A video blind watermark embedding and extraction method based on H.265 / HEVC
By using the encrypted watermark image pixel values to embed I frames and P frames in H.265/HEVC videos, combined with the characteristics of DST and DCT coefficient blocks, blind extraction and high embedding capacity of video watermarks are achieved, solving existing problems. The watermarking scheme in the technology improves the practicality and quality of video watermarking by solving the problems of blind extraction and embedding capacity balance and location map transmission security.
Patent Information
- Application Number
- CN202210562182.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-23
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing video watermarking scheme based on H.265/HEVC is difficult to achieve a good balance between blind extraction and data embedding capacity and imperceptibility, and there are problems with the transmission security and integrity of the location map, resulting in low practicality. .
The encrypted watermark image pixel value is embedded into the I frame and P frame of H.265/HEVC, and the Fibonacci transformation, Hilbert curve, affine transformation or magic square transformation encryption algorithm is used, combined with the DST coefficient block and the DCT coefficient block. Features, realize blind extraction and embedding of watermarks, and use matrix coding scheme to increase embedding capacity.
The limitation of video bitrate growth is achieved, ensuring the blind extraction capability and high data embedding capacity of watermarks, while maintaining the visual quality of the video and enhancing the security and practicality of the method.
Smart Images

Figure CN114998081B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of multimedia information security and relates to a video blind watermark embedding and extraction method based on H.265 / HEVC. Background Art
[0002] Video watermarking is mainly to achieve the purpose of copyright protection by embedding information into the carrier file. Its characteristics include imperceptibility, robustness and high embedding capacity. The embedding points of video watermarks are generally selected in the spatial domain (pixel domain), transform domain and compression domain. However, video applications generally have real-time requirements. Since the computational complexity of embedding watermarks in the spatial domain and transform domain is high, most algorithms choose to embed in the compression domain. At present, a large number of video watermarking schemes have been proposed, especially for the most widely used video compression standard H.264 / AVC.
[0003] However, as people increasingly pursue higher video clarity experience, H.264 / AVC is difficult to provide ideal compression efficiency when processing ultra-high resolution videos. In response to the above problems, the new generation of video compression standard H.265 / HEVC was developed and released by the Joint Collaboration Group on Video Coding, and is gradually becoming a new hot research direction during its rapid development. Although the watermark algorithm based on H.265 / HEVC has made some progress, there are still some shortcomings:
[0004] (1) In video watermarking, blind extraction means that the watermark information can be successfully extracted at the video decoding end without relying on additional information. Among the existing digital watermarking schemes based on HEVC, most of them need to save the embedding position in a local file during the data embedding process, and then use the position map to correctly extract the watermark when extracting data at the decoding end. However, in actual application scenarios, it is difficult to transmit the position map file securely and completely from the sender to the receiver, so these schemes are not very practical.
[0005] (2) There is no good balance between the imperceptibility and embedding capacity of the watermark algorithm. The video embedded with the watermark should not affect the quality of the original video, but as the data embedding capacity increases, many existing algorithms will have a greater impact on imperceptibility. In addition, the existing algorithms only embed the watermark information into a single frame type of the video, thus wasting a lot of embedding space and reducing the embedding efficiency. Summary of the invention
[0006] In order to solve the above technical problems, the present invention provides a video blind watermark embedding and extraction method based on H.265 / HEVC, which can effectively limit the growth of video bit rate, realize blind extraction of watermarks, and ensure video visual quality while achieving higher data embedding capacity.
[0007] The present invention provides a video blind watermark embedding and extraction method based on H.265 / HEVC, comprising the following steps:
[0008] Step 1: Encrypt the watermark image with copyright information;
[0009] Step 2: The pixel value of the encrypted watermark image is embedded into the HEVC I frame image in binary form as watermark information;
[0010] Step 3: The pixel values of the encrypted watermark image are embedded into the HEVC P frame image in binary form as watermark information;
[0011] Step 4: In the HEVC video decoding stage, the watermark information embedded in the I frame image is blindly extracted;
[0012] Step 5: In the HEVC video decoding stage, the watermark information embedded in the P frame image is blindly extracted;
[0013] Step 6: Decrypt the extracted watermark information and restore it to the watermark image.
[0014] In the video blind watermark embedding and extraction method based on H.265 / HEVC of the present invention, step 1 is specifically as follows:
[0015] The encryption method used in the watermark image encryption processing is the Fibonacci transformation encryption algorithm, the Hilbert curve transformation encryption algorithm, the affine transformation encryption algorithm or the magic square transformation encryption algorithm; the pixel value of the encrypted watermark image will be embedded into the video in binary form as the watermark information.
[0016] In the video blind watermark embedding and extraction method based on H.265 / HEVC of the present invention, step 2 is specifically as follows:
[0017] Step 2.1: First, find the 4×4 luminance DST coefficient block of the I frame, and then calculate the PNNZ value of this coefficient block according to the corresponding coefficients in the 2nd row and 2nd column of the luminance DST coefficient block. The PNNZ value represents the number of non-zero coefficients in the specified position.
[0018] Step 2.2: If the PNNZ value of the current coefficient block is less than a preset threshold N th , N th = 1 to 7, then this coefficient block abandons embedding watermark information, otherwise the current 4×4 brightness DST coefficient block is dequantized and inversely transformed to obtain the first reconstructed residual matrix R r , as shown in formula (1);
[0019]
[0020] Step 2.3: Calculate the first reconstruction residual matrix R according to formula (2): r Middle pixel x' 33 The average value of the surrounding 8 pixels
[0021]
[0022] Step 2.4: Design the watermark embedding matrix W as shown in formula (3):
[0023]
[0024] Where, δ is the embedding strength;
[0025] Step 2.5: Use w k Represents the binary bit of the embedded watermark information. When the binary bit of the watermark information w k =1, judge Is it established? th >1 If it is established, the watermark information is embedded and the next step is executed; otherwise, the embedding strength in the watermark embedding matrix W is set according to the following formula:
[0026]
[0027] Among them, Qstep is the equivalent quantization step size;
[0028] Step 2.6: Modify the original DST coefficient matrix using the obtained watermark embedding matrix W according to the following formula;
[0029] X W =X+W (5)
[0030] Where X is the original DST coefficient matrix, X W Represents the modified DST coefficient matrix, which realizes the embedding of watermark;
[0031] Step 2.7: When the binary bit w of the watermark information k =0, judge Is it true? If so, the watermark information is embedded and the next step is executed; otherwise, the embedding strength in the watermark embedding matrix W is set according to the following formula:
[0032]
[0033] Among them, Qstep is the equivalent quantization step size;
[0034] Step 2.8: Modify the original coefficient matrix using the watermark embedding matrix W obtained in the previous step according to the following formula;
[0035] X W =XW (7)
[0036] Where X is the original DST coefficient matrix, X W Represents the modified DST coefficient matrix, which realizes the embedding of watermark.
[0037] Step 2.9: The current 4×4 luminance DST coefficient block has been processed, and steps 2.1 to 2.8 are repeated until all 4×4 luminance DST coefficient blocks have been processed.
[0038] In the video blind watermark embedding and extraction method based on H.265 / HEVC of the present invention, step 3 is specifically as follows:
[0039] Step 3.1: Get the 4×4 luminance DCT coefficient block of each P frame. In order to realize the blind extraction of watermark, use the coefficients A1 and A2 in the DCT coefficient matrix A as flags. If the number of non-zero values of A1 and A2 is greater than or equal to a threshold T th , T th If the value is 1 or 2, the next step of embedding process is carried out, otherwise the block abandons embedding data;
[0040]
[0041] Step 3.2: Select the (1,7,3) matrix coding scheme, use the 3rd to 9th coefficients A3~A9 in the DCT coefficient matrix as carrier signals, and use their least significant bits to construct the carrier vector S 1×7 :
[0042] S 1×7 =(v1,v2,v3,v4,v5,v6,v7) (9)
[0043] Among them, v1~v7 are the least significant bits of A3~A9 respectively;
[0044] Step 3.3: Select the binary Hamming code matrix H 3×7 :
[0045]
[0046] Then, by H 3×7 and S 1×7 According to formula (11), the dependency vector D is calculated 3×1 ;
[0047]
[0048] Among them, S 1×c represents a 1-row c-column carrier vector, H m×c represents the Hamming code matrix with m rows and c columns, D m×1 represents a dependency vector with m rows and 1 column, and mod represents a modulo operation;
[0049] Step 3.4: Select 3 bits of watermark information in order to form the information vector E 3×1 =(m1,m2,m3), and then calculate the carrier vector S according to formula (12) 1×7 To modify the position P, add 1 to the coefficients of the corresponding positions in A3 to A9 of the DCT coefficient matrix A according to the modified position, and complete the watermark embedding;
[0050]
[0051] Among them, bin2dec() represents the binary to decimal function. represents an exclusive-OR operation; if position P is zero, it means that the carrier vector does not change.
[0052] Step 3.6: The current 4×4 luminance DCT coefficient block is processed, and steps 2.2.1 to 2.2.3 are repeated until all 4×4 luminance DCT coefficient blocks are processed.
[0053] In the video blind watermark embedding and extraction method based on H.265 / HEVC of the present invention, step 4 is specifically as follows:
[0054] Step 4.1: At the HEVC video decoding end, for each 4×4 luma DST coefficient block of an I frame, calculate the PNNZ value of this coefficient block according to the corresponding coefficients in the second row and the second column of the luma DST coefficient block.
[0055] Step 4.2: When the PNNZ value of this coefficient block is less than the preset threshold N th , the extracted information is abandoned; otherwise, the coefficient block is dequantized and inversely transformed to obtain the second reconstructed residual matrix R W :
[0056]
[0057] Step 4.3: Calculate the second reconstruction residual matrix R W of The average value of the surrounding 8 pixels
[0058]
[0059] Step 4.4: Extract the embedded watermark information according to formula (14), w k Represents the extracted binary information bits:
[0060]
[0061] Step 4.5: Save the extracted watermark information and repeat steps 4.1 to 4.4 until all 4×4 luminance DST coefficient blocks are processed.
[0062] In the video blind watermark embedding and extraction method based on H.265 / HEVC of the present invention, step 5 is specifically as follows:
[0063] Step 5.1: During the HEVC video decoding process, obtain the 4×4 luminance DCT coefficient block of each P frame. If the modified DCT coefficient matrix The coefficients in and The number of non-zero values of is greater than or equal to the threshold T th , then proceed to the next step of extraction process, otherwise give up extracting watermark for this block;
[0064]
[0065] Step 5.2: Perform the inverse process of matrix encoding, using the modified DCT coefficient matrix The 3rd to 9th coefficients As the carrier signal, The least significant bit of the carrier vector S' is constructed 1×7 :
[0066] S' 1×7 =(v'1,v'2,v'3,v'4,v'5,v'6,v'7) (17)
[0067] Step 5.3: Use the Hamming code matrix H of formula (10) 3×7 Multiply by S' 1×7 The transposition of the extracted watermark information M can be obtained 3×1 :
[0068] M 3×1 =H 3×7 S' 1×7 (18)
[0069] Step 5.4: Save the extracted watermark information and repeat steps 5.1 to 5.3 until the processing of all 4×4 luminance DCT coefficient blocks is completed.
[0070] The H.265 / HEVC-based video blind watermark embedding and extraction method of the present invention also includes evaluating the video quality after the watermark information is inserted through the peak signal-to-noise ratio PSNR and the structural similarity index SSIM.
[0071] The video blind watermark embedding and extraction method based on H.265 / HEVC of the present invention has at least the following beneficial effects:
[0072] 1. Converting one-dimensional information into two-dimensional information improves the robustness of the watermark, and encryption processing improves security. Generally, the copyright information of the video author is in the form of a line of text or a special number. When the information is embedded in the video in this way, once it is attacked maliciously, the recognizability of the information will be sharply reduced. If the information is embedded in a two-dimensional form such as an image, even if the extracted image pixels are changed, shifted, or even missing some blocks, it is still possible to identify the watermark information.
[0073] 2. The decoding end can successfully extract the watermark information without relying on additional information. The present invention uses the non-zero number of some coefficients in the coefficient matrix to determine whether the current block is embedded with a watermark, thereby achieving true blind watermark extraction at the receiving end, thereby enhancing the practicability of the method.
[0074] 3. The video quality and data embedding capacity after watermark embedding are guaranteed. In the video I frame, the present invention uses an information embedding algorithm without intra-frame prediction error propagation by analyzing the characteristics of 35 intra-frame prediction modes of HEVC. By modifying the 4×4 size brightness DST coefficient block, the final embedding effect may only cause a change in one pixel in the spatial domain, which effectively guarantees the quality of the video. In the video P frame, since most P frames use inter-frame prediction, even if the coefficients are directly modified, it will not cause intra-frame prediction error propagation, so the present invention chooses to use matrix coding to increase the embedding capacity. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 It is a flow chart of a method for embedding and extracting blind watermarks in a video based on H.265 / HEVC of the present invention;
[0076] Figure 2 For this embodiment, the original watermark image with copyright information is used;
[0077] Figure 3 It is the image after the original watermark image is encrypted;
[0078] Figure 4 This is the flow chart for embedding watermark of 4×4 luma DST coefficient block in HEVC I frame;
[0079] Figure 5 The PNNZ value position calculation diagram for the 4×4 luma DST coefficient block in the HEVC I frame;
[0080] Figure 6(a) is a comparison diagram of the original video frame and the watermarked video frame at frame 6 of the test video RaceHorses_416x240_30;
[0081] Figure 6(b) is a comparison diagram of the original video frame and the watermarked video frame at frame 65 of the test video RaceHorses_832x480_30;
[0082] Figure 6(c) is a comparison diagram of the original video frame and the watermarked video frame in the first frame of the test video FourPeople_1280x720_60;
[0083] Figure 6(d) is a comparison diagram of the original video frame and the watermarked video frame at frame 65 of the test video BasketballDrive_1920x1080_50. DETAILED DESCRIPTION
[0084] In order to more clearly explain the purpose, technical methods and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0085] This paper proposes a video blind watermark embedding and extraction method based on H.265 / HEVC, which provides a copyright protection solution for the new generation video compression standard H.265 / HEVC by efficiently embedding information into the video compression domain. Figure 1 As shown, the specific implementation of the method of the present invention includes the following steps:
[0086] Step 1: Encrypt the watermark image with copyright information to enhance security. In this embodiment, the watermark image is a 64×64 grayscale image, such as Figure 2 The encrypted watermark image looks like this: Figure 3 Specifically, the encryption method used in this step can be a Fibonacci transformation encryption algorithm, a Hilbert curve transformation encryption algorithm, an affine transformation encryption algorithm, or a magic square transformation encryption algorithm. The pixel value of the encrypted watermark image will be embedded in the video in binary form as watermark information.
[0087] In the HEVC encoding stage, different embedding methods are designed for I frames and P frames. For ease of description, the methods for I frames and P frames are introduced separately, but it should be noted that in general, I frames and P frames of a video appear alternately, that is, the embedding steps described below selectively execute steps 2 and 3 according to different frame types.
[0088] Step 2: The pixel values of the encrypted watermark image are embedded into the HEVC I frame image in binary form as watermark information, such as Figure 4 As shown, step 2 is specifically as follows:
[0089] Step 2.1: First find the 4×4 luminance DST coefficient block of the I frame, and then use the corresponding coefficients of the 2nd row and 2nd column in the luminance DST coefficient block, that is, Figure 5In the light gray block, the PNNZ value of this coefficient block is calculated. The PNNZ value represents the number of non-zero coefficients in the specified position.
[0090] Step 2.2: If the PNNZ of the current coefficient block is less than a preset threshold N th , N th = 1 to 7, then this coefficient block abandons embedding watermark information, otherwise the current 4×4 brightness DST coefficient block is dequantized and inversely transformed to obtain the first reconstructed residual matrix R r , as shown in formula (1);
[0091]
[0092] Step 2.3: Calculate the first reconstruction residual matrix R according to formula (2): r Middle pixel x' 33 The average value of the surrounding 8 pixels
[0093]
[0094] Step 2.4: Design the watermark embedding matrix W as shown in formula (3):
[0095]
[0096] Where, δ is the embedding strength;
[0097] Step 2.5: Use w k Represents the binary bit of the embedded watermark information. When the binary bit of the watermark information w k =1, judge Is it established? th >1, if it is established, the watermark information is embedded and the next step is executed; otherwise, the embedding strength in the watermark embedding matrix W is set according to the following formula:
[0098]
[0099] Among them, Qstep is the equivalent quantization step size;
[0100] Step 2.6: Modify the original DST coefficient matrix using the obtained watermark embedding matrix W according to the following formula;
[0101] X W =X+W (5)
[0102] Where X is the original DST coefficient matrix, X W Represents the modified DST coefficient matrix, which realizes the embedding of watermark;
[0103] Step 2.7: When the binary bit w of the watermark information k=0, judge Is it true? If so, the watermark information is embedded and the next step is executed; otherwise, the embedding strength in the watermark embedding matrix W is set according to the following formula:
[0104]
[0105] Among them, Qstep is the equivalent quantization step size;
[0106] Step 2.8: Modify the original coefficient matrix using the watermark embedding matrix W obtained in the previous step according to the following formula;
[0107] X W =XW (7)
[0108] Where X is the original DST coefficient matrix, X W Represents the modified DST coefficient matrix, which changes x' by modifying the original coefficient matrix 33 and The relationship between the two is used to realize the embedding of watermark.
[0109] Step 2.9: The current 4×4 luminance DST coefficient block has been processed, and steps 2.1 to 2.8 are repeated until all 4×4 luminance DST coefficient blocks have been processed.
[0110] There are two important thresholds in step 2, N th and R th ; The setting of these two values is to balance the imperceptibility and embedding capacity of the data embedding algorithm. In this embodiment, N is set th =6 and R th =3. According to the binary bit w of the embedded watermark information k The embedding strength δ in the embedding matrix W is set according to different values of , and the original DST coefficient matrix is modified by the embedding matrix W to embed the watermark information.
[0111] Step 3: The pixel value of the encrypted watermark image is embedded into the HEVC P frame image in binary form as watermark information. Step 3 is specifically as follows;
[0112] Step 3.1: Get the 4×4 luminance DCT coefficient block of each P frame. In order to realize the blind extraction of watermark, use the coefficients A1 and A2 in the DCT coefficient matrix A as flags. If the number of non-zero values of A1 and A2 is greater than or equal to a threshold T th , T th If the value is 1 or 2, the next step of embedding process is carried out, otherwise the block abandons embedding data;
[0113]
[0114] Step 3.2: Select the (1,7,3) matrix coding scheme, use the 3rd to 9th coefficients A3~A9 in the DCT coefficient matrix as carrier signals, and use their least significant bits to construct the carrier vector S 1×7 :
[0115] S 1×7 =(v1,v2,v3,v4,v5,v6,v7) (9)
[0116] Among them, v1~v7 are the least significant bits of A3~A9 respectively;
[0117] Step 3.3: Select the binary Hamming code matrix H 3×7 :
[0118]
[0119] Then, by H 3×7 and S 1×7 According to formula (11), the dependency vector D is calculated 3×1 ;
[0120]
[0121] Among them, S 1×c represents a 1-row c-column carrier vector, H m×c represents the Hamming code matrix with m rows and c columns, D m×1 represents a dependency vector with m rows and 1 column, and mod represents a modulo operation;
[0122] Step 3.4: Select 3 bits of watermark information in order to form the information vector E 3×1 =(m1,m2,m3), and then calculate the carrier vector S according to formula (12) 1×7 To modify the position P, add 1 to the coefficients of the corresponding positions in A3 to A9 of the DCT coefficient matrix A according to the modified position, and complete the watermark embedding;
[0123]
[0124] Among them, bin2dec() represents the binary to decimal function. represents an exclusive-OR operation; if position P is zero, it means that the carrier vector does not change.
[0125] Step 3.6: The current 4×4 luminance DCT coefficient block is processed, and steps 2.2.1 to 2.2.3 are repeated until all 4×4 luminance DCT coefficient blocks are processed.
[0126] Step 4: In the HEVC video decoding stage, the watermark information embedded in the I frame image is blindly extracted. Step 4 is as follows:
[0127] Step 4.1: At the HEVC video decoding end, for each 4×4 luma DST coefficient block of an I frame, calculate the PNNZ value of this coefficient block according to the corresponding coefficients in the second row and the second column of the luma DST coefficient block.
[0128] Step 4.2: When the PNNZ value of this coefficient block is less than the preset threshold N th , the extracted information is abandoned; otherwise, the coefficient block is dequantized and inversely transformed to obtain the second reconstructed residual matrix R W :
[0129]
[0130] Step 4.3: Calculate the second reconstruction residual matrix R W of The average value of the surrounding 8 pixels x W ;
[0131]
[0132] Step 4.4: Extract the embedded watermark information according to formula (14), w k Represents the extracted binary information bits:
[0133]
[0134] Step 4.5: Save the extracted watermark information and repeat steps 4.1 to 4.4 until all 4×4 luminance DST coefficient blocks are processed.
[0135] Step 5: In the HEVC video decoding stage, the watermark information embedded in the P frame image is blindly extracted. Step 5 is as follows:
[0136] Step 5.1: During the HEVC video decoding process, obtain the 4×4 luminance DCT coefficient block of each P frame. If the modified DCT coefficient matrix The coefficients in and The number of non-zero values of is greater than or equal to the threshold T th , then proceed to the next step of extraction process, otherwise give up extracting watermark for this block;
[0137]
[0138] Step 5.2: Perform the inverse process of matrix encoding, using the modified DCT coefficient matrix The 3rd to 9th coefficients As the carrier signal, The least significant bit of the carrier vector S' is constructed 1×7 :
[0139] S' 1×7 =(v'1,v'2,v'3,v'4,v'5,v'6,v'7) (17)
[0140] Step 5.3: Use the Hamming code matrix H of formula (10) 3×7 Multiply by S' 1×7 The transposition of the extracted watermark information M can be obtained 3×1 :
[0141] M 3×1 =H 3×7 S' T 1×7 (18)
[0142] Step 5.4: Save the extracted watermark information and repeat steps 5.1 to 5.3 until the processing of all 4×4 luminance DCT coefficient blocks is completed.
[0143] Step 6: Decrypt the extracted watermark information to restore the watermark image, completing the extraction of the watermark image.
[0144] Experimental results and analysis
[0145] 1. Analysis of video bitrate growth
[0146] In general, embedding data in a video will inevitably lead to a certain degree of bit rate expansion. However, the embedding algorithm should not significantly affect the encoding and decoding process of the video and reduce the user experience. The present invention tests the influence of the watermarking method on the video bit rate by conducting experiments on a variety of video sequences. The experimental results are shown in Table 1. In Table 1, the composition of the video sequence name is as follows: Taking RaceHorses_416x240_30 as an example, RaceHorses represents the sequence name, 416×240 represents the video resolution, and 30 represents the frame rate of the video. QP represents the quantization parameter during video compression. The basic unit of the bit rate is kbps. It can be seen from the experimental results that the average bit rate expansion of all test sequences is only 0.2033%. It can be seen that the watermarking method proposed in the present invention has little effect on the expansion of the video bit rate.
[0147] Table 1 Video bit rate expansion introduced by watermark
[0148]
[0149] 2. Video Subjective Quality Analysis
[0150] Subjective quality mainly refers to whether human vision can perceive the existence of the watermark after the watermark is embedded in the video. Figure 6(a)-Figure 6(d)It is a comparison of the original and watermarked video frames of the test sequence. In the figure, the left side is the decoded video frame of the original video after compression, and the right side is the compressed and decoded video frame after adding the watermark. The subjective quality analysis experimental results are all obtained under the condition of QP=28. Figure 6(a) is a comparison of the original video frame and the watermarked video frame of the 6th frame of the test video RaceHorses_416x240_30, Figure 6(b) is a comparison of the original video frame and the watermarked video frame of the 65th frame of the test video RaceHorses_832x480_30, Figure 6(c) is a comparison of the original video frame and the watermarked video frame of the 1st frame of the test video FourPeople_1280x720_60, and Figure 6(d) is a comparison of the original video frame and the watermarked video frame of the 65th frame of the test video BasketballDrive_1920x1080_50. The experimental results show that it is difficult for the human eye to perceive the presence of watermarks in videos. This watermarking method does not have a significant impact on the subjective quality of the video, ensuring the imperceptibility of the watermarking algorithm.
[0151] 3. Objective video quality analysis
[0152] The subjective quality evaluation system of the video often requires a lot of manpower and time costs, and will be affected by the subjective consciousness of the tester, while the objective quality evaluation system uses algorithms and visual models to complete the quality evaluation of the reconstructed image on the computer. The following uses multiple objective evaluation indicators to analyze the impact of the watermark algorithm on video quality from multiple dimensions.
[0153] (1) PSNR
[0154] Peak Signal to Noise Ratio (PSNR) is a classic full-reference image metric used to measure the difference between the original image and the distorted image. The definition of PSNR is shown in formula (19):
[0155]
[0156] In formula (19), MaxErr is the absolute value of the maximum value of the corresponding image color component (in this case is set to 1), MSE is the root mean square error, which is defined as shown in formula (20):
[0157]
[0158] In formula (20), m and n correspond to the length and width of the image, respectively, and I(i, j) and K(i, j) correspond to the original image and the distorted image, respectively. In this experiment, the value range of PSNR is 0 to 100. The larger the value, the smaller the distortion of the video image. When the value is between 30 and 40, the distortion of the image is difficult to be detected. Table 2 shows the impact of the watermark algorithm on the PSNR value of the video. Among them, the calculation result of the PSNR value is the average value of the video sequence on the YUV component. The reference image is the video image before compression, and the original video is the video compressed and decoded by HEVC when the watermark is not embedded. It can be seen from Table 2 that the PSNR value of the algorithm of the present invention is only slightly reduced compared with the original video. The experimental results show that the video watermark algorithm of the present invention has good imperceptibility.
[0159] Table 2 The influence of the watermark algorithm of the present invention on the video PSNR value
[0160]
[0161] (2)SSIM
[0162] The structural similarity index SSIM (Structure Similarity) evaluates image distortion from three components: brightness similarity, contrast similarity, and structural similarity. The algorithm uses a window function W i,j (i, j = 0, 1, 2, ..., N) is convolved on the image and is defined as shown in formula (21):
[0163]
[0164] It should be noted that in equation (21), the image U uses negative indices that extend beyond the image area, and here the nearest edge pixels are extended to the desired position. Then, using the convolution operation in equation (22), the SSIM of the image pixels is calculated in equation (23):
[0165]
[0166]
[0167] In formula (23), C1 = 0.01 2 ,C2=0.03 2 The SSIM value range is from 0 to 1. The larger the value, the smaller the image distortion. SSIM=1 means that the two images are the same. Table 3 shows the influence of the watermark algorithm on the SSIM value of the video image in the experiment. From the experimental results in Table 3, it can be seen that the watermark algorithm of the present invention has little influence on the SSIM value, indicating that the watermark only causes slight distortion to the video image.
[0168] Table 3 The impact of the watermark algorithm of the present invention on the video SSIM value
[0169]
[0170] The platform used for testing in this experiment is: Intel(R) Core(TM) i5-10400 CPU@2.90GHz; memory (RAM): 16GB; operating system: Windows 10 64-bit; algorithm implementation language: C++ language.
[0171] The above series of analyses show that the blind watermarking method based on H.265 / HEVC proposed in the present invention can effectively limit the growth of video bit rate, realize blind extraction of watermarks, and ensure video visual quality while achieving higher data embedding capacity. Experiments have proved that the watermarking method of the present invention is suitable for application scenarios such as video copyright protection and has high practical value.
[0172] The above description is only a preferred embodiment of the present invention and is not intended to limit the concept of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A video blind watermark embedding and extraction method based on H.265 / HEVC, characterized in that: The following steps are involved: Step 1: Encrypt the watermark image with copyright information; Step 2: The pixel value of the encrypted watermark image is embedded into the HEVC I frame image in binary form as watermark information; Step 3: The pixel values of the encrypted watermark image are embedded into the HEVC P frame image in binary form as watermark information; Step 4: In the HEVC video decoding stage, the watermark information embedded in the I frame image is blindly extracted; Step 5: In the HEVC video decoding stage, the watermark information embedded in the P frame image is blindly extracted; Step 6: Decrypt the extracted watermark information and restore it to the watermark image; Step 2 is specifically as follows: Step 2.1: First, find the 4×4 luminance DST coefficient block of the I frame, and then calculate the PNNZ value of this coefficient block according to the corresponding coefficients in the second row and the second column of the luminance DST coefficient block. The PNNZ value represents the number of non-zero coefficients in the specified position. Step 2.2: If the PNNZ value of the current coefficient block is less than a preset threshold N th , N th = 1 to 7, then this coefficient block abandons embedding watermark information, otherwise the current 4×4 brightness DST coefficient block is dequantized and inversely transformed to obtain the first reconstructed residual matrix R r , as shown in formula (1); Step 2.3: Calculate the first reconstruction residual matrix R according to formula (2): r Middle pixel x' 33 The average value of the surrounding 8 pixels Step 2.4: Design the watermark embedding matrix W as shown in formula (3): Where δ is the embedding strength; Step 2.5: Use w k Represents the binary bit of the embedded watermark information. When the binary bit of the watermark information w k =1, judge Is it established? th >1, if it is established, the watermark information is embedded and the next step is executed; otherwise, the embedding strength in the watermark embedding matrix W is set according to the following formula: Among them, Qstep is the equivalent quantization step size; Step 2.6: Modify the original DST coefficient matrix using the obtained watermark embedding matrix W according to the following formula; X W =X+W (5) Where X is the original DST coefficient matrix, X W Represents the modified DST coefficient matrix, which realizes the embedding of watermark; Step 2.7: When the binary bit w of the watermark information k =0, judge Is it true? If so, the watermark information is embedded and the next step is executed; otherwise, the embedding strength in the watermark embedding matrix W is set according to the following formula: Among them, Qstep is the equivalent quantization step size; Step 2.8: Modify the original coefficient matrix using the watermark embedding matrix W obtained in the previous step according to the following formula; X W =X-W (7) Where X is the original DST coefficient matrix, X W Represents the modified DST coefficient matrix, which realizes the embedding of watermark; Step 2.9: The current 4×4 luminance DST coefficient block is processed, and steps 2.1 to 2.8 are repeated until all 4×4 luminance DST coefficient blocks are processed; Step 3 is specifically as follows: Step 3.1: Get the 4×4 luminance DCT coefficient block of each P frame. In order to realize the blind extraction of watermark, use the coefficients A1 and A2 in the DCT coefficient matrix A as flags. If the number of non-zero values of A1 and A2 is greater than or equal to a threshold T th , T th If the value is 1 or 2, the next step of embedding process is carried out, otherwise the block abandons embedding data; Step 3.2: Select the (1,7,3) matrix coding scheme, use the 3rd to 9th coefficients A3~A9 in the DCT coefficient matrix as carrier signals, and use their least significant bits to construct the carrier vector S 1×7 : S 1×7 =(v1,v2,v3,v4,v5,v6,v7) (9) Among them, v1:v7 are the least significant bits of A3 to A9 respectively; Step 3.3: Select the binary Hamming code matrix H 3×7 : Then, by H 3×7 and S 1×7 According to formula (11), the dependency vector D is calculated 3×1 ; Among them, S 1×c represents a 1-row c-column carrier vector, H m×c represents the Hamming code matrix with m rows and c columns, D m×1 represents a dependency vector with m rows and 1 column, and mod represents a modulo operation; Step 3.4: Select 3 bits of watermark information in order to form the information vector E 3×1 =(m1,m2,m3), and then calculate the carrier vector S according to formula (12) 1×7 To modify the position P, add 1 to the coefficients of the corresponding positions in A3 to A9 of the DCT coefficient matrix A according to the modified position, and complete the watermark embedding; Among them, bin2dec() represents the binary to decimal function. represents an XOR operation; if position P is zero, it means that the carrier vector does not change; Step 3.5: The current 4×4 luminance DCT coefficient block is processed, and steps 3.1 to 3.4 are repeated until all 4×4 luminance DCT coefficient blocks are processed; Step 4 is specifically as follows; Step 4.1: At the HEVC video decoding end, for each 4×4 luma DST coefficient block of an I frame, calculate the PNNZ value of this coefficient block according to the corresponding coefficients in the second row and the second column of the luma DST coefficient block; Step 4.2: When the PNNZ value of this coefficient block is less than the preset threshold N th , the extracted information is abandoned; otherwise, the coefficient block is dequantized and inversely transformed to obtain the second reconstructed residual matrix R W : Step 4.3: Calculate the second reconstruction residual matrix R W of The average value of the surrounding 8 pixels Step 4.4: Extract the embedded watermark information according to formula (14), w k Represents the extracted binary information bits: Step 4.5: Save the extracted watermark information and repeat steps 4.1 to 4.4 until all 4×4 luminance DST coefficient blocks are processed; Step 5 is specifically as follows; Step 5.1: During the HEVC video decoding process, obtain the 4×4 luminance DCT coefficient block of each P frame. If the modified DCT coefficient matrix The coefficients in and The number of non-zero values of is greater than or equal to the threshold T th , then proceed to the next step of extraction process, otherwise give up extracting watermark for this block; Step 5.2: Perform the inverse process of matrix coding, using the 3rd to 9th coefficients in the modified DCT coefficient matrix A As the carrier signal, The least significant bit of the carrier vector S' is constructed 1×7 : Step 5.3: Use the Hamming code matrix H of formula (10) 3×7 Multiply by S' 1×7 The transposition of the extracted watermark information M can be obtained 3×1 : M 3×1 =H 3×7 S' 1×7 (18) Step 5.4: Save the extracted watermark information and repeat steps 5.1 to 5.3 until the processing of all 4×4 luminance DCT coefficient blocks is completed.
2. The method for embedding and extracting blind video watermarks based on H.265 / HEVC according to claim 1, characterized in that: Step 1 specifically includes: The encryption method used in the watermark image encryption processing is the Fibonacci transformation encryption algorithm, the Hilbert curve transformation encryption algorithm, the affine transformation encryption algorithm or the magic square transformation encryption algorithm; the pixel value of the encrypted watermark image will be embedded into the video in binary form as the watermark information.
3. The method for embedding and extracting blind video watermarks based on H.265 / HEVC according to claim 1, characterized in that: It also includes evaluating the video quality after inserting watermark information through peak signal-to-noise ratio PSNR and structural similarity index SSIM.
