-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
cvFindExtrinsicCameraParams2 is unsafe when count=3 points #10519
Copy link
Copy link
Closed
Labels
Description
System information (version)
- OpenCV => 3.4
- Operating System / Platform => Linux 64 Bit
- Compiler => GCC 5.4
Detailed description
cvFindExtrinsicCameraParams2 is unsafe when 3 points are used and useExtrinsicGuess is false. Code handling the case of 3 points should be removed and an associated assertion should be added preventing its use when 3 points are used.
There reason why this is unsafe is that this uses LM optimisation that returns only a single solution. However pnp when n=3 (p3p) can have up to four real-valued solutions. A user should not call cvFindExtrinsicCameraParams2 when n=3 and when no initial solution is provided, because there is no guarantee that it will converge on the correct solution.
The case of n=3 is not handled in solvePnP for this exact reason (which calls cvFindExtrinsicCameraParams2) .
Steps to reproduce
Reactions are currently unavailable