[SciPy-User] Image with black points

Zachary Pincus zachary.pincus at yale.edu
Tue Apr 26 10:49:59 EDT 2011


I don't know if it's image IO differences (I don't use PIL) or what,  
but the results I get look quite different than what you've shown. Did  
"face.jpg" get re-encoded by ImageShack (I downloaded a "faceg.jpg" --  
that might have altered some frequency bands that you see in the FFT  
which are absent in what I calculated.

Nevertheless, I see some "dark spots" too, but nothing seems wrong  
with them. Are you sure it's an error?

Why don't you figure out the pixel coordinates of a dark spot in your  
output, and then look at the calculated values in the various  
intermediate numpy arrays at that position (don't forget to transpose  
the coords) to satisfy yourself that the calculation is correct?

Zach


On Apr 25, 2011, at 7:32 PM, Paulo Henrique Junqueira Amorim wrote:

> On 25 April 2011 14:15, Zachary Pincus <zachary.pincus at yale.edu>  
> wrote:
> On Apr 24, 2011, at 10:22 PM, Paulo Henrique Junqueira Amorim wrote:
>
> > Hi,
> >
> > I'm computing the 1D fft from image, and saving the image of
> > frequency.
> >
> > But the saved image appears black point's (example image), it seems
> > that do not belong.
> >
> > Is this correct? How could I remove it?
> >
> > Example image - http://img818.imageshack.us/i/fftthreshold.png/
> >
> > Code:
> >
> > import scipy
> > import numpy
> >
> > r = scipy.misc.pilutil.imread('face.jpg', 'F')
> >
> > fft = numpy.fft.fftshift(numpy.fft.fft(r).real)
> > fft_2d = numpy.log10(numpy.abs(fft))
> > pil_array = scipy.misc.pilutil.toimage(fft_2d)
> >
> > scipy.misc.pilutil.imsave('fft.tif', pil_array)
> >
>
> If you could provide the input image that would be helpful for people
> trying to determine what the issue is.
>
> As a stab in the dark -- have you checked (from python) what the
> values of at the "black points" are? Are they NaNs? (Perhaps from the
> log10 operation?)
>
> Zach
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
>
> Hi Zachary,
>
> The image of input:  http://img846.imageshack.us/i/faceg.jpg/
>
> Image before moving on log10.http://img215.imageshack.us/i/fftthreshold2.png/
>
> Thx,
> Paulo




More information about the SciPy-User mailing list