Calibration of a stereo camera with images 352x288 p.

asked 2018-04-14 09:24:38 -0500

DenisN03 gravatar image

When you perform the calibration of the stereo camera on images with a resolution less than 640x480, large errors are obtained. For example, using images with a resolution of 352x288 p. the errors are:

done with RMS error=5.28809
average epipolar err = 4.12764

If I use the same images but with a resolution of 640x480 then the errors are the same:

done with RMS error=0.322039
average epipolar err = 0.280778

Result of calibration with the resolution of 352x288 images. For calibration use the program stereo_calib.

Why do different resolutions produce different errors? Is it possible to calibrate cameras with a resolution of less than 640x480?

image description

edit retag flag offensive close merge delete


I don't know what requirements you need to meet for error and depth, but you need to budget your accuracy through each step of your application's image pipeline. Here's what I do: I calibrate my cameras at the maximum resolution they will support. When I run an application which needs to use the calibration/depth map, I pyramid down (linear interpolate) the left and right images to the lowest resolution which will meet my application's requirements, to reduce the processing time and latency.

Another observation, the interesting scene should fill our field of view. You're using a very small portion of your image as a region of interest. Can you use longer focal length lenses, or move your cameras physically closer to the objects of interest? You will get much higher accuracy that way.

opalmirror gravatar imageopalmirror ( 2018-04-16 14:19:20 -0500 )edit

@opalmirror, this means you can calibrate on resolutions with large sizes, and in the future work use a lower resolution? Does this mean that the calibration matrices do not depend on the original image resolution?

DenisN03 gravatar imageDenisN03 ( 2018-04-20 03:15:39 -0500 )edit

The resolution change does change some matrix cells, but it's scalar pixel scaling. If your calibrated image height and width is h, w, the 3x3 camera intrinsics matrix K:

     [fx  0 cx]
 K = [ 0 fy cy]
     [ 0  0  1]

and T is the 1x3 Translation matrix for the second stereo camera, then (pseudocode):

y_scale = h' / h
x_scale = w' / w
K' = K
K'[0][0] *= x_scale  // fx
K'[0][2] *= x_scale  // cx
K'[1][1] *= y_scale  // fy
K'[1][2] *= y_scale  // cy
T' = T
T'[0][0] *= x_scale  // x_off
T'[0][1] *= y_scale  // y_off

Since I'm usually using ROS as a library level above opencv, it's only a general approach. I can in this way use camera information from calibration from one imager resolution, at a different imager resolution.

opalmirror gravatar imageopalmirror ( 2018-04-20 13:52:18 -0500 )edit