# gunarakulangunaretnam/fire-detection-system-using-python-opencv architecture

> Architecture diagram of the GitHub repository gunarakulangunaretnam/fire-detection-system-using-python-opencv, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gunarakulangunaretnam/fire-detection-system-using-python-opencv
- Repository: https://github.com/gunarakulangunaretnam/fire-detection-system-using-python-opencv

## Overview

##### Main Components

a. Input Layer:
- Camera/Video Feed Component

b. Processing Layer:
- OpenCV Processing Module
- Fire Detection Algorithm

c. Output Layer:
- Alarm System (using alarm-sound.mp3)
- Visual Display/Monitor

##### Detailed Component Breakdown

a. Video Processing Pipeline:
- RGB to HSV conversion step
- Threshold Mask application
- Fire detection decision point

b. Alert System:
- Alarm trigger to the detection system
- Audio output component

##### Technical Specifications

Technology labels:
- Python (main runtime)
- OpenCV (computer vision library)
- HSV Algorithm implementation
- Playsound library (for alarm)

- [Input] → [Processing] → [Detection] → [Output]
- ↑                                      ↓
- [Configuration] ←――――――――――――――――――――→ [Alerts]

##### Additional Elements

- Version information for key dependencies
- Error handling paths
- System requirements

Remember to include a small notes section explaining that this is a computer vision-based security system designed for real-time fire detection using standard camera hardware.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        Camera[Camera/Video Feed]
    end

    subgraph Processing["Processing Layer"]
        direction TB
        OpenCV[OpenCV Processing]:::processing
        HSV[HSV Color Detection]:::processing
        FireDetect[Fire Detection Algorithm]:::processing
    end

    subgraph Output["Output Layer"]
        direction TB
        Display[Visual Display]:::output
        Alarm[Alarm System]:::output
    end

    subgraph Config["Configuration & Documentation"]
        direction TB
        Docs[Documentation]:::docs
        HSVRef[HSV Color Reference]:::docs
    end

    Camera --> OpenCV
    OpenCV --> HSV
    HSV --> FireDetect
    FireDetect --> Display
    FireDetect --> Alarm
    HSVRef -.-> HSV
    Docs -.-> OpenCV

    %% Data Flow
    OpenCV -- RGB to HSV --> HSV
    HSV -- Threshold Mask --> FireDetect
    FireDetect -- Alert Trigger --> Alarm
    FireDetect -- Status --> Display

    %% Click Events
    click FireDetect "https://github.com/gunarakulangunaretnam/fire-detection-system-using-python-opencv/blob/main/fire-detector.py"
    click OpenCV "https://github.com/gunarakulangunaretnam/fire-detection-system-using-python-opencv/blob/main/fire-detector.py"
    click HSV "https://github.com/gunarakulangunaretnam/fire-detection-system-using-python-opencv/blob/main/fire-detector.py"
    click Alarm "https://github.com/gunarakulangunaretnam/fire-detection-system-using-python-opencv/blob/main/alarm-sound.mp3"
    click Docs "https://github.com/gunarakulangunaretnam/fire-detection-system-using-python-opencv/tree/main/github-readme-content/"

    %% Styling
    classDef processing fill:#90EE90,stroke:#333,stroke-width:2px
    classDef output fill:#FFB6C1,stroke:#333,stroke-width:2px
    classDef input fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef docs fill:#F0E68C,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1[Input Components]:::input
        L2[Processing Components]:::processing
        L3[Output Components]:::output
        L4[Documentation]:::docs
    end
```
