I am trying to find a simple algorithm for finding a match between two sets of 2D points (registration). One set contains the template of the object that I would like to find, and the second set 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 about 40 points in 2D . The second set is the homography of the first set (translation, rotation and perspective transformation).
I am interested in finding a registration algorithm to get a point match. I will use this information to find the conversion between the two sets (all this in OpenCV).
Can anyone suggest an algorithm, library, or a small bit of code that could do the job? Since I am dealing with small sets, this should not be super optimized. Currently my approach is a RANSAC-like algorithm:
- Select 4 random points from set 1 and from set 2.
- Computing transformation matrix H (using openCV getPerspective ())
- Warp the 1st set of points using H and check how they match with the second set of points
- Repeat 1-3 times and select the best transformation according to some metric (for example, the sum of squares).
Any ideas? Thanks for your input.
source
share