I want to draw 3D Positions in a webcam Image using OpenCV’s projectPoints function. During testing I noticed, that I always have a certain offset from the real object. This is most obvious when trying to project the origin (0,0,0) to the image center.
The image shape is (2988, 5312, 3), the big red dot is the image center at (1494, 2656) and the small red dot with the lines attached is the projection of the origin (0,0,0) with NO translation and NO rotation leading to (1476, 2732).
The main question: Why is the projected point not in the middle of the image?
I determined the projected point like so:
origin_2d, jacobian = cv2.projectPoints(
np.array([(0.0, 0.0, 0.0)]),
np.array([(0.0, 0.0, 0.0)]),
np.array([(0.0, 0.0, 0.0)]),
mtx,
dist,
)
So the origin (0,0,0) should be projected to 2D with no translation and no rotation and thus appear in the image center, right?
I obtained the camera mtx and dist by executing a camera calibration routine as described here https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html using the chessboard you see in the image. Is there something wrong with my calibration? Or am I misunderstanding something in the projection process?
Thanks and best regards, Felix