Ocean
Ocean::Geometry::NonLinearOptimizationObjectPoint Class Reference

This class implements least square or robust optimization algorithms optimizing the locations of 3D object points (sometimes in combination with e.g., 3-DOF camera orientations or 6-DOF camera poses). More...

Inheritance diagram for Ocean::Geometry::NonLinearOptimizationObjectPoint:

Data Structures

class  ObjectPointsOnePoseProvider
 Forward declaration of a highly optimized provider object allowing to optimize one camera pose and several 3D object point locations concurrently. More...
 
class  ObjectPointsOrientationalPosesProvider
 Forward declaration of a highly optimized provider object allowing to optimize the orientations of several camera pose and several 3D object point locations concurrently. More...
 
class  ObjectPointsPosesProvider
 Forward declaration of a highly optimized provider object allowing to optimize several camera pose and several 3D object point locations concurrently. More...
 

Static Public Member Functions

static bool optimizeObjectPointForFixedPoses (const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_cameras, const Vector3 &worldObjectPoint, const ConstIndexedAccessor< Vector2 > &imagePoints, Vector3 &optimizedWorldObjectPoint, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Scalar *initialRobustError=nullptr, Scalar *finalRobustError=nullptr, Scalars *intermediateRobustErrors=nullptr)
 Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) camera images, by minimizing the projection error between the 3D object point and the 2D image points. More...
 
static bool optimizeObjectPointForFixedPosesIF (const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const Vector3 &worldObjectPoint, const ConstIndexedAccessor< Vector2 > &imagePoints, Vector3 &optimizedWorldObjectPoint, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Scalar *initialRobustError=nullptr, Scalar *finalRobustError=nullptr, Scalars *intermediateRobustErrors=nullptr)
 Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) camera images, by minimizing the projection error between the 3D object point and the 2D image points. More...
 
static bool optimizeObjectPointForFixedPoses (const ConstIndexedAccessor< const AnyCamera * > &cameras, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_cameras, const Vector3 &worldObjectPoint, const ConstIndexedAccessor< Vector2 > &imagePoints, Vector3 &optimizedWorldObjectPoint, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Scalar *initialRobustError=nullptr, Scalar *finalRobustError=nullptr, Scalars *intermediateRobustErrors=nullptr)
 Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) camera images, by minimizing the projection error between the 3D object point and the 2D image points. More...
 
static bool optimizeObjectPointForFixedPosesIF (const ConstIndexedAccessor< const AnyCamera * > &cameras, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const Vector3 &worldObjectPoint, const ConstIndexedAccessor< Vector2 > &imagePoints, Vector3 &optimizedWorldObjectPoint, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Scalar *initialRobustError=nullptr, Scalar *finalRobustError=nullptr, Scalars *intermediateRobustErrors=nullptr)
 Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) camera images, by minimizing the projection error between the 3D object point and the 2D image points. More...
 
static bool optimizeObjectPointForFixedStereoPoses (const AnyCamera &anyCameraA, const AnyCamera &anyCameraB, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_camerasA, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_camerasB, const Vector3 &worldObjectPoint, const ConstIndexedAccessor< Vector2 > &imagePointAccessorA, const ConstIndexedAccessor< Vector2 > &imagePointAccessorB, Vector3 &optimizedWorldObjectPoint, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Scalar *initialRobustError=nullptr, Scalar *finalRobustError=nullptr, Scalars *intermediateRobustErrors=nullptr)
 Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) stereo fisheye camera frames, by minimizing the projection error between the 3D object point and the 2D image points. More...
 
static bool optimizeObjectPointForFixedStereoPosesIF (const AnyCamera &anyCameraA, const AnyCamera &anyCameraB, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCamerasA_T_world, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCamerasB_T_world, const Vector3 &worldObjectPoint, const ConstIndexedAccessor< Vector2 > &imagePointAccessorA, const ConstIndexedAccessor< Vector2 > &imagePointAccessorB, Vector3 &optimizedWorldObjectPoint, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Scalar *initialRobustError=nullptr, Scalar *finalRobustError=nullptr, Scalars *intermediateRobustErrors=nullptr)
 Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) stereo fisheye camera frames, by minimizing the projection error between the 3D object point and the 2D image points. More...
 
static bool optimizeObjectPointsForFixedPoses (const PinholeCamera &pinholeCamera, const ConstIndexedAccessor< HomogenousMatrix4 > &poseAccessor, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, const bool distortImagePoints, NonconstIndexedAccessor< Vector3 > &optimizedObjectPoints, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Worker *worker=nullptr)
 Minimizes the projection errors of given 3D object points, visible in several individual (fixed) camera frames, by minimizing the projection error between the 3D object point and the 2D image points. More...
 
static bool optimizeObjectPointsForFixedPosesIF (const PinholeCamera &pinholeCamera, const ConstIndexedAccessor< HomogenousMatrix4 > &invertedFlippedPoses, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, const bool distortImagePoints, NonconstIndexedAccessor< Vector3 > &optimizedObjectPoints, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Worker *worker=nullptr)
 Minimizes the projection errors of given 3D object points, visible in several individual (fixed) camera frames, by minimizing the projection error between the 3D object point and the 2D image points. More...
 
static bool optimizeObjectPointForFixedOrientations (const AnyCamera &camera, const ConstIndexedAccessor< SquareMatrix3 > &world_R_cameras, const ConstIndexedAccessor< Vector2 > &imagePoints, const Vector3 &objectPoint, const Scalar objectPointDistance, Vector3 &optimizedObjectPoint, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoint=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of one 3D object point visible in individual (fixed) camera poses all located at the origin with individual orientations by minimizing the projection error between the 3D object point and the 2D image points. More...
 
static bool optimizeObjectPointForFixedOrientationsIF (const AnyCamera &camera, const ConstIndexedAccessor< SquareMatrix3 > &flippedCameras_R_world, const ConstIndexedAccessor< Vector2 > &imagePoints, const Vector3 &objectPoint, const Scalar objectPointDistance, Vector3 &optimizedObjectPoint, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoint=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of one 3D object point visible in individual (fixed) camera poses all located at the origin with individual orientations by minimizing the projection error between the 3D object point and the 2D image points. More...
 
static bool optimizeObjectPointsAndOrientations (const PinholeCamera &pinholeCamera, const ConstIndexedAccessor< SquareMatrix3 > &orientations, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, const Scalar objectPointDistance, NonconstIndexedAccessor< SquareMatrix3 > *optimizedOrientations, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of 3D object points visible in individual camera poses all located at the origin with individual orientations by minimizing the projection error between the 3D object points and the 2D image points. More...
 
static bool optimizeObjectPointsAndOnePose (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &firstPose, const HomogenousMatrix4 &secondPose, const ConstIndexedAccessor< Vector3 > &objectPoints, const ConstIndexedAccessor< Vector2 > &firstImagePoints, const ConstIndexedAccessor< Vector2 > &secondImagePoints, const bool useDistortionParameters, HomogenousMatrix4 *optimizedSecondPose, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of 3D object points visible in two individual camera poses by minimizing the projection error between the 3D object points and the 2D image points. More...
 
static bool optimizeObjectPointsAndOnePoseIF (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &firstPoseIF, const HomogenousMatrix4 &secondPoseIF, const ConstIndexedAccessor< Vector3 > &objectPoints, const ConstIndexedAccessor< Vector2 > &firstImagePoints, const ConstIndexedAccessor< Vector2 > &secondImagePoints, const bool useDistortionParameters, HomogenousMatrix4 *optimizedSecondPoseIF, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of 3D object points visible in two individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points. More...
 
static bool optimizeObjectPointsAndTwoPoses (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &firstPose, const HomogenousMatrix4 &secondPose, const ConstIndexedAccessor< Vector3 > &objectPoints, const ConstIndexedAccessor< Vector2 > &firstImagePoints, const ConstIndexedAccessor< Vector2 > &secondImagePoints, const bool useDistortionParameters, HomogenousMatrix4 *optimizedFirstPose, HomogenousMatrix4 *optimizedSecondPose, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedFirstCovariances=nullptr, const Matrix *invertedSecondCovariances=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of 3D object points visible in two individual camera poses by minimizing the projection error between the 3D object points and the 2D image points. More...
 
static bool optimizeObjectPointsAndTwoPosesIF (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &firstPoseIF, const HomogenousMatrix4 &secondPoseIF, const ConstIndexedAccessor< Vector3 > &objectPoints, const ConstIndexedAccessor< Vector2 > &firstImagePoints, const ConstIndexedAccessor< Vector2 > &secondImagePoints, const bool useDistortionParameters, HomogenousMatrix4 *optimizedFirstPoseIF, HomogenousMatrix4 *optimizedSecondPoseIF, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedFirstCovariances=nullptr, const Matrix *invertedSecondCovariances=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of 3D object points visible in two individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points. More...
 
static bool optimizeObjectPointsAndPoses (const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_cameras, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *world_T_optimizedCameras, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of 3D object points visible in individual camera poses by minimizing the projection error between the 3D object points and the 2D image points. More...
 
static bool optimizeObjectPointsAndPosesIF (const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *flippedOptimizedCameras_T_world, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of 3D object points visible in individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points. More...
 
static bool optimizeObjectPointsAndPoses (const ConstIndexedAccessor< const AnyCamera * > &cameras, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_cameras, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *world_T_optimizedCameras, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of 3D object points visible in individual camera poses by minimizing the projection error between the 3D object points and the 2D image points. More...
 
static bool optimizeObjectPointsAndPosesIF (const ConstIndexedAccessor< const AnyCamera * > &cameras, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *flippedOptimizedCameras_T_world, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of 3D object points visible in individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points. More...
 
static bool optimizeObjectPointsAndOrientationalPoses (const ConstIndexedAccessor< const AnyCamera * > &cameras, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_cameras, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *world_T_optimizedCameras, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of 3D object points visible in individual camera poses by minimizing the projection error between the 3D object points and the 2D image points. More...
 
static bool optimizeObjectPointsAndOrientationalPosesIF (const ConstIndexedAccessor< const AnyCamera * > &cameras, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *flippedOptimizedCameras_T_world, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Optimizes the locations of 3D object points visible in individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points. More...
 

Protected Types

typedef StaticMatrix< Scalar, 3, 3 > StaticMatrix3x3
 Definition of a 3x3 matrix. More...
 
typedef StaticMatrix< Scalar, 3, 6 > StaticMatrix3x6
 Definition of a 3x6 matrix. More...
 
typedef StaticMatrix< Scalar, 6, 3 > StaticMatrix6x3
 Definition of a 6x3 matrix. More...
 
typedef StaticMatrix< Scalar, 6, 6 > StaticMatrix6x6
 Definition of a 6x6 matrix. More...
 
typedef std::vector< StaticMatrix3x3StaticMatrices3x3
 Definition of a vector holding 3x3 matrices. More...
 
typedef std::vector< StaticMatrix6x3StaticMatrices6x3
 Definition of a vector holding 6x3 matrices. More...
 
typedef std::vector< StaticMatrix6x6StaticMatrices6x6
 Definition of a vector holding 6x6 matrices. More...
 

Static Protected Member Functions

static bool slowOptimizeObjectPointsAndPoses (const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_cameras, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *world_T_optimizedCameras, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 This function is a slow implementation and has been replaced by a faster implementation. More...
 
static bool slowOptimizeObjectPointsAndPosesIF (const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *flippedOptimizedCameras_T_world, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 This function is a slow implementation and has been replaced by a faster implementation. More...
 
static bool slowOptimizeObjectPointsAndPoses (const PinholeCamera &pinholeCamera, const ConstIndexedAccessor< HomogenousMatrix4 > &poses, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, const bool useDistortionParameters, NonconstIndexedAccessor< HomogenousMatrix4 > *optimizedPoses, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Deprecated. More...
 
static bool slowOptimizeObjectPointsAndPosesIF (const PinholeCamera &pinholeCamera, const ConstIndexedAccessor< HomogenousMatrix4 > &posesIF, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, const bool useDistortionParameters, NonconstIndexedAccessor< HomogenousMatrix4 > *optimizedPosesIF, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
 Deprecated. More...
 
static void optimizeObjectPointsForFixedPosesIFSubset (const PinholeCamera *pinholeCamera, const ConstIndexedAccessor< HomogenousMatrix4 > *invertedFlippedPoses, const ConstIndexedAccessor< Vector3 > *objectPoints, const ObjectPointGroupsAccessor *correspondenceGroups, const bool distortImagePoints, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Estimator::EstimatorType estimator, Scalar lambda, const Scalar lambdaFactor, const bool onlyFrontObjectPoints, const unsigned int firstObjectPoint, const unsigned int numberObjectPoints)
 Minimizes the projection errors of a subset of given 3D object points, visible in several individual (fixed) camera frames, by minimizing the projection error between the 3D object point and the 2D image points. More...
 
- Static Protected Member Functions inherited from Ocean::Geometry::NonLinearOptimization
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

This class implements least square or robust optimization algorithms optimizing the locations of 3D object points (sometimes in combination with e.g., 3-DOF camera orientations or 6-DOF camera poses).

Therefore, this class implements typical Bundle Adjustment tasks e.g., for 3D object points and 6-DOF camera poses.

Member Typedef Documentation

◆ StaticMatrices3x3

Definition of a vector holding 3x3 matrices.

◆ StaticMatrices6x3

Definition of a vector holding 6x3 matrices.

◆ StaticMatrices6x6

Definition of a vector holding 6x6 matrices.

◆ StaticMatrix3x3

Definition of a 3x3 matrix.

◆ StaticMatrix3x6

Definition of a 3x6 matrix.

◆ StaticMatrix6x3

Definition of a 6x3 matrix.

◆ StaticMatrix6x6

Definition of a 6x6 matrix.

Member Function Documentation

◆ optimizeObjectPointForFixedOrientations()

bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedOrientations ( const AnyCamera camera,
const ConstIndexedAccessor< SquareMatrix3 > &  world_R_cameras,
const ConstIndexedAccessor< Vector2 > &  imagePoints,
const Vector3 objectPoint,
const Scalar  objectPointDistance,
Vector3 optimizedObjectPoint,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoint = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
inlinestatic

Optimizes the locations of one 3D object point visible in individual (fixed) camera poses all located at the origin with individual orientations by minimizing the projection error between the 3D object point and the 2D image points.

Parameters
cameraThe camera profile defining the projection, must be valid
world_R_camerasThe accessor for the orientations of the individual cameras, with default camera pointing towards the negative z-space with y-axis upwards, at least two
imagePointsThe accessor for the image points which are projections of the 3D object points, one image point for each orientation
objectPointThe rough object point location to optimize
objectPointDistanceThe distance between the origin and the 3D object points, with range (0, infinity)
optimizedObjectPointThe resulting optimized 3D object points locations
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointForFixedOrientationsIF().

◆ optimizeObjectPointForFixedOrientationsIF()

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedOrientationsIF ( const AnyCamera camera,
const ConstIndexedAccessor< SquareMatrix3 > &  flippedCameras_R_world,
const ConstIndexedAccessor< Vector2 > &  imagePoints,
const Vector3 objectPoint,
const Scalar  objectPointDistance,
Vector3 optimizedObjectPoint,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoint = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
static

Optimizes the locations of one 3D object point visible in individual (fixed) camera poses all located at the origin with individual orientations by minimizing the projection error between the 3D object point and the 2D image points.

Parameters
cameraThe camera profile defining the projection, must be valid
flippedCameras_R_worldThe accessor for the inverted and flipped orientations of the individual cameras, with default flipped camera pointing towards the positive z-space with y-axis downwards, at least two
imagePointsThe accessor for the image points which are projections of the 3D object points, one image point for each orientation
objectPointThe rough object point location to optimize
objectPointDistanceThe distance between the origin and the 3D object points, with range (0, infinity)
optimizedObjectPointThe resulting optimized 3D object points locations
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointForFixedOrientations().

◆ optimizeObjectPointForFixedPoses() [1/2]

bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedPoses ( const AnyCamera camera,
const ConstIndexedAccessor< HomogenousMatrix4 > &  world_T_cameras,
const Vector3 worldObjectPoint,
const ConstIndexedAccessor< Vector2 > &  imagePoints,
Vector3 optimizedWorldObjectPoint,
const unsigned int  iterations = 5u,
const Estimator::EstimatorType  estimator = Estimator::ET_SQUARE,
Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = 10,
const bool  onlyFrontObjectPoints = true,
Scalar initialRobustError = nullptr,
Scalar finalRobustError = nullptr,
Scalars intermediateRobustErrors = nullptr 
)
inlinestatic

Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) camera images, by minimizing the projection error between the 3D object point and the 2D image points.

Parameters
cameraThe camera profile defining the projection between 3D object points and 2D image points, must be valid
world_T_camerasThe accessor for 6-DOF camera poses of the camera frames, with default camera pointing towards the negative z-space with y-axis upwards, at least two
worldObjectPointThe 3D object point to be projected into the camera plane and for that the projection error is minimized, defined in world
imagePointsThe accessor for the image points that are visible in individual camera frames (with world_T_cameras.size() == imagePoints.size())
optimizedWorldObjectPointResulting optimized 3D object point, defined in world
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialRobustErrorOptional resulting averaged robust pixel error for the given initial parameters
finalRobustErrorOptional resulting averaged robust pixel error for the final optimized parameters
intermediateRobustErrorsOptional resulting averaged robust pixel errors for intermediate optimization iterations
Returns
True, if succeeded
See also
optimizeObjectPointForFixedPosesIF().

◆ optimizeObjectPointForFixedPoses() [2/2]

bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedPoses ( const ConstIndexedAccessor< const AnyCamera * > &  cameras,
const ConstIndexedAccessor< HomogenousMatrix4 > &  world_T_cameras,
const Vector3 worldObjectPoint,
const ConstIndexedAccessor< Vector2 > &  imagePoints,
Vector3 optimizedWorldObjectPoint,
const unsigned int  iterations = 5u,
const Estimator::EstimatorType  estimator = Estimator::ET_SQUARE,
Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = 10,
const bool  onlyFrontObjectPoints = true,
Scalar initialRobustError = nullptr,
Scalar finalRobustError = nullptr,
Scalars intermediateRobustErrors = nullptr 
)
inlinestatic

Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) camera images, by minimizing the projection error between the 3D object point and the 2D image points.

Parameters
camerasThe camera profiles defining the projection between 3D object points and 2D image points, one individual provide for each observation, must be valid
world_T_camerasThe accessor for 6-DOF camera poses of the camera frames, with default camera pointing towards the negative z-space with y-axis upwards, at least two
worldObjectPointThe 3D object point to be projected into the camera plane and for that the projection error is minimized, defined in world
imagePointsThe accessor for the image points that are visible in individual camera frames (with world_T_cameras.size() == imagePoints.size())
optimizedWorldObjectPointResulting optimized 3D object point, defined in world
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialRobustErrorOptional resulting averaged robust pixel error for the given initial parameters
finalRobustErrorOptional resulting averaged robust pixel error for the final optimized parameters
intermediateRobustErrorsOptional resulting averaged robust pixel errors for intermediate optimization iterations
Returns
True, if succeeded
See also
optimizeObjectPointForFixedPosesIF().

◆ optimizeObjectPointForFixedPosesIF() [1/2]

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedPosesIF ( const AnyCamera camera,
const ConstIndexedAccessor< HomogenousMatrix4 > &  flippedCameras_T_world,
const Vector3 worldObjectPoint,
const ConstIndexedAccessor< Vector2 > &  imagePoints,
Vector3 optimizedWorldObjectPoint,
const unsigned int  iterations = 5u,
const Estimator::EstimatorType  estimator = Estimator::ET_SQUARE,
Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = 10,
const bool  onlyFrontObjectPoints = true,
Scalar initialRobustError = nullptr,
Scalar finalRobustError = nullptr,
Scalars intermediateRobustErrors = nullptr 
)
static

Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) camera images, by minimizing the projection error between the 3D object point and the 2D image points.

Beware: The given inverted and flipped 6DOF poses are not equivalent to a standard extrinsic camera matrix.

Parameters
cameraThe camera profile defining the projection between 3D object points and 2D image points, must be valid
flippedCameras_T_worldThe accessor for (inverted and flipped) 6-DOF camera poses of the camera frames, with default flipped camera pointing towards the positive z-space with y-axis downwards, at least two
worldObjectPointThe 3D object point to be projected into the camera plane and for that the projection error is minimized, defined in world
imagePointsThe accessor for the image points that are visible in individual camera frames (with flippedCameras_T_world.size() == imagePoints.size())
optimizedWorldObjectPointResulting optimized 3D object point, defined in world
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialRobustErrorOptional resulting averaged robust pixel error for the given initial parameters
finalRobustErrorOptional resulting averaged robust pixel error for the final optimized parameters
intermediateRobustErrorsOptional resulting averaged robust pixel errors for intermediate optimization iterations
Returns
True, if succeeded
See also
optimizeObjectPointForFixedPoses().

◆ optimizeObjectPointForFixedPosesIF() [2/2]

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedPosesIF ( const ConstIndexedAccessor< const AnyCamera * > &  cameras,
const ConstIndexedAccessor< HomogenousMatrix4 > &  flippedCameras_T_world,
const Vector3 worldObjectPoint,
const ConstIndexedAccessor< Vector2 > &  imagePoints,
Vector3 optimizedWorldObjectPoint,
const unsigned int  iterations = 5u,
const Estimator::EstimatorType  estimator = Estimator::ET_SQUARE,
Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = 10,
const bool  onlyFrontObjectPoints = true,
Scalar initialRobustError = nullptr,
Scalar finalRobustError = nullptr,
Scalars intermediateRobustErrors = nullptr 
)
static

Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) camera images, by minimizing the projection error between the 3D object point and the 2D image points.

Beware: The given inverted and flipped 6DOF poses are not equivalent to a standard extrinsic camera matrix.

Parameters
camerasThe camera profiles defining the projection between 3D object points and 2D image points, one individual provide for each observation, must be valid
flippedCameras_T_worldThe accessor for (inverted and flipped) 6-DOF camera poses of the camera frames, with default flipped camera pointing towards the positive z-space with y-axis downwards, at least two
worldObjectPointThe 3D object point to be projected into the camera plane and for that the projection error is minimized, defined in world
imagePointsThe accessor for the image points that are visible in individual camera frames (with flippedCameras_T_world.size() == imagePoints.size())
optimizedWorldObjectPointResulting optimized 3D object point, defined in world
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialRobustErrorOptional resulting averaged robust pixel error for the given initial parameters
finalRobustErrorOptional resulting averaged robust pixel error for the final optimized parameters
intermediateRobustErrorsOptional resulting averaged robust pixel errors for intermediate optimization iterations
Returns
True, if succeeded
See also
optimizeObjectPointForFixedPoses().

◆ optimizeObjectPointForFixedStereoPoses()

bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedStereoPoses ( const AnyCamera anyCameraA,
const AnyCamera anyCameraB,
const ConstIndexedAccessor< HomogenousMatrix4 > &  world_T_camerasA,
const ConstIndexedAccessor< HomogenousMatrix4 > &  world_T_camerasB,
const Vector3 worldObjectPoint,
const ConstIndexedAccessor< Vector2 > &  imagePointAccessorA,
const ConstIndexedAccessor< Vector2 > &  imagePointAccessorB,
Vector3 optimizedWorldObjectPoint,
const unsigned int  iterations = 5u,
const Estimator::EstimatorType  estimator = Estimator::ET_SQUARE,
Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = 10,
const bool  onlyFrontObjectPoints = true,
Scalar initialRobustError = nullptr,
Scalar finalRobustError = nullptr,
Scalars intermediateRobustErrors = nullptr 
)
inlinestatic

Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) stereo fisheye camera frames, by minimizing the projection error between the 3D object point and the 2D image points.

The number of provided observations from the first (e.g., left) stereo camera can be different from the number of observations from the second (e.g., right) stereo camera.

Parameters
anyCameraAThe fisheye camera profile of first (e.g., left) stereo images defining the projection between 3D object points and 2D image points, must be valid
anyCameraBThe fisheye camera profile of second (e.g., right) stereo images defining the projection between 3D object points and 2D image points, must be valid
world_T_camerasAThe accessor for 6-DOF camera poses of the first stereo camera frames, with poseAccessor_world_T_cameraA.size() + poseAccessor_world_T_cameraB.size() >= 2
world_T_camerasBThe accessor for 6-DOF camera poses of the second stereo camera frames, with poseAccessor_world_T_cameraA.size() + poseAccessor_world_T_cameraB.size() >= 2
worldObjectPointThe 3D object point to be optimized, defined in world
imagePointAccessorAThe accessor for the image points that are visible in individual first stereo camera frames (with poseAccessor_world_T_cameraA.size() == imagePointAccessorA.size())
imagePointAccessorBThe accessor for the image points that are visible in individual second stereo camera frames (with poseAccessor_world_T_cameraB.size() == imagePointAccessorB.size())
optimizedWorldObjectPointResulting optimized 3D object point, defined in world
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialRobustErrorOptional resulting averaged robust pixel error for the given initial parameters
finalRobustErrorOptional resulting averaged robust pixel error for the final optimized parameters
intermediateRobustErrorsOptional resulting averaged robust pixel errors for intermediate optimization iterations
Returns
True, if succeeded
See also
optimizeObjectPointForFixedPosesIF().

◆ optimizeObjectPointForFixedStereoPosesIF()

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedStereoPosesIF ( const AnyCamera anyCameraA,
const AnyCamera anyCameraB,
const ConstIndexedAccessor< HomogenousMatrix4 > &  flippedCamerasA_T_world,
const ConstIndexedAccessor< HomogenousMatrix4 > &  flippedCamerasB_T_world,
const Vector3 worldObjectPoint,
const ConstIndexedAccessor< Vector2 > &  imagePointAccessorA,
const ConstIndexedAccessor< Vector2 > &  imagePointAccessorB,
Vector3 optimizedWorldObjectPoint,
const unsigned int  iterations = 5u,
const Estimator::EstimatorType  estimator = Estimator::ET_SQUARE,
Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = 10,
const bool  onlyFrontObjectPoints = true,
Scalar initialRobustError = nullptr,
Scalar finalRobustError = nullptr,
Scalars intermediateRobustErrors = nullptr 
)
static

Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) stereo fisheye camera frames, by minimizing the projection error between the 3D object point and the 2D image points.

The number of provided observations from the first (e.g., left) stereo camera can be different from the number of observations from the second (e.g., right) stereo camera. Beware: The given inverted and flipped 6DOF poses are not equivalent to a standard extrinsic camera matrix.

Parameters
anyCameraAThe fisheye camera profile of first (e.g., left) stereo images defining the projection between 3D object points and 2D image points, must be valid
anyCameraBThe fisheye camera profile of second (e.g., right) stereo images defining the projection between 3D object points and 2D image points, must be valid
flippedCamerasA_T_worldThe accessor for (inverted and flipped) 6-DOF camera poses of the first stereo camera frames, with poseAccessor_flippedCameraA_T_world.size() + poseAccessor_flippedCameraB_T_world.size() >= 2
flippedCamerasB_T_worldThe accessor for (inverted and flipped) 6-DOF camera poses of the second stereo camera frames, with poseAccessor_flippedCameraA_T_world.size() + poseAccessor_flippedCameraB_T_world.size() >= 2
worldObjectPointThe 3D object point to be optimized, defined in world
imagePointAccessorAThe accessor for the image points that are visible in individual first stereo camera frames (with poseAccessor_flippedCameraA_T_world.size() == imagePointAccessorA.size())
imagePointAccessorBThe accessor for the image points that are visible in individual second stereo camera frames (with poseAccessor_flippedCameraB_T_world.size() == imagePointAccessorB.size())
optimizedWorldObjectPointResulting optimized 3D object point, defined in world
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialRobustErrorOptional resulting averaged robust pixel error for the given initial parameters
finalRobustErrorOptional resulting averaged robust pixel error for the final optimized parameters
intermediateRobustErrorsOptional resulting averaged robust pixel errors for intermediate optimization iterations
Returns
True, if succeeded
See also
optimizeObjectPointForFixedPoses().

◆ optimizeObjectPointsAndOnePose()

bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsAndOnePose ( const PinholeCamera pinholeCamera,
const HomogenousMatrix4 firstPose,
const HomogenousMatrix4 secondPose,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ConstIndexedAccessor< Vector2 > &  firstImagePoints,
const ConstIndexedAccessor< Vector2 > &  secondImagePoints,
const bool  useDistortionParameters,
HomogenousMatrix4 optimizedSecondPose,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
inlinestatic

Optimizes the locations of 3D object points visible in two individual camera poses by minimizing the projection error between the 3D object points and the 2D image points.

The first pose is static while the second pose and the 3D point positions are dynamic so that they will be optimized.
The object points are visible in both frames.

Parameters
pinholeCameraThe pinhole camera profile defining the projection
firstPoseThe first (static and precise) pose, must be valid
secondPoseThe second (dynamic and rough) pose, must be valid
objectPointsThe accessor for the known (but rough) locations of the 3D object points
firstImagePointsThe accessor for the image points visible in the first frame, one image point for each object point (and with same order)
secondImagePointsThe accessor for the image points visible in the second frame, one image point for each object point (and with the same order)
useDistortionParametersTrue, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination
optimizedSecondPoseOptional resulting optimized camera pose for the second frame, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used to measure the pixel errors
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndOnePoseIF().

◆ optimizeObjectPointsAndOnePoseIF()

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsAndOnePoseIF ( const PinholeCamera pinholeCamera,
const HomogenousMatrix4 firstPoseIF,
const HomogenousMatrix4 secondPoseIF,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ConstIndexedAccessor< Vector2 > &  firstImagePoints,
const ConstIndexedAccessor< Vector2 > &  secondImagePoints,
const bool  useDistortionParameters,
HomogenousMatrix4 optimizedSecondPoseIF,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
static

Optimizes the locations of 3D object points visible in two individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points.

The first pose is static while the second pose and the 3D point positions are dynamic so that they will be optimized.
The object points are visible in both frames.

Parameters
pinholeCameraThe pinhole camera profile defining the projection
firstPoseIFThe first (static and precise) inverted and flipped pose, must be valid
secondPoseIFThe second (dynamic and rough) inverted and flipped pose, must be valid
objectPointsThe accessor for the known (but rough) locations of the 3D object points
firstImagePointsThe accessor for the image points visible in the first frame, one image point for each object point (and with same order)
secondImagePointsThe accessor for the image points visible in the second frame, one image point for each object point (and with the same order)
useDistortionParametersTrue, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination
optimizedSecondPoseIFOptional resulting optimized (inverted and flipped) camera pose for the second frame, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used to measure the pixel errors
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndOnePose().

◆ optimizeObjectPointsAndOrientationalPoses()

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsAndOrientationalPoses ( const ConstIndexedAccessor< const AnyCamera * > &  cameras,
const ConstIndexedAccessor< HomogenousMatrix4 > &  world_T_cameras,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
NonconstIndexedAccessor< HomogenousMatrix4 > *  world_T_optimizedCameras,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
static

Optimizes the locations of 3D object points visible in individual camera poses by minimizing the projection error between the 3D object points and the 2D image points.

The number of correspondences may vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result.
This function performs a Bundle Adjustment but does not modify the translations of camera poses.
The function supports a per-image camera profile (an individual camera profile for each individual image).

Parameters
camerasThe camera profiles defining the projection, one for each camera frame, must be valid
world_T_camerasThe accessor for the known (but rough) poses of the individual camera frames, transforming cameras to world, with default camera pointing towards the negative z-space with y-axis upwards, at least two
objectPointsThe accessor for the known (but rough) locations of the 3D object points, defined in world
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
world_T_optimizedCamerasOptional accessor for the resulting optimized camera poses, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndPoses(), NonLinearOptimization::ObjectPointToPoseIndexImagePointCorrespondenceAccessor.

◆ optimizeObjectPointsAndOrientationalPosesIF()

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsAndOrientationalPosesIF ( const ConstIndexedAccessor< const AnyCamera * > &  cameras,
const ConstIndexedAccessor< HomogenousMatrix4 > &  flippedCameras_T_world,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
NonconstIndexedAccessor< HomogenousMatrix4 > *  flippedOptimizedCameras_T_world,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
static

Optimizes the locations of 3D object points visible in individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points.

The number of correspondences may vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result. This function performs a Bundle Adjustment but does not modify the translations of camera poses.
The function supports a per-image camera profile (an individual camera profile for each individual image).

Parameters
camerasThe camera profiles defining the projection, one for each camera frame, must be valid
flippedCameras_T_worldThe accessor for the known (but rough) camera frames, with default camera pointing towards the positive z-space with y-axis downwards, at least two
objectPointsThe accessor for the known (but rough) locations of the 3D object points, defined in world
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
flippedOptimizedCameras_T_worldOptional accessor for the resulting optimized camera poses, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)s
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndPosesIF(), NonLinearOptimization::ObjectPointToPoseIndexImagePointCorrespondenceAccessor.

◆ optimizeObjectPointsAndOrientations()

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsAndOrientations ( const PinholeCamera pinholeCamera,
const ConstIndexedAccessor< SquareMatrix3 > &  orientations,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
const Scalar  objectPointDistance,
NonconstIndexedAccessor< SquareMatrix3 > *  optimizedOrientations,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
static

Optimizes the locations of 3D object points visible in individual camera poses all located at the origin with individual orientations by minimizing the projection error between the 3D object points and the 2D image points.

Further, this function optimized the orientation of the individual camera poses.
The number of correspondences may vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result.

Parameters
pinholeCameraThe pinhole camera profile defining the projection
orientationsThe accessor for the known (but rough) orientations of the individual camera frames
objectPointsThe accessor for the known (but rough) locations of the 3D object points
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
objectPointDistanceThe distance between the origin and the 3D object points, with range (0, infinity)
optimizedOrientationsOptional accessor for the resulting optimized camera orientations, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded

◆ optimizeObjectPointsAndPoses() [1/2]

bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsAndPoses ( const AnyCamera camera,
const ConstIndexedAccessor< HomogenousMatrix4 > &  world_T_cameras,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
NonconstIndexedAccessor< HomogenousMatrix4 > *  world_T_optimizedCameras,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
inlinestatic

Optimizes the locations of 3D object points visible in individual camera poses by minimizing the projection error between the 3D object points and the 2D image points.

The number of correspondences may vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result.
This function performs a classic Bundle Adjustment using a per-session camera profile (the same identical camera profile for all individual images).

Parameters
cameraThe camera profile defining the projection for all camera frames, must be valid
world_T_camerasThe accessor for the known (but rough) poses of the individual camera frames, transforming cameras to world, with default camera pointing towards the negative z-space with y-axis upwards, at least two
objectPointsThe accessor for the known (but rough) locations of the 3D object points, defined in world
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
world_T_optimizedCamerasOptional accessor for the resulting optimized camera poses, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndPosesIF(), NonLinearOptimization::ObjectPointToPoseIndexImagePointCorrespondenceAccessor.

◆ optimizeObjectPointsAndPoses() [2/2]

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsAndPoses ( const ConstIndexedAccessor< const AnyCamera * > &  cameras,
const ConstIndexedAccessor< HomogenousMatrix4 > &  world_T_cameras,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
NonconstIndexedAccessor< HomogenousMatrix4 > *  world_T_optimizedCameras,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
static

Optimizes the locations of 3D object points visible in individual camera poses by minimizing the projection error between the 3D object points and the 2D image points.

The number of correspondences may vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result.
This function performs a classic Bundle Adjustment using a per-image camera profile (an individual camera profile for each individual image).

Parameters
camerasThe camera profiles defining the projection, one for each camera frame, must be valid
world_T_camerasThe accessor for the known (but rough) poses of the individual camera frames, transforming cameras to world, with default camera pointing towards the negative z-space with y-axis upwards, at least two
objectPointsThe accessor for the known (but rough) locations of the 3D object points, defined in world
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
world_T_optimizedCamerasOptional accessor for the resulting optimized camera poses, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndPosesIF(), optimizeObjectPointsAndOrientationalPoses(), NonLinearOptimization::ObjectPointToPoseIndexImagePointCorrespondenceAccessor.

◆ optimizeObjectPointsAndPosesIF() [1/2]

bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsAndPosesIF ( const AnyCamera camera,
const ConstIndexedAccessor< HomogenousMatrix4 > &  flippedCameras_T_world,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
NonconstIndexedAccessor< HomogenousMatrix4 > *  flippedOptimizedCameras_T_world,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
inlinestatic

Optimizes the locations of 3D object points visible in individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points.

The number of correspondences may vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result.
This function performs a classic Bundle Adjustment using a per-session camera profile (the same identical camera profile for all individual images).

Parameters
cameraThe camera profile defining the projection for all camera frames, must be valid
flippedCameras_T_worldThe accessor for the known (but rough) camera frames, with default camera pointing towards the positive z-space with y-axis downwards, at least two
objectPointsThe accessor for the known (but rough) locations of the 3D object points, defined in world
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
flippedOptimizedCameras_T_worldOptional accessor for the resulting optimized camera poses, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)s
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndPoses(), NonLinearOptimization::ObjectPointToPoseIndexImagePointCorrespondenceAccessor.

◆ optimizeObjectPointsAndPosesIF() [2/2]

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsAndPosesIF ( const ConstIndexedAccessor< const AnyCamera * > &  cameras,
const ConstIndexedAccessor< HomogenousMatrix4 > &  flippedCameras_T_world,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
NonconstIndexedAccessor< HomogenousMatrix4 > *  flippedOptimizedCameras_T_world,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
static

Optimizes the locations of 3D object points visible in individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points.

The number of correspondences may vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result. This function performs a classic Bundle Adjustment using a per-image camera profile (an individual camera profile for each individual image).

Parameters
camerasThe camera profiles defining the projection, one for each camera frame, must be valid
flippedCameras_T_worldThe accessor for the known (but rough) camera frames, with default camera pointing towards the positive z-space with y-axis downwards, at least two
objectPointsThe accessor for the known (but rough) locations of the 3D object points, defined in world
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
flippedOptimizedCameras_T_worldOptional accessor for the resulting optimized camera poses, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)s
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndPoses(), optimizeObjectPointsAndOrientationalPosesIF(), NonLinearOptimization::ObjectPointToPoseIndexImagePointCorrespondenceAccessor.

◆ optimizeObjectPointsAndTwoPoses()

bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsAndTwoPoses ( const PinholeCamera pinholeCamera,
const HomogenousMatrix4 firstPose,
const HomogenousMatrix4 secondPose,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ConstIndexedAccessor< Vector2 > &  firstImagePoints,
const ConstIndexedAccessor< Vector2 > &  secondImagePoints,
const bool  useDistortionParameters,
HomogenousMatrix4 optimizedFirstPose,
HomogenousMatrix4 optimizedSecondPose,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Estimator::EstimatorType  estimator = Estimator::ET_SQUARE,
Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
const Matrix invertedFirstCovariances = nullptr,
const Matrix invertedSecondCovariances = nullptr,
Scalars intermediateErrors = nullptr 
)
inlinestatic

Optimizes the locations of 3D object points visible in two individual camera poses by minimizing the projection error between the 3D object points and the 2D image points.

Both camera poses and the 3D point positions are dynamic.
The object points are visible in both frames.

Parameters
pinholeCameraThe pinhole camera object defining the projection between 3D object points and 2D image points
firstPoseThe first pose to optimize, must be valid
secondPoseThe second pose to optimize, must be valid
objectPointsThe accessor for the known (but rough) locations of the 3D object points
firstImagePointsThe accessor for the image points visible in the first frame, one image point for each object point (and with same order)
secondImagePointsThe accessor for the image points visible in the second frame, one image point for each object point (and with the same order)
useDistortionParametersTrue, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination
optimizedFirstPoseOptional resulting optimized camera pose for the first frame, nullptr otherwise
optimizedSecondPoseOptional resulting optimized camera pose for the second frame, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used to measure the pixel errors
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
invertedFirstCovariancesOptional set of 2x2 inverted covariance matrices that represent the uncertainties of the first image points (a 2*n x 2 matrix)
invertedSecondCovariancesOptional set of 2x2 inverted covariance matrices that represent the uncertainties of the second image points (a 2*n x 2 matrix)
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndTwoPosesIF().

◆ optimizeObjectPointsAndTwoPosesIF()

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsAndTwoPosesIF ( const PinholeCamera pinholeCamera,
const HomogenousMatrix4 firstPoseIF,
const HomogenousMatrix4 secondPoseIF,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ConstIndexedAccessor< Vector2 > &  firstImagePoints,
const ConstIndexedAccessor< Vector2 > &  secondImagePoints,
const bool  useDistortionParameters,
HomogenousMatrix4 optimizedFirstPoseIF,
HomogenousMatrix4 optimizedSecondPoseIF,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Estimator::EstimatorType  estimator = Estimator::ET_SQUARE,
Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
const Matrix invertedFirstCovariances = nullptr,
const Matrix invertedSecondCovariances = nullptr,
Scalars intermediateErrors = nullptr 
)
static

Optimizes the locations of 3D object points visible in two individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points.

Both camera poses and the 3D point positions are dynamic.
The object points are visible in both frames.

Parameters
pinholeCameraThe pinhole camera object defining the projection between 3D object points and 2D image points
firstPoseIFThe first inverted and pose to optimize, must be valid
secondPoseIFThe second inverted and pose to optimize, must be valid
objectPointsThe accessor for the known (but rough) locations of the 3D object points
firstImagePointsThe accessor for the image points visible in the first frame, one image point for each object point (and with same order)
secondImagePointsThe accessor for the image points visible in the second frame, one image point for each object point (and with the same order)
useDistortionParametersTrue, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination
optimizedFirstPoseIFOptional resulting optimized inverted and camera pose for the first frame, nullptr otherwise
optimizedSecondPoseIFOptional resulting optimized inverted and camera pose for the second frame, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used to measure the pixel errors
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
invertedFirstCovariancesOptional set of 2x2 inverted covariance matrices that represent the uncertainties of the first image points (a 2*n x 2 matrix)
invertedSecondCovariancesOptional set of 2x2 inverted covariance matrices that represent the uncertainties of the second image points (a 2*n x 2 matrix)
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndTwoPoses().

◆ optimizeObjectPointsForFixedPoses()

bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsForFixedPoses ( const PinholeCamera pinholeCamera,
const ConstIndexedAccessor< HomogenousMatrix4 > &  poseAccessor,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
const bool  distortImagePoints,
NonconstIndexedAccessor< Vector3 > &  optimizedObjectPoints,
const unsigned int  iterations = 5u,
const Estimator::EstimatorType  estimator = Estimator::ET_SQUARE,
Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = 10,
const bool  onlyFrontObjectPoints = true,
Worker worker = nullptr 
)
inlinestatic

Minimizes the projection errors of given 3D object points, visible in several individual (fixed) camera frames, by minimizing the projection error between the 3D object point and the 2D image points.

The given 6DOF poses are standard extrinsic camera matrix.
The number of correspondences can vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result.

Parameters
pinholeCameraThe pinhole camera object defining the projection between 3D object points and 2D image points
poseAccessorThe accessor for the known (and fixed) poses of the individual camera frames
objectPointsThe accessor for the known (but rough) locations of the 3D object points
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
distortImagePointsTrue, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination
optimizedObjectPointsAccessor for the resulting optimized 3D object points locations
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
workerOptional worker object to distribute the computation
Returns
True, if succeeded
See also
optimizeObjectPointsForFixedPosesIF().

◆ optimizeObjectPointsForFixedPosesIF()

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsForFixedPosesIF ( const PinholeCamera pinholeCamera,
const ConstIndexedAccessor< HomogenousMatrix4 > &  invertedFlippedPoses,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
const bool  distortImagePoints,
NonconstIndexedAccessor< Vector3 > &  optimizedObjectPoints,
const unsigned int  iterations = 5u,
const Estimator::EstimatorType  estimator = Estimator::ET_SQUARE,
Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = 10,
const bool  onlyFrontObjectPoints = true,
Worker worker = nullptr 
)
static

Minimizes the projection errors of given 3D object points, visible in several individual (fixed) camera frames, by minimizing the projection error between the 3D object point and the 2D image points.

Beware: The given inverted and flipped 6DOF poses are not equivalent to a standard extrinsic camera matrix.
The number of correspondences can vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result.

Parameters
pinholeCameraThe pinhole camera object defining the projection between 3D object points and 2D image points
invertedFlippedPosesThe accessor for the known (and fixed) poses of the individual camera frames
objectPointsThe accessor for the known (but rough) locations of the 3D object points
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
distortImagePointsTrue, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination
optimizedObjectPointsAccessor for the resulting optimized 3D object points locations
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
workerOptional worker object to distribute the computation
Returns
True, if succeeded
See also
optimizeObjectPointsForFixedPoses().

◆ optimizeObjectPointsForFixedPosesIFSubset()

static void Ocean::Geometry::NonLinearOptimizationObjectPoint::optimizeObjectPointsForFixedPosesIFSubset ( const PinholeCamera pinholeCamera,
const ConstIndexedAccessor< HomogenousMatrix4 > *  invertedFlippedPoses,
const ConstIndexedAccessor< Vector3 > *  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
const bool  distortImagePoints,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Estimator::EstimatorType  estimator,
Scalar  lambda,
const Scalar  lambdaFactor,
const bool  onlyFrontObjectPoints,
const unsigned int  firstObjectPoint,
const unsigned int  numberObjectPoints 
)
staticprotected

Minimizes the projection errors of a subset of given 3D object points, visible in several individual (fixed) camera frames, by minimizing the projection error between the 3D object point and the 2D image points.

Beware: The given inverted and flipped 6DOF poses are not equivalent to a standard extrinsic camera matrix.

Parameters
pinholeCameraThe pinhole camera object defining the projection between 3D object points and 2D image points
invertedFlippedPosesThe accessor for the known (and fixed) poses of the individual camera frames
objectPointsThe accessor for the known (but rough) locations of the 3D object points
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
distortImagePointsTrue, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination
optimizedObjectPointsResulting optimized 3D object points, the caller must provide enough memory to store the optimized 3D points
iterationsNumber of iterations to be applied at most, if no convergence can be reached
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
firstObjectPointThe first object point to be handled
numberObjectPointsThe number of object points to be handled
See also
optimizeObjectPointsForFixedPosesIF().

◆ slowOptimizeObjectPointsAndPoses() [1/2]

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::slowOptimizeObjectPointsAndPoses ( const AnyCamera camera,
const ConstIndexedAccessor< HomogenousMatrix4 > &  world_T_cameras,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
NonconstIndexedAccessor< HomogenousMatrix4 > *  world_T_optimizedCameras,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
staticprotected

This function is a slow implementation and has been replaced by a faster implementation.

The code remains for demonstration and evaluation purposes.
Optimizes the locations of 3D object points visible in individual camera poses by minimizing the projection error between the 3D object points and the 2D image points.
The number of correspondences may vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result.

Parameters
cameraThe camera profile defining the projection, must be valid
world_T_camerasThe accessor for the known (but rough) poses of the individual camera frames, transforming cameras to world, with default camera pointing towards the negative z-space with y-axis upwards, at least two
objectPointsThe accessor for the known (but rough) locations of the 3D object points, defined in world
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
world_T_optimizedCamerasOptional accessor for the resulting optimized camera poses, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndPoses, optimizeObjectPointsAndPosesIF(), NonLinearOptimization::ObjectPointToPoseIndexImagePointCorrespondenceAccessor.

◆ slowOptimizeObjectPointsAndPoses() [2/2]

bool Ocean::Geometry::NonLinearOptimizationObjectPoint::slowOptimizeObjectPointsAndPoses ( const PinholeCamera pinholeCamera,
const ConstIndexedAccessor< HomogenousMatrix4 > &  poses,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
const bool  useDistortionParameters,
NonconstIndexedAccessor< HomogenousMatrix4 > *  optimizedPoses,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
inlinestaticprotected

Deprecated.

This function is a slow implementation and has been replaced by a faster implementation. The code remains for demonstration and evaluation purposes.
Optimizes the locations of 3D object points visible in individual camera poses by minimizing the projection error between the 3D object points and the 2D image points.
The number of correspondences may vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result.

Parameters
pinholeCameraThe pinhole camera profile defining the projection
posesThe accessor for the known (but rough) poses of the individual camera frames
objectPointsThe accessor for the known (but rough) locations of the 3D object points
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
useDistortionParametersTrue, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination
optimizedPosesOptional accessor for the resulting optimized camera poses, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndPoses, optimizeObjectPointsAndPosesIF(), NonLinearOptimization::ObjectPointToPoseIndexImagePointCorrespondenceAccessor.

◆ slowOptimizeObjectPointsAndPosesIF() [1/2]

static bool Ocean::Geometry::NonLinearOptimizationObjectPoint::slowOptimizeObjectPointsAndPosesIF ( const AnyCamera camera,
const ConstIndexedAccessor< HomogenousMatrix4 > &  flippedCameras_T_world,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
NonconstIndexedAccessor< HomogenousMatrix4 > *  flippedOptimizedCameras_T_world,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
staticprotected

This function is a slow implementation and has been replaced by a faster implementation.

The code remains for demonstration and evaluation purposes.
Optimizes the locations of 3D object points visible in individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points.
The number of correspondences may vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result.

Parameters
cameraThe camera profile defining the projection, must be valid
flippedCameras_T_worldThe accessor for the known (but rough) camera frames, with default camera pointing towards the positive z-space with y-axis downwards, at least two
objectPointsThe accessor for the known (but rough) locations of the 3D object points, defined in world
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
flippedOptimizedCameras_T_worldOptional accessor for the resulting optimized camera poses, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndPosesIF, slowOptimizeObjectPointsAndPoses(), NonLinearOptimization::ObjectPointToPoseIndexImagePointCorrespondenceAccessor.

◆ slowOptimizeObjectPointsAndPosesIF() [2/2]

bool Ocean::Geometry::NonLinearOptimizationObjectPoint::slowOptimizeObjectPointsAndPosesIF ( const PinholeCamera pinholeCamera,
const ConstIndexedAccessor< HomogenousMatrix4 > &  posesIF,
const ConstIndexedAccessor< Vector3 > &  objectPoints,
const ObjectPointGroupsAccessor correspondenceGroups,
const bool  useDistortionParameters,
NonconstIndexedAccessor< HomogenousMatrix4 > *  optimizedPosesIF,
NonconstIndexedAccessor< Vector3 > *  optimizedObjectPoints,
const unsigned int  iterations,
const Geometry::Estimator::EstimatorType  estimator = Geometry::Estimator::ET_SQUARE,
const Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
const bool  onlyFrontObjectPoints = true,
Scalar initialError = nullptr,
Scalar finalError = nullptr,
Scalars intermediateErrors = nullptr 
)
inlinestaticprotected

Deprecated.

This function is a slow implementation and has been replaced by a faster implementation. The code remains for demonstration and evaluation purposes.
Optimizes the locations of 3D object points visible in individual (inverted and flipped) camera poses by minimizing the projection error between the 3D object points and the 2D image points.
The number of correspondences may vary between the individual frames (groups).
Each group may address individual object points, however the larger the intersection of sets between the individual 3D object points in the individual frames the better the optimization result.

Parameters
pinholeCameraThe pinhole camera profile defining the projection
posesIFThe accessor for the known (but rough) inverted and flipped poses of the individual camera frames
objectPointsThe accessor for the known (but rough) locations of the 3D object points
correspondenceGroupsThe accessor for the individual groups of correspondences between pose indices and image point location, one group for each object point
useDistortionParametersTrue, to force the usage of the distortion parameters of the given camera object to distort the projected 2D image points before error determination
optimizedPosesIFOptional accessor for the resulting optimized camera poses, nullptr otherwise
optimizedObjectPointsOptional accessor for the resulting optimized 3D object points locations, nullptr otherwise
iterationsNumber of iterations to be applied at most, if no convergence can be reached, with range [1, infinity)
estimatorRobust error estimator to be used
lambdaInitial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity)
lambdaFactorLevenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity)
onlyFrontObjectPointsTrue, to avoid that the optimized 3D position lies behind any camera
initialErrorOptional resulting averaged pixel error for the given initial parameters, in relation to the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, in relation to the defined estimator
intermediateErrorsOptional resulting intermediate (improving) errors
Returns
True, if succeeded
See also
optimizeObjectPointsAndPosesIF, slowOptimizeObjectPointsAndPoses(), NonLinearOptimization::ObjectPointToPoseIndexImagePointCorrespondenceAccessor.

The documentation for this class was generated from the following file: