P2DingoCV.Camera.Camera

Classes

Camera()

Abstract base class for camera input sources.

class P2DingoCV.Camera.Camera.Camera[source]

Bases: abc.ABC

Abstract base class for camera input sources.

This class defines the interface for any camera or video input source used in image or thermal processing pipelines. Subclasses must implement the frame capture, test capture, and resource release methods.

_HEIGHT

Default frame height in pixels.

Type:

Final[int]

_WIDTH

Default frame width in pixels.

Type:

Final[int]

Abstract base class for camera input sources.

abstractmethod read()[source]

Capture and return the next frame from the camera.

Returns:

A NumPy array representing the image frame (shape: [_HEIGHT, _WIDTH, channels]) or None if no frame is available.

Return type:

np.ndarray | None

Read and return the next frame as a NumPy array.

abstractmethod release()[source]

Release any resources held by the camera.

This should close video streams, free memory, and release hardware resources as needed.

Release any resources held by the camera.

Return type:

None

abstractmethod testRead()[source]

Capture the next frame in a loop for testing purposes.

Unlike read, this method loops or replays frames when the input source reaches the end. Useful for continuous testing without stopping at the end of a video or camera stream.

Returns:

A NumPy array representing the image frame or None if the source is unavailable.

Return type:

np.ndarray | None

Read but loops when done for testing.