robokudo.io.camera_without_depth_interface

OpenCV camera interface for RGB-only devices in RoboKudo.

This module provides an interface for OpenCV-compatible cameras and video sources that only provide RGB data without depth information. It supports:

  • Live camera streams

  • Video file playback

  • Single image loading

  • Contrast/brightness normalization

  • Configurable looping behavior

The module is used for:

  • USB webcams

  • IP cameras

  • Video file playback

  • Image sequence processing

Attributes

Classes

OpenCVCameraWithoutDepthInterface

An openCV camera without depth information.

Module Contents

robokudo.io.camera_without_depth_interface.TYPE_VIDEO: int = 0
robokudo.io.camera_without_depth_interface.TYPE_CAMERA: int = 1
robokudo.io.camera_without_depth_interface.TYPE_IMAGE: int = 2
class robokudo.io.camera_without_depth_interface.OpenCVCameraWithoutDepthInterface(camera_config: typing_extensions.Any)

Bases: robokudo.io.camera_interface.CameraInterface

An openCV camera without depth information. An OpenCV-based interface for RGB-only cameras and video sources.

This class handles various types of RGB input sources through OpenCV: * Live camera feeds (USB webcams, IP cameras) * Video file playback * Single image or image sequence loading

Supports features like: * Automatic input type detection * Configurable frame looping * Image normalization * Static camera calibration

video_capture: cv2.VideoCapture

OpenCV video capture object

device_driver_flag: int

OpenCV-specific driver flags

stream_type: int = 0

Type of input (video/camera/image)

_loop_counter: int

Number of remaining playback loops. Only works on video/image files.

_backup_color: typing_extensions.Optional[numpy.typing.NDArray] = None

Backup of image for single-image file mode

has_new_data() bool

Check if new frame data is available.

For video/camera streams, attempts to grab the next frame. For single images, checks if backup image is available.

Returns:

True if new data is available, False otherwise

set_data(cas: robokudo.cas.CAS) None

Update the Common Analysis Structure with latest frame data.

This method: * Retrieves the next frame from video/camera or backup * Handles looping behavior for videos and images * Applies optional contrast/brightness normalization * Updates the CAS with frame and camera data

Parameters:

cas – Common Analysis Structure to update