1pub(crate) mod internal;
31
32pub mod camera_motion;
34pub mod detection;
35pub mod distances;
36pub mod filter;
37pub mod matching;
38pub mod metrics;
39pub mod tracked_object;
40pub mod tracker;
41pub mod utils;
42
43#[cfg(feature = "opencv")]
45pub mod video;
46
47#[cfg(feature = "opencv")]
48pub mod drawing;
49
50#[cfg(feature = "python")]
52pub mod python;
53
54pub use camera_motion::CoordinateTransformation;
56pub use detection::Detection;
57pub use distances::{distance_by_name, Distance};
58pub use filter::{Filter, FilterFactory};
59pub use tracked_object::{TrackedObject, TrackedObjectFactory};
60pub use tracker::{Tracker, TrackerConfig};
61
62pub use crate::error::{Error, Result};
64
65mod error {
66 use thiserror::Error;
67
68 #[derive(Error, Debug)]
70 pub enum Error {
71 #[error("Invalid configuration: {0}")]
72 InvalidConfig(String),
73
74 #[error("Invalid detection: {0}")]
75 InvalidDetection(String),
76
77 #[error("Invalid points shape: expected {expected}, got {got}")]
78 InvalidPointsShape { expected: String, got: String },
79
80 #[error("Distance function error: {0}")]
81 DistanceError(String),
82
83 #[error("Filter error: {0}")]
84 FilterError(String),
85
86 #[error("Unknown distance function: {0}")]
87 UnknownDistance(String),
88
89 #[error("Coordinate transformation error: {0}")]
90 TransformError(String),
91
92 #[error("Metrics evaluation error: {0}")]
93 MetricsError(String),
94
95 #[error("IO error: {0}")]
96 IoError(#[from] std::io::Error),
97 }
98
99 pub type Result<T> = std::result::Result<T, Error>;
101}