Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

RANSAC and 2 point clouds

I have 2 point clouds in 2D and I want to use RANSAC to determine transformation matrix between them. I have no pairs of points, just 2 sets of points. How can I do this in OpenCV?

RANSAC and 2 2D point clouds

I have 2 point clouds in 2D and I want to use RANSAC to determine transformation matrix between them. I have no pairs of points, just 2 sets of points. How can I do this in OpenCV?


I tried to write ransac-like scheme for my purposes.

  1. Get 4 random points from 1st set and from 2nd set.
  2. Compute transform matrix H using getPerspectiveTransform.
  3. Warp 1st set of points using H and test how they aligned to the 2nd set of points using some metric(I don't know what metric I should use I tried sum of min distance for all points in 1st set, but it seems it's not work good if points group together after transform)
  4. Repeat 1-3 N times and choose best transform according to metric.

maybe I should use different metric?

Also I have idea that I can match points using shape context algorithm and only then use RANSAC(or some other algorithm) to determine transformation.