02-12-2014 11:00 AM
Hi,
I am trying to calculate and display the optical flow field from a .AVI file. I am working from the example Optical Flow.vi, however I cannot get it to work and am getting a 'IMAQ Vision: Incompatible image size error' on the optical flow function box. As far as I can see the 2 image inputs to the optical flow function are both in 8-bit greyscale format as they should be.
I am using my own greyscale conversion sub vi but this is again taken from one of the examples. I've included both the vi's as well as the .avi file im using. Hopefully someone can point out where I've gone wrong.
Thanks,
Oscar.
02-13-2014 07:31 AM
Update:
I've managed to get rid of the error messages by setting the image 'Previous Frame Grey' to the first image of the .AVI file. However I still cannot get the optical flow vectors to display.
02-14-2014 11:32 AM
Hi Oscar,
I've had a quick look at your code and although I can't identify the exact reason why it's not working I have spotted a few things.
If I scroll the image I see the vectors appear briefly, so I think the image might be getting ovewritten somehow after the motion flow overlay is drawn
Also, I'm not sure a dedicated Grayscale conversion sub VI is needed, and yours creates a new image reference every time it runs which isn't ideal as it will continue to allocate more memory.
I think maybe a more linear flow of code may help combat your issues, I've written a quick VI that implements motion flow from an AVI, it seems to work fine with the AVI files I tested, so hopefully this might help:
03-04-2015 12:49 AM - edited 03-04-2015 12:50 AM
Hi Adam
I am having the same problem with the velocity vectors not getting displayed however i am using ar drone video feed and trying to compute optical flow. I have attached the VIs. Please help