Block re-embedding reversible watermark hiding method based on IPVO

By calculating the local complexity of image blocks and adopting a diamond prediction strategy and pre-sorting scheme, low-complexity blocks are preferentially selected for segmentation and embedding watermark information, which solves the problem of balancing embedding capacity and visual quality in existing technologies and realizes efficient reversible watermark hiding.

CN120634828APending Publication Date: 2025-09-12HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510738278.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing reversible watermarking technologies have difficulty in maintaining high embedding performance and imperceptibility while improving embedding capacity, especially in natural images where the embedding effect is poor around image blocks with different texture complexity.

Method used

By calculating the local complexity of each image block, low-complexity blocks are preferentially selected for subdivision, and different embedding methods are adopted, combined with diamond prediction strategy and pre-sorting scheme, to improve the embedding capacity while maintaining visual quality.

Benefits of technology

It achieves the goal of improving the embedding capacity while maintaining good imperceptibility and visual quality, reducing the impact of invalid pixel modification on image quality, and improving the image embedding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120634828A_ABST
    Figure CN120634828A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information hiding and digital watermarking, and discloses an IPVO-based block re-embedding reversible watermark hiding method, which comprises the following steps of: dividing all pixels except a first row of an image into 3 * 3 non-overlapping pixel blocks, calculating the local complexity of each image block, and preferentially selecting a low-complexity block for embedding a watermark; the selected pixel blocks are subdivided into three parts, the middle pixel block serves as a sub-block C, the three pixel blocks at the upper left corner serve as sub-blocks A, the five pixel blocks in the L shape at the lower right corner serve as sub-blocks B, watermark information is embedded in different embedding modes according to the sequence of the sub-blocks C, the sub-blocks A and the sub-blocks B, and auxiliary information is embedded in the first line of the image. The watermark extraction method is an inverse process of watermark embedding. Compared with the prior art, the method has the advantages that the embedding performance is good, and good imperceptibility can be kept while the embedding capacity is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information hiding and digital watermark technology, and in particular to an IPVO-based block subdivision and embedding reversible watermark hiding method. Background Art

[0002] Reversible watermarking technology, as a means of covert communication, copyright protection, and content integrity authentication, plays a vital role in today's digital age. With the continuous advancement of technology, reversible watermarking has become a field of considerable interest. The core of this technology lies in cleverly embedding specific information into a carrier, ensuring that legitimate users can restore the original carrier without distortion after extracting the information, thus providing convenience and security for information transmission and protection. The emergence of reversible watermarking technology has made it of great research value in fields such as archival images, medical images, and military images, where the quality of the original data is extremely high.

[0003] To improve the performance of image watermark embedding, an innovative difference histogram manipulation technique is proposed based on the high correlation between pixels. This algorithm analyzes the difference distribution characteristics of the carrier image and effectively utilizes the fact that the peak values ​​in the difference histogram are highly concentrated at zero, increasing the embedding capacity by over 35%. Furthermore, the IPVO algorithm uses the spatial position prediction error between the maximum and second-largest values, and the minimum and second-smallest values, to embed watermark information in image blocks with error values ​​equal to 0 and 1. This reversible data hiding algorithm, based on pixel value sorting and block subdivision, utilizes pixel sorting technology to better utilize the image's texture information, reduce the translation of invalid pixels, and improve the watermark's embedding capacity and visual quality.

[0004] One of the fundamental goals of reversible image watermarking algorithm research is to achieve the maximum amount of effective information embedding with minimal distortion. When embedding information into an image using a watermark embedding algorithm, pixels that are only modified but not embedded with watermark information are called invalid pixels. The more invalid pixels are modified, the less the embedding capacity will increase, but the image embedding performance will decrease. Furthermore, during the embedding process, it is necessary to consider that adjacent pixels in natural images are highly correlated. Image blocks with low texture complexity also have low texture complexity around them, while image blocks with high texture complexity also have high texture complexity around them. Therefore, how to increase embedding capacity while maintaining high embedding performance is something that those skilled in the art urgently need to further research and improve. Summary of the Invention

[0005] Purpose of the Invention: To address the challenges of the prior art, the present invention provides a reversible watermarking method based on IPVO (Internet Protocol Voda) block-resection embedding. By calculating the local complexity of each image block, low-complexity blocks are preferentially selected for watermark embedding. The selected image blocks are then subdivided into three parts, each of which uses a different embedding method to embed watermark information. This method achieves excellent embedding performance, increasing embedding capacity while maintaining good imperceptibility.

[0006] Technical solution: The present invention provides a block-resection-embedded reversible watermark hiding method based on IPVO, including a watermark embedding method, which specifically includes the following steps:

[0007] Step 1: First, divide all pixels of a given 8-bit grayscale image I except the first row into 3×3 non-overlapping pixel blocks {X1, X2, ... X N}, the boundary pixels that cannot be divided are filled with zero, where N is the total number of pixel blocks;

[0008] Step 2: If there are pixels with a value of 255 or 0 in a certain pixel block, mark the block as L LM(i) =1, otherwise marked as 0, and finally all L LM Compressed to a length of L CLM The bit stream string, i.e. the location map of the image;

[0009] Step 3: For L LM(i) =1 No operation is performed on L LM(i) = 0 pixel block complexity calculation, get the local complexity N NL , according to the local complexity of L LM(i) = 0 pixel blocks are sorted in ascending order;

[0010] Step 4: According to the order of local complexity, select the low-complexity pixel block and subdivide it into 3 sub-blocks, and embed the watermark information b in the order of sub-block C → sub-block A → sub-block B. After all the watermark information is embedded, the last pixel block embedded with data is recorded as X. end ;

[0011] The three sub-blocks are divided as follows: the middle pixel block of the 3×3 non-overlapping pixel blocks is used as sub-block C, the three pixel blocks in the upper left corner are used as sub-block A, and the L-shaped 5 pixel blocks in the lower right corner are used as sub-block B;

[0012] Step 5: Set the block size and end position X end The position map is embedded into the least significant bit (LSB) of the first row of the image as auxiliary data to obtain the final encrypted image I'.

[0013] Furthermore, a watermark extraction method is also included, which specifically includes the following steps:

[0014] S1: First, read the LSB of the first row of pixels of the encrypted image I', extract the compressed auxiliary information, and obtain the position map;

[0015] S2: Then divide all pixels except the first row into non-overlapping 3×3 pixel blocks, and find the L of each block. LM (i), calculate each L LM(i) = 0 and sort in ascending order;

[0016] S3: Divide each 3×3 pixel block into 3 sub-blocks in the order of pixel block complexity from low to high, and extract the watermark information in the order of sub-block B → sub-block A → sub-block C, and extract the compressed bit stream S LSB The three sub-blocks are divided as follows: the middle pixel block of the 3×3 non-overlapping pixel blocks is used as sub-block C, the three pixel blocks in the upper left corner are used as sub-block A, and the L-shaped 5 pixel blocks in the lower right corner are used as sub-block B;

[0017] S4: After restoring the pixel block to the original block of the image, decompress S LSB , replace the LSB bit of the first row, and finally restore the entire original image I.

[0018] Furthermore, when embedding watermark information into the sub-block C, a diamond prediction strategy is used to obtain a prediction value, and the watermark information is embedded according to the prediction error. The prediction value obtained by using the diamond prediction strategy is specifically:

[0019] Assume that the pixel value p5 of sub-block C is l i,j , and its prediction process is shown in formula (1):

[0020] l' i,j =ω1·r1+ω2·r2+ω3·r3+ω4·r4 (1)

[0021] Among them, l' i,j is the pixel value l i,j The predicted value of , where i and j represent pixel coordinates; ω1, ω2, ω3, and ω4 are weight values ​​between groups of diamond blocks, satisfying ω1+ω2+ω3+ω4=1; r1, r2, r3, and r4 are the means between groups; the division method between groups of diamond blocks is: the 4 pixels on the cross area are numbered clockwise, and each group of 3 pixels is divided into 4 groups;

[0022] The inter-group mean is determined after the grayscale values ​​of each group are sorted in ascending order, and the distance between each group is further determined. The sum of the inter-group differences of the four groups is determined based on the distance between each group, and the weight value between each group of the final diamond block is determined using the distance between each group and the sum of the inter-group differences.

[0023] Furthermore, the specific process of determining the weight values ​​between the groups of diamond blocks is as follows:

[0024] Step 4.1: First, the target pixel (i.e., the pixel value p5) is numbered clockwise on the four pixels in the cross area, with each group of three pixels divided into four groups, and the grayscale values ​​of each group of pixels are sorted in ascending order to obtain v m σ(1) ≤v m σ(2) ≤v m σ(3) , 1≤m≤4, and the mean values ​​r1, r2, r3, and r4 between groups are calculated using formula (2):

[0025]

[0026] Among them, v m σ(1) ,v m σ(2) ,v m σ(3) Indicates the first, second, and third pixel grayscale values ​​in each group after sorting in ascending order from small to large. σ(1), σ(2), and σ(3) represent pixel grayscale value subscripts and have no actual meaning. 1≤m≤4 represents the first to fourth groups.

[0027] Step 4.2: Subtract the minimum value from the maximum value in each group to obtain the four inter-group distances e i , 1≤i≤4, representing the distance between the four groups, which is used to judge the texture degree. The calculation is as follows:

[0028]

[0029] According to the calculated distances between the groups, the sum of the inter-group differences e of the four groups is calculated. sum , then calculate the weights ω'1, ω'2, ω'3, ω'4 of each group, and then normalize the weight values ​​to obtain ω1, ω2, ω3, ω4:

[0030]

[0031]

[0032] Furthermore, the sub-block C embeds watermark information according to the prediction error, specifically: calculating the prediction error value d i,j , expand the prediction error and embed the watermark information, the original pixel becomes L i,j =E i,j +l' i,j :

[0033] di,j =l i,j -l' i,j (6).

[0034] E i,j =2d i,j +b (7).

[0035] Furthermore, when embedding watermark information into sub-block A, a pre-sorted pixel value sorting scheme is adopted, and then the IPVO algorithm is used for embedding; the details are as follows:

[0036] First, predict the pixel values ​​of the three pixels in sub-block A. Set u1, u2, and u3 as the predicted values ​​of pixels p1, p2, and p4 within the block, and p3, p5…p9 as the pixel values ​​within the 3×3 block:

[0037]

[0038] Once a set of predictions is obtained, determine the difference between the pixel predictions:

[0039]

[0040] Then determine the scanning order based on the difference in the predicted values, and perform sequential scanning using the corresponding scanning order:

[0041] When |d1|≥|d2|:

[0042] When d1≥0 and d2≥0, scan in the order of p1→p2→p4;

[0043] When d1≥0 and d2<0, scan in the order of p1→p4→p2;

[0044] When d1<0 and d2≥0, scan in the order of p2→p4→p1;

[0045] When d1<0 and d2<0, scan in the order of p4→p2→p1;

[0046] When |d1|≤|d2|:

[0047] When d1≥0 and d2≥0, scan in the order of p1→p2→p4;

[0048] When d1≥0 and d2<0, scan in the order of p4→p1→p2;

[0049] When d1<0 and d2≥0, scan in the order of p2→p1→p4;

[0050] When d1<0 and d2<0, scan in the order of p4→p2→p1;

[0051] After the scanning sequence, IPVO is used to embed the watermark, and when extracting the watermark, the inverse process of IPVO is used to extract it.

[0052] Furthermore, when embedding watermark information into sub-block B, the pixel block is scanned from top to bottom and from right to left to obtain the pixel sequence {p3, p6, p9, p8, p7}, which is then sorted in ascending order to obtain the sequence {p τ(1) ,p τ(2) ,p τ(3) ,p τ(4) ,p τ(5)}, if p τ(w) =p τ(j) , and w≤j, then τ(w)≤τ(j), calculate the prediction error e 2,j , as shown below:

[0053] e 2,j =p s -p t (10)

[0054] Where, j∈{1,2,3,4}; when j∈{1,2}, s=min{τ(j),τ(3)}, t=max{τ(j),τ(3)}; when j∈{3,4}, s=min{τ(j+1),τ(3)}, t=max{τ(j+1),τ(3)}; after obtaining the prediction error, the prediction error is modified to embed the watermark information b as shown below:

[0055]

[0056] After the prediction error is modified, when j∈{1,2} and j∈{3,4}, the p corresponding to sub-block B τ(j) With p τ(j+1) They are modified as shown in formula (16):

[0057]

[0058] Furthermore, the complexity of the pixel block is calculated to obtain the local complexity, which is as follows:

[0059] Define a circle of pixels in a 3×3 pixel block as the nearest pixels adjacent to the pixel block, and let it be the pixel set C. For the pixel block, its local complexity N NL is defined as:

[0060] C={p i-1,j+m ,p i+3,j+m ,p i+n,j-1 ,p i+n,j+3 |m=-1,0,1,2,3; n=0,1,2} (13)

[0061]

[0062] in: is the average value of pixels in pixel set C.

[0063] Furthermore, when performing pixel extraction on sub-block C, specifically:

[0064] In the pixel extraction stage, for a pixel containing watermark information, the pixel value is L i,j , calculate L i,j The predicted value L' i,j , and then obtain its prediction error E' i,j , while recovering the original prediction error d i,j , the formula is as follows:

[0065] E' i,j =L i,j -L' i,j (15)

[0066] b=E' i,j mod2 (16)

[0067]

[0068] l i,j =L' i,j +d i,j (18).

[0069] Furthermore, when extracting the watermark from sub-block B, the pixel sequence obtained by scanning and sorting the 5 pixel blocks in ascending order using the same method is {p' τ(1) ,p' τ(2) ,p' τ(3) ,p' τ(4) ,p' τ(5)}, also calculate the prediction error e' 2,j =p s -p t , then extract the watermark information b as follows:

[0070]

[0071] After extracting the watermark information, when j∈{1,2} and j∈{3,4}, the p corresponding to the sub-block B is τ(j) With p τ(j+1) Restore to original pixels as follows:

[0072]

[0073] Beneficial effects:

[0074] This paper proposes a reversible watermarking method based on IPVO (Internet Protocol Voda) block-based embedding. By calculating the local complexity of each image block, low-complexity blocks are preferentially selected for watermark embedding. The selected image blocks are then subdivided into three parts, each of which uses a different embedding method to embed the watermark information. The algorithm has excellent embedding performance and maintains good imperceptibility while increasing the embedding capacity.

[0075] 2. In the process of embedding information into an image using a watermark embedding algorithm, the present invention uses pixel points that are only modified but not embedded with watermark information as invalid pixels. The more invalid pixels are modified, the less the embedding capacity will be. Instead, the embedding performance of the image will be reduced. Considering that adjacent pixels in natural images are highly correlated, image blocks with low texture complexity have low texture complexity around them, and image blocks with high texture complexity have high texture complexity around them. After the image is divided into blocks and the complexity is calculated, the complexity of all blocks is sorted in ascending order. According to the complexity from low to high, low-complexity blocks, i.e., smooth blocks, are used for data embedding operations first, and the use of rough blocks for data embedding is avoided. This significantly improves the visual quality and embedding capacity of the encrypted image.

[0076] 3. The present invention adopts different embedding methods for target pixels with different spatial positions, making full use of the correlation between pixels, increasing the embedding capacity and improving the visual quality of the encrypted image. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 This is a flow chart of the IPVO-based block subdivision and embedding reversible watermark hiding method of the present invention;

[0078] Figure 2 is a test image according to an embodiment of the present invention;

[0079] Figure 3 Schematic diagram of data embedding and extraction for the IPVO algorithm of the present invention;

[0080] Figure 4 This is a schematic diagram of pixel block division according to the present invention;

[0081] Figure 5 This is the pixel grouping mode of the present invention;

[0082] Figure 6 The present invention has 8 pre-scanning modes based on spatial position;

[0083] Figure 7 The pixels surrounding the 3×3 pixel block of the present invention;

[0084] Figure 8 This is a comparison chart of the embedding results of different algorithms of the present invention;

[0085] Figure 9 Comparison of the maximum embedding capacity of different algorithms in the present invention. DETAILED DESCRIPTION

[0086] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and are not intended to limit the scope of protection of the present invention.

[0087] The invention discloses an IPVO-based block subdivision embedding reversible watermark hiding method, which mainly comprises two parts: watermark embedding and watermark extraction.

[0088] Watermark embedding, the specific operation process of watermark embedding is as follows:

[0089] (1) First, all pixels except the first row of a given M×N8-bit grayscale image I are divided into 3×3 non-overlapping pixel blocks {X1, X2, ... X N}, the boundary pixels that cannot be divided are filled with zeros, where N is the total number of pixel blocks.

[0090] (2) If there are pixels with values ​​of 255 or 0 in an image block, the block is marked as L LM(i) =1, otherwise marked as 0. Finally, all L LM Compressed to a length of L CLM The bit stream string is the location map of the image.

[0091] (3) In order to prevent overflow or underflow after embedding information, for L LM(i) =1 No operation is performed. LM(i) = 0, and calculate the complexity of the block to get its local complexity N NL , according to the complexity of L LM(i) = 0 are sorted in ascending order.

[0092] (4) According to the order of complexity, select low-complexity image blocks for operation, subdivide the image blocks into 3 sub-blocks, and embed watermark information in the order of sub-block C → sub-block A → sub-block B. The watermark information b is a randomly generated data stream belonging to {0,1}. After all the watermark information is embedded, the last image block embedded with data is recorded as X end .

[0093] (5) Set the block size and end position X end and location Figure 1 The ciphertext 'I' is embedded as auxiliary data into the least significant bit (LSB) of the first row of the image to obtain the final encrypted image I'.

[0094] Watermark extraction,The watermark extraction stage is mainly divided into the following steps:

[0095] (1) First, read the LSB of the first row of pixels in the encrypted image, extract the compressed auxiliary information, and obtain the position map. Then divide all pixels except the first row into non-overlapping 3×3 pixel blocks, and find the L LM (i), calculate each L LM(i) = 0 and sorted in ascending order.

[0096] (2) In order of image block complexity from low to high, each 3×3 image block is divided into three sub-blocks. The watermark information is extracted in the order of sub-block B → sub-block A → sub-block C, and the compressed bit stream S is extracted. LSB .

[0097] (3) After restoring the watermark block to the original block of the image, decompress S LSB , replace the LSB bit of the first row, and finally restore the entire original image I.

[0098] The present invention studies a block-resection and embedding reversible watermark hiding method based on IPVO, which mainly uses relevant knowledge and technologies such as improved pixel value sorting (IPVO), pixel block segmentation, and pixel block complexity sorting to achieve watermark embedding and extraction.

[0099] The following describes pixel block segmentation and processing:

[0100] In order to utilize the correlation between pixels in an image block, the present invention adopts the following method: Figure 4 The chunking method shown divides the original chunk into three parts:

[0101] like Figure 4 As shown in the figure, the pixel block is divided into three parts: sub-block A, sub-block B, and sub-block C. Embedding follows the order of sub-block C → sub-block A → sub-block B. Extraction follows the order of sub-block B → sub-block A → sub-block C. This ensures the reversibility of the algorithm. The middle pixel block of the 3×3 non-overlapping pixel block is used as sub-block C, the three pixel blocks in the upper left corner are used as sub-block A, and the five pixel blocks in the L-shaped shape in the lower right corner are used as sub-block B.

[0102] 1) Sub-block C processing:

[0103] In the watermark embedding process, the sub-block C is embedded first. Using the diamond prediction strategy, let the pixel value p5 be l i,j , and its prediction process is shown in formula (1):

[0104] l' i,j =ω1·r1+ω2·r2+ω3·r3+ω4·r4 (1)

[0105] Among them, l' i,j is the pixel value l i,j The predicted value; ω1, ω2, ω3, ω4 are the weight values ​​between the groups of diamond blocks, which need to satisfy ω1+ω2+ω3+ω4=1; r1, r2, r3, r4 are the means between the groups, and the grouping is as follows Figure 4 shown.

[0106] The calculation steps of the four weight values ​​are as follows:

[0107] Step 1: First, number the four pixels on the target pixel cross area in clockwise order, and divide them into four groups of three pixels each, such as Figure 4 As shown, the grayscale values ​​of each group of pixels are sorted in ascending order to obtain v m σ(1) ≤v m σ(2) ≤v m σ(3) (1≤m≤4), calculate r1, r2, r3, r4 by formula (2):

[0108]

[0109] Step 2: To determine the texture level of the pixel group, subtract the minimum value from the maximum value in each group to obtain the four inter-group distances to determine the texture level. The calculation is as follows:

[0110]

[0111] According to the calculated distances between the groups, the sum of the inter-group differences of the four groups, e, is calculated using formula (4). sum Then use formula (5) to calculate the weights of each group ω'1, ω'2, ω'3, ω'4, and then normalize the weight values ​​to get ω1, ω2, ω3, ω4. Then use formula (1) to get the predicted pixel value l' i,j .

[0112]

[0113] Step 3: Calculate the prediction error value d according to formula (6) i,j , through such a pixel prediction method, the prediction accuracy of the pixel can be improved to a certain extent. Then, the prediction error is expanded and the watermark information is embedded through formula (7), and the original pixel becomes L i,j =E i,j +l' i,j , thus completing the embedding of watermark information of sub-block C.

[0114] d i,j =l i,j -l' i,j (6)

[0115] E i,j =2d i,j +b (7)

[0116] In the pixel extraction stage, for a pixel containing watermark information, its pixel value is L i,j Calculate L using the same method as above i,j The predicted value L' i,j Then use formula (8) to obtain the prediction error E' i,j The watermark information b is extracted by equation (9), and at the same time the original prediction error d is restored by equation (10) i,j , so the original pixel value can be completely restored by formula (11). The prediction accuracy value can be increased by weighting, making the prediction error value more accurate. The formula is as follows:

[0117] E' i,j =L i,j -L' i,j (8)

[0118] b=E' i,j mod2 (9)

[0119]

[0120] l i,j =L' i,j +d i,j (11)

[0121] 2) Sub-block A processing

[0122] For sub-block A, a pre-sorted pixel value sorting scheme is adopted, based on which the IPVO algorithm is used for embedding. IPVO uses prediction error expansion when the prediction error is 0 or 1. Increasing the number of prediction error values ​​of "0" and "1" is particularly critical to improving embedding performance. If larger pixel values ​​can be assigned smaller spatial locations, the number of prediction error values ​​of "1" can be increased to a certain extent. Based on the above considerations, a pre-sorting scheme is proposed for sub-block A. The prediction error values ​​of the three pixel blocks are calculated, and their scanning order is adaptively selected based on their distribution.

[0123] First, the pixel values ​​of the three pixels of sub-block A are predicted using formula (12). u1, u2, and u3 are the predicted values ​​of pixels p1, p2, and p4 within the block, and p3, p5, ..., p9 are the pixel values ​​within the 3 × 3 block. Figure 4 shown.

[0124]

[0125] After obtaining a set of predicted values ​​using formula (12), this set of predicted values ​​is used to complete the pre-sorting process. Figure 6 In this paper, eight pre-sorting modes are summarized. After determining the difference of pixel prediction values ​​through formula (13), Figure 6 Select the corresponding scanning order as follows:

[0126]

[0127] The scanning order is:

[0128] When |d1|≥|d2|:

[0129] When d1≥0 and d2≥0, scan in the order of p1→p2→p4; when d1≥0 and d2<0, scan in the order of p1→p4→p2; when d1<0 and d2≥0, scan in the order of p2→p4→p1; when d1<0 and d2<0, scan in the order of p4→p2→p1.

[0130] When |d1|≤|d2|:

[0131] When d1≥0 and d2≥0, scan in the order of p1→p2→p4; when d1≥0 and d2<0, scan in the order of p4→p1→p2; when d1<0 and d2≥0, scan in the order of p2→p1→p4; when d1<0 and d2<0, scan in the order of p4→p2→p1.

[0132] After obtaining the new scanning order through the pre-scanning mode, the IPVO scheme is used to embed the watermark, and the same steps are used to extract the watermark in the extraction stage.

[0133] Introduction to IPVO algorithm:

[0134] The PVO algorithm is a reversible watermark hiding algorithm based on PEE. In this method, the image is divided into blocks and the n pixels in the blocks are sorted in ascending order so that x σ(1) ≤x σ(2) ≤…≤x σ(n) , calculate the prediction error e max =x σ(n) -x σ(n-1) Thus, a prediction error value is obtained. When the prediction error value is 1, the image block can be used to embed watermark information. The improved pixel value sorting (IPVO) algorithm based on the PVO algorithm can use the pixel blocks with prediction error values ​​of 0 that are discarded in the PVO algorithm to embed data. In IPVO, the prediction error d is calculated. max =x u -xv , where u=min(σ(n),σ(n-1)), v=max(σ(n),σ(n-1)). IPVO exploit max =0 and d max =1 to embed data, which greatly increases the embedding capacity compared to the PVO algorithm.

[0135] When the watermark information is embedded into the image block, the maximum value of the image block is modified to x' σ(n) =x σ(n) +b, the minimum value is changed to x' σ(n) =x σ(n) -b, the other pixels remain unchanged to ensure the reversibility of the algorithm. In the extraction stage, the prediction error d' is calculated in the same way max =x' u -x' v , when d' max ∈{1,2}, the extracted data is b=d' max -1, if d' is calculated max ∈{-1, 0}, then extract b=-d max , the modified pixel is x σ(n) =x' (n) -b Restore to original pixels.

[0136] The process of IPVO embedding and extracting data on a 3×3 image block is as follows: Figure 2 As shown:

[0137] When the 9 pixels of the original block are sorted, it can be seen that the maximum value x σ(9) is 160, the second largest value x σ(8) is 160, the minimum value x σ(5) is 151, the second smallest value x σ(4) is 152, and we get d max =x σ(9) -x σ(8) =0,d min =x σ(2) -x σ(1) =1.

[0138] Assuming the embedded data b=0,b=1, then d' max =d max +b=d max +0,d' min =d min -b=d min -1. Maximum value x σ(9) Modified to x' σ(9) =x σ(9) +b=160+0=160, minimum value x σ(5) Modified to x'σ(1) =x σ(1) -b=151-1=150, and the new block after embedding the watermark is formed according to the original corresponding position. In the data extraction stage, the same sorting algorithm as the embedding process is used to ensure that the position index sequence of the watermark information block is completely consistent with the arrangement of the original carrier block. The prediction error can be calculated to obtain d' max =x' σ(9) -x' σ(8) =0,d' min =x' σ(2) -x' σ(1) = 1. Because d' max ∈{-1, 0}, d' min ∈{1,2}, b=0, b=1 can be extracted respectively, and the original pixels are restored to the pixel values ​​before embedding the watermark, and then sorted into original blocks according to the corresponding positions.

[0139] 3) Sub-block B processing

[0140] For sub-block B, here we use Figure 4 Scan the image from top to bottom and from right to left to get the pixel sequence {p3, p6, p9, p8, p7}, and then sort it in ascending order to get the sequence {p τ(1) ,p τ(2) ,p τ(3) ,p τ(4) ,p τ(5)}, if p τ(w) =p τ(j) , and w≤j, then τ(w)≤τ(j), and the prediction error e is calculated by formula (14): 2,j , as shown below:

[0141] e 2,j =p s -p t (14)

[0142] Where j∈{1,2,3,4}; when j∈{1,2}, s=min{τ(j),τ(3)}, t=max{τ(j),τ(3)}; when j∈{3,4}, s=min{τ(j+1),τ(3)}, t=max{τ(j+1),τ(3)}. After obtaining the prediction error, use Equation (15) to modify the prediction error to embed the watermark information b, as shown below:

[0143]

[0144] After the prediction error is modified, when j∈{1,2} and j∈{3,4}, the p corresponding to sub-block B τ(j) With p τ(j+1) They are modified as shown in formula (16):

[0145]

[0146] In the data extraction stage of sub-block B, the pixel sequence obtained by scanning and sorting the 5 pixel blocks in ascending order using the same method is {p' τ(1) ,p' τ(2) ,p' τ(3) ,p' τ(4) ,p' τ(5)}, also calculate the prediction error e' 2,j =p s -p t , the definition of j, s, t is exactly the same as that of formula (14), and then the watermark information b is extracted according to formula (17), as shown below:

[0147]

[0148] After extracting the watermark information, according to formula (18), when j∈{1,2} and j∈{3,4}, the p corresponding to the sub-block B is τ(j) With p τ(j+1) Restore to original pixels as follows:

[0149]

[0150] The order of image block complexity is as follows:

[0151] In the process of embedding information in an image using a watermark embedding algorithm, pixels that are only modified but not embedded with watermark information are called invalid pixels. The more invalid pixels are modified, the less the embedding capacity will be. Instead, the embedding performance of the image will be reduced. Considering that adjacent pixels in natural images are highly correlated, the texture complexity of image blocks surrounding image blocks with low texture complexity is also low, and the texture complexity of image blocks surrounding image blocks with high texture complexity is also high. Define a circle of pixels in a 3×3 image block as the nearest pixels adjacent to the block, and let it be the pixel set C, as shown in formula (19). For an image block, its local complexity N NL It is defined as shown in formula (20):

[0152] C={p i-1,j+m ,p i+3,j+m ,p i+n,j-1 ,p i+n,j+3 |m=-1,0,1,2,3; n=0,1,2} (19)

[0153]

[0154] in: is the average value of pixels in pixel set C, and the surrounding pixel set of a 3×3 pixel block is as follows Figure 7 As shown:

[0155] After dividing the image into blocks and calculating the complexity, all blocks are sorted in ascending order of complexity. From low to high complexity, low-complexity blocks, i.e., smooth blocks, are given priority for data embedding operations, avoiding the use of rough blocks for data embedding, which significantly helps the visual quality and embedding capacity of the encrypted image.

[0156] This reversible image watermarking algorithm can completely restore the original carrier image after extracting the watermark, making the algorithm reversible. The specific experimental comparison is as follows:

[0157] 1. Peak signal-to-noise ratio comparison

[0158] Peak Signal-to-Noise Ratio (PSNR) is an objective quality evaluation indicator widely used in image processing, video coding and other fields.

[0159] In the experiment, in order to further test the performance advantages of the algorithm in this paper, watermark information of different sizes is embedded into 4 pictures in turn, and then the PSNR values ​​are calculated. The experimental results are as follows: Figure 8 As shown. It can be seen that in most cases, the PSNR value of this algorithm is optimal, and as the embedding capacity increases, the PSNR value of this algorithm also shows better performance, as shown below:

[0160] from Figure 8It can be seen that this algorithm still has good embedding ability when a certain embedding capacity is met. When embedding the same data in different test images, its PSNR value is higher than that of the other three embedding algorithms. As the embedding capacity increases, this algorithm can still maintain a high PSNR value. Algorithm 1 (Ren Fang, Yang Yiping, Xue Feiyuan. Reversible data hiding algorithm based on pixel value sorting and block subdivision [J]. Computer Engineering, 2022, 48 (10): 130-137) adopts a block subdivision algorithm based on pixel value sorting, and screens pixel blocks with complexity lower than the threshold by calculating the local complexity of the pixel block. Then, by dividing one image block into two sub-blocks, different scanning orders and embedding methods are used for each sub-block to embed data, thereby improving the visual quality of the image after embedding data. Compared with Algorithm 2 (KIM S, QU XC, SACHNEV V, et al. Skewedhistogram shifting for reversible data hiding using a pair of extreme predictions [J]. IEEE Transactions on Circuits and Systems for Video Technology, 2019, 29 (11): 3236-3246) and Algorithm 3 (ZHANG T, LI XL, QI WF, et al. Location-based PVO and adaptive pairwise modification for efficient reversible data hiding [J]. IEEE Transactions on Information Forensics and Security, 2020, 15: 2306-2319), its PSNR value is higher and the image embedding capacity is larger. Based on this, this algorithm uses adaptive scanning technology to adaptively sort image blocks to increase the number of prediction errors of "1" and the number of blocks that can be embedded. At the same time, it embeds blocks from low to high according to the complexity sorting, giving priority to embedding low-complexity blocks, reducing the modification of invalid pixels, thereby reducing the distortion of the encrypted image. Taking the Boat image as an example, when the embedding capacity is 5000 bits, the PSNR value of this algorithm is 64.67dB, while Algorithms 1 to 3 achieve values ​​of 63.75dB, 63.48dB, and 62.12dB, respectively. These values ​​are 0.92dB, 1.19dB, and 2.55dB higher, respectively. When the embedding capacity is 25000 bits, the PSNR value of this algorithm also improves to varying degrees compared to the other three algorithms. Table 1 shows a comparison of the PSNR values ​​of the different algorithms when embedding 10000 bits on four images:

[0161] Table 1 PSNR comparison of different embedding algorithms when embedding 10000 bits of information

[0162]

[0163] Table 1 shows that when embedding 10,000-bit watermark information, the PSNR values ​​obtained by this algorithm are significantly improved compared to the other three methods. For the same image, the PSNR values ​​of this algorithm compared to the other three algorithms range from 0.23dB to 5.28dB, and the average PSNR values ​​compared to Algorithm 1, Algorithm 2, and Algorithm 3 are improved by 0.97dB, 1.78dB, and 2.89dB, respectively. Therefore, this algorithm can effectively improve the quality of encrypted images after embedding data.

[0164] 2. Embedded Capacity Comparison

[0165] The maximum embedding capacity of this algorithm compared with other algorithms is Figure 9 shown.

[0166] Generally speaking, the smaller the block, the larger the maximum embedding capacity. However, as the embedding capacity increases, the visual quality of the encrypted image will also decrease. This algorithm is implemented on a fixed 3×3 block size. The method used in Algorithm 1 also embeds on a fixed 3×3 image block size, but the difference is that Algorithm 1 can embed up to 6 bits of data in an image block, while this algorithm can embed up to 7 bits of data. Compared with Algorithm 1, this algorithm has certain advantages. Figure 9 From the simulation experiment results, it can be seen that the embedding capacity of this algorithm is improved compared with the other three algorithms. By making full use of the pixels in the image block to embed watermark information, the maximum embedding capacity is effectively improved while ensuring better visual quality.

[0167] The above embodiments are intended only to illustrate the technical concepts and features of the present invention. Their purpose is to enable those skilled in the art to understand the contents of the present invention and implement them accordingly. They are not intended to limit the scope of protection of the present invention. Any equivalent changes or modifications made in accordance with the spirit of the present invention are intended to be covered by the scope of protection of the present invention.

Claims

1. A block-resection embedding reversible watermark hiding method based on IPVO, characterized in that: The watermark embedding method includes the following steps: Step 1: First, divide all pixels of a given 8-bit grayscale image I except the first row into 3×3 non-overlapping pixel blocks {X1, X2, ... X N }, the boundary pixels that cannot be divided are filled with zero, where N is the total number of pixel blocks; Step 2: If there are pixels with a value of 255 or 0 in a certain pixel block, mark the block as L LM(i) =1, otherwise marked as 0, and finally all L LM Compressed to a length of L CLM The bit stream string, i.e. the location map of the image; Step 3: For L LM(i) =1 No operation is performed on L LM(i) = 0 pixel block complexity calculation, get the local complexity N NL , according to the local complexity of L LM(i) = 0 pixel blocks are sorted in ascending order; Step 4: According to the order of local complexity, select the low-complexity pixel block and subdivide it into 3 sub-blocks, and embed the watermark information b in the order of sub-block C → sub-block A → sub-block B. After all the watermark information is embedded, the last pixel block embedded with data is recorded as X. end ; The three sub-blocks are divided as follows: the middle pixel block of the 3×3 non-overlapping pixel blocks is used as sub-block C, the three pixel blocks in the upper left corner are used as sub-block A, and the L-shaped 5 pixel blocks in the lower right corner are used as sub-block B; Step 5: Set the block size and end position X end The position map is embedded into the least significant bit (LSB) of the first row of the image as auxiliary data to obtain the final encrypted image I'.

2. The method for hiding reversible watermarks by block subdivision and embedding based on IPVO according to claim 1, characterized in that: It also includes a watermark extraction method, which specifically includes the following steps: S1: First, read the LSB of the first row of pixels of the encrypted image I', extract the compressed auxiliary information, and obtain the position map; S2: Then divide all pixels except the first row into non-overlapping 3×3 pixel blocks, and find the L of each block. LM (i), calculate each L LM(i) = 0 and sort in ascending order; S3: Divide each 3×3 pixel block into 3 sub-blocks in the order of pixel block complexity from low to high, and extract the watermark information in the order of sub-block B → sub-block A → sub-block C, and extract the compressed bit stream S LSB The three sub-blocks are divided as follows: the middle pixel block of the 3×3 non-overlapping pixel blocks is used as sub-block C, the three pixel blocks in the upper left corner are used as sub-block A, and the L-shaped 5 pixel blocks in the lower right corner are used as sub-block B; S4: After restoring the pixel block to the original block of the image, decompress S LSB , replace the LSB bit of the first row, and finally restore the entire original image I.

3. The IPVO-based block subdivision and embedding reversible watermark hiding method according to claim 1 or 2, characterized in that: When embedding watermark information into sub-block C, the diamond prediction strategy is used to predict and obtain the predicted value, and the watermark information is embedded according to the prediction error. The prediction value obtained by using the diamond prediction strategy is specifically: Assume that the pixel value p5 of sub-block C is l i,j , and its prediction process is shown in formula (1): the i,j =ω1·r1+ω2·r2+ω3·r3+ω4·r4(1) Among them, l' i,j is the pixel value l i,j The predicted value of , where i and j represent pixel coordinates; ω1, ω2, ω3, and ω4 are weight values ​​between groups of diamond blocks, satisfying ω1+ω2+ω3+ω4=1; r1, r2, r3, and r4 are the means between groups; the division method between groups of diamond blocks is: the 4 pixels on the cross area are numbered clockwise, and each group of 3 pixels is divided into 4 groups; The inter-group mean is determined after the grayscale values ​​of each group are sorted in ascending order, and the distance between each group is further determined. The sum of the inter-group differences of the four groups is determined based on the distance between each group, and the weight value between each group of the final diamond block is determined using the distance between each group and the sum of the inter-group differences.

4. The method for hiding reversible watermarks by block subdivision and embedding based on IPVO according to claim 3, characterized in that: The specific process of determining the weight values ​​between groups of diamond blocks is as follows: Step 4.1: First, the target pixel (i.e., the pixel value p5) is numbered clockwise on the four pixels in the cross area, with each group of three pixels divided into four groups, and the grayscale values ​​of each group of pixels are sorted in ascending order to obtain v m σ(1) ≤v m σ(2) ≤v m σ(3) , 1≤m≤4, and the mean values ​​r1, r2, r3, and r4 between groups are calculated using formula (2): Among them, v m σ(1) ,v m σ(2) ,v m σ(3) Indicates the first, second, and third pixel grayscale values ​​in each group after sorting in ascending order from small to large. σ(1), σ(2), and σ(3) represent pixel grayscale value subscripts and have no actual meaning. 1≤m≤4 represents the first to fourth groups. Step 4.2: Subtract the minimum value from the maximum value in each group to obtain the four inter-group distances e i , 1≤i≤4, representing the distance between the four groups, which is used to judge the texture degree. The calculation is as follows: According to the calculated distances between the groups, the sum of the inter-group differences e of the four groups is calculated. sum , then calculate the weights ω'1, ω'2, ω'3, ω'4 of each group, and then normalize the weight values ​​to obtain ω1, ω2, ω3, ω4:

5. The method for hiding reversible watermarks by block subdivision and embedding based on IPVO according to claim 4 is characterized in that: The sub-block C embeds watermark information according to the prediction error, specifically: calculate the prediction error value d i,j , expand the prediction error and embed the watermark information, the original pixel becomes L i,j =E i,j +l' i,j : d i,j =l i,j -l' i,j (6)。 E i,j =2d i,j +b(7)。 6. A block-resection-embedded reversible watermark hiding method based on IPVO according to claim 1 or 2, characterized in that: When embedding watermark information into sub-block A, a pre-sorted pixel value sorting scheme is adopted, and then the IPVO algorithm is used for embedding; the details are as follows: First, predict the pixel values ​​of the three pixels in sub-block A. Set u1, u2, and u3 as the predicted values ​​of pixels p1, p2, and p4 within the block, and p3, p5…p9 as the pixel values ​​within the 3×3 block: Once a set of predictions is obtained, determine the difference between the pixel predictions: Then determine the scanning order based on the difference in the predicted values, and perform sequential scanning using the corresponding scanning order: When |d1|≥|d2|: When d1≥0 and d2≥0, scan in the order of p1→p2→p4; When d1≥0 and d2<0, scan in the order of p1→p4→p2; When d1<0 and d2≥0, scan in the order of p2→p4→p1; When d1<0 and d2<0, scan in the order of p4→p2→p1; When |d1|≤|d2|: When d1≥0 and d2≥0, scan in the order of p1→p2→p4; When d1≥0 and d2<0, scan in the order of p4→p1→p2; When d1<0 and d2≥0, scan in the order of p2→p1→p4; When d1<0 and d2<0, scan in the order of p4→p2→p1; After the scanning sequence, IPVO is used to embed the watermark, and when extracting the watermark, the inverse process of IPVO is used to extract it.

7. The IPVO-based block subdivision and embedding reversible watermark hiding method according to claim 1 or 2, characterized in that: When embedding watermark information into sub-block B, the pixel block is scanned from top to bottom and from right to left to obtain the pixel sequence {p3, p6, p9, p8, p7}, which is then sorted in ascending order to obtain the sequence {p τ(1) ,p τ(2) ,p τ(3) ,p τ(4) ,p τ(5) }, if p τ(w) =p τ(j) , and w≤j, then τ(w)≤τ(j), calculate the prediction error e 2,j , as shown below: e 2,j =p s -p t (10) Where, j∈{1,2,3,4}; when j∈{1,2}, s=min{τ(j),τ(3)}, t=max{τ(j),τ(3)}; when j∈{3,4}, s=min{τ(j+1),τ(3)}, t=max{τ(j+1),τ(3)}; after obtaining the prediction error, the prediction error is modified to embed the watermark information b as shown below: After the prediction error is modified, when j∈{1,2} and j∈{3,4}, the p corresponding to sub-block B τ(j) With p τ(j+1) They are modified as shown in formula (16):

8. The IPVO-based block subdivision and embedding reversible watermark hiding method according to claim 1 or 3, characterized in that: The complexity of the pixel block is calculated to obtain the local complexity, which is as follows: Define a circle of pixels in a 3×3 pixel block as the nearest pixels adjacent to the pixel block, and let it be the pixel set C. For the pixel block, its local complexity N NL is defined as: C={p i-1,j+m ,p i+3,j+m ,p i+n,j-1 ,p i+n,j+3 |m=-1,0,1,2,3;n=0,1,2} (13) in: is the average value of pixels in pixel set C.

9. The method for hiding reversible watermarks by block subdivision and embedding based on IPVO according to claim 5, characterized in that: When pixel extraction is performed on sub-block C, specifically: In the pixel extraction stage, for a pixel containing watermark information, the pixel value is L i,j , calculate L i,j The predicted value L' i,j , and then obtain its prediction error E' i,j , while recovering the original prediction error d i,j , the formula is as follows: AND' i,j =L i,j -THE' i,j (15) b=E' i,j mod2(16) L i,j =The i,j +d i,j (18) 10. The IPVO-based block subdivision and embedding reversible watermark hiding method according to claim 7, characterized in that: When extracting the watermark from sub-block B, the pixel sequence obtained by scanning and sorting the 5 pixel blocks in ascending order using the same method is {p' τ(1) ,p' τ(2) ,p' τ(3) ,p' τ(4) ,p' τ(5) }, also calculate the prediction error e' 2,j =p s -p t , then extract the watermark information b as follows: After extracting the watermark information, when j∈{1,2} and j∈{3,4}, the p corresponding to the sub-block B is τ(j) With p τ(j+1) Restore to original pixels as follows: