SkillAgentSearch skills...

Watershed

A Python implementation of the watershed image segmentation algorithm

Install / Use

/learn @mzur/Watershed
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Watershed

A simple (but not very fast) Python implementation of Determining watersheds in digital pictures via flooding simulations.

source image labelled image

In contrast to skimage.morphology.watershed and cv2.watershed this implementation does not use marker seeds.

Usage

import numpy as np
from Watershed import Watershed
from PIL import Image
import matplotlib.pyplot as plt

w = Watershed()
image = np.array(Image.open('ex.png'))
labels = w.apply(image)
plt.imshow(labels, cmap='Paired', interpolation='nearest')
plt.show()
View on GitHub
GitHub Stars86
CategoryDevelopment
Updated1mo ago
Forks36

Languages

Python

Security Score

100/100

Audited on Jan 27, 2026

No findings