Functions that analyse images using Scholar machine-learning primitives.
The primary public API is unique_colors/1 and k_means/2
which underpin Image.k_means/2 and Image.reduce_colors/2.
Summary
Functions
Clusters the unique colors of an image using the K-means algorithm.
Returns the unique colors in an image and the count of each color.
Functions
Clusters the unique colors of an image using the K-means algorithm.
Arguments
imageis any 3- or 4-bandVix.Vips.Image.t/0with{:u, 8}band format.optionsis a keyword list of options passed toScholar.Cluster.KMeans.fit/2.
Returns
A fitted
Scholar.Cluster.KMeansmodel or{:error, reason}.
Returns the unique colors in an image and the count of each color.
Arguments
imageis any 3- or 4-bandVix.Vips.Image.t/0with{:u, 8}band format.
Returns
{:ok, {color_count_tensor, unique_colors_tensor}}or{:error, reason}.