From ba575fd4ad182b0d099ad141da170cc589269a35 Mon Sep 17 00:00:00 2001 From: AleksandrPanov Date: Tue, 18 Oct 2022 23:25:41 +0300 Subject: [PATCH] reduce extra adaptiveThreshold() --- modules/objdetect/src/qrcode.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/objdetect/src/qrcode.cpp b/modules/objdetect/src/qrcode.cpp index f3e48f6ee0..23cd4f3ad4 100644 --- a/modules/objdetect/src/qrcode.cpp +++ b/modules/objdetect/src/qrcode.cpp @@ -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); -- GitLab