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.

Parameters:
Returns:

Estimated sensor intrinsics.

Return type:

Intrinsics

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:
  • intrinsics (Intrinsics) – Sensor intrinsics (see estimate_intrinsics).

  • x (list of float) – X coordinates.

  • y (list of float) – Y coordinates.

  • z (list of float) – Z coordinates.

Returns:

Projected range image.

Return type:

RangeImage

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:
Returns:

(x, y, z) coordinate lists.

Return type:

tuple

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:
  • width (int) – Image width.

  • height (int) – Image height.

  • initial_value (float, optional) – Initial value for all pixels (if provided).

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:
  • row (int) – Row index (0 to height-1).

  • col (int) – Column index (0 to width-1).

Returns:

Pixel value at [row, col].

Return type:

float

Example

>>> value = range_image[i, j]
__setitem__(self: alice_lri.RangeImage, arg0: tuple, arg1: float) None

Set pixel value at the specified position.

Parameters:
  • row (int) – Row index (0 to height-1).

  • col (int) – Column index (0 to width-1).

  • value (float) – Value to set.

Example

>>> range_image[i, j] = 10.5
property height

Image height.

property width

Image width.

Additional Resources