Vision

Vision provides dependency-light camera geometry helpers for RGB-D observations and Cartesian/pixel alignment-error helpers for caller-owned correction loops.

Camera geometry and position/pixel alignment-error helpers.

Types

class olo.vision.Pixel[source]

Bases: object

Pixel coordinate, zero-based from the top-left of the image.

__init__(x, y)
Parameters:
Return type:

None

class olo.vision.BoundingBox[source]

Bases: object

Half-open image bounding box with XYXY pixel coordinates.

__init__(minimum, maximum)
Parameters:
Return type:

None

property center: Pixel

Return the box centre pixel.

classmethod from_xywh(x, y, width, height)[source]

Create a half-open bounding box from x, y, width, height.

Return type:

BoundingBox

Parameters:
classmethod from_xyxy(x_min, y_min, x_max, y_max)[source]

Create a half-open bounding box from x_min, y_min, x_max, y_max.

Return type:

BoundingBox

Parameters:
property height: float

Return the box height in pixels.

to_xywh()[source]

Return x, y, width, height.

Return type:

tuple[float, float, float, float]

to_xyxy()[source]

Return x_min, y_min, x_max, y_max.

Return type:

tuple[float, float, float, float]

property width: float

Return the box width in pixels.

class olo.vision.CameraIntrinsics[source]

Bases: object

Pinhole camera calibration parsed from sensor_msgs/CameraInfo.

__init__(width, height, fx, fy, cx, cy, frame_id='', stamp=None, distortion_model='', distortion=())
Parameters:
Return type:

None

class olo.vision.PointObservation[source]

Bases: object

Stamped 3D point observation in the camera optical frame.

__init__(point, frame_id, pixel, depth_metres, stamp=None)
Parameters:
Return type:

None

class olo.vision.AlignmentError[source]

Bases: object

Image-space alignment error.

__init__(x_px, y_px, distance_px, converged)
Parameters:
Return type:

None

class olo.vision.PositionError[source]

Bases: object

Cartesian position error.

__init__(vector, distance, converged, frame_id='')
Parameters:
Return type:

None

Camera geometry helpers

olo.vision.camera_info_to_intrinsics(message)[source]

Parse a sensor_msgs/CameraInfo message into pinhole intrinsics.

Return type:

CameraIntrinsics

Parameters:

message (dict[str, Any])

olo.vision.sample_depth(image, pixel, *, window_size=1, min_depth_metres=None, max_depth_metres=None)[source]

Sample a depth image at a pixel, optionally using a median window.

Return type:

float | None

Parameters:
olo.vision.sample_depth_region(image, region, *, aggregation='median', min_valid_pixels=1, min_depth_metres=None, max_depth_metres=None)[source]

Sample a depth image region and aggregate valid depths in metres.

Return type:

float

Parameters:
olo.vision.sample_depth_point(depth_image, pixel, intrinsics, *, window_size=1, min_depth_metres=None, max_depth_metres=None)[source]

Sample and deproject a depth point, preserving the depth image observation stamp.

Return type:

PointObservation | None

Parameters:
olo.vision.deproject_pixel(pixel, depth_metres, intrinsics)[source]

Deproject a pixel and depth into the ROS optical camera frame.

Return type:

Point

Parameters:
olo.vision.deproject_point(pixel, depth_metres, intrinsics)[source]

Deproject a pixel and scalar depth into the ROS optical camera frame.

Return type:

Point

Parameters:
olo.vision.deproject(depth_image, pixel, intrinsics, *, window_size=1, min_depth_metres=None, max_depth_metres=None)[source]

Sample and deproject a depth point, preserving frame metadata.

Return type:

PointObservation | None

Parameters:
olo.vision.deproject_region(depth_image, region, intrinsics, *, aggregation='median', min_valid_pixels=1, min_depth_metres=None, max_depth_metres=None)[source]

Deproject a depth region into an aggregated camera-frame observation.

Return type:

PointObservation

Parameters:
olo.vision.deproject_to_frame(observation, *, frames, target_frame, timeout=5.0)[source]

Transform a stamped point observation into a target frame.

Return type:

PointObservation

Parameters:
olo.vision.project_point(point, intrinsics)[source]

Project a camera-frame point into pixel coordinates.

Return type:

Pixel

Parameters:
olo.vision.project(point, intrinsics)[source]

Project a camera-frame point into pixel coordinates.

Return type:

Pixel

Parameters:

Control helpers

olo.vision.pixel_alignment_error(current, target, *, tolerance_px)[source]

Return signed pixel error and convergence against a tolerance.

Return type:

AlignmentError

Parameters:
olo.vision.position_error(current, target, *, tolerance_m)[source]

Return Cartesian target - current error and convergence.

Return type:

PositionError

Parameters:

Import from olo/vision:

Types

Options

Camera geometry helpers

Control helpers