nareshmlx/opencv-pr huggingface dataset:
**File:** samples/cpp/facedetect.cpp
**Change Type:** modified
**Context:** PR #9526: improvement on documentation - related issue : #9520 i want to add some more link in [examples page](http://docs.opencv.org/master/examples....

**Code Changes:**
```diff
@@ -8,7 +8,7 @@ using namespace cv;
 
 static void help()
 {
-    cout << "\nThis program demonstrates the cascade recognizer. Now you can use Haar or LBP features.\n"
+    cout << "\nThis program demonstrates the use of cv::CascadeClassifier class to detect objects (Face + eyes). You can use Haar or LBP features.\n"
             "This classifier can recognize many kinds of rigid objects, once the appropriate classifier is trained.\n"
             "It's most known use is for faces.\n"
             "Usage:\n"
```

Review comment:
using =&gt; the use of
**File:** samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp
**Change Type:** modified
**Context:** PR #9526: improvement on documentation - related issue : #9520 i want to add some more link in [examples page](http://docs.opencv.org/master/examples....

**Code Changes:**
```diff
@@ -1,77 +1,117 @@
 /**
  * @file Sobel_Demo.cpp
- * @brief Sample code using Sobel and/or Scharr OpenCV functions to make a simple Edge Detector
+ * @brief Sample code uses Sobel or Scharr OpenCV functions for edge detection
  * @author OpenCV team
  */
 
 #include "opencv2/imgproc.hpp"
 #include "opencv2/imgcodecs.hpp"
```

Review comment:
The sample uses Sobel or Scharr OpenCV functions for edge detection
**File:** modules/objdetect/src/cascadedetect.cpp
**Change Type:** modified
**Context:** PR #9600: fixing issue 9583 - issue in cascadeclassifier code clipObjects

**Code Changes:**
```diff
@@ -1666,7 +1666,7 @@ void clipObjects(Size sz, std::vector<Rect>& objects,
     for( i = 0; i < n; i++ )
     {
         Rect r = win0 & objects[i];
-        if( r.area() > 0 )
+        if( !r.empty() )
         {
             objects[j] = r;
             if( i > j )
```

Review comment:
Condition should be `!r.empty()` (we need non-empty rectangles)
**File:** modules/objdetect/src/cascadedetect.cpp
**Change Type:** modified
**Context:** PR #9600: fixing issue 9583 - issue in cascadeclassifier code clipObjects

**Code Changes:**
```diff
@@ -1666,7 +1666,7 @@ void clipObjects(Size sz, std::vector<Rect>& objects,
     for( i = 0; i < n; i++ )
     {
         Rect r = win0 & objects[i];
-        if( r.area() > 0 )
+        if( !r.empty() )
         {
             objects[j] = r;
             if( i > j )
```

Review comment:
I will fix it this afternoon... Simpky a bad copy paste 😀
**File:** modules/objdetect/src/cascadedetect.cpp
**Change Type:** modified
**Context:** PR #9600: fixing issue 9583 - issue in cascadeclassifier code clipObjects

**Code Changes:**
```diff
@@ -1666,7 +1666,7 @@ void clipObjects(Size sz, std::vector<Rect>& objects,
     for( i = 0; i < n; i++ )
     {
         Rect r = win0 & objects[i];
-        if( r.area() > 0 )
+        if( !r.empty() )
         {
             objects[j] = r;
             if( i > j )
```

Review comment:
` > 0` is not needed here
**File:** modules/objdetect/src/cascadedetect.cpp
**Change Type:** modified
**Context:** PR #9600: fixing issue 9583 - issue in cascadeclassifier code clipObjects

**Code Changes:**
```diff
@@ -1666,7 +1666,7 @@ void clipObjects(Size sz, std::vector<Rect>& objects,
     for( i = 0; i < n; i++ )
     {
         Rect r = win0 & objects[i];
-        if( r.area() > 0 )
+        if( !r.empty() )
         {
             objects[j] = r;
             if( i > j )
```

Review comment:
Oops fix on it's way!
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #9374: Lab tests: bit-exactness and other fixes - ### This pullrequest changes * Lab2RGB_b: - bit-exactness enabled for all modes - Non-vectorized ...
**Review Line:** 6777

**Code Changes:**
```diff
         int adiv, bdiv;
-        adiv = aa*BASE/500 - 128*BASE/500, bdiv = bb*BASE/200 - 128*BASE/200;
+        //adiv = aa*BASE/500 - 128*BASE/500, bdiv = bb*BASE/200 - 128*BASE/200;
+        //approximations with reasonable precision
+        adiv = ((5*aa*53687 + (1 << 7)) >> 13) - 128*BASE/500;
+        bdiv = ((  bb*41943 + (1 << 4)) >>  9) - 128*BASE/200+1;
 
         int ifxz[] = {ify + adiv, ify - bdiv};
 
@@ -7104,8 +7107,6 @@ struct Lab2RGB_b
                const float* _whitept, bool _srgb )
```

Review comment:
Looks like these code lines are not equal to their comments. `adiv = aa*BASE/500 - 128*BASE/500` ==> `adiv = (aa-128)*BASE/500` ?
**File:** modules/imgproc/test/test_color.cpp
**Change Type:** modified
**Context:** PR #9374: Lab tests: bit-exactness and other fixes - ### This pullrequest changes * Lab2RGB_b: - bit-exactness enabled for all modes - Non-vectorized ...

**Code Changes:**
```diff
@@ -79,6 +79,7 @@ class CV_ColorCvtBaseTest : public cvtest::ArrayTest
     int fwd_code, inv_code;
     bool test_cpp;
     int hue_range;
+    bool srgb;
 };
 
 
@@ -100,6 +101,7 @@ CV_ColorCvtBaseTest::CV_ColorCvtBaseTest( bool _custom_inv_transform, bool _allo
     test_cpp = false;
```

Review comment:
We should dump information about mode, iteration, actual hash - at least to make updates of hash table above.
**File:** modules/imgproc/test/test_color.cpp
**Change Type:** modified
**Context:** PR #9374: Lab tests: bit-exactness and other fixes - ### This pullrequest changes * Lab2RGB_b: - bit-exactness enabled for all modes - Non-vectorized ...

**Code Changes:**
```diff
@@ -79,6 +79,7 @@ class CV_ColorCvtBaseTest : public cvtest::ArrayTest
     int fwd_code, inv_code;
     bool test_cpp;
     int hue_range;
+    bool srgb;
 };
 
 
@@ -100,6 +101,7 @@ CV_ColorCvtBaseTest::CV_ColorCvtBaseTest( bool _custom_inv_transform, bool _allo
     test_cpp = false;
```

Review comment:
Using of "ts" is deprecated. You should use GTest `FAIL() << message` form.
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #9374: Lab tests: bit-exactness and other fixes - ### This pullrequest changes * Lab2RGB_b: - bit-exactness enabled for all modes - Non-vectorized ...
**Review Line:** 6777

**Code Changes:**
```diff
         int adiv, bdiv;
-        adiv = aa*BASE/500 - 128*BASE/500, bdiv = bb*BASE/200 - 128*BASE/200;
+        //adiv = aa*BASE/500 - 128*BASE/500, bdiv = bb*BASE/200 - 128*BASE/200;
+        //approximations with reasonable precision
+        adiv = ((5*aa*53687 + (1 << 7)) >> 13) - 128*BASE/500;
+        bdiv = ((  bb*41943 + (1 << 4)) >>  9) - 128*BASE/200+1;
 
         int ifxz[] = {ify + adiv, ify - bdiv};
 
@@ -7104,8 +7107,6 @@ struct Lab2RGB_b
                const float* _whitept, bool _srgb )
```

Review comment:
The goal was to make non-vectorized code produce the same values as vectorized one. This code is an approximation of the calculation which is done w/o integer division operation since there's no integer division available in SIMD.
**File:** modules/core/include/opencv2/core.hpp
**Change Type:** modified
**Context:** PR #9574: I9482 - resolves #9482 ### This pullrequest changes  Commit messages explain what's been done. Documentation for cv::norm has been slightly ...

**Code Changes:**
```diff
@@ -640,43 +640,50 @@ Scalar_ 's.
 CV_EXPORTS_W void meanStdDev(InputArray src, OutputArray mean, OutputArray stddev,
                              InputArray mask=noArray());
 
-/** @brief Calculates an absolute array norm, an absolute difference norm, or a
-relative difference norm.
-
-The function cv::norm calculates an absolute norm of src1 (when there is no
-src2 ):
-
```

Review comment:
Relative `NORM_L2SQR` is the same as relative `NORM_L2` but squared. All the relative norms are computed as follows: ```c++ if( normType & CV_RELATIVE ) { return norm(_src1, _src2, normType & ~CV_RELATIVE, _mask)/(norm(_src2, normType, _mask) + DBL_EPSILON); } ```
**File:** modules/core/include/opencv2/core/base.hpp
**Change Type:** modified
**Context:** PR #9574: I9482 - resolves #9482 ### This pullrequest changes  Commit messages explain what's been done. Documentation for cv::norm has been slightly ...

**Code Changes:**
```diff
@@ -152,46 +152,57 @@ enum DecompTypes {
 };
 
 /** norm types
-- For one array:
-\f[norm =  \forkthree{\|\texttt{src1}\|_{L_{\infty}} =  \max _I | \texttt{src1} (I)|}{if  \(\texttt{normType} = \texttt{NORM_INF}\) }
-{ \| \texttt{src1} \| _{L_1} =  \sum _I | \texttt{src1} (I)|}{if  \(\texttt{normType} = \texttt{NORM_L1}\) }
-{ \| \texttt{src1} \| _{L_2} =  \sqrt{\sum_I \texttt{src1}(I)^2} }{if  \(\texttt{normType} = \texttt{NORM_L2}\) }\f]
-
-- Absolute norm for two arrays
```

Review comment:
I suggest removing this wrapper to avoid cluttering, maybe this value can be documented: ```.cpp NORM_TYPE_MASK = 7, //!< bit-mask which can be used to separate norm type from norm flags ```
**File:** modules/core/include/opencv2/core/base.hpp
**Change Type:** modified
**Context:** PR #9574: I9482 - resolves #9482 ### This pullrequest changes  Commit messages explain what's been done. Documentation for cv::norm has been slightly ...
**Review Line:** 187

**Code Changes:**
```diff
+                 { \frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}} }{if  \(\texttt{normType} = \texttt{NORM_RELATIVE | NORM_L2}\) }
+                 \f]
+                 */
                  NORM_L2        = 4,
+                 /**
+                 \f[
+                 norm =  \forkthree
+                 { \| \texttt{src1} \| _{L_2} ^{2} = \sum_I \texttt{src1}(I)^2} {if  \(\texttt{normType} = \texttt{NORM_L2SQR}\)}
+                 { \| \texttt{src1} - \texttt{src2} \| _{L_2} ^{2} =  \sum_I (\texttt{src1}(I) - \texttt{src2}(I))^2 }{if  \(\texttt{normType} = \texttt{NORM_L2SQR}\) }
+                 { \left(\frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}}\right)^2 }{if  \(\texttt{normType} = \texttt{NORM_RELATIVE | NORM_L2}\) }
+                 \f]
```

Review comment:
Why did you move this documentation to `norm` function? This enumeration is used in many different places and now users will not be able to see it when they jump here from functions other than `norm`. For example [BFMatcher::BFMatcher](http://docs.opencv.org/3.3.0/d3/da1/classcv_1_1BFMatcher.html#abe0bb11749b30d97f60d6ade665617bd). I even suggest moving each block to corresponding enumeration item.
**File:** modules/core/include/opencv2/core/base.hpp
**Change Type:** modified
**Context:** PR #9574: I9482 - resolves #9482 ### This pullrequest changes  Commit messages explain what's been done. Documentation for cv::norm has been slightly ...
**Review Line:** 187

**Code Changes:**
```diff
+                 { \frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}} }{if  \(\texttt{normType} = \texttt{NORM_RELATIVE | NORM_L2}\) }
+                 \f]
+                 */
                  NORM_L2        = 4,
+                 /**
+                 \f[
+                 norm =  \forkthree
+                 { \| \texttt{src1} \| _{L_2} ^{2} = \sum_I \texttt{src1}(I)^2} {if  \(\texttt{normType} = \texttt{NORM_L2SQR}\)}
+                 { \| \texttt{src1} - \texttt{src2} \| _{L_2} ^{2} =  \sum_I (\texttt{src1}(I) - \texttt{src2}(I))^2 }{if  \(\texttt{normType} = \texttt{NORM_L2SQR}\) }
+                 { \left(\frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}}\right)^2 }{if  \(\texttt{normType} = \texttt{NORM_RELATIVE | NORM_L2}\) }
+                 \f]
```

Review comment:
It seemed very specific to `cv::norm`. My logic was that any other function that takes in `cv::NormTypes` as a parameter could possibly treat usage of `cv::NormTypes` differently and it would be better if individual method's treatment using `cv::NormTypes` parameter could be documented in that function's doc. I agree with your suggestion though, let's just move it all to `cv::NormTypes`. Moving to corresponding enumeration item makes more sense.
**File:** doc/tutorials/core/adding_images/adding_images.markdown
**Change Type:** modified
**Context:** PR #9406: GSoC - Updating Core Tutorials - Using the java Highgui, toggle buttons and other tools to update the Core tutorials. Each commit will conta...
**Review Line:** 13

**Code Changes:**
```diff
 
 In this tutorial you will learn:
 
 -   what is *linear blending* and why it is useful;
--   how to add two images using @ref cv::addWeighted
+-   how to add two images using **addWeighted()**
 
 Theory
 ------
@@ -28,33 +31,83 @@ eh?)
 Source Code
```

Review comment:
personally i prefer cv::addWeighted() instead of **addWeighted()**
**File:** doc/tutorials/core/adding_images/adding_images.markdown
**Change Type:** modified
**Context:** PR #9406: GSoC - Updating Core Tutorials - Using the java Highgui, toggle buttons and other tools to update the Core tutorials. Each commit will conta...
**Review Line:** 77

**Code Changes:**
```diff
+We used the following images: [LinuxLogo.jpg](https://raw.githubusercontent.com/opencv/opencv/master/samples/data/LinuxLogo.jpg) and [WindowsLogo.jpg](https://raw.githubusercontent.com/opencv/opencv/master/samples/data/WindowsLogo.jpg)
+
+@warning Since we are *adding* *src1* and *src2*, they both have to be of the same size
+(width and height) and type.
+
+Now we need to generate the `g(x)` image. For this, the function **addWeighted()** comes quite handy:
+
+@add_toggle_cpp
+@snippet cpp/tutorial_code/core/AddingImages/AddingImages.cpp blend_images
+@end_toggle
 
```

Review comment:
personally i prefer cv::addWeighted() instead of **addWeighted()**
**File:** doc/tutorials/core/adding_images/adding_images.markdown
**Change Type:** modified
**Context:** PR #9406: GSoC - Updating Core Tutorials - Using the java Highgui, toggle buttons and other tools to update the Core tutorials. Each commit will conta...
**Review Line:** 95

**Code Changes:**
```diff
+    dst = np.uint8(alpha*(img1)+beta*(img2))
+\endcode
+@end_toggle
 
-    **warning**
+since **addWeighted()**  produces:
+\f[dst = \alpha \cdot src1 + \beta \cdot src2 + \gamma\f]
+In this case, `gamma` is the argument \f$0.0\f$ in the code above.
 
-    Since we are *adding* *src1* and *src2*, they both have to be of the same size (width and
-    height) and type.
```

Review comment:
personally i prefer cv::addWeighted() instead of **addWeighted()**
**File:** doc/tutorials/core/adding_images/adding_images.markdown
**Change Type:** modified
**Context:** PR #9406: GSoC - Updating Core Tutorials - Using the java Highgui, toggle buttons and other tools to update the Core tutorials. Each commit will conta...
**Review Line:** 13

**Code Changes:**
```diff
 
 In this tutorial you will learn:
 
 -   what is *linear blending* and why it is useful;
--   how to add two images using @ref cv::addWeighted
+-   how to add two images using **addWeighted()**
 
 Theory
 ------
@@ -28,33 +31,83 @@ eh?)
 Source Code
```

Review comment:
I would suggest to add another method ```cpp // addWeighted( src1, alpha, src2, beta, 0.0, dst); dst = alpha * src1 + beta * src2 + 0.0; ``` which is more intuitive and user friendly, as we do not need to remember which function to call.
**File:** samples/python/tutorial_code/core/mat_mask_operations/mat_mask_operations.py
**Change Type:** modified
**Context:** PR #9406: GSoC - Updating Core Tutorials - Using the java Highgui, toggle buttons and other tools to update the Core tutorials. Each commit will conta...

**Code Changes:**
```diff
@@ -1,9 +1,10 @@
+from __future__ import print_function
 import sys
 import time
+
 import numpy as np
 import cv2
 
-
 ## [basic_method]
```

Review comment:
Please add this line to the beginning of file (before any imports): ``` from __future__ import print_function ``` This will allow to remove space after `print` (for Python 2.x)
**File:** samples/python/tutorial_code/core/mat_mask_operations/mat_mask_operations.py
**Change Type:** modified
**Context:** PR #9406: GSoC - Updating Core Tutorials - Using the java Highgui, toggle buttons and other tools to update the Core tutorials. Each commit will conta...

**Code Changes:**
```diff
@@ -1,9 +1,10 @@
+from __future__ import print_function
 import sys
 import time
+
 import numpy as np
 import cv2
 
-
 ## [basic_method]
```

Review comment:
does it also work for Python 3.x?
**File:** modules/core/include/opencv2/core/base.hpp
**Change Type:** modified
**Context:** PR #9293: core: add multi-argument CV_Assert

**Code Changes:**
```diff
@@ -424,7 +424,22 @@ The macros CV_Assert (and CV_DbgAssert(expr)) evaluate the specified expression.
 raise an error (see cv::error). The macro CV_Assert checks the condition in both Debug and Release
 configurations while CV_DbgAssert is only retained in the Debug configuration.
 */
-#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
+
+#define CV_VA_NUM_ARGS_HELPER(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...)    N
+#define CV_VA_NUM_ARGS(...)      CV_VA_NUM_ARGS_HELPER(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
+
+#define CV_Assert_1( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
```

Review comment:
It should be CV_Assert_7.
**File:** modules/core/include/opencv2/core/base.hpp
**Change Type:** modified
**Context:** PR #9293: core: add multi-argument CV_Assert

**Code Changes:**
```diff
@@ -424,7 +424,22 @@ The macros CV_Assert (and CV_DbgAssert(expr)) evaluate the specified expression.
 raise an error (see cv::error). The macro CV_Assert checks the condition in both Debug and Release
 configurations while CV_DbgAssert is only retained in the Debug configuration.
 */
-#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
+
+#define CV_VA_NUM_ARGS_HELPER(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...)    N
+#define CV_VA_NUM_ARGS(...)      CV_VA_NUM_ARGS_HELPER(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
+
+#define CV_Assert_1( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
```

Review comment:
It should be CV_Assert_8.
**File:** modules/core/include/opencv2/core/base.hpp
**Change Type:** modified
**Context:** PR #9293: core: add multi-argument CV_Assert

**Code Changes:**
```diff
@@ -424,7 +424,22 @@ The macros CV_Assert (and CV_DbgAssert(expr)) evaluate the specified expression.
 raise an error (see cv::error). The macro CV_Assert checks the condition in both Debug and Release
 configurations while CV_DbgAssert is only retained in the Debug configuration.
 */
-#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
+
+#define CV_VA_NUM_ARGS_HELPER(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...)    N
+#define CV_VA_NUM_ARGS(...)      CV_VA_NUM_ARGS_HELPER(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
+
+#define CV_Assert_1( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
```

Review comment:
It should be CV_Assert_9.
**File:** modules/imgproc/src/colormap.cpp
**Change Type:** modified
**Context:** PR #7865: ApplyColorMap can be used with a user colormap - ### This pullrequest changes applyColorMap can be used now with a user colormap defined in ...

**Code Changes:**
```diff
@@ -490,6 +490,22 @@ namespace colormap
         }
     };
 
+    // UserColormap .
+    class UserColorMap : public ColorMap {
+    public:
+
+        UserColorMap(Mat c) : ColorMap() {
+            init(c);
```

Review comment:
Why new/delete are required here? (I see here local usage of cm variable): ``` colormap::UserColorMap cm(userColor.getMat()); cm(src, dst); ```
**File:** modules/core/test/test_io.cpp
**Change Type:** modified
**Context:** PR #9327: core: fix FS doesn't close input file after parse error

**Code Changes:**
```diff
@@ -1345,3 +1345,25 @@ TEST(Core_InputOutput, FileStorage_json_bool)
     ASSERT_EQ((int)fs["bool_false"], 0);
     fs.release();
 }
+
+TEST(Core_InputOutput, FileStorage_free_file_after_exception)
+{
+    const std::string fileName = "test.yml";
+    const std::string content = "%YAML:1.0\n cameraMatrix;:: !<tag:yaml.org,2002:opencv-matrix>\n";
+
```

Review comment:
I would add an assertion after the constructor, e.g. an assert fail because we expected an exception to be thrown. Or an assertion that ``!fs.isOpened()``. This way we could make sure that future changes (i.e. not throwing an exception) don't render this test useless. Similarly, I would move the ``std::remove`` to after the catch block and leave the block empty
**File:** samples/dnn/ssd_mobilenet_object_detection.cpp
**Change Type:** added
**Context:** PR #9188: MobileNet SSD sample -  ### This pullrequest changes Added C++ and python samples for MobileNet-based SSD model 

**Code Changes:**
```diff
@@ -0,0 +1,161 @@
+#include <opencv2/dnn.hpp>
+#include <opencv2/dnn/shape_utils.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
+
+using namespace cv;
+using namespace cv::dnn;
+
+#include <fstream>
```

Review comment:
Wouldn't it be better to define it near other consts?
**File:** modules/dnn/src/layers/detection_output_layer.cpp
**Change Type:** modified
**Context:** PR #9188: MobileNet SSD sample -  ### This pullrequest changes Added C++ and python samples for MobileNet-based SSD model 

**Code Changes:**
```diff
@@ -234,7 +234,7 @@ class DetectionOutputLayerImpl : public DetectionOutputLayer
 
         if (numKept == 0)
         {
-            CV_ErrorNoReturn(Error::StsError, "Couldn't find any detections");
+            return;
         }
         int outputShape[] = {1, 1, (int)numKept, 7};
         outputs[0].create(4, outputShape, CV_32F);
```

Review comment:
Perhaps we should remove this line completely.
**File:** samples/dnn/mobilenet_ssd_python.py
**Change Type:** added
**Context:** PR #9188: MobileNet SSD sample -  ### This pullrequest changes Added C++ and python samples for MobileNet-based SSD model 

**Code Changes:**
```diff
@@ -0,0 +1,87 @@
+import numpy as np
+import argparse
+
+try:
+    import cv2 as cv
+except ImportError:
+    raise ImportError('Can\'t find OpenCV Python module. If you\'ve built it from sources without installation, '
+                      'configure environemnt variable PYTHONPATH to "opencv_build_dir/lib" directory (with "python3" subdirectory if required)')
+
```

Review comment:
Please remove this hard-coded path too. Use `PYTHONPATH` environment variable instead to `cv2.pyd` location.
**File:** modules/imgproc/src/color.cpp
**Change Type:** modified
**Context:** PR #8498: Bit-exact version of Lab ⇔ RGB conversions - ### This pullrequest changes 1. Adding new version of Lab2RGB_b conversion which is done in int...

**Code Changes:**
```diff
@@ -94,6 +94,8 @@
 #include "opencl_kernels_imgproc.hpp"
 #include <limits>
 #include "hal_replacement.hpp"
+#include "opencv2/core/hal/intrin.hpp"
+#include "opencv2/core/softfloat.hpp"
 
 #define  CV_DESCALE(x,n)     (((x) + (1 << ((n)-1))) >> (n))
 
@@ -138,6 +140,8 @@ const int CB2GI = -5636;
```

Review comment:
Please verify these changes. There was merge conflict (there are several similar places - search `d = 1.f/std::max`).
**File:** modules/core/include/opencv2/core/mat.hpp
**Change Type:** modified
**Context:** PR #8616: dnn refactoring - **WIP** some changes in the core to assist refactoring of opencv_contrib's dnn module; see https://github.com/opencv/openc...
**Review Line:** 1727

**Code Changes:**
```diff
 
+    /** @brief Returns the total number of array elements.
+
+     The method returns the number of elements within a certain sub-array slice with startDim <= dim < endDim
+     */
+    size_t total(int startDim, int endDim=INT_MAX) const;
+
     //! returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise
     int checkVector(int elemChannels, int depth=-1, bool requireContinuous=true) const;
 
```

Review comment:
This functionality looks misnamed. Probably `sliceSize` would be good. Also my suggestion is to move this out of `cv::Mat` class to prevent exploding of cv::Mat with rarely used/specific functionality.