Home | History | Annotate | Download | only in api
      1 
      2 
      3 
      4 
      5 <!DOCTYPE html>
      6 <html lang="en">
      7 <head>
      8   <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
      9     <title>ImageMagick: MagickCore, C API for ImageMagick: Compare an Image to a Reconstructed Image</title>
     10   <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
     11   <meta name="application-name" content="ImageMagick"/>
     12   <meta name="description" content="ImageMagick is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bzier curves."/>
     13   <meta name="application-url" content="http://www.imagemagick.org"/>
     14   <meta name="generator" content="PHP"/>
     15   <meta name="keywords" content="magickcore, c, api, for, imagemagick:, compare, an, image, to, a, reconstructed, image, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/>
     16   <meta name="rating" content="GENERAL"/>
     17   <meta name="robots" content="INDEX, FOLLOW"/>
     18   <meta name="generator" content="ImageMagick Studio LLC"/>
     19   <meta name="author" content="ImageMagick Studio LLC"/>
     20   <meta name="revisit-after" content="2 DAYS"/>
     21   <meta name="resource-type" content="document"/>
     22   <meta name="copyright" content="Copyright (c) 1999-2016 ImageMagick Studio LLC"/>
     23   <meta name="distribution" content="Global"/>
     24   <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
     25   <link rel="icon" href="../image/wand.png"/>
     26   <link rel="shortcut icon" href="../image/wand.ico"/>
     27   <link rel="stylesheet" href="../css/magick.php"/>
     28 </head>
     29 <body>
     30 <div class="main">
     31 <div class="magick-masthead">
     32   <div class="container">
     33     <script async="async" src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
     34          style="display:block"
     35          data-ad-client="ca-pub-3129977114552745"
     36          data-ad-slot="6345125851"
     37          data-ad-format="auto"></ins>
     38     <script>
     39       (adsbygoogle = window.adsbygoogle || []).push({});
     40     </script>
     41     <nav class="magick-nav">
     42       <a class="magick-nav-item " href="../index.php">Home</a>
     43       <a class="magick-nav-item " href="../script/binary-releases.php">Download</a>
     44       <a class="magick-nav-item " href="../script/command-line-tools.php">Tools</a>
     45       <a class="magick-nav-item " href="../script/command-line-options.php">Options</a>
     46       <a class="magick-nav-item " href="../script/resources.php">Resources</a>
     47       <a class="magick-nav-item " href="../script/api.php">Develop</a>
     48       <a class="magick-nav-item " href="../script/search.php">Search</a>
     49       <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
     50     </nav>
     51   </div>
     52 </div>
     53 <div class="container">
     54 <div class="magick-header">
     55 <p class="text-center"><a href="compare.php#CompareImages">CompareImages</a> &bull; <a href="compare.php#GetImageDistortion">GetImageDistortion</a> &bull; <a href="compare.php#GetImageDistortions">GetImageDistortions</a> &bull; <a href="compare.php#IsImagesEqual">IsImagesEqual</a> &bull; <a href="compare.php#SimilarityImage">SimilarityImage</a></p>
     56 
     57 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/compare_8c.html" id="CompareImages">CompareImages</a></h2>
     58 
     59 <p>CompareImages() compares one or more pixel channels of an image to a reconstructed image and returns the difference image.</p>
     60 
     61 <p>The format of the CompareImages method is:</p>
     62 
     63 <pre class="text">
     64 Image *CompareImages(const Image *image,const Image *reconstruct_image,
     65   const MetricType metric,double *distortion,ExceptionInfo *exception)
     66 </pre>
     67 
     68 <p>A description of each parameter follows:</p>
     69 
     70 <dd>
     71 </dd>
     72 
     73 <dd> </dd>
     74 <dl class="dl-horizontal">
     75 <dt>image</dt>
     76 <dd>the image. </dd>
     77 
     78 <dd> </dd>
     79 <dt>reconstruct_image</dt>
     80 <dd>the reconstruct image. </dd>
     81 
     82 <dd> </dd>
     83 <dt>metric</dt>
     84 <dd>the metric. </dd>
     85 
     86 <dd> </dd>
     87 <dt>distortion</dt>
     88 <dd>the computed distortion between the images. </dd>
     89 
     90 <dd> </dd>
     91 <dt>exception</dt>
     92 <dd>return any errors or warnings in this structure. </dd>
     93 
     94 <dd>  </dd>
     95 </dl>
     96 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/compare_8c.html" id="GetImageDistortion">GetImageDistortion</a></h2>
     97 
     98 <p>GetImageDistortion() compares one or more pixel channels of an image to a reconstructed image and returns the specified distortion metric.</p>
     99 
    100 <p>The format of the GetImageDistortion method is:</p>
    101 
    102 <pre class="text">
    103 MagickBooleanType GetImageDistortion(const Image *image,
    104   const Image *reconstruct_image,const MetricType metric,
    105   double *distortion,ExceptionInfo *exception)
    106 </pre>
    107 
    108 <p>A description of each parameter follows:</p>
    109 
    110 <dd>
    111 </dd>
    112 
    113 <dd> </dd>
    114 <dl class="dl-horizontal">
    115 <dt>image</dt>
    116 <dd>the image. </dd>
    117 
    118 <dd> </dd>
    119 <dt>reconstruct_image</dt>
    120 <dd>the reconstruct image. </dd>
    121 
    122 <dd> </dd>
    123 <dt>metric</dt>
    124 <dd>the metric. </dd>
    125 
    126 <dd> </dd>
    127 <dt>distortion</dt>
    128 <dd>the computed distortion between the images. </dd>
    129 
    130 <dd> </dd>
    131 <dt>exception</dt>
    132 <dd>return any errors or warnings in this structure. </dd>
    133 
    134 <dd>  </dd>
    135 </dl>
    136 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/compare_8c.html" id="GetImageDistortions">GetImageDistortions</a></h2>
    137 
    138 <p>GetImageDistortions() compares the pixel channels of an image to a reconstructed image and returns the specified distortion metric for each channel.</p>
    139 
    140 <p>The format of the GetImageDistortions method is:</p>
    141 
    142 <pre class="text">
    143 double *GetImageDistortions(const Image *image,
    144   const Image *reconstruct_image,const MetricType metric,
    145   ExceptionInfo *exception)
    146 </pre>
    147 
    148 <p>A description of each parameter follows:</p>
    149 
    150 <dd>
    151 </dd>
    152 
    153 <dd> </dd>
    154 <dl class="dl-horizontal">
    155 <dt>image</dt>
    156 <dd>the image. </dd>
    157 
    158 <dd> </dd>
    159 <dt>reconstruct_image</dt>
    160 <dd>the reconstruct image. </dd>
    161 
    162 <dd> </dd>
    163 <dt>metric</dt>
    164 <dd>the metric. </dd>
    165 
    166 <dd> </dd>
    167 <dt>exception</dt>
    168 <dd>return any errors or warnings in this structure. </dd>
    169 
    170 <dd>  </dd>
    171 </dl>
    172 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/compare_8c.html" id="IsImagesEqual">IsImagesEqual</a></h2>
    173 
    174 <p>IsImagesEqual() measures the difference between colors at each pixel location of two images.  A value other than 0 means the colors match exactly.  Otherwise an error measure is computed by summing over all pixels in an image the distance squared in RGB space between each image pixel and its corresponding pixel in the reconstruct image.  The error measure is assigned to these image members:</p>
    175 
    176 <pre class="text">
    177     o mean_error_per_pixel:  The mean error for any single pixel in
    178 the image.
    179 </pre>
    180 
    181 <dt>normalized_mean_error</dt>
    182 <p>The normalized mean quantization error for any single pixel in the image.  This distance measure is normalized to a range between 0 and 1.  It is independent of the range of red, green, and blue values in the image.</p>
    183 
    184 <dt>normalized_maximum_error</dt>
    185 <p>The normalized maximum quantization error for any single pixel in the image.  This distance measure is normalized to a range between 0 and 1.  It is independent of the range of red, green, and blue values in your image.</p>
    186 
    187 <p>A small normalized mean square error, accessed as image-&gt;normalized_mean_error, suggests the images are very similar in spatial layout and color.</p>
    188 
    189 <p>The format of the IsImagesEqual method is:</p>
    190 
    191 <pre class="text">
    192 MagickBooleanType IsImagesEqual(Image *image,
    193   const Image *reconstruct_image,ExceptionInfo *exception)
    194 </pre>
    195 
    196 <p>A description of each parameter follows.</p>
    197 
    198 <dt>image</dt>
    199 <p>the image.</p>
    200 
    201 <dt>reconstruct_image</dt>
    202 <p>the reconstruct image.</p>
    203 
    204 <dt>exception</dt>
    205 <p>return any errors or warnings in this structure.</p>
    206 
    207 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/compare_8c.html" id="SimilarityImage">SimilarityImage</a></h2>
    208 
    209 <p>SimilarityImage() compares the reference image of the image and returns the best match offset.  In addition, it returns a similarity image such that an exact match location is completely white and if none of the pixels match, black, otherwise some gray level in-between.</p>
    210 
    211 <p>The format of the SimilarityImageImage method is:</p>
    212 
    213 <pre class="text">
    214 Image *SimilarityImage(const Image *image,const Image *reference,
    215   const MetricType metric,const double similarity_threshold,
    216   RectangleInfo *offset,double *similarity,ExceptionInfo *exception)
    217 </pre>
    218 
    219 <p>A description of each parameter follows:</p>
    220 
    221 <dd>
    222 </dd>
    223 
    224 <dd> </dd>
    225 <dl class="dl-horizontal">
    226 <dt>image</dt>
    227 <dd>the image. </dd>
    228 
    229 <dd> </dd>
    230 <dt>reference</dt>
    231 <dd>find an area of the image that closely resembles this image. </dd>
    232 
    233 <dd> </dd>
    234 <dt>metric</dt>
    235 <dd>the metric. </dd>
    236 
    237 <dd> </dd>
    238 <dt>similarity_threshold</dt>
    239 <dd>minimum distortion for (sub)image match. </dd>
    240 
    241 <dd> </dd>
    242 <dt>offset</dt>
    243 <dd>the best match offset of the reference image within the image. </dd>
    244 
    245 <dd> </dd>
    246 <dt>similarity</dt>
    247 <dd>the computed similarity between the images. </dd>
    248 
    249 <dd> </dd>
    250 <dt>exception</dt>
    251 <dd>return any errors or warnings in this structure. </dd>
    252 
    253 <dd>  </dd>
    254 </dl>
    255 </div>
    256   <footer class="magick-footer">
    257     <p><a href="../script/support.php">Donate</a> 
    258      <a href="../script/sitemap.php">Sitemap</a> 
    259     <a href="../script/links.php">Related</a> 
    260     <a href="../script/architecture.php">Architecture</a>
    261 </p>
    262     <p><a href="compare.php#">Back to top</a> 
    263     <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> 
    264     <a href="../script/contact.php">Contact Us</a></p>
    265         <p><small>  1999-2016 ImageMagick Studio LLC</small></p>
    266   </footer>
    267 </div><!-- /.container -->
    268 
    269   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    270   <script src="http://nextgen.imagemagick.org/js/magick.php"></script>
    271 </div>
    272 </body>
    273 </html>
    274