Camera info in ros topic after changing the height and width have large difference in fx and fy , why does this happen

header:
seq: 2065
stamp:
secs: 47
nsecs: 783335825
frame_id: “carter_camera_stereo_left”
height: 480
width: 640
distortion_model: “pinhole”
D:
K: [732.999267578125, 0.0, 320.0, 0.0, 978.8427124023438, 240.0, 0.0, 0.0, 1.0]
R: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
P: [732.999267578125, 0.0, 320.0, 0.0, 0.0, 978.8427124023438, 240.0, 0.0, 0.0, 0.0, 1.0, 0.0]
binning_x: 0
binning_y: 0
roi:
x_offset: 0
y_offset: 0
height: 0
width: 0
do_rectify: False

The fx and fy values represent the focal length of the camera in the x and y directions and expressed in pixel units. These values are related to the camera’s field of view and the size of the image sensor.

When you change the image size, the relationship between the field of view and no. of pixels in the image changes, which affects the focal length values. If the aspect ratio of the new image size is different from the original aspect ratio, the difference between fx and fy will be more significant.

To maintain the correct camera calibration, you should recalibrate your camera after changing the image size. This will ensure that the fx and fy values are accurate for the new image dimensions.

You can use the ROS camera calibration tools, such as the camera_calibration package, to perform the calibration.

1 Like