robokudo.types.cv

Computer vision types for Robokudo.

This module provides types for computer vision operations including:

  • 2D and 3D point representations

  • Rectangle and region of interest definitions

  • 3D bounding box specifications

The types support integration with: * OpenCV for image processing * Open3D for point cloud handling * Transform system for poses

Classes

Point2D

2D point representation.

Points3D

3D point cloud container.

Rect

2D rectangle representation.

ImageROI

Image region of interest.

BoundingBox3D

3D oriented bounding box.

KeyPoint

A key point in an image.

Module Contents

class robokudo.types.cv.Point2D

Bases: robokudo.types.core.Type

2D point representation.

Represents a point in 2D image coordinates.

x: int = 0

X coordinate

y: int = 0

Y coordinate

class robokudo.types.cv.Points3D

Bases: robokudo.types.core.Type

3D point cloud container.

Wraps an Open3D point cloud for 3D point operations.

points: open3d.geometry.PointCloud = None

The actual Open3D point cloud object

class robokudo.types.cv.Rect

Bases: robokudo.types.core.Type

2D rectangle representation.

Defines a rectangle by its top-left corner position and dimensions.

pos: Point2D

Top-left corner position

width: int = 0

Rectangle width in pixels

height: int = 0

Rectangle height in pixels

get_corner_points() typing_extensions.Tuple[int, int, int, int]

Get the rectangle as a tuple of (x1, y1, x2, y2).

as_tuple() typing_extensions.Tuple[int, int, int, int]

Get the rectangle as a tuple of (x, y, w, h).

class robokudo.types.cv.ImageROI

Bases: robokudo.types.core.Type

Image region of interest.

Defines a region of interest in an image using: * Binary mask for arbitrary shapes * Rectangle for bounding region

mask: numpy.typing.NDArray = None

Binary opencv mask image

roi: Rect

Rectangular region of interest

class robokudo.types.cv.BoundingBox3D

Bases: robokudo.types.core.Type

3D oriented bounding box.

Represents a 3D box with: * Dimensions along each axis * 6-DOF pose defining orientation and position

x_length: float = 0.0

Box length along x-axis

y_length: float = 0.0

Box length along y-axis

z_length: float = 0.0

Box length along z-axis

pose: robokudo.types.tf.Pose

Box pose in 3D space

class robokudo.types.cv.KeyPoint

Bases: Point2D

A key point in an image.

size: float

Diameter of the keypoint.

angle: float

Orientation of the keypoint.

response: float

Strength of the keypoint.

octave: int

Pyramid octave the keypoint was detected in.

class_id: int

Object class ID.

classmethod from_cv(keypoint: cv2.KeyPoint) KeyPoint

Create a keypoint from an OpenCV keypoint.

Returns:

The created keypoint.

to_cv() cv2.KeyPoint

Convert the RoboKudo keypoint to an OpenCV keypoint.

Returns:

The cv2 equivalent of the keypoint.