LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Optical Flow from AVI file

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.

Download All
0 Kudos
Message 1 of 4
(3,288 Views)

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.

0 Kudos
Message 2 of 4
(3,251 Views)

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:

 

AVI Motion Flow

0 Kudos
Message 3 of 4
(3,214 Views)

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

Download All
0 Kudos
Message 4 of 4
(2,979 Views)