MagickCore  7.0.3
statistic.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2019 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 #define MaximumNumberOfImageMoments 8
26 #define MaximumNumberOfPerceptualColorspaces 6
27 #define MaximumNumberOfPerceptualHashes 7
28 
29 typedef struct _ChannelStatistics
30 {
31  size_t
33 
34  double
36  minima,
37  maxima,
38  sum,
40  sum_cubed,
42  mean,
43  variance,
45  kurtosis,
46  skewness,
47  entropy;
49 
50 typedef struct _ChannelMoments
51 {
52  double
54 
55  PointInfo
58 
59  double
64 
65 typedef struct _ChannelPerceptualHash
66 {
67  double
70 
71  size_t
73 
76 
77  double
79 
80  size_t
83 
84 typedef enum
85 {
120 
121 typedef enum
122 {
129 
130 typedef enum
131 {
142 } StatisticType;
143 
146 
148  *GetImageMoments(const Image *,ExceptionInfo *);
149 
152 
153 extern MagickExport Image
155  *PolynomialImage(const Image *,const size_t,const double *,ExceptionInfo *),
156  *StatisticImage(const Image *,const StatisticType,const size_t,const size_t,
157  ExceptionInfo *);
158 
160  EvaluateImage(Image *,const MagickEvaluateOperator,const double,
161  ExceptionInfo *),
162  FunctionImage(Image *,const MagickFunction,const size_t,const double *,
163  ExceptionInfo *),
164  GetImageEntropy(const Image *,double *,ExceptionInfo *),
165  GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *),
166  GetImageMean(const Image *,double *,double *,ExceptionInfo *),
167  GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *),
168  GetImageRange(const Image *,double *,double *,ExceptionInfo *);
169 
170 #if defined(__cplusplus) || defined(c_plusplus)
171 }
172 #endif
173 
174 #endif
StatisticType
Definition: statistic.h:130
double standard_deviation
Definition: statistic.h:35
double phash[MaximumNumberOfPerceptualColorspaces+1][MaximumNumberOfImageMoments+1]
Definition: statistic.h:78
double ellipse_angle
Definition: statistic.h:60
MagickExport MagickBooleanType FunctionImage(Image *image, const MagickFunction function, const size_t number_parameters, const double *parameters, ExceptionInfo *exception)
Definition: statistic.c:1009
MagickExport ChannelStatistics * GetImageStatistics(const Image *image, ExceptionInfo *exception)
Definition: statistic.c:1918
MagickExport MagickBooleanType EvaluateImage(Image *image, const MagickEvaluateOperator op, const double value, ExceptionInfo *exception)
Definition: statistic.c:772
struct _ChannelMoments ChannelMoments
#define MaximumNumberOfImageMoments
Definition: statistic.h:25
struct _ChannelStatistics ChannelStatistics
MagickExport MagickBooleanType GetImageEntropy(const Image *image, double *entropy, ExceptionInfo *exception)
Definition: statistic.c:1128
Definition: image.h:151
double invariant[MaximumNumberOfImageMoments+1]
Definition: statistic.h:53
MagickBooleanType
Definition: magick-type.h:158
double ellipse_intensity
Definition: statistic.h:60
MagickEvaluateOperator
Definition: statistic.h:84
#define MaximumNumberOfPerceptualColorspaces
Definition: statistic.h:26
MagickExport ChannelMoments * GetImageMoments(const Image *image, ExceptionInfo *exception)
Definition: statistic.c:1346
double hclp_hu_phash[MaximumNumberOfImageMoments+1]
Definition: statistic.h:68
MagickExport MagickBooleanType GetImageRange(const Image *image, double *minima, double *maxima, ExceptionInfo *exception)
Definition: statistic.c:1783
MagickExport MagickBooleanType GetImageKurtosis(const Image *image, double *kurtosis, double *skewness, ExceptionInfo *exception)
Definition: statistic.c:1226
MagickExport MagickBooleanType GetImageMean(const Image *image, double *mean, double *standard_deviation, ExceptionInfo *exception)
Definition: statistic.c:1276
MagickExport MagickBooleanType GetImageExtrema(const Image *image, size_t *minima, size_t *maxima, ExceptionInfo *exception)
Definition: statistic.c:1176
PointInfo centroid
Definition: statistic.h:56
struct _ChannelPerceptualHash ChannelPerceptualHash
ColorspaceType colorspace[MaximumNumberOfPerceptualColorspaces+1]
Definition: statistic.h:75
ColorspaceType
Definition: colorspace.h:25
PointInfo ellipse_axis
Definition: statistic.h:56
double sum_squared
Definition: statistic.h:35
double ellipse_eccentricity
Definition: statistic.h:60
#define MagickExport
double srgb_hu_phash[MaximumNumberOfImageMoments+1]
Definition: statistic.h:68
MagickExport Image * PolynomialImage(const Image *images, const size_t number_terms, const double *terms, ExceptionInfo *exception)
Definition: statistic.c:2167
MagickExport ChannelPerceptualHash * GetImagePerceptualHash(const Image *image, ExceptionInfo *exception)
Definition: statistic.c:1675
MagickFunction
Definition: statistic.h:121
MagickExport Image * EvaluateImages(const Image *images, const MagickEvaluateOperator op, ExceptionInfo *exception)
Definition: statistic.c:444
MagickExport Image * StatisticImage(const Image *image, const StatisticType type, const size_t width, const size_t height, ExceptionInfo *exception)
Definition: statistic.c:2836
double sum_fourth_power
Definition: statistic.h:35