Let g be the core of the gaussian and f image. Then f * g (convolution) gives a blurry version of the image. This means a low-passed version of the image.
Then consider
. This means image - lowpass image . This gives a high-passed image version. It contains only images. Details are on a white background. I think this is the image that you are getting right now.

After you have extracted the image details from the image, you must add them back to the image in order to get a sharpened image.

This means that you can get a sharpened image by convolving 2e - g with your image (this is a blur mask).
You can get 2e from matlab with padarray(2,[2 2]) and g with fspecial('gaussian' ,[5 5],2) .
H = padarray(2,[2 2]) - fspecial('gaussian' ,[5 5],2); %create unsharp mask
Sometimes you need to control the brightness of the image details. You can do it with
sharpen image = image + alpha (image details)

source share