include
find_object
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/Header.h
>
32
#include "
find_object/FindObjectExp.h
"
// DLL export/import defines
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
imageReceived(
const
cv::Mat & image,
const
find_object::Header
& header,
const
cv::Mat & depth,
float
depthConstant);
61
void
finished();
62
63
public
Q_SLOTS:
64
virtual
void
updateImageRate();
65
virtual
void
takeImage();
66
67
protected
:
68
void
startTimer();
69
void
stopTimer();
70
71
private
:
72
cv::VideoCapture
capture_
;
73
QTimer
cameraTimer_
;
74
QList<std::string>
images_
;
75
unsigned
int
currentImageIndex_
;
76
CameraTcpServer
*
cameraTcpServer_
;
77
};
78
79
}
// namespace find_object
80
81
#endif
/* CAMERA_H_ */
find_object::Camera::cameraTcpServer_
CameraTcpServer * cameraTcpServer_
Definition:
Camera.h:76
getPort
ROSCPP_DECL uint32_t getPort()
find_object::Camera::currentImageIndex_
unsigned int currentImageIndex_
Definition:
Camera.h:75
find_object::Camera::capture_
cv::VideoCapture capture_
Definition:
Camera.h:72
FINDOBJECT_EXP
#define FINDOBJECT_EXP
Definition:
FindObjectExp.h:38
find_object::Camera
Definition:
Camera.h:42
find_object::Header
Definition:
Header.h:36
find_object::Camera::images_
QList< std::string > images_
Definition:
Camera.h:74
find_object::CameraTcpServer
Definition:
CameraTcpServer.h:37
FindObjectExp.h
find_object::Camera::cameraTimer_
QTimer cameraTimer_
Definition:
Camera.h:73
start
ROSCPP_DECL void start()
find_object
Definition:
Camera.h:38
find_object::Camera::isRunning
virtual bool isRunning()
Definition:
Camera.h:50
Header.h
find_object_2d
Author(s): Mathieu Labbe
autogenerated on Mon Dec 12 2022 03:43:35