CN116095341A - Watermark embedding method, device, equipment and storage medium - Google Patents

Watermark embedding method, device, equipment and storage medium Download PDF

Info

Publication number
CN116095341A
CN116095341A CN202310068287.0A CN202310068287A CN116095341A CN 116095341 A CN116095341 A CN 116095341A CN 202310068287 A CN202310068287 A CN 202310068287A CN 116095341 A CN116095341 A CN 116095341A
Authority
CN
China
Prior art keywords
watermark
frame image
embedded
dct
video
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202310068287.0A
Other languages
Chinese (zh)
Inventor
武兰兰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Novel Supertv Digital Tv Technology Co ltd
Original Assignee
Beijing Novel Supertv Digital Tv Technology Co ltd
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 Beijing Novel Supertv Digital Tv Technology Co ltd filed Critical Beijing Novel Supertv Digital Tv Technology Co ltd
Priority to CN202310068287.0A priority Critical patent/CN116095341A/en
Publication of CN116095341A publication Critical patent/CN116095341A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/467Embedding additional information in the video signal during the compression process characterised by the embedded information being invisible, e.g. watermarking
    • 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
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • G06T1/0092Payload characteristic determination in a watermarking scheme, e.g. number of bits to be embedded
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]

Landscapes

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

Abstract

The invention discloses a watermark embedding method, device, equipment and storage medium. The method comprises the following steps: acquiring an I frame image associated with an original compressed video and other video frames except the I frame image, and performing Discrete Cosine Transform (DCT) domain decoding on the I frame image; watermark embedding is carried out on the I frame image decoded in the DCT domain based on a differential energy watermark DEW algorithm, so that the I frame image added with the watermark is obtained; and carrying out lossless recoding treatment on the I-frame image embedded with the watermark to obtain an encoded I-frame image containing the watermark, and generating a compressed video with the watermark embedded according to the I-frame image containing the watermark and other video frames except the I-frame image. The technical scheme of the invention can effectively embed the watermark into the video, and is convenient for follow-up better video piracy tracking and copyright protection.

Description

Watermark embedding method, device, equipment and storage medium
Technical Field
The present invention relates to the field of video processing, and in particular, to a watermark embedding method, apparatus, device, and storage medium.
Background
With the development of network and multimedia technologies, video data is often attacked by illegal actions such as malicious copying, deleting, modifying, etc., and the problem of copyright protection becomes more and more important, while the related technology of digital watermarking has been widely applied to copyright protection of video data.
How to effectively embed watermark into video, thereby better realizing piracy tracking and copyright protection of video is a problem to be solved in the present.
Disclosure of Invention
The invention provides a watermark embedding method, a watermark embedding device, watermark embedding equipment and a watermark embedding storage medium, which can effectively embed the watermark into the video and facilitate the follow-up better video piracy tracking and copyright protection.
According to an aspect of the present invention, there is provided a watermark embedding method, including:
acquiring an I frame image associated with an original compressed video and other video frames except the I frame image, and performing Discrete Cosine Transform (DCT) domain decoding on the I frame image;
watermark embedding is carried out on the I frame image decoded in the DCT domain based on a differential energy watermark DEW algorithm, so that the I frame image added with the watermark is obtained;
and carrying out lossless recoding treatment on the I-frame image embedded with the watermark to obtain an encoded I-frame image containing the watermark, and generating a compressed video with the watermark embedded according to the I-frame image containing the watermark and other video frames except the I-frame image.
According to another aspect of the present invention, there is provided a watermark embedding apparatus comprising:
the decoding module is used for acquiring an I frame image associated with the original compressed video and other video frames except the I frame image, and performing Discrete Cosine Transform (DCT) domain decoding on the I frame image;
The embedding module is used for watermark embedding of the I frame image decoded by the DCT domain based on a differential energy watermark DEW algorithm to obtain an I frame image added with the watermark;
the generation module is used for carrying out lossless recoding processing on the I-frame image embedded with the watermark, obtaining the encoded I-frame image containing the watermark, and generating a compressed video with the watermark embedded according to the I-frame image containing the watermark and other video frames except the I-frame image.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the watermark embedding method described in any one of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement a watermark embedding method according to any embodiment of the present invention when executed.
According to the technical scheme, an I frame image associated with an original compressed video and other video frames except the I frame image are obtained, discrete cosine transform DCT domain decoding is carried out on the I frame image, watermark embedding is carried out on the I frame image decoded in the DCT domain based on a differential energy watermark DEW algorithm, the I frame image with the watermark added is obtained, lossless recoding processing is carried out on the I frame image with the watermark embedded, the I frame image with the watermark after encoding is obtained, and the compressed video with the watermark embedded is generated according to the I frame image with the watermark and other video frames except the I frame image. The DCT domain decoding, watermark embedding and recoding are only carried out on the I frame, so that the time for embedding the video watermark can be greatly reduced, the watermark embedding efficiency is improved, the watermark embedding of the video can be realized from the coding angle by adopting the DEW algorithm to embed the watermark, the visual invisibility of the watermark is improved, and the follow-up better video piracy tracking and copyright protection are facilitated.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a watermark embedding method according to a first embodiment of the present invention;
fig. 2 is a block diagram of a watermark embedding device according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," "target," "candidate," "alternative," and the like in the description and claims of the invention and in the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that, the video uses the principle of persistence of vision of human eyes, and a series of pictures are played to make human eyes generate a sense of movement. Simply transmitting video pictures, the amount of video is very large and unacceptable for existing networks and storage. In order to facilitate the transmission and storage of the video, people find that the video has a large amount of repeated information, if the repeated information is removed at the transmitting end and recovered at the receiving end, the files of the video data are greatly reduced, and therefore, the video often relates to the encoding and decoding processes in the process of transmission and processing.
The original compressed video provided by the invention can be video compressed based on an H.264 video compression standard or video compressed based on other compression standards (such as mpeg 2), and the invention is not limited to this, in the H.264 compression standard, I frames, P frames and B frames are all used for representing transmitted video pictures. Specifically, the I frame is also called an intra-frame coding frame, is an independent frame with all information, can be independently decoded without referring to other images, and can be simply understood as a still picture. The first frame in the video sequence is always an I-frame because it is a key-on. P frames, also known as inter prediction encoded frames, represent the difference between the current frame picture and the previous frame. B frames are also called bi-directional predictive coding frames, and the differences between the frame and the previous and subsequent frames are recorded by the B frames. The watermark embedding scheme provided by the invention can effectively improve the effectiveness of watermark embedding by only carrying out watermark embedding on the I frame of the original compressed video, and the specific scheme is explained in detail in the following embodiments.
Example 1
Fig. 1 is a flowchart of a watermark embedding method according to a first embodiment of the present invention; the embodiment is applicable to the case of digital watermark embedding of video, and the method can be performed by a watermark embedding device, which can be implemented in hardware and/or software, and which can be configured in an electronic device, such as a device with video watermark embedding function. As shown in fig. 1, the watermark embedding method includes:
S101, acquiring an I frame image associated with the original compressed video and other video frames except the I frame image, and performing discrete cosine transform DCT domain decoding on the I frame image.
The original compressed video refers to video that has been subjected to video compression using a preset compression standard. An I-frame image refers to an intra-coded frame of the original compressed video, and may be, for example, the first frame of a video sequence to which the original compressed video corresponds. Other video frames refer to video frames other than I-frame images (i.e., I-frame video frames) in the video frames associated with the original compressed video. Discrete cosine transform (Discrete Cosine Transform, DCT) is a technique that can transform an image from the spatial domain to the frequency domain.
Optionally, the video to be watermark embedded designated by the related personnel can be obtained and used as the original compressed video, and the video frames contained in the original compressed video are classified based on a preset video frame classification mode to determine the I-frame image associated with the original compressed video and other video frames except the I-frame image.
Optionally, the decoder of the video frequency domain decoding module is used for performing DCT domain decoding on the I-frame image, including: and adopting a decoder of the video frequency domain decoding module to perform DCT domain decoding on the I frame image, and determining DCT coefficients corresponding to each macro block in the I frame image. The DCT domain decoding refers to a process of decoding an I frame image from a space domain to a frequency domain through DCT transformation.
Optionally, the decoder of the video frequency domain decoding module is used for performing DCT domain decoding on the I-frame image, including: and determining macro blocks contained in the I frame image, and performing DCT domain inverse quantization on the macro blocks in the I frame image by adopting a decoder of a video frequency domain decoding module to realize DCT domain decoding of the I frame image. Wherein, the I-frame image may include at least 1 macroblock, each macroblock is composed of a plurality of pixels, for example, if the macroblock has a size of 8×8 pixels, the macroblock includes 64 pixels.
It should be noted that a video picture may be encoded into one or more slices (slices), each slice containing an integer number of Macroblocks (MBs), i.e., at least one MB per slice, and at most, each slice containing macroblocks of the entire picture.
Optionally, slice (i.e., slice) information of the I-frame image in the original compressed video may be obtained, and the macro block included in the I-frame image may be further determined according to the slice information. Meanwhile, related elements of each macro block and I-frame slice (i.e. stripe) information elements, such as mb_type (macro block type), quantization matrix and the like, can be recorded so as to be called when recoding the video I-frame after watermark is embedded later.
It should be noted that, according to the codec process, different macro block elements, such as MPEG-2Encoder/Decoder Version 1.2 of the peer codec, generally need to be recorded, and some elements of dct_type, mb_type, mb_mquat, slice, etc. need to be recorded when the codec is actually implemented.
Optionally, after performing DCT domain decoding by using a decoder of the video frequency domain decoding module, the luminance value (0-255) of each pixel in each macroblock may be obtained, the luminance values of each pixel are DCT-transformed (i.e. inversely quantized), and the obtained DCT coefficients of each pixel, and the DCT matrix formed by the DCT coefficients of each pixel corresponding to the macroblock is used as the DCT coefficients of the macroblock.
It should be noted that, the watermark embedding scheme provided by the invention adopts a transform domain watermark technology (namely DCT domain decoding operation), and can perform certain frequency domain modulation on watermark information in the transform process of the I frame image from the space domain to the frequency domain, so that the watermark information is well hidden in important energy parts of the image, and meanwhile, the obvious degradation of the image quality is not caused.
S102, watermark embedding is carried out on the I frame image decoded in the DCT domain based on a differential energy watermark DEW algorithm, and the I frame image added with the watermark is obtained.
The differential energy watermark algorithm (Differential Energy Watermarking, DEW) is an algorithm for watermark embedding. In the I-frame image decoded in the DCT domain, each macroblock may be referred to as a DCT block, that is, the I-frame image decoded in the DCT domain includes a plurality of DCT blocks, each DCT block is composed of a plurality of pixels, and each pixel corresponds to a DCT coefficient, so each DCT block is associated with a DCT coefficient matrix.
It should be noted that, watermark embedding may be performed on the I-frame image decoded in the DCT domain, or the texture area (i.e., the area where the target embedded watermark block in the I-frame image is located) may be determined from the I-frame image decoded in the DCT domain based on a preset rule, and then watermark embedding is performed in the determined texture area, so that the efficiency of watermark embedding may be effectively improved.
Optionally, watermark embedding is performed on the I-frame image decoded in the DCT domain based on a differential energy watermarking DEW algorithm, including: determining a watermark embedding region in the I frame image decoded in the DCT domain based on a differential energy watermark DEW algorithm, and determining a target embedded watermark block meeting watermark embedding conditions in the watermark embedding region; and determining a watermark block to be embedded corresponding to the target embedded watermark block, and performing watermark embedding on the target embedded watermark block according to the information value of the watermark block to be embedded.
The watermark embedding area is primarily determined from the I frame image decoded by the DCT domain. The watermark embedding region contains at least one target embedded watermark block. The target embedded watermark block refers to a watermark block area satisfying watermark embedding conditions in the watermark embedding area. Watermark embedding conditions refer to conditions for evaluating whether a watermark block belongs to a texture region. The watermark block to be embedded refers to a preset watermark block which needs to be embedded into a watermark embedding area of the I frame image. Each watermark block to be embedded is associated with an information value of 0 or 1, which characterizes the watermark information that needs to be embedded.
Alternatively, a square area with the largest middle can be taken as the watermark embedding area according to the resolution of the I-frame image. The length of the side of the watermark embedding area is an even number of macro blocks (or DCT blocks), and the distances between the four sides of the watermark embedding area and the four sides of the I frame image are at least 2 macro blocks (or DCT blocks), so as to reduce the influence of black frames around the I frame image on watermark embedding.
Optionally, the number of watermark blocks to be embedded and the information value of each watermark block to be embedded may be determined according to a preset watermark sequence to be embedded.
Optionally, after determining the target embedded watermark blocks in the watermark embedding area, iterative embedding may be performed, specifically, for each target embedded watermark block, watermark information of a preset size (for example, 1bir size) may be sequentially determined from the watermark sequence to be embedded based on a preset watermark sequence to be embedded containing the watermark to be embedded, the watermark information may be, for example, 0 or 1, as an information value of the watermark block to be embedded corresponding to the target embedded watermark block, and according to the information value of the watermark block to be embedded, the energy of the target embedded watermark block is adjusted to implement watermark embedding of the target embedded watermark block until all watermark information of all watermark blocks to be embedded in the watermark sequence to be embedded is embedded into the target embedded watermark block of the I-frame image.
It should be noted that, if the number of watermark blocks to be embedded in the preset watermark sequence is equal to the number of the determined target embedded watermark blocks, then it can be ensured that the watermark blocks to be embedded in the watermark sequence correspond to the target embedded watermark blocks one by one, so that watermark information corresponding to each watermark block to be embedded in the watermark sequence is completely embedded in the target embedded watermark blocks of the I-frame image;
if the number of watermark blocks to be embedded in the preset watermark sequence to be embedded is smaller than the number of the determined target embedded watermark blocks, for example, 5 watermark blocks to be embedded and 8 watermark blocks to be embedded are arranged, watermark information of each watermark block to be embedded can be sequentially embedded in the first 5 watermark blocks to be embedded, and then watermark information of each watermark block to be embedded is sequentially embedded again from the 6 th watermark block to be embedded until all the watermark blocks to be embedded are embedded with the watermark information; if the number of watermark blocks to be embedded in the preset watermark sequence to be embedded is greater than the number of the determined target watermark blocks to be embedded, for example, 5 watermark blocks to be embedded and 2 watermark blocks to be embedded are arranged, after one watermark block to be embedded is respectively embedded in two watermark blocks to be embedded, an I frame image of a frame of video can be obtained, and the rest three watermark blocks to be embedded are continuously embedded in the newly obtained I frame image.
Optionally, determining, in the watermark embedding region, a target embedded watermark block that meets the watermark embedding condition, includes: tiling and dividing the watermark embedding area by taking watermark blocks with preset sizes as units to obtain at least two candidate embedded watermark blocks; and sequentially judging whether each candidate embedded watermark block meets the watermark embedding condition, and determining the candidate embedded watermark block meeting the watermark embedding condition as a target embedded watermark block.
For example, the watermark block sequence may be obtained by tiling and dividing the image in the watermark embedding region with watermark blocks of 2x2 macro blocks as units, and each watermark block in the watermark block sequence is used as a candidate embedded watermark block.
For example, if the watermark block has a size of 32×32 pixels, the watermark block may be tiled and partitioned into 16 macro blocks having a size of 8×8 pixels, each macro block containing 64 pixels.
Optionally, after obtaining at least two candidate embedded watermark blocks, dividing the candidate embedded watermark blocks into an upper half part and a lower half part for each candidate embedded watermark block, generating a first bearing sub-region and a second bearing sub-region, and determining energies EA and EB of the first bearing sub-region and the second bearing sub-region respectively; and judging whether EA and EB are larger than a preset energy threshold value D0, if so, considering that two bearing subareas of the candidate embedded watermark block are texture areas, and enabling the candidate embedded watermark block to meet watermark embedding conditions.
Illustratively, S is defined as an I-frame image. B is defined as the DCT block in the I-frame image. Then there are:
S={B k |k=0,1,…,N}
where N is the number of DCT blocks in the I-frame image. B (B) k Representing the kth DCT block. If the size of the I frame image is N 1 ×N 2 And each DCT block has a size of n0×n0 pixels, the number of DCT blocks in the I-frame image n=n 1 ×N 2 /(n0 x n0)。
The quantized high frequency component in the DCT block of the I frame image is denoted as S (c), which is a set of elements with sequence numbers greater than a preset separation sequence number c in DCT coefficients generated by frequency rearrangement after scanning, that is, S (c) = { I e {0, n0 x n0-1} | (I > c) }. Where n0 is the side length of each DCT block.
Alternatively, the sum of squares of the DCT coefficients of each DCT block in the first bearer sub-area may be used as the energy of the first bearer sub-area, while the sum of squares of the DCT coefficients of each DCT block in the second bearer sub-area may be used as the energy of the second bearer sub-area.
Alternatively, the energy EA of the first bearer sub-region may be determined based on the following formula:
Figure BDA0004073704130000091
wherein EA is the energy of the first carrier sub-region. N is the number of DCT blocks in the I-frame image. S (c) is a high frequency component quantized in the DCT block of the I-frame image. DCT [ i, j]The number i of the DCT coefficient value in the j-th DCT coefficient matrix in the first bearer sub-area A. [ ] Q Representing the value of the DCT coefficients after inverse quantization in the DCT domain.
Alternatively, the energy EB of the second bearer sub-region may be determined based on the following formula:
Figure BDA0004073704130000092
where EB is the energy of the second carrier region. N is the number of DCT blocks in the I-frame image. S (c) is a high frequency component quantized in the DCT block of the I-frame image. DCT [ i, j]The number i of the j-th DCT coefficient matrix in the second bearer sub-area B is the DCT coefficient value. [] Q Representing the value of the DCT coefficients after inverse quantization in the DCT domain.
It should be noted that, the energy calculation manners of the first bearer sub-area and the second bearer sub-area are the same, but the DCT coefficients of the macro blocks included in the first bearer sub-area and the second bearer sub-area may be different, so that the obtained energy of the first bearer sub-area and the obtained energy of the second bearer sub-area may be different.
It should be noted that, by circularly embedding the watermark sequence, the number of the target embedded watermark blocks is determined according to the texture of the I-frame image, and the same watermark information is not required to be embedded after all the I-frame images, so that the method has larger embedding amount compared with the traditional texture DEW method.
It should be noted that, through the lossless recoding module, the influence of recoding after watermark embedding on the watermark embedding effect can be effectively reduced, and the algorithm has higher invisibility. The embedding method has DEW robustness, and improves two indexes of invisibility and embedding amount in video watermark vision, thereby better realizing piracy tracking and copyright protection of video
Optionally, watermark embedding is performed on the target embedded watermark block according to the information value of the watermark block to be embedded, including: and adjusting DCT coefficients of the target DCT blocks in the first bearing subarea or the second bearing subarea corresponding to the target embedded watermark blocks according to the information values of the watermark blocks to be embedded, so as to realize watermark embedding.
Optionally, an energy value EA of the first bearer sub-area corresponding to the target embedded watermark block and an energy value EB of the second bearer sub-area corresponding to the target embedded watermark block may be determined, and an energy difference between EA and EB may be further determined: d=ea-EB.
Optionally, if the information value of the watermark block to be embedded is 1 and the energy difference between EA and EB is greater than 0, the DCT system of the DCT block associated with the target embedded watermark block may not be adjusted; if the information value of the watermark block to be embedded is 0 and the energy difference between EA and EB is smaller than 0, the DCT system of the DCT block associated with the target embedded watermark block may not be adjusted.
Optionally, if the information value of the watermark block to be embedded is 1 and the energy difference between EA and EB is smaller than 0, the DCT coefficients of the target DCT block in the first bearer sub-area or the second bearer sub-area corresponding to the target embedded watermark block need to be adjusted, specifically, the DCT coefficients of the target DCT block in the second bearer sub-area of the target embedded watermark block may be adjusted, for example, the DCT coefficients of the DCT block after the DCT block preset separation sequence number c in the second bearer sub-area are set to 0, so that d=e A -E B =E A -0>0, realizing the watermark with embedded information value of 1. If the number of DCT blocks in the second bearer sub-area is 8 and the installation sequence numbers 1-8 are ordered, the preset separation sequence number c may be 4.
Optionally, if the information value of the watermark block to be embedded is 0 and the energy difference between EA and EB is greater than 0, the first carrier corresponding to the target embedded watermark block needs to be adjustedThe DCT coefficients of the target DCT block in the region or the second bearer sub-region, in particular, the DCT coefficients of the target DCT block in the first bearer sub-region of the target embedded watermark block may be adjusted, for example, the DCT coefficients of the DCT block following the DCT block preset separation sequence number c in the first bearer sub-region are set to 0 such that d=e A -E B =0-E B <0, realizing embedding the watermark with the information value of 0.
Alternatively, watermark information of the watermark block to be embedded can be sequentially circularly embedded into the target embedded watermark block meeting DEW embedding conditions, and the non-watermark embedding area and other candidate embedded watermark blocks do not perform watermark embedding operation, so that an I frame image containing the watermark is obtained.
S103, carrying out lossless recoding treatment on the I-frame image embedded with the watermark, obtaining the encoded I-frame image containing the watermark, and generating a compressed video with the watermark embedded according to the I-frame image containing the watermark and other video frames except the I-frame image.
Optionally, a preset lossless recoding module can be adopted, related elements of each macro block (or DCT block) of the I frame image after watermark embedding and I frame slice information elements are called, quantization of slice information elements and each macro block DCT domain is carried out, namely, recoding is carried out on the related elements of the DCT domain, the slice information elements and the like after the frequency domain is decoded and the watermark is added, recoding of the I frame after the watermark is added is achieved, and the encoded I frame image containing the watermark is obtained.
Optionally, after the encoded I-frame image containing the watermark is obtained, the I-frame image containing the watermark may be combined with B-frame data, P-frame data, other video frames except the I-frame image, video sequence header, GOP header, image header, and other data of the original compressed video based on a preset rule, to generate a compressed video with the watermark embedded.
It should be noted that, the watermark embedding scheme of the invention processes only the I-frame image, and does not process and directly output other video frames except the I-frame image and data such as video sequence header, GOP header, image header, etc., so that the time of watermark embedding can be greatly reduced on the basis of reducing the influence of recoding on video watermark embedding, and real-time watermark embedding is realized.
According to the technical scheme, an I frame image associated with an original compressed video and other video frames except the I frame image are obtained, discrete cosine transform DCT domain decoding is carried out on the I frame image, watermark embedding is carried out on the I frame image decoded in the DCT domain based on a differential energy watermark DEW algorithm, the I frame image with the watermark added is obtained, lossless recoding processing is carried out on the I frame image with the watermark embedded, the I frame image with the watermark after encoding is obtained, and the compressed video with the watermark embedded is generated according to the I frame image with the watermark and other video frames except the I frame image. The DCT domain decoding, watermark embedding and recoding are only carried out on the I frame, so that the time for embedding the video watermark can be greatly reduced, the watermark embedding efficiency is improved, the watermark embedding of the video can be realized from the coding angle by adopting the DEW algorithm to embed the watermark, the visual invisibility of the watermark is improved, and the follow-up better video piracy tracking and copyright protection are facilitated.
Preferably, the watermark embedding scheme provided by the invention can be realized through the following steps:
1) Let the binary watermark ID sequence to be embedded be w= { w iw I iw = 1,2, …, N }, where w iw ∈{0,1}。
2) Decoding and analyzing the original data, determining non-I frame data and I frame images, and directly outputting the non-I frame data; for video I frames (i.e. I frame images), after the video I frames are acquired, the sequence numbers of the I frame images can be recorded in a watermark configuration file, and the video I frames are subjected to frequency domain decoding to obtain DCT coefficients after the DCT domains of the macro blocks are inversely quantized, and then the inversely quantized DCT data are embedded with watermarks.
3) And calculating a watermark embedding area, and tiling and dividing a frame image in the watermark embedding area by taking 2x2 macro blocks (called watermark blocks, wherein the upper two macro blocks are marked as bearing sub-areas A, and the lower two macro blocks are marked as bearing sub-areas B) as units to obtain a watermark block sequence, namely a candidate embedded watermark block.
4) Sequentially judging whether each watermark block meets DEW watermark embedding conditions, and sequentially taking 1bit from the 1 st bit if the watermark blocks meet the DEW watermark embedding conditionsWatermark information w iw Watermark embedding is performed (see description of the second part of the inventive solution for details) and the starting macroblock number of the watermark embeddable block is recorded in the watermark profile.
5) And (4) repeating the step until all watermark information is embedded, if watermark blocks can be embedded in the video I frame after the watermark sequence of one period is embedded, continuing to sequentially select watermark blocks after watermark information is embedded from the 1 st bit watermark until the watermark embedding of one video I frame is completed, and recording a watermark ending identifier 0xffff into a watermark configuration file.
6) The I-frame DCT blocks containing the watermark and other data elements are losslessly recoded and output.
7) Repeating the steps 2-6 until the watermark embedding of all videos is completed. The watermark information embedded by the 1 st embeddable watermark block of the non-first I frame of the last frame is connected with the last 1bit watermark information of the last I frame.
Optionally, responding to the piracy tracking event, and acquiring the piracy video after watermark attack; and watermark extraction is carried out on the pirated video, watermark information of a user is determined according to watermark extraction results, and pirated video tracking is carried out.
The original video which is pirated and corresponds to the pirated video is compressed video which is subjected to watermark embedding through the watermark embedding method.
For example, assuming that the sequence length of the embedded binary watermark ID in the pirated video is N, the corresponding watermark extraction process may be as follows:
1. and reading the watermark configuration file, obtaining the I frame number, and calculating the frame sequence number j.
2. And decoding and analyzing the original data to obtain YUV data of the j frame, recoding the YUV data into an I frame, decoding the I frame into a macro block, performing inverse quantization on DCT coefficients, and performing watermark extraction on the inverse quantization on DCT data.
3. And reading the position of the initial macro block in the watermark configuration file, thereby acquiring the position of the watermark block to be extracted, and then extracting the watermark from the watermark block.
4. Calculating watermark blocksE of (2) A And E is B Note d=e A -E B Δd is a preset determination threshold (Δd>0) The watermark block extraction results are as follows:
Figure BDA0004073704130000141
5. repeating the steps 3 and 4 until the watermark ending identifier is read from the watermark configuration file, and completing the extraction of the frame watermark.
6. Repeating the steps 1-5 until watermark extraction of all watermark blocks of the watermark configuration file is completed.
7. And carrying out grouping statistics on the watermark information according to the watermark length. The element of a watermark length is a period, the number of watermark values of each bit equal to 1 and 0 in the watermark period is counted respectively, and the watermark value with the largest counted total number is the watermark value of the corresponding bit.
Example two
Fig. 2 is a block diagram of a watermark embedding device according to a second embodiment of the present invention; the watermark embedding device provided by the embodiment of the invention can be suitable for the situation of digital watermark embedding of video, can be realized in a form of hardware and/or software, and is configured in equipment with a specific watermark embedding function. As shown in fig. 2, the apparatus specifically includes: a decoding module 201, an embedding module 202, and a generating module 203, wherein,
A decoding module 201, configured to obtain an I-frame image associated with an original compressed video, and other video frames except for the I-frame image, and perform discrete cosine transform DCT domain decoding on the I-frame image;
the embedding module 202 is configured to perform watermark embedding on the I-frame image decoded in the DCT domain based on the differential energy watermarking DEW algorithm, so as to obtain a watermarked I-frame image;
the generating module 203 is configured to perform lossless recoding processing on the I-frame image after watermark embedding, obtain an encoded I-frame image containing the watermark, and generate a compressed video after watermark embedding according to the I-frame image containing the watermark and other video frames except the I-frame image.
According to the technical scheme, an I frame image associated with an original compressed video and other video frames except the I frame image are obtained, discrete cosine transform DCT domain decoding is carried out on the I frame image, watermark embedding is carried out on the I frame image decoded in the DCT domain based on a differential energy watermark DEW algorithm, the I frame image with the watermark added is obtained, lossless recoding processing is carried out on the I frame image with the watermark embedded, the I frame image with the watermark after encoding is obtained, and the compressed video with the watermark embedded is generated according to the I frame image with the watermark and other video frames except the I frame image. The DCT domain decoding, watermark embedding and recoding are only carried out on the I frame, so that the time for embedding the video watermark can be greatly reduced, the watermark embedding efficiency is improved, the watermark embedding of the video can be realized from the coding angle by adopting the DEW algorithm to embed the watermark, the visual invisibility of the watermark is improved, and the follow-up better video piracy tracking and copyright protection are facilitated.
Further, the decoding module 201 is specifically configured to:
and adopting a decoder of the video frequency domain decoding module to perform DCT domain decoding on the I frame image, and determining DCT coefficients corresponding to each macro block in the I frame image.
Further, the decoding module 201 is further configured to:
and determining macro blocks contained in the I frame image, and performing DCT domain inverse quantization on the macro blocks in the I frame image by adopting a decoder of a video frequency domain decoding module to realize DCT domain decoding of the I frame image.
Further, the embedding module 202 may include:
the watermark block determining unit is used for determining a watermark embedding area in the I frame image decoded by the DCT domain based on a differential energy watermark DEW algorithm, and determining a target embedded watermark block meeting watermark embedding conditions in the watermark embedding area;
the embedding unit is used for determining a watermark block to be embedded corresponding to the target embedded watermark block, and carrying out watermark embedding on the target embedded watermark block according to the information value of the watermark block to be embedded.
Further, the watermark block determination unit is specifically configured to:
tiling and dividing the watermark embedding area by taking watermark blocks with preset sizes as units to obtain at least two candidate embedded watermark blocks;
and sequentially judging whether each candidate embedded watermark block meets the watermark embedding condition, and determining the candidate embedded watermark block meeting the watermark embedding condition as a target embedded watermark block.
Further, the embedding unit is specifically configured to:
and adjusting DCT coefficients of the target DCT blocks in the first bearing subarea or the second bearing subarea corresponding to the target embedded watermark blocks according to the information values of the watermark blocks to be embedded, so as to realize watermark embedding.
Further, the device is also used for:
responding to the piracy tracking event, and acquiring a piracy video after watermark attack;
and watermark extraction is carried out on the pirated video, watermark information of a user is determined according to watermark extraction results, and pirated video tracking is carried out.
Example III
Fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention. Fig. 3 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 3, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the watermark embedding method.
In some embodiments, the watermark embedding method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. One or more of the steps of the watermark embedding method described above may be performed when the computer program is loaded into RAM 13 and executed by processor 11. Alternatively, in other embodiments, the processor 11 may be configured to perform the watermark embedding method in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method of watermark embedding, comprising:
acquiring an I frame image associated with an original compressed video and other video frames except the I frame image, and performing Discrete Cosine Transform (DCT) domain decoding on the I frame image;
watermark embedding is carried out on the I frame image decoded in the DCT domain based on a differential energy watermark DEW algorithm, so that the I frame image added with the watermark is obtained;
and carrying out lossless recoding treatment on the I-frame image embedded with the watermark to obtain an encoded I-frame image containing the watermark, and generating a compressed video with the watermark embedded according to the I-frame image containing the watermark and other video frames except the I-frame image.
2. The method of claim 1, wherein discrete cosine transform, DCT, domain decoding the I-frame image comprises:
and adopting a decoder of the video frequency domain decoding module to perform DCT domain decoding on the I frame image, and determining DCT coefficients corresponding to each macro block in the I frame image.
3. The method of claim 2, wherein performing DCT-domain decoding on the I-frame image using a decoder of a video frequency-domain decoding module, comprises:
and determining macro blocks contained in the I frame image, and performing DCT domain inverse quantization on the macro blocks in the I frame image by adopting a decoder of a video frequency domain decoding module to realize DCT domain decoding of the I frame image.
4. The method of claim 1, wherein watermark embedding the DCT domain decoded I-frame image based on a differential energy watermark DEW algorithm comprises:
determining a watermark embedding region in the I frame image decoded in the DCT domain based on a differential energy watermark DEW algorithm, and determining a target embedded watermark block meeting watermark embedding conditions in the watermark embedding region;
and determining a watermark block to be embedded corresponding to the target embedded watermark block, and performing watermark embedding on the target embedded watermark block according to the information value of the watermark block to be embedded.
5. The method of claim 4, wherein determining a target embedded watermark block in the watermark embedding region that satisfies the watermark embedding condition comprises:
tiling and dividing the watermark embedding area by taking watermark blocks with preset sizes as units to obtain at least two candidate embedded watermark blocks;
and sequentially judging whether each candidate embedded watermark block meets the watermark embedding condition, and determining the candidate embedded watermark block meeting the watermark embedding condition as a target embedded watermark block.
6. The method of claim 4, wherein watermark embedding the target embedded watermark block based on the information value of the watermark block to be embedded comprises:
and adjusting DCT coefficients of the target DCT blocks in the first bearing subarea or the second bearing subarea corresponding to the target embedded watermark blocks according to the information values of the watermark blocks to be embedded, so as to realize watermark embedding.
7. The method as recited in claim 1, further comprising:
responding to the piracy tracking event, and acquiring a piracy video after watermark attack;
and watermark extraction is carried out on the pirated video, watermark information of a user is determined according to watermark extraction results, and pirated video tracking is carried out.
8. A watermark embedding device, comprising:
the decoding module is used for acquiring an I frame image associated with the original compressed video and other video frames except the I frame image, and performing Discrete Cosine Transform (DCT) domain decoding on the I frame image;
the embedding module is used for watermark embedding of the I frame image decoded by the DCT domain based on a differential energy watermark DEW algorithm to obtain an I frame image added with the watermark;
the generation module is used for carrying out lossless recoding processing on the I-frame image embedded with the watermark, obtaining the encoded I-frame image containing the watermark, and generating a compressed video with the watermark embedded according to the I-frame image containing the watermark and other video frames except the I-frame image.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the watermark embedding method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the watermark embedding method of any one of claims 1 to 7 when executed.
CN202310068287.0A 2023-01-13 2023-01-13 Watermark embedding method, device, equipment and storage medium Pending CN116095341A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310068287.0A CN116095341A (en) 2023-01-13 2023-01-13 Watermark embedding method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310068287.0A CN116095341A (en) 2023-01-13 2023-01-13 Watermark embedding method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116095341A true CN116095341A (en) 2023-05-09

Family

ID=86207990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310068287.0A Pending CN116095341A (en) 2023-01-13 2023-01-13 Watermark embedding method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116095341A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117061768A (en) * 2023-10-12 2023-11-14 腾讯科技(深圳)有限公司 Video watermark processing method, video watermark processing device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117061768A (en) * 2023-10-12 2023-11-14 腾讯科技(深圳)有限公司 Video watermark processing method, video watermark processing device, electronic equipment and storage medium
CN117061768B (en) * 2023-10-12 2024-01-30 腾讯科技(深圳)有限公司 Video watermark processing method, video watermark processing device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
Su et al. A practical design of digital video watermarking in H. 264/AVC for content authentication
CN103237209B (en) A kind of H264 video watermark process based on region DCT coefficient
Farfoura et al. Low complexity semi-fragile watermarking scheme for H. 264/AVC authentication
Xuemei et al. A new video watermarking algorithm based on shot segmentation and block classification
Zhou et al. An intra-drift-free robust watermarking algorithm in high efficiency video coding compressed domain
Nguyen et al. A novel steganography scheme for video H. 264/AVC without distortion drift
Amanipour et al. Video-tampering detection and content reconstruction via self-embedding
CN116095341A (en) Watermark embedding method, device, equipment and storage medium
WO2019037471A1 (en) Video processing method, video processing device and terminal
Zeng et al. Issues and solution on distortion drift in reversible video data hiding
US9087377B2 (en) Video watermarking method resistant to temporal desynchronization attacks
Khalilian et al. Multiplicative video watermarking with semi-blind maximum likelihood decoding for copyright protection
Barni et al. Object watermarking for for MPEG-4 video streams copyright protection
Ma et al. Data hiding in H. 264/AVC streams with limited intra-frame distortion drift
CN111065000B (en) Video watermark processing method, device and storage medium
Ahuja et al. Robust Video Watermarking Scheme Based on Intra-Coding Process in MPEG-2 Style.
Jiang et al. A robust H. 264/AVC video watermarking scheme with drift compensation
KR20100091765A (en) Method for embedding and detecting watermark
WO2022110870A1 (en) Image encoding and decoding method, encoding and decoding apparatus, encoder, and decoder
Nguyen et al. High embedding capacity data hiding algorithm for H. 264/AVC video sequences without intraframe distortion drift
Liu et al. A novel data hiding scheme for H. 264/AVC video streams without intra-frame distortion drift
Gujjunoori et al. Reversible Data Embedding for MPEG-4 Video Using Middle Frequency DCT Coefficients.
CN111510672A (en) Video tampering recovery processing method, system, storage medium and encoder
Abdi et al. Real-time Watermarking Algorithm of H. 264/AVC Video Stream.
Ellinas Reversible watermarking on stereo image sequences

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination