Reversible watermarking method based on reblocking and prediction error expansion of ipvo
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAIYIN INSTITUTE OF TECHNOLOGY
- Filing Date
- 2026-04-02
- Publication Date
- 2026-07-14
AI Technical Summary
Existing reversible image watermarking algorithms, while improving the watermark embedding capacity, struggle to maintain good imperceptibility of the carrier image, and their embedding performance is easily affected by the correlation between adjacent pixels within a block.
The original image is divided into 4×5 non-overlapping blocks, and each block is further subdivided into 4 sub-blocks. The median pixel is selected as the prediction pixel by sorting in ascending order. The prediction error value is calculated, and watermark information is embedded in the prediction error. Redundancy space is constructed by sorting the pixel values to improve the distribution of the prediction error value.
It significantly improves the watermark embedding capacity, and while maintaining the visual quality of the image, ensures the imperceptibility and reversibility of the image, and increases the number and distribution concentration of prediction error values.
Smart Images

Figure CN122390942A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of information hiding and digital watermarking technology, specifically to a reversible watermarking method based on prediction error expansion using re-blocking and IPVO. Background Technology
[0002] With the rapid development of digital image processing and multimedia communication technologies, digital image storage and privacy protection have become urgent issues. Reversible watermarking algorithms, as a key technology in information security, achieve the covert embedding of secret data into a carrier image by making slight and imperceptible modifications to the pixels of the carrier image. Its core advantage lies in the fact that the receiver can extract the secret data losslessly from the carrier image with embedded watermark information, and thus recover all pixel information of the carrier image without loss. It has been widely used in special fields such as military, medical, and transportation, completely solving the problem of irreversible carrier distortion in traditional watermarking algorithms.
[0003] By embedding secret information using the prediction error values of extended pixels, the Prediction Error Expansion (PEE) algorithm better utilizes the correlation between pixels compared to traditional difference expansion methods, thus improving the embedding capacity and becoming a mainstream research direction in the field of reversible information hiding. Building upon this, the Improved Pixel-Value Ordering (IPVO) algorithm further introduces pixel spatial location information. By considering the original positional relationship between the largest (smallest) and second-largest (smallest) pixel values, it optimizes the prediction error generation mechanism. Pixel blocks with errors of 0 and 1 are used to embed secret information, effectively reducing the number of invalid error points and concentrating the prediction error more around zero, significantly improving the embedding capacity. The Pixel-Value Ordering algorithm, after dividing the image into blocks and sorting the pixels, selects the three largest and smallest pixels for data embedding, achieving 0.5 bits of watermark information embedded per pixel, thus improving the embedding capacity. The median prediction four-round embedding strategy, by mining the texture features of image pixels and embedding according to pixel complexity, effectively reduces the number of invalid pixel shifts. The reversible data hiding algorithm based on pixel value sorting and block re-division improves the embedding capacity by subdividing image blocks and using pixel sorting techniques to embed data using prediction errors.
[0004] The core challenge facing current reversible image watermarking algorithms is maximizing embedding capacity with minimal image distortion. However, in existing algorithms, embedding performance is easily affected by the correlation between adjacent pixels within a block. Higher pixel correlation results in smaller prediction errors, allowing for a greater number of pixels that can be used for embedding. Maintaining good imperceptibility of the watermarked image while improving watermark embedding capacity remains a critical technical challenge that requires further research. Summary of the Invention
[0005] Purpose of the invention: To address the problems existing in the prior art, this invention provides a reversible watermarking method based on re-blocking and IPVO prediction error expansion. First, the original image block is divided into 4 non-overlapping sub-blocks. Then, each sub-block is sorted in ascending order and the median pixel is selected as the prediction pixel. The prediction error value is constructed by calculating the difference between the original value and the predicted value of the remaining pixels. Finally, the watermark information is embedded into the prediction error.
[0006] Technical solution: This invention provides a reversible watermarking method based on prediction error expansion using re-blocking and IPVO, including a watermark embedding process, as follows:
[0007] Step 1: Given an M×N 8-bit grayscale image , to image All pixels except the last column are divided into non-overlapping 4×5 blocks in a top-to-bottom, left-to-right order. , where N is the total number of blocks, and i and j represent the x and y coordinates of the pixel in the image, respectively;
[0008] Step 2: Process the blocks obtained in Step 1 The blocks are further divided into four sub-blocks. ;
[0009] Step 3: Process the sub-blocks obtained in Step 2 The pixels within the block are sorted in ascending order to obtain the median pixel value of the corresponding sub-block, and then four prediction error values for the corresponding sub-block are calculated. , ;
[0010] Step 4: Calculate the prediction error The prediction error is obtained by extending or shifting the data to embed watermark information. Modify the pixel values to the left and right of the median within the sorted sub-block to complete the sub-block. Watermark embedding;
[0011] Step 5: For sub-blocks Repeat steps 3 and 4 above to embed the watermark; this completes the block segmentation. Watermark information embedding; once all watermark information has been embedded, record the last image block with the embedded watermark. .
[0012] Furthermore, in the segmentation When embedding a watermark with pixels containing values of 255 or 0, the blocks containing these pixels are marked as... Otherwise, mark as ;for The blocks are not processed; for each Blocks After embedding the watermark, the image location map is finally created. Compress into a length of The bitstream string is embedded as auxiliary information; the auxiliary information is embedded into the least significant bit (LSB) of the last column of pixels in the image, where the auxiliary information is a compressed location map. Block size and embedding end position Replace the last LSB in the image with auxiliary information, and compress the replaced LSB into a bitstream. Finally, it is embedded into the remaining area of the image according to the embedding method described in steps 2 to 5, that is... Generate watermarked images .
[0013] Furthermore, the specific operation of further dividing the material into blocks in step 2 is as follows:
[0014] In step 1, the original image is divided into 4×5 non-overlapping blocks. In step 2, each block's 20 pixels are further divided into 4 sub-blocks, with x representing the number of pixels from top to bottom and from left to right. 1~ x 20 Each sub-block contains 5 pixel values, designated as sub-block A, sub-block B, sub-block C, and sub-block D. Sub-block A contains pixels x1, x2, x3, x6, and x7; sub-block B contains pixels x4, x5, x8, x9, and x1. 10 Sub-block C pixels include x 11 x 12 x 13 x 16 x 17 Sub-block D pixels include x 14 x 15 x 18 x 19 x 20 During embedding, the sub-blocks are embedded sequentially in the order of sub-block A → sub-block B → sub-block C → sub-block D.
[0015] Furthermore, step 3 specifically includes:
[0016] Define a sub-block containing 5 pixels. Then sort the gray values in sub-block A in ascending order to obtain ,in, , That is, the median pixel of the sub-block, if And w < r, then ;
[0017] The remaining 4 pixels within the sub-block The prediction process generates a maximum of four prediction errors that can be used to embed watermark information. The prediction error is then calculated. As shown in equation (1):
[0018] (1);
[0019] in: Use the fixed index value corresponding to each pixel in the sub-block. As a subscript to the prediction error value, when hour, , This involves comparing the index values of the first two pixels in the sub-block after ascending sorting, as well as the index value of the median pixel, and calculating the difference between the pixel value with the smaller index value and the pixel value with the larger index value; when hour, , This involves comparing the index values of the last two pixels in the sub-block after ascending sorting with the index value of the median pixel, calculating the difference between the pixel value with the smaller index value and the pixel value with the larger index value, and thus obtaining the original prediction error of the watermark information to be embedded.
[0020] Furthermore, in step 4, the modified prediction error is obtained. The specific operation is as follows:
[0021] use and To embed watermark information, when Embed the watermark in the negative direction of the zero value point. When the value is 1, the watermark is embedded in the positive direction of the point; otherwise, it is shifted. The specific embedding expression is as follows:
[0022] (2);
[0023] in, This is the revised prediction error. This is the embedded binary watermark information.
[0024] Furthermore, in step 5, the pixel values to the left and right of the median within the sorted sub-block are modified to complete the sub-block. Watermark embedding specifically includes:
[0025] set up These are the original pixels to the left and right of the median pixel after sorting sub-block A in ascending order. These are the pixels after the watermark information is embedded in the original pixels;
[0026] when At that time, the pixels to the left of the median pixel Modified to The calculation formula is as follows:
[0027] (3);
[0028] in: ;
[0029] when At that time, the pixel to the right of the median pixel Modified to The calculation formula is as follows:
[0030] (4);
[0031] in: .
[0032] Furthermore, it also includes the watermark extraction process, specifically:
[0033] S1: First, scan the LSB bits of the last column of pixels in the watermark image to extract the bitstream. Block size and end position And decompress it to get the location map;
[0034] S2: Based on the block size and location map, divide all pixels of the watermark image except the last column into non-overlapping 4×5 blocks in the order from top to bottom and from left to right as described in step 1, and then divide the location map... Image blocks Following step 2, further subdivide the blocks to obtain 4 sub-blocks. ;
[0035] S3: Sub-blocks obtained by sorting S2 in ascending order The pixels are calculated, and the median predicted pixels of the corresponding sub-blocks are obtained. Then, the modified prediction error value is calculated. Extract sub-blocks Watermark information and compressed bitstream ;
[0036] S4: Process the sub-blocks sequentially To extract watermark information, the pixel values to the left and right of the median value within each sorted sub-block are... Restore to This completes the image block. Extraction of watermark information;
[0037] S5: Using the watermark information extracted from S4, restore the watermark block to the original block. Then, unzip. The LSB bits of the last column of pixels are replaced, and finally the entire original image is recovered. .
[0038] Furthermore, in step S3, sub-blocks are extracted. The specific steps for handling watermark information are as follows:
[0039] First, sort the pixels within the block in ascending order to obtain the sequence. , The median pixel value after the watermark is embedded in the sub-block, and the sequence of pixels in the watermark block after being arranged in ascending order is the same as the sequence of pixels in the original block.
[0040] The proposed median pixel For each predicted pixel within a sub-block, the prediction error after embedding the watermark is calculated. The embedded watermark information b is extracted, and its calculation formula is as follows:
[0041] (5).
[0042] Furthermore, in S4, the pixel values to the left and right of the median within each sorted sub-block are... Restore to Specifically:
[0043] when When, the left side of the median value Restore to the original pixel values of the sub-block The specific expression is as follows:
[0044] (6);
[0045] in: ;
[0046] when When, the right side of the median value Restore to the original pixel values of the sub-block The specific expression is as follows:
[0047] (7);
[0048] in: , These are the original pixels to the left and right of the median pixel after the sub-blocks are sorted in ascending order. These are the pixels after the watermark information is embedded in the original pixels.
[0049] Beneficial effects:
[0050] 1. The reversible image watermarking method of this invention first divides the original image into 4×5 non-overlapping blocks, and then subdivides each block into 4 sub-blocks. This invention ensures that pixels within sub-blocks are interconnected during block division, resulting in a more concentrated distribution of prediction errors. By fully utilizing the correlation between pixels within blocks, a maximum of 4 prediction errors that can be used to embed watermark information are generated within a sub-block containing 5 pixels. Therefore, a maximum of 16 bits of watermark information can be embedded in a 4×5 block. Compared with traditional PVO and IPVO algorithms, this significantly improves the embedding capacity within the same block size.
[0051] 2. This invention sorts the pixels of each sub-block in ascending order, determines the median pixel as the prediction benchmark, and predicts the remaining pixels to obtain four prediction error values. Directly using the median pixel for prediction is susceptible to the influence of local pixel distribution. This invention constructs a larger redundancy space through a pixel value sorting method, and effectively reduces invalid shifted pixels while keeping the total number of image pixels fixed, thus improving the visual quality of the image after watermark embedding. Within each sub-block, four new prediction error values are constructed by comparing the median pixel index with other pixel indices, increasing the number of prediction error values while ensuring the algorithm's reversibility.
[0052] 3. This invention employs an improved pixel value sorting algorithm to perform difference expansion on pixels with prediction error values of 0 and 1 to embed the watermark. Taking the pixel to the right of the median as an example, compared to the PVO algorithm, the new prediction error value range is expanded from non-negative integers to... This invention selects pixels with prediction errors of 0 and 1 to embed data, which greatly improves the embedding capacity. Attached Figure Description
[0053] Figure 1 This is the watermark embedding process of the present invention;
[0054] Figure 2 This is the watermark extraction process of the present invention;
[0055] Figure 3 This is a schematic diagram of the image segmentation method of the present invention;
[0056] Figure 4 This is the pixel block division mode of the present invention;
[0057] Figure 5 This is a sub-block embedding process of the present invention;
[0058] Figure 6 These are test images from embodiments of the present invention;
[0059] Figure 7 A comparison chart of PSNR for different algorithms of this invention;
[0060] Figure 8This invention provides a comparison of image watermark embedding and image restoration before and after, according to an embodiment of the invention.
[0061] Figure 9 The PSNR values of Peppers, Airplane, Boat, and Lake images under different embedding capacities are shown in the embodiments of the present invention.
[0062] Figure 10 This is a comparison of the maximum embedding capacity of different algorithms in this invention. Detailed Implementation
[0063] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0064] The technical solution of this invention mainly includes two parts: watermark embedding and watermark extraction. See [link to relevant documentation]. Figure 1 and Figure 2 :
[0065] I. The specific embedding process is as follows:
[0066] Step 1: Given an M×N 8-bit grayscale image , to image Except for the last column, all pixels are divided into non-overlapping 4×5 blocks in a top-to-bottom, left-to-right order. , where N is the total number of blocks.
[0067] To increase the amount of watermark information embedded, this invention divides the image into two parts, such as... Figure 3 As shown, watermarks are embedded into non-overlapping blocks in a top-to-bottom, left-to-right order, and then the auxiliary information of the image is stored in the last column of pixels.
[0068] For an image of size M×N The test image used in this invention is 512×512 pixels, divided into 4×5 non-overlapping blocks. The row-oriented blocks achieve perfect divisibility, while the column-oriented blocks cannot perfectly match, resulting in two empty columns of pixels at the end. Therefore, in the image... In the middle, only those who meet the requirements and The pixels can be used for block segmentation and watermark information embedding, where i and j represent the horizontal and vertical coordinates of the pixel in the image, respectively. After image preprocessing, pixels that meet the conditions can be fully utilized for watermark information embedding and extraction, thereby improving the watermark embedding capacity.
[0069] Step 2: Process the blocks obtained in Step 1 The blocks are further divided into four sub-blocks. .
[0070] Since pixel correlation is negatively correlated with prediction error, to improve watermark embedding capacity, this invention should ensure that pixels within sub-blocks are connected to each other during block segmentation, making the prediction error distribution more concentrated. For example... Figure 4 The block partitioning pattern shown divides the original image into 4×5 non-overlapping blocks. Each block's 20 pixels are further divided into four sub-blocks, each containing five pixel values: sub-block A, sub-block B, sub-block C, and sub-block D. This fully utilizes the correlation between pixels within each block. To ensure the algorithm's reversibility, the embedding is performed sequentially in the order of sub-block A → sub-block B → sub-block C → sub-block D.
[0071] Step 3: Process the sub-blocks obtained in Step 2 The pixels within the block are sorted in ascending order to obtain the median pixel value of the corresponding sub-block. Then, four prediction error values for the corresponding sub-block are calculated. .
[0072] During the watermark embedding process, the watermark is read line by line in a left-to-right, top-to-bottom order. Figure 4 The pixels of sub-blocks ABCD are recorded sequentially using fixed index values 1-20, ensuring that the index of each pixel value in the 4×5 block is unique. This provides reversibility for subsequent watermark extraction operations, thereby ensuring the consistency and accuracy of the watermark information embedding and extraction process.
[0073] Because the sub-blocks are similar and the embedding method is the same for each sub-block, we will take sub-block A as an example to describe the watermark embedding process in detail. First, we read the pixels of sub-block A line by line to obtain the sequence of sub-block A as follows: ,like Figure 5 As shown, sub-block A is sequentially marked with fixed index values [1,5], and then sorted in ascending order to obtain... ,in It is a double-shot, making .if And w < r, then And calculate the prediction error. As shown in equation (1):
[0074] (1)
[0075] in: We use a fixed index value corresponding to each pixel in the sub-block. The purpose of using the subscript for the prediction error value is to distinguish the original prediction error value generated within the entire 4×5 block, thereby ensuring the reversibility of the algorithm of this invention. When hour, , This involves comparing the index values of the first two pixels in the sub-block after ascending sorting, as well as the index value of the median pixel, and calculating the difference between the pixel value with the smaller index value and the pixel value with the larger index value; when hour, , This involves comparing the index values of the last two pixels in the sub-block after ascending sorting with the index value of the median pixel, calculating the difference between the pixel value with the smaller index value and the pixel value with the larger index value, and thus obtaining the original prediction error of the watermark information to be embedded.
[0076] For the pixels in sub-block A after ascending sorting, we calculated the pixel values excluding the median pixel value according to equation (1). The other four prediction error values , respectively corresponding to the sorted pixels ,in .
[0077] Step 4: Calculate the prediction error The prediction error is obtained by extending or shifting the data to embed watermark information. Modify the pixel values to the left and right of the median within the sorted sub-block to complete the sub-block. Watermark embedding.
[0078] We utilize and To embed watermark information, and to ensure the reversibility of watermark extraction, when... Embed the watermark in the negative direction of the zero value point. When the value is 1, the watermark is embedded in the positive direction of the point; otherwise, it is shifted. The specific embedding expression is as follows:
[0079] (2)
[0080] in This is the revised prediction error. This is the embedded binary watermark information.
[0081] set up These are the original pixels to the left and right of the median pixel after sorting sub-block A in ascending order. These are the pixels after the watermark information is embedded in the original pixels mentioned above. Equation (2) is used to assess the prediction error. After embedding the watermark information b, the modified prediction error is calculated. .when At that time, the pixels to the left of the median pixel Modified to The calculation formula is as follows:
[0082] (3)
[0083] in: .
[0084] when At that time, the pixel to the right of the median pixel Equation (4) is modified to The calculation formula is as follows:
[0085] (4)
[0086] in: .
[0087] At this point, all the watermark information embedded in sub-block A has been completed.
[0088] Step 5: Since the watermark embedding process for sub-blocks B, C, and D is exactly the same as that for sub-block A, this process can be directly reused for the sub-blocks. Repeat steps 3 and 4 above to embed the watermark; this completes the block segmentation. Watermark information embedding. This step stops once all watermark information has been embedded, and the last image block with the embedded watermark is recorded as... .
[0089] Step 6: Due to the use of equations (3) and (4) for block division When embedding watermarks containing pixels with values of 255 or 0, there is a possibility of pixel value overflow and underflow. Therefore, blocks containing these pixels are marked as... Otherwise, mark as .for The blocks are not processed; for each Blocks Follow steps 2 through 5 to embed the watermark. Finally, map the image's location. Compress into a length of The bitstream string is used as an auxiliary information embedding.
[0090] Step 7: To achieve reversible recovery, auxiliary information is embedded into the least significant bit (LSB) of the last column of pixels in the image, where the auxiliary information is a compressed location map. Block size and embedding end position Use this information to replace the LSB in the last column of the image, and then compress the replaced LSB into a bitstream. Finally, it is embedded into the remaining area of the image according to the embedding method described in steps 2-5, that is... Generate watermarked images .
[0091] II. The specific extraction process is as follows:
[0092] To achieve accurate extraction of watermark information and lossless restoration of the original image from the watermarked image, we adopt a reverse operation process that is completely symmetrical to the watermark embedding stage. The specific extraction algorithm is as follows:
[0093] S1: Before watermark extraction, first scan the LSB bits of the last column of pixels in the watermark image and extract them. Block size and end position The location map was then extracted and obtained. The end location is shown below. The preceding block This is a block containing embedded watermark information, ending at... The following block is a block that embeds the last LSB of the original image.
[0094] S2: Based on the block size and location map extracted in S1, divide all pixels of the watermark image except the last column into non-overlapping 4×5 blocks in order from top to bottom and from left to right, and then divide the location map... Image blocks The same method as in step 2 above is used to further divide the blocks into 4 sub-blocks. .
[0095] S3: Sub-blocks obtained by sorting S2 in ascending order The pixels are then used to obtain the median predicted pixels of the corresponding sub-blocks according to the method in step 3, and the modified prediction error value is then calculated. Extract sub-blocks using equation (5) Watermark information and compressed bitstream .
[0096] During the watermark extraction process, for watermark block A, the sequence obtained by first sorting the pixels within the block in ascending order is as follows: , The median pixel value after embedding the watermark within the sub-block is known. That is, the sequence of pixels in watermark block A, after being arranged in ascending order, is the same as the sequence of pixels in the original block A. The aforementioned median pixels... For each predicted pixel within a sub-block, the prediction error after embedding the watermark is calculated. ,in The definitions of s and t are the same as in equation (1). Next, the embedded watermark information b is extracted according to equation (5), and its calculation formula is:
[0097] (5).
[0098] S4: Process the sub-blocks sequentially according to S3. Watermark information is extracted, and the pixel values to the left and right of the median in each sorted sub-block are calculated according to equations (6) and (7). Restore to This completes the image block. Extraction of watermark information.
[0099] After extracting the watermark information b according to formula (5), when At that time, according to equation (6), the left side of the median is... Restore to the original pixel values of sub-block A The specific expression is as follows:
[0100] (6)
[0101] in: .
[0102] when At that time, according to equation (7), the right side of the median is... Restore to the original pixel values of sub-block A The specific expression is as follows:
[0103] (7)
[0104] in: .
[0105] S5: Using the watermark information extracted from S4, restore the watermark block to the original block. Then, unzip. The LSB bits of the last column of pixels are replaced, and finally the entire original image is recovered. .
[0106] This invention can completely recover the original carrier image after extracting the watermark, achieving algorithm reversibility. The following section focuses on... Figure 6 The four test images shown are used for experimental verification:
[0107] 1. Image quality analysis
[0108] This invention selects four images with different features as test images, and embeds watermark information of different sizes starting from 2500 bits. Specific experimental results are as follows: Figure 7 As shown in the figure. Experiments show that under most embedding conditions, the proposed algorithm outperforms the comparison scheme in terms of PSNR value, especially in large-capacity embedding, where the PSNR value decreases more gradually.
[0109] from Figure 7It can be seen that as the embedding capacity increases, the peak signal-to-noise ratio (PSNR) of the image decreases, but remains above 50 dB. Taking the Boat image as an example, when the embedding capacity is 10,000 bits, the PSNR value of this invention is 57.4 dB, which is 2.20 dB, 2.90 dB, and 1.99 dB higher than the three comparison algorithms, respectively. When the embedding capacity increases to 25,000 bits, the PSNR value of this invention is improved to varying degrees compared with the other three algorithms. At low embedding capacity, the algorithm of Huang et al. (Huang D, Wang J. Efficient reversible data hiding based on the histogram modification of differences of pixel differences[J]. Multimedia Tools and Applications,2020, 79(29): 1-16) (referred to as pixel differences) has a higher PSNR value in the Airplane image, but as the embedding capacity increases, the PSNR value of this invention decreases gradually and is higher than that of Huang et al.'s algorithm. This invention utilizes pixel correlation to further divide a 4×5 image block into 4 sub-blocks, and makes predictions based on the median pixel of each sub-block. While improving the visual quality of the image, it also increases the number of prediction error values of 0 and 1, making the distribution of prediction error values more concentrated. Figure 8 The image shows a comparison of Peppers images before and after watermarking, as well as the restored images. Visually, it is impossible to distinguish the difference between the embedded image and the original image.
[0110] To further evaluate the visual quality of the watermarked images, this experiment started with 2500 bits and sequentially embedded watermark information of different capacities into four images with different textures. The PSNR values were then used to compare and analyze the quality of the watermarked images. The experimental results are as follows: Figure 9 As shown, for the smooth Airplane image, its visual quality is significantly higher than other images when embedding watermarks of different capacities, reaching a maximum of 64.1 dB. Although the visual quality trends of the other three carrier images are similar, when the embedding capacity is greater than 12,500 bits, the PSNR value of the textured Boat image is significantly lower than that of the other images.
[0111] Table 1 shows the PSNR comparison between the present invention and other algorithms for different images with an embedding capacity of 25,000 bits. When embedding 25,000 bits of watermark information, the average PSNR value of the present invention is 53.74 dB, which is 2.65 dB and 1.39 dB higher than that of Wang's algorithm (Wang C, Li XL, Yang B. Efficient reversible image watermarking by using dynamicalprediction-error expansion[C]. IEEE International Conference on Image Processing, 2010: 3673-3676) (using Wang's description) and Multi-channel PVO (Zhou Tongyang, Tang Xin, Xu Yichen. Multi-channel PVO reversible information hiding based on spatial location optimization[J]. Journal of Applied Sciences, 2025, 43(3):387-402), respectively. This shows that under high embedding capacity, the present invention can effectively improve the image quality after watermarking and generate the highest fidelity watermarked image.
[0112] Table 1. Comparison of PSNR for different algorithms (embedding capacity: 25,000 bits)
[0113] image Wang Pixel differences Multi-channel PVO This invention Peppers 49.34 51.17 51.85 53.03 Airplane 54.03 53.29 54.78 56.46 Boat 50.86 50.55 51.41 52.15 Lake 50.14 - 51.36 53.32 Average 51.09 - 52.35 53.74
[0114] 2. Structural similarity
[0115] Table 2 shows a comparison of the SSIM values of the present invention under different embedding capacities. The data in the table shows that for an embedding capacity of 10,000 bits, the SSIM value of the present invention remains at 0.99997 across different images, indicating that the original structural information of the image is preserved after embedding. As the embedding capacity increases to 20,000 bits, the present invention also maintains good SSIM values in all images, without introducing significant structural distortion during the embedding process, demonstrating stable performance.
[0116] Table 2 Comparison of SSIM under different embedding capacities using this algorithm
[0117] Embedded amount / bit Peppers Airplane Boat Lake 5000 0.99998 0.99998 0.99998 0.99998 10000 0.99997 0.99997 0.99996 0.99998 15000 0.99995 0.99997 0.99992 0.99997 20000 0.99994 0.99996 0.99990 0.99996 25000 0.99993 0.99995 0.99988 0.99994
[0118] 3. Comparison of embedded capacity
[0119] Figure 10 The maximum embedding capacity of the present invention is compared with that of existing algorithms.
[0120] To improve the embedding capacity of images, this invention is implemented on 4×5 fixed-size blocks. From Figure 10 The comparison results show that, compared with other algorithms, the maximum embedding capacity of this algorithm is improved in most images. The method used in the Block Subdivision algorithm (Ren Fang, Yang Yiping, Xue Feiyuan. Reversible data hiding algorithm based on pixel value sorting and block re-division [J]. Computer Engineering, 2022, 48(10): 130-137) is to embed watermarks on fixed 3×3 blocks, and a maximum of 6 bits of watermark information can be embedded in a block. Although this algorithm performs better in terms of PSNR, the maximum embedding capacity of this invention is much higher than that of the Block Subdivision algorithm. This is because this invention takes into account that the higher the correlation between adjacent pixels, the smaller the prediction error value. The 4×5 block is re-divided into blocks, and a maximum of 16 bits of watermark can be embedded, which significantly improves the embedding capacity of the algorithm. Compared with the Block Subdivision algorithm, this invention improves the embedding capacity by 20%. For Boat images with relatively coarse textures, the embedding capacities of Block Subdivision and Multi-channel PVO (Zhou Tongyang, Tang Xin, Xu Yichen. Reversible Information Hiding Based on Spatial Location Optimization of Multi-channel PVO [J]. Journal of Applied Sciences, 2025, 43(3): 387-402) algorithms are 27816 bits and 27631 bits, respectively, while the embedding capacity of the present invention is 32189 bits, which are improved by 15.7% and 16.5%, respectively. The results show that the present invention significantly outperforms other comparative algorithms in terms of high embedding capacity by making full use of the pixel correlation after image segmentation for watermark embedding, achieving a balance between watermark embedding and image visual quality maintenance.
[0121] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent transformations or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A reversible watermarking method based on prediction error expansion using re-blocking and IPVO, characterized in that, The watermark embedding process includes the following steps: Step 1: Given an M×N 8-bit grayscale image , to image All pixels except the last column are divided into non-overlapping 4×5 blocks in a top-to-bottom, left-to-right order. , where N is the total number of blocks, and i and j represent the x and y coordinates of the pixel in the image, respectively; Step 2: Process the blocks obtained in Step 1 The blocks are further divided into four sub-blocks. ; Step 3: Process the sub-blocks obtained in Step 2 The pixels within the block are sorted in ascending order to obtain the median pixel value of the corresponding sub-block, and then four prediction error values for the corresponding sub-block are calculated. , ; Step 4: Calculate the prediction error The prediction error is obtained by extending or shifting the data to embed watermark information. Modify the pixel values to the left and right of the median within the sorted sub-block to complete the sub-block. Watermark embedding; Step 5: For sub-blocks Repeat steps 3 and 4 above to embed the watermark; this completes the block segmentation. Watermark information embedding; once all watermark information has been embedded, record the last image block with the embedded watermark. .
2. The reversible watermarking method based on prediction error expansion using re-blocking and IPVO as described in claim 1, characterized in that, In the segmentation When embedding a watermark with pixels containing values of 255 or 0, the blocks containing these pixels are marked as... Otherwise, mark as ;for The blocks are not processed; for each Blocks After embedding the watermark, the image location map is finally created. Compress into a length of The bitstream string is used as an auxiliary information embedding; The auxiliary information is embedded in the least significant bit (LSB) of the last column of pixels in the image, where the auxiliary information is a compressed location map. Block size and embedding end position Replace the last LSB in the image with auxiliary information, and compress the replaced LSB into a bitstream. Finally, it is embedded into the remaining area of the image according to the embedding method described in steps 2 to 5, that is... Generate watermarked images .
3. The reversible watermarking method based on prediction error expansion using re-blocking and IPVO as described in claim 1, characterized in that, The specific operation of further segmentation in step 2 is as follows: In step 1, the original image is divided into 4×5 non-overlapping blocks. In step 2, each block's 20 pixels are further divided into 4 sub-blocks, and the 20 pixels are defined as x from top to bottom and from left to right. 1~ x 20 Each sub-block contains 5 pixel values, designated as sub-block A, sub-block B, sub-block C, and sub-block D. Sub-block A contains pixels x1, x2, x3, x6, and x7; sub-block B contains pixels x4, x5, x8, x9, and x1. 10 Sub-block C pixels include x 11 x 12 x 13 x 16 x 17 Sub-block D pixels include x 14 x 15 x 18 x 19 x 20 During embedding, the sub-blocks are embedded sequentially in the order of sub-block A → sub-block B → sub-block C → sub-block D.
4. The reversible watermarking method based on prediction error expansion using re-blocking and IPVO as described in claim 1, characterized in that, Step 3 specifically involves: Define a sub-block containing 5 pixels. Then sort the gray values in sub-block A in ascending order to obtain ,in, , That is, the median pixel of the sub-block, if And w < r, then ; The remaining 4 pixels within the sub-block The prediction process generates a maximum of four prediction errors that can be used to embed watermark information. The prediction error is then calculated. As shown in equation (1): (1); in: Use the fixed index value corresponding to each pixel in the sub-block. As a subscript to the prediction error value, when hour, , This involves comparing the index values of the first two pixels in the sub-block after ascending sorting, as well as the index value of the median pixel, and calculating the difference between the pixel value with the smaller index value and the pixel value with the larger index value; when hour, , This involves comparing the index values of the last two pixels in the sub-block after ascending sorting with the index value of the median pixel, calculating the difference between the pixel value with the smaller index value and the pixel value with the larger index value, and thus obtaining the original prediction error of the watermark information to be embedded.
5. A reversible watermarking method based on prediction error expansion using re-blocking and IPVO as described in claim 4, characterized in that, In step 4, the modified prediction error is obtained. The specific operation is as follows: use and To embed watermark information, when Embed the watermark in the negative direction of the zero value point. When the value is 1, the watermark is embedded in the positive direction of the point; otherwise, it is shifted. The specific embedding expression is as follows: (2); in, This is the revised prediction error. This is the embedded binary watermark information.
6. A reversible watermarking method based on prediction error expansion using re-blocking and IPVO as described in claim 5, characterized in that, In step 5, the pixel values to the left and right of the median within the sorted sub-block are modified to complete the sub-block. Watermark embedding specifically includes: set up These are the original pixels to the left and right of the median pixel after sorting sub-block A in ascending order. These are the pixels after the watermark information is embedded in the original pixels; when At that time, the pixels to the left of the median pixel Modified to The calculation formula is as follows: (3); in: ; when At that time, the pixel to the right of the median pixel Modified to The calculation formula is as follows: (4); in: .
7. A reversible watermarking method based on prediction error expansion using re-blocking and IPVO as described in claim 2, characterized in that, It also includes the watermark extraction process, specifically: S1: First, scan the LSB bits of the last column of pixels in the watermark image to extract the bitstream. Block size and end position And decompress it to get the location map; S2: Based on the block size and location map, divide all pixels of the watermark image except the last column into non-overlapping 4×5 blocks in the order from top to bottom and from left to right as described in step 1, and then divide the location map... Image blocks Following step 2, further subdivide the blocks to obtain 4 sub-blocks. ; S3: Sub-blocks obtained by sorting S2 in ascending order The pixels are calculated, and the median predicted pixels of the corresponding sub-blocks are obtained. Then, the modified prediction error value is calculated. Extract sub-blocks Watermark information and compressed bitstream ; S4: Process the sub-blocks sequentially To extract watermark information, the pixel values to the left and right of the median value within each sorted sub-block are... Restore to This completes the image block. Extraction of watermark information; S5: Using the watermark information extracted from S4, restore the watermark block to the original block. Then, unzip. The LSB bits of the last column of pixels are replaced, and finally the entire original image is recovered. .
8. A reversible watermarking method based on prediction error expansion using re-blocking and IPVO as described in claim 7, characterized in that, In step S3, sub-blocks are extracted. The specific steps for handling watermark information are as follows: First, sort the pixels within the block in ascending order to obtain the sequence. , The median pixel value after the watermark is embedded in the sub-block, and the sequence of pixels in the watermark block after being arranged in ascending order is the same as the sequence of pixels in the original block. The proposed median pixel For each predicted pixel within a sub-block, the prediction error after embedding the watermark is calculated. The embedded watermark information b is extracted, and its calculation formula is as follows: (5)。 9. A reversible watermarking method based on prediction error expansion using re-blocking and IPVO as described in claim 8, characterized in that, In step S4, the pixel values to the left and right of the median value within each sorted sub-block are... Restore to Specifically: when When, the left side of the median value Restore to the original pixel values of the sub-block The specific expression is as follows: (6); in: ; when When, the right side of the median value Restore to the original pixel values of the sub-block The specific expression is as follows: (7); in: , These are the original pixels to the left and right of the median pixel after the sub-blocks are sorted in ascending order. These are the pixels after the watermark information is embedded in the original pixels.