Ask Your Question

Revision history [back]

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