0
votes

I am confused about the opencv camera calibration coordinate transformation. I used the example code to calibrate my camera, and I got this result:

enter image description here

When I use this camera matrix to multiply a point in camera coordinate system, say P = [50, 50, 1.35], the output result is too big which is impossible to be a pixel coordinate. What's is wrong here ? Did I miss something ?

The image is 1920 x 1080. This is the chessboard configuration file information:

enter image description here

1
It is totally possible to project a point that will not be inside the image. You choose a ratio between X and Z (or Y and Z) that is very big. It is like I want to project a point that is 1.5 m away from the camera in Z but that is 50 m away in X and Y...Catree
@Catree I don't quite understand what you say by "You choose a ratio between X and Z (or Y and Z) that is very big. "Johnnylin
This post explain very well the process stackoverflow.com/questions/12299870/…damianodamiano
@DamianoDamiano, Thanks for the post. I understand's the process. But I cannot figure out why this multiplication fails to project P = [50, 50, 1.35] this point. I think something is missing.Johnnylin
There is no problem with the multiplication, you can find here more information in the OpenCV documentation. Your point P is X=50, Y=50, Z=1.35 in the camera frame. The Z axis is going forward, the X axis is going to the right and the Y axis is going to the down. Now read again my analogy. Again, there is no need for a mathematically projected point in the camera frame to be inside the image. It is the same like a camera and your point P is not visible by the camera.Catree

1 Answers

3
votes

You can find in the OpenCV documentation the different equations for the perspective projection model, also illustrated in the following pictures (thanks to this link).

Camera model

Assuming a point P=(X,Y,Z) in the camera frame Fc, its coordinate in the normalized camera frame is:

x' = X/Z
y' = Y/Z

And its projection onto the image plane (assuming no distortion):

u = fx * x' + cx
v = fy * y' + cy

With fx and fy the focal length in pixel and cx, cy the coordinate of the principal point in the image.

In your case, your Z is at 1.35 away from the camera but the 2 other coordinates are way too far compared to the Z coordinate.

There is no problem mathematically, it is just that your point P is not visible for your camera.