nareshmlx/opencv-pr huggingface dataset:
**File:** modules/dnn/src/opencl/ocl4dnn_lrn.cl
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,96 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
comments are cleaned.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
yes, we add check on this build option based on opencl version and carefully check the program compilation result if it fails.
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -51,7 +51,10 @@
 #include <inttypes.h>
 #endif
 
+#include <opencv2/core/utils/configuration.private.hpp>
+
 #include "opencv2/core/ocl_genbase.hpp"
+#include "opencl_kernels_core.hpp"
 
 #define CV_OPENCL_ALWAYS_SHOW_BUILD_LOG 0
```

Review comment:
we add one build option for enabling OpenCL profiling event, it gives user an option to control this flag.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Code context is buggy (it is GitHub bug observed on large patches): This is for lines like these: ``` float fastestTime = 999999990000000000000000000.0f; ```
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
fixed in the new update
**File:** modules/dnn/src/ocl4dnn/src/math_functions.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,538 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
fixed in the new update
**File:** modules/dnn/src/ocl4dnn/src/math_functions.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,538 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
fixed in the update
**File:** modules/dnn/src/layers/fully_connected_layer.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -43,8 +43,13 @@
 #include "../precomp.hpp"
 #include "layers_common.hpp"
 #include "op_halide.hpp"
+#include "opencl_kernels_dnn.hpp"
 #include <opencv2/dnn/shape_utils.hpp>
 
+#ifdef HAVE_OPENCL
+using namespace cv::dnn::ocl4dnn;
+#endif
```

Review comment:
fixed in the new update
**File:** modules/dnn/src/layers/concat_layer.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -43,6 +43,7 @@
 #include "../precomp.hpp"
 #include "layers_common.hpp"
 #include "op_halide.hpp"
+#include "opencl_kernels_dnn.hpp"
 
 namespace cv
 {
@@ -174,11 +175,62 @@ class ConcatLayerImpl : public ConcatLayer
         }
```

Review comment:
fixed in the new update
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_pool.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...
**Review Line:** 150

**Code Changes:**
```diff
+        break;
+    case LIBDNN_POOLING_METHOD_AVE:
+        {
+            ocl::Kernel oclk_ave_pool_forward(CL_KERNEL_SELECT("ave_pool_forward"),
+                                              cv::ocl::dnn::ocl4dnn_pooling_oclsrc);
+
+            if (oclk_ave_pool_forward.empty())
+                return false;
+
+            argIdx = 0;
+            oclk_ave_pool_forward.set(argIdx++, count_);
```

Review comment:
Error checks are mandatory (see MacOS builds): ``` if (kernel.empty()) return false; ```
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_pool.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,213 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Error checks are mandatory for `kernel.run()` calls
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_pool.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...
**Review Line:** 150

**Code Changes:**
```diff
+        break;
+    case LIBDNN_POOLING_METHOD_AVE:
+        {
+            ocl::Kernel oclk_ave_pool_forward(CL_KERNEL_SELECT("ave_pool_forward"),
+                                              cv::ocl::dnn::ocl4dnn_pooling_oclsrc);
+
+            if (oclk_ave_pool_forward.empty())
+                return false;
+
+            argIdx = 0;
+            oclk_ave_pool_forward.set(argIdx++, count_);
```

Review comment:
Fixed in the update patch. Checks on ocl4dnn kernel create and run are added.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_pool.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,213 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Fixed in the update patch.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_pool.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,213 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
`(void*)NULL`, because just NULL has `int` type (MSVS, Windows).
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_pool.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,213 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
fixed in the update
**File:** modules/dnn/src/ocl4dnn/include/default_kernel_config.hpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,854 @@
+#ifndef _OPENCV_OCL4DNN_DEFAULT_KERNEL_CONFIG_HPP_
+#define _OPENCV_OCL4DNN_DEFAULT_KERNEL_CONFIG_HPP_
+const char *default_kernel_config_intel[] = {
+// Below is the information for OpenCL based on which these configurations tuned
+/*******************************************************************************
+Number of platforms                               1
+  Platform Name                                   Intel(R) OpenCL
+  Platform Vendor                                 Intel(R) Corporation
+  Platform Version                                OpenCL 2.0
```

Review comment:
Could you expand these hashes? (avoid using of hashes here) Something like this (probably without driver version until we support version masks): ``` Intel(R) Corporation: Intel(R) HD Graphics (VER=r5.0.63503) CU=24 k5x1_cn32_g1_s1x1_d1x1_b0_in64x64_p2x0_num1_M32 ``` How did you handle different names for the same devices on different platforms? For example, we have this for i7-6700K with Intel OpenCL runtime: - [Windows](http://pullrequest.opencv.org/buildbot/builders/precommit_opencl/builds/12523/steps/test_dnn-ippicv-opencl/logs/stdio): "Intel(R) HD Graphics 530" - [Linux](): "Intel(R) HD Graphics" Are there configurations for "beignet" runtime? Could you also add OpenCL information for mentioned devices (into comments) from OpenCV tests header? <details> ``` OpenCL Platforms: Intel(R) OpenCL iGPU: Intel(R) HD Graphics (OpenCL 2.0 ) CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz (OpenCL 2.0 (Build 475)) Current OpenCL device: Type = iGPU Name = Intel(R) HD Graphics Version = OpenCL 2.0 Driver version = r5.0.63503 Compute units = 24 Max work group size = 256 Local memory size = 64 kB Max memory allocation size = 3 GB 1023 MB 1015 kB 1023 B Double support = Yes Host unified memory = Yes Device extensions: cl_intel_accelerator cl_intel_advanced_motion_estimation cl_intel_device_side_avc_motion_estimation cl_intel_driver_diagnostics cl_intel_media_block_io cl_intel_motion_estimation cl_intel_planar_yuv cl_intel_packed_yuv cl_intel_required_subgroup_size cl_intel_subgroups cl_intel_subgroups_short cl_intel_va_api_media_sharing cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_fp16 cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_image2d_from_buffer cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_mipmap_image cl_khr_mipmap_image_writes cl_khr_spir cl_khr_subgroups Has AMD Blas = No Has AMD Fft = No Preferred vector width char = 16 Preferred vector width short = 8 Preferred vector width int = 4 Preferred vector width long = 1 Preferred vector width float = 1 Preferred vector width double = 1 ``` </details>
**File:** modules/dnn/src/ocl4dnn/include/default_kernel_config.hpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,854 @@
+#ifndef _OPENCV_OCL4DNN_DEFAULT_KERNEL_CONFIG_HPP_
+#define _OPENCV_OCL4DNN_DEFAULT_KERNEL_CONFIG_HPP_
+const char *default_kernel_config_intel[] = {
+// Below is the information for OpenCL based on which these configurations tuned
+/*******************************************************************************
+Number of platforms                               1
+  Platform Name                                   Intel(R) OpenCL
+  Platform Vendor                                 Intel(R) Corporation
+  Platform Version                                OpenCL 2.0
```

Review comment:
-- Could you expand these hashes? Yes, I will use more readable string to replace hashes. -- How did you handle different names for the same devices on different platform? Good question. I will remove the device name and vendor name from the the signature. --Are there configurations for "beignet" runtime? No. We recommend to use "Intel OpenCL Driver" (https://software.intel.com/en-us/articles/opencl-drivers#latest_linux_driver) for the performance consideration. Beignet lacks of some key extension supports that need by convolution kernel. --Could you also add OpenCL information for mentioned devices (into comments) from OpenCV tests header? Ok.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_softmax.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,135 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Looks like, softmax is completely disabled. What is the problem here?
**File:** modules/dnn/src/ocl4dnn/src/common.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,57 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
This condition is not valid for "=>2.1": "3.0" would not pass. Also SRB5.0 supports "ifp" flag (at least don't fail) but it is still "OpenCL 2.0". Perhaps we should try build with "ifp" flag and then fallback to build without this problematic flag in case of errors.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_softmax.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,135 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
The subgroup version softmax kernel is enabled in the new commit. both subgroup version and non-subgroup version works in ocl4dnn.
**File:** modules/dnn/src/ocl4dnn/src/common.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,57 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
A more universal check method is implemented in new commit.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_inner_product.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,108 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
dropped unused variable in new commit
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...
**Review Line:** 5263

**Code Changes:**
```diff
+            clReleaseEvent(start_gpu_cl_);
+            ocl::Kernel kernel("null_kernel_float", ocl::core::benchmark_oclsrc);
+            float arg = 0;
+            clSetKernelArg((cl_kernel)kernel.ptr(), 0, sizeof(arg), &arg);
+            clEnqueueTask((cl_command_queue)queue.ptr(), (cl_kernel)kernel.ptr(), 0,
+                          NULL, &start_gpu_cl_);
+            clFinish((cl_command_queue)queue.ptr());
+            running_ = true;
+            has_run_at_least_once_ = true;
+        }
+#endif
```

Review comment:
Did you try to use events from [clEnqueueMarker()](https://www.khronos.org/registry/OpenCL/sdk/1.1/docs/man/xhtml/clEnqueueMarker.html) (OpenCL 1.1) or preferable [clEnqueueBarrierWithWaitList()](https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/clEnqueueBarrierWithWaitList.html) (OpenCL 1.2+) instead of kernel task submitting?
**File:** samples/cpp/kalman.cpp
**Change Type:** modified
**Context:** PR #20564: Update kalman sample

**Code Changes:**
```diff
@@ -1,6 +1,6 @@
 #include "opencv2/video/tracking.hpp"
 #include "opencv2/highgui.hpp"
-
+#include "opencv2/core/cvdef.h"
 #include <stdio.h>
 
 using namespace cv;
@@ -14,15 +14,19 @@ static void help()
 {
```

Review comment:
I recommend to use CV_PI or PI constant.
**File:** samples/cpp/kalman.cpp
**Change Type:** modified
**Context:** PR #20564: Update kalman sample

**Code Changes:**
```diff
@@ -1,6 +1,6 @@
 #include "opencv2/video/tracking.hpp"
 #include "opencv2/highgui.hpp"
-
+#include "opencv2/core/cvdef.h"
 #include <stdio.h>
 
 using namespace cv;
@@ -14,15 +14,19 @@ static void help()
 {
```

Review comment:
fixed using `CV_PI`
**File:** modules/python/test/test_houghcircles.py
**Change Type:** modified
**Context:** PR #20584: Fix hough circles alt dimensions

**Code Changes:**
```diff
@@ -80,5 +80,52 @@ def test_houghcircles(self):
         self.assertLess(float(len(circles) - matches_counter) / len(circles), .75)
 
 
+    def test_houghcircles_alt(self):
+
+        fn = "samples/data/board.jpg"
+
+        src = self.get_sample(fn, 1)
+        img = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
```

Review comment:
I propose to add shape check here. The issue you are solving is about result shape, but not content.
**File:** modules/python/test/test_houghcircles.py
**Change Type:** modified
**Context:** PR #20584: Fix hough circles alt dimensions

**Code Changes:**
```diff
@@ -80,5 +80,52 @@ def test_houghcircles(self):
         self.assertLess(float(len(circles) - matches_counter) / len(circles), .75)
 
 
+    def test_houghcircles_alt(self):
+
+        fn = "samples/data/board.jpg"
+
+        src = self.get_sample(fn, 1)
+        img = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
```

Review comment:
added assertEqual to circles.shape ```C++ self.assertEqual(circles.shape[0], 1) self.assertEqual(circles.shape[1], 18) self.assertEqual(circles.shape[2], 3) ```
**File:** modules/python/test/test_houghcircles.py
**Change Type:** modified
**Context:** PR #20584: Fix hough circles alt dimensions

**Code Changes:**
```diff
@@ -80,5 +80,52 @@ def test_houghcircles(self):
         self.assertLess(float(len(circles) - matches_counter) / len(circles), .75)
 
 
+    def test_houghcircles_alt(self):
+
+        fn = "samples/data/board.jpg"
+
+        src = self.get_sample(fn, 1)
+        img = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
```

Review comment:
What about extra dimension that was there?
**File:** modules/python/test/test_houghcircles.py
**Change Type:** modified
**Context:** PR #20584: Fix hough circles alt dimensions

**Code Changes:**
```diff
@@ -80,5 +80,52 @@ def test_houghcircles(self):
         self.assertLess(float(len(circles) - matches_counter) / len(circles), .75)
 
 
+    def test_houghcircles_alt(self):
+
+        fn = "samples/data/board.jpg"
+
+        src = self.get_sample(fn, 1)
+        img = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
```

Review comment:
There was no extra dimension. There was a wrong order of shape. Wrong shape order (for this sample): circles.shape[0] = 18 circles.shape[1] = 1 circles.shape[2] = 3 The required shape order (for this sample): circles.shape[0] = 1 circles.shape[1] = 18 circles.shape[2] = 3
**File:** modules/python/test/test_houghcircles.py
**Change Type:** modified
**Context:** PR #20584: Fix hough circles alt dimensions

**Code Changes:**
```diff
@@ -80,5 +80,52 @@ def test_houghcircles(self):
         self.assertLess(float(len(circles) - matches_counter) / len(circles), .75)
 
 
+    def test_houghcircles_alt(self):
+
+        fn = "samples/data/board.jpg"
+
+        src = self.get_sample(fn, 1)
+        img = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
```

Review comment:
Please use this form: ``` self.assertEqual(circles.shape, (1, 18, 3)) ``` - better messages - avoid issues with wrong index access if returned shape is 2D