[R] black cluster in salt and pepper image
gregoire.pau at embl.de
Mon Mar 8 18:30:52 CET 2010
The function bwlabel() in the Bioconductor package EBImage, extracts the
connected components of an image. Denoting your binary matrix by x, the
following code gives you the first 10 largest clusters (in size).
> y = bwlabel(x)
> sort(table(y), dec=TRUE)[1:10]
how to download/install EBImage.
EMBL Research Officer
Sylvain Sardy wrote:
> on a lattice, I have binary 0/1 data. 1s are rare and may form clusters.
> I would like
> to know the size/length of largest cluster. Any help warmly welcome,
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help