Public Types | |
enum | ERobustFunction { Tukey, Talwar, Cauchy, Welsh } |
enum | ECConstType { CConst_Fixed, CConst_Classic, CConst_Robust } |
Public Methods | |
CMotion2DEstimator () | |
~CMotion2DEstimator () | |
bool | estimate (const CMotion2DPyramid &pyramid1, const CMotion2DPyramid &pyramid2, const short *support, short label, CMotion2DModel &model, bool useModelAsInitialization=false) |
bool | estimate (const CMotion2DPyramid &pyramid1, const CMotion2DPyramid &pyramid2, const unsigned char *support, unsigned char label, CMotion2DModel &model, bool useModelAsInitialization=false) |
float * | getWeights (int &n_rows, int &n_cols) |
void | setRobustEstimator (bool robust=true) |
void | setRobustFunction (ERobustFunction function=Tukey) |
void | setCConstant (ECConstType C_type=CConst_Fixed, double C=8.0) |
void | setNIterationMaxIRLS (int niter=8) |
void | setNIterationMaxLevel (int niter=7) |
void | setLevelParameterIntroduction (int level_const=-1, int level_affine=-1, int level_quadratic=-1) |
bool | setFirstEstimationLevel (unsigned level=3) |
unsigned | getFirstEstimationLevel () |
bool | setLastEstimationLevel (unsigned level=0) |
unsigned | getLastEstimationLevel () |
void | setReliableSupportRate (float rate=0.4) |
void | computeSupportSize (bool compute=true, float threshold=0.2f) |
bool | isSupportSizeComputed () |
bool | getSupportSize (double &size) |
void | computeResidualVariance (bool compute=false) |
bool | isResidualVarianceComputed () |
double | getResidualVariance () |
void | computeCovarianceMatrix (bool compute=false) |
bool | isCovarianceMatrixComputed () |
double * | getCovarianceMatrix (int &n_rows, int &n_cols) |
float * | getDFDDataAddress (int level, int &n_rows, int &n_cols) |
We consider the displaced frame difference corresponding to the motion model:
where
and
are two successive images,
the motion model to estimate (including a global intensity shift
to account for global illumination change) and
denotes the flow vector modeled at the image point
.
To ensure the goal of robustness, we introduce a M-estimation criterion with a hard-redescending robust estimator. Thus, the motion model is given by:
where
is the Tukey, Talwar, Cauchy or Welsh biweight function which is bounded for high values of
and
a scale parameter to be set.
The estimation support
usually consists of the whole image. If required, it can also be restricted to a specific area of the image. The minimization is embedded in a multiresolution and incremental scheme based on the Gauss-Newton method. At each incremental step
(at a given resolution level, or from a resolution level to a finer one), we have:
where
is the current estimate of the parameter vector
. A linearization of
around
is performed, leading to the expression
linear with respect to
:
where
denotes the spatial gradient of the intensity function at location
and at time
. Then, we substitute for the minimization of
the minimization of the expression given by:
which is equivalent to minimizing:
with
where
is the derivative of the
function. The error function
is minimized using an Iterative-Reweighted-Least-Squares procedure, with 0 as an initial value for
. For more details about the method and its performances, see the Motion-2D related references.
|
Describes the way in which the
At the beginning of the process, the estimator must be rather tolerant to outliers; thus,
|
|
Defines implemented robust functions
|
|
Constructs a robust multiresolution estimator by implementing the iterative reweighted least squares (IRLS) technique. |
|
Destructs the multiresolution estimator, deleting all allocated memory. |
|
If compute is true, computes the covariance matrix of the estimated 2D polynomial motion model parameters.
|
|
If compute is set as true, the residual variance of the estimated 2D polynomial motion model parameters is computed.
|
|
If compute is set as true, the normalized support size evaluated from the weights The threshold value must belong to [0; 1[.
|
|
Implements the estimation of a 2D parametric motion model.
This method differs from estimate(const CMotion2DPyramid &, const CMotion2DPyramid &, const short *, short, CMotion2DModel &) only in the type of the estimation support Return true if the estimation process succeeds, false otherwise.
|
|
Implements the estimation of a 2D parametric motion model. Depending on setRobustEstimator() two different schemes can be used: either involving a robust multiresolution estimation implementing the IRLS technique, or involving a multiresolution least-mean-square estimation.
The estimation process is performed between images
The parameter support refers to the estimation support An initialization of the motion model parameters does not affect the results. That means that the parameters of the motion model given as input are not used to initialize the estimator. This function returns the estimated 2D parametric motion model in model. The returned parameters have to be considered for the highest resolution in the pyramids (level = 0) even if the last level considered in the estimation process is different when specified for example with setLastEstimationLevel(1). If the estimation process is stopped at a pyramid level different from 0, a projection of the motion model parameter to level 0 is performed. For the projection from one given level to the next finer one, the constant parameters of the model are multiplied by 2, the affine parameters are unchanged and the quadratic parameters are divided by 2. The weight map can be obtained by getWeights(). Returns true if the estimation process succeeds, false otherwise.
|
|
Updates the address of the covariance matrix containing the covariance terms of the estimated parameters. The covariance matrix is bidimentional, with MAXCOEFSMODEL rows and MAXCOEFSMODEL colomns. If the matrix is not computed, the method returns NULL.
|
|
Get the address of the DFD map for the level given as argument. Updates the dimension of the map. |
|
Returns the pyramid level where the estimation process is started. Considerering the pyramids size, this level can be different from the level specified with setFirstEstimationLevel(). The returned value is updated after each call of the estimate() method.
|
|
Returns the pyramid level where the estimation process is stopped.
|
|
Returns the variance of the residual values.
|
|
Returns the normalized size of the estimated weight map. If the method returns true, the normalized support size is computed.
|
|
Returns a pointer to the map containing the weights The weight values are in [0; 1]. A value close to 1 indicates that the corresponding pixel is conforming to the dominant motion. A value close to 0 indicates that the pixel is considered as an outlier. This method is to use after a call to estimate().
|
|
Indicates if the covariance matrix of the estimated 2D motion model parameters is computed.
|
|
Indicates if the variance of the estimated 2D motion model parameters is computed. In fact, it is the variance of the last estimated parameter increment.
|
|
Indicates if the normalized support size is computed.
|
|
Sets the
|
|
Defines the pyramid first level where the estimation process is starting, with:
At the coarsest level l, no prior estimation is available. The weights are set to 1 and the mimimization is started using expression (1). A first estimate of Returns false if the requested level is not authorized, true otherwise.
|
|
Sets the pyramid level where the estimation process is stopped, with Returns false if the requested level is not authorized, true otherwise.
|
|
Sets the different pyramid levels where respectively the constant, affine and quadratic parameters of the 2D motion model will be first introduced and estimated. If a parameter is set to -1, the default level is used. |
|
Sets the maximal number of iterations in the iteratively reweighted least squares (IRLS) method. IRLS first consists in evaluating the residual
|
|
Sets the maximal number of iterations of IRLS performed at a given pyramid level l to estimate
|
|
Sets the support percentage (rate) for which the estimation is considered as reliable. It must be comprised between 0.f and 1.f. |
|
If robust is true, a robust estimator is used. Otherwise, a least-mean-square method is considered, where all the weights are set to 1.
|
|
Defines the robust function used in the weighted least-squares resolution (IRLS). ERobustFunction() gives the list of implemented functions.
|