extractClusters: Extract cluster values and sizes from kmeans fit objects
Description
Extract a list of dataframes with the same format as those returned by
getHistList, where each dataframe has 3 color attributes (R, G,
B or H, S, V) and a size attribute (Pct) for every cluster.
A list of kmeans fit objects
(especially as returned by getKMeansList).
ordering
Logical. Should clusters by reordered by color similarity? If
TRUE, the Hungarian algorithm via solve_LSAP is
applied to find the minimum sum of Euclidean distances between color pairs
for every pair of cluster objects and colors are reordered accordingly.
normalize
Logical. Should each cluster be normalized to show R:G:B or
H:S:V ratios rather than absolute values? Can be helpful for inconsistent
lighting, but reduces variation. See normalizeRGB.
Value
A list of dataframes (same length as input list), each with 4
columns: R, G, B (or H, S, V) and Pct (cluster size), with one row per
cluster.