mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-06-08 15:37:13 +02:00
correct distortion computation
This commit is contained in:
@@ -1171,9 +1171,6 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
|
||||
FinalizeImageSettings(image_info,image,MagickTrue);
|
||||
if ((image == (Image *) NULL) || (GetImageListLength(image) < 2))
|
||||
ThrowCompareException(OptionError,"MissingAnImageFilename",argv[i]);
|
||||
if ((metric == MeanSquaredErrorMetric) ||
|
||||
(metric == PeakSignalToNoiseRatioErrorMetric))
|
||||
distortion_metric=metric;
|
||||
image=GetImageFromList(image,0);
|
||||
reconstruct_image=GetImageFromList(image,1);
|
||||
offset.x=0;
|
||||
@@ -1187,6 +1184,9 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
|
||||
if (similarity_metric >= dissimilarity_threshold)
|
||||
(void) ThrowMagickException(exception,GetMagickModule(),ImageWarning,
|
||||
"ImagesTooDissimilar","`%s'",image->filename);
|
||||
if ((metric == AbsoluteErrorMetric) ||
|
||||
(metric == PeakSignalToNoiseRatioErrorMetric))
|
||||
distortion_metric=metric;
|
||||
}
|
||||
if (similarity_image == (Image *) NULL)
|
||||
difference_image=CompareImages(image,reconstruct_image,distortion_metric,
|
||||
|
||||
@@ -7974,9 +7974,6 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
|
||||
if (option != (const char *) NULL)
|
||||
metric=(MetricType) ParseCommandOption(MagickMetricOptions,
|
||||
MagickFalse,option);
|
||||
if ((metric != MeanSquaredErrorMetric) &&
|
||||
(metric != PeakSignalToNoiseRatioErrorMetric))
|
||||
metric=MeanSquaredErrorMetric;
|
||||
difference_image=CompareImages(image,reconstruct_image,metric,
|
||||
&distortion,exception);
|
||||
if (difference_image == (Image *) NULL)
|
||||
|
||||
@@ -4003,9 +4003,6 @@ static MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
|
||||
if (option != (const char *) NULL)
|
||||
metric=(MetricType) ParseCommandOption(MagickMetricOptions,
|
||||
MagickFalse,option);
|
||||
if ((metric != AbsoluteErrorMetric) &&
|
||||
(metric != PeakSignalToNoiseRatioErrorMetric))
|
||||
metric=MeanSquaredErrorMetric;
|
||||
new_images=CompareImages(image,reconstruct_image,metric,&distortion,
|
||||
_exception);
|
||||
(void) distortion;
|
||||
|
||||
Reference in New Issue
Block a user