# crgrove/automated-drone-image-analysis-tool architecture

> Architecture diagram of the GitHub repository crgrove/automated-drone-image-analysis-tool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/crgrove/automated-drone-image-analysis-tool
- Repository: https://github.com/crgrove/automated-drone-image-analysis-tool

## Overview

##### Main Components

a. Core Application Layer:
- Main Window (UI Entry Point)
- Video Parser
- Viewer Component
- Configuration Management
- Settings Management
- Logging System

b. Algorithm Layer:
- Multiple Analysis Algorithms (ColorRange, MatchedFilter, RXAnomaly, ThermalAnomaly, ThermalRange)
- Shared Algorithm Components

c. Services Layer:
- Thermal Parser Services (Autel, DJI, Flir)
- Analysis Services
- KML Service
- Histogram Normalization
- K-Means Clustering

d. External Dependencies:
- DJI Thermal SDK
- Autel Bridge
- ExifTool

**[User Interface Layer]**

- Main Window
- Video Parser
- Viewer
- Preferences

- ↕ (Two-way communication)

**[Controller Layer]**

- Algorithm Controllers
- ColorRange
- MatchedFilter
- RXAnomaly
- ThermalAnomaly
- ThermalRange

- Core Controllers
- MainWindow
- VideoParser
- Viewer

- ↕ (Service calls)

**[Service Layer]**

- Core Services
- AnalyzeService
- ConfigService
- KMLService
- LoggerService
- SettingsService

- Thermal Parser Services
- Autel
- DJI
- FLIR

- Algorithm Services
- ColorRangeService
- MatchedFilterService
- Other Algorithm Services

- ↕ (External Integration)

**[External Dependencies]**
- DJI Thermal SDK
- Autel Bridge
- ExifTool

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#a8d1f0,stroke:#333
    classDef controller fill:#90EE90,stroke:#333
    classDef service fill:#FFB347,stroke:#333
    classDef external fill:#D3D3D3,stroke:#333
    classDef algorithm fill:#98FB98,stroke:#333

    %% UI Layer
    subgraph UI
        MW["Main Window"]:::ui
        VP["Video Parser"]:::ui
        V["Viewer"]:::ui
        P["Preferences"]:::ui
    end

    %% Controller Layer
    subgraph Controllers
        MWC["MainWindow Controller"]:::controller
        VPC["VideoParser Controller"]:::controller
        VC["Viewer Controller"]:::controller
    end

    %% Algorithm Controllers
    subgraph AlgorithmControllers
        CR["ColorRange"]:::algorithm
        MF["MatchedFilter"]:::algorithm
        RX["RXAnomaly"]:::algorithm
        TA["ThermalAnomaly"]:::algorithm
        TR["ThermalRange"]:::algorithm
        SC["Shared Components"]:::algorithm
    end

    %% Service Layer
    subgraph Services
        AS["Analysis Service"]:::service
        CS["Config Service"]:::service
        KS["KML Service"]:::service
        LS["Logger Service"]:::service
        SS["Settings Service"]:::service
        HN["Histogram Normalization"]:::service
        KM["K-Means Clustering"]:::service
    end

    %% Thermal Parser Services
    subgraph ThermalParsers
        ATP["Autel Parser"]:::service
        DTP["DJI Parser"]:::service
        FTP["FLIR Parser"]:::service
    end

    %% External Dependencies
    subgraph External
        DJI["DJI Thermal SDK"]:::external
        AB["Autel Bridge"]:::external
        ET["ExifTool"]:::external
    end

    %% Relationships
    MW --> MWC
    VP --> VPC
    V --> VC

    MWC --> AS
    MWC --> CS
    MWC --> SS
    MWC --> LS

    VPC --> AS
    VC --> AS

    AS --> CR & MF & RX & TA & TR
    CR & MF & RX & TA & TR --> SC

    AS --> ATP & DTP & FTP
    AS --> HN & KM
    AS --> KS

    ATP --> AB
    DTP --> DJI
    FTP --> ET

    %% Click Events
    click MW "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/controllers/MainWindow.py"
    click VP "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/controllers/VideoParser.py"
    click V "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/controllers/Viewer.py"
    click CS "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/services/ConfigService.py"
    click SS "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/services/SettingsService.py"
    click LS "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/services/LoggerService.py"
    click CR "https://github.com/crgrove/automated-drone-image-analysis-tool/tree/master/app/algorithms/ColorRange/"
    click MF "https://github.com/crgrove/automated-drone-image-analysis-tool/tree/master/app/algorithms/MatchedFilter/"
    click RX "https://github.com/crgrove/automated-drone-image-analysis-tool/tree/master/app/algorithms/RXAnomaly/"
    click TA "https://github.com/crgrove/automated-drone-image-analysis-tool/tree/master/app/algorithms/ThermalAnomaly/"
    click TR "https://github.com/crgrove/automated-drone-image-analysis-tool/tree/master/app/algorithms/ThermalRange/"
    click SC "https://github.com/crgrove/automated-drone-image-analysis-tool/tree/master/app/algorithms/Shared/"
    click AS "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/services/AnalyzeService.py"
    click KS "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/services/KMLService.py"
    click HN "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/services/HistogramNormalizationService.py"
    click KM "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/services/KMeansClustersService.py"
    click ATP "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/services/thermalParserServices/AutelThermalParserService.py"
    click DTP "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/services/thermalParserServices/DjiThermalParserService.py"
    click FTP "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/core/services/thermalParserServices/FlirThermalParserService.py"
    click DJI "https://github.com/crgrove/automated-drone-image-analysis-tool/tree/master/app/external/dji_thermal_sdk_v1.5_20240507/"
    click AB "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/external/autel/AutelBridge.lib"
    click ET "https://github.com/crgrove/automated-drone-image-analysis-tool/blob/master/app/external/exiftool.exe"
```
