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     median;
00049 } ChannelStatistics;
00050 
00051 typedef struct _ChannelMoments
00052 {
00053   double
00054     invariant[MaximumNumberOfImageMoments+1];
00055 
00056   PointInfo
00057     centroid,
00058     ellipse_axis;
00059 
00060   double
00061     ellipse_angle,
00062     ellipse_eccentricity,
00063     ellipse_intensity;
00064 } ChannelMoments;
00065 
00066 typedef struct _ChannelPerceptualHash
00067 {
00068   double
00069     srgb_hu_phash[MaximumNumberOfImageMoments+1],
00070     hclp_hu_phash[MaximumNumberOfImageMoments+1];
00071 
00072   size_t
00073     number_colorspaces;
00074 
00075   ColorspaceType
00076     colorspace[MaximumNumberOfPerceptualColorspaces+1];
00077 
00078   double
00079     phash[MaximumNumberOfPerceptualColorspaces+1][MaximumNumberOfImageMoments+1];
00080 
00081   size_t
00082     number_channels;
00083 } ChannelPerceptualHash;
00084 
00085 typedef enum
00086 {
00087   UndefinedEvaluateOperator,
00088   AbsEvaluateOperator,
00089   AddEvaluateOperator,
00090   AddModulusEvaluateOperator,
00091   AndEvaluateOperator,
00092   CosineEvaluateOperator,
00093   DivideEvaluateOperator,
00094   ExponentialEvaluateOperator,
00095   GaussianNoiseEvaluateOperator,
00096   ImpulseNoiseEvaluateOperator,
00097   LaplacianNoiseEvaluateOperator,
00098   LeftShiftEvaluateOperator,
00099   LogEvaluateOperator,
00100   MaxEvaluateOperator,
00101   MeanEvaluateOperator,
00102   MedianEvaluateOperator,
00103   MinEvaluateOperator,
00104   MultiplicativeNoiseEvaluateOperator,
00105   MultiplyEvaluateOperator,
00106   OrEvaluateOperator,
00107   PoissonNoiseEvaluateOperator,
00108   PowEvaluateOperator,
00109   RightShiftEvaluateOperator,
00110   RootMeanSquareEvaluateOperator,
00111   SetEvaluateOperator,
00112   SineEvaluateOperator,
00113   SubtractEvaluateOperator,
00114   SumEvaluateOperator,
00115   ThresholdBlackEvaluateOperator,
00116   ThresholdEvaluateOperator,
00117   ThresholdWhiteEvaluateOperator,
00118   UniformNoiseEvaluateOperator,
00119   XorEvaluateOperator,
00120   InverseLogEvaluateOperator
00121 } MagickEvaluateOperator;
00122 
00123 typedef enum
00124 {
00125   UndefinedFunction,
00126   ArcsinFunction,
00127   ArctanFunction,
00128   PolynomialFunction,
00129   SinusoidFunction
00130 } MagickFunction;
00131 
00132 typedef enum
00133 {
00134   UndefinedStatistic,
00135   GradientStatistic,
00136   MaximumStatistic,
00137   MeanStatistic,
00138   MedianStatistic,
00139   MinimumStatistic,
00140   ModeStatistic,
00141   NonpeakStatistic,
00142   RootMeanSquareStatistic,
00143   StandardDeviationStatistic
00144 } StatisticType;
00145 
00146 extern MagickExport ChannelStatistics
00147   *GetImageStatistics(const Image *,ExceptionInfo *);
00148 
00149 extern MagickExport ChannelMoments
00150   *GetImageMoments(const Image *,ExceptionInfo *);
00151 
00152 extern MagickExport ChannelPerceptualHash
00153   *GetImagePerceptualHash(const Image *,ExceptionInfo *);
00154 
00155 extern MagickExport Image
00156   *EvaluateImages(const Image *,const MagickEvaluateOperator,ExceptionInfo *),
00157   *PolynomialImage(const Image *,const size_t,const double *,ExceptionInfo *),
00158   *StatisticImage(const Image *,const StatisticType,const size_t,const size_t,
00159     ExceptionInfo *);
00160 
00161 extern MagickExport MagickBooleanType
00162   EvaluateImage(Image *,const MagickEvaluateOperator,const double,
00163     ExceptionInfo *),
00164   FunctionImage(Image *,const MagickFunction,const size_t,const double *,
00165     ExceptionInfo *),
00166   GetImageEntropy(const Image *,double *,ExceptionInfo *),
00167   GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *),
00168   GetImageMean(const Image *,double *,double *,ExceptionInfo *),
00169   GetImageMedian(const Image *,double *,ExceptionInfo *),
00170   GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *),
00171   GetImageRange(const Image *,double *,double *,ExceptionInfo *);
00172 
00173 #if defined(__cplusplus) || defined(c_plusplus)
00174 }
00175 #endif
00176 
00177 #endif

Generated on 16 Nov 2020 for MagickCore by  doxygen 1.6.1