moonbit-robot-vision-formats

    Offline robotics vision format bridge for image timestamps, camera calibration, trajectories, depth metadata and annotation sync.

    robotics
    vision
    csv
    yaml
    dataset
    slam
    Download zip
    Author
    Version
    0.3.1
    License
    Apache-2.0
    Last updated
    last month
    Downloads
    20

    #moonbit-robot-vision-formats

    Offline format bridges for robotics vision datasets in MoonBit.

    The project focuses on text artifacts commonly exported from ROS bag workflows: image timestamp indexes, CameraInfo-style calibration YAML, 2D trajectory CSV, depth image metadata and object annotations. It is not a ROS client and does not subscribe to topics. The goal is to give MoonBit users a small, testable library for converting and aligning perception data before it reaches SLAM, calibration or dataset review tools.

    ///|
    test "README quick start" {
    let csv =
    #|sec,nsec,frame_id,path
    #|42,0,camera/front,front_000001.png
    #|42,33333333,camera/front,front_000002.png
    #|
    let frames = parse_image_index_csv(csv)
    inspect(
    image_index_summary(frames),
    content="2 frames from 42.000000000 to 42.033333333",
    )
    }

    #Scope

    • Parse and write image timestamp CSV exported from bag extraction scripts.
    • Parse the scalar and matrix subset of camera calibration YAML used by common sensor_msgs/CameraInfo dumps.
    • Parse trajectory CSV containing timestamped planar poses.
    • Parse depth metadata sidecars without loading large depth image payloads.
    • Parse 2D annotation CSV and align all streams by timestamp tolerance.

    #Repository Notes

    This repository is an original MoonBit application-ecosystem library. Before implementation, the package space on Mooncakes was checked with robotics, vision, camera, depth, CSV and YAML keywords. No mature MoonBit package with this same offline robotics vision bridge scope was found.

    #Validation

    Run these commands before submitting or publishing:

    moon check --target all moon test --target all moon check --target all --deny-warn --fmt moon fmt --check moon info git diff --exit-code

    #License

    Apache-2.0.

    The extended API includes quoted CSV parsing, time-series statistics and resampling, polygon and box geometry, camera distortion/undistortion, quality rules and deterministic benchmark checksums.

    The package is published to Mooncakes. Publishing from CI is available through the guarded workflow in .github/workflows/publish.yml.

    CsvError

    pub(all) suberror CsvError {
    EmptyRow
    UnterminatedQuote(Int)
    UnexpectedQuote(Int)
    InvalidColumnCount(Int, Int, Int)
    } derive(Eq,
    Debug
    )

    ManifestError

    pub(all) suberror ManifestError {
    MissingKind
    DuplicateKind(String)
    UnknownKind(String)
    EmptyPath(String)
    } derive(Eq,
    Debug
    )

    VisionFormatError

    pub(all) suberror VisionFormatError {
    EmptyInput
    MissingField(String)
    InvalidNumber(String)
    InvalidRow(String)
    InvalidShape(String)
    OutOfOrder(String)
    } derive(Eq,
    Debug
    )

    Annotation

    pub(all) struct Annotation {
    stamp : Stamp
    frame_id : String
    label : String
    bbox : BoundingBox
    confidence : Double
    } derive(ToJson,
    Debug
    )

    BenchmarkResult

    pub(all) struct BenchmarkResult {
    name : String
    rows : Int
    iterations : Int
    elapsed_ns : Int64
    rows_per_second : Double
    checksum : Int64
    } derive(ToJson,
    Debug
    )

    BoundingBox

    pub(all) struct BoundingBox {
    x : Double
    y : Double
    width : Double
    height : Double
    } derive(ToJson,
    Debug
    )

    BoundingBox::area

    fn BoundingBox::area(self : BoundingBox) -> Double

    BoundingBox::bottom

    fn BoundingBox::bottom(self : BoundingBox) -> Double

    BoundingBox::intersection_area

    fn BoundingBox::intersection_area(self : BoundingBox, other : BoundingBox) -> Double

    BoundingBox::iou

    fn BoundingBox::iou(self : BoundingBox, other : BoundingBox) -> Double

    BoundingBox::is_inside_image

    fn BoundingBox::is_inside_image(self : BoundingBox, width : Int, height : Int) -> Bool

    BoundingBox::right

    fn BoundingBox::right(self : BoundingBox) -> Double

    CameraIntrinsics

    pub(all) struct CameraIntrinsics {
    width : Int
    height : Int
    distortion_model : String
    k : Array[Double]
    d : Array[Double]
    r : Array[Double]
    p : Array[Double]
    } derive(ToJson,
    Debug
    )

    CameraIntrinsics::aspect_ratio

    fn CameraIntrinsics::aspect_ratio(self : CameraIntrinsics) -> Double raise VisionFormatError

    CameraIntrinsics::has_identity_rectification

    fn CameraIntrinsics::has_identity_rectification(self : CameraIntrinsics, tolerance : Double) -> Bool

    CameraIntrinsics::normalize_pixel

    fn CameraIntrinsics::normalize_pixel(self : CameraIntrinsics, pixel : PixelPoint) -> NormalizedPoint raise VisionFormatError

    CameraIntrinsics::principal_point

    fn CameraIntrinsics::principal_point(self : CameraIntrinsics) -> PixelPoint raise VisionFormatError

    CameraIntrinsics::project_normalized

    fn CameraIntrinsics::project_normalized(self : CameraIntrinsics, point : NormalizedPoint) -> PixelPoint raise VisionFormatError

    CameraIssue

    pub(all) enum CameraIssue {
    InvalidDimensions
    InvalidIntrinsicMatrix
    InvalidProjectionMatrix
    InvalidRectificationMatrix
    NonPositiveFocalLength
    EmptyDistortionModel
    } derive(Eq,
    Debug
    )

    CsvOptions

    pub(all) struct CsvOptions {
    delimiter : Char
    trim_fields : Bool
    allow_comments : Bool
    } derive(Eq,
    Debug
    )

    DatasetManifest

    pub(all) struct DatasetManifest {
    name : String
    root : String
    image_index : String
    camera_info : String?
    trajectory : String?
    depth_metadata : String?
    annotations : String?
    } derive(Eq, ToJson,
    Debug
    )

    DatasetManifest::required_files

    fn DatasetManifest::required_files(self : DatasetManifest) -> Array[String]

    DatasetManifest::to_manifest_csv

    fn DatasetManifest::to_manifest_csv(self : DatasetManifest) -> String

    DatasetManifest::to_markdown

    fn DatasetManifest::to_markdown(self : DatasetManifest) -> String

    DatasetQualityReport

    pub(all) struct DatasetQualityReport {
    issues : Array[QualityIssue]
    } derive(Eq, ToJson,
    Debug
    )

    DatasetQualityReport::is_clean

    fn DatasetQualityReport::is_clean(self : DatasetQualityReport) -> Bool

    DatasetQualityReport::summary

    fn DatasetQualityReport::summary(self : DatasetQualityReport) -> String

    DatasetSplit

    pub(all) struct DatasetSplit[T] {
    train : Array[T]
    validation : Array[T]
    test_set : Array[T]
    } derive(
    Debug
    )

    DepthMetadata

    pub(all) struct DepthMetadata {
    stamp : Stamp
    frame_id : String
    width : Int
    height : Int
    encoding : String
    unit : String
    min_depth : Double
    max_depth : Double
    } derive(ToJson,
    Debug
    )

    DepthSummary

    pub(all) struct DepthSummary {
    sample_count : Int
    valid_samples : Int
    total_pixels : Int64
    valid_pixels : Int64
    min_depth : Double
    max_depth : Double
    mean_depth : Double
    } derive(ToJson,
    Debug
    )

    DistortedPoint

    pub(all) struct DistortedPoint {
    x : Double
    y : Double
    } derive(ToJson,
    Debug
    )

    DistortionCoefficients

    pub(all) struct DistortionCoefficients {
    k1 : Double
    k2 : Double
    p1 : Double
    p2 : Double
    k3 : Double
    } derive(ToJson,
    Debug
    )

    FieldKind

    pub(all) enum FieldKind {
    IntField
    FloatField
    StringField
    StampField
    PathField
    } derive(Eq, ToJson,
    Debug
    )

    FieldSpec

    pub(all) struct FieldSpec {
    name : String
    kind : FieldKind
    required : Bool
    note : String
    } derive(Eq, ToJson,
    Debug
    )

    FormatSpec

    pub(all) struct FormatSpec {
    name : String
    media_type : String
    fields : Array[FieldSpec]
    description : String
    } derive(Eq, ToJson,
    Debug
    )

    FrameGroup

    pub(all) struct FrameGroup {
    frame_id : String
    count : Int
    first : Stamp
    last : Stamp
    paths : Array[String]
    } derive(ToJson,
    Debug
    )

    ImageFrameRef

    pub(all) struct ImageFrameRef {
    stamp : Stamp
    frame_id : String
    path : String
    } derive(Eq, ToJson,
    Debug
    )

    IssueSeverity

    pub(all) enum IssueSeverity {
    Info
    Warning
    Error
    } derive(Eq, ToJson,
    Debug
    )

    LabelSummary

    pub(all) struct LabelSummary {
    label : String
    count : Int
    mean_confidence : Double
    total_area : Double
    } derive(ToJson,
    Debug
    )

    NormalizedPoint

    pub(all) struct NormalizedPoint {
    x : Double
    y : Double
    } derive(ToJson,
    Debug
    )

    NumericSummary

    pub(all) struct NumericSummary {
    count : Int
    min : Double
    max : Double
    mean : Double
    variance : Double
    } derive(ToJson,
    Debug
    )

    PixelPoint

    pub(all) struct PixelPoint {
    u : Double
    v : Double
    } derive(ToJson,
    Debug
    )

    Point2D

    pub(all) struct Point2D {
    x : Double
    y : Double
    } derive(ToJson,
    Debug
    )

    Point2D::distance

    fn Point2D::distance(self : Point2D, other : Point2D) -> Double

    Point2D::lerp

    fn Point2D::lerp(self : Point2D, other : Point2D, amount : Double) -> Point2D

    Pose2D

    pub(all) struct Pose2D {
    x : Double
    y : Double
    theta : Double
    } derive(ToJson,
    Debug
    )

    QualityIssue

    pub(all) struct QualityIssue {
    severity : IssueSeverity
    source : String
    message : String
    } derive(Eq, ToJson,
    Debug
    )

    QualityRuleCode

    pub(all) enum QualityRuleCode {
    EmptyStream
    NonMonotonic
    LargeTimestampGap
    InvalidDimensions
    InvalidRange
    MissingCalibration
    LowConfidence
    OutOfBounds
    SparseStream
    } derive(Eq, ToJson,
    Debug
    )

    QualityThresholds

    pub(all) struct QualityThresholds {
    max_gap_ns : Int64
    min_confidence : Double
    max_confidence : Double
    min_depth : Double
    max_depth : Double
    require_camera : Bool
    } derive(ToJson,
    Debug
    )

    RuleViolation

    pub(all) struct RuleViolation {
    code : QualityRuleCode
    source : String
    row : Int
    detail : String
    } derive(ToJson,
    Debug
    )

    Sample2D

    pub(all) struct Sample2D {
    stamp : Stamp
    value : Point2D
    } derive(ToJson,
    Debug
    )

    Segment2D

    pub(all) struct Segment2D {
    start : Point2D
    end : Point2D
    } derive(ToJson,
    Debug
    )

    Segment2D::length

    fn Segment2D::length(self : Segment2D) -> Double

    Segment2D::point_at

    fn Segment2D::point_at(self : Segment2D, amount : Double) -> Point2D

    Stamp

    pub(all) struct Stamp {
    sec : Int
    nsec : Int
    } derive(Eq, ToJson,
    Debug
    )

    Stamp::compare

    fn Stamp::compare(self : Stamp, other : Stamp) -> Int

    Stamp::delta_ns

    fn Stamp::delta_ns(self : Stamp, next : Stamp) -> Int64

    Stamp::to_nanoseconds

    fn Stamp::to_nanoseconds(self : Stamp) -> Int64

    Stamp::to_string

    fn Stamp::to_string(self : Stamp) -> String

    SyncFramePolicy

    pub(all) enum SyncFramePolicy {
    IgnoreFrameId
    RequireSameFrameId
    } derive(Eq,
    Debug
    )

    SyncMatch

    pub(all) struct SyncMatch {
    image : ImageFrameRef
    trajectory : TrajectorySample?
    depth : DepthMetadata?
    annotations : Array[Annotation]
    max_abs_offset_ns : Int64
    } derive(ToJson,
    Debug
    )

    SyncReport

    pub(all) struct SyncReport {
    matches : Array[SyncMatch]
    unmatched_images : Array[ImageFrameRef]
    unmatched_trajectory : Array[TrajectorySample]
    unmatched_depth : Array[DepthMetadata]
    unmatched_annotations : Array[Annotation]
    } derive(ToJson,
    Debug
    )

    TimeSeriesStats

    pub(all) struct TimeSeriesStats {
    count : Int
    first : Stamp?
    last : Stamp?
    span_ns : Int64
    min_period_ns : Int64?
    max_period_ns : Int64?
    mean_period_ns : Double
    monotonic : Bool
    } derive(ToJson,
    Debug
    )

    TrajectorySample

    pub(all) struct TrajectorySample {
    stamp : Stamp
    frame_id : String
    pose : Pose2D
    } derive(ToJson,
    Debug
    )

    TrajectorySummary

    pub(all) struct TrajectorySummary {
    samples : Int
    distance : Double
    duration_ns : Int64
    average_speed : Double
    min_x : Double
    max_x : Double
    min_y : Double
    max_y : Double
    } derive(ToJson,
    Debug
    )

    all_format_specs

    fn all_format_specs() -> Array[FormatSpec]

    annotation_area_histogram

    fn annotation_area_histogram(annotations : ArrayView[Annotation], bins : Int) -> Array[Int]

    annotation_centroid

    fn annotation_centroid(annotation : Annotation) -> Point2D

    annotation_centroids

    fn annotation_centroids(annotations : ArrayView[Annotation]) -> Array[Point2D]

    annotation_density

    fn annotation_density(annotations : ArrayView[Annotation], width : Int, height : Int) -> Double

    annotation_spec

    fn annotation_spec() -> FormatSpec

    annotations_at_stamp

    fn annotations_at_stamp(annotations : ArrayView[Annotation], stamp : Stamp, tolerance_ns : Int64) -> Array[Annotation]

    annotations_for_image

    fn annotations_for_image(image : ImageFrameRef, annotations : ArrayView[Annotation], tolerance_ns : Int64, policy : SyncFramePolicy) -> Array[Annotation]

    annotations_for_label

    fn annotations_for_label(annotations : ArrayView[Annotation], label : String) -> Array[Annotation]

    annotations_in_region

    fn annotations_in_region(annotations : ArrayView[Annotation], region : BoundingBox) -> Array[Annotation]

    annotations_to_csv

    fn annotations_to_csv(annotations : ArrayView[Annotation]) -> String

    average_precision_at_iou

    fn average_precision_at_iou(predictions : ArrayView[BoundingBox], ground_truth : ArrayView[BoundingBox], threshold : Double) -> Double

    benchmark_csv_parse

    fn benchmark_csv_parse(text : String, iterations : Int) -> BenchmarkResult raise VisionFormatError

    benchmark_image_summary

    fn benchmark_image_summary(frames : ArrayView[ImageFrameRef], iterations : Int) -> BenchmarkResult

    benchmark_is_reproducible

    fn benchmark_is_reproducible(result : BenchmarkResult) -> Bool

    benchmark_result

    fn benchmark_result(name : String, rows : Int, iterations : Int, elapsed_ns : Int64, checksum : Int64) -> BenchmarkResult

    benchmark_summary

    fn benchmark_summary(results : ArrayView[BenchmarkResult]) -> String

    benchmark_sync

    fn benchmark_sync(images : ArrayView[ImageFrameRef], trajectory : ArrayView[TrajectorySample], depth : ArrayView[DepthMetadata], annotations : ArrayView[Annotation], tolerance_ns : Int64, iterations : Int) -> BenchmarkResult

    bounding_box_of_points

    fn bounding_box_of_points(points : ArrayView[Point2D]) -> BoundingBox raise VisionFormatError

    box_recall_at_iou

    fn box_recall_at_iou(predictions : ArrayView[BoundingBox], ground_truth : ArrayView[BoundingBox], threshold : Double) -> Double

    camera_diagnostics

    fn camera_diagnostics(camera : CameraIntrinsics) -> Array[CameraIssue]

    camera_info_spec

    fn camera_info_spec() -> FormatSpec

    camera_info_to_yaml

    fn camera_info_to_yaml(camera : CameraIntrinsics) -> String

    camera_is_usable

    fn camera_is_usable(camera : CameraIntrinsics) -> Bool

    camera_is_well_conditioned

    fn camera_is_well_conditioned(camera : CameraIntrinsics, epsilon : Double) -> Bool raise VisionFormatError

    camera_matrix_determinant

    fn camera_matrix_determinant(camera : CameraIntrinsics) -> Double raise VisionFormatError

    camera_normalized_round_trip_error

    fn camera_normalized_round_trip_error(camera : CameraIntrinsics, point : NormalizedPoint) -> Double raise VisionFormatError

    camera_pixel_is_inside

    fn camera_pixel_is_inside(camera : CameraIntrinsics, pixel : PixelPoint) -> Bool

    camera_projection_center

    fn camera_projection_center(camera : CameraIntrinsics) -> PixelPoint

    clamp_box

    fn clamp_box(box : BoundingBox, width : Int, height : Int) -> BoundingBox

    column_index

    fn column_index(header : ArrayView[String], name : String) -> Int?

    confidence_summary

    fn confidence_summary(annotations : ArrayView[Annotation]) -> NumericSummary

    csv_escape

    fn csv_escape(value : String, delimiter : Char) -> String

    csv_join_row

    fn csv_join_row(values : ArrayView[String], delimiter : Char) -> String

    csv_numeric_column

    fn csv_numeric_column(rows : ArrayView[Array[String]], index : Int) -> Array[Double] raise VisionFormatError

    csv_table_to_text

    fn csv_table_to_text(rows : ArrayView[Array[String]], delimiter : Char) -> String

    deduplicate_stamps

    fn[T] deduplicate_stamps(items : ArrayView[T], stamp_of : (T) -> Stamp) -> Array[T]

    default_csv_options

    fn default_csv_options() -> CsvOptions

    default_quality_thresholds

    fn default_quality_thresholds() -> QualityThresholds

    depth_dimensions_are_consistent

    fn depth_dimensions_are_consistent(samples : ArrayView[DepthMetadata]) -> Bool

    depth_encoding_bytes_per_pixel

    fn depth_encoding_bytes_per_pixel(encoding : String) -> Int

    depth_metadata_spec

    fn depth_metadata_spec() -> FormatSpec

    depth_metadata_to_csv

    fn depth_metadata_to_csv(samples : ArrayView[DepthMetadata]) -> String

    depth_ranges_overlap

    fn depth_ranges_overlap(left : DepthMetadata, right : DepthMetadata) -> Bool

    depth_sample_is_valid

    fn depth_sample_is_valid(sample : DepthMetadata) -> Bool

    depth_valid_pixel_ratio

    fn depth_valid_pixel_ratio(summary : DepthSummary) -> Double

    distort_normalized

    fn distort_normalized(point : NormalizedPoint, coefficients : DistortionCoefficients) -> DistortedPoint

    distortion_coefficients

    fn distortion_coefficients(camera : CameraIntrinsics) -> DistortionCoefficients

    downsample_images

    fn downsample_images(frames : ArrayView[ImageFrameRef], every : Int) -> Array[ImageFrameRef]

    empty_time_series_stats

    fn empty_time_series_stats() -> TimeSeriesStats

    expand_box

    fn expand_box(box : BoundingBox, padding : Double) -> BoundingBox

    expected_period_ns

    fn expected_period_ns(rate_hz : Double) -> Int64 raise VisionFormatError

    filter_annotations_by_confidence

    fn filter_annotations_by_confidence(annotations : ArrayView[Annotation], min_confidence : Double) -> Array[Annotation]

    filter_annotations_by_label

    fn filter_annotations_by_label(annotations : ArrayView[Annotation], label : String) -> Array[Annotation]

    filter_images_by_extension

    fn filter_images_by_extension(frames : ArrayView[ImageFrameRef], extension : String) -> Array[ImageFrameRef]

    focal_length_pair

    fn focal_length_pair(camera : CameraIntrinsics) -> (Double, Double) raise VisionFormatError

    format_spec_names

    fn format_spec_names() -> Array[String]

    greedy_non_max_suppression

    fn greedy_non_max_suppression(annotations : ArrayView[Annotation], iou_threshold : Double) -> Array[Annotation]

    group_images_by_frame

    fn group_images_by_frame(frames : ArrayView[ImageFrameRef]) -> Array[FrameGroup]

    image_depth_is_compatible

    fn image_depth_is_compatible(image : ImageFrameRef, sample : DepthMetadata, tolerance_ns : Int64, policy : SyncFramePolicy) -> Bool

    image_frame_ids

    fn image_frame_ids(frames : ArrayView[ImageFrameRef]) -> Array[String]

    image_index_duration_ns

    fn image_index_duration_ns(frames : ArrayView[ImageFrameRef]) -> Int64

    image_index_is_complete

    fn image_index_is_complete(frames : ArrayView[ImageFrameRef], expected_period : Int64, tolerance : Int64) -> Bool

    image_index_spec

    fn image_index_spec() -> FormatSpec

    image_index_summary

    fn image_index_summary(frames : ArrayView[ImageFrameRef]) -> String

    image_index_to_csv

    fn image_index_to_csv(frames : ArrayView[ImageFrameRef]) -> String

    image_paths_for_frame

    fn image_paths_for_frame(frames : ArrayView[ImageFrameRef], frame_id : String) -> Array[String]

    image_periods_ns

    fn image_periods_ns(frames : ArrayView[ImageFrameRef]) -> Array[Int64]

    image_rate_hz

    fn image_rate_hz(frames : ArrayView[ImageFrameRef]) -> Double

    image_trajectory_is_compatible

    fn image_trajectory_is_compatible(image : ImageFrameRef, sample : TrajectorySample, tolerance_ns : Int64, policy : SyncFramePolicy) -> Bool

    inspect_stream_quality

    fn inspect_stream_quality(images : ArrayView[ImageFrameRef], camera : CameraIntrinsics?, trajectory : ArrayView[TrajectorySample], depth : ArrayView[DepthMetadata], annotations : ArrayView[Annotation]) -> DatasetQualityReport

    interpolate_angle

    fn interpolate_angle(a : Double, b : Double, amount : Double) -> Double

    interpolate_point

    fn interpolate_point(a : Sample2D, b : Sample2D, stamp : Stamp) -> Point2D

    interpolate_pose

    fn interpolate_pose(a : TrajectorySample, b : TrajectorySample, stamp : Stamp) -> Pose2D

    interpolate_trajectory

    fn interpolate_trajectory(samples : ArrayView[TrajectorySample], stamp : Stamp) -> TrajectorySample?

    invalid_label_names

    fn invalid_label_names(annotations : ArrayView[Annotation]) -> Array[String]

    label_counts

    fn label_counts(annotations : ArrayView[Annotation]) -> Map[String, Int]

    manifest_from_paths

    fn manifest_from_paths(name : String, root : String, image_index : String, camera_info? : String, trajectory? : String, depth_metadata? : String, annotations? : String) -> DatasetManifest raise ManifestError

    manifest_has_kind

    fn manifest_has_kind(manifest : DatasetManifest, kind : String) -> Bool

    manifest_path_for

    fn manifest_path_for(manifest : DatasetManifest, kind : String) -> String?

    manifest_to_csv

    fn manifest_to_csv(manifest : DatasetManifest) -> String

    mean_absolute_error

    fn mean_absolute_error(actual : ArrayView[Double], predicted : ArrayView[Double]) -> Double raise VisionFormatError

    median

    fn median(values : ArrayView[Double]) -> Double raise VisionFormatError

    merge_sorted_images

    fn merge_sorted_images(left : ArrayView[ImageFrameRef], right : ArrayView[ImageFrameRef]) -> Array[ImageFrameRef]

    missing_periods_ns

    fn missing_periods_ns(periods : ArrayView[Int64], expected : Int64, tolerance : Int64) -> Int

    nearest_stamp_index

    fn[T] nearest_stamp_index(stamp : Stamp, items : ArrayView[T], stamp_of : (T) -> Stamp) -> Int?

    nearest_trajectory_for_image

    fn nearest_trajectory_for_image(image : ImageFrameRef, samples : ArrayView[TrajectorySample], tolerance_ns : Int64, policy : SyncFramePolicy) -> TrajectorySample?

    numeric_summary

    fn numeric_summary(values : ArrayView[Double]) -> NumericSummary

    parse_annotation_csv

    fn parse_annotation_csv(text : String) -> Array[Annotation] raise VisionFormatError

    parse_camera_info_yaml

    fn parse_camera_info_yaml(text : String) -> CameraIntrinsics raise VisionFormatError

    parse_csv_row

    fn parse_csv_row(line : String, options : CsvOptions) -> Array[String] raise CsvError

    parse_csv_table

    fn parse_csv_table(text : String, options : CsvOptions) -> Array[Array[String]] raise CsvError

    parse_depth_metadata_csv

    fn parse_depth_metadata_csv(text : String) -> Array[DepthMetadata] raise VisionFormatError

    parse_image_index_csv

    fn parse_image_index_csv(text : String) -> Array[ImageFrameRef] raise VisionFormatError

    parse_manifest_csv

    fn parse_manifest_csv(name : String, root : String, text : String) -> DatasetManifest raise ManifestError

    parse_stamp

    fn parse_stamp(sec : StringView, nsec : StringView) -> Stamp raise VisionFormatError

    parse_stamp_text

    fn parse_stamp_text(text : String) -> Stamp raise VisionFormatError

    parse_trajectory_csv

    fn parse_trajectory_csv(text : String) -> Array[TrajectorySample] raise VisionFormatError

    percentile

    fn percentile(values : ArrayView[Double], fraction : Double) -> Double raise VisionFormatError

    period_jitter_ns

    fn period_jitter_ns(periods : ArrayView[Int64]) -> (Int64, Int64, Double)

    point_in_polygon

    fn point_in_polygon(point : Point2D, polygon : ArrayView[Point2D]) -> Bool

    polygon_area

    fn polygon_area(points : ArrayView[Point2D]) -> Double

    polygon_is_clockwise

    fn polygon_is_clockwise(points : ArrayView[Point2D]) -> Bool

    polygon_signed_area

    fn polygon_signed_area(points : ArrayView[Point2D]) -> Double

    pose_distance

    fn pose_distance(a : Pose2D, b : Pose2D) -> Double

    precision_recall_f1

    fn precision_recall_f1(true_positive : Int, false_positive : Int, false_negative : Int) -> (Double, Double, Double)

    project_distorted

    fn project_distorted(camera : CameraIntrinsics, point : NormalizedPoint) -> PixelPoint raise VisionFormatError

    quality_score

    fn quality_score(violations : ArrayView[RuleViolation]) -> Double

    require_rectangular

    fn require_rectangular(rows : ArrayView[Array[String]]) -> Int raise CsvError

    resample_trajectory

    fn resample_trajectory(samples : ArrayView[TrajectorySample], start : Stamp, end : Stamp, step_ns : Int64) -> Array[TrajectorySample]

    root_mean_square_error

    fn root_mean_square_error(actual : ArrayView[Double], predicted : ArrayView[Double]) -> Double raise VisionFormatError

    rows_with_column

    fn rows_with_column(rows : ArrayView[Array[String]], index : Int, expected : String) -> Array[Array[String]]

    select_columns

    fn select_columns(row : ArrayView[String], indexes : ArrayView[Int]) -> Array[String]

    split_annotations

    fn split_annotations(annotations : ArrayView[Annotation], seed : Int, validation_percent : Int, test_percent : Int) -> DatasetSplit[Annotation]

    split_by_gap

    fn[T] split_by_gap(items : ArrayView[T], stamp_of : (T) -> Stamp, gap_ns : Int64) -> Array[Array[T]]

    split_counts

    fn[T] split_counts(split : DatasetSplit[T]) -> (Int, Int, Int)

    split_images

    fn split_images(frames : ArrayView[ImageFrameRef], seed : Int, validation_percent : Int, test_percent : Int) -> DatasetSplit[ImageFrameRef]

    split_index

    fn split_index(index : Int, seed : Int, validation_percent : Int, test_percent : Int) -> Int

    split_is_disjoint

    fn[T] split_is_disjoint(split : DatasetSplit[T], equal : (T, T) -> Bool) -> Bool

    split_items

    fn[T] split_items(items : ArrayView[T], seed : Int, validation_percent : Int, test_percent : Int) -> DatasetSplit[T]

    split_manifest

    fn split_manifest(manifest : DatasetManifest, split_name : String) -> DatasetManifest

    split_trajectory

    fn split_trajectory(samples : ArrayView[TrajectorySample], seed : Int, validation_percent : Int, test_percent : Int) -> DatasetSplit[TrajectorySample]

    stationary_samples

    fn stationary_samples(samples : ArrayView[TrajectorySample], maximum_speed : Double) -> Array[TrajectorySample]

    summarize_depth

    fn summarize_depth(samples : ArrayView[DepthMetadata]) -> DepthSummary

    summarize_labels

    fn summarize_labels(annotations : ArrayView[Annotation]) -> Array[LabelSummary]

    summarize_trajectory

    fn summarize_trajectory(samples : ArrayView[TrajectorySample]) -> TrajectorySummary raise VisionFormatError

    sync_report_is_complete

    fn sync_report_is_complete(report : SyncReport) -> Bool

    sync_report_max_offset

    fn sync_report_max_offset(report : SyncReport) -> Int64

    sync_report_summary

    fn sync_report_summary(report : SyncReport) -> String

    synchronize

    fn synchronize(images : ArrayView[ImageFrameRef], trajectory : ArrayView[TrajectorySample], depth : ArrayView[DepthMetadata], annotations : ArrayView[Annotation], tolerance_ns~ : Int64) -> SyncReport

    time_series_stats

    fn[T] time_series_stats(items : ArrayView[T], stamp_of : (T) -> Stamp) -> TimeSeriesStats

    timestamp_span_ns

    fn[T] timestamp_span_ns(items : ArrayView[T], stamp_of : (T) -> Stamp) -> Int64

    timestamps_in_window

    fn[T] timestamps_in_window(start : Stamp, end : Stamp, items : ArrayView[T], stamp_of : (T) -> Stamp) -> Array[T]

    trajectory_average_speed

    fn trajectory_average_speed(samples : ArrayView[TrajectorySample]) -> Double

    trajectory_bounds

    fn trajectory_bounds(samples : ArrayView[TrajectorySample]) -> (Double, Double, Double, Double) raise VisionFormatError

    trajectory_distance

    fn trajectory_distance(samples : ArrayView[TrajectorySample]) -> Double

    trajectory_duration_ns

    fn trajectory_duration_ns(samples : ArrayView[TrajectorySample]) -> Int64

    trajectory_spec

    fn trajectory_spec() -> FormatSpec

    trajectory_to_csv

    fn trajectory_to_csv(samples : ArrayView[TrajectorySample]) -> String

    trajectory_turns

    fn trajectory_turns(samples : ArrayView[TrajectorySample], minimum_change : Double) -> Int

    translate_trajectory

    fn translate_trajectory(samples : ArrayView[TrajectorySample], dx : Double, dy : Double) -> Array[TrajectorySample]

    undistort_normalized

    fn undistort_normalized(point : DistortedPoint, coefficients : DistortionCoefficients, iterations : Int) -> NormalizedPoint

    unique_column_values

    fn unique_column_values(rows : ArrayView[Array[String]], index : Int) -> Array[String]

    unproject_distorted

    fn unproject_distorted(camera : CameraIntrinsics, pixel : PixelPoint, iterations : Int) -> NormalizedPoint raise VisionFormatError

    validate_annotation

    fn validate_annotation(annotation : Annotation, image_width : Int, image_height : Int) -> Unit raise VisionFormatError

    validate_annotation_stream

    fn validate_annotation_stream(annotations : ArrayView[Annotation], image_width : Int, image_height : Int, thresholds : QualityThresholds) -> Array[RuleViolation]

    validate_camera

    fn validate_camera(camera : CameraIntrinsics?, thresholds : QualityThresholds) -> Array[RuleViolation]

    validate_depth_metadata

    fn validate_depth_metadata(sample : DepthMetadata) -> Unit raise VisionFormatError

    validate_depth_stream

    fn validate_depth_stream(samples : ArrayView[DepthMetadata], thresholds : QualityThresholds) -> Array[RuleViolation]

    validate_image_stream

    fn validate_image_stream(frames : ArrayView[ImageFrameRef], thresholds : QualityThresholds) -> Array[RuleViolation]

    validate_label_name

    fn validate_label_name(label : String) -> Bool

    validate_trajectory_stream

    fn validate_trajectory_stream(samples : ArrayView[TrajectorySample], thresholds : QualityThresholds) -> Array[RuleViolation]

    violations_by_code

    fn violations_by_code(violations : ArrayView[RuleViolation]) -> Map[String, Int]

    violations_to_markdown

    fn violations_to_markdown(violations : ArrayView[RuleViolation]) -> String