MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Image Processing

  • To: mathgroup at
  • Subject: [mg66110] Re: Image Processing
  • From: David Bailey <dave at>
  • Date: Sat, 29 Apr 2006 03:41:21 -0400 (EDT)
  • References: <e2srgo$3bv$>
  • Sender: owner-wri-mathgroup at

Charlie Springer wrote:
> Hi all.
> Old physicist, new Mathematica user.
> I want to perform 2D FFT's on images. I have used Import to get a JPEG into 
> apparently, a graphic object. I can not see how to get it into a "list of 
> lists" or any form acceptable to Fourier[].
> Anybody have a snippet or some experience? I'm still learning the 
> terminology. If this works out I'll get the grid version for a Mac Quad.
> -- Charlie Springer

When you import a JPEG file you end up with a Graphics object, whose 
structure is suppressed for convenience by the FrontEnd, but it is easy 
to examine, taking care not to spill a super large set of numbers into 
the notebook:



Graphics[Raster[{{{73, 54, 0}, {72, 53, 0}, {<<3>>}, <<96>>, {55, 37, 
1}}, <<34>>}, <<3>>], <<3>>]

So image[[1,1]] is a 2-D array of colour triples - which you can boil 
down to a single number (e.g. by summing them to get a gray scale) and 
apply the Fourier transform.

Note that although other types of images - such as GIF - import as a 
Graphics structure, the internal structure is not the same (but there 
are some GIF-specific Import options to solve this if you require them).

David Bailey

  • Prev by Date: Re: How Functions are Applied to Matrices
  • Next by Date: Re: nearest neighbor
  • Previous by thread: Re: Image Processing
  • Next by thread: Solving a double integration and feeding function...