mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-06-12 15:37:14 +02:00
trap for NCC working with constant color in spatial domain
This commit is contained in:
@@ -1266,6 +1266,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
|
||||
similarity_metric=fabs(similarity_metric);
|
||||
break;
|
||||
}
|
||||
case NormalizedCrossCorrelationErrorMetric:
|
||||
case PerceptualHashErrorMetric:
|
||||
{
|
||||
double
|
||||
@@ -1273,7 +1274,10 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
|
||||
minima = 0.0;
|
||||
|
||||
(void) GetImageRange(reconstruct_image,&minima,&maxima,exception);
|
||||
if (fabs(maxima-minima) < MagickEpsilon)
|
||||
if ((fabs(maxima-minima) < MagickEpsilon) ||
|
||||
((subimage_search != MagickFalse) &&
|
||||
(image->columns == reconstruct_image->columns) &&
|
||||
(image->rows == reconstruct_image->rows)))
|
||||
(void) ThrowMagickException(exception,GetMagickModule(),ImageWarning,
|
||||
"subimage search is not sufficiently robust for PAE/PHASH metrics",
|
||||
"`%s'",image->filename);
|
||||
|
||||
Reference in New Issue
Block a user