Skip to content

trackforge / utils


Module utils

Utility functions for geometry and Kalman filtering.

This module provides common mathematical and geometric tools used by the trackers.

Quick Reference

Item Kind Description
assignment mod Greedy linear assignment shared by the trackers.
detections mod Conversion helpers that turn detector output into tracker input.
features mod Appearance-feature helpers shared by the Re-ID trackers.
geometry mod
kalman mod

Modules

  • assignment — Greedy linear assignment shared by the trackers.
  • detections — Conversion helpers that turn detector output into tracker input.
  • features — Appearance-feature helpers shared by the Re-ID trackers.
  • geometry
  • kalman

Functions

detections_from_xyxy

fn detections_from_xyxy(data: &[f32]) -> Vec<([f32; 4], f32, i64)>

Convert flat [x1, y1, x2, y2, conf, cls] detector output into tracker detections.

This is the layout most YOLO-style detectors produce after NMS, including the data array of Ultralytics Boxes. Each group of six values becomes a (tlwh, score, class_id) tuple, the input every tracker's update takes. Trailing values that do not form a full group of six are ignored.

Example

use trackforge::utils::detections_from_xyxy;

let data = [10.0, 20.0, 50.0, 80.0, 0.9, 0.0];
let dets = detections_from_xyxy(&data);
assert_eq!(dets, vec![([10.0, 20.0, 40.0, 60.0], 0.9, 0)]);