statistic.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
00003   dedicated to making software imaging solutions freely available.
00004   
00005   You may not use this file except in compliance with the License.  You may
00006   obtain a copy of the License at
00007   
00008     https://imagemagick.org/script/license.php
00009   
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 
00016   MagickCore statistical methods.
00017 */
00018 #ifndef MAGICKCORE_STATISTIC_H
00019 #define MAGICKCORE_STATISTIC_H
00020 
00021 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024 
00025 #define MaximumNumberOfImageMoments  8
00026 #define MaximumNumberOfPerceptualColorspaces  6
00027 #define MaximumNumberOfPerceptualHashes  7
00028 
00029 typedef struct _ChannelStatistics
00030 {
00031   size_t
00032     depth;
00033 
00034   double
00035     area,
00036     minima,
00037     maxima,
00038     sum,
00039     sum_squared,
00040     sum_cubed,
00041     sum_fourth_power,
00042     mean,
00043     variance,
00044     standard_deviation,
00045     kurtosis,
00046     skewness,
00047     entropy;
00048 } ChannelStatistics;
00049 
00050 typedef struct _ChannelMoments
00051 {
00052   double
00053     invariant[MaximumNumberOfImageMoments+1];
00054 
00055   PointInfo
00056     centroid,
00057     ellipse_axis;
00058 
00059   double
00060     ellipse_angle,
00061     ellipse_eccentricity,
00062     ellipse_intensity;
00063 } ChannelMoments;
00064 
00065 typedef struct _ChannelPerceptualHash
00066 {
00067   double
00068     srgb_hu_phash[MaximumNumberOfImageMoments+1],
00069     hclp_hu_phash[MaximumNumberOfImageMoments+1];
00070 
00071   size_t
00072     number_colorspaces;
00073 
00074   ColorspaceType
00075     colorspace[MaximumNumberOfPerceptualColorspaces+1];
00076 
00077   double
00078     phash[MaximumNumberOfPerceptualColorspaces+1][MaximumNumberOfImageMoments+1];
00079 
00080   size_t
00081     number_channels;
00082 } ChannelPerceptualHash;
00083 
00084 typedef enum
00085 {
00086   UndefinedEvaluateOperator,
00087   AbsEvaluateOperator,
00088   AddEvaluateOperator,
00089   AddModulusEvaluateOperator,
00090   AndEvaluateOperator,
00091   CosineEvaluateOperator,
00092   DivideEvaluateOperator,
00093   ExponentialEvaluateOperator,
00094   GaussianNoiseEvaluateOperator,
00095   ImpulseNoiseEvaluateOperator,
00096   LaplacianNoiseEvaluateOperator,
00097   LeftShiftEvaluateOperator,
00098   LogEvaluateOperator,
00099   MaxEvaluateOperator,
00100   MeanEvaluateOperator,
00101   MedianEvaluateOperator,
00102   MinEvaluateOperator,
00103   MultiplicativeNoiseEvaluateOperator,
00104   MultiplyEvaluateOperator,
00105   OrEvaluateOperator,
00106   PoissonNoiseEvaluateOperator,
00107   PowEvaluateOperator,
00108   RightShiftEvaluateOperator,
00109   RootMeanSquareEvaluateOperator,
00110   SetEvaluateOperator,
00111   SineEvaluateOperator,
00112   SubtractEvaluateOperator,
00113   SumEvaluateOperator,
00114   ThresholdBlackEvaluateOperator,
00115   ThresholdEvaluateOperator,
00116   ThresholdWhiteEvaluateOperator,
00117   UniformNoiseEvaluateOperator,
00118   XorEvaluateOperator
00119 } MagickEvaluateOperator;
00120 
00121 typedef enum
00122 {
00123   UndefinedFunction,
00124   ArcsinFunction,
00125   ArctanFunction,
00126   PolynomialFunction,
00127   SinusoidFunction
00128 } MagickFunction;
00129 
00130 typedef enum
00131 {
00132   UndefinedStatistic,
00133   GradientStatistic,
00134   MaximumStatistic,
00135   MeanStatistic,
00136   MedianStatistic,
00137   MinimumStatistic,
00138   ModeStatistic,
00139   NonpeakStatistic,
00140   RootMeanSquareStatistic,
00141   StandardDeviationStatistic
00142 } StatisticType;
00143 
00144 extern MagickExport ChannelStatistics
00145   *GetImageStatistics(const Image *,ExceptionInfo *);
00146 
00147 extern MagickExport ChannelMoments
00148   *GetImageMoments(const Image *,ExceptionInfo *);
00149 
00150 extern MagickExport ChannelPerceptualHash
00151   *GetImagePerceptualHash(const Image *,ExceptionInfo *);
00152 
00153 extern MagickExport Image
00154   *EvaluateImages(const Image *,const MagickEvaluateOperator,ExceptionInfo *),
00155   *PolynomialImage(const Image *,const size_t,const double *,ExceptionInfo *),
00156   *StatisticImage(const Image *,const StatisticType,const size_t,const size_t,
00157     ExceptionInfo *);
00158 
00159 extern MagickExport MagickBooleanType
00160   EvaluateImage(Image *,const MagickEvaluateOperator,const double,
00161     ExceptionInfo *),
00162   FunctionImage(Image *,const MagickFunction,const size_t,const double *,
00163     ExceptionInfo *),
00164   GetImageEntropy(const Image *,double *,ExceptionInfo *),
00165   GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *),
00166   GetImageMean(const Image *,double *,double *,ExceptionInfo *),
00167   GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *),
00168   GetImageRange(const Image *,double *,double *,ExceptionInfo *);
00169 
00170 #if defined(__cplusplus) || defined(c_plusplus)
00171 }
00172 #endif
00173 
00174 #endif

Generated on 25 May 2020 for MagickCore by  doxygen 1.6.1