mirror of
https://github.com/opencv/opencv.git
synced 2025-01-19 06:53:50 +08:00
fixed GPU minMaxLoc test, updated docs
This commit is contained in:
parent
d7e612cd4b
commit
202e239cbd
@ -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}.
|
||||
See also: \cvCppCross{countNonZero}.
|
||||
|
BIN
doc/opencv.pdf
BIN
doc/opencv.pdf
Binary file not shown.
@ -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<unsigned char>(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()),
|
||||
|
Loading…
Reference in New Issue
Block a user