35 #include <opencv2/core/core.hpp>
39 #define CAMERA_GROUP ("camera")
40 #define CAMERA_NUM_CHANNELS_KEY ("num_channels")
41 #define CAMERA_CHANNEL_GROUP_PREFIX ("channel_")
42 #define CAMERA_CHANNEL_TYPE_KEY ("type")
44 #define CAMERA_CHANNEL_TYPE_HSV_KEY ("hsv")
45 #define CAMERA_CHANNEL_TYPE_QR_KEY ("qr")
61 const double confidence,
const char *
const data = 0,
62 const size_t dataLength = 0);
68 const double confidence()
const;
69 const char *data()
const;
70 const size_t dataLength()
const;
88 void setImage(
const cv::Mat &image);
92 virtual void update(
const cv::Mat &image) = 0;
104 virtual void setImage(
const cv::Mat &image) = 0;
105 virtual ChannelImpl *channelImpl(
const std::string &name) = 0;
114 virtual void setImage(
const cv::Mat &image);
115 virtual ChannelImpl *channelImpl(
const std::string &name);
118 std::map<std::string, ChannelImpl *> m_channelImpls;
136 void setConfig(
const Config &config);
143 mutable bool m_valid;
151 static std::string extension();
153 static void setBasePath(
const std::string &path);
154 static std::string path(
const std::string &name = std::string());
155 static std::string defaultPath();
156 static std::string defaultConfigPath();
157 static void setDefaultConfigPath(
const std::string &name);
160 static std::string s_path;
167 virtual bool open(
const int number) = 0;
168 virtual bool isOpen()
const = 0;
169 virtual void setWidth(
const unsigned width) = 0;
170 virtual void setHeight(
const unsigned height) = 0;
171 virtual bool next(cv::Mat &image) = 0;
172 virtual bool close() = 0;
181 virtual bool open(
const int number);
182 virtual bool isOpen()
const;
183 virtual void setWidth(
const unsigned width);
184 virtual void setHeight(
const unsigned height);
185 virtual bool next(cv::Mat &image);
186 virtual bool close();
189 cv::VideoCapture *m_capture;
198 bool open(
const int number = 0);
203 void setWidth(
const unsigned width);
204 void setHeight(
const unsigned height);
206 unsigned width()
const;
207 unsigned height()
const;
212 const cv::Mat &rawImage()
const;
214 void setConfig(
const Config &config);
215 const Config &config()
const;
228 timeval m_lastUpdate;