0
$\begingroup$

I have a 3x3 matrix inside a calibration file that has the intrinsics of my real room inside it. We will call them fx fy cx cy. I would like to know if the code I have written is correct, as I am not sure about cam.shift_y. It comes out a negative value put in because blender inverts the y-axis.

def setCameraParams(cam, fkx, fky, x0, y0):
    pixel2mm = cam.sensor_width/RESX
    cam.type = 'PERSP'
    cam.lens = fkx*pixel2mm
    cam.lens_unit = 'MILLIMETERS'
    cam.shift_x = (RESX/2 - x0)/RESX
    cam.shift_y = (RESY/2 - y0)/RESY
    cam.clip_start = 0.01
    cam.clip_end = 4
$\endgroup$

0

You must log in to answer this question.

Browse other questions tagged .