I am trying to find a simple algorithm to find the correspondence between two sets of 2D points (registration). One set contains the template of an object I'd like to find and the second set mostly contains points that belong to the object of interest, but it can be noisy (missing points as well as additional points that do not belong to the object). Both sets contain roughly 40 points in 2D. The second set is a homography of the first set (translation, rotation and perspective transform).
I am interested in finding an algorithm for registration in order to get the point-correspondence. I will be using this information to find the transform between the two sets (all of this in OpenCV).
Can anyone suggest an algorithm, library or small bit of code that could do the job? As I'm dealing with small sets, it does not have to be super optimized. Currently, my approach is a RANSAC-like algorithm:
- Choose 4 random points from set 1 and from set 2.
- Compute transform matrix H (using openCV getPerspective())
- Warp 1st set of points using H and test how they aligned to the 2nd set of points
- Repeat 1-3 N times and choose best transform according to some metric (e.g. sum of squares).
Any ideas? Thanks for your input.
cv::findHomography
requires that the two points sets (srcPoints and dstPoints here) correspond. I am interested in finding out how to find that correspondence, i.e. which points in the source point cloud correspond to which points in the destination point cloud. The RANSAC approach still needs a reasonable amount of inliers. Simply passing two uncoordinated point clouds will not work. – Earing