Camera.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 CAMERA_H_
29 #define CAMERA_H_
30 
31 #include "find_object/FindObjectExp.h" // DLL export/import defines
32 
33 #include <opencv2/highgui/highgui.hpp>
34 #include <QtCore/QObject>
35 #include <QtCore/QTimer>
36 #include <QtGui/QImage>
37 
38 namespace find_object {
39 
40 class CameraTcpServer;
41 
42 class FINDOBJECT_EXP Camera : public QObject {
43  Q_OBJECT
44 public:
45  Camera(QObject * parent = 0);
46  virtual ~Camera();
47 
48  virtual bool start();
49  virtual void stop();
50  virtual bool isRunning() {return cameraTimer_.isActive();}
51 
52  void pause();
53  int getTotalFrames();
54  int getCurrentFrameIndex();
55  int getPort();
56  void moveToFrame(int frame);
57 
58 Q_SIGNALS:
59  void imageReceived(const cv::Mat & image);
60  void finished();
61 
62 public Q_SLOTS:
63  virtual void updateImageRate();
64  virtual void takeImage();
65 
66 protected:
67  void startTimer();
68  void stopTimer();
69 
70 private:
71  cv::VideoCapture capture_;
72  QTimer cameraTimer_;
73  QList<std::string> images_;
74  unsigned int currentImageIndex_;
76 };
77 
78 } // namespace find_object
79 
80 #endif /* CAMERA_H_ */
ROSCPP_DECL uint32_t getPort()
QTimer cameraTimer_
Definition: Camera.h:72
virtual bool isRunning()
Definition: Camera.h:50
#define FINDOBJECT_EXP
Definition: FindObjectExp.h:38
unsigned int currentImageIndex_
Definition: Camera.h:74
CameraTcpServer * cameraTcpServer_
Definition: Camera.h:75
cv::VideoCapture capture_
Definition: Camera.h:71
QList< std::string > images_
Definition: Camera.h:73


find_object_2d
Author(s): Mathieu Labbe
autogenerated on Thu Jun 6 2019 19:22:26