reduce extra adaptiveThreshold()
authorAleksandrPanov <alexander.panov@xperience.ai>
Tue, 18 Oct 2022 20:25:41 +0000 (23:25 +0300)
committerAleksandrPanov <alexander.panov@xperience.ai>
Tue, 18 Oct 2022 20:25:41 +0000 (23:25 +0300)
modules/objdetect/src/qrcode.cpp

index f3e48f6ee05bb3c9ae4763dd523dddac68d62022..23cd4f3ad4f9e6e4aad300ea0b30640dd27fc74e 100644 (file)
@@ -2273,10 +2273,8 @@ bool QRDecode::updatePerspective()
     pts.push_back(centerPt);
 
     Mat H = findHomography(pts, perspective_points);
-    Mat bin_original;
-    adaptiveThreshold(original, bin_original, 255, ADAPTIVE_THRESH_GAUSSIAN_C, THRESH_BINARY, 83, 2);
     Mat temp_intermediate;
-    warpPerspective(bin_original, temp_intermediate, H, temporary_size, INTER_NEAREST);
+    warpPerspective(bin_barcode, temp_intermediate, H, temporary_size, INTER_NEAREST);
     no_border_intermediate = temp_intermediate(Range(1, temp_intermediate.rows), Range(1, temp_intermediate.cols));
 
     const int border = cvRound(0.1 * test_perspective_size);