pycvcam.Cv2Extrinsic.from_rt#
- classmethod Cv2Extrinsic.from_rt(rvec, tvec)[source]#
Class method to create a Cv2Extrinsic object from a rotation vector and a translation vector.
- Parameters:
rvec (numpy.ndarray) – The rotation vector of the camera in the world coordinate system. It should be a numpy array of shape (3,).
tvec (numpy.ndarray) – The translation vector of the camera in the world coordinate system. It should be a numpy array of shape (3,).
- Returns:
A new instance of the Cv2Extrinsic class with the specified rotation and translation vectors.
- Return type:
Examples
Create an extrinsic object with a rotation vector and a translation vector:
import numpy as np from pycvcam import Cv2Extrinsic rvec = numpy.array([0.1, 0.2, 0.3]) tvec = numpy.array([0.5, 0.5, 0.5]) extrinsic = Cv2Extrinsic.from_rt(rvec, tvec)