Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying Optical Flow from AVI file

Solved!
Go to solution

Hi,

 

I am tring to display optical flow vectors from an .AVI file. I am working from the example "Optical Flow.vi". I cannot get the optical flow vectors to display. To test whether I have the right image formats, I have set up displays on the front panel for the "current frame" and "previous frame", which are the inputs to the optical flow calculator. At the bottom of these image displays it is possible to see the image type. For some reason the "previous frame" image keeps changing its image type on different loop iterations. In the current setup it is an 8-bit grayscale (as it should be) for the 1st 5 iterations, and then changes to a blank HSL image. I cannot understand why this is happening. I assume this is the reason the optical flow vectors are not displaying correctly.

 

Any help would be greatly appreciated!

 

Thanks,

 

Oscar.

0 Kudos
Message 1 of 3
(4,753 Views)
Solution
Accepted by topic author oscar_m

Your image allocation is messed up.  You have to remember they are pointers, not data.  You need to use IMAQ copy to copy current image to previous image instead of feeding it into the shift register.  You probably need another image for the destination image when you convert your AVI image to grayscale.  Right now you are converting the original AVI image, so the next time you read the AVI it forces it to match the image format (grayscale).

 

Bruce

Bruce Ammons
Ammons Engineering
Message 2 of 3
(4,746 Views)

Thanks Bruce!

 

I'm new to LabVIEW and still getting my head around things like shift registers. That makes a lot of sense and I changed it to use the IMAQ image copy and it worked!

 

Thanks for your help and the quick reply!

 

Regards,

 

Oscar.

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