144 assert(image != (
Image *) NULL);
153 sizeof(*channel_statistics));
171 for (y=0; y < (ssize_t) image->
rows; y++)
180 if (p == (
const Quantum *) NULL)
182 for (x=0; x < (ssize_t) image->
columns; x++)
200 if ((
double) p[i] > channel_statistics[channel].maxima)
201 channel_statistics[channel].
maxima=(double) p[i];
206 if ((
double) p[i] < channel_statistics[channel].
minima)
207 channel_statistics[channel].minima=(
double) p[i];
215 return(channel_statistics);
221 #define PrintFeature(feature) \ 222 GetMagickPrecision(),(feature)[0], \ 223 GetMagickPrecision(),(feature)[1], \ 224 GetMagickPrecision(),(feature)[2], \ 225 GetMagickPrecision(),(feature)[3], \ 226 GetMagickPrecision(),((feature)[0]+(feature)[1]+(feature)[2]+(feature)[3])/4.0 \ 228 #define FeaturesFormat " %s:\n" \ 229 " Angular Second Moment:\n" \ 230 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 232 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 234 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 235 " Sum of Squares Variance:\n" \ 236 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 237 " Inverse Difference Moment:\n" \ 238 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 240 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 242 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 244 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 246 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 247 " Difference Variance:\n" \ 248 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 249 " Difference Entropy:\n" \ 250 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 251 " Information Measure of Correlation 1:\n" \ 252 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 253 " Information Measure of Correlation 2:\n" \ 254 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \ 255 " Maximum Correlation Coefficient:\n" \ 256 " %.*g, %.*g, %.*g, %.*g, %.*g\n" 262 PrintFeature(channel_features[channel].angular_second_moment),
265 PrintFeature(channel_features[channel].variance_sum_of_squares),
266 PrintFeature(channel_features[channel].inverse_difference_moment),
271 PrintFeature(channel_features[channel].difference_variance),
272 PrintFeature(channel_features[channel].difference_entropy),
273 PrintFeature(channel_features[channel].measure_of_correlation_1),
274 PrintFeature(channel_features[channel].measure_of_correlation_2),
275 PrintFeature(channel_features[channel].maximum_correlation_coefficient));
298 target=channel_statistics[channel].
maxima;
303 target=channel_statistics[channel].
minima;
311 for (y=0; y < (ssize_t) image->
rows; y++)
321 if (p == (
const Quantum *) NULL)
323 for (x=0; x < (ssize_t) image->
columns; x++)
335 if ((max_locations != 0) && (n >= (ssize_t) max_locations))
342 if (x < (ssize_t) image->
columns)
350 const char *name,
const double scale,
const ChannelMoments *channel_moments)
354 { 1.0, 2.0, 3.0, 3.0, 6.0, 4.0, 6.0, 4.0 };
376 channel_moments[channel].ellipse_intensity);
394 for (i=0; i < (ssize_t) channel_phash[0].number_colorspaces; i++)
427 for (k=0; k < (ssize_t) channel_phash[0].number_colorspaces; k++)
430 channel_phash[channel].phash[k][j]);
431 if (k < (ssize_t) (channel_phash[0].number_colorspaces-1))
441 const char *name,
const double scale,
444 #define StatisticsFormat " %s:\n min: %.*g (%.*g)\n " \ 445 "max: %.*g (%.*g)\n mean: %.*g (%.*g)\n median: %.*g (%.*g)\n " \ 446 "standard deviation: %.*g (%.*g)\n kurtosis: %.*g\n " \ 447 "skewness: %.*g\n entropy: %.*g\n" 455 channel_statistics[channel].minima/(
double)
QuantumRange,
458 channel_statistics[channel].maxima/(
double)
QuantumRange,
468 channel_statistics[channel].entropy);
531 assert(image != (
Image *) NULL);
535 if (file == (FILE *) NULL)
539 if (locate != (
const char *) NULL)
557 if (limit != (
const char *) NULL)
569 statistic_type,max_locations,channel_statistics);
571 statistic_type,max_locations,channel_statistics);
573 statistic_type,max_locations,channel_statistics);
579 statistic_type,max_locations,channel_statistics);
581 "Magenta",statistic_type,max_locations,channel_statistics);
583 statistic_type,max_locations,channel_statistics);
585 statistic_type,max_locations,channel_statistics);
592 statistic_type,max_locations,channel_statistics);
599 statistic_type,max_locations,channel_statistics);
605 statistic_type,max_locations,channel_statistics);
635 (double) image->
rows);
640 (double) image->
page.
y);
676 (
unsigned long) (elapsed_time/60.0),(
unsigned long) floor(fmod(
677 elapsed_time,60.0)),(
unsigned long) (1000.0*(elapsed_time-
678 floor(elapsed_time))));
699 if (artifact != (
const char *) NULL)
705 if (artifact != (
const char *) NULL)
722 if ((magick_info == (
const MagickInfo *) NULL) ||
728 if ((magick_info != (
const MagickInfo *) NULL) &&
734 (void)
FormatLocaleFile(file,
" Geometry: %.20gx%.20g%+.20g%+.20g\n",(
double)
757 if (image->
type != type)
764 if (image->
depth == depth)
769 image->
depth,(
double) depth);
813 (
double) i,(
double) channel_statistics[i].depth);
846 scale,channel_statistics);
848 scale,channel_statistics);
850 scale,channel_statistics);
856 scale,channel_statistics);
858 scale,channel_statistics);
860 scale,channel_statistics);
862 scale,channel_statistics);
869 scale,channel_statistics);
882 scale,channel_statistics);
892 1.0/scale,channel_statistics);
895 1.0/scale,channel_statistics);
898 "Composite mask",1.0/scale,channel_statistics);
906 "Meta channel[%.20g]",(
double) i);
915 1.0/scale,channel_statistics);
922 scale=(double) ((1UL << image->
depth)-1);
991 "left and right diagonals, average):\n");
1057 for (y=0; y < (ssize_t) image->
rows; y++)
1060 if (p == (
const Quantum *) NULL)
1062 for (x=0; x < (ssize_t) image->
columns; x++)
1111 if (image->
colors <= 1024)
1125 for (i=0; i < (ssize_t) image->
colors; i++)
1171 if (image->
gamma != 0.0)
1215 (image->
page.
x != 0) || (image->
page.
y != 0))
1219 if ((image->
page.
x != 0) || (image->
page.
y != 0))
1224 if (image->
delay != 0)
1237 if (image->
scene != 0)
1245 if (image->
montage != (
char *) NULL)
1268 for (d=image->
directory; *d !=
'\0'; d++)
1271 while ((*q !=
'\xff') && (*q !=
'\0') &&
1272 ((
size_t) (q-d) <
sizeof(image_info->
filename)))
1280 if (tile == (
Image *) NULL)
1290 while (property != (
const char *) NULL)
1294 if (value != (
const char *) NULL)
1304 if (value != (
const char *) NULL)
1310 if (strlen(value) > 80)
1311 (
void) fputc(
'\n',file);
1337 for (n=0; n < (ssize_t) number_points; n++)
1340 convex_hull[n].x,convex_hull[n].y);
1352 for (n=0; n < (ssize_t) number_points; n++)
1355 bounding_box[n].x,bounding_box[n].y);
1366 if (name != (
char *) NULL)
1375 while (name != (
char *) NULL)
1404 for (i=0; i < (ssize_t) profile_length-5; i+=(ssize_t) length)
1414 case 5: tag=
"Image Name";
break;
1415 case 7: tag=
"Edit Status";
break;
1416 case 10: tag=
"Priority";
break;
1417 case 15: tag=
"Category";
break;
1418 case 20: tag=
"Supplemental Category";
break;
1419 case 22: tag=
"Fixture Identifier";
break;
1420 case 25: tag=
"Keyword";
break;
1421 case 30: tag=
"Release Date";
break;
1422 case 35: tag=
"Release Time";
break;
1423 case 40: tag=
"Special Instructions";
break;
1424 case 45: tag=
"Reference Service";
break;
1425 case 47: tag=
"Reference Date";
break;
1426 case 50: tag=
"Reference Number";
break;
1427 case 55: tag=
"Created Date";
break;
1428 case 60: tag=
"Created Time";
break;
1429 case 65: tag=
"Originating Program";
break;
1430 case 70: tag=
"Program Version";
break;
1431 case 75: tag=
"Object Cycle";
break;
1432 case 80: tag=
"Byline";
break;
1433 case 85: tag=
"Byline Title";
break;
1434 case 90: tag=
"City";
break;
1435 case 92: tag=
"Sub-Location";
break;
1436 case 95: tag=
"Province State";
break;
1437 case 100: tag=
"Country Code";
break;
1438 case 101: tag=
"Country";
break;
1439 case 103: tag=
"Original Transmission Reference";
break;
1440 case 105: tag=
"Headline";
break;
1441 case 110: tag=
"Credit";
break;
1442 case 115: tag=
"Src";
break;
1443 case 116: tag=
"Copyright String";
break;
1444 case 120: tag=
"Caption";
break;
1445 case 121: tag=
"Local Caption";
break;
1446 case 122: tag=
"Caption Writer";
break;
1447 case 200: tag=
"Custom Field 1";
break;
1448 case 201: tag=
"Custom Field 2";
break;
1449 case 202: tag=
"Custom Field 3";
break;
1450 case 203: tag=
"Custom Field 4";
break;
1451 case 204: tag=
"Custom Field 5";
break;
1452 case 205: tag=
"Custom Field 6";
break;
1453 case 206: tag=
"Custom Field 7";
break;
1454 case 207: tag=
"Custom Field 8";
break;
1455 case 208: tag=
"Custom Field 9";
break;
1456 case 209: tag=
"Custom Field 10";
break;
1457 case 210: tag=
"Custom Field 11";
break;
1458 case 211: tag=
"Custom Field 12";
break;
1459 case 212: tag=
"Custom Field 13";
break;
1460 case 213: tag=
"Custom Field 14";
break;
1461 case 214: tag=
"Custom Field 15";
break;
1462 case 215: tag=
"Custom Field 16";
break;
1463 case 216: tag=
"Custom Field 17";
break;
1464 case 217: tag=
"Custom Field 18";
break;
1465 case 218: tag=
"Custom Field 19";
break;
1466 case 219: tag=
"Custom Field 20";
break;
1467 default: tag=
"unknown";
break;
1470 (
double) dataset,(double) record);
1473 length=
MagickMin(length,profile_length-i);
1474 attribute=(
char *) NULL;
1477 sizeof(*attribute));
1478 if (attribute != (
char *) NULL)
1483 if (attribute_list != (
char **) NULL)
1485 for (j=0; attribute_list[j] != (
char *) NULL; j++)
1487 (void) fputs(attribute_list[j],file);
1488 (void) fputs(
"\n",file);
1506 if (property != (
const char *) NULL)
1512 while (property != (
const char *) NULL)
1516 if (value != (
const char *) NULL)
1523 if (artifact != (
const char *) NULL)
1529 while (artifact != (
const char *) NULL)
1533 if (value != (
const char *) NULL)
1540 if (
registry != (
const char *) NULL)
1546 while (
registry != (
const char *) NULL)
1551 if (value != (
const char *) NULL)
1562 if (strlen(buffer) > 1)
1563 buffer[strlen(buffer)-1]=
'\0';
1577 (
unsigned long) (elapsed_time/60.0),(
unsigned long) ceil(fmod(elapsed_time,
1578 60.0)),(
unsigned long) (1000.0*(elapsed_time-floor(elapsed_time))));
1581 (void) fflush(file);
MagickDoubleType MagickRealType
PixelIntensityMethod intensity
MagickExport ssize_t FormatMagickSize(const MagickSizeType size, const MagickBooleanType bi, const char *suffix, const size_t length, char *format)
static ssize_t GetPixelChannelOffset(const Image *magick_restrict image, const PixelChannel channel)
MagickExport MagickBooleanType QueryColorname(const Image *magick_unused(image), const PixelInfo *color, const ComplianceType compliance, char *name, ExceptionInfo *exception)
MagickExport ImageInfo * AcquireImageInfo(void)
MagickExport double GetUserTime(TimerInfo *time_info)
MagickExport double GetImageTotalInkDensity(Image *image, ExceptionInfo *exception)
MagickExport size_t ConcatenateMagickString(char *magick_restrict destination, const char *magick_restrict source, const size_t length)
static Quantum GetPixelAlpha(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
MagickExport MagickBooleanType IsHistogramImage(const Image *image, ExceptionInfo *exception)
MagickExport void ResetImagePropertyIterator(const Image *image)
static unsigned long StringToUnsignedLong(const char *magick_restrict value)
MagickExport ssize_t ParseCommandOption(const CommandOption option, const MagickBooleanType list, const char *options)
MagickExport ChannelStatistics * GetImageStatistics(const Image *image, ExceptionInfo *exception)
#define ThrowFatalException(severity, tag)
MagickExport MagickBooleanType IdentifyImage(Image *image, FILE *file, const MagickBooleanType verbose, ExceptionInfo *exception)
MagickExport WarningHandler SetWarningHandler(WarningHandler handler)
MagickExport const char * GetMagickDescription(const MagickInfo *magick_info)
MagickExport PointInfo * GetImageMinimumBoundingBox(Image *image, size_t *number_vertices, ExceptionInfo *exception)
MagickExport const char * GetImageArtifact(const Image *image, const char *artifact)
MagickExport char * GetNextImageRegistry(void)
#define MaximumNumberOfPerceptualHashes
double mean_error_per_pixel
static PixelTrait GetPixelChannelTraits(const Image *magick_restrict image, const PixelChannel channel)
MagickExport ExceptionInfo * AcquireExceptionInfo(void)
MagickExport ssize_t FormatLocaleString(char *magick_restrict string, const size_t length, const char *magick_restrict format,...)
static Quantum GetPixelReadMask(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
MagickExport size_t CopyMagickString(char *magick_restrict destination, const char *magick_restrict source, const size_t length)
MagickExport MagickBooleanType SignatureImage(Image *image, ExceptionInfo *exception)
char magick[MagickPathExtent]
#define MAGICKCORE_QUANTUM_DEPTH
MagickExport void ResetImageArtifactIterator(const Image *image)
#define MaximumNumberOfImageMoments
CompressionType compression
static ssize_t PrintChannelMoments(FILE *file, const PixelChannel channel, const char *name, const double scale, const ChannelMoments *channel_moments)
RectangleInfo tile_offset
MagickExport void GetPixelInfo(const Image *image, PixelInfo *pixel)
static Quantum ClampToQuantum(const MagickRealType quantum)
MagickExport Image * GetPreviousImageInList(const Image *images)
size_t number_meta_channels
#define MagickCoreSignature
double normalized_mean_error
MagickExport unsigned char * GetStringInfoDatum(const StringInfo *string_info)
static ChannelStatistics * GetLocationStatistics(const Image *image, const StatisticType type, ExceptionInfo *exception)
#define PrintFeature(feature)
MagickExport void GetPathComponent(const char *path, PathType type, char *component)
MagickExport ssize_t FormatLocaleFile(FILE *file, const char *magick_restrict format,...)
MagickExport char ** StringToList(const char *text)
MagickExport char * AcquireString(const char *source)
static ssize_t PrintChannelFeatures(FILE *file, const PixelChannel channel, const char *name, const ChannelFeatures *channel_features)
MagickExport const char * CommandOptionToMnemonic(const CommandOption option, const ssize_t type)
MagickExport const Quantum * GetVirtualPixels(const Image *image, const ssize_t x, const ssize_t y, const size_t columns, const size_t rows, ExceptionInfo *exception)
MagickExport void * AcquireQuantumMemory(const size_t count, const size_t quantum)
char filename[MagickPathExtent]
MagickExport void GetColorTuple(const PixelInfo *pixel, const MagickBooleanType hex, char *tuple)
MagickExport PointInfo * GetImageConvexHull(const Image *image, size_t *number_vertices, ExceptionInfo *exception)
MagickExport const StringInfo * GetImageProfile(const Image *image, const char *name)
#define UndefinedCompressionQuality
MagickExport void PrintStringInfo(FILE *file, const char *id, const StringInfo *string_info)
MagickExport MagickBooleanType IsStringTrue(const char *value)
static void GetPixelInfoPixel(const Image *magick_restrict image, const Quantum *magick_restrict pixel, PixelInfo *magick_restrict pixel_info)
MagickExport MagickBooleanType IsEventLogging(void)
MagickExport ChannelMoments * GetImageMoments(const Image *image, ExceptionInfo *exception)
MagickExport int GetMagickPrecision(void)
#define MagickMaximumValue
MagickExport Image * ReadImage(const ImageInfo *image_info, ExceptionInfo *exception)
static ssize_t PrintChannelPerceptualHash(Image *image, FILE *file, const ChannelPerceptualHash *channel_phash)
MagickExport void ResetImageRegistryIterator(void)
static ssize_t PrintChannelLocations(FILE *file, const Image *image, const PixelChannel channel, const char *name, const StatisticType type, const size_t max_locations, const ChannelStatistics *channel_statistics)
char magick_filename[MagickPathExtent]
MagickExport MagickBooleanType LogMagickEvent(const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...)
MagickExport const char * GetMagickVersion(size_t *version)
MagickExport const char * GetNextImageProperty(const Image *image)
MagickExport const MagickInfo * GetMagickInfo(const char *name, ExceptionInfo *exception)
MagickExport ImageType IdentifyImageType(const Image *image, ExceptionInfo *exception)
void(* WarningHandler)(const ExceptionType, const char *, const char *)
MagickExport void ConcatenateColorComponent(const PixelInfo *pixel, const PixelChannel channel, const ComplianceType compliance, char *tuple)
RectangleInfo extract_info
MagickExport char * GetNextImageProfile(const Image *image)
static size_t GetPixelChannels(const Image *magick_restrict image)
MagickExport int LocaleCompare(const char *p, const char *q)
char filename[MagickPathExtent]
#define GetMagickModule()
PrimaryInfo green_primary
MagickExport size_t GetNumberColors(const Image *image, FILE *file, ExceptionInfo *exception)
MagickExport void GetTimerInfo(TimerInfo *time_info)
MagickExport ChannelFeatures * GetImageFeatures(const Image *image, const size_t distance, ExceptionInfo *exception)
static PixelChannel GetPixelChannelChannel(const Image *magick_restrict image, const ssize_t offset)
MagickExport ImageInfo * DestroyImageInfo(ImageInfo *image_info)
RenderingIntent rendering_intent
double normalized_maximum_error
MagickExport size_t GetImageDepth(const Image *image, ExceptionInfo *exception)
MagickExport Image * GetNextImageInList(const Image *images)
MagickExport char * DestroyString(char *string)
MagickExport const char * GetMagickMimeType(const MagickInfo *magick_info)
static ssize_t PrintChannelStatistics(FILE *file, const PixelChannel channel, const char *name, const double scale, const ChannelStatistics *channel_statistics)
MagickExport const char * GetImageProperty(const Image *image, const char *property, ExceptionInfo *exception)
size_t number_colorspaces
MagickExport double GetElapsedTime(TimerInfo *time_info)
ChromaticityInfo chromaticity
MagickExport CacheType GetImagePixelCacheType(const Image *image)
ColorspaceType colorspace[MaximumNumberOfPerceptualColorspaces+1]
MagickExport const char * GetNextImageArtifact(const Image *image)
MagickExport MagickBooleanType ConcatenateString(char **magick_restrict destination, const char *magick_restrict source)
MagickExport void * RelinquishMagickMemory(void *memory)
MagickExport void * GetImageRegistry(const RegistryType type, const char *key, ExceptionInfo *exception)
MagickExport char * CloneString(char **destination, const char *source)
CompositeOperator compose
MagickExport void ResetImageProfileIterator(const Image *image)
OrientationType orientation
ColorspaceType colorspace
PixelInfo transparent_color
MagickExport ChannelPerceptualHash * GetImagePerceptualHash(const Image *image, ExceptionInfo *exception)
MagickExport size_t GetStringInfoLength(const StringInfo *string_info)
PixelInfo background_color
MagickExport size_t GetImageListLength(const Image *images)
MagickExport Image * DestroyImage(Image *image)
static SplayTreeInfo * registry
ColorspaceType colorspace