MATLAB: Matlab code for Laplacian of Guassian

Image Processing Toolboxlog

Hello,I want to matlab code for Laplacian of Guassian filter. Here is one of the code i applied but there is some problem in it.
img=imread('TEST.jpg');
Log_filter = fspecial('log',[5,5],4.0); % fspecial creat predefined filter.Return a filter.
% 25X25 Gaussian filter with SD =25 is created.
img_LOG = imfilter(img,Log_filter,'symmetric', 'conv');
imshow(img_LOG);

Best Answer

Cast to double, and use [] in imshow(). Try this:
img = double(imread('cameraman.tif'));
Log_filter = fspecial('log', [5,5], 4.0); % fspecial creat predefined filter.Return a filter.
% 25X25 Gaussian filter with SD =25 is created.
img_LOG = imfilter(img, Log_filter, 'symmetric', 'conv');
imshow(img_LOG, []);