# ashutoshraj/signaturerecognition architecture

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

- Interactive diagram: https://gitdiagram.com/ashutoshraj/signaturerecognition
- Repository: https://github.com/ashutoshraj/signaturerecognition

## Overview

##### Project type and purpose
- This is a command-line image-processing pipeline (a small full-stack of modules) for signature verification without deep learning.
- Purpose: take two scanned signature images, preprocess & segment strokes, compute orientation & frequency maps, enhance via Gabor filters, extract keypoints (ORB), and match them to decide if both signatures belong to the same person.

##### File structure
- Top level:
- main-app.py (entry point / CLI)
- Libraries/ (contains one subpackage per processing stage)
- README.md, LICENSE, config (_config.yml), __init__.py
- Libraries/ modules follow a pip-style package:
- Preprocessing/Preprocessing.py
- StrokeSegmentation/StrokeSegmentation.py
- StrokeOrient/StrokeOrient.py
- StrokeFrequency/StrokeFrequency.py
- StrokeFilter/StrokeFilter.py
- ExtractKeypoints/ExtractKeypoints.py
- No web frontend or database—just a sequential pipeline invoked from the CLI.

##### README for additional insights
- Steps described in “Technical Details”: CLAHE → grayscale → normalize → stroke segmentation → orientation → frequency estimation → Gabor filtering → thresholding & normalization → thinning & denoising → corner/curve feature extraction → ORB descriptor → brute-force matching → decision by threshold.
- External dependencies: numpy, scipy, matplotlib, OpenCV, scikit-image.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Data["Data (sample images & flow diagram)"]:::data
    CLI["Input Loader & Orchestrator"]:::input
    Pre["Preprocessing\n(skimage CLAHE, grayscale, normalize)"]:::module
    Seg["StrokeSegmentation\n(binary stroke map)"]:::module
    Orient["OrientationEstimation\n(orientation map)"]:::module
    Freq["FrequencyEstimation\n(frequency map)"]:::module
    Filter["Filtering & Enhancement\n(Gabor filtering)"]:::module
    KeyExt["KeypointExtraction\n(ORB descriptor)"]:::module
    Match["Matcher & Decision Logic\n(brute-force matching, threshold)"]:::decision
    Output["Print Result\n(similarity score & decision)"]:::output

    subgraph "External Libraries"
        OpenCV["OpenCV"]:::external
        NumPy["NumPy"]:::external
        SciPy["SciPy"]:::external
        SKImage["scikit-image"]:::external
        Matplotlib["Matplotlib"]:::external
    end

    subgraph "Documentation"
        README["README.md"]:::data
        Config["_config.yml"]:::data
    end

    Data -->|load images| CLI
    CLI -->|image pair| Pre
    Pre -->|preprocessed image| Seg
    Seg -->|stroke map| Orient
    Orient -->|orientation map| Freq
    Freq -->|frequency map| Filter
    Filter -->|enhanced image| KeyExt
    KeyExt -->|feature descriptors| Match
    Match -->|score & decision| Output

    Pre -->|uses| SKImage
    Pre -->|uses| NumPy
    Seg -->|uses| OpenCV
    Orient -->|uses| SciPy
    Freq -->|uses| SciPy
    Filter -->|uses| OpenCV
    Filter -->|uses| NumPy
    KeyExt -->|uses| OpenCV
    Match -->|uses| OpenCV
    Output -->|uses| Matplotlib

    click CLI "https://github.com/ashutoshraj/signaturerecognition/blob/master/main-app.py"
    click Pre "https://github.com/ashutoshraj/signaturerecognition/blob/master/Libraries/Preprocessing/Preprocessing.py"
    click Seg "https://github.com/ashutoshraj/signaturerecognition/blob/master/Libraries/StrokeSegmentation/StrokeSegmentation.py"
    click Orient "https://github.com/ashutoshraj/signaturerecognition/blob/master/Libraries/StrokeOrient/StrokeOrient.py"
    click Freq "https://github.com/ashutoshraj/signaturerecognition/blob/master/Libraries/StrokeFrequency/StrokeFrequency.py"
    click Filter "https://github.com/ashutoshraj/signaturerecognition/blob/master/Libraries/StrokeFilter/StrokeFilter.py"
    click KeyExt "https://github.com/ashutoshraj/signaturerecognition/blob/master/Libraries/ExtractKeypoints/ExtractKeypoints.py"
    click Match "https://github.com/ashutoshraj/signaturerecognition/blob/master/main-app.py"
    click Data "https://github.com/ashutoshraj/signaturerecognition/tree/master/Data/"
    click README "https://github.com/ashutoshraj/signaturerecognition/blob/master/README.md"
    click Config "https://github.com/ashutoshraj/signaturerecognition/blob/master/_config.yml"

    classDef input fill:#9f6,stroke:#333,stroke-width:1px
    classDef data fill:#afa,stroke:#333,stroke-width:1px
    classDef module fill:#bbf,stroke:#333,stroke-width:1px
    classDef external fill:#f96,stroke:#333,stroke-width:1px
    classDef decision fill:#f99,stroke:#333,stroke-width:1px
    classDef output fill:#9cf,stroke:#333,stroke-width:1px
```
