Image-DominantColors

 view release on metacpan or  search on metacpan

lib/Image/DominantColors.pm  view on Meta::CPAN

		}		
	}

	my @centroids = ();
	for (my $i = 1; $i <= $clusters; $i++) {
		my $cc = Image::ColorCollection->new();
		push @centroids, $cc;
	}
	
	my $shft = 100;
	my $it = 0;#track iterations
#	print "TotalCentroid : ".scalar(@centroids);
	while($shft != 0)
	{
		foreach my $col (@colors) {
			my $min = LONG_MAX;
			my $cent = undef;
#				print "TotalCentroidAgainb : ".scalar(@centroids);
			foreach my $c (@centroids) {
				#print Dumper($c);
				my $d = int(euclideanDist($col, $c->getCentroid()));



( run in 0.523 second using v1.01-cache-2.11-cpan-71847e10f99 )