nareshmlx/opencv-pr huggingface dataset:
**File:** modules/core/include/opencv2/core/ocl.hpp
**Change Type:** modified
**Context:** PR #2956: T-API: optimization of cv::accumulate, cv::accumulateSquare, cv::accumulateProduct, cv::accumulateWeighted; added strategies in cv::predictO...
**Review Line:** 613

**Code Changes:**
```diff
+    // (useful for cases when matrices have different data types)
+    OCL_VECTOR_MAX = 1,
+
+    // default strategy
+    OCL_VECTOR_DEFAULT = OCL_VECTOR_OWN
+};
+
 CV_EXPORTS int predictOptimalVectorWidth(InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(),
                                          InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(),
-                                         InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray());
+                                         InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray(),
```

Review comment:
For this case I believe that more clear decision is to **export** separate functions for different strategies. Also passing strategy after 8 optional arguments doesn't look good.
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #2956: T-API: optimization of cv::accumulate, cv::accumulateSquare, cv::accumulateProduct, cv::accumulateWeighted; added strategies in cv::predictO...

**Code Changes:**
```diff
@@ -4451,42 +4451,46 @@ String kernelToStr(InputArray _kernel, int ddepth, const char * name)
         if (!src.empty()) \
         { \
             CV_Assert(src.isMat() || src.isUMat()); \
-            int ctype = src.type(), ccn = CV_MAT_CN(ctype); \
             Size csize = src.size(); \
-            cols.push_back(ccn * csize.width); \
-            if (ctype != type) \
+            int ctype = src.type(), ccn = CV_MAT_CN(ctype), cdepth = CV_MAT_DEPTH(ctype), \
+                ckercn = vectorWidths[cdepth], cwidth = ccn * csize.width; \
```

Review comment:
It is dead code, `wsz` is not defined.
**File:** modules/core/src/matmul.cpp
**Change Type:** modified
**Context:** PR #3259: Neon optimization of cv::scaleAdd (CV_32F)
**Review Line:** 2106

**Code Changes:**
```diff
@@ -2102,6 +2102,16 @@ static void scaleAdd_32f(const float* src1, const float* src2, float* dst,
             }
     }
     else
+#elif CV_NEON
+    if (true)
+    {
+        for ( ; i <= len - 4; i += 4)
+        {
+            float32x4_t v_src1 = vld1q_f32(src1 + i), v_src2 = vld1q_f32(src2 + i);
+            vst1q_f32(dst + i, vaddq_f32(vmulq_n_f32(v_src1, alpha), v_src2));
```

Review comment:
why is this "if(true)" ?
**File:** modules/core/src/matmul.cpp
**Change Type:** modified
**Context:** PR #3259: Neon optimization of cv::scaleAdd (CV_32F)
**Review Line:** 2106

**Code Changes:**
```diff
@@ -2102,6 +2102,16 @@ static void scaleAdd_32f(const float* src1, const float* src2, float* dst,
             }
     }
     else
+#elif CV_NEON
+    if (true)
+    {
+        for ( ; i <= len - 4; i += 4)
+        {
+            float32x4_t v_src1 = vld1q_f32(src1 + i), v_src2 = vld1q_f32(src2 + i);
+            vst1q_f32(dst + i, vaddq_f32(vmulq_n_f32(v_src1, alpha), v_src2));
```

Review comment:
to prevent execution of the next cycle behind `#endif` (to be consistent with SSE2 above)
**File:** modules/videoio/src/cap_gstreamer.cpp
**Change Type:** modified
**Context:** PR #3220: Several fixes for GStreamer support in OpenCV - - Accurate ASYC task handling for both GStreamer generations. - Correct video duration reque...

**Code Changes:**
```diff
@@ -74,7 +74,7 @@
 #endif
 
 #if GST_VERSION_MAJOR > 0
-#define COLOR_ELEM "videoconvert"
+#define COLOR_ELEM "autovideoconvert"
 #else
 #define COLOR_ELEM "ffmpegcolorspace"
 #endif
@@ -151,6 +151,7 @@ class CvCapture_GStreamer : public CvCapture
```

Review comment:
typo `fideo`
**File:** modules/videoio/src/cap_gstreamer.cpp
**Change Type:** modified
**Context:** PR #3220: Several fixes for GStreamer support in OpenCV - - Accurate ASYC task handling for both GStreamer generations. - Correct video duration reque...
**Review Line:** 778

**Code Changes:**
```diff
+#endif
+        {
+            CV_WARN("GStreamer: unable to query duration of stream");
+            duration = -1;
+            return true;
+        }
+    }
+    else
+    {
+        duration = -1;
+    }
```

Review comment:
`#undef FORMAT`?
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #3126: moving KDTree from core to ml - As we refactored ml module, I think it is useful to move KDTree from core to ml.
**Review Line:** 237

**Code Changes:**
```diff
-        Params(int defaultK=10, bool isclassifier=true);
+        Params(int defaultK=10, bool isclassifier_=true, int Emax_=INT_MAX, int algorithmType_=BRUTE_FORCE);
 
         CV_PROP_RW int defaultK;
         CV_PROP_RW bool isclassifier;
+        CV_PROP_RW int Emax; // for implementation with KDTree
+        CV_PROP_RW int algorithmType;
     };
     virtual void setParams(const Params& p) = 0;
     virtual Params getParams() const = 0;
     virtual float findNearest( InputArray samples, int k,
```

Review comment:
why not put the type here?
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #3126: moving KDTree from core to ml - As we refactored ml module, I think it is useful to move KDTree from core to ml.

**Code Changes:**
```diff
@@ -12,6 +12,7 @@
 //
 // Copyright (C) 2000, Intel Corporation, all rights reserved.
 // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
+// Copyright (C) 2014, Itseez Inc, all rights reserved.
 // Third party copyrights are property of their respective owners.
 //
 // Redistribution and use in source and binary forms, with or without modification,
@@ -229,17 +230,22 @@ class CV_EXPORTS_W KNearest : public StatModel
     class CV_EXPORTS_W_MAP Params
```

Review comment:
let's write something like <pre>enum { BRUTE_FORCE=1, KDTREE=2, DEFAULT=BRUTE_FORCE };</pre>
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #3126: moving KDTree from core to ml - As we refactored ml module, I think it is useful to move KDTree from core to ml.

**Code Changes:**
```diff
@@ -12,6 +12,7 @@
 //
 // Copyright (C) 2000, Intel Corporation, all rights reserved.
 // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
+// Copyright (C) 2014, Itseez Inc, all rights reserved.
 // Third party copyrights are property of their respective owners.
 //
 // Redistribution and use in source and binary forms, with or without modification,
@@ -229,17 +230,22 @@ class CV_EXPORTS_W KNearest : public StatModel
     class CV_EXPORTS_W_MAP Params
```

Review comment:
this change will likely break some code. At least it breaks letter_recog sample. Please, search globally for all the KNearest occurences and check all the use cases.
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #3126: moving KDTree from core to ml - As we refactored ml module, I think it is useful to move KDTree from core to ml.

**Code Changes:**
```diff
@@ -12,6 +12,7 @@
 //
 // Copyright (C) 2000, Intel Corporation, all rights reserved.
 // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
+// Copyright (C) 2014, Itseez Inc, all rights reserved.
 // Third party copyrights are property of their respective owners.
 //
 // Redistribution and use in source and binary forms, with or without modification,
@@ -229,17 +230,22 @@ class CV_EXPORTS_W KNearest : public StatModel
     class CV_EXPORTS_W_MAP Params
```

Review comment:
BTW, check opencv_contrib too. This is the reason why I strongly dislike such changes, then you silently add new parameters in the middle of parameter list. Many compilers will just miss such changes.
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #2711: Add VS2013, Windows 8.1, Windows Phone 8.0, Windows Phone 8.1 environment support - VS2013 and Windows 8.1 SDK will be selected if the compi...

**Code Changes:**
```diff
@@ -223,6 +223,10 @@ OCV_OPTION(ENABLE_NOISY_WARNINGS      "Show all warnings even if they are too no
 OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors"                                 OFF )
 OCV_OPTION(ENABLE_WINRT_MODE          "Build with Windows Runtime support"                       OFF  IF WIN32 )
 OCV_OPTION(ENABLE_WINRT_MODE_NATIVE   "Build with Windows Runtime native C++ support"            OFF  IF WIN32 )
+OCV_OPTION(ENABLE_LIBVS2013           "Build VS2013 with Visual Studio 2013 libraries"           OFF  IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
+OCV_OPTION(ENABLE_WINSDK81            "Build VS2013 with Windows 8.1 SDK"                        OFF  IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
+OCV_OPTION(ENABLE_WINPHONESDK80       "Build with Windows Phone 8.0 SDK"                         OFF  IF WIN32 AND (MSVC_VERSION EQUAL 1700) )
+OCV_OPTION(ENABLE_WINPHONESDK81       "Build VS2013 with Windows Phone 8.1 SDK"                  OFF  IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
 
 # uncategorized options
```

Review comment:
Are flags WinRT-only related? If so, please change name (like `ENABLE_WINRT_xxx`) Can we change option "visibility" condition to `IF (WIN32 AND (MSVC_VERSION EQUAL 1800))` ?
**File:** cmake/OpenCVCRTLinkage.cmake
**Change Type:** modified
**Context:** PR #2711: Add VS2013, Windows 8.1, Windows Phone 8.0, Windows Phone 8.1 environment support - VS2013 and Windows 8.1 SDK will be selected if the compi...

**Code Changes:**
```diff
@@ -6,34 +6,62 @@ endif()
 
 set(HAVE_WINRT FALSE)
 
-# search Windows Platform SDK
-message(STATUS "Checking for Windows Platform SDK")
-GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
-if(WINDOWS_SDK_PATH STREQUAL "")
-  set(HAVE_MSPDK FALSE)
-  message(STATUS "Windows Platform SDK 8.0 was not found")
```

Review comment:
May be put all of this WinRT-related code under ``` if (ENABLE_WINRT_MODE OR ENABLE_WINRT_MODE_NATIVE) ``` ?
**File:** cmake/OpenCVCRTLinkage.cmake
**Change Type:** modified
**Context:** PR #2711: Add VS2013, Windows 8.1, Windows Phone 8.0, Windows Phone 8.1 environment support - VS2013 and Windows 8.1 SDK will be selected if the compi...

**Code Changes:**
```diff
@@ -6,34 +6,62 @@ endif()
 
 set(HAVE_WINRT FALSE)
 
-# search Windows Platform SDK
-message(STATUS "Checking for Windows Platform SDK")
-GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
-if(WINDOWS_SDK_PATH STREQUAL "")
-  set(HAVE_MSPDK FALSE)
-  message(STATUS "Windows Platform SDK 8.0 was not found")
```

Review comment:
Alas, it is not WinRT related. Even without WinRT, VS2013 libraries and Windows 8.1 SDK may be desired for linking. I had forgotten visibility regarding WIN32 and VS2013 compiler so I already corrected it.
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #2711: Add VS2013, Windows 8.1, Windows Phone 8.0, Windows Phone 8.1 environment support - VS2013 and Windows 8.1 SDK will be selected if the compi...

**Code Changes:**
```diff
@@ -223,6 +223,10 @@ OCV_OPTION(ENABLE_NOISY_WARNINGS      "Show all warnings even if they are too no
 OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors"                                 OFF )
 OCV_OPTION(ENABLE_WINRT_MODE          "Build with Windows Runtime support"                       OFF  IF WIN32 )
 OCV_OPTION(ENABLE_WINRT_MODE_NATIVE   "Build with Windows Runtime native C++ support"            OFF  IF WIN32 )
+OCV_OPTION(ENABLE_LIBVS2013           "Build VS2013 with Visual Studio 2013 libraries"           OFF  IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
+OCV_OPTION(ENABLE_WINSDK81            "Build VS2013 with Windows 8.1 SDK"                        OFF  IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
+OCV_OPTION(ENABLE_WINPHONESDK80       "Build with Windows Phone 8.0 SDK"                         OFF  IF WIN32 AND (MSVC_VERSION EQUAL 1700) )
+OCV_OPTION(ENABLE_WINPHONESDK81       "Build VS2013 with Windows Phone 8.1 SDK"                  OFF  IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
 
 # uncategorized options
```

Review comment:
Could you use the following notation and remove `if()` commands? ``` OCV_OPTION(ENABLE_WINSDK81 "Build VS2013 with Windows 8.1 SDK" OFF IF WIN32 AND (MSVC_VERSION EQUAL 1800)) ```
**File:** modules/imgproc/src/moments.cpp
**Change Type:** modified
**Context:** PR #2359: Work around an apparent GCC bug
**Review Line:** 202

**Code Changes:**
```diff
 \****************************************************************************************/
 
 template<typename T, typename WT, typename MT>
+#if defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 9
+// Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60196
+__attribute__((optimize("no-tree-vectorize")))
+#endif
 static void momentsInTile( const cv::Mat& img, double* moments )
 {
     cv::Size size = img.size();
```

Review comment:
http://build.opencv.org/builders/precommit_macos/builds/9396
**File:** modules/imgproc/src/moments.cpp
**Change Type:** modified
**Context:** PR #2359: Work around an apparent GCC bug
**Review Line:** 202

**Code Changes:**
```diff
 \****************************************************************************************/
 
 template<typename T, typename WT, typename MT>
+#if defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 9
+// Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60196
+__attribute__((optimize("no-tree-vectorize")))
+#endif
 static void momentsInTile( const cv::Mat& img, double* moments )
 {
     cv::Size size = img.size();
```

Review comment:
That's an old build; I fixed that already.
**File:** modules/videoio/doc/reading_and_writing_video.rst
**Change Type:** modified
**Context:** PR #3182: adding fourcc to VideoWriter docs - CV_FOURCC => VideoWriter::fourcc

**Code Changes:**
```diff
@@ -300,7 +300,7 @@ VideoWriter constructors
 
     :param filename: Name of the output video file.
 
-    :param fourcc: 4-character code of codec used to compress the frames. For example, ``CV_FOURCC('P','I','M','1')``  is a MPEG-1 codec, ``CV_FOURCC('M','J','P','G')``  is a motion-jpeg codec etc. List of codes can be obtained at `Video Codecs by FOURCC <http://www.fourcc.org/codecs.php>`_ page.
+    :param fourcc: 4-character code of codec used to compress the frames. For example, ``VideoWriter::fourcc('P','I','M','1')``  is a MPEG-1 codec, ``VideoWriter::fourcc('M','J','P','G')``  is a motion-jpeg codec etc. List of codes can be obtained at `Video Codecs by FOURCC <http://www.fourcc.org/codecs.php>`_ page.
 
     :param fps: Framerate of the created video stream.
 
@@ -358,3 +358,14 @@ Writes the next video frame
```

Review comment:
These last empty lines should be removed in order to ensure documentation gets built properly.
**File:** modules/videoio/doc/reading_and_writing_video.rst
**Change Type:** modified
**Context:** PR #3182: adding fourcc to VideoWriter docs - CV_FOURCC => VideoWriter::fourcc

**Code Changes:**
```diff
@@ -300,7 +300,7 @@ VideoWriter constructors
 
     :param filename: Name of the output video file.
 
-    :param fourcc: 4-character code of codec used to compress the frames. For example, ``CV_FOURCC('P','I','M','1')``  is a MPEG-1 codec, ``CV_FOURCC('M','J','P','G')``  is a motion-jpeg codec etc. List of codes can be obtained at `Video Codecs by FOURCC <http://www.fourcc.org/codecs.php>`_ page.
+    :param fourcc: 4-character code of codec used to compress the frames. For example, ``VideoWriter::fourcc('P','I','M','1')``  is a MPEG-1 codec, ``VideoWriter::fourcc('M','J','P','G')``  is a motion-jpeg codec etc. List of codes can be obtained at `Video Codecs by FOURCC <http://www.fourcc.org/codecs.php>`_ page.
 
     :param fps: Framerate of the created video stream.
 
@@ -358,3 +358,14 @@ Writes the next video frame
```

Review comment:
Add two more seperation marks. It needs to be as long as the amount of title characters to pass all builds.
**File:** modules/imgproc/src/canny.cpp
**Change Type:** modified
**Context:** PR #3117: OCL: Optimization for canny - Performance optimization for canny. http://ocl.itseez.com/intel/export/perf/pr/3117/report/ check_regression=O...
**Review Line:** 171

**Code Changes:**
```diff
+                Calc magnitudes
+                Non maxima suppression
+                Double thresholding
+        */
+        UMat dx, dy;
         Sobel(_src, dx, CV_16S, 1, 0, aperture_size, 1, 0, BORDER_REPLICATE);
         Sobel(_src, dy, CV_16S, 0, 1, aperture_size, 1, 0, BORDER_REPLICATE);
 
-        // magnitude calculation
-        ocl::Kernel magnitudeKernel("calcMagnitude", ocl::imgproc::canny_oclsrc,
-                                    format("-D OP_MAG -D cn=%d%s -D intT=int -D shortT=short -D convertToIntT=convert_int_sat",
```

Review comment:
does it make sense to use special sobel kernel for 5x5 and 7x7 aperture as it did int extractCovdata function (corner.cpp)?
**File:** modules/imgproc/src/canny.cpp
**Change Type:** modified
**Context:** PR #3117: OCL: Optimization for canny - Performance optimization for canny. http://ocl.itseez.com/intel/export/perf/pr/3117/report/ check_regression=O...
**Review Line:** 171

**Code Changes:**
```diff
+                Calc magnitudes
+                Non maxima suppression
+                Double thresholding
+        */
+        UMat dx, dy;
         Sobel(_src, dx, CV_16S, 1, 0, aperture_size, 1, 0, BORDER_REPLICATE);
         Sobel(_src, dy, CV_16S, 0, 1, aperture_size, 1, 0, BORDER_REPLICATE);
 
-        // magnitude calculation
-        ocl::Kernel magnitudeKernel("calcMagnitude", ocl::imgproc::canny_oclsrc,
-                                    format("-D OP_MAG -D cn=%d%s -D intT=int -D shortT=short -D convertToIntT=convert_int_sat",
```

Review comment:
I have tried to merge it in one kernel, but it didn't give no acceleration, inversely slowdown.
**File:** modules/videoio/src/cap.cpp
**Change Type:** modified
**Context:** PR #3152: VideoCapture did not detect an unopened camera - Resolving [issue 3880](http://code.opencv.org/issues/3880): "I believe that during the crea...

**Code Changes:**
```diff
@@ -621,15 +621,15 @@ Ptr<IVideoCapture> VideoCapture::createCameraCapture(int index)
         {
 #ifdef HAVE_DSHOW
         case CV_CAP_DSHOW:
-            capture = Ptr<IVideoCapture>(new cv::VideoCapture_DShow(index));
-            if (capture)
+            capture = makePtr<VideoCapture_DShow>(index);
+            if (capture && capture.dynamicCast<VideoCapture_DShow>()->isOpened())
                 return capture;
             break; // CV_CAP_DSHOW
```

Review comment:
I think something like ``` if (!dhow) break; if (dshow->isOpened()) ............... ``` will be more safe,
**File:** modules/videoio/src/cap.cpp
**Change Type:** modified
**Context:** PR #3152: VideoCapture did not detect an unopened camera - Resolving [issue 3880](http://code.opencv.org/issues/3880): "I believe that during the crea...

**Code Changes:**
```diff
@@ -621,15 +621,15 @@ Ptr<IVideoCapture> VideoCapture::createCameraCapture(int index)
         {
 #ifdef HAVE_DSHOW
         case CV_CAP_DSHOW:
-            capture = Ptr<IVideoCapture>(new cv::VideoCapture_DShow(index));
-            if (capture)
+            capture = makePtr<VideoCapture_DShow>(index);
+            if (capture && capture.dynamicCast<VideoCapture_DShow>()->isOpened())
                 return capture;
             break; // CV_CAP_DSHOW
```

Review comment:
will the following solution work? <pre> capture = makePtr&lt;VideoCapture_DShow&gt;(index); if(capture && capture-&gt;isOpened()) return capture; </pre> it's that we do not like "new" very much and try to use smart pointers where possible.
**File:** modules/videoio/src/cap.cpp
**Change Type:** modified
**Context:** PR #3152: VideoCapture did not detect an unopened camera - Resolving [issue 3880](http://code.opencv.org/issues/3880): "I believe that during the crea...

**Code Changes:**
```diff
@@ -621,15 +621,15 @@ Ptr<IVideoCapture> VideoCapture::createCameraCapture(int index)
         {
 #ifdef HAVE_DSHOW
         case CV_CAP_DSHOW:
-            capture = Ptr<IVideoCapture>(new cv::VideoCapture_DShow(index));
-            if (capture)
+            capture = makePtr<VideoCapture_DShow>(index);
+            if (capture && capture.dynamicCast<VideoCapture_DShow>()->isOpened())
                 return capture;
             break; // CV_CAP_DSHOW
```

Review comment:
Good point. The problem is that IVideoCapture does not have an isOpened() method. I don't know why, but many classes which are based on IVideoCapture do not provide one as well. So do you like a cast more? ``` if(capture && ((Ptr<VideoCapture_DShow>)capture)->isOpened()) ``` or ``` if (capture && ((VideoCapture_DShow*)capture.get())->isOpened()) ``` probably work.
**File:** modules/videoio/src/cap.cpp
**Change Type:** modified
**Context:** PR #3152: VideoCapture did not detect an unopened camera - Resolving [issue 3880](http://code.opencv.org/issues/3880): "I believe that during the crea...

**Code Changes:**
```diff
@@ -621,15 +621,15 @@ Ptr<IVideoCapture> VideoCapture::createCameraCapture(int index)
         {
 #ifdef HAVE_DSHOW
         case CV_CAP_DSHOW:
-            capture = Ptr<IVideoCapture>(new cv::VideoCapture_DShow(index));
-            if (capture)
+            capture = makePtr<VideoCapture_DShow>(index);
+            if (capture && capture.dynamicCast<VideoCapture_DShow>()->isOpened())
                 return capture;
             break; // CV_CAP_DSHOW
```

Review comment:
it's better to use capture.dynamicCast&lt;VideoCapture_DShow&gt;()-&gt;isOpened()
**File:** modules/ml/doc/logistic_regression.rst
**Change Type:** added
**Context:** PR #3119: Reworked logistic regression classifier - Merged PR #1227 to master and reworked logistic regression module to conform with new machine lear...

**Code Changes:**
```diff
@@ -0,0 +1,178 @@
+Logistic Regression
+===================
+
+.. highlight:: cpp
+
+ML implements logistic regression, which is a probabilistic classification technique. Logistic Regression is a binary classification algorithm which is closely related to Support Vector Machines (SVM).
+Like SVM, Logistic Regression can be extended to work on multi-class classification problems like digit recognition (i.e. recognizing digitis like 0,1 2, 3,... from the given images).
+This version of Logistic Regression supports both binary and multi-class classifications (for multi-class it creates a multiple 2-class classifiers).
+In order to train the logistic regression classifier, Batch Gradient Descent and Mini-Batch Gradient Descent algorithms are used (see [BatchDesWiki]_).
```

Review comment:
the name should be updated
**File:** modules/ml/doc/ml.rst
**Change Type:** modified
**Context:** PR #3119: Reworked logistic regression classifier - Merged PR #1227 to master and reworked logistic regression module to conform with new machine lear...
**Review Line:** 21

**Code Changes:**
```diff
@@ -18,4 +18,5 @@ Most of the classification and regression algorithms are implemented as C++ clas
     random_trees
     expectation_maximization
     neural_networks
+    logistic_regression
     mldata
```

Review comment:
since mldata is general-use class, for more logical ordering I suggest to move logistic_regression above mldata
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #3119: Reworked logistic regression classifier - Merged PR #1227 to master and reworked logistic regression module to conform with new machine lear...

**Code Changes:**
```diff
@@ -90,7 +90,6 @@ class CV_EXPORTS_W_MAP ParamGrid
     CV_PROP_RW double logStep;
 };
 
-
 class CV_EXPORTS TrainData
 {
 public:
@@ -566,6 +565,48 @@ class CV_EXPORTS_W ANN_MLP : public StatModel
     static Ptr<ANN_MLP> create(const Params& params=Params());
```

Review comment:
this is not needed anymore in header files, please, remove it