PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/branches/ImageMagick-6.5.9/www/api/compare.html

https://github.com/trevor/ImageMagick
HTML | 338 lines | 273 code | 63 blank | 2 comment | 0 complexity | 5cb9721a65dc8fc955bf023cc9915ce5 MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" value="application/xhtml+xml" />
  6. <meta name="verify-v1" content="g222frIIxcQTrvDR3NBRUSKP3AnMNoqxOkIniCEkV7U=" />
  7. <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf" />
  8. <style type="text/css" media="screen,projection"><!--
  9. @import url("../../www/magick.css");
  10. --></style>
  11. <link rel="shortcut icon" href="../../images/wand.ico" type="images/vnd.microsoft.icon"/>
  12. <title>ImageMagick: MagickCore, C API for ImageMagick: Compare an Image to a Reconstructed Image</title>
  13. <meta http-equiv="Content-Language" content="en-US"/>
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  15. <meta http-equiv="Reply-to" content="magick-users@imagemagick.org"/>
  16. <meta name="Generator" content="PHP"/>
  17. <meta name="Keywords" content="magickcore, c, api, for, imagemagick:, compare, an, image, to, a, reconstructed, image, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand, ImageMagickObject, Swiss, Army, Knife, Image, Processing"/>
  18. <meta name="Description" content="ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems. The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images automagically and dynamically."/>
  19. <meta name="Rating" content="GENERAL"/>
  20. <meta name="Robots" content="INDEX, FOLLOW"/>
  21. <meta name="Generator" content="ImageMagick Studio LLC"/>
  22. <meta name="Author" content="ImageMagick Studio LLC"/>
  23. <meta name="Revisit-after" content="2 DAYS"/>
  24. <meta name="Resource-type" content="document"/>
  25. <meta name="Copyright" content="Copyright (c) 1999-2010 ImageMagick Studio LLC"/>
  26. <meta name="Distribution" content="Global"/>
  27. </head>
  28. <body id="www-imagemagick-org">
  29. <div class="titlebar">
  30. <a href="../../index.html">
  31. <img src="../../images/script.png" alt="[ImageMagick]"
  32. style="width: 350px; height: 60px; margin: 28px auto; float: left;" /></a>
  33. <a href="http://www.networkredux.com">
  34. <img src="../../images/networkredux.png" alt="[sponsor]"
  35. style="margin: 45px auto; border: 0px; float: left;" /></a>
  36. <a href="http://www.imagemagick.org/discourse-server/">
  37. <img src="../../images/logo.jpg" alt=""
  38. style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
  39. <a href="../../index.html">
  40. <img src="../../images/sprite.jpg" alt=""
  41. style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
  42. </div>
  43. <div class="eastbar">
  44. <div class="menu">
  45. <a href="../../index.html">About ImageMagick</a>
  46. </div>
  47. <div class="sep"></div>
  48. <div class="menu">
  49. <a href="../../www/command-line-tools.html">Command-line Tools</a>
  50. </div>
  51. <div class="sub">
  52. <a href="../../www/command-line-processing.html">Processing</a>
  53. </div>
  54. <div class="sub">
  55. <a href="../../www/command-line-options.html">Options</a>
  56. </div>
  57. <div class="sub">
  58. <a href="http://www.imagemagick.org/Usage/">Usage</a>
  59. </div>
  60. <div class="menu">
  61. <a href="../../www/api.html">Program Interfaces</a>
  62. </div>
  63. <div class="sub">
  64. <a href="../../www/magick-wand.html">MagickWand</a>
  65. </div>
  66. <div class="sub">
  67. <a href="../../www/magick-core.html">MagickCore</a>
  68. </div>
  69. <div class="sub">
  70. <a href="../../www/perl-magick.html">PerlMagick</a>
  71. </div>
  72. <div class="sub">
  73. <a href="../../Magick++/">Magick++</a>
  74. </div>
  75. <div class="menu">
  76. <a href="../../www/architecture.html">Architecture</a>
  77. </div>
  78. <div class="sep"></div>
  79. <div class="menu">
  80. <a href="../../www/install-source.html">Install from Source</a>
  81. </div>
  82. <div class="sub">
  83. <a href="../../www/install-source.html#unix">Unix</a>
  84. </div>
  85. <div class="sub">
  86. <a href="../../www/install-source.html#windows">Windows</a>
  87. </div>
  88. <div class="menu">
  89. <a href="../../www/binary-releases.html">Binary Releases</a>
  90. </div>
  91. <div class="sub">
  92. <a href="../../www/binary-releases.html#unix">Unix</a>
  93. </div>
  94. <div class="sub">
  95. <a href="../../www/binary-releases.html#macosx">Mac OS X</a>
  96. </div>
  97. <div class="sub">
  98. <a href="../../www/binary-releases.html#windows">Windows</a>
  99. </div>
  100. <div class="menu">
  101. <a href="../../www/resources.html">Resources</a>
  102. </div>
  103. <div class="sep"></div>
  104. <div class="menu">
  105. <a href="../../www/download.html">Download</a>
  106. </div>
  107. <div class="sep"></div>
  108. <div class="menu">
  109. <a href="../http://www.imagemagick.org/script/search.php">Search</a>
  110. </div>
  111. <div class="sep"></div>
  112. <div class="menu">
  113. <a href="../../www/sitemap.html">Site Map</a>
  114. </div>
  115. <div class="sub">
  116. <a href="../../www/links.html">Links</a>
  117. </div>
  118. <div class="sep"></div>
  119. <div class="menu">
  120. <a href="../../www/sponsors.html">Sponsors:</a>
  121. <div class="sponsbox">
  122. <div class="sponsor">
  123. <a href="http://www.abi-stoff.de/abizeitung/" title="Abibuch">Abizeitung</a><!-- 20101101000200 -->
  124. </div>
  125. <div class="sponsor">
  126. <a href="http://www.tomsgutscheine.de">Tom's Gutscheine</a><!-- 201005010360 invendio.de-->
  127. </div>
  128. <div class="sponsor">
  129. <a href="http://www.online-kredit-index.de">Kredit</a><!-- 201007010120 Buchhorn -->
  130. </div>
  131. <div class="sponsor">
  132. <a href="http://www.blumenversender.com">Blumenversand</a><!-- 201005010120 -->
  133. </div>
  134. <div class="sponsor">
  135. <a href="http://www.print24.de/">Druckerei</a><!-- 201009010720 -->
  136. </div>
  137. <div class="sponsor">
  138. <a href="http://www.goyax.de">Börse</a><!-- 201004010240 Gewiese digital-finance.de -->
  139. </div>
  140. <div class="sponsor">
  141. <a href="http://www.allesdruck.de">Druckerei Online</a><!-- 201012011200 allesdruck.de-->
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. <div class="main">
  147. <p class="navigation-index">[<a href="#CompareImageChannels">CompareImageChannels</a> &bull; <a href="#GetImageChannelDistortion">GetImageChannelDistortion</a> &bull; <a href="#GetImageChannelDistrortion">GetImageChannelDistrortion</a> &bull; <a href="#IsImagesEqual">IsImagesEqual</a> &bull; <a href="#SimilarityImage">SimilarityImage</a>]</p>
  148. <h2><a href="http://www.imagemagick.org/api/MagickCore/compare
  149. _8c.html" target="source" name="CompareImageChannels">CompareImageChannels</a></h2>
  150. <div class="doc-section">
  151. <p>CompareImageChannels() compares one or more image channels of an image to a reconstructed image and returns the difference image.</p></ol>
  152. <p>The format of the CompareImageChannels method is:</p>
  153. <pre class="code">
  154. Image *CompareImageChannels(const Image *image,
  155. const Image *reconstruct_image,const ChannelType channel,
  156. const MetricType metric,double *distortion,ExceptionInfo *exception)
  157. </pre>
  158. <p>A description of each parameter follows:</p></ol>
  159. <h5>image</h5>
  160. <ol><p>the image.</p></ol>
  161. <h5>reconstruct_image</h5>
  162. <ol><p>the reconstruct image.</p></ol>
  163. <h5>channel</h5>
  164. <ol><p>the channel.</p></ol>
  165. <h5>metric</h5>
  166. <ol><p>the metric.</p></ol>
  167. <h5>distortion</h5>
  168. <ol><p>the computed distortion between the images.</p></ol>
  169. <h5>exception</h5>
  170. <ol><p>return any errors or warnings in this structure.</p></ol>
  171. </div>
  172. <h2><a href="http://www.imagemagick.org/api/MagickCore/compare
  173. _8c.html" target="source" name="GetImageChannelDistortion">GetImageChannelDistortion</a></h2>
  174. <div class="doc-section">
  175. <p>GetImageChannelDistortion() compares one or more image channels of an image to a reconstructed image and returns the specified distortion metric.</p></ol>
  176. <p>The format of the CompareImageChannels method is:</p>
  177. <pre class="code">
  178. MagickBooleanType GetImageChannelDistortion(const Image *image,
  179. const Image *reconstruct_image,const ChannelType channel,
  180. const MetricType metric,double *distortion,ExceptionInfo *exception)
  181. </pre>
  182. <p>A description of each parameter follows:</p></ol>
  183. <h5>image</h5>
  184. <ol><p>the image.</p></ol>
  185. <h5>reconstruct_image</h5>
  186. <ol><p>the reconstruct image.</p></ol>
  187. <h5>channel</h5>
  188. <ol><p>the channel.</p></ol>
  189. <h5>metric</h5>
  190. <ol><p>the metric.</p></ol>
  191. <h5>distortion</h5>
  192. <ol><p>the computed distortion between the images.</p></ol>
  193. <h5>exception</h5>
  194. <ol><p>return any errors or warnings in this structure.</p></ol>
  195. </div>
  196. <h2><a href="http://www.imagemagick.org/api/MagickCore/compare
  197. _8c.html" target="source" name="GetImageChannelDistrortion">GetImageChannelDistrortion</a></h2>
  198. <div class="doc-section">
  199. <p>GetImageChannelDistrortion() compares the image channels of an image to a reconstructed image and returns the specified distortion metric for each channel.</p></ol>
  200. <p>The format of the CompareImageChannels method is:</p>
  201. <pre class="code">
  202. double *GetImageChannelDistortions(const Image *image,
  203. const Image *reconstruct_image,const MetricType metric,
  204. ExceptionInfo *exception)
  205. </pre>
  206. <p>A description of each parameter follows:</p></ol>
  207. <h5>image</h5>
  208. <ol><p>the image.</p></ol>
  209. <h5>reconstruct_image</h5>
  210. <ol><p>the reconstruct image.</p></ol>
  211. <h5>metric</h5>
  212. <ol><p>the metric.</p></ol>
  213. <h5>exception</h5>
  214. <ol><p>return any errors or warnings in this structure.</p></ol>
  215. </div>
  216. <h2><a href="http://www.imagemagick.org/api/MagickCore/compare
  217. _8c.html" target="source" name="IsImagesEqual">IsImagesEqual</a></h2>
  218. <div class="doc-section">
  219. <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>
  220. <pre class="text">
  221. o mean_error_per_pixel: The mean error for any single pixel in
  222. the image.
  223. </pre>
  224. <h5>normalized_mean_error</h5>
  225. <ol><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></ol>
  226. <h5>normalized_maximum_error</h5>
  227. <ol><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></ol>
  228. <p>A small normalized mean square error, accessed as image->normalized_mean_error, suggests the images are very similar in spatial layout and color.</p></ol>
  229. <p>The format of the IsImagesEqual method is:</p>
  230. <pre class="code">
  231. MagickBooleanType IsImagesEqual(Image *image,
  232. const Image *reconstruct_image)
  233. </pre>
  234. <p>A description of each parameter follows.</p></ol>
  235. <h5>image</h5>
  236. <ol><p>the image.</p></ol>
  237. <h5>reconstruct_image</h5>
  238. <ol><p>the reconstruct image.</p></ol>
  239. </div>
  240. <h2><a href="http://www.imagemagick.org/api/MagickCore/compare
  241. _8c.html" target="source" name="SimilarityImage">SimilarityImage</a></h2>
  242. <div class="doc-section">
  243. <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></ol>
  244. <p>The format of the SimilarityImageImage method is:</p>
  245. <pre class="code">
  246. Image *SimilarityImage(const Image *image,const Image *reference,
  247. RectangleInfo *offset,double *similarity,ExceptionInfo *exception)
  248. </pre>
  249. <p>A description of each parameter follows:</p></ol>
  250. <h5>image</h5>
  251. <ol><p>the image.</p></ol>
  252. <h5>reference</h5>
  253. <ol><p>find an area of the image that closely resembles this image.</p></ol>
  254. <p>o the best match offset of the reference image within the image.</p></ol>
  255. <h5>similarity</h5>
  256. <ol><p>the computed similarity between the images.</p></ol>
  257. <h5>exception</h5>
  258. <ol><p>return any errors or warnings in this structure.</p></ol>
  259. </div>
  260. </div>
  261. <div id="linkbar">
  262. <!-- <span id="linkbar-west">&nbsp;</span> -->
  263. <span id="linkbar-center">
  264. <a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> &bull;
  265. <a href="http://studio.webbyland.com/ImageMagick/MagickStudio/scripts/MagickStudio.cgi">Studio</a>
  266. </span>
  267. <span id="linkbar-east">&nbsp;</span>
  268. </div>
  269. <div class="footer">
  270. <span id="footer-west">&copy; 1999-2010 ImageMagick Studio LLC</span>
  271. <span id="footer-east"> <a href="../http://www.imagemagick.org/script/contact.php">Contact the Wizards</a></span>
  272. </div>
  273. <div style="clear: both; margin: 0; width: 100%; "></div>
  274. </body>
  275. </html>