Documentation Index
Fetch the complete documentation index at: https://docs.generalrobotics.dev/llms.txt
Use this file to discover all available pages before exploring further.
ScaFoCamera
Inherits from: Camera
A software-based camera implementation.
This class implements all required abstract methods from the Camera base class.
Suitable for development, validation, and scenarios where physical hardware is not available.
Attributes:
resolution (tuple[int, int]): Image resolution (width, height)
_frame_count (int): Counter for tracking number of frames captured
Inherited methods
- From
Camera: getData, getCameraIntrinsics, setCameraIntrinsics, getCameraSettings, setCameraSettings
init
ScaFoCamera.__init__(resolution: tuple[int, int] = (640, 480), fps: int = 30, camera_model: CameraModel = CameraModel.PINHOLE)
Initialize the ScaFoCamera.
resolution (tuple[int, int])
Image resolution (width, height). Defaults to (640, 480).
Frames per second (informational only). Defaults to 30.
camera_model (CameraModel)
Camera projection model. Defaults to PINHOLE.
getImage
ScaFoCamera.getImage(image_type: str = 'rgb', camera_name: str = 'left') -> Optional[Image]
Return an image from the camera.
Type of image to return. Options: ‘rgb’, ‘depth’, ‘left’, ‘right’. Defaults to ‘rgb’.
Camera name for stereo cameras. Options: ‘left’, ‘right’. Defaults to ‘left’.
Captured image with appropriate data type and range
getStereoImagePair
ScaFoCamera.getStereoImagePair() -> tuple[Image, Image]
Get a synchronized pair of left and right images for stereo vision.
getExtrinsics
ScaFoCamera.getExtrinsics(source_image_frame: str, target_image_frame: str) -> np.ndarray
Get the transform between camera frames as a 4x4 homogeneous transformation matrix.
Returns either identity (same frame) or translation for left-to-right stereo baseline.
Source frame. Valid: ‘color’, ‘rgb’, ‘left’, ‘right’
Target frame. Valid: ‘color’, ‘rgb’, ‘left’, ‘right’
4x4 homogeneous transformation matrix
getCameraMatrix
ScaFoCamera.getCameraMatrix(image_type: Optional[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]]
image_type (Optional[str])
Camera sensor type (‘left’, ‘color’, ‘rgb’, ‘right’). Defaults to ‘left’.
3x3 camera intrinsic matrix
getDistortionCoefficients
ScaFoCamera.getDistortionCoefficients(image_type: str = 'left') -> np.ndarray
Get distortion coefficients as a numpy array of shape (5,).
Camera sensor type (‘left’ or ‘right’). Defaults to ‘left’.
Distortion coefficients [k1, k2, k3, k4, k5]
getFrameCount
ScaFoCamera.getFrameCount() -> int
Get the number of frames captured so far.
Total number of frames captured
resetFrameCount
ScaFoCamera.resetFrameCount() -> None
Reset the frame counter to zero.