MagickCore  6.9.12-43
Convert, Edit, Or Compose Bitmap Images
statistic.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2021 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 {
111 
112 typedef enum
113 {
120 
121 typedef enum
122 {
133 } StatisticType;
134 
137 
140 
143 
144 extern MagickExport Image
146  *PolynomialImage(const Image *,const size_t,const double *,ExceptionInfo *),
147  *PolynomialImageChannel(const Image *,const ChannelType,const size_t,
148  const double *,ExceptionInfo *),
149  *StatisticImage(const Image *,const StatisticType,const size_t,const size_t,
150  ExceptionInfo *),
152  const size_t,const size_t,ExceptionInfo *);
153 
155  EvaluateImage(Image *,const MagickEvaluateOperator,const double,
156  ExceptionInfo *),
158  const double,ExceptionInfo *),
159  FunctionImage(Image *,const MagickFunction,const size_t,const double *,
160  ExceptionInfo *),
162  const size_t,const double *,ExceptionInfo *),
163  GetImageChannelEntropy(const Image *,const ChannelType,double *,
164  ExceptionInfo *),
165  GetImageChannelExtrema(const Image *,const ChannelType,size_t *,size_t *,
166  ExceptionInfo *),
167  GetImageChannelMean(const Image *,const ChannelType,double *,double *,
168  ExceptionInfo *),
169  GetImageChannelKurtosis(const Image *,const ChannelType,double *,double *,
170  ExceptionInfo *),
171  GetImageChannelRange(const Image *,const ChannelType,double *,double *,
172  ExceptionInfo *),
173  GetImageEntropy(const Image *,double *,ExceptionInfo *),
174  GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *),
175  GetImageMean(const Image *,double *,double *,ExceptionInfo *),
176  GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *),
177  GetImageRange(const Image *,double *,double *,ExceptionInfo *);
178 
179 #if defined(__cplusplus) || defined(c_plusplus)
180 }
181 #endif
182 
183 #endif
Definition: statistic.h:87
Definition: statistic.h:103
double sum
Definition: statistic.h:36
Definition: statistic.h:82
StatisticType
Definition: statistic.h:121
double Q[32]
Definition: statistic.h:70
double standard_deviation
Definition: statistic.h:36
Definition: statistic.h:76
Definition: statistic.h:117
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:1088
Definition: statistic.h:83
MagickExport MagickBooleanType EvaluateImage(Image *image, const MagickEvaluateOperator op, const double value, ExceptionInfo *exception)
Definition: statistic.c:478
double maxima
Definition: statistic.h:36
MagickExport MagickBooleanType GetImageChannelEntropy(const Image *image, const ChannelType channel, double *entropy, ExceptionInfo *exception)
Definition: statistic.c:1244
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:2765
Definition: statistic.h:116
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:3606
struct _ChannelStatistics ChannelStatistics
Definition: statistic.h:52
MagickExport MagickBooleanType GetImageEntropy(const Image *image, double *entropy, ExceptionInfo *exception)
Definition: statistic.c:1234
Definition: statistic.h:91
Definition: image.h:152
Definition: statistic.h:118
Definition: statistic.h:123
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:2234
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:2344
Definition: statistic.h:109
Definition: statistic.h:89
Definition: statistic.h:114
Definition: statistic.h:128
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:1410
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:1100
MagickExport MagickBooleanType GetImageRange(const Image *image, double *minima, double *maxima, ExceptionInfo *exception)
Definition: statistic.c:2228
MagickExport MagickBooleanType GetImageKurtosis(const Image *image, double *kurtosis, double *skewness, ExceptionInfo *exception)
Definition: statistic.c:1399
Definition: statistic.h:90
Definition: statistic.h:132
MagickExport MagickBooleanType GetImageMean(const Image *image, double *mean, double *standard_deviation, ExceptionInfo *exception)
Definition: statistic.c:1565
Definition: statistic.h:85
Definition: statistic.h:124
MagickExport MagickBooleanType EvaluateImageChannel(Image *image, const ChannelType channel, const MagickEvaluateOperator op, const double value, ExceptionInfo *exception)
Definition: statistic.c:819
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:1344
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:1333
MagickExport ChannelPerceptualHash * GetImageChannelPerceptualHash(const Image *image, ExceptionInfo *exception)
Definition: statistic.c:2119
Definition: statistic.h:67
PointInfo centroid
Definition: statistic.h:58
struct _ChannelPerceptualHash ChannelPerceptualHash
Definition: statistic.h:130
Definition: statistic.h:86
Definition: statistic.h:79
Definition: statistic.h:115
Definition: statistic.h:127
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:1576
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:125
Definition: statistic.h:126
Definition: statistic.h:30
MagickExport Image * PolynomialImage(const Image *images, const size_t number_terms, const double *terms, ExceptionInfo *exception)
Definition: statistic.c:2754
double P[32]
Definition: statistic.h:70
MagickFunction
Definition: statistic.h:112
Definition: statistic.h:129
Definition: statistic.h:131
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:488
MagickExport Image * StatisticImage(const Image *image, const StatisticType type, const size_t width, const size_t height, ExceptionInfo *exception)
Definition: statistic.c:3595
Definition: statistic.h:78
double sum_fourth_power
Definition: statistic.h:36
MagickExport ChannelMoments * GetImageChannelMoments(const Image *image, ExceptionInfo *exception)
Definition: statistic.c:1671