Hi,
I am not sure how image coordinates are interpreted in OpenCV. I hope you guys can help me out.
I understand that the origin of the coordinate system is in the top left corner of the image, but I did not yet find a definite answer to the question, if integer coordinates fall on the top left border of a pixel or on its center.
I ran cv::aruco::interpolateCornersCharuco( ... )
and cv::findChessboardCorners( ... )
on the same ChArUco board and the results were inconsitent. The former suggests that the coordinate grid lies on the pixel borders, the latter, that it lies in the center of the pixels. The drawing functions (like cv::circle( ... )
also suggest the center of the pixels. I’m all the more confused, as cv::aruco::interpolateCornersCharuco( ... )
and cv::calibrateCamera( ... )
seem to both use cv::solvePnP( ... )
without modulating the coordinates. Maybe I oversaw something, but this suggests to me, that the functions would yield inconsistent camera parameters for the same input images.
For camera matrices the question translates to: Is the principle point for a perfect pinhole camera ( img_width / 2, img_height / 2 )
or ( (img_width - 1 ) / 2, (img_height - 1 ) / 2 )
. For the simplest case of a point on the optical axis, one can determine, that for the former, the projection would be in the center of pixel border coordinate system and for the latter it would be in the center of the pixel center coordinate system.
Cheers,
Jo