# esraa-alii/image-segmentation architecture

> Architecture diagram of the GitHub repository esraa-alii/image-segmentation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/esraa-alii/image-segmentation
- Repository: https://github.com/esraa-alii/image-segmentation

## Overview

This is a Streamlit image-segmentation application. A user uploads an image, chooses a segmentation or color-conversion method and its available parameters, and views the resulting image. The main branches are clustering, thresholding, region growing, spectral segmentation, and RGB-to-LUV conversion. The graph reflects calls visible in the app excerpt and capabilities documented in the README; it does not infer links for unsampled files or distinguish unshown internal steps.

Main entry points: [`app.py`](https://github.com/esraa-alii/image-segmentation/blob/main/app.py) (Streamlit app), [`KMean.py`](https://github.com/esraa-alii/image-segmentation/blob/main/KMean.py) (K-means), [`meanShift_optimal.py`](https://github.com/esraa-alii/image-segmentation/blob/main/meanShift_optimal.py) (Mean shift), [`agglomerative.py`](https://github.com/esraa-alii/image-segmentation/blob/main/agglomerative.py) (Agglomerative)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_app["Streamlit app<br/>[app.py]"]
end

subgraph group_segmentation["Segmentation methods"]
  node_kmeans["K-means<br/>[KMean.py]"]
  node_meanshift["Mean shift"]
  node_agglomerative["Agglomerative<br/>[agglomerative.py]"]
  node_region["Region growing<br/>[Region_Growing.py]"]
  node_spectral["Spectral threshold"]
end

subgraph group_processing["Image processing"]
  node_optimized["Optimized threshold"]
  node_manual_otsu["Manual and Otsu<br/>[Thresholding.py]"]
  node_luv["RGB to LUV<br/>[rgb2luv.py]"]
end

node_user(("User"))

node_user -->|"uploads image"| node_app
node_user -->|"selects method"| node_app
node_app -->|"calls clustering"| node_kmeans
node_app -->|"calls mean shift"| node_meanshift
node_app -->|"calls thresholding"| node_optimized
node_app -->|"calls thresholding"| node_spectral
node_app -->|"calls region growing"| node_region
node_app -->|"calls clustering"| node_agglomerative
node_app -->|"calls thresholding"| node_manual_otsu
node_app -->|"calls conversion"| node_luv
node_app -->|"displays result"| node_user

click node_app "https://github.com/esraa-alii/image-segmentation/blob/main/app.py"
click node_kmeans "https://github.com/esraa-alii/image-segmentation/blob/main/KMean.py"
click node_meanshift "https://github.com/esraa-alii/image-segmentation/blob/main/meanShift_optimal.py"
click node_agglomerative "https://github.com/esraa-alii/image-segmentation/blob/main/agglomerative.py"
click node_region "https://github.com/esraa-alii/image-segmentation/blob/main/Region_Growing.py"
click node_spectral "https://github.com/esraa-alii/image-segmentation/blob/main/spectral_threshold.py"
click node_optimized "https://github.com/esraa-alii/image-segmentation/blob/main/meanShift_optimal.py"
click node_manual_otsu "https://github.com/esraa-alii/image-segmentation/blob/main/Thresholding.py"
click node_luv "https://github.com/esraa-alii/image-segmentation/blob/main/rgb2luv.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_user toneBlue
class node_kmeans,node_meanshift,node_agglomerative,node_region,node_spectral toneAmber
class node_optimized,node_manual_otsu,node_luv toneMint
```

## Components

### User interface

- [Streamlit app](https://github.com/esraa-alii/image-segmentation/blob/main/app.py): `app.py`

### Segmentation methods

- [K-means](https://github.com/esraa-alii/image-segmentation/blob/main/KMean.py): `KMean.py`
- [Mean shift](https://github.com/esraa-alii/image-segmentation/blob/main/meanShift_optimal.py): `meanShift_optimal.py`
- [Agglomerative](https://github.com/esraa-alii/image-segmentation/blob/main/agglomerative.py): `agglomerative.py`
- [Region growing](https://github.com/esraa-alii/image-segmentation/blob/main/Region_Growing.py): `Region_Growing.py`
- [Spectral threshold](https://github.com/esraa-alii/image-segmentation/blob/main/spectral_threshold.py): `spectral_threshold.py`

### Image processing

- [Optimized threshold](https://github.com/esraa-alii/image-segmentation/blob/main/meanShift_optimal.py): `meanShift_optimal.py`
- [Manual and Otsu](https://github.com/esraa-alii/image-segmentation/blob/main/Thresholding.py): `Thresholding.py`
- [RGB to LUV](https://github.com/esraa-alii/image-segmentation/blob/main/rgb2luv.py): `rgb2luv.py`

### Other components

- **User**

## Connections

- User → Streamlit app: uploads image (evidence: `app.py`)
- User → Streamlit app: selects method (evidence: `app.py`)
- Streamlit app → K-means: calls clustering (evidence: `app.py`)
- Streamlit app → Mean shift: calls mean shift (evidence: `app.py`)
- Streamlit app → Optimized threshold: calls thresholding (evidence: `app.py`)
- Streamlit app → Spectral threshold: calls thresholding (evidence: `app.py`)
- Streamlit app → Region growing: calls region growing (evidence: `app.py`)
- Streamlit app → Agglomerative: calls clustering (evidence: `app.py`)
- Streamlit app → Manual and Otsu: calls thresholding (evidence: `app.py`)
- Streamlit app → RGB to LUV: calls conversion (evidence: `app.py`)
- Streamlit app → User: displays result (evidence: `app.py`)
