diff --git a/doc/gpu_matrix_reductions.tex b/doc/gpu_matrix_reductions.tex index 875d751814..9a8e3f2484 100644 --- a/doc/gpu_matrix_reductions.tex +++ b/doc/gpu_matrix_reductions.tex @@ -89,7 +89,7 @@ void minMax(const GpuMat\& src, double* minVal, double* maxVal,\par \cvarg{src}{Single-channel source image.} \cvarg{minVal}{Pointer to returned minimum value. \texttt{NULL} if not required.} \cvarg{maxVal}{Pointer to returned maximum value. \texttt{NULL} if not required.} -\cvarg{mask}{Optional mask to select a sub-matrix.} +\cvarg{mask}{Optional mask to select a sub-matrix. Please note the result is undefined in the case of empty mask.} \cvarg{buf}{Optional buffer to avoid extra memory allocations. It's resized automatically.} \end{description} @@ -112,7 +112,7 @@ void minMaxLoc(const GpuMat\& src, double* minVal, double* maxVal,\par \cvarg{maxVal}{Pointer to returned maximum value. \texttt{NULL} if not required.} \cvarg{minValLoc}{Pointer to returned minimum location. \texttt{NULL} if not required.} \cvarg{maxValLoc}{Pointer to returned maximum location. \texttt{NULL} if not required.} -\cvarg{mask}{Optional mask to select a sub-matrix.} +\cvarg{mask}{Optional mask to select a sub-matrix. Please note the result is undefined in the case of empty mask.} \cvarg{valbuf}{Optional values buffer to avoid extra memory allocations. It's resized automatically.} \cvarg{locbuf}{Optional locations buffer to avoid extra memory allocations. It's resized automatically.} \end{description} @@ -132,4 +132,4 @@ int countNonZero(const GpuMat\& src, GpuMat\& buf);} \end{description} Function doesn't work with \texttt{CV\_64F} images on GPU with compute capability $<$ 1.3.\newline -See also: \cvCppCross{countNonZero}. \ No newline at end of file +See also: \cvCppCross{countNonZero}. diff --git a/doc/opencv.pdf b/doc/opencv.pdf index d637273e87..c271841663 100644 Binary files a/doc/opencv.pdf and b/doc/opencv.pdf differ diff --git a/tests/gpu/src/arithm.cpp b/tests/gpu/src/arithm.cpp index 54e0c0821f..1d575cfb4b 100644 --- a/tests/gpu/src/arithm.cpp +++ b/tests/gpu/src/arithm.cpp @@ -829,6 +829,10 @@ struct CV_GpuMinMaxLocTest: public CvTest cv::Mat mask(src.size(), CV_8U); rng.fill(mask, RNG::UNIFORM, Scalar(0), Scalar(2)); + // At least one of mask elements must be non zero as OpenCV returns 0 + // in such case, our implementation returns max value + mask.at(0, 0) = 1; + double minVal, maxVal; cv::Point minLoc, maxLoc; @@ -855,6 +859,10 @@ struct CV_GpuMinMaxLocTest: public CvTest cv::Point minLoc_, maxLoc_; cv::gpu::minMaxLoc(cv::gpu::GpuMat(src), &minVal_, &maxVal_, &minLoc_, &maxLoc_, cv::gpu::GpuMat(mask), valbuf, locbuf); + cout << rows << " " << cols << " " << depth << endl; + cout << minVal << " " << minVal_ << endl; + cout << maxVal << " " << maxVal_ << endl; + CHECK(minVal == minVal_, CvTS::FAIL_INVALID_OUTPUT); CHECK(maxVal == maxVal_, CvTS::FAIL_INVALID_OUTPUT); CHECK(0 == memcmp(src.ptr(minLoc.y) + minLoc.x * src.elemSize(), src.ptr(minLoc_.y) + minLoc_.x * src.elemSize(), src.elemSize()),