Vista     Main Page   Class List   Function List   File List   Examples  


CMotion2DModel Class Reference

The CMotion2DModel class provides 2D parametric motion models. More...

List of all members.

Public Types

enum  { MDL_NMAX_COEF = 12 }

Public Methods

 CMotion2DModel ()
 CMotion2DModel (const CMotion2DModel &model)
 ~CMotion2DModel ()
void setOrigin (double row, double col)
void setIdModel (EIdModel id)
void setIdModel (string id)
void setVarLight (bool state, double parameter=0.0)
void setParameters (const double parameters[MDL_NMAX_COEF])
bool compose (CMotion2DModel model)
int getNParameters ()
int getDegre ()
void getParameters (double parameters[MDL_NMAX_COEF])
void reset ()
bool invert (CMotion2DModel &inv)
string idToString ()
bool changeRepere (double row, double col)
bool getDisplacement (double row, double col, double &d_row, double &d_col)
EIdModel getIdModel ()
bool getVarLight ()
bool getVarLight (double &parameter)
CMotion2DModel getModelLevel (int delta_level)
void getOrigin (double &row, double &col)
double operator[] (int n)
void operator= (const CMotion2DModel &model)


Detailed Description

The CMotion2DModel class provides 2D parametric motion models.

Using matrix notation, these models can always be written as:

which is linear with respect to the n motion parameters , and where denotes the spatial position of a point in , the flow vector given by the estimated motion model at point ; is a matrix, the form of which depends on the chosen model, but the coefficients of which depend only on the point coordinates.

The complete list of the 2D polynomial motion models available is given by the EIdModel() enum. It involves constant, affine, quadratic (complete or not), motion models.

Moreover, to take into account global illumination changes between two successive images, we have introduced the parameter .

Finally, the resulting implemented motion models are specified by parameters .

To initialize a motion model, use setOrigin() to define the reference point of the model, setIdModel() to specify the 2D polynomial model to use, eventually setParameters() to initialize the parameters of the model and setVarLight() to initialize .

See also:
setOrigin(), setIdModel(), setParameters(), setVarLight()
Examples:

Motion2D.cpp, and Warping.cpp.


Member Enumeration Documentation

anonymous enum
 

Maximal number of parameters for a 2D polynomial motion model.

Enumeration values:
MDL_NMAX_COEF  Maximal number of parameters


Constructor & Destructor Documentation

CMotion2DModel::CMotion2DModel  
 

Default constructor for 2D polynomial motion models.

CMotion2DModel::CMotion2DModel const CMotion2DModel &    model
 

Copy constructor for 2D polynomial motion models.

CMotion2DModel::~CMotion2DModel  
 

Destructor.


Member Function Documentation

bool CMotion2DModel::changeRepere double    row,
double    col
 

Transforms all the parameters of the 2D polynomial motion model from to where are the coordinates of the origin in .

Warning:
If used, the global illumination parameter is not affected by this function.
Returns true if success, false otherwise.

bool CMotion2DModel::compose CMotion2DModel    model
 

Computes the motion composition between the current motion model and another motion model passed as parameter to the function.

where denotes the current motion model parameters, and is the model parameter vector passed as parameter to the function.

The motion composition is only performed if the degree of the 2D polynomial motion models to manipulate are 0 or 1.

Returns true if success, false otherwise.

See also:
getDegre()

int CMotion2DModel::getDegre  
 

Returns the degree of the 2D polynomial motion model, either :

Returns -1 if the model is not recognized.

See also:
EIdModel

bool CMotion2DModel::getDisplacement double    row,
double    col,
double &    d_row,
double &    d_col
 

For a given motion model, supplies the displacement in pixels

for the specified point .

Returns:
true if success, false otherwise.

EIdModel CMotion2DModel::getIdModel   [inline]
 

Return the id of the 2D polynomial motion model. The complete list of the 2D polynomial motion models available is given by the EIdModel() enum

CMotion2DModel CMotion2DModel::getModelLevel int    delta_level
 

Returns a motion model where the 2D parametric motion model parameters and the model origin are transformed considering a relative pyramid level given as input by delta_level.

For example,

  • if delta_level is set to 0, returns the same motion model.
  • if delta_level is set to 1, returns a transformed motion model where the constant parameters are divided by 2 and the quadratic terms are multiplied by 2. The model origin coordinates are divided by two.
  • if delta_level is set to -1, returns a transformed motion model where the constant parameters are multiplied by 2 and the quadratic terms are divided by 2. The model origin coordinates are multiplied by two.
Examples:
Motion2D.cpp.

int CMotion2DModel::getNParameters  
 

Returns the number of parameters describing the 2D polynomial motion model.

Warning:
If the motion model involves the global illumination parameter, the value returned does not take it into account.
See also:
EIdModel()

void CMotion2DModel::getOrigin double &    row,
double &    col
[inline]
 

Returns the origin coordinates: .

See also:
setOrigin()
Examples:
Motion2D.cpp, and Warping.cpp.

void CMotion2DModel::getParameters double    parameters[MDL_NMAX_COEF]
 

Returns all the CMotion2DModel::MDL_NMAX_COEF parameter values corresponding to the 2D polynomial motion model. The unused parameters are set to zero.

Warning:
For a given motion model, the number of parameters of the polynomial model is accessible with getNParameters().
Warning:
If the global illumination variation is estimated, the corresponding value is given by getVarLight().
The general form of the model is given by:

The table below gives the correspondence between the value of n and the corresponding parameter of the model.

See also:
getVarLight(), getNParameters(), operator[]()
Examples:
Motion2D.cpp, and Warping.cpp.

bool CMotion2DModel::getVarLight double &    parameter
 

Indicates if the global illumination variation parameter is used. Returns true if the motion model involves it, and false otherwise. If true, the parameter parameter contains the value of .

See also:
setVarLight()

bool CMotion2DModel::getVarLight  
 

Indicates if the global illumination variation parameter is used. Returns true if the motion model involves this illumination parameter, and false otherwise.

See also:
setVarLight()
Examples:
Motion2D.cpp.

string CMotion2DModel::idToString  
 

Returns a string describing the id motion model.

Examples:
Motion2D.cpp, and Warping.cpp.

bool CMotion2DModel::invert CMotion2DModel &    inv
 

Computes the inverse motion model. This transformation is only available for constant or affine motion models.

Returns:
true if success, false otherwise.

void CMotion2DModel::operator= const CMotion2DModel &    model
 

Assigns a copy of model to this motion model and returns a reference to this motion model.

double CMotion2DModel::operator[] int    n [inline]
 

Returns the parameter n of the 2D polynomial motion model. The number of parameters associated to a given 2D motion model is accessible with getNParameters().

Warning:
If the global illumination variation is estimated, the corresponding value is given by getVarLight().
The general form of the model is given by:

The table below gives the correspondence between the value of n and the corresponding parameter of the model.

See also:
getVarLight(), getNParameters(), getParameters()

void CMotion2DModel::reset  
 

Sets all the 2D polynomial motion model parameters and the global illumination variation parameter to zero.

See also:
setParameters(), setVarLight()
Examples:
Motion2D.cpp, and Warping.cpp.

void CMotion2DModel::setIdModel string    id
 

A model is defined for a given coordinated system origin , by its id and eventually by an additional parameter corresponding to the global illumination variation. This method is used to specify the model id. The complete list of the 2D polynomial motion models available is given by the EIdModel() enum.

The relation between the string id and the polynomial motion model id is given below:

string id EIdModel model Id
TX or MDL_TX EIdModel::MDL_TX
TY or MDL_TY EIdModel::MDL_TY
TR or MDL_TR EIdModel::MDL_TR
AXD or MDL_AFF_TX_DIV EIdModel::MDL_AFF_TX_DIV
ARD or MDL_AFF_TR_DIV EIdModel::MDL_AFF_TR_DIV
ARR or MDL_AFF_TR_ROT EIdModel::MDL_AFF_TR_ROT
AXN or MDL_AFF_TX_NULL EIdModel::MDL_AFF_TX_NULL
AYN or MDL_AFF_TY_NULL EIdModel::MDL_AFF_TY_NULL
ADN or MDL_AFF_DIV_NULL EIdModel::MDL_AFF_DIV_NULL
ARN or MDL_AFF_ROT_NULL EIdModel::MDL_AFF_ROT_NULL
AH1N or MDL_AFF_HYP1_NULL EIdModel::MDL_AFF_HYP1_NULL
AH2N or MDL_AFF_HYP2_NULL EIdModel::MDL_AFF_HYP2_NULL
ARRD or MDL_AFF_TR_ROT_DIV EIdModel::MDL_AFF_TR_ROT_DIV
AC or MDL_AFF_COMPLET EIdModel::MDL_AFF_COMPLET
QPD or MDL_QUA_PAN_DIV EIdModel::MDL_QUA_PAN_DIV
QPT or MDL_QUA_PAN_TILT EIdModel::MDL_QUA_PAN_TILT
QPTD or MDL_QUA_PAN_TILT_DIV EIdModel::MDL_QUA_PAN_TILT_DIV
Q2D or MDL_QUA_2D EIdModel::MDL_QUA_2D
QC or MDL_QUA_COMPLET EIdModel::MDL_QUA_COMPLET

See also:
setIdModel(EIdModel), getIdModel(), setOrigin(), setVarLight()

void CMotion2DModel::setIdModel EIdModel    id
 

A model is defined for a given coordinated system origin , by its id and eventually by an additional parameter corresponding to the global illumination variation. This method is used to specify the model id. The complete list of the 2D polynomial motion models available is given by the EIdModel() enum.

See also:
setIdModel(string), getIdModel(), setOrigin(), setVarLight()
Examples:
Motion2D.cpp, and Warping.cpp.

void CMotion2DModel::setOrigin double    row,
double    col
 

A model is defined for a given coordinated system origin , by its id and eventually by an additional parameter corresponding to the global illumination variation. This method is used to specify the image coordinate system origin. If the origin is not specified (i.e., row = -1 and col = -1) the origin corresponds to the center of the support, otherwise .

See also:
getOrigin(), setIdModel(), setVarLight()
Examples:
Motion2D.cpp, and Warping.cpp.

void CMotion2DModel::setParameters const double    parameters[MDL_NMAX_COEF]
 

Sets the 2D parametric motion model parameters. The number of parameters can be known by using getNParameters().

The general form of the model is given by:

The table below gives the correspondence between the index of the table parameters[index] and the corresponding parameter of the model.

See also:
getNParameters(), setVarLight()
Examples:
Motion2D.cpp, and Warping.cpp.

void CMotion2DModel::setVarLight bool    state,
double    parameter = 0.0
 

A model is defined for a given coordinated system origin , by its id and eventually by an additional parameter corresponding to the global illumination variation. This method is used to specify if the model involves or not the global illumination parameter and to eventually set the global illumination variation parameter.

See also:
setOrigin(), setIdModel(), setParameters(), getVarLight(), getVarLight(double &)
Examples:
Motion2D.cpp, and Warping.cpp.


The documentation for this class was generated from the following files:
Motion2D is Copyright © 1995-2005 by Inria
This documentation was generated on 31 Jan 2005 by Fabien Spindler for Motion2D 1.3.11 using doxygen1.2.18 written by Dimitri van Heesch, © 1997-2005