The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Hey guys,
I was trying to get image statistics using MagickWand but I get wrong results. Obviously I'm doing something wrong, but I can't figure out what. I'm reading JPEG file. My code is as follows:
MagickBooleanType status;
MagickWand *magick_wand;
ChannelStatistics *chan_stat;
double mean_red, std_red;
/*
Read an image.
*/
MagickWandGenesis();
magick_wand=NewMagickWand();
status=MagickReadImage(magick_wand,pFilename);
if (status == MagickFalse)
ThrowWandException(magick_wand);
/*
Get stats
*/
chan_stat=MagickGetImageChannelStatistics(magick_wand);
mean_red=chan_stat[RedChannel].mean;
/*
Close session
*/
magick_wand=DestroyMagickWand(magick_wand);
MagickWandTerminus();
Seems that chan_stat structure is not being initialized, since the figures are garbage. When I run command line 'identify -verbose' all numbers are ok. Any advice?
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.
Show us some of the statistics you get when you use the builtin logo: image.
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.