How jiemojiemo/cpp_blind_watermark works
Project Type and Purpose
• This is a C/C++ library and demo application that implements the Blind Watermark algorithm.
• It provides a core algorithm module, several utility modules, a command‑line/demo executable, and a suite of unit tests.
• Build and dependency management are handled by Conan and CMake.
Main Components
a. Demo Application (Executable)
• main.cpp: entry point that parses inputs, invokes watermarking routines, and displays/saves results.
b. Core Library
• i_blind_watermark_core.h: abstract interface for watermark operations.
• blind_watermark_core0.h: concrete implementation of the blind watermark algorithm.
c. Utility Modules
• base64codec_utils.h / .cpp: Base64 encoding/decoding of watermark payloads.
• binary_utils.h / .cpp: Bit‑level operations for payload embedding/extraction.
• dtw2_utils.h / .cpp: Dynamic Time Warping utilities if used in the algorithm pipeline.
d. Third‑Party Libraries
• 3rdparty/wavelib: wavelet transform routines referenced by the core algorithm.
• External deps (via Conan): OpenCV 4.x for image/video I/O and processing; base64/0.5.1, etc.
e. Test Suite
• tests/*: GoogleTest‑based unit tests for each utility and the core algorithm.
f. Build System
• conanfile.txt: dependency declarations.
• CMakeLists.txt + 3rdparty/CMakeLists.txt: build scripts.
Component Relationships & Data Flow
• The Demo Application calls the Core Library API.
• The Core Library orchestrates:
· wavelet transforms (wavelib)
· bit manipulation (binary_utils)
· Base64 encoding/decoding (base64codec_utils)
· DTW computations (dtw2_utils)
• External libraries (OpenCV, base64) are linked at build time via Conan/CMake.
• The Test Suite links against the Core and Utility modules to verify correctness.
Architectural Patterns & Design Principles
• Modular monolith: clear separation between interface (i_blind_watermark_core) and implementation.
• Layered organization: Demo → Core → Utilities → Third‑party.
• Dependency injection: Core interface allows swapping algorithm versions.
• Unit‑testable design: small, focused modules with GoogleTest harnesses.