Page 1 of 1

FFT with Magick++

Posted: 2013-11-02T12:02:16-07:00
by smajler
Hi i'm trying to do convolution/deconvolution in Magick++ according to scripts at http://www.imagemagick.org/Usage/fourier/fft_math/.

Now i'm stuck on FFT, in Magick++ there is a function:
Magick::forwardFourierTransformImage and i'm trying to use it with:

Code: Select all

Magick::Image images[2];
Magick::forwardFourierTransformImage(images,kernel,true);
But i'm getting error:

Code: Select all

Error	48	error C2039: 'clear' : is not a member of 'Magick::Image'	F:\Image Editor\ImageMagick-6.8.7\Magick++\lib\Magick++\STL.h	2291
How can i do it with Magick++. Anyway i saw that there is an inverse fourier function like:

Code: Select all

Magick::inverseFourierTransformImage
and

Code: Select all

Magick::Image.inverseFourierTransform
but Image doesn't have forwardFourierTransform.

Re: FFT with Magick++

Posted: 2013-11-02T12:09:54-07:00
by fmw42
What version of IM and platform are you using? Did you install FFTW delegate? Does convert -version list fftw?

Sorry I know nothing about Magick++.

Re: FFT with Magick++

Posted: 2013-11-02T12:32:58-07:00
by smajler
I have compiled 8bit with HDRI. FFTW included. In cmd all FFT/IFT scripts work, now i'd like to use it in c++.

Re: FFT with Magick++

Posted: 2013-11-02T12:35:31-07:00
by fmw42
smajler wrote:I have compiled 8bit with HDRI. FFTW included. In cmd all FFT/IFT scripts work, now i'd like to use it in c++.
OK. Just wanted to be sure everything was installed. Sorry I do not know Magick++ only the command line.

I have tutorials for the command line at http://www.fmwconcepts.com/imagemagick/ ... urier.html

Re: FFT with Magick++

Posted: 2013-11-02T12:42:50-07:00
by fmw42
try

Magick::Image.forwardFourierTransform

even though it is not listed, it may just be an oversight

Re: FFT with Magick++

Posted: 2013-11-02T13:09:33-07:00
by smajler
do not work

Re: FFT with Magick++

Posted: 2013-11-02T14:08:10-07:00
by fmw42
Unless someone else knows, you will have to wait for one of the IM developers to respond. It is over my head.

Re: FFT with Magick++

Posted: 2013-11-02T15:18:11-07:00
by dlemstra
You should use a std::list as the first parameter of forwardFourierTransformImage.

Are you aware that FFTW is GPL: http://www.fftw.org/faq/section1.html#isfftwfree?

Re: FFT with Magick++

Posted: 2013-11-03T13:25:30-07:00
by smajler
I've used std::list<Magick::Image> images;
but when i try to build app i'm getting linking errors:
I have added fftw directories to my project but it doesn't help. FFT works in console.

Code: Select all

1>main.obj : error LNK2001: unresolved external symbol __imp__DestroyExceptionInfo
1>main.obj : error LNK2001: unresolved external symbol __imp__ForwardFourierTransformImage
1>main.obj : error LNK2001: unresolved external symbol __imp__GetExceptionInfo

Re: FFT with Magick++

Posted: 2013-11-03T14:13:26-07:00
by smajler
smajler wrote:I've used std::list<Magick::Image> images;
but when i try to build app i'm getting linking errors:
I have added fftw directories to my project but it doesn't help. FFT works in console.

Code: Select all

1>main.obj : error LNK2001: unresolved external symbol __imp__DestroyExceptionInfo
1>main.obj : error LNK2001: unresolved external symbol __imp__ForwardFourierTransformImage
1>main.obj : error LNK2001: unresolved external symbol __imp__GetExceptionInfo
SOLVED:
needed to add to linker lib: CORE_RL_magick_.lib (or CORE_DB_magick_.lib for debug).