First time here? Check out the FAQ!

Ask Your Question
0

How does resizing an image affect the intrinsics?

asked May 21 '17

stillNovice gravatar image

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.

Preview: (hide)

2 answers

Sort by » oldest newest most voted
0

answered May 21 '17

LBerger gravatar image

updated May 21 '17

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

Preview: (hide)

Comments

Explained perfectly. thank you!

stillNovice gravatar imagestillNovice (May 21 '17)edit
0

answered Jun 18 '19

r7vme gravatar image

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[0]*=scale_x
K[1]*=scale_y
Preview: (hide)

Comments

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?

Massimo gravatar imageMassimo (Jul 4 '19)edit

Question Tools

3 followers

Stats

Asked: May 21 '17

Seen: 9,252 times

Last updated: May 21 '17