Reversible image watermarking method and device based on inter-block prediction error histogram shift
By using inter-block correlation in the carrier image to generate and translate the prediction error histogram, the embedding capacity of the reversible digital watermark is improved, the problem of insufficient embedding capacity in the prior art is solved, and the reliability and practicality of the watermark are improved.
Patent Information
- Application Number
- CN202011086043.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-12
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2040-10-12
AI Technical Summary
The existing reversible digital watermarking method based on prediction error histograms has a low embedding capacity because the embedding capacity depends on the number of pixels at the peak point of the histogram, which reduces the reliability and practicality of the watermark and has a poor user experience.
By dividing the carrier image into multiple images, using the correlation between image blocks, the peak points and zero-value points in the prediction error histogram are generated and translated, thereby improving the embedding capacity, and embedding watermarks using the inter-block prediction error histogram translation technology .
It effectively improves the reliability and practicality of watermarks, improves the embedded capacity, enhances the user experience, and solves the problem of insufficient embedded capacity.
Smart Images

Figure CN114022336B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of digital watermark technology, and in particular to a reversible image watermarking method and device based on inter-block prediction error histogram shift. Background Art
[0002] At present, reversible digital watermarking technology can embed watermark information with specific functions into multimedia carriers, so as to protect the content of multimedia or communicate secretly, and after extracting the watermark at the extraction end, the watermark carrier can be restored to its original state without loss. Therefore, reversible digital watermarking technology can be widely used in fields that require watermarks to achieve content protection and have special requirements for the integrity of the original carrier. For example, in the field of medical image applications, it can embed the patient's diagnostic information into the corresponding medical image in the form of a watermark, and the original medical image can be obtained during extraction for high-quality diagnosis and further processing; it can also be applied to military, medical and remote sensing fields, and has extremely broad application prospects.
[0003] However, with the continuous development of science and technology, the quality and capacity requirements of digital watermarks are getting higher and higher. In the related technology, the reversible digital watermarking method based on the prediction error histogram uses peak point pixels and zero point pixels to embed "0" and "1" respectively to achieve the purpose of watermark information embedding. However, since the embedding capacity depends on the number of histogram peak point pixels, and the number of peak point pixels reflects the degree of correlation of a certain area of the image, the embedding capacity is subject to certain restrictions, the embedding capacity is low, and the reliability and practicality of the watermark are reduced, which needs to be improved urgently.
[0004] Application Contents
[0005] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.
[0006] To this end, the first purpose of the present invention is to propose a reversible image watermarking method based on inter-block prediction error histogram translation, which can utilize the correlation of image blocks in different areas to improve the embedding capacity of the prediction error histogram technology, effectively improve the reliability and practicality of the watermark, and enhance the user experience.
[0007] The second object of the present invention is to provide a reversible image watermarking device based on inter-block prediction error histogram shift.
[0008] A third objective of the present invention is to provide an electronic device.
[0009] A fourth object of the present invention is to provide a non-transitory computer-readable storage medium.
[0010] To achieve the above-mentioned purpose, the first aspect of the present application provides a reversible image watermarking method based on inter-block prediction error histogram shift, comprising the following steps: dividing a carrier image into multiple blocks of images according to a preset division strategy, and obtaining a prediction value of each block of images according to the central pixels of the multiple blocks of images, and obtaining a prediction error of a non-central pixel, so as to replace the non-central pixel to-be-measured value with the prediction error; selecting the central pixel of each block of images according to a preset selection strategy, and recombining a central pixel image based on the central pixels of each block of images, and dividing the central pixel image into multiple sub-central pixel images according to the preset division strategy, so as to calculate the prediction error of each sub-central pixel image based on the prediction value of the sub-central pixel image, obtain the prediction error image of the central pixel image, and obtain a prediction error histogram corresponding to the non-central pixel according to the same preset division strategy, so as to obtain a negative prediction error histogram and a non-negative prediction error histogram based on the prediction error histogram; respectively selecting a pair of peak points and a zero value point closest to the peak point on the histogram corresponding to each block of images, and embedding the watermark using a preset histogram shift technology.
[0011] According to the reversible image watermarking method based on inter-block prediction error histogram translation in the embodiment of the present application, the purpose of embedding watermark is achieved based on the correlation between adjacent pixels and the correlation between a certain block image and adjacent block images, and the embedding capacity of the prediction error histogram technology is improved by using the correlation between image blocks in different regions, that is, in the embedding process, the peak points and zero value points contained in the prediction error histogram generated based on the original image and the prediction error histogram corresponding to the central pixel map are different, so that different information can be embedded in the two prediction error histograms, effectively improving the reliability and practicality of the watermark and improving the user experience. Therefore, the technical problems of the reversible digital watermarking algorithm based on the prediction error histogram in the related technology, that is, because the embedding capacity depends on the number of pixels at the peak point of the histogram, and is only based on the correlation between a certain pixel and the surrounding pixels, the embedding capacity is low, the reliability and practicality of the watermark are not met, and the user experience is low, etc.
[0012] In addition, the reversible image watermarking method based on inter-block prediction error histogram shift according to the above embodiment of the present invention may also have the following additional technical features:
[0013] Optionally, in one embodiment of the present application, the watermark is embedded using a preset histogram shift technology, including: shifting the pixel points corresponding to the pixel values between the peak point and the zero value point by 1 bit in the direction of the zero value point; embedding the information with a watermark bit of 1 into the pixel points corresponding to the peak point of the histogram, and embedding the information with a watermark bit of 0 into the pixel points corresponding to the pixel values in the direction of the zero value point of the histogram and adjacent to the peak point, and cyclically embedding the watermark; for the prediction errors corresponding to the non-central pixels in the central pixel image, a negative prediction error histogram and a non-negative prediction error histogram are generated, and the watermark is embedded using the preset histogram shift method until all histograms are shifted and embedded with the watermark, thereby generating a prediction error image containing the watermark; using a preset inverse prediction error method, the prediction error value corresponding to each pixel point is added to the pixel value corresponding to the original central pixel to obtain an image containing the watermark.
[0014] Optionally, in one embodiment of the present application, when extracting the watermark, it also includes: dividing the watermarked image into blocks, extracting the pixel value corresponding to the central pixel point of each block according to a preset division strategy and the preset selection strategy, and generating the central pixel map; obtaining the prediction error corresponding to the non-central pixel according to the central pixel map, and generating a prediction error map corresponding to the prediction error based on all central pixel blocks; scanning the pixel points in the prediction error image according to the peak point and the zero value point, wherein when a peak point is encountered, information with a watermark bit of 1 is extracted, and when a pixel point corresponding to the residual value adjacent to the zero value point in the direction of the zero value point is encountered, information with a watermark bit of 0 is extracted, until the prediction error image is scanned.
[0015] Optionally, in one embodiment of the present application, during image restoration, it also includes: scanning non-central pixel points of the prediction error image, and when encountering a pixel value corresponding to the prediction error value between the peak point and the zero value point, shifting 1 bit toward the peak point, and the pixel values corresponding to the remaining prediction error values remain unchanged; using a preset inverse prediction error method to obtain the pixel value that the pixel point should correspond to, and similarly operating the non-central image to obtain the carrier image.
[0016] To achieve the above-mentioned purpose, the second aspect of the present application provides a reversible image watermarking device based on inter-block prediction error histogram shift, including: a processing module, used to divide the carrier image into multiple blocks of images according to a preset division strategy, and obtain the prediction value of each block of images according to the central pixels of the multiple blocks of images, and obtain the prediction error of the non-central pixel, so as to replace the non-central pixel to be measured value with the prediction error; an acquisition module, used to select the central pixel of each block of images according to a preset selection strategy, and recompose the central pixel image based on the central pixels of each block of images, and divide the image according to the preset division strategy. The strategy divides the central pixel image into multiple sub-central pixel images, calculates the prediction error of each sub-central pixel image based on the prediction value of the block sub-central pixel image, obtains the prediction error image of the central pixel image, and obtains the prediction error histogram corresponding to the non-central pixel according to the same preset division strategy, so as to obtain a negative prediction error histogram and a non-negative prediction error histogram based on the prediction error histogram; a watermark module is used to respectively select a pair of peak points and a zero value point closest to the peak point on the histogram corresponding to each block of the image, and embed the watermark using a preset histogram shift technology.
[0017] According to the reversible image watermarking device based on inter-block prediction error histogram translation of the embodiment of the present application, the purpose of embedding watermark is achieved based on the correlation between adjacent pixels and the correlation between a certain block image and adjacent block images, and the embedding capacity of the prediction error histogram technology is improved by using the correlation between image blocks in different regions, that is, in the embedding process, the peak points and zero value points contained in the prediction error histogram generated based on the original image and the prediction error histogram corresponding to the central pixel map are different, so that different information can be embedded in the two prediction error histograms, effectively improving the reliability and practicality of the watermark and improving the user experience. Therefore, the technical problems of the reversible digital watermarking algorithm based on the prediction error histogram in the related technology, that is, because the embedding capacity depends on the number of pixels at the peak point of the histogram, and is only based on the correlation between a certain pixel and the surrounding pixels, resulting in low embedding capacity, unsatisfactory reliability and practicality of the watermark, and low user experience, are solved.
[0018] In addition, the reversible image watermarking device based on inter-block prediction error histogram shift according to the above embodiment of the present invention may also have the following additional technical features:
[0019] Optionally, in one embodiment of the present application, the watermark module includes: a translation unit, which is used to shift the pixel points corresponding to the pixel values between the peak point and the zero value point by 1 bit toward the zero value point; an embedding unit, which is used to embed information with a watermark bit of 1 into the pixel points corresponding to the peak point of the histogram, and embed information with a watermark bit of 0 into the pixel points corresponding to the pixel values in the direction of the zero value point of the histogram and adjacent to the peak point, and cyclically embed the watermark; a generation unit, which is used to generate a negative prediction error histogram and a non-negative prediction error histogram for the prediction error corresponding to the non-central pixel point in the central pixel image, and embed the watermark using the preset histogram translation method until all histograms are translated and embedded with the watermark, thereby generating a prediction error image containing a watermark; a watermark unit, which is used to add the prediction error value corresponding to each pixel point to the pixel value corresponding to the original central pixel using a preset inverse prediction error method to obtain an image containing a watermark.
[0020] Optionally, in one embodiment of the present application, it also includes: an extraction module, which is used to divide the watermarked image into blocks when extracting the watermark, and extract the pixel value corresponding to the central pixel point of each block according to a preset division strategy and the preset selection strategy to generate the central pixel map; obtain the prediction error corresponding to the non-central pixel according to the central pixel map, and generate a prediction error map corresponding to the prediction error based on all central pixel blocks; scan the pixel points in the prediction error image according to the peak point and the zero value point, wherein when a peak point is encountered, the information with a watermark bit of 1 is extracted, and when the pixel point corresponding to the residual value adjacent to the zero value point in the direction of the zero value point is encountered, the information with a watermark bit of 0 is extracted, until the prediction error image is scanned.
[0021] Optionally, in one embodiment of the present application, it also includes: a recovery module, which is used to scan the non-central pixel points of the prediction error image during image restoration, and when encountering a pixel value corresponding to the prediction error value between the peak point and the zero value point, shift it by 1 bit in the direction of the peak point, and the pixel values corresponding to the remaining prediction error values remain unchanged; use a preset inverse prediction error method to obtain the pixel value that the pixel point should correspond to, and similarly operate on the non-central image to obtain the carrier image.
[0022] To achieve the above-mentioned purpose, the third aspect of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the reversible image watermarking method based on inter-block prediction error histogram shift as described in the above-mentioned embodiment.
[0023] To achieve the above-mentioned objectives, the fourth aspect embodiment of the present application provides a non-temporary computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the reversible image watermarking method based on inter-block prediction error histogram shift as described in the above embodiment.
[0024] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0026] Figure 1 A flowchart of a reversible image watermarking method based on inter-block prediction error histogram shifting according to an embodiment of the present application;
[0027] Figure 2 A schematic diagram of dividing a carrier image according to an embodiment of the present application;
[0028] Figure 3 (a) is a schematic diagram of selecting a certain image according to an embodiment of the present invention;
[0029] Figure 3 (b) is a schematic diagram of an image after the prediction error is calculated according to an embodiment of the present invention;
[0030] Figure 4 A schematic diagram of an image after the prediction error is calculated according to an embodiment of the present application;
[0031] Figure 5 is a schematic diagram of a prediction error map of a central pixel map according to an embodiment of the present application;
[0032] Figure 6 is a schematic diagram of a prediction error histogram corresponding to a non-central pixel of an original image according to an embodiment of the present application;
[0033] Figure 7 (a) is a schematic diagram of a negative prediction error histogram according to an embodiment of the present application;
[0034] Figure 7 (b) A schematic diagram of a non-negative prediction error histogram according to an embodiment of the present application;
[0035] Figure 8 It is a flowchart of a reversible image watermarking method based on inter-block prediction error histogram shift according to a specific embodiment of the present application;
[0036] Fig. 9 It is a flowchart of a reversible image watermarking method based on inter-block prediction error histogram shift according to another specific embodiment of the present application;
[0037] Fig.10 is an example diagram of a reversible image watermarking device based on inter-block prediction error histogram shift according to an embodiment of the present application;
[0038] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0040] Before describing the reversible image watermarking method and apparatus based on inter-block prediction error histogram shifting according to an embodiment of the present invention, the defects of the reversible digital watermarking algorithm based on the prediction error histogram are briefly described below.
[0041] Specifically, the reversible digital watermarking technology based on the prediction error histogram: first divide the carrier image into n*n small blocks, consider the correlation of adjacent pixels in each small block, that is, use the central pixel of each block as the prediction value of the whole block to obtain the prediction error of each adjacent pixel. The smaller the number of pixels contained in each small block of the image, the higher the correlation between the central pixel and the non-central pixel, so that the prediction error corresponding to the obtained pixel point is more concentrated to 0. Then generate the histogram corresponding to the prediction error, and divide the histogram into negative histogram and non-negative histogram. Select a pair of peak points and zero points on these two histograms, and embed the watermark by using the histogram shift technology. After the watermark is completely embedded, use the inverse prediction error technology to add the prediction error value corresponding to the non-central pixel point to the pixel value of the central pixel point, so as to generate a watermarked image, which improves the embedding capacity to a certain extent, and can generate a large number of zero points, effectively solving the overflow problem.
[0042] However, since it only considers the pixel correlation within each small block of the image, it produces a prediction error histogram with a very high number of peak pixels, while it does not consider the correlation between blocks, which limits the embedding capacity to a certain extent. The embedding capacity is low, which reduces the reliability and practicality of the watermark and needs to be improved urgently.
[0043] The present invention is based on the above problems and proposes a reversible image watermarking method based on inter-block prediction error histogram shift and a reversible image watermarking device based on inter-block prediction error histogram shift.
[0044] The following describes a reversible image watermarking method and device based on inter-block prediction error histogram shifting according to an embodiment of the present invention with reference to the accompanying drawings. First, the reversible image watermarking method based on inter-block prediction error histogram shifting according to an embodiment of the present invention will be described with reference to the accompanying drawings.
[0045] Specifically, Figure 1 A schematic flow chart of a reversible image watermarking method based on inter-block prediction error histogram shifting provided in an embodiment of the present application.
[0046] like Figure 1 As shown, the reversible image watermarking method based on inter-block prediction error histogram shifting includes the following steps:
[0047] In step S101, the carrier image is divided into multiple image blocks according to a preset division strategy, and the prediction value of each image block is obtained according to the central pixels of the multiple image blocks, and the prediction error of the non-central pixel is obtained to replace the non-central pixel to be measured with the prediction error.
[0048] In the actual implementation process, the embodiment of the present application first enters the preparation stage. Figure 2 As shown, the preset division strategy is to divide the carrier image into 3*3 small blocks, where the standard of the block size can be selected to be as small as possible, so as to better utilize the correlation of pixels within the block and the correlation between blocks. i,j , where, as mentioned above, since the block size is small, the correlation between the pixels in each image block is very high, so the central pixel can be selected as the predicted value p of each image block i,j , then the non-central pixel x i,j The prediction error pe i,j :
[0049] pe i,j =x i,j -p i,j .
[0050] Finally, after calculating the prediction error, the value of the non-center pixel is replaced by the prediction error. Figure 3 As shown, (a) is a selected image, (b) is the image after the prediction error is calculated, and Figure 4 for Figure 2 (b) Image after calculating the prediction error.
[0051] In step S102, the central pixels of each block of the image are selected according to a preset selection strategy, and the central pixel image is reconstructed based on the central pixels of each block of the image, and the central pixel image is divided into a plurality of sub-central pixel images according to a preset division strategy, so as to calculate the prediction error of each sub-central pixel image based on the prediction value of the block sub-central pixel image, obtain the prediction error image of the central pixel image, and obtain the prediction error histogram corresponding to the non-central pixels according to the same preset division strategy, so as to obtain a negative prediction error histogram and a non-negative prediction error histogram based on the prediction error histogram.
[0052] Specifically, in the embodiment of the present application, in order to further improve the embedding capacity, the embodiment of the present application selects the central pixel of each small block according to a preset selection strategy, such as a selection order from left to right and from top to bottom, and recomposes a new image, which is recorded as a central pixel map, such as Figure 5 As shown, the central pixel map is divided into 3*3 small blocks using the same method as above, and the prediction error of each small block is calculated again according to the above method to obtain the prediction error map of the central pixel map, as shown in Figure 6 As shown, the prediction error histogram corresponding to the non-central pixel of each 3*3 sub-block corresponding to the above is generated, and then the histogram is divided into two: a negative prediction error histogram and a non-negative prediction error histogram, as shown in Figure 7 As shown, Figure 7 It is the prediction error histogram corresponding to the non-central pixels of the original image.
[0053] In step S103, a pair of peak points and a zero-value point closest to the peak point on the histogram corresponding to each image block are selected respectively, and a watermark is embedded using a preset histogram shifting technique.
[0054] Those skilled in the art should understand that after selecting a pair of peak points and the zero value point closest to the peak point on the two histograms corresponding to each block, in order to improve the embedding capacity, the traditional histogram shifting technology is used to embed the watermark.
[0055] That is to say, the embodiment of the present application takes into account the correlation between adjacent blocks, first extracts the central pixels of each small block to form a new image, and then uses the block processing method to embed a prediction error histogram. It should be noted that if the number of pixels contained in each small block of the image is smaller, the more central pixel values can be used, and then the new image that can be generated contains more pixels, so that more information can be embedded, which means that the embedding capacity is effectively improved. Thus, the reversible digital watermarking algorithm based on the prediction error histogram in the related art is solved. Since the embedding capacity depends on the number of pixels at the peak point of the histogram, it is only based on the correlation between a certain pixel and the surrounding pixels, resulting in a low embedding capacity, and the reliability and practicality of the watermark cannot be met, and the user experience is low. Technical problems.
[0056] Optionally, in one embodiment of the present application, a watermark is embedded using a preset histogram shift technology, including: shifting the pixel points corresponding to the pixel values between the peak point and the zero value point by 1 bit in the direction of the zero value point; embedding the information with a watermark bit of 1 into the pixel points corresponding to the peak point of the histogram, and embedding the information with a watermark bit of 0 into the pixel points corresponding to the pixel values in the direction of the zero value point of the histogram and adjacent to the peak point, and cyclically embedding the watermark; for the prediction error corresponding to the non-central pixel point in the central pixel image, a negative prediction error histogram and a non-negative prediction error histogram are generated, and the watermark is embedded using a preset histogram shift method until all histograms are shifted and embedded with the watermark, thereby generating a prediction error image containing a watermark; using a preset inverse prediction error method, the prediction error value corresponding to each pixel point is added to the pixel value corresponding to the original central pixel to obtain an image containing a watermark.
[0057] As a possible implementation method, step S103 includes:
[0058] Step 1: Shift the pixel points corresponding to the pixel values between the peak point and the zero value point by 1 bit toward the zero value point. At this time, the pixel values adjacent to the peak point in the direction of the zero value point are empty, thus preparing for embedding the watermark.
[0059] Step 2: embed the information with watermark bit 1 into the pixel corresponding to the peak point of the histogram, embed the information with watermark bit 0 into the pixel corresponding to the pixel value adjacent to the peak point in the direction of the zero value point of the histogram, and embed the watermark cyclically.
[0060] Step 3: For the prediction errors corresponding to the non-central pixels in the central pixel map, generate a negative prediction error histogram and a non-negative prediction error histogram according to the above method, and embed the watermark using the histogram shift method of the related technology.
[0061] Step 4: After all histograms have been translated and embedded with watermarks, a prediction error image containing a watermark is generated. At this time, the value corresponding to the central pixel of the image is the pixel value, and the values corresponding to other pixels are prediction error values, which can be obtained through prediction error technology.
[0062] Step 5: Using the inverse prediction error technology, add the prediction error value corresponding to each pixel point to the pixel value corresponding to the original center pixel to obtain the watermarked image:
[0063] x' i,j =pe i,j +p i,j + b,
[0064] Finally, the values corresponding to all pixels are the pixel values x' after embedding the watermark i,j , indicating that the embedding work is completed.
[0065] Based on the description of other related embodiments, it can be understood that during the embedding process, the peak points and zero value points contained in the prediction error histogram generated by the original image and the prediction error histogram corresponding to the central pixel image are different, that is, different information can be embedded in the two prediction error histograms, so the embodiment of the present application can achieve an improvement in embedding capacity through secondary embedding.
[0066] Optionally, in one embodiment of the present application, when extracting the watermark, it also includes: dividing the watermarked image into blocks, extracting the pixel values corresponding to the central pixel points of each block according to a preset division strategy and a preset selection strategy, and generating a central pixel map; obtaining the prediction error corresponding to the non-central pixel according to the central pixel map, and generating a prediction error map corresponding to the prediction error based on all central pixel blocks; scanning the pixel points in the prediction error image according to the peak points and the zero value points, wherein when encountering the peak point, extracting the information with the watermark bit of 1, and when encountering the zero value point direction, when encountering the pixel point corresponding to the residual value adjacent to the zero value point, extracting the information with the watermark bit of 0, until the prediction error image is scanned.
[0067] In some embodiments, the watermark extraction process is the inverse process of embedding, that is, the central pixel map is extracted first, and then the non-central pixel map is operated, which includes the following steps:
[0068] Step 1: Divide the watermarked image into blocks, the block size is the block size agreed with the receiver, that is, n*n. Then, the pixel values corresponding to the central pixel points of each block can be extracted from top to bottom and from left to right to form a new map, namely the central pixel map.
[0069] Step 2: For the center pixel map, the pixel value corresponding to the center pixel remains unchanged, which is the predicted value p of the non-center pixel. i,j It should be noted that the prediction error pe corresponding to the non-central pixel is obtained by subtracting the pixel value corresponding to the central pixel from the pixel value corresponding to the pixel points around the central pixel. i,j. .
[0070] Step 3: All central pixel blocks generate prediction error images corresponding to their prediction errors. Scan the pixels in the prediction error image according to each pair of peak points and zero value points agreed with the receiver. When a peak point is encountered, the information with the watermark bit of 1 is extracted. When a pixel corresponding to the residual value of the zero value point is encountered in the direction of the zero value point, the information with the watermark bit of 0 is extracted. After the prediction error image is scanned, it means that the watermark embedded in the central pixel block has been extracted.
[0071] In addition, in one embodiment of the present application, when restoring an image, it also includes: scanning non-central pixel points of the prediction error image, and when encountering a pixel value corresponding to a prediction error value between a peak point and a zero value point, shifting it by 1 bit toward the peak point, and the pixel values corresponding to the remaining prediction error values remain unchanged; using a preset inverse prediction error method to obtain the pixel value that the pixel point should correspond to, and similarly operating on the non-central image to obtain a carrier image.
[0072] In some embodiments, to restore the original carrier image, it includes the following steps:
[0073] Step 1: Scan the non-central pixel points in the above prediction error image again. When encountering the pixel value corresponding to the prediction error value between the peak point and the zero value point (including the zero value point), shift it 1 bit toward the peak point, and the pixel values corresponding to the other prediction error values remain unchanged.
[0074] Step 2: Use the inverse prediction error technology to obtain the pixel value that the pixel point should correspond to. Specifically, add the prediction error value corresponding to the non-central pixel point of each central pixel block to the pixel value corresponding to the central pixel point of the central pixel block in the image to obtain the pixel value corresponding to the non-central pixel point of each central pixel block.
[0075] Step 3: Repeat the above extraction step 2 - restoration step 2 for the non-central pixel image, and finally obtain the original carrier image.
[0076] The following examples are listed in conjunction with the accompanying drawings for schematic illustration.
[0077] First, if Figure 8 As shown, the watermark embedding of the embodiment of the present application includes the following steps:
[0078] Step S801: Divide the carrier image into n*n blocks.
[0079] Firstly, the carrier image is divided into multiple images according to the partitioning strategy.
[0080] Step S802: Subtract the central pixel block from the non-central pixel block to obtain a residual value.
[0081] Step S803: extract the non-central pixel points of each small block to form a central pixel block.
[0082] Step S804: Subtract the central pixel block from the non-central pixel block to obtain a residual value.
[0083] Step S805: remove the central pixel in each block, and generate a negative residual value histogram and a non-negative residual histogram corresponding to the carrier image block and the central pixel block respectively.
[0084] That is, a negative prediction error histogram and a non-negative prediction error histogram are obtained based on the prediction error histogram.
[0085] Step S806: Select a pair of peak points and zero value points in each histogram corresponding to the carrier image block.
[0086] Step S807: Shift the pixel points corresponding to the pixel values between the peak point and the zero-value point by 1 bit toward the zero-value point.
[0087] Step S808: Determine whether the watermark bit is 1, if so, execute step S810, otherwise execute step S809.
[0088] Step S809: embed the watermark into the pixel point corresponding to the residual value of the next digit of the peak point in the direction of the zero-value point.
[0089] Step S810: embed the watermark into the peak point.
[0090] Step S811: obtaining the residual value after watermark embedding corresponding to the non-central pixel in the carrier image block.
[0091] Step S812: The residual value is added to the pixel value of the central pixel corresponding to the non-central pixel.
[0092] Step S813: Select a pair of peak points and zero value points in each histogram corresponding to the central pixel block.
[0093] Step S814: Shift the pixel values corresponding to the pixel values between the peak point and the zero value point by 1 bit toward the zero value point.
[0094] Step S815: Determine whether the watermark bit is 1, if so, execute step S817, otherwise execute step S816.
[0095] Step S816: embed the watermark into the pixel point corresponding to the residual value of the next digit of the peak point in the direction of the zero-value point.
[0096] Step S817: embed the watermark into the peak point.
[0097] Step S818: obtaining residual values corresponding to non-central pixels in the central pixel block after embedding the watermark.
[0098] Step S819: The residual value is added to the pixel value of the central pixel corresponding to the non-central pixel.
[0099] Step S820: Generate a carrier image containing a watermark.
[0100] After all histograms have been translated and embedded with watermarks, a prediction error image containing a watermark is generated.
[0101] Secondly, if Fig. 9 As shown, the watermark extraction and image restoration of the embodiment of the present application includes the following steps:
[0102] Step S901: Divide the watermarked image into n*n blocks.
[0103] Step S902: extract non-central pixel points of each block to form a central pixel block.
[0104] Step S903: Subtract the central pixel block from the non-central pixel block to obtain a residual value.
[0105] Step S904: Generate a residual map corresponding to the central pixel block.
[0106] Step S905: Scan the residual image of the central pixel block.
[0107] Step S906: Determine whether the pixel point is a peak point, if yes, execute step S907, otherwise execute step S909.
[0108] Step S907: Determine whether the residual value corresponding to the pixel point is located in the direction of the zero value point and close to the peak point. If so, execute step S911; otherwise, execute step S908.
[0109] Step S908: The residual value remains unchanged.
[0110] Step S909: extract the information whose watermark bit is 1.
[0111] Step S910: Generate a watermark sequence and scan the residual image corresponding to the central pixel block.
[0112] Step S911: extract information with watermark bits being 0.
[0113] Step S912: Determine whether the pixel point is located between the peak point and the zero value point, if so, execute step S914, otherwise execute step S913.
[0114] Step S913: The pixel value remains unchanged.
[0115] Step S914: Shift by 1 bit toward the peak point.
[0116] Step S915: Add the residual value corresponding to the non-central pixel to the value corresponding to the central pixel to obtain the pixel value corresponding to each pixel point.
[0117] Step S916: Subtract the central pixel block from the non-central pixel block of the carrier pixel block to obtain a residual value.
[0118] Step S917: Perform inverse linear transformation through the carrier image block to generate the original carrier image.
[0119] Step S918: Generate a residual map corresponding to the central pixel block.
[0120] Step S919: Scan the residual image of the carrier pixel block and execute step S806 in a loop.
[0121] Based on the above embodiments, it can be understood that in the reversible digital watermarking work based on the prediction error histogram, the embodiment of the present application utilizes the correlation between each small block of the image after block processing when designing the carrier of the embedded image, thereby greatly improving the embedding capacity of the watermark, and when performing information hiding, the image can still maintain a high level of imperceptibility while greatly improving the embedding capacity, so that the present invention can have a better effect when applied to reversible digital watermarking.
[0122] According to the reversible image watermarking method based on inter-block prediction error histogram translation in the embodiment of the present application, the purpose of embedding watermark is achieved based on the correlation between adjacent pixels and the correlation between a certain block image and adjacent block images, and the embedding capacity of the prediction error histogram technology is improved by using the correlation between image blocks in different regions, that is, in the embedding process, the peak points and zero value points contained in the prediction error histogram generated based on the original image and the prediction error histogram corresponding to the central pixel map are different, so that different information can be embedded in the two prediction error histograms, effectively improving the reliability and practicality of the watermark and improving the user experience. Therefore, the technical problems of the reversible digital watermarking algorithm based on the prediction error histogram in the related technology, that is, because the embedding capacity depends on the number of pixels at the peak point of the histogram, and is only based on the correlation between a certain pixel and the surrounding pixels, the embedding capacity is low, the reliability and practicality of the watermark are not met, and the user experience is low, etc.
[0123] Next, a reversible image watermarking device based on inter-block prediction error histogram shift proposed in an embodiment of the present application is described with reference to the accompanying drawings.
[0124] Fig.10 It is a block diagram of a reversible image watermarking device based on inter-block prediction error histogram shift according to an embodiment of the present application.
[0125] like Figure 2 As shown, the reversible image watermarking device 10 based on inter-block prediction error histogram shift includes: a processing module 100 , an acquisition module 200 and a watermarking module 300 .
[0126] Specifically, the processing module 100 is used to divide the carrier image into multiple image blocks according to a preset division strategy, and obtain the prediction value of each image block according to the central pixels of the multiple image blocks, and obtain the prediction error of the non-central pixel to replace the non-central pixel to be measured with the prediction error.
[0127] The acquisition module 200 is used to select the central pixel of each block of the image according to a preset selection strategy, and reconstruct the central pixel image based on the central pixel of each block of the image, and divide the central pixel image into multiple sub-central pixel images according to a preset division strategy, so as to calculate the prediction error of each sub-central pixel image based on the prediction value of the block sub-central pixel image, obtain the prediction error image of the central pixel image, and obtain the prediction error histogram corresponding to the non-central pixel according to the same preset division strategy, so as to obtain a negative prediction error histogram and a non-negative prediction error histogram based on the prediction error histogram.
[0128] The watermark module 300 is used to select a pair of peak points and a zero-value point closest to the peak point on the histogram corresponding to each image block, and embed the watermark using a preset histogram shifting technology.
[0129] Optionally, in one embodiment of the present application, the watermark module 300 includes: a translation unit, an embedding unit, a generation unit and a watermark unit.
[0130] The translation unit is used to translate the pixel points corresponding to the pixel values between the peak point and the zero value point by 1 bit toward the zero value point.
[0131] The embedding unit is used to embed the information with the watermark bit of 1 into the pixel points corresponding to the peak points of the histogram, and embed the information with the watermark bit of 0 into the pixel points corresponding to the pixel values in the direction of the zero value point of the histogram and adjacent to the peak point, and cyclically embed the watermark.
[0132] The generating unit is used to generate a negative prediction error histogram and a non-negative prediction error histogram for the prediction error corresponding to the non-central pixel point in the central pixel image, and embed the watermark using a preset histogram translation method until all histograms have completed the translation and embedding of the watermark, thereby generating a prediction error image containing the watermark.
[0133] The watermark unit is used to add the prediction error value corresponding to each pixel point to the pixel value corresponding to the original central pixel by using a preset inverse prediction error method to obtain an image containing a watermark.
[0134] Optionally, in one embodiment of the present application, the device 10 of the embodiment of the present application further includes: an extraction module.
[0135] Among them, the extraction module is used to divide the watermarked image into blocks when extracting the watermark, extract the pixel value corresponding to the central pixel point of each block according to the preset division strategy and the preset selection strategy, and generate a central pixel map; obtain the prediction error corresponding to the non-central pixel according to the central pixel map, and generate a prediction error map corresponding to the prediction error based on all central pixel blocks; scan the pixel points in the prediction error image according to the peak point and the zero value point, wherein when the peak point is encountered, the information with the watermark bit of 1 is extracted, and when the pixel point corresponding to the residual value adjacent to the zero value point in the direction of the zero value point is encountered, the information with the watermark bit of 0 is extracted, until the prediction error image is scanned.
[0136] Optionally, in one embodiment of the present application, the device 10 of the embodiment of the present application further includes: a recovery module.
[0137] Among them, the restoration module is used to scan the non-central pixel points of the prediction error image during image restoration. When encountering a pixel value corresponding to the prediction error value between the peak point and the zero value point, it is shifted 1 bit toward the peak point, and the pixel values corresponding to the remaining prediction error values remain unchanged; the pixel value that the pixel point should correspond to is obtained using a preset inverse prediction error method, and the non-central image is operated in the same way to obtain the carrier image.
[0138] It should be noted that the above explanation of the embodiment of the reversible image watermarking method based on inter-block prediction error histogram shift is also applicable to the reversible image watermarking device based on inter-block prediction error histogram shift in this embodiment, which will not be repeated here.
[0139] According to the reversible image watermarking device based on inter-block prediction error histogram translation of the embodiment of the present application, the purpose of embedding watermark is achieved based on the correlation between adjacent pixels and the correlation between a certain block image and adjacent block images, and the embedding capacity of the prediction error histogram technology is improved by using the correlation between image blocks in different regions, that is, in the embedding process, the peak points and zero value points contained in the prediction error histogram generated based on the original image and the prediction error histogram corresponding to the central pixel map are different, so that different information can be embedded in the two prediction error histograms, effectively improving the reliability and practicality of the watermark and improving the user experience. Therefore, the technical problems of the reversible digital watermarking algorithm based on the prediction error histogram in the related technology, that is, because the embedding capacity depends on the number of pixels at the peak point of the histogram, and is only based on the correlation between a certain pixel and the surrounding pixels, resulting in low embedding capacity, unsatisfactory reliability and practicality of the watermark, and low user experience, are solved.
[0140] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0141] A memory 1201 , a processor 1202 , and a computer program stored in the memory 1201 and executable on the processor 1202 .
[0142] When the processor 1202 executes the program, the reversible image watermarking method based on inter-block prediction error histogram shift provided in the above embodiment is implemented.
[0143] Furthermore, the electronic device further comprises:
[0144] The communication interface 1203 is used for communication between the memory 1201 and the processor 1202 .
[0145] The memory 1201 is used to store computer programs that can be executed on the processor 1202 .
[0146] The memory 1201 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0147] If the memory 1201, the processor 1202 and the communication interface 1203 are implemented independently, the communication interface 1203, the memory 1201 and the processor 1202 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0148] Optionally, in a specific implementation, if the memory 1201, the processor 1202 and the communication interface 1203 are integrated on a chip, the memory 1201, the processor 1202 and the communication interface 1203 can communicate with each other through an internal interface.
[0149] The processor 1202 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0150] This embodiment further provides a computer-readable storage medium on which a computer program is stored, wherein when the program is executed by a processor, the above-mentioned reversible image watermarking method based on inter-block prediction error histogram shift is implemented.
[0151] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0152] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0153] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0154] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0155] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0156] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0157] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0158] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A reversible image watermarking method based on inter-block prediction error histogram shift, characterized in that: The following steps are involved: Divide the carrier image into multiple blocks of images according to a preset division strategy, obtain the prediction value of each block of the image according to the central pixels of the multiple blocks of the image, and obtain the prediction error of the non-central pixel, so as to replace the non-central pixel to be measured with the prediction error; The central pixel of each block of the image is selected according to a preset selection strategy, and a central pixel image is recomposed based on the central pixel of each block of the image, and the central pixel image is divided into a plurality of sub-central pixel images according to the preset division strategy, so as to calculate the prediction error of each sub-central pixel image based on the prediction value of the block sub-central pixel image, obtain the prediction error image of the central pixel image, and obtain the prediction error histogram corresponding to the non-central pixel according to the same preset division strategy, so as to obtain a negative prediction error histogram and a non-negative prediction error histogram based on the prediction error histogram; as well as A pair of peak points and a zero-value point closest to the peak point on the histogram corresponding to each block of the image are respectively selected, and a watermark is embedded using a preset histogram shifting technique, wherein the pixel points corresponding to the pixel values between the peak point and the zero-value point are shifted by 1 bit toward the zero-value point; The information whose watermark bit is 1 is embedded into the pixel points corresponding to the peak point of the histogram, and the information whose watermark bit is 0 is embedded into the pixel points corresponding to the pixel values in the direction of the zero value point of the histogram and adjacent to the peak point, and the watermark is embedded cyclically; for the prediction error corresponding to the non-central pixel point in the central pixel image, a negative prediction error histogram and a non-negative prediction error histogram are generated, and the watermark is embedded using the preset histogram shifting method until all histograms have completed the shifting and embedding of the watermark, and a prediction error image containing a watermark is generated; using the preset inverse prediction error method, the prediction error value corresponding to each pixel point is added to the pixel value corresponding to the original central pixel to obtain an image containing a watermark.
2. The method according to claim 1, characterized in that When extracting watermarks, it also includes: Divide the watermarked image into blocks, extract the pixel value corresponding to the central pixel point of each block according to the preset division strategy and the preset selection strategy, and generate the central pixel map; Obtaining prediction errors corresponding to the non-central pixels according to the central pixel map, and generating prediction error maps corresponding to the prediction errors based on all central pixel blocks; According to the peak points and zero value points, the pixel points in the prediction error image are scanned, wherein when a peak point is encountered, information with a watermark bit of 1 is extracted, and when a pixel point corresponding to a residual value adjacent to the zero value point is encountered in the direction of the zero value point, information with a watermark bit of 0 is extracted until the prediction error image is scanned.
3. The method according to claim 2, characterized in that When restoring an image, it also includes: Scan the non-central pixel points of the prediction error image, and when encountering a pixel value corresponding to a prediction error value between the peak point and the zero value point, shift it by 1 bit toward the peak point, and the pixel values corresponding to the other prediction error values remain unchanged; The pixel value that the pixel point should correspond to is obtained using a preset inverse prediction error method, and the non-central image is operated similarly to obtain the carrier image.
4. A reversible image watermarking device based on inter-block prediction error histogram shift, characterized in that: include: A processing module, used to divide the carrier image into multiple blocks of images according to a preset division strategy, and obtain a prediction value of each block of the image according to the central pixels of the multiple blocks of the image, and obtain a prediction error of a non-central pixel, so as to replace the non-central pixel to-be-measured value with the prediction error; An acquisition module, used to select the central pixel of each block of the image according to a preset selection strategy, and recompose the central pixel image based on the central pixels of each block of the image, and divide the central pixel image into a plurality of sub-central pixel images according to the preset division strategy, so as to calculate the prediction error of each sub-central pixel image based on the prediction value of the block sub-central pixel image, and obtain the prediction error image of the central pixel image, and similarly obtain the prediction error histogram corresponding to the non-central pixel according to the preset division strategy, so as to obtain a negative prediction error histogram and a non-negative prediction error histogram based on the prediction error histogram; as well as A watermark module, used for selecting a pair of peak points and a zero value point closest to the peak point on the histogram corresponding to each image block, and embedding a watermark by using a preset histogram shifting technology; The watermark module comprises: A translation unit, used to translate the pixel points corresponding to the pixel values between the peak point and the zero value point by 1 bit toward the zero value point; An embedding unit, used to embed information with a watermark bit of 1 into a pixel corresponding to a peak point of the histogram, and to embed information with a watermark bit of 0 into a pixel corresponding to a pixel value in the direction of a zero value point of the histogram and adjacent to the peak point, and to embed the watermark cyclically; A generating unit, for generating a negative prediction error histogram and a non-negative prediction error histogram for prediction errors corresponding to non-central pixels in the central pixel image, and embedding a watermark using the preset histogram translation method until all histograms have completed translation and embedding of watermarks, thereby generating a prediction error image containing a watermark; The watermark unit is used to add the prediction error value corresponding to each pixel point to the pixel value corresponding to the original central pixel by using a preset inverse prediction error method to obtain an image containing a watermark.
5. The device according to claim 4, characterized in that Also includes: The extraction module is used to divide the watermarked image into blocks during watermark extraction, extract the pixel value corresponding to the central pixel point of each block according to the preset division strategy and the preset selection strategy, and generate the central pixel map; obtain the prediction error corresponding to the non-central pixel according to the central pixel map, and generate a prediction error map corresponding to the prediction error based on all central pixel blocks; scan the pixel points in the prediction error image according to the peak point and the zero value point, wherein when encountering a peak point, extract the information with the watermark bit of 1, and when encountering the pixel point corresponding to the residual value adjacent to the zero value point in the direction of the zero value point, extract the information with the watermark bit of 0, until the prediction error image is scanned.
6. The device according to claim 5, characterized in that Also includes: The restoration module is used to scan the non-central pixel points of the prediction error image during image restoration. When encountering a pixel value corresponding to the prediction error value between the peak point and the zero value point, it is shifted by 1 bit toward the peak point, and the pixel values corresponding to the remaining prediction error values remain unchanged; the pixel value that the pixel point should correspond to is obtained using a preset inverse prediction error method, and the non-central image is operated in the same way to obtain the carrier image.
7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the reversible image watermarking method based on inter-block prediction error histogram shift as described in any one of claims 1 to 3.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the reversible image watermarking method based on inter-block prediction error histogram shift as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Reversible information hiding method based on block prediction and difference value histogram translation
CN110232651A
Reversible information hiding method for carrying out multi-histogram point selection based on crisscross algorithm
CN110351450A
Methods and apparatus for reversible data hiding through histogram modification
US20040223627A1
