Motion detection by comparing edges of two images

asked 2014-11-05 00:25:12 -0500

I am searching for a method to detect motion by comparing edges of adjacent frames. I wan to do this using openCvSharp. Any idea about how to do this?

edit retag flag offensive close merge delete


Users of OpenCV typically tend to detect motion by comparing feature points (also called key points). Link to documentation. A theoretical argument for favoring feature points as an approach to tracking is provided in the paper "Good Features to Track", by Shi and Tomasi, CVPR 1994. Other tracking mechanisms are possible, but it would require one to look at sample images to evaluate whether those other mechanisms would be sufficient or efficient compared to feature point tracking.

rwong gravatar imagerwong ( 2014-11-05 01:44:59 -0500 )edit

just curious - why edges ?

berak gravatar imageberak ( 2014-11-05 06:44:25 -0500 )edit

And besides that OpenCvSharp is not an officially supported package, which makes it difficult to give good info. They do not wrap all existing functionality. Why use C# interface and not a supported C++ interface?

StevenPuttemans gravatar imageStevenPuttemans ( 2014-11-05 06:50:54 -0500 )edit

@berak: just my guess - tracking by edges are commonly employed in industrial vision applications for tracking machine parts, because machine parts don't often have feature points (unlike our everyday living environment) but often have plenty of edges. Also, 1-D position detection is used a lot. 1-D position detection applications do not require the 2-D localizability that was highlighted in the CVPR 1994 paper by Shi and Tomasi.

rwong gravatar imagerwong ( 2014-11-05 14:47:55 -0500 )edit

@asanganuwan: For clarification. If you want to track by edges, it is necessary to show some sample images to help formulate a strategy. Tracking by feature points are almost universally applicable - there are few situations where it would not work. Whereas, tracking by edges are almost always application-specific - you must design a "line template" that describes the spatial arrangements of edges you want to track. You can see that most industrial vision tracking tools have GUI front-ends that allow one to define shape templates for the machine parts. Different machine parts also tend to have different trajectories, and these trajectories are used by the algorithm to confine the motion of the parts (in other words, trajectories must be provided to the algorithm by the users).

rwong gravatar imagerwong ( 2014-11-05 14:59:44 -0500 )edit