Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Laplace matlab opencv differences

Hello I wanted to implement the imfilter with the Laplace option (Sobel option worked perfectly) but I it gives a totally different result. While in the Sobel option both filter2d and the Sobel itself gives me the same result in case of of Laplace the results are different from Matlab For the Laplace implementation I used:

Mat LAP = (Mat_<double>(3,3) << 1/6, 2/3, 1/6, 2/3, -10/3, 2/3, 1/6, 2/3, 1/6);

And then used the 2D filter:

filter2D(red1,LAP_CONV,CV_64F,LAP);

And the results are totally different

Moreover when I use

Laplacian(red1,LAP_CONV,CV_64F);

Only on my ROI the results are pretty much the same as if I used Matlab on the whole image And yes I know that the matrixes for Laplace in OPENCV and Matlab are different

The result was checked by std squared

Thanks in advanced for all your help