Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

vision based motion detection

I am working on a project for school where I intent to use a usb webcam(mounted on a lego mindstorms based turret) to track motion and cause the turrent to follow that motion. As far as the mindstorms control, I have that working great. I also have my logitech quickam working with LABView and are able to import video from it fine. My problem lies in getting the cam to detect motion. I have tried to take a series of still shots and subtract the latter from the former usinng a modified version of the vision add example and have been unsucessful thus far. I guess the next step after that would be to convert the image to an array (2-d) of pixels and determine the highest intensity in the array and determine which direction from the center pixel it lies. I think I have bitten off a little more than I can chew with this project and any advice, example code, or direction would be appreciated.

Steve
0 Kudos
Message 1 of 7
(6,466 Views)
I have had some success since my post. I am able to take two images and subtract them and find the centroid of that image. Now just to get that to work near "real time"
0 Kudos
Message 2 of 7
(6,458 Views)
Hi Steve!

We have done some video motion tracking for a tactical surveillance application. A very simple method of motion tracking would be to use a simple pattern match. However, I assume that you are using the Lego Mindstorm toolkit for LabVIEW? I am not sure, if you have a pattern match.vi available there.
You may also look into image correlation, or correlation tracking. Some other common tracking methods are:
  • Blob tracking: Segmentation of object interior or block based correlation
  • Kernel-based tracking (Mean-shift tracking): An iterative localization procedure based on the maximization of a similarity measure 
  • Contour tracking: Detection of object boundary (e.g. active contours or condensation algorithm)
  • Visual feature matching using registration
In any case, tracking is not a trivial task, unless the image conditions are ideal. (Black dot on white background or etc.)

Using a pan-tilt setup for tracking you should also consider implementing a PID algorithm. Another thing to consider is that you have to adjust the tracking speed based on the distance of the object to the camera, or based on the field of view or zoom position, if applicable.

I hope this gives you some additional pointers.

Kind Regards,
Markus Tarin

0 Kudos
Message 3 of 7
(6,440 Views)
Epsilon,
      Thanks for your reply. The matter seems to be quite a bit more complicated then originally expected. Since my project does not neccesarilly have to work I will just demonstrate LABView control (using labview toolkit)  and give a static example of the black dot subtraction. I will probably pursue this project in more detail next semester but with better video equipment. and without the mindstorms.I will save you message and explore those topics at that time. Again, thanks much.


Steve
0 Kudos
Message 4 of 7
(6,433 Views)

It's very good about your points. Did you ever try to track one point in moving project, such as convex point in moving hand?

Do you have some ideas? THKS! 

0 Kudos
Message 5 of 7
(5,370 Views)
Optical Flow is also suitable for motion detection. You will get a vector field indicating the movement for the image pixels. But one will still face the challenge to identify the moved image parts. In the school project one has the challenge that first something is changing in the image (can be well detected with optical flow) and when the robot starts to follow it this image part will change only little while the rest of the image will "flow out" all the time (think of starfield screensaver).
0 Kudos
Message 6 of 7
(5,286 Views)

Thank you for replying. I will use the position got from the USB Camera to control motion later. But, I'm getting troubles about image acquiring and processing. I will attached my code. Can you help me see where is my problem. I used the USB Camera. 

Thank you very much! 

Download All
0 Kudos
Message 7 of 7
(5,278 Views)