8 #ifndef META_OCEAN_GEOMETRY_NON_LINEAR_OPTIMIZATION_TRANSFORMATION_H
9 #define META_OCEAN_GEOMETRY_NON_LINEAR_OPTIMIZATION_TRANSFORMATION_H
34 class AdvancedObjectTransformationOptimizationProvider;
39 class AdvancedObjectTransformationStereoOptimizationProvider;
73 static inline bool optimizeObjectTransformation(
const AnyCamera& camera,
const HomogenousMatrices4& world_T_cameras,
const HomogenousMatrix4& world_T_object,
const ObjectPointGroups& objectPointGroups,
const ImagePointGroups& imagePointGroups,
HomogenousMatrix4& optimized_world_T_object,
const unsigned int iterations = 20u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
80 static bool optimizeObjectTransformationIF(
const AnyCamera& camera,
const HomogenousMatrices4& flippedCameras_T_world,
const HomogenousMatrix4& world_T_object,
const ObjectPointGroups& objectPointGroups,
const ImagePointGroups& imagePointGroups,
HomogenousMatrix4& optimized_world_T_object,
const unsigned int iterations = 20u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
105 static inline bool optimizeObjectTransformationStereo(
const AnyCamera& cameraA,
const AnyCamera& cameraB,
const HomogenousMatrices4& world_T_camerasA,
const HomogenousMatrices4& world_T_camerasB,
const HomogenousMatrix4& world_T_object,
const ObjectPointGroups& objectPointGroupsA,
const ObjectPointGroups& objectPointGroupsB,
const ImagePointGroups& imagePointGroupsA,
const ImagePointGroups& imagePointGroupsB,
HomogenousMatrix4& optimized_world_T_object,
const unsigned int iterations = 20u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
112 static bool optimizeObjectTransformationStereoIF(
const AnyCamera& cameraA,
const AnyCamera& cameraB,
const HomogenousMatrices4& flippedCamerasA_T_world,
const HomogenousMatrices4& flippedCamerasB_T_world,
const HomogenousMatrix4& world_T_object,
const ObjectPointGroups& objectPointGroupsA,
const ObjectPointGroups& objectPointGroupsB,
const ImagePointGroups& imagePointGroupsA,
const ImagePointGroups& imagePointGroupsB,
HomogenousMatrix4& optimized_world_T_object,
const unsigned int iterations = 20u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
115 inline bool NonLinearOptimizationTransformation::optimizeObjectTransformation(
const AnyCamera& camera,
const HomogenousMatrices4& world_T_cameras,
const HomogenousMatrix4& world_T_object,
const ObjectPointGroups& objectPointGroups,
const ImagePointGroups& imagePointGroups,
HomogenousMatrix4& optimized_world_T_object,
const unsigned int iterations,
const Estimator::EstimatorType estimator,
Scalar lambda,
const Scalar lambdaFactor,
Scalar* initialError,
Scalar* finalError,
Scalars* intermediateErrors)
117 return optimizeObjectTransformationIF(camera,
PinholeCamera::standard2InvertedFlipped(world_T_cameras), world_T_object, objectPointGroups, imagePointGroups, optimized_world_T_object, iterations, estimator, lambda, lambdaFactor, initialError, finalError, intermediateErrors);
120 inline bool NonLinearOptimizationTransformation::optimizeObjectTransformationStereo(
const AnyCamera& cameraA,
const AnyCamera& cameraB,
const HomogenousMatrices4& world_T_camerasA,
const HomogenousMatrices4& world_T_camerasB,
const HomogenousMatrix4& world_T_object,
const ObjectPointGroups& objectPointGroupsA,
const ObjectPointGroups& objectPointGroupsB,
const ImagePointGroups& imagePointGroupsA,
const ImagePointGroups& imagePointGroupsB,
HomogenousMatrix4& optimized_world_T_object,
const unsigned int iterations,
const Estimator::EstimatorType estimator,
Scalar lambda,
const Scalar lambdaFactor,
Scalar* initialError,
Scalar* finalError,
Scalars* intermediateErrors)
122 return optimizeObjectTransformationStereoIF(cameraA, cameraB,
PinholeCamera::standard2InvertedFlipped(world_T_camerasA),
PinholeCamera::standard2InvertedFlipped(world_T_camerasB), world_T_object, objectPointGroupsA, objectPointGroupsB, imagePointGroupsA, imagePointGroupsB, optimized_world_T_object, iterations, estimator, lambda, lambdaFactor, initialError, finalError, intermediateErrors);
This class implements the abstract base class for all AnyCamera objects.
Definition: AnyCamera.h:130
static HomogenousMatrixT4< U > standard2InvertedFlipped(const HomogenousMatrixT4< U > &world_T_camera)
Transforms a standard homogenous 4x4 viewing (extrinsic camera) matrix into an inverted and flipped c...
Definition: Camera.h:734
EstimatorType
Definition of individual robust estimator types.
Definition: Estimator.h:34
@ ET_SQUARE
The standard square error estimator (L2).
Definition: Estimator.h:52
This class implements the basic functions for least square or robust optimization algorithms for non ...
Definition: NonLinearOptimization.h:34
std::vector< ObjectPoints > ObjectPointGroups
Definition of a vector holding object points, so we have groups of object points.
Definition: geometry/Geometry.h:135
std::vector< ImagePoints > ImagePointGroups
Definition of a vector holding image points, so we have groups of image points.
Definition: geometry/Geometry.h:141
float Scalar
Definition of a scalar type.
Definition: Math.h:128
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition: HomogenousMatrix4.h:73
std::vector< Scalar > Scalars
Definition of a vector holding Scalar objects.
Definition: Math.h:144
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15