Corresponding points in two matched contours
Hello,
First of all, I just starting using OpenCV, so I'm sorry is the answer is obvious, I tried searching for a solution as well as studying the API, but I'm not making any progress.
I'm working on writing an application that needs to check if certain measurements of an item in a photo are correct. To be concise, having two contours that match reasonably well and having a point p on the first contour, I need the corresponding point on the other contour.
I was thinking that one way of trying this is this:
- Transform the second contour (by resizing and rotating it) so it best overlaps with the first one.
- Given the point p in the first contour, use
pointPolygonTest
to compute the distance between p and the second contour.
However I'm stuck because the matchShape
function only gives me information regarding the match quality and not how to overlap the contours. So the question is: how do I transform a contour so it best overlaps with another contour?
Thanks, R.
may be here
You will need a registration procedure of shape 1 to shape 2. However my own experience is limited in this field... but I am guessing that the shape module already has most of the needed functionality.