Commit 52fa2c5
authored
Fix SolvePnPMethod enum values to match native OpenCV5 numbering (#2081)
* Fix SolvePnPMethod enum values to match native OpenCV5 numbering
The geometry module removed the broken DLS/UPnP methods (both just
fell back to EPnP) and renumbered the remaining SOLVEPNP_* constants,
but the managed SolvePnPMethod enum still carried the old OpenCV4
values. As a result AP3P/IPPE silently ran the wrong native algorithm,
and IPPE_SQUARE/SQPNP were rejected outright since they fell outside
the native flag range.
Also drops the obsolete SolvePnPFlags alias enum, which is no longer
needed now that OpenCvSharp5 doesn't guarantee source compatibility
with the 4.x API.
Fixes #2080
* Address CodeRabbit feedback on #2081
- Rename SolvePnPMethod.IPPE_SQUARE to IppeSquare: once an acronym is
glued to another word to form a compound member name, this repo's
enum-naming convention PascalCases the whole compound rather than
leaving part of it in caps (see .github/copilot-instructions.md).
- Use a positive-Z tvec in the new synthetic poses so the projected
points sit in front of the camera instead of behind it.
- Strengthen SolvePnPTestByArrayMethods/IppeSquare to reproject with
the recovered pose and assert it matches the input points, instead
of only asserting the call doesn't throw. Confirmed this actually
matters: with the old AP3P/IPPE values, SolvePnP silently dispatches
to a different native solver that still completes without throwing,
so a throws-only assertion doesn't catch it - the reprojection check
does.
* Rename IppeSquare to IPPESquare to match existing acronym+word precedent
CodeRabbit's suggested PascalCase compound (IppeSquare) follows the
letter of the naming convention doc, but AKAZEDescriptorType already
has an established precedent for this exact shape (acronym + plain
word) that keeps the acronym in caps: KAZEUpright/MLDBUpright, not
KazeUpright/MldbUpright. Match that existing style instead so IPPE
(the bare enum member) and the compound built from it stay visually
related.1 parent 5d08d9c commit 52fa2c5
2 files changed
Lines changed: 77 additions & 52 deletions
File tree
- src/OpenCvSharp/Modules/geometry/Enum
- test/OpenCvSharp.Tests/calib3d
Lines changed: 4 additions & 52 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 30 | | |
44 | 31 | | |
45 | 32 | | |
46 | 33 | | |
47 | 34 | | |
48 | | - | |
| 35 | + | |
49 | 36 | | |
50 | 37 | | |
51 | 38 | | |
52 | 39 | | |
53 | 40 | | |
54 | 41 | | |
55 | | - | |
| 42 | + | |
56 | 43 | | |
57 | 44 | | |
58 | 45 | | |
| |||
63 | 50 | | |
64 | 51 | | |
65 | 52 | | |
66 | | - | |
| 53 | + | |
67 | 54 | | |
68 | 55 | | |
69 | 56 | | |
70 | 57 | | |
71 | 58 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 59 | + | |
108 | 60 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
484 | 557 | | |
485 | 558 | | |
486 | 559 | | |
| |||
0 commit comments