Commit 5d0c765
test(kpm): add dual-mode test for DoG detector with find_orientation=true
The existing `test_dog_keypoints_match_cpp_count` uses
`find_orientation = false`, which means `detect()` skips the
OrientationAssignment step entirely. The test was therefore insensitive
to changes in the orientation gradient histogram, the SMOOTH_KERNEL
constant, or the parabolic peak refinement — anything in `orientation.rs`
could regress silently.
Add a companion test
`test_dog_keypoints_match_cpp_count_with_orientation` that runs the
same image (`found.jpg`, 3 octaves) with `find_orientation = true`.
This exercises every step of the detector pipeline including the
orientation assignment that the M8-2 SMOOTH_KERNEL fidelity fix
touched.
Empirical local result on Windows MSVC (clean rebuild): |diff| = 0 on
both variants. The Rust port matches C++ keypoint counts EXACTLY both
with and without orientation, contrary to the speculative concern that
the 1-ULP kernel literal change might shift peak detection at the
0.8 · max_height threshold boundary.
Tolerances set to allow cross-platform FP variance:
- orientation-off: 5 (unchanged)
- orientation-on: 10 (orientation step adds more FP ops; can be
tightened if CI shows consistent agreement)
Doc-test comments record the empirical 0-divergence baseline so future
regressions are easy to spot.
refs #125 #128
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>1 parent bc1c7fa commit 5d0c765
1 file changed
Lines changed: 67 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1196 | 1196 | | |
1197 | 1197 | | |
1198 | 1198 | | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1199 | 1204 | | |
1200 | 1205 | | |
1201 | 1206 | | |
| |||
1229 | 1234 | | |
1230 | 1235 | | |
1231 | 1236 | | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
1232 | 1299 | | |
0 commit comments