The function assigns clusters to all coordinate-pairs in pixel.idx
.
A cluster contains all pixels which share a diagonal link with each other.
Arguments
- pixel.idx
list declaring pixels to which target.color.hsv is applied
- sort_by_frequency
logical, control if clusters should be enumerated from 1 > N based on the number of elements in them. For more info, see documentation on
reassign_integers_by_frequency()
Details
This means that points (1/1)
, (1/2)
and (2/2)
are assigned the same cluster.
Additionally, points (5/5)
and (6/6)
are assigned the same cluster.
To consider diagonal matches as well, see adjacency()
Reference: https://stackoverflow.com/a/37946855