Skip to content

Commit

Permalink
report similarity metric
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jan 6, 2025
1 parent a967e06 commit 802ba5c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions wand/compare.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,11 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
similarity_image=(Image *) NULL;
}
}
if (metric == NormalizedCrossCorrelationErrorMetric)
{
distortion=1.0-distortion;
similarity_metric=1.0-similarity_metric;
}
if (difference_image == (Image *) NULL)
status=0;
else
Expand Down Expand Up @@ -1429,8 +1434,12 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
channel_distortion=(double *) RelinquishMagickMemory(
channel_distortion);
if (subimage_search != MagickFalse)
(void) FormatLocaleFile(stderr," Offset: %.20g,%.20g\n",(double)
difference_image->page.x,(double) difference_image->page.y);
{
(void) FormatLocaleFile(stderr," Offset: %.20g,%.20g\n",(double)
difference_image->page.x,(double) difference_image->page.y);
(void) FormatLocaleFile(stderr," Similarity metric: %.*g\n",
GetMagickPrecision(),similarity_metric);
}
}
(void) ResetImagePage(difference_image,"0x0+0+0");
if (difference_image->next != (Image *) NULL)
Expand Down

0 comments on commit 802ba5c

Please sign in to comment.