Matlab code for Laplacian of Guassian

조회 수: 41 (최근 30일)
Tahir
Tahir 2014년 8월 25일
댓글: Image Analyst 2014년 8월 25일
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);

채택된 답변

Image Analyst
Image Analyst 2014년 8월 25일
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, []);
  댓글 수: 3
Tahir
Tahir 2014년 8월 25일
Thanks...I just read on a forum that "for RGB images use imfilter function and for intensity images use filter2 function"...is it true?? as in my case the image is intensity image so what can i do?
Image Analyst
Image Analyst 2014년 8월 25일
I don't know who would say that. Doesn't sound right to me. Does that person actually do image processing? All images have values, which can represent anything, but usually intensity (actually joules, but that's a whole other sidebar topic), but can be something else like absorption, range (distance), pressure, temperature, etc. imfilter() can do color images one color channel at a time, or monochrome images. filter2() can do monochrome images. I would ask the person who said that for more clarification. You can use imfilter(), filter2(), xcorr2(), or conv2() to do your monochrome image.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by