Summary of the invention
At existing deficiency in the prior art, the objective of the invention is to: propose a kind of bittorrent Robust digital figure watermark embedding and detection method and device.With the digital picture after this method and the device embed digital watermark; even behind convergent-divergent, rotation, shearing, upset, translation, mirror image, printing-image processing operations such as scanning; autocorrelation characteristic by the cycle watermark; can the computational transformation parameter and correctly from recover image extract watermark data, thus realized the copyright protection function of digital picture works.
In order to achieve the above object, the present invention is undertaken by following steps.Utilization is modulated bitstream data by the pseudo-random sequence of cipher controlled, with the modulation signal addition, is configured to axisymmetric watermark then, at last according to the masking effect of original digital image periodically self-adaptation embed in the original digital image.When needs are verified the copyright of digital picture works, do not need original image to participate in, at first the autocorrelation function of predetermined period watermark and computation period watermark is judged the affined transformation of image experience and is recovered image according to the lattice structure that the peak value of autocorrelation function is formed; From recover image, predict watermark once more, utilize the key identical to produce pseudo-random sequence, and be configured to axisymmetric signal that the watermark of demodulation prediction obtains binary code word, thereby propose copyright information according to the rule identical with built-in end with built-in end.
The present invention includes embed digital watermark and detect the digital watermarking two large divisions.Embed digital watermark method and device comprise: with data-modulated, the signal configuration after will modulating then be axisymmetric watermark and with its periodically self-adaptation embed digital picture.The method and the device that detect digital watermarking comprise: the prediction watermark is also calculated the autocorrelation function of prediction watermark, utilizes the coordinate of autocorrelation function local peaking to judge the parameter of the affined transformation of image experience, and recovers image according to parameter.From recover image, predict watermark at last, by extracting data after the demodulation.Now be described in detail as follows:
The method that a first aspect of the present invention provides a kind of like this bittorrent Robust digital figure watermark to embed comprises following three steps:
The first step is the spread spectrum modulation: utilize key to produce a set that is made of pseudo-random sequence, the number of elements of set is identical with the amount of bits of bit stream, and the length of pseudo-random sequence is according to the requirement of robustness is decided.Modulate corresponding bit with pseudo-random sequence, form new pseudo-random sequence set, all pseudo-random sequence additions get pseudo-random sequence to the end in will gathering then.
Second step was the axisymmetric watermark signal of structure: the pseudo-random sequence that obtains is rearranged form the sub-piece of two dimension, sub-piece serves as the axle upset with any one of four limits, two sub-pieces are arranged in form an axisymmetric macro block together, this macro block can be left-right symmetric, symmetry up and down.According to the big young pathbreaker's macro block tiling of image, obtain a periodicity watermark identical then, by limiter amplitude limit is carried out in the periodicity watermark at last with original image size.Wherein also can when this step begins, carry out, the pseudo-random sequence that obtains is carried out amplitude limit by limiter by the limiter amplitude limit.
The 3rd step was the masking effect according to original digital image, the watermark of above-mentioned structure periodically self-adaptation embed in the original digital image: the noise visibility function that at first calculates each component of original digital image, the initial value of a contrast sensitivity is set, deposit the data of original image component in a two-dimensional array, wicket sequential scanning two-dimensional array with certain size, the variance of calculating in each window deposits it in another two-dimensional array and finds out maximum variance yields, obtain one with the contrast sensitivity initial value divided by the variance yields of maximum and adjust parameter, adjust the MAD one of parameter and variance, get the noise visibility function (NVF) that value that inverse obtains becomes this component.Then the cycle watermark is embedded digital picture adaptively, the NVF of each component of the original image value with the cycle watermark on duty, be added to respectively then on the numerical value of each component of original image, the intensity of watermark can be set according to the requirement of robustness and invisibility in this process.
The method that a second aspect of the present invention provides a kind of like this bittorrent Robust digital figure watermark to detect comprises following five steps:
The first step is predetermined period watermark: the method for digital picture by filtering obtained a signal, and the product of this signal and the noise visibility function of himself is as the predicted value of cycle watermark.
Second step was to judge affined transformation and recover image: the autocorrelation function of computation period watermark predicted value, the value of autocorrelation function is mapped as the data (as image codomain 0-255) that belong to certain codomain, utilize given shape (as cross, intersections etc.) method of filtering obtains the local peaking of autocorrelation function, the affine transformation parameter of the lattice structure computed image experience that constitutes according to the coordinate points of local peaking, according to parameter digital picture is carried out the inverse transformation image that is restored, if there is not the local peaking of rule, then illustrate not contain watermark in this image, need not to proceed the following step.
The 3rd step was to predict watermark once more: the predicted value that the digital picture of recovering is obtained once more the cycle watermark according to the method for the first step.
The 4th step was to judge from the 3rd to go on foot to obtain whether there is watermark the predicted value: utilize the key identical with built-in end to produce the pseudo-random sequence set, structure principle according to built-in end, the pseudo-random sequence of flag bit correspondence is configured to axisymmetric two-dimentional macro block, the cross correlation function of computing macro block and cycle watermark predicted value; With the extreme value of cross correlation function, compare with prior preset threshold, if having watermark, carried out for the 5th step greater than the threshold value explanation; If less than threshold value, do not contain watermark in the key diagram picture, need not to proceed the following step.
The 5th step was to go on foot the prediction watermark that obtains from the 3rd to extract data: according to the structure principle of built-in end, other pseudo-random sequences are configured to axisymmetric two-dimentional macro block respectively, calculate the cross correlation function of two-dimentional macro block and cycle watermark predicted value; Ask the maximal value of the absolute value of cross correlation function,, judge watermark bit according to the cross-correlation function value of absolute value maximum and preset threshold comparison in advance.
A third aspect of the present invention provides a kind of like this flush mounting of bittorrent Robust digital figure watermark, and this flush mounting has the modulating device that utilizes pseudo-random sequence bitstream data to be carried out the spread spectrum modulation; Modulation signal is configured to the constructing apparatus of axisymmetric watermark; According to the masking effect of original digital image, the watermark of structure periodically self-adaptation imbed flush mounting in the original digital image.Wherein modulating device comprises pseudorandom number generator that can produce pseudo-random sequence and the stacking apparatus that modulation signal is superposeed.Constructing apparatus comprises the limiter that modulation signal is carried out amplitude limit.And the calculation element that is inserted in the masking effect of the calculating digital picture between above-mentioned constructing apparatus and the above-mentioned flush mounting.
A fourth aspect of the present invention provides a kind of like this pick-up unit of bittorrent Robust digital figure watermark, and this pick-up unit has and is used for the watermark prediction unit of predetermined period watermark from digital picture; Be used for calculating the autocorrelation function of prediction watermark, affine transformation parameter that the judgement image experiences and the image correction apparatus that recovers image; According to the pseudo-random sequence set that produces with the same key of built-in end, according to constructing axisymmetric two-dimentional macro block with the same rule of built-in end, the cycle watermark of demodulation prediction obtains the demodulating equipment of watermark data.Wherein the watermark prediction unit also has the wave filter of predetermined period watermark and the calculation element of the masking effect of calculating digital picture; Image correction apparatus comprise computation period watermark predicted value autocorrelation function calculation element and obtain the wave filter of the local peaking of autocorrelation function.Also have the pseudorandom number generator that can utilize key to produce pseudo-random sequence in the demodulating equipment, pseudo random signal is configured to the constructing apparatus of axisymmetric two-dimentional macro block, according to the value of the simple crosscorrelation of the cycle watermark of axisymmetric two-dimentional macro block and prediction, judge the matched filter of watermark bit.
The present invention's's " a kind of embedding of bittorrent Robust digital figure watermark and the method for detection and device " effect is as follows:
1. the present invention has adopted axisymmetric periodicity watermark embedded technology, can eliminate the influences that geometric attack brought such as affined transformation, shearing, upset, mirror image effectively, provides reliable synchronizing information for detecting watermark.
2. because the present invention has adopted spread spectrum modulation technique, error-correcting code technique,, still can extract data exactly, for the robustness of digital watermarking provides good assurance even experienced some image processing operations at image.
Why the present invention has above-mentioned effect, mainly be because the lattice structure that the peak value of the digital figure watermark technology utilization periodicity watermark autocorrelation function among the present invention is formed also presents periodicity this characteristics same with watermark, can pick up synchronizing information, thereby eliminate the influence that above-mentioned geometric attack brings effectively; The present invention utilizes the robustness of spread spectrum digital watermark enhancing watermark in addition, utilizes the local peaking position of the wave filter location prediction watermark rapidly and accurately autocorrelation function of given shape.
Embodiment
The present invention is described in further detail below in conjunction with drawings and Examples, and see also accompanying drawing.Fig. 1 is that a kind of bittorrent Robust digital figure watermark of expression embeds and the method for detection and the process flow diagram of device, wherein is divided into embed digital watermark and detects digital watermarking two parts.
The structure of flush mounting comprises the modulating device that utilizes pseudo-random sequence bitstream data to be carried out the spread spectrum modulation; Modulation signal is configured to the constructing apparatus of axisymmetric watermark; According to the masking effect of original digital image, the watermark of structure periodically self-adaptation imbed flush mounting in the original digital image.Wherein comprise can be by carrying out Error Correction of Coding with the original bit flow data for modulating device, add the scrambler that is used in detection, can judging fast a flag bit that whether contains watermark in the image in the code word front then, the unipolarity code word can be become the converter of bipolarity code word, can produce the pseudorandom number generator of pseudo-random sequence, and the stacking apparatus that modulation signal is superposeed.Constructing apparatus comprises the limiter that modulation signal is carried out amplitude limit, and the calculation element that is inserted in the masking effect of the calculating digital picture between above-mentioned constructing apparatus and the above-mentioned flush mounting.
By flush mounting that the operation steps that digital watermarking embeds in the original image is as follows: at first, utilize the Bose-Chaudhuri Hocquenghem error correction codes technology to add with many bit-binary data coding and in the code word front and by converter unipolarity error correction code word is become the bipolarity code word then by a flag bit 1 by scrambler; Second step, utilize key to produce a set that constitutes by pseudo-random sequence by pseudo-random generator, utilize the corresponding bipolarity code word of modulating device modulation, by superimposer all modulated signal sequences additions are got to the end pseudo-random sequence then; The 3rd step, by constructing apparatus the pseudo-random sequence that obtains is rearranged sub-piece of two dimension of formation, sub-piece serves as the axle upset with any one of four limits, two sub-pieces are arranged in form an axisymmetric macro block together, this macro block can be left-right symmetric, symmetrical up and down, perhaps as a whole with two blocks, upset once is configured to not only left-right symmetric but also laterally zygomorphic macro block again, shown in Fig. 2 a (we have used not only left-right symmetric but also laterally zygomorphic macro block in the present embodiment), big young pathbreaker's macro block tiling is come and is obtained periodically watermark according to image then, by limiter amplitude limit is carried out in the periodicity watermark at last; In the 4th step,, be used to be controlled at the embedment strength of image zones of different watermark by the noise visibility function of each component of calculation element calculating original digital image; In the 5th step, the cycle watermark is embedded digital picture adaptively by flush mounting.
The pick-up unit structure comprises and is used for the watermark prediction unit of predetermined period watermark from digital picture; Be used for calculating the autocorrelation function of prediction watermark, affine transformation parameter that the judgement image experiences and the image correction apparatus that recovers image; According to the pseudo-random sequence set that produces with the same key of built-in end, according to constructing axisymmetric two-dimentional macro block with the same rule of built-in end, the cycle watermark of demodulation prediction obtains the demodulating equipment of watermark data.Wherein the watermark prediction unit also has the wave filter of predetermined period watermark and the calculation element of the masking effect of calculating digital picture; Image correction apparatus comprise computation period watermark predicted value autocorrelation function calculation element and obtain the wave filter of the local peaking of autocorrelation function.Also have the pseudorandom number generator that can utilize key to produce pseudo-random sequence in the demodulating equipment, pseudo random signal is configured to the constructing apparatus of axisymmetric two-dimentional macro block, according to the value of the simple crosscorrelation of the cycle watermark of axisymmetric two-dimentional macro block and prediction, judge the matched filter of watermark bit.
By pick-up unit that the operation steps that digital watermarking detects from digital picture is as follows: the first step, by the watermark prediction unit, utilize wave filter that digital picture is carried out low-pass filtering, obtain a signal, the product of this signal and the noise visibility function of this signal that obtains by calculation element is the periodically predicted value of watermark; Second step, pass through image correction apparatus, allow calculation element utilize the autocorrelation function of fast Fourier transform (FFT) computation period watermark, obtain the transformation parameter of image experience: the range mappings of auto-correlation function value is arrived 0-255, utilize image process method to extract local peaking by filter then; Utilize the method for statistics afterwards, obtain distance and angle between the peak value, and the distance and the angle contrast that are provided with when embedding, thereby obtain the parameter of the affined transformation of digital picture experience, according to parameter image is carried out inverse transformation and recover image; In the 3rd step, utilize the method and apparatus processing recovery image of the first step to obtain predetermined period watermark once more; In the 4th step, utilize the pseudo-random sequence of flag bit key correspondence to judge by demodulating equipment and recover whether to contain flag bit in the image, thereby judge whether to exist watermark; The 5th step: by demodulating equipment, utilize the pseudo-random sequence set that produces according to key, according to constructing axisymmetric macro block with the same rule of built-in end, the watermark of demodulation cycle obtains binary data; The 6th step: utilize the BCH decoding technique to extract the original watermark data by the error correcting code code translator.
More than every rapid step by step action effect referring to subordinate list 1 and subordinate list 2.
Each the step effect of table 1 embed digital watermark method
Step |
Operation |
Effect |
1 |
Write the error correcting code program, to the copyright of many bits |
Strengthen many bits copyright information for figure |
|
Information data is carried out Error Correction of Coding; The front is transformed to the bipolarity code word after adding a flag bit. |
Picture is handled the robustness of operation. |
2 |
Write modulation program, use the pseudo-random sequence that produces according to key to modulate summation afterwards the bipolarity code word. |
Strengthen the robustness of watermark for image processing operations. |
3 |
Write structure cycle watermarking process, the pseudo-random sequence that obtains is rearranged sub-piece of two dimension of formation, sub-piece serves as the axle upset with any one of four limits, two sub-pieces are arranged in form an axisymmetric macro block together, this macro block can be left-right symmetric, symmetrical up and down, perhaps as a whole with two blocks, upset once is configured to not only left-right symmetric but also laterally zygomorphic macro block again,, and with the macro block tiling generation cycle watermark of coming. |
Strengthen the robustness of watermark for upset, shearing, mirror image; Determine synchronously when detecting. |
4 |
Calculate the masking effect of digital picture, digital picture is scanned calculating noise visibility function NVF with the window of certain size. |
Increase the invisibility of watermark. |
5 |
The cycle watermark is embedded into digital picture, sets watermark strength, then the watermark additivity is embedded in the digital picture according to the requirement of robustness and invisibility. |
Formation adds watermarking images. |
Table 2 detects each step effect of digital watermark method
Step |
Operation |
Effect |
1 |
Digital picture is carried out low-pass filtering obtain the high frequency imaging signal, calculate the NVF of this signal simultaneously, both multiply each other and obtain the periodically predicted value of watermark; |
Do not need original image to participate in when detecting. |
2 |
The autocorrelation function of computation period watermark to 0-255, extracts local peaking with the range mappings of auto-correlation function value then, obtains the transformation parameter that image may experience, and recovers image; |
Seek and detect the required synchronizing information of watermark. |
3 |
Operate predetermined period watermark once more according to step 1 pair recovery image |
Obtain containing the signal of watermark data |
4 |
Rotational symmetry macro block that the pseudo-random sequence of calculation flag bit correspondence constitutes and the simple crosscorrelation between the predicted value are calculated the ratio of cross correlation function maximal value and watermark energy opening, with prior preset threshold comparison. |
Judge the watermark that whether has embedding in the predicted value |
5 |
Write the demodulation coding program, utilize the pseudo-random sequence that produces according to key prediction watermark demodulation, |
Extract the binary data of many bits |
6 |
Extract the data of many bits with the error-correcting decoding technology. |
Obtain the scale-of-two copyright information |
Fig. 2 b is the process flow diagram of tectonic axis symmetric watermark.
Fig. 2 c is the cycle watermark of being constructed according to the flow process of Fig. 2 by flag bit 1 and data " 12345 ".
Fig. 3 a is the original RGB image lena that selects;
Fig. 3 b is the noise visibility function NVF of image lena red component.
Fig. 4 embeds the RGB image lena afterwards of the cycle watermark shown in Fig. 2 b.
At first, the color value of reading images Lena takes out R, G, three components of B, stores in three two-dimensional arrays.Calculate the noise visibility function of three components respectively.Then the cycle watermark shown in Fig. 2 b is hidden in respectively in the lena image shown in Fig. 3 a.The formula of additivity embed watermark is in three components:
R′=R+(1-NVF(R))·α+NVF(R)·β
G′=G+(1-NVF(G))·α+NVF(G)·β
B′=B+(1-NVF(B))·α+NVF(B)·β
α wherein, β represents the embedment strength of watermark in image;
The detail operations step that concrete digital watermarking embeds algorithm is as follows:
The first step is encoded to scale-of-two " 0,011 0,000 0,011 1001 " with data " 12345 "; Obtain unipolarity code word " xxxxx " after utilizing the BCH Error Correction of Coding.
In second step, the unipolar code front adds a flag bit 1, forms code word " 1 xxxxx ", is mapped as-1 with all 0 then, obtains bipolarity code word " 1 xxxxx ".
The 3rd step according to the quantity of bipolarity code word, produced the separate pseudo-random sequence of same quantity and multiplies each other with the bipolarity code word with key, and we are chosen as 1024 sequence length, and data are obeyed evenly and distributed, and average is 0; With all sequence additions, form an one-dimensional signal that contains all codeword information at last.
The 4th step, with length is the two-dimensional blocks of data that 1024 one-dimensional signal is arranged as 32*32, then data block is overturn along right hand edge, lower limb, the lower right corner respectively, four two-dimensional blocks of data are put into the two-dimensional array of a 64*64, form axisymmetric macro block.
In the 5th step, the size of reading in image Lena is 512*512, and the macro block tiling that obtains is come, and forms the cycle watermark array of 512*512.
The 6th step, read in the color value of image Lena, and propose three components of RGB, calculate the noise visibility function NVF of Lena image R, G, B component respectively, the wicket size of our usefulness is 3*3 in the calculating, the contrast sensitivity initial value is set to 150.
The 7th step was embedded into three components of RGB of image with the cycle watermark respectively according to embedding formula, with the synthetic RGB image of three components, formed the Lena image that adds watermark then.
Fig. 5 is the variation synoptic diagram of the lattice structure of the autocorrelation function of cycle watermark and the peak value composition that passes through affined transformation autocorrelation function afterwards thereof.This conversion can often take place in image processing process, but a lot of watermarking algorithm is powerless to this conversion, because this conversion has destroyed synchronizing information.The present invention detects from image before the watermark, must seek earlier equally and detect the needed synchronizing information of watermark.The watermark that embeds is periodic, be with axisymmetric, therefore horizontal and vertical all is periodic, be easy to draw from mathematics, the local peaking of cycle watermark autocorrelation function has the cycle same with the cycle watermark, and promptly local peaking also is the cycle appearance on horizontal and vertical, simultaneously, even the cycle watermark is through affined transformation, corresponding variation also can take place in the peak of its autocorrelation function.Utilize these characteristics to obtain the required synchronizing information of detection watermark just with axisymmetric periodic signal.
Fig. 6 is the example of image through affined transformation, by the image of Fig. 4 through forming after rotation 20 degree.From Fig. 6, extract watermark, at first predetermined period watermark, the autocorrelation function of calculating predicted value.Here the fourier modulus spectrum according to signal is that a pair of Fourier transform is right with its autocorrelation function, utilizes fast fourier transform to calculate the autocorrelation function of prediction watermark.Formula is:
ACF(W)=IFFT(|FFT(W)|
2)
The range mappings of auto-correlation function value between the 0-255, is generated a width of cloth gray level image.Utilize image process method extraction local peaking wherein, calculate distance and angle between the peak value, draw affine transformation parameter, according to parameter image is carried out inverse transformation then and recover image.The operation steps of concrete recovery image is as follows:
The first step, at first predetermined period watermark, read in digital picture shown in Figure 6, three color components of RGB are proposed respectively, it is the mean filter of 3*3 that each component is adopted window size, deduct filtered pixel value with original pixel value, obtain three watermark block, will save as a two-dimensional array after three's addition.
Second step, the noise visibility function of calculating two-dimensional array, the small window size that uses in the computation process is 3*3, the contrast sensitivity initial value still is made as 150.The value of noise visibility function is multiplied each other with the value of two-dimensional array is corresponding, obtain predicting watermark, save as two-dimensional array.
In the 3rd step, calculate the autocorrelation function of prediction watermark: the prediction watermark is carried out the FFT conversion according to the order of row earlier, carries out the FFT conversion according to the order of row then, then the FFT coefficient is taken absolute value and square, save as two-dimensional array; This array is carried out the IFFT conversion according to the order of row earlier, carry out the IFFT conversion according to the order of row then, then the numerical value after the conversion is taken absolute value, obtain autocorrelation function.
The 4th step, obtain the minimum value and the maximal value of auto-correlation function value, make that minimum value is 0, maximal value is 255, and other values are mapped between the 0-255, generates a width of cloth 8bit gray level image; Use the certain window scan image then, obtain the position of local peaking, if this is a local peaking, value is made as 1, otherwise is 0, obtains a width of cloth bianry image.
In the 5th step, non-zero points each other the distance of statistics in the bianry image found out the maximum distance value of quantity, and this value is divided by 64 multiples that are image modification, and the angle of two local peaking's lines is exactly the angle that image is rotated, and just can recover image according to both.
Fig. 7 is the lattice structure figure that the local peaking that extracts from Fig. 6 forms.
Fig. 8 is according to the parameter image restored that obtains from Fig. 7.
Recover after the image, just can carry out the watermark extracting operation, the operation steps of specifically extracting data from recover image is as follows:
The first step, at first predetermined period watermark, read in the digital picture of recovery, three color components of RGB are proposed respectively, it is the mean filter of 3*3 that each component is adopted window size, deduct filtered pixel value with original pixel value, obtain three watermark block, will save as a two-dimensional array after three's addition.
Second step, the noise visibility function of calculating two-dimensional array, the small window size that uses in the computation process is 3*3, the contrast sensitivity initial value still is made as 150; The value of noise visibility function is multiplied each other with the value of two-dimensional array is corresponding, obtain predicting watermark.
The 3rd step, utilizing key to produce x pseudo-random sequence, is axisymmetric macro block with the sequence structure of flag bit correspondence, computing macro block and the simple crosscorrelation of predicting watermark, if the ratio of the watermark energy evolution of cross-correlation maximum and 64 * 64 sizes, illustrates watermark greater than 2 and exists; Otherwise do not exist, withdraw from.
The 4th step was axisymmetric macro block with other sequence structures, the simple crosscorrelation of computing macro block and prediction watermark respectively, and ask the maximal value of simple crosscorrelation absolute value, if should value greater than 0, decision bit is 1; Otherwise be 0; Obtain unipolarity code word " xxxxx ".
The 5th step, " xxxxx " that obtains deciphered through BCH, get data " 12345 " to the end.
So far, described among the present invention and be used for embedding method and apparatus, and the method and apparatus by the Detection and Extraction watermark information how, thereby can effectively protect the copyright of image works with axisymmetric periodicity digital watermarking in digital picture.For those of ordinary skills, under the situation of the spirit and scope that do not break away from claims of the present invention and limited, can make various changes and distortion.