50 #include <opencv2/core/core.hpp>
54 #define CAMERA_GROUP ("camera")
55 #define CAMERA_NUM_CHANNELS_KEY ("num_channels")
56 #define CAMERA_CHANNEL_GROUP_PREFIX ("channel_")
57 #define CAMERA_CHANNEL_TYPE_KEY ("type")
59 #define CAMERA_CHANNEL_TYPE_HSV_KEY ("hsv")
60 #define CAMERA_CHANNEL_TYPE_QR_KEY ("qr")
76 const double &confidence,
const char *data = 0,
77 const size_t &dataLength = 0);
85 const double confidence()
const;
86 const char *data()
const;
87 const size_t dataLength()
const;
105 void setImage(
const cv::Mat &image);
106 ObjectVector objects(
const Config &config);
109 virtual void update(
const cv::Mat &image) = 0;
110 virtual ObjectVector findObjects(
const Config &config) = 0;
121 virtual void setImage(
const cv::Mat &image) = 0;
122 virtual ChannelImpl *channelImpl(
const std::string &name) = 0;
131 virtual void setImage(
const cv::Mat &image);
132 virtual ChannelImpl *channelImpl(
const std::string &name);
135 std::map<std::string, ChannelImpl *> m_channelImpls;
147 const ObjectVector *objects()
const;
155 void setConfig(
const Config &config);
160 mutable ObjectVector m_objects;
162 mutable bool m_valid;
170 static std::string extension();
172 static void setBasePath(
const std::string &path);
173 static std::string path(
const std::string &name = std::string());
174 static std::string defaultPath();
175 static std::string defaultConfigPath();
176 static void setDefaultConfigPath(
const std::string &name);
179 static std::string s_path;
186 virtual bool open(
const int number) = 0;
187 virtual bool isOpen()
const = 0;
188 virtual void setWidth(
const unsigned width) = 0;
189 virtual void setHeight(
const unsigned height) = 0;
190 virtual bool next(cv::Mat &image) = 0;
191 virtual bool close() = 0;
200 virtual bool open(
const int number);
201 virtual bool isOpen()
const;
202 virtual void setWidth(
const unsigned width);
203 virtual void setHeight(
const unsigned height);
204 virtual bool next(cv::Mat &image);
205 virtual bool close();
208 cv::VideoCapture *m_capture;
217 bool open(
const int number = 0);
222 void setWidth(
const unsigned width);
223 void setHeight(
const unsigned height);
225 unsigned width()
const;
226 unsigned height()
const;
228 const ChannelPtrVector &channels()
const;
232 const cv::Mat &rawImage()
const;
234 void setConfig(
const Config &config);
235 const Config &config()
const;
240 const unsigned char *bgr()
const;
247 ChannelPtrVector m_channels;
250 timeval m_lastUpdate;
252 mutable unsigned char *m_bgr;
253 mutable unsigned m_bgrSize;
Camera::Device * cDevice()
Definition: camera.hpp:211
Definition: camera.hpp:62
std::vector< Object > ObjectVector
Definition: camera.hpp:97
Definition: ardrone.hpp:144
Definition: camera.hpp:167
std::vector< Channel * > ChannelPtrVector
Definition: camera.hpp:165
Definition: camera.hpp:138
#define EXPORT_SYM
Definition: export.h:7
Definition: camera.hpp:99
Definition: camera.hpp:117
Definition: camera.hpp:71
Definition: camera.hpp:125