Skip to content

cvFindExtrinsicCameraParams2 is unsafe when count=3 points #10519

@tobycollins

Description

@tobycollins
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions