nareshmlx/opencv-pr huggingface dataset:
**File:** modules/objdetect/src/face_detect.cpp
**Change Type:** modified
**Context:** PR #23020: upgrade FaceDetectorYN to v2

**Code Changes:**
```diff
@@ -6,6 +6,7 @@
 
 #include "opencv2/imgproc.hpp"
 #include "opencv2/core.hpp"
+
 #ifdef HAVE_OPENCV_DNN
 #include "opencv2/dnn.hpp"
 #endif
@@ -27,6 +28,8 @@ class FaceDetectorYNImpl : public FaceDetectorYN
                        int top_k,
```

Review comment:
`std::vector<Point2f>& priors_layer = priors[i];` -> `const std::vector<Point2f>& priors_layer = priors[i];`
**File:** modules/objdetect/src/face_detect.cpp
**Change Type:** modified
**Context:** PR #23020: upgrade FaceDetectorYN to v2

**Code Changes:**
```diff
@@ -6,6 +6,7 @@
 
 #include "opencv2/imgproc.hpp"
 #include "opencv2/core.hpp"
+
 #ifdef HAVE_OPENCV_DNN
 #include "opencv2/dnn.hpp"
 #endif
@@ -27,6 +28,8 @@ class FaceDetectorYNImpl : public FaceDetectorYN
                        int top_k,
```

Review comment:
I would suggest make it static
**File:** modules/objdetect/src/face_detect.cpp
**Change Type:** modified
**Context:** PR #23020: upgrade FaceDetectorYN to v2

**Code Changes:**
```diff
@@ -6,6 +6,7 @@
 
 #include "opencv2/imgproc.hpp"
 #include "opencv2/core.hpp"
+
 #ifdef HAVE_OPENCV_DNN
 #include "opencv2/dnn.hpp"
 #endif
@@ -27,6 +28,8 @@ class FaceDetectorYNImpl : public FaceDetectorYN
                        int top_k,
```

Review comment:
Hello, I don't think changing this variable to static is better for performance.
**File:** modules/dnn/src/layers/region_layer.cpp
**Change Type:** modified
**Context:** PR #22660: Fix objectness is not assigned in dnn::region_layer
**Review Line:** 323

**Code Changes:**
```diff
                                 dstData[box_index + 2] = (srcData[box_index + 2]) * (srcData[box_index + 2]) * 4 * biasData[2 * a] / wNorm;
                                 dstData[box_index + 3] = (srcData[box_index + 3]) * (srcData[box_index + 3]) * 4 * biasData[2 * a + 1] / hNorm;
+                                dstData[box_index + 4] = srcData[p_index];
 
                                 scale = srcData[p_index];
                                 if (classfix == -1 && scale < thresh)
```

Review comment:
If I understand correctly, `new_coords` only have affects on how we calculate the width and height of bboxes. It does not relate to whether objectness should be kept or not. See these lines from darknet: https://github.com/AlexeyAB/darknet/blob/62e5549cef53bd11890808615e0bfae59cfd4491/src/yolo_layer.c#L132-L153 By they way, the `scale` in line 322 should be the objectness as you mentioned. Objectness is only used to calculate the final object score, and hence we do not need to keep it in the output.
**File:** modules/videoio/src/cap_dshow.cpp
**Change Type:** modified
**Context:** PR #23460: Fix OBS Virtual Camera capture.
**Review Line:** 2889

**Code Changes:**
```diff
 
     // Disable format conversion if using 8/16-bit data (e-Con systems)
-    if (checkSingleByteFormat(VD->pAmMediaType->subtype) || (VD->pAmMediaType->subtype == MEDIASUBTYPE_Y16)) {
+    if (checkSingleByteFormat(VD->pAmMediaType->subtype) ||
+        (VD->pAmMediaType->subtype == MEDIASUBTYPE_Y16 || VD->pAmMediaType->subtype == MEDIASUBTYPE_YUY2))
+    {
         DebugPrintOut("SETUP: Not converting frames to RGB.\n");
         mt.subtype = VD->pAmMediaType->subtype;
     }
```

Review comment:
Converting from YUY2 to BGR manually instead of using DirectShow helps with making the OBS Virtual Camera work. But I am not sure whether it is a bug in the OBS Virtual Camera or in `cap_dhow.cpp`.
**File:** samples/cpp/tutorial_code/ImgProc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.cpp
**Change Type:** modified
**Context:** PR #23442: Fix image loading in tutorials code
**Review Line:** 23

**Code Changes:**
```diff
-"{image          |original.JPG | input image name     }"
-"{R              |53           | radius               }"
-"{SNR            |5200         | signal to noise ratio}"
+"{image          |original.jpg | input image name     }"
+"{R              |5           | radius               }"
+"{SNR            |100         | signal to noise ratio}"
 ;
 
 int main(int argc, char *argv[])
@@ -35,6 +36,7 @@ int main(int argc, char *argv[])
     int R = parser.get<int>("R");
```

Review comment:
Why do you change defaults?
**File:** samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp
**Change Type:** modified
**Context:** PR #23442: Fix image loading in tutorials code

**Code Changes:**
```diff
@@ -26,26 +26,28 @@ int max_Trackbar = 5;
 /// Function Headers
 void MatchingMethod( int, void* );
 
+const char* keys =
+"{ help  h| | Print help message. }"
+"{ @input1 | Template_Matching_Original_Image.jpg | image_name }"
+"{ @input2 | Template_Matching_Template_Image.jpg | template_name }"
+"{ @input3 |  | mask_name }";
+
```

Review comment:
Please remove `./` at the beginning. Here and in the following places.
**File:** samples/cpp/tutorial_code/ImgProc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.cpp
**Change Type:** modified
**Context:** PR #23442: Fix image loading in tutorials code
**Review Line:** 23

**Code Changes:**
```diff
-"{image          |original.JPG | input image name     }"
-"{R              |53           | radius               }"
-"{SNR            |5200         | signal to noise ratio}"
+"{image          |original.jpg | input image name     }"
+"{R              |5           | radius               }"
+"{SNR            |100         | signal to noise ratio}"
 ;
 
 int main(int argc, char *argv[])
@@ -35,6 +36,7 @@ int main(int argc, char *argv[])
     int R = parser.get<int>("R");
```

Review comment:
because previous values does not work
**File:** modules/gapi/test/gapi_fluid_resize_test.cpp
**Change Type:** modified
**Context:** PR #22471: Increasing tolerance for Preproc4lpiTest set on ARM - The Resize gives calculation deviation on ARM. So the Resize test tolerance should be...
**Review Line:** 836

**Code Changes:**
```diff
 
+#if defined(__arm__) || defined(__aarch64__)
+    EXPECT_GE(2, cvtest::norm(out_mat(roi), out_mat_ocv(roi), NORM_INF));
+#else
     EXPECT_EQ(0, cvtest::norm(out_mat(roi), out_mat_ocv(roi), NORM_INF));
+#endif
 }
 
 INSTANTIATE_TEST_CASE_P(Fluid, Preproc4lpiTest,
```

Review comment:
Is it the only test which fails? Don't we instantiate other tests with this Resize? Just asking
**File:** modules/gapi/test/gapi_fluid_resize_test.cpp
**Change Type:** modified
**Context:** PR #22471: Increasing tolerance for Preproc4lpiTest set on ARM - The Resize gives calculation deviation on ARM. So the Resize test tolerance should be...
**Review Line:** 836

**Code Changes:**
```diff
 
+#if defined(__arm__) || defined(__aarch64__)
+    EXPECT_GE(2, cvtest::norm(out_mat(roi), out_mat_ocv(roi), NORM_INF));
+#else
     EXPECT_EQ(0, cvtest::norm(out_mat(roi), out_mat_ocv(roi), NORM_INF));
+#endif
 }
 
 INSTANTIATE_TEST_CASE_P(Fluid, Preproc4lpiTest,
```

Review comment:
> `EXPECT_EQ(2,` `EXPECT_GE(2, ...);` or even `EXPECT_LE(..., 2);` should be better.
**File:** modules/highgui/src/roiSelector.cpp
**Change Type:** modified
**Context:** PR #23196: added argument to print notice in `roiSelector.cpp`

**Code Changes:**
```diff
@@ -13,11 +13,14 @@ namespace
 class ROISelector
 {
   public:
-    Rect select(const String &windowName, Mat img, bool showCrossair = true, bool fromCenter = true)
+    Rect select(const String &windowName, Mat img, bool showCrossair = true, bool fromCenter = true, bool printNotice = true)
     {
-        // show notice to user
-        printf("Select a ROI and then press SPACE or ENTER button!\n");
-        printf("Cancel the selection process by pressing c button!\n");
```

Review comment:
This line should be guarded too.
**File:** modules/dnn/src/tflite/tflite_importer.cpp
**Change Type:** modified
**Context:** PR #23325: Propagate inputs info for ONNX and TFLite models

**Code Changes:**
```diff
@@ -163,6 +163,8 @@ void TFLiteImporter::populateNet()
     CV_Assert(modelTensors);
     layouts.resize(modelTensors->size(), DATA_LAYOUT_UNKNOWN);
     size_t subgraph_inputs_size = subgraph_inputs->size();
+    std::vector<std::string> inputsNames(subgraph_inputs_size);
+    std::vector<MatShape> inputsShapes(subgraph_inputs_size);
     for (size_t i = 0; i < subgraph_inputs_size; ++i)
     {
         int idx = subgraph_inputs->Get(i);
@@ -171,7 +173,24 @@ void TFLiteImporter::populateNet()
```

Review comment:
vector sizes are known here. It makes sense to define size and do not use push_back.
**File:** modules/dnn/src/net_impl.cpp
**Change Type:** modified
**Context:** PR #23325: Propagate inputs info for ONNX and TFLite models
**Review Line:** 1414

**Code Changes:**
```diff
     {
         CV_Assert(!netInputLayer.empty());
@@ -1411,18 +1412,17 @@ void Net::Impl::setInput(InputArray blob, const String& name, double scalefactor
             if (!inputShapeLimitation.empty())
             {
                 CV_CheckEQ(inputShapeLimitation.size(), blobShape.size(), "");
-#if 0  // TODO: DNNTestNetwork.MobileNet_SSD_Caffe_Different_Width_Height/0
                 const size_t dims = inputShapeLimitation.size();
                 for (size_t dim = 0; dim < dims; dim++)
                 {
                     if (dims >= 3 && dim == 0 && inputShapeLimitation[0] == 1)
```

Review comment:
It's not relevant change.
**File:** modules/dnn/src/net_impl.cpp
**Change Type:** modified
**Context:** PR #23325: Propagate inputs info for ONNX and TFLite models
**Review Line:** 1414

**Code Changes:**
```diff
     {
         CV_Assert(!netInputLayer.empty());
@@ -1411,18 +1412,17 @@ void Net::Impl::setInput(InputArray blob, const String& name, double scalefactor
             if (!inputShapeLimitation.empty())
             {
                 CV_CheckEQ(inputShapeLimitation.size(), blobShape.size(), "");
-#if 0  // TODO: DNNTestNetwork.MobileNet_SSD_Caffe_Different_Width_Height/0
                 const size_t dims = inputShapeLimitation.size();
                 for (size_t dim = 0; dim < dims; dim++)
                 {
                     if (dims >= 3 && dim == 0 && inputShapeLimitation[0] == 1)
```

Review comment:
The following tests were failed: ```cpp [ FAILED ] Test_ONNX_layers.Convolution_variable_weight_bias/0, where GetParam() = OCV/CPU [ FAILED ] Test_ONNX_layers.Conv1d_variable_weight_bias/0, where GetParam() = OCV/CPU ``` ``` C++ exception with description "OpenCV(4.7.0-dev) /home/dkurt/opencv/modules/dnn/src/net_impl.cpp:1413: error: (-2:Unspecified error) in function 'virtual void cv::dnn::dnn4_v20221220::Net::Impl::setInput(cv::InputArray, const String&, double, const Scalar&)' > (expected: 'inputShapeLimitation.size() == blobShape.size()'), where > 'inputShapeLimitation.size()' is 1 > must be equal to > 'blobShape.size()' is 2 " thrown in the test body. ``` The thing is that there is no limitation for the shapes - OpenCV networks are flexible for any valid input size,
**File:** modules/dnn/src/net_impl.cpp
**Change Type:** modified
**Context:** PR #23325: Propagate inputs info for ONNX and TFLite models
**Review Line:** 1414

**Code Changes:**
```diff
     {
         CV_Assert(!netInputLayer.empty());
@@ -1411,18 +1412,17 @@ void Net::Impl::setInput(InputArray blob, const String& name, double scalefactor
             if (!inputShapeLimitation.empty())
             {
                 CV_CheckEQ(inputShapeLimitation.size(), blobShape.size(), "");
-#if 0  // TODO: DNNTestNetwork.MobileNet_SSD_Caffe_Different_Width_Height/0
                 const size_t dims = inputShapeLimitation.size();
                 for (size_t dim = 0; dim < dims; dim++)
                 {
                     if (dims >= 3 && dim == 0 && inputShapeLimitation[0] == 1)
```

Review comment:
It makes sense to hide/remove `inputShapeLimitation` constant with the condition. It's abandoned constant with empty condition.
**File:** modules/dnn/src/net_impl.cpp
**Change Type:** modified
**Context:** PR #23325: Propagate inputs info for ONNX and TFLite models
**Review Line:** 1414

**Code Changes:**
```diff
     {
         CV_Assert(!netInputLayer.empty());
@@ -1411,18 +1412,17 @@ void Net::Impl::setInput(InputArray blob, const String& name, double scalefactor
             if (!inputShapeLimitation.empty())
             {
                 CV_CheckEQ(inputShapeLimitation.size(), blobShape.size(), "");
-#if 0  // TODO: DNNTestNetwork.MobileNet_SSD_Caffe_Different_Width_Height/0
                 const size_t dims = inputShapeLimitation.size();
                 for (size_t dim = 0; dim < dims; dim++)
                 {
                     if (dims >= 3 && dim == 0 && inputShapeLimitation[0] == 1)
```

Review comment:
Decided to hide it under `#if 0` completely.
**File:** modules/dnn/src/layers/convolution_layer.cpp
**Change Type:** modified
**Context:** PR #17858: added depth-wise convolution; gives ~20-40% performance improvement on MobileSSD networks

**Code Changes:**
```diff
@@ -833,6 +833,7 @@ class ConvolutionLayerImpl CV_FINAL : public BaseConvolutionLayerImpl
         bool useAVX;
         bool useAVX2;
         bool useAVX512;
+        int blk_size_cn;
 
         ParallelConv()
             : input_(0), weights_(0), output_(0), ngroups_(0), nstripes_(0),
@@ -889,12 +890,17 @@ class ConvolutionLayerImpl CV_FINAL : public BaseConvolutionLayerImpl
             p.useAVX2   = checkHardwareSupport(CPU_AVX2) && isConv2D;
```

Review comment:
why we check `batchSize == ngroups` and `ngroups > 1`? depthwise convolution is a convolution layer with groups == input channels == output channels. So the question is what we expect to match `depthWiseConvolution`?
**File:** modules/flann/include/opencv2/flann/flann_base.hpp
**Change Type:** modified
**Context:** PR #23276: Fixed potential memory leak in flann

**Code Changes:**
```diff
@@ -45,6 +45,21 @@
 
 namespace cvflann
 {
+class FILEScopeGuard {
+
+public:
+    explicit FILEScopeGuard(FILE* file) {
+        file_ = file;
+    };
```

Review comment:
What is about other exceptions? They still cause leaks. Perhaps we need RAII-based scope guard for `fin` with cleanup/destructor with `fclose()` call (new code should use `std::ifstream`)
**File:** modules/flann/include/opencv2/flann/flann_base.hpp
**Change Type:** modified
**Context:** PR #23276: Fixed potential memory leak in flann

**Code Changes:**
```diff
@@ -45,6 +45,21 @@
 
 namespace cvflann
 {
+class FILEScopeGuard {
+
+public:
+    explicit FILEScopeGuard(FILE* file) {
+        file_ = file;
+    };
```

Review comment:
Debug message is redundant.
**File:** modules/flann/include/opencv2/flann/flann_base.hpp
**Change Type:** modified
**Context:** PR #23276: Fixed potential memory leak in flann

**Code Changes:**
```diff
@@ -45,6 +45,21 @@
 
 namespace cvflann
 {
+class FILEScopeGuard {
+
+public:
+    explicit FILEScopeGuard(FILE* file) {
+        file_ = file;
+    };
```

Review comment:
there is no rvalue in C++98
**File:** modules/flann/include/opencv2/flann/flann_base.hpp
**Change Type:** modified
**Context:** PR #23276: Fixed potential memory leak in flann

**Code Changes:**
```diff
@@ -45,6 +45,21 @@
 
 namespace cvflann
 {
+class FILEScopeGuard {
+
+public:
+    explicit FILEScopeGuard(FILE* file) {
+        file_ = file;
+    };
```

Review comment:
don't add unused code
**File:** modules/flann/include/opencv2/flann/flann_base.hpp
**Change Type:** modified
**Context:** PR #23276: Fixed potential memory leak in flann

**Code Changes:**
```diff
@@ -45,6 +45,21 @@
 
 namespace cvflann
 {
+class FILEScopeGuard {
+
+public:
+    explicit FILEScopeGuard(FILE* file) {
+        file_ = file;
+    };
```

Review comment:
Revert unnecessary whitespace changes.
**File:** modules/flann/include/opencv2/flann/flann_base.hpp
**Change Type:** modified
**Context:** PR #23276: Fixed potential memory leak in flann

**Code Changes:**
```diff
@@ -45,6 +45,21 @@
 
 namespace cvflann
 {
+class FILEScopeGuard {
+
+public:
+    explicit FILEScopeGuard(FILE* file) {
+        file_ = file;
+    };
```

Review comment:
constructors with one parameter should be `explicit`
**File:** modules/flann/include/opencv2/flann/flann_base.hpp
**Change Type:** modified
**Context:** PR #23276: Fixed potential memory leak in flann

**Code Changes:**
```diff
@@ -45,6 +45,21 @@
 
 namespace cvflann
 {
+class FILEScopeGuard {
+
+public:
+    explicit FILEScopeGuard(FILE* file) {
+        file_ = file;
+    };
```

Review comment:
`fopen` / `get_file` methods should be removed. We need just cleanup scope guard (in C++11 it could be `std::unique_ptr`), not a full function wrapper.
**File:** modules/flann/include/opencv2/flann/flann_base.hpp
**Change Type:** modified
**Context:** PR #23276: Fixed potential memory leak in flann

**Code Changes:**
```diff
@@ -45,6 +45,21 @@
 
 namespace cvflann
 {
+class FILEScopeGuard {
+
+public:
+    explicit FILEScopeGuard(FILE* file) {
+        file_ = file;
+    };
```

Review comment:
Remove default unused ctor. (at least it doesn't initialize `file_` member and destructor calls `fclose()` unconditionally - sporadic WTF behavior with closing of non-owned files)
**File:** modules/flann/include/opencv2/flann/flann_base.hpp
**Change Type:** modified
**Context:** PR #23276: Fixed potential memory leak in flann

**Code Changes:**
```diff
@@ -45,6 +45,21 @@
 
 namespace cvflann
 {
+class FILEScopeGuard {
+
+public:
+    explicit FILEScopeGuard(FILE* file) {
+        file_ = file;
+    };
```

Review comment:
It should be after if NULL statement. otherwise you'll get `fclose(NULL);`
**File:** modules/flann/src/miniflann.cpp
**Change Type:** modified
**Context:** PR #23276: Fixed potential memory leak in flann

**Code Changes:**
```diff
@@ -767,11 +767,15 @@ bool Index::load(InputArray _data, const String& filename)
     Mat data = _data.getMat();
     bool ok = true;
     release();
+
     FILE* fin = fopen(filename.c_str(), "rb");
-    if (fin == NULL)
+    if (fin == NULL) {
         return false;
+    }
```

Review comment:
The same thing on fclose();
**File:** modules/flann/include/opencv2/flann/flann_base.hpp
**Change Type:** modified
**Context:** PR #23276: Fixed potential memory leak in flann
**Review Line:** 123

**Code Changes:**
```diff
@@ -107,7 +120,7 @@ class Index : public NNIndex<Distance>
     typedef typename Distance::ResultType DistanceType;
 
     Index(const Matrix<ElementType>& features, const IndexParams& params, Distance distance = Distance() )
-        : index_params_(params)
+        :index_params_(params)
     {
         flann_algorithm_t index_type = get_param<flann_algorithm_t>(params,"algorithm");
         loaded_ = false;
```

Review comment:
No need to touch it.
**File:** modules/dnn/src/net_impl_fuse.cpp
**Change Type:** modified
**Context:** PR #23354: DNN : fix bug in layer fusion
**Review Line:** 250

**Code Changes:**
```diff
@@ -247,7 +247,7 @@ void Net::Impl::fuseLayers(const std::vector<LayerPin>& blobsToKeep_)
                     {
                         // fuse naryEltwise layer
                         // bias must already be computed to fuse => bias layer must appear before convolution
-                        if (biasLayerData->id < ld.id)
+                        if (biasLayerData->id < ld.id && biasLayerData->consumers.size() == 1)
                         {
                             // conv + naryEltwise.
                             CV_Assert_N(biasLayerData->outputBlobs.size() == 1, ld.inputBlobs.size() == 1);
```

Review comment:
The `Conv_Add` fusion strategy wants to bypass the `biasLayerData`(Add layer). But the strategy only works when its consumer size is 1.
**File:** samples/python/aruco_detect_board_charuco.py
**Change Type:** added
**Context:** PR #23139: add python charuco sample

**Code Changes:**
```diff
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+
+"""aruco_detect_board_charuco.py
+Usage example:
+python aruco_detect_board_charuco.py -w=5 -h=7 -sl=0.04 -ml=0.02 -d=10 -c=../data/aruco/tutorial_camera_charuco.yml
+                                     -i=../data/aruco/choriginal.jpg
+"""
+
+import argparse
```

Review comment:
> `-v=choriginal.jpg` AFAIK, this does NOT work without FFmpeg. --- > choriginal.jpg > tutorial_camera_charuco.yml It is a sample. It is unclear where are users could get these files?
**File:** samples/python/aruco_detect_board_charuco.py
**Change Type:** added
**Context:** PR #23139: add python charuco sample

**Code Changes:**
```diff
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+
+"""aruco_detect_board_charuco.py
+Usage example:
+python aruco_detect_board_charuco.py -w=5 -h=7 -sl=0.04 -ml=0.02 -d=10 -c=../data/aruco/tutorial_camera_charuco.yml
+                                     -i=../data/aruco/choriginal.jpg
+"""
+
+import argparse
```

Review comment:
> wait_time What is the purpose of this? `waitKey(0)` will wait forever - we don't really want that for input video file. --- What do we have in the other samples?
**File:** samples/python/aruco_detect_board_charuco.py
**Change Type:** added
**Context:** PR #23139: add python charuco sample

**Code Changes:**
```diff
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+
+"""aruco_detect_board_charuco.py
+Usage example:
+python aruco_detect_board_charuco.py -w=5 -h=7 -sl=0.04 -ml=0.02 -d=10 -c=../data/aruco/tutorial_camera_charuco.yml
+                                     -i=../data/aruco/choriginal.jpg
+"""
+
+import argparse
```

Review comment:
Duplicate of `--help` output. Duplication must be avoided as it could not be maintained in reliable way.
**File:** samples/python/aruco_detect_board_charuco.py
**Change Type:** added
**Context:** PR #23139: add python charuco sample

**Code Changes:**
```diff
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+
+"""aruco_detect_board_charuco.py
+Usage example:
+python aruco_detect_board_charuco.py -w=5 -h=7 -sl=0.04 -ml=0.02 -d=10 -c=../data/aruco/tutorial_camera_charuco.yml
+                                     -i=../data/aruco/choriginal.jpg
+"""
+
+import argparse
```

Review comment:
1. Should a png image be used in the sample? 2. `tutorial_camera_charuco.yml` and `choriginal.jpg` are located in https://github.com/opencv/opencv_contrib/tree/4.x/modules/aruco/samples and https://github.com/opencv/opencv_contrib/tree/4.x/modules/aruco/tutorials/charuco_detection/images Would it be enough to link to these files? Also, I think these files will be moved from contrib to main repo or to extra.
**File:** samples/python/aruco_detect_board_charuco.py
**Change Type:** added
**Context:** PR #23139: add python charuco sample

**Code Changes:**
```diff
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+
+"""aruco_detect_board_charuco.py
+Usage example:
+python aruco_detect_board_charuco.py -w=5 -h=7 -sl=0.04 -ml=0.02 -d=10 -c=../data/aruco/tutorial_camera_charuco.yml
+                                     -i=../data/aruco/choriginal.jpg
+"""
+
+import argparse
```

Review comment:
removed duplication
**File:** samples/python/aruco_detect_board_charuco.py
**Change Type:** added
**Context:** PR #23139: add python charuco sample

**Code Changes:**
```diff
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+
+"""aruco_detect_board_charuco.py
+Usage example:
+python aruco_detect_board_charuco.py -w=5 -h=7 -sl=0.04 -ml=0.02 -d=10 -c=../data/aruco/tutorial_camera_charuco.yml
+                                     -i=../data/aruco/choriginal.jpg
+"""
+
+import argparse
```

Review comment:
removed `waitKey(0)` from loop
**File:** samples/python/aruco_detect_board_charuco.py
**Change Type:** added
**Context:** PR #23139: add python charuco sample

**Code Changes:**
```diff
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+
+"""aruco_detect_board_charuco.py
+Usage example:
+python aruco_detect_board_charuco.py -w=5 -h=7 -sl=0.04 -ml=0.02 -d=10 -c=../data/aruco/tutorial_camera_charuco.yml
+                                     -i=../data/aruco/choriginal.jpg
+"""
+
+import argparse
```

Review comment:
Why do you need it?