Home Why LOG filter is returning the black background image?
Reply: 3

Why LOG filter is returning the black background image?

M.Zaman
1#
M.Zaman Published in 2014-10-20 16:20:17Z

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:

M.Zaman
2#
M.Zaman Reply to 2014-10-21 15:02:24Z

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

Ander Biguri
3#
Ander Biguri Reply to 2014-10-20 16:32:33Z

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))

Dima
4#
Dima Reply to 2014-10-22 19:43:53Z

The best way to solve this problem is not to change your image, but to change the way imshow displays it. Try this:

>> imshow(z, [0, 31]);

Or, better yet, try this:

>> imshow(z, []);

which will re-scale the image automatically, mapping the minimum value to 0 and the maximum to 255.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.391746 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO