From e6282b8ace23142e341fa9b6e22bdef3f2f46abb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 May 2023 19:42:01 +0200 Subject: [PATCH] solve Issue I23683 --- samples/dnn/text_detection.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/dnn/text_detection.cpp b/samples/dnn/text_detection.cpp index 76989dcdc2..24902abfd7 100644 --- a/samples/dnn/text_detection.cpp +++ b/samples/dnn/text_detection.cpp @@ -126,7 +126,7 @@ int main(int argc, char** argv) // Detection std::vector< std::vector > detResults; detector.detect(frame, detResults); - + Mat frame2 = frame.clone(); if (detResults.size() > 0) { // Text Recognition Mat recInput; @@ -153,11 +153,11 @@ int main(int argc, char** argv) std::string recognitionResult = recognizer.recognize(cropped); std::cout << i << ": '" << recognitionResult << "'" << std::endl; - putText(frame, recognitionResult, quadrangle[3], FONT_HERSHEY_SIMPLEX, 1.5, Scalar(0, 0, 255), 2); + putText(frame2, recognitionResult, quadrangle[3], FONT_HERSHEY_SIMPLEX, 1.5, Scalar(0, 0, 255), 2); } - polylines(frame, contours, true, Scalar(0, 255, 0), 2); + polylines(frame2, contours, true, Scalar(0, 255, 0), 2); } - imshow(kWinName, frame); + imshow(kWinName, frame2); } return 0; }