Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assertion from cuda::createGaussianFilter

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;
}