nareshmlx/opencv-pr huggingface dataset:
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #20080: Update dnn.hpp

**Code Changes:**
```diff
@@ -712,9 +712,11 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
         CV_WRAP void enableFusion(bool fusion);
 
         /** @brief Returns overall time for inference and timings (in ticks) for layers.
+         *
          * Indexes in returned vector correspond to layers ids. Some layers can be fused with others,
-         * in this case zero ticks count will be return for that skipped layers.
-         * @param timings vector for tick timings for all layers.
+         * in this case zero ticks count will be return for that skipped layers. Supported by DNN_BACKEND_OPENCV on DNN_TARGET_CPU only.
+         *
```

Review comment:
I believe OpenCV/CPU backend only supports this method properly. Other backends are asynchronous (like OpenCL, CUDA) or they don't provide per-layer information because tasks are scheduled as sub-graphs.
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #20080: Update dnn.hpp

**Code Changes:**
```diff
@@ -712,9 +712,11 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
         CV_WRAP void enableFusion(bool fusion);
 
         /** @brief Returns overall time for inference and timings (in ticks) for layers.
+         *
          * Indexes in returned vector correspond to layers ids. Some layers can be fused with others,
-         * in this case zero ticks count will be return for that skipped layers.
-         * @param timings vector for tick timings for all layers.
+         * in this case zero ticks count will be return for that skipped layers. Supported by DNN_BACKEND_OPENCV on DNN_TARGET_CPU only.
+         *
```

Review comment:
I don't have that knowledge. It would be helpful to indicate limited backend support, so no one else wastes time to find out the hard way.
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #20080: Update dnn.hpp

**Code Changes:**
```diff
@@ -712,9 +712,11 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
         CV_WRAP void enableFusion(bool fusion);
 
         /** @brief Returns overall time for inference and timings (in ticks) for layers.
+         *
          * Indexes in returned vector correspond to layers ids. Some layers can be fused with others,
-         * in this case zero ticks count will be return for that skipped layers.
-         * @param timings vector for tick timings for all layers.
+         * in this case zero ticks count will be return for that skipped layers. Supported by DNN_BACKEND_OPENCV on DNN_TARGET_CPU only.
+         *
```

Review comment:
It should be: ``` ... DNN_BACKEND_OPENCV on DNN_TARGET_CPU only. ```
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #20080: Update dnn.hpp

**Code Changes:**
```diff
@@ -712,9 +712,11 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
         CV_WRAP void enableFusion(bool fusion);
 
         /** @brief Returns overall time for inference and timings (in ticks) for layers.
+         *
          * Indexes in returned vector correspond to layers ids. Some layers can be fused with others,
-         * in this case zero ticks count will be return for that skipped layers.
-         * @param timings vector for tick timings for all layers.
+         * in this case zero ticks count will be return for that skipped layers. Supported by DNN_BACKEND_OPENCV on DNN_TARGET_CPU only.
+         *
```

Review comment:
Yes, I corrected it.
**File:** modules/java/test/pure_test/build.xml
**Change Type:** modified
**Context:** PR #20146: Analog of gtest_filter for java tests

**Code Changes:**
```diff
@@ -6,6 +6,7 @@
 
   <property name="opencv.test.package" value="*"/>
   <property name="opencv.test.class" value="*"/>
+  <property name="opencv.test.exclude" value=""/>
 
   <path id="master-classpath">
     <fileset dir="lib">
@@ -53,7 +54,7 @@
       <formatter type="xml"/>
```

Review comment:
this name would confuse anyone because it is used to exclude tests. (AFAIK, original problem with QR test is already resolved)
**File:** modules/java/test/pure_test/build.xml
**Change Type:** modified
**Context:** PR #20146: Analog of gtest_filter for java tests

**Code Changes:**
```diff
@@ -6,6 +6,7 @@
 
   <property name="opencv.test.package" value="*"/>
   <property name="opencv.test.class" value="*"/>
+  <property name="opencv.test.exclude" value=""/>
 
   <path id="master-classpath">
     <fileset dir="lib">
@@ -53,7 +54,7 @@
       <formatter type="xml"/>
```

Review comment:
Replaced "filter" with "exclude".
**File:** modules/photo/test/test_hdr.cpp
**Change Type:** modified
**Context:** PR #20054: Fix Robertson Calibration NaN Bug

**Code Changes:**
```diff
@@ -249,4 +249,21 @@ TEST(Photo_CalibrateRobertson, regression)
     checkEqual(expected, response, 1e-1f, "CalibrateRobertson");
 }
 
+TEST(Photo_CalibrateRobertson, bug_18180)
+{
+    vector<Mat> images;
+    vector<cv::String> fn;
+    string test_path = cvtest::TS::ptr()->get_data_path() + "hdr/exposures/bug_18180/";
+    for(int i = 1; i <= 4; ++i)
```

Review comment:
`norm(response, response_no_nans, NORM_INF) == 0.0` ?
**File:** modules/photo/test/test_hdr.cpp
**Change Type:** modified
**Context:** PR #20054: Fix Robertson Calibration NaN Bug

**Code Changes:**
```diff
@@ -249,4 +249,21 @@ TEST(Photo_CalibrateRobertson, regression)
     checkEqual(expected, response, 1e-1f, "CalibrateRobertson");
 }
 
+TEST(Photo_CalibrateRobertson, bug_18180)
+{
+    vector<Mat> images;
+    vector<cv::String> fn;
+    string test_path = cvtest::TS::ptr()->get_data_path() + "hdr/exposures/bug_18180/";
+    for(int i = 1; i <= 4; ++i)
```

Review comment:
Please avoid using `glob()` in tests. Use fixed input instead.
**File:** modules/photo/test/test_hdr.cpp
**Change Type:** modified
**Context:** PR #20054: Fix Robertson Calibration NaN Bug

**Code Changes:**
```diff
@@ -249,4 +249,21 @@ TEST(Photo_CalibrateRobertson, regression)
     checkEqual(expected, response, 1e-1f, "CalibrateRobertson");
 }
 
+TEST(Photo_CalibrateRobertson, bug_18180)
+{
+    vector<Mat> images;
+    vector<cv::String> fn;
+    string test_path = cvtest::TS::ptr()->get_data_path() + "hdr/exposures/bug_18180/";
+    for(int i = 1; i <= 4; ++i)
```

Review comment:
NORM_INF doesn't properly handle NaNs. There is still a problem: ``` EXPECT_EQ(0.0, cv::norm(response, response_no_nans, NORM_L2)); ``` Results to this error message (Linux Debug): ``` Expected equality of these values: 0.0 Which is: 0 cv::norm(response, response_no_nans, NORM_L2) Which is: -nan [ FAILED ] Photo_CalibrateRobertson.bug_18180 (1789 ms) ```
**File:** modules/photo/src/merge.cpp
**Change Type:** modified
**Context:** PR #20054: Fix Robertson Calibration NaN Bug

**Code Changes:**
```diff
@@ -344,7 +344,7 @@ class MergeRobertsonImpl CV_FINAL : public MergeRobertson
             result += times.at<float>((int)i) * w.mul(im);
             wsum += times.at<float>((int)i) * times.at<float>((int)i) * w;
         }
-        result = result.mul(1 / wsum);
+        result = result.mul(1 / (wsum + Scalar::all(DBL_EPSILON)));
     }
 
     void process(InputArrayOfArrays src, OutputArray dst, InputArray times) CV_OVERRIDE
```

Review comment:
Patching `wsum` doesn't look valid. Patch divide operation instead (`Scalar::all()` is necessary as we work with multi-channel data): ``` result = result.mul(1 / (wsum + Scalar::all(DBL_EPSILON))); ```
**File:** modules/imgproc/src/phasecorr.cpp
**Change Type:** modified
**Context:** PR #20102: Add missing sqrt to magSpectrum().

**Code Changes:**
```diff
@@ -78,9 +78,9 @@ static void magSpectrums( InputArray _src, OutputArray _dst)
             {
                 if( k == 1 )
                     dataSrc += cols - 1, dataDst += cols - 1;
-                dataDst[0] = dataSrc[0]*dataSrc[0];
+                dataDst[0] = (float)std::abs(dataSrc[0]);
                 if( rows % 2 == 0 )
-                    dataDst[(rows-1)*stepDst] = dataSrc[(rows-1)*stepSrc]*dataSrc[(rows-1)*stepSrc];
+                    dataDst[(rows-1)*stepDst] = (float)std::abs(dataSrc[(rows-1)*stepSrc]);
 
```

Review comment:
please, replace it with more efficient `std::abs(dataSrc[0])`
**File:** modules/imgproc/src/phasecorr.cpp
**Change Type:** modified
**Context:** PR #20102: Add missing sqrt to magSpectrum().

**Code Changes:**
```diff
@@ -78,9 +78,9 @@ static void magSpectrums( InputArray _src, OutputArray _dst)
             {
                 if( k == 1 )
                     dataSrc += cols - 1, dataDst += cols - 1;
-                dataDst[0] = dataSrc[0]*dataSrc[0];
+                dataDst[0] = (float)std::abs(dataSrc[0]);
                 if( rows % 2 == 0 )
-                    dataDst[(rows-1)*stepDst] = dataSrc[(rows-1)*stepSrc]*dataSrc[(rows-1)*stepSrc];
+                    dataDst[(rows-1)*stepDst] = (float)std::abs(dataSrc[(rows-1)*stepSrc]);
 
```

Review comment:
please, replace it with more efficient `std::abs(...)`
**File:** modules/imgproc/src/phasecorr.cpp
**Change Type:** modified
**Context:** PR #20102: Add missing sqrt to magSpectrum().

**Code Changes:**
```diff
@@ -78,9 +78,9 @@ static void magSpectrums( InputArray _src, OutputArray _dst)
             {
                 if( k == 1 )
                     dataSrc += cols - 1, dataDst += cols - 1;
-                dataDst[0] = dataSrc[0]*dataSrc[0];
+                dataDst[0] = (float)std::abs(dataSrc[0]);
                 if( rows % 2 == 0 )
-                    dataDst[(rows-1)*stepDst] = dataSrc[(rows-1)*stepSrc]*dataSrc[(rows-1)*stepSrc];
+                    dataDst[(rows-1)*stepDst] = (float)std::abs(dataSrc[(rows-1)*stepSrc]);
 
```

Review comment:
use std::abs()
**File:** modules/imgproc/src/phasecorr.cpp
**Change Type:** modified
**Context:** PR #20102: Add missing sqrt to magSpectrum().

**Code Changes:**
```diff
@@ -78,9 +78,9 @@ static void magSpectrums( InputArray _src, OutputArray _dst)
             {
                 if( k == 1 )
                     dataSrc += cols - 1, dataDst += cols - 1;
-                dataDst[0] = dataSrc[0]*dataSrc[0];
+                dataDst[0] = (float)std::abs(dataSrc[0]);
                 if( rows % 2 == 0 )
-                    dataDst[(rows-1)*stepDst] = dataSrc[(rows-1)*stepSrc]*dataSrc[(rows-1)*stepSrc];
+                    dataDst[(rows-1)*stepDst] = (float)std::abs(dataSrc[(rows-1)*stepSrc]);
 
```

Review comment:
use abs; in the double-precision version do not cast the result to float
**File:** modules/imgproc/src/color_lab.cpp
**Change Type:** modified
**Context:** PR #19883: Add Neon optimised RGB2Lab conversion

**Code Changes:**
```diff
@@ -1536,6 +1536,8 @@ static inline void trilinearPackedInterpolate(const v_uint16& inX, const v_uint1
 #endif // CV_SIMD
 
 
+
+
 struct RGB2Lab_b
 {
     typedef uchar channel_type;
@@ -1571,6 +1573,69 @@ struct RGB2Lab_b
```

Review comment:
I think you might want to use `v_uint8::nlanes` here instead of 16?
**File:** modules/imgproc/src/color_lab.cpp
**Change Type:** modified
**Context:** PR #19883: Add Neon optimised RGB2Lab conversion

**Code Changes:**
```diff
@@ -1536,6 +1536,8 @@ static inline void trilinearPackedInterpolate(const v_uint16& inX, const v_uint1
 #endif // CV_SIMD
 
 
+
+
 struct RGB2Lab_b
 {
     typedef uchar channel_type;
@@ -1571,6 +1573,69 @@ struct RGB2Lab_b
```

Review comment:
Maybe leave a space after the `,`?
**File:** modules/imgproc/src/color_lab.cpp
**Change Type:** modified
**Context:** PR #19883: Add Neon optimised RGB2Lab conversion

**Code Changes:**
```diff
@@ -1536,6 +1536,8 @@ static inline void trilinearPackedInterpolate(const v_uint16& inX, const v_uint1
 #endif // CV_SIMD
 
 
+
+
 struct RGB2Lab_b
 {
     typedef uchar channel_type;
@@ -1571,6 +1573,69 @@ struct RGB2Lab_b
```

Review comment:
Nit: one empty line should make it.
**File:** modules/imgproc/src/color_lab.cpp
**Change Type:** modified
**Context:** PR #19883: Add Neon optimised RGB2Lab conversion

**Code Changes:**
```diff
@@ -1536,6 +1536,8 @@ static inline void trilinearPackedInterpolate(const v_uint16& inX, const v_uint1
 #endif // CV_SIMD
 
 
+
+
 struct RGB2Lab_b
 {
     typedef uchar channel_type;
@@ -1571,6 +1573,69 @@ struct RGB2Lab_b
```

Review comment:
Done, also changed the types throughout to not hard code the number of lanes
**File:** modules/imgproc/src/color_lab.cpp
**Change Type:** modified
**Context:** PR #19883: Add Neon optimised RGB2Lab conversion

**Code Changes:**
```diff
@@ -1536,6 +1536,8 @@ static inline void trilinearPackedInterpolate(const v_uint16& inX, const v_uint1
 #endif // CV_SIMD
 
 
+
+
 struct RGB2Lab_b
 {
     typedef uchar channel_type;
@@ -1571,6 +1573,69 @@ struct RGB2Lab_b
```

Review comment:
```suggestion #endif // CV_NEON ```
**File:** modules/imgproc/src/color_lab.cpp
**Change Type:** modified
**Context:** PR #19883: Add Neon optimised RGB2Lab conversion

**Code Changes:**
```diff
@@ -1536,6 +1536,8 @@ static inline void trilinearPackedInterpolate(const v_uint16& inX, const v_uint1
 #endif // CV_SIMD
 
 
+
+
 struct RGB2Lab_b
 {
     typedef uchar channel_type;
@@ -1571,6 +1573,69 @@ struct RGB2Lab_b
```

Review comment:
May I suggest to use a static (inline?) function here instead of a macro? Should make the code easier to read. It will likely be inlined so the final code will perform as the one produced with the macro. You should also guard it with `CV_NEON` to prevent it being built when not used.
**File:** modules/imgproc/src/color_lab.cpp
**Change Type:** modified
**Context:** PR #19883: Add Neon optimised RGB2Lab conversion

**Code Changes:**
```diff
@@ -1536,6 +1536,8 @@ static inline void trilinearPackedInterpolate(const v_uint16& inX, const v_uint1
 #endif // CV_SIMD
 
 
+
+
 struct RGB2Lab_b
 {
     typedef uchar channel_type;
@@ -1571,6 +1573,69 @@ struct RGB2Lab_b
```

Review comment:
Done, although it was neater to do in a member function of RGB2Lab_b
**File:** modules/imgproc/src/color_lab.cpp
**Change Type:** modified
**Context:** PR #19883: Add Neon optimised RGB2Lab conversion

**Code Changes:**
```diff
@@ -1536,6 +1536,8 @@ static inline void trilinearPackedInterpolate(const v_uint16& inX, const v_uint1
 #endif // CV_SIMD
 
 
+
+
 struct RGB2Lab_b
 {
     typedef uchar channel_type;
@@ -1571,6 +1573,69 @@ struct RGB2Lab_b
```

Review comment:
```suggestion vL = v_fma(vfY, v_setall_s32(Lscale), v_setall_s32(Lshift+labDescaleShift)); ```
**File:** modules/imgproc/src/color_lab.cpp
**Change Type:** modified
**Context:** PR #19883: Add Neon optimised RGB2Lab conversion
**Review Line:** 1576

**Code Changes:**
```diff
     typedef uchar channel_type;
@@ -1571,6 +1573,69 @@ struct RGB2Lab_b
         }
     }
 
+#if CV_NEON
+    template <int n>
+    inline void rgb2lab_batch(const ushort* tab,
+                              const v_uint8 vRi, const v_uint8 vGi, const v_uint8 vBi,
+                              v_int32& vL, v_int32& va, v_int32& vb) const
+    {
```

Review comment:
It should be `#if CV_SIMD`.
**File:** modules/calib3d/src/ptsetreg.cpp
**Change Type:** modified
**Context:** PR #19689: add estimateAffine3D overload that implements Umeyama's algorithm
**Review Line:** 949

**Code Changes:**
```diff
+    Mat cov = to_centered.t() * from_centered * one_over_n;
+
+    Mat u,d,vt;
+    SVD::compute(cov, d, u, vt, SVD::MODIFY_A | SVD::FULL_UV);
+
+    CV_CheckGE(countNonZero(d), 2, "Points cannot be colinear");
+
+    Mat S = Mat::eye(3, 3, CV_64F);
+    // det(d) can only ever be >=0, so we can always use this here (compared to the original formula by Umeyama)
+    if (force_rotation && (determinant(u) * determinant(vt) < 0))
+    {
```

Review comment:
this check may throw exception, which is not a good idea for a numerical algorithm. Instead, it should provide some reasonable response, i.e. return empty matrix or maybe one of possible solutions (if there are many).
**File:** modules/calib3d/src/ptsetreg.cpp
**Change Type:** modified
**Context:** PR #19689: add estimateAffine3D overload that implements Umeyama's algorithm
**Review Line:** 949

**Code Changes:**
```diff
+    Mat cov = to_centered.t() * from_centered * one_over_n;
+
+    Mat u,d,vt;
+    SVD::compute(cov, d, u, vt, SVD::MODIFY_A | SVD::FULL_UV);
+
+    CV_CheckGE(countNonZero(d), 2, "Points cannot be colinear");
+
+    Mat S = Mat::eye(3, 3, CV_64F);
+    // det(d) can only ever be >=0, so we can always use this here (compared to the original formula by Umeyama)
+    if (force_rotation && (determinant(u) * determinant(vt) < 0))
+    {
```

Review comment:
If the points are collinear the problem is underconstrained and there is an infinite number of solutions. However it is common to throw on malformed arguments, for example if the input matrices are not the correct dimension. E.g. `CV_CheckEQ(to.checkVector(3), count, "Point sets need to have the same size");` I would consider this to be a similar case. I would suggest extending the documentation to saying that co-linear points are not valid. Returning a possible solution would involve matching two two point sets, of which at least one lies on a line. So we would need to choose a random plane to project to to do so. It would involve quite some heuristics and would be pretty hard for the user to unravel if it goes wrong. BTW.: I tried what happens when a collinear set of points is passed to the existing RANSAC implementation: ``` import cv2 import numpy as np a = np.array([[1., 1, 1, 1],[0, 0, 0, 0],[0, 0, 0, 0]]).T r, o, i = cv2.estimateAffine3D(a, a) print(o, r) ``` returns: ``` [[0.5 0. 0. 0.5] [0. 0. 0. 0. ] [0. 0. 0. 0. ]] 1 ``` Should I maybe open an issue, at least this should probably not report a successful execution.
**File:** modules/imgproc/test/test_pc.cpp
**Change Type:** modified
**Context:** PR #20103: Make div spectrums public
**Review Line:** 362

**Code Changes:**
```diff
+    if( cn == 1 )
+    {
+        Mat &converted_src1 = test_mat[TEMP][0];
+        Mat &converted_src2 = test_mat[TEMP][1];
+        convert_from_ccs( src1, src1, converted_src1, flags );
+        convert_from_ccs( src2, src2, converted_src2, flags );
+        div_complex( converted_src1, converted_src2, ref_dst, flags );
+    }
+    // Inputs are complex matrices.  Get the expected output as a complex matrix.
+    else
+    {
```

Review comment:
I'd like to see `convert_from_ccs` and `convert_to_ccs` as public functions as well. Why do you pass in two src matrices to this function?
**File:** modules/imgproc/test/test_pc.cpp
**Change Type:** modified
**Context:** PR #20103: Make div spectrums public
**Review Line:** 362

**Code Changes:**
```diff
+    if( cn == 1 )
+    {
+        Mat &converted_src1 = test_mat[TEMP][0];
+        Mat &converted_src2 = test_mat[TEMP][1];
+        convert_from_ccs( src1, src1, converted_src1, flags );
+        convert_from_ccs( src2, src2, converted_src2, flags );
+        div_complex( converted_src1, converted_src2, ref_dst, flags );
+    }
+    // Inputs are complex matrices.  Get the expected output as a complex matrix.
+    else
+    {
```

Review comment:
I think it's a good idea to make them public if they're going to be used elsewhere. Also, the exact same conversion is used in `test_dxt.cpp`. Only a single src matrix needs to be passed in for the end user. The presence of two src args is for the recursive call on line 260. Perhaps the public api can be improved to only accept a single src matrix.
**File:** modules/core/include/opencv2/core/mat.hpp
**Change Type:** modified
**Context:** PR #19967: Adding functions rbegin() and rend() functions to matrix class.
**Review Line:** 2017

**Code Changes:**
```diff
     template<typename _Tp> MatConstIterator_<_Tp> begin() const;
 
+    /** @brief Same as begin() but for inverse traversal
+     */
+    template<typename _Tp> std::reverse_iterator<MatIterator_<_Tp>> rbegin();
+    template<typename _Tp> std::reverse_iterator<MatConstIterator_<_Tp>> rbegin() const;
+
     /** @brief Returns the matrix iterator and sets it to the after-last matrix element.
 
     The methods return the matrix read-only or read-write iterators, set to the point following the last
@@ -2019,6 +2024,12 @@ class CV_EXPORTS Mat
```

Review comment:
Please remove extra spaces
**File:** modules/core/include/opencv2/core/mat.inl.hpp
**Change Type:** modified
**Context:** PR #19967: Adding functions rbegin() and rend() functions to matrix class.

**Code Changes:**
```diff
@@ -1015,6 +1015,17 @@ MatConstIterator_<_Tp> Mat::begin() const
     return MatConstIterator_<_Tp>((const Mat_<_Tp>*)this);
 }
 
+template<typename _Tp> inline
+std::reverse_iterator<MatConstIterator_<_Tp>> Mat::rbegin() const
+{
+    if (empty())
+        return std::reverse_iterator<MatConstIterator_<_Tp>>();
+    CV_DbgAssert( elemSize() == sizeof(_Tp) );
```

Review comment:
remove extra double space and empty line
**File:** modules/videoio/src/cap_ffmpeg_hw.hpp
**Change Type:** modified
**Context:** PR #19755: cv::UMat output/input in VideoCapture/VideoWriter (data stays in GPU memory)

**Code Changes:**
```diff
@@ -5,7 +5,10 @@
 // Copyright (C) 2020-2021 Intel Corporation
 
 #include "opencv2/videoio.hpp"
-#if defined(__OPENCV_BUILD) || defined(OPENCV_HAVE_CVCONFIG_H)  // TODO Properly detect and add D3D11 / LIBVA dependencies for standalone plugins
+#ifdef HAVE_OPENCL
+#include "opencv2/core/ocl.hpp"
+#endif
+#if defined(__OPENCV_BUILD) && !defined(BUILD_PLUGIN)  // TODO Properly detect and add D3D11 / LIBVA dependencies for standalone plugins
 #include "cvconfig.h"
```

Review comment:
> `ocl::useOpenCL(false)` I believe it is enough to check `ocl_context.empty()` only. So adding new "useOpenCL" behavior is not necessary. --- Current opencv_test_videoio tests stuck with these messages (due to pre-initialized OpenCL device): ``` [ RUN ] videoio/videocapture_acceleration.read/55, where GetParam() = (sample_322x242_15frames.yuv420p.libx264.mp4, FFMPEG, VAAPI, true) ... [ INFO:0] global /home/alalek/projects/opencv/dev/modules/videoio/src/cap_ffmpeg_hw.hpp (268) hw_check_device FFMPEG: Using vaapi video acceleration on device: Intel iHD driver for Intel(R) Gen Graphics - 20.3.0 () [ INFO:0] global /home/alalek/projects/opencv/dev/modules/videoio/src/cap_ffmpeg_hw.hpp (559) hw_create_device FFMPEG: Created video acceleration context (av_hwdevice_ctx_create) for vaapi on device 'default' [ INFO:0] global /home/alalek/projects/opencv/dev/modules/videoio/src/cap_ffmpeg_hw.hpp (571) hw_create_device FFMPEG: Can't bind vaapi video acceleration context to already created OpenCL context ``` --- BTW, I would suggest to add explicit "VideoCapture" open parameter which forces creation of new of OpenCL context.