# 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

take a look at the filter2D docs again (convolution vs. correlation)

Yes I need convolution its default option as my imfilter function is:

Where I took the h from

~~so you need to flip(kernel, -1)~~Its symmetrical (and try it anyway same answer :) )

oh, right missed it ;)