Advanced Python API

Additional functions, data structures, and utilities for advanced use cases and detailed introspection.

Functions

estimate_intrinsics_detailed(x: Sequence[float], y: Sequence[float], z: Sequence[float]) alice_lri.IntrinsicsDetailed

Estimate detailed sensor intrinsics (including algorithm execution info) from point cloud coordinates given as float vectors.

Parameters:
Returns:

Detailed estimated intrinsics and statistics.

Return type:

IntrinsicsDetailed

intrinsics_from_json_file(path: str) alice_lri.Intrinsics

Load intrinsics from a JSON file.

Parameters:

path (str) – Path to JSON file.

Returns:

Parsed intrinsics.

Return type:

Intrinsics

intrinsics_from_json_str(json: str) alice_lri.Intrinsics

Create intrinsics from a JSON string.

Parameters:

json (str) – JSON string.

Returns:

Parsed intrinsics.

Return type:

Intrinsics

intrinsics_to_json_file(intrinsics: alice_lri.Intrinsics, output_path: str, indent: int = -1) None

Write intrinsics to a JSON file.

Parameters:
  • intrinsics (Intrinsics) – Intrinsics to write.

  • output_path (str) – Output file path.

  • indent (int, optional) – Indentation for pretty printing (-1 for compact).

Raises:

RuntimeError – If writing fails.

intrinsics_to_json_str(intrinsics: alice_lri.Intrinsics, indent: int = -1) str

Convert intrinsics to a JSON string.

Parameters:
  • intrinsics (Intrinsics) – Intrinsics to serialize.

  • indent (int, optional) – Indentation for pretty printing (-1 for compact).

Returns:

JSON string.

Return type:

str

error_message(code: alice_lri.ErrorCode) str

Get a human-readable error message for an error code.

Parameters:

code (ErrorCode) – Error code.

Returns:

Error message.

Return type:

str

Data Structures

class IntrinsicsDetailed

Detailed intrinsic parameters, including scanline details and statistics.

Parameters:
  • scanline_count (int) – Number of scanlines.

  • vertical_iterations (int) – Number of vertical iterations performed.

  • unassigned_points (int) – Number of unassigned points.

  • points_count (int) – Total number of points.

  • end_reason (EndReason) – Reason for ending the process.

property end_reason

Reason for ending the process.

property points_count

Total number of points.

property scanlines

List of detailed scanlines.

property unassigned_points

Number of unassigned points.

property vertical_iterations

Number of vertical iterations performed.

class Scanline

Represents a single scanline with intrinsic parameters.

property azimuthal_offset

Azimuthal offset of the scanline.

property horizontal_offset

Horizontal spatial offset of the scanline.

property resolution

Horizontal resolution of the scanline.

property vertical_angle

Vertical angle of the scanline.

property vertical_offset

Vertical spatial offset of the scanline.

class ScanlineDetailed

Detailed scanline information with uncertainty and voting statistics.

property azimuthal_offset

Azimuthal offset.

property horizontal_heuristic

Whether horizontal heuristic was used.

property horizontal_offset

Horizontal spatial offset.

property hough_hash

Hash value for Hough voting.

property hough_votes

Number of Hough transform votes.

property points_count

Number of points assigned to this scanline.

property resolution

Horizontal resolution of the scanline.

property theoretical_angle_bounds

Theoretical angle bounds for the scanline.

property uncertainty

Estimated uncertainty.

property vertical_angle

Vertical angle with confidence interval.

property vertical_heuristic

Whether vertical heuristic was used.

property vertical_offset

Vertical spatial offset with confidence interval.

class ScanlineAngleBounds

Angle bounds for a scanline.

property lower_line

Lower angle interval.

property upper_line

Upper angle interval.

class Interval

Represents a numeric interval [lower, upper].

any_contained(self: alice_lri.Interval, other: alice_lri.Interval) bool

Check if any part of another interval is contained in this interval.

clamp_both(self: alice_lri.Interval, min_value: float, max_value: float) None

Clamp both bounds to [min_value, max_value].

diff(self: alice_lri.Interval) float

Get the width of the interval (upper - lower).

property lower

Lower bound of the interval.

property upper

Upper bound of the interval.

class ValueConfInterval

Value with associated confidence interval.

property ci

Confidence interval for the value.

property value

The value.

Enums and Constants

class ErrorCode

Error codes for Alice LRI operations.

Members:

NONE : No error.

MISMATCHED_SIZES : Input arrays have mismatched sizes.

EMPTY_POINT_CLOUD : Point cloud is empty.

RANGES_XY_ZERO : At least one point has a range of zero in the XY plane.

INTERNAL_ERROR : Internal error occurred.

EMPTY_POINT_CLOUD = <ErrorCode.EMPTY_POINT_CLOUD: 2>
INTERNAL_ERROR = <ErrorCode.INTERNAL_ERROR: 4>
MISMATCHED_SIZES = <ErrorCode.MISMATCHED_SIZES: 1>
NONE = <ErrorCode.NONE: 0>
RANGES_XY_ZERO = <ErrorCode.RANGES_XY_ZERO: 3>
property name
property value
class EndReason

Reason for ending the iterative vertical fitting process.

Members:

ALL_ASSIGNED : All points assigned. This is the normal termination condition.

MAX_ITERATIONS : Maximum number of iterations reached.

NO_MORE_PEAKS : No more peaks found in the Hough accumulator.

ALL_ASSIGNED = <EndReason.ALL_ASSIGNED: 0>
MAX_ITERATIONS = <EndReason.MAX_ITERATIONS: 1>
NO_MORE_PEAKS = <EndReason.NO_MORE_PEAKS: 2>
property name
property value