# vashikkaushik-hub/maze-path-finder architecture

> Architecture diagram of the GitHub repository vashikkaushik-hub/maze-path-finder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vashikkaushik-hub/maze-path-finder
- Repository: https://github.com/vashikkaushik-hub/maze-path-finder

## Overview

Maze Path Finder is a single-file Python program that accepts a maze image, processes it, locates colored start and end markers, searches for a route, and displays the result. Its main() function coordinates the runtime workflow. Image loading, processing, contour detection, and drawing use OpenCV; path search uses breadth-first search. The boundary overlay is computed but its returned image is not used by main(). The supplied source supports the workflow shown; future improvements in the README are not implemented components.

Main entry points: [`Maze Path Finder.py`](https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py) (Workflow coordinator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Program workflow"]
  node_main["Workflow coordinator"]
  node_load["Image input"]
end

subgraph group_vision["Image analysis"]
  node_gray["Grayscale conversion"]
  node_binary["Binary threshold"]
  node_pixels["Pixel counting"]
  node_boundary["Boundary detection"]
  node_markers["Marker detection"]
end

subgraph group_path["Path and display"]
  node_solver["Breadth-first search"]
  node_render["Path rendering"]
  node_resize["Display resizing"]
end

node_user(("Maze image user"))
node_opencv["OpenCV"]
node_viewer(("Result viewer"))

node_user -->|"provides path"| node_load
node_main -->|"calls"| node_load
node_load -->|"loads image"| node_opencv
node_main -->|"calls"| node_gray
node_gray -->|"converts color"| node_opencv
node_main -->|"calls"| node_binary
node_binary -->|"thresholds image"| node_opencv
node_main -->|"calls"| node_pixels
node_main -->|"calls"| node_boundary
node_boundary -->|"finds contours"| node_opencv
node_main -->|"calls"| node_markers
node_markers -->|"detects colors"| node_opencv
node_main -->|"calls"| node_solver
node_main -->|"calls"| node_render
node_render -->|"calls"| node_resize
node_render -->|"draws path"| node_opencv
node_main -->|"displays result"| node_opencv
node_opencv -->|"shows windows"| node_viewer

click node_main "https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py"
click node_load "https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py"
click node_gray "https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py"
click node_binary "https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py"
click node_pixels "https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py"
click node_boundary "https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py"
click node_markers "https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py"
click node_solver "https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py"
click node_render "https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py"
click node_resize "https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.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_main,node_load,node_user,node_viewer toneBlue
class node_gray,node_binary,node_pixels,node_boundary,node_markers toneAmber
class node_solver,node_render,node_resize toneMint
class node_opencv toneIndigo
```

## Components

### Program workflow

- [Workflow coordinator](https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py): `Maze Path Finder.py`
- [Image input](https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py): `Maze Path Finder.py`

### Image analysis

- [Grayscale conversion](https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py): `Maze Path Finder.py`
- [Binary threshold](https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py): `Maze Path Finder.py`
- [Pixel counting](https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py): `Maze Path Finder.py`
- [Boundary detection](https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py): `Maze Path Finder.py`
- [Marker detection](https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py): `Maze Path Finder.py`

### Path and display

- [Breadth-first search](https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py): `Maze Path Finder.py`
- [Path rendering](https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py): `Maze Path Finder.py`
- [Display resizing](https://github.com/vashikkaushik-hub/maze-path-finder/blob/main/Maze%20Path%20Finder.py): `Maze Path Finder.py`

### Other components

- **Maze image user**
- **OpenCV**
- **Result viewer**

## Connections

- Maze image user → Image input: provides path
- Workflow coordinator → Image input: calls
- Image input → OpenCV: loads image
- Workflow coordinator → Grayscale conversion: calls
- Grayscale conversion → OpenCV: converts color
- Workflow coordinator → Binary threshold: calls
- Binary threshold → OpenCV: thresholds image
- Workflow coordinator → Pixel counting: calls
- Workflow coordinator → Boundary detection: calls
- Boundary detection → OpenCV: finds contours
- Workflow coordinator → Marker detection: calls
- Marker detection → OpenCV: detects colors
- Workflow coordinator → Breadth-first search: calls
- Workflow coordinator → Path rendering: calls
- Path rendering → Display resizing: calls
- Path rendering → OpenCV: draws path
- Workflow coordinator → OpenCV: displays result
- OpenCV → Result viewer: shows windows
