I have a fixed camera with known cameraMatrix
and distCoeffs
. I also have a chessboard which is fixed too, and transform
and rotation
vector are also calculated using solvePnP
.
I'm wondering how is possible to get 3D location of a 2D point on the same plane that the chessboard is located, like the picture below:
One thing for sure is that the Z of that point is 0, but how to get X and Y of that point.
You can solve this with 3 simple steps:
Step 1:
Compute the 3d direction vector, expressed in the coordinate frame of the camera, of the ray corresponding to the given 2d image point by inverting the camera projection model:
Step 2:
Compute the 3d direction of the vector of this ray in the coordinate frame attached to the chessboard, using the relative pose between the camera and the chessboard:
Step 3:
Find the desired 3d point by computing the intersection between the 3d ray and the chessboard plane with Z=0: