]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sat, 19 Aug 2017 11:48:25 +0000 (07:48 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 19 Aug 2017 11:48:25 +0000 (07:48 -0400)
MagickCore/compare.c
MagickCore/compare.h
MagickCore/option.c
configure
configure.ac
version.sh

index 742836b140be4d4400837744a793de4b70978b57..48a7425d934f8b8646977d256c402095c112a415 100644 (file)
@@ -1313,6 +1313,33 @@ static MagickBooleanType GetRootMeanSquaredDistortion(const Image *image,
   return(status);
 }
 
+static MagickBooleanType GetStructuralSimilarityDistortion(const Image *image,
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
+{
+  MagickBooleanType
+    status;
+
+  register ssize_t
+    i;
+
+  status=GetMeanSquaredDistortion(image,reconstruct_image,distortion,exception);
+  for (i=0; i <= MaxPixelChannels; i++)
+    distortion[i]=sqrt(distortion[i]);
+  return(status);
+}
+
+static MagickBooleanType GetStructuralDisimilarityDistortion(const Image *image,
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
+{
+  MagickBooleanType
+    status;
+
+  status=GetStructuralSimilarityDistortion(image,reconstruct_image,
+    distortion,exception);
+  *distortion=(1.0-(*distortion))/2.0;
+  return(status);
+}
+
 MagickExport MagickBooleanType GetImageDistortion(Image *image,
   const Image *reconstruct_image,const MetricType metric,double *distortion,
   ExceptionInfo *exception)
@@ -1409,6 +1436,18 @@ MagickExport MagickBooleanType GetImageDistortion(Image *image,
         channel_distortion,exception);
       break;
     }
+    case StructuralSimilarityErrorMetric:
+    {
+      status=GetStructuralSimilarityDistortion(image,reconstruct_image,
+        channel_distortion,exception);
+      break;
+    }
+    case StructuralDissimilarityErrorMetric:
+    {
+      status=GetStructuralDisimilarityDistortion(image,reconstruct_image,
+        channel_distortion,exception);
+      break;
+    }
   }
   *distortion=channel_distortion[CompositePixelChannel];
   channel_distortion=(double *) RelinquishMagickMemory(channel_distortion);
index 79bf6ad2d8bac12d74f2dc2f2d8025e1380eab9a..b34baa33509b17d2299e9226568399142f0fa9b9 100644 (file)
@@ -36,7 +36,9 @@ typedef enum
   PeakAbsoluteErrorMetric,
   PeakSignalToNoiseRatioErrorMetric,
   PerceptualHashErrorMetric,
-  RootMeanSquaredErrorMetric
+  RootMeanSquaredErrorMetric,
+  StructuralSimilarityErrorMetric,
+  StructuralDissimilarityErrorMetric
 } MetricType;
 
 extern MagickExport double
index 2fb55175de264bc4515d5c18ee58e29de51268bf..63d99946e21185ae60e90241779883052403709c 100644 (file)
@@ -1443,6 +1443,7 @@ static const OptionInfo
     { "PHASH", PerceptualHashErrorMetric, UndefinedOptionFlag, MagickFalse },
     { "PSNR", PeakSignalToNoiseRatioErrorMetric, UndefinedOptionFlag, MagickFalse },
     { "RMSE", RootMeanSquaredErrorMetric, UndefinedOptionFlag, MagickFalse },
+    { "SSIM", StructuralSimilarityErrorMetric, UndefinedOptionFlag, MagickFalse },
     { (char *) NULL, UndefinedErrorMetric, UndefinedOptionFlag, MagickFalse }
   },
   MethodOptions[] =
index 999c83df26b9b4ebf634081e476fb837ee34e406..e71c6a7bd206f5c4c905e2f2735c409556978f40 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ImageMagick 7.0.6-8.
+# Generated by GNU Autoconf 2.69 for ImageMagick 7.0.6-9.
 #
 # Report bugs to <https://github.com/ImageMagick/ImageMagick/issues>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='ImageMagick'
 PACKAGE_TARNAME='ImageMagick'
-PACKAGE_VERSION='7.0.6-8'
-PACKAGE_STRING='ImageMagick 7.0.6-8'
+PACKAGE_VERSION='7.0.6-9'
+PACKAGE_STRING='ImageMagick 7.0.6-9'
 PACKAGE_BUGREPORT='https://github.com/ImageMagick/ImageMagick/issues'
 PACKAGE_URL='https://www.imagemagick.org'
 
@@ -1826,7 +1826,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures ImageMagick 7.0.6-8 to adapt to many kinds of systems.
+\`configure' configures ImageMagick 7.0.6-9 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1901,7 +1901,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of ImageMagick 7.0.6-8:";;
+     short | recursive ) echo "Configuration of ImageMagick 7.0.6-9:";;
    esac
   cat <<\_ACEOF
 
@@ -2179,7 +2179,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-ImageMagick configure 7.0.6-8
+ImageMagick configure 7.0.6-9
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -3230,7 +3230,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by ImageMagick $as_me 7.0.6-8, which was
+It was created by ImageMagick $as_me 7.0.6-9, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -4216,7 +4216,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='ImageMagick'
- VERSION='7.0.6-8'
+ VERSION='7.0.6-9'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4526,11 +4526,11 @@ MAGICK_MINOR_VERSION=0
 
 MAGICK_MICRO_VERSION=6
 
-MAGICK_PATCHLEVEL_VERSION=8
+MAGICK_PATCHLEVEL_VERSION=9
 
-MAGICK_VERSION=7.0.6-8
+MAGICK_VERSION=7.0.6-9
 
-MAGICK_GIT_REVISION=20819:6e663f7e3:20170815
+MAGICK_GIT_REVISION=20847:4575049ec:20170819
 
 
 # Substitute library versioning
@@ -38589,7 +38589,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by ImageMagick $as_me 7.0.6-8, which was
+This file was extended by ImageMagick $as_me 7.0.6-9, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -38656,7 +38656,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-ImageMagick config.status 7.0.6-8
+ImageMagick config.status 7.0.6-9
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index 2f28f600daf1bdd6fc1347b48232be68d33a4837..7d27c6278a35b757930a203f09530e4339467d10 100644 (file)
@@ -27,7 +27,7 @@ AC_PREREQ(2.69)
 m4_define([magick_major_version], [7])
 m4_define([magick_minor_version], [0])
 m4_define([magick_micro_version], [6])
-m4_define([magick_patchlevel_version], [8])
+m4_define([magick_patchlevel_version], [9])
 m4_define([magick_version],
           [magick_major_version.magick_minor_version.magick_micro_version-magick_patchlevel_version])
 m4_define([magick_git_revision], esyscmd([sh -c "(gitversion.sh .) | tr -d '\n'"]))
index 1c15ecb69dc76c4e06fe2773125c61545b5593d5..e754dfa7d82a304f139132db69f7c7fefb00daa0 100644 (file)
@@ -18,7 +18,7 @@ PACKAGE_CHANGE_DATE=`awk '/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/ { print
 PACKAGE_VERSION='7.0.6'
 PACKAGE_PERL_VERSION='7.06'
 PACKAGE_LIB_VERSION="0x706"
-PACKAGE_RELEASE="8"
+PACKAGE_RELEASE="9"
 PACKAGE_LIB_VERSION_NUMBER="7,0,6,${PACKAGE_RELEASE}"
 PACKAGE_RELEASE_DATE_RAW=`date +%F`
 PACKAGE_RELEASE_DATE_REPRODUCIBLE="${PACKAGE_CHANGE_DATE}"