Filter applied in the x and y direction :
0.0625	0.25	  0.375	0.25	0.0625

MATRIX to be filtered :
1   2   3   4   5   6   7   

-1   -2   -3   -4   -5   -6   -7   

-10   -20   -30   -40   -50   -60   -70   

8   56   66   12   21   43   75   

21   41   91   81   11   71   51   

Output of OpenCV
-2.40625   -2.92188   -4.125   -5.5   -6.875   -8.07812   -8.59375   

-2.25   -2.97656   -5.33984   -8.72266   -11.5352   -13.0664   -13.5312   

5.40625   5.75781   3.24219   -3.71094   -8.89062   -9.01562   -8.04688   

22.625   26.4453   28.0273   19.6602   13.2539   16.9102   20.8438   

32.3438   38.3438   43.0156   34.7969   28.0938   33.7969   39.3125      

Output of Matlab
-0.53125 	-1	-1.5 000	-2	-2.5 000	-2.75 00	-2.21875 

-1.46875 -2.7343	-5.15234 	-8.47265625 	-11.22265625 	-11.8828125 	-9.13671875 

2.5859375 0	5.21484375 	3.2421875 0	-3.7109375 0	-8.890625 	-8.48828125 	-5.078125 

11.15234375 	22.078125 0	25.3046875 	17.6328125 	11.3515625 	13.03125 	13.08984375 

13.546875 0	26.9765625 	34	29.1875 	23.609375 0	24.4765625 	21.359375 0