# gherrada22/spanish-sign-translator architecture

> Architecture diagram of the GitHub repository gherrada22/spanish-sign-translator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gherrada22/spanish-sign-translator
- Repository: https://github.com/gherrada22/spanish-sign-translator

## Overview

##### Main Components to Identify
- Webcam/Video Input – Represents the hardware capturing real-time images.
- Video Capture Module – The component in app.py that uses OpenCV to capture feed from the webcam.
- Hand Detection & Processing Pipeline – The core logic that leverages MediaPipe to detect and track hand gestures.
- Utility/Helper Functions – The functions located in the Funciones directory (such as condicionales.py and normalizacionCords.py) to handle conditional processing and coordinate normalization.
- Additional Dynamic Processing Module – (letra en movimiento.py) which likely provides additional functionality (possibly for showing the detected letter in motion or for dynamic display logic).
- External Libraries & Dependencies – OpenCV, MediaPipe, and NumPy (all managed via requirements.txt).

##### Relationships & Data Flow
- The video stream is captured from the webcam by the Video Capture Module.
- Frames from the video are then passed to the Hand Detection Pipeline, which uses MediaPipe to detect hand landmarks.
- The raw landmark data is processed by calling functions within Funciones (e.g., condicionals for evaluating hand gesture conditions and normalizacionCords for normalizing coordinates). This component refines and translates raw detection data into sign language outputs.
- The outcome may be visualized/annotated on the video feed or, if applicable, further processed by otro módulo like “letra en movimiento.py” to animate or display the letter corresponding to the sign.
- The overall system orchestrated by app.py integrates these modules and likely handles user interaction and the main execution loop.

##### Architectural Patterns & Design Principles
- Modular Design: The project is broken down into a main application file (app.py) and segregated functionality in the Funciones folder. This makes the system modular and encourages separation of concerns.
- Real-Time Processing Pipeline: The architecture follows a sequential processing pipeline where video frames are captured, processed for hand landmarks, then mapped to sign language meaning.
- Dependency Injection & Extensibility: Although simple, the modular approach (with dedicated scripts for hand processing or dynamic display) allows for enhancements or substitution of components as needed.

##### Specific Inclusions

♦ “Normalization Module (normalizacionCords.py)”
♦ “Conditional Processing (condicionales.py)”
- All outcomes then converge into a final output component like “Translated Sign Display” which presents the detected letter/sign in Spanish on the screen.

## Diagram (Mermaid)

```mermaid
graph TD
    A("Hardware: Webcam"):::hardware
    B("OpenCV Video Capture (app.py)"):::module
    C("MediaPipe Hand Detection (app.py)"):::module
    D("Coordinate Normalization (normalizacionCords.py)"):::utility
    E("Conditional Processing (condicionales.py)"):::utility
    F("Dynamic Movement Display (letra en movimiento.py)"):::module
    G("Translated Sign Display"):::display
    H("External Libraries (requirements.txt)"):::external

    A -->|"RawFrameData"| B
    B -->|"VideoFrames"| C
    C -->|"HandLandmarks"| D
    C -->|"HandLandmarks"| E
    C -->|"ProcessedSign"| F
    D -->|"NormalizedCoords"| G
    E -->|"GestureConditions"| G
    F -->|"AnimatedSign"| G
    H -->|"ProvidesLibs"| B
    H -->|"ProvidesLibs"| C

    click B "https://github.com/gherrada22/spanish-sign-translator/blob/main/app.py"
    click C "https://github.com/gherrada22/spanish-sign-translator/blob/main/app.py"
    click D "https://github.com/gherrada22/spanish-sign-translator/blob/main/Funciones/normalizacionCords.py"
    click E "https://github.com/gherrada22/spanish-sign-translator/blob/main/Funciones/condicionales.py"
    click F "https://github.com/gherrada22/spanish-sign-translator/blob/main/letra en movimiento.py"
    click H "https://github.com/gherrada22/spanish-sign-translator/blob/main/requirements.txt"

    classDef hardware fill:#FFE6E6,stroke:#FF0000,stroke-width:2px;
    classDef module fill:#E6F7FF,stroke:#0000FF,stroke-width:2px;
    classDef utility fill:#E6FFE6,stroke:#008000,stroke-width:2px;
    classDef external fill:#FFFFE6,stroke:#999900,stroke-width:2px;
    classDef display fill:#F6E6FF,stroke:#990099,stroke-width:2px;
```
