I am trying to understand the logic behind unsharp filter in matlab. If I type:
image = imread('nameoffile');
filter = fspecial('unsharp', 0.5);
resultImage = imfilter(image, filter);
resultImage is sharper than image. I opened fspecial.m file and saw that unsharp filter is created as:
h = [0 0 0;0 1 0;0 0 0] - fspecial('laplacian',alpha);
If I filter an image with this matrix:
[0 0 0;
0 1 0;
0 0 0;]
result image is the same with original one. I know laplacian filter detects sharp edges. So, if we subtract sharp edges from an image we must get blurred image, I suppose. However, if we filter an image with h matrix(unsharp filter), we get sharper image. I did not understand the logic.