# nnyang0918/screen-shooting-watermark architecture

> Architecture diagram of the GitHub repository nnyang0918/screen-shooting-watermark, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nnyang0918/screen-shooting-watermark
- Repository: https://github.com/nnyang0918/screen-shooting-watermark

## Overview

##### Project Type and Purpose
- This is an academic/research codebase implementing “An End-to-End Robust and Transparent Image Watermarking Method for Screen-Shooting Scenarios.”
- It is not a full-stack web application but rather a signal-processing/ML pipeline tool that embeds watermarks into images, simulates screen-shooting distortions (angle, distance), and then extracts and evaluates the watermark.

##### File Structure Analysis
- Root directory contains:
- README.md – high-level project description and link to full dataset
- angle/ – module for evaluating the watermarking under varied camera angles
· angle/README.md – example and instructions for angle experiments
- distance/ – module for evaluating under varied shooting distances
· distance/readME.md – example and instructions for distance experiments
- No traditional “src,” “lib,” or “tests” directories; instead the code is organized by distortion type.

##### Key Components
a. Data Ingestion
– Input Plain Images (from Google Drive link)
b. Watermark Embedding Module
– Embeds a transparent watermark into each input image
– Likely implemented in Python using OpenCV or a DL framework (PyTorch/TensorFlow)
c. Distortion Simulation Modules
– Angle Simulation (angle/ directory) – applies geometric transforms to simulate different camera angles
– Distance Simulation (distance/ directory) – applies scaling, blurring to simulate different shooting distances
d. Watermark Extraction Module
– Takes the distorted (screen-captured) image and recovers the embedded watermark
e. Evaluation & Metrics
– Compares recovered watermark with original
– Computes robustness metrics (e.g., PSNR, SSIM, bit-error rate)
f. External Dependencies and Data Storage
– Google Drive for storing full datasets
– Standard Python libraries (list as notes): OpenCV, NumPy, PIL, DL framework

##### Relationships and Data Flow
1. “Input Image” →
2. “Embedder” →
3. “Watermarked Image” →
4. [fork] → “Angle Simulation” → Distorted-Angle Image → “Extractor” → Recovered Watermark
→ “Distance Simulation” → Distorted-Distance Image → “Extractor” → Recovered Watermark
5. “Evaluator” computes metrics on each recovery
- That both simulation modules feed into the same extraction and evaluation steps.

##### Architectural Patterns and Design Principles
- Pipeline Pattern (linear data flow with branches)
- Modular separation by distortion type (angle vs distance)
- Reuse of core modules (Embedder, Extractor, Evaluator) across experiments
- External data decoupling (large datasets stored on Google Drive)

##### Detailed Level
- Configuration parameters (angle range, distance blur kernel size) if desired.
- Branching clearly: one main embedder feeding two separate simulation flows.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Sources
    README["README.md\n(Project Overview)"]:::sink
    GoogleDrive["Google Drive Dataset"]:::external
    Input["Input Plain Images"]:::data

    %% Core Processing Modules
    Embedd["Embedder:\nPyTorch + OpenCV"]:::core
    Extract["Extractor:\nOpenCV + DL"]:::core

    %% Intermediate Data
    Watermarked["Watermarked Image"]:::data
    DistAngImg["Distorted-Angle Image"]:::data
    DistDisImg["Distorted-Distance Image"]:::data
    RecoveredAng["Recovered Watermark\n(Angle)"]:::data
    RecoveredDis["Recovered Watermark\n(Distance)"]:::data

    %% Simulation Modules
    angleSubgraph["Angle Simulation"]:::simulation
    distanceSubgraph["Distance Simulation"]:::simulation

    %% Evaluation
    Evaluator["Evaluator & Metrics:\nPSNR, SSIM, BER"]:::sink

    %% Relationships
    README -->|describes| Input
    GoogleDrive -.->|dataset download| Input
    Input -->|"plain image"| Embedd
    Embedd -->|"watermarked image"| Watermarked
    Watermarked --> angleSubgraph
    Watermarked --> distanceSubgraph
    angleSubgraph -->|"distorted image"| DistAngImg
    distanceSubgraph -->|"distorted image"| DistDisImg
    DistAngImg --> Extract
    DistDisImg --> Extract
    Extract --> RecoveredAng
    Extract --> RecoveredDis
    RecoveredAng --> Evaluator
    RecoveredDis --> Evaluator

    %% Click events
    click README "https://github.com/nnyang0918/screen-shooting-watermark/blob/main/README.md"
    click angleSubgraph "https://github.com/nnyang0918/screen-shooting-watermark/tree/main/angle/"
    click distanceSubgraph "https://github.com/nnyang0918/screen-shooting-watermark/tree/main/distance/"

    %% Styles
    classDef core fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef simulation fill:#90EE90,stroke:#333,stroke-width:1px
    classDef data fill:#FFD580,stroke:#333,stroke-width:1px
    classDef sink fill:#FFB347,stroke:#333,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
```
