nareshmlx/opencv-pr huggingface dataset:
**File:** modules/imgproc/src/thresh.cpp
**Change Type:** modified
**Context:** PR #3360: Add Triangle thresholding algorithm - Add Triangle method for automatic threshold computation next to the existing Otsu's method. Triangle d...

**Code Changes:**
```diff
@@ -986,6 +986,110 @@ getThreshVal_Otsu_8u( const Mat& _src )
     return max_val;
 }
 
+static double
+getThreshVal_Triangle_8u( const Mat& _src )
+{
+    Size size = _src.size();
+    int step = (int) _src.step;
+    if( _src.isContinuous() )
```

Review comment:
OTSU and Triangle algorithms are mutually exclusive. Can you use something like: <pre> int automatic_algo = type & ~CV_THRESH_MASK; if( automatic_algo == 0 ) // no automatic thresholding { } else if( automatic_algo == CV_THRESH_OTSU ) { ... } else if( automatic_algo == CV_THRESH_TRIANGLE ) { ... } </pre> ?
**File:** modules/imgproc/src/opencl/canny.cl
**Change Type:** modified
**Context:** PR #3394: OCL: minor optimization for Canny - Attempt to optimize `stage1_with_sobel` kernel using float calculations instead integer. **Performance r...

**Code Changes:**
```diff
@@ -49,9 +49,9 @@
 #ifdef WITH_SOBEL
 
 #if cn == 1
-#define loadpix(addr) convert_intN(*(__global const TYPE *)(addr))
+#define loadpix(addr) convert_floatN(*(__global const TYPE *)(addr))
 #else
-#define loadpix(addr) convert_intN(vload3(0, (__global const TYPE *)(addr)))
+#define loadpix(addr) convert_floatN(vload3(0, (__global const TYPE *)(addr)))
 #endif
```

Review comment:
a cycle with unknown number of iterations would not be unrolled.
**File:** modules/video/src/bgfg_gaussmix2.cpp
**Change Type:** modified
**Context:** PR #3352: BackgroundSubtractorMOG2, learningRate=0 optimization - If learningRate=0 then background model should not be updated (unnecessary computati...

**Code Changes:**
```diff
@@ -689,7 +689,7 @@ class MOG2Invoker : public ParallelLoopBody
                 nmodes = nNewModes;
 
                 //make new mode if needed and exit
-                if( !fitsPDF )
+                if( !fitsPDF && alphaT > 0.f )
                 {
                     // replace the weakest or add a new one
                     int mode = nmodes == nmixtures ? nmixtures-1 : nmodes++;
```

Review comment:
it's better to use "alphaT &gt; 0" here
**File:** modules/calib3d/src/upnp.cpp
**Change Type:** modified
**Context:** PR #3308: New PnP approach to calib3d module - SOLVEPNP_UPNP Method is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto, F.Moreno-Noguer. "Exha...
**Review Line:** 48

**Code Changes:**
```diff
+/****************************************************************************************\
+* Exhaustive Linearization for Robust Camera Pose and Focal Length Estimation.
+* Contributed by Edgar Riba
+\****************************************************************************************/
+
 #include "precomp.hpp"
 #include "upnp.h"
 #include <limits>
 
-upnp::upnp(const cv::Mat& cameraMatrix, const cv::Mat& opoints, const cv::Mat& ipoints)
+using namespace std;
```

Review comment:
can you add the standard opencv license in front (and optionally information about the author, i.e. you :) )?
**File:** modules/calib3d/src/upnp.cpp
**Change Type:** modified
**Context:** PR #3308: New PnP approach to calib3d module - SOLVEPNP_UPNP Method is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto, F.Moreno-Noguer. "Exha...

**Code Changes:**
```diff
@@ -1,8 +1,58 @@
+//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:
if possible, can you replace all the "CvMat" with "cv::Mat"?
**File:** modules/calib3d/src/upnp.cpp
**Change Type:** modified
**Context:** PR #3308: New PnP approach to calib3d module - SOLVEPNP_UPNP Method is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto, F.Moreno-Noguer. "Exha...

**Code Changes:**
```diff
@@ -1,8 +1,58 @@
+//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:
if possible, can you replace all the CvMat and cvFoo with cv::Mat and cv::foo? Also, please, put all this code into "cv" namespace and then remove all the "cv::" prefixes. This will make the code much cleaner
**File:** modules/calib3d/src/upnp.h
**Change Type:** modified
**Context:** PR #3308: New PnP approach to calib3d module - SOLVEPNP_UPNP Method is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto, F.Moreno-Noguer. "Exha...

**Code Changes:**
```diff
@@ -1,12 +1,57 @@
-#ifndef UPNP_H_
-#define UPNP_H_
+//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:
please, add the standard OpenCV license and optionally your copyright/info. Also, please, use some prefix in the guard macro, e.g. OPENCV_CALIB3D_UPNP_H instead of UPNP_H.
**File:** modules/calib3d/src/upnp.h
**Change Type:** modified
**Context:** PR #3308: New PnP approach to calib3d module - SOLVEPNP_UPNP Method is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto, F.Moreno-Noguer. "Exha...

**Code Changes:**
```diff
@@ -1,12 +1,57 @@
-#ifndef UPNP_H_
-#define UPNP_H_
+//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:
please, place all the functionality into cv namespace. Placing "using namespace std" in headers is quite bad practice. It's better to put this in .cpp file and explicitly type std::vector etc. in the header.
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #3321: Add code for print errors of OpenCL kernels running - Add `#define` and code for OpenCL kernel errors checking and printing..

**Code Changes:**
```diff
@@ -47,6 +47,7 @@
 #include <iostream> // std::cerr
 
 #define CV_OPENCL_ALWAYS_SHOW_BUILD_LOG 0
+#define CV_OPENCL_SHOW_RUN_ERRORS       0
 
 #include "opencv2/core/bufferpool.hpp"
 #ifndef LOG_BUFFER_POOL
@@ -3037,6 +3038,13 @@ bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[],
     cl_int retval = clEnqueueNDRangeKernel(qq, p->handle, (cl_uint)dims,
```

Review comment:
`returns`
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #3321: Add code for print errors of OpenCL kernels running - Add `#define` and code for OpenCL kernel errors checking and printing..
**Review Line:** 3041

**Code Changes:**
```diff
 #ifndef LOG_BUFFER_POOL
@@ -3037,6 +3038,13 @@ bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[],
     cl_int retval = clEnqueueNDRangeKernel(qq, p->handle, (cl_uint)dims,
                                            offset, globalsize, _localsize, 0, 0,
                                            sync ? 0 : &p->e);
+#if CV_OPENCL_SHOW_RUN_ERRORS
+    if (retval != CL_SUCCESS)
+    {
+        printf("OpenCL program returns error: %d\n", retval);
+        fflush(stdout);
+    }
```

Review comment:
can you also add CV_OclDbgAssert(retval == CL_SUCCESS);
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #3321: Add code for print errors of OpenCL kernels running - Add `#define` and code for OpenCL kernel errors checking and printing..
**Review Line:** 3041

**Code Changes:**
```diff
 #ifndef LOG_BUFFER_POOL
@@ -3037,6 +3038,13 @@ bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[],
     cl_int retval = clEnqueueNDRangeKernel(qq, p->handle, (cl_uint)dims,
                                            offset, globalsize, _localsize, 0, 0,
                                            sync ? 0 : &p->e);
+#if CV_OPENCL_SHOW_RUN_ERRORS
+    if (retval != CL_SUCCESS)
+    {
+        printf("OpenCL program returns error: %d\n", retval);
+        fflush(stdout);
+    }
```

Review comment:
My understanding is that without this assert the OPENCV_OPENCL_RAISE_ERROR env var will not work for clEnqeueNDRange call. Isn't it? BTW the same situation for clEnqueuTask call.
**File:** modules/imgproc/src/corner.cpp
**Change Type:** modified
**Context:** PR #3326: Neon optimization of OpenCV algos
**Review Line:** 129

**Code Changes:**
```diff
@@ -126,7 +126,7 @@ static void calcHarris( const Mat& _cov, Mat& _dst, double k )
         if( simd )
         {
             __m128 k4 = _mm_set1_ps((float)k);
-            for( ; j <= size.width - 5; j += 4 )
+            for( ; j <= size.width - 4; j += 4 )
             {
                 __m128 t0 = _mm_loadu_ps(cov + j*3); // a0 b0 c0 x
                 __m128 t1 = _mm_loadu_ps(cov + j*3 + 3); // a1 b1 c1 x
@@ -146,6 +146,17 @@ static void calcHarris( const Mat& _cov, Mat& _dst, double k )
                 _mm_storeu_ps(dst + j, a);
```

Review comment:
I believe, -5 instead of -4 was used to avoid buffer access beyond the right boundary. Can you double-check that this fix is correct?
**File:** modules/core/src/mathfuncs.cpp
**Change Type:** modified
**Context:** PR #3254: Neon optimization of some functions of core module
**Review Line:** 272

**Code Changes:**
```diff
+    for( ; i <= len - 4; i += 4 )
+    {
+        float32x4_t v_x = vld1q_f32(x + i), v_y = vld1q_f32(y + i);
+        vst1q_f32(m, vaddq_f32(vmulq_f32(v_x, v_x), vmulq_f32(v_y, v_y)));
+
+        mag[i] = std::sqrt(m[0]);
+        mag[i+1] = std::sqrt(m[1]);
+        mag[i+2] = std::sqrt(m[2]);
+        mag[i+3] = std::sqrt(m[3]);
+    }
 #endif
```

Review comment:
I would add Newton-Raphson iterations to compute square root right inside the loop. Probably, you can add a macro, since this will be needed in a few places in this file: https://github.com/juj/MathGeoLib/blob/master/tests/NEONTests.cpp (inverse square root is computed there, and there should be 2 iterations (using vrsqrtsq_f32), not 1).
**File:** modules/java/generator/gen_javadoc.py
**Change Type:** modified
**Context:** PR #3301: Fixed #3768 update gen_javadoc prints to python3 syntax - I am not a python programmer, but I was having trouble getting opencv to build on ...
**Review Line:** 67

**Code Changes:**
```diff
@@ -65,13 +65,13 @@ def document(self, infile, outfile):
                         javadoc = self.makeJavadoc(decl, marker[2])
                         if self.verbose:
                             print
-                            print "Javadoc for \"%s\" File: %s (line %s)" % (decl["name"], decl["file"], decl["line"])
-                            print javadoc
+                            print("Javadoc for \"%s\" File: %s line %s" % (decl["name"], decl["file"], decl["line"]))
+                            print(javadoc)
                         for line in javadoc.split("\n"):
```

Review comment:
please, restore 4 spaces
**File:** platforms/android/service/engine/jni/BinderComponent/HardwareDetector.cpp
**Change Type:** modified
**Context:** PR #3285: OpenCV Manager hardware detector workaround for not detected ARM SoC support

**Code Changes:**
```diff
@@ -39,44 +39,57 @@ int GetCpuID()
 #else
     result = ARCH_UNKNOWN;
 #endif
-#else
+#elif defined(__arm__)
     LOGD("Using ARM HW detector");
     it = cpu_info.find("Processor");
 
     if (cpu_info.end() != it)
```

Review comment:
In this branch, you can't even be sure you're running on ARM - there were no checks for it.
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #3263: Added implicit dependency from python and python-py to debian packages

**Code Changes:**
```diff
@@ -69,7 +69,11 @@ set(CPACK_COMPONENT_dev_DEPENDS libs)
 set(CPACK_COMPONENT_docs_DEPENDS libs)
 set(CPACK_COMPONENT_java_DEPENDS libs)
 set(CPACK_COMPONENT_python_DEPENDS libs)
+set(CPACK_DEB_python_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}")
 set(CPACK_COMPONENT_tests_DEPENDS libs)
+if (HAVE_opencv_python)
+  set(CPACK_DEB_tests_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}, python-py | python-pytest")
+endif()
 
```

Review comment:
What do we use `python-py` for? Did you mean `python-numpy`?
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #3263: Added implicit dependency from python and python-py to debian packages

**Code Changes:**
```diff
@@ -69,7 +69,11 @@ set(CPACK_COMPONENT_dev_DEPENDS libs)
 set(CPACK_COMPONENT_docs_DEPENDS libs)
 set(CPACK_COMPONENT_java_DEPENDS libs)
 set(CPACK_COMPONENT_python_DEPENDS libs)
+set(CPACK_DEB_python_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}")
 set(CPACK_COMPONENT_tests_DEPENDS libs)
+if (HAVE_opencv_python)
+  set(CPACK_DEB_tests_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}, python-py | python-pytest")
+endif()
 
```

Review comment:
No it's a package with python unit-test runner that is used in OpenCV tests.
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #3263: Added implicit dependency from python and python-py to debian packages

**Code Changes:**
```diff
@@ -69,7 +69,11 @@ set(CPACK_COMPONENT_dev_DEPENDS libs)
 set(CPACK_COMPONENT_docs_DEPENDS libs)
 set(CPACK_COMPONENT_java_DEPENDS libs)
 set(CPACK_COMPONENT_python_DEPENDS libs)
+set(CPACK_DEB_python_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}")
 set(CPACK_COMPONENT_tests_DEPENDS libs)
+if (HAVE_opencv_python)
+  set(CPACK_DEB_tests_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}, python-py | python-pytest")
+endif()
 
```

Review comment:
Where, exactly? I can't find any trace of it.
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #3263: Added implicit dependency from python and python-py to debian packages

**Code Changes:**
```diff
@@ -69,7 +69,11 @@ set(CPACK_COMPONENT_dev_DEPENDS libs)
 set(CPACK_COMPONENT_docs_DEPENDS libs)
 set(CPACK_COMPONENT_java_DEPENDS libs)
 set(CPACK_COMPONENT_python_DEPENDS libs)
+set(CPACK_DEB_python_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}")
 set(CPACK_COMPONENT_tests_DEPENDS libs)
+if (HAVE_opencv_python)
+  set(CPACK_DEB_tests_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}, python-py | python-pytest")
+endif()
 
```

Review comment:
It is used as test runner in `cmake/templates/opencv_run_all_tests_unix.sh.in`: `py.test --junitxml $report "$OPENCV_TEST_PATH"/$t`
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #3263: Added implicit dependency from python and python-py to debian packages

**Code Changes:**
```diff
@@ -69,7 +69,11 @@ set(CPACK_COMPONENT_dev_DEPENDS libs)
 set(CPACK_COMPONENT_docs_DEPENDS libs)
 set(CPACK_COMPONENT_java_DEPENDS libs)
 set(CPACK_COMPONENT_python_DEPENDS libs)
+set(CPACK_DEB_python_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}")
 set(CPACK_COMPONENT_tests_DEPENDS libs)
+if (HAVE_opencv_python)
+  set(CPACK_DEB_tests_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}, python-py | python-pytest")
+endif()
 
```

Review comment:
I see. However, on my machine `py.test` is in the `python-pytest` package, not in `python-py`. Can you make this more flexible somehow?
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #3263: Added implicit dependency from python and python-py to debian packages

**Code Changes:**
```diff
@@ -69,7 +69,11 @@ set(CPACK_COMPONENT_dev_DEPENDS libs)
 set(CPACK_COMPONENT_docs_DEPENDS libs)
 set(CPACK_COMPONENT_java_DEPENDS libs)
 set(CPACK_COMPONENT_python_DEPENDS libs)
+set(CPACK_DEB_python_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}")
 set(CPACK_COMPONENT_tests_DEPENDS libs)
+if (HAVE_opencv_python)
+  set(CPACK_DEB_tests_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}, python-py | python-pytest")
+endif()
 
```

Review comment:
Added more flexibility :)
**File:** modules/java/CMakeLists.txt
**Change Type:** modified
**Context:** PR #3249: Enabled java wrappers for bionspired/retina module - - Java wrappers support for nested namespaces and classes - Logging of wrapping process...
**Review Line:** 11

**Code Changes:**
```diff
@@ -8,7 +8,7 @@ if(IOS OR NOT PYTHON_DEFAULT_AVAILABLE OR NOT ANT_EXECUTABLE OR NOT (JNI_FOUND O
 endif()
 
 set(the_description "The java bindings")
-ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_imgcodecs opencv_videoio opencv_calib3d opencv_photo)
+ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_imgcodecs opencv_videoio opencv_calib3d opencv_photo opencv_bioinspired)
 ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp")
 
 if(NOT ANDROID)
```

Review comment:
IMHO, information about contrib modules should not be hardcoded in opencv repo. List of supported contrib modules should be detected and passed automatically.
**File:** modules/java/generator/config/bioinspired.filelist
**Change Type:** added
**Context:** PR #3249: Enabled java wrappers for bionspired/retina module - - Java wrappers support for nested namespaces and classes - Logging of wrapping process...
**Review Line:** 1

**Code Changes:**
```diff
@@ -0,0 +1 @@
+include/opencv2/bioinspired/retina.hpp
```

Review comment:
My suggestion is to move this file into contrib repo, for example: modules/bioinspired/java_bindings.conf
**File:** modules/python/common.cmake
**Change Type:** modified
**Context:** PR #3249: Enabled java wrappers for bionspired/retina module - - Java wrappers support for nested namespaces and classes - Logging of wrapping process...
**Review Line:** 22

**Code Changes:**
```diff
@@ -18,6 +18,8 @@ ocv_list_filterout(candidate_deps "^opencv_matlab$")
 ocv_list_filterout(candidate_deps "^opencv_ts$")
 ocv_list_filterout(candidate_deps "^opencv_adas$")
 ocv_list_filterout(candidate_deps "^opencv_tracking$")
+ocv_list_filterout(candidate_deps "^opencv_bioinspired$")
+ocv_list_filterout(candidate_deps "^opencv_java$")
 
 ocv_add_module(${MODULE_NAME} BINDINGS OPTIONAL ${candidate_deps})
 
```

Review comment:
OpenCV has 3 types of modules: - PUBLIC: core, imgproc, etc - INTERNAL: ts module - BINDINGS: python, java, ... IMHO, "opencv_java" should be filtered out by module type. Also, please take a look on PR #2861.
**File:** modules/core/include/opencv2/core/ocl.hpp
**Change Type:** modified
**Context:** PR #2956: T-API: optimization of cv::accumulate, cv::accumulateSquare, cv::accumulateProduct, cv::accumulateWeighted; added strategies in cv::predictO...
**Review Line:** 613

**Code Changes:**
```diff
+    // (useful for cases when matrices have different data types)
+    OCL_VECTOR_MAX = 1,
+
+    // default strategy
+    OCL_VECTOR_DEFAULT = OCL_VECTOR_OWN
+};
+
 CV_EXPORTS int predictOptimalVectorWidth(InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(),
                                          InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(),
-                                         InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray());
+                                         InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray(),
```

Review comment:
Use boolean parameter instead of introducing of new enum.
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #2956: T-API: optimization of cv::accumulate, cv::accumulateSquare, cv::accumulateProduct, cv::accumulateWeighted; added strategies in cv::predictO...

**Code Changes:**
```diff
@@ -4451,42 +4451,46 @@ String kernelToStr(InputArray _kernel, int ddepth, const char * name)
         if (!src.empty()) \
         { \
             CV_Assert(src.isMat() || src.isUMat()); \
-            int ctype = src.type(), ccn = CV_MAT_CN(ctype); \
             Size csize = src.size(); \
-            cols.push_back(ccn * csize.width); \
-            if (ctype != type) \
+            int ctype = src.type(), ccn = CV_MAT_CN(ctype), cdepth = CV_MAT_DEPTH(ctype), \
+                ckercn = vectorWidths[cdepth], cwidth = ccn * csize.width; \
```

Review comment:
Don't use magic numbers. Use CV_8U/CV_8S/etc for indexes.
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #2956: T-API: optimization of cv::accumulate, cv::accumulateSquare, cv::accumulateProduct, cv::accumulateWeighted; added strategies in cv::predictO...

**Code Changes:**
```diff
@@ -4451,42 +4451,46 @@ String kernelToStr(InputArray _kernel, int ddepth, const char * name)
         if (!src.empty()) \
         { \
             CV_Assert(src.isMat() || src.isUMat()); \
-            int ctype = src.type(), ccn = CV_MAT_CN(ctype); \
             Size csize = src.size(); \
-            cols.push_back(ccn * csize.width); \
-            if (ctype != type) \
+            int ctype = src.type(), ccn = CV_MAT_CN(ctype), cdepth = CV_MAT_DEPTH(ctype), \
+                ckercn = vectorWidths[cdepth], cwidth = ccn * csize.width; \
```

Review comment:
Remove dead code
**File:** modules/core/include/opencv2/core/ocl.hpp
**Change Type:** modified
**Context:** PR #2956: T-API: optimization of cv::accumulate, cv::accumulateSquare, cv::accumulateProduct, cv::accumulateWeighted; added strategies in cv::predictO...
**Review Line:** 613

**Code Changes:**
```diff
+    // (useful for cases when matrices have different data types)
+    OCL_VECTOR_MAX = 1,
+
+    // default strategy
+    OCL_VECTOR_DEFAULT = OCL_VECTOR_OWN
+};
+
 CV_EXPORTS int predictOptimalVectorWidth(InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(),
                                          InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(),
-                                         InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray());
+                                         InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray(),
```

Review comment:
I can't guarantee that the number of strategies will be 2 all the time
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #2956: T-API: optimization of cv::accumulate, cv::accumulateSquare, cv::accumulateProduct, cv::accumulateWeighted; added strategies in cv::predictO...

**Code Changes:**
```diff
@@ -4451,42 +4451,46 @@ String kernelToStr(InputArray _kernel, int ddepth, const char * name)
         if (!src.empty()) \
         { \
             CV_Assert(src.isMat() || src.isUMat()); \
-            int ctype = src.type(), ccn = CV_MAT_CN(ctype); \
             Size csize = src.size(); \
-            cols.push_back(ccn * csize.width); \
-            if (ctype != type) \
+            int ctype = src.type(), ccn = CV_MAT_CN(ctype), cdepth = CV_MAT_DEPTH(ctype), \
+                ckercn = vectorWidths[cdepth], cwidth = ccn * csize.width; \
```

Review comment:
I believe that it's a hint for other developers that will support this code, that another strategy has a place.