Last chance! 50% off unlimited learning
Sale ends in
data(cells)
d <- distmap(cells, dimyx=256)
X <- levelset(d, 0.06)
plot(X)
Z <- connected(X)
plot(Z)
# number of components
nc <- length(levels(Z))
# plot with randomised colour map
plot(Z, col=hsv(h=sample(seq(0,1,length=nc), nc)))
# how to extract the components as a list of windows
W <- tiles(tess(image=Z))
Run the code above in your browser using DataLab