CN111327963A - Watermark embedding and extracting method, device and equipment - Google Patents

Watermark embedding and extracting method, device and equipment Download PDF

Info

Publication number
CN111327963A
CN111327963A CN201811541393.1A CN201811541393A CN111327963A CN 111327963 A CN111327963 A CN 111327963A CN 201811541393 A CN201811541393 A CN 201811541393A CN 111327963 A CN111327963 A CN 111327963A
Authority
CN
China
Prior art keywords
matrix
watermark information
image frame
preset
watermark
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
CN201811541393.1A
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 Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201811541393.1A priority Critical patent/CN111327963A/en
Publication of CN111327963A publication Critical patent/CN111327963A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/835Generation of protective data, e.g. certificates
    • H04N21/8358Generation of protective data, e.g. certificates involving watermark
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/88Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving rearrangement of data among different coding units, e.g. shuffling, interleaving, scrambling or permutation of pixel data or permutation of transform coefficient data among different blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor
    • H04N5/913Television signal processing therefor for scrambling ; for copy protection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor
    • H04N5/913Television signal processing therefor for scrambling ; for copy protection
    • H04N2005/91307Television signal processing therefor for scrambling ; for copy protection by adding a copy protection signal to the video signal
    • H04N2005/91335Television signal processing therefor for scrambling ; for copy protection by adding a copy protection signal to the video signal the copy protection signal being a watermark

Abstract

The embodiment of the invention provides a watermark embedding and extracting method, device and equipment. The method comprises the following steps: acquiring a target image frame to be added with preset watermark information; dividing a target image frame into a plurality of image blocks; acquiring a direct current coefficient corresponding to each image block; and adding preset watermark information to the target image frame according to the preset watermark information and the direct current coefficient corresponding to each image block. The method of the embodiment of the invention improves the capability of resisting the heavy compression attack on the premise of ensuring the image quality.

Description

Watermark embedding and extracting method, device and equipment
Technical Field
The embodiment of the invention relates to the technical field of digital copyright, in particular to a watermark embedding and extracting method, device and equipment.
Background
The advent of the digital information era brings great convenience to the life of people, and meanwhile, problems related to the digital information era are gradually exposed, for example, piracy not only causes economic loss, but also seriously attacks the enthusiasm of creators, and negatively affects the healthy development of the market, so how to effectively protect the copyright of digital products is a problem which needs to be solved urgently.
Video watermarking technology has been developed to protect the copyright of video information. The video watermarking technology is to utilize the spatial and temporal redundancy of carrier data, embed copyright information into a video sequence and ensure the concealment and invisibility of operation.
With the development of video compression technology, most of digital videos used in daily life are subjected to compression coding processing. After video encoding and decoding processing, the existing video watermark can cause loss of part of watermark information, namely, the existing video watermark technology can not resist the recompression attack of the video compression technology, and can not effectively protect the copyright of the video information.
Disclosure of Invention
The embodiment of the invention provides a watermark embedding and extracting method, a watermark embedding and extracting device and watermark embedding equipment, which are used for solving the problem that the existing watermark embedding method cannot resist the heavy compression attack.
In a first aspect, an embodiment of the present invention provides a watermark embedding method, including:
acquiring a target image frame to be added with preset watermark information;
dividing a target image frame into a plurality of image blocks;
acquiring a Direct Current (DC) coefficient corresponding to each image block;
and adding preset watermark information to the target image frame according to the preset watermark information and the direct current coefficient corresponding to each image block.
In a possible implementation manner, adding preset watermark information to a target image frame according to the preset watermark information and a direct current coefficient corresponding to each image block includes:
scrambling and encrypting preset watermark information;
and adding the preset watermark information after the scrambling and encryption processing to the target image frame according to the preset watermark information after the scrambling and encryption processing and the direct current coefficient corresponding to each image block.
In a possible implementation manner, scrambling and encrypting the preset watermark information includes:
and performing an Arnold transformation on the preset watermark information.
In a possible implementation manner, acquiring a target image frame to which preset watermark information is to be added includes:
acquiring a Y component of a target image frame to be added with preset watermark information;
dividing a target image frame into a plurality of image blocks, including:
the Y component of the target image frame is divided into a plurality of image blocks.
In one possible implementation, dividing the target image frame into a plurality of image blocks includes:
dividing the target image frame into a plurality of image blocks with the size of N × N according to the size of the target image frame and the size of preset watermark information;
Figure BDA0001908236930000021
according to formula 1, the size of N is determined, wherein the size of the target image frame is W × H, and the size of the preset watermark information is U × V.
In a possible implementation manner, the obtaining a dc coefficient corresponding to each image block includes:
according to a formula 2, performing full-phase inverse discrete sine biorthogonal conversion APIDSBT on each image block to obtain a direct current coefficient of each image block;
Y=CXCTequation 2
Wherein C represents the APIDSBT transform matrix, CTRepresenting a transpose of an APIDSBT transform matrix, X representing an image block of size N × N, Y representing an APIDSBT transform coefficient matrix for image block X, Y (0,0) representing a dc coefficient for image block X;
Figure BDA0001908236930000022
the order-N APIDSBT transformation matrix C is determined according to equation 3, where C (i, j) represents the i row and j column elements in the matrix C, and l represents the summation variable.
In a possible implementation manner, adding the preset watermark information to the target image frame according to the preset watermark information and the dc coefficient corresponding to each image block includes:
performing discrete wavelet transform on the first matrix to generate a second matrix, wherein the first matrix is formed by direct current coefficients corresponding to a plurality of image blocks;
performing singular value decomposition on the second matrix to obtain a diagonal matrix corresponding to the second matrix;
determining a third matrix according to the diagonal matrix corresponding to the second matrix and the matrix corresponding to the watermark information;
performing singular value decomposition on the third matrix to obtain a diagonal matrix corresponding to the third matrix;
and acquiring the image frame added with the preset watermark information according to the diagonal matrix corresponding to the third matrix.
In a possible implementation manner, determining a third matrix according to the diagonal matrix corresponding to the second matrix and the matrix corresponding to the watermark information includes:
from equation 4, a third matrix is determined:
S′1=S1+ α W equation 4
Wherein S is1Identifying the diagonal matrix corresponding to the second matrix, W representing the matrix corresponding to the watermark information, α being a scaling factor, α∈ [16,32 ]],S′1Representing a third matrix.
In a second aspect, an embodiment of the present invention provides a watermark extraction method, including:
acquiring the image frame added with the watermark information;
dividing the image frame added with the watermark information into a plurality of image blocks;
acquiring a direct current coefficient corresponding to each image block;
and determining watermark information according to the direct current coefficient corresponding to each image block.
In a possible implementation manner, determining watermark information according to a dc coefficient corresponding to each image block includes:
determining watermark information after scrambling and encryption according to the direct current coefficient corresponding to each image block;
and performing anti-scrambling decryption processing on the watermark information subjected to the scrambling encryption processing to determine the watermark information.
In one possible implementation manner, the descrambling and decryption processing on the watermark information after the scrambling and encryption processing includes:
according to the periodicity of the Arnold transformation, the watermark information after the scrambling encryption processing is subjected to the descrambling decryption processing.
In a possible implementation manner, the obtaining a dc coefficient corresponding to each image block includes:
and performing full-phase inverse discrete sine biorthogonal conversion APIDSBT on each image block to obtain a direct current coefficient corresponding to each image block.
In a possible implementation manner, determining watermark information according to a dc coefficient corresponding to each image block includes:
performing discrete wavelet transform on the fourth matrix to generate a fifth matrix, wherein the fourth matrix is formed by direct current coefficients corresponding to a plurality of image blocks;
performing singular value decomposition on the fifth matrix to obtain a diagonal matrix corresponding to the fifth matrix;
determining a coefficient matrix containing watermark information according to a diagonal matrix corresponding to the fifth matrix and a watermark embedding key;
and determining watermark information according to the coefficient matrix.
In one possible implementation, determining watermark information according to the coefficient matrix includes:
determining watermark information according to formula 5;
Figure BDA0001908236930000041
wherein W represents a matrix corresponding to the watermark information, and W (i, j) is a moment corresponding to the watermark informationThe element in row i and column j of the array, α, represents the scale factor, α∈ [16,32 ]]U denotes the number of rows of the matrix W, V denotes the number of columns of the matrix W, sijRepresenting the element in the ith row and the jth column of the coefficient matrix.
In a third aspect, an embodiment of the present invention provides a watermark embedding apparatus, including:
the first acquisition module is used for acquiring a target image frame to be added with preset watermark information;
the dividing module is used for dividing the target image frame into a plurality of image blocks;
the second acquisition module is used for acquiring the direct current coefficient corresponding to each image block;
and the processing module is used for adding the preset watermark information to the target image frame according to the preset watermark information and the direct current coefficient corresponding to each image block.
In a fourth aspect, an embodiment of the present invention provides a watermark extraction apparatus, including:
the first acquisition module is used for acquiring the image frame added with the watermark information;
the dividing module is used for dividing the image frame added with the watermark information into a plurality of image blocks;
the second acquisition module is used for acquiring the direct current coefficient corresponding to each image block;
and the determining module is used for determining the watermark information according to the direct current coefficient corresponding to each image block.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the watermark embedding method according to any one of the first aspect or the watermark extraction method according to any one of the second aspect.
In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the watermark embedding method according to any one of the first aspect or the watermark extraction method according to any one of the second aspect.
According to the watermark embedding and extracting method, device and equipment provided by the embodiment of the invention, the target image frame to be added with the preset watermark information is obtained, the target image frame is divided into a plurality of image blocks, the direct current coefficient corresponding to each image block is obtained, the preset watermark information is added to the target image frame according to the preset watermark information and the direct current coefficient corresponding to each image block, the recompression attack is effectively resisted on the premise of ensuring the image quality, and the effective protection of the copyright of a digital product is realized.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a flowchart of an embodiment of a watermark embedding method provided by the present invention;
FIGS. 2A-2C are schematic diagrams of an implementation of the Arnold transformation according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an embodiment of a watermark embedding method provided by the present invention;
fig. 4 is a flowchart of an embodiment of a watermark extraction method provided in the present invention;
fig. 5 is a schematic diagram of an embodiment of a watermark extraction method provided in the present invention;
fig. 6 is a schematic structural diagram of an embodiment of a watermark embedding apparatus provided in the present invention;
fig. 7 is a schematic structural diagram of an embodiment of a watermark extraction apparatus provided in the present invention;
fig. 8 is a schematic structural diagram of an embodiment of an electronic device provided in the present invention.
With the above figures, certain embodiments of the invention have been illustrated and described in more detail below. The drawings and the description are not intended to limit the scope of the inventive concept in any way, but rather to illustrate it by those skilled in the art with reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The terms "comprising" and "having," and any variations thereof, in the description and claims of this invention are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
The terms "first" and "second" in the present application are used for identification purposes only and are not to be construed as indicating or implying a sequential relationship, relative importance, or implicitly indicating the number of technical features indicated. "plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
With the advent of the digital information age, multimedia information is exploded, and problems related to the multimedia information are gradually revealed, and particularly, the information security problem is increasingly highlighted. Current piracy of video, games, movies, music, software is on the order of billions of dollars each year in economic loss. The piracy seriously attacks the enthusiasm of creators while causing economic loss, and has negative impact on the healthy development of the market. With the help of diversified multimedia information editing software, such as Adobe Photoshop, american show, Adobe Premiere, love clip, etc., pirates can copy original digital products without loss and spread them through the internet. Even more, for some purposes, the associated digital product can be subject to a variety of tampering or counterfeiting with little or no trace, compromising the authenticity and integrity of the information. In order to solve the copyright problem of video information, video watermarking technology is developed. The technology can well make up for the defects of encryption and digital signature technologies. The video watermarking technology is to embed copyright information of a video into a video sequence by utilizing spatial and temporal redundancy of carrier data and ensure the concealment and invisibility of operation.
With the development of video compression technology, video watermarking, which is a main technology for video copyright protection, has also gained wide attention. Currently, the mainstream video coding standards are the MPEG-x series and the h.26x series, and the video watermarking related technology is mainly developed around the MPEG-4 and h.264 video coding standards. In 2013, a new generation of Video compression standard High Efficiency Video Coding (HEVC) is proposed, and compared with the conventional Video compression standard, the Coding performance of HEVC is greatly improved, and good performance is achieved in the aspects of High definition and ultra-High definition Video compression. It is believed that the HEVC video coding standard will be widely applied in the near future, however, due to the change of the HEVC coding structure, the related technology of the previous video watermark cannot be applied to the new generation of HEVC video coding standard, and in order to ensure the healthy development of the future video field, the video watermark based on different video coding standards is a problem to be solved urgently at present. Although the current video watermarking algorithms are more, no video watermarking algorithm capable of resisting the recompression attack of the video algorithm exists at present, and the current embedding scheme based on Discrete Cosine Transform (DCT) and Singular Value Decomposition (SVD) can cause false positive false detection and blocking effect problems. Therefore, how to protect the copyright of the video through the video watermark and resist the recompression attack of different video compression technologies is the problem that the application aims to solve. The present application will be illustrated by the following detailed examples.
Fig. 1 is a flowchart of an embodiment of a watermark embedding method provided by the present invention. As shown in fig. 1, the method of this embodiment may include:
s101, obtaining a target image frame to be added with preset watermark information.
The watermark embedding method provided by the embodiment can be used for performing copyright protection on videos and can also be used for performing copyright protection on pictures.
When used for copyright protection of a video, the target image frame in the present embodiment may be at least one image frame in a video file. For example, all image frames in the video file may be selected as target image frames to be added with the preset watermark information, or a preset number of image frames in the video file may be designated as target image frames to be added with the preset watermark information, or the target image frames may be selected at a preset frequency, for example, one image frame may be selected every 5 frames in the video file as the target image frame to be added with the preset watermark information.
When the method is used for protecting the picture, the target image frame to be added with the preset watermark information is the picture needing copyright protection.
The preset watermark information in this embodiment is picture information, and may be, for example, an author signature, a company identifier, and the like.
Optionally, in order to improve stability and reliability, the preset watermark information in this embodiment may be represented by a binary image.
And S102, dividing the target image frame into a plurality of image blocks.
Optionally, in this embodiment, the target image frame may be divided into a plurality of image blocks according to an information amount included in the preset watermark information. For example, the number of image blocks into which the target image frame is divided is equal to or greater than the number of bits of the preset watermark information. For example, for an 8 × 8 binary watermark picture, at least 64 image blocks need to be divided.
The plurality of image blocks in the embodiment may not overlap each other, and may also overlap each other; the plurality of image blocks may be the same size or different sizes. Therefore, in the embodiment, the target image frame can be divided into any plurality of image blocks for embedding the preset watermark information, so that the watermark embedding capacity is increased.
And S103, acquiring a direct current coefficient corresponding to each image block.
In this embodiment, for example, the dc coefficients of the image block may be obtained through DCT Transform, or may be obtained through All-Phase Inverse Discrete Sine Biorthogonal Transform (APIDSBT). In this embodiment, a specific implementation manner for obtaining the dc coefficient of the image block is not limited.
And S104, adding preset watermark information to the target image frame according to the preset watermark information and the direct current coefficient corresponding to each image block.
In this embodiment, the preset watermark information is embedded into the target image frame through the dc coefficients corresponding to the image blocks. The direct current coefficient contains the main part of the image block energy, has good anti-interference performance, and the preset watermark information is embedded through the direct current coefficient, so that the influence of interference reduction on the image quality after the preset watermark information is embedded can be resisted; the direct current coefficient is slightly influenced by the recompression, so that the preset watermark information can be embedded through the direct current coefficient, and the recompression attack can be effectively resisted.
According to the watermark embedding method provided by the embodiment, the target image frame to be added with the preset watermark information is obtained, the target image frame is divided into the plurality of image blocks, the direct current coefficient corresponding to each image block is obtained, the preset watermark information is added to the target image frame according to the preset watermark information and the direct current coefficient corresponding to each image block, the recompression attack is effectively resisted on the premise of ensuring the image quality, and the effective protection of the copyright of a digital product is realized.
On the basis of the foregoing embodiment, in order to further improve security and reliability, in the watermark embedding method provided in this embodiment, adding the preset watermark information to the target image frame according to the preset watermark information and the dc coefficient corresponding to each image block may include: scrambling and encrypting preset watermark information; and adding the preset watermark information after the scrambling and encryption processing to the target image frame according to the preset watermark information after the scrambling and encryption processing and the direct current coefficient corresponding to each image block.
In this embodiment, for example, any one of the following scrambling encryption algorithms may be adopted to perform scrambling encryption processing on the preset watermark information: affine transform encryption algorithm, magic square transform encryption algorithm, Hilbert (Hilbert) curve transform encryption algorithm, Fibonacci (Fibonacci) transform encryption algorithm, and the like.
Optionally, one possible implementation manner of scrambling and encrypting the preset watermark information may be: performing an Arnold (Arnold) transformation on the preset watermark information.
In this embodiment, by performing Arnold transformation on preset watermark information, watermark information with strong correlation between pixels can be scrambled into an uncorrelated two-dimensional matrix. The Arnold transform can be expressed as:
Figure BDA0001908236930000091
where a and b are positive integers, x, y ∈ {0,1, …, N-1}, the image size of the scrambling process is N × N, (x, y) is the position of the pixel before the scrambling process, and (x ', y') is the position of the pixel after the scrambling process, for example, when a is 1 and b is 1, the Arnold transform may be expressed as:
Figure BDA0001908236930000092
fig. 2A-2C are schematic diagrams of performing the arnold transform according to an embodiment of the invention. Fig. 2A is a picture of watermark information to be added, fig. 2B is a picture of the watermark information picture after the arnold transform process, and fig. 2C is a watermark information picture restored by periodic re-scrambling according to the periodicity of the arnold transform.
In the watermark embedding method provided by this embodiment, on the basis of the above embodiment, the preset watermark information is scrambled and encrypted, and the scrambled and encrypted preset watermark information is embedded into the target image frame, so that the security of the watermark information is ensured, and the watermark information cannot be obtained even if the watermark information is illegally extracted, thereby further improving the security and reliability. In addition, in the embodiment, the preset watermark information is scrambled and encrypted by using the arnold transformation, and the original watermark information is easily recovered during extraction due to the good periodicity of the arnold transformation.
Optionally, the obtaining of the target image frame to which the preset watermark information is to be added may include: acquiring a Y component of a target image frame to be added with preset watermark information; dividing the target image frame into a plurality of image blocks may comprise: the Y component of the target image frame is divided into a plurality of image blocks.
Each of the target image frames in the present embodiment may contain Y, U, V components. Wherein the Y component is used to represent brightness (Luminance), the U component is used to represent Chroma (Chroma), and the V component is used to represent concentration (Chroma). Since the human visual system is more sensitive to brightness than to chroma and concentration, the Y component generally contains more information than the U, V component. In the recompression process, the influence on the Y component is small, so in order to resist the recompression attack, in this embodiment, by acquiring the Y component of the target image frame and embedding the preset watermark information into the Y component in the target image frame, not only the subjective quality of the image frame after embedding the watermark information can be ensured, but also the recompression attack can be effectively resisted, and the effective protection of the digital product copyright can be realized.
In some embodiments, one implementation of dividing the target image frame into a plurality of image blocks may be dividing the target image frame into a plurality of image blocks of size N × N according to the size of the target image frame and the size of the preset watermark information;
Figure BDA0001908236930000101
according to formula 1, the size of N is determined, wherein the size of the target image frame is W × H, and the size of the preset watermark information is U × V.
In this embodiment, the size of the target image frame is W × H, the size of the Y component of the target image frame is also W × H, and the size of the preset watermark information is U × V.
According to the watermark embedding method provided by the embodiment, the target image frame is divided into the plurality of image blocks with the size of N × N according to the size of the target image frame and the size of the preset watermark information, so that the quality of a reconstructed image is ensured, the preset watermark information can be embedded at one time, and the watermark embedding efficiency is improved.
On the basis of any of the foregoing embodiments, in order to reduce blocking artifacts caused by watermark embedding, in the watermark embedding method provided by this embodiment, acquiring the dc coefficient corresponding to each image block may include:
according to a formula 2, performing full-phase inverse discrete sine biorthogonal conversion APIDSBT on each image block to obtain a direct current coefficient of each image block;
Y=CXCTequation 2
Wherein C represents the APIDSBT transform matrix, CTRepresenting a transpose of an APIDSBT transform matrix, X representing an image block of size N × N, Y representing an APIDSBT transform coefficient matrix for image block X, Y (0,0) representing a dc coefficient for image block X;
Figure BDA0001908236930000111
the order-N APIDSBT transformation matrix C is determined according to equation 3, where C (i, j) represents the i row and j column elements in the matrix C, and l represents the summation variable.
APIDSBT transform matrix C to an orthogonal matrix, i.e. CT=C-1. Thus, the image can be reconstructed by:
X'=C-1Y'(CT)-1=CTY'C
and Y ' represents a corresponding transformation coefficient matrix after the preset watermark information is embedded into Y, and X ' represents an image block reconstructed according to Y '.
The watermark embedding method provided in this embodiment, on the basis of any of the above embodiments, obtains the dc coefficients of each image block by using the APIDSBT transform matrix, avoids the blocking effect caused by watermark embedding, and solves the blocking effect problem caused by existing video watermark embedding.
In some embodiments, one implementation manner of adding the preset watermark information to the target image frame according to the preset watermark information and the dc coefficient corresponding to each image block may be: performing Discrete Wavelet Transform (DWT) on a first matrix to generate a second matrix, wherein the first matrix is formed by direct current coefficients corresponding to a plurality of image blocks; performing Singular Value Decomposition (SVD) on the second matrix to obtain a diagonal matrix corresponding to the second matrix; determining a third matrix according to the diagonal matrix corresponding to the second matrix and the matrix corresponding to the watermark information; performing singular value decomposition on the third matrix to obtain a diagonal matrix corresponding to the third matrix; and acquiring the image frame added with the preset watermark information according to the diagonal matrix corresponding to the third matrix.
The second matrix generated by DWT transforming the first matrix in this embodiment may include low frequency children (LL), horizontal children (LH), vertical children (HL), and high frequency children (HH).
In this embodiment, one implementation manner of performing singular value decomposition on the second matrix to obtain a diagonal matrix corresponding to the second matrix may be: and performing SVD on LL, LH, HL and HH included in the second matrix respectively to obtain four diagonal matrices corresponding to the LL, LH, HL and HH.
Optionally, determining the third matrix according to the diagonal matrix corresponding to the second matrix and the matrix corresponding to the watermark information may include:
from equation 4, a third matrix is determined:
S′1=S1+ α W equation 4
Wherein S is1Identifying the diagonal matrix corresponding to the second matrix, W representing the matrix corresponding to the watermark information, α being a scaling factor, α∈ [16,32 ]],S′1Representing a third matrix.
In this embodiment, an implementation manner of determining the third matrix according to the diagonal matrix corresponding to the second matrix and the matrix corresponding to the watermark information may be:
dividing a matrix corresponding to the watermark information into four local watermark information matrixes with the same size as LL, LH, HL and HH, and embedding the four local watermark information matrixes into four diagonal matrixes corresponding to the LL, the LH, the HL and the HH.
On the basis of the above embodiment, the watermark embedding method provided by this embodiment reduces the influence of watermark embedding on the quality of a video owner by performing discrete wavelet transform and two singular value decompositions on a matrix formed by dc coefficients, and solves the problem of false positive false detection caused by existing video watermark embedding.
Based on the above embodiment, the following takes video watermark embedding as an example to further explain the watermark embedding method provided by the present invention, fig. 3 is a schematic diagram of an embodiment of the watermark embedding method provided by the present invention, as shown in fig. 3, a video file to be added with watermark information in the present embodiment includes a plurality of image frames, each image frame has a size of W × H, the upper left corner in fig. 3 is a target image frame to be added with watermark information acquired from the video file in the present embodiment, taking adding watermark information to a Y component of the target image frame as an example to explain, the upper left corner in fig. 3 represents a Y component of the target image frame having a size of W × H, and how to add watermark information will be explained in detail in the clockwise direction shown in fig. 3 from the upper left corner in fig. 3.
In this embodiment, for example, the binary watermark information shown in fig. 2A is added, assuming that the size of the watermark information in fig. 2A is U × V, the change is first made in an arnold manner, and the watermark information subjected to the arnold change is shown in fig. 2B and is represented by a matrix W with a size of U × V in this embodiment.
In order to embed watermark information of size U × V into a target image frame at once, the target image frame needs to be divided into U × V image blocks, as shown in fig. 3, the target image frame is divided into U × V image blocks of size N × N in the present embodiment.
For each image block in the U × V image blocks, the APIDSBT transform matrix provided by formula 3 is used to perform APIDSBT transform, and an APIDSBT transform coefficient matrix with a size of N × N corresponding to each image block is obtained, and the first element of all the APIDSBT transform coefficient matrices, i.e. the DC coefficient, will form a first matrix D with a size of U × V.
Carrying out DWT transformation on the first matrix D to obtain a second matrix D with the size of U × V2The second matrix comprises four descendants of LL, LH, HL and HH, each of which has a size of
Figure BDA0001908236930000131
Then SVD is carried out on each filial generation, watermark information is embedded, and then SVD is carried out for the second time.
D2=[LL,LH;HL,HH]=DWT(D);
Taking the low-frequency child LL as an example, the first SVD decomposition can be obtained:
SVD(LL)=[U1,S1,V1];
wherein LL is
Figure BDA0001908236930000132
Size, low frequency coefficient matrix, U, obtained by discrete wavelet transform of matrix D consisting of DC coefficients1Is that
Figure BDA0001908236930000133
Order matrix, V1Is that
Figure BDA0001908236930000134
An order matrix. S1Is composed of
Figure BDA0001908236930000135
The diagonal matrix of size can be expressed as (assuming U ≧ V):
Figure BDA0001908236930000136
dividing a matrix W with the size of U × V corresponding to watermark information into 4 matrixes with the size of U × V
Figure BDA0001908236930000137
The matrix of (a): w1、W2、W3And W4。W1、W2、W3And W4Corresponding to the four children LL, LH, HL and HH, respectively.
At this time, the binary watermark image data matrix W1Can be prepared by S'1=S1+αW1Watermark data W1Is embedded in S1To obtain S'1Where α is the scaling factor, α∈ [16,32 ]]:
Figure BDA0001908236930000138
To the obtained S'1Performing second SVD to obtain:
SVD(S′1)=[U2,S2,V2];
then, the embedded watermark information W is obtained according to the following formula1Subsequent matrix (LL) of low frequency offspring coefficientsw
(LL)w=U1S2V1 T
Similarly, by the same method, the embedded watermark information W can be obtained separately2The latter matrix (LH) of horizontal offspring coefficientswEmbedding watermark information W3The latter matrix (HL) of vertical offspring coefficientswAnd embedding watermark information W4The latter matrix (HH) consisting of low-frequency offspring coefficientsw
Composed matrix (LL)w、(LH)w、(HL)wAnd (HH)wA second matrix (D) in which watermark information W is embedded may be formed2)w
(D2)w=[(LL)w,(LH)w;(HL)w,(HH)w]
For the second matrix (D) embedded with watermark information W2)wPerforming Inverse Discrete Wavelet Transform (IDWT) to obtain a matrix of dc coefficients with size U × V embedded with watermark information W, i.e. a first matrix (D) embedded with watermark information Ww
(D)w=IDWT((D2)w);
Will (D)wThe U × V dc coefficients embedded with watermark information are respectively placed into the APIDSBT Transform coefficient matrixes corresponding to the U × V image blocks, then each APIDSBT Transform coefficient matrix is subjected to full-Phase Inverse Discrete Sine Biorthogonal Inverse Transform (iapdbt), the image block embedded with watermark information is obtained, and finally the image frame added with watermark information is obtained.
In the watermark embedding method provided by the embodiment, the DC coefficient of each image block is obtained through APIDSBT conversion, and the watermark information is embedded by adopting DWT conversion and double SVD conversion, so that the capability of resisting compression attack of a video compression algorithm is improved on the premise of ensuring the video quality, and even the influence of adjusting the compression parameter to more than 40 on the reconstructed watermark quality is small; meanwhile, the embodiment of the invention solves the problems of blocking effect and false positive false alarm through APIDSBT conversion and double SVD, and improves the capability of resisting noise interference. In summary, the video watermark embedding method provided by the embodiment can effectively resist video recompression attack and can effectively protect the copyright of a digital product.
Fig. 4 is a flowchart of an embodiment of a watermark extraction method provided in the present invention. As shown in fig. 4, the watermark extraction method provided in this embodiment may include:
s401, acquiring the image frame added with the watermark information.
In this embodiment, for example, the image frame to which the watermark information is added may be obtained according to the mark information when the watermark information is added, or the image frame to which the watermark information is added may be obtained according to the frame number of the video frame to which the watermark information is added.
S402, dividing the image frame added with the watermark information into a plurality of image blocks.
In this embodiment, the image frame to which the watermark information is added may be divided into a plurality of image blocks of the same size and the same number in the same manner as the watermark information is added.
And S403, acquiring a direct current coefficient corresponding to each image block.
In this embodiment, the same manner as that of adding the watermark information is adopted to obtain the dc coefficient corresponding to each image block. For example, if the watermark adding information adopts DCT transform, then the dc coefficient corresponding to each image block is also obtained by the DCT transform at this time; if APIDSBT conversion is adopted for adding the watermark information, the APIDSBT conversion is also adopted at the moment to obtain the direct current coefficient corresponding to each image block.
And S404, determining watermark information according to the direct current coefficient corresponding to each image block.
In this embodiment, the corresponding watermark information may be determined from the dc coefficient in which the watermark information is embedded.
The watermark extraction method provided in this embodiment obtains the image frame added with the watermark information, divides the image frame added with the watermark information into a plurality of image blocks, obtains the dc coefficient corresponding to each image block, and determines the watermark information according to the dc coefficient corresponding to each image block, thereby realizing the recovery of the watermark information from the image frame. In the embodiment, the watermark information is determined by depending on the direct current coefficient, so that a high-quality reconstructed watermark picture can be obtained, and the heavy compression attack can be effectively resisted.
In some embodiments, if the embedded watermark information is watermark information after scrambling and encryption, determining the watermark information according to the dc coefficient corresponding to each image block may include:
determining watermark information after scrambling and encryption according to the direct current coefficient corresponding to each image block; and performing anti-scrambling decryption processing on the watermark information subjected to the scrambling encryption processing to determine the watermark information.
Optionally, an implementation manner of performing descrambling and decryption processing on the watermark information after the scrambling and encryption processing may be: according to the periodicity of the Arnold transformation, the watermark information after the scrambling encryption processing is subjected to the descrambling decryption processing.
Because the Arnold transformation has periodicity, the watermark information scrambled by the Arnold transformation can be restored by periodically re-scrambling.
Optionally, the watermark information after the scrambling encryption processing may also be subjected to the descrambling decryption processing according to a predetermined inverse anordue transform matrix, so as to recover the original watermark information.
In some embodiments, one implementation manner of obtaining the dc coefficient corresponding to each image block may be: and performing full-phase inverse discrete sine biorthogonal conversion APIDSBT on each image block to obtain a direct current coefficient corresponding to each image block.
In this embodiment, with reference to the formula 2 and the formula 3 described in the above embodiments, the APIDSBT transformation may be performed on each image block to obtain the dc coefficient corresponding to each image block. For a specific implementation, reference is made to the above embodiments, which are not described herein again.
In some embodiments, one implementation of determining the watermark information according to the dc coefficient corresponding to each image block may be:
performing discrete wavelet transform on the fourth matrix to generate a fifth matrix, wherein the fourth matrix is formed by direct current coefficients corresponding to a plurality of image blocks; performing singular value decomposition on the fifth matrix to obtain a diagonal matrix corresponding to the fifth matrix; determining a coefficient matrix containing watermark information according to a diagonal matrix corresponding to the fifth matrix and a watermark embedding key; and determining watermark information according to the coefficient matrix.
Optionally, determining watermark information according to the coefficient matrix may include:
determining watermark information according to formula 5;
Figure BDA0001908236930000161
wherein W represents a matrix corresponding to the watermark information, W (i, j) is an element of the ith row and the jth column in the matrix corresponding to the watermark information, α represents a scale factor, α∈ [16,32 ]]U denotes the number of rows of the matrix W, V denotes the number of columns of the matrix W, sijRepresenting the element in the ith row and the jth column of the coefficient matrix.
On the basis of the above embodiment, the following takes extracting watermark information from a video in which watermark information is embedded as an example, and further describes the watermark extraction method provided by the present invention. Fig. 5 is a schematic diagram of an embodiment of a watermark extraction method provided in the present invention. This embodiment will be described by taking watermark extraction as an example of the image frame to which watermark information is added acquired in the embodiment shown in fig. 3. As shown in fig. 5, the leftmost square represents a video file, each cell represents one frame image in the video file, and the black square represents the image frame to which the watermark information is added.
Firstly, in the same way as when the watermark information is added, the image frame is divided into U × V image blocks, APIDSBT conversion is carried out on each image block to obtain corresponding DC coefficients, and the U × V DC coefficients form a DC coefficient matrix D 'with the size of U × V'w(distinguished from the first matrix (D) in which watermark information is embedded)w). To DC coefficient matrix D'wCarrying out DWT conversion:
[LL'w,LH'w;HL'w,HH'w]=DWT(D'w);
for each child, an SVD decomposition is performed. In this embodiment, low frequency generation LL'wThe description is given for the sake of example:
SVD(LL'w)=[U'1,S'2,V'1];
obtaining a diagonal matrix S'2Then, decryption processing is performed according to the following formula to obtain a matrix S 'embedded with watermark information'1
S′1=U2S'2V2 T
Wherein, the matrix U2And matrix V2In this embodiment, the key matrix generated in the embodiment shown in fig. 3 may be used as the key matrix generated when the watermark information is added.
Similarly, by using the same method, the matrix S 'embedded with watermark information corresponding to the other three descendants can be obtained'2、S′3And S'4Coefficient matrix S ═ S'1,S'2;S'3,S'4]Then, threshold comparison is performed according to the formula 5 described in the above embodiment to extract watermark information, it should be noted that the value of the scaling factor α in the formula 5 is the same as the value when the watermark information is added.
It is understood that if the scrambling encryption processing is performed during watermark embedding, the watermark information shown in fig. 2B will be obtained through threshold comparison, and the descrambling decryption processing, such as the inverse arnold transform, needs to be performed on the watermark information to obtain the watermark information shown in fig. 2C.
The watermark extraction method provided by this embodiment performs block APIDSBT transformation on the image frame to which the watermark information is added to the video file, performs DWT transformation on the matrix formed by the DC coefficients of each image block, performs SVD decomposition and decryption on each child of the transformed matrix, and then obtains the embedded watermark information by threshold comparison, thereby realizing extraction of the video watermark. The watermark extraction method provided by the embodiment can obtain high-quality reconstructed watermark information even if the compression parameters are adjusted to be more than 40, can effectively resist the recompression attack of a video compression algorithm, and effectively protects video copyright information.
Fig. 6 shows a watermark embedding apparatus, which is only illustrated in fig. 6, and the embodiment of the present invention is not limited thereto. Fig. 6 is a schematic structural diagram of an embodiment of a watermark embedding apparatus provided in the present invention. As shown in fig. 6, the watermark embedding apparatus 60 provided in the present embodiment may include: a first obtaining module 601, a dividing module 602, a second obtaining module 603 and a processing module 604.
The first obtaining module 601 is configured to obtain a target image frame to which preset watermark information is to be added.
A dividing module 602, configured to divide a target image frame into a plurality of image blocks.
A second obtaining module 603, configured to obtain a dc coefficient corresponding to each image block.
The processing module 604 is configured to add preset watermark information to the target image frame according to the preset watermark information and the dc coefficient corresponding to each image block.
The apparatus of this embodiment may be used to implement the technical solution of the method embodiment shown in fig. 1, and the implementation principle and the technical effect are similar, which are not described herein again.
Optionally, the processing module 604 is configured to add the preset watermark information to the target image frame according to the preset watermark information and the dc coefficient corresponding to each image block, and specifically includes: scrambling and encrypting preset watermark information; and adding the preset watermark information after the scrambling and encryption processing to the target image frame according to the preset watermark information after the scrambling and encryption processing and the direct current coefficient corresponding to each image block.
Optionally, the processing module 604 is configured to perform scrambling and encryption processing on the preset watermark information, and specifically may include: and performing an Arnold transformation on the preset watermark information.
Optionally, the first obtaining module 601 is configured to obtain a target image frame to which preset watermark information is to be added, and specifically may include: acquiring a Y component of a target image frame to be added with preset watermark information; the dividing module 602 is configured to divide the target image frame into a plurality of image blocks, and specifically may include: the Y component of the target image frame is divided into a plurality of image blocks.
Optionally, the dividing module 602 is configured to divide the target image frame into a plurality of image blocks, and specifically may include dividing the target image frame into a plurality of image blocks of N × N size according to the size of the target image frame and the size of the preset watermark information;
Figure BDA0001908236930000181
according to formula 1, the size of N is determined, wherein the size of the target image frame is W × H, and the size of the preset watermark information is U × V.
Optionally, the step of obtaining the dc coefficient corresponding to each image block by the second obtaining module 603 may specifically include: according to a formula 2, performing full-phase inverse discrete sine biorthogonal conversion APIDSBT on each image block to obtain a direct current coefficient of each image block;
Y=CXCTequation 2
Wherein C represents the APIDSBT transform matrix, CTRepresenting a transpose of an APIDSBT transform matrix, X representing an image block of size N × N, Y representing an APIDSBT transform coefficient matrix for image block X, Y (0,0) representing a dc coefficient for image block X;
Figure BDA0001908236930000182
the order-N APIDSBT transformation matrix C is determined according to equation 3, where C (i, j) represents the i row and j column elements in the matrix C, and l represents the summation variable.
Optionally, the processing module 604 is configured to add the preset watermark information to the target image frame according to the preset watermark information and the dc coefficient corresponding to each image block, and specifically includes:
performing discrete wavelet transform on the first matrix to generate a second matrix, wherein the first matrix is formed by direct current coefficients corresponding to a plurality of image blocks;
performing singular value decomposition on the second matrix to obtain a diagonal matrix corresponding to the second matrix;
determining a third matrix according to the diagonal matrix corresponding to the second matrix and the matrix corresponding to the watermark information;
performing singular value decomposition on the third matrix to obtain a diagonal matrix corresponding to the third matrix;
and acquiring the image frame added with the preset watermark information according to the diagonal matrix corresponding to the third matrix.
Optionally, the processing module 604 is configured to determine, according to the diagonal matrix corresponding to the second matrix and the matrix corresponding to the watermark information, the third matrix specifically includes:
from equation 4, a third matrix is determined:
S′1=S1+ α W equation 4
Wherein S is1Identifying the diagonal matrix corresponding to the second matrix, W representing the matrix corresponding to the watermark information, α being a scaling factor, α∈ [16,32 ]],S′1Representing a third matrix.
Fig. 7 shows a watermark extracting apparatus, which is only illustrated in fig. 7, and the embodiment of the present invention is not limited thereto. Fig. 7 is a schematic structural diagram of an embodiment of a watermark extraction apparatus provided in the present invention. As shown in fig. 7, the watermark extraction apparatus 70 provided in this embodiment may include: a first obtaining module 701, a dividing module 702, a second obtaining module 703 and a determining module 704.
A first obtaining module 701, configured to obtain the image frame to which the watermark information is added.
A dividing module 702, configured to divide the image frame to which the watermark information is added into a plurality of image blocks.
The second obtaining module 703 is configured to obtain a dc coefficient corresponding to each image block.
A determining module 704, configured to determine watermark information according to the dc coefficient corresponding to each image block.
The apparatus of this embodiment may be used to implement the technical solution of the method embodiment shown in fig. 4, and the implementation principle and the technical effect are similar, which are not described herein again.
Optionally, the determining module 704 is configured to determine watermark information according to a dc coefficient corresponding to each image block, and specifically may include: determining watermark information after scrambling and encryption according to the direct current coefficient corresponding to each image block; and performing anti-scrambling decryption processing on the watermark information subjected to the scrambling encryption processing to determine the watermark information.
Optionally, the determining module 704 is configured to perform descrambling and decryption processing on the watermark information after the scrambling and encryption processing, and specifically may include: according to the periodicity of the Arnold transformation, the watermark information after the scrambling encryption processing is subjected to the descrambling decryption processing.
Optionally, the step of the second obtaining module 703 is configured to obtain the dc coefficient corresponding to each image block, which specifically includes: and performing full-phase inverse discrete sine biorthogonal conversion APIDSBT on each image block to obtain a direct current coefficient corresponding to each image block.
Optionally, the determining module 704 is configured to determine, according to the dc coefficient corresponding to each image block, watermark information specifically including: performing discrete wavelet transform on the fourth matrix to generate a fifth matrix, wherein the fourth matrix is formed by direct current coefficients corresponding to a plurality of image blocks; performing singular value decomposition on the fifth matrix to obtain a diagonal matrix corresponding to the fifth matrix; determining a coefficient matrix containing watermark information according to a diagonal matrix corresponding to the fifth matrix and a watermark embedding key; and determining watermark information according to the coefficient matrix.
Optionally, the determining module 704 is configured to determine, according to the coefficient matrix, watermark information specifically including:
determining watermark information according to formula 5;
Figure BDA0001908236930000201
wherein W represents a matrix corresponding to the watermark information, W (i, j) is an element of the ith row and the jth column in the matrix corresponding to the watermark information, α represents a scale factor, α∈ [16,32 ]]U denotes the number of rows of the matrix W, V denotes the number of columns of the matrix W, sijRepresenting the element in the ith row and the jth column of the coefficient matrix.
Fig. 8 is a schematic view showing an electronic device according to an embodiment of the present invention, which is only illustrated in fig. 8, and the embodiment of the present invention is not limited thereto. Fig. 8 is a schematic structural diagram of an embodiment of an electronic device provided in the present invention. As shown in fig. 8, the electronic device 80 provided in this embodiment may include: a memory 801, a processor 802, and a bus 803. Bus 803 is used to enable connections between various components.
The memory 801 stores a computer program, and when executed by the processor 802, the computer program may implement the technical solution of any of the method embodiments described above, for example, may implement the watermark embedding method provided by any of the method embodiments described above, and/or the watermark extraction method provided by any of the method embodiments described above.
Wherein the memory 801 and the processor 802 are electrically connected directly or indirectly to enable data transmission or interaction. For example, the elements may be electrically connected to each other via one or more communication buses or signal lines, such as bus 803. The memory 801 stores a computer program for implementing a watermark embedding method and/or a watermark extracting method, and includes at least one software functional module that can be stored in the memory 801 in the form of software or firmware, and the processor 802 executes various functional applications and data processing by executing the software program and the module stored in the memory 801.
The Memory 801 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 801 is used for storing programs, and the processor 802 executes the programs after receiving execution instructions. Further, the software programs and modules within the above-described memory 801 may also include an operating system, which may include various software components and/or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components.
The processor 802 may be an integrated circuit chip having signal processing capabilities. The Processor 802 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and so on. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. It will be appreciated that the configuration of fig. 8 is merely illustrative and may include more or fewer components than shown in fig. 8 or have a different configuration than shown in fig. 8. The components shown in fig. 8 may be implemented in hardware and/or software.
It should be noted that the electronic device provided in this embodiment includes, but is not limited to, at least one of the following: user side equipment and network side equipment. User-side devices include, but are not limited to, computers, smart phones, tablets, digital broadcast terminals, messaging devices, game consoles, personal digital assistants, and the like. The network-side device includes, but is not limited to, a single network server, a server group consisting of a plurality of network servers, or a cloud consisting of a large number of computers or network servers based on cloud computing, wherein the cloud computing is one of distributed computing and is a super virtual computer consisting of a group of loosely coupled computers.
The electronic device for embedding the watermark and the electronic device for extracting the watermark may be the same electronic device or different electronic devices. The electronic device provided in this embodiment may be configured to execute the watermark embedding method provided in any of the above method embodiments, and/or the watermark extraction method provided in any of the above method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, may implement the watermark embedding method provided in any of the above-mentioned method embodiments, and/or the watermark extraction method provided in any of the above-mentioned method embodiments. The computer-readable storage medium in this embodiment may be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, etc. that is integrated with one or more available media, and the available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., SSDs), etc.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (18)

1. A watermark embedding method, comprising:
acquiring a target image frame to be added with preset watermark information;
dividing the target image frame into a plurality of image blocks;
acquiring a direct current coefficient corresponding to each image block;
and adding the preset watermark information to the target image frame according to the preset watermark information and the direct current coefficient corresponding to each image block.
2. The method according to claim 1, wherein the adding the preset watermark information to the target image frame according to the preset watermark information and the dc coefficient corresponding to each of the image blocks comprises:
scrambling and encrypting the preset watermark information;
and adding the preset watermark information after the scrambling and encryption processing to the target image frame according to the preset watermark information after the scrambling and encryption processing and the direct current coefficient corresponding to each image block.
3. The method according to claim 2, wherein the scrambling and encrypting the preset watermark information comprises:
and carrying out the Arnold transformation on the preset watermark information.
4. The method according to claim 1, wherein the obtaining of the target image frame to which the preset watermark information is to be added comprises:
acquiring a Y component of a target image frame to be added with preset watermark information;
the dividing the target image frame into a plurality of image blocks includes:
dividing a Y component of the target image frame into a plurality of image blocks.
5. The method of claim 1, wherein the dividing the target image frame into a plurality of image blocks comprises:
dividing the target image frame into a plurality of image blocks with the size of N × N according to the size of the target image frame and the size of the preset watermark information;
Figure FDA0001908236920000011
according to formula 1, determining the size of N, wherein the size of the target image frame is W × H, and the size of the preset watermark information is U × V.
6. The method according to claim 1, wherein the obtaining the dc coefficient corresponding to each of the image blocks comprises:
according to a formula 2, performing full-phase inverse discrete sine biorthogonal conversion APIDSBT on each image block to obtain a direct current coefficient of each image block;
Y=CXCTequation 2
Wherein C represents the APIDSBT transform matrix, CTRepresenting a transpose of an APIDSBT transform matrix, X representing an image block of size N × N, Y representing an APIDSBT transform coefficient matrix for image block X, Y (0,0) representing a dc coefficient for image block X;
Figure FDA0001908236920000021
the order-N APIDSBT transformation matrix C is determined according to equation 3, where C (i, j) represents the i row and j column elements in the matrix C, and l represents the summation variable.
7. The method according to claim 1, wherein the adding the preset watermark information to the target image frame according to the preset watermark information and the dc coefficient corresponding to each of the image blocks comprises:
performing discrete wavelet transform on a first matrix to generate a second matrix, wherein the first matrix is composed of direct current coefficients corresponding to a plurality of image blocks;
performing singular value decomposition on the second matrix to obtain a diagonal matrix corresponding to the second matrix;
determining a third matrix according to the diagonal matrix corresponding to the second matrix and the matrix corresponding to the watermark information;
performing singular value decomposition on the third matrix to obtain a diagonal matrix corresponding to the third matrix;
and acquiring the image frame added with the preset watermark information according to the diagonal matrix corresponding to the third matrix.
8. The method according to claim 7, wherein determining a third matrix according to the diagonal matrix corresponding to the second matrix and the matrix corresponding to the watermark information comprises:
determining the third matrix according to equation 4:
S′1=S1+ α W equation 4
Wherein S is1Identifying a diagonal matrix corresponding to the second matrix, W representing a matrix corresponding to the watermark information, α being a scale factor, α∈ [16,32 ]],S′1Representing the third matrix.
9. A watermark extraction method, comprising:
acquiring the image frame added with the watermark information;
dividing the image frame added with the watermark information into a plurality of image blocks;
acquiring a direct current coefficient corresponding to each image block;
and determining the watermark information according to the direct current coefficient corresponding to each image block.
10. The method according to claim 9, wherein the determining the watermark information according to the dc coefficient corresponding to each of the image blocks comprises:
determining watermark information after scrambling and encryption according to the direct current coefficient corresponding to each image block;
and performing anti-scrambling decryption processing on the watermark information after scrambling encryption processing to determine the watermark information.
11. The method according to claim 10, wherein the descrambling and decrypting the scrambled and encrypted watermark information includes:
and according to the periodicity of the Arnold transformation, performing anti-scrambling decryption processing on the watermark information after scrambling encryption processing.
12. The method according to claim 9, wherein the obtaining the dc coefficient corresponding to each of the image blocks comprises:
and performing full-phase inverse discrete sine biorthogonal transformation APIDSBT on each image block to obtain a direct current coefficient corresponding to each image block.
13. The method according to claim 9, wherein the determining the watermark information according to the dc coefficient corresponding to each of the image blocks comprises:
performing discrete wavelet transform on a fourth matrix to generate a fifth matrix, wherein the fourth matrix is formed by a plurality of direct current coefficients corresponding to the image blocks;
performing singular value decomposition on the fifth matrix to obtain a diagonal matrix corresponding to the fifth matrix;
determining a coefficient matrix containing the watermark information according to a diagonal matrix corresponding to the fifth matrix and a watermark embedding key;
and determining the watermark information according to the coefficient matrix.
14. The method of claim 13, wherein the determining the watermark information according to the coefficient matrix comprises:
determining the watermark information according to formula 5;
Figure FDA0001908236920000041
wherein W represents a matrix corresponding to the watermark information, W (i, j) is an element of the ith row and the jth column in the matrix corresponding to the watermark information, α represents a scale factor, α∈ [16,32 ]]U denotes the number of rows of the matrix W, V denotes the number of columns of the matrix W, sijRepresenting the elements of the ith row and the jth column in the coefficient matrix.
15. A watermark embedding apparatus, comprising:
the first acquisition module is used for acquiring a target image frame to be added with preset watermark information;
the dividing module is used for dividing the target image frame into a plurality of image blocks;
the second acquisition module is used for acquiring the direct current coefficient corresponding to each image block;
and the processing module is used for adding the preset watermark information to the target image frame according to the preset watermark information and the direct current coefficient corresponding to each image block.
16. A watermark extraction apparatus, comprising:
the first acquisition module is used for acquiring the image frame added with the watermark information;
the dividing module is used for dividing the image frame added with the watermark information into a plurality of image blocks;
the second acquisition module is used for acquiring the direct current coefficient corresponding to each image block;
and the determining module is used for determining the watermark information according to the direct current coefficient corresponding to each image block.
17. An electronic device, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement a watermark embedding method as claimed in any one of claims 1 to 8 or a watermark extraction method as claimed in any one of claims 9 to 14.
18. A computer-readable storage medium, having stored thereon a computer program for execution by a processor to implement a watermark embedding method as claimed in any one of claims 1 to 8, or a watermark extraction method as claimed in any one of claims 9 to 14.
CN201811541393.1A 2018-12-17 2018-12-17 Watermark embedding and extracting method, device and equipment Pending CN111327963A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811541393.1A CN111327963A (en) 2018-12-17 2018-12-17 Watermark embedding and extracting method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811541393.1A CN111327963A (en) 2018-12-17 2018-12-17 Watermark embedding and extracting method, device and equipment

Publications (1)

Publication Number Publication Date
CN111327963A true CN111327963A (en) 2020-06-23

Family

ID=71170877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811541393.1A Pending CN111327963A (en) 2018-12-17 2018-12-17 Watermark embedding and extracting method, device and equipment

Country Status (1)

Country Link
CN (1) CN111327963A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112616093A (en) * 2020-12-14 2021-04-06 重庆紫光华山智安科技有限公司 Video watermark adding method, system, medium and electronic terminal
CN113810722A (en) * 2021-09-15 2021-12-17 深圳先进技术研究院 Video watermarking method based on key frame selection and safe spread spectrum technology
CN115150627A (en) * 2022-06-30 2022-10-04 四川大学 DST-based video compression robustness blind watermarking resisting method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335924A (en) * 2015-11-18 2016-02-17 曲阜师范大学 Wavelet domain color image watermark encryption algorithm based on differential evolution
CN105847800A (en) * 2016-05-18 2016-08-10 山东大学(威海) Image compression method based on all phase discrete sine double orthogonal transformation and system
CN106454367A (en) * 2016-10-09 2017-02-22 中国农业大学 Method and system for identifying multimedia file
CN107222750A (en) * 2017-06-21 2017-09-29 北京工业大学 A kind of frequency domain parallax towards three-dimensional video-frequency is concerned with water mark method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335924A (en) * 2015-11-18 2016-02-17 曲阜师范大学 Wavelet domain color image watermark encryption algorithm based on differential evolution
CN105847800A (en) * 2016-05-18 2016-08-10 山东大学(威海) Image compression method based on all phase discrete sine double orthogonal transformation and system
CN106454367A (en) * 2016-10-09 2017-02-22 中国农业大学 Method and system for identifying multimedia file
CN107222750A (en) * 2017-06-21 2017-09-29 北京工业大学 A kind of frequency domain parallax towards three-dimensional video-frequency is concerned with water mark method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
单荣杨: "基于APBT的类JPEG图像压缩以及HEVC视频编码与水印算法研究", 《中国优秀硕士学位论文全文数据库》 *
崔荣全: "《基于人类视觉特性模型的3D视频数字水印技术研究》", 《中国优秀硕士学位论文全文数据库》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112616093A (en) * 2020-12-14 2021-04-06 重庆紫光华山智安科技有限公司 Video watermark adding method, system, medium and electronic terminal
CN113810722A (en) * 2021-09-15 2021-12-17 深圳先进技术研究院 Video watermarking method based on key frame selection and safe spread spectrum technology
CN115150627A (en) * 2022-06-30 2022-10-04 四川大学 DST-based video compression robustness blind watermarking resisting method
CN115150627B (en) * 2022-06-30 2024-04-19 四川大学 DST-based video compression robustness-resistant blind watermarking method

Similar Documents

Publication Publication Date Title
Wang et al. Ternary radial harmonic Fourier moments based robust stereo image zero-watermarking algorithm
Ansari et al. Multipurpose image watermarking in the domain of DWT based on SVD and ABC
Mahto et al. A survey of color image watermarking: State-of-the-art and research directions
Tao et al. Robust image watermarking theories and techniques: A review
Haghighi et al. TRLH: Fragile and blind dual watermarking for image tamper detection and self-recovery based on lifting wavelet transform and halftoning technique
Preda et al. A robust digital watermarking scheme for video copyright protection in the wavelet domain
Paul Review of robust video watermarking techniques
CN110084733A (en) The embedding grammar and system of text image watermark, extracting method and system
Singh et al. A review of different techniques on digital image watermarking scheme
Rajab et al. Video watermarking algorithms using the SVD transform
CN111327963A (en) Watermark embedding and extracting method, device and equipment
Ernawan Tchebichef image watermarking along the edge using YCoCg-R color space for copyright protection
CN109191361A (en) Image Watermarking, extracting method and correlation technique
Bhatnagar et al. A new robust reference logo watermarking scheme
Agilandeeswari et al. RST invariant robust video watermarking algorithm using quaternion curvelet transform
Lakrissi et al. Novel dynamic color image watermarking based on DWT-SVD and the human visual system
Meenpal DWT-based blind and robust watermarking using SPIHT algorithm with applications in tele-medicine
Gul A blind robust color image watermarking method based on discrete wavelet transform and discrete cosine transform using grayscale watermark image
Kannan et al. An extensive research on robust digital image watermarking techniques: A review
Liu et al. An efficient video watermark method using blockchain
Tian et al. Authentication and copyright protection watermarking scheme for H. 264 based on visual saliency and secret sharing
Awasthi et al. Robust image watermarking based on discrete wavelet transform, discrete cosine transform & singular value decomposition
Hassan et al. An overview of robust video watermarking techniques
Potkar et al. Review on digital video watermarking techniques
Jin et al. StreamingTag: A scalable piracy tracking solution for mobile streaming services

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200623