Commit Graph

10 Commits

Author SHA1 Message Date
20b2cf59f2 refactor: Enhance OneEuroFilter with type hints and error handling improvements
- Added overloads for the `_smoothing_factor` method to improve type hinting for different input types.
- Enhanced error handling in the timestamp validation to provide clearer feedback when an invalid timestamp is encountered.
- Streamlined the calculation of the filtered velocity by simplifying the logic in the `update` method.
- Improved code organization with additional type annotations for better clarity and maintainability.
2025-05-03 15:12:06 +08:00
4a5cfde245 feat: Add OneEuroFilter for adaptive keypoint smoothing
- Introduced the `OneEuroFilter` class to implement an adaptive low-pass filter for smoothing keypoint data, enhancing tracking stability during varying movement speeds.
- Implemented methods for initialization, prediction, and updating of keypoints, allowing for dynamic adjustment of smoothing based on movement.
- Added detailed documentation and type hints to clarify the filter's functionality and parameters.
- Improved the handling of timestamps and filtering logic to ensure accurate predictions and updates.
2025-05-03 14:58:51 +08:00
d2c1c8d624 refactor: Revamp LeastMeanSquareVelocityFilter to utilize historical 3D poses
- Replaced the historical detections mechanism with deques for managing historical 3D poses and timestamps, enhancing performance and memory efficiency.
- Updated the constructor to accept historical data directly, ensuring proper initialization and sorting of poses and timestamps.
- Refined the `predict` and `update` methods to work with the new data structure, improving clarity and functionality.
- Enhanced error handling to ensure robustness when no historical data is available for predictions.
2025-05-03 14:31:59 +08:00
c31cc4e7bf refactor: Enhance tracking state management and velocity filter integration
- Introduced `TrackingState` to encapsulate the state of tracking, improving data organization and immutability.
- Updated the `Tracking` class to utilize `TrackingState`, enhancing clarity in state management.
- Refactored methods to access keypoints and timestamps through the new state structure, ensuring consistency across the codebase.
- Added a `DummyVelocityFilter` for cases where no velocity estimation is needed, improving flexibility in tracking implementations.
- Cleaned up imports and improved type hints for better code organization.
2025-05-02 12:44:58 +08:00
46b8518a10 refactor: Clean up and enhance LeastMeanSquareVelocityFilter implementation
- Removed unused `reset` methods from `GenericVelocityFilter` and `LastDifferenceVelocityFilter` classes to streamline the code.
- Added a static method `from_tracking` to `LeastMeanSquareVelocityFilter` for creating instances from a `Tracking` object.
- Implemented robust error handling in the `predict` and `get` methods to ensure proper functioning with historical detections.
- Enhanced the `update` method to utilize least squares for velocity estimation, improving accuracy in tracking predictions.
- Updated class documentation to reflect changes and clarify method purposes.
2025-05-02 12:06:05 +08:00
4e78165f12 feat: Add LeastMeanSquareVelocityFilter for advanced tracking velocity estimation
- Introduced a new `LeastMeanSquareVelocityFilter` class to enhance tracking velocity estimation using historical detections.
- Implemented methods for updating measurements and predicting future states, laying the groundwork for advanced tracking capabilities.
- Improved import organization and added necessary dependencies for the new filter functionality.
- Updated class documentation to reflect the new filter's purpose and methods.
2025-05-02 11:39:01 +08:00
c78850855c feat: Introduce LastDifferenceVelocityFilter for improved tracking velocity estimation
- Added a new `LastDifferenceVelocityFilter` class to estimate tracking velocities based on the last observed keypoints, enhancing the tracking capabilities.
- Updated the `Tracking` class to utilize the new velocity filter, allowing for more accurate predictions of keypoints over time.
- Refactored the `predict` method to support various input types (float, timedelta, datetime) for better flexibility in time handling.
- Improved timestamp handling in the `perpendicular_distance_camera_2d_points_to_tracking_raycasting` function to ensure adherence to minimum delta time constraints.
- Cleaned up imports and type hints for better organization and clarity across the codebase.
2025-05-02 11:11:32 +08:00
072bf1c46f feat: Integrate pyrsistent for enhanced tracking state management
- Added `pyrsistent` as a dependency to manage historical detections in the `Tracking` class, improving data integrity and immutability.
- Updated the `GlobalTrackingState` to include historical detections using `PVector`, facilitating better tracking of past detections.
- Introduced a new `update_tracking` function to handle timestamp updates for tracking objects, enhancing the tracking logic.
- Refactored imports and type hints for improved organization and clarity across the codebase.
2025-04-30 10:04:39 +08:00
29ca66ad47 refactor: Update affinity matrix calculation and dependencies
- Replaced the `linear_sum_assignment` import from `scipy.optimize` with `hungarian_algorithm` from `optax` to enhance performance in affinity matrix calculations.
- Introduced a new `AffinityResult` class to encapsulate results of affinity computations, including trackings and detections, improving the structure of the affinity calculation process.
- Removed deprecated functions and debug print statements to streamline the codebase.
- Updated `pyproject.toml` and `uv.lock` to include `optax` as a dependency, ensuring compatibility with the new implementation.
- Refactored imports and type hints for better organization and consistency across the codebase.
2025-04-29 15:45:24 +08:00
65cc646927 feat: Introduce Tracking class and refactor pose prediction
- Added a new `Tracking` class to encapsulate tracking data, including keypoints and velocity, with a method for predicting 3D poses based on velocity.
- Refactored the pose prediction logic in `calculate_camera_affinity_matrix_jax` to utilize the new `predict` method from the `Tracking` class, enhancing clarity and modularity.
- Introduced an `AffinityResult` class to manage results of affinity computations, including trackings and detections, improving the structure of the affinity calculation process.
- Updated imports and type hints for better organization and consistency across the codebase.
2025-04-29 12:14:08 +08:00