pycvcam.Cv2Extrinsic.from_tmatrix#

classmethod Cv2Extrinsic.from_tmatrix(tmatrix)[source]#

Class method to create a Cv2Extrinsic object from a 4x4 transformation matrix.

Parameters:

tmatrix (numpy.ndarray) – The 4x4 transformation matrix of the camera in the world coordinate system. It should be a numpy array of shape (4, 4).

Returns:

A new instance of the Cv2Extrinsic class with the specified transformation matrix.

Return type:

Cv2Extrinsic

Examples

Create an extrinsic object with a transformation matrix:

import numpy as np

from pycvcam import Cv2Extrinsic

tmatrix = numpy.array([[0.93629336, -0.27509585, 0.21835066, 0.5],
                       [0.28962948, 0.95642509, -0.03695701, 0.5],
                       [-0.19866933, 0.0978434, 0.97517033, 0.5],
                       [0.0, 0.0, 0.0, 1.0]])

extrinsic = Cv2Extrinsic.from_tmatrix(tmatrix)