A digital watermark embedding method for binary images
By defining horizontal and vertical error diffusion filters and multi-scale error diffusion algorithms, the problem of insufficient robustness and universality of binary image watermarking technology in the printing process is solved, and efficient and accurate watermark embedding and extraction is achieved.
Patent Information
- Application Number
- CN202211684816.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-12-27
AI Technical Summary
The existing binary image watermarking technology has problems such as low robustness, insufficient versatility and low watermark capacity in the printing process, especially the differences in different languages and printer algorithms are greatly affected.
Define horizontal and vertical error diffusion filters, embed digital watermark bits into pixel blocks of binary images through multi-scale error diffusion algorithm, and use frequency domain features to binarize them, and combine them with multi-scale error diffusion algorithm for watermark embedding and extraction.
It realizes the synchronous progress of watermark embedding and binarization, improves robustness and versatility, and has high accuracy in watermark extraction, and is suitable for multiple languages and printer environments.
Smart Images

Figure CN115908099B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of digital multimedia anti-counterfeiting, and particularly relates to a method for embedding digital watermark in binary images. Background Art
[0002] Traditional anti-counterfeiting technologies for printed products generally adopt anti-counterfeiting measures using paper, ink, printing, and plate-making, which are costly, require special printing equipment, paper, and ink, cause relatively large environmental pollution, and are difficult to replace anti-counterfeiting marks. Digital watermark technology is an information security technology that hides copyright information as a watermark in digital images and extracts the watermark containing copyright information from digital images when needed. However, most digital watermark technologies are inevitably affected by image binarization during the printing process when hiding copyright information in the spatial domain, frequency domain, or transform domain.
[0003] Currently, existing watermark technologies for target binary images mainly include the following categories:
[0004] Structure fine-tuning method, which only targets text printing and embeds copyright information by adjusting text features such as line, character spacing, text edge, and stroke structure. This method can only target text and shows inconsistent performance for documents in different languages (such as Chinese, English, special characters, etc.), and has low robustness.
[0005] Watermark technology borrowed from grayscale images, which uses spatial domain and transform domain digital watermark embedding algorithms widely used in grayscale digital images and improves the recognition rate and robustness on target binary images by increasing the watermark anti-interference ability during the printing / scanning process. However, due to the inconsistency of printing algorithms used inside different types of printers, the versatility of this method is insufficient.
[0006] Block embedding method, which divides the target binary image into small blocks and modifies the proportion of black and white pixels in each block to meet the needs of copyright information embedding. The main defect of this method is that the watermark capacity is relatively low and the anti-interference ability is weak. Summary of the Invention
[0007] In order to overcome the deficiencies of the above-mentioned prior art, the present invention provides a method for embedding digital watermark in binary images.
[0008] In order to achieve the above object, the present invention provides the following technical solutions:
[0009] A method for embedding digital watermark in binary images, comprising the following steps:
[0010] Define two error diffusion filters with different directions;
[0011] Convert the digital watermark into multiple bits and determine the total number of bits. According to the total number of bits, evenly divide the target binary image into multiple pixel blocks in a certain order;
[0012] Extract the multiple bits in sequence, and select a corresponding error diffusion filter according to the bit extracted each time;
[0013] Embed the extracted bit into the current pixel block by using the selected error diffusion filter and the multi-scale error diffusion algorithm and perform binarization to obtain a binary image with the hidden watermark embedded.
[0014] Preferably, the two error diffusion filters are a horizontal error diffusion filter and a vertical error diffusion filter. The horizontal error diffusion filter DF1 and the vertical error diffusion filter DF2 are respectively:
[0015]
[0016] In the formula, "x" represents the current pixel block being processed.
[0017] Preferably, the method for selecting the corresponding error diffusion filter for the bit extracted each time is:
[0018] If the bit is 0, then select the horizontal error diffusion filter DF1;
[0019] If the bit is not 0, then select the vertical error diffusion filter DF2.
[0020] Preferably, the target binary image is a grayscale image obtained by processing the original image.
[0021] Preferably, the process of embedding the extracted bit into the current pixel block by using the selected error diffusion filter and the multi-scale error diffusion algorithm and performing binarization is:
[0022] (1) Randomly select a point. Randomly select a point among the pixel points in the whole image that have not been binarized, and perform quantization. The quantization formula is:
[0023]
[0024] In the formula, (x, y) represents the coordinates of the randomly selected point, I represents the grayscale image to be processed, G represents the target binary image, and the quantization error generated during the quantization process is:
[0025] err = G(x, y) - I(x, y);
[0026] (2) Error diffusion. According to the region position where the randomly selected point is located, read the corresponding bit to be embedded, and use the multi-scale error diffusion algorithm to embed the bit into the region position where the randomly selected point is located. The calculation formula of the multi-scale error diffusion algorithm is:
[0027] I(x-1:x+1,y-1:y+1) = I(x-1:x+1,y-1:y+1) - err·DF i
[0028] In the formula, DF i is the horizontal error diffusion filter DF1 or the vertical error diffusion filter DF2;
[0029] (4) Repeat the above steps 1-2 until all pixel points in the target binary image are embedded with bits and binarized, and obtain the binary image embedded with the hidden watermark.
[0030] Preferably, the segmentation order of the target binary image is: from top to bottom, from left to right.
[0031] Preferably, it further includes a watermark extraction method, and the watermark extraction method includes the following steps:
[0032] (1) Scan the obtained binary image into a digital image and evenly divide it into multiple tiles;
[0033] (2) Perform a two-dimensional fast Fourier transform on each tile to obtain the amplitude spectrum;
[0034] (3) Extract the eigenvalues in the horizontal and vertical directions in the amplitude spectrum:
[0035]
[0036] In the formula, F H and F V respectively represent the eigenvalues in the horizontal and vertical directions, is the currently processed tile;
[0037] (4) Judge the watermark information bit represented by the currently processed image block;
[0038]
[0039] (5) Loop through steps 1-4 until the watermark information bits of the image are obtained, and perform watermark recombination in the order from top to bottom and from left to right to extract the complete watermark information.
[0040] Preferably, the E H and E V are two optimal feature extraction matrices trained using the gradient descent method.
[0041] The digital watermark embedding method for binary images provided by the present invention has the following beneficial effects:
[0042] By defining two error diffusion filters with different directions, the present invention can flexibly control the frequency domain of each pixel block in the target binary image; by converting the digital watermark into multiple bits, the selected error diffusion filter and the multi-scale error diffusion algorithm can embed the extracted bits into the current pixel block and perform binarization to obtain a binary image with the hidden watermark embedded. The watermark embedding and image binarization are carried out simultaneously, directly converting the target binary image into a printed binary image with hidden watermark information, which is convenient for watermark embedding; since the two steps of watermark embedding and binarization are carried out synchronously in one step, the watermark embedding process will not be affected by the multi-scale error diffusion algorithm, that is, the binarization algorithm, and has good versatility and strong robustness. Description of the Drawings
[0043] In order to more clearly illustrate the embodiments of the present invention and their design schemes, the accompanying drawings required for the present embodiments will be briefly introduced below. The accompanying drawings in the following description are only partial embodiments of the present invention. For those of ordinary skill in the art, other accompanying drawings can be obtained based on these drawings without creative efforts.
[0044] Figure 1 is a flowchart of the digital watermark embedding method for binary images according to the embodiment of the present invention;
[0045] Figure 2 (a) and 2(b) are respectively the spectrograms of the horizontal error diffusion filter and the vertical error diffusion filter;
[0046] Figure 3 is a comparison diagram between the binary image after embedding the watermark and the binary image generated by the error diffusion method commonly used by ordinary printers, Figure 3 (a) is the binary image "hat" with the watermark embedded, Figure 3 (b) is the ordinary binary image "hat"; Figure 3 (c) is the binary image "bicycle" with the watermark embedded, Figure 3 (d) is the ordinary binary image "bicycle";
[0047] Figure 4 is a flowchart of the watermark extraction method. Detailed Embodiments
[0048] In order to enable those skilled in the art to better understand the technical solutions of the present invention and be able to implement them, the present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and cannot be used to limit the protection scope of the present invention.
[0049] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "axial", "radial", "circumferential", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the technical solution of the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the present invention.
[0050] In addition, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present invention, it should be noted that unless otherwise clearly specified or limited, the terms "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. In the description of the present invention, unless otherwise stated, the meaning of "plurality" is two or more, which will not be elaborated here.
[0051] Embodiment
[0052] The present invention provides a method for embedding digital watermark in binary images, specifically as Figures 1-4 shown, including the following steps (as Figure 1 shown):
[0053] Step 1: Define two error diffusion filters with different directions to generate different frequency domains for the target binary image;
[0054] The two error diffusion filters are a horizontal error diffusion filter and a vertical error diffusion filter respectively. The horizontal error diffusion filter DF1 and the vertical error diffusion filter DF2 are respectively:
[0055]
[0056] In the formula, "x" represents the currently processed pixel block. The horizontal error diffusion filter DF1 and the vertical error diffusion filter DF2 perform error diffusion in the horizontal and vertical directions respectively. Therefore, the processed target binary image (the target binary image is the grayscale image obtained by processing the original image) will have obvious frequency domain direction characteristics, as Figure 2 shown.
[0057] Step 2: Convert the digital watermark into multiple bits and determine the total number of bits. According to the total number of bits, evenly divide the target binary image into multiple pixel blocks in a certain order; the segmentation order of the target binary image is from top to bottom and from left to right.
[0058] Step 3: Extract the multiple bits in sequence, and select a corresponding error diffusion filter according to each extracted bit;
[0059] Since the entire digital watermark forms multiple bits, and each bit corresponds to a block of the target binary image, therefore, during the process of generating the binary image, it is necessary to search for a corresponding bit according to the block where the current pixel is located.
[0060] The method for selecting the corresponding error diffusion filter for each extracted bit is as follows:
[0061] If the extracted bit is 0, select the horizontal error diffusion filter DF1;
[0062] If the extracted bit is not 0, select the vertical error diffusion filter DF2;
[0063] A bit is a binary number, which may be 0 or 1. According to this value, an error diffusion filter is selected. Selecting different error diffusion filters will affect the frequency domain characteristics of the finally generated binary image.
[0064] Step 4: Use the selected error diffusion filter and the multi-scale error diffusion algorithm to embed the extracted bit into the current pixel block and perform binarization to obtain a binary image with a hidden watermark embedded.
[0065] The specific process is as follows:
[0066] (1) Randomly select a point. Randomly select a point among the pixels in the entire image that have not been binarized and perform quantization. Quantization means rounding the value of each pixel point of a normal digital image to 1 bit. Therefore, the original value of each pixel is a decimal between 0 and 1 (0 represents pure black, 1 represents pure white), and now it is approximated to an integer that can only be 0 or 1. Such an image is a binary image.
[0067] The quantization formula is:
[0068]
[0069] In the formula, (x, y) represents the coordinates of the randomly selected point, I represents the grayscale image to be processed, G represents the target binary image, and the quantization error generated during the quantization process is:
[0070] err = G(x, y) - I(x, y);
[0071] (2) Error diffusion. According to the regional position of the randomly selected point, read the corresponding bit to be embedded, and use the multi-scale error diffusion algorithm to embed the bit into the regional position where the randomly selected point is located. The calculation formula of the multi-scale error diffusion algorithm is:
[0072] I(x - 1:x + 1, y - 1:y + 1) = I(x - 1:x + 1, y - 1:y + 1) - err·DF i
[0073] In the formula, DF i is the horizontal error diffusion filter DF1 or the vertical error diffusion filter DF2;
[0074] Figure 3 (a) and (c) are binary images embedded with watermarks, Figure 3 (b) and (d) are binary images without embedded watermarks. Visually, the two are quite similar.
[0075] (5) Repeat the above steps 1 - 2 until all pixel points in the target binary image are embedded with bits and binarized, obtaining a binary image with the hidden watermark embedded.
[0076] In this embodiment, a watermark extraction method is also included. The watermark extraction is based on the different frequency domain characteristics of different blocks in the binary image due to the use of different error diffusion filters to identify whether the watermark information bit represented by each block is 0 or 1, and finally complete all watermark extractions. The main steps are as follows: (as Figure 4 shown)
[0077] (1) Scan the obtained binary image into a digital image and evenly divide it into multiple tiles;
[0078] (2) Perform a two-dimensional fast Fourier transform on each tile to obtain the amplitude spectrum;
[0079] (3) Extract the eigenvalue in the horizontal and vertical directions from the amplitude spectrum:
[0080]
[0081] In the formula, F H and F V respectively represent the eigenvalues in the horizontal and vertical directions, is the currently processed tile;
[0082] The above E H and E V are two optimal feature extraction matrices trained by the gradient descent method, and their optimized values are shown in Table 1 and Table 2 respectively.
[0083] Table 1 FH Optimized value
[0084]
[0085] Table 2 Optimized Fv values
[0086]
[0087] (4) Determine the watermark information bit represented by the currently processed image block;
[0088]
[0089] (6) Loop through steps 1 - 4 until the watermark information bits of the image are obtained, and perform watermark recombination in the order from top to bottom and from left to right to extract the complete watermark information. Table 3 shows the comparison of the results of extracting the same watermark from different images. As can be seen from the table, the accuracy of watermark extraction is very high.
[0090] Table 3 shows the comparison of the results of extracting the same watermark from different images
[0091] 1 1 1 1 1 Original watermarked image Watermark extraction 1 Watermark extraction 2 Watermark extraction 3 Watermark extraction 4
[0092] Example 2:
[0093] The present invention shows the comparison of objective indicators of some from the Kodak test image set, as shown in Table 4. From the objective data, the peak signal-to-noise ratio (PSNR) of the binary image with embedded watermark and the ordinary binary image is not much different, while the H-PSNR has a small decrease, which is caused by the blockiness resulting from "embedding" the watermark in partitions. However, generally speaking, the values of H-PSNR are relatively high, which proves that at the normal viewing distance (20 inches) and printing resolution (DPI set to 300 or 600), the visual effect of the binary image with embedded watermark is still relatively satisfactory. The correct rate of watermark extraction almost reaches over 95%, indicating that the extraction effect is also relatively good.
[0094] Table 4 Comparison of objective indicators of some from the Kodak test image set
[0095]
[0096] The above-described embodiments are only preferred specific embodiments of the present invention, and the protection scope of the present invention is not limited thereto. Any simple changes or equivalent replacements of the technical solutions that can be obviously obtained by those skilled in the art within the technical scope disclosed by the present invention all belong to the protection scope of the present invention.
Claims
1. A digital watermark embedding method for binary images, characterized in that, It includes the following steps: Define two error diffusion filters with different directions; Convert the digital watermark into multiple bits and determine the total number of bits. According to the total number of bits, evenly divide the target binary image into multiple pixel blocks in a certain order; Successively extract multiple said bits, and select a corresponding error diffusion filter according to the bit extracted each time; Use the selected error diffusion filter and the multi-scale error diffusion algorithm to embed the extracted bit into the current pixel block and perform binarization to obtain a binarized image with the hidden watermark embedded; The process of using the selected error diffusion filter and the multi-scale error diffusion algorithm to embed the extracted bit into the current pixel block and perform binarization is as follows: (1) Randomly select a point. Randomly select a point among the pixel points in the entire image that have not been binarized, and perform quantization. The quantization formula is: In the formula, ( x,y ) represents the coordinates of randomly selected points, I represents the grayscale image to be processed, G represents the target binary image, and the quantization error generated during the quantization process is: (2) Error diffusion. According to the regional position where the randomly selected point is located, read the corresponding bit to be embedded, and use the multi-scale error diffusion algorithm to embed the bit into the regional position where the randomly selected point is located; The calculation formula of the multi-scale error diffusion algorithm is: In the formula, is a horizontal error diffusion filter DF 1 or a vertical error diffusion filter DF 2; (3) Repeat the above steps 1-2 until all pixel points in the target binary image are embedded with bits and binarization is completed, obtaining a binarized image with the hidden watermark embedded.
2. The digital watermark embedding method for binary images according to claim 1, wherein The two error diffusion filters are a horizontal error diffusion filter DF 1 and a vertical error diffusion filter DF 2. The horizontal error diffusion filter DF 1 and the vertical error diffusion filter DF 2 are respectively: , In the formula, " x " represents the pixel block being currently processed.
3. The digital watermark embedding method for binary images according to claim 2, characterized in that, The method for selecting the corresponding error diffusion filter for the bit extracted each time is: If the bit is 0, then select the horizontal error diffusion filter DF 1; If the bit is not 0, a vertical error diffusion filter is selected DF 2 4. The digital watermark embedding method for binary images according to claim 1, characterized in that The target binary image is a grayscale image obtained by processing the original image.
5. The digital watermark embedding method for binary images according to claim 1, wherein The segmentation order of the target binary image is: from top to bottom, from left to right.
6. The digital watermark embedding method for binary images according to claim 1, characterized in that, It also includes watermark extraction from the binarized image with the hidden watermark embedded. The watermark extraction method includes the following steps: (1) Scan the obtained binarized image into a digital image and evenly divide it into multiple tiles; (2) Perform a two-dimensional fast Fourier transform on each said tile to obtain an amplitude spectrum; (3) Extract the eigenvalue in the horizontal and vertical directions in the amplitude spectrum: , In the formula, and respectively represent the eigenvalue in the horizontal and vertical directions, is the currently processed tile; the and are two optimal feature extraction matrices obtained by training using the gradient descent method; (4) Determine the watermark information bit represented by the current processed image block; (5) Loop through steps 1-4 until the watermark information bit of the image is obtained, and perform watermark recombination in the order from top to bottom and from left to right to extract the complete watermark information.
Citation Information
Patent Citations
Novel method of digital watermarking for protecting literary property of presswork
CN101039371A
Image media security authentication recovery method based on secret sharing
CN110390623A