RunwenHu / CLRW

MIT License
4 stars 2 forks source link

CLRW

Author:

Runwen Hu and Shijun Xiang

School of Information Science and Technology, Jinan University Guangzhou, China

Description:

This version can only support 8-bit grayscale images in BMP format with a size of 512 * 512. The working environment is Windows 10 and MATLAB 2019a. The work is based on the paper:

R. Hu and S. Xiang, "Cover-Lossless Robust Image Watermarking Against Geometric Deformations," in IEEE Transactions on Image Processing, doi: 10.1109/TIP.2020.3036727.

Folder description :

"standard_test_images" : This folder contains four standard images used in this paper.

"watermark" : This folder contains the file used to store the robust watermark information, whose name is "watermark.txt". After using the program "clrw_extract_and_recover.exe" or "clrw_extract_after_attack.exe ", the extracted watermark will appear in this folder with the name "extracted_watermark.txt".

"watermarked_images" : This folder is used to store the generated final watermarked images.

"recovered_images" : This folder is used to store the recovered images.

"attacked_images" : This folder is used to store the attacked images.

Usage:

(1) Embed the robust watermark information into one image

usage:

.\clrw_embed.exe [order] [step] [threshold] [watermark] [cover image]

order : The maximum order of Zernike moments step : The quantization step of the proposed robust watermarking method, whose recommended value is 18. threshold : The threshold used in robust watermarking, whose recommended value is 1000. watermark : The robust watermark information of binary bit sequence, whose length is corresponding to the [order]. The watermark information is written in the "watemark\watermark.txt" file. cover image : The original image used to embed the watermark information.

After using this program, the final watermark image will appear in the "watermarked_images" file in the root directory.

Example:

.\clrw_embed.exe 31 18 1000 .\watermark\watermark.txt .\standard_test_images\lena.bmp

(2) Extract the robust watermark information and recover the original image

usage:

.\clrw_extract_and_recover.exe [extracted watermark] [final watermarked image]

extracted watermark : The TXT document used to store the extracted robust watermark information. final watermarked image : The final watermarked image after program (1).

After using this program, the recovered image will appear in the "recovered_images" file in the root directory. The extracted watermark information will appear in the [extracted watermark] file.

Example:

.\clrw_extract_and_recover.exe .\watermark\extracted_watermark.txt .\watermarked_images\embedded_lena.bmp

(3) Extract the robust watermark information after the watermarked image was attacked

Note :

The geometric attacks that this version of code can resist are: A. the rotated images have to be cropped to the size of the original images (i.e., the attribute "bbox" of MATLAB function "imrotate" is "crop"); B. the scaled images could not need to scale back to the size of the original images; C. other types of attacks can be found in Fig. 10 of this paper.

usage:

.\clrw_extract_after_attack [order] [step] [threshold] [length of watermark] [extracted watermark] [attacked imge]

order : The maximum order of Zernike moments step : The quantization step of the proposed robust watermarking method, whose recommended value is 18. threshold : The threshold used in robust watermarking, whose recommended value is 1000. length of watermark : The length of the robust watermark information. Must be told to the program. extracted watermark : The TXT document used to store the extracted robust watermark information. attacked image : The attacked version of the final watermarked image generated by the program (1).

Example:

.\clrw_extract_after_attack 31 18 1000 128 .\watermark\extracted_watermark.txt .\attacked_images\attacked_lena.bmp

For this version of the code, the rotated images must be cropped to the original size.