Lines Matching defs:Cluster
67 % The fuzzy c-Means technique attempts to cluster a pixel by finding
152 } Cluster;
262 Cluster
263 *cluster,
298 cluster=(Cluster *) NULL;
299 head=(Cluster *) NULL;
314 if (head != (Cluster *) NULL)
316 cluster->next=(Cluster *) AcquireMagickMemory(
317 sizeof(*cluster->next));
318 cluster=cluster->next;
322 cluster=(Cluster *) AcquireMagickMemory(sizeof(*cluster));
323 head=cluster;
325 if (cluster == (Cluster *) NULL)
331 cluster->count=0;
332 cluster->red=red;
333 cluster->green=green;
334 cluster->blue=blue;
335 cluster->next=(Cluster *) NULL;
339 if (head == (Cluster *) NULL)
344 cluster=(Cluster *) AcquireMagickMemory(sizeof(*cluster));
345 if (cluster == (Cluster *) NULL)
351 cluster->count=0;
352 cluster->red=red;
353 cluster->green=green;
354 cluster->blue=blue;
355 cluster->next=(Cluster *) NULL;
356 head=cluster;
359 Count the pixels for each cluster.
378 for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
380 (cluster->red.left-SafeMargin)) &&
382 (cluster->red.right+SafeMargin)) &&
384 (cluster->green.left-SafeMargin)) &&
386 (cluster->green.right+SafeMargin)) &&
388 (cluster->blue.left-SafeMargin)) &&
390 (cluster->blue.right+SafeMargin)))
396 cluster->red.center+=(double) ScaleQuantumToChar(
398 cluster->green.center+=(double) ScaleQuantumToChar(
400 cluster->blue.center+=(double) ScaleQuantumToChar(
402 cluster->count++;
423 Remove clusters that do not meet minimum cluster threshold.
428 for (cluster=head; cluster != (Cluster *) NULL; cluster=next_cluster)
430 next_cluster=cluster->next;
431 if ((cluster->count > 0) &&
432 (cluster->count >= (count*cluster_threshold/100.0)))
435 Initialize cluster.
437 cluster->id=count;
438 cluster->red.center/=cluster->count;
439 cluster->green.center/=cluster->count;
440 cluster->blue.center/=cluster->count;
442 last_cluster=cluster;
446 Delete cluster.
448 if (cluster == head)
452 cluster=(Cluster *) RelinquishMagickMemory(cluster);
458 Print cluster statistics.
469 Print the total number of points per cluster.
471 (void) FormatLocaleFile(stdout,"\n\nNumber of Vectors Per Cluster\n");
473 for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
474 (void) FormatLocaleFile(stdout,"Cluster #%.20g = %.20g\n",(double)
475 cluster->id,(double) cluster->count);
477 Print the cluster extents.
482 for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
485 cluster->id);
488 cluster->red.left,(double) cluster->red.right,(double)
489 cluster->green.left,(double) cluster->green.right,(double)
490 cluster->blue.left,(double) cluster->blue.right);
493 Print the cluster center values.
498 for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
501 cluster->id);
503 cluster->red.center,(double) cluster->green.center,(double)
504 cluster->blue.center);
527 for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
530 (cluster->red.center+0.5));
532 (cluster->green.center+0.5));
534 (cluster->blue.center+0.5));
547 Cluster
548 *cluster;
570 for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
573 (cluster->red.left-SafeMargin)) &&
575 (cluster->red.right+SafeMargin)) &&
577 (cluster->green.left-SafeMargin)) &&
579 (cluster->green.right+SafeMargin)) &&
581 (cluster->blue.left-SafeMargin)) &&
583 (cluster->blue.right+SafeMargin)))
588 SetPixelIndex(image,(Quantum) cluster->id,q);
592 if (cluster == (Cluster *) NULL)
667 for (cluster=head; cluster != (Cluster *) NULL; cluster=next_cluster)
669 next_cluster=cluster->next;
670 cluster=(Cluster *) RelinquishMagickMemory(cluster);
943 Cluster
945 *cluster,
1014 cluster=(Cluster *) NULL;
1015 head=(Cluster *) NULL;
1030 if (head != (Cluster *) NULL)
1032 cluster->next=(Cluster *) AcquireMagickMemory(
1033 sizeof(*cluster->next));
1034 cluster=cluster->next;
1038 cluster=(Cluster *) AcquireMagickMemory(sizeof(*cluster));
1039 head=cluster;
1041 if (cluster == (Cluster *) NULL)
1051 cluster->count=0;
1052 cluster->red=red;
1053 cluster->green=green;
1054 cluster->blue=blue;
1055 cluster->next=(Cluster *) NULL;
1059 if (head == (Cluster *) NULL)
1064 cluster=(Cluster *) AcquireMagickMemory(sizeof(*cluster));
1065 if (cluster == (Cluster *) NULL)
1074 cluster->count=0;
1075 cluster->red=red;
1076 cluster->green=green;
1077 cluster->blue=blue;
1078 cluster->next=(Cluster *) NULL;
1079 head=cluster;
1082 Count the pixels for each cluster.
1092 for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
1094 (cluster->red.left-SafeMargin)) &&
1096 (cluster->red.right+SafeMargin)) &&
1098 (cluster->green.left-SafeMargin)) &&
1100 (cluster->green.right+SafeMargin)) &&
1102 (cluster->blue.left-SafeMargin)) &&
1104 (cluster->blue.right+SafeMargin)))
1110 cluster->red.center+=(double) ScaleQuantumToChar(
1112 cluster->green.center+=(double) ScaleQuantumToChar(
1114 cluster->blue.center+=(double) ScaleQuantumToChar(
1116 cluster->count++;
1127 Remove clusters that do not meet minimum cluster threshold.
1132 for (cluster=head; cluster != (Cluster *) NULL; cluster=next_cluster)
1134 next_cluster=cluster->next;
1135 if ((cluster->count > 0) &&
1136 (cluster->count >= (count*cluster_threshold/100.0)))
1139 Initialize cluster.
1141 cluster->id=count;
1142 cluster->red.center/=cluster->count;
1143 cluster->green.center/=cluster->count;
1144 cluster->blue.center/=cluster->count;
1146 last_cluster=cluster;
1150 Delete cluster.
1152 if (cluster == head)
1156 cluster=(Cluster *) RelinquishMagickMemory(cluster);
1163 for (cluster=object; cluster->next != (Cluster *) NULL; )
1165 if (cluster->count < object->count)
1166 object=cluster;
1167 cluster=cluster->next;
1170 for (cluster=background; cluster->next != (Cluster *) NULL; )
1172 if (cluster->count > background->count)
1173 background=cluster;
1174 cluster=cluster->next;
1177 if (background != (Cluster *) NULL)
1192 for (cluster=head; cluster != (Cluster *) NULL; cluster=next_cluster)
1194 next_cluster=cluster->next;
1195 cluster=(Cluster *) RelinquishMagickMemory(cluster);