Conversation
But now there are random crashes on out of bound index mostly, need to fix it
Add test for fit_quads with sample image
Contributor
There was a problem hiding this comment.
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
familyandquadmodules 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);
edgarriba
approved these changes
Jul 1, 2025
cjpurackal
reviewed
Jul 2, 2025
cjpurackal
reviewed
Jul 2, 2025
cjpurackal
approved these changes
Jul 2, 2025
andrew-shc
pushed a commit
to andrew-shc/kornia-rs
that referenced
this pull request
Aug 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TODOs