Image.Scholar (image v0.71.0)

Copy Markdown View Source

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

k_means(image, options \\ [])

Clusters the unique colors of an image using the K-means algorithm.

Arguments

Returns

unique_colors(image)

Returns the unique colors in an image and the count of each color.

Arguments

Returns

  • {:ok, {color_count_tensor, unique_colors_tensor}} or

  • {:error, reason}.