Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
When I try MagickForwardFourierTransformImage in a test program it only returns one image in the MagickWand (checked with MagickNumberImages after the call). If I request the mag/phase I only get the magnitude and requesting real/imag only returns the real component. Shouldn't MagickForwardFourierTransformImage return two images in the MagickWand?
This is with 6.6.3-8 Q16 compiled on WinXP to include fft and HDRI.
#include <windows.h>
#include <wand/magick_wand.h>
void test_wand(void)
{
MagickWand *mw = NULL;
char info[128];
MagickWandGenesis();
mw = NewMagickWand();
MagickReadImage(mw,"lena.png");
// True returns mag/phase and false returns real/imag
if(MagickForwardFourierTransformImage(mw,MagickTrue) == MagickFalse) {
MessageBox(NULL,"FFT Failed","",MB_OK);
}
sprintf(info,"%d",MagickGetNumberImages(mw));
// This indicates that there's one image in the wand
MessageBox(NULL,info,"",MB_OK);
MagickContrastStretchImage(mw,0,MagickGetImageWidth(mw)*MagickGetImageHeight(mw));
MagickEvaluateImage(mw,LogEvaluateOperator,10000);
MagickWriteImage(mw,"lena_mag.png");
if(mw != NULL)DestroyMagickWand(mw);
MagickWandTerminus();
}
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Once adjoin is set to true the image will be a two-frame image, first frame will be magnitude, second frame will be phase. If you save it with simple:
image.write(fileName);
to a format that supports multiple frames (e.g. TIFF, MPC, etc) you will have a two-frame image. I am now stuck on how to access an individual frame of image, as it looks like subRange and subFrame are not working. So I implemented a work-around saving the result as MPC and reading it as:
strcat(fileName,"[0]"); /* Getting only the magnitude part from frame 0 from the temporary file - THIS IS A WORKAROUND */
image2.read(fileName);
This results in magnitude image in image2. This is really lame and I am waiting for somebody to suggest a better scenario. Setting the argument to [1] will result in phase image in the image2.
MagickWand doesn't have a way of directly setting adjoin, but MagickWriteImages allows you to specify an adjoin parameter. But it doesn't make any difference.
Changing the write to:
doesn't result in a multiframe TIFF file (and nor does using MagickFalse).
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Your test works fine here (also 6.6.3-8) but perhaps I don't understand how MagickForwardFourierTransformImage works. When I specify MagickTrue to get the magnitude and phase, there is only one image in the wand and that is the magnitude. If I request the real/imag there is only one image in the wand and that's the real.
How do I get the phase or imaginary image as well?
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
I've just compiled the 6.6.3-9 windows source distribution and there isn't any change. MagickForwardFourierTransformImage still produces only one image in the wand.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
This code returns 2 suggesting MagickForwardFourierTransformImage() is working as expected. We're using ImageMagick-6.6.3-9. Can you post code we can download and execute to try to reproduce your problem.
Sorry, my bad. I forgot to update the PATH environment variable.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.