Ask Your Question
0

Corresponding points in two matched contours

asked 2016-04-03 08:43:21 -0600

Radu Hobincu gravatar image

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:

  1. Transform the second contour (by resizing and rotating it) so it best overlaps with the first one.
  2. 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.

edit retag flag offensive close merge delete

Comments

may be here

LBerger gravatar imageLBerger ( 2016-04-04 02:32:06 -0600 )edit

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.

StevenPuttemans gravatar imageStevenPuttemans ( 2016-04-04 03:33:51 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-04-04 13:23:43 -0600

Radu Hobincu gravatar image

Thank you! I'll have a look this week.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-04-03 08:43:21 -0600

Seen: 301 times

Last updated: Apr 03 '16