www/api/statistic.html
Select API Method
EvaluateImage() applies a value to the image with an arithmetic, relational, or logical operator to an image. Use these operations to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image.
The format of the EvaluateImage method is:
MagickBooleanType EvaluateImage(Image \*image, const MagickEvaluateOperator op,const double value, ExceptionInfo \*exception) MagickBooleanType EvaluateImages(Image \*images, const MagickEvaluateOperator op,const double value, ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. opA channel op. valueA value value. exceptionreturn any errors or warnings in this structure.
FunctionImage() applies a value to the image with an arithmetic, relational, or logical operator to an image. Use these operations to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image.
The format of the FunctionImage method is:
MagickBooleanType FunctionImage(Image \*image, const MagickFunction function,const ssize\_t number\_parameters, const double \*parameters,ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. functionA channel function. parametersone or more parameters. exceptionreturn any errors or warnings in this structure.
GetImageEntropy() returns the entropy of one or more image channels.
The format of the GetImageEntropy method is:
MagickBooleanType GetImageEntropy(const Image \*image,double \*entropy, ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. entropythe average entropy of the selected channels. exceptionreturn any errors or warnings in this structure.
GetImageExtrema() returns the extrema of one or more image channels.
The format of the GetImageExtrema method is:
MagickBooleanType GetImageExtrema(const Image \*image,size\_t \*minima, size\_t \*maxima,ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. minimathe minimum value in the channel. maximathe maximum value in the channel. exceptionreturn any errors or warnings in this structure.
GetImageKurtosis() returns the kurtosis and skewness of one or more image channels.
The format of the GetImageKurtosis method is:
MagickBooleanType GetImageKurtosis(const Image \*image,double \*kurtosis, double \*skewness,ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. kurtosisthe kurtosis of the channel. skewnessthe skewness of the channel. exceptionreturn any errors or warnings in this structure.
GetImageMean() returns the mean and standard deviation of one or more image channels.
The format of the GetImageMean method is:
MagickBooleanType GetImageMean(const Image \*image,double \*mean, double \*standard\_deviation,ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. meanthe average value in the channel. standard_deviationthe standard deviation of the channel. exceptionreturn any errors or warnings in this structure.
GetImageMedian() returns the median pixel of one or more image channels.
The format of the GetImageMedian method is:
MagickBooleanType GetImageMedian(const Image \*image,double \*median, ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. medianthe average value in the channel. exceptionreturn any errors or warnings in this structure.
GetImageMoments() returns the normalized moments of one or more image channels.
The format of the GetImageMoments method is:
ChannelMoments \*GetImageMoments(const Image \*image, ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. exceptionreturn any errors or warnings in this structure.
GetImagePerceptualHash() returns the perceptual hash of one or more image channels.
The format of the GetImagePerceptualHash method is:
ChannelPerceptualHash \*GetImagePerceptualHash(const Image \*image, ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. exceptionreturn any errors or warnings in this structure.
GetImageRange() returns the range of one or more image channels.
The format of the GetImageRange method is:
MagickBooleanType GetImageRange(const Image \*image,double \*minima, double \*maxima,ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. minimathe minimum value in the channel. maximathe maximum value in the channel. exceptionreturn any errors or warnings in this structure.
GetImageStatistics() returns statistics for each channel in the image. The statistics include the channel depth, its minima, maxima, mean, standard deviation, kurtosis and skewness. You can access the red channel mean, for example, like this:
channel\_statistics=GetImageStatistics(image,exception); red\_mean=channel\_statistics[RedPixelChannel].mean;
Use MagickRelinquishMemory() to free the statistics buffer.
The format of the GetImageStatistics method is:
ChannelStatistics \*GetImageStatistics(const Image \*image, ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. exceptionreturn any errors or warnings in this structure.
PolynomialImage() returns a new image where each pixel is the sum of the pixels in the image sequence after applying its corresponding terms (coefficient and degree pairs).
The format of the PolynomialImage method is:
Image \*PolynomialImage(const Image \*images,const size\_t number\_terms, const double \*terms,ExceptionInfo \*exception)
A description of each parameter follows:
imagesthe image sequence. number_termsthe number of terms in the list. The actual list length is 2 x number_terms + 1 (the constant). termsthe list of polynomial coefficients and degree pairs and a constant. exceptionreturn any errors or warnings in this structure.
StatisticImage() makes each pixel the min / max / median / mode / etc. of the neighborhood of the specified width and height.
The format of the StatisticImage method is:
Image \*StatisticImage(const Image \*image,const StatisticType type, const size\_t width,const size\_t height,ExceptionInfo \*exception)
A description of each parameter follows:
imagethe image. typethe statistic type (median, mode, etc.). widththe width of the pixel neighborhood. heightthe height of the pixel neighborhood. exceptionreturn any errors or warnings in this structure.