Add image downscaling support in AprilTag Detection#444
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds image downscaling support to AprilTag detection to improve performance by processing smaller images while adjusting coordinates back to original scale. The changes demonstrate significant performance improvements with ~68% reduction in processing time on both NVIDIA Orin and AMD Ryzen platforms.
- Adds downscale_factor configuration parameter with default value of 2
- Implements image resizing functionality for grayscale images in the processing pipeline
- Scales detected quad corners back to original image coordinates
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/apriltag/src/main.rs | Adds command-line argument for downscale factor configuration |
| crates/kornia-imgproc/src/resize.rs | Implements grayscale image resizing and generalizes resize function for multiple channel types |
| crates/kornia-apriltag/src/quad.rs | Adds coordinate scaling logic to adjust detected quad corners back to original image scale |
| crates/kornia-apriltag/src/lib.rs | Integrates downscaling into the main detection pipeline with conditional image resizing |
| crates/kornia-apriltag/benches/bench_decoding.rs | Updates benchmark to use decimation factor of 2.0 for performance comparison |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
|
@strasdat what's your bandwidth to setup a small example using sophus-rs optim for calibration ? |
Benchmarks
NVIDIA Orin
kornia-apriltag time: [11.525 ms 11.526 ms 11.528 ms] change: [−68.450% −68.443% −68.436%] (p = 0.00 < 0.05)AMD Ryzen 7 5800X
kornia-apriltag time: [5.4888 ms 5.4963 ms 5.5049 ms] change: [−68.551% −68.469% −68.392%] (p = 0.00 < 0.05)