Skip to content

Add image downscaling support in AprilTag Detection#444

Merged
edgarriba merged 8 commits intomainfrom
as1100k/apriltag-downscaling
Aug 27, 2025
Merged

Add image downscaling support in AprilTag Detection#444
edgarriba merged 8 commits intomainfrom
as1100k/apriltag-downscaling

Conversation

@AS1100K
Copy link
Copy Markdown
Member

@AS1100K AS1100K commented Aug 2, 2025

Benchmarks

  1. 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)
  2. 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)

@AS1100K AS1100K marked this pull request as ready for review August 17, 2025 09:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread crates/kornia-imgproc/src/resize.rs Outdated
Comment thread crates/kornia-imgproc/src/resize.rs Outdated
Comment thread crates/kornia-apriltag/src/lib.rs Outdated
Comment thread crates/kornia-apriltag/src/lib.rs Outdated
Comment thread crates/kornia-apriltag/src/lib.rs
Comment thread crates/kornia-imgproc/src/resize.rs Outdated
Comment thread crates/kornia-imgproc/src/resize.rs Outdated
@edgarriba
Copy link
Copy Markdown
Member

@strasdat what's your bandwidth to setup a small example using sophus-rs optim for calibration ?

@AS1100K AS1100K requested a review from edgarriba August 22, 2025 15:09
@edgarriba edgarriba merged commit 0733221 into main Aug 27, 2025
14 of 16 checks passed
@edgarriba edgarriba deleted the as1100k/apriltag-downscaling branch August 27, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants