AddObjectDialog.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef ADDOBJECTDIALOG_H_
29 #define ADDOBJECTDIALOG_H_
30 
31 #include <QDialog>
32 #include <QtCore/QTimer>
33 #include <opencv2/features2d/features2d.hpp>
34 #include <opencv2/core/core.hpp>
35 #include "find_object/Header.h"
36 
37 class Ui_addObjectDialog;
38 
39 namespace find_object {
40 
41 class ObjWidget;
42 class Camera;
43 class KeypointItem;
44 class Feature2D;
45 class ObjSignature;
46 
47 class AddObjectDialog : public QDialog {
48 
49  Q_OBJECT
50 
51 public:
52  AddObjectDialog(Camera * camera, const cv::Mat & image, bool mirrorView, QWidget * parent = 0, Qt::WindowFlags f = 0);
53  virtual ~AddObjectDialog();
54 
55  // ownership transferred to caller
56  void retrieveObject(ObjWidget ** widget, ObjSignature ** signature);
57 
58 private Q_SLOTS:
59  void update(const cv::Mat &);
60  void update(const cv::Mat &, const find_object::Header &, const cv::Mat &, float);
61  void next();
62  void back();
63  void cancel();
64  void takePicture();
65  void updateNextButton();
66  void updateNextButton(const cv::Rect &);
67  void changeSelectionMode();
68 
69 protected:
70  virtual void closeEvent(QCloseEvent* event);
71 
72 private:
73  void setState(int state);
74  cv::Rect computeROI(const std::vector<cv::KeyPoint> & kpts);
75 private:
76  Ui_addObjectDialog * ui_;
80  cv::Mat cameraImage_;
81  cv::Rect roi_;
84 
86  int state_;
87 };
88 
89 } // namespace find_object
90 
91 #endif /* ADDOBJECTDIALOG_H_ */
Ui_addObjectDialog * ui_
void update(const cv::Mat &)
f
virtual void closeEvent(QCloseEvent *event)
AddObjectDialog(Camera *camera, const cv::Mat &image, bool mirrorView, QWidget *parent=0, Qt::WindowFlags f=0)
cv::Rect computeROI(const std::vector< cv::KeyPoint > &kpts)
void retrieveObject(ObjWidget **widget, ObjSignature **signature)


find_object_2d
Author(s): Mathieu Labbe
autogenerated on Mon Dec 12 2022 03:20:09