nareshmlx/opencv-pr huggingface dataset:
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
I suspect an issue in the condition. `abs` applied to `sidesLen[i]/sidesLen[i-1]`. It's always >= 0.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
I propose to extract the loop as dedicated function and name it like `checkFinderPatternByAspect`. It makes code more readable. Also the function result depends on points order and it's strange. I propose to check delta between minimum and maximum length or deviation from average length.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
in case we know, that we have 4 length values min and max are obvious without sort: `max(max(a1, a2), max(a3, a4))`.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
fixed also all other occurrences
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
add const and reference to https://www.thonky.com/qr-code-tutorial/format-version-tables
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
added iterate from zero to `sizeof(versionCodes)/sizeof(versionCodes[0])`
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
there is only one log now
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
Copy is redundant here. There is no midification. You can pass buffer as is `Mat currVers(Size(3, 6), CV_8UC1, &versionCodes[i]);`
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
Sort is O(n*log(n)). Minimum can be found for O(n). Sort is redundant here.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
this code will not compile need to use const_cast (UB in this case)
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
There are max 2 element in `versionAndDistances`. `sort` was added to skip 'if versionAndDistances.size() == 2, if versionAndDistances.size() == 1, ...' replaced `sort` by just `min`
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
removed const from `versionCodes`
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
remove const
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
As soon as you know `sidesLen` size there is no need in `std::vector<>` and `push_back` with possible memory re-allocation. You can use `float sidesLen[4];`
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation

**Code Changes:**
```diff
@@ -16,7 +16,6 @@
 
 #include <limits>
 #include <cmath>
-#include <iostream>
 #include <queue>
 #include <limits>
 #include <map>
@@ -990,6 +989,7 @@ class QRDecode
     bool straightDecodingProcess();
```

Review comment:
Looks like `std::vector<>` is redundant here. `Point2f vf [4] = {}` is more efficient solution. No heap allocation is required.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation
**Review Line:** 2284

**Code Changes:**
```diff
+ *
+ * This function matches finder patterns to the corners of the QR code. Points of finder pattern calculated by
+ * findPatternsVerticesPoints() may be erroneous, so they are checked.
+ */
+static inline std::pair<int, int> matchPatternPoints(const vector<Point> &finderPattern,
+                                                     const vector<Point2f> cornerPointsQR) {
+    if (!checkFinderPatternByAspect(finderPattern))
+        return std::make_pair(-1, -1);
+
+    float distanceToOrig = normL2Sqr<float>(Point2f(finderPattern[0]) - cornerPointsQR[0]);
+    int closestFinderPatternV = 0;
```

Review comment:
Looks like it should be a reference
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation
**Review Line:** 2317

**Code Changes:**
```diff
+
+double QRDecode::getNumModules() {
+    vector<vector<Point>> finderPatterns;
+    double numModulesX = 0., numModulesY = 0.;
+    bool flag = findPatternsVerticesPoints(finderPatterns);
+    if (flag) {
+        vector<double> pattern_distance(4);
+        for (auto& pattern : finderPatterns) {
+            auto indexes = matchPatternPoints(pattern, original_points);
+            if (indexes == std::make_pair(-1, -1))
+                return 0.;
```

Review comment:
Nit: negate the condition to reduce nesting.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation
**Review Line:** 2318

**Code Changes:**
```diff
+double QRDecode::getNumModules() {
+    vector<vector<Point>> finderPatterns;
+    double numModulesX = 0., numModulesY = 0.;
+    bool flag = findPatternsVerticesPoints(finderPatterns);
+    if (flag) {
+        vector<double> pattern_distance(4);
+        for (auto& pattern : finderPatterns) {
+            auto indexes = matchPatternPoints(pattern, original_points);
+            if (indexes == std::make_pair(-1, -1))
+                return 0.;
+            Point2f vf[4] = {pattern[indexes.first % 4], pattern[(1+indexes.first) % 4],
```

Review comment:
why is this a vector?
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation
**Review Line:** 2320

**Code Changes:**
```diff
+    double numModulesX = 0., numModulesY = 0.;
+    bool flag = findPatternsVerticesPoints(finderPatterns);
+    if (flag) {
+        vector<double> pattern_distance(4);
+        for (auto& pattern : finderPatterns) {
+            auto indexes = matchPatternPoints(pattern, original_points);
+            if (indexes == std::make_pair(-1, -1))
+                return 0.;
+            Point2f vf[4] = {pattern[indexes.first % 4], pattern[(1+indexes.first) % 4],
+                                  pattern[(2+indexes.first) % 4], pattern[(3+indexes.first) % 4]};
+            for (int i = 1; i < 4; i++) {
```

Review comment:
Nit: name both elements of the pair so that's easier to read.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation
**Review Line:** 2528

**Code Changes:**
```diff
+    bool useFinderPattern = false;
+    const double thresholdFinderPattern = 0.2;
+    const double roundingError = abs(numModulesByFinderPattern - cvRound(numModulesByFinderPattern));
+    if (cvRound(versionByFinderPattern) >= 1 && versionByFinderPattern <= 6 && transition_x != transition_y) {
+        if (roundingError < thresholdFinderPattern)
+            useFinderPattern = true;
+    }
+
+    bool useCode = false;
+    int versionByCode = 7;
+    if (cvRound(versionByFinderPattern) >= 7 || versionByTransition >= 7) {
```

Review comment:
`useFinderPattern = (roundingError < thresholdFinderPattern);`
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation
**Review Line:** 2534

**Code Changes:**
```diff
+    }
+
+    bool useCode = false;
+    int versionByCode = 7;
+    if (cvRound(versionByFinderPattern) >= 7 || versionByTransition >= 7) {
+        vector<std::pair<double, int>> versionAndDistances;
+        if (cvRound(versionByFinderPattern) >= 7) {
+            versionAndDistances.push_back(getVersionByCode(numModulesByFinderPattern, no_border_intermediate,
+                                                           cvRound(versionByFinderPattern)));
+        }
+        if (versionByTransition >= 7) {
```

Review comment:
Why do we need this? Should be pair `bestVersion` instead, then `push_back` -> `bestVersion = std::min(bestVersion, ...)`;
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation
**Review Line:** 2564

**Code Changes:**
```diff
+        version = versionByTransition;
+    }
     version_size = 21 + (version - 1) * 4;
-    CV_LOG_INFO(NULL, "QR corners: " << original_points[0] << " " << original_points[1] << " " << original_points[2] <<
-                      " " << original_points[3]);
+    if ( !(0 < version && version <= 40) ) { return false; }
     CV_LOG_INFO(NULL, "QR version: " << (int)version);
     return true;
 }
```

Review comment:
Nit: `if ( version <= 0 || version > 40) { return false; }` looks far more readable
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #22695: Improve QR code version estimation
**Review Line:** 2271

**Code Changes:**
```diff
+    const float minSide = min(min(sidesLen[0], sidesLen[1]), min(sidesLen[2], sidesLen[3]));
+
+    const float patternMaxRelativeLen = .3f;
+    if (1.f - minSide / maxSide > patternMaxRelativeLen)
+        return false;
+    return true;
+}
+
+/**
+ * @param finderPattern - 4 points of finder pattern markers, calculated by findPatternsVerticesPoints()
+ * @param cornerPointsQR - 4 corner points of QR code
```

Review comment:
`return (1.f - minSide / maxSide <= patternMaxRelativeLen);`
**File:** modules/imgproc/src/color_hsv.simd.hpp
**Change Type:** modified
**Context:** PR #22520: Modify the SIMD loop in color_hsv.

**Code Changes:**
```diff
@@ -5,6 +5,19 @@
 #include "precomp.hpp"
 #include "opencv2/core/hal/intrin.hpp"
 
+#if CV_SIMD_SCALABLE
+/* FIX IT:
+// std::swap(a, b) is not available for RVV vector types,
+// and CV_SWAP needs another "t" as input,
+// For compatibility, we swap RVV vector manually by using this macro.
+
```

Review comment:
> `v_and(v_lt(v_g, v_b), vx_setall_f32(360.0f)` v_select() should be used instead of bits manipulation. BTW, comparison functions and `v_select()` should work through dedicated masks type (`vbool32_t` in case of RVV) instead of the same data type. This is old legacy design bug - comparison returns the same type as inputs type. I believe it should be redesigned during adding of new "scalable" API.
**File:** modules/core/include/opencv2/core/hal/intrin.hpp
**Change Type:** modified
**Context:** PR #22520: Modify the SIMD loop in color_hsv.

**Code Changes:**
```diff
@@ -758,7 +758,6 @@ namespace CV__SIMD_NAMESPACE {
     OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int32)
     OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int64)
 
-
     #define OPENCV_HAL_WRAP_BIN_OP_MUL(_Tpvec) \
     inline _Tpvec v_mul(const _Tpvec& a, const _Tpvec& b) \
     { \
```

Review comment:
Why do we still trying to add bitwise operations for floating point types? 1. Drop that from intrinsics API. 2. Use `vreinterpret` and/or `v_select` in the code directly with a TODO mark to rework on masks.
**File:** modules/3d/test/ocl/test_tsdf.cpp
**Change Type:** modified
**Context:** PR #22178: HashTSDF: enableGrowth property

**Code Changes:**
```diff
@@ -571,6 +571,7 @@ void valid_points_test_common_framesize(VolumeType volumeType, VolumeTestSrcType
     ASSERT_LT(abs(0.5 - percentValidity), 0.3) << "percentValidity out of [0.3; 0.7] (percentValidity=" << percentValidity << ")";
 }
 
+
 TEST(TSDF_GPU, raycast_custom_framesize_normals_mat)
 {
     normal_test_custom_framesize(VolumeType::TSDF, VolumeTestFunction::RAYCAST, VolumeTestSrcType::MAT);
```

Review comment:
I propose to compare the result with volume unit size or add volume unit size to the comment for reference.
**File:** modules/3d/test/ocl/test_tsdf.cpp
**Change Type:** modified
**Context:** PR #22178: HashTSDF: enableGrowth property

**Code Changes:**
```diff
@@ -571,6 +571,7 @@ void valid_points_test_common_framesize(VolumeType volumeType, VolumeTestSrcType
     ASSERT_LT(abs(0.5 - percentValidity), 0.3) << "percentValidity out of [0.3; 0.7] (percentValidity=" << percentValidity << ")";
 }
 
+
 TEST(TSDF_GPU, raycast_custom_framesize_normals_mat)
 {
     normal_test_custom_framesize(VolumeType::TSDF, VolumeTestFunction::RAYCAST, VolumeTestSrcType::MAT);
```

Review comment:
I propose to split the function into separate tests as soon as if-else branches do not have common logic: - Parameterized GTest test for TSDF and colorTSDF. It's very small and simple. - Parameterized test with bool setEnableGrowth(true/false). It's for else branch and it'll be smaller than the original one without code duplication.
**File:** modules/3d/src/rgbd/volume_impl.cpp
**Change Type:** modified
**Context:** PR #22178: HashTSDF: enableGrowth property

**Code Changes:**
```diff
@@ -66,8 +66,8 @@ void TsdfVolume::integrate(InputArray _depth, InputArray _cameraPose)
     settings.getCameraIntegrateIntrinsics(intr);
     Intr intrinsics(intr);
     Vec6f newParams((float)depth.rows, (float)depth.cols,
-        intrinsics.fx, intrinsics.fy,
-        intrinsics.cx, intrinsics.cy);
+                    intrinsics.fx, intrinsics.fy,
+                    intrinsics.cx, intrinsics.cy);
     if (!(frameParams == newParams))
     {
```

Review comment:
"VOXEL mode is not implemented yet" to make it clear, what's wrong.
**File:** modules/3d/test/ocl/test_tsdf.cpp
**Change Type:** modified
**Context:** PR #22178: HashTSDF: enableGrowth property

**Code Changes:**
```diff
@@ -571,6 +571,7 @@ void valid_points_test_common_framesize(VolumeType volumeType, VolumeTestSrcType
     ASSERT_LT(abs(0.5 - percentValidity), 0.3) << "percentValidity out of [0.3; 0.7] (percentValidity=" << percentValidity << ")";
 }
 
+
 TEST(TSDF_GPU, raycast_custom_framesize_normals_mat)
 {
     normal_test_custom_framesize(VolumeType::TSDF, VolumeTestFunction::RAYCAST, VolumeTestSrcType::MAT);
```

Review comment:
The exact zero is OK: this means that no volume units were created during integration. But the comparison should be done with an epsilon, will fix it.
**File:** modules/3d/test/ocl/test_tsdf.cpp
**Change Type:** modified
**Context:** PR #22178: HashTSDF: enableGrowth property

**Code Changes:**
```diff
@@ -571,6 +571,7 @@ void valid_points_test_common_framesize(VolumeType volumeType, VolumeTestSrcType
     ASSERT_LT(abs(0.5 - percentValidity), 0.3) << "percentValidity out of [0.3; 0.7] (percentValidity=" << percentValidity << ")";
 }
 
+
 TEST(TSDF_GPU, raycast_custom_framesize_normals_mat)
 {
     normal_test_custom_framesize(VolumeType::TSDF, VolumeTestFunction::RAYCAST, VolumeTestSrcType::MAT);
```

Review comment:
It's still there.
**File:** modules/3d/test/test_tsdf.cpp
**Change Type:** modified
**Context:** PR #22178: HashTSDF: enableGrowth property
**Review Line:** 1492

**Code Changes:**
```diff
+    OpenCLStatusRevert revert(cv::ocl::useOpenCL());
+
+    if (!gpu)
+        cv::ocl::setUseOpenCL(false);
+
+    boundingBoxGrowthTest(enableGrowth);
+}
+
+INSTANTIATE_TEST_CASE_P(TSDF, BoundingBoxEnableGrowthTest, ::testing::Combine(::testing::Bool(), ::testing::Bool()));
 
 #endif
```

Review comment:
In case if `boundingBoxGrowthTest` throws exception or fails the test the next step for OpenCL will not be executed. I propose to use special struct with constructor+destructor to guarantee context handling. It's applicable for other OpenCL specific tests too: ``` struct OpenCLContextStorage { OpenCLContextStorage(bool openclStatus): originalOpenCLStatus(openclStatus) {} ~OpenCLContextStorage() { cv::ocl::setUseOpenCL(originalOpenCLStatus); } } ``` And in test: ``` OpenCLContextStorage oclStatusStorage(false); ... ```
**File:** modules/3d/test/test_tsdf.cpp
**Change Type:** modified
**Context:** PR #22178: HashTSDF: enableGrowth property
**Review Line:** 1492

**Code Changes:**
```diff
+    OpenCLStatusRevert revert(cv::ocl::useOpenCL());
+
+    if (!gpu)
+        cv::ocl::setUseOpenCL(false);
+
+    boundingBoxGrowthTest(enableGrowth);
+}
+
+INSTANTIATE_TEST_CASE_P(TSDF, BoundingBoxEnableGrowthTest, ::testing::Combine(::testing::Bool(), ::testing::Bool()));
 
 #endif
```

Review comment:
Done As for other tests, this will be done in the next PR
**File:** modules/3d/include/opencv2/3d/detail/submap.hpp
**Change Type:** modified
**Context:** PR #22845: Volume interface changes, etc.

**Code Changes:**
```diff
@@ -52,7 +52,7 @@ class Submap
     virtual ~Submap() = default;
 
     virtual void integrate(InputArray _depth, const int currframeId);
-    virtual void raycast(const cv::Affine3f& cameraPose, cv::Size frameSize,
+    virtual void raycast(const cv::Affine3f& cameraPose, cv::Size frameSize, cv::Matx33f K,
                          OutputArray points = noArray(), OutputArray normals = noArray());
 
     virtual int getTotalAllocatedBlocks() const { return int(volume.getTotalVolumeUnits()); };
@@ -112,14 +112,14 @@ void Submap<MatType>::integrate(InputArray _depth, const int currFrameId)
```

Review comment:
in calib module camera projection matrix is usually named as `K`
**File:** modules/core/src/opengl.cpp
**Change Type:** modified
**Context:** PR #22855: Print CL status code on error in opengl interop functions
**Review Line:** 1641

**Code Changes:**
```diff
@@ -1638,14 +1638,14 @@ Context& initializeContextFromGL()
     cl_uint numPlatforms;
     cl_int status = clGetPlatformIDs(0, NULL, &numPlatforms);
     if (status != CL_SUCCESS)
-        CV_Error(cv::Error::OpenCLInitError, "OpenCL: Can't get number of platforms");
+        CV_Error_(cv::Error::OpenCLInitError, "OpenCL: Can't get number of platforms: %d ", status);
     if (numPlatforms == 0)
         CV_Error(cv::Error::OpenCLInitError, "OpenCL: No available platforms");
 
     std::vector<cl_platform_id> platforms(numPlatforms);
     status = clGetPlatformIDs(numPlatforms, &platforms[0], NULL);
```

Review comment:
Is it tested anywhere on CI? Used syntax is following: `CV_Error_(code, (format, args...))`
**File:** modules/core/src/opengl.cpp
**Change Type:** modified
**Context:** PR #22855: Print CL status code on error in opengl interop functions
**Review Line:** 1641

**Code Changes:**
```diff
@@ -1638,14 +1638,14 @@ Context& initializeContextFromGL()
     cl_uint numPlatforms;
     cl_int status = clGetPlatformIDs(0, NULL, &numPlatforms);
     if (status != CL_SUCCESS)
-        CV_Error(cv::Error::OpenCLInitError, "OpenCL: Can't get number of platforms");
+        CV_Error_(cv::Error::OpenCLInitError, "OpenCL: Can't get number of platforms: %d ", status);
     if (numPlatforms == 0)
         CV_Error(cv::Error::OpenCLInitError, "OpenCL: No available platforms");
 
     std::vector<cl_platform_id> platforms(numPlatforms);
     status = clGetPlatformIDs(numPlatforms, &platforms[0], NULL);
```

Review comment:
I got your point and fix it asap.
**File:** modules/core/src/opengl.cpp
**Change Type:** modified
**Context:** PR #22855: Print CL status code on error in opengl interop functions
**Review Line:** 1641

**Code Changes:**
```diff
@@ -1638,14 +1638,14 @@ Context& initializeContextFromGL()
     cl_uint numPlatforms;
     cl_int status = clGetPlatformIDs(0, NULL, &numPlatforms);
     if (status != CL_SUCCESS)
-        CV_Error(cv::Error::OpenCLInitError, "OpenCL: Can't get number of platforms");
+        CV_Error_(cv::Error::OpenCLInitError, "OpenCL: Can't get number of platforms: %d ", status);
     if (numPlatforms == 0)
         CV_Error(cv::Error::OpenCLInitError, "OpenCL: No available platforms");
 
     std::vector<cl_platform_id> platforms(numPlatforms);
     status = clGetPlatformIDs(numPlatforms, &platforms[0], NULL);
```

Review comment:
I am testing at the moment. Why did this work?
**File:** modules/core/src/opengl.cpp
**Change Type:** modified
**Context:** PR #22855: Print CL status code on error in opengl interop functions
**Review Line:** 1641

**Code Changes:**
```diff
@@ -1638,14 +1638,14 @@ Context& initializeContextFromGL()
     cl_uint numPlatforms;
     cl_int status = clGetPlatformIDs(0, NULL, &numPlatforms);
     if (status != CL_SUCCESS)
-        CV_Error(cv::Error::OpenCLInitError, "OpenCL: Can't get number of platforms");
+        CV_Error_(cv::Error::OpenCLInitError, "OpenCL: Can't get number of platforms: %d ", status);
     if (numPlatforms == 0)
         CV_Error(cv::Error::OpenCLInitError, "OpenCL: No available platforms");
 
     std::vector<cl_platform_id> platforms(numPlatforms);
     status = clGetPlatformIDs(numPlatforms, &platforms[0], NULL);
```

Review comment:
A merge gone bad🤦‍♂️ Still testing.