How to find the best match between two curves, part-to-whole

asked 2014-03-19 14:07:14 -0500

Isa gravatar image

updated 2014-03-20 03:38:20 -0500

berak gravatar image

Hey all

I'm currently facing the following problem:

given: two curves, both approximated by sample points. One of them is slightly bigger than the other, in my case, the small curve has 20 sample points and the large one 25. They are not uniformly distributed, but the sample points are in a certain range (-> point x1 in range 0-9, point x2 in range 10-19 etc)

what I need: The best match between the two curves under the assumption that the small curve is a subset of the bigger curve.

I thought about a sliding-window algorithm, but I don't know how to make it rotation invariant. I need only translation and rotation, no scaling.

I already tried

estimateRigidTransform(Mat pointSetA, Mat pointSetB, bool fullAffine)

but this works only with point sets that are of equal size and the pairs of points must be corresponding (x1 with y1, x2 with y2, etc).

findHomography()

is no option, because it also calculates the perspective transform which I don't need.

Here is an image for clarification:

image description

(The image is only a sample, I didn't count the points..)

Does anyone know an elegant algorithm for this? Or any ideas how to write my own?

Thanks in advance for any help! Isa

edit retag flag offensive close merge delete

Comments

Did you try Hausdorff distance ?

bvbdort gravatar imagebvbdort ( 2014-11-20 11:00:07 -0500 )edit