views:

101

answers:

2

Hello friends,

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!

A: 

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

Protector one
+1  A: 

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 :-)

Mark Mullin
Thanks for the side note
Luis Filipe
you're welcome - glad to help
Mark Mullin
I am hoping to avoid rewriting stuff myself as I am sure what I am trying to do is possible with EmguCV or another image-fiddling library. But I will keep this in mind should I go that way. Thanks
Dinoo