# sh1kurlu/edge-vision architecture

> Architecture diagram of the GitHub repository sh1kurlu/edge-vision, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sh1kurlu/edge-vision
- Repository: https://github.com/sh1kurlu/edge-vision

## Overview

EdgeVision is a desktop document-scanning application. The user uploads a photo, adjusts scan settings, reviews detection and processing stages, compares the rectified image with its enhanced version, and exports the result. The main window owns GUI interactions and dispatches scans to the pipeline; the pipeline coordinates preprocessing, detection, perspective correction, and enhancement. The README documents additional controls and preview behavior. Some source excerpts are partial, so edges for those documented capabilities are based on the README rather than uninspected implementation details.

Main entry points: [`gui/main_window.py`](https://github.com/sh1kurlu/edge-vision/blob/main/gui/main_window.py) (Main window), [`scanner/pipeline.py`](https://github.com/sh1kurlu/edge-vision/blob/main/scanner/pipeline.py) (Scan coordinator), [`gui/pipeline_viewer.py`](https://github.com/sh1kurlu/edge-vision/blob/main/gui/pipeline_viewer.py) (Pipeline inspector), [`gui/widgets.py`](https://github.com/sh1kurlu/edge-vision/blob/main/gui/widgets.py) (Image and status widgets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop application"]
  node_entry["Application entry<br/>[main.py]"]
  node_window["Main window<br/>[main_window.py]"]
  node_header["Brand header<br/>[header.py]"]
  node_sliders["Parameter sliders<br/>[labeled_slider.py]"]
  node_theme["Dark theme<br/>[theme.py]"]
end

subgraph group_scan["Scanning pipeline"]
  node_scanner["Scan coordinator<br/>[pipeline.py]"]
  node_preprocess["Preprocessing<br/>[preprocessing.py]"]
  node_edges["Edge detection<br/>[edge_detection.py]"]
  node_contours["Contour detection"]
  node_corners["Corner refinement"]
  node_perspective["Perspective correction<br/>[perspective.py]"]
  node_enhancement["Scan enhancement<br/>[enhancement.py]"]
  node_configlog["Config logging<br/>[config_log.py]"]
end

subgraph group_view["Review interface"]
  node_viewer["Pipeline inspector<br/>[pipeline_viewer.py]"]
  node_comparison["Result comparison"]
  node_widgets["Image and status widgets<br/>[widgets.py]"]
end

subgraph group_io["Image and export"]
  node_imageio["Image loading and saving<br/>[image_utils.py]"]
  node_pdf["PDF export<br/>[pdf_export.py]"]
end

node_user(("User"))

node_user -->|"launches"| node_entry
node_entry -->|"opens"| node_window
node_window -->|"dispatches scans"| node_scanner
node_window -->|"loads and saves"| node_imageio
node_window -->|"exports PDF"| node_pdf
node_window -->|"uses"| node_header
node_window -->|"uses"| node_sliders
node_window -->|"applies"| node_theme
node_window -->|"updates stages"| node_viewer
node_window -->|"updates comparison"| node_comparison
node_window -->|"uses"| node_widgets
node_scanner -->|"preprocesses"| node_preprocess
node_scanner -->|"detects edges"| node_edges
node_scanner -->|"finds document"| node_contours
node_scanner -->|"refines corners"| node_corners
node_scanner -->|"corrects perspective"| node_perspective
node_scanner -->|"enhances scan"| node_enhancement
node_scanner -->|"logs settings"| node_configlog
node_viewer -->|"renders stages"| node_widgets
node_viewer -->|"reads stage results"| node_scanner
node_comparison -->|"converts images"| node_imageio
node_widgets -->|"converts images"| node_imageio

click node_entry "https://github.com/sh1kurlu/edge-vision/blob/main/main.py"
click node_window "https://github.com/sh1kurlu/edge-vision/blob/main/gui/main_window.py"
click node_header "https://github.com/sh1kurlu/edge-vision/blob/main/gui/header.py"
click node_sliders "https://github.com/sh1kurlu/edge-vision/blob/main/gui/labeled_slider.py"
click node_theme "https://github.com/sh1kurlu/edge-vision/blob/main/gui/theme.py"
click node_scanner "https://github.com/sh1kurlu/edge-vision/blob/main/scanner/pipeline.py"
click node_preprocess "https://github.com/sh1kurlu/edge-vision/blob/main/scanner/preprocessing.py"
click node_edges "https://github.com/sh1kurlu/edge-vision/blob/main/scanner/edge_detection.py"
click node_contours "https://github.com/sh1kurlu/edge-vision/blob/main/scanner/contour_detection.py"
click node_corners "https://github.com/sh1kurlu/edge-vision/blob/main/scanner/corner_refinement.py"
click node_perspective "https://github.com/sh1kurlu/edge-vision/blob/main/scanner/perspective.py"
click node_enhancement "https://github.com/sh1kurlu/edge-vision/blob/main/scanner/enhancement.py"
click node_configlog "https://github.com/sh1kurlu/edge-vision/blob/main/scanner/config_log.py"
click node_viewer "https://github.com/sh1kurlu/edge-vision/blob/main/gui/pipeline_viewer.py"
click node_comparison "https://github.com/sh1kurlu/edge-vision/blob/main/gui/comparison_widget.py"
click node_widgets "https://github.com/sh1kurlu/edge-vision/blob/main/gui/widgets.py"
click node_imageio "https://github.com/sh1kurlu/edge-vision/blob/main/utils/image_utils.py"
click node_pdf "https://github.com/sh1kurlu/edge-vision/blob/main/utils/pdf_export.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_entry,node_window,node_header,node_sliders,node_theme,node_user toneBlue
class node_scanner,node_preprocess,node_edges,node_contours,node_corners,node_perspective,node_enhancement,node_configlog toneAmber
class node_viewer,node_comparison,node_widgets toneMint
class node_imageio,node_pdf toneRose
```

## Components

### Desktop application

- [Application entry](https://github.com/sh1kurlu/edge-vision/blob/main/main.py): `main.py`
- [Main window](https://github.com/sh1kurlu/edge-vision/blob/main/gui/main_window.py): `gui/main_window.py`
- [Brand header](https://github.com/sh1kurlu/edge-vision/blob/main/gui/header.py): `gui/header.py`
- [Parameter sliders](https://github.com/sh1kurlu/edge-vision/blob/main/gui/labeled_slider.py): `gui/labeled_slider.py`
- [Dark theme](https://github.com/sh1kurlu/edge-vision/blob/main/gui/theme.py): `gui/theme.py`

### Scanning pipeline

- [Scan coordinator](https://github.com/sh1kurlu/edge-vision/blob/main/scanner/pipeline.py): `scanner/pipeline.py`
- [Preprocessing](https://github.com/sh1kurlu/edge-vision/blob/main/scanner/preprocessing.py): `scanner/preprocessing.py`
- [Edge detection](https://github.com/sh1kurlu/edge-vision/blob/main/scanner/edge_detection.py): `scanner/edge_detection.py`
- [Contour detection](https://github.com/sh1kurlu/edge-vision/blob/main/scanner/contour_detection.py): `scanner/contour_detection.py`
- [Corner refinement](https://github.com/sh1kurlu/edge-vision/blob/main/scanner/corner_refinement.py): `scanner/corner_refinement.py`
- [Perspective correction](https://github.com/sh1kurlu/edge-vision/blob/main/scanner/perspective.py): `scanner/perspective.py`
- [Scan enhancement](https://github.com/sh1kurlu/edge-vision/blob/main/scanner/enhancement.py): `scanner/enhancement.py`
- [Config logging](https://github.com/sh1kurlu/edge-vision/blob/main/scanner/config_log.py): `scanner/config_log.py`

### Review interface

- [Pipeline inspector](https://github.com/sh1kurlu/edge-vision/blob/main/gui/pipeline_viewer.py): `gui/pipeline_viewer.py`
- [Result comparison](https://github.com/sh1kurlu/edge-vision/blob/main/gui/comparison_widget.py): `gui/comparison_widget.py`
- [Image and status widgets](https://github.com/sh1kurlu/edge-vision/blob/main/gui/widgets.py): `gui/widgets.py`

### Image and export

- [Image loading and saving](https://github.com/sh1kurlu/edge-vision/blob/main/utils/image_utils.py): `utils/image_utils.py`
- [PDF export](https://github.com/sh1kurlu/edge-vision/blob/main/utils/pdf_export.py): `utils/pdf_export.py`

### Other components

- **User**

## Connections

- User → Application entry: launches (evidence: `README.md`)
- Application entry → Main window: opens (evidence: `main.py`)
- Main window → Scan coordinator: dispatches scans (evidence: `gui/main_window.py`)
- Main window → Image loading and saving: loads and saves (evidence: `gui/main_window.py`)
- Main window → PDF export: exports PDF (evidence: `gui/main_window.py`)
- Main window → Brand header: uses (evidence: `gui/main_window.py`)
- Main window → Parameter sliders: uses (evidence: `gui/main_window.py`)
- Main window → Dark theme: applies (evidence: `gui/main_window.py`)
- Main window → Pipeline inspector: updates stages (evidence: `gui/main_window.py`)
- Main window → Result comparison: updates comparison (evidence: `gui/main_window.py`)
- Main window → Image and status widgets: uses (evidence: `gui/main_window.py`)
- Scan coordinator → Preprocessing: preprocesses (evidence: `scanner/pipeline.py`)
- Scan coordinator → Edge detection: detects edges (evidence: `scanner/pipeline.py`)
- Scan coordinator → Contour detection: finds document (evidence: `scanner/pipeline.py`)
- Scan coordinator → Corner refinement: refines corners (evidence: `scanner/pipeline.py`)
- Scan coordinator → Perspective correction: corrects perspective (evidence: `scanner/pipeline.py`)
- Scan coordinator → Scan enhancement: enhances scan (evidence: `scanner/pipeline.py`)
- Scan coordinator → Config logging: logs settings (evidence: `scanner/pipeline.py`)
- Pipeline inspector → Image and status widgets: renders stages (evidence: `gui/pipeline_viewer.py`)
- Pipeline inspector → Scan coordinator: reads stage results (evidence: `gui/pipeline_viewer.py`)
- Result comparison → Image loading and saving: converts images (evidence: `gui/comparison_widget.py`)
- Image and status widgets → Image loading and saving: converts images (evidence: `gui/widgets.py`)
