nareshmlx/opencv-pr huggingface dataset:
**File:** modules/imgproc/src/hough.cpp
**Change Type:** modified
**Context:** PR #16561: improved version of HoughCircles (HOUGH_GRADIENT_ALT method)

**Code Changes:**
```diff
@@ -1005,6 +1005,7 @@ void HoughLinesPointSet( InputArray _point, OutputArray _lines, int lines_max, i
 
 struct EstimatedCircle
 {
+    EstimatedCircle() { accum = 0; }
     EstimatedCircle(Vec3f _c, int _accum) :
         c(_c), accum(_accum) {}
     Vec3f c;
@@ -1710,6 +1711,530 @@ static void HoughCirclesGradient(InputArray _image, OutputArray _circles,
     }
```

Review comment:
> 80 > 0.03 and below > 4000 > 0.06 "magic numbers"
**File:** modules/imgproc/test/test_houghcircles.cpp
**Change Type:** modified
**Context:** PR #16561: improved version of HoughCircles (HOUGH_GRADIENT_ALT method)

**Code Changes:**
```diff
@@ -178,26 +178,34 @@ INSTANTIATE_TEST_CASE_P(ImgProc, HoughCirclesTestFixture, testing::Combine(
     testing::Values(200)
     ));
 
-TEST(HoughCirclesTest, DefaultMaxRadius)
+
+class HoughCirclesTest : public testing::TestWithParam<HoughModes>
 {
-    string picture_name = "imgproc/stuff.jpg";
-    const double dp = 1.0;
```

Review comment:
It is better to split/parametrize test itself instead of internal loops.
**File:** modules/imgproc/src/hough.cpp
**Change Type:** modified
**Context:** PR #16561: improved version of HoughCircles (HOUGH_GRADIENT_ALT method)
**Review Line:** 1815

**Code Changes:**
```diff
+
+    for( int y = 0; y < edges.rows; y++ )
+    {
+        for( int x = 0; x < edges.cols; x++ )
+        {
+            if(!edgeData[y*estep + x] || mdata[y*mstep + x])
+                continue;
+
+            mdata[y*mstep + x] = (uchar)1;
+            stack.push_back(Point(x, y));
+            bool backtrace_mode = false;
```

Review comment:
This is the inner loop where performance matters. Address arithmetic is faster here and will not be replaced with .at
**File:** modules/imgproc/src/hough.cpp
**Change Type:** modified
**Context:** PR #16561: improved version of HoughCircles (HOUGH_GRADIENT_ALT method)
**Review Line:** 1804

**Code Changes:**
```diff
+    int mstep = (int)mask.step1();
+
+    circles.clear();
+    std::vector<Vec4f> nz;
+
+    std::vector<Point> stack;
+    const int n33[][2] = {{-1, -1}, {-1, 0}, {-1, 1}, {0, 1}, {1, 1}, {1, 0}, {1, -1}, {0, -1}};
+
+    for( int x = 0; x < mask.cols; x++ ) mdata[x] = mdata[(mask.rows-1)*mstep + x] = (uchar)1;
+    for( int y = 0; y < mask.rows; y++ ) mdata[y*mstep] = mdata[y*mstep + mask.cols-1] = (uchar)1;
+    mdata += mstep + 1;
```

Review comment:
std::stack is an adapter on top of std::vector (or list or deque). Why use this adapter instead of plain simple std::vector?
**File:** modules/imgproc/src/hough.cpp
**Change Type:** modified
**Context:** PR #16561: improved version of HoughCircles (HOUGH_GRADIENT_ALT method)

**Code Changes:**
```diff
@@ -1005,6 +1005,7 @@ void HoughLinesPointSet( InputArray _point, OutputArray _lines, int lines_max, i
 
 struct EstimatedCircle
 {
+    EstimatedCircle() { accum = 0; }
     EstimatedCircle(Vec3f _c, int _accum) :
         c(_c), accum(_accum) {}
     Vec3f c;
@@ -1710,6 +1711,530 @@ static void HoughCirclesGradient(InputArray _image, OutputArray _circles,
     }
```

Review comment:
I have not found simple inline function that takes uint64(_t) on input, just universal intrinsic that I do not need. I improved the implementation to use CV_POPCOUNT_U64 if possible. Someone (maybe me) in some subsequent patch can move it to some of core headers and rename cv::circle_popcnt() to cv::popcount() or cvPopCount64() or something like that.
**File:** modules/imgproc/src/hough.cpp
**Change Type:** modified
**Context:** PR #16561: improved version of HoughCircles (HOUGH_GRADIENT_ALT method)
**Review Line:** 1780

**Code Changes:**
```diff
+    dp = std::max(dp, 1.);
+
+    Mat Dx, Dy, edges;
+    Scharr(img, Dx, CV_16S, 1, 0);
+    Scharr(img, Dy, CV_16S, 0, 1);
+    Canny(Dx, Dy, edges, cannyThreshold/2, cannyThreshold, true);
+    Mat mask(img.rows + 2, img.cols + 2, CV_8U, Scalar::all(0));
+    double idp = 1./dp;
+    int minR = cvFloor(minRadius*idp);
+    int maxR = cvCeil(maxRadius*idp);
+    int acols = cvRound(img.cols*idp);
```

Review comment:
it's not preprocessing. Canny edge detector is the essential part of HoughCircles that takes grayscale image on input. HOUGH_GRADIENT method does the same.
**File:** modules/videoio/cmake/detect_ximea.cmake
**Change Type:** modified
**Context:** PR #17576: videoio(ximea): fix the detection of the XIMEA library - The location of the XIMEA library is not the same in all versions of this software...

**Code Changes:**
```diff
@@ -6,10 +6,10 @@ if(NOT HAVE_XIMEA)
     endif()
   endif()
   if(X86_64)
-    set(lib_dir "x64")
+    set(lib_dir "API/x64" "API/64bit")
     set(lib_suffix "64")
   else()
-    set(lib_dir "x86")
+    set(lib_dir "API/x86" "API/32bit")
```

Review comment:
I think `if(X86)` check should be added. OpenCV supports ARM, PowerPC, etc.
**File:** modules/videoio/cmake/detect_ximea.cmake
**Change Type:** modified
**Context:** PR #17576: videoio(ximea): fix the detection of the XIMEA library - The location of the XIMEA library is not the same in all versions of this software...

**Code Changes:**
```diff
@@ -6,10 +6,10 @@ if(NOT HAVE_XIMEA)
     endif()
   endif()
   if(X86_64)
-    set(lib_dir "x64")
+    set(lib_dir "API/x64" "API/64bit")
     set(lib_suffix "64")
   else()
-    set(lib_dir "x86")
+    set(lib_dir "API/x86" "API/32bit")
```

Review comment:
Perhaps. Do you have the opportunity to check the ximea folder tree on an ARM board for example? I have only been able to test it on X86 boards using Windows or Linux... However i have not changed the way it was previously done and if the architecture is not x86, the folder will not be found and it should not be a problem.
**File:** modules/videoio/cmake/detect_ximea.cmake
**Change Type:** modified
**Context:** PR #17576: videoio(ximea): fix the detection of the XIMEA library - The location of the XIMEA library is not the same in all versions of this software...

**Code Changes:**
```diff
@@ -6,10 +6,10 @@ if(NOT HAVE_XIMEA)
     endif()
   endif()
   if(X86_64)
-    set(lib_dir "x64")
+    set(lib_dir "API/x64" "API/64bit")
     set(lib_suffix "64")
   else()
-    set(lib_dir "x86")
+    set(lib_dir "API/x86" "API/32bit")
```

Review comment:
Also I propose to use CMake list instead of lib_dirXXX. It's native interface for `FIND_LIBRARY` and easy to extend in future.
**File:** cmake/OpenCVDetectCUDA.cmake
**Change Type:** modified
**Context:** PR #17432: CUDA: choose supported CC automatically

**Code Changes:**
```diff
@@ -53,6 +53,12 @@ if(CUDA_FOUND)
   message(STATUS "CUDA detected: " ${CUDA_VERSION})
 
   set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing")
+  set(_arch_fermi   "2.0")
+  set(_arch_kepler  "3.0;3.5;3.7")
+  set(_arch_maxwell "5.0;5.2")
+  set(_arch_pascal  "6.0;6.1")
+  set(_arch_volta   "7.0")
+  set(_arch_turing  "7.5")
```

Review comment:
> IN LISTS Requires CMake 3.0+ OpenCV 3.x requires support of CMake 2.8.12.2 ``` foreach(target_arch ${CC_LIST}) ```
**File:** cmake/OpenCVDetectCUDA.cmake
**Change Type:** modified
**Context:** PR #17432: CUDA: choose supported CC automatically

**Code Changes:**
```diff
@@ -53,6 +53,12 @@ if(CUDA_FOUND)
   message(STATUS "CUDA detected: " ${CUDA_VERSION})
 
   set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing")
+  set(_arch_fermi   "2.0")
+  set(_arch_kepler  "3.0;3.5;3.7")
+  set(_arch_maxwell "5.0;5.2")
+  set(_arch_pascal  "6.0;6.1")
+  set(_arch_volta   "7.0")
+  set(_arch_turing  "7.5")
```

Review comment:
It would be nice to split line above (so future modification and history would be straightforward) and use `${ARGN}` in `ocv_filter_available_architecture` macro ``` ocv_filter_available_architecture(__cuda_arch_bin ${_arch_fermi} ${_arch_kepler} ${_arch_maxwell} ${_arch_pascal} ${_arch_volta} ${_arch_turing} ) ``` ```.diff -macro(ocv_filter_available_architecture result_list TARGET_ARCH_LIST) +macro(ocv_filter_available_architecture result_list) - string(REPLACE " " ";" CC_LIST ${TARGET_ARCH_LIST}) + set(CC_LIST ${ARGN}) ```
**File:** cmake/OpenCVDetectCUDA.cmake
**Change Type:** modified
**Context:** PR #17432: CUDA: choose supported CC automatically

**Code Changes:**
```diff
@@ -53,6 +53,12 @@ if(CUDA_FOUND)
   message(STATUS "CUDA detected: " ${CUDA_VERSION})
 
   set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing")
+  set(_arch_fermi   "2.0")
+  set(_arch_kepler  "3.0;3.5;3.7")
+  set(_arch_maxwell "5.0;5.2")
+  set(_arch_pascal  "6.0;6.1")
+  set(_arch_volta   "7.0")
+  set(_arch_turing  "7.5")
```

Review comment:
It would be nice to ensure that its result is cached (or upstream variable is cached), so `cmake .` call doesn't trigger that again in a loop.
**File:** cmake/OpenCVDetectCUDA.cmake
**Change Type:** modified
**Context:** PR #17432: CUDA: choose supported CC automatically

**Code Changes:**
```diff
@@ -53,6 +53,12 @@ if(CUDA_FOUND)
   message(STATUS "CUDA detected: " ${CUDA_VERSION})
 
   set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing")
+  set(_arch_fermi   "2.0")
+  set(_arch_kepler  "3.0;3.5;3.7")
+  set(_arch_maxwell "5.0;5.2")
+  set(_arch_pascal  "6.0;6.1")
+  set(_arch_volta   "7.0")
+  set(_arch_turing  "7.5")
```

Review comment:
> `${_nvcc_res}` Just `_nvcc_res`.
**File:** modules/imgproc/src/smooth.dispatch.cpp
**Change Type:** modified
**Context:** PR #15855: imgproc: fix bit-exact GaussianBlur() / sepFilter2D() - **Merge with contrib**: https://github.com/opencv/opencv_contrib/pull/2342 **Merge ...
**Review Line:** 593

**Code Changes:**
```diff
+static bool validateGaussianBlurKernel(std::vector<T>& kernel)
+{
+    softdouble validation_sum = softdouble::zero();
+    for (size_t i = 0; i < kernel.size(); i++)
+    {
+        validation_sum += softdouble((double)kernel[i]);
+    }
+
+    bool isValid = validation_sum == softdouble::one();
+    return isValid;
+}
```

Review comment:
``` error: conversion from ‘__gnu_cxx::__alloc_traits<std::allocator<cv::{anonymous}::ufixedpoint16> >::value_type {aka cv::{anonymous}::ufixedpoint16}’ to ‘double’ is ambiguous validation_sum += softdouble((double)kernel[i]); ```
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
helo, just curious, which model is used here ? and if it is not (yet) in the [model zoo](https://github.com/opencv/opencv_extra/blob/master/testdata/dnn/download_models.py), shouldn't there be a download link somewhere ?
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
Please keep 4 whitespace
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
I think it's better to keep detector flag for compatibility. (Just "model")
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
Maybe just "detector"?
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
Please use blobFeomImage arguments for preprocessing
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
`blobFromImage(cropped, 1.0/127.5, Size(100,32), Scalar(127), false, false);`
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
I'd like to keep unchanged lines as is. Let's name a flag as just "ocr"
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
Only .pb is supported for detection model here.
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
```cpp static const std::string alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"; ```
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
```cpp const Mat& scores ```
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
Instead of multiple `minMaxLoc` it's better to use [cv::reduce](https://docs.opencv.org/master/d2/de8/group__core__array.html#ga4b78072a303f29d9031d56e5638da78e) with `REDUCE_MAX`.
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
`blobFromImage` can also perform scaling. So let's convert to grayscale first.
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
Instead of rotating of entire frame, can you try to create a matrix for mapping from frame points to 32x100 cv::Mat so box corners will be mapped to `(0, 0), (0, w-1), (h-1, w-1), (h-1, 0)`?
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
Even without `false, false` due they are by default. An probably, `Scalar::all(127.5)`.
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
We cannot use cv::reduce here because we need a character index.
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
The decode_text here is wrong all the adjacent same characters should be removed before removing the background classes ('-')
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
I think the total time should be included ``` detector.getPerfProfile(layersTimes) / freq + recognizer.getPerfProfile(layersTimes) / freq;```
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
Should be `Scalar::all(127.5)`. Ohterwise this is `[127.5, 0, 0, 0]`. Please also avoid specifying default arguments.
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
Looks like it's very good feature to have. If you want, you may propose a feature with `REDUCE_MAX_IDX` for `cv::reduce` in the separate PR. (corresponding issue https://github.com/opencv/opencv/issues/10286)
**File:** samples/dnn/text_detection.cpp
**Change Type:** modified
**Context:** PR #16941: Add text recognition to examples_dnn_text_decoder

**Code Changes:**
```diff
@@ -1,3 +1,20 @@
+/*
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+
+    import torch
```

Review comment:
Please remove extra new line