Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mzur/watershed
A Python implementation of the watershed image segmentation algorithm
https://github.com/mzur/watershed
image-processing python watershed-algorithm
Last synced: about 2 months ago
JSON representation
A Python implementation of the watershed image segmentation algorithm
- Host: GitHub
- URL: https://github.com/mzur/watershed
- Owner: mzur
- License: mit
- Created: 2017-10-24T14:06:09.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-25T09:15:56.000Z (about 7 years ago)
- Last Synced: 2024-05-02T01:10:56.532Z (8 months ago)
- Topics: image-processing, python, watershed-algorithm
- Language: Python
- Size: 12.7 KB
- Stars: 75
- Watchers: 2
- Forks: 34
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Watershed
A simple (but not very fast) Python implementation of [Determining watersheds in digital pictures via flooding simulations](http://dx.doi.org/10.1117/12.24211).
![source image](ex.png) ![labelled image](ws.png)
In contrast to [`skimage.morphology.watershed`](http://scikit-image.org/docs/dev/api/skimage.morphology.html#skimage.morphology.watershed) and [`cv2.watershed`](https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_watershed/py_watershed.html) this implementation does not use marker seeds.
## Usage
```python
import numpy as np
from Watershed import Watershed
from PIL import Image
import matplotlib.pyplot as pltw = Watershed()
image = np.array(Image.open('ex.png'))
labels = w.apply(image)
plt.imshow(labels, cmap='Paired', interpolation='nearest')
plt.show()
```