% Image Comparison Methods %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% December 2003 %
% %
% %
ThrowCompareException(ImageError,"ImagesTooDissimilar",image->filename);
}
if ((reconstruct_image->columns == image->columns) &&
- (reconstruct_image->rows == image->rows))
+ (reconstruct_image->rows == image->rows))
difference_image=CompareImages(image,reconstruct_image,metric,&distortion,
exception);
else
if (similarity_image == (Image *) NULL)
- ThrowCompareException(OptionError,"ImageWidthsOrHeightsDiffer",
- image->filename)
+ {
+ if (metric == PerceptualHashErrorMetric)
+ difference_image=CompareImages(image,reconstruct_image,metric,
+ &distortion,exception);
+ else
+ ThrowCompareException(OptionError,"ImageWidthsOrHeightsDiffer",
+ image->filename);
+ }
else
{
Image
case FuzzErrorMetric:
case MeanAbsoluteErrorMetric:
case MeanSquaredErrorMetric:
- case RootMeanSquaredErrorMetric:
case PeakAbsoluteErrorMetric:
+ case RootMeanSquaredErrorMetric:
{
(void) FormatLocaleFile(stderr,"%g (%g)",QuantumRange*distortion,
(double) distortion);
- if ((reconstruct_image->columns != image->columns) ||
- (reconstruct_image->rows != image->rows))
- (void) FormatLocaleFile(stderr," @ %.20g,%.20g",(double)
- difference_image->page.x,(double) difference_image->page.y);
break;
}
case AbsoluteErrorMetric:
case NormalizedCrossCorrelationErrorMetric:
- case PeakSignalToNoiseRatioMetric:
+ case PeakSignalToNoiseRatioErrorMetric:
+ case PerceptualHashErrorMetric:
{
(void) FormatLocaleFile(stderr,"%g",distortion);
- if ((reconstruct_image->columns != image->columns) ||
- (reconstruct_image->rows != image->rows))
- (void) FormatLocaleFile(stderr," @ %.20g,%.20g",(double)
- difference_image->page.x,(double) difference_image->page.y);
break;
}
- case MeanErrorPerPixelMetric:
+ case MeanErrorPerPixelErrorMetric:
{
(void) FormatLocaleFile(stderr,"%g (%g, %g)",distortion,
image->error.normalized_mean_error,
image->error.normalized_maximum_error);
- if ((reconstruct_image->columns != image->columns) ||
- (reconstruct_image->rows != image->rows))
- (void) FormatLocaleFile(stderr," @ %.20g,%.20g",(double)
- difference_image->page.x,(double) difference_image->page.y);
break;
}
case UndefinedErrorMetric:
break;
}
+ if (subimage_search != MagickFalse)
+ (void) FormatLocaleFile(stderr," @ %.20g,%.20g",(double)
+ difference_image->page.x,(double) difference_image->page.y);
}
else
{
case FuzzErrorMetric:
case MeanAbsoluteErrorMetric:
case MeanSquaredErrorMetric:
- case RootMeanSquaredErrorMetric:
case PeakAbsoluteErrorMetric:
+ case RootMeanSquaredErrorMetric:
{
switch (image->colorspace)
{
}
case AbsoluteErrorMetric:
case NormalizedCrossCorrelationErrorMetric:
- case PeakSignalToNoiseRatioMetric:
+ case PeakSignalToNoiseRatioErrorMetric:
+ case PerceptualHashErrorMetric:
{
switch (image->colorspace)
{
channel_distortion[MaxPixelChannels]);
break;
}
- case MeanErrorPerPixelMetric:
+ case MeanErrorPerPixelErrorMetric:
{
(void) FormatLocaleFile(stderr," %g (%g, %g)\n",
channel_distortion[MaxPixelChannels],
}
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);
}
status&=WriteImages(image_info,difference_image,argv[argc-1],exception);
if ((metadata != (char **) NULL) && (format != (char *) NULL))