Commit 2fcefa2
* refactor(kpm): factor VisualDatabase::query matching loop + add query_from_keyframe (#147)
Recover part of the C++ query onion. Step 1 (no public API change): extract
the per-keyframe matching loop into `match_against_database` and the
per-query reset into `reset_query_state`. Step 2: expose
`query_from_keyframe(Keyframe)` — runs only the matching loop against the
database (skips pyramid build + feature extraction), for deterministic
testing and callers that already hold a `Keyframe`. Mirrors C++
`query(const keyframe_t*)`.
`query(&Matrix<u8>)` is now a thin wrapper (build keyframe → match → stash),
behaviorally identical (existing query tests unchanged + green).
Skipped per YAGNI: `query_from_pyramid` — KPM uses GaussianScaleSpacePyramid
while AR2 uses BoxFilterPyramid8u, so there is no possible cross-pipeline
caller (documented in #147).
Test: query_from_keyframe self-matches an identical keyframe.
Closes #147.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* test(kpm): raise M9 coverage — exclude examples + edge tests (#177)
- coverage: exclude `examples/**` from tarpaulin (the 30-line
simple_nft_dual.rs diagnostic at 0% was the single biggest gap; examples
are demos, not test code — the issue's preferred fix).
- clustering: add a degenerate-input test (BHC build over all-identical
descriptors → zero-distance k-medoids split + query).
- visual_database: add a no-match test via query_from_keyframe (#147) —
maximally-distant descriptors short-circuit try_match_one.
Codecov on this PR confirms the resulting M9 module coverage; any residual
per-file gaps (rust_backend DualFreakMatcher divergence, hough 1-liner) are
quick follow-ups.
Refs #177.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 5b6fbee commit 2fcefa2
3 files changed
Lines changed: 49 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
879 | 895 | | |
880 | 896 | | |
881 | 897 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1129 | 1129 | | |
1130 | 1130 | | |
1131 | 1131 | | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
1132 | 1164 | | |
1133 | 1165 | | |
1134 | 1166 | | |
| |||
0 commit comments