nareshmlx/opencv-pr huggingface dataset:
**File:** modules/gapi/include/opencv2/gapi/video.hpp
**Change Type:** modified
**Context:** PR #18674: GAPI: New BackgroundSubtractor stateful kernel - New BackgroundSubtractor kernel represents 2 types of operation such as: - Background Subt...

**Code Changes:**
```diff
@@ -62,6 +62,73 @@ G_TYPED_KERNEL(GCalcOptFlowLKForPyr,
         return std::make_tuple(empty_array_desc(), empty_array_desc(), empty_array_desc());
     }
 };
+
+enum BackgroundSubtractorType
+{
+    TYPE_BS_MOG2,
+    TYPE_BS_KNN
+};
```

Review comment:
I think this can be removed if there are no links
**File:** modules/gapi/include/opencv2/gapi/video.hpp
**Change Type:** modified
**Context:** PR #18674: GAPI: New BackgroundSubtractor stateful kernel - New BackgroundSubtractor kernel represents 2 types of operation such as: - Background Subt...
**Review Line:** 114

**Code Changes:**
```diff
+    speed a bit, so if you do not need this feature, set the parameter to false.
+    @param lRate The value between 0 and 1 that indicates how fast the background model is learnt.
+    Negative parameter value makes the algorithm to use some automatically chosen learning rate.
+    */
+    BackgroundSubtractorParams(BackgroundSubtractorType op, int histLength,
+                               double thrshld, bool detect, double lRate) : operation(op),
+                                                                            history(histLength),
+                                                                            threshold(thrshld),
+                                                                            detectShadows(detect),
+                                                                            learningRate(lRate){}
+};
```

Review comment:
BTW, "const" is not necessary for parameters with regular scalar (or enum) type.
**File:** modules/gapi/test/common/gapi_video_tests_common.hpp
**Change Type:** modified
**Context:** PR #18674: GAPI: New BackgroundSubtractor stateful kernel - New BackgroundSubtractor kernel represents 2 types of operation such as: - Background Subt...

**Code Changes:**
```diff
@@ -321,6 +321,35 @@ inline GComputation runOCVnGAPIOptFlowPipeline(TestFunctional& testInst,
     return c;
 }
 
+inline void testBackgroundSubtractorStreaming(cv::GStreamingCompiled& gapiBackSub,
+                                              const cv::Ptr<cv::BackgroundSubtractor>& pOCVBackSub,
+                                              const int diffPercent, const int tolerance,
+                                              const double lRate, const std::size_t testNumFrames)
+{
+    cv::Mat frame, gapiForeground, ocvForeground;
```

Review comment:
This comment for gapiBackSub?
**File:** modules/gapi/include/opencv2/gapi/video.hpp
**Change Type:** modified
**Context:** PR #18674: GAPI: New BackgroundSubtractor stateful kernel - New BackgroundSubtractor kernel represents 2 types of operation such as: - Background Subt...

**Code Changes:**
```diff
@@ -62,6 +62,73 @@ G_TYPED_KERNEL(GCalcOptFlowLKForPyr,
         return std::make_tuple(empty_array_desc(), empty_array_desc(), empty_array_desc());
     }
 };
+
+enum BackgroundSubtractorType
+{
+    TYPE_BS_MOG2,
+    TYPE_BS_KNN
+};
```

Review comment:
I see that you took the description from `opencv_video` Nevertheless, `makes` should be without `to` here. This is 100% `makes the algorithm use`
**File:** modules/gapi/test/common/gapi_video_tests_inl.hpp
**Change Type:** modified
**Context:** PR #18674: GAPI: New BackgroundSubtractor stateful kernel - New BackgroundSubtractor kernel represents 2 types of operation such as: - Background Subt...

**Code Changes:**
```diff
@@ -8,6 +8,7 @@
 #define OPENCV_GAPI_VIDEO_TESTS_INL_HPP
 
 #include "gapi_video_tests.hpp"
+#include <opencv2/gapi/streaming/cap.hpp>
 
 namespace opencv_test
 {
@@ -88,6 +89,49 @@ TEST_P(BuildPyr_CalcOptFlow_PipelineTest, AccuracyTest)
     compareOutputsOptFlow(outOCV, outGAPI);
```

Review comment:
I agree that you have to use `tuple` here as threshold depends on subtractor's type. But it is better to predefine two variables and then use `std::tie()` instead of using `std::get<>` I mean, ``` cv::gapi::video::BackgroundSubtractorType opType = -1; double threshold = -1; std::tie(opType, threshold) = typeAndThreshold; ```
**File:** modules/gapi/test/common/gapi_video_tests_common.hpp
**Change Type:** modified
**Context:** PR #18674: GAPI: New BackgroundSubtractor stateful kernel - New BackgroundSubtractor kernel represents 2 types of operation such as: - Background Subt...

**Code Changes:**
```diff
@@ -321,6 +321,35 @@ inline GComputation runOCVnGAPIOptFlowPipeline(TestFunctional& testInst,
     return c;
 }
 
+inline void testBackgroundSubtractorStreaming(cv::GStreamingCompiled& gapiBackSub,
+                                              const cv::Ptr<cv::BackgroundSubtractor>& pOCVBackSub,
+                                              const int diffPercent, const int tolerance,
+                                              const double lRate, const std::size_t testNumFrames)
+{
+    cv::Mat frame, gapiForeground, ocvForeground;
```

Review comment:
`const cv::Ptr<cv::BackgroundSubtractor>& pOCVBackSub`
**File:** modules/gapi/include/opencv2/gapi/video.hpp
**Change Type:** modified
**Context:** PR #18674: GAPI: New BackgroundSubtractor stateful kernel - New BackgroundSubtractor kernel represents 2 types of operation such as: - Background Subt...

**Code Changes:**
```diff
@@ -62,6 +62,73 @@ G_TYPED_KERNEL(GCalcOptFlowLKForPyr,
         return std::make_tuple(empty_array_desc(), empty_array_desc(), empty_array_desc());
     }
 };
+
+enum BackgroundSubtractorType
+{
+    TYPE_BS_MOG2,
+    TYPE_BS_KNN
+};
```

Review comment:
avoid indentation in namespaces
**File:** modules/gapi/include/opencv2/gapi/video.hpp
**Change Type:** modified
**Context:** PR #18674: GAPI: New BackgroundSubtractor stateful kernel - New BackgroundSubtractor kernel represents 2 types of operation such as: - Background Subt...

**Code Changes:**
```diff
@@ -62,6 +62,73 @@ G_TYPED_KERNEL(GCalcOptFlowLKForPyr,
         return std::make_tuple(empty_array_desc(), empty_array_desc(), empty_array_desc());
     }
 };
+
+enum BackgroundSubtractorType
+{
+    TYPE_BS_MOG2,
+    TYPE_BS_KNN
+};
```

Review comment:
It is better to keep multi-line comments before declaration to avoid excessive indentations.
**File:** modules/gapi/include/opencv2/gapi/video.hpp
**Change Type:** modified
**Context:** PR #18674: GAPI: New BackgroundSubtractor stateful kernel - New BackgroundSubtractor kernel represents 2 types of operation such as: - Background Subt...

**Code Changes:**
```diff
@@ -62,6 +62,73 @@ G_TYPED_KERNEL(GCalcOptFlowLKForPyr,
         return std::make_tuple(empty_array_desc(), empty_array_desc(), empty_array_desc());
     }
 };
+
+enum BackgroundSubtractorType
+{
+    TYPE_BS_MOG2,
+    TYPE_BS_KNN
+};
```

Review comment:
> misinterpreted the comments > `//!<` Please learn how to use doxygen comments: https://www.doxygen.nl/manual/docblocks.html
**File:** modules/gapi/include/opencv2/gapi/video.hpp
**Change Type:** modified
**Context:** PR #18674: GAPI: New BackgroundSubtractor stateful kernel - New BackgroundSubtractor kernel represents 2 types of operation such as: - Background Subt...

**Code Changes:**
```diff
@@ -62,6 +62,73 @@ G_TYPED_KERNEL(GCalcOptFlowLKForPyr,
         return std::make_tuple(empty_array_desc(), empty_array_desc(), empty_array_desc());
     }
 };
+
+enum BackgroundSubtractorType
+{
+    TYPE_BS_MOG2,
+    TYPE_BS_KNN
+};
```

Review comment:
`learningRate` word here isn't required if you have another iteration, please remove
**File:** doc/tutorials/videoio/orbbec-astra/orbbec_astra.markdown
**Change Type:** added
**Context:** PR #18854: Add tutorial on how to use Orbbec Astra 3D cameras

**Code Changes:**
```diff
@@ -0,0 +1,150 @@
+Using Orbbec Astra 3D cameras {#tutorial_orbbec_astra}
+======================================================
+
+@prev_tutorial{tutorial_kinect_openni}
+@next_tutorial{tutorial_intelperc}
+
+
+### Introduction
+
```

Review comment:
> .webp Please stay conservative and use JPEG / PNG formats instead at least in "docs" area. > +430 KB Hi-res images are usually not needed for tutorial pages. - use lower resolution - use lower quality for JPEG encoder (80 is usually good enough) BTW, General rule is stay up to 150 Kb per image.
**File:** samples/cpp/tutorial_code/videoio/orbbec_astra/orbbec_astra.cpp
**Change Type:** added
**Context:** PR #18854: Add tutorial on how to use Orbbec Astra 3D cameras

**Code Changes:**
```diff
@@ -0,0 +1,195 @@
+#include <opencv2/videoio/videoio.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/imgproc.hpp>
+
+#include <list>
+#include <iostream>
+#include <thread>
+#include <mutex>
+#include <condition_variable>
```

Review comment:
Please split this line
**File:** samples/cpp/tutorial_code/videoio/orbbec_astra/orbbec_astra.cpp
**Change Type:** added
**Context:** PR #18854: Add tutorial on how to use Orbbec Astra 3D cameras
**Review Line:** 150

**Code Changes:**
```diff
+            dataReady.wait(lk);
+
+        depthFramesMtx.lock();
+        if (depthFrames.empty())
+        {
+            depthFramesMtx.unlock();
+        }
+        else
+        {
+            // Get a frame from the list
+            Mat depthMap = depthFrames.front().frame;
```

Review comment:
How this can happen after a `while()` pre-check above? Half-answer: why do we need 3 different mutexes?
**File:** samples/cpp/tutorial_code/videoio/orbbec_astra/orbbec_astra.cpp
**Change Type:** added
**Context:** PR #18854: Add tutorial on how to use Orbbec Astra 3D cameras
**Review Line:** 180

**Code Changes:**
```diff
+            Mat colorFrame = colorFrames.front().frame;
+            colorFrames.pop_front();
+            colorFramesMtx.unlock();
+
+            // Show color frame
+            imshow("Color", colorFrame);
+        }
+        //! [Show color frame]
+
+        // Exit on Esc key press
+        int key = waitKey(1);
```

Review comment:
This sample processes color/depth streams independently. It is not a common flow for such applications. They usually has some function like `process(colorFrame, depthMap)` which takes data from both streams. There is no way to call processing with just one data frame. Current "if"s logic above doesn't care about that and processes streams independently and optionally.
**File:** doc/tutorials/videoio/orbbec-astra/orbbec_astra.markdown
**Change Type:** added
**Context:** PR #18854: Add tutorial on how to use Orbbec Astra 3D cameras

**Code Changes:**
```diff
@@ -0,0 +1,150 @@
+Using Orbbec Astra 3D cameras {#tutorial_orbbec_astra}
+======================================================
+
+@prev_tutorial{tutorial_kinect_openni}
+@next_tutorial{tutorial_intelperc}
+
+
+### Introduction
+
```

Review comment:
Is there any particular reason to avoid using webp? It is [supported in all browsers](https://caniuse.com/webp) except KalOS browser. I picked webp because it's much smaller than png in lossless mode.
**File:** samples/cpp/tutorial_code/videoio/orbbec_astra/orbbec_astra.cpp
**Change Type:** added
**Context:** PR #18854: Add tutorial on how to use Orbbec Astra 3D cameras
**Review Line:** 150

**Code Changes:**
```diff
+            dataReady.wait(lk);
+
+        depthFramesMtx.lock();
+        if (depthFrames.empty())
+        {
+            depthFramesMtx.unlock();
+        }
+        else
+        {
+            // Get a frame from the list
+            Mat depthMap = depthFrames.front().frame;
```

Review comment:
The condition in the while() loop is true only when both lists are empty, so one of the lists can be empty here.
**File:** samples/cpp/tutorial_code/videoio/orbbec_astra/orbbec_astra.cpp
**Change Type:** added
**Context:** PR #18854: Add tutorial on how to use Orbbec Astra 3D cameras
**Review Line:** 180

**Code Changes:**
```diff
+            Mat colorFrame = colorFrames.front().frame;
+            colorFrames.pop_front();
+            colorFramesMtx.unlock();
+
+            // Show color frame
+            imshow("Color", colorFrame);
+        }
+        //! [Show color frame]
+
+        // Exit on Esc key press
+        int key = waitKey(1);
```

Review comment:
Indeed some post-processing is required to sync two streams. It will be implemented later, I guess. This topic is out of scope for now.
**File:** doc/tutorials/videoio/orbbec-astra/orbbec_astra.markdown
**Change Type:** added
**Context:** PR #18854: Add tutorial on how to use Orbbec Astra 3D cameras

**Code Changes:**
```diff
@@ -0,0 +1,150 @@
+Using Orbbec Astra 3D cameras {#tutorial_orbbec_astra}
+======================================================
+
+@prev_tutorial{tutorial_kinect_openni}
+@next_tutorial{tutorial_intelperc}
+
+
+### Introduction
+
```

Review comment:
WebP still has low adoption in tools. At least, GitHub PR review tool doesn't support that format.
**File:** doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown
**Change Type:** modified
**Context:** PR #17839: Update tutorial for erosion / dilation

**Code Changes:**
```diff
@@ -84,57 +84,198 @@ This tutorial's code is shown below. You can also download it
 Explanation
 -----------
 
--#  Most of the material shown here is trivial (if you have any doubt, please refer to the tutorials in
-    previous sections). Let's check the general structure of the C++ program:
+@add_toggle_cpp
+Most of the material shown here is trivial (if you have any doubt, please refer to the tutorials in
+previous sections). Let's check the general structure of the C++ program:
+
```

Review comment:
Not sure that function's tutorial is a right section for Python troubleshooting (both are about misused OpenCV version - samples assume OpenCV binaries from the same version and for right Python version)
**File:** modules/highgui/include/opencv2/highgui.hpp
**Change Type:** modified
**Context:** PR #18675: Documentation Improvement - documentation improvement ready to review ``` force_builders_only=docs ```

**Code Changes:**
```diff
@@ -66,6 +66,7 @@ It provides easy interface to:
 -   Add trackbars to the windows, handle simple mouse events as well as keyboard commands.
 
 @{
+    @defgroup highgui_window_flags Flags related creating and manipulating HighGUI windows and mouse events
     @defgroup highgui_opengl OpenGL support
     @defgroup highgui_qt Qt New Functions
 
@@ -93,7 +94,7 @@ It provides easy interface to:
 
```

Review comment:
Would change to "...select multiple ROIs..."
**File:** modules/gapi/src/executor/gapi_itt.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor
**Review Line:** 16

**Code Changes:**
```diff
+#include <type_traits>
+#include <memory>
+
+// FIXME: It seems that this macro is not propagated here by the OpenCV cmake (as this is not core module).
+// (Consider using OpenCV's trace.hpp )
+#ifdef OPENCV_WITH_ITT
+#include <ittnotify.h>
+#endif
+
+#include <opencv2/gapi/util/compiler_hints.hpp>
+namespace cv {
```

Review comment:
This macro is not propagated to other modules except opencv_core
**File:** modules/gapi/src/executor/gapi_itt.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor

**Code Changes:**
```diff
@@ -0,0 +1,59 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2020 Intel Corporation
+
+#ifndef OPENCV_GAPI_GAPI_ITT_HPP
+#define OPENCV_GAPI_GAPI_ITT_HPP
+
```

Review comment:
Be careful with definition macros with `ITT_` prefixes. Consider using of `GAPI_ITT_` prefix or similar instead.
**File:** modules/gapi/src/executor/gapi_itt.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor
**Review Line:** 16

**Code Changes:**
```diff
+#include <type_traits>
+#include <memory>
+
+// FIXME: It seems that this macro is not propagated here by the OpenCV cmake (as this is not core module).
+// (Consider using OpenCV's trace.hpp )
+#ifdef OPENCV_WITH_ITT
+#include <ittnotify.h>
+#endif
+
+#include <opencv2/gapi/util/compiler_hints.hpp>
+namespace cv {
```

Review comment:
Hmmm.... So what is the right way to check for ITT here then ?
**File:** modules/gapi/CMakeLists.txt
**Change Type:** modified
**Context:** PR #17851: Sole tbb executor

**Code Changes:**
```diff
@@ -102,6 +102,7 @@ set(gapi_srcs
 
     # Executor
     src/executor/gexecutor.cpp
+    src/executor/gtbbexecutor.cpp
     src/executor/gstreamingexecutor.cpp
     src/executor/gasync.cpp
 
@@ -187,6 +188,10 @@ if(TARGET opencv_test_gapi)
   target_link_libraries(opencv_test_gapi PRIVATE ade)
```

Review comment:
Everything here is `gapi`, so I'd recommend renaming it to `gtbbexecutor`
**File:** modules/gapi/src/executor/gapi_itt.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor
**Review Line:** 7

**Code Changes:**
```diff
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2020 Intel Corporation
+
+#ifndef OPENCV_GAPI_GAPI_ITT_HPP
+#define OPENCV_GAPI_GAPI_ITT_HPP
+
+//for ITT_NAMED_TRACE_GUARD
+#include <type_traits>
+#include <memory>
```

Review comment:
Should ITT be part of the `/executor`? maybe move it to `backends/common`?
**File:** modules/gapi/src/executor/gapi_itt.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor
**Review Line:** 36

**Code Changes:**
```diff
+        return {p, std::forward<D>(d)};
+    }
+}  // namespace util
+
+// FIXME: make it more reusable (and move to other place and other namespace)
+namespace gimpl { namespace parallel {
+    #ifdef OPENCV_WITH_ITT
+    extern const __itt_domain* gapi_itt_domain;
+
+    namespace {
+        auto make_itt_guard = [](__itt_string_handle* h) {
```

Review comment:
Though it has nothing with parallelism, right? :)
**File:** modules/gapi/src/executor/gapi_itt.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor
**Review Line:** 16

**Code Changes:**
```diff
+#include <type_traits>
+#include <memory>
+
+// FIXME: It seems that this macro is not propagated here by the OpenCV cmake (as this is not core module).
+// (Consider using OpenCV's trace.hpp )
+#ifdef OPENCV_WITH_ITT
+#include <ittnotify.h>
+#endif
+
+#include <opencv2/gapi/util/compiler_hints.hpp>
+namespace cv {
```

Review comment:
The right way is reusing OpenCV's trace.hpp functionality for profiling purposes.
**File:** modules/gapi/src/executor/gapi_itt.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor
**Review Line:** 7

**Code Changes:**
```diff
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2020 Intel Corporation
+
+#ifndef OPENCV_GAPI_GAPI_ITT_HPP
+#define OPENCV_GAPI_GAPI_ITT_HPP
+
+//for ITT_NAMED_TRACE_GUARD
+#include <type_traits>
+#include <memory>
```

Review comment:
added a FIXME
**File:** modules/gapi/src/executor/gapi_itt.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor
**Review Line:** 36

**Code Changes:**
```diff
+        return {p, std::forward<D>(d)};
+    }
+}  // namespace util
+
+// FIXME: make it more reusable (and move to other place and other namespace)
+namespace gimpl { namespace parallel {
+    #ifdef OPENCV_WITH_ITT
+    extern const __itt_domain* gapi_itt_domain;
+
+    namespace {
+        auto make_itt_guard = [](__itt_string_handle* h) {
```

Review comment:
You are right :) added a FIXME
**File:** modules/gapi/src/executor/gapi_itt.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor

**Code Changes:**
```diff
@@ -0,0 +1,59 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2020 Intel Corporation
+
+#ifndef OPENCV_GAPI_GAPI_ITT_HPP
+#define OPENCV_GAPI_GAPI_ITT_HPP
+
```

Review comment:
changed prefix to `GAPI_ITT`
**File:** modules/gapi/src/executor/gapi_itt.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor
**Review Line:** 16

**Code Changes:**
```diff
+#include <type_traits>
+#include <memory>
+
+// FIXME: It seems that this macro is not propagated here by the OpenCV cmake (as this is not core module).
+// (Consider using OpenCV's trace.hpp )
+#ifdef OPENCV_WITH_ITT
+#include <ittnotify.h>
+#endif
+
+#include <opencv2/gapi/util/compiler_hints.hpp>
+namespace cv {
```

Review comment:
added a FIXME
**File:** modules/gapi/include/opencv2/gapi/util/copy_through_move.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor
**Review Line:** 21

**Code Changes:**
```diff
+    //This is a tool to move initialize captures of a lambda in C++11
+    template<typename T>
+    struct copy_through_move_t{
+       T value;
+       const T& get() const {return value;}
+       T&       get()       {return value;}
+       copy_through_move_t(T&& g) : value(std::move(g)) {}
+       copy_through_move_t(copy_through_move_t&&) = default;
+       copy_through_move_t(copy_through_move_t const& lhs) : copy_through_move_t(std::move(const_cast<copy_through_move_t&>(lhs))) {}
+    };
+
```

Review comment:
So why is one of this `get()` method `const` and other is not? As I see they both don't change the struct. Or it's non-const because `value` can be modified, not by the method, but after returning it outside?
**File:** modules/gapi/include/opencv2/gapi/own/assert.hpp
**Change Type:** modified
**Context:** PR #17851: Sole tbb executor
**Review Line:** 8

**Code Changes:**
```diff
 //
-// Copyright (C) 2018 Intel Corporation
+// Copyright (C) 2018-2020 Intel Corporation
 
 
 #ifndef OPENCV_GAPI_OWN_ASSERT_HPP
 #define OPENCV_GAPI_OWN_ASSERT_HPP
 
+#include <opencv2/gapi/util/compiler_hints.hpp>
+
+#define GAPI_DbgAssertNoOp(expr) {                  \
```

Review comment:
Would you change the year at the top of the file?
**File:** modules/gapi/src/executor/gapi_itt.hpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor
**Review Line:** 59

**Code Changes:**
```diff
+    #define GAPI_ITT_AUTO_TRACE_GUARD_IMPL(LINE, h)         GAPI_ITT_AUTO_TRACE_GUARD_IMPL_(LINE, h)
+    #define GAPI_ITT_AUTO_TRACE_GUARD(h)                    GAPI_ITT_AUTO_TRACE_GUARD_IMPL(__LINE__, h)
+}} //gimpl::parallel
+}  //namespace cv
+
+#endif /* OPENCV_GAPI_GAPI_ITT_HPP */
```

Review comment:
Too many empty lines :)
**File:** modules/gapi/src/executor/gtbbexecutor.cpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor

**Code Changes:**
```diff
@@ -0,0 +1,445 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2020 Intel Corporation
+
+#include "gtbbexecutor.hpp"
+
+#if defined(HAVE_TBB)
```

Review comment:
A very minor suggestion - would it be more logical to have `no=0`, `yes=1`? I mean, to swap them, put `no` before `yes`. If it doesn't require a lot of changes after, of course
**File:** modules/gapi/src/executor/gtbbexecutor.cpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor

**Code Changes:**
```diff
@@ -0,0 +1,445 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2020 Intel Corporation
+
+#include "gtbbexecutor.hpp"
+
+#if defined(HAVE_TBB)
```

Review comment:
I suggest to `poped` -> `popped`
**File:** modules/gapi/src/executor/gtbbexecutor.cpp
**Change Type:** added
**Context:** PR #17851: Sole tbb executor

**Code Changes:**
```diff
@@ -0,0 +1,445 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2020 Intel Corporation
+
+#include "gtbbexecutor.hpp"
+
+#if defined(HAVE_TBB)
```

Review comment:
Typo? Is `then` leaved by design?