0
$\begingroup$

Rosanswers logo

Are the calibration parameters, generated by cameracalibrator.py, portable across arbitrary camera resolutions?

I'm attempting to calibrate a Raspberry Pi camera following the monocular camera calibration tutorial. The process seemed to complete flawlessly.

However, I ran the calibration routine with the image resolution at 640x480. Normally, I run the driver at 320x240 resolution to limit CPU. Can I use the same calibration parameters for 320x240 or do I need to re-run the calibration routine for that resolution and use a separate calibration file?


Originally posted by Cerin on ROS Answers with karma: 940 on 2016-08-23

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The distortion coefficients do not change if you apply a binning to your image (e.g. to go to a quarter of your resolution). The camera matrix of course changes as it's the conversion from meters to pixels and your right most pixel suddenly is now in column 320 instead of 640. ROS already provides some nice functions that are implemented in image_geometry::PinholeCameraModel. In your case, initialize the class with your 640x480 calibration (with binning_x and binning_y set to 2 to get to your QVGA resolution).


Originally posted by NEngelhard with karma: 3519 on 2016-08-24

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Cerin on 2016-08-24:
I'm confused. As is, are you saying it will work on won't work? When I view the 320x240 stream using image_view with the 640x480 calibration file, it looks fine. What component is interpreting pixels as meters?

Comment by NEngelhard on 2016-08-24:
"What component is interpreting pixels as meters?" The camera matrix converts a position (in meters) to pixels and therefore depends on the used resolution. So you don't need to recalibrate your camera but you have to adapt your calibration (or use the image_geometry-class)

Comment by Cerin on 2016-08-24:
That's still not making any sense to me. Maybe I'm not asking the right question. When I access my video stream, I'm getting JPEGs, and the images look fine. Where in the JPEG does it store the camera matrix and why would I care that this matrix isn't converting meters to pixels correctly?

Comment by NEngelhard on 2016-08-25:
The intrinsic matrix is not stored in the JPEG (although focal length could be given in an EXIF header). " why would I care that this matrix isn't converting meters to pixels correctly?" ??? Why would you ask if they are resolution agnostic if you don't care?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.