Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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

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

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 descriptionimage 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

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

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

click to hide/show revision 4
retagged

updated 2014-03-20 03:38:20 -0600

berak gravatar image

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

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