Ask Your Question

B-money's profile - activity

2016-02-12 21:55:58 -0600 commented answer Rotating target changes distances computed with solvePnP

@augustt198 Ran into the same issue here, took my first point (which is assumed to be the top left or top right from the contour detection) and the centroid of the contours. If the first point fell to the right of the centroid you need to flip the array so you start at the top left.

Next, I looked at the second and last point to determine if the points were going clockwise or counterclockwise. If the y of the last point was less than the second point then the order needs to be swapped retaining the first point.

After both were done the points were ordered from top left and going clockwise. Also note that I defined all 8 points not just the outer 4 corners.

Alternatively you can detect these two cases and pass in altered versions of the target descriptor to compensate

2016-02-08 12:08:44 -0600 commented question Rotating target changes distances computed with solvePnP

Looking at the rotation vector you rendered in the second image it appears to shift the normal from toward the screen to straight up. I am also working on the same problem (although in python) and noticing the same issue even when describing the whole U shape rather than the bounding corners.

2016-02-07 12:49:48 -0600 answered a question Rotating target changes distances computed with solvePnP

First thing I see is that your target is not square