https://github.com/kar-dim/watermarking-cpu
Code for my Diploma thesis at Information and Communication Systems Engineering (University of the Aegean, School of Engineering) with title "Efficient implementation of watermark and watermark detection algorithms for image and video using the graphics processing unit". Part 1 / CPU
https://github.com/kar-dim/watermarking-cpu
clang cpp eigen openmp parallel-computing watermark-image watermarking
Last synced: 8 months ago
JSON representation
Code for my Diploma thesis at Information and Communication Systems Engineering (University of the Aegean, School of Engineering) with title "Efficient implementation of watermark and watermark detection algorithms for image and video using the graphics processing unit". Part 1 / CPU
- Host: GitHub
- URL: https://github.com/kar-dim/watermarking-cpu
- Owner: kar-dim
- Created: 2023-03-23T19:43:16.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-18T17:47:09.000Z (12 months ago)
- Last Synced: 2024-10-19T14:06:11.324Z (12 months ago)
- Topics: clang, cpp, eigen, openmp, parallel-computing, watermark-image, watermarking
- Language: C++
- Homepage:
- Size: 53.7 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ICSD thesis Part 1 / CPU Watermarking

Code for my Diploma thesis at Information and Communication Systems Engineering (University of the Aegean, School of Engineering) with title "Efficient implementation of watermark and watermark detection algorithms for image and video using the graphics processing unit". [Link](https://hellanicus.lib.aegean.gr/handle/11610/19672)
# Overview
The aim of this project is to compare the performance (primarily execution speed) of watermarking algorithms when implemented on CPU versus GPU. This repository focuses on the CPU implementation (Part 1). The GPU implementation can be found in the corresponding GPU repository (Part 2 / GPU usage [here](https://github.com/kar-dim/Watermarking-GPU) ).
**NOTE**: This repository features a refactored and optimized version of the original implementation, with improved algorithms and execution times.
# Key Features
- Implementation of watermark embedding and detection algorithms for images.
- Comparative performance analysis between CPU and GPU implementations.# Run the pre-build binaries
- Get the latest binaries [here](https://github.com/kar-dim/Watermarking-CPU/releases). The binary contains the sample application which embeds and detects watermarks for the provided images. Before we can emded the watermark, we have to create it first.
- This implementation is based on Normal-distributed random values with zero mean and standard deviation of one. The ```CommonRandomMatrix``` produces pseudo-random values. A bat file is included to generate the watermarks, with sizes exactly the same as the provided sample images. Of course, one can generate a random watermark for any desired image size like this:
```CommonRandomMatrix.exe [rows] [cols] [seed] [fileName]``` .Then pass the provided watermark file path in the sample project configuration.The sample application:
- Embeds the watermark using the NVF and the proposed Prediction-Error mask.
- Detects the watermark using the proposed Prediction-Error based detector.
- Prints FPS for both operations, and both masks.
Needs to be parameterized from the corresponding ```settings.ini``` file. Here is a detailed explanation for each parameter:| Parameter | Description |
|-----------------------------------|----------------------------------------------------------------------------------------------------------------------------- |
| image | Path to the input image. |
| w_path | Path to the Random Matrix (watermark). This is produced by the CommonRandomMatrix project. Watermark and Image sizes should match exactly. |
| save_watermarked_files_to_disk | \[true/false\]: Set to true to save the watermarked NVF and Prediction-Error files to disk. |
| execution_time_in_fps | \[true/false\]: Set to true to display execution times in FPS. Else, it will display execution time in seconds. |
| p | Window size for masking algorithms. Currently only ```p=3``` is allowed. |
| psnr | PSNR (Peak Signal-to-Noise Ratio). Higher values correspond to less watermark in the image, reducing noise, but making detection harder. |
| threads | Maximum number of threads. Set to 0 to automatically find the maximum concurrent threads supported, or set them manually here. |
| loops_for_test | Loops the algorithms many times, simulating more work. A value of 1000 produces almost identical execution times. |# Libraries Used
- [Eigen](https://eigen.tuxfamily.org/index.php?title=Main_Page): A C++ template library for linear algebra.
- [CImg](https://cimg.eu/): A C++ library for image processing.
- [inih](https://github.com/jtilly/inih): A lightweight C++ library for parsing .ini configuration files.# Additional Dependencies
LibPNG and LibJPEG are also included, and are used internally by CImg for loading and saving of images.