Estimate the transform between source and target keypoints. More...
Data Structures | |
struct | VPIConstrainedHomography2DConfig |
Holds the configuration of a constrained 2d homography transform. More... | |
union | VPITransformConfig |
Transformation parameters. More... | |
struct | VPITransformEstimatorParams |
Parameters used to tune Transform Estimator algorithm. More... | |
Enumerations | |
enum | VPITransformType |
Types of transformation supported. More... | |
enum | VPITransfomEstimationMethod |
Transform estimation method. More... | |
Functions | |
VPIStatus | vpiCreateTransformEstimator (uint64_t backends, int32_t maxKeypoints, VPIPayload *payload) |
Creates payload for vpiSubmitTransformEstimator. More... | |
VPIStatus | vpiInitTransformEstimatorParams (VPITransformType type, VPITransformEstimatorParams *params) |
Initializes the VPITransformEstimatorParams with default values for a given transform type. More... | |
VPIStatus | vpiSubmitTransformEstimator (VPIStream stream, uint64_t backend, VPIPayload payload, VPIArray srcKeypoints, VPIArray tgtKeypoints, VPIArray matches, VPIArray outTransform, VPIArray outInliers, const VPITransformEstimatorParams *params) |
Submits a Transform Estimator operation to the stream. More... | |
Estimate the transform between source and target keypoints.
Refer to Transform Estimator for more details and usage examples.
struct VPIConstrainedHomography2DConfig |
Holds the configuration of a constrained 2d homography transform.
Definition at line 104 of file TransformEstimator.h.
union VPITransformConfig |
Transformation parameters.
Definition at line 178 of file TransformEstimator.h.
Data Fields | ||
---|---|---|
VPIConstrainedHomography2DConfig | constrainedHomography2D |
struct VPITransformEstimatorParams |
Parameters used to tune Transform Estimator algorithm.
Definition at line 193 of file TransformEstimator.h.
Data Fields | ||
---|---|---|
VPITransfomEstimationMethod | method | Method to use for transform estimation. |
int32_t | solverMaxIterations | Maximum number of iterations the non-linear solver should take. |
int32_t | ransacMaxIterations | Maximum number of RANSAC iterations. |
float | ransacReprojErrorTolerance | Maximum allowed reprojection error for a point to be treated as an inlier. |
float | ransacConfidenceLevel | Maximum allowed reprojection error for a point to be treated as an inlier. |
int32_t | ransacSeed | Random number seed to be used. |
int32_t | maxRefinementIterations |
Maximum number of iterations for model refinement step. Pass 0 to skip refinement. It's usually needed when transform isn't affine. |
VPITransformType | xftype | Type of transform to estimate. |
VPITransformConfig | xfcfg | Transform configuration, such as trusted boundaries, etc. |
enum VPITransformType |
#include <vpi/algo/TransformEstimator.h>
Types of transformation supported.
Enumerator | |
---|---|
VPI_XFORM_CONSTRAINED_HOMOGRAPHY_2D | Represents a constrained 2D homography transform. |
Definition at line 171 of file TransformEstimator.h.
#include <vpi/algo/TransformEstimator.h>
Transform estimation method.
Enumerator | |
---|---|
VPI_XFORM_ESTIM_METHOD_REGULAR | Use least squares minimization method. |
VPI_XFORM_ESTIM_METHOD_RANSAC | Use robust estimation with RANSAC and least squares. |
Definition at line 184 of file TransformEstimator.h.
VPIStatus vpiCreateTransformEstimator | ( | uint64_t | backends, |
int32_t | maxKeypoints, | ||
VPIPayload * | payload | ||
) |
#include <vpi/algo/TransformEstimator.h>
Creates payload for vpiSubmitTransformEstimator.
[in] | backends | VPI backend that will execute the algorithm.
|
[in] | maxKeypoints | Maximum number of keypoints processed.
|
[out] | payload | Pointer to the payload variable that receives the created handle. |
VPI_ERROR_INVALID_ARGUMENT | payload is NULL. |
VPI_ERROR_INVALID_ARGUMENT | maxKeypints outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | backend refers to an invalid backend. |
VPI_ERROR_NOT_IMPLEMENTED | Transform Estimator algorithm is not supported by given backend. |
VPI_ERROR_INVALID_CONTEXT | Current context was destroyed. |
VPI_ERROR_INVALID_OPERATION | Backend isn't enabled in current context. |
VPI_ERROR_OUT_OF_MEMORY | Cannot allocate required resources. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiInitTransformEstimatorParams | ( | VPITransformType | type, |
VPITransformEstimatorParams * | params | ||
) |
#include <vpi/algo/TransformEstimator.h>
Initializes the VPITransformEstimatorParams with default values for a given transform type.
The default values remove all parameter constraints. It sets the following parameters:
[in] | type | Type of transform to initialize the structure to.
|
[in,out] | params | Pointer to structure to be initialized.
|
VPI_ERROR_INVALID_ARGUMENT | params is NULL. |
VPI_ERROR_INVALID_ARGUMENT | Transform type not accepted. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiSubmitTransformEstimator | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIPayload | payload, | ||
VPIArray | srcKeypoints, | ||
VPIArray | tgtKeypoints, | ||
VPIArray | matches, | ||
VPIArray | outTransform, | ||
VPIArray | outInliers, | ||
const VPITransformEstimatorParams * | params | ||
) |
#include <vpi/algo/TransformEstimator.h>
Submits a Transform Estimator operation to the stream.
[in] | stream | The stream where the operation will be queued in.
| ||||
[in] | backend | Backend that will execute the algorithm.
| ||||
[in] | payload | Payload created with vpiCreateTransformEstimator.
| ||||
[in] | srcKeypoints | Source keypoints. It defines a set of keypoints to which the estimated transform is to be applied to.
| ||||
[in] | tgtKeypoints | Target keypoints. It defines a set of keypoints that are to be the result of applying the transform to the source keypoints.
| ||||
[in] | matches | Correspondence between source and target keypoints. If not NULL, for each i-th element in matches, the correspondence is given by:
| ||||
[out] | outTransform | Where the estimated transformation will be written to. Array's type specify what transform is to be estimated.
| ||||
[out] | outInliers | Indices of the inlier matches. Optional, if not needed pass NULL.
| ||||
[in] | params | Parameters specifying the parameters of the transform to be estimated. If NULL, will perform an unconstrained estimation for the transform given by the output transform array type. If not NULL, the following restrictions apply:
|
VPI_ERROR_INVALID_ARGUMENT | stream is NULL. |
VPI_ERROR_INVALID_ARGUMENT | payload is NULL. |
VPI_ERROR_INVALID_ARGUMENT | srcKeypoints or tgtKeypoints are NULL. |
VPI_ERROR_INVALID_ARGUMENT | outTransform is NULL. |
VPI_ERROR_INVALID_ARGUMENT | backend is invalid or unknown. |
VPI_ERROR_INVALID_ARGUMENT | srcKeypoints , tgtKeypoints aren't consistent. |
VPI_ERROR_INVALID_ARGUMENT | Transform type not consistent with output transform array type. |
VPI_ERROR_INVALID_ARRAY_TYPE | Array type of srcKeypoints , tgtKeypoints , matches or outInliers is not correct. |
VPI_ERROR_NOT_IMPLEMENTED | Transform Estimator algorithm is not supported by given backend. |
VPI_ERROR_INVALID_OPERATION | Backend hardware not available. |
VPI_ERROR_INVALID_OPERATION | The needed backends aren't enabled in stream , srcKeypoints , tgtKeypoints or matches . |
VPI_SUCCESS | Operation executed successfully. |