Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Optical Flow and setting Offset make Not an Image

Hi all,

 

What I'm trying to accomplish is taking only a few hundred rows from a camera sensor to improve frame rate and moving the offset around based on movement in the image.

 

I am utilizing configure grab and grab in a loop to improve refresh rate.

 

I set up a test where the offset in Y was just incremented each loop and displayed the image. This is no problem. I have the incrementor as a remainder output and it will loop all day without error, and the image 'scrolls' across the available sensor space.

 

When I use optical flow (or point LK algorithm), with no incrementation, and just moving the camera around, optical flow has no problem. It will run all day. Also, the output is correct when I take care to set up the algorthim.

 

However, when I put the incrementation of the offset and the optical flow together, there is a problem. I expect the optical flow to return a vector similar to my incrementation. Instead, the program exits with a 'Not an Image' in the input of the optical flow block. Indeed, if I put a probe down the image does not appear.

 

The weird thing is this: for some increments it runs no problem. If I increment 10 rows at a time, no problem. If 8 or 9 or 1 for example, it crashes with 'Not An Image'. If I feedback the output of the optical flow vector into the offset change, the program will run until the distance of the vector in one of the X or Y directions happens to be one of these 'unhappy' numbers.

 

I also don't understand why 'Grab.vi' is returning an empty image when connected to optical flow, but with an image output without optical flow the image is never empty.

 

 

 

 

0 Kudos
Message 1 of 4
(4,614 Views)

Hi,

 

Please share your code if possible. This would be helpful to better understand your code flow and make recommendations accordingly.

 

Also for your reference, here is also a link to a forum regarding optical flow:

 

http://forums.ni.com/t5/Machine-Vision/Displaying-Optical-Flow-from-AVI-file/m-p/2738890

 

Luis S
Application Engineer
National Instruments
0 Kudos
Message 2 of 4
(4,585 Views)

Hello, 

      I want to know if I can use the Optical flow.vi in a real-time systerm? I  have tried my best to do that. But it didn't work. Can you help me?

Change the world
0 Kudos
Message 3 of 4
(4,077 Views)

Usually, you can change code around to implement on a Real Time operating system. What have you tried? If you post code, or at least show screenshots, we will get a better understanding of what you have already tried and we can see what we can do to help out! Thanks!

Douglas Choisnet
0 Kudos
Message 4 of 4
(4,058 Views)