Ask Your Question
1

Are camera calibration files resolution agnostic?

asked 2016-08-23 21:45:23 -0500

Cerin gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-08-24 02:08:14 -0500

NEngelhard gravatar image

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).

edit flag offensive delete link more

Comments

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?

Cerin gravatar imageCerin ( 2016-08-24 09:19:22 -0500 )edit

"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)

NEngelhard gravatar imageNEngelhard ( 2016-08-24 17:15:14 -0500 )edit

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?

Cerin gravatar imageCerin ( 2016-08-24 18:38:46 -0500 )edit

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?

NEngelhard gravatar imageNEngelhard ( 2016-08-25 14:55:34 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-08-23 21:45:23 -0500

Seen: 383 times

Last updated: Aug 24 '16