# kamegawaa/handtrack-project architecture

> Architecture diagram of the GitHub repository kamegawaa/handtrack-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kamegawaa/handtrack-project
- Repository: https://github.com/kamegawaa/handtrack-project

## Overview

##### Project type and purpose
- This is a hardware‐software integration prototype: a Python application using OpenCV and MediaPipe to count raised fingers via a webcam, then sending commands over a serial link (via pyFirmata) to an Arduino Uno running C++ firmware to light up LEDs accordingly.

##### File structure
- Top‐level files:
- README.md – project description and dependencies
- Vídeo.mp4 – demonstration video
- controller.py – main Python script for camera capture, finger detection, and serial communication
- new.py – likely an alternate or updated version of controller.py
- Documentação do Projeto/ – design docs, schematics, photos

##### README for additional insights
- Dependencies: Python, OpenCV, MediaPipe, pyFirmata; Arduino C++ sketch on the Uno
- Workflow: webcam → detect hand landmarks → compute number of fingers → send command via USB → Arduino toggles LEDs

## Diagram (Mermaid)

```mermaid
flowchart TD
    Camera["USB Webcam"]:::hwDevice

    subgraph "Python Application"
        C1["controller.py"]:::software
        C2["new.py"]:::software
        subgraph "CV Pipeline"
            OC["OpenCV Video Capture"]:::software
            MP["MediaPipe Hand-Landmark Detector"]:::software
            FC["Finger-Count Algorithm"]:::software
        end
        PF["pyFirmata Serial Client"]:::software
    end

    Serial["USB/Serial (pyFirmata protocol)"]:::hardware

    AF["Arduino Uno Firmware (C++)"]:::firmware
    LED["LED Array"]:::hwDevice

    subgraph "Project Assets"
        RD["README.md"]:::docs
        DV["Vídeo.mp4"]:::docs
        DOC["Documentação do Projeto/"]:::docs
    end

    Camera --> OC
    OC --> MP
    MP --> FC
    FC --> PF
    PF --> Serial
    Serial --> AF
    AF --> LED

    classDef software fill:#bbf,stroke:#339;
    classDef hardware fill:#f9f,stroke:#933;
    classDef firmware fill:#bfb,stroke:#393;
    classDef hwDevice fill:#fcf,stroke:#c39;
    classDef docs fill:#eee,stroke:#999,stroke-dasharray: 5 5;

    click C1 "https://github.com/kamegawaa/handtrack-project/blob/main/controller.py"
    click C2 "https://github.com/kamegawaa/handtrack-project/blob/main/new.py"
    click RD "https://github.com/kamegawaa/handtrack-project/blob/main/README.md"
    click DV "https://github.com/kamegawaa/handtrack-project/blob/main/Vídeo.mp4"
    click DOC "https://github.com/kamegawaa/handtrack-project/tree/main/Documentação do Projeto/"
```
