Frequency Domain Filtering Problem
Frequency Domain Filtering Problem
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
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Frequency Domain Filtering Problem
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
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
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
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Frequency Domain Filtering Problem
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?
Did you install IM after installing FFTW?
Last edited by fmw42 on 2013-10-30T10:36:00-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Frequency Domain Filtering Problem
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
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
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
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
Also the spectrum lena_blur_r20_spec.png is generated. But we cannot find the result from it.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Frequency Domain Filtering Problem
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?
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.
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
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
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Frequency Domain Filtering Problem
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.Delegates: fftw png png zlib
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Frequency Domain Filtering Problem
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
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
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.
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
Last edited by glennrp on 2013-10-31T19:03:54-07:00, edited 1 time in total.
Re: Frequency Domain Filtering Problem
Also OpenMP is listed in Features
Re: Frequency Domain Filtering Problem
Square31.png is getting the same result as u mentioned above. They are working fine with my system.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Frequency Domain Filtering Problem
Then are you sure that the circle image looks correct?parth1 wrote:Square31.png is getting the same result as u mentioned above. They are working fine with my system.
What is DPC?parth1 wrote:Features: DPC OpenMP
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