From 45dcd156b7624cd40474989fd50762f08cdce569 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 May 2023 21:34:51 +0200 Subject: [PATCH] solve Issue 23685 --- samples/dnn/scene_text_spotting.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/dnn/scene_text_spotting.cpp b/samples/dnn/scene_text_spotting.cpp index 548289d0e9..37796acc60 100644 --- a/samples/dnn/scene_text_spotting.cpp +++ b/samples/dnn/scene_text_spotting.cpp @@ -103,6 +103,7 @@ int main(int argc, char** argv) // Inference std::vector< std::vector > detResults; detector.detect(frame, detResults); + Mat frame2 = frame.clone(); if (detResults.size() > 0) { // Text Recognition @@ -131,13 +132,13 @@ 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, Scalar(0, 0, 255), 2); + putText(frame2, recognitionResult, quadrangle[3], FONT_HERSHEY_SIMPLEX, 1, Scalar(0, 0, 255), 2); } - polylines(frame, contours, true, Scalar(0, 255, 0), 2); + polylines(frame2, contours, true, Scalar(0, 255, 0), 2); } else { std::cout << "No Text Detected." << std::endl; } - imshow(winName, frame); + imshow(winName, frame2); waitKey(); return 0;