Ocean
|
This class implements least square or robust optimization algorithms for orientations. More...
#include <NonLinearOptimizationOrientation.h>
Static Public Member Functions | |
static bool | optimizeOrientation (const AnyCamera &camera, const Quaternion &world_R_camera, const ConstIndexedAccessor< Vector3 > &objectPoints, const ConstIndexedAccessor< Vector2 > &imagePoints, Quaternion &world_R_optimizedCamera, const unsigned int iterations, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Minimizes the projection error of a given (pure rotational) 3-DOF camera pose. | |
static bool | optimizeOrientationIF (const AnyCamera &camera, const Quaternion &flippedCamera_R_world, const ConstIndexedAccessor< Vector3 > &objectPoints, const ConstIndexedAccessor< Vector2 > &imagePoints, Quaternion &optimizedFlippedCamera_R_world, const unsigned int iterations, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Minimizes the projection error of a given (pure rotational) 3-DOF camera pose. | |
static bool | optimizeCameraOrientation (const PinholeCamera &pinholeCamera, const SquareMatrix3 &world_R_camera, const ConstIndexedAccessor< ObjectPoint > &objectPoints, const ConstIndexedAccessor< ImagePoint > &imagePoints, const bool distortImagePoints, SquareMatrix3 &world_R_optimizedCamera, PinholeCamera &optimizedCamera, const unsigned int iterations, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Minimizes the projection error of a given 3DOF orientation and the entire camera parameters (intrinsic and distortion). | |
static bool | optimizeCameraOrientationIF (const PinholeCamera &pinholeCamera, const SquareMatrix3 &flippedCamera_R_world, const ConstIndexedAccessor< ObjectPoint > &objectPoints, const ConstIndexedAccessor< ImagePoint > &imagePoints, const bool distortImagePoints, SquareMatrix3 &optimizedFlippedCamera_R_world, PinholeCamera &optimizedCamera, const unsigned int iterations, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Minimizes the projection error of a given inverted and flipped 3DOF orientation and the entire camera parameters (intrinsic and distortion). | |
Additional Inherited Members | |
![]() | |
template<typename T > | |
static bool | denseOptimization (T &provider, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a dense (matrix) optimization problem. | |
template<typename T , Estimator::EstimatorType tEstimator> | |
static bool | denseOptimization (T &provider, const unsigned int iterations=5u, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a dense (matrix) optimization problem. | |
template<typename T > | |
static bool | sparseOptimization (T &provider, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a sparse (matrix) optimization problem. | |
template<typename T , Estimator::EstimatorType tEstimator> | |
static bool | sparseOptimization (T &provider, const unsigned int iterations=5u, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedCovariances=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a sparse (matrix) optimization problem. | |
template<typename T > | |
static bool | advancedDenseOptimization (T &advancedDenseProvider, const unsigned int iterations, Scalar lambda, const Scalar lambdaFactor, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a dense (matrix) optimization problem using an advanced optimization provider. | |
template<typename T > | |
static bool | advancedSparseOptimization (T &advancedSparseProvider, const unsigned int iterations, Scalar lambda, const Scalar lambdaFactor, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr) |
Invokes the optimization of a sparse (matrix) optimization problem using an advanced optimization provider. | |
template<Estimator::EstimatorType tEstimator> | |
static Scalar | sqrErrors2robustErrors2 (const Scalars &sqrErrors, const size_t modelParameters, Vector2 *weightedErrors, Vector2 *weightVectors, const SquareMatrix2 *transposedInvertedCovariances) |
Translates the n/2 squared errors that correspond to n elements in the error vector to robust errors. | |
template<Estimator::EstimatorType tEstimator, size_t tDimension> | |
static Scalar | sqrErrors2robustErrors (const Scalars &sqrErrors, const size_t modelParameters, StaticBuffer< Scalar, tDimension > *weightedErrors, StaticBuffer< Scalar, tDimension > *weightVectors, const Matrix *transposedInvertedCovariances) |
Translates the n/i squared errors that correspond to n elements in the error vector to robust errors. | |
template<Estimator::EstimatorType tEstimator> | |
static Scalar | sqrErrors2robustErrors_i (const Scalars &sqrErrors, const size_t modelParameters, const size_t dimension, Scalar *weightedErrors_i, Scalar *weightVectors_i, const Matrix *transposedInvertedCovariances_i) |
Translates the n/i squared errors that correspond to n elements in the error vector to robust errors. | |
static Scalar | sqrErrors2robustErrors2 (const Estimator::EstimatorType estimator, const Scalars &sqrErrors, const size_t modelParameters, Vector2 *weightedErrors, Vector2 *weightVectors, const SquareMatrix2 *transposedInvertedCovariances) |
Translates the n/2 squared errors that correspond to n elements in the error vector to robust errors. | |
template<size_t tDimension> | |
static Scalar | sqrErrors2robustErrors (const Estimator::EstimatorType estimator, const Scalars &sqrErrors, const size_t modelParameters, StaticBuffer< Scalar, tDimension > *weightedErrors, StaticBuffer< Scalar, tDimension > *weightVectors, const Matrix *transposedInvertedCovariances) |
Translates the n/i squared errors that correspond to n elements in the error vector to robust errors. | |
static Scalar | sqrErrors2robustErrors_i (const Estimator::EstimatorType estimator, const Scalars &sqrErrors, const size_t modelParameters, const size_t dimension, Scalar *weightedErrors_i, Scalar *weightVectors_i, const Matrix *transposedInvertedCovariances_i) |
Translates the n/i squared errors that correspond to n elements in the error vector to robust errors. | |
This class implements least square or robust optimization algorithms for orientations.
|
inlinestatic |
Minimizes the projection error of a given 3DOF orientation and the entire camera parameters (intrinsic and distortion).
The given 3DOF orientation is the rotational part of a standard extrinsic camera matrix.
pinholeCamera | The pinhole camera object defining the projection between 3D object points and 2D image points |
world_R_camera | 3DOF orientation to minimize the projection error for |
objectPoints | The accessor providing the 3D object points to be projected into the camera plane |
imagePoints | The accessor providing the 2D image points corresponding to the object points, the image points may be distorted or undistorted depending on the usage of the distortImagePoints state |
distortImagePoints | True, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination |
world_R_optimizedCamera | Resulting optimized 3DOF orientation |
optimizedCamera | The resulting optimized camera with modified intrinsic camera parameters and distortion parameters |
iterations | Number of iterations to be applied at most, if no convergence can be reached |
estimator | Robust error estimator to be used |
lambda | Initial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity) |
lambdaFactor | Levenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity) |
initialError | Optional resulting averaged robust pixel error for the given initial parameters depending on the selected estimator |
finalError | Optional resulting averaged robust pixel error for the final optimized parameters depending on the selected estimator |
invertedCovariances | Optional set of 2x2 inverted covariance matrices that represent the uncertainties of the image points (a 2*n x 2 matrix) |
intermediateErrors | Optional resulting intermediate (improving) errors |
|
static |
Minimizes the projection error of a given inverted and flipped 3DOF orientation and the entire camera parameters (intrinsic and distortion).
Beware: The given inverted and flipped 3DOF orientation is not equivalent to the rotational part of a standard extrinsic camera matrix.
pinholeCamera | The pinhole camera object defining the projection between 3D object points and 2D image points |
flippedCamera_R_world | 3DOF orientation to minimize the projection error for (inverted and flipped) |
objectPoints | The accessor providing the 3D object points to be projected into the camera plane |
imagePoints | The accessor providing the 2D image points corresponding to the object points, the image points may be distorted or undistorted depending on the usage of the distortImagePoints state |
distortImagePoints | True, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination |
optimizedFlippedCamera_R_world | Resulting optimized 3DOF orientation (inverted and flipped) |
optimizedCamera | The resulting optimized camera with modified intrinsic camera parameters and distortion parameters |
iterations | Number of iterations to be applied at most, if no convergence can be reached |
estimator | Robust error estimator to be used |
lambda | Initial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity) |
lambdaFactor | Levenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity) |
initialError | Optional resulting averaged robust pixel error for the given initial parameters depending on the selected estimator |
finalError | Optional resulting averaged robust pixel error for the final optimized parameters depending on the selected estimator |
invertedCovariances | Optional set of 2x2 inverted covariance matrices that represent the uncertainties of the image points (a 2*n x 2 matrix) |
intermediateErrors | Optional resulting intermediate (improving) errors |
|
inlinestatic |
Minimizes the projection error of a given (pure rotational) 3-DOF camera pose.
camera | The camera profile defining the projection between 3D object points and 2D image points, must be valid |
world_R_camera | The 3-DOF camera pose to optimize, with default camera pointing towards the negative z-space, with y-axis upwards, must be valid |
objectPoints | The accessor providing the 3D object points to be projected into the camera plane |
imagePoints | The accessor providing the 2D image points corresponding to the object points, the image points may be distorted or undistorted depending on the usage of the distortImagePoints state |
world_R_optimizedCamera | The resulting optimized 3-DOF camera pose, with default camera pointing towards the negative z-space, with y-axis upwards |
iterations | The number of iterations to be applied at most, if no convergence can be reached, with range [1, infinity) |
estimator | The robust error estimator to be used |
lambda | The initial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity) |
lambdaFactor | The Levenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity) |
initialError | Optional resulting averaged robust pixel error for the given initial parameters depending on the selected estimator |
finalError | Optional resulting averaged robust pixel error for the final optimized parameters depending on the selected estimator |
invertedCovariances | Optional set of 2x2 inverted covariance matrices that represent the uncertainties of the image points (a 2*n x 2 matrix) |
intermediateErrors | Optional resulting intermediate (improving) errors |
|
static |
Minimizes the projection error of a given (pure rotational) 3-DOF camera pose.
camera | The camera profile defining the projection between 3D object points and 2D image points, must be valid |
flippedCamera_R_world | The inverted and flipped 3-DOF camera pose to optimize, with flipped camera pointing towards the positive z-space, with y-axis downwards, must be valid |
objectPoints | The accessor providing the 3D object points to be projected into the camera plane |
imagePoints | The accessor providing the 2D image points corresponding to the object points, the image points may be distorted or undistorted depending on the usage of the distortImagePoints state |
distortImagePoints | True, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination |
optimizedFlippedCamera_R_world | The resulting optimized flipped and inverted 3-DOF camera pose, with flipped camera pointing towards the positive z-space, with y-axis downwards |
iterations | Number of iterations to be applied at most, if no convergence can be reached |
estimator | Robust error estimator to be used |
lambda | Initial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity) |
lambdaFactor | Levenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity) |
initialError | Optional resulting averaged robust pixel error for the given initial parameters depending on the selected estimator |
finalError | Optional resulting averaged robust pixel error for the final optimized parameters depending on the selected estimator |
invertedCovariances | Optional set of 2x2 inverted covariance matrices that represent the uncertainties of the image points (a 2*n x 2 matrix) |
intermediateErrors | Optional resulting intermediate (improving) errors |