https://github.com/sivanajani/regiongrowinglabeln
Region Growing segmentation of star-like blobs using Python, NumPy, Matplotlib, and scikit-image.
https://github.com/sivanajani/regiongrowinglabeln
computer-vision flood-fill image-processing labeling matplotlib python region-growing scikit-image segmentation visualization
Last synced: 18 days ago
JSON representation
Region Growing segmentation of star-like blobs using Python, NumPy, Matplotlib, and scikit-image.
- Host: GitHub
- URL: https://github.com/sivanajani/regiongrowinglabeln
- Owner: Sivanajani
- Created: 2025-04-08T00:23:39.000Z (20 days ago)
- Default Branch: main
- Last Pushed: 2025-04-08T01:06:41.000Z (20 days ago)
- Last Synced: 2025-04-08T01:26:33.936Z (20 days ago)
- Topics: computer-vision, flood-fill, image-processing, labeling, matplotlib, python, region-growing, scikit-image, segmentation, visualization
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Region Growing โ Automatic Star Labeling (Image Segmentation with Python)
This project implements an image processing routine to automatically label segmented objects (blobs) in an image.
The goal is to detect, label, and individually visualize stars in the input image `stars.png` using a simplified **Region Growing** algorithm based on **Flood Fill**.
---
## ๐ง Tech Stack & Methods
- **Python** ยท **NumPy** ยท **Matplotlib** ยท **Scikit-Image**
- Flood Fill (Region Growing)
- Binary segmentation & labeling
- Interactive visualization---
## ๐ Features
- Load and convert RGB images to grayscale
- Automatically compute threshold for binarization
- Detect connected regions (stars) using `skimage.segmentation.flood()`
- Assign unique labels to each blob (star)
- Visualize all stars in color using `nipy_spectral`
- Show individual binary masks for each detected star (one per window)
- Interactive hover: Display blob ID when cursor is near a star
- Output number of detected stars in the console---
## ๐ผ๏ธ OutputEach detected star is assigned a unique label and color in the "Label Map".
Individual binary masks are shown for further analysis or visualization.---
## ๐ฆ Dependencies- `matplotlib`
- `numpy`
- `scikit-image`Install with:
```bash
pip install matplotlib numpy scikit-image
```
---
### ๐ธ Visual Overview#### ๐ผ๏ธ Input: Original Star Image
The script starts with this image of stars:

---
#### โซ Binary Segmentation (Thresholding Step)
After grayscale conversion and thresholding, the image is binarized:
This mask (`segmentation_mask.png`) highlights bright areas that may contain stars.
---
#### ๐ Labeled Output โ Region Growing (Flood Fill)
The Flood Fill algorithm assigns a unique label to each connected region.
This is visualized using a color-coded Label Map:
---
#### ๐ Example: Binary Mask of a Single Star
Each detected star (blob) is visualized in its own grayscale binary mask.
Example โ Blob 1:

---
## ๐ License
This project was developed as part of a university project at FHNW and is intended for demonstration and educational purposes only.---