Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SolvePnP With Hidden Points

Given a calibrated image containing a rectangle whose real-life coordinates I know, I can easily find the transformation between the camera coordinates and the image coordinates. However, I can't figure out how to compute the pose of the rectangle when one edge of it (and thus, two vertices) are out of the frame: image description

Intuitively, this seems like it should be possible: given the two points of the rectangle that are in view, the angles of the two partial edges, and the known dimensions of the rectangle, I think there's enough information to get the pose. However, solvePnP (or findHomography) requires >2 points, and I haven't been able to find any similar algorithm that works with lines instead of points.

I considered trying to calculate the image coordinates of the two missing points to pass to solvePnP, but as far as I can tell, determining the would-be image coordinates of the missing line of the rectangle would essentially require me to already know the homography I'm trying to compute.