]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 8 Jan 2014 18:34:48 +0000 (18:34 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 8 Jan 2014 18:34:48 +0000 (18:34 +0000)
MagickCore/compare.c
MagickCore/compare.h
MagickCore/option.c
MagickWand/compare.c

index 86649908539e631b2cb0bf1a9a258169546f1e5d..0642ba58334810fcf609217a03fceca37a25dd45 100644 (file)
@@ -1101,6 +1101,13 @@ static MagickBooleanType GetPeakSignalToNoiseRatio(const Image *image,
   return(status);
 }
 
+static MagickBooleanType GetPerceptualHashDistortion(const Image *image,
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
+{
+  *distortion=0.0;
+  return(MagickTrue);
+}
+
 static MagickBooleanType GetRootMeanSquaredDistortion(const Image *image,
   const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
 {
@@ -1197,12 +1204,18 @@ MagickExport MagickBooleanType GetImageDistortion(Image *image,
         channel_distortion,exception);
       break;
     }
-    case PeakSignalToNoiseRatioMetric:
+    case PeakSignalToNoiseRatioErrorMetric:
     {
       status=GetPeakSignalToNoiseRatio(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
+    case PerceptualHashErrorMetric:
+    {
+      status=GetPerceptualHashDistortion(image,reconstruct_image,
+        channel_distortion,exception);
+      break;
+    }
     case RootMeanSquaredErrorMetric:
     {
       status=GetRootMeanSquaredDistortion(image,reconstruct_image,
@@ -1333,12 +1346,18 @@ MagickExport double *GetImageDistortions(Image *image,
         channel_distortion,exception);
       break;
     }
-    case PeakSignalToNoiseRatioMetric:
+    case PeakSignalToNoiseRatioErrorMetric:
     {
       status=GetPeakSignalToNoiseRatio(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
+    case PerceptualHashErrorMetric:
+    {
+      status=GetRootMeanSquaredDistortion(image,reconstruct_image,
+        channel_distortion,exception);
+      break;
+    }
     case RootMeanSquaredErrorMetric:
     {
       status=GetRootMeanSquaredDistortion(image,reconstruct_image,
index 7ca46f7a362cbefc9c573bd5fa08a5563d97d36d..892f4d5bcfe74a343cf4890f885030d3f419a5ec 100644 (file)
@@ -34,7 +34,7 @@ typedef enum
   MeanSquaredErrorMetric,
   NormalizedCrossCorrelationErrorMetric,
   PeakAbsoluteErrorMetric,
-  PeakSignalToNoiseRatioMetric,
+  PeakSignalToNoiseRatioErrorMetric,
   PerceptualHashErrorMetric,
   RootMeanSquaredErrorMetric
 } MetricType;
index 58618fc576cb09877e49f185829e108b26ecd11d..fa98fd0cb93b943574d131694124ff21af859822 100644 (file)
@@ -1353,7 +1353,7 @@ static const OptionInfo
     { "NCC", NormalizedCrossCorrelationErrorMetric, UndefinedOptionFlag, MagickFalse },
     { "PAE", PeakAbsoluteErrorMetric, UndefinedOptionFlag, MagickFalse },
     { "PHASh", PerceptualHashErrorMetric, UndefinedOptionFlag, MagickFalse },
-    { "PSNR", PeakSignalToNoiseRatioMetric, UndefinedOptionFlag, MagickFalse },
+    { "PSNR", PeakSignalToNoiseRatioErrorMetric, UndefinedOptionFlag, MagickFalse },
     { "RMSE", RootMeanSquaredErrorMetric, UndefinedOptionFlag, MagickFalse },
     { (char *) NULL, UndefinedErrorMetric, UndefinedOptionFlag, MagickFalse }
   },
index 0be13900958e28d800c9b114ec2b72e04420c842..127d8cc1d28eded868d3108dcd15c011655ef117 100644 (file)
@@ -1039,7 +1039,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
             }
             case AbsoluteErrorMetric:
             case NormalizedCrossCorrelationErrorMetric:
-            case PeakSignalToNoiseRatioMetric:
+            case PeakSignalToNoiseRatioErrorMetric:
             {
               (void) FormatLocaleFile(stderr,"%g",distortion);
               if ((reconstruct_image->columns != image->columns) ||
@@ -1144,7 +1144,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
             }
             case AbsoluteErrorMetric:
             case NormalizedCrossCorrelationErrorMetric:
-            case PeakSignalToNoiseRatioMetric:
+            case PeakSignalToNoiseRatioErrorMetric:
             {
               switch (image->colorspace)
               {