MagickCore  6.9.10
Convert, Edit, Or Compose Bitmap Images
statistic.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
3  dedicated to making software imaging solutions freely available.
4 
5  You may not use this file except in compliance with the License. You may
6  obtain a copy of the License at
7 
8  https://imagemagick.org/script/license.php
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  MagickCore statistical methods.
17 */
18 #ifndef MAGICKCORE_STATISTIC_H
19 #define MAGICKCORE_STATISTIC_H
20 
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24 
25 #include "magick/draw.h"
26 
27 #define MaximumNumberOfImageMoments 8
28 #define MaximumNumberOfPerceptualHashes 7
29 
30 typedef struct _ChannelStatistics
31 {
32  size_t
34 
35  double
37  maxima,
38  sum,
40  sum_cubed,
42  mean,
43  variance,
45  kurtosis,
46  skewness,
47  entropy;
49 
50 #undef I
51 
52 typedef struct _ChannelMoments
53 {
54  double
55  I[32];
56 
57  PointInfo
60 
61  double
66 
67 typedef struct _ChannelPerceptualHash
68 {
69  double
70  P[32],
71  Q[32];
73 
74 typedef enum
75 {
110 
111 typedef enum
112 {
119 
120 typedef enum
121 {
132 } StatisticType;
133 
136 
139 
142 
143 extern MagickExport Image
145  *PolynomialImage(const Image *,const size_t,const double *,ExceptionInfo *),
146  *PolynomialImageChannel(const Image *,const ChannelType,const size_t,
147  const double *,ExceptionInfo *),
148  *StatisticImage(const Image *,const StatisticType,const size_t,const size_t,
149  ExceptionInfo *),
151  const size_t,const size_t,ExceptionInfo *);
152 
154  EvaluateImage(Image *,const MagickEvaluateOperator,const double,
155  ExceptionInfo *),
157  const double,ExceptionInfo *),
158  FunctionImage(Image *,const MagickFunction,const size_t,const double *,
159  ExceptionInfo *),
161  const size_t,const double *,ExceptionInfo *),
162  GetImageChannelEntropy(const Image *,const ChannelType,double *,
163  ExceptionInfo *),
164  GetImageChannelExtrema(const Image *,const ChannelType,size_t *,size_t *,
165  ExceptionInfo *),
166  GetImageChannelMean(const Image *,const ChannelType,double *,double *,
167  ExceptionInfo *),
168  GetImageChannelKurtosis(const Image *,const ChannelType,double *,double *,
169  ExceptionInfo *),
170  GetImageChannelRange(const Image *,const ChannelType,double *,double *,
171  ExceptionInfo *),
172  GetImageEntropy(const Image *,double *,ExceptionInfo *),
173  GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *),
174  GetImageMean(const Image *,double *,double *,ExceptionInfo *),
175  GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *),
176  GetImageRange(const Image *,double *,double *,ExceptionInfo *);
177 
178 #if defined(__cplusplus) || defined(c_plusplus)
179 }
180 #endif
181 
182 #endif
Definition: statistic.h:87
Definition: statistic.h:103
double sum
Definition: statistic.h:36
Definition: statistic.h:82
StatisticType
Definition: statistic.h:120
double Q[32]
Definition: statistic.h:70
double standard_deviation
Definition: statistic.h:36
Definition: statistic.h:76
Definition: statistic.h:116
Definition: statistic.h:88
double minima
Definition: statistic.h:36
Definition: statistic.h:77
double sum_cubed
Definition: statistic.h:36
Definition: statistic.h:99
double ellipse_angle
Definition: statistic.h:62
MagickExport MagickBooleanType FunctionImage(Image *image, const MagickFunction function, const size_t number_parameters, const double *parameters, ExceptionInfo *exception)
Definition: statistic.c:1076
Definition: statistic.h:83
MagickExport MagickBooleanType EvaluateImage(Image *image, const MagickEvaluateOperator op, const double value, ExceptionInfo *exception)
Definition: statistic.c:472
double maxima
Definition: statistic.h:36
MagickExport MagickBooleanType GetImageChannelEntropy(const Image *image, const ChannelType channel, double *entropy, ExceptionInfo *exception)
Definition: statistic.c:1232
struct _ChannelMoments ChannelMoments
Definition: exception.h:102
Definition: statistic.h:106
double I[32]
Definition: statistic.h:55
Definition: statistic.h:93
MagickExport Image * PolynomialImageChannel(const Image *images, const ChannelType channel, const size_t number_terms, const double *terms, ExceptionInfo *exception)
Definition: statistic.c:2759
Definition: statistic.h:115
MagickExport Image * StatisticImageChannel(const Image *image, const ChannelType channel, const StatisticType type, const size_t width, const size_t height, ExceptionInfo *exception)
Definition: statistic.c:3600
struct _ChannelStatistics ChannelStatistics
Definition: statistic.h:52
MagickExport MagickBooleanType GetImageEntropy(const Image *image, double *entropy, ExceptionInfo *exception)
Definition: statistic.c:1222
Definition: statistic.h:91
Definition: image.h:152
Definition: statistic.h:117
Definition: statistic.h:122
Definition: statistic.h:80
Definition: statistic.h:108
Definition: statistic.h:96
MagickBooleanType
Definition: magick-type.h:198
double ellipse_intensity
Definition: statistic.h:62
double mean
Definition: statistic.h:36
MagickEvaluateOperator
Definition: statistic.h:74
Definition: statistic.h:84
Definition: statistic.h:95
MagickExport MagickBooleanType GetImageChannelRange(const Image *image, const ChannelType channel, double *minima, double *maxima, ExceptionInfo *exception)
Definition: statistic.c:2228
Definition: statistic.h:101
Definition: statistic.h:98
double skewness
Definition: statistic.h:36
Definition: statistic.h:94
MagickExport ChannelStatistics * GetImageChannelStatistics(const Image *image, ExceptionInfo *exception)
Definition: statistic.c:2338
Definition: statistic.h:89
Definition: statistic.h:113
Definition: statistic.h:127
size_t depth
Definition: statistic.h:33
double entropy
Definition: statistic.h:36
MagickExport MagickBooleanType GetImageChannelKurtosis(const Image *image, const ChannelType channel, double *kurtosis, double *skewness, ExceptionInfo *exception)
Definition: statistic.c:1398
Definition: statistic.h:104
Definition: statistic.h:107
MagickExport MagickBooleanType FunctionImageChannel(Image *image, const ChannelType channel, const MagickFunction function, const size_t number_parameters, const double *parameters, ExceptionInfo *exception)
Definition: statistic.c:1088
MagickExport MagickBooleanType GetImageRange(const Image *image, double *minima, double *maxima, ExceptionInfo *exception)
Definition: statistic.c:2222
MagickExport MagickBooleanType GetImageKurtosis(const Image *image, double *kurtosis, double *skewness, ExceptionInfo *exception)
Definition: statistic.c:1387
Definition: statistic.h:90
Definition: statistic.h:131
MagickExport MagickBooleanType GetImageMean(const Image *image, double *mean, double *standard_deviation, ExceptionInfo *exception)
Definition: statistic.c:1553
Definition: statistic.h:85
Definition: statistic.h:123
MagickExport MagickBooleanType EvaluateImageChannel(Image *image, const ChannelType channel, const MagickEvaluateOperator op, const double value, ExceptionInfo *exception)
Definition: statistic.c:813
Definition: statistic.h:105
Definition: statistic.h:97
MagickExport MagickBooleanType GetImageChannelExtrema(const Image *image, const ChannelType channel, size_t *minima, size_t *maxima, ExceptionInfo *exception)
Definition: statistic.c:1332
ChannelType
Definition: magick-type.h:164
double kurtosis
Definition: statistic.h:36
MagickExport MagickBooleanType GetImageExtrema(const Image *image, size_t *minima, size_t *maxima, ExceptionInfo *exception)
Definition: statistic.c:1321
MagickExport ChannelPerceptualHash * GetImageChannelPerceptualHash(const Image *image, ExceptionInfo *exception)
Definition: statistic.c:2113
Definition: statistic.h:67
PointInfo centroid
Definition: statistic.h:58
struct _ChannelPerceptualHash ChannelPerceptualHash
Definition: statistic.h:129
Definition: statistic.h:86
Definition: statistic.h:79
Definition: statistic.h:114
Definition: statistic.h:126
Definition: statistic.h:102
PointInfo ellipse_axis
Definition: statistic.h:58
MagickExport MagickBooleanType GetImageChannelMean(const Image *image, const ChannelType channel, double *mean, double *standard_deviation, ExceptionInfo *exception)
Definition: statistic.c:1564
double sum_squared
Definition: statistic.h:36
double ellipse_eccentricity
Definition: statistic.h:62
Definition: statistic.h:81
Definition: statistic.h:92
#define MagickExport
Definition: method-attribute.h:80
Definition: statistic.h:124
Definition: statistic.h:125
Definition: statistic.h:30
MagickExport Image * PolynomialImage(const Image *images, const size_t number_terms, const double *terms, ExceptionInfo *exception)
Definition: statistic.c:2748
double P[32]
Definition: statistic.h:70
MagickFunction
Definition: statistic.h:111
Definition: statistic.h:128
Definition: statistic.h:130
double variance
Definition: statistic.h:36
Definition: statistic.h:100
Definition: draw.h:138
MagickExport Image * EvaluateImages(const Image *images, const MagickEvaluateOperator op, ExceptionInfo *exception)
Definition: statistic.c:482
MagickExport Image * StatisticImage(const Image *image, const StatisticType type, const size_t width, const size_t height, ExceptionInfo *exception)
Definition: statistic.c:3589
Definition: statistic.h:78
double sum_fourth_power
Definition: statistic.h:36
MagickExport ChannelMoments * GetImageChannelMoments(const Image *image, ExceptionInfo *exception)
Definition: statistic.c:1659