Creating a custom kernel for convolution

How do I create a custom kernel (laplace) and then convolve it with my input image efficiently ?

Actually found a small discussion on this topic.
We can close this topic.