Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is this a bug or not about filter2D?

image description

Hi all: Above pic is orginal picture. I try some kernels to check filter2D.But some kernels i get right result,somethings are not. So I am confused that the code is wrong,or there are some bugs in filter2D. The code is here: float m[] = {-1.0, -1.0, -1.0, -1.0, 10.0, -1.0, -1.0, -1.0, -1.0 }; cv::Mat kernel=cv::Mat(3,3,CV_32F,m); //cv::normalize(kernel,kernel,1.0,0,NORM_L1); filter2D(src, dst,-1,kernel); kernel.release();

But I get image description This is wrong pic. I ever use imagj & ni vision to check result. The correct pic should be liked image description How to do?If I want to get correct image!

click to hide/show revision 2
fixed code-tags and some language errors

Is this a bug or not about filter2D?

image description

Hi all: Above pic is the orginal picture. I try tried some kernels to check filter2D.But filter2D. For some kernels i get right result,somethings are result, sometimes not. So I am confused that the code is wrong,or wrong, or that there are some bugs in filter2D. The code is here: here:

float m[] = {-1.0, -1.0, -1.0,
-1.0, 10.0, -1.0,
-1.0, -1.0, -1.0 };
cv::Mat kernel=cv::Mat(3,3,CV_32F,m);
//cv::normalize(kernel,kernel,1.0,0,NORM_L1);
filter2D(src, dst,-1,kernel);
kernel.release();

kernel.release();

But I get get:

image description

This is the wrong pic. I ever use imagj & ni vision to check result. The correct pic should be liked like

image description

How

What to do?If do? I want to get correct image!