x = readImage(system.file('images', 'shapes.png', package='EBImage'))
x = x[110:512,1:130]
display(x, title='Binary')
y = distmap(x)
display(normalize(y), title='Distance map')
w = watershed(y)
display(normalize(w), title='Watershed')
Run the code above in your browser using DataLab