nareshmlx/opencv-pr huggingface dataset:
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 197

**Code Changes:**
```diff
+    float margin[2] = { std::numeric_limits<float>::max(), std::numeric_limits<float>::max() };
+
+    Mat trainSamples = _samples.getMat();
+    int trainSamplesCount = trainSamples.rows;
+
+    Mat trainResponses = _responses.getMat();
+
+    CV_Assert(trainResponses.type() ==  CV_32FC1);
+    for (int samplesIndex = 0; samplesIndex < trainSamplesCount; samplesIndex++)
+    {
+        Mat currentSample = trainSamples.row(samplesIndex);
```

Review comment:
CV_Assert(trainResponses.type() == CV_32FC1);
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
see the comment on `areClassesEmpty`
**File:** modules/ml/test/test_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,318 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
??? The only difference is the rng seed?
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -1496,6 +1496,165 @@ class CV_EXPORTS_W LogisticRegression : public StatModel
     CV_WRAP static Ptr<LogisticRegression> create();
 };
 
+
+/****************************************************************************************\
+*                        Stochastic Gradient Descent SVM Classifier                      *
+\****************************************************************************************/
+
+/*!
```

Review comment:
I count 6 items. What is about something like this: `The classifier has these parameters:`?
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -1496,6 +1496,165 @@ class CV_EXPORTS_W LogisticRegression : public StatModel
     CV_WRAP static Ptr<LogisticRegression> create();
 };
 
+
+/****************************************************************************************\
+*                        Stochastic Gradient Descent SVM Classifier                      *
+\****************************************************************************************/
+
+/*!
```

Review comment:
lower case: `svmsgd`
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -1496,6 +1496,165 @@ class CV_EXPORTS_W LogisticRegression : public StatModel
     CV_WRAP static Ptr<LogisticRegression> create();
 };
 
+
+/****************************************************************************************\
+*                        Stochastic Gradient Descent SVM Classifier                      *
+\****************************************************************************************/
+
+/*!
```

Review comment:
`SvmsgdType::SGD` is not valid for enum values access. `SVMSGD::ASGD` looks better in [docs](http://pullrequest.opencv.org/buildbot/export/pr/6096/docs/de/d54/classcv_1_1ml_1_1SVMSGD.html) Or just use `SVMSGD::SvmsgdType` for "name" of valid values P.S. Same note for MarginType
**File:** modules/ml/include/opencv2/ml.hpp
**Change Type:** modified
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -1496,6 +1496,165 @@ class CV_EXPORTS_W LogisticRegression : public StatModel
     CV_WRAP static Ptr<LogisticRegression> create();
 };
 
+
+/****************************************************************************************\
+*                        Stochastic Gradient Descent SVM Classifier                      *
+\****************************************************************************************/
+
+/*!
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/74c87a26a561999ecdaf23102e8ed47519a8b313.
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/74c87a26a561999ecdaf23102e8ed47519a8b313.
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 481

**Code Changes:**
```diff
+{
+    clear();
+    setOptimalParameters();
+}
+
+void SVMSGDImpl::setOptimalParameters(int svmsgdType, int marginType)
+{
+    switch (svmsgdType)
+    {
+    case SGD:
+        params.svmsgdType = SGD;
```

Review comment:
Fixed. See commit https://github.com/mnoskova/opencv/commit/74c87a26a561999ecdaf23102e8ed47519a8b313.
**File:** samples/cpp/train_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 178

**Code Changes:**
```diff
+    float shift = 0;
+
+    if (doTrain(data.samples, data.responses, weights, shift))
+    {
+        Point points[2];
+        findPointsForLine(weights, shift, points, data.img.cols, data.img.rows);
+
+        redraw(data, points);
+    }
+}
+
```

Review comment:
So we decided to leave `shift`.
**File:** modules/ml/test/test_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,318 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Fixed. Now it's the single function.
**File:** modules/ml/test/test_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,318 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
`const Mat &weights`? `RNG &rng`?
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.

**Code Changes:**
```diff
@@ -0,0 +1,510 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
I think a better idea is to call `setOptimalParameters` first. And do nothing if some of the parameters weren't set.
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 279

**Code Changes:**
```diff
+
+        Mat currentSample = extendedTrainSamples.row(randomNumber);
+
+        float stepSize = params.initialStepSize * std::pow((1 + params.marginRegularization * params.initialStepSize * (float)iter), (-params.stepDecreasingPower));    //update stepSize
+
+        updateWeights( currentSample, isPositive(trainResponses.at<float>(randomNumber)), stepSize, extendedWeights );
+
+        //average weights (only for ASGD model)
+        if (params.svmsgdType == ASGD)
+        {
+            averageExtendedWeights = ((float)iter/ (1 + (float)iter)) * averageExtendedWeights  + extendedWeights / (1 + (float) iter);
```

Review comment:
`assert(type == float)`?
**File:** samples/cpp/train_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 97

**Code Changes:**
```diff
+    int yMax = std::max(segment.first.y, segment.second.y);
+
+    CV_Assert(weights.type() == CV_32FC1);
+    CV_Assert(xMin == xMax || yMin == yMax);
+
+    if (xMin == xMax && weights.at<float>(1) != 0)
+    {
+        x = xMin;
+        y = static_cast<int>(std::floor( - (weights.at<float>(0) * x + shift) / weights.at<float>(1)));
+        if (y >= yMin && y <= yMax)
+        {
```

Review comment:
`assert(type == float)`?
**File:** samples/cpp/train_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 153

**Code Changes:**
```diff
+    int radius = 3;
+    Scalar color;
+    CV_Assert((data.samples.type() == CV_32FC1) && (data.responses.type() == CV_32FC1));
+    for (int i = 0; i < data.samples.rows; i++)
+    {
+        center.x = static_cast<int>(data.samples.at<float>(i,0));
+        center.y = static_cast<int>(data.samples.at<float>(i,1));
+        color = (data.responses.at<float>(i) > 0) ? Scalar(128,128,0) : Scalar(0,128,128);
+        circle(data.img, center, radius, color, 5);
+    }
+    line(data.img, points[0], points[1],cv::Scalar(1,255,1));
```

Review comment:
`assert(type == float)`?
**File:** samples/cpp/train_svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 155

**Code Changes:**
```diff
+    CV_Assert((data.samples.type() == CV_32FC1) && (data.responses.type() == CV_32FC1));
+    for (int i = 0; i < data.samples.rows; i++)
+    {
+        center.x = static_cast<int>(data.samples.at<float>(i,0));
+        center.y = static_cast<int>(data.samples.at<float>(i,1));
+        color = (data.responses.at<float>(i) > 0) ? Scalar(128,128,0) : Scalar(0,128,128);
+        circle(data.img, center, radius, color, 5);
+    }
+    line(data.img, points[0], points[1],cv::Scalar(1,255,1));
+
+    imshow("Train svmsgd", data.img);
```

Review comment:
assert(type == float)?
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 354

**Code Changes:**
```diff
+{
+    return (params.svmsgdType == SGD || params.svmsgdType == ASGD)
+            &&
+            (params.marginType == SOFT_MARGIN || params.marginType == HARD_MARGIN)
+            &&
+            (params.marginRegularization > 0) && (params.initialStepSize > 0) && (params.stepDecreasingPower >= 0);
+}
+
+bool SVMSGDImpl::isTrained() const
+{
+    return !weights_.empty();
```

Review comment:
Is `params.stepDecreasingPower == 0` actually valid?
**File:** modules/ml/src/svmsgd.cpp
**Change Type:** added
**Context:** PR #6096: Mn/svmsgd to opencv3 0 - **Merge with extra**: https://github.com/Itseez/opencv_extra/pull/288 Implemented SVMSGD classifier.
**Review Line:** 354

**Code Changes:**
```diff
+{
+    return (params.svmsgdType == SGD || params.svmsgdType == ASGD)
+            &&
+            (params.marginType == SOFT_MARGIN || params.marginType == HARD_MARGIN)
+            &&
+            (params.marginRegularization > 0) && (params.initialStepSize > 0) && (params.stepDecreasingPower >= 0);
+}
+
+bool SVMSGDImpl::isTrained() const
+{
+    return !weights_.empty();
```

Review comment:
When params.stepDecreasingPower == 0, step size is a constant. It is the valid value.
**File:** ISSUE_TEMPLATE.md
**Change Type:** added
**Context:** PR #6144: Add an Issue template for new issues - Since we've got a new feature here on github i would like to use it to get all relevant information i...

**Code Changes:**
```diff
@@ -0,0 +1,37 @@
+This is a template helping you to create an issue which can be processes as quickly as possible. Feel free to add additional information or remove not relevant points if you do not need them.
+
+If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
+
+### Please state the information for your system
+- OpenCV version: 2.4 / 3.x
+- Host OS: Linux (Ubuntu 14.04)  / Mac OS X 10.11.3 / Windows 10
+- *(if needed, only cross-platform builds)* Target OS: host / Android 6.0 / ARM board / Raspberry Pi 2
+- *(if needed)* Compiler & CMake: GCC 5.3 & CMake 3.5
```

Review comment:
I believe list looks good and more editable here: ``` - OpenCV version: 2.4 / 3.x - Host OS: Linux (Ubuntu 14.04) / Mac OS X 10.11.3 / Windows 10 - *(if needed, only cross-platform builds)* Target OS: host / Android 6.0 / ARM board / Raspberry Pi 2 - *(if needed)* Compiler & CMake: GCC 5.3 & CMake 3.5 ```
**File:** modules/hal/src/replacement.hpp
**Change Type:** added
**Context:** PR #5743: HAL: improvements - - moved hardware detection routines to HAL - added new functions from core module: split, merge, add, sub, mul, div, ......
**Review Line:** 50

**Code Changes:**
```diff
+#ifndef __OPENCV_HAL_REPLACEMENT_HPP__
+#define __OPENCV_HAL_REPLACEMENT_HPP__
+
+#include "opencv2/hal.hpp"
+
+inline int hal_t_add8u(const uchar*, size_t, const uchar*, size_t, uchar*, size_t, int, int) { return cv::hal::Error::NotImplemented; }
+inline int hal_t_add8s(const schar*, size_t, const schar*, size_t, schar*, size_t, int, int) { return cv::hal::Error::NotImplemented; }
+inline int hal_t_add16u(const ushort*, size_t, const ushort*, size_t, ushort*, size_t, int, int) { return cv::hal::Error::NotImplemented; }
+inline int hal_t_add16s(const short*, size_t, const short*, size_t, short*, size_t, int, int) { return cv::hal::Error::NotImplemented; }
+inline int hal_t_add32s(const int*, size_t, const int*, size_t, int*, size_t, int, int) { return cv::hal::Error::NotImplemented; }
+inline int hal_t_add32f(const float*, size_t, const float*, size_t, float*, size_t, int, int) { return cv::hal::Error::NotImplemented; }
```

Review comment:
well, this thing needs to be discussed separately, I would probably do it differently
**File:** modules/core/include/opencv2/core/cvdef.h
**Change Type:** modified
**Context:** PR #3771: Round on arm - Added ARM implementation in cvRound function ``` - note: uses VFPv3 instructions - also added overloaded cvRound variants wit...

**Code Changes:**
```diff
@@ -196,6 +196,10 @@
 #  define CV_NEON 1
 #endif
 
+#if defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__)
+#  define CV_VFP 1
+#endif
+
 #endif // __CUDACC__
 
```

Review comment:
please, insert your code after Tegra one.
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #5993: Added lintian overrides for package signature entry

**Code Changes:**
```diff
@@ -289,6 +289,13 @@ else()
     set(TESTS_LINTIAN_OVERRIDES "empty-binary-package") # there is no tests
 endif()
 
+set(ALL_COMPONENTS "libs" "dev" "docs" "python" "java" "samples" "tests")
+
+foreach (comp ${ALL_COMPONENTS})
+    string(TOUPPER ${comp} comp_upcase)
+    list(APPEND ${comp_upcase}_LINTIAN_OVERRIDES "misplaced-extra-member-in-deb") # for signed packages
+endforeach()
```

Review comment:
why do you use `__` instead of `_`?
**File:** modules/imgproc/include/opencv2/imgproc.hpp
**Change Type:** modified
**Context:** PR #5386: adding some markers inside OpenCV - Adding Matlab like markers in OpenCV since I needed them for an application I made.

**Code Changes:**
```diff
@@ -3902,6 +3902,43 @@ a filled ellipse sector is to be drawn.
 CV_EXPORTS_W void ellipse(InputOutputArray img, const RotatedRect& box, const Scalar& color,
                         int thickness = 1, int lineType = LINE_8);
 
+/* ----------------------------------------------------------------------------------------- */
+/* ADDING A SET OF PREDEFINED MARKERS WHICH COULD BE USED TO HIGHLIGHT POSITIONS IN AN IMAGE */
+/* ----------------------------------------------------------------------------------------- */
+
+//! Possible set of marker types used for the cv::drawMarker function
+enum MarkerTypes
```

Review comment:
Please use doxygen compatible comments: `//! ...` See: http://pullrequest.opencv.org/buildbot/export/pr/5386/docs/d6/d6e/group__imgproc__draw.html#ga0ad87faebef1039ec957737ecc633b7b
**File:** modules/imgproc/include/opencv2/imgproc.hpp
**Change Type:** modified
**Context:** PR #5386: adding some markers inside OpenCV - Adding Matlab like markers in OpenCV since I needed them for an application I made.

**Code Changes:**
```diff
@@ -3902,6 +3902,43 @@ a filled ellipse sector is to be drawn.
 CV_EXPORTS_W void ellipse(InputOutputArray img, const RotatedRect& box, const Scalar& color,
                         int thickness = 1, int lineType = LINE_8);
 
+/* ----------------------------------------------------------------------------------------- */
+/* ADDING A SET OF PREDEFINED MARKERS WHICH COULD BE USED TO HIGHLIGHT POSITIONS IN AN IMAGE */
+/* ----------------------------------------------------------------------------------------- */
+
+//! Possible set of marker types used for the cv::drawMarker function
+enum MarkerTypes
```

Review comment:
function declaration != function definition(implementation): `Mat&` vs `InputOutputArray`
**File:** modules/imgproc/include/opencv2/imgproc.hpp
**Change Type:** modified
**Context:** PR #5386: adding some markers inside OpenCV - Adding Matlab like markers in OpenCV since I needed them for an application I made.

**Code Changes:**
```diff
@@ -3902,6 +3902,43 @@ a filled ellipse sector is to be drawn.
 CV_EXPORTS_W void ellipse(InputOutputArray img, const RotatedRect& box, const Scalar& color,
                         int thickness = 1, int lineType = LINE_8);
 
+/* ----------------------------------------------------------------------------------------- */
+/* ADDING A SET OF PREDEFINED MARKERS WHICH COULD BE USED TO HIGHLIGHT POSITIONS IN AN IMAGE */
+/* ----------------------------------------------------------------------------------------- */
+
+//! Possible set of marker types used for the cv::drawMarker function
+enum MarkerTypes
```

Review comment:
Will do so after the weekend, no time anymore before my trip!
**File:** modules/imgproc/include/opencv2/imgproc.hpp
**Change Type:** modified
**Context:** PR #5386: adding some markers inside OpenCV - Adding Matlab like markers in OpenCV since I needed them for an application I made.

**Code Changes:**
```diff
@@ -3902,6 +3902,43 @@ a filled ellipse sector is to be drawn.
 CV_EXPORTS_W void ellipse(InputOutputArray img, const RotatedRect& box, const Scalar& color,
                         int thickness = 1, int lineType = LINE_8);
 
+/* ----------------------------------------------------------------------------------------- */
+/* ADDING A SET OF PREDEFINED MARKERS WHICH COULD BE USED TO HIGHLIGHT POSITIONS IN AN IMAGE */
+/* ----------------------------------------------------------------------------------------- */
+
+//! Possible set of marker types used for the cv::drawMarker function
+enum MarkerTypes
```

Review comment:
also here you can here marker types are supported (See cv::MarkerTypes)
**File:** modules/imgproc/include/opencv2/imgproc.hpp
**Change Type:** modified
**Context:** PR #5386: adding some markers inside OpenCV - Adding Matlab like markers in OpenCV since I needed them for an application I made.

**Code Changes:**
```diff
@@ -3902,6 +3902,43 @@ a filled ellipse sector is to be drawn.
 CV_EXPORTS_W void ellipse(InputOutputArray img, const RotatedRect& box, const Scalar& color,
                         int thickness = 1, int lineType = LINE_8);
 
+/* ----------------------------------------------------------------------------------------- */
+/* ADDING A SET OF PREDEFINED MARKERS WHICH COULD BE USED TO HIGHLIGHT POSITIONS IN AN IMAGE */
+/* ----------------------------------------------------------------------------------------- */
+
+//! Possible set of marker types used for the cv::drawMarker function
+enum MarkerTypes
```

Review comment:
(See cv::MarkerTypes)
**File:** modules/core/src/mathfuncs.cpp
**Change Type:** modified
**Context:** PR #5605: Fix bug #5599 - Solves polynominal equations more correctly. #5599

**Code Changes:**
```diff
@@ -2496,7 +2496,6 @@ double cv::solvePoly( InputArray _coeffs0, OutputArray _roots0, int maxIters )
     }
 
     C p(1, 0), r(1, 1);
-
     for( i = 0; i < n; i++ )
     {
         roots[i] = p;
@@ -2511,12 +2510,54 @@ double cv::solvePoly( InputArray _coeffs0, OutputArray _roots0, int maxIters )
         {
```

Review comment:
this is terribly inefficient - allocate 1x1 matrix and call cv::sqrt(). just use std::sqrt() instead
**File:** samples/python2/calibrate.py
**Change Type:** modified
**Context:** PR #5802: Added missing docstrings to Python samples - Updated Python samples in continuation of https://github.com/Itseez/opencv/pull/5790 - added mi...

**Code Changes:**
```diff
@@ -1,5 +1,18 @@
 #!/usr/bin/env python
 
+'''
+camera calibration for distorted images with chess board samples
+reads distorted images, calculates the calibration and write undistorted images
+
+usage:
+    calibrate.py [--debug <output path>] [--square_size] [<image mask>]
+
```

Review comment:
why did you comment this off?