problem with fourier spectrum
-
- Posts: 2
- Joined: 2015-12-29T16:52:13-07:00
- Authentication code: 1151
problem with fourier spectrum
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: problem with fourier spectrum
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
Then convert to polar coordinates using
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
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.
Code: Select all
convert image -fft -delete 1 -evaluate log 10000 spectrum.png
Code: Select all
convert spectrum.png -virtual-pixel Black -distort depolar 0 spectrum_polar.png
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.
-
- Posts: 2
- Joined: 2015-12-29T16:52:13-07:00
- Authentication code: 1151
Re: problem with fourier spectrum
Thanks a lot, but I need to implement that in matlab.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: problem with fourier spectrum
This is an Imagemagick forum. I doubt any one here uses Matlab. You should probably ask on a Matlab forum.guus_hiddink wrote:Thanks a lot, but I need to implement that in matlab.