problem with fourier spectrum

Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.
Locked
guus_hiddink
Posts: 2
Joined: 2015-12-29T16:52:13-07:00
Authentication code: 1151

problem with fourier spectrum

Post by guus_hiddink »

I need to show the Fourier spectrum of the image and determine one dimensional spectrum in the form: S(theta)=sum(Sr(theta)), where the limits of the sum are r=1 and r=Ro where Ro is the radius of a circle centered at the origin. Can someone help me? Thanks

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: problem with fourier spectrum

Post by fmw42 »

Sorry, I am not sure I understand fully. Image spectra are 2D not 1D. Are you asking to create the 2D spectra and then average over all angles for each radius. If so, then create the 2D spectrum from

Code: Select all

convert image -fft -delete 1 -evaluate log 10000 spectrum.png
Then convert to polar coordinates using

Code: Select all

convert spectrum.png -virtual-pixel Black -distort depolar 0 spectrum_polar.png
Then average all columns to 1 column and the result is a 1D image of what you want.

You can then list the values using txt: format output

Code: Select all

convert spectrum_polar.png -scale 1x! txt:

see
http://www.fmwconcepts.com/imagemagick/ ... urier.html
http://www.imagemagick.org/Usage/fourier/
http://www.imagemagick.org/script/comma ... ns.php#fft
http://www.imagemagick.org/Usage/distorts/#depolar
http://www.imagemagick.org/script/comma ... .php#scale
http://www.imagemagick.org/script/comma ... p#geometry
http://www.imagemagick.org/Usage/files/#txt

In the future, when asking questions on this forum, please identify your Imagemagick version and platform, since syntax differs on Windows and Unix systems.

guus_hiddink
Posts: 2
Joined: 2015-12-29T16:52:13-07:00
Authentication code: 1151

Re: problem with fourier spectrum

Post by guus_hiddink »

Thanks a lot, but I need to implement that in matlab.

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: problem with fourier spectrum

Post by fmw42 »

guus_hiddink wrote:Thanks a lot, but I need to implement that in matlab.
This is an Imagemagick forum. I doubt any one here uses Matlab. You should probably ask on a Matlab forum.

Locked