ViSP  2.9.0

#include <vpMbTracker.h>

+ Inheritance diagram for vpMbTracker:

Public Member Functions

 vpMbTracker ()
 
virtual ~vpMbTracker ()
 
virtual void display (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, const unsigned int thickness=1, const bool displayFullModel=false)=0
 
virtual void display (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, const unsigned int thickness=1, const bool displayFullModel=false)=0
 
virtual void getCameraParameters (vpCameraParameters &camera) const
 
virtual vpMatrix getCovarianceMatrix () const
 
void getPose (vpHomogeneousMatrix &cMo_) const
 
vpHomogeneousMatrix getPose () const
 
virtual void init (const vpImage< unsigned char > &I)=0
 
virtual void initClick (const vpImage< unsigned char > &I, const std::string &initFile, const bool displayHelp=false)
 
virtual void initClick (const vpImage< unsigned char > &I, const std::vector< vpPoint > &points3D_list, const std::string &displayFile="")
 
virtual void initFromPoints (const vpImage< unsigned char > &I, const std::string &initFile)
 
virtual void initFromPoints (const vpImage< unsigned char > &I, const std::vector< vpImagePoint > &points2D_list, const std::vector< vpPoint > &points3D_list)
 
virtual void initFromPose (const vpImage< unsigned char > &I, const std::string &initFile)
 
virtual void initFromPose (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
 
virtual void initFromPose (const vpImage< unsigned char > &I, const vpPoseVector &cPo)
 
virtual void loadConfigFile (const std::string &configFile)=0
 
virtual void loadModel (const std::string &modelFile)
 
virtual void resetTracker ()=0
 
void savePose (const std::string &filename)
 
virtual void setCameraParameters (const vpCameraParameters &camera)
 
virtual void setCovarianceComputation (const bool &flag)
 
void setDisplayFeatures (const bool displayF)
 
virtual void setPose (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo)=0
 
void setPoseSavingFilename (const std::string &filename)
 
virtual void testTracking ()=0
 
virtual void track (const vpImage< unsigned char > &I)=0
 

Protected Member Functions

void computeJTR (const vpMatrix &J, const vpColVector &R, vpMatrix &JTR)
 
virtual void extractGroup (SoVRMLGroup *sceneGraphVRML2, vpHomogeneousMatrix &transform, unsigned int &indexFace)
 
virtual void extractFaces (SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, unsigned int &indexFace)
 
virtual void extractLines (SoVRMLIndexedLineSet *line_set)
 
virtual void extractCylinders (SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform)
 
vpPoint getGravityCenter (const std::vector< vpPoint > &_pts)
 
virtual void initCylinder (const vpPoint &p1, const vpPoint &p2, const double radius, const unsigned int indexCylinder=0)=0
 
virtual void initFaceFromCorners (const std::vector< vpPoint > &corners, const unsigned int indexFace=-1)=0
 
virtual void loadVRMLModel (const std::string &modelFile)
 
virtual void loadCAOModel (const std::string &modelFile)
 

Protected Attributes

vpCameraParameters cam
 
vpHomogeneousMatrix cMo
 
std::string modelFileName
 
bool modelInitialised
 
std::string poseSavingFilename
 
bool computeCovariance
 
vpMatrix covarianceMatrix
 
bool displayFeatures
 

Detailed Description

Main methods for a model-based tracker.

This class provides the main methods for a model based tracker. This pure virtual class must be used in inheritance for a tracker that compute the interaction matrix and the residu vector using a defined information (edge, points of interest, patch, ...)

This class intends to define a common basis for object tracking. This is realised by implementing the main functions:

  • init() : Initialisation of the tracker (it includes re-initialisation). This method is called at the end of the initClick() method.
  • initFaceFromCorners() : Initialisation of a face using its corners.
  • track() : Tracking on the current image
  • testTracking() : Test the tracking. This method throws exception if the tracking failed.
  • display() : Display the model and eventually other information.

In addition, two flags are declared in this class and may have to be initialised in the child class :

  • modelInitialised : flag to ensure that the model has been loaded. initialised (either by loading them from a configuration file or by setting them with the setCameraParameters() method).

Definition at line 102 of file vpMbTracker.h.

Constructor & Destructor Documentation

vpMbTracker::vpMbTracker ( )

Basic constructor. Set default values.

Definition at line 95 of file vpMbTracker.cpp.

vpMbTracker::~vpMbTracker ( )
virtual

Basic destructor that doest nothing.

Definition at line 104 of file vpMbTracker.cpp.

Member Function Documentation

void vpMbTracker::computeJTR ( const vpMatrix interaction,
const vpColVector error,
vpMatrix JTR 
)
protected

Compute $ J^T R $, with J the interaction matrix and R the vector of residu.

Exceptions
vpMatrixException::incorrectMatrixSizeErrorif the sizes of the matrices do not allow the computation.
Warning
The JTR matrix is resized.
Parameters
interaction: The interaction matrix (size Nx6).
error: The residu vector (size Nx1).
JTR: The resulting JTR matrix (size 6x1).

Definition at line 1433 of file vpMbTracker.cpp.

References vpMatrix::getCols(), vpMatrix::getRows(), vpMatrixException::incorrectMatrixSizeError, and vpMatrix::resize().

Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), and vpMbEdgeTracker::computeVVS().

virtual void vpMbTracker::display ( const vpImage< unsigned char > &  I,
const vpHomogeneousMatrix cMo,
const vpCameraParameters cam,
const vpColor col,
const unsigned int  thickness = 1,
const bool  displayFullModel = false 
)
pure virtual

Display the 3D model at a given position using the given camera parameters on a grey level image.

Parameters
I: The image.
cMo: Pose used to project the 3D model into the image.
cam: The camera parameters.
col: The desired color.
thickness: The thickness of the lines.
displayFullModel: If true, the full model is displayed (even the non visible surfaces).

Implemented in vpMbEdgeTracker, vpMbKltTracker, and vpMbEdgeKltTracker.

Referenced by initClick().

virtual void vpMbTracker::display ( const vpImage< vpRGBa > &  I,
const vpHomogeneousMatrix cMo,
const vpCameraParameters cam,
const vpColor col,
const unsigned int  thickness = 1,
const bool  displayFullModel = false 
)
pure virtual

Display the 3D model at a given position using the given camera parameters on a color (RGBa) image.

Parameters
I: The image.
cMo: Pose used to project the 3D model into the image.
cam: The camera parameters.
col: The desired color.
thickness: The thickness of the lines.
displayFullModel: If true, the full model is displayed (even the non visible surfaces).

Implemented in vpMbEdgeTracker, vpMbKltTracker, and vpMbEdgeKltTracker.

void vpMbTracker::extractCylinders ( SoVRMLIndexedFaceSet *  face_set,
vpHomogeneousMatrix transform 
)
protectedvirtual

Extract a cylinder to track from the VMRL model. This method calls the initCylinder() method implemented in the child class.

Warning
This method extract cylinder described using an indexed face set not a cylinder set since software such as AC3D or blender export a cylinder using this data type. the object name is used, if it begins with "cyl" then this method is called otherwise the extractFaces() is used.
Parameters
face_set: Pointer to the cylinder in the vrml format.
transform: Transformation matrix applied to the cylinder.

Definition at line 1282 of file vpMbTracker.cpp.

References vpException::badValue, vpException::dimensionError, vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), getGravityCenter(), initCylinder(), vpMath::maximum(), vpPoint::setWorldCoordinates(), and vpMatrix::sumSquare().

Referenced by extractGroup().

void vpMbTracker::extractFaces ( SoVRMLIndexedFaceSet *  face_set,
vpHomogeneousMatrix transform,
unsigned int &  indexFace 
)
protectedvirtual

Extract a face of the object to track from the VMRL model. This method calls the initFaceFromCorners() method implemented in the child class.

Parameters
face_set: Pointer to the face in the vrml format.
transform: Transformation matrix applied to the face.
indexFace: Face index.

Definition at line 1228 of file vpMbTracker.cpp.

References initFaceFromCorners(), and vpPoint::setWorldCoordinates().

Referenced by extractGroup().

void vpMbTracker::extractGroup ( SoVRMLGroup *  sceneGraphVRML2,
vpHomogeneousMatrix transform,
unsigned int &  indexFace 
)
protectedvirtual

Extract a VRML object Group.

Parameters
sceneGraphVRML2: Current node (either Transform, or Group node).
transform: Transformation matrix for this group.
indexFace: Index of the face.

Definition at line 1141 of file vpMbTracker.cpp.

References extractCylinders(), extractFaces(), and extractLines().

Referenced by loadVRMLModel().

void vpMbTracker::extractLines ( SoVRMLIndexedLineSet *  line_set)
protectedvirtual

Extract a line of the object to track from the VMRL model. This method calls the initFaceFromCorners() method implemented in the child class.

Parameters
line_set: Pointer to the line in the vrml format.

Definition at line 1378 of file vpMbTracker.cpp.

References initFaceFromCorners(), and vpPoint::setWorldCoordinates().

Referenced by extractGroup().

virtual void vpMbTracker::getCameraParameters ( vpCameraParameters camera) const
inlinevirtual

Get the camera parameters.

Parameters
camera: copy of the camera parameters used by the tracker.
Examples:
mbtEdgeKltTracking.cpp, mbtEdgeTracking.cpp, mbtKltTracking.cpp, tutorial-mb-edge-tracker.cpp, tutorial-mb-hybrid-tracker.cpp, and tutorial-mb-klt-tracker.cpp.

Definition at line 158 of file vpMbTracker.h.

virtual vpMatrix vpMbTracker::getCovarianceMatrix ( ) const
inlinevirtual

Get the covariance matrix.

Definition at line 163 of file vpMbTracker.h.

References vpTRACE.

vpPoint vpMbTracker::getGravityCenter ( const std::vector< vpPoint > &  pts)
protected

Compute the center of gravity of a set of point. This is used in the cylinder extraction to find the center of the circles.

Exceptions
vpException::dimensionErrorif the set is empty.
Parameters
pts: Set of point to extract the center of gravity.
Returns
Center of gravity of the set.

Definition at line 1349 of file vpMbTracker.cpp.

References vpException::dimensionError, vpPoint::get_oX(), and vpPoint::setWorldCoordinates().

Referenced by extractCylinders().

void vpMbTracker::getPose ( vpHomogeneousMatrix cMo_) const
inline

Get the current pose between the object and the camera. cMo is the matrix which can be used to express coordinates from the object frame to camera frame.

Parameters
cMo_: the pose
Examples:
mbtEdgeKltTracking.cpp, mbtEdgeTracking.cpp, mbtKltTracking.cpp, tutorial-mb-edge-tracker.cpp, tutorial-mb-hybrid-tracker.cpp, and tutorial-mb-klt-tracker.cpp.

Definition at line 177 of file vpMbTracker.h.

vpHomogeneousMatrix vpMbTracker::getPose ( ) const
inline

Get the current pose between the object and the camera. cMo is the matrix which can be used to express coordinates from the object frame to camera frame.

Returns
the current pose

Definition at line 186 of file vpMbTracker.h.

virtual void vpMbTracker::init ( const vpImage< unsigned char > &  I)
pure virtual

Initialise the tracking.

Parameters
I: Input image.

Implemented in vpMbEdgeTracker, vpMbEdgeKltTracker, and vpMbKltTracker.

Referenced by initClick(), initFromPoints(), and initFromPose().

void vpMbTracker::initClick ( const vpImage< unsigned char > &  I,
const std::string &  initFile,
const bool  displayHelp = false 
)
virtual

Initialise the tracking by clicking on the image points corresponding to the 3D points (object frame) in the file initFile. The structure of this file is (without the comments):

4 // Number of points in the file (minimum is four)
0.01 0.01 0.01 // \
... // | 3D coordinates in the object basis
0.01 -0.01 -0.01 // /
Parameters
I: Input image
initFile: File containing the points where to click
displayHelp: Optionnal display of an image ( 'initFile.ppm' ). This image may be used to show where to click.
Exceptions
vpException::ioError: The file specified in initFile doesn't exist.
See also
setPathNamePoseSaving()
Examples:
mbtEdgeKltTracking.cpp, mbtEdgeTracking.cpp, mbtKltTracking.cpp, tutorial-mb-edge-tracker.cpp, tutorial-mb-hybrid-tracker.cpp, and tutorial-mb-klt-tracker.cpp.

Definition at line 131 of file vpMbTracker.cpp.

References vpPose::addPoint(), vpException::badValue, vpHomogeneousMatrix::buildFrom(), vpMouseButton::button1, cam, vpPose::clearPoint(), cMo, vpPose::computePose(), vpPose::computeResidual(), vpPixelMeterConversion::convertPoint(), vpPose::DEMENTHON, display(), vpDisplay::display(), vpDisplay::displayCharString(), vpDisplay::displayCross(), vpDisplay::displayFrame(), vpDisplay::displayPoint(), vpDisplay::flush(), vpDisplay::getClick(), vpColor::green, vpDisplayOpenCV::init(), init(), vpException::ioError, vpPose::LAGRANGE, poseSavingFilename, vpImageIo::read(), vpColor::red, savePose(), vpPoint::set_x(), vpPoint::set_y(), vpHomogeneousMatrix::setIdentity(), vpPoint::setWorldCoordinates(), and vpPose::VIRTUAL_VS.

void vpMbTracker::initClick ( const vpImage< unsigned char > &  I,
const std::vector< vpPoint > &  points3D_list,
const std::string &  displayFile = "" 
)
virtual

Initialise the tracking by clicking on the image points corresponding to the 3D points (object frame) in the list points3D_list.

Parameters
I: Input image
points3D_list: List of the 3D points (object frame).
displayFile: Path to the image used to display the help.

Definition at line 352 of file vpMbTracker.cpp.

References vpPose::addPoint(), vpMouseButton::button1, cam, vpPose::clearPoint(), cMo, vpPose::computePose(), vpPose::computeResidual(), vpPixelMeterConversion::convertPoint(), vpPose::DEMENTHON, display(), vpDisplay::display(), vpDisplay::displayCharString(), vpDisplay::displayCross(), vpDisplay::displayFrame(), vpDisplay::displayPoint(), vpDisplay::flush(), vpDisplay::getClick(), vpColor::green, vpDisplayOpenCV::init(), init(), vpPose::LAGRANGE, vpImageIo::read(), vpColor::red, vpPoint::set_x(), vpPoint::set_y(), and vpPose::VIRTUAL_VS.

virtual void vpMbTracker::initCylinder ( const vpPoint p1,
const vpPoint p2,
const double  radius,
const unsigned int  indexCylinder = 0 
)
protectedpure virtual

Add a cylinder to track from two points on the axis (defining the length of the cylinder) and its radius.

Parameters
p1: First point on the axis.
p2: Second point on the axis.
radius: Radius of the cylinder.
indexCylinder: Index of the cylinder.

Implemented in vpMbEdgeTracker, vpMbKltTracker, and vpMbEdgeKltTracker.

Referenced by extractCylinders(), and loadCAOModel().

virtual void vpMbTracker::initFaceFromCorners ( const std::vector< vpPoint > &  corners,
const unsigned int  indexFace = -1 
)
protectedpure virtual

Add a face to track from its corners (in the object frame). This method is called from the loadModel() one to add a face of the object to track. The initialisation of the face depends on the primitive to track.

Parameters
corners: The vector of corners representing the face.
indexFace: The index of the face.

Implemented in vpMbEdgeTracker, vpMbKltTracker, and vpMbEdgeKltTracker.

Referenced by extractFaces(), extractLines(), and loadCAOModel().

void vpMbTracker::initFromPoints ( const vpImage< unsigned char > &  I,
const std::string &  initFile 
)
virtual

Initialise the tracking by reading the 3D points (object frame) and the image points in initFile. The structure of this file is (without the comments):

4 // Number of 3D points in the file (minimum is four)
0.01 0.01 0.01 // \
... // | 3D coordinates in meters in the object frame
0.01 -0.01 -0.01 // /
4 // Number of image points in the file (has to be the same as the number of 3D points)
100 200 // \
... // | 2D coordinates in pixel in the image
50 10 // /
Parameters
I: Input image
initFile: Path to the file containing all the points.

Definition at line 469 of file vpMbTracker.cpp.

References vpPose::addPoint(), vpException::badValue, cam, cMo, vpPose::computePose(), vpPose::computeResidual(), vpPixelMeterConversion::convertPoint(), vpPose::DEMENTHON, init(), vpException::ioError, vpPose::LAGRANGE, vpPoint::set_x(), vpPoint::set_y(), vpPoint::setWorldCoordinates(), vpPose::VIRTUAL_VS, and vpERROR_TRACE.

void vpMbTracker::initFromPoints ( const vpImage< unsigned char > &  I,
const std::vector< vpImagePoint > &  points2D_list,
const std::vector< vpPoint > &  points3D_list 
)
virtual

Initialise the tracking with the list of image points (points2D_list) and the list of corresponding 3D points (object frame) (points3D_list).

Parameters
I: Input image
points2D_list: List of image points.
points3D_list: List of 3D points (object frame).

Definition at line 554 of file vpMbTracker.cpp.

References vpPose::addPoint(), cam, cMo, vpPose::computePose(), vpPose::computeResidual(), vpPixelMeterConversion::convertPoint(), vpPose::DEMENTHON, init(), vpPose::LAGRANGE, vpPoint::set_x(), vpPoint::set_y(), vpPoint::setWorldCoordinates(), vpPose::VIRTUAL_VS, and vpERROR_TRACE.

void vpMbTracker::initFromPose ( const vpImage< unsigned char > &  I,
const std::string &  initFile 
)
virtual

Initialise the tracking thanks to the pose in vpPoseVector format, and read in the file initFile. The structure of this file is (without the comments):

// The six value of the pose vector
0.0000 // \
0.0000 // |
1.0000 // | Exemple of value for the pose vector where Z = 1 meter
0.0000 // |
0.0000 // |
0.0000 // /

Where the three firsts lines refer to the translation and the three last to the rotation in thetaU parametrisation (see vpThetaUVector).

Parameters
I: Input image
initFile: Path to the file containing the pose.
Examples:
mbtEdgeKltTracking.cpp, mbtEdgeTracking.cpp, and mbtKltTracking.cpp.

Definition at line 609 of file vpMbTracker.cpp.

References vpHomogeneousMatrix::buildFrom(), cMo, init(), and vpException::ioError.

Referenced by initFromPose(), and vpMbEdgeTracker::reInitModel().

void vpMbTracker::initFromPose ( const vpImage< unsigned char > &  I,
const vpHomogeneousMatrix cMo_ 
)
virtual

Initialise the tracking thanks to the pose.

Parameters
I: Input image
cMo_: Pose matrix.

Definition at line 644 of file vpMbTracker.cpp.

References cMo, and init().

void vpMbTracker::initFromPose ( const vpImage< unsigned char > &  I,
const vpPoseVector cPo 
)
virtual

Initialise the tracking thanks to the pose vector.

Parameters
I: Input image
cPo: Pose vector.

Definition at line 656 of file vpMbTracker.cpp.

References initFromPose().

void vpMbTracker::loadCAOModel ( const std::string &  modelFile)
protectedvirtual

Load a 3D model contained in a .cao file.

the structure of the file is (without the comments) :

V1
8 // Number of points describing the object
0.01 0.01 0.01 // \
... // | coordinates of the points in the object frame (in m.)
0.01 0.01 0.01 // /
3 // Number of lines to track.
0 2 // \
1 4 // | Index of the points representing the extremities of the lines
1 5 // /
0 // Number of polygon (face) to track using the line previously described
// Face described as follow : nbLine IndexLine1 indexLine2 ... indexLineN
3 // Number of polygon (face) to track using the line previously described
4 0 2 3 4 // Face described as follow : nbPoint IndexPoint1 IndexPoint2 ... IndexPointN
4 1 3 5 7
3 1 5 6
1 // Number of cylinder
6 7 0.05 // Index of the limits points on the axis (used to know the 'height' of the cylinder) and radius of the cyclinder (in m.)
Parameters
modelFile: Full name of the .CAO file containing the model.

Definition at line 838 of file vpMbTracker.cpp.

References vpException::badValue, initCylinder(), initFaceFromCorners(), vpException::ioError, vpPoint::setWorldCoordinates(), and vpTRACE.

Referenced by loadModel().

virtual void vpMbTracker::loadConfigFile ( const std::string &  configFile)
pure virtual

Load a config file to parameterise the behavior of the tracker.

Pure virtual method to adapt to each tracker.

Parameters
configFile: the (xml) config file to parse

Implemented in vpMbEdgeTracker, vpMbEdgeKltTracker, and vpMbKltTracker.

void vpMbTracker::loadModel ( const std::string &  modelFile)
virtual

Load a 3D model from the file in parameter. This file must either be a vrml file (.wrl) or a CAO file (.cao). CAO format is described in the loadCAOModel() method.

Warning
When this class is called to load a vrml model, remember that you have to call Call SoDD::finish() before ending the program.
int main()
{
...
#ifdef VISP_HAVE_COIN
SoDB::finish();
#endif
}
Exceptions
vpException::ioErrorif the file cannot be open, or if its extension is not wrl or cao.
Parameters
modelFile: the file containing the model.

Reimplemented in vpMbEdgeTracker, and vpMbEdgeKltTracker.

Examples:
mbtKltTracking.cpp, and tutorial-mb-klt-tracker.cpp.

Definition at line 705 of file vpMbTracker.cpp.

References vpIoTools::checkFilename(), vpException::ioError, loadCAOModel(), loadVRMLModel(), modelFileName, and modelInitialised.

Referenced by vpMbEdgeKltTracker::loadModel(), and vpMbEdgeTracker::loadModel().

void vpMbTracker::loadVRMLModel ( const std::string &  modelFile)
protectedvirtual

Load the 3D model of the object from a vrml file. Only LineSet and FaceSet are extracted from the vrml file.

Warning
When this class is called, remember that you have to call Call SoDD::finish() before ending the program.
int main()
{
...
#ifdef VISP_HAVE_COIN
SoDB::finish();
#endif
}
The cylinders extracted using this method do not use the Cylinder keyword of vrml since vrml exporter such as Blender or AC3D consider a cylinder as an IndexedFaceSet. To test whether an indexedFaceSet is a cylinder or not, the name of the geometry is read. If the name begins with "cyl" then the faceset is supposed to be a cylinder. For example, the line
geometry DEF cyl_cylinder1 IndexedFaceSet
defines a cylinder named cyl_cylinder1.
Exceptions
vpException::fatalErrorif the file cannot be open.
Parameters
modelFile: The full name of the file containing the 3D model.

Definition at line 763 of file vpMbTracker.cpp.

References extractGroup(), vpException::fatalError, and vpERROR_TRACE.

Referenced by loadModel().

virtual void vpMbTracker::resetTracker ( )
pure virtual

Reset the tracker.

Implemented in vpMbEdgeTracker, vpMbKltTracker, and vpMbEdgeKltTracker.

void vpMbTracker::savePose ( const std::string &  filename)

Save the pose in the given filename

Parameters
filename: Path to the file used to save the pose.

Definition at line 667 of file vpMbTracker.cpp.

References vpPoseVector::buildFrom(), and cMo.

Referenced by initClick().

virtual void vpMbTracker::setCameraParameters ( const vpCameraParameters camera)
inlinevirtual

Set the camera parameters.

Parameters
camera: the new camera parameters

Reimplemented in vpMbEdgeTracker, vpMbKltTracker, and vpMbEdgeKltTracker.

Definition at line 233 of file vpMbTracker.h.

virtual void vpMbTracker::setCovarianceComputation ( const bool &  flag)
inlinevirtual

Set if the covaraince matrix has to be computed.

Parameters
flag: True if the covariance has to be computed, false otherwise

Definition at line 240 of file vpMbTracker.h.

void vpMbTracker::setDisplayFeatures ( const bool  displayF)
inline

Enable to display the features.

Parameters
displayF: set it to true to display the features.
Examples:
mbtEdgeKltTracking.cpp, mbtKltTracking.cpp, tutorial-mb-edge-tracker.cpp, tutorial-mb-hybrid-tracker.cpp, and tutorial-mb-klt-tracker.cpp.

Definition at line 247 of file vpMbTracker.h.

virtual void vpMbTracker::setPose ( const vpImage< unsigned char > &  I,
const vpHomogeneousMatrix cdMo 
)
pure virtual

Set the pose to be used in entry of the next call to the track() function. This pose will be just used once.

Warning
This function has to be called after the initialisation of the tracker.
Parameters
I: image corresponding to the desired pose.
cdMo: Pose to affect.

Implemented in vpMbEdgeTracker, vpMbKltTracker, and vpMbEdgeKltTracker.

void vpMbTracker::setPoseSavingFilename ( const std::string &  filename)
inline

Set the filename used to save the initial pose computed using the initClick() method. It is also used to read a previous pose in the same method. If the file is not set then, the initClick() method will create a .0.pos file in the root directory. This directory is the path to the file given to the method initClick() used to know the coordinates in the object frame.

Parameters
filename: The new filename.

Definition at line 269 of file vpMbTracker.h.

virtual void vpMbTracker::testTracking ( )
pure virtual

Test the quality of the tracking.

Exceptions
vpExceptionif the test fail.

Implemented in vpMbEdgeTracker, vpMbKltTracker, and vpMbEdgeKltTracker.

virtual void vpMbTracker::track ( const vpImage< unsigned char > &  I)
pure virtual

Track the object in the given image

Parameters
I: The current image.

Implemented in vpMbEdgeTracker, vpMbKltTracker, and vpMbEdgeKltTracker.

Member Data Documentation

bool vpMbTracker::computeCovariance
protected

Flag used to specify if the covariance matrix has to be computed or not.

Definition at line 116 of file vpMbTracker.h.

Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), vpMbKltTracker::resetTracker(), and vpMbEdgeKltTracker::vpMbEdgeKltTracker().

vpMatrix vpMbTracker::covarianceMatrix
protected

Covariance matrix.

Definition at line 118 of file vpMbTracker.h.

Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), and vpMbEdgeTracker::computeVVS().

bool vpMbTracker::displayFeatures
protected

If true, the features are displayed.

Definition at line 120 of file vpMbTracker.h.

Referenced by vpMbEdgeKltTracker::display(), vpMbKltTracker::display(), vpMbEdgeKltTracker::postTracking(), and vpMbEdgeTracker::track().

std::string vpMbTracker::modelFileName
protected

The name of the file containing the model (it is used to create a file name.0.pos used to store the compute pose in the initClick method).

Definition at line 110 of file vpMbTracker.h.

Referenced by loadModel().

bool vpMbTracker::modelInitialised
protected

Flag used to ensure that the CAD model is loaded before the initialisation.

Definition at line 112 of file vpMbTracker.h.

Referenced by vpMbKltTracker::init(), and loadModel().

std::string vpMbTracker::poseSavingFilename
protected

Filename used to save the initial pose computed using the initClick() method. It is also used to read a previous pose in the same method.

Definition at line 114 of file vpMbTracker.h.

Referenced by initClick().