Page 1 of 1
Frequency Domain Filtering Problem
Posted: 2013-10-29T21:45:20-07:00
by parth1
Hello,
The problem with me is that I am getting same image as result after running scripts for low pass filter as well as high pass filter from the following link .
http://www.imagemagick.org/Usage/fourier/
Kindly Help
Parth
Re: Frequency Domain Filtering Problem
Posted: 2013-10-29T21:53:58-07:00
by fmw42
What is your version of IM and platform? Did you install FFTW delegate? It should show when you do
convert -version
Are you running HDRI compile of IM?
What is your exact command? Can you provide the input image?
Please review
viewtopic.php?f=1&t=9620
Re: Frequency Domain Filtering Problem
Posted: 2013-10-30T09:02:20-07:00
by parth1
I am using IM 6.8.7-1 and also I have installed FFTW delegate. Using Ubuntu 13
The problem is when I run command
convert -size 128x128 xc:black -fill white \
-draw "circle 64,64 44,64" circle_r20.png
It is generating expected image with white circle at center of specific radius.
but when I go for Command
convert lena.png -fft \
\( -clone 0 circle_r20.png -compose multiply -composite \) \
\( +clone -evaluate log 10000 -write lena_blur_r20_spec.png +delete \) \
-swap 0 +delete -ift lena_blur_r20.png
The resultant image is same as original lena.png . It is not at all blurring the image.
--Parth
Re: Frequency Domain Filtering Problem
Posted: 2013-10-30T09:58:12-07:00
by fmw42
Does convert -version show fftw as a delegate? You may have it installed, but IM does not recognize it?
Did you install IM after installing FFTW?
Re: Frequency Domain Filtering Problem
Posted: 2013-10-30T10:04:16-07:00
by fmw42
Those commands works fine for me under IM 6.8.7.3 Q16 Mac OSX Snow Leopard.
Be sure you are using the 128x128 version of the lena image.
convert -version
Version: ImageMagick 6.8.7-3 2013-10-25 Q16
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib
fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps png tiff x xml zlib
Re: Frequency Domain Filtering Problem
Posted: 2013-10-30T20:53:00-07:00
by parth1
Yes I have installed IM after installing FFTW.
convert -fft is working fine with my system. I am resizing the lena image to 128x128 before processing it.
But still the result is same. No blurring. I also checked it for HIgh Pass Filter, but result's same.
I dont know about HDRI compile.
Regards,
Parth
Re: Frequency Domain Filtering Problem
Posted: 2013-10-30T21:08:06-07:00
by parth1
Also the spectrum lena_blur_r20_spec.png is generated. But we cannot find the result from it.
Re: Frequency Domain Filtering Problem
Posted: 2013-10-30T21:33:03-07:00
by fmw42
What does your system return for
convert -version
Does it list fftw? If so what is the version of FFTW on your system?
Does it list OpenMP? If so, perhaps you need to reinstall IM with OpenMP disabled.
As I mentioned above, it works fine for me on IM 6.8.7.3 Q16. I am trying to find out what may be different on your system that might cause a problem. Do you have write permissions for where you are trying to save all the images.
Does this work without creating the spectrum?
Code: Select all
convert lena.png -fft \
\( -clone 0 circle_r20.png -compose multiply -composite \) \
-swap 0 +delete -ift lena_blur_r20.png
P.S. Might you have multiple versions of IM installed on your system. Typical locations are /usr/bin/convert and /usr/local/bin/convert.
You can try
type -a convert
and see if it lists more than one version.
Re: Frequency Domain Filtering Problem
Posted: 2013-10-31T06:13:11-07:00
by parth1
Yes I am doing work in root.
Convert -version
Version: ImageMagick 6.8.7-1 2013-10-19 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: fftw png png zlib
Also it is not working for code you provided to me.
And for type -a convert
convert is /usr/local/bin/convert
Re: Frequency Domain Filtering Problem
Posted: 2013-10-31T09:40:50-07:00
by fmw42
Delegates: fftw png png zlib
Why is png listed twice? Oddly, I see it is listed twice in my list also. I will have to notify the IM developers. But this is not the problem, since your commands work for me.
Re: Frequency Domain Filtering Problem
Posted: 2013-10-31T09:51:29-07:00
by fmw42
try the following and see if you get the same results as shown below.
Input:
convert square31.png -fft square31_fft_mp.png
convert square31_fft_mp-0.png -auto-level -evaluate log 10000 square31_fft_mp-0_al_log10000.png
Re: Frequency Domain Filtering Problem
Posted: 2013-10-31T10:13:12-07:00
by glennrp
PNG is listed twice for me, too. It seems to be due to a cut-and-paste
error in GetMagickDelegates (in magick/version.c). I've fixed that
in the SVN repository for IM6 and IM7. The fix should show up in
IM-6.8.7-5.
- glenn.rp> q16convert -version
Version: ImageMagick 6.8.7-3 2013-10-24 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: fontconfig freetype jng jpeg png png x xml zlib
Re: Frequency Domain Filtering Problem
Posted: 2013-10-31T18:21:36-07:00
by parth1
Also OpenMP is listed in Features
Re: Frequency Domain Filtering Problem
Posted: 2013-10-31T18:27:54-07:00
by parth1
Square31.png is getting the same result as u mentioned above. They are working fine with my system.
Re: Frequency Domain Filtering Problem
Posted: 2013-10-31T19:37:07-07:00
by fmw42
parth1 wrote:Square31.png is getting the same result as u mentioned above. They are working fine with my system.
Then are you sure that the circle image looks correct?
parth1 wrote:Features: DPC OpenMP
What is DPC?
Does make any difference if you turn alpha off after creating the circle?
convert -size 128x128 xc:black -fill white -draw "circle 64,64 44,64"
-alpha off circle_r20.png
Try the above and check the circle image. Then try
Code: Select all
convert lena.png -fft lena_fft_mp.png
convert lena_fft_mp-0.png circle_r20.png -compose multiply -composite lena_fft_mag_filtered.png
convert lena_fft_mag_filtered.png lena_fft_mp-1.png -ift lena_blur_r20.png