diff --git a/impl/application/ocean/demo/cv/detector/qrcodes/detector2d/ios/AppDelegate.mm b/impl/application/ocean/demo/cv/detector/qrcodes/detector2d/ios/AppDelegate.mm index 80d332cd4..fada5d3ad 100644 --- a/impl/application/ocean/demo/cv/detector/qrcodes/detector2d/ios/AppDelegate.mm +++ b/impl/application/ocean/demo/cv/detector/qrcodes/detector2d/ios/AppDelegate.mm @@ -89,6 +89,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( std::vector commandLines; commandLines.push_back(L"LiveVideoId:0"); // 0. Video source commandLines.push_back(L"1280x720"); // 1. Video resolution + commandLines.push_back(L"--micro"); // 2. Include micro QR codes detectorWrapper_ = Detector2DWrapper(commandLines); diff --git a/impl/ocean/cv/detector/qrcodes/MicroQRCodeDetector.cpp b/impl/ocean/cv/detector/qrcodes/MicroQRCodeDetector.cpp index 0febeccd5..1ab24217b 100644 --- a/impl/ocean/cv/detector/qrcodes/MicroQRCodeDetector.cpp +++ b/impl/ocean/cv/detector/qrcodes/MicroQRCodeDetector.cpp @@ -64,7 +64,7 @@ bool MicroQRCodeDetector::getTimingPatternModules(const uint8_t* const yFrame, c Bresenham bresenhamBack(xBack, yBack, Numeric::round32(farPointBack.x()), Numeric::round32(farPointBack.y())); VectorT2 lastIn, firstOut; - if(TransitionDetector::findNextPixel(yFrame, xBack, yBack, width, height, paddingElements, bresenhamBack, maxStepSize, finderPattern.grayThreshold(), columns, rows, lastIn, firstOut)) + if(xBack < width && yBack < height && TransitionDetector::findNextPixel(yFrame, xBack, yBack, width, height, paddingElements, bresenhamBack, maxStepSize, finderPattern.grayThreshold(), columns, rows, lastIn, firstOut)) { // Found dark pixel in quiet zone return false; @@ -96,7 +96,8 @@ bool MicroQRCodeDetector::getTimingPatternModules(const uint8_t* const yFrame, c bool foundDark = true; for (bool start : {true, false}) { - if ((start && !TransitionDetector::findNextPixel(yFrame, x, y, width, height, paddingElements, bresenham, maxStepSize, finderPattern.grayThreshold(), columns, rows, lastIn, firstOut)) + if ( x >= width || y >= height + || (start && !TransitionDetector::findNextPixel(yFrame, x, y, width, height, paddingElements, bresenham, maxStepSize, finderPattern.grayThreshold(), columns, rows, lastIn, firstOut)) || (!start && !TransitionDetector::findNextPixel(yFrame, x, y, width, height, paddingElements, bresenham, maxStepSize, finderPattern.grayThreshold(), columns, rows, lastIn, firstOut))) { foundDark = false;