public class KMeansClusteringQuantizer extends ColorQuantizer
| Modifier and Type | Class and Description |
|---|---|
static class |
KMeansClusteringQuantizer.Parameters |
static class |
KMeansClusteringQuantizer.SamplingMethod |
MAX_RGB| Constructor and Description |
|---|
KMeansClusteringQuantizer(int[] pixels) |
KMeansClusteringQuantizer(int[] pixels,
KMeansClusteringQuantizer.Parameters params)
Creates a new quantizer instance from the supplied sequence
of color values (assumed to be ARGB-encoded integers).
|
| Modifier and Type | Method and Description |
|---|---|
int[][] |
getColorMap()
Retrieves the color map produced by this color quantizer.
|
double |
getTotalError()
Returns the total error of this clustering, calculated as the sum of
the squared distances of the color samples to the associated cluster
center.
|
void |
listClusters()
Lists the color clusters to System.out (intended for debugging only).
|
findColorIndex, intToRgb, listColorMap, log2, quantize, quantize, quantize, rgbToInt, sqrpublic KMeansClusteringQuantizer(int[] pixels, KMeansClusteringQuantizer.Parameters params)
pixels - Sequence of input color values.params - Parameter object.public KMeansClusteringQuantizer(int[] pixels)
public void listClusters()
public double getTotalError()
public int[][] getColorMap()
ColorQuantizergetColorMap in class ColorQuantizerCopyright © 2006–2017, Wilhelm Burger, Mark J. Burge (BSD 2-Clause Simplified License)