% April 1993 %
% %
% %
-% Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
/*
Print cluster statistics.
*/
- (void) fprintf(stdout,"Fuzzy C-means Statistics\n");
- (void) fprintf(stdout,"===================\n\n");
- (void) fprintf(stdout,"\tCluster Threshold = %g\n",(double)
+ (void) FormatLocaleFile(stdout,"Fuzzy C-means Statistics\n");
+ (void) FormatLocaleFile(stdout,"===================\n\n");
+ (void) FormatLocaleFile(stdout,"\tCluster Threshold = %g\n",(double)
cluster_threshold);
- (void) fprintf(stdout,"\tWeighting Exponent = %g\n",(double)
+ (void) FormatLocaleFile(stdout,"\tWeighting Exponent = %g\n",(double)
weighting_exponent);
- (void) fprintf(stdout,"\tTotal Number of Clusters = %.20g\n\n",(double)
- number_clusters);
+ (void) FormatLocaleFile(stdout,"\tTotal Number of Clusters = %.20g\n\n",
+ (double) number_clusters);
/*
Print the total number of points per cluster.
*/
- (void) fprintf(stdout,"\n\nNumber of Vectors Per Cluster\n");
- (void) fprintf(stdout,"=============================\n\n");
+ (void) FormatLocaleFile(stdout,"\n\nNumber of Vectors Per Cluster\n");
+ (void) FormatLocaleFile(stdout,"=============================\n\n");
for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
- (void) fprintf(stdout,"Cluster #%.20g = %.20g\n",(double) cluster->id,
- (double) cluster->count);
+ (void) FormatLocaleFile(stdout,"Cluster #%.20g = %.20g\n",(double)
+ cluster->id,(double) cluster->count);
/*
Print the cluster extents.
*/
- (void) fprintf(stdout,
+ (void) FormatLocaleFile(stdout,
"\n\n\nCluster Extents: (Vector Size: %d)\n",MaxDimension);
- (void) fprintf(stdout,"================");
+ (void) FormatLocaleFile(stdout,"================");
for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
{
- (void) fprintf(stdout,"\n\nCluster #%.20g\n\n",(double) cluster->id);
- (void) fprintf(stdout,"%.20g-%.20g %.20g-%.20g %.20g-%.20g\n",(double)
+ (void) FormatLocaleFile(stdout,"\n\nCluster #%.20g\n\n",(double)
+ cluster->id);
+ (void) FormatLocaleFile(stdout,
+ "%.20g-%.20g %.20g-%.20g %.20g-%.20g\n",(double)
cluster->red.left,(double) cluster->red.right,(double)
cluster->green.left,(double) cluster->green.right,(double)
cluster->blue.left,(double) cluster->blue.right);
/*
Print the cluster center values.
*/
- (void) fprintf(stdout,
+ (void) FormatLocaleFile(stdout,
"\n\n\nCluster Center Values: (Vector Size: %d)\n",MaxDimension);
- (void) fprintf(stdout,"=====================");
+ (void) FormatLocaleFile(stdout,"=====================");
for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
{
- (void) fprintf(stdout,"\n\nCluster #%.20g\n\n",(double) cluster->id);
- (void) fprintf(stdout,"%g %g %g\n",(double)
+ (void) FormatLocaleFile(stdout,"\n\nCluster #%.20g\n\n",(double)
+ cluster->id);
+ (void) FormatLocaleFile(stdout,"%g %g %g\n",(double)
cluster->red.center,(double) cluster->green.center,(double)
cluster->blue.center);
}
- (void) fprintf(stdout,"\n");
+ (void) FormatLocaleFile(stdout,"\n");
}
if (number_clusters > 256)
ThrowBinaryException(ImageError,"TooManyClusters",image->filename);
indexes=GetCacheViewAuthenticIndexQueue(image_view);
for (x=0; x < (ssize_t) image->columns; x++)
{
- indexes[x]=(IndexPacket) 0;
+ SetIndexPixelComponent(indexes+x,0);
for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
{
if (((ssize_t) ScaleQuantumToChar(q->red) >=
/*
Classify this pixel.
*/
- indexes[x]=(IndexPacket) cluster->id;
+ SetIndexPixelComponent(indexes+x,cluster->id);
break;
}
}
Classify this pixel.
*/
local_minima=1.0/sum;
- indexes[x]=(IndexPacket) j;
+ SetIndexPixelComponent(indexes+x,j);
}
}
}
static void ConsolidateCrossings(ZeroCrossing *zero_crossing,
const size_t number_crossings)
{
+ register ssize_t
+ i,
+ j,
+ k,
+ l;
+
ssize_t
center,
correct,
left,
right;
- register ssize_t
- i,
- j,
- k,
- l;
-
/*
Consolidate zero crossings.
*/
green,
red;
- ssize_t
- count,
- *histogram[MaxDimension],
- y;
-
MagickBooleanType
proceed;
short
*extrema[MaxDimension];
+ ssize_t
+ count,
+ *histogram[MaxDimension],
+ y;
+
/*
Allocate histogram and extrema.
*/
static void InitializeHistogram(const Image *image,ssize_t **histogram,
ExceptionInfo *exception)
{
- ssize_t
- y;
-
register const PixelPacket
*p;
i,
x;
+ ssize_t
+ y;
+
/*
Initialize histogram.
*/
*node,
*root;
+ register ssize_t
+ i;
+
ssize_t
j,
k,
left,
number_nodes;
- register ssize_t
- i;
-
/*
Allocate interval tree.
*/
*node,
*root;
- ssize_t
- index,
- j,
- k,
- number_nodes;
+ MagickBooleanType
+ peak;
MagickRealType
average_tau,
i,
x;
- MagickBooleanType
- peak;
-
size_t
count,
number_crossings;
+ ssize_t
+ index,
+ j,
+ k,
+ number_nodes;
+
ZeroCrossing
*zero_crossing;
const ColorspaceType colorspace,const MagickBooleanType verbose,
const double cluster_threshold,const double smooth_threshold)
{
- ssize_t
- *histogram[MaxDimension];
-
MagickBooleanType
status;
short
*extrema[MaxDimension];
+ ssize_t
+ *histogram[MaxDimension];
+
/*
Allocate histogram and extrema.
*/
static void ZeroCrossHistogram(MagickRealType *second_derivative,
const MagickRealType smooth_threshold,short *crossings)
{
- ssize_t
- parity;
-
register ssize_t
i;
+ ssize_t
+ parity;
+
/*
Merge low numbers to zero to help prevent noise.
*/