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:
objectPixel coordinate, zero-based from the top-left of the image.
- class olo.vision.BoundingBox[source]¶
Bases:
objectHalf-open image bounding box with XYXY pixel coordinates.
- classmethod from_xywh(x, y, width, height)[source]¶
Create a half-open bounding box from
x, y, width, height.- Return type:
- 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:
- Parameters:
- class olo.vision.CameraIntrinsics[source]¶
Bases:
objectPinhole camera calibration parsed from sensor_msgs/CameraInfo.
- class olo.vision.PointObservation[source]¶
Bases:
objectStamped 3D point observation in the camera optical frame.
Camera geometry helpers
- olo.vision.camera_info_to_intrinsics(message)[source]¶
Parse a sensor_msgs/CameraInfo message into pinhole intrinsics.
- Return type:
- Parameters:
- 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.
- 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.
- 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:
- Parameters:
- olo.vision.deproject_pixel(pixel, depth_metres, intrinsics)[source]¶
Deproject a pixel and depth into the ROS optical camera frame.
- Return type:
- Parameters:
pixel (Pixel)
depth_metres (float)
intrinsics (CameraIntrinsics)
- olo.vision.deproject_point(pixel, depth_metres, intrinsics)[source]¶
Deproject a pixel and scalar depth into the ROS optical camera frame.
- Return type:
- Parameters:
pixel (Pixel)
depth_metres (float)
intrinsics (CameraIntrinsics)
- 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:
- 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:
- Parameters:
depth_image (Image)
region (BoundingBox | ndarray)
intrinsics (CameraIntrinsics)
aggregation (Literal['median', 'trimmed_mean'])
min_valid_pixels (int)
min_depth_metres (float | None)
max_depth_metres (float | None)
- olo.vision.deproject_to_frame(observation, *, frames, target_frame, timeout=5.0)[source]¶
Transform a stamped point observation into a target frame.
- Return type:
- Parameters:
observation (PointObservation)
frames (FrameLookup)
target_frame (str)
timeout (float)
- olo.vision.project_point(point, intrinsics)[source]¶
Project a camera-frame point into pixel coordinates.
- Return type:
- Parameters:
point (Point)
intrinsics (CameraIntrinsics)
- olo.vision.project(point, intrinsics)[source]¶
Project a camera-frame point into pixel coordinates.
- Return type:
- Parameters:
point (Point)
intrinsics (CameraIntrinsics)
Control helpers
- olo.vision.pixel_alignment_error(current, target, *, tolerance_px)[source]¶
Return signed pixel error and convergence against a tolerance.
- Return type:
- Parameters:
- olo.vision.position_error(current, target, *, tolerance_m)[source]¶
Return Cartesian
target - currenterror and convergence.- Return type:
- Parameters:
current (Point | PointObservation)
target (Point | PointObservation)
tolerance_m (float)
Import from olo/vision:
Types
Pixel Zero-based image pixel coordinate.
BoundingBox Half-open image bounding box with XYXY pixel coordinates.
CameraIntrinsics Pinhole camera calibration parsed from
sensor_msgs/CameraInfo.PointObservation Stamped 3D point observation in an image-derived frame.
AlignmentError Image-space alignment error.
PositionError Cartesian position error.
Options
Camera geometry helpers
Control helpers