fixeg gpu::Laplacian
This commit is contained in:
parent
b880bbcc18
commit
489a1da0ed
@ -395,7 +395,7 @@ CV_EXPORTS void GaussianBlur(const GpuMat& src, GpuMat& dst, Size ksize, GpuMat&
|
|||||||
|
|
||||||
//! applies Laplacian operator to the image
|
//! applies Laplacian operator to the image
|
||||||
//! supports only ksize = 1 and ksize = 3
|
//! supports only ksize = 1 and ksize = 3
|
||||||
CV_EXPORTS void Laplacian(const GpuMat& src, GpuMat& dst, int ddepth, int ksize = 1, double scale = 1, Stream& stream = Stream::Null());
|
CV_EXPORTS void Laplacian(const GpuMat& src, GpuMat& dst, int ddepth, int ksize = 1, double scale = 1, int borderType = BORDER_DEFAULT, Stream& stream = Stream::Null());
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////// Arithmetics ///////////////////////////////////
|
////////////////////////////// Arithmetics ///////////////////////////////////
|
||||||
@ -1094,7 +1094,7 @@ public:
|
|||||||
|
|
||||||
bool use_local_init_data_cost;
|
bool use_local_init_data_cost;
|
||||||
private:
|
private:
|
||||||
GpuMat messages_buffers;
|
GpuMat messages_buffers;
|
||||||
|
|
||||||
GpuMat temp;
|
GpuMat temp;
|
||||||
GpuMat out;
|
GpuMat out;
|
||||||
|
@ -87,7 +87,7 @@ void cv::gpu::Scharr(const GpuMat&, GpuMat&, int, int, int, double, int, int) {
|
|||||||
void cv::gpu::Scharr(const GpuMat&, GpuMat&, int, int, int, GpuMat&, double, int, int, Stream&) { throw_nogpu(); }
|
void cv::gpu::Scharr(const GpuMat&, GpuMat&, int, int, int, GpuMat&, double, int, int, Stream&) { throw_nogpu(); }
|
||||||
void cv::gpu::GaussianBlur(const GpuMat&, GpuMat&, Size, double, double, int, int) { throw_nogpu(); }
|
void cv::gpu::GaussianBlur(const GpuMat&, GpuMat&, Size, double, double, int, int) { throw_nogpu(); }
|
||||||
void cv::gpu::GaussianBlur(const GpuMat&, GpuMat&, Size, GpuMat&, double, double, int, int, Stream&) { throw_nogpu(); }
|
void cv::gpu::GaussianBlur(const GpuMat&, GpuMat&, Size, GpuMat&, double, double, int, int, Stream&) { throw_nogpu(); }
|
||||||
void cv::gpu::Laplacian(const GpuMat&, GpuMat&, int, int, double, Stream&) { throw_nogpu(); }
|
void cv::gpu::Laplacian(const GpuMat&, GpuMat&, int, int, double, int, Stream&) { throw_nogpu(); }
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -1193,7 +1193,7 @@ void cv::gpu::Scharr(const GpuMat& src, GpuMat& dst, int ddepth, int dx, int dy,
|
|||||||
sepFilter2D(src, dst, ddepth, kx, ky, buf, Point(-1,-1), rowBorderType, columnBorderType, stream);
|
sepFilter2D(src, dst, ddepth, kx, ky, buf, Point(-1,-1), rowBorderType, columnBorderType, stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cv::gpu::Laplacian(const GpuMat& src, GpuMat& dst, int ddepth, int ksize, double scale, Stream& stream)
|
void cv::gpu::Laplacian(const GpuMat& src, GpuMat& dst, int ddepth, int ksize, double scale, int borderType, Stream& stream)
|
||||||
{
|
{
|
||||||
CV_Assert(ksize == 1 || ksize == 3);
|
CV_Assert(ksize == 1 || ksize == 3);
|
||||||
|
|
||||||
@ -1206,7 +1206,7 @@ void cv::gpu::Laplacian(const GpuMat& src, GpuMat& dst, int ddepth, int ksize, d
|
|||||||
if (scale != 1)
|
if (scale != 1)
|
||||||
kernel *= scale;
|
kernel *= scale;
|
||||||
|
|
||||||
filter2D(src, dst, ddepth, kernel, Point(-1,-1), stream);
|
filter2D(src, dst, ddepth, kernel, Point(-1,-1), borderType, stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -334,10 +334,7 @@ TEST_P(Laplacian, Accuracy)
|
|||||||
cv::Mat dst_gold;
|
cv::Mat dst_gold;
|
||||||
cv::Laplacian(src, dst_gold, -1, ksize.width);
|
cv::Laplacian(src, dst_gold, -1, ksize.width);
|
||||||
|
|
||||||
if (type == CV_32FC1)
|
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
|
||||||
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
|
|
||||||
else
|
|
||||||
EXPECT_MAT_NEAR(getInnerROI(dst_gold, cv::Size(3, 3)), getInnerROI(dst, cv::Size(3, 3)), 0.0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GPU_Filter, Laplacian, testing::Combine(
|
INSTANTIATE_TEST_CASE_P(GPU_Filter, Laplacian, testing::Combine(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user