Defines methods to solve the perspective-n-points (PnP) problem.
|
typedef struct dwPnPObject * | dwPnPHandle_t |
| A pointer to the handle representing a PnP solver. More...
|
|
◆ DW_PNP_MAX_POINT_COUNT
#define DW_PNP_MAX_POINT_COUNT 128 |
Defines the maximum number of points that can be processed by the PnP solver.
Definition at line 84 of file PnP.h.
◆ dwPnPHandle_t
A pointer to the handle representing a PnP solver.
This object allows you to solve perspective-n-points problems, i.e. estimating camera pose from 2D-3D correspondences.
Definition at line 43 of file PnP.h.
◆ dwPnP_initialize()
Initializes a PnP solver.
- Parameters
-
[out] | obj | A pointer to the PnP handle for the created module. |
[in] | ransacIterations | The number of P3P ransac iterations to run when solving a PnP pose. |
[in] | optimizerIterations | The number of non-linear optimization iterations to run when solving a PnP pose. |
[in] | ctx | Specifies the handler to the context to create the rectifier. |
- Returns
- DW_INVALID_ARGUMENT - if the PnP handle is NULL
DW_SUCCESS
- API Group
- Init: Yes
- Runtime: No
- De-Init: No
◆ dwPnP_release()
Releases the PnP solver.
- Parameters
-
[in] | obj | The object handle to release. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
- Note
- This method renders the handle unusable.
- API Group
- Init: Yes
- Runtime: No
- De-Init: Yes
◆ dwPnP_reset()
Resets the PnP solver.
- Parameters
-
[in] | obj | Specifies the solver to reset. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwPnP_solve()
Estimates the worldToCamera pose based on optical ray to 3D world point correspondences.
The rays can be obtained by applying the camera model to 2D pixel positions. The 3D world points come from known world structure.
- Parameters
-
[out] | worldToCamera | The estimated pose |
[in] | matchCount | The number of ray to point correspondences. |
[in] | rays | The optical rays. Their norm is expected to be one. |
[in] | worldPoints | The 3D world points that correspond to the rays provided. |
[in] | obj | A pointer to the PnP handle for the created module. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_INVALID_ARGUMENT - If any arguments is null, or too few (minimum three are required), or too many points (more than DW_PNP_MAX_POINT_COUNT) are provided
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes