0

As I understand OpenCV's coordinate system, as in this diagram. enter image description here
The left camera of a calibrated stereo pair is located at the origin facing the Z direction.

I have a pair of 2464x2056 pixel cameras that I have calibrated (with a stereo rms of around 0.35), computed the disparity on a pair of images and reprojected this to get the 3D pointcloud. However, I've noticed that the Z axis is not in line with the optical centre of the camera.

This does kind of mess with some of the pointcloud manipulation I'm hoping to do- is this expected, or does it indicate that that something has gone wrong along the way?

Below is the point I've generated, plus the axis- the red green and blue lines indicate the x,y and z axes respectively, coming out from the origin. enter image description here

As you can see, the Z axis intercepts the pointcloud between the head and the post- this corresponds to a pixel coordinate of approximately x = 637, y = 1028 when I fix the principal point during calibration to cx = 1232,y=1028. When I remove the CV_FIX_PRINCIPAL_POINT flag, this is calculated as approximatly cx = 1310, cy=1074, and the Z axis intercepts at around x=310,y=1050.
Compared to the rectified image here where the midpoint x = 1232,y=1028 is marked by a yellow cross, the centre of the image is over the mannequin had, the intersection between the Z axis is significantly off from where I would expect. enter image description here

Does anyone have any idea as to why this could be occuring? Any help would be greatly appreciated.

Jack
  • 101
  • 2
  • Why should the Z axis intercept "the pointcloud" elsewhere ? And why do you define pointcloud with only x and y ? If I understood correctly your first image, this is a 3D reconstruction from two camera. Thus it is not the projection of the 3D points on the screen like your second image which is the result of the projection. – T.Lucas Jan 30 '19 at 10:25
  • @T.Lucas Apologies, when I refer to the x and y coordinates I'm refering to the point in the pointcloud that is generated from the pixel x,y in the disparity image. As the princpal point of the left camera should be at the origin, and the camera is facing in the Z direction (i.e. the pixel at the optical center is looking along the Z axis), the z axis should intersect with the point in the pointcloud corresponding to the rectified image at ~x=1232,y=1028 – Jack Jan 30 '19 at 11:39

0 Answers0