help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about the function "imwrite"


From: Divakar Ramachandran
Subject: Re: about the function "imwrite"
Date: Fri, 18 Nov 2011 23:00:36 +0530
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110921 Lightning/1.0b2 Thunderbird/3.1.15

On Friday 18 November 2011 07:15 PM, Przemek Klosowski wrote:
On 11/17/2011 04:42 PM, Yaowang wrote:

octave:1> x=imread('1149.tiff')
octave:2> imshow(x)
octave:3> y=fft(x);
octave:4> imshow(y)
warning: imshow: only showing real part of complex image
octave:5> imwrite("1149.img",y)

It's the second time in few weeks when someone tries to display and save FFTs of images. That doesn't make any sense to me---is there something I'm missing here? Is it some kind of image processing trick that treats Fourier coefficients as an image on its own?

It makes sense when you have periodic images such as those recorded under phase contrast conditions in a transmission electron microscope, from crystalline / amorphous specimen. The FFT then is analogous to a diffraction pattern. In a strict sense it is the power spectrum that is displayed on screen, usually log compressed to handle the dynamic range. Image processing software such as the old semper from Synaptic, UK would allow saving the FT in some format that could be read back and IFFT applied with or without filtering. ImageJ allows saving as TIFF but what is actually saved is a log compressed 8-bit TIFF which when read back is a real space "image" of the power spectrum.

As far as the original post is concerned, computation time involved being insignificant, there is no point storing the FFT - it could just be calculated again when required from the source image; if an "image" of the FFT is required, you could use something like (Warning: This is just off the top of my head - I don't have octave at hand to check syntax at the moment)

z = log(abs(y));
imwrite(z,"PS","TIFF");
 
HTH,
Divakar

_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave



--
Divakar Ramachandran Anupuram, TN 603127, INDIA

reply via email to

[Prev in Thread] Current Thread [Next in Thread]