]> granicus.if.org Git - imagemagick/blob - www/api/statistic.html
Added missing calls to xmlFreeDoc to fix memory leak reported in #1766.
[imagemagick] / www / api / statistic.html
1
2
3
4
5 <!DOCTYPE html>
6 <html lang="en">
7 <head>
8   <meta charset="utf-8"  />
9   <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no"  />
10   <title>MagickCore, C API: Image Statistics @ ImageMagick</title>
11   <meta name="application-name" content="ImageMagick" />
12   <meta name="description" content="ImageMagick® creates, edits, composes, and converts bitmap images. Resize an image, crop it, change its shades and colors, add captions, and more." />
13   <meta name="application-url" content="https://imagemagick.org" />
14   <meta name="generator" content="PHP" />
15   <meta name="keywords" content="magickcore, c, api:, image, statistics, 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-2019 ImageMagick Studio LLC" />
23   <meta name="distribution" content="Global" />
24   <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
25   <meta property='og:url' content='../../' />
26   <meta property='og:title' content='ImageMagick' />
27   <meta property='og:image' content='../../images/logo.png' />
28   <meta property='og:type' content='website' />
29   <meta property='og:site_name' content='ImageMagick' />
30   <meta property='og:description' content="Convert, Edit, or Compose Bitmap Images" />
31   <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
32   <link href="statistic.html" rel="canonical" />
33   <link href="../images/wand.png" rel="icon" />
34   <link href="../images/wand.ico" rel="shortcut icon" />
35   <link href="assets/magick.css" rel="stylesheet" />
36 </head>
37 <body>
38   <header>
39   <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
40     <a class="navbar-brand" href="../index.html"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../images/wand.ico"/></a>
41     <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation">
42       <span class="navbar-toggler-icon"></span>
43     </button>
44
45     <div class="navbar-collapse collapse" id="navbarsMagick" style="">
46     <ul class="navbar-nav mr-auto">
47       <li class="nav-item ">
48         <a class="nav-link" href="montage.html">Home <span class="sr-only">(current)</span></a>
49       </li>
50       <li class="nav-item ">
51         <a class="nav-link" href="../www/download.html">Download</a>
52       </li>
53       <li class="nav-item ">
54         <a class="nav-link" href="../www/command-line-tools.html">Tools</a>
55       </li>
56       <li class="nav-item ">
57         <a class="nav-link" href="../www/command-line-processing.html">Command-line</a>
58       </li>
59       <li class="nav-item ">
60         <a class="nav-link" href="../www/resources.html">Resources</a>
61       </li>
62       <li class="nav-item ">
63         <a class="nav-link" href="../www/develop.html">Develop</a>
64       </li>
65       <li class="nav-item">
66         <a class="nav-link" target="_blank" href="../https://imagemagick.org/discourse-server//">Community</a>
67       </li>
68     </ul>
69     <form class="form-inline my-2 my-lg-0" action="../https://imagemagick.org/script/search.php">
70       <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search">
71       <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button>
72     </form>
73     </div>
74   </nav>
75   <div class="container">
76    <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
77          style="display:block"
78          data-ad-client="ca-pub-3129977114552745"
79          data-ad-slot="6345125851"
80          data-ad-format="auto"></ins>
81     <script>
82       (adsbygoogle = window.adsbygoogle || []).push({});
83     </script>
84
85   </div>
86   </header>
87   <main class="container">
88     <div class="magick-template">
89 <div class="magick-header">
90 <p class="text-center"><a href="statistic.html#EvaluateImage">EvaluateImage</a> &#8226; <a href="statistic.html#FunctionImage">FunctionImage</a> &#8226; <a href="statistic.html#GetImageEntropy">GetImageEntropy</a> &#8226; <a href="statistic.html#GetImageExtrema">GetImageExtrema</a> &#8226; <a href="statistic.html#GetImageKurtosis">GetImageKurtosis</a> &#8226; <a href="statistic.html#GetImageMean">GetImageMean</a> &#8226; <a href="statistic.html#GetImageMoments">GetImageMoments</a> &#8226; <a href="statistic.html#GetImagePerceptualHash">GetImagePerceptualHash</a> &#8226; <a href="statistic.html#GetImageRange">GetImageRange</a> &#8226; <a href="statistic.html#GetImageStatistics">GetImageStatistics</a> &#8226; <a href="statistic.html#PolynomialImage">PolynomialImage</a> &#8226; <a href="statistic.html#StatisticImage">StatisticImage</a></p>
91
92 <h2><a href="../../api/MagickCore/statistic_8c.html" id="EvaluateImage">EvaluateImage</a></h2>
93
94 <p>EvaluateImage() applies a value to the image with an arithmetic, relational, or logical operator to an image. Use these operations to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image.</p>
95
96 <p>The format of the EvaluateImage method is:</p>
97
98 <pre class="text">
99 MagickBooleanType EvaluateImage(Image *image,
100   const MagickEvaluateOperator op,const double value,
101   ExceptionInfo *exception)
102 MagickBooleanType EvaluateImages(Image *images,
103   const MagickEvaluateOperator op,const double value,
104   ExceptionInfo *exception)
105 </pre>
106
107 <p>A description of each parameter follows:</p>
108
109 <dd>
110 </dd>
111
112 <dd> </dd>
113 <dl class="dl-horizontal">
114 <dt>image</dt>
115 <dd>the image. </dd>
116
117 <dd> </dd>
118 <dt>op</dt>
119 <dd>A channel op. </dd>
120
121 <dd> </dd>
122 <dt>value</dt>
123 <dd>A value value. </dd>
124
125 <dd> </dd>
126 <dt>exception</dt>
127 <dd>return any errors or warnings in this structure. </dd>
128
129 <dd>  </dd>
130 </dl>
131 <h2><a href="../../api/MagickCore/statistic_8c.html" id="FunctionImage">FunctionImage</a></h2>
132
133 <p>FunctionImage() applies a value to the image with an arithmetic, relational, or logical operator to an image. Use these operations to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image.</p>
134
135 <p>The format of the FunctionImage method is:</p>
136
137 <pre class="text">
138 MagickBooleanType FunctionImage(Image *image,
139   const MagickFunction function,const ssize_t number_parameters,
140   const double *parameters,ExceptionInfo *exception)
141 </pre>
142
143 <p>A description of each parameter follows:</p>
144
145 <dd>
146 </dd>
147
148 <dd> </dd>
149 <dl class="dl-horizontal">
150 <dt>image</dt>
151 <dd>the image. </dd>
152
153 <dd> </dd>
154 <dt>function</dt>
155 <dd>A channel function. </dd>
156
157 <dd> </dd>
158 <dt>parameters</dt>
159 <dd>one or more parameters. </dd>
160
161 <dd> </dd>
162 <dt>exception</dt>
163 <dd>return any errors or warnings in this structure. </dd>
164
165 <dd>  </dd>
166 </dl>
167 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageEntropy">GetImageEntropy</a></h2>
168
169 <p>GetImageEntropy() returns the entropy of one or more image channels.</p>
170
171 <p>The format of the GetImageEntropy method is:</p>
172
173 <pre class="text">
174 MagickBooleanType GetImageEntropy(const Image *image,double *entropy,
175   ExceptionInfo *exception)
176 </pre>
177
178 <p>A description of each parameter follows:</p>
179
180 <dd>
181 </dd>
182
183 <dd> </dd>
184 <dl class="dl-horizontal">
185 <dt>image</dt>
186 <dd>the image. </dd>
187
188 <dd> </dd>
189 <dt>entropy</dt>
190 <dd>the average entropy of the selected channels. </dd>
191
192 <dd> </dd>
193 <dt>exception</dt>
194 <dd>return any errors or warnings in this structure. </dd>
195
196 <dd>  </dd>
197 </dl>
198 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageExtrema">GetImageExtrema</a></h2>
199
200 <p>GetImageExtrema() returns the extrema of one or more image channels.</p>
201
202 <p>The format of the GetImageExtrema method is:</p>
203
204 <pre class="text">
205 MagickBooleanType GetImageExtrema(const Image *image,size_t *minima,
206   size_t *maxima,ExceptionInfo *exception)
207 </pre>
208
209 <p>A description of each parameter follows:</p>
210
211 <dd>
212 </dd>
213
214 <dd> </dd>
215 <dl class="dl-horizontal">
216 <dt>image</dt>
217 <dd>the image. </dd>
218
219 <dd> </dd>
220 <dt>minima</dt>
221 <dd>the minimum value in the channel. </dd>
222
223 <dd> </dd>
224 <dt>maxima</dt>
225 <dd>the maximum value in the channel. </dd>
226
227 <dd> </dd>
228 <dt>exception</dt>
229 <dd>return any errors or warnings in this structure. </dd>
230
231 <dd>  </dd>
232 </dl>
233 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageKurtosis">GetImageKurtosis</a></h2>
234
235 <p>GetImageKurtosis() returns the kurtosis and skewness of one or more image channels.</p>
236
237 <p>The format of the GetImageKurtosis method is:</p>
238
239 <pre class="text">
240 MagickBooleanType GetImageKurtosis(const Image *image,double *kurtosis,
241   double *skewness,ExceptionInfo *exception)
242 </pre>
243
244 <p>A description of each parameter follows:</p>
245
246 <dd>
247 </dd>
248
249 <dd> </dd>
250 <dl class="dl-horizontal">
251 <dt>image</dt>
252 <dd>the image. </dd>
253
254 <dd> </dd>
255 <dt>kurtosis</dt>
256 <dd>the kurtosis of the channel. </dd>
257
258 <dd> </dd>
259 <dt>skewness</dt>
260 <dd>the skewness of the channel. </dd>
261
262 <dd> </dd>
263 <dt>exception</dt>
264 <dd>return any errors or warnings in this structure. </dd>
265
266 <dd>  </dd>
267 </dl>
268 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageMean">GetImageMean</a></h2>
269
270 <p>GetImageMean() returns the mean and standard deviation of one or more image channels.</p>
271
272 <p>The format of the GetImageMean method is:</p>
273
274 <pre class="text">
275 MagickBooleanType GetImageMean(const Image *image,double *mean,
276   double *standard_deviation,ExceptionInfo *exception)
277 </pre>
278
279 <p>A description of each parameter follows:</p>
280
281 <dd>
282 </dd>
283
284 <dd> </dd>
285 <dl class="dl-horizontal">
286 <dt>image</dt>
287 <dd>the image. </dd>
288
289 <dd> </dd>
290 <dt>mean</dt>
291 <dd>the average value in the channel. </dd>
292
293 <dd> </dd>
294 <dt>standard_deviation</dt>
295 <dd>the standard deviation of the channel. </dd>
296
297 <dd> </dd>
298 <dt>exception</dt>
299 <dd>return any errors or warnings in this structure. </dd>
300
301 <dd>  </dd>
302 </dl>
303 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageMoments">GetImageMoments</a></h2>
304
305 <p>GetImageMoments() returns the normalized moments of one or more image channels.</p>
306
307 <p>The format of the GetImageMoments method is:</p>
308
309 <pre class="text">
310 ChannelMoments *GetImageMoments(const Image *image,
311   ExceptionInfo *exception)
312 </pre>
313
314 <p>A description of each parameter follows:</p>
315
316 <dd>
317 </dd>
318
319 <dd> </dd>
320 <dl class="dl-horizontal">
321 <dt>image</dt>
322 <dd>the image. </dd>
323
324 <dd> </dd>
325 <dt>exception</dt>
326 <dd>return any errors or warnings in this structure. </dd>
327
328 <dd>  </dd>
329 </dl>
330 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImagePerceptualHash">GetImagePerceptualHash</a></h2>
331
332 <p>GetImagePerceptualHash() returns the perceptual hash of one or more image channels.</p>
333
334 <p>The format of the GetImagePerceptualHash method is:</p>
335
336 <pre class="text">
337 ChannelPerceptualHash *GetImagePerceptualHash(const Image *image,
338   ExceptionInfo *exception)
339 </pre>
340
341 <p>A description of each parameter follows:</p>
342
343 <dd>
344 </dd>
345
346 <dd> </dd>
347 <dl class="dl-horizontal">
348 <dt>image</dt>
349 <dd>the image. </dd>
350
351 <dd> </dd>
352 <dt>exception</dt>
353 <dd>return any errors or warnings in this structure. </dd>
354
355 <dd>  </dd>
356 </dl>
357 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageRange">GetImageRange</a></h2>
358
359 <p>GetImageRange() returns the range of one or more image channels.</p>
360
361 <p>The format of the GetImageRange method is:</p>
362
363 <pre class="text">
364 MagickBooleanType GetImageRange(const Image *image,double *minima,
365   double *maxima,ExceptionInfo *exception)
366 </pre>
367
368 <p>A description of each parameter follows:</p>
369
370 <dd>
371 </dd>
372
373 <dd> </dd>
374 <dl class="dl-horizontal">
375 <dt>image</dt>
376 <dd>the image. </dd>
377
378 <dd> </dd>
379 <dt>minima</dt>
380 <dd>the minimum value in the channel. </dd>
381
382 <dd> </dd>
383 <dt>maxima</dt>
384 <dd>the maximum value in the channel. </dd>
385
386 <dd> </dd>
387 <dt>exception</dt>
388 <dd>return any errors or warnings in this structure. </dd>
389
390 <dd>  </dd>
391 </dl>
392 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageStatistics">GetImageStatistics</a></h2>
393
394 <p>GetImageStatistics() returns statistics for each channel in the image.  The statistics include the channel depth, its minima, maxima, mean, standard deviation, kurtosis and skewness.  You can access the red channel mean, for example, like this:</p>
395
396 <pre class="text">
397 channel_statistics=GetImageStatistics(image,exception);
398 red_mean=channel_statistics[RedPixelChannel].mean;
399 </pre>
400
401 <p>Use MagickRelinquishMemory() to free the statistics buffer.</p>
402
403 <p>The format of the GetImageStatistics method is:</p>
404
405 <pre class="text">
406 ChannelStatistics *GetImageStatistics(const Image *image,
407   ExceptionInfo *exception)
408 </pre>
409
410 <p>A description of each parameter follows:</p>
411
412 <dd>
413 </dd>
414
415 <dd> </dd>
416 <dl class="dl-horizontal">
417 <dt>image</dt>
418 <dd>the image. </dd>
419
420 <dd> </dd>
421 <dt>exception</dt>
422 <dd>return any errors or warnings in this structure. </dd>
423
424 <dd>  </dd>
425 </dl>
426 <h2><a href="../../api/MagickCore/statistic_8c.html" id="PolynomialImage">PolynomialImage</a></h2>
427
428 <p>PolynomialImage() returns a new image where each pixel is the sum of the pixels in the image sequence after applying its corresponding terms (coefficient and degree pairs).</p>
429
430 <p>The format of the PolynomialImage method is:</p>
431
432 <pre class="text">
433 Image *PolynomialImage(const Image *images,const size_t number_terms,
434   const double *terms,ExceptionInfo *exception)
435 </pre>
436
437 <p>A description of each parameter follows:</p>
438
439 <dd>
440 </dd>
441
442 <dd> </dd>
443 <dl class="dl-horizontal">
444 <dt>images</dt>
445 <dd>the image sequence. </dd>
446
447 <dd> </dd>
448 <dt>number_terms</dt>
449 <dd>the number of terms in the list.  The actual list length is 2 x number_terms + 1 (the constant). </dd>
450
451 <dd> </dd>
452 <dt>terms</dt>
453 <dd>the list of polynomial coefficients and degree pairs and a constant. </dd>
454
455 <dd> </dd>
456 <dt>exception</dt>
457 <dd>return any errors or warnings in this structure. </dd>
458
459 <dd>  </dd>
460 </dl>
461 <h2><a href="../../api/MagickCore/statistic_8c.html" id="StatisticImage">StatisticImage</a></h2>
462
463 <p>StatisticImage() makes each pixel the min / max / median / mode / etc. of the neighborhood of the specified width and height.</p>
464
465 <p>The format of the StatisticImage method is:</p>
466
467 <pre class="text">
468 Image *StatisticImage(const Image *image,const StatisticType type,
469   const size_t width,const size_t height,ExceptionInfo *exception)
470 </pre>
471
472 <p>A description of each parameter follows:</p>
473
474 <dd>
475 </dd>
476
477 <dd> </dd>
478 <dl class="dl-horizontal">
479 <dt>image</dt>
480 <dd>the image. </dd>
481
482 <dd> </dd>
483 <dt>type</dt>
484 <dd>the statistic type (median, mode, etc.). </dd>
485
486 <dd> </dd>
487 <dt>width</dt>
488 <dd>the width of the pixel neighborhood. </dd>
489
490 <dd> </dd>
491 <dt>height</dt>
492 <dd>the height of the pixel neighborhood. </dd>
493
494 <dd> </dd>
495 <dt>exception</dt>
496 <dd>return any errors or warnings in this structure. </dd>
497
498 <dd>  </dd>
499 </dl>
500 </div>
501     </div>
502   </main><!-- /.container -->
503   <footer class="magick-footer">
504     <p><a href="../www/security-policy.html">Security</a> •
505     <a href="../www/architecture.html">Architecture</a>
506      
507     <a href="statistic.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../images/wand.ico"/></a>
508      
509     <a href="../www/links.html">Related</a> •
510      <a href="../www/sitemap.html">Sitemap</a>
511     <br/>
512     <a href="../www/support.html">Donate</a> •
513     <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
514     <a href="../www/contact.html">Contact Us</a> 
515     <br/>
516     <small>© 1999-2019 ImageMagick Studio LLC</small></p>
517   </footer>
518
519   <!-- Javascript assets -->
520   <script src="assets/magick.js" crossorigin="anonymous"></script>
521   <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script>')</script>
522 </body>
523 </html>
524 <!-- Magick Cache 24th April 2019 19:56 -->