analyze.c revision b51dff5c0d16a4c1b69ff683e786cb3b4c467694
13ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/* 23ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 33ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 43ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 53ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% AAA N N AAA L Y Y ZZZZZ EEEEE % 63ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% A A NN N A A L Y Y ZZ E % 73ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% AAAAA N N N AAAAA L Y ZZZ EEE % 83ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% A A N NN A A L Y ZZ E % 93ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% A A N N A A LLLLL Y ZZZZZ EEEEE % 103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% Analyze An Image % 123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% Software Design % 143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% Bill Corbis % 153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% December 1998 % 163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 187e41fe84a841d7b9d7b36b245b65e9dcb3314943cristy% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization % 193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% dedicated to making software imaging solutions freely available. % 203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% You may not use this file except in compliance with the License. You may % 223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% obtain a copy of the License at % 233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% http://www.imagemagick.org/script/license.php % 253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% Unless required by applicable law or agreed to in writing, software % 273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% distributed under the License is distributed on an "AS IS" BASIS, % 283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % 293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% See the License for the specific language governing permissions and % 303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% limitations under the License. % 313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/ 353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/* 373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Include declarations. 383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/ 393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include <stdio.h> 403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include <stdlib.h> 413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include <string.h> 423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include <time.h> 433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include <assert.h> 443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include <math.h> 453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include "magick/MagickCore.h" 463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/* 483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% a n a l y z e I m a g e % 533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% analyzeImage() computes the brightness and saturation mean, standard 593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% deviation, kurtosis and skewness and stores these values as attributes 603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% of the image. 613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% The format of the analyzeImage method is: 633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 64bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy% size_t analyzeImage(Image *images,const int argc, 653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% char **argv,ExceptionInfo *exception) 663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% A description of each parameter follows: 683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% o image: the address of a structure of type Image. 703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% o argc: Specifies a pointer to an integer describing the number of 723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% elements in the argument vector. 733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% o argv: Specifies a pointer to a text array containing the command line 753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% arguments. 763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% o exception: return any errors or warnings in this structure. 783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/ 80bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristyModuleExport size_t analyzeImage(Image **images,const int argc, 813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy const char **argv,ExceptionInfo *exception) 823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{ 833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy char 843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy text[MaxTextExtent]; 853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy double 873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy area, 8848974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy brightness, 893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_mean, 903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_standard_deviation, 913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_kurtosis, 923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_skewness, 933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x, 943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x2, 953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x3, 963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x4, 9748974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy hue, 9848974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy saturation, 993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_mean, 1003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_standard_deviation, 1013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_kurtosis, 1023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_skewness, 1033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x, 1043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x2, 1053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x3, 1063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x4; 1073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 1083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Image 1093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *image; 1103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 1113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy assert(images != (Image **) NULL); 1123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy assert(*images != (Image *) NULL); 1133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy assert((*images)->signature == MagickSignature); 1143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) argc; 1153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) argv; 1163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy image=(*images); 1173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy for ( ; image != (Image *) NULL; image=GetNextImageInList(image)) 1183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 11948974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy CacheView 12048974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy *image_view; 12148974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy 122bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 12348974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy y; 12448974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy 12548974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy MagickBooleanType 12648974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy status; 12748974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy 1283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x=0.0; 1293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x2=0.0; 1303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x3=0.0; 1313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x4=0.0; 1323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_mean=0.0; 1333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_standard_deviation=0.0; 1343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_kurtosis=0.0; 1353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_skewness=0.0; 1363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x=0.0; 1373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x2=0.0; 1383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x3=0.0; 1393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x4=0.0; 1403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_mean=0.0; 1413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_standard_deviation=0.0; 1423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_kurtosis=0.0; 1433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_skewness=0.0; 1443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy area=0.0; 14548974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy status=MagickTrue; 14648974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy image_view=AcquireCacheView(image); 14748974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy#if defined(MAGICKCORE_OPENMP_SUPPORT) 14848974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy #pragma omp parallel for schedule(dynamic,4) shared(status) 14948974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy#endif 150bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy for (y=0; y < (ssize_t) image->rows; y++) 1513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 15248974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy register const PixelPacket 15348974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy *p; 15448974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy 155bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy register ssize_t 15648974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy x; 15748974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy 15848974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy if (status == MagickFalse) 15948974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy continue; 16048974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); 1613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (p == (const PixelPacket *) NULL) 16248974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy { 16348974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy status=MagickFalse; 16448974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy continue; 16548974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy } 166bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy for (x=0; x < (ssize_t) image->columns; x++) 1673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 168d05ecd1dab44b782f4f1e145b0a1f36c7217b8a4cristy ConvertRGBToHSB(GetRedPixelComponent(p),GetGreenPixelComponent(p),GetBluePixelComponent(p),&hue,&saturation,&brightness); 1693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness*=QuantumRange; 1703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x+=brightness; 1713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x2+=brightness*brightness; 1723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x3+=brightness*brightness*brightness; 1733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x4+=brightness*brightness*brightness*brightness; 1743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation*=QuantumRange; 1753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x+=saturation; 1763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x2+=saturation*saturation; 1773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x3+=saturation*saturation*saturation; 1783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x4+=saturation*saturation*saturation*saturation; 1793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy area++; 1803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy p++; 1813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 1823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 18348974b9e7af8f4d112ff28ec47fa3201cff2ff21cristy image_view=DestroyCacheView(image_view); 1843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (area <= 0.0) 1853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 1863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_mean=brightness_sum_x/area; 187b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy (void) FormatLocaleString(text,MaxTextExtent,"%g",brightness_mean); 1883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) SetImageProperty(image,"filter:brightness:mean",text); 1893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_standard_deviation=sqrt(brightness_sum_x2/area-(brightness_sum_x/ 1903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy area*brightness_sum_x/area)); 191b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy (void) FormatLocaleString(text,MaxTextExtent,"%g", 1923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_standard_deviation); 1933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) SetImageProperty(image,"filter:brightness:standard-deviation",text); 1943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (brightness_standard_deviation != 0) 1953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_kurtosis=(brightness_sum_x4/area-4.0*brightness_mean* 1963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x3/area+6.0*brightness_mean*brightness_mean* 1973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x2/area-3.0*brightness_mean*brightness_mean* 1983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_mean*brightness_mean)/(brightness_standard_deviation* 1993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_standard_deviation*brightness_standard_deviation* 2003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_standard_deviation)-3.0; 201b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy (void) FormatLocaleString(text,MaxTextExtent,"%g",brightness_kurtosis); 2023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) SetImageProperty(image,"filter:brightness:kurtosis",text); 2033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (brightness_standard_deviation != 0) 2043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_skewness=(brightness_sum_x3/area-3.0*brightness_mean* 2053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_sum_x2/area+2.0*brightness_mean*brightness_mean* 2063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_mean)/(brightness_standard_deviation* 2073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy brightness_standard_deviation*brightness_standard_deviation); 208b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy (void) FormatLocaleString(text,MaxTextExtent,"%g",brightness_skewness); 2093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) SetImageProperty(image,"filter:brightness:skewness",text); 2103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_mean=saturation_sum_x/area; 211b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy (void) FormatLocaleString(text,MaxTextExtent,"%g",saturation_mean); 2123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) SetImageProperty(image,"filter:saturation:mean",text); 2133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_standard_deviation=sqrt(saturation_sum_x2/area-(saturation_sum_x/ 2143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy area*saturation_sum_x/area)); 215b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy (void) FormatLocaleString(text,MaxTextExtent,"%g", 2163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_standard_deviation); 2173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) SetImageProperty(image,"filter:saturation:standard-deviation",text); 2183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (saturation_standard_deviation != 0) 2193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_kurtosis=(saturation_sum_x4/area-4.0*saturation_mean* 2203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x3/area+6.0*saturation_mean*saturation_mean* 2213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x2/area-3.0*saturation_mean*saturation_mean* 2223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_mean*saturation_mean)/(saturation_standard_deviation* 2233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_standard_deviation*saturation_standard_deviation* 2243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_standard_deviation)-3.0; 225b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy (void) FormatLocaleString(text,MaxTextExtent,"%g",saturation_kurtosis); 2263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) SetImageProperty(image,"filter:saturation:kurtosis",text); 2273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (saturation_standard_deviation != 0) 2283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_skewness=(saturation_sum_x3/area-3.0*saturation_mean* 2293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_sum_x2/area+2.0*saturation_mean*saturation_mean* 2303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_mean)/(saturation_standard_deviation* 2313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy saturation_standard_deviation*saturation_standard_deviation); 232b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy (void) FormatLocaleString(text,MaxTextExtent,"%g",saturation_skewness); 2333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) SetImageProperty(image,"filter:saturation:skewness",text); 2343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 2353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy return(MagickImageFilterSignature); 2363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy} 237