Saving filtered image

1 view (last 30 days)
Philip on 14 Mar 2011
I have tested some code that applies homomorphic filtering to an image in the logarithmic space:
%%%%%log of image
%%%%%DFT of logged image
%%%%%Filter Applying DFT image
%%%%Inverse DFT of filtered image
%%%%%Inverse log
When this process is complete, the image can be displayed using imshow(im_e,[]), but since im_e is of type double I cannot save it as per what is seen from the imshow statement...
Does anyone know how to solve this problem so that the image can be saved properly?
Many thanks!

Accepted Answer

Philip on 15 Mar 2011
% convert image to intensities
int_vals = mat2gray(im_e);
% save intensities using imwrite
imwrite(int_vals, 'filtered_image.png');

More Answers (1)

Sean de Wolski
Sean de Wolski on 14 Mar 2011
doc imwrite
Philip on 15 Mar 2011
Thanks, I played about for a while after your last comment and found that the easiest solution was to convert the data values to intensities using "mat2gray", and then saving the image as a PNG using "imwrite". This function converts the intensities to pixel values automatically before saving.
Thanks again!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by