Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why LOG filter is returning the black background image?

I had taken co-relation of image with LOG filter via imfilter command.

z=imfilter(I,fspecial('log',11,1.5)); 
figure
imshow(z);

Image:

enter image description here

like image 685
M.Zaman Avatar asked Oct 20 '14 16:10

M.Zaman


2 Answers

Converting the image to double (double precision) will resolve the issue because imread command took the image in default unit8 (unsigned int) format.

like image 72
M.Zaman Avatar answered Nov 01 '22 23:11

M.Zaman


The problem you have is that you are not showing the result properly.

Your result is in range 0-31, but you need to convert it to 0-255 to plot it!

do

imshow(mat2gray(z))

enter image description here

like image 3
Ander Biguri Avatar answered Nov 01 '22 21:11

Ander Biguri