Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions
ObjectModel Class Reference

#include <ObjectModel.h>

List of all members.

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 VisualizationModelgetVisualizationModel () 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< FaceFaces
std::string Name
std::string Type

Protected Attributes

VisualizationModelm_visualization_model

Private Member Functions

 ObjectModel (const ObjectModel &)
ObjectModeloperator= (const ObjectModel &)

Detailed Description

Definition at line 53 of file ObjectModel.h.


Constructor & Destructor Documentation

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

Parameters:
dir
load_visualization_modelif true, the visualization model is also loaded

Definition at line 69 of file ObjectModel.cpp.

Definition at line 79 of file ObjectModel.cpp.


Member Function Documentation

bool ObjectModel::checkDirectory ( const std::string &  dir) [static]

Checks if a directory contains a valid object model

Parameters:
dirdirectory to test
Returns:
true iif dir contains a valid model

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.

Parameters:
scenescene features
face_indicesindices of detected faces, in descending order of number of detected points
key_indicesfor each detected face, local indices of its matched keypoints, in descending order of number of detected points
scene_indicesfor each detected face, indices of matched points from the scene, in the same order than key_indices
min_detected_pointsfaces 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_ratiomax 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

Parameters:
dirdirectory where the model is stored
Returns:
object name

Definition at line 249 of file ObjectModel.cpp.

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

Parameters:
dir
load_visualization_modelif true, the visualization model is also loaded
Exceptions:
stringexception if error
Note:
dir must contain a meta.xml file and these files for each face: face_%03d.png, face_%03d.txt, face_%03d.key.gz, face_%03d.ply

Definition at line 100 of file ObjectModel.cpp.

ObjectModel& ObjectModel::operator= ( const ObjectModel ) [private]

Member Data Documentation

Definition at line 162 of file ObjectModel.h.

Reads a .idx file and updates the local maps (m_maps)

Parameters:
filename
face_idxcurrent face index
Nnumber of entries in filename Loads the flann tree
flan_filenameindex file
key_filenamefeature 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.


The documentation for this class was generated from the following files:


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:34:15