I'm trying to make an average of a set of images with the function MagickAverageImages, but i'm doing something wrong..
Code: Select all
MagickWand *mw = NULL;
MagickWand *imagen =NULL;
MagickWand *combi =NULL;
MagickBooleanType status;
MagickWandGenesis();
mw = NewMagickWand();
imagen =NewMagickWand();
combi =NewMagickWand();
/* Read the input image */
MagickReadImage(mw,"C:\\data\\10_3_61_154\\000\\004\\M00001.jpg");
MagickReadImage(imagen,"C:\\data\\10_3_61_154\\000\\004\\M00001.jpg");
status= MagickAddImage (mw, imagen);
combi = MagickAverageImages(mw);
/* write it */
MagickWriteImage(combi,"D:\\c++\\imagemagick\\Debug\\combinacion.jpg");
/* Tidy up */
if(mw) mw = DestroyMagickWand(mw);
if(imagen) imagen = DestroyMagickWand(imagen);
if(combi) combi = DestroyMagickWand(combi);
MagickWandTerminus();
}