WO2023138303A1 - 基于dwt的数字水印方法、系统、电子设备及存储介质 - Google Patents

基于dwt的数字水印方法、系统、电子设备及存储介质 Download PDF

Info

Publication number
WO2023138303A1
WO2023138303A1 PCT/CN2022/141415 CN2022141415W WO2023138303A1 WO 2023138303 A1 WO2023138303 A1 WO 2023138303A1 CN 2022141415 W CN2022141415 W CN 2022141415W WO 2023138303 A1 WO2023138303 A1 WO 2023138303A1
Authority
WO
WIPO (PCT)
Prior art keywords
watermark
image
rgb
rgb component
component
Prior art date
Application number
PCT/CN2022/141415
Other languages
English (en)
French (fr)
Inventor
贺佳乐
Original Assignee
西安闻泰信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 西安闻泰信息技术有限公司 filed Critical 西安闻泰信息技术有限公司
Publication of WO2023138303A1 publication Critical patent/WO2023138303A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/10Image enhancement or restoration using non-spatial domain filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20064Wavelet transform [DWT]

Definitions

  • the invention discloses a DWT-based digital watermarking method, system, electronic equipment and storage medium.
  • Digital watermark technology is an effective method to realize multimedia copyright protection and information integrity assurance in the field of information hiding. Its basic idea is to embed secret watermark information in digital images to protect the copyright of digital products, just like stamping pictures to indicate ownership.
  • LSB Least Significant Bit
  • DCT Discrete Cosine Transform
  • DWT Discrete Wavelet Transform
  • the more commonly used method is to use DWT for watermark embedding.
  • the watermark dimensionality reduction process is converted into a one-dimensional matrix when the watermark is embedded, and only the high-frequency part is embedded, but the low-frequency part is not embedded. As a result, the extracted watermark is not complete when the subsequent watermark is extracted.
  • a DWT-based digital watermarking method system, electronic device, and storage medium are provided.
  • a DWT-based digital watermarking method including a watermark embedding method, comprising:
  • Discrete wavelet transform is performed on the RGB component image of the original image and the RGB component image of the watermark respectively, and the RGB component matrix information of the original image and the RGB component matrix information of the watermark are correspondingly obtained;
  • Three-color superposition is performed on the reconstructed RGB component image to obtain a watermarked image.
  • a DWT-based digital watermarking method based on the watermarked image obtained by the above-mentioned DWT-based digital watermarking method, including a watermark extraction method, including:
  • Three-color superposition is performed on the reconstructed RGB component image to obtain the extracted color watermark.
  • a DWT-based digital watermarking system including a watermark embedding device, including:
  • the original image acquisition module is configured to acquire an original color image to be embedded with a watermark
  • the original image RGB extraction module is configured to extract the RGB component of the original color image, and obtain the RGB component map of the original image
  • the original image discrete wavelet transform module is configured to perform discrete wavelet transform on the RGB component images of the original image respectively to obtain the RGB component matrix information of the original image;
  • a watermark acquisition module configured to acquire a watermarked color image to be embedded
  • the watermark RGB extraction module is configured to extract the RGB components of the watermark color image to obtain the RGB component map of the watermark;
  • the watermark discrete wavelet transform module is configured to perform discrete wavelet transform on the RGB component images of the watermark respectively to obtain the RGB component matrix information of the watermark;
  • the embedding module is configured to embed the RGB component matrix information of the watermark into the RGB component matrix information of the corresponding original image by embedding low-frequency information and high-frequency information together, so as to obtain the RGB component image after embedding the watermark;
  • the discrete wavelet inverse transform module is configured to perform discrete wavelet inverse transform on the RGB component graph after embedding the watermark respectively, so as to obtain the reconstructed RGB component graph;
  • the overlay module is configured to perform three-color overlay on the reconstructed RGB component image to obtain a watermarked image.
  • a DWT-based digital watermarking system including a watermark extraction device, including:
  • the original image acquisition module is configured to acquire an original color image that is not embedded with a watermark
  • Original image RGB extracting module is configured to extract the RGB component of described original color image, obtains the RGB component figure of original image
  • the original image discrete wavelet transform module is configured to perform discrete wavelet transform on the RGB component images of the original image respectively to obtain the RGB component matrix information of the original image;
  • the post-watermark image acquisition module is configured to obtain the post-watermark image of the watermark to be extracted
  • the image RGB extraction module after the watermark is configured to extract the RGB components of the image after the watermark, and obtain the RGB component map of the image after the watermark;
  • the post-watermark image discrete wavelet transform module is configured to perform discrete wavelet transform on the RGB component images of the watermark post-image, respectively, to obtain the RGB component matrix information of the post-watermark post-watermark image;
  • the extraction module is configured to extract low-frequency information and high-frequency information of the watermark according to the RGB component matrix information of the watermarked image and the RGB component matrix information of the original image, and then obtain the RGB component matrix information of the watermark;
  • the discrete wavelet inverse transform module is configured to perform discrete wavelet inverse transform on the RGB component matrix information of the watermark respectively to obtain a reconstructed RGB component map;
  • the overlay module is configured to perform three-color overlay on the reconstructed RGB component image to obtain the extracted color watermark.
  • An electronic device includes a memory and one or more processors, the memory stores computer-readable instructions, and the one or more processors execute the computer-readable instructions to implement the steps of the DWT-based digital watermarking method provided by any embodiment of the present application.
  • One or more non-volatile computer-readable storage media storing computer-readable instructions, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by one or more processors, the steps of the DWT-based digital watermarking method provided by any embodiment of the present application are implemented.
  • FIG. 1 is an exemplary flowchart of a DWT-based digital watermark embedding method provided by one or more embodiments of the present application;
  • Fig. 2 is a schematic diagram of discrete wavelet transform decomposition provided by one or more embodiments of the present application;
  • Fig. 3 is the matrix information [C, S] obtained by wavelet decomposition provided by one or more embodiments of the present application;
  • FIG. 4 is an exemplary flowchart of a DWT-based digital watermark extraction method provided by one or more embodiments of the present application;
  • FIG. 5 is an exemplary structural block diagram of a DWT-based digital watermark embedding device provided by one or more embodiments of the present application;
  • Figure 6 is a simulation result figure of the existing watermark embedding method; wherein, figure (a) is the original image (size 512*512), figure (b) is the image after embedding the watermark; figure (c) watermark image (size 64*64); figure (d) is the watermark image extracted from the watermark image;
  • Fig. 7 is the simulation result figure of the DWT-based digital watermarking method provided by one or more embodiments of the present application; wherein, figure (a) is the original image, figure (b) is the image after embedding the watermark; figure (c) watermark image; figure (d) is the watermark image extracted from the watermark image;
  • Fig. 8 is a schematic structural diagram of an electronic device provided by one or more embodiments of the present application.
  • Wavelet transform is a local transformation of space and frequency, which can effectively extract information from signals; in numerical calculation, in order to reduce the redundancy of information, it is generally necessary to discretize the scale factor and displacement factor of wavelet transform to form discrete wavelet transform.
  • a is a fixed parameter (designed according to one's own needs).
  • the watermark embedding coefficient is not set, and the transparency of the watermark embedding cannot be adjusted, resulting in a poor watermark embedding effect; and when the watermark is embedded, the watermark dimensionality reduction process is transformed into a one-dimensional matrix, which is only embedded in the high-frequency part and not embedded in the low-frequency part, resulting in incomplete watermark extraction during subsequent watermark extraction.
  • Fig. 1 is an exemplary block diagram of a DWT-based digital watermark embedding method provided by an embodiment of the present application.
  • the first aspect of the embodiment of the present application provides a DWT-based digital watermarking method, including a watermark embedding method, including:
  • S130 Perform discrete wavelet transform on the RGB component image of the original image and the RGB component image of the watermark respectively, to obtain the RGB component matrix information of the original image and the RGB component matrix information of the watermark;
  • S140 Embedding the RGB component matrix information of the watermark into the RGB component matrix information of the corresponding original image by embedding low-frequency information and high-frequency information together, to obtain an RGB component image after embedding the watermark;
  • S160 Perform three-color superposition on the reconstructed RGB component image to obtain a watermarked image.
  • the DWT-based digital watermarking method, system, electronic equipment, and storage medium adopt the method of embedding low-frequency information and high-frequency information together when embedding the watermark into the original image. Since the low-frequency band contains most of the information of the image, the watermark is embedded in the low-frequency band, so that the final extracted watermark is not much different from the original watermark image, and the extracted watermark image has a high degree of integrity; and under the interference of noise, the watermark can be effectively embedded and extracted, which has good robustness.
  • both low-frequency information and high-frequency information are embedded together. Since the low-frequency band contains most of the information in the image, the watermark is embedded in the low-frequency band. Although the embedding process is complicated, it is beneficial to the subsequent extraction of the watermark, so that the finally extracted watermark contains both low-frequency information and high-frequency information.
  • the extracted watermark image is not much different from the original watermark image, and the extracted watermark image has a high degree of integrity. And when the watermark is embedded, the color of the watermark is considered, and the way of RGB components of the watermark is adopted, so that the finally extracted watermark is still a color image.
  • watermarks are safe, and different designers can set different watermark embedding rules according to their own needs, such as the position, size, and format of inserting watermarks, and different designers will be different.
  • the designer uses certain rules to arrange the watermarks. These rules are difficult to be imitated by thieves, so as to ensure their safety and reliability.
  • the RGB components of the original color image are extracted separately, and the original color image is divided into three parts R, G, and B; the RGB components of the watermarked color image are respectively extracted, and the watermarked image is divided into three parts R, G, and B. Therefore, in the subsequent watermark embedding, the three parts R, G and B of the watermark are respectively embedded into the three parts R, G and B of the original image.
  • step S130 specifically includes:
  • Select Haar wavelet function as wavelet base function, carry out n-level two-dimensional discrete wavelet transform respectively to the RGB component figure of described original image and the RGB component figure of described watermark;
  • the R component matrix information of the original image is [C R ,S R ]
  • the G component matrix information of the original image is [C G ,S G ]
  • the B component matrix information of the original image is [C B ,S B ]
  • the R component matrix information of the watermark is [C WR ,S WR ], the G component matrix information of the watermark is [C WG ,S WG ], the B component matrix information of the watermark is [C WB ,S WB ];
  • C WR The decomposition results of each level of n-level two-dimensional discrete wavelet transform used to store the watermark R component, S WR for C WR Explain the decomposition results of all levels stored in ;
  • C WG The decomposition results of each level of n-level two-dimensional discrete wavelet transform used to store the G component of the watermark, S WG for C WG Explain the decomposition results of all levels stored in ;
  • C WB The decomposition results of each level of n-level two-dimensional discrete wavelet transform used to store the watermark B component, S WB for C WB Explain the decomposition results of all levels stored in .
  • the technology of image processing using wavelet transform is to decompose digital images into multiple resolutions, expand them into specific series, form layered images of different spaces and frequencies, and then calculate and process layered sub-images.
  • the n-level two-dimensional discrete wavelet transform is performed on the image to obtain the corresponding n-th low-frequency band and n-th high-frequency band.
  • the matrix information [C, S] after image decomposition is obtained by using the wavedec2() wavelet decomposition function in Matlab, where C is used to actually store the decomposition results of n-level two-dimensional discrete wavelet transform at each level, and S is used to explain the results of each level stored in C.
  • C is used to actually store the decomposition results of n-level two-dimensional discrete wavelet transform at each level
  • S is used to explain the results of each level stored in C.
  • the decomposed low-frequency and high - frequency components at all levels are actually stored in C in the form of vectors (one-dimensional arrays ) .
  • C is a one-dimensional array.
  • cAn represents the n-th low-frequency approximate component
  • cH n represents the n-th high - frequency horizontal detail component
  • cV n represents the n-th high-frequency vertical detail component
  • cD n represents the n-th high-frequency diagonal detail component
  • S records the size information of the original image and the size information of the decomposition results of each level. It should be noted that since the two-dimensional matrix sizes of high-frequency components (horizontal H, vertical V, and diagonal D) at the same level are the same, only a single record size is sufficient for high-frequency components at the same level.
  • the low-frequency and high-frequency components obtained from the decomposition are transformed from a two-dimensional matrix into a one-dimensional array by column, and arranged and stored in C (one-dimensional array) in the order of (cA 2 , cH 2 , cV 2 , cD 2 ), (cH 1 , cV 1 , cD 1 ); where A represents low-frequency approximate components, and H, D, and V represent high-frequency components respectively Detail ingredients.
  • the S matrix is used to explain the data stored in C.
  • the first line of S records the row and column information of cA 2 (low frequency component) as a two-dimensional matrix, that is, 32x32, followed by the information on the number of rows and columns of the two-dimensional matrix of high-frequency components (because the two-dimensional matrix size of each level of high-frequency components is the same, so only a single record is needed to explain); the last line records the size of the original image X.
  • the Haar wavelet function is selected as the wavelet basis function, and the R, G, and B three components of the original image are respectively subjected to n-level two-dimensional discrete wavelet transform, and the R component matrix information of the original image is [C R ,S R ], the G component matrix information of the original image is [C G ,S G ], the B component matrix information of the original image is [C B ,S B ]; where [C R ,S R ], [C G ,S G ], [C B ,S B ]
  • the specific explanation is the same as the explanation of the matrix information [C,S], for example, C R It is used to store the decomposition results of the n-level two-dimensional discrete wavelet transform of the R component of the original image, S R for C R Explain the decomposition results of all levels stored in , and this application will not repeat them one by one.
  • the Haar wavelet function is selected as the wavelet basis function, and the n-level two-dimensional discrete wavelet transform is performed on the three components of R, G, and B of the watermark respectively, and the matrix information of the R component of the watermark is [C WR , S WR ], the matrix information of the G component of the watermark is [C WG , S WG ], and the matrix information of the B component of the watermark is [C WB , S WB ]; among them, [C WR , S WR ], [C WG , S WG ], [C WB , S WB ], the specific explanations are the same as the explanations of the matrix information [C, S], and this application will not repeat them one by one.
  • step S140 includes:
  • the low-frequency information of the RGB component matrix information of the watermark is multiplied by the embedding coefficient m, and added to the low-frequency information of the RGB component matrix information of the original image;
  • Multiply the high-frequency information of the RGB component matrix information of the watermark by the embedding coefficient add it to the high-frequency information of the RGB component matrix information of the original image, repeat the embedding k times, and obtain the RGB component image after embedding the watermark.
  • the embedding code is as follows:
  • the low-frequency information of the G component of the watermark is embedded in the low-frequency information of the G component of the original image;
  • the number of repeated embedding k is determined by the ratio of the length of the original color image to be embedded with the watermark and the length of the watermark color image to be embedded.
  • the embedding codes of the three high-frequency components (H, V, D) of the G component are as follows:
  • the transparency of the watermark can be changed.
  • the smaller the value of m the higher the transparency of the watermark, the smaller the impact on the original image after the watermark is embedded, and the better the concealment of the watermark.
  • other parameter values can also be set.
  • the watermark high-frequency information adopts the method of repeated embedding, which can make the watermark embedded in the original image more fully, and ensure that a relatively complete watermark can be obtained in the subsequent watermark extraction, so that the final extracted watermark is not much different from the original watermark.
  • the corresponding embedding of the low-frequency information of the RGB component matrix information of the watermark into the low-frequency information of the RGB component matrix information of the original image includes:
  • the low-frequency information c WRAn in the R component matrix information [C WR , S WR ] of the watermark, the low-frequency information c WGAn in the G component matrix information [C WG , S WG ] of the watermark, and the low-frequency information c WBAn in the B component matrix information [C WB , S WB ] of the watermark are correspondingly embedded in the R component matrix information [ CR , S R ] of the original image.
  • the low-frequency information of the three components of R, G, and B of the watermark is correspondingly embedded into the low-frequency information of the three components of R, G, and B of the original image.
  • the specific embedding code is as described above and adjusted accordingly.
  • the above-mentioned C i is replaced by C iAn
  • C Wi is replaced by C WiAn , as follows:
  • the watermark is embedded with low-frequency information, which can retain most of the information of the image, but it is beneficial to the subsequent extraction of the watermark, so that the extracted watermark is complete and has little difference from the original watermark.
  • the red embedding coefficient r, the green embedding coefficient g, and the blue embedding coefficient b are set in equal proportions.
  • changing the embedding coefficients r, g, and b a little bit smaller during debugging will increase the transparency of the watermark and make the image after embedding the watermark closer to the original image.
  • said repeatedly embedding the high-frequency information of the RGB component matrix information of the watermark into the high-frequency information of the RGB component matrix information of the original image includes:
  • the above high-frequency information embedding step is repeated several times, and finally the high-frequency information of the RGB component matrix information of the watermark is correspondingly embedded into the high-frequency information of the RGB component matrix information of the original image.
  • C G actually represents high-frequency horizontal information c GHn , high-frequency vertical information c GVn , and high-frequency diagonal information c GDn ;
  • C WG actually represents high-frequency horizontal information c WGHn , high-frequency vertical information c WGVn , and high-frequency diagonal information c WGDn .
  • the high-frequency information embedding principles of the R and B components are the same as those of the G component, and will not be described in detail in this application.
  • step 150 the three components R, G, and B of the watermarked image are reconstructed by using the reconstruction function to obtain the reconstructed three components of R, G, and B.
  • step 160 the reconstructed three components of R, G, and B are superimposed in three colors to obtain a watermarked image.
  • Fig. 4 is an exemplary flowchart of a DWT-based digital watermark extraction method provided by an embodiment of the present application.
  • the second aspect of the embodiment of the present application provides a DWT-based digital watermarking method, based on the watermarked image obtained by the DWT-based digital watermarking method provided in the above-mentioned embodiment of the present application, including a watermark extraction method, including:
  • S220 Extracting the RGB components of the original color image and the RGB components of the watermarked image respectively, correspondingly obtaining the RGB component map of the original image and the RGB component map of the watermarked image; wherein, R is red, G is green, and B is blue;
  • S230 Perform discrete wavelet transform on the RGB component image of the original image and the RGB component image of the watermarked image, respectively, to obtain the RGB component matrix information of the original image and the RGB component matrix information of the watermarked image;
  • S240 Extract low-frequency information and high-frequency information of the watermark according to the RGB component matrix information of the watermarked image and the RGB component matrix information of the original image, and then obtain the RGB component matrix information of the watermark;
  • S260 Perform three-color superposition on the reconstructed RGB component image to obtain an extracted color watermark.
  • the extraction of the watermark is based on the inverse transformation of the watermark embedding to extract the watermark position information to obtain a complete watermark.
  • the low-frequency information and high-frequency information of the watermark can be extracted. Since the low-frequency band contains most of the image information, the extracted watermark image is not much different from the original watermark image, and the extracted watermark image has a high degree of integrity.
  • the color of the watermark is considered, and the RGB component of the watermark is adopted, so that the finally extracted watermark is still a color image.
  • step S210 the watermarked image is obtained, in which both the low-frequency and high-frequency parts are embedded during watermark embedding, that is, the watermarked image obtained by using the watermark embedding method provided in the embodiment of the present application is the watermarked image to be extracted.
  • the RGB components of the original color image are extracted separately, and the original color image is divided into three parts R, G, and B; the RGB components of the watermarked image are extracted respectively, and the watermarked image is divided into three parts R, G, and B.
  • step S230 specifically includes:
  • Select Haar wavelet function as wavelet base function, carry out n-level two-dimensional discrete wavelet transform respectively to the RGB component figure of described original image and the RGB component figure of described watermarked image;
  • the R component matrix information of the original image is [C R , S R ]
  • the G component matrix information of the original image is [C G , S G ]
  • the B component matrix information of the original image is [C B , S B ];
  • the R component matrix information of the watermarked image is [C TR ,S TR ], the G component matrix information of the watermarked image is [C TG ,S TG ], the B component matrix information of the watermarked image is [C TB ,S TB ];
  • C TR Decomposition results of each level of n-level two-dimensional discrete wavelet transform used to store the R component of the watermarked image, S TR for C TR Explain the decomposition results of all levels stored in ;
  • C TG Decomposition results of each level of n-level two-dimensional discrete wavelet transform used to store the G component of the watermarked image, S TG for C TG Explain the decomposition results of all levels stored in ;
  • C TB The decomposition results of n-level two-dimensional discrete wavelet transform used to store the B component of the watermarked image at each level, S TB for C TB Explain the decomposition results of all levels stored in .
  • the R, G, and B components of the original image and the R, G, and B components of the watermarked image are decomposed by using the n-level two-dimensional discrete wavelet transform method, and the matrix information obtained according to the decomposition is convenient for subsequent extraction of low-frequency information and high-frequency information of the watermark.
  • step S240 specifically includes:
  • the low-frequency information and high-frequency information of the RGB components of the watermark are combined to obtain RGB component matrix information of the watermark.
  • the difference between the high-frequency part of the RGB component matrix information of the watermarked image and the high-frequency part of the RGB component matrix information of the original image is correspondingly calculated, and the high-frequency components of the RGB component of the watermark are extracted, and the R component is used as an example to illustrate, as follows:
  • the R component low frequency component wa R extraction code is as follows:
  • R component high frequency component extraction code is as follows:
  • wv R (k+1,:) C WR (1+size(C WR ,2)/2+k*size(C WR ,2)/16:...
  • wd R (k+1,:) C WR (1+3*size(C WR ,2)/4+k*size(C WR ,2)/16:...
  • k is the number of repeated embeddings, which can be 0, 1, 2, or 3.
  • R is the high-frequency horizontal component of the R component
  • wv R is the high-frequency vertical component of the R component
  • wd R is the high-frequency diagonal component of the R component.
  • the extracted R-component low-frequency components wa R and R-component high-frequency components (wh R , wv R , wd R ) also contain embedded coefficients r
  • the obtained R-component low-frequency components wa R and R-component high-frequency components (wh R , wv R , wd R ) need to be divided by the embedded coefficients.
  • the code is as follows:
  • wv R (wv R (1,:)+wv R (2,:)+wv R (3,:)+wv R (4,:))/(4*r);
  • wd R (wd R (1,:)+wd R (2,:)+wd R (3,:)+wd R (4,:))/(4*r);
  • wa R (C WR (1:size(C WR ,2)/16)-C R (1:size(C R ,2)/16))/r;
  • Step S250 is specifically: use the reconstruction function waverec(cw R , sw R ), waverec(cw G , sw G ) waverec(cw B , sw B ) to reconstruct parameters to obtain reconstructed RGB components w R , w G , w B .
  • Step S260 is specifically, performing three-color superposition on the reconstructed RGB components w R , w G , and w B to obtain the extracted color watermark.
  • steps in the flow charts of FIG. 1 and FIG. 4 are shown sequentially according to the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in Fig. 1 and Fig. 4 may include a plurality of sub-steps or multiple stages, these sub-steps or stages are not necessarily executed at the same time, but may be executed at different moments, the execution order of these sub-steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
  • Fig. 5 is an exemplary structural block diagram of a DWT-based digital watermark embedding device provided by an embodiment of the present application.
  • the third aspect of the embodiment of the present application provides a DWT-based digital watermarking system, which is characterized in that it includes a watermark embedding device, including:
  • the original image acquisition module is configured to acquire an original color image to be embedded with a watermark
  • the original picture RGB extraction module is configured to extract the RGB component of the original color image, and obtain the RGB component figure of the original picture; wherein, R is red, G is green, and B is blue;
  • the original image discrete wavelet transform module is configured to perform discrete wavelet transform on the RGB component images of the original image respectively to obtain the RGB component matrix information of the original image;
  • a watermark acquisition module configured to acquire a watermarked color image to be embedded
  • the watermark RGB extraction module is configured to extract the RGB components of the watermark color image to obtain the RGB component map of the watermark;
  • the watermark discrete wavelet transform module is configured to perform discrete wavelet transform on the RGB component images of the watermark respectively to obtain the RGB component matrix information of the watermark;
  • the embedding module is configured to embed the RGB component matrix information of the watermark into the RGB component matrix information of the corresponding original image by embedding low-frequency information and high-frequency information together, so as to obtain the RGB component image after embedding the watermark;
  • the discrete wavelet inverse transform module is configured to perform discrete wavelet inverse transform on the RGB component graph after embedding the watermark respectively, so as to obtain the reconstructed RGB component graph;
  • the overlay module is configured to perform three-color overlay on the reconstructed RGB component image to obtain a watermarked image.
  • the fourth aspect of the embodiment of the present application provides a DWT-based digital watermarking system, including a watermark extraction device, including:
  • the original image acquisition module is configured to acquire an original color image that is not embedded with a watermark
  • the original picture RGB extraction module is configured to extract the RGB component of the original color image, and obtain the RGB component figure of the original picture; wherein, R is red, G is green, and B is blue;
  • the original image discrete wavelet transform module is configured to perform discrete wavelet transform on the RGB component images of the original image respectively to obtain the RGB component matrix information of the original image;
  • the post-watermark image acquisition module is configured to obtain the post-watermark image of the watermark to be extracted
  • the image RGB extraction module after the watermark is configured to extract the RGB component of the image after the watermark, and obtain the RGB component map of the image after the watermark;
  • the post-watermark image discrete wavelet transform module is configured to perform discrete wavelet transform on the RGB component images of the watermark post-image, respectively, to obtain the RGB component matrix information of the post-watermark post-watermark image;
  • the extraction module is configured to extract low-frequency information and high-frequency information of the watermark according to the RGB component matrix information of the watermarked image and the RGB component matrix information of the original image, and then obtain the RGB component matrix information of the watermark;
  • the discrete wavelet inverse transform module is configured to perform discrete wavelet inverse transform on the RGB component matrix information of the watermark respectively to obtain a reconstructed RGB component map;
  • the overlay module is configured to perform three-color overlay on the reconstructed RGB component image to obtain the extracted color watermark.
  • Each module in the above-mentioned watermark embedding device and extracting device can be fully or partially realized by software, hardware and combinations thereof.
  • the above-mentioned modules can be embedded in or independent of one or more processors in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that one or more processors can invoke and execute the corresponding operations of the above modules.
  • Test 1 Immunity test of LSB watermark and DWT watermark of this application against attacks
  • the attack test includes noise attack, compression, and other attack methods. It needs to attack the watermarked image (the image watermarked by the LSB method and the watermarked image obtained by the DWT-based digital watermarking method provided in the embodiment of this application) and then extract it. First, use the function imnoise(,,,) to add noise to the watermarked image.
  • the first parameter in the function parameter fills in the original image with noise.
  • the second parameter can be filled with noise types such as salt and pepper noise and Gaussian noise.
  • dec() performs wavelet decomposition on it according to the above method, finds its difference and reconstructs to get the watermark.
  • the LSB method is processed in the space domain. Its algorithm is simple, but its anti-attack ability is not good.
  • the test results show that after the LSB is compressed, the original watermark arrangement rules during the embedding are disrupted, resulting in the extracted watermark being chaotic.
  • DWT performs information processing in the transform domain.
  • the original information is operated through forward transform, and then reversely transformed back to restore. This has flexible and changeable characteristics.
  • the test results show that the result after DWT compression is better than LSB.
  • noise attack it can be seen that salt and pepper noise is less damaging to the image than Gaussian noise, and the greater the noise density, the greater the impact.
  • signal-to-noise ratio it can be seen from the signal-to-noise ratio function that the signal-to-noise ratios of the three color arrays are different, and the minimum value of the signal-to-noise ratio is greater than 5, so the value of the signal-to-noise ratio obtained is still objective, and then it is verified that the DWT digital watermark is more robust than the LSB method, and the DWT digital watermark has better immunity to attacks.
  • FIG. 6 is a diagram of a simulation result of a DWT-based digital watermarking method provided by an existing technology.
  • the watermark dimensionality reduction process is converted into a one-dimensional matrix, and only the high-frequency part is embedded in the low-frequency part without embedding. It can be seen from Figure 6 that the final extracted watermark is not complete, and some parts are incomplete.
  • FIG. 7 is a simulation result diagram of the DWT-based digital watermarking method provided by the embodiment of the present application.
  • the discrete wavelet method is used to process the image.
  • the two-stage decomposition decomposes the image into a low-frequency and three high-frequency parts, respectively embeds the watermark into the original image, and then inversely transforms and superimposes the three colors to complete the embedding.
  • the extraction part only needs to use the difference between the original image and the watermarked image after decomposition to obtain the three-color superposition of the watermark information to complete the extraction.
  • This application adopts the method of embedding both low-frequency and high-frequency parts.
  • the low-frequency watermark contains most of the information of the image.
  • the embedding part is complicated to process, the difference between the obtained watermark image and the original watermark is not very large, and the extracted watermark is still a color image, and a complete watermark is obtained (as can be seen from Figure 7).
  • an electronic device in one embodiment, is provided, and its internal structure diagram may be as shown in FIG. 8 .
  • the electronic device includes one or more processors, memory, communication interface, display screen, and input device connected by a system bus.
  • one or more processors of the electronic device are configured to provide computing and control capabilities.
  • the memory of the electronic device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and computer readable instructions.
  • the internal memory provides an environment for the execution of the operating system and computer readable instructions in the non-volatile storage medium.
  • the communication interface of the electronic device is configured to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, an operator network, near field communication (NFC) or other technologies.
  • the computer readable instructions are executed by one or more processors, the DWT-based digital watermarking method is realized.
  • the display screen of the electronic device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device may be a touch layer covered on the display screen, or a button, a trackball or a touch pad provided on the housing of the electronic device, or an external keyboard, touch pad or mouse.
  • FIG. 8 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the electronic equipment to which the solution of the application is applied.
  • the specific electronic equipment may include more or less components than those shown in the figure, or combine certain components, or have different component arrangements.
  • the wearable device provided in this application can be implemented in the form of a computer readable instruction, and the computer readable instruction can be run on the electronic device as shown in FIG. 8 .
  • the memory of the electronic device can store various program modules that make up the wearable device, for example, the original image acquisition module, the original image RGB extraction module, and the watermark acquisition module shown in FIG. 5 .
  • the computer-readable instructions constituted by each program module enable one or more processors to execute the steps in the DWT-based digital watermarking method of each embodiment of the application described in this specification.
  • an electronic device including a memory and one or more processors, the memory stores computer-readable instructions, and the one or more processors implement the steps S110-S160, S210-S260 when executing the computer-readable instructions.
  • non-volatile computer-readable storage media storing computer-readable instructions, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by one or more processors, the following steps S110-S160, S210-S260 are implemented.
  • Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory or optical memory, etc.
  • Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory.
  • RAM Random Access Memory
  • SRAM Static Random Access Memory
  • DRAM Dynamic Random Access Memory
  • the DWT-based digital watermarking method provided in this disclosure adopts the method of embedding low-frequency information and high-frequency information together when embedding the watermark into the original image. Since the low-frequency band contains most of the information of the image, the watermark is embedded in the low-frequency band, so that the finally extracted watermark is not much different from the original watermark image.
  • the extracted watermark image has a high integrity and has strong industrial applicability.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

本申请公开了基于DWT的数字水印方法、系统、电子设备及存储介质,该方法包括水印嵌入方法:获取原始彩色图像和水印彩色图像,并分别提取其RGB分量,再分别进行DWT变换,对应得到原图和水印的RGB分量矩阵信息;将水印的RGB分量矩阵信息采用低频信息和高频信息共同嵌入的方式嵌入到对应的原图的RGB分量矩阵信息;对嵌入水印后的RGB分量图分别进行DWT逆变换,重构RGB分量图;将重构RGB分量图进行三色叠加,得到水印后图像。在水印嵌入原图时采用低频信息和高频信息共同嵌入的方式,由于低频频带含有图像大部分的信息,水印在低频频带嵌入,使得最终提取出来的水印和原始水印图差别不大,提取出的水印图完整度较高。

Description

基于DWT的数字水印方法、系统、电子设备及存储介质
本公开要求于2022年01月24日提交中国专利局、申请号为2022100817712、发明名称为“基于DWT的数字水印方法、系统、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开一种基于DWT的数字水印方法、系统、电子设备及存储介质。
背景技术
随着信息时代的到来,特别是互联网(Internet)的普及,信息的安全保护问题日益突出。数字水印技术是信息隐藏领域中实现多媒体版权保护与信息完整性保证的有效方法,它的基本思想是在数字图像中嵌入秘密的水印信息以便保护数字产品的版权,就好像给图片盖章,注明所有权。
数字水印的嵌入方法有很多,如最低有效位(LSB)、离散余弦变换(DCT)、离散小波变换(DWT)等。比较常用的是采用DWT进行水印嵌入,但是目前基于DWT的水印嵌入方法中,水印嵌入时是将水印降维处理转化成一维矩阵只在高频部分嵌入而低频却没有嵌入,导致后续进行水印提取时,提取出来的水印并不完整。
发明内容
(一)要解决的技术问题
目前的水印嵌入方法中,在后续进行水印提取时,提取出来的水印不完整。
(二)技术方案
根据本公开公开的各种实施例,提供一种基于DWT的数字水印方法、系统、电子设备及存储介质。
一种基于DWT的数字水印方法,包括水印嵌入方法,包括:
获取待嵌入水印的原始彩色图像和要嵌入的水印彩色图像;
分别提取所述原始彩色图像的RGB分量和所述水印彩色图像的RGB分量,对应得到原图的RGB分量图和水印的RGB分量图;
对所述原图的RGB分量图和所述水印的RGB分量图分别进行离散小波变换,对应得到原图的RGB分量矩阵信息和水印的RGB分量矩阵信息;
将水印的RGB分量矩阵信息采用低频信息和高频信息共同嵌入的方式 嵌入到对应的原图的RGB分量矩阵信息,得到嵌入水印后的RGB分量图;
对所述嵌入水印后的RGB分量图分别进行离散小波逆变换,得到重构后的RGB分量图;
将所述重构后的RGB分量图进行三色叠加,得到水印后图像。
一种基于DWT的数字水印方法,基于上述基于DWT的数字水印方法获得的水印后图像,包括水印提取方法,包括:
获取未嵌入水印的原始彩色图像和所述水印后图像;
分别提取所述原始彩色图像的RGB分量和所述水印后图像的RGB分量,对应得到原图的RGB分量图和水印后图像的RGB分量图;对所述原图的RGB分量图和所述水印后图像的RGB分量图分别进行离散小波变换,对应得到原图的RGB分量矩阵信息和水印后图像的RGB分量矩阵信息;
根据所述水印后图像的RGB分量矩阵信息与所述原图的RGB分量矩阵信息提取水印的低频信息和高频信息,进而得到水印的RGB分量矩阵信息;
将所述水印的RGB分量矩阵信息分别进行离散小波逆变换,得到重构后的RGB分量图;
将所述重构后的RGB分量图进行三色叠加,得到提取彩色水印。
一种基于DWT的数字水印系统,包括水印嵌入装置,包括:
原图获取模块,配置成获取待嵌入水印的原始彩色图像;
原图RGB提取模块,配置成提取所述原始彩色图像的RGB分量,得到原图的RGB分量图;
原图离散小波变换模块,配置成对所述原图的RGB分量图分别进行离散小波变换,得到原图的RGB分量矩阵信息;
水印获取模块,配置成获取要嵌入的水印彩色图像;
水印RGB提取模块,配置成提取所述水印彩色图像的RGB分量,得到水印的RGB分量图;
水印离散小波变换模块,配置成对所述水印的RGB分量图分别进行离散小波变换,得到水印的RGB分量矩阵信息;
嵌入模块,配置成将水印的RGB分量矩阵信息采用低频信息和高频信息共同嵌入的方式嵌入到对应的原图的RGB分量矩阵信息,得到嵌入水印后的RGB分量图;
离散小波逆变换模块,配置成对所述嵌入水印后的RGB分量图分别进行离散小波逆变换,得到重构后的RGB分量图;
叠加模块,配置成将所述重构后的RGB分量图进行三色叠加,得到水印后图像。
一种基于DWT的数字水印系统,包括水印提取装置,包括:
原图获取模块,配置成获取未嵌入水印的原始彩色图像;
原图RGB提取模块,配置成提取所述原始彩色图像的RGB分量,得 到原图的RGB分量图;
原图离散小波变换模块,配置成对所述原图的RGB分量图分别进行离散小波变换,得到原图的RGB分量矩阵信息;
水印后图像获取模块,配置成获取待提取水印的水印后图像;
水印后图像RGB提取模块,配置成提取所述水印后图像的RGB分量,得到水印后图像的RGB分量图;
水印后图像离散小波变换模块,配置成对所述水印后图像的RGB分量图分别进行离散小波变换,得到水印后图像的RGB分量矩阵信息;
提取模块,配置成根据所述水印后图像的RGB分量矩阵信息与所述原图的RGB分量矩阵信息提取水印的低频信息和高频信息,进而得到水印的RGB分量矩阵信息;
离散小波逆变换模块,配置成将所述水印的RGB分量矩阵信息分别进行离散小波逆变换,得到重构后的RGB分量图;
叠加模块,配置成将所述重构后的RGB分量图进行三色叠加,得到提取彩色水印。
一种电子设备,包括存储器和一个或多个处理器,所述存储器存储有计算机可读指令,所述一个或多个处理器执行所述计算机可读指令时实现本申请任意实施例所提供的基于DWT的数字水印方法的步骤。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时实现本申请任意实施例所提供的基于DWT的数字水印方法的步骤。
本公开的其他特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本公开而了解。本公开的目的和其他优点在说明书、权利要求书以及附图中所特别指出的结构来实现和获得,本公开的一个或多个实施例的细节在下面的附图和描述中提出。
为使本公开的上述目的、特征和优点能更明显易懂,下文特举可选实施例,并配合所附附图,作详细说明如下。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1为本申请一个或多个实施例提供的基于DWT的数字水印嵌入方法的示例性流程框图;
图2为本申请一个或多个实施例提供的离散小波变换分解示意图;
图3为本申请一个或多个实施例提供的小波分解得到的矩阵信息[C,S];
图4为本申请一个或多个实施例提供的基于DWT的数字水印提取方法的示例性流程框图;
图5为本申请一个或多个实施例提供的基于DWT的数字水印嵌入装置的示例性结构框图;
图6为现有水印嵌入方法的仿真结果图;其中,图(a)为原始图像(尺寸512*512),图(b)为嵌入水印后的图像;图(c)水印图像(尺寸64*64);图(d)为从含水印图像中提取出的水印图像;
图7为本申请一个或多个实施例提供的基于DWT的数字水印方法的仿真结果图;其中,图(a)为原始图像,图(b)为嵌入水印后的图像;图(c)水印图像;图(d)为从含水印图像中提取出的水印图像;
图8为本申请一个或多个实施例提供的电子设备的结构示意图。
具体实施方式
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与发明相关的部分。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
专业术语解释
离散小波变换(DWT):小波变换是空间和频率的局部变换,能有效地从信号中提取信息;在数值计算时,为了减少信息的冗余度,一般需要对小波变换的尺度因子和位移因子进行离散化,从而形成离散小波变换。
鲁棒性:是指在经历多种无意或有意的信号处理过程后,数字水印仍能保持部分完整性并能被准确鉴别。可能的信号处理过程包括信道噪声、滤波、尺度变化以及有损压缩编码等。
现有的基于DWT数字水印嵌入具体步骤如下:
(1)对水印图像进行降维分解处理:将水印图像扫描成一维向量,得到一维数字水印序列V;
(2)选用Haar小波函数作为小波基函数对原始图像I进行n级离散小波变换,使原始图像置于低频频带LLn;
(3)选取水印序列V的小波系数c k,对选取的小波系数c k按照以下公式进行修改,并利用修改后得到的小波系数c′ k进行水印嵌入;
c′ k=c k+aV
其中,a为固定参数(根据自己需要设计)。
(4)原始图像的n级离散小波分解得到的各个子图像与水印图像的子图像进行合成,将合成子图进行DWT逆变换,得到重构后的含水印图像。
由上可知,现有的基于DWT的数字水印嵌入方法中,未设置水印嵌入系数,不能调节水印嵌入透明度,导致水印嵌入效果不佳;且水印嵌入时是将水印降维处理转化成一维矩阵只在高频部分嵌入而低频却没有嵌入,导致后续进行水印提取时,提取出来的水印并不完整。
图1为本申请实施例提供的基于DWT的数字水印嵌入方法的示例性流程框图。如图1所示,本申请实施例的第一方面提供一种基于DWT的数字水印方法,包括水印嵌入方法,包括:
S110:获取待嵌入水印的原始彩色图像和要嵌入的水印彩色图像;
S120:分别提取所述原始彩色图像的RGB分量和所述水印彩色图像的RGB分量,对应得到原图的RGB分量图和水印的RGB分量图;其中,R为红色,G为绿色,B为蓝色;
S130:对所述原图的RGB分量图和所述水印的RGB分量图分别进行离散小波变换,对应得到原图的RGB分量矩阵信息和水印的RGB分量矩阵信息;
S140:将水印的RGB分量矩阵信息采用低频信息和高频信息共同嵌入的方式嵌入到对应的原图的RGB分量矩阵信息,得到嵌入水印后的RGB分量图;
S150:对所述嵌入水印后的RGB分量图分别进行离散小波逆变换,得到重构后的RGB分量图;
S160:将所述重构后的RGB分量图进行三色叠加,得到水印后图像。
本申请实施例所提供的基于DWT的数字水印方法、系统、电子设备及存储介质,在水印嵌入原图时采用低频信息和高频信息共同嵌入的方式,由于低频频带含有图像大部分的信息,水印在低频频带嵌入,使得最终提取出来的水印和原始水印图差别不大,提取出的水印图完整度较高;且在噪声干扰下,能有效的嵌入、提取水印,具有较好的鲁棒性。
本实施例中,在水印嵌入原图时采用低频信息和高频信息共同嵌入的方式,由于低频频带含有图像大部分的信息,水印在低频频带嵌入,虽然嵌入部分处理复杂,但有利于后续对水印进行提取,使得最终提取出来的水印同时包含低频信息和高频信息,提取出来的水印图和原始水印图差别不大,且提取出的水印图完整度较高。且在水印嵌入时,考虑了水印的颜色,采用水印RGB分量的方式,使得最终提取出来的水印依然是彩色图像。
需要说明的是,水印具有安全性,不同的设计者可根据自身需求设置不同的水印嵌入规律,比如插入水印的位置、大小、格式,不同的设计者都会有所不同。设计者利用一定的规律对水印进行排列,这些规律难以被盗取者模仿,保证其安全可靠的特点。
具体的,步骤S120中,采用input r=input(:,:,1)提取红色,绿色和蓝色的提取方法同理。分别提取原始彩色图像的RGB分量,将原始彩色图像分为R、G、B三个部分;分别提取水印彩色图像的RGB分量,将水印图像分为R、G、B三个部分。因此,在后续水印嵌入时,是将水印的R、G、B三个部分分别对应嵌入原始图像的R、G、B三个部分。
在一个实施例中,步骤S130具体包括:
选用Haar小波函数作为小波基函数,对所述原图的RGB分量图和所述水印的RGB分量图分别进行n级二维离散小波变换;
所述分量矩阵信息为[C,S],其中,C用于存储n级二维离散小波变换的各级分解结果,C=((cAn,cH n,cV n,cD n),(cH n-1,cV n-1,cD n-1),……(cH 2,cV 2,cD 2),(cH 1,cV 1,cD 1)),其中,cAn表示第n级低频近似成分,cH n表示第n级高频水平细节成分,cV n表示第n级高频垂直细节成分,cD n表示第n级高频对角细节成分;S用于对C中存储的各级分解结果进行解释说明,S中记录原图尺寸信息和各级分解结果的尺寸信息;
则所述原图的R分量矩阵信息为[C R,S R],所述原图的G分量矩阵信息为[C G,S G],所述原图的B分量矩阵信息为[C B,S B];其中,C R用于存储原图R分量的n级二维离散小波变换的各级分解结果,S R用于对C R中存储的各级分解结果进行解释说明;C G用于存储原图G分量的n级二维离散小波变换的各级分解结果,S G用于对C G中存储的各级分解结果进行解释说明;C B用于存储原图B分量的n级二维离散小波变换的各级分解结果,S B用于对C B中存储的各级分解结果进行解释说明;
所述水印的R分量矩阵信息为[C WR,S WR],所述水印的G分量矩阵信息为[C WG,S WG],所述水印的B分量矩阵信息为[C WB,S WB];其中,C WR用于存储水印R分量的n级二维离散小波变换的各级分解结果,S WR用于对C WR中存储的各级分解结果进行解释说明;C WG用于存储水印G分量的n级二维离散小波变换的各级分解结果,S WG用于对C WG中存储的各级分解结果进行解释说明;C WB用于存储水印B分量的n级二维离散小波变换的各级分解结果,S WB用于对C WB中存储的各级分解结果进行解释说明。
具体的,采用小波变换进行图像处理的技术是把数字图像进行多分辨率分解,展开成特定级数,形成不同空间和不同频率的分层图像,然后对分层子图像进行计算和处理。由于图像可以看成是由行和列组成的二维信号,因而在小波变换时需要分别在行和列上进行,如图2所示,在经过一次二维离散小波变换后,图像可分解为4个子图像(即4个频带:HL 1为第一级高频水平频带,LH 1为第一级高频垂直频带,HH 1为第一级高频对角频带,LL 1为第一级低频频带);其中,第一级低频频带LL 1可进行下一级分解,分解为第二级高频水平频带HL 2,第二级高频垂直频带LH 2,第二级高频对角频带HH 2,第二级低频频带LL 2。依次类推,对图像进行n级二维离散小波变换,得到对应的第n级低频频带和第n级高频频带。
其中,采用Matlab中wavedec2()小波分解函数得到了图片分解后的矩阵信息[C,S],其中C用于实际存储n级二维离散小波变换的各级分解结果,S用于对C中存储的各级结果进行解释说明。如下图3所示,在 使用wavedec2()进行小波分解之后,分解的各级低频与高频成分实际上是通过向量(一维数组)的形式全部存储在C中,C为一维数组,C=((cAn,cH n,cV n,cD n),(cH n-1,cV n-1,cD n-1),……(cH 2,cV 2,cD 2),(cH 1,cV 1,cD 1)),其中,cAn表示第n级低频近似成分,cH n表示第n级高频水平细节成分,cV n表示第n级高频垂直细节成分,cD n表示第n级高频对角细节成分;S中记录原图尺寸信息和各级分解结果的尺寸信息。需要说明的是,由于同一级高频成分(水平H、垂直V、对角D)的二维矩阵尺寸一样,因此,同一级高频成分只需单条记录尺寸即可。
以2级小波分解为例,即假设图3中n=2,分解得到的各级低频与高频成分(为二维矩阵),按列由二维矩阵转化为一维数组,并按照(cA 2,cH 2,cV 2,cD 2),(cH 1,cV 1,cD 1)的顺序排列存储到C(为一维数组)中;其中,A代表低频近似成分,H、D、V分别代表高频细节成分。从上述描述中可以发现,C是一个包含了所有分解结果信息的很大的一维数组,但是仅仅通过C并不能确定某区间内的数据原属于哪个二维矩阵。所以,S矩阵则用于对C中存储的数据进行说明,如图3所示,S中的第一行记录了cA 2(低频成分)原来作为二维矩阵的行列数信息,即32x32,依次往下为高频成分的二维矩阵行列数信息(因为每一级高频成分的二维矩阵尺寸是一样的,故仅需要单条记录即可说明);最后一行记录的是原图X的尺寸。
本实施例中,选用Haar小波函数作为小波基函数,对原图的R、G、B三个分量分别进行n级二维离散小波变换,得到原图的R分量矩阵信息为[C R,S R],原图的G分量矩阵信息为[C G,S G],原图的B分量矩阵信息为[C B,S B];其中,[C R,S R]、[C G,S G]、[C B,S B]的具体解释说明同矩阵信息[C,S]的解释说明,比如,C R用于存储原图R分量的n级二维离散小波变换的各级分解结果,S R用于对C R中存储的各级分解结果进行解释说明,本申请不再一一赘述。
同时,选用Haar小波函数作为小波基函数,对水印的R、G、B三个分量分别进行n级二维离散小波变换,得到水印的R分量矩阵信息为[C WR,S WR],水印的G分量矩阵信息为[C WG,S WG],水印的B分量矩阵信息为[C WB,S WB];其中,[C WR,S WR]、[C WG,S WG]、[C WB,S WB]的具体解释说明同矩阵信息[C,S]的解释说明,本申请不再一一赘述。
在一个实施例中,步骤S140包括:
设置嵌入系数m,所述水印的RGB分量矩阵信息的低频信息乘以所述嵌入系数m,并加在所述原图的RGB分量矩阵信息的低频信息上;
将所述水印的RGB分量矩阵信息的高频信息乘以所述嵌入系数,并加在所述原图的RGB分量矩阵信息的高频信息上,重复嵌入k次,得到嵌入水印后的RGB分量图。
在本实施例中,在水印嵌入时,先将小波分解后存储原始图像行列 的低频信息进行嵌入,嵌入代码如下:
C i(1:size(C Wi,2)/16)=C i(1:size(C Wi,2)/16)+m*C Wi(1:size(C Wi,2)/16)
其中,i∈[R,G,B];m∈[r,g,b],r为红色嵌入系数,g为绿色嵌入系数,b为蓝色嵌入系数;size(X,2)表示X向量的长度。
比如,当i=R,m=r时,即先将水印的R分量的低频信息嵌入原图R分量的低频信息中,嵌入代码为C R(1:size(C WR,2)/16)=C R(1:size(C WR,2)/16)+r*C WR(1:size(C WR,2)/16),表示原图R分量矩阵C R的前B/16个元素在本身的基础上+水印R分量矩阵C WR的前B/16个元素*红色嵌入系数r(分别对每个元素)。当i=G,m=g时,将水印的G分量的低频信息嵌入原图G分量的低频信息中;当i=B,m=b时,将水印的B分量的低频信息嵌入原图B分量的低频信息中。
然后对高频成分的水平、垂直、对角位置将水印对应的高频部分重复进行嵌入,要将水印图片高频的三个部分通过水印的高频成分乘以嵌入系数加在原始图像上。其中,重复嵌入的次数k由待嵌入水印的原始彩色图像的长度和要嵌入的水印彩色图像的长度的比值确定,原始彩色图像的长度与原图R分量的长度一样,水印彩色图像的长度和水印R分量的长度一样,图像提取三原色RGB后,并不改变图像的长度,假定C R的长度用A表示,C WR的长度用B表示,则重复嵌入的次数k=A/B,若A/B=1,则编译一个while循环k=0,while k<=A/B-1,就只能重复嵌入一次。
以G分量的三个高频成分的嵌入为例进行说明,如G分量的三个高频成分(H、V、D)的嵌入代码如下:
C G(1+size(C G,2)/4+k*size(C WG,2)/4:size(C G,2)/4+...
(k+1)*size(C WG,2)/4)=C G(1+size(C G,2)/4+...
k*size(C WG,2)/4:size(C G,2)/4+(k+1)*size(C WG,2)/4+...
g*C WG(1+size(C WG,2)/4:size(C WG,2)/2));
C G(1+size(C G,2)/2+k*size(C WG,2)/4:size(C G,2)/2+...
(k+1)*size(C WG,2)/4)=C G(1+size(C G,2)/2+...
k*size(C WG,2)/4:size(C G,2)/2+(k+1)*size(C WG,2)/4+...
g*C WG(1+size(C WG,2)/2:3*size(C WG,2)/4));
C G(1+3*size(C G,2)/4+k*size(C WG,2)/4:3*size(C G,2)/4+...
(k+1)*size(C WG,2)/4)=C G(1+3*size(C G,2)/4+...
k*size(C WG,2)/4:3*size(C G,2)/4+(k+1)*size(C WG,2)/4+...
g*C WG(1+3*size(C WG,2)/4:size(C WG,2)));
对于R分量、B分量的高频嵌入同理,采用与G分量相同的嵌入方法,本申请实施例不再一一赘述。
该示例中,通过设置水印嵌入系数m,可以改变水印的透明度,m值越小,则水印透明度越高,水印嵌入后对原始图像的影响越小,水印 的隐藏性越好。在嵌入时可将m值设置小点,如m=0.03,当然,在实际应用中,也可以设置其他参数值。且水印高频信息采用重复嵌入的方式可以使水印嵌入原图更加充分,保证后续进行水印提取时能够获得较为完整的水印,使最终提取出的水印与原始水印相差不大。
在一个实施例中,所述先将所述水印的RGB分量矩阵信息的低频信息对应嵌入所述原图的RGB分量矩阵信息的低频信息中包括:
同时将所述水印的R分量矩阵信息[C WR,S WR]中的低频信息c WRAn、水印的G分量矩阵信息[C WG,S WG]中的低频信息c WGAn、水印的B分量矩阵信息[C WB,S WB]中的低频信息c WBAn对应嵌入所述原图的R分量矩阵信息[C R,S R]中的低频信息c RAn、原图的G分量矩阵信息[C G,S G]中的低频信息c GAn、原图的B分量矩阵信息[C B,S B]中的低频信息c BAn。该示例中,将水印的R、G、B三个分量的低频信息对应嵌入原图的R、G、B三个分量的低频信息中,具体的嵌入代码如上所述并做相应调整,对应的将上述的C i替换为C iAn,将C Wi替换为C WiAn,具体如下:
C iAn(1:size(C WiAn,2)/16)
=C iAn(1:size(C WiAn,2)/16)+m*C WiAn(1:size(C WiAn,2)/16)
其中,i∈[R,G,B];m∈[r,g,b],r为红色嵌入系数,g为绿色嵌入系数,b为蓝色嵌入系数;size(X,2)表示X向量的长度。
该示例中,水印采用低频信息嵌入的方式,可以保留图像的大部分信息,但有利于后续对水印进行提取,使提取的水印完整,且与原始水印相差不大。
在一个实施例中,所述红色嵌入系数r、绿色嵌入系数g、蓝色嵌入系数b等比例设置。
在本实施例中,r、g、b嵌入系数等比例设置,r=g=b,保证得到的图像的颜色不会失调。为了能使水印不那么明显,不容易被分辨出来,在调试中把嵌入系数r、g、b改的稍微小一点会使得水印的透明度增加,使嵌入水印后的图像更加接近于原图。
在一个实施例中,所述再将所述水印的RGB分量矩阵信息的高频信息对应重复嵌入所述原图的RGB分量矩阵信息的高频信息中包括:
将所述水印的R分量矩阵信息[C WR,S WR]中的高频水平信息c WRHn、高频垂直信息c WRVn、高频对角信息c WRDn利用高频信息嵌入代码对应嵌入所述原图的R分量矩阵信息[C R,S R]中的高频水平信息c RHn、高频垂直信息c RVn、高频对角信息c RDn中;
同时将所述水印的G分量矩阵信息[C WG,S WG]中的高频水平信息c WGHn、高频垂直信息c WGVn、高频对角信息c WGDn利用高频信息嵌入代码对应嵌入所述原图的G分量矩阵信息[C G,S G]中的高频水平信息c GHn、高频垂直信息c GVn、高频对角信息c GDn中;
同时将所述水印的B分量矩阵信息[C WB,S WB]中的高频水平信息 c WBHn、高频垂直信息c WBVn、高频对角信息c WBDn利用高频信息嵌入代码对应嵌入所述原图的B分量矩阵信息[C B,S B]中的高频水平信息c BHn、高频垂直信息c BVn、高频对角信息c BDn中;
重复以上高频信息嵌入步骤多次,最终将水印的RGB分量矩阵信息的高频信息对应嵌入所述原图的RGB分量矩阵信息的高频信息中。
该示例中,上述G分量高频嵌入代码中,C G实际表示的是高频水平信息c GHn、高频垂直信息c GVn、高频对角信息c GDn;C WG实际表示的高频水平信息c WGHn、高频垂直信息c WGVn、高频对角信息c WGDn。对于R、B分量高频信息嵌入原理同G分量,本申请不再一一赘述。
在步骤150中,利用重构函数对嵌入水印后图像的R、G、B三个分量进行重构,得到重构后的R、G、B三个分量。
在步骤160中,将重构后的R、G、B三个分量进行三色叠加,得到水印后图像。
图4为本申请实施例提供的基于DWT的数字水印提取方法的示例性流程框图。如图4所示,本申请实施例的第二方面提供一种基于DWT的数字水印方法,基于上述本申请实施例提供的基于DWT的数字水印方法获得的水印后图像,包括水印提取方法,包括:
S210:获取未嵌入水印的原始彩色图像和所述水印后图像;
S220:分别提取所述原始彩色图像的RGB分量和所述水印后图像的RGB分量,对应得到原图的RGB分量图和水印后图像的RGB分量图;其中,R为红色,G为绿色,B为蓝色;
S230:对所述原图的RGB分量图和所述水印后图像的RGB分量图分别进行离散小波变换,对应得到原图的RGB分量矩阵信息和水印后图像的RGB分量矩阵信息;
S240:根据所述水印后图像的RGB分量矩阵信息与所述原图的RGB分量矩阵信息提取水印的低频信息和高频信息,进而得到水印的RGB分量矩阵信息;
S250:将所述水印的RGB分量矩阵信息分别进行离散小波逆变换,得到重构后的RGB分量图;
S260:将所述重构后的RGB分量图进行三色叠加,得到提取彩色水印。
本实施例中,水印的提取则是同理按照水印嵌入的逆变换对水印位置信息进行提取得到完整的水印,该示例中能够提取水印的低频信息和高频信息,由于低频频带含有图像大部分的信息,提取出来的水印图和原始水印图差别不大,且提取出的水印图完整度较高。且在水印提取时,考虑了水印的颜色,采用水印RGB分量的方式,使得最终提取出来的水印依然是彩色图像。
具体的,在步骤S210中,获取水印后图像,该水印后图像中在水印 嵌入时低频和高频部分均进行嵌入,即采用本申请实施例提供的水印嵌入方法获得的水印后图像为待提取水印的水印后图像。
在步骤S220中,采用input r=input(:,:,1)提取红色,绿色和蓝色的提取方法同理。分别提取原始彩色图像的RGB分量,将原始彩色图像分为R、G、B三个部分;分别提取水印后图像的RGB分量,将水印后图像分为R、G、B三个部分。
在一个实施例中,步骤S230具体包括:
选用Haar小波函数作为小波基函数,对所述原图的RGB分量图和所述水印后图像的RGB分量图分别进行n级二维离散小波变换;
所述分量矩阵信息为[C,S],其中,C用于存储n级二维离散小波变换的各级分解结果,C=((cAn,cH n,cV n,cD n),(cH n-1,cV n-1,cD n-1),……(cH 2,cV 2,cD 2),(cH 1,cV 1,cD 1)),其中,cAn表示第n级低频近似成分,cH n表示第n级高频水平细节成分,cV n表示第n级高频垂直细节成分,cD n表示第n级高频对角细节成分;S用于对C中存储的各级分解结果进行解释说明,S中记录原图尺寸信息和各级分解结果的尺寸信息;
则所述原图的R分量矩阵信息为[C R,S R],所述原图的G分量矩阵信息为[C G,S G],所述原图的B分量矩阵信息为[C B,S B];
所述水印后图像的R分量矩阵信息为[C TR,S TR],所述水印后图像的G分量矩阵信息为[C TG,S TG],所述水印后图像的B分量矩阵信息为[C TB,S TB];其中,C TR用于存储水印后图像R分量的n级二维离散小波变换的各级分解结果,S TR用于对C TR中存储的各级分解结果进行解释说明;C TG用于存储水印后图像G分量的n级二维离散小波变换的各级分解结果,S TG用于对C TG中存储的各级分解结果进行解释说明;C TB用于存储水印后图像B分量的n级二维离散小波变换的各级分解结果,S TB用于对C TB中存储的各级分解结果进行解释说明。
本实施例中,采用n级二维离散小波变换方法对原图的R、G、B分量,以及对水印后图像的R、G、B分量进行分解,根据分解得到的矩阵信息,便于后续对水印的低频信息和高频信息进行提取。
在一个实施例中,步骤S240具体包括:
将所述水印后图像的RGB分量矩阵信息与所述原图的RGB分量矩阵信息对应采用先求差值再除以嵌入系数m的方式,得到水印RGB分量的低频信息和高频信息;
将所述水印RGB分量的低频信息和高频信息合并,得到水印的RGB分量矩阵信息。
具体的,对水印后图像的RGB分量矩阵信息的高频部分与原图的RGB分量矩阵信息的高频部分对应求差值,提取到水印RGB分量高频成分,以R分量为例进行说明,具体如下:
R分量低频成分wa R提取代码如下:
wa R=C WR(1:size(C WR,2)/16)-C R(1:size(C R,2)/16)
R分量高频成分提取代码如下:
for k=0:3
wh R(k+1,:)=C WR(1+size(C WR,2)/4+k*size(C WR,2)/16:...
size(C WR,2)/4+(k+1)*size(C WR,2)/16)-...
C R(1+size(C R,2)/4+k*size(C R,2)/16:...
size(C R,2)/4+(k+1)*size(C R,2)/16);
wv R(k+1,:)=C WR(1+size(C WR,2)/2+k*size(C WR,2)/16:...
size(C WR,2)/2+(k+1)*size(C WR,2)/16)-...
C R(1+size(C R,2)/2+k*size(C R,2)/16:...
size(C R,2)/2+(k+1)*size(C R,2)/16);
wd R(k+1,:)=C WR(1+3*size(C WR,2)/4+k*size(C WR,2)/16:...
3*size(C WR,2)/4+(k+1)*size(C WR,2)/16)-...
C R(1+3*size(C R,2)/4+k*size(C R,2)/16:...
3*size(C R,2)/4+(k+1)*size(C R,2)/16);
end
其中,k为重复嵌入次数,可以取0,1,2,3。wh R为R分量高频水平成分,wv R为R分量高频垂直成分,wd R为R分量高频对角成分。对于G、B分量低频成分、高频成分的提取代码的方法同R分量。
由于提取的R分量低频成分wa R、R分量高频成分(wh R、wv R、wd R)还含有嵌入系数r,因此,得到的R分量低频成分wa R、R分量高频成分(wh R、wv R、wd R)还需要除以嵌入系数,代码如下:
wh R=(wh R(1,:)+wh R(2,:)+wh R(3,:)+wh R(4,:))/(4*r);
wv R=(wv R(1,:)+wv R(2,:)+wv R(3,:)+wv R(4,:))/(4*r);
wd R=(wd R(1,:)+wd R(2,:)+wd R(3,:)+wd R(4,:))/(4*r);
wa R=(C WR(1:size(C WR,2)/16)-C R(1:size(C R,2)/16))/r;
再将除以嵌入系数后的低频信息wa R、高频信息(wh R、wv R、wd R)合并得到R分量cw R矩阵cw R=[wa R,wh R,wv R,wd R];同理,将G、B分量的低频信息和高频信息进行合并,对应得到G分量cw G矩阵,B分量cw B矩阵。
需要说明的是,在提取RGB分量的低频信息和高频信息时,经过测试如果系数m设置太小就会导致提取的水印与原图对比失真,所以建议提取时候系数m尽量设置稍微大一点才能保证图像效果,即提取时为了使水印的图像色彩更真,在程序里把rgb系数改稍微大一点,如可设置为r=g=b=0.1。
步骤S250具体为:利用重构函数waverec(cw R,sw R),waverec(cw G,sw G)waverec(cw B,sw B)重构参数得到重构后的RGB分量w R,w G,w B
步骤S260具体为,将重构后的RGB分量w R,w G,w B进行三色叠加得 到提取彩色水印。
应该理解的是,虽然图1、图4的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1、图4中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
图5为本申请实施例提供的基于DWT的数字水印嵌入装置的示例性结构框图。如图5所示,本申请实施例的第三方面提供一种基于DWT的数字水印系统,其特征在于,包括水印嵌入装置,包括:
原图获取模块,配置成获取待嵌入水印的原始彩色图像;
原图RGB提取模块,配置成提取所述原始彩色图像的RGB分量,得到原图的RGB分量图;其中,R为红色,G为绿色,B为蓝色;
原图离散小波变换模块,配置成对所述原图的RGB分量图分别进行离散小波变换,得到原图的RGB分量矩阵信息;
水印获取模块,配置成获取要嵌入的水印彩色图像;
水印RGB提取模块,配置成提取所述水印彩色图像的RGB分量,得到水印的RGB分量图;
水印离散小波变换模块,配置成对所述水印的RGB分量图分别进行离散小波变换,得到水印的RGB分量矩阵信息;
嵌入模块,配置成将水印的RGB分量矩阵信息采用低频信息和高频信息共同嵌入的方式嵌入到对应的原图的RGB分量矩阵信息,得到嵌入水印后的RGB分量图;
离散小波逆变换模块,配置成对所述嵌入水印后的RGB分量图分别进行离散小波逆变换,得到重构后的RGB分量图;
叠加模块,配置成将所述重构后的RGB分量图进行三色叠加,得到水印后图像。
本申请实施例的第四方面提供一种基于DWT的数字水印系统,包括水印提取装置,包括:
原图获取模块,配置成获取未嵌入水印的原始彩色图像;
原图RGB提取模块,配置成提取所述原始彩色图像的RGB分量,得到原图的RGB分量图;其中,R为红色,G为绿色,B为蓝色;
原图离散小波变换模块,配置成对所述原图的RGB分量图分别进行离散小波变换,得到原图的RGB分量矩阵信息;
水印后图像获取模块,配置成获取待提取水印的水印后图像;
水印后图像RGB提取模块,配置成提取所述水印后图像的RGB分 量,得到水印后图像的RGB分量图;
水印后图像离散小波变换模块,配置成对所述水印后图像的RGB分量图分别进行离散小波变换,得到水印后图像的RGB分量矩阵信息;
提取模块,配置成根据所述水印后图像的RGB分量矩阵信息与所述原图的RGB分量矩阵信息提取水印的低频信息和高频信息,进而得到水印的RGB分量矩阵信息;
离散小波逆变换模块,配置成将所述水印的RGB分量矩阵信息分别进行离散小波逆变换,得到重构后的RGB分量图;
叠加模块,配置成将所述重构后的RGB分量图进行三色叠加,得到提取彩色水印。
关于水印嵌入装置、提取装置的具体限定可以参见上文中对于基于DWT的数字水印嵌入、提取方法的限定,在此不再赘述。上述水印嵌入装置、提取装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的一个或多个处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于一个或多个处理器调用执行以上各个模块对应的操作。
仿真实验
数字水印嵌入方法有很多,要能顺利嵌入水印使得水印嵌入前后并无明显变化,而且除了设计者外任何人都不可以将嵌入的水印原封不动的提取出来,同时设计者提取不对原图造成影响,还有评价该算法嵌入数字水印噪声、攻击的免疫性能,这几点综合的体现数字水印的隐藏性、安全性和鲁棒性。
试验1:LSB水印和本申请的DWT水印对攻击的免疫性能测试
1)试验方法
攻击测试有噪声攻击、压缩、等攻击方式,需要给水印过的图(LSB方法水印过的图和本申请实施例提供的基于DWT的数字水印方法得到水印过的图)攻击,再提取,首先利用函数imnoise(,,,)对水印过的图片加噪声,函数参数里面第一个参数填写加噪声的原图,第二个参数可以填写噪声类型如椒盐噪声、高斯噪声,第三个参数为添加噪声的强度,加完噪声后再利用wavedec()根据上面方法对其进行小波分解,求其差值重构得到了水印。
2)试验结果
LSB方法是在空间域进行处理,其算法简单,但是抗攻击能力不行,通过测试结果可知LSB经过压缩后把原来嵌入时的水印排列规则打乱了,导致了提取出来的水印是乱的。
本申请实施例提供的基于DWT的数字水印方法,DWT是在变换域上进行信息处理,原来的信息在通过正变换进行操作,之后在反变换回来还原,这样具有灵活多变的特性,测试的结果表明DWT压缩后的结 果比LSB的能好一点,在噪声攻击方面,看出来椒盐噪声比高斯噪声更不破环图像,噪声密度越大影响也就越大。信噪比方面,通过信噪比函数看出来三色阵的的信噪比各不相同,信噪比最小值大于5,所以得到的信噪比的值还是客观的,进而验证DWT数字水印相对于LSB方法鲁棒性较好一些,DWT数字水印对攻击的免疫性能更佳。
试验2:现有的DWT水印和本申请的DWT水印方法的效果对比
图6为采用现有的技术提供的基于DWT的数字水印方法的仿真结果图。现有技术进行水印嵌入时是将水印降维处理转化成一维矩阵只在高频部分嵌入低频却没有嵌入,由图6可知,最终提取出来的水印并不完整,有部分残缺。
图7为本申请实施例提供的基于DWT的数字水印方法的仿真结果图。本申请中利用离散小波法对图像进行处理,通过将彩色图像三色分离,二级分解将图像分解为一个低频三个高频部分,分别将水印嵌入到原始图像中然后逆变换并三色叠加完成嵌入,提取部分只需要在分解后利用原始图像和水印过的图像求差值得到水印信息三色叠加完成提取。本申请采用低频和高频部分共同嵌入的方式,水印低频含有图像大部分信息,虽然在嵌入部分处理复杂,但是能在得到的水印图和原始水印差别不是很大,而且提取的水印依然是彩色图像,得到完整的水印(由图7可知)。
在一个实施例中,提供了一种电子设备,其内部结构图可以如图8所示。该电子设备包括通过系统总线连接的一个或多个处理器、存储器、通信接口、显示屏和输入装置。其中,该电子设备的一个或多个处理器配置成提供计算和控制能力。该电子设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机可读指令。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该电子设备的通信接口配置成与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、运营商网络、近场通信(NFC)或其他技术实现。该计算机可读指令被一个或多个处理器执行时以实现基于DWT的数字水印方法。该电子设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该电子设备的输入装置可以是显示屏上覆盖的触摸层,也可以是电子设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的电子设备的限定,具体的电子设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,本申请提供的可穿戴设备可以实现为一种计算机可读指令的形式,计算机可读指令可在如图8所示的电子设备上运行。 电子设备的存储器中可存储组成该可穿戴设备的各个程序模块,比如,图5所示的原图获取模块、原图RGB提取模块、水印获取模块等。各个程序模块构成的计算机可读指令使得一个或多个处理器执行本说明书中描述的本申请各个实施例的基于DWT的数字水印方法中的步骤。
在一个实施例中,提供了一种电子设备,包括存储器和一个或多个处理器,该存储器存储有计算机可读指令,该一个或多个处理器执行计算机可读指令时实现步骤S110~S160、S210~S260。
在一个实施例中,还提供了一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,其上存储有计算机可读指令,计算机可读指令被一个或多个处理器执行时实现以下步骤S110~S160、S210~S260。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,比如静态随机存取存储器(Static Random Access Memory,SRAM)和动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。
工业实用性
本公开提供的基于DWT的数字水印方法,在水印嵌入原图时采用低频信息和高频信息共同嵌入的方式,由于低频频带含有图像大部分的信息,水印在低频频带嵌入,使得最终提取出来的水印和原始水印图差别不大,提取出的水印图完整度较高,具有很强的工业实用性。

Claims (15)

  1. 一种基于DWT的数字水印方法,其特征在于,包括水印嵌入方法,包括:
    获取待嵌入水印的原始彩色图像和要嵌入的水印彩色图像;
    分别提取所述原始彩色图像的RGB分量和所述水印彩色图像的RGB分量,对应得到原图的RGB分量图和水印的RGB分量图;
    对所述原图的RGB分量图和所述水印的RGB分量图分别进行离散小波变换,对应得到原图的RGB分量矩阵信息和水印的RGB分量矩阵信息;
    将水印的RGB分量矩阵信息采用低频信息和高频信息共同嵌入的方式嵌入到对应的原图的RGB分量矩阵信息,得到嵌入水印后的RGB分量图;
    对所述嵌入水印后的RGB分量图分别进行离散小波逆变换,得到重构后的RGB分量图;
    将所述重构后的RGB分量图进行三色叠加,得到水印后图像。
  2. 根据权利要求1所述的基于DWT的数字水印方法,其中,所述对所述原图的RGB分量图和所述水印的RGB分量图分别进行离散小波变换,对应得到原图的RGB分量矩阵信息和水印的RGB分量矩阵信息包括:
    选用Haar小波函数作为小波基函数,对所述原图的RGB分量图和所述水印的RGB分量图分别进行n级二维离散小波变换;
    所述分量矩阵信息为[C,S],其中,C用于存储n级二维离散小波变换的各级分解结果,C=((cAn,cH n,cV n,cD n),(cH n-1,cV n-1,cD n-1),……(cH 2,cV 2,cD 2),(cH 1,cV 1,cD 1)),其中,cAn表示第n级低频近似成分,cH n表示第n级高频水平细节成分,cV n表示第n级高频垂直细节成分,cD n表示第n级高频对角细节成分;S用于对C中存储的各级分解结果进行解释说明,S中记录原图尺寸信息和各级分解结果的尺寸信息;
    则所述原图的R分量矩阵信息为[C R,S R],所述原图的G分量矩阵信息为[C G,S G],所述原图的B分量矩阵信息为[C B,S B];其中,C R用于存储原图R分量的n级二维离散小波变换的各级分解结果,S R用于对C R中存储的各级分解结果进行解释说明;C G用于存储原图G分量的n级二维离散小波变换的各级分解结果,S G用于对C G中存储的各级分解结果进行解释说明;C B用于存储原图B分量的n级二维离散小波变换的各级分解结果,S B用于对C B中存储的各级分 解结果进行解释说明;
    所述水印的R分量矩阵信息为[C WR,S WR],所述水印的G分量矩阵信息为[C WG,S WG],所述水印的B分量矩阵信息为[C WB,S WB];其中,C WR用于存储水印R分量的n级二维离散小波变换的各级分解结果,S WR用于对C WR中存储的各级分解结果进行解释说明;C WG用于存储水印G分量的n级二维离散小波变换的各级分解结果,S WG用于对C WG中存储的各级分解结果进行解释说明;C WB用于存储水印B分量的n级二维离散小波变换的各级分解结果,S WB用于对C WB中存储的各级分解结果进行解释说明。
  3. 根据权利要求2所述的基于DWT的数字水印方法,其中,所述将水印的RGB分量矩阵信息采用低频信息和高频信息共同嵌入的方式嵌入到对应的原图的RGB分量矩阵信息,得到嵌入水印后的RGB分量图包括:
    设置嵌入系数m,所述水印的RGB分量矩阵信息的低频信息乘以所述嵌入系数m,并加在所述原图的RGB分量矩阵信息的低频信息上;
    将所述水印的RGB分量矩阵信息的高频信息乘以所述嵌入系数,并加在所述原图的RGB分量矩阵信息的高频信息上,重复嵌入k次,得到嵌入水印后的RGB分量图。
  4. 根据权利要求3所述的基于DWT的数字水印方法,其中,所述水印的RGB分量矩阵信息的低频信息乘以所述嵌入系数m,并加在所述原图的GRB分量矩阵信息的低频信息上具体的嵌入代码如下:
    C i(1:size(C Wi,2)/16)=C i(1:size(C Wi,2)/16)+m*C Wi(1:size(C Wi,2)/16)
    其中,i∈[R,G,B];m∈[r,g,b],r为红色嵌入系数,g为绿色嵌入系数,b为蓝色嵌入系数;size(X,2)表示X向量的长度。
  5. 一种基于DWT的数字水印方法,其中,基于权利要求1-4任一项所述的基于DWT的数字水印方法获得的水印后图像,包括水印提取方法,包括:
    获取未嵌入水印的原始彩色图像和所述水印后图像;
    分别提取所述原始彩色图像的RGB分量和所述水印后图像的RGB分量,对应得到原图的RGB分量图和水印后图像的RGB分量图;
    对所述原图的RGB分量图和所述水印后图像的RGB分量图分别进行离散小波变换,对应得到原图的RGB分量矩阵信息和水印后图像的RGB分量矩阵信息;
    根据所述水印后图像的RGB分量矩阵信息与所述原图的RGB分量矩阵信息提取水印的低频信息和高频信息,进而得到水印的RGB分量矩阵信息;
    将所述水印的RGB分量矩阵信息分别进行离散小波逆变换,得到重构后的RGB分量图;
    将所述重构后的RGB分量图进行三色叠加,得到提取彩色水印。
  6. 根据权利要求5所述的基于DWT的数字水印方法,其中,所述根据所述水印后图像的RGB分量矩阵信息与所述原图的RGB分量矩阵信息提取水印的低频信息和高频信息,进而得到水印的RGB分量矩阵信息包括:
    将所述水印后图像的RGB分量矩阵信息与所述原图的RGB分量矩阵信息对应采用先求差值再除以嵌入系数m的方式,得到水印RGB分量的低频信息和高频信息;
    将所述水印RGB分量的低频信息和高频信息合并,得到水印的RGB分量矩阵信息。
  7. 基于DWT的数字水印系统,其特征在于,包括水印嵌入装置,包括:
    原图获取模块,配置成获取待嵌入水印的原始彩色图像;
    原图RGB提取模块,配置成提取所述原始彩色图像的RGB分量,得到原图的RGB分量图;
    原图离散小波变换模块,配置成对所述原图的RGB分量图分别进行离散小波变换,得到原图的RGB分量矩阵信息;
    水印获取模块,配置成获取要嵌入的水印彩色图像;
    水印RGB提取模块,配置成提取所述水印彩色图像的RGB分量,得到水印的RGB分量图;
    水印离散小波变换模块,配置成对所述水印的RGB分量图进行离散小波变换,得到水印的RGB分量矩阵信息;
    嵌入模块,配置成将水印的RGB分量矩阵信息采用低频信息和高频信息共同嵌入的方式嵌入到对应的原图的RGB分量矩阵信息,得到嵌入水印后的RGB分量图;
    离散小波逆变换模块,配置成对所述嵌入水印后的RGB分量图分别进行离散小波逆变换,得到重构后的RGB分量图;
    叠加模块,配置成将所述重构后的RGB分量图进行三色叠加,得到水印后图像。
  8. 根据权利要求7所述的基于DWT的数字水印系统,其中,
    所述原图离散小波变换模块,具体配置成选用Haar小波函数作为小波基函数,对所述原图的RGB分量图进行n级二维离散小波变换;
    所述水印离散小波变换模块,具体配置成选用Haar小波函数作为小波基函数,对所述水印的RGB分量图进行n级二维离散小波变换;
    所述分量矩阵信息为[C,S],其中,C用于存储n级二维离散小波变换的各级分解结果,C=((cAn,cH n,cV n,cD n),(cH n-1,cV n-1,cD n-1),……(cH 2,cV 2,cD 2),(cH 1,cV 1,cD 1)),其中,cAn表示第n级低频近似成分,cH n表示第n级高频水平细节成分,cV n表示第n级高频垂直细节成分,cD n表示第n级高频对角细节成分;S用于对C中存储的各级分解结果进行解释说明,S中记录原图尺寸信息和各级分解结果的尺寸信息;
    则所述原图的R分量矩阵信息为[C R,S R],所述原图的G分量矩阵信息为[C G,S G],所述原图的B分量矩阵信息为[C B,S B];其中,C R用于存储原图R分量的n级二维离散小波变换的各级分解结果,S R用于对C R中存储的各级分解结果进行解释说明;C G用于存储原图G分量的n级二维离散小波变换的各级分解结果,S G用于对C G中存储的各级分解结果进行解释说明;C B用于存储原图B分量的n级二维离散小波变换的各级分解结果,S B用于对C B中存储的各级分解结果进行解释说明;
    所述水印的R分量矩阵信息为[C WR,S WR],所述水印的G分量矩阵信息为[C WG,S WG],所述水印的B分量矩阵信息为[C WB,S WB];其中,C WR用于存储水印R分量的n级二维离散小波变换的各级分解结果,S WR用于对C WR中存储的各级分解结果进行解释说明;C WG用于存储水印G分量的n级二维离散小波变换的各级分解结果,S WG用于对C WG中存储的各级分解结果进行解释说明;C WB用于存储水印B分量的n级二维离散小波变换的各级分解结果,S WB用于对C WB中存储的各级分解结果进行解释说明。
  9. 根据权利要求8所述的基于DWT的数字水印系统,其中,所述嵌入模块,具体配置成:设置嵌入系数m,所述水印的RGB分量矩阵信息的低频信息乘以所述嵌入系数m,并加在所述原图的RGB分量矩阵信息的低频信息上;
    将所述水印的RGB分量矩阵信息的高频信息乘以所述嵌入系数,并加在所述原图的RGB分量矩阵信息的高频信息上,重复嵌入k次,得到嵌入水印后的RGB分量图。
  10. 根据权利要求9所述的基于DWT的数字水印系统,其中,所述嵌入模块,具体配置成:设置嵌入系数m,所述水印的RGB分量矩阵信息的低频信息乘以所述嵌入系数m,并加在所述原图的RGB分量矩阵信息的低频信息上具体的嵌入代码如下:
    C i(1:size(C Wi,2)/16)=C i(1:size(C Wi,2)/16)+m*C Wi(1:size(C Wi,2)/16)
    其中,i∈[R,G,B];m∈[r,g,b],r为红色嵌入系数,g为绿色嵌入系数,b为蓝色嵌入系数;size(X,2)表示X向量的长度。
  11. 基于DWT的数字水印系统,其特征在于,包括水印提取装置,包括:
    原图获取模块,配置成获取未嵌入水印的原始彩色图像;
    原图RGB提取模块,配置成提取所述原始彩色图像的RGB分量,得到原图的RGB分量图;
    原图离散小波变换模块,配置成对所述原图的RGB分量图进行离散小波变换,得到原图的RGB分量矩阵信息;
    水印后图像获取模块,配置成获取待提取水印的水印后图像;
    水印后图像RGB提取模块,配置成提取所述水印后图像的RGB分量,得到水印后图像的RGB分量图;
    水印后图像离散小波变换模块,配置成对所述水印后图像的RGB分量图分别进行离散小波变换,得到水印后图像的RGB分量矩阵信息;
    提取模块,配置成根据所述水印后图像的RGB分量矩阵信息与所述原图的RGB分量矩阵信息提取水印的低频信息和高频信息,进而得到水印的RGB分量矩阵信息;
    离散小波逆变换模块,配置成将所述水印的RGB分量矩阵信息分别进行离散小波逆变换,得到重构后的RGB分量图;
    叠加模块,配置成将所述重构后的RGB分量图进行三色叠加,得到提取彩色水印。
  12. 根据权利要求11所述的基于DWT的数字水印系统,其中,
    所述提取模块,具体配置成将所述水印后图像的RGB分量矩阵信息与所述原图的RGB分量矩阵信息对应采用先求差值再除以嵌入系数m的方式,得到水印RGB分量的低频信息和高频信息;
    将所述水印RGB分量的低频信息和高频信息合并,得到水印的RGB分量矩阵信息。
  13. 根据权利要求11所述的基于DWT的数字水印系统,其中,所述原图离散小波变换模块,具体配置成选用Haar小波函数作为小波基函数,对所述原图的RGB分量图进行n级二维离散小波变换;
    所述水印后图像离散小波变换模块,具体配置成选用Haar小波函数作为小波基函数,对所述水印后图像的RGB分量图进行n级二维离散小波变换;
    所述分量矩阵信息为[C,S],其中,C用于存储n级二维离散小波变换的各级分解结果,C=((cAn,cH n,cV n,cD n),(cH n-1,cV n-1,cD n-1),……(cH 2,cV 2,cD 2),(cH 1,cV 1,cD 1)),其中,cAn表示第n级低频近似成分,cH n表示第n级高频水平细节成分,cV n表示第n级高频垂直细节成分,cD n表示第n级高频对角细节成分;S用于对C中存储的各级分解结果进行解释说明,S中记录原图尺寸信息和各级分解结果的尺寸信息;
    则所述原图的R分量矩阵信息为[C R,S R],所述原图的G分量矩阵信息为[C G,S G],所述原图的B分量矩阵信息为[C B,S B];其中,C R用于存储原图R分量的n级二维离散小波变换的各级分解结果,S R用于对C R中存储的各级分解结果进行解释说明;C G用于存储原图G分量的n级二维离散小波变换的各级分解结果,S G用于对C G中存储的各级分解结果进行解释说明;C B用于存储原图B分量的n级二维离散小波变换的各级分解结果,S B用于对C B中存储的各级分解结果进行解释说明;
    所述水印的R分量矩阵信息为[C WR,S WR],所述水印的G分量矩阵信息为[C WG,S WG],所述水印的B分量矩阵信息为[C WB,S WB];其中,C WR用于存储水印R分量的n级二维离散小波变换的各级分解结果,S WR用于对C WR中存储的各级分解结果进行解释说明;C WG用于存储水印G分量的n级二维离散小波变换的各级分解结果,S WG用于对C WG中存储的各级分解结果进行解释说明;C WB用于存储水印B分量的n级二维离散小波变换的各级分解结果,S WB用于对C WB中存储的各级分解结果进行解释说明。
  14. 一种电子设备,其特征在于,包括存储器和一个或多个处理器,所述存储器存储有计算机可读指令,其特征在于,所述一个或多个处理器执行所述计算机可读指令时实现权利要求1-6中任一项所述的基于DWT的数字水印方法的步骤。
  15. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被一个或多个处理器执行时实现权利要求1-6中任一项所述的基于DWT的数字水印方法的步骤。
PCT/CN2022/141415 2022-01-24 2022-12-23 基于dwt的数字水印方法、系统、电子设备及存储介质 WO2023138303A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210081771.2 2022-01-24
CN202210081771.2A CN114493969A (zh) 2022-01-24 2022-01-24 基于dwt的数字水印方法、系统、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023138303A1 true WO2023138303A1 (zh) 2023-07-27

Family

ID=81475217

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/141415 WO2023138303A1 (zh) 2022-01-24 2022-12-23 基于dwt的数字水印方法、系统、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN114493969A (zh)
WO (1) WO2023138303A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117093965A (zh) * 2023-10-20 2023-11-21 江苏省测绘资料档案馆 一种基础测绘成果全流程追踪系统及方法

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114493969A (zh) * 2022-01-24 2022-05-13 西安闻泰信息技术有限公司 基于dwt的数字水印方法、系统、电子设备及存储介质
CN115482142A (zh) * 2022-09-27 2022-12-16 河北纬坤电子科技有限公司 暗水印添加方法、提取方法、系统、存储介质及终端
CN115564634B (zh) * 2022-12-05 2023-05-02 杭州海康威视数字技术股份有限公司 视频对抗水印嵌入方法、装置、电子设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252694A (zh) * 2014-10-17 2014-12-31 苏州工业职业技术学院 一种基于dwt的图像水印嵌入方法及提取方法
WO2016016040A1 (en) * 2014-07-31 2016-02-04 Innovation Ulster Limited Digital image watermarking system and method
CN114493969A (zh) * 2022-01-24 2022-05-13 西安闻泰信息技术有限公司 基于dwt的数字水印方法、系统、电子设备及存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699508B (zh) * 2009-09-03 2012-01-11 中兴通讯股份有限公司 一种图像数字水印嵌入和提取的方法及系统
CN110910299B (zh) * 2019-11-29 2021-01-05 山东科技大学 一种基于整数小波变换的自适应可逆信息隐藏方法
CN112801846B (zh) * 2021-02-09 2024-04-09 腾讯科技(深圳)有限公司 一种水印嵌入、提取方法、装置、计算机设备和存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016016040A1 (en) * 2014-07-31 2016-02-04 Innovation Ulster Limited Digital image watermarking system and method
CN104252694A (zh) * 2014-10-17 2014-12-31 苏州工业职业技术学院 一种基于dwt的图像水印嵌入方法及提取方法
CN114493969A (zh) * 2022-01-24 2022-05-13 西安闻泰信息技术有限公司 基于dwt的数字水印方法、系统、电子设备及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HONGMEI SHI: "A Strong Robust Image Watermarking Algorithm Design", JOURNAL OF CHANGZHOU VOCATIONAL COLLEGE OF INFORMATION TECHNOLOGY, vol. 3, 1 January 2011 (2011-01-01), pages 36 - 39, XP093080644 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117093965A (zh) * 2023-10-20 2023-11-21 江苏省测绘资料档案馆 一种基础测绘成果全流程追踪系统及方法
CN117093965B (zh) * 2023-10-20 2024-03-12 江苏省测绘资料档案馆 一种基础测绘成果全流程追踪系统及方法

Also Published As

Publication number Publication date
CN114493969A (zh) 2022-05-13

Similar Documents

Publication Publication Date Title
WO2023138303A1 (zh) 基于dwt的数字水印方法、系统、电子设备及存储介质
Mahto et al. A survey of color image watermarking: State-of-the-art and research directions
Bhattacharya et al. A session based multiple image hiding technique using DWT and DCT
Jayashree et al. A Robust Image Watermarking Scheme Using Z-Transform, Discrete Wavelet Transform and Bidiagonal Singular Value Decomposition.
CN109685710A (zh) 一种图像版权隐数字水印嵌入的方法及装置
Wang et al. Blind color image watermarking based on DWT and LU decomposition
WO2023231679A1 (zh) 音频处理方法、版权读取方法及计算机设备、存储介质
Su et al. A combined domain watermarking algorithm of color image
CN115908095A (zh) 一种基于分层注意力特征融合的鲁棒图像水印方法及系统
McKeon Strange Fourier steganography in movies
Zhu et al. Generative high-capacity image hiding based on residual CNN in wavelet domain
Elbasi Enhancing the robustness of watermarked medical images using heuristic search algorithm
CN116308986A (zh) 基于小波变换及注意力机制的隐蔽水印攻击算法
CN116703726A (zh) 基于可逆神经网络的大规模图像隐写方法、装置和设备
CN111065000B (zh) 视频水印处理方法、装置及存储介质
RU2331085C2 (ru) Двухкомпонентное встраивание сообщений в изображение
Wang An efficient multiple-bit reversible data hiding scheme without shifting
CN111583085B (zh) 一种基于变换域的彩色图像数字水印方法
Aghagolzadeh et al. Bayer and panchromatic color filter array demosaicing by sparse recovery
Li et al. Resampling forgery detection in JPEG-compressed images
Molina-Garcia et al. Parallel image and video self-recovery scheme with high recovery capability
Karmani et al. Efficient hardware architecture of 2D-scan-based wavelet watermarking for image and video
Phuong Thi et al. A new block selection strategy from LU decomposition domain for robust image watermarking
CN115222575B (zh) 利用频率域系数比值的矢量数据水印嵌入和提取方法
Shilbayeh Digital VVatermarking System based on Cascading Haar Wavelet

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22921724

Country of ref document: EP

Kind code of ref document: A1