# How does resizing an image affect the intrinsics?

Hi there, i have calibrated a camera using images at 1280 * 720. the intrinsic data is:

<cameraResolution>
1280 720</cameraResolution>
<camera_matrix type_id="opencv-matrix">
<rows>3</rows>
<cols>3</cols>
<dt>d</dt>
<data>
6.5700301862152855e+02 0. 6.4669706479436286e+02 0.
6.5700301862152855e+02 3.4711751174913059e+02 0. 0. 1.</data></camera_matrix>


So the focal length is:

657.003018


and the center pixels are:

cx = 646.69706
cy = 347.11751


Now, to speed up my algorithm, I have resized the images by half, to give a resolution of:

640
360


My question is, how do I need to adjust my intrinsic matrix to match? I assume i need to half the cx and cy values, but the focal stays the same? Is this correct?

Thank you.

edit retag close merge delete

Sort by » oldest newest most voted

657.003=a then a = f . m where f is focal length in meter and m number of pixel by meter (inverse of pixel size). if you have resize the images by half it means pixel size is double then a becomes 328.5 (ref. multiple view in geometry p157)

resize means using opencv function and not changing resoultion using method set of videocapture class

more Just a bit extension of answer of @LBerger for case with changed aspect ratio.

Let's say you have resized image (cv2.resize) and changed aspect ratio. e.g. was 1242 x 375 now 512 x 256. Then you need to multiply first row (x) with width scale scale_x = 512 / 1242 and second row with height scale scale_y = 256 / 375

With numpy

K*=scale_x
K*=scale_y

more

According to the documentation, radial (k1, k2) and tangential (p1, p2) distortion coefficients remain unchanged in case of a change of resolution (one that preserves aspect ratio, I guess). What happens to distortion coefficients if aspect ratio changes too? Are they still left unaltered? And what about distortion coefficients when the fisheye camera model is used?

Official site

GitHub

Wiki

Documentation