if (!deviceSupports(FEATURE_SET_COMPUTE_13))
CV_Error(cv::Error::StsNotImplemented, "Not sufficient compute capebility");
- const GpuMat src = getInputMat(_src, stream);
+ GpuMat src = getInputMat(_src, stream);
CV_Assert( src.type() == CV_8UC1 );
- GpuMat dst = getOutputMat(_dst, 1, 2, CV_64FC1, stream);
+ _dst.create(1, 2, CV_64FC1);
+ GpuMat dst = _dst.getGpuMat();
NppiSize sz;
sz.width = src.cols;
BufferPool pool(stream);
GpuMat buf = pool.getBuffer(1, bufSize, CV_8UC1);
+ // detail: https://github.com/opencv/opencv/issues/11063
+ //NppStreamHandler h(StreamAccessor::getStream(stream));
+
nppSafeCall( nppiMean_StdDev_8u_C1R(src.ptr<Npp8u>(), static_cast<int>(src.step), sz, buf.ptr<Npp8u>(), dst.ptr<Npp64f>(), dst.ptr<Npp64f>() + 1) );
syncOutput(dst, _dst, stream);
void cv::cuda::equalizeHist(InputArray _src, OutputArray _dst, Stream& _stream)
{
- GpuMat src = _src.getGpuMat();
+ GpuMat src = getInputMat(_src, _stream);
CV_Assert( src.type() == CV_8UC1 );
}
};
+CUDA_TEST_P(EqualizeHist, Async)
+{
+ cv::Mat src = randomMat(size, CV_8UC1);
+
+ cv::cuda::Stream stream;
+
+ cv::cuda::GpuMat dst;
+ cv::cuda::equalizeHist(loadMat(src), dst, stream);
+
+ stream.waitForCompletion();
+
+ cv::Mat dst_gold;
+ cv::equalizeHist(src, dst_gold);
+
+ EXPECT_MAT_NEAR(dst_gold, dst, 3.0);
+}
+
CUDA_TEST_P(EqualizeHist, Accuracy)
{
cv::Mat src = randomMat(size, CV_8UC1);