Skip to content

Add Quad Fitting#419

Merged
AS1100K merged 15 commits intomainfrom
as1100k/apriltag-quad-fitting
Jul 3, 2025
Merged

Add Quad Fitting#419
AS1100K merged 15 commits intomainfrom
as1100k/apriltag-quad-fitting

Conversation

@AS1100K
Copy link
Copy Markdown
Member

@AS1100K AS1100K commented Jun 28, 2025

Screenshot from 2025-06-30 04-54-00

TODOs

  • Add Initial Quad Fitting Logic
  • Add Tests
  • Code Cleanup
  • Add Docs

@AS1100K AS1100K marked this pull request as ready for review June 29, 2025 23:24
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

Adds the initial quadrilateral fitting pipeline to the AprilTag detector, including slope calculation, line fitting, segmentation, and associated tests.

  • Refactor Point2d to be generic and extend GradientInfo with a slope field
  • Implement quad fitting (quad.rs) with slope computation, line fitting, corner segmentation, and end‐to‐end tests
  • Expose new family and quad modules in the crate root and define a basic TagFamily

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/kornia-apriltag/src/utils.rs Made Point2d generic (T = usize) to support float coordinates in quads
crates/kornia-apriltag/src/segmentation.rs Added slope to GradientInfo and explicit repr(i32) + discriminants to GradientDirection
crates/kornia-apriltag/src/quad.rs New quad fitting implementation: slope assignment, classic line fitting, maxima segmentation, and tests
crates/kornia-apriltag/src/lib.rs Registered the new family and quad modules
crates/kornia-apriltag/src/family.rs Defined TagFamily struct and TAG36_H11 constant
Comments suppressed due to low confidence (1)

crates/kornia-apriltag/src/quad.rs:776

  • The test duplicates the check for corner index 2 and never asserts on corner index 1. Update the assertions to cover all four corners (0 … 3) and remove the duplicate to ensure complete verification.
            assert!((point[2].x as usize).abs_diff(expected_quad[2][0]) <= 1);

Comment thread crates/kornia-apriltag/src/quad.rs
Comment thread crates/kornia-apriltag/src/quad.rs Outdated
@AS1100K AS1100K mentioned this pull request Jul 1, 2025
4 tasks
Comment thread crates/kornia-apriltag/src/quad.rs
Comment thread crates/kornia-apriltag/src/quad.rs
@AS1100K AS1100K merged commit aac0077 into main Jul 3, 2025
13 checks passed
@AS1100K AS1100K deleted the as1100k/apriltag-quad-fitting branch July 3, 2025 01:11
andrew-shc pushed a commit to andrew-shc/kornia-rs that referenced this pull request Aug 2, 2025
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