nareshmlx/opencv-pr huggingface dataset:
**File:** modules/dnn/test/test_model.cpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels
**Review Line:** 221

**Code Changes:**
```diff
+    bool swapRB = true;
+    bool crop = false;
+    bool nmsAcrossClasses = true;
+
+    double confThreshold = 0.24;
+    double nmsThreshold = (target == DNN_TARGET_MYRIAD) ? 0.15: 0.15;
+    double scoreDiff = 8e-5, iouDiff = 1e-5;
+    if (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD || target == DNN_TARGET_CUDA_FP16)
+    {
+        scoreDiff = 1e-2;
+        iouDiff = 1.6e-2;
```

Review comment:
I looked at different images, but I could not find good any good examples. Would you recommend any, I think the example is not so confusing as visually there is overlap
**File:** modules/dnn/src/model.cpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -320,34 +320,78 @@ void SegmentationModel::segment(InputArray frame, OutputArray mask)
     }
 }
 
-void disableRegionNMS(Net& net)
+class DetectionModel_Impl : public Model::Impl
 {
-    for (String& name : net.getUnconnectedOutLayersNames())
+public:
+    virtual ~DetectionModel_Impl() {}
```

Review comment:
Same problem. Should be ```cpp if (!nmsAcrossClasses) { ```
**File:** modules/dnn/test/test_model.cpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels
**Review Line:** 221

**Code Changes:**
```diff
+    bool swapRB = true;
+    bool crop = false;
+    bool nmsAcrossClasses = true;
+
+    double confThreshold = 0.24;
+    double nmsThreshold = (target == DNN_TARGET_MYRIAD) ? 0.15: 0.15;
+    double scoreDiff = 8e-5, iouDiff = 1e-5;
+    if (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD || target == DNN_TARGET_CUDA_FP16)
+    {
+        scoreDiff = 1e-2;
+        iouDiff = 1.6e-2;
```

Review comment:
Can you please show the results? There should be dog, car and a bicycle ![image](https://user-images.githubusercontent.com/25801568/99937791-8fb08300-2d77-11eb-997b-a4818b879dfb.png)
**File:** modules/dnn/test/test_model.cpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -25,7 +25,8 @@ class Test_Model : public DNNTestLayer
                          double scoreDiff, double iouDiff,
                          double confThreshold = 0.24, double nmsThreshold = 0.0,
                          const Size& size = {-1, -1}, Scalar mean = Scalar(),
-                         double scale = 1.0, bool swapRB = false, bool crop = false)
+                         double scale = 1.0, bool swapRB = false, bool crop = false,
+                         bool nmsAcrossClasses = false)
     {
         checkBackend();
 
```

Review comment:
please rename `nmsDifferentLabels`
**File:** modules/dnn/test/test_model.cpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -25,7 +25,8 @@ class Test_Model : public DNNTestLayer
                          double scoreDiff, double iouDiff,
                          double confThreshold = 0.24, double nmsThreshold = 0.0,
                          const Size& size = {-1, -1}, Scalar mean = Scalar(),
-                         double scale = 1.0, bool swapRB = false, bool crop = false)
+                         double scale = 1.0, bool swapRB = false, bool crop = false,
+                         bool nmsAcrossClasses = false)
     {
         checkBackend();
 
```

Review comment:
reaname nmsDifferentLabels
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -1296,6 +1296,23 @@ CV__DNN_INLINE_NS_BEGIN
           */
          CV_WRAP DetectionModel(const Net& network);
 
+         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code (need to fix bindings first)
+         DetectionModel();
+
+         /**
+          * @brief nmsAcrossClasses defaults to false,
+          * such that when non max suppression is used during the detect() function, it will do so per-class.
```

Review comment:
Please make as a method: ```cpp CV_WRAP DetectionModel& setNMSAcrossClasses (bool value); ``` Otherwise this method is too complicated.
**File:** modules/dnn/test/test_model.cpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels
**Review Line:** 221

**Code Changes:**
```diff
+    bool swapRB = true;
+    bool crop = false;
+    bool nmsAcrossClasses = true;
+
+    double confThreshold = 0.24;
+    double nmsThreshold = (target == DNN_TARGET_MYRIAD) ? 0.15: 0.15;
+    double scoreDiff = 8e-5, iouDiff = 1e-5;
+    if (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD || target == DNN_TARGET_CUDA_FP16)
+    {
+        scoreDiff = 1e-2;
+        iouDiff = 1.6e-2;
```

Review comment:
The results in the new test case should be just dog and car, since I want nms to suppress bicycle as the iou between dog and bicycle exceeds 0.15 and the confidence for dog is higher, and I want to demonstrate nms across classes, this is the difference between the new test case and the previous one.
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -1296,6 +1296,23 @@ CV__DNN_INLINE_NS_BEGIN
           */
          CV_WRAP DetectionModel(const Net& network);
 
+         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code (need to fix bindings first)
+         DetectionModel();
+
+         /**
+          * @brief nmsAcrossClasses defaults to false,
+          * such that when non max suppression is used during the detect() function, it will do so per-class.
```

Review comment:
Hi, I'm doing this, however for when the return type is DetectionModel&, I get an error in the python binding that no default contructor for DetectionModel exists. It works fine when the type is void for the setter though.
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -1296,6 +1296,23 @@ CV__DNN_INLINE_NS_BEGIN
           */
          CV_WRAP DetectionModel(const Net& network);
 
+         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code (need to fix bindings first)
+         DetectionModel();
+
+         /**
+          * @brief nmsAcrossClasses defaults to false,
+          * such that when non max suppression is used during the detect() function, it will do so per-class.
```

Review comment:
Yes, please take a look at Model class definition: https://github.com/opencv/opencv/blob/master/modules/dnn/include/opencv2/dnn/dnn.hpp
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -1296,6 +1296,23 @@ CV__DNN_INLINE_NS_BEGIN
           */
          CV_WRAP DetectionModel(const Net& network);
 
+         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code (need to fix bindings first)
+         DetectionModel();
+
+         /**
+          * @brief nmsAcrossClasses defaults to false,
+          * such that when non max suppression is used during the detect() function, it will do so per-class.
```

Review comment:
Right, just saw the 'need to fix bindings first' comment. Does that mean I should leave it as void for now or create a default constructor for DetectionModel as well?
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -1296,6 +1296,23 @@ CV__DNN_INLINE_NS_BEGIN
           */
          CV_WRAP DetectionModel(const Net& network);
 
+         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code (need to fix bindings first)
+         DetectionModel();
+
+         /**
+          * @brief nmsAcrossClasses defaults to false,
+          * such that when non max suppression is used during the detect() function, it will do so per-class.
```

Review comment:
Please add the changes from https://github.com/dkurt/opencv/pull/1 so this private field may go to internal implementation.
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -1296,6 +1296,23 @@ CV__DNN_INLINE_NS_BEGIN
           */
          CV_WRAP DetectionModel(const Net& network);
 
+         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code (need to fix bindings first)
+         DetectionModel();
+
+         /**
+          * @brief nmsAcrossClasses defaults to false,
+          * such that when non max suppression is used during the detect() function, it will do so per-class.
```

Review comment:
Did this, I added the commit from that PR to this one, I also changed the branch to master rather than 'next', since the api itself does not change now, only gets added to.
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -1296,6 +1296,23 @@ CV__DNN_INLINE_NS_BEGIN
           */
          CV_WRAP DetectionModel(const Net& network);
 
+         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code (need to fix bindings first)
+         DetectionModel();
+
+         /**
+          * @brief nmsAcrossClasses defaults to false,
+          * such that when non max suppression is used during the detect() function, it will do so per-class.
```

Review comment:
Please change return type: `void` => `DetectionModel&` (`return *this;`) to allow chains of `.set*()` calls. (+ default dummy ctor `DetectionModel()` for bindings (see mentioned PR), + checks for nullptr impl from this ctor)
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -1296,6 +1296,23 @@ CV__DNN_INLINE_NS_BEGIN
           */
          CV_WRAP DetectionModel(const Net& network);
 
+         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code (need to fix bindings first)
+         DetectionModel();
+
+         /**
+          * @brief nmsAcrossClasses defaults to false,
+          * such that when non max suppression is used during the detect() function, it will do so per-class.
```

Review comment:
Right, forgot about this. Would you be able to elaborate further what you mean by "checks for nullptr impl", please? In other words, ``` DetectionModel::DetectionModel() : Model() { // What goes here? } ``` I understand the implementation field `impl` will be null in this constructor, but I am not sure what exactly to put here. I just updated this PR with a new commit to show the differences I made. I will change and squash it later once we rectify this. For now, I made the constructor as `CV_DEPRECATED_EXTERNAL`, which is what the default constructor for `Model` is using at the moment and left the body empty, also to be like `Model`'s, but am not sure if this is what you intended.
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -1296,6 +1296,23 @@ CV__DNN_INLINE_NS_BEGIN
           */
          CV_WRAP DetectionModel(const Net& network);
 
+         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code (need to fix bindings first)
+         DetectionModel();
+
+         /**
+          * @brief nmsAcrossClasses defaults to false,
+          * such that when non max suppression is used during the detect() function, it will do so per-class.
```

Review comment:
Constructor is fine. Need to add checks (`CV_Assert()`) into other methods (where `impl` is nullptr and `impl.dynamicCast<DetectionModel_Impl>()` is nullptr too).
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #18891: Add option for NMS for boxes with different labels

**Code Changes:**
```diff
@@ -1296,6 +1296,23 @@ CV__DNN_INLINE_NS_BEGIN
           */
          CV_WRAP DetectionModel(const Net& network);
 
+         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code (need to fix bindings first)
+         DetectionModel();
+
+         /**
+          * @brief nmsAcrossClasses defaults to false,
+          * such that when non max suppression is used during the detect() function, it will do so per-class.
```

Review comment:
Added another commit with the assertions, is this what you meant? Also added the comments next to them, let me know if I should remove or reword
**File:** modules/videoio/test/test_video_io.cpp
**Change Type:** modified
**Context:** PR #18968: Added test for VideoCapture CAP_PROP_FRAME_MSEC option

**Code Changes:**
```diff
@@ -231,6 +231,34 @@ class Videoio_Bunny : public Videoio_Test_Base, public testing::TestWithParam<Ba
         else
             std::cout << "Frames counter is not available. Actual frames: " << count_actual << ". SKIP check." << std::endl;
     }
+
+    void doTimestampTest()
+    {
+        if (!isBackendAvailable(apiPref, cv::videoio_registry::getStreamBackends()))
+            throw SkipTestException(cv::String("Backend is not available/disabled: ") + cv::videoio_registry::getBackendName(apiPref));
+
```

Review comment:
Use `throw SkipTestException(...)` here and below (see above for example).
**File:** modules/core/src/matrix_wrap.cpp
**Change Type:** modified
**Context:** PR #17077: core(matrix): Negative values checks
**Review Line:** 984

**Code Changes:**
```diff
@@ -981,21 +981,21 @@ bool _InputArray::isSubmatrix(int i) const
     if( k == STD_VECTOR_MAT )
     {
         const std::vector<Mat>& vv = *(const std::vector<Mat>*)obj;
-        CV_Assert((size_t)i < vv.size());
+        CV_Assert(i >= 0 && (size_t)i < vv.size());
         return vv[i].isSubmatrix();
     }
 
     if( k == STD_ARRAY_MAT )
     {
```

Review comment:
Casting to unsigned type is a trick to handle `i >= 0` check automatically.
**File:** modules/core/src/matrix_wrap.cpp
**Change Type:** modified
**Context:** PR #17077: core(matrix): Negative values checks

**Code Changes:**
```diff
@@ -947,7 +947,7 @@ bool _InputArray::isContinuous(int i) const
     if( k == STD_ARRAY_MAT )
     {
         const Mat* vv = (const Mat*)obj;
-        CV_Assert(i > 0 && i < sz.height);
+        CV_Assert(i >= 0 && i < sz.height);
         return vv[i].isContinuous();
     }
 
@@ -981,21 +981,21 @@ bool _InputArray::isSubmatrix(int i) const
```

Review comment:
Is that correct? Why not assertion?
**File:** modules/core/src/matrix_wrap.cpp
**Change Type:** modified
**Context:** PR #17077: core(matrix): Negative values checks

**Code Changes:**
```diff
@@ -947,7 +947,7 @@ bool _InputArray::isContinuous(int i) const
     if( k == STD_ARRAY_MAT )
     {
         const Mat* vv = (const Mat*)obj;
-        CV_Assert(i > 0 && i < sz.height);
+        CV_Assert(i >= 0 && i < sz.height);
         return vv[i].isContinuous();
     }
 
@@ -981,21 +981,21 @@ bool _InputArray::isSubmatrix(int i) const
```

Review comment:
Why >= somewhere and > here?
**File:** modules/core/src/matrix_wrap.cpp
**Change Type:** modified
**Context:** PR #17077: core(matrix): Negative values checks

**Code Changes:**
```diff
@@ -947,7 +947,7 @@ bool _InputArray::isContinuous(int i) const
     if( k == STD_ARRAY_MAT )
     {
         const Mat* vv = (const Mat*)obj;
-        CV_Assert(i > 0 && i < sz.height);
+        CV_Assert(i >= 0 && i < sz.height);
         return vv[i].isContinuous();
     }
 
@@ -981,21 +981,21 @@ bool _InputArray::isSubmatrix(int i) const
```

Review comment:
The same assertion is used also in `_InputArray::isContinuous` for `STD_ARRAY_MAT` case above. I am not sure whether `>` is intentional for `STD_ARRAY_MAT` case or it is a typo. Maybe `>=` should be used in both places?
**File:** modules/core/src/matrix_wrap.cpp
**Change Type:** modified
**Context:** PR #17077: core(matrix): Negative values checks

**Code Changes:**
```diff
@@ -947,7 +947,7 @@ bool _InputArray::isContinuous(int i) const
     if( k == STD_ARRAY_MAT )
     {
         const Mat* vv = (const Mat*)obj;
-        CV_Assert(i > 0 && i < sz.height);
+        CV_Assert(i >= 0 && i < sz.height);
         return vv[i].isContinuous();
     }
 
@@ -981,21 +981,21 @@ bool _InputArray::isSubmatrix(int i) const
```

Review comment:
It is used at several similar places, like in conditional that handles `STD_ARRAY_MAT`. As `step` (and `offset`) are declared with `-1` to be a default value of `i`, my guess, based on [this](https://github.com/opencv/opencv/blob/3.4.10/modules/core/src/matmul.dispatch.cpp#L83), is that `if ( i < 0 ) return 1;` is preferred over assertion to prevent `mat.step()` and `mat.offset()` calls from failing.
**File:** modules/core/src/matrix_wrap.cpp
**Change Type:** modified
**Context:** PR #17077: core(matrix): Negative values checks

**Code Changes:**
```diff
@@ -947,7 +947,7 @@ bool _InputArray::isContinuous(int i) const
     if( k == STD_ARRAY_MAT )
     {
         const Mat* vv = (const Mat*)obj;
-        CV_Assert(i > 0 && i < sz.height);
+        CV_Assert(i >= 0 && i < sz.height);
         return vv[i].isContinuous();
     }
 
@@ -981,21 +981,21 @@ bool _InputArray::isSubmatrix(int i) const
```

Review comment:
maybe, it should be `sizeof(cuda::GpuMat>)`?
**File:** modules/core/src/matrix_wrap.cpp
**Change Type:** modified
**Context:** PR #17077: core(matrix): Negative values checks

**Code Changes:**
```diff
@@ -947,7 +947,7 @@ bool _InputArray::isContinuous(int i) const
     if( k == STD_ARRAY_MAT )
     {
         const Mat* vv = (const Mat*)obj;
-        CV_Assert(i > 0 && i < sz.height);
+        CV_Assert(i >= 0 && i < sz.height);
         return vv[i].isContinuous();
     }
 
@@ -981,21 +981,21 @@ bool _InputArray::isSubmatrix(int i) const
```

Review comment:
Why is 1 here for offset? What is logic here? I know that this is a copy-paste, but we should not copy mistakes. IMHO we should ban this method call with negative argument value (through `CV_Assert()`).
**File:** modules/core/src/matrix_wrap.cpp
**Change Type:** modified
**Context:** PR #17077: core(matrix): Negative values checks
**Review Line:** 984

**Code Changes:**
```diff
@@ -981,21 +981,21 @@ bool _InputArray::isSubmatrix(int i) const
     if( k == STD_VECTOR_MAT )
     {
         const std::vector<Mat>& vv = *(const std::vector<Mat>*)obj;
-        CV_Assert((size_t)i < vv.size());
+        CV_Assert(i >= 0 && (size_t)i < vv.size());
         return vv[i].isSubmatrix();
     }
 
     if( k == STD_ARRAY_MAT )
     {
```

Review comment:
Oh, ok. Should I revert it than and write a note to comment?
**File:** modules/core/src/matrix_wrap.cpp
**Change Type:** modified
**Context:** PR #17077: core(matrix): Negative values checks
**Review Line:** 984

**Code Changes:**
```diff
@@ -981,21 +981,21 @@ bool _InputArray::isSubmatrix(int i) const
     if( k == STD_VECTOR_MAT )
     {
         const std::vector<Mat>& vv = *(const std::vector<Mat>*)obj;
-        CV_Assert((size_t)i < vv.size());
+        CV_Assert(i >= 0 && (size_t)i < vv.size());
         return vv[i].isSubmatrix();
     }
 
     if( k == STD_ARRAY_MAT )
     {
```

Review comment:
I believe we can keep this as is.
**File:** modules/core/src/matrix_wrap.cpp
**Change Type:** modified
**Context:** PR #17077: core(matrix): Negative values checks

**Code Changes:**
```diff
@@ -947,7 +947,7 @@ bool _InputArray::isContinuous(int i) const
     if( k == STD_ARRAY_MAT )
     {
         const Mat* vv = (const Mat*)obj;
-        CV_Assert(i > 0 && i < sz.height);
+        CV_Assert(i >= 0 && i < sz.height);
         return vv[i].isContinuous();
     }
 
@@ -981,21 +981,21 @@ bool _InputArray::isSubmatrix(int i) const
```

Review comment:
> Why is 1 here for offset? What is logic here? I tried to find some design documents about `_InputArray`, but without success. > I know that this is a copy-paste, but we should not copy mistakes. > > IMHO we should ban this method call with negative argument value (through `CV_Assert()`). Agree. The current behavior is a bit inconsistent (some kind of matrices raise an error and some return 1). I will fix the patch and tests.
**File:** modules/gapi/include/opencv2/gapi/garray.hpp
**Change Type:** modified
**Context:** PR #18762: [G-API] Wrap GArray
**Review Line:** 371

**Code Changes:**
```diff
@@ -368,6 +368,8 @@ template<typename T> class GArray
     detail::GArrayU m_ref;
 };
 
+using GArrayP2f = GArray<cv::Point2f>;
+
 /** @} */
 
 } // namespace cv
```

Review comment:
Can it be defined as shadow?
**File:** modules/gapi/misc/python/pyopencv_gapi.hpp
**Change Type:** modified
**Context:** PR #18762: [G-API] Wrap GArray
**Review Line:** 68

**Code Changes:**
```diff
@@ -47,8 +47,20 @@ static PyObject* from_grunarg(const GRunArg& v)
             const auto& s = util::get<cv::Scalar>(v);
             return pyopencv_from(s);
         }
-
+        case GRunArg::index_of<cv::detail::VectorRef>():
+        {
+            const auto& vref = util::get<cv::detail::VectorRef>(v);
+            switch (vref.getKind())
+            {
+                case cv::detail::OpaqueKind::CV_POINT2F:
+                    return pyopencv_from(vref.rref<cv::Point2f>());
+                default:
+                    PyErr_SetString(PyExc_TypeError, "Unsupported kind for GArray");
+                    return NULL;
```

Review comment:
Is that expected delete?
**File:** modules/gapi/misc/python/test/test_gapi_imgproc.py
**Change Type:** added
**Context:** PR #18762: [G-API] Wrap GArray

**Code Changes:**
```diff
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+
+import numpy as np
+import cv2 as cv
+import os
+
+from tests_common import NewOpenCVTests
+
+
```

Review comment:
Note that this is 1280 rows and 720 columns (perhaps you mentioned `(720, 1280, 3`)
**File:** modules/gapi/include/opencv2/gapi/garray.hpp
**Change Type:** modified
**Context:** PR #18762: [G-API] Wrap GArray
**Review Line:** 371

**Code Changes:**
```diff
@@ -368,6 +368,8 @@ template<typename T> class GArray
     detail::GArrayU m_ref;
 };
 
+using GArrayP2f = GArray<cv::Point2f>;
+
 /** @} */
 
 } // namespace cv
```

Review comment:
No, that symbol should be in libopencv_gapi.so
**File:** modules/gapi/misc/python/pyopencv_gapi.hpp
**Change Type:** modified
**Context:** PR #18762: [G-API] Wrap GArray
**Review Line:** 68

**Code Changes:**
```diff
@@ -47,8 +47,20 @@ static PyObject* from_grunarg(const GRunArg& v)
             const auto& s = util::get<cv::Scalar>(v);
             return pyopencv_from(s);
         }
-
+        case GRunArg::index_of<cv::detail::VectorRef>():
+        {
+            const auto& vref = util::get<cv::detail::VectorRef>(v);
+            switch (vref.getKind())
+            {
+                case cv::detail::OpaqueKind::CV_POINT2F:
+                    return pyopencv_from(vref.rref<cv::Point2f>());
+                default:
+                    PyErr_SetString(PyExc_TypeError, "Unsupported kind for GArray");
+                    return NULL;
```

Review comment:
Yes, I put this check above
**File:** modules/gapi/misc/python/test/test_gapi_imgproc.py
**Change Type:** added
**Context:** PR #18762: [G-API] Wrap GArray

**Code Changes:**
```diff
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+
+import numpy as np
+import cv2 as cv
+import os
+
+from tests_common import NewOpenCVTests
+
+
```

Review comment:
indentation is strange here (use 4 spaces)
**File:** modules/gapi/misc/python/test/test_gapi_imgproc.py
**Change Type:** added
**Context:** PR #18762: [G-API] Wrap GArray

**Code Changes:**
```diff
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+
+import numpy as np
+import cv2 as cv
+import os
+
+from tests_common import NewOpenCVTests
+
+
```

Review comment:
> np.random - input is not determined (no way to reproduce failed test) - we don't want sporadic failures. - it is better to use some image instead (or draw it)