FFT with Magick++

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
smajler
Posts: 28
Joined: 2013-05-17T09:26:53-07:00
Authentication code: 6789

FFT with Magick++

Post by smajler » 2013-11-02T12:02:16-07:00

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.

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

Re: FFT with Magick++

Post by fmw42 » 2013-11-02T12:09:54-07:00

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++.

smajler
Posts: 28
Joined: 2013-05-17T09:26:53-07:00
Authentication code: 6789

Re: FFT with Magick++

Post by smajler » 2013-11-02T12:32:58-07:00

I have compiled 8bit with HDRI. FFTW included. In cmd all FFT/IFT scripts work, now i'd like to use it in c++.

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

Re: FFT with Magick++

Post by fmw42 » 2013-11-02T12:35:31-07:00

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

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

Re: FFT with Magick++

Post by fmw42 » 2013-11-02T12:42:50-07:00

try

Magick::Image.forwardFourierTransform

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

smajler
Posts: 28
Joined: 2013-05-17T09:26:53-07:00
Authentication code: 6789

Re: FFT with Magick++

Post by smajler » 2013-11-02T13:09:33-07:00

do not work

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

Re: FFT with Magick++

Post by fmw42 » 2013-11-02T14:08:10-07:00

Unless someone else knows, you will have to wait for one of the IM developers to respond. It is over my head.

User avatar
dlemstra
Posts: 1563
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: FFT with Magick++

Post by dlemstra » 2013-11-02T15:18:11-07:00

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?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

smajler
Posts: 28
Joined: 2013-05-17T09:26:53-07:00
Authentication code: 6789

Re: FFT with Magick++

Post by smajler » 2013-11-03T13:25:30-07:00

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

smajler
Posts: 28
Joined: 2013-05-17T09:26:53-07:00
Authentication code: 6789

Re: FFT with Magick++

Post by smajler » 2013-11-03T14:13:26-07:00

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).

Post Reply