我试图找出两个图像有多相似,但我遇到了分割错误。我究竟做错了什么?
ExceptionInfo *exception;
Image *base_image, *reference_image, *composed_image, *image, *images, *images1;
double *similarity;
RectangleInfo offset;
ImageInfo *image_info, *image_info1;
char base_image_src[] = "jpgs/100000.jpg";
char reference_image_src[] = "jpgs/100000.jpg";
MagickCoreGenesis(NULL, MagickTrue);
exception = AcquireExceptionInfo();
image_info = CloneImageInfo((ImageInfo *) NULL);
(void) strcpy(image_info->filename, base_image_src);
base_image = ReadImage(image_info, exception);
image_info1 = CloneImageInfo((ImageInfo *) NULL);
(void) strcpy(image_info1->filename, reference_image_src);
reference_image = ReadImage(image_info1, exception);
offset.width = (unsigned int) 1200;
offset.height = (unsigned int) 1200;
offset.x = 0;
offset.y = 0;
composed_image = SimilarityImage(base_image, reference_image, &offset, similarity, exception);
编辑:我意识到它打破了 SimilarityImage。0x000000371dc5fdfa in SimilarityImage () from /usr/lib64/libMagickCore.so.2