Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

sdynpy.signal_processing.sdynpy_camera.camera_matrix_from_image

Signature

def sdynpy.signal_processing.sdynpy_camera.camera_matrix_from_image(image_points, spatial_points)

Computes camera matrices from at least six points

This function computes camera matrices K (intrinic parameters) and R|T (extrinsic parameters) from a set of points defined on the image (u,v) and in 3D space (x,y,z). It sets up a system of homogeneous linear equations for the camera parameters and solves for them using the singular value decomposition to extract the left singular vector corresponding to the smallest singular value. This vector is the closest vector to the null space of the system of equations.

Parameters

Returns

Notes

The return matrix K is of the form::

    [f_u  s  u_0]
K = [ 0  f_v v_0]
    [ 0   0   1 ]

And the matrix RT is of the form::

             [r_xx r_xy r_xz | t_x]
RT = [R|T] = [r_yx r_yy r_yz | t_y]
             [r_zx r_zy r_zz | t_z]

And satisfy the equation::

c*[u v 1].T = K@RT@[x y z 1].T