Ask Your Question
0

Assertion from cuda GaussianFilter

asked 2017-12-29 17:34:26 -0600

mkallay gravatar image

My code below fails with "Assertion failed (src.type() == srcType_) in `anonymous-namespace'::SeparableLinearFilter::apply, file D:\local\opencv\sources\modules\cudafilters\src\filtering.cpp, line 404". I am Using OpenCV 3.0 and CUDA 7.5. My function computeGradientNorm returns a GpuMat of type CV_32FC1. What am I doing wrong?

GpuMat computeBlurredGradientNorm(const GpuMat &mat)
{
    GpuMat norm = computeGradientNorm(mat);
    GpuMat result(norm.rows, norm.cols, norm.type());
    cv::Ptr<cv::cuda::Filter> gauss = cv::cuda::createGaussianFilter(norm.type(), result.type(), cv::Size(5, 5), 1);
    gauss->apply(mat, result);
    return result;
}
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-12-30 03:38:05 -0600

LBerger gravatar image

updated 2017-12-30 05:25:00 -0600

A good idea is to update your code to opencv 3.4. In your example norm.type() is not equal to mat.type()

edit flag offensive delete link more

Comments

1

Oops, the second to last statement should be apply(norm, result). Thanks for detecting this bug for me. Michael

mkallay gravatar imagemkallay ( 2018-01-03 10:20:20 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-12-29 17:33:48 -0600

Seen: 398 times

Last updated: Dec 30 '17