Ask Your Question
0

How does resizing an image affect the intrinsics?

asked 2017-05-21 14:37:11 -0600

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.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-05-21 14:46:37 -0600

LBerger gravatar image

updated 2017-05-21 14:49:48 -0600

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

edit flag offensive delete link more

Comments

Explained perfectly. thank you!

stillNovice gravatar imagestillNovice ( 2017-05-21 15:16:24 -0600 )edit
0

answered 2019-06-18 13:07:47 -0600

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
edit flag offensive delete link more

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 ( 2019-07-04 07:34:11 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2017-05-21 14:37:11 -0600

Seen: 8,729 times

Last updated: May 21 '17