7 scanner_.set_config(zbar::ZBAR_NONE, zbar::ZBAR_CFG_ENABLE, 1);
10 bool Detector::detect(cv::Mat& image,
int timeout,
unsigned int offsetx,
unsigned int offsety){
11 bool detected =
false;
16 scanner_.set_config(zbar::ZBAR_NONE, zbar::ZBAR_CFG_ENABLE, 1);
17 int width = image.cols;
18 int height = image.rows;
21 cv::cvtColor(image,gray_image,CV_BGR2GRAY);
24 zbar::Image img(width, height,
"Y800", gray_image.data, width * height);
30 for(zbar::Image::SymbolIterator symbol = img.symbol_begin();
31 symbol != img.symbol_end();
37 i<symbol->get_location_size();
41 polygon_.push_back(cv::Point(symbol->get_location_x(i) + offsetx,symbol->get_location_y(i) + offsety));
59 img.set_data(NULL, 0);
bool detect(cv::Mat &image, int timeout=1000, unsigned int offsetx=0, unsigned int offsety=0)
zbar::ImageScanner scanner_
TFSIMD_FORCE_INLINE const tfScalar & y() const
TFSIMD_FORCE_INLINE const tfScalar & x() const
std::vector< cv::Point > polygon_
std::vector< std::pair< cv::Point, cv::Point > > lines_