# paresh123829/real-time-wire-gap-detection-system architecture

> Architecture diagram of the GitHub repository paresh123829/real-time-wire-gap-detection-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/paresh123829/real-time-wire-gap-detection-system
- Repository: https://github.com/paresh123829/real-time-wire-gap-detection-system

## Overview

This is a Streamlit prototype for inspecting industrial wire belts: operators supply an image or synthetic scenario, the app detects and tracks wires, evaluates adjacent gaps and confidence, then presents measurements and visual alerts. The graph preserves the documented camera, calibration, and dashboard capabilities; some app wiring is based on the SOURCE INDEX because the relevant app sections were not excerpted.

Main entry points: [`app.py`](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/app.py) (Inspection Dashboard), [`config.py`](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/config.py) (Detection Settings), [`src/image_preprocessing.py`](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/image_preprocessing.py) (Preprocessing), [`src/wire_detection.py`](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/wire_detection.py) (Wire Detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inspection Inputs"]
  node_belt_image["Belt Image"]
  node_camera["Live Camera<br/>[camera.py]"]
  node_synthetic["Synthetic Scenarios<br/>[synthetic.py]"]
end

subgraph group_vision["Image Processing"]
  node_roi["ROI Localization<br/>[roi.py]"]
  node_preprocess["Preprocessing"]
  node_wire_detection["Wire Detection<br/>[wire_detection.py]"]
  node_strip_measurement["Strip Profiles"]
end

subgraph group_analysis["Measurement Analysis"]
  node_tracking["Wire Tracking<br/>[wire_tracking.py]"]
  node_gap["Gap Evaluation<br/>[gap_measurement.py]"]
  node_calibration["Pixel Calibration<br/>[calibration.py]"]
  node_confidence["Detection Confidence<br/>[confidence.py]"]
end

subgraph group_interface["Operator Interface"]
  node_app["Inspection Dashboard<br/>[app.py]"]
  node_config["Detection Settings<br/>[config.py]"]
  node_visualization["Inspection Overlays<br/>[visualization.py]"]
end

node_operator(("Operator"))

node_operator -->|"configures inspection"| node_app
node_belt_image -->|"supplies image"| node_app
node_camera -.->|"streams frames"| node_app
node_synthetic -->|"generates scenarios"| node_app
node_app -->|"localizes region"| node_roi
node_app -->|"prepares image"| node_preprocess
node_preprocess -->|"evaluates channels"| node_wire_detection
node_app -->|"extracts profiles"| node_strip_measurement
node_app -->|"detects candidates"| node_wire_detection
node_app -->|"tracks candidates"| node_tracking
node_app -->|"evaluates gaps"| node_gap
node_app -->|"uses calibration"| node_calibration
node_app -->|"scores detection"| node_confidence
node_app -->|"renders inspection"| node_visualization
node_config -->|"sets parameters"| node_preprocess
node_config -->|"sets parameters"| node_wire_detection
node_config -->|"sets limits"| node_tracking
node_config -->|"sets thresholds"| node_gap
node_config -->|"sets weights"| node_confidence
node_config -->|"sets strip range"| node_strip_measurement
node_app -->|"shows results"| node_operator

click node_camera "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/camera.py"
click node_synthetic "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/synthetic.py"
click node_app "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/app.py"
click node_config "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/config.py"
click node_roi "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/roi.py"
click node_preprocess "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/image_preprocessing.py"
click node_wire_detection "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/wire_detection.py"
click node_strip_measurement "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/strip_measurement.py"
click node_tracking "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/wire_tracking.py"
click node_gap "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/gap_measurement.py"
click node_calibration "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/calibration.py"
click node_confidence "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/confidence.py"
click node_visualization "https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/visualization.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_belt_image,node_camera,node_synthetic toneBlue
class node_roi,node_preprocess,node_wire_detection,node_strip_measurement toneAmber
class node_tracking,node_gap,node_calibration,node_confidence toneMint
class node_app,node_config,node_visualization toneRose
class node_operator toneIndigo
```

## Components

### Inspection Inputs

- **Belt Image**
- [Live Camera](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/camera.py): `src/camera.py`
- [Synthetic Scenarios](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/synthetic.py): `src/synthetic.py`

### Image Processing

- [ROI Localization](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/roi.py): `src/roi.py`
- [Preprocessing](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/image_preprocessing.py): `src/image_preprocessing.py`
- [Wire Detection](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/wire_detection.py): `src/wire_detection.py`
- [Strip Profiles](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/strip_measurement.py): `src/strip_measurement.py`

### Measurement Analysis

- [Wire Tracking](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/wire_tracking.py): `src/wire_tracking.py`
- [Gap Evaluation](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/gap_measurement.py): `src/gap_measurement.py`
- [Pixel Calibration](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/calibration.py): `src/calibration.py`
- [Detection Confidence](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/confidence.py): `src/confidence.py`

### Operator Interface

- [Inspection Dashboard](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/app.py): `app.py`
- [Detection Settings](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/config.py): `config.py`
- [Inspection Overlays](https://github.com/paresh123829/real-time-wire-gap-detection-system/blob/main/src/visualization.py): `src/visualization.py`

### Other components

- **Operator**

## Connections

- Operator → Inspection Dashboard: configures inspection (evidence: `README.md`)
- Belt Image → Inspection Dashboard: supplies image (evidence: `README.md`)
- Live Camera → Inspection Dashboard: streams frames
- Synthetic Scenarios → Inspection Dashboard: generates scenarios (evidence: `app.py`)
- Inspection Dashboard → ROI Localization: localizes region (evidence: `app.py`)
- Inspection Dashboard → Preprocessing: prepares image (evidence: `app.py`)
- Preprocessing → Wire Detection: evaluates channels (evidence: `src/image_preprocessing.py`)
- Inspection Dashboard → Strip Profiles: extracts profiles (evidence: `app.py`)
- Inspection Dashboard → Wire Detection: detects candidates (evidence: `app.py`)
- Inspection Dashboard → Wire Tracking: tracks candidates (evidence: `app.py`)
- Inspection Dashboard → Gap Evaluation: evaluates gaps (evidence: `app.py`)
- Inspection Dashboard → Pixel Calibration: uses calibration (evidence: `app.py`)
- Inspection Dashboard → Detection Confidence: scores detection (evidence: `app.py`)
- Inspection Dashboard → Inspection Overlays: renders inspection (evidence: `app.py`)
- Detection Settings → Preprocessing: sets parameters (evidence: `src/image_preprocessing.py`)
- Detection Settings → Wire Detection: sets parameters (evidence: `src/wire_detection.py`)
- Detection Settings → Wire Tracking: sets limits (evidence: `src/wire_tracking.py`)
- Detection Settings → Gap Evaluation: sets thresholds (evidence: `src/gap_measurement.py`)
- Detection Settings → Detection Confidence: sets weights (evidence: `src/confidence.py`)
- Detection Settings → Strip Profiles: sets strip range (evidence: `src/strip_measurement.py`)
- Inspection Dashboard → Operator: shows results (evidence: `README.md`)
