nareshmlx/opencv-pr huggingface dataset:
**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:
- Instead of printing to console, the undistorted images are now calculated and saved to disk, so the found calibration is not the final result of the example anymore. - Could have deleted the `print` lines as well, but wanted to keep the convenient possibility to print them again for people working with the script. If you want the values to be printed I change that and include the `print` again.
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #5801: Added switch to CMakeLists.txt in order to enable/disable Matlab. - On Windows machines, the CMake file `cmake/OpenCVFindMatlab.cmake`, whic...

**Code Changes:**
```diff
@@ -207,6 +207,7 @@ OCV_OPTION(WITH_OPENCLAMDBLAS  "Include AMD OpenCL BLAS library support"     ON
 OCV_OPTION(WITH_DIRECTX        "Include DirectX support"                     ON   IF (WIN32 AND NOT WINRT) )
 OCV_OPTION(WITH_INTELPERC      "Include Intel Perceptual Computing support"  OFF  IF (WIN32 AND NOT WINRT) )
 OCV_OPTION(WITH_IPP_A          "Include Intel IPP_A support"                 OFF  IF (MSVC OR X86 OR X86_64) )
+OCV_OPTION(WITH_MATLAB         "Include Matlab support"                      ON   IF (NOT ANDROID AND NOT IOS AND NOT WINRT))
 OCV_OPTION(WITH_VA             "Include VA support"                          OFF  IF (UNIX AND NOT ANDROID) )
 OCV_OPTION(WITH_VA_INTEL       "Include Intel VA-API/OpenCL support"         OFF  IF (UNIX AND NOT ANDROID) )
 OCV_OPTION(WITH_GDAL           "Include GDAL Support"                        OFF  IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
@@ -583,7 +584,9 @@ if(WITH_DIRECTX)
 endif()
```

Review comment:
Please use here `if(MATLAB_FOUND)` only. `WITH_MATLAB` is unnecessary here (and sometimes buggy) Also remove nested `if(MATLAB_FOUND)` check and the "else" branch below (or replace it to `elseif(WITH_MATLAB)`).
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #5763: suppress lintian warning in opencv.pc

**Code Changes:**
```diff
@@ -227,6 +227,32 @@ function(ocv_generate_lintian_overrides_file comp)
     endif()
 endfunction()
 
+function(ocv_get_lintian_version version)
+    find_program(LINTIAN_EXECUTABLE lintian)
+
+    if(NOT LINTIAN_EXECUTABLE)
+        return()
+    endif()
```

Review comment:
The problem origin is not architecture, but lintian tool version. Ubuntu 15.04 includes newer version of lintian that supports more directives.
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #5763: suppress lintian warning in opencv.pc

**Code Changes:**
```diff
@@ -227,6 +227,32 @@ function(ocv_generate_lintian_overrides_file comp)
     endif()
 endfunction()
 
+function(ocv_get_lintian_version version)
+    find_program(LINTIAN_EXECUTABLE lintian)
+
+    if(NOT LINTIAN_EXECUTABLE)
+        return()
+    endif()
```

Review comment:
I know. Alternative solution?
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #5763: suppress lintian warning in opencv.pc

**Code Changes:**
```diff
@@ -227,6 +227,32 @@ function(ocv_generate_lintian_overrides_file comp)
     endif()
 endfunction()
 
+function(ocv_get_lintian_version version)
+    find_program(LINTIAN_EXECUTABLE lintian)
+
+    if(NOT LINTIAN_EXECUTABLE)
+        return()
+    endif()
```

Review comment:
Obviously, check lintian version.
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #5763: suppress lintian warning in opencv.pc

**Code Changes:**
```diff
@@ -227,6 +227,32 @@ function(ocv_generate_lintian_overrides_file comp)
     endif()
 endfunction()
 
+function(ocv_get_lintian_version version)
+    find_program(LINTIAN_EXECUTABLE lintian)
+
+    if(NOT LINTIAN_EXECUTABLE)
+        return()
+    endif()
```

Review comment:
It's not a portable solution too. The same package can be checked with different versions of lintian and it will lead to errors.
**File:** cmake/OpenCVPackaging.cmake
**Change Type:** modified
**Context:** PR #5763: suppress lintian warning in opencv.pc

**Code Changes:**
```diff
@@ -227,6 +227,32 @@ function(ocv_generate_lintian_overrides_file comp)
     endif()
 endfunction()
 
+function(ocv_get_lintian_version version)
+    find_program(LINTIAN_EXECUTABLE lintian)
+
+    if(NOT LINTIAN_EXECUTABLE)
+        return()
+    endif()
```

Review comment:
`PARENT_SCOPE` is needed here.
**File:** modules/core/include/opencv2/core.hpp
**Change Type:** modified
**Context:** PR #5704: Documentation patch for cv::mixChannels
**Review Line:** 875

**Code Changes:**
```diff
-depth must be the same as in src[0].
-@param ndsts number of matrices in dst.
+@param nsrcs number of matrices in `src`.
+@param dst output array or vector of matrices; all the matrices **must be allocated**; their size and
+depth must be the same as in `src[0]`.
+@param ndsts number of matrices in `dst`.
 @param fromTo array of index pairs specifying which channels are copied and where; fromTo[k\*2] is
 a 0-based index of the input channel in src, fromTo[k\*2+1] is an index of the output channel in
 dst; the continuous channel numbering is used: the first input image channels are indexed from 0 to
 src[0].channels()-1, the second input image channels are indexed from src[0].channels() to
 src[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image
```

Review comment:
I'd prefer using italic font instead of fixed-width to make emphasis on parameter references, but it is just a matter of taste.
**File:** modules/imgproc/test/test_goodfeaturetotrack.cpp
**Change Type:** added
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module

**Code Changes:**
```diff
@@ -0,0 +1,495 @@
+/*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:
Path should be `string(ts.get_data_path()) + "stereomatching/datasets/tsukuba/im2.png"` to work on linux.
**File:** modules/ts/include/opencv2/ts.hpp
**Change Type:** modified
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module

**Code Changes:**
```diff
@@ -163,6 +163,9 @@ CV_EXPORTS void gemm(const Mat& src1, const Mat& src2, double alpha,
                      const Mat& src3, double beta, Mat& dst, int flags);
     CV_EXPORTS void transform( const Mat& src, Mat& dst, const Mat& transmat, const Mat& shift );
 CV_EXPORTS double crossCorr(const Mat& src1, const Mat& src2);
+CV_EXPORTS void threshold( const Mat& src, Mat& dst, double thresh, double maxval, int thresh_type );
+CV_EXPORTS void minMaxIdx( InputArray _img, double* minVal, double* maxVal,
+                    Point* minLoc, Point* maxLoc, InputArray _mask );
 
 struct CV_EXPORTS MatInfo
 {
```

Review comment:
should be `minMaxIdx` in according to `cv::minMaxIdx`
**File:** modules/ts/src/ts_func.cpp
**Change Type:** modified
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module

**Code Changes:**
```diff
@@ -1,6 +1,7 @@
 #include "precomp.hpp"
 #include <float.h>
 #include <limits.h>
+#include "opencv2/imgproc/types_c.h"
 
 #ifdef HAVE_TEGRA_OPTIMIZATION
 #include "tegra.hpp"
@@ -3074,4 +3075,265 @@ void printVersionInfo(bool useStdOut)
 #endif
```

Review comment:
why do you need this enum? I believe the original OpenCV one is enough.
**File:** modules/ts/include/opencv2/ts.hpp
**Change Type:** modified
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module

**Code Changes:**
```diff
@@ -163,6 +163,9 @@ CV_EXPORTS void gemm(const Mat& src1, const Mat& src2, double alpha,
                      const Mat& src3, double beta, Mat& dst, int flags);
     CV_EXPORTS void transform( const Mat& src, Mat& dst, const Mat& transmat, const Mat& shift );
 CV_EXPORTS double crossCorr(const Mat& src1, const Mat& src2);
+CV_EXPORTS void threshold( const Mat& src, Mat& dst, double thresh, double maxval, int thresh_type );
+CV_EXPORTS void minMaxIdx( InputArray _img, double* minVal, double* maxVal,
+                    Point* minLoc, Point* maxLoc, InputArray _mask );
 
 struct CV_EXPORTS MatInfo
 {
```

Review comment:
https://github.com/Itseez/opencv/blob/master/modules/core/src/stat.cpp#L1907
**File:** modules/ts/include/opencv2/ts.hpp
**Change Type:** modified
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module

**Code Changes:**
```diff
@@ -163,6 +163,9 @@ CV_EXPORTS void gemm(const Mat& src1, const Mat& src2, double alpha,
                      const Mat& src3, double beta, Mat& dst, int flags);
     CV_EXPORTS void transform( const Mat& src, Mat& dst, const Mat& transmat, const Mat& shift );
 CV_EXPORTS double crossCorr(const Mat& src1, const Mat& src2);
+CV_EXPORTS void threshold( const Mat& src, Mat& dst, double thresh, double maxval, int thresh_type );
+CV_EXPORTS void minMaxIdx( InputArray _img, double* minVal, double* maxVal,
+                    Point* minLoc, Point* maxLoc, InputArray _mask );
 
 struct CV_EXPORTS MatInfo
 {
```

Review comment:
you use wrong function name
**File:** modules/ts/src/ts_func.cpp
**Change Type:** modified
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module

**Code Changes:**
```diff
@@ -1,6 +1,7 @@
 #include "precomp.hpp"
 #include <float.h>
 #include <limits.h>
+#include "opencv2/imgproc/types_c.h"
 
 #ifdef HAVE_TEGRA_OPTIMIZATION
 #include "tegra.hpp"
@@ -3074,4 +3075,265 @@ void printVersionInfo(bool useStdOut)
 #endif
```

Review comment:
why not? OpenCV TS module depends on imgproc one (see https://github.com/Itseez/opencv/blob/master/modules/ts/CMakeLists.txt#L12)
**File:** modules/ts/src/ts_func.cpp
**Change Type:** modified
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module

**Code Changes:**
```diff
@@ -1,6 +1,7 @@
 #include "precomp.hpp"
 #include <float.h>
 #include <limits.h>
+#include "opencv2/imgproc/types_c.h"
 
 #ifdef HAVE_TEGRA_OPTIMIZATION
 #include "tegra.hpp"
@@ -3074,4 +3075,265 @@ void printVersionInfo(bool useStdOut)
 #endif
```

Review comment:
what prevents you from including it? :wink:
**File:** modules/imgproc/src/featureselect.cpp
**Change Type:** modified
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module

**Code Changes:**
```diff
@@ -309,11 +309,18 @@ void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners,
                 tmpCorners.push_back(eig_data + x);
         }
     }
-    std::sort( tmpCorners.begin(), tmpCorners.end(), greaterThanPtr() );
 
     std::vector<Point2f> corners;
     size_t i, j, total = tmpCorners.size(), ncorners = 0;
 
+    if (total == 0)
```

Review comment:
Please revert this change. Float equality operation is fine here.
**File:** modules/imgproc/src/featureselect.cpp
**Change Type:** modified
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module

**Code Changes:**
```diff
@@ -309,11 +309,18 @@ void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners,
                 tmpCorners.push_back(eig_data + x);
         }
     }
-    std::sort( tmpCorners.begin(), tmpCorners.end(), greaterThanPtr() );
 
     std::vector<Point2f> corners;
     size_t i, j, total = tmpCorners.size(), ncorners = 0;
 
+    if (total == 0)
```

Review comment:
Please revert border type to default here and below.
**File:** modules/imgproc/src/featureselect.cpp
**Change Type:** modified
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module

**Code Changes:**
```diff
@@ -309,11 +309,18 @@ void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners,
                 tmpCorners.push_back(eig_data + x);
         }
     }
-    std::sort( tmpCorners.begin(), tmpCorners.end(), greaterThanPtr() );
 
     std::vector<Point2f> corners;
     size_t i, j, total = tmpCorners.size(), ncorners = 0;
 
+    if (total == 0)
```

Review comment:
`std::sort` above should work fine. Revert this change.
**File:** modules/imgproc/test/test_goodfeaturetotrack.cpp
**Change Type:** added
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module

**Code Changes:**
```diff
@@ -0,0 +1,495 @@
+/*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 suggest to use image from "shared" folder.
**File:** modules/imgproc/test/test_goodfeaturetotrack.cpp
**Change Type:** added
**Context:** PR #3540: added test goodfeaturetotrack.cpp - Added missed accuracy test for goodFeaturesToTrack functions from opencv_imgproc module
**Review Line:** 463

**Code Changes:**
```diff
+               blockSize,
+               useHarrisDetector,
+               k );
+    }
+
+    double e =norm(corners, Refcorners);
+
+    if (e > eps)
+    {
+        TEST_MESSAGEL ("Number of features: Refcorners =  ", Refcorners.size())
+        TEST_MESSAGEL ("                    TestCorners = ", corners.size())
```

Review comment:
It is better to use `cvtest::norm` here.
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...

**Code Changes:**
```diff
@@ -139,124 +139,125 @@ void CvCaptureCAM_PvAPI::close()
 }
 
 // Initialize camera input
-bool CvCaptureCAM_PvAPI::open( int index )
+bool CvCaptureCAM_PvAPI::open( int )
 {
     tPvCameraInfo cameraList[MAX_CAMERAS];
-
     tPvCameraInfo  camInfo;
```

Review comment:
This is error 2, this should be !PvInitialize(). The function returns 0 when initialization is busy and thus waiting untill a camera is up should depend on it being 0. Will update this already and some other snippets.
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...

**Code Changes:**
```diff
@@ -139,124 +139,125 @@ void CvCaptureCAM_PvAPI::close()
 }
 
 // Initialize camera input
-bool CvCaptureCAM_PvAPI::open( int index )
+bool CvCaptureCAM_PvAPI::open( int )
 {
     tPvCameraInfo cameraList[MAX_CAMERAS];
-
     tPvCameraInfo  camInfo;
```

Review comment:
Adjusting the package size with a static value is dangerous, not all systems and ethernet cards support this. This is mainly done to avoid overhead, probably by the original author. It will work on some systems but fail miserably on others. Just let the standard package sizes be used and ignore the overhead it creates.
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...

**Code Changes:**
```diff
@@ -139,124 +139,125 @@ void CvCaptureCAM_PvAPI::close()
 }
 
 // Initialize camera input
-bool CvCaptureCAM_PvAPI::open( int index )
+bool CvCaptureCAM_PvAPI::open( int )
 {
     tPvCameraInfo cameraList[MAX_CAMERAS];
-
     tPvCameraInfo  camInfo;
```

Review comment:
From here discussion 2 is important, waiting for input on this
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...

**Code Changes:**
```diff
@@ -139,124 +139,125 @@ void CvCaptureCAM_PvAPI::close()
 }
 
 // Initialize camera input
-bool CvCaptureCAM_PvAPI::open( int index )
+bool CvCaptureCAM_PvAPI::open( int )
 {
     tPvCameraInfo cameraList[MAX_CAMERAS];
-
     tPvCameraInfo  camInfo;
```

Review comment:
The bug reporter will join also. I think this is incorrect. My Manta is a monocrome camera and returns Mono8 here. This should thus be set to true and false in the 16 bit case. Considering the Proscilla actually uses 16 bit to store a bayer pattern, this is completely normal.
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...

**Code Changes:**
```diff
@@ -139,124 +139,125 @@ void CvCaptureCAM_PvAPI::close()
 }
 
 // Initialize camera input
-bool CvCaptureCAM_PvAPI::open( int index )
+bool CvCaptureCAM_PvAPI::open( int )
 {
     tPvCameraInfo cameraList[MAX_CAMERAS];
-
     tPvCameraInfo  camInfo;
```

Review comment:
Like said above, I think this should be false. Also the further processing is somewhat wrong. We should apply a Bayer2BGR conversion here to capture the color data.
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...

**Code Changes:**
```diff
@@ -139,124 +139,125 @@ void CvCaptureCAM_PvAPI::close()
 }
 
 // Initialize camera input
-bool CvCaptureCAM_PvAPI::open( int index )
+bool CvCaptureCAM_PvAPI::open( int )
 {
     tPvCameraInfo cameraList[MAX_CAMERAS];
-
     tPvCameraInfo  camInfo;
```

Review comment:
In mono16, monocrome should be set to true, not false. - Shai
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...

**Code Changes:**
```diff
@@ -139,124 +139,125 @@ void CvCaptureCAM_PvAPI::close()
 }
 
 // Initialize camera input
-bool CvCaptureCAM_PvAPI::open( int index )
+bool CvCaptureCAM_PvAPI::open( int )
 {
     tPvCameraInfo cameraList[MAX_CAMERAS];
-
     tPvCameraInfo  camInfo;
```

Review comment:
The shold be PvCameraCount() or PvCameraList() both should work. However, it's cleaner to call PvCamaerCount() first in my mind.
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...
**Review Line:** 150

**Code Changes:**
```diff
     tPvCameraInfo  camInfo;
     tPvIpSettings ipSettings;
 
+    // Initialization parameters [500 x 10 ms = 5000 ms timeout]
+    int initializeTimeOut = 500;
 
-    if (PvInitialize()) {
-    }
-    //return false;
+    // Disregard any errors, since this might be called several times and only needs to be called once or it will return an
+    // Important when wanting to use more than 1 AVT camera at the same time
```

Review comment:
This should be changed back to PvInitialize() without checking the return value. The reason is that calls to several PVAPI cameras will fail because PvInitialize() is already initialized after the first camera is opened. The lack of checking for the return code will not effect code as later only there are enough traps to catch for problems
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...

**Code Changes:**
```diff
@@ -139,124 +139,125 @@ void CvCaptureCAM_PvAPI::close()
 }
 
 // Initialize camera input
-bool CvCaptureCAM_PvAPI::open( int index )
+bool CvCaptureCAM_PvAPI::open( int )
 {
     tPvCameraInfo cameraList[MAX_CAMERAS];
-
     tPvCameraInfo  camInfo;
```

Review comment:
This should actually be numCameras=PvCameraList(cameraList, MAX_CAMERAS, NULL); instead. The reason is that we want an updated cameraList after a call to PvInitialize() or the list will be wrong.
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...

**Code Changes:**
```diff
@@ -139,124 +139,125 @@ void CvCaptureCAM_PvAPI::close()
 }
 
 // Initialize camera input
-bool CvCaptureCAM_PvAPI::open( int index )
+bool CvCaptureCAM_PvAPI::open( int )
 {
     tPvCameraInfo cameraList[MAX_CAMERAS];
-
     tPvCameraInfo  camInfo;
```

Review comment:
This check should be removed as well as the fprintf() that follows it and the return call. It adds no value and causes issues with indexing due to the way VideoCapture() works.
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...

**Code Changes:**
```diff
@@ -139,124 +139,125 @@ void CvCaptureCAM_PvAPI::close()
 }
 
 // Initialize camera input
-bool CvCaptureCAM_PvAPI::open( int index )
+bool CvCaptureCAM_PvAPI::open( int )
 {
     tPvCameraInfo cameraList[MAX_CAMERAS];
-
     tPvCameraInfo  camInfo;
```

Review comment:
Again, several cameras with different interfaces will cause this to break down. See my code that uses findNewCamera variable.
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...

**Code Changes:**
```diff
@@ -139,124 +139,125 @@ void CvCaptureCAM_PvAPI::close()
 }
 
 // Initialize camera input
-bool CvCaptureCAM_PvAPI::open( int index )
+bool CvCaptureCAM_PvAPI::open( int )
 {
     tPvCameraInfo cameraList[MAX_CAMERAS];
-
     tPvCameraInfo  camInfo;
```

Review comment:
This if sentence will not be needed once findNewCamera is used as it already opens the cameras one by one.
**File:** modules/highgui/src/cap_pvapi.cpp
**Change Type:** modified
**Context:** PR #3322: fixing cap_pvpapi interface - This PR tries to fix the following 3 reported issues - http://code.opencv.org/issues/3946 - http://code.opencv...
**Review Line:** 300

**Code Changes:**
```diff
-        return (double)ip;
-    }
+        char mEnable[2];
+        char mIp[11];
+        PvAttrEnumGet(Camera.Handle,"MulticastEnable",mEnable,sizeof(mEnable),NULL);
+        if (strcmp(mEnable, "Off") == 0) {
+            return -1;
+        }
+        else {
+            long int ip;
+            int a,b,c,d;
```

Review comment:
Maybe change this to stricmp() for a little more robustness.