A kind of Watermarking for Integrity insertion and detection method based on MPEG video compression domain
Technical field
The present invention relates to field of information security technology, more specifically to a kind of based on the complete of MPEG video compression domain
Whole property watermark embedding and detection method.
Background technique
With the appearance of powerful authoring tool, the modification of the multimedia messages such as audio and video is become
It is simple to be easy.The multimedia messages distorted and forged once are heavily used in formal media, scientific discovery, insurance and court's card
Object etc. will have serious consequences.Tampering detection is primarily to solve the integrality and primitiveness identification of digital multimedia data
Problem.For the altering detecting method comparative maturity of digital picture, and it is opposite for the altering detecting method of digital video
It is less.
And altering detecting method anti-fake for existing MPEG video there is the Hash watermark for video and distorts inspection
Survey method can distort interframe and effectively be detected, but digital signature increases volume of transmitted data.And Watermarking for Integrity is
It is a kind of water whether being tampered for detecting video using serial number of the frame in entire video as Watermarking for Integrity information
Official seal breath.However, the information capacity of traditional Watermarking for Integrity information is small, so that altering detecting method accuracy and reliability
It is low.Therefore, the information capacity of Watermarking for Integrity information how is improved, so that altering detecting method accuracy and reliability is high, is
The research hotspot of current video tampering detection.
Summary of the invention
It is an object of the invention to overcome shortcoming and deficiency in the prior art, provide a kind of based on MPEG video compression domain
Watermarking for Integrity insertion and detection method, this method make method of detecting watermarks have fault-tolerance, to improve the robust of watermark
Property;This method also improves the information capacity of Watermarking for Integrity simultaneously, improves the reliability and accuracy of tampering detection.
In order to achieve the above object, the technical scheme is that: one kind based on MPEG video compress
The Watermarking for Integrity in domain is embedded in and detection method, it is characterised in that: including three steps:
The first step, firstly, generation group sequence watermark information, and a group sequence watermark information is converted into binary representation;So
Afterwards, frame sequence watermark information in generation group, and interior frame sequence watermark information will be organized and be converted into binary representation, by binary representation
Frame sequence watermark information is as Watermarking for Integrity information in the group sequence watermark information of form and the group of binary representation;
Second step, firstly, setting when Watermarking for Integrity information is embedded into MPEG video the quantity of image frame insertion point and
The position of each image frame insertion point;Then, the group sequence watermark information in Watermarking for Integrity information is embedded into each of MPEG video
The Cr chrominance block of picture I frame insertion point, is embedded into MPEG video for frame sequence watermark information in the group in Watermarking for Integrity information
The Cb chrominance block of each picture I frame insertion point;Finally, the group sequence watermark information in Watermarking for Integrity information is embedded into MPEG video
Each image frame insertion point first luminance block of macro block in, frame sequence watermark information in the group in Watermarking for Integrity information is embedded in
Into the 4th luminance block of macro block of each image frame insertion point of MPEG video, to realize the insertion of Watermarking for Integrity information, obtain
To the MPEG video with Watermarking for Integrity information;
Third step carries out mentioning for Watermarking for Integrity information to the MPEG video with Watermarking for Integrity information that second step obtains
It takes, and the Watermarking for Integrity information of extraction is detected, judge that each image frame is embedding in the MPEG video of Watermarking for Integrity information
Whether the Watermarking for Integrity information of access point is tampered, and realizes that judgement is embedded in Watermarking for Integrity information in MPEG video in advance
The integrality of MPEG video.
In the above scheme, Watermarking for Integrity of the invention uses innovative double information, i.e., by the picture where frame
The serial number of group serial number and frame in picture group generates Watermarking for Integrity information jointly, (utilizes relative to previous Watermarking for Integrity
Serial number of the frame in entire video is as Watermarking for Integrity information), the method applied in the present invention improves Watermarking for Integrity
Information capacity improves the reliability of tampering detection.
In the first step, the generation group sequence watermark information, and a group sequence watermark information is converted into binary representation is
Refer to: the following steps are included:
Step S0101: the calculating of hash value is carried out to MPEG video picture group serial number, then all pictures in i-th of picture group
The group sequence watermark information of frameAre as follows:
Wherein, GiFor the serial number of i-th of picture group;
Step S0102: by the group sequence watermark information of all image frames in i-th of picture group of step S0101Ten
System representation is converted to binary representation, when the group sequence watermark information code element number of binary representation is less than 9
When, it is supplied in front with " 0 ".The picture group quantity of MPEG video is very more, therefore picture use cannot directly be adopted by organizing sequence watermark information
Group serial number needs to carry out the calculating of hash value to picture group serial number.
In the first step, frame sequence watermark information in the generation group, and interior frame sequence watermark information will be organized and be converted into binary form
Show that form refers to: the following steps are included:
Step S0103: other than first frame in picture group, frame sequence watermark information uses the sequence of itself in the group of other frames
Number;Frame sequence watermark information is the serial number of the last one frame in the picture group in the group of first frame;
Step S0104: the decimal representation form of frame sequence watermark information in the group of step S0103 is converted into binary form
Show form, when frame sequence watermark information code element number is less than 9 in the group of binary representation, is supplied in front with " 0 ".Consider
It is few to the number of frames in MPEG video picture group, therefore can directly use serial number as other frames in addition to first frame in picture group
Group in frame sequence watermark information.
In second step, the setting when Watermarking for Integrity information is embedded into MPEG video the quantity of image frame insertion point and
The position of each image frame insertion point refers to:
Firstly, determining that the quantity of image frame insertion point is N number of, wherein each image frame insertion point includes 9 macro blocks, and 9 macro
Block is formed by 1 pivots and around 8 macro blocks of the pivots;Each macro block includes a Cr chrominance block, a Cb
Chrominance block and four luminance blocks;
Secondly, the position of each image frame insertion dot center's macro block is determined according to following rules, it is embedding to obtain the image frame
The position of 9 macro blocks in access point: each image frame insertion dot center's macro block is 4n-1 (n=at a distance from top line macro block
1,2,3 ...), it is at a distance from one column macro block of Far Left 4m-1 (m=1,2,3 ...).,
Second step, the group sequence watermark information by Watermarking for Integrity information are embedded into each picture I frame of MPEG video
It is embedded in the Cr chrominance block of point, frame sequence watermark information in the group in Watermarking for Integrity information is embedded into each picture I of MPEG video
The Cb chrominance block of frame insertion point refers to: the following steps are included:
Step S0201: the quadratic sum DMH of the DCT medium-high frequency coefficient of Cr chrominance block in each macro block is calculated:
Wherein,Indicate i-th of DCT medium-high frequency coefficient in Cr block;
Step S0202: according to the position of 9 macro blocks, each picture I frame that group sequence watermark information is embedded into MPEG video is embedding
In the Cr chrominance block of each macro block of access point:
If the group sequence watermark information of binary representation to be embedded is " 1 ", and high in the DCT of Cr chrominance block to be embedded
Frequency coefficient quadratic sum DMH is 0, then optimal macro block is found in the adjacent macroblocks of current macro, by Cr chrominance block in optimal macro block
DCT medium-high frequency coefficient replacement current macro in Cr chrominance block DCT medium-high frequency coefficient;Wherein, optimal macro block refers to Cr coloration
The DCT medium-high frequency coefficient quadratic sum DMH of block is minimum and non-zero;
If the group sequence watermark information of binary representation to be embedded is " 0 ", and high in the DCT of Cr chrominance block to be embedded
Frequency coefficient quadratic sum DMH be it is non-zero, then the DCT medium-high frequency coefficient of Cr chrominance block in the macro block of watermark to be embedded is set to 0;
Code element number is that 9 group sequence watermark informations are embedded into according to the above method by sequence from left to right, from top to bottom
In image frame insertion point in the Cr chrominance block of 9 macro blocks;
Step S0203: the quadratic sum DMH of the DCT medium-high frequency coefficient of Cb chrominance block in each macro block is calculated:
Wherein,Indicate i-th of DCT medium-high frequency coefficient in Cb block;
Step S0204: according to the position of 9 macro blocks, each picture I that interior frame sequence watermark information is embedded into MPEG video will be organized
In the Cb chrominance block of each macro block of frame insertion point:
If frame sequence watermark information is " 1 ", and the DCT of Cb chrominance block to be embedded in the group of binary representation to be embedded
Medium-high frequency coefficient quadratic sum DMH is 0, then optimal macro block is found in the adjacent macroblocks of current macro, by Cb color in optimal macro block
Spend the DCT medium-high frequency coefficient of Cb chrominance block in the DCT medium-high frequency coefficient replacement current macro of block;Wherein, optimal macro block refers to Cb
The DCT medium-high frequency coefficient quadratic sum DMH of chrominance block is minimum and non-zero;
If frame sequence watermark information is " 0 ", and the DCT of Cb chrominance block to be embedded in the group of binary representation to be embedded
Medium-high frequency coefficient quadratic sum DMH be it is non-zero, then the DCT medium-high frequency coefficient of Cb chrominance block in the macro block of watermark to be embedded is set to 0;
Frame sequence watermark information is embedding by sequence from left to right, from top to bottom according to the above method in the group that code element number is 9
Enter into image frame insertion point in the Cb chrominance block of 9 macro blocks.
Second step, each image frame that the group sequence watermark information by Watermarking for Integrity information is embedded into MPEG video are embedding
In first luminance block of macro block of access point, frame sequence watermark information in the group in Watermarking for Integrity information is embedded into MPEG video
Refer in the 4th luminance block of macro block of each image frame insertion point: the following steps are included:
Step S0205: according to the position of 9 macro blocks, each image frame that group sequence watermark information is embedded into MPEG video is embedding
In first luminance block of each macro block of access point:
If the group sequence watermark information of binary representation to be embedded is " 0 ", it is macro that this is calculated as follows
First luminance block of insertion group sequence watermark information in block:
Wherein, Y1For original first luminance block;
If the group sequence watermark information of binary representation to be embedded is " 1 ", calculate
If Y#Value be 0, then it is 1 that the 40th DCT medium-high frequency coefficient, which is arranged in the first luminance block:If Y#
Value be it is non-zero, then without operation;
Step S0206: according to the position of 9 macro blocks, each picture that interior frame sequence watermark information is embedded into MPEG video will be organized
In the 4th luminance block of each macro block of frame insertion point:
If frame sequence watermark information is " 0 " in the group of binary representation to be embedded, it is calculated as follows
In the macro block in insertion group frame sequence watermark information the 4th luminance block:
Wherein, Y4For original 4th luminance block;
If frame sequence watermark information is " 1 " in the group of binary representation to be embedded, calculate
If Y#Value be 0, then it is 1 that the 40th DCT medium-high frequency coefficient in the 4th luminance block, which is arranged:If Y#
Value be it is non-zero, then without operation.
It is described that Watermarking for Integrity letter is carried out to the MPEG video with Watermarking for Integrity information that second step obtains in third step
The extraction of breath refers to: the quantity of image frame insertion point, the position of each image frame insertion point and each picture obtained according to second step
The position of 9 macro blocks, carries out mentioning for Watermarking for Integrity information to the MPEG video with Watermarking for Integrity information in face frame insertion point
It takes, comprising the following steps:
Step S0301: the quadratic sum DMH of the DCT medium-high frequency coefficient of Cr chrominance block in each macro block is calculated:
Wherein,Indicate i-th of DCT medium-high frequency coefficient in Cr block;
If the DCT medium-high frequency coefficient quadratic sum DMH of Cr chrominance block is 0, the binary representation of Cr chrominance block is corresponded to
Group sequence watermark information be " 0 ", correspond to the group sequence watermark information of the binary representation of Cr chrominance block otherwise as " 1 ";Successively
Analogize the group sequence watermark information that the Cr chrominance block of each macro block in image frame insertion point is calculated;According to from left to right, from upper
Sequence arrangement under then obtains the group sequence watermark information of the Cr chrominance block of 9 macro blocks;
Step S0302: the quadratic sum DMH of the DCT medium-high frequency coefficient of Cb chrominance block in each macro block is calculated:
Wherein,Indicate i-th of DCT medium-high frequency coefficient in Cb block;
If the DCT medium-high frequency coefficient quadratic sum DMH of Cb chrominance block is 0, the binary representation of Cb chrominance block is corresponded to
Group in frame sequence watermark information be " 0 ", otherwise corresponding to frame sequence watermark information in the group of the binary representation of Cb chrominance block is
"1";And so on be calculated image frame insertion point in each macro block Cb chrominance block group in frame sequence watermark information;According to from
Frame sequence watermark information in the group for the Cb chrominance block that sequence arrangement left-to-right, from top to bottom then obtains 9 macro blocks;
Step S0303: first luminance block of each macro block of each image frame insertion point is performed the following operation:
Wherein,For first luminance block of macro block in the MPEG video of Watermarking for Integrity information;
If Y#It is 0, then the group sequence watermark information for corresponding to the binary representation of the first luminance block is " 0 ", is otherwise corresponded to
The group sequence watermark information of the binary representation of first luminance block is " 1 ";And so on be calculated image frame insertion point in
The group sequence watermark information of first luminance block of each macro block;According to from left to right, from top to bottom sequence arrangement then obtain 9 it is macro
The group sequence watermark information of first luminance block of block;
Step S0304: the 4th luminance block of each macro block of each image frame insertion point is performed the following operation:
Wherein,For the 4th luminance block of macro block in the MPEG video of Watermarking for Integrity information;
If Y#It is 0, then corresponding to frame sequence watermark information in the group of the binary representation of the 4th luminance block is " 0 ", otherwise
Frame sequence watermark information is " 1 " in the group of the binary representation of corresponding 4th luminance block;And so on image frame is calculated
Frame sequence watermark information in the group of 4th luminance block of each macro block in insertion point;According to sequence row from left to right, from top to bottom
Arrange frame sequence watermark information in the group for the 4th luminance block for then obtaining 9 macro blocks.
In third step, the Watermarking for Integrity information of described pair of extraction is detected, and judges the MPEG of Watermarking for Integrity information
Whether the Watermarking for Integrity information of each image frame insertion point is tampered in video, realizes that judgement has been embedded in MPEG video in advance
The integrality of the MPEG video of whole property watermark information refers to, comprising the following steps:
Step S0401: each image frame is embedded in the group sequence watermark information of Cr chrominance block in 9 macro blocks of point, Cb chrominance block
Frame sequence watermark information is used as respectively in frame sequence watermark information, the group sequence watermark information of the first luminance block and the group of the 4th luminance block in group
The Watermarking for Integrity information of image frame insertion point, and the Watermarking for Integrity information generated with the first step is made comparisons;
Step S0402: the Watermarking for Integrity that the Watermarking for Integrity information and the first step for counting each image frame insertion point generate
The identical quantity of information;In same picture frame, if the Watermarking for Integrity information phase that Watermarking for Integrity information is generated with the first step
The quantity of same insertion point is greater than and is equal to insertion sumThen judge that the information of the image frame is not tampered with, current picture
Frame is normal frame, and executes step S0403;Otherwise judge that the information of the image frame is tampered;
Step S0403: using the Watermarking for Integrity information of the identical insertion point of Watermarking for Integrity information in normal frame as working as
The Watermarking for Integrity information of preceding image frame, and the binary representation of Watermarking for Integrity information is converted into decimal representation shape
Formula.
Compared with prior art, the invention has the advantages that with the utility model has the advantages that the present invention is based on MPEG video compression domains
Watermarking for Integrity insertion with detection method make method of detecting watermarks have fault-tolerance, to improve the robustness of watermark;Simultaneously
This method also improves the information capacity of Watermarking for Integrity, improves the reliability and accuracy of tampering detection.
Detailed description of the invention
Fig. 1 is the flow chart that Watermarking for Integrity information generates in the method for the present invention;
Fig. 2 is the flow chart that Watermarking for Integrity information is embedded in the method for the present invention;
Fig. 3 is the flow chart of Watermarking for Integrity infomation detection in the method for the present invention;
Specific embodiment
The present invention is described in further detail with specific embodiment with reference to the accompanying drawing.
Embodiment
As shown in Figure 1 to Figure 3, the present invention is based on the insertion of the Watermarking for Integrity of MPEG video compression domain and detection method, packets
Include three steps:
The first step, firstly, generation group sequence watermark information, and a group sequence watermark information is converted into binary representation;So
Afterwards, frame sequence watermark information in generation group, and interior frame sequence watermark information will be organized and be converted into binary representation, by binary representation
Frame sequence watermark information is as Watermarking for Integrity information in the group sequence watermark information of form and the group of binary representation;
Second step, firstly, setting when Watermarking for Integrity information is embedded into MPEG video the quantity of image frame insertion point and
The position of each image frame insertion point;Then, the group sequence watermark information in Watermarking for Integrity information is embedded into each of MPEG video
The Cr chrominance block of picture I frame insertion point, is embedded into MPEG video for frame sequence watermark information in the group in Watermarking for Integrity information
The Cb chrominance block of each picture I frame insertion point;Finally, the group sequence watermark information in Watermarking for Integrity information is embedded into MPEG video
Each image frame insertion point first luminance block of macro block in, frame sequence watermark information in the group in Watermarking for Integrity information is embedded in
Into the 4th luminance block of macro block of each image frame insertion point of MPEG video, to realize the insertion of Watermarking for Integrity information, obtain
To the MPEG video with Watermarking for Integrity information;
Third step carries out mentioning for Watermarking for Integrity information to the MPEG video with Watermarking for Integrity information that second step obtains
It takes, and the Watermarking for Integrity information of extraction is detected, judge that each image frame is embedding in the MPEG video of Watermarking for Integrity information
Whether the Watermarking for Integrity information of access point is tampered, and realizes that judgement is embedded in Watermarking for Integrity information in MPEG video in advance
The integrality of MPEG video.
In the first step, above-mentioned generation group sequence watermark information, and a group sequence watermark information is converted into binary representation is
Refer to: the following steps are included:
Step S0101: the calculating of hash value is carried out to MPEG video picture group serial number, then all pictures in i-th of picture group
The group sequence watermark information of frameAre as follows:
Wherein, GiFor the serial number of i-th of picture group;
Step S0102: by the group sequence watermark information of all image frames in i-th of picture group of step S0101Ten
System representation is converted to binary representation, when the group sequence watermark information code element number of binary representation is less than 9
When, it is supplied in front with " 0 ".The picture group quantity of MPEG video is very more, therefore picture use cannot directly be adopted by organizing sequence watermark information
Group serial number needs to carry out the calculating of hash value to picture group serial number.
In the first step, frame sequence watermark information in above-mentioned generation group, and interior frame sequence watermark information will be organized and be converted into binary form
Show that form refers to: the following steps are included:
Step S0103: other than first frame in picture group, frame sequence watermark information uses the sequence of itself in the group of other frames
Number;Frame sequence watermark information is the serial number of the last one frame in the picture group in the group of first frame;
Step S0104: the decimal representation form of frame sequence watermark information in the group of step S0103 is converted into binary form
Show form, when frame sequence watermark information code element number is less than 9 in the group of binary representation, is supplied in front with " 0 ".Consider
It is few to the number of frames in MPEG video picture group, therefore can directly use serial number as other frames in addition to first frame in picture group
Group in frame sequence watermark information.
In second step, when Watermarking for Integrity information is embedded into MPEG video by above-mentioned setting image frame insertion point quantity and
The position of each image frame insertion point refers to:
Firstly, determining quantity 4 of image frame insertion point, wherein each image frame insertion point includes 9 macro blocks, and 9 macro
Block is formed by 1 pivots and around 8 macro blocks of the pivots;Each macro block includes a Cr chrominance block, a Cb
Chrominance block and four luminance blocks;
Secondly, the position of each image frame insertion dot center's macro block is determined according to following rules, it is embedding to obtain the image frame
The position of 9 macro blocks in access point: each image frame insertion dot center's macro block is 4n-1 (n=at a distance from top line macro block
1,2,3 ...), it is at a distance from one column macro block of Far Left 4m-1 (m=1,2,3 ...)., 4 insertion point positions of the present embodiment
As shown in table 1.
1 Watermarking for Integrity of table default insertion point position table
Insertion point |
n |
m |
W1 |
1 |
1 |
W2 |
1 |
2 |
W3 |
2 |
1 |
W4 |
2 |
2 |
Second step, the above-mentioned group sequence watermark information by Watermarking for Integrity information are embedded into each picture I frame of MPEG video
It is embedded in the Cr chrominance block of point, frame sequence watermark information in the group in Watermarking for Integrity information is embedded into each picture I of MPEG video
The Cb chrominance block of frame insertion point refers to: the following steps are included:
Step S0201: the quadratic sum DMH of the DCT medium-high frequency coefficient of Cr chrominance block in each macro block is calculated:
Wherein,Indicate i-th of DCT medium-high frequency coefficient in Cr block;
Step S0202: according to the position of 9 macro blocks, each picture I frame that group sequence watermark information is embedded into MPEG video is embedding
In the Cr chrominance block of each macro block of access point:
If the group sequence watermark information of binary representation to be embedded is " 1 ", and high in the DCT of Cr chrominance block to be embedded
Frequency coefficient quadratic sum DMH is 0, then optimal macro block is found in the adjacent macroblocks of current macro, by Cr chrominance block in optimal macro block
DCT medium-high frequency coefficient replacement current macro in Cr chrominance block DCT medium-high frequency coefficient;Wherein, optimal macro block refers to Cr coloration
The DCT medium-high frequency coefficient quadratic sum DMH of block is minimum and non-zero;
If the group sequence watermark information of binary representation to be embedded is " 0 ", and high in the DCT of Cr chrominance block to be embedded
Frequency coefficient quadratic sum DMH be it is non-zero, then the DCT medium-high frequency coefficient of Cr chrominance block in the macro block of watermark to be embedded is set to 0;
Code element number is that 9 group sequence watermark informations are embedded into according to the above method by sequence from left to right, from top to bottom
In image frame insertion point in the Cr chrominance block of 9 macro blocks;
Step S0203: the quadratic sum DMH of the DCT medium-high frequency coefficient of Cb chrominance block in each macro block is calculated:
Wherein,Indicate i-th of DCT medium-high frequency coefficient in Cb block;
Step S0204: according to the position of 9 macro blocks, each picture I that interior frame sequence watermark information is embedded into MPEG video will be organized
In the Cb chrominance block of each macro block of frame insertion point:
If frame sequence watermark information is " 1 ", and the DCT of Cb chrominance block to be embedded in the group of binary representation to be embedded
Medium-high frequency coefficient quadratic sum DMH is 0, then optimal macro block is found in the adjacent macroblocks of current macro, by Cb color in optimal macro block
Spend the DCT medium-high frequency coefficient of Cb chrominance block in the DCT medium-high frequency coefficient replacement current macro of block;Wherein, optimal macro block refers to Cb
The DCT medium-high frequency coefficient quadratic sum DMH of chrominance block is minimum and non-zero;
If frame sequence watermark information is " 0 ", and the DCT of Cb chrominance block to be embedded in the group of binary representation to be embedded
Medium-high frequency coefficient quadratic sum DMH be it is non-zero, then the DCT medium-high frequency coefficient of Cb chrominance block in the macro block of watermark to be embedded is set to 0;
Frame sequence watermark information is embedding by sequence from left to right, from top to bottom according to the above method in the group that code element number is 9
Enter into image frame insertion point in the Cb chrominance block of 9 macro blocks.
Second step, each image frame that the above-mentioned group sequence watermark information by Watermarking for Integrity information is embedded into MPEG video are embedding
In first luminance block of macro block of access point, frame sequence watermark information in the group in Watermarking for Integrity information is embedded into MPEG video
Refer in the 4th luminance block of macro block of each image frame insertion point: the following steps are included:
Step S0205: according to the position of 9 macro blocks, each image frame that group sequence watermark information is embedded into MPEG video is embedding
In first luminance block of each macro block of access point:
If the group sequence watermark information of binary representation to be embedded is " 0 ", it is macro that this is calculated as follows
First luminance block of insertion group sequence watermark information in block:
Wherein, Y1For original first luminance block;
If the group sequence watermark information of binary representation to be embedded is " 1 ", calculate
If Y#Value be 0, then it is 1 that the 40th DCT medium-high frequency coefficient, which is arranged in the first luminance block:If Y#
Value be it is non-zero, then without operation;
Step S0206: according to the position of 9 macro blocks, each picture that interior frame sequence watermark information is embedded into MPEG video will be organized
In the 4th luminance block of each macro block of frame insertion point:
If frame sequence watermark information is " 0 " in the group of binary representation to be embedded, it is calculated as follows
In the macro block in insertion group frame sequence watermark information the 4th luminance block:
Wherein, Y4For original 4th luminance block;
If frame sequence watermark information is " 1 " in the group of binary representation to be embedded, calculate
If Y#Value be 0, then it is 1 that the 40th DCT medium-high frequency coefficient in the 4th luminance block, which is arranged:If Y#
Value be it is non-zero, then without operation.
It is above-mentioned that Watermarking for Integrity letter is carried out to the MPEG video with Watermarking for Integrity information that second step obtains in third step
The extraction of breath refers to: the quantity of image frame insertion point, the position of each image frame insertion point and each picture obtained according to second step
The position of 9 macro blocks, carries out mentioning for Watermarking for Integrity information to the MPEG video with Watermarking for Integrity information in face frame insertion point
It takes, comprising the following steps:
Step S0301: the quadratic sum DMH of the DCT medium-high frequency coefficient of Cr chrominance block in each macro block is calculated:
Wherein,Indicate i-th of DCT medium-high frequency coefficient in Cr block;
If the DCT medium-high frequency coefficient quadratic sum DMH of Cr chrominance block is 0, the binary representation of Cr chrominance block is corresponded to
Group sequence watermark information be " 0 ", correspond to the group sequence watermark information of the binary representation of Cr chrominance block otherwise as " 1 ";Successively
Analogize the group sequence watermark information that the Cr chrominance block of each macro block in image frame insertion point is calculated;According to from left to right, from upper
Sequence arrangement under then obtains the group sequence watermark information of the Cr chrominance block of 9 macro blocks;
Step S0302: the quadratic sum DMH of the DCT medium-high frequency coefficient of Cb chrominance block in each macro block is calculated:
Wherein,Indicate i-th of DCT medium-high frequency coefficient in Cb block;
If the DCT medium-high frequency coefficient quadratic sum DMH of Cb chrominance block is 0, the binary representation of Cb chrominance block is corresponded to
Group in frame sequence watermark information be " 0 ", otherwise corresponding to frame sequence watermark information in the group of the binary representation of Cb chrominance block is
"1";And so on be calculated image frame insertion point in each macro block Cb chrominance block group in frame sequence watermark information;According to from
Frame sequence watermark information in the group for the Cb chrominance block that sequence arrangement left-to-right, from top to bottom then obtains 9 macro blocks;
Step S0303: first luminance block of each macro block of each image frame insertion point is performed the following operation:
Wherein,For first luminance block of macro block in the MPEG video of Watermarking for Integrity information;
If Y#It is 0, then the group sequence watermark information for corresponding to the binary representation of the first luminance block is " 0 ", is otherwise corresponded to
The group sequence watermark information of the binary representation of first luminance block is " 1 ";And so on be calculated image frame insertion point in
The group sequence watermark information of first luminance block of each macro block;According to from left to right, from top to bottom sequence arrangement then obtain 9 it is macro
The group sequence watermark information of first luminance block of block;
Step S0304: the 4th luminance block of each macro block of each image frame insertion point is performed the following operation:
Wherein,For the 4th luminance block of macro block in the MPEG video of Watermarking for Integrity information;
If Y#It is 0, then corresponding to frame sequence watermark information in the group of the binary representation of the 4th luminance block is " 0 ", otherwise
Frame sequence watermark information is " 1 " in the group of the binary representation of corresponding 4th luminance block;And so on image frame is calculated
Frame sequence watermark information in the group of 4th luminance block of each macro block in insertion point;According to sequence row from left to right, from top to bottom
Arrange frame sequence watermark information in the group for the 4th luminance block for then obtaining 9 macro blocks.
In third step, the above-mentioned Watermarking for Integrity information to extraction is detected, and judges the MPEG of Watermarking for Integrity information
Whether the Watermarking for Integrity information of each image frame insertion point is tampered in video, realizes that judgement has been embedded in MPEG video in advance
The integrality of the MPEG video of whole property watermark information refers to, comprising the following steps:
Step S0401: each image frame is embedded in the group sequence watermark information of Cr chrominance block in 9 macro blocks of point, Cb chrominance block
Frame sequence watermark information is used as respectively in frame sequence watermark information, the group sequence watermark information of the first luminance block and the group of the 4th luminance block in group
The Watermarking for Integrity information of image frame insertion point, and the Watermarking for Integrity information generated with the first step is made comparisons;
Step S0402: the Watermarking for Integrity that the Watermarking for Integrity information and the first step for counting each image frame insertion point generate
The identical quantity of information;In same picture frame, if the Watermarking for Integrity information phase that Watermarking for Integrity information is generated with the first step
The quantity of same insertion point is greater than and is equal to insertion sumThen judge that the information of the image frame is not tampered with, current picture
Frame is normal frame, and executes step S0403;Otherwise judge that the information of the image frame is tampered;
Step S0403: using the Watermarking for Integrity information of the identical insertion point of Watermarking for Integrity information in normal frame as working as
The Watermarking for Integrity information of preceding image frame, and the binary representation of Watermarking for Integrity information is converted into decimal representation shape
Formula.
The above embodiment is a preferred embodiment of the present invention, but embodiments of the present invention are not by above-described embodiment
Limitation, other any changes, modifications, substitutions, combinations, simplifications made without departing from the spirit and principles of the present invention,
It should be equivalent substitute mode, be included within the scope of the present invention.