2011-12-02 18:34:08 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2011, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
|
|
|
|
*/
|
|
|
|
|
|
2011-10-25 15:48:19 +00:00
|
|
|
#ifndef ADDOBJECTDIALOG_H_
|
|
|
|
|
#define ADDOBJECTDIALOG_H_
|
|
|
|
|
|
|
|
|
|
#include <QtGui/QDialog>
|
|
|
|
|
#include <QtCore/QTimer>
|
|
|
|
|
#include <opencv2/features2d/features2d.hpp>
|
|
|
|
|
#include <opencv2/core/core_c.h>
|
|
|
|
|
|
|
|
|
|
class Ui_addObjectDialog;
|
2011-11-15 16:37:40 +00:00
|
|
|
class ObjWidget;
|
2011-10-25 15:48:19 +00:00
|
|
|
class Camera;
|
|
|
|
|
class KeypointItem;
|
|
|
|
|
|
|
|
|
|
class AddObjectDialog : public QDialog {
|
|
|
|
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2012-01-28 01:00:23 +00:00
|
|
|
AddObjectDialog(Camera * camera, QList<ObjWidget*> * objects, bool mirrorView, QWidget * parent = 0, Qt::WindowFlags f = 0);
|
2011-10-25 15:48:19 +00:00
|
|
|
virtual ~AddObjectDialog();
|
|
|
|
|
|
|
|
|
|
private slots:
|
2011-11-23 16:44:14 +00:00
|
|
|
void update(const cv::Mat &);
|
2011-10-25 15:48:19 +00:00
|
|
|
void next();
|
|
|
|
|
void back();
|
|
|
|
|
void cancel();
|
|
|
|
|
void takePicture();
|
|
|
|
|
void updateNextButton();
|
2012-01-28 01:00:23 +00:00
|
|
|
void updateNextButton(const QRect &);
|
|
|
|
|
void changeSelectionMode();
|
2011-10-25 15:48:19 +00:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void closeEvent(QCloseEvent* event);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void setState(int state);
|
|
|
|
|
CvRect computeROI(const std::vector<cv::KeyPoint> & kpts);
|
|
|
|
|
private:
|
|
|
|
|
Ui_addObjectDialog * ui_;
|
|
|
|
|
Camera * camera_;
|
2011-11-15 16:37:40 +00:00
|
|
|
QList<ObjWidget*> * objects_;
|
2011-10-25 15:48:19 +00:00
|
|
|
IplImage * cvImage_;
|
|
|
|
|
|
|
|
|
|
enum State{kTakePicture, kSelectFeatures, kVerifySelection, kClosing};
|
|
|
|
|
int state_;
|
2012-01-28 01:00:23 +00:00
|
|
|
QRect roi_;
|
2011-10-25 15:48:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* ADDOBJECTDIALOG_H_ */
|