Code: Select all
magick/cache-view.c:163: AcquireVirtualCacheView: Assertion `image != (Image *) ((void *)0)' failed.
This is a sample of the code (ok, it's 90% of it):
Code: Select all
MagickWandGenesis();
image = NewMagickWand();
for(a = 1; a <= samples; a++) {
image_temp = NewMagickWand();
sprintf(filename, "%s/%s-%02d.jpg", argv[1], argv[2], a);
if (MagickReadImage(image_temp, filename)==MagickFalse) {
ThrowWandException(image_temp);
}
width = MagickGetImageWidth(image_temp);
height = MagickGetImageHeight(image_temp);
pixels_gs = (unsigned char **) create_array(width, height, sizeof(char));
pixels_gs_tmp = (unsigned char **) create_array(width, height, sizeof(char));
for (i=0; i<height; i++) {
MagickGetImagePixels(image_temp, 0, i, width, 1, "I", CharPixel, pixels_gs[i]);
}
gs_threshold(pixels_gs, width, height, 140);
gs_erosion_viz(pixels_gs, width, height,2,1);
for (i=0; i<height; i++) {
MagickSetImagePixels(image_temp, 0, i, width, 1, "I", CharPixel, pixels_gs[i]);
}
MagickAddImage(image,image_temp);
DestroyMagickWand(image_temp);
}
image = MagickAverageImages(image);
MagickWriteImage(image, argv[4]);
If this is happening because MagickAverageImages is deprecated... Then I'd ask what is the replacement for it, because I couldn't find it.
Thanks in advance