|
Algorithm 2 Extraction algorithm |
|
Input: Original watermarked PDF file and watermarked PDF file |
|
Output: Extracted watermark sequence |
-
1:
Convert the original PDF file and the watermarked PDF file into a series of images, and perform subsequent operations on each original image and the watermarked image . Map the image and to be detected from RGB space to YCbCr space, decompose the components, mark it as and , and convert them into binary text images and .
-
2:
for each original image and corresponding watermarked image do
-
3:
Obtain the set of sub-blocks , and , where P is the number of rows.
-
4:
for each do
-
5:
Adjust its corresponding to ensure that the pixels of and correspond one by one.
-
6:
Calculate the number of black pixels in each row of , find the row with the highest number of black pixels, and mark it as .
-
7:
for each column in L do
-
8:
Find the white pixel closest to , and mark it as .
-
9:
Extract pixel from the watermarked image .
-
10:
Calculate the difference .
-
11:
end for
-
12:
Obtain sets .
-
13:
Extract watermark bit according to the number of positive and negative numbers in .
-
14:
end for
-
15:
Extract all watermark bits and obtain the watermark string (length N) extracted from the current image.
-
16:
end for
-
17:
Overlay and average all extracted watermark strings to obtain the final extracted watermarks .
|