opentl::modalities::TemplateMap Class Reference

Processing functions related to the template visual feature (cvdata::TemplateMap). More...

Inherits opentl::modalities::Modality.

List of all members.

Public Types


Public Member Functions

int buildTemplateMap (const TargetPtrVector &targets)
 Collect offline template by sampling pixels from the opengl texture image, and back-warping points onto the 3D mesh.
virtual modalities::Modalityclone () const
 Clone (it calls the Deep Copy Constructor).
opentl::core::cvdata::TemplateMapgetTmapData (int targetId)
 Return the template model of a given target.
void init ()
 Memory allocation and initialization (common to both constructors).
int LossDetect (const TargetPtrVector &targets)
 Detect target loss, by computing the NCC over the full template.
virtual int matchFeatLevel (const TargetPtrVector &targets, T_MEAS_FEATPtrVector &outputMeas, std::size_t partitionIdx)
 matchFeatLevel. Match template gray level values with underlying image values (multi-resolution) The overall similarity function can be: Sum of Squared Differences (SSD), Normalized Cross-Correlation (NCC), Mutual Information (MI).
virtual int matchObjLevel (const TargetPtrVector &targets, T_MEAS_OBJPtrVector &outputMeas, std::size_t partitionIdx)
 matchObjLevel. Find local maximum of feature-level likelihood (i.e. the template similarity function)
virtual int preProcess (const opentl::core::cvdata::Image &image)
 Get the multi-resolution image pyramid.
void resetOnlineTemplate (const TargetPtrVector &targets)
 Reset the on-line template to the off-line values.
virtual int sampleModelFeatures (const TargetPtrVector &targets)
 Compute visible points from the template map at pose p (occlusion query).
 TemplateMap (const TemplateMap &tmap)
 Deep Copy Constructor.
 TemplateMap (opentl::modelprojection::Warp *warp, int camIdx)
 Constructor.
int updateAllTemplate (const TargetPtrVector &targets)
 Update the complete template gray values (on-line and off-line) from the pre-processed image pyramid.
virtual int updateModelFeatures (const TargetPtrVector &targets)
 Update the on-line observed gray values (= feature) from the multi-resolution image pyramid.
void updateOnlineTemplate (const TargetPtrVector &targets, std::vector< boost::shared_ptr< opentl::core::cvdata::Image > > &imageData)
 Update the on-line template gray values from 4 resolution images.
int warpTemplate (const TargetPtrVector &targets)
 Warp all visible template points.
virtual ~TemplateMap ()
 Destructor.

Protected Attributes

T_MEAS_FEATPtrVector mFeatLevelMeas
 Internal storage for feature level measurements NOTE: this is needed by the static function "staticSimilarityEval" (for the simplex optimizer).
TargetPtrVector mTmpTarget
 Temporary state NOTE: this is needed by the static function "staticSimilarityEval" (for the simplex optimizer).


Detailed Description

Processing functions related to the template visual feature (cvdata::TemplateMap).

Member Enumeration Documentation

Common flags to all modalities: they specify which field will be filled in the output measurement, inside the matchXLevel() function. Default values = all true.

Enumerator:
param_sampleTemplateFromModel  (bool) If we set template points locally, whether to sample them from model, or load them from file.
param_computeJacobians  (bool) Whether to compute template point Jacobians (using Gauss-Newton) or not (using matchObjLevel).
param_maxPoints  (int) In order to generate a maximum number of template points. (default = -1 -> Unlimited number)
param_nBins  (int) Number of histogram bins (for Mutual Information only).
param_nRes  (int) Number of resolutions.
param_debugShow  (bool) Show debug window (optimization sample, etc).
param_templateFilenames  (std::vector(std::string) ) Filenames (indexed by target ID) where to load/store model template points
OFFLINE_COUNT 

Reimplemented from opentl::modalities::Modality.

Enumerator:
param_featLevelCov  (double) Feature-level covariance (gray-values).
param_objLevelCov  (double) Object-level covariance (incremental pose-space).
param_fixedNumberIterations  (int) Fixed number of iterations for the optimization algorithm (default = -1 -> Variable number)
param_simFunc  (SimFuncType) Similarity function for template matching.
param_updateTemplate  (bool) Whether to update on-line template values.
param_simplexDelta  (std::vector(std::vector(double) ) ) Initial simplexes (for optimization).
param_smoothGauss  (std::vector(int) ) Gauss filter size (for multi-resolution).
param_subsample  (std::vector(int) ) Subsampling factor (for faster optimization).
param_minNCC  (double) Threshold for the final NCC value (loss detection).
param_woff  (double) Weight for off-line/on-line template fusion.
param_noisySample  (bool) Switch the subsampling index (noisy optimization) or not.
ONLINE_COUNT 

Reimplemented from opentl::modalities::Modality.

Enumerator:
MI 
SSD 
NCC 


Constructor & Destructor Documentation

opentl::modalities::TemplateMap::TemplateMap ( opentl::modelprojection::Warp warp,
int  camIdx 
)

Constructor.

opentl::modalities::TemplateMap::TemplateMap ( const TemplateMap tmap  ) 

Deep Copy Constructor.

virtual opentl::modalities::TemplateMap::~TemplateMap (  )  [virtual]

Destructor.


Member Function Documentation

int opentl::modalities::TemplateMap::buildTemplateMap ( const TargetPtrVector targets  ) 

Collect offline template by sampling pixels from the opengl texture image, and back-warping points onto the 3D mesh.

Parameters:
targets Input target vector

virtual modalities::Modality* opentl::modalities::TemplateMap::clone (  )  const [virtual]

Clone (it calls the Deep Copy Constructor).

Implements opentl::modalities::Modality.

opentl::core::cvdata::TemplateMap* opentl::modalities::TemplateMap::getTmapData ( int  targetId  )  [inline]

Return the template model of a given target.

Parameters:
targetId Unique target ID number

void opentl::modalities::TemplateMap::init (  )  [virtual]

Memory allocation and initialization (common to both constructors).

Reimplemented from opentl::modalities::Modality.

int opentl::modalities::TemplateMap::LossDetect ( const TargetPtrVector targets  ) 

Detect target loss, by computing the NCC over the full template.

Parameters:
targets Input target vector

virtual int opentl::modalities::TemplateMap::matchFeatLevel ( const TargetPtrVector targets,
T_MEAS_FEATPtrVector outputMeas,
std::size_t  partitionIdx 
) [virtual]

matchFeatLevel. Match template gray level values with underlying image values (multi-resolution) The overall similarity function can be: Sum of Squared Differences (SSD), Normalized Cross-Correlation (NCC), Mutual Information (MI).

Parameters:
targets Input vector of targets
outputMeas Output feature-level measurements (gray-level pairs, Jacobians and UNIQUE residual = overall template similarity) NOTE: The second index of outputMeas (state inside the target) is not used, and always set to 0.

Reimplemented from opentl::modalities::Modality.

virtual int opentl::modalities::TemplateMap::matchObjLevel ( const TargetPtrVector targets,
T_MEAS_OBJPtrVector outputMeas,
std::size_t  partitionIdx 
) [virtual]

matchObjLevel. Find local maximum of feature-level likelihood (i.e. the template similarity function)

Parameters:
targets Input vector of targets
outputMeas Output object-level measurements (predicted and estimated pose, and residual = incremental pose) NOTE: The second index of outputMeas (state inside the target) is not used, and always set to 0.

Reimplemented from opentl::modalities::Modality.

virtual int opentl::modalities::TemplateMap::preProcess ( const opentl::core::cvdata::Image image  )  [virtual]

Get the multi-resolution image pyramid.

Parameters:
sensData Input sensor data

void opentl::modalities::TemplateMap::resetOnlineTemplate ( const TargetPtrVector targets  ) 

Reset the on-line template to the off-line values.

Parameters:
targets Input target vector

virtual int opentl::modalities::TemplateMap::sampleModelFeatures ( const TargetPtrVector targets  )  [virtual]

Compute visible points from the template map at pose p (occlusion query).

Parameters:
targets Input target vector

Reimplemented from opentl::modalities::Modality.

int opentl::modalities::TemplateMap::updateAllTemplate ( const TargetPtrVector targets  ) 

Update the complete template gray values (on-line and off-line) from the pre-processed image pyramid.

Parameters:
targets Input target vector

virtual int opentl::modalities::TemplateMap::updateModelFeatures ( const TargetPtrVector targets  )  [virtual]

Update the on-line observed gray values (= feature) from the multi-resolution image pyramid.

Parameters:
targets Input target vector

Reimplemented from opentl::modalities::Modality.

void opentl::modalities::TemplateMap::updateOnlineTemplate ( const TargetPtrVector targets,
std::vector< boost::shared_ptr< opentl::core::cvdata::Image > > &  imageData 
)

Update the on-line template gray values from 4 resolution images.

Parameters:
targets Input target vector
imageData Input multi-resolution images from which to sample visible points

int opentl::modalities::TemplateMap::warpTemplate ( const TargetPtrVector targets  ) 

Warp all visible template points.

Parameters:
targets Input target vector


Member Data Documentation

Internal storage for feature level measurements NOTE: this is needed by the static function "staticSimilarityEval" (for the simplex optimizer).

Temporary state NOTE: this is needed by the static function "staticSimilarityEval" (for the simplex optimizer).


Generated on Fri Jul 31 17:38:39 2009 for OpenTL by  doxygen 1.5.8