Ocean
Ocean::Geometry::NonLinearOptimizationLine Class Reference

This class implements least square or robust optimization algorithms optimizing lines. More...

Inheritance diagram for Ocean::Geometry::NonLinearOptimizationLine:

Static Public Member Functions

static bool optimizeLine (const Line2 &line, const ConstIndexedAccessor< ImagePoint > &pointAccessor, Line2 &optimizedLine, const unsigned int iterations=20u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), Scalar *initialError=nullptr, Scalar *finalError=nullptr)
 Optimizes a 2D line by reducing the distance between image points and their projected line points. More...
 

Additional Inherited Members

- 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 lines.

Member Function Documentation

◆ optimizeLine()

static bool Ocean::Geometry::NonLinearOptimizationLine::optimizeLine ( const Line2 line,
const ConstIndexedAccessor< ImagePoint > &  pointAccessor,
Line2 optimizedLine,
const unsigned int  iterations = 20u,
const Estimator::EstimatorType  estimator = Estimator::ET_SQUARE,
Scalar  lambda = Scalar(0.001),
const Scalar  lambdaFactor = Scalar(5),
Scalar initialError = nullptr,
Scalar finalError = nullptr 
)
static

Optimizes a 2D line by reducing the distance between image points and their projected line points.

Parameters
lineLine that has to be optimized
pointAccessorThe accessor providing the 2D points that define the 2D line, at least two points
optimizedLineResulting optimized line with reduced (optimized) distance between image points and projected line points
iterationsNumber of iterations to be applied at most, if no convergence can be reached in the meantime, 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)
initialErrorOptional resulting averaged pixel error for the given initial parameters, w.r.t. the defined estimator
finalErrorOptional resulting averaged pixel error for the final optimized parameters, w.r.t. the defined estimator
Returns
Result of the optimization

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