# PYTHON Calculating Laplacian of Gaussian Kernel Matrix

I've been trying to create a LoG kernel for various sigma values. But the problem is that I always get float value matrix and I need integer value matrix as it is published on every document. I haven't find a method.

1st image: My functions and my output

2nd image: My expected matrix

• “integer value matrix as it is published on every document”. A LoG needs floating-point weights. You can scale it and round the values, but it will no longer be a proper LoG. The image you show is not a proper LoG. You also need to create a larger kernel that a 3x3. Use for example 2*ceil(3*sigma)+1 for the size. If you want to be more precise, use 4 instead of 3. – Cris Luengo Mar 17 at 14:12
• “integer value matrix as it is published on every document” means "I want to create the matrix below" – Fatih M. Mar 17 at 15:35
• Don’t expect to create that using exp or anything related to a Gaussian. You can simply copy those weights if you want to reproduce what the paper does, but know that that is not a LoG! – Cris Luengo Mar 17 at 15:37