From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining position using camera movement

I am trying to do a project which is similar to the working of an optical mouse. So my robot will be having a camera pointing downward and I will be acquiring images from that camera in labview. What I need is that based on the comparision of the previous and the current image, my robot should provide me with the distance it has travelled. I know that it has something to do with the pattern matching and pattern shift of both the images and then that would somehow provide me with the distance but what I dont know is how to implement that in labview as i am new. Any help in form of a solution to this problem or some tutorials that would help building this sort of example is much appreciated. Thanks

0 Kudos
Message 1 of 6
(4,683 Views)

What you are looking at implementing is called Optical Flow.  Newer version of LabVIEW include it in the Vision module.  You will need sufficient texture in the camera FOV to get good results.

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 2 of 6
(4,669 Views)

Hey thanks, I was searching for what its actually called Smiley Happy. So the technique is pretty clear to me now of how it overlays the velocity vectors on the images but is it possible to actually use those velocity component to calculate the shift in image ie the distance travelled by  the robot? Sorry for being noob here.

0 Kudos
Message 3 of 6
(4,661 Views)

Yes.  The distance that the vectors travel can be had in an array.  If you strip out the upper and lower 20%, and average the rest (in X and Y), you should have a fairly accurate distance count in pixels.  To get reall world measurements, you can calibrate the camera image, and figure out what one pixel equals in real distance.

 

I think rotation can also be measured.

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
Message 4 of 6
(4,643 Views)

Thanks. So I tried implementing it but there seems to be an error and most frustating is that the labview cant detect what the error is. So I am taking video feed from ar drone and using lk method but it seems that the velocity components are not returning anything. I thought that the optical flow works on grayscale images only so i tried casting the image source to grayscale but that too doesnt seem to work.Smiley Sad. What to do?

Download All
0 Kudos
Message 5 of 6
(4,631 Views)

Sorry for the above post. I have figured out that using ar drone's botttom camera is not very efficient and now i will be using a wifi camera below ar drone to compute optical flow which is much more responsive and faster.

0 Kudos
Message 6 of 6
(4,621 Views)