Python API Reference¶
The Python package exposes the core ALICE-LRI functionality.
Main Functions¶
Common entry points for typical workflows.
- estimate_intrinsics(x: Sequence[float], y: Sequence[float], z: Sequence[float]) alice_lri.Intrinsics¶
Estimate sensor intrinsics from point cloud coordinates given as float vectors.
- project_to_range_image(intrinsics: alice_lri.Intrinsics, x: Sequence[float], y: Sequence[float], z: Sequence[float]) alice_lri.RangeImage¶
Project a point cloud to a range image using given intrinsics.
- Parameters:
- Returns:
Projected range image.
- Return type:
- unproject_to_point_cloud(intrinsics: alice_lri.Intrinsics, ri: alice_lri.RangeImage) tuple¶
Unproject a range image to a 3D point cloud using given intrinsics.
- Parameters:
intrinsics (Intrinsics) – Sensor intrinsics.
ri (RangeImage) – Input range image.
- Returns:
(x, y, z) coordinate lists.
- Return type:
Main Data Structures¶
Types commonly used when interacting with ALICE-LRI.
- class Intrinsics¶
Contains intrinsic parameters for a sensor, including all scanlines.
- Parameters:
scanline_count (int) – Number of scanlines.
- property scanlines¶
Array of scanlines describing the sensor geometry.
- class RangeImage¶
Represents a 2D range image with pixel data.
- Parameters:
Note
The (width, height) constructor only reserves space for pixels but does not initialize them. The (width, height, initial_value) constructor initializes all pixels to the given value.
Indexing and Array Access
This class supports indexing syntax for getting and setting pixel values:
value = range_image[row, col]— Get pixel value at position (row, col)range_image[row, col] = value— Set pixel value at position (row, col)array = np.asarray(range_image)— Convert to NumPy array (zero-copy view)
- __array__(self: object, **kwargs) numpy.typing.NDArray[numpy.float64]¶
Convert RangeImage to a NumPy array (zero-copy view).
- Returns:
A 2D array view of the range image data.
- Return type:
numpy.ndarray
Note
The returned array is a view of the underlying data, so modifications to the array will affect the original RangeImage.
Example
>>> import numpy as np >>> array = np.asarray(range_image) >>> max_range = np.max(array)
- __getitem__(self: alice_lri.RangeImage, arg0: tuple) float¶
Get pixel value at the specified position.
- Parameters:
- Returns:
Pixel value at [row, col].
- Return type:
Example
>>> value = range_image[i, j]
- __setitem__(self: alice_lri.RangeImage, arg0: tuple, arg1: float) None¶
Set pixel value at the specified position.
- Parameters:
Example
>>> range_image[i, j] = 10.5
- property height¶
Image height.
- property width¶
Image width.
Additional Resources¶
Advanced Python API - Advanced functions, detailed intrinsics, and utilities