Question

I am trying to calculate by how much an object has moved in each consecutive image captured from a stationary camera. What we're testing here is the repeatability of our setup to place an object in the same place each time.

The object in question has a stamp placed on its center that has a simple shape on it (see below). The camera only has a view of a few square millimeters(~25). There might be other artifacts in the image that will need to be cleared up, but all I can show currently is just a simple drawing.

Template

What I am trying to calculate is the offset of where the lines intersect in each image compared to the previous one. In the picture below, the red lines represent where the lines intersect in the 2nd image, ie. how far they have moved.

Problem

My question is, using an image recognition C# library, preferably EmguCV, how can I calculate the dimensions of the green rectangle(the offset)? I have followed a few of Emgu's tutorials, and through canny conversions the software is able to detect just the two lines, but I am clueless as to how to get where they intersect as the library creates over 500 mini lines instead of 2 long ones.

Any help, ideas, and suggestions are appreciated. Thanks!

Was it helpful?

Solution

As a side note, if you're doing a lot of pixel twiddling, you may want to seriously consider the use of the 'unsafe' attribute - this will stop the runtime from validating each subscriped access to the pixel array, which will get you back into native performance range - otherwise, your algs will run very slooowwwwwwllllllyyyyyy :-)

OTHER TIPS

You'll want to look into "image tracking" algorithms, like for example the mean-shift algorithm: http://en.wikipedia.org/wiki/Mean-shift.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top