From: cristy Date: Wed, 8 Jan 2014 00:21:50 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~2944 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89298f3c13624feaa1c88ace47e4c728ea9d1fb0;p=imagemagick --- diff --git a/MagickCore/identify.c b/MagickCore/identify.c index c3cec97ea..4d5f7d86a 100644 --- a/MagickCore/identify.c +++ b/MagickCore/identify.c @@ -371,26 +371,28 @@ static ssize_t PrintChannelLocations(FILE *file,const Image *image, static ssize_t PrintChannelMoments(FILE *file,const PixelChannel channel, const char *name,const ChannelMoments *channel_moments) { + register ssize_t + i; + ssize_t n; - n=FormatLocaleFile(file,"% s:\n",name); - n+=FormatLocaleFile(file," i1: %.*g\n",GetMagickPrecision(), - channel_moments[channel].I1); - n+=FormatLocaleFile(file," i2: %.*g\n",GetMagickPrecision(), - channel_moments[channel].I2); - n+=FormatLocaleFile(file," i3: %.*g\n",GetMagickPrecision(), - channel_moments[channel].I3); - n+=FormatLocaleFile(file," i4: %.*g\n",GetMagickPrecision(), - channel_moments[channel].I4); - n+=FormatLocaleFile(file," i5: %.*g\n",GetMagickPrecision(), - channel_moments[channel].I5); - n+=FormatLocaleFile(file," i6: %.*g\n",GetMagickPrecision(), - channel_moments[channel].I6); - n+=FormatLocaleFile(file," i7: %.*g\n",GetMagickPrecision(), - channel_moments[channel].I7); - n+=FormatLocaleFile(file," i8: %.*g\n",GetMagickPrecision(), - channel_moments[channel].I8); + n=FormatLocaleFile(file," %s:\n",name); + n+=FormatLocaleFile(file," Centroid: %.*g,%.*g\n", + GetMagickPrecision(),channel_moments[channel].centroid.x, + GetMagickPrecision(),channel_moments[channel].centroid.y); + n+=FormatLocaleFile(file," Ellipse Semi-Major/Minor axis: %.*g,%.*g\n", + GetMagickPrecision(),channel_moments[channel].ellipse_axis.x, + GetMagickPrecision(),channel_moments[channel].ellipse_axis.y); + n+=FormatLocaleFile(file," Ellipse angle: %.*g\n", + GetMagickPrecision(),channel_moments[channel].ellipse_angle); + n+=FormatLocaleFile(file," Ellipse eccentricity: %.*g\n", + GetMagickPrecision(),channel_moments[channel].ellipse_eccentricity); + n+=FormatLocaleFile(file," Ellipse intensity: %.*g\n", + GetMagickPrecision(),channel_moments[channel].ellipse_intensity); + for (i=0; i < 8; i++) + n+=FormatLocaleFile(file," I%.20g: %.*g\n",i+1.0,GetMagickPrecision(), + channel_moments[channel].I[i]); return(n); } diff --git a/MagickCore/statistic.h b/MagickCore/statistic.h index ab06b366c..06bad83d4 100644 --- a/MagickCore/statistic.h +++ b/MagickCore/statistic.h @@ -45,14 +45,16 @@ typedef struct _ChannelStatistics typedef struct _ChannelMoments { double - I1, - I2, - I3, - I4, - I5, - I6, - I7, - I8; + I[8]; + + PointInfo + centroid, + ellipse_axis; + + double + ellipse_angle, + ellipse_eccentricity, + ellipse_intensity; } ChannelMoments; typedef enum