[−][src]Function kmeans_colors::get_kmeans_rgb
pub fn get_kmeans_rgb(
k: u8,
max_iter: usize,
converge: f32,
verbose: bool,
rgb: &[Srgb],
seed: u64
) -> KmeansRgb
Find the k-means colors of a buffer in RGB space. max_iter
and converge
are useed together to determine when the k-means calculation has converged.
When the score
is less than converge
or the number of iterations reaches
max_iter
, the calculation is complete.
k
: number of clusters.
max_iter
: maximum number of iterations.
converge
: threshold for convergence.
verbose
: flag for printing convergence information to console.
rgb
: array of Srgb
colors.
seed
: seed for the random number generator.