#include <ObjectModel.h>
Classes | |
| struct | Face |
Public Member Functions | |
| void | detectFaces (const SurfSet &scene, std::vector< int > &face_indices, std::vector< std::vector< int > > &key_indices, std::vector< std::vector< int > > &scene_indices, std::vector< std::vector< float > > &distances, int min_detected_points=1, int max_correspondences_per_point=3, float max_ratio=0.6) |
| const VisualizationModel & | getVisualizationModel () const |
| void | loadDirectory (const std::string &dir, bool load_visualization_model) |
| ObjectModel () | |
| ObjectModel (const std::string &dir, bool load_visualization_model) | |
| virtual | ~ObjectModel () |
Static Public Member Functions | |
| static bool | checkDirectory (const std::string &dir) |
| static std::string | getName (const std::string &dir) |
Public Attributes | |
| std::vector< Face > | Faces |
| std::string | Name |
| std::string | Type |
Protected Attributes | |
| VisualizationModel * | m_visualization_model |
Private Member Functions | |
| ObjectModel (const ObjectModel &) | |
| ObjectModel & | operator= (const ObjectModel &) |
Definition at line 53 of file ObjectModel.h.
| ObjectModel::ObjectModel | ( | const ObjectModel & | ) | [private] |
Important: this class is currently non-copyable because it manages pointers to flann structures that cannot be copied. ToDo: fix this Note: Code for Opencv > 2.1.1 should be copyable (but im not sure)
Definition at line 60 of file ObjectModel.cpp.
| ObjectModel::ObjectModel | ( | const std::string & | dir, |
| bool | load_visualization_model | ||
| ) |
Creates the model by loading it from a directory
| dir | |
| load_visualization_model | if true, the visualization model is also loaded |
Definition at line 69 of file ObjectModel.cpp.
| ObjectModel::~ObjectModel | ( | ) | [virtual] |
Definition at line 79 of file ObjectModel.cpp.
| bool ObjectModel::checkDirectory | ( | const std::string & | dir | ) | [static] |
Checks if a directory contains a valid object model
| dir | directory to test |
Definition at line 214 of file ObjectModel.cpp.
| void ObjectModel::detectFaces | ( | const SurfSet & | scene, |
| std::vector< int > & | face_indices, | ||
| std::vector< std::vector< int > > & | key_indices, | ||
| std::vector< std::vector< int > > & | scene_indices, | ||
| std::vector< std::vector< float > > & | distances, | ||
| int | min_detected_points = 1, |
||
| int | max_correspondences_per_point = 3, |
||
| float | max_ratio = 0.6 |
||
| ) |
Calculate correspondences between the scene features and all the faces of this model. This only returns those faces, and the indices of their matched keypoints, that have at least min_detected_points correspondences.
| scene | scene features |
| face_indices | indices of detected faces, in descending order of number of detected points |
| key_indices | for each detected face, local indices of its matched keypoints, in descending order of number of detected points |
| scene_indices | for each detected face, indices of matched points from the scene, in the same order than key_indices |
| min_detected_points | faces with fewer matches than this number are ignored |
| max_correspondences_per_point. | each scene match can be matched with up to this number of model points |
| max_ratio | max ratio between two close neighbors |
Definition at line 336 of file ObjectModel.cpp.
| std::string ObjectModel::getName | ( | const std::string & | dir | ) | [static] |
Loads only the meta data of a model and returns its name
| dir | directory where the model is stored |
Definition at line 249 of file ObjectModel.cpp.
| const VisualizationModel& ObjectModel::getVisualizationModel | ( | ) | const [inline] |
Returns the visualization model
Definition at line 135 of file ObjectModel.h.
| void ObjectModel::loadDirectory | ( | const std::string & | dir, |
| bool | load_visualization_model | ||
| ) |
Loads the model from the given directory
| dir | |
| load_visualization_model | if true, the visualization model is also loaded |
| string | exception if error |
Definition at line 100 of file ObjectModel.cpp.
| ObjectModel& ObjectModel::operator= | ( | const ObjectModel & | ) | [private] |
Definition at line 162 of file ObjectModel.h.
VisualizationModel* ObjectModel::m_visualization_model [protected] |
Reads a .idx file and updates the local maps (m_maps)
| filename | |
| face_idx | current face index |
| N | number of entries in filename Loads the flann tree |
| flan_filename | index file |
| key_filename | feature file |
Definition at line 191 of file ObjectModel.h.
| std::string ObjectModel::Name |
Definition at line 161 of file ObjectModel.h.
| std::string ObjectModel::Type |
Definition at line 163 of file ObjectModel.h.