Recognizer for 3D pose estimation using SIFT features. More...
#include <Recognizer3D.h>
Public Member Functions | |
cv::Mat | getDebugImage () |
cv::Mat | getImage () |
void | getLastSifts (std::vector< Siftex > &sl) |
get position and normal vector of sift features in model detected in the last call of learnSifts() | |
void | getSifts (std::vector< Siftex > &sl) |
get position and normal vector of sift features in model | |
void | initTrainingModel () |
Creates a model for the training phase. | |
bool | learnSifts (IplImage *tFrame, const TomGine::tgModel &model, const TomGine::tgPose &pose) |
add sift features to sift model of an object | |
bool | loadModelFromFile (const std::string sift_file) |
load a sift model | |
bool | recognize (IplImage *tFrame, std::map< std::string, boost::shared_ptr< TomGine::tgPose > > &poses, std::map< std::string, double > &confs) |
recognizes a object by using the loaded sift model file | |
bool | recognize (IplImage *tFrame, std::map< std::string, boost::shared_ptr< TomGine::tgPose > > &poses, std::map< std::string, double > &confs, const std::map< std::string, bool > &select) |
recognizes a object by using the loaded sift model file | |
Recognizer3D (const CameraParameter &camParam, std::string config_root="", bool display=false, bool training=false) | |
Construction of Recognizer. | |
bool | saveModelToFile (const char *sift_file) |
save a sift model | |
void | setCameraParameter (const blortRecognizer::CameraParameter &camParam) |
void | setDoUndistort (bool enable) |
void | setGaussian (int kernel, float stdDeviation) |
void | setNNThreshold (double nn_threshold) |
void | setRansacNPointsToMatch (unsigned int n) |
~Recognizer3D () | |
Static Public Member Functions | |
static void | Convert (P::PoseCv &p1, TomGine::tgPose &p2) |
Private Member Functions | |
Recognizer3D () | |
Private Attributes | |
CvMat * | C |
std::string | config_root |
cv::Mat | debug_image |
cv::Mat | display_image |
bool | do_undistort |
CameraParameter | m_cp |
P::ODetect3D | m_detect |
bool | m_display |
float | m_gauss_dev |
int | m_gauss_kernel |
P::Array< P::KeypointDescriptor * > | m_image_keys |
std::vector< Siftex > | m_lastsiftexlist |
bool | m_model_loaded |
P::ModelObject3D | m_sift_model_learner |
std::vector< boost::shared_ptr < P::Object3D > > | m_sift_models |
std::vector< Siftex > | m_siftexlist |
CvMat * | pDistortion |
CvMat * | pIntrinsicDistort |
CvMat * | pMapX |
CvMat * | pMapY |
P::DetectGPUSIFT | sift |
Recognizer for 3D pose estimation using SIFT features.
Definition at line 47 of file Recognizer3D.h.
Recognizer3D::Recognizer3D | ( | const CameraParameter & | camParam, |
std::string | config_root = "" , |
||
bool | display = false , |
||
bool | training = false |
||
) |
Construction of Recognizer.
camParam | camera parameter for camera calibration |
prefix | to be added to every file path |
display | display sifts and found object in a window |
Definition at line 56 of file Recognizer3D.cpp.
Definition at line 122 of file Recognizer3D.cpp.
blortRecognizer::Recognizer3D::Recognizer3D | ( | ) | [private] |
void Recognizer3D::Convert | ( | P::PoseCv & | p1, |
TomGine::tgPose & | p2 | ||
) | [static] |
Definition at line 40 of file Recognizer3D.cpp.
cv::Mat blortRecognizer::Recognizer3D::getDebugImage | ( | ) | [inline] |
Definition at line 116 of file Recognizer3D.h.
cv::Mat blortRecognizer::Recognizer3D::getImage | ( | ) | [inline] |
Definition at line 109 of file Recognizer3D.h.
void blortRecognizer::Recognizer3D::getLastSifts | ( | std::vector< Siftex > & | sl | ) | [inline] |
get position and normal vector of sift features in model detected in the last call of learnSifts()
pl | 3D point list of sift features (relative to object) |
nl | 3D normal vector list of sift features (in object space) |
Definition at line 106 of file Recognizer3D.h.
void blortRecognizer::Recognizer3D::getSifts | ( | std::vector< Siftex > & | sl | ) | [inline] |
get position and normal vector of sift features in model
pl | 3D point list of sift features (relative to object) |
nl | 3D normal vector list of sift features (in object space) |
Definition at line 101 of file Recognizer3D.h.
void Recognizer3D::initTrainingModel | ( | ) |
Creates a model for the training phase.
Definition at line 414 of file Recognizer3D.cpp.
bool Recognizer3D::learnSifts | ( | IplImage * | tFrame, |
const TomGine::tgModel & | model, | ||
const TomGine::tgPose & | pose | ||
) |
add sift features to sift model of an object
tFrame | image/pixel map to search for new sift features |
model | shape description of model using faces and vertices (see TomGine::tgModel) |
pose | pose of the model as seen in the image |
Definition at line 284 of file Recognizer3D.cpp.
bool Recognizer3D::loadModelFromFile | ( | const std::string | sift_file | ) |
load a sift model
sift_file | relative path and name to sift file (i.e.: "../Resources/sift/TeaBox.sift") |
Definition at line 404 of file Recognizer3D.cpp.
bool Recognizer3D::recognize | ( | IplImage * | tFrame, |
std::map< std::string, boost::shared_ptr< TomGine::tgPose > > & | poses, | ||
std::map< std::string, double > & | confs | ||
) |
recognizes a object by using the loaded sift model file
tFrame | Image/Pixel map to search for the sift model |
pose | returned pose of the object (if found) |
conf | returned confidence of pose of the object |
Definition at line 168 of file Recognizer3D.cpp.
bool Recognizer3D::recognize | ( | IplImage * | tFrame, |
std::map< std::string, boost::shared_ptr< TomGine::tgPose > > & | poses, | ||
std::map< std::string, double > & | confs, | ||
const std::map< std::string, bool > & | select | ||
) |
recognizes a object by using the loaded sift model file
tFrame | Image/Pixel map to search for the sift model |
pose | returned pose of the object (if found) |
conf | returned confidence of pose of the object |
select | objects in this vector will be recognized |
Definition at line 176 of file Recognizer3D.cpp.
bool Recognizer3D::saveModelToFile | ( | const char * | sift_file | ) |
save a sift model
sift_file | relative path and name to sift file (i.e.: "../Resources/sift/TeaBox.sift") |
Definition at line 420 of file Recognizer3D.cpp.
void Recognizer3D::setCameraParameter | ( | const blortRecognizer::CameraParameter & | camParam | ) |
Definition at line 131 of file Recognizer3D.cpp.
void blortRecognizer::Recognizer3D::setDoUndistort | ( | bool | enable | ) | [inline] |
Definition at line 110 of file Recognizer3D.h.
void blortRecognizer::Recognizer3D::setGaussian | ( | int | kernel, |
float | stdDeviation | ||
) | [inline] |
Definition at line 61 of file Recognizer3D.h.
void Recognizer3D::setNNThreshold | ( | double | nn_threshold | ) |
Definition at line 427 of file Recognizer3D.cpp.
void Recognizer3D::setRansacNPointsToMatch | ( | unsigned int | n | ) |
Definition at line 432 of file Recognizer3D.cpp.
CvMat* blortRecognizer::Recognizer3D::C [private] |
Definition at line 137 of file Recognizer3D.h.
std::string blortRecognizer::Recognizer3D::config_root [private] |
Definition at line 151 of file Recognizer3D.h.
cv::Mat blortRecognizer::Recognizer3D::debug_image [private] |
Definition at line 149 of file Recognizer3D.h.
cv::Mat blortRecognizer::Recognizer3D::display_image [private] |
Definition at line 148 of file Recognizer3D.h.
bool blortRecognizer::Recognizer3D::do_undistort [private] |
Definition at line 150 of file Recognizer3D.h.
Definition at line 139 of file Recognizer3D.h.
Definition at line 125 of file Recognizer3D.h.
bool blortRecognizer::Recognizer3D::m_display [private] |
Definition at line 142 of file Recognizer3D.h.
float blortRecognizer::Recognizer3D::m_gauss_dev [private] |
Definition at line 145 of file Recognizer3D.h.
int blortRecognizer::Recognizer3D::m_gauss_kernel [private] |
Definition at line 144 of file Recognizer3D.h.
Definition at line 130 of file Recognizer3D.h.
std::vector<Siftex> blortRecognizer::Recognizer3D::m_lastsiftexlist [private] |
Definition at line 132 of file Recognizer3D.h.
bool blortRecognizer::Recognizer3D::m_model_loaded [private] |
Definition at line 141 of file Recognizer3D.h.
Definition at line 123 of file Recognizer3D.h.
std::vector< boost::shared_ptr<P::Object3D> > blortRecognizer::Recognizer3D::m_sift_models [private] |
Definition at line 127 of file Recognizer3D.h.
std::vector<Siftex> blortRecognizer::Recognizer3D::m_siftexlist [private] |
Definition at line 133 of file Recognizer3D.h.
CvMat* blortRecognizer::Recognizer3D::pDistortion [private] |
Definition at line 136 of file Recognizer3D.h.
CvMat* blortRecognizer::Recognizer3D::pIntrinsicDistort [private] |
Definition at line 135 of file Recognizer3D.h.
CvMat* blortRecognizer::Recognizer3D::pMapX [private] |
Definition at line 138 of file Recognizer3D.h.
CvMat * blortRecognizer::Recognizer3D::pMapY [private] |
Definition at line 138 of file Recognizer3D.h.
Definition at line 121 of file Recognizer3D.h.