Skip to main content

RealsenseCamera

Inherits from: Camera No class docstring.

Inherited methods

  • From Camera: getData, setCameraIntrinsics, getCameraSettings, setCameraSettings

init

RealsenseCamera.__init__() -> None
No docstring provided.
Returns
returns
None

init_camera

RealsenseCamera.init_camera() -> None
Initialize the RealSense camera
Returns
returns
None

cleanup

RealsenseCamera.cleanup() -> None
Properly cleanup the camera resources
Returns
returns
None

getImage

RealsenseCamera.getImage(image_type: str | None = None) -> Image
Get image from RealSense camera
Arguments
image_type (str | None)
str | None
type of image to retrieve (“rgb”, “depth”, “infrared”). Defaults to rgb.
Returns
Image
Image
requested image as numpy array

getStereoImagePair

RealsenseCamera.getStereoImagePair() -> tuple
Get the left and right infrared images, which can be used for stereo vision.
Returns
returns
tuple

getAllImages

RealsenseCamera.getAllImages() -> tuple
Get all images from RealSense camera (RGB, Depth, and IR), aligned to RGB
Returns
tuple
tuple
(rgb_image, depth_image, ir_image) as Images

getCameraIntrinsics

RealsenseCamera.getCameraIntrinsics() -> dict
Get all camera intrinsic parameters, including the focal length and centerpoint, distortion_coefficients, distortion model, image size, etc.
Returns
dict
dict
camera intrinsics

getCameraMatrix

RealsenseCamera.getCameraMatrix(image_type: str = None) -> np.ndarray
Get the camera matrix K as a numpy array of shape (3, 3) K = [[fx, 0, cx], [0, fy, cy], [0, 0, 1]]
Arguments
image_type (str)
str
str, Describes which camera sensor to get the matrix for. Valid values are: - “color” or “rgb” or None: the color camera (default) - “left” or “infrared”: the left infrared camera - “right”: the right infrared camera
Returns
np.ndarray
np.ndarray
camera matrix

getDistortionCoefficients

RealsenseCamera.getDistortionCoefficients() -> np.ndarray
Get distortion coefficients as a numpy array of shape (5,)
Returns
np.ndarray
np.ndarray
distortion coefficients

getExtrinsics

RealsenseCamera.getExtrinsics(source_image_frame: str, target_image_frame: str) -> np.ndarray
Get the transform of the target sensor frame with respect to the source sensor frame as a 4x4 homogeneous transformation matrix (np.ndarray) This transform transforms a 3D point (in meters) from the source frame to the target frame.
Arguments
source_image_frame (str)
str
required
the frame of the source sensor. Valid values are ‘color’, ‘rgb’, ‘left’, ‘right’
target_image_frame (str)
str
required
the frame of the target sensor. Valid values are ‘color’, ‘rgb’, ‘left’, ‘right’
Returns
np.ndarray
np.ndarray
4x4 homogeneous transformation matrix