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   InverseLogEvaluateOperator
00120 } MagickEvaluateOperator;
00121 
00122 typedef enum
00123 {
00124   UndefinedFunction,
00125   ArcsinFunction,
00126   ArctanFunction,
00127   PolynomialFunction,
00128   SinusoidFunction
00129 } MagickFunction;
00130 
00131 typedef enum
00132 {
00133   UndefinedStatistic,
00134   GradientStatistic,
00135   MaximumStatistic,
00136   MeanStatistic,
00137   MedianStatistic,
00138   MinimumStatistic,
00139   ModeStatistic,
00140   NonpeakStatistic,
00141   RootMeanSquareStatistic,
00142   StandardDeviationStatistic
00143 } StatisticType;
00144 
00145 extern MagickExport ChannelStatistics
00146   *GetImageStatistics(const Image *,ExceptionInfo *);
00147 
00148 extern MagickExport ChannelMoments
00149   *GetImageMoments(const Image *,ExceptionInfo *);
00150 
00151 extern MagickExport ChannelPerceptualHash
00152   *GetImagePerceptualHash(const Image *,ExceptionInfo *);
00153 
00154 extern MagickExport Image
00155   *EvaluateImages(const Image *,const MagickEvaluateOperator,ExceptionInfo *),
00156   *PolynomialImage(const Image *,const size_t,const double *,ExceptionInfo *),
00157   *StatisticImage(const Image *,const StatisticType,const size_t,const size_t,
00158     ExceptionInfo *);
00159 
00160 extern MagickExport MagickBooleanType
00161   EvaluateImage(Image *,const MagickEvaluateOperator,const double,
00162     ExceptionInfo *),
00163   FunctionImage(Image *,const MagickFunction,const size_t,const double *,
00164     ExceptionInfo *),
00165   GetImageEntropy(const Image *,double *,ExceptionInfo *),
00166   GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *),
00167   GetImageMean(const Image *,double *,double *,ExceptionInfo *),
00168   GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *),
00169   GetImageRange(const Image *,double *,double *,ExceptionInfo *);
00170 
00171 #if defined(__cplusplus) || defined(c_plusplus)
00172 }
00173 #endif
00174 
00175 #endif

Generated on 3 Aug 2020 for MagickCore by  doxygen 1.6.1