This is done using OpenCV function called convexHull shown in line 12. If the location is not a quad, we draw the outer boundary of all the points ( also called the convex hull ) of all the points. in a QR code ), we simply draw the quad ( line 14 ). The code below takes in the input image and a vector of decoded symbols from the previous step. Next, we will explain the code for displaying all the symbols. Finally, we iterate over the symbols and extract the type, data, and location information and push it in the vector of detected objects ( lines 21-40). Finally, we scan the image for symbols ( line 19). We then convert the grayscale image to a ZBar compatible format in line 16. ![]() We then convert the image to grayscale ( lines 11-13). If you want only a specific kind of symbol to be detected, you need to change ZBAR_NONE to a different type listed here. _back(Point(symbol->get_location_x(i),symbol->get_location_y(i))) įirst, in lines 5-9 we create an instance of a ZBar ImageScanner and configure it to detect all kinds of barcodes and QR codes. ![]() Scan the image for barcodes and QRCodesįor(Image::SymbolIterator symbol = image.symbol_begin() symbol != image.symbol_end() ++symbol) ![]() Image image(im.cols, im.rows, "Y800", (uchar *)imGray.data, im.cols * im.rows) Void decode(Mat &im, vector&decodedObjects)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |