/* * FindObject.h * * Created on: 2014-07-30 * Author: mathieu */ #ifndef FINDOBJECT_H_ #define FINDOBJECT_H_ #include "find_object/FindObjectExp.h" // DLL export/import defines #include #include #include #include #include #include #include #include #include #include class ObjSignature; class Vocabulary; class KeypointDetector; class DescriptorExtractor; class FINDOBJECT_EXP FindObject : public QObject { Q_OBJECT; public: enum TimeStamp{kTimeKeypointDetection, kTimeDescriptorExtraction, kTimeIndexing, kTimeMatching, kTimeHomography, kTimeTotal}; public: FindObject(QObject * parent = 0); virtual ~FindObject(); int loadObjects(const QString & dirPath); // call updateObjects() const ObjSignature * addObject(const QString & filePath); const ObjSignature * addObject(const cv::Mat & image, int id=0); bool addObject(ObjSignature * obj); // take ownership when true is returned void removeObject(int id); void removeAllObjects(); bool detect(const cv::Mat & image, QMultiMap > & objectsDetected); void updateDetectorExtractor(); void updateObjects(); void updateVocabulary(); const QMap & objects() const {return objects_;} const Vocabulary * vocabulary() const {return vocabulary_;} const QMap & timeStamps() const {return timeStamps_;} const std::vector & sceneKeypoints() const {return sceneKeypoints_;} const cv::Mat & sceneDescriptors() const {return sceneDescriptors_;} const QMultiMap & sceneWords() const {return sceneWords_;} const QMap > & matches() const {return matches_;} const QMultiMap > & inliers() const {return inliers_;} const QMultiMap > & outliers() const {return outliers_;} const QMultiMap > & rejectedInliers() const {return rejectedInliers_;} const QMultiMap > & rejectedOutliers() const {return rejectedOutliers_;} float minMatchedDistance() const {return minMatchedDistance_;} float maxMatchedDistance() const {return maxMatchedDistance_;} public Q_SLOTS: void detect(const cv::Mat & image); Q_SIGNALS: void objectsFound(const QMultiMap > &); private: void clearVocabulary(); private: QMap objects_; Vocabulary * vocabulary_; QMap objectsDescriptors_; QMap dataRange_; // KeypointDetector * detector_; DescriptorExtractor * extractor_; QMap timeStamps_; std::vector sceneKeypoints_; cv::Mat sceneDescriptors_; QMultiMap sceneWords_; QMap > matches_; // ObjectID Map< ObjectDescriptorIndex, SceneDescriptorIndex >, match the number of objects QMultiMap > inliers_; // ObjectID Map< ObjectDescriptorIndex, SceneDescriptorIndex >, match the number of detected objects QMultiMap > outliers_; // ObjectID Map< ObjectDescriptorIndex, SceneDescriptorIndex >, match the number of detected objects QMultiMap > rejectedInliers_; // ObjectID Map< ObjectDescriptorIndex, SceneDescriptorIndex > QMultiMap > rejectedOutliers_; // ObjectID Map< ObjectDescriptorIndex, SceneDescriptorIndex > float minMatchedDistance_; float maxMatchedDistance_; }; #endif /* FINDOBJECT_H_ */