Template matching using the LINEMOD approach. More...
#include <linemod.h>
Public Member Functions | |
int | addTemplate (const SparseQuantizedMultiModTemplate &linemod_template) |
Adds the specified template to the matching queue. | |
int | createAndAddTemplate (const std::vector< QuantizableModality * > &modalities, const std::vector< MaskMap * > &masks, const RegionXY ®ion) |
Creates a template from the specified data and adds it to the matching queue. | |
void | deserialize (std::istream &stream) |
Deserializes templates from the specified stream. | |
void | detectTemplates (const std::vector< QuantizableModality * > &modalities, std::vector< LINEMODDetection > &detections) const |
Detects the stored templates in the supplied modality data. | |
void | detectTemplatesSemiScaleInvariant (const std::vector< QuantizableModality * > &modalities, std::vector< LINEMODDetection > &detections, float min_scale=0.6944444f, float max_scale=1.44f, float scale_multiplier=1.2f) const |
Detects the stored templates in a semi scale invariant manner by applying the detection to multiple scaled versions of the input data. | |
size_t | getNumOfTemplates () const |
Returns the number of stored/trained templates. | |
const SparseQuantizedMultiModTemplate & | getTemplate (int template_id) const |
Returns the template with the specified ID. | |
LINEMOD () | |
Constructor. | |
void | loadTemplates (const char *file_name) |
Loads templates from the specified file. | |
void | matchTemplates (const std::vector< QuantizableModality * > &modalities, std::vector< LINEMODDetection > &matches) const |
Matches the stored templates to the supplied modality data. | |
void | saveTemplates (const char *file_name) const |
Saves the stored templates to the specified file. | |
void | serialize (std::ostream &stream) const |
Serializes the stored templates to the specified stream. | |
void | setDetectionAveraging (bool average_detections) |
Enables/disables averaging of close detections. | |
void | setDetectionThreshold (float threshold) |
Sets the detection threshold. | |
void | setNonMaxSuppression (bool use_non_max_suppression) |
Enables/disables non-maximum suppression. | |
virtual | ~LINEMOD () |
Destructor. | |
Private Attributes | |
bool | average_detections_ |
float | template_threshold_ |
std::vector < SparseQuantizedMultiModTemplate > | templates_ |
bool | use_non_max_suppression_ |
Constructor.
Definition at line 51 of file linemod.cpp.
pcl::LINEMOD::~LINEMOD | ( | ) | [virtual] |
Destructor.
Definition at line 60 of file linemod.cpp.
int pcl::LINEMOD::addTemplate | ( | const SparseQuantizedMultiModTemplate & | linemod_template | ) |
Adds the specified template to the matching queue.
[in] | linemod_template | the template to add. |
Definition at line 115 of file linemod.cpp.
int pcl::LINEMOD::createAndAddTemplate | ( | const std::vector< QuantizableModality * > & | modalities, |
const std::vector< MaskMap * > & | masks, | ||
const RegionXY & | region | ||
) |
Creates a template from the specified data and adds it to the matching queue.
[in] | modalities | the modalities used to create the template. |
[in] | masks | the masks that determine which parts of the modalities are used for creating the template. |
[in] | region | the region which will be associated with the template (can be larger than the actual modality-maps). |
Definition at line 66 of file linemod.cpp.
void pcl::LINEMOD::deserialize | ( | std::istream & | stream | ) |
Deserializes templates from the specified stream.
[in] | stream | the stream the templates will be read from. |
Definition at line 1341 of file linemod.cpp.
void pcl::LINEMOD::detectTemplates | ( | const std::vector< QuantizableModality * > & | modalities, |
std::vector< LINEMODDetection > & | detections | ||
) | const |
Detects the stored templates in the supplied modality data.
[in] | modalities | the modalities that will be used for detection. |
[out] | detections | the destination for the detections. |
Definition at line 371 of file linemod.cpp.
void pcl::LINEMOD::detectTemplatesSemiScaleInvariant | ( | const std::vector< QuantizableModality * > & | modalities, |
std::vector< LINEMODDetection > & | detections, | ||
float | min_scale = 0.6944444f , |
||
float | max_scale = 1.44f , |
||
float | scale_multiplier = 1.2f |
||
) | const |
Detects the stored templates in a semi scale invariant manner by applying the detection to multiple scaled versions of the input data.
[in] | modalities | the modalities that will be used for detection. |
[out] | detections | the destination for the detections. |
[in] | min_scale | the minimum scale. |
[in] | max_scale | the maximum scale. |
[in] | scale_multiplier | the multiplier for getting from one scale to the next. |
Definition at line 837 of file linemod.cpp.
size_t pcl::LINEMOD::getNumOfTemplates | ( | ) | const [inline] |
const SparseQuantizedMultiModTemplate& pcl::LINEMOD::getTemplate | ( | int | template_id | ) | const [inline] |
void pcl::LINEMOD::loadTemplates | ( | const char * | file_name | ) |
Loads templates from the specified file.
[in] | file_name | the name of the file to load the template from. |
Definition at line 1319 of file linemod.cpp.
void pcl::LINEMOD::matchTemplates | ( | const std::vector< QuantizableModality * > & | modalities, |
std::vector< LINEMODDetection > & | matches | ||
) | const |
Matches the stored templates to the supplied modality data.
[in] | modalities | the modalities that will be used for matching. |
[out] | matches | the found matches. |
Definition at line 125 of file linemod.cpp.
void pcl::LINEMOD::saveTemplates | ( | const char * | file_name | ) | const |
Saves the stored templates to the specified file.
[in] | file_name | the name of the file to save the templates to. |
Definition at line 1307 of file linemod.cpp.
void pcl::LINEMOD::serialize | ( | std::ostream & | stream | ) | const |
Serializes the stored templates to the specified stream.
[in] | stream | the stream the templates will be written to. |
Definition at line 1331 of file linemod.cpp.
void pcl::LINEMOD::setDetectionAveraging | ( | bool | average_detections | ) | [inline] |
void pcl::LINEMOD::setDetectionThreshold | ( | float | threshold | ) | [inline] |
void pcl::LINEMOD::setNonMaxSuppression | ( | bool | use_non_max_suppression | ) | [inline] |
bool pcl::LINEMOD::average_detections_ [private] |
float pcl::LINEMOD::template_threshold_ [private] |
std::vector<SparseQuantizedMultiModTemplate> pcl::LINEMOD::templates_ [private] |
bool pcl::LINEMOD::use_non_max_suppression_ [private] |