# paraggarg969/car-parking-system architecture

> Architecture diagram of the GitHub repository paraggarg969/car-parking-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/paraggarg969/car-parking-system
- Repository: https://github.com/paraggarg969/car-parking-system

## Overview

#### Purpose
A small computer-vision parking-occupancy project. It appears to analyze parking-lot video, define parking-space rectangles, and render/count available spaces.

#### Entry Points
- `final_carparking.py` is the likely runtime application entry point for video-based parking detection.
- `draw_rectangle.py` likely provides an interactive/manual workflow for marking parking bays.
- `position_finder.py` likely supports determining or persisting parking-space positions.

No README is present, so invocation commands and dependencies are not documented.

#### Video Input Boundary
The repository includes two MP4 assets:
- `Image_Video/video.mp4`
- `parking system.mp4`

These files are the probable local input sources for the detection pipeline. The design appears file/video-stream oriented rather than web-service based.

#### Parking-Space Definition Stage
Parking-space geometry is likely established before or alongside detection:
- `draw_rectangle.py`
- `position_finder.py`
- `carparkpos`

`carparkpos` is likely a serialized parking-position dataset consumed by the runtime detector. This separates manual calibration of lot-specific bays from frame-by-frame occupancy evaluation.

#### Occupancy Detection and Visualization
`final_carparking.py` likely coordinates the main control flow: read video frames, inspect each configured parking region, classify it as occupied or free, and draw status overlays/counts. `draw_rectangle.py` is likely responsible for visual rectangle annotation used to produce the region definitions.

#### Runtime and External Dependencies
The code is Python-based, as indicated by the `.py` scripts. The presence of local MP4 processing and rectangle drawing strongly suggests an image-processing runtime such as OpenCV, though no dependency manifest is available to confirm package names or versions. There are no visible cloud services, databases, APIs, containers, or deployment infrastructure in the repository tree.

Main entry points: [`final_carparking.py`](https://github.com/paraggarg969/car-parking-system/blob/main/final_carparking.py) (Parking detector), [`carparkpos`](https://github.com/paraggarg969/car-parking-system/blob/main/carparkpos) (Parking positions), [`draw_rectangle.py`](https://github.com/paraggarg969/car-parking-system/blob/main/draw_rectangle.py) (Rectangle annotation), [`position_finder.py`](https://github.com/paraggarg969/car-parking-system/blob/main/position_finder.py) (Position finder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_calibration["Parking-space calibration"]
  node_draw_rectangle["Rectangle annotation<br/>Python script<br/>[draw_rectangle.py]"]
  node_position_finder["Position finder<br/>Python script<br/>[position_finder.py]"]
  node_carpark_positions[("Parking positions<br/>serialized position data")]
end

subgraph group_runtime["Video occupancy runtime"]
  node_video_primary["Parking video<br/>MP4 input<br/>[video.mp4]"]
  node_video_alternate["Alternate parking video<br/>MP4 input<br/>[parking system.mp4]"]
  node_final_carparking["Parking detector<br/>Python application"]
  node_frame_processing["Frame processing<br/>vision stage"]
  node_occupancy_status(("Space occupancy<br/>classification result"))
  node_availability_overlay["Availability display<br/>visual output"]
end

node_opencv_runtime{{"Image-processing runtime<br/>Python dependency"}}

node_draw_rectangle -->|"creates"| node_carpark_positions
node_position_finder -->|"determines or saves"| node_carpark_positions
node_carpark_positions -->|"loads bay geometry"| node_final_carparking
node_video_primary -->|"video input"| node_final_carparking
node_video_alternate -.->|"alternate input"| node_final_carparking
node_final_carparking -->|"orchestrates"| node_frame_processing
node_frame_processing -->|"classifies regions"| node_occupancy_status
node_occupancy_status -->|"renders statuses and count"| node_availability_overlay
node_final_carparking -->|"displays"| node_availability_overlay
node_draw_rectangle -.->|"uses"| node_opencv_runtime
node_final_carparking -.->|"likely uses"| node_opencv_runtime

click node_draw_rectangle "https://github.com/paraggarg969/car-parking-system/blob/main/draw_rectangle.py"
click node_position_finder "https://github.com/paraggarg969/car-parking-system/blob/main/position_finder.py"
click node_carpark_positions "https://github.com/paraggarg969/car-parking-system/blob/main/carparkpos"
click node_video_primary "https://github.com/paraggarg969/car-parking-system/blob/main/Image_Video/video.mp4"
click node_video_alternate "https://github.com/paraggarg969/car-parking-system/blob/main/parking%20system.mp4"
click node_final_carparking "https://github.com/paraggarg969/car-parking-system/blob/main/final_carparking.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_draw_rectangle,node_position_finder,node_carpark_positions toneBlue
class node_video_primary,node_video_alternate,node_final_carparking,node_frame_processing,node_occupancy_status,node_availability_overlay toneAmber
class node_opencv_runtime toneNeutral
```

## Components

### Parking-space calibration

Manual setup of lot-specific parking bays.

- [Rectangle annotation](https://github.com/paraggarg969/car-parking-system/blob/main/draw_rectangle.py): Python script · Interactive workflow for marking parking bays. · `draw_rectangle.py`
- [Position finder](https://github.com/paraggarg969/car-parking-system/blob/main/position_finder.py): Python script · Supports determining or persisting parking-space positions. · `position_finder.py`
- [Parking positions](https://github.com/paraggarg969/car-parking-system/blob/main/carparkpos): serialized position data · Lot-specific parking-space geometry. · `carparkpos`

### Video occupancy runtime

Frame-based parking availability analysis.

- [Parking video](https://github.com/paraggarg969/car-parking-system/blob/main/Image_Video/video.mp4): MP4 input · Local video source for occupancy analysis. · `Image_Video/video.mp4`
- [Alternate parking video](https://github.com/paraggarg969/car-parking-system/blob/main/parking%20system.mp4): MP4 input · Alternate local parking video source. · `parking system.mp4`
- [Parking detector](https://github.com/paraggarg969/car-parking-system/blob/main/final_carparking.py): Python application · Coordinates video processing, occupancy classification, and display. · `final_carparking.py`
- **Frame processing**: vision stage · Reads video frames and evaluates configured parking regions.
- **Space occupancy**: classification result · Free or occupied status per parking space.
- **Availability display**: visual output · Renders parking-space status and available-space count.

### Other components

- **Image-processing runtime**: Python dependency · Likely local vision and drawing capability; dependency is not documented.

## Connections

- Rectangle annotation → Parking positions: creates
- Position finder → Parking positions: determines or saves
- Parking positions → Parking detector: loads bay geometry
- Parking video → Parking detector: video input
- Alternate parking video → Parking detector: alternate input
- Parking detector → Frame processing: orchestrates
- Frame processing → Space occupancy: classifies regions
- Space occupancy → Availability display: renders statuses and count
- Parking detector → Availability display: displays
- Rectangle annotation → Image-processing runtime: uses
- Parking detector → Image-processing runtime: likely uses
