IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Modules | Classes | Functions

Parametric model estimation. More...

Modules

 Geometric estimation 2d
 Parametric model estimation in geometric 2d case.
 
 Geometric estimation 3d
 Parametric model estimation in geometric 3d case.
 

Classes

class  ipsdk::math::BaseEstimator
 Base class for parametric estimation from data set. More...
 
class  ipsdk::math::BaseRobustEstimator
 Base class for parametric robust estimation from data set. More...
 
class  ipsdk::math::EstimationConfig
 Configuration structure used for estimation management. More...
 
class  ipsdk::math::EstimationResults
 Structure allowing to encapsulate robust estimation results. More...
 
class  ipsdk::math::LMSRobustEstimator
 Robust Least Mean Square estimatorThis algorithm do not request any threshold for model estimation. It has an outlier ratio upper bound at 50% (<50%) More...
 
class  ipsdk::math::MLESACRobustEstimator
 Robust Maximum Likelihood Estimation SAmple Consensus estimatorThis algorithm request a threshold value on residuals of model estimation. It has no outlier ratio upper bound. More...
 
class  ipsdk::math::MSACRobustEstimator
 Robust M-estimator SAmple Consensus estimatorThis algorithm request a threshold value on residuals of model estimation. It has no outlier ratio upper bound. More...
 
class  ipsdk::math::RANSACRobustEstimator
 Robust RANdom SAmple Consensus estimatorThis algorithm request a threshold value on residuals of model estimation. It has no outlier ratio upper bound. More...
 

Functions

IPSDKMATH_API void ipsdk::math::processEstimation (const EstimationConfig &config, const EstimatorPtr &pEstimator, const DataSet &inputDataSet, EstimationResults &results)
 function allowing to launch a robust estimation process More...
 
IPSDKMATH_API void ipsdk::math::processEstimation (const EstimationConfig &config, const EstimatorPtr &pEstimator, const CostFunCreator &costFunCreator, const DataSet &inputDataSet, EstimationResults &results)
 function allowing to launch a robust estimation process completed with a non linear estimation More...
 

Detailed Description

Parametric model estimation.

Basic estimation

This section deals with processes allowing to estimate the values of model parameters based on measured data.

It will give some theorical and practical basis on parametric estimation under IPSDK. User should take a look to examples to start with these features.

A basic example of model parameter estimator is the case where an input cloud of 2d points is used to estimate parameters of underlying line 2d :

estimationBasicExample.png

In this case we use input 2d points coordinates $P = \{P_i\}_{i \in [1, N]} = \{x_i, y_i\}_{i \in [1, N]}$ to compute line parameters $\rho$ and $theta$ where points coordinates are supposed to respect the following equation :

\[ \cos(\theta) \times x_i + \sin(\theta) \times y_i = \rho, \forall i \]

A more realistic version of previous problem is illustrated by following figure :

estimationNoisyExample.png

where input 2d points are issued from a measure and do not perfectly fit searched 2d line.

A common assumption in this case is to consider that input measures are perturbated with an additive white gaussian noise :

\[ \forall i, \left \{ \begin{matrix} x^m_i = x_i + G(0, \sigma)\\ y^m_i = y_i + G(0, \sigma) \end{matrix} \right. \]

with :

Under this assumption, we can use technics such as linear least square regression to solve for model parameters. Such technics suppose that we are able to define a cost function $C$ which can be used to quantify an error between an input data set and parameters of an estimated model :

\[ C(X, D) = \sum_{i=1}^{N}{r^2(X, d_i)} \]

with :

In case of 2d lines, $X$ is define by $\rho$ and $\theta$ parameters and we can simply use orthogonal distance from input 2d points to estimated the line 2d as cost function :

\[ d(x^m_i, y^m_i, \rho, \theta) = \cos(\theta) \times x_i + \sin(\theta) \times y_i - \rho \]

Least square regression will then compute optimal (minimal) solution of following problem :

\[ C(\rho, \theta, P) = \sum_{i=1}^{N}{d^2(x^m_i, y^m_i, \rho, \theta)} \]

This cost function allows to derive the 'root mean square' (RMS) value associated to an estimation :

\[ RMS(X, D) = \sqrt{\frac{\sum_{i=1}^{N}{r^2(X, d_i)}}{N}} \]

This value can be used as a measure quality indicator.

This process can be represented by following diagram :

simpleEstimationProcess.png

A more complete description of Estimation theory and of linear regression concepts can be found here :

See also
https://en.wikipedia.org/wiki/Estimation_theory
https://en.wikipedia.org/wiki/Linear_regression.
https://en.wikipedia.org/wiki/Root_mean_square

Robust estimation

Overview

Suppose now that input data, in addition to an additive white gaussian noise, can be affected by outliers. Which means that we modify measured data definition as :

\[ \forall i, \left \{ \begin{matrix} x^m_i = x_i + G(0, \sigma) + O(p, r)\\ y^m_i = y_i + G(0, \sigma) + O(p, r) \end{matrix} \right. \]

with $O(p, r)$ a perturbation which will be take following value :

In this case previous technics may completly failed since input data are no more simply ruled by white gaussian noise hypothesis :

estimationSimpleFailureExample.png

In this case we can see that two outlier points introduce a strong bias in line 2d parameters estimation.

Such failure cases can be handle using robust estimation technics, which allow to detect outlier data and to remove it from estimation process :

estimationRobustExample.png

Red points stand for detected outliers in previous figure.

This process can be represented by following diagram :

robustEstimationProcess.png
See also
https://en.wikipedia.org/wiki/Robust_statistics

Available robust estimators

The following robust estimators are available for processing :

This algorithm do not need any assumption on a threshold value on residuals allowing to separate inliers and outlier. It has an outlier ratio break down point at 0.5 (this means that input collection should strictly contains less than 50% of outliers).

See also
Least Median of Squares Regression, PETER J. ROUSSEEUW, Journal of the American Statistical Association December 1984, Volume 79, Number 388 Theory and Methods Section.

This algorithm has the advantage to have no theorical outlier ratio break down point but uses an input user threshold value to separate inliers and outlier. This is historically the first version of this kind of algorithms. We recommand to use MSAC or MLESAC sub versions of this algorithm.

See also
https://en.wikipedia.org/wiki/Random_sample_consensus

This algorithm has the same properties as RANSAC algorithm but is more efficient for outliers filtering.

See also
P.H.S. Torr and A. Zisserman, MLESAC: A new robust estimator with application to estimating image geometry, Journal of Computer Vision and Image Understanding 78 (2000), no. 1, 138–156.

This is the more complex version of algorithms derived from RANSAC. It is more efficient than MSAC version but is a bit slower and more complex to configure.

See also
P.H.S. Torr and A. Zisserman, MLESAC: A new robust estimator with application to estimating image geometry, Journal of Computer Vision and Image Understanding 78 (2000), no. 1, 138–156.

Notes on data partition policy

Robust estimation is based on statistical random sub sampling of input data set with minimal size regards to solved problem.

In the case of a 2d line, a robust process will sample several couples of points. For each pairs a 2d line will be estimated and residuals on global input data set will be computed.

It is easy to see that random sampling of closed points is often a bad idea :

estimationNoBucket.png

To avoid such cases, we use a data partition policy which will associate to each input data a bucket. During robust estimation sub sampling stages we will then randomly choose a bucket and then randomly choose a data inside it with the guarantee that each random data for a given sub sampling are issued from a separate bucket.

We provide to algorithms for data partition:

Each axis is then divided into nbBucketsByAxis constant sized buckets between minimum and maximum data range along considered axis.

Each axis is once again divided into nbBucketsByAxis buckets between minimum and maximum data range but in this case each bucket contains a constant quantile of data for considered axis.

Note
adaptive grid algorithm is the default case

Function Documentation

◆ processEstimation() [1/2]

IPSDKMATH_API void ipsdk::math::processEstimation ( const EstimationConfig config,
const EstimatorPtr pEstimator,
const DataSet inputDataSet,
EstimationResults results 
)

function allowing to launch a robust estimation process

Exceptions
ipsdk::math::IPSDKMathExceptionif pEstimator.get() == 0 || pEstimator->isInit() == false
ipsdk::math::IPSDKMathExceptionif config.isInit() == false

◆ processEstimation() [2/2]

IPSDKMATH_API void ipsdk::math::processEstimation ( const EstimationConfig config,
const EstimatorPtr pEstimator,
const CostFunCreator costFunCreator,
const DataSet inputDataSet,
EstimationResults results 
)

function allowing to launch a robust estimation process completed with a non linear estimation

Exceptions
ipsdk::math::IPSDKMathExceptionif pEstimator.get() == 0 || pEstimator->isInit() == false
ipsdk::math::IPSDKMathExceptionif costFunCreator returns a null shared pointer
ipsdk::math::IPSDKMathExceptionif config.isInit() == false