fixed GPU minMaxLoc test, updated docs

pull/13383/head
Alexey Spizhevoy 14 years ago
parent d7e612cd4b
commit 202e239cbd
  1. 6
      doc/gpu_matrix_reductions.tex
  2. 150414
      doc/opencv.pdf
  3. 8
      tests/gpu/src/arithm.cpp

@ -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}.

File diff suppressed because it is too large Load Diff

@ -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…
Cancel
Save