greenhouse/src/AddObjectDialog.h
matlabbe 680b1740b1 Moved all non-gui stuff outside the GUI
Added FindObject and ObjSignature classes
Added ULogger from utilite for pretty log

git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@356 620bd6b2-0a58-f614-fd9a-1bd335dccda9
2014-07-31 19:02:31 +00:00

63 lines
1.4 KiB
C++

/*
* Copyright (C) 2011, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
*/
#ifndef ADDOBJECTDIALOG_H_
#define ADDOBJECTDIALOG_H_
#include <QtGui/QDialog>
#include <QtCore/QTimer>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/core/core.hpp>
class Ui_addObjectDialog;
class ObjWidget;
class Camera;
class KeypointItem;
class KeypointDetector;
class DescriptorExtractor;
class ObjSignature;
class AddObjectDialog : public QDialog {
Q_OBJECT
public:
AddObjectDialog(Camera * camera, const cv::Mat & image, bool mirrorView, QWidget * parent = 0, Qt::WindowFlags f = 0);
virtual ~AddObjectDialog();
// ownership transferred to caller
void retrieveObject(ObjWidget ** widget, ObjSignature ** signature);
private Q_SLOTS:
void update(const cv::Mat &);
void next();
void back();
void cancel();
void takePicture();
void updateNextButton();
void updateNextButton(const cv::Rect &);
void changeSelectionMode();
protected:
virtual void closeEvent(QCloseEvent* event);
private:
void setState(int state);
cv::Rect computeROI(const std::vector<cv::KeyPoint> & kpts);
private:
Ui_addObjectDialog * ui_;
Camera * camera_;
ObjWidget * objWidget_;
ObjSignature * objSignature_;
cv::Mat cameraImage_;
cv::Rect roi_;
KeypointDetector * detector_;
DescriptorExtractor * extractor_;
enum State{kTakePicture, kSelectFeatures, kVerifySelection, kClosing};
int state_;
};
#endif /* ADDOBJECTDIALOG_H_ */