Digital watermark method based on 2DPCA
Technical field:
The invention belongs to the digital watermarking field, be specifically related to a kind of digital watermarking algorithm that can resist the local nonlinearity geometric attack based on 2DPCA.
Background technology:
What the robust digital watermark algorithm was stressed is the ability of algorithm opposing various attack, and promptly carrier is being gone through various operations (attack) consciously or unconsciously afterwards, and the watermark that wherein embeds still can be extracted or detect.Aspect the research of robustness image digital watermark, the researchist successively studied filtering, add normal signal processing attack such as make an uproar; Compressions such as JPEG compression, JPEG2000 compression are attacked; Overall geometric attacks such as rotation, convergent-divergent, translation.
But in real world, usually there is the local nonlinearity geometric attack.This attack is very easy to realize with image processing software, as utilizes Photoshop just can easily realize nonlinear geometries attacks such as ripple distortion, sphere distortion, projective transformation.This attack is printing watermark again in print scanned watermark, and the field of waiting also often occurs, and carrier is through after print scanned, owing to paper changes, the unequal reason of scanner sensitization makes and has been full of local nonlinearity geometric transformation in the carrier.
Therefore studying the image digital watermark algorithm of anti-local nonlinearity geometric attack, be of great immediate significance in copyright protection, field such as print scanned for digital watermarking, is that digital watermark technology moves towards the problem that practicability must solve.
Principal component analysis (PCA), promptly PCA is a kind of feature extraction and dimension reduction method of classics, can more effective processing image in order to make it, the researchist has proposed two-dimentional principal component analysis (PCA), i.e. 2DPCA, this method can extract the major component of image.
Because image is after having suffered the local nonlinearity geometric attack; The substance of image does not change; Be that the main contents that image shows do not change, so the 2DPCA principal component transform of image is little, still adopt 2DPCA method opposing local nonlinearity geometric attack.
Summary of the invention:
The research purpose of this patent is, studies a kind of digital watermarking algorithm, can effectively resist all kinds of nonlinear geometries and attack.
Its principle is: training image is set to by original image and original image is carried out multiple nonlinear geometry attack the image sets that the back is formed; Equal value matrix to these training images carries out eigenvalue calculation then; And then extract the eigenvectors matrix of image, thereby obtain the original image major component matrix weighed from the integral image angle.Yet also being not enough to provide, this image major component matrix can resist the characteristics of image robustness that nonlinear geometry is attacked; Because attack through different nonlinear geometries; Again image being carried out image major component matrix extracts; The image major component matrix numerical value that twice calculating produces is incomplete same, and variation has to a certain degree taken place, but the image major component matrix numerical value before and after attacking has identical trend.If this major component matrix is carried out certain conversion, like DCT, FFT etc., then can this trend be separated, carry out the watermark embedding on this basis and just can access characteristics of image with quite stable property.
The implementation process of method that this patent proposes is divided into watermark embedded part and watermark extracting part.Watermark embedded part general procedure is based on 2DPCA (two-dimentional principal component analysis (PCA)), extracts the major component of original image, and can carry out Error Correction of Coding to original watermark information.Watermark bit is embedded through in the parts of images major component matrix of frequency domain transform, and formation contains watermarking images.Watermark extracting part general procedure be to suffer that nonlinear geometry attacks contain watermarking images extract image under fire major component, the major component matrix of image is under fire carried out frequency domain transform, and according to watermark extracting Rule Extraction watermark information.
1. image pre-service
Original image is carried out various nonlinear geometry conversion (attack like ripple, extruding is attacked, and sphere is attacked, and ripples are attacked, and projection is attacked, and local rotation is attacked etc. and to be made the transform method that original image changes).And be at every turn original image is carried out the nonlinear geometry conversion, obtain the new image of a width of cloth after each conversion.
2. the characteristics of image vector matrix is extracted and the extraction of image major component matrix
Several new images that obtain with original image with through the image pre-service carry out the characteristics of image vector matrix and extract as training image, and detailed process is following:
(1) matrix with all training images adds up, and obtains the equal value matrix (averageimage) of all training images.
(2) carrying out the characteristics of image vector matrix extracts.The eigenwert of computation of mean values matrix is with all eigenwerts composition eigenvalue matrix that sorts from big to small.Obtain each eigenwert characteristic of correspondence vector, promptly each eigenwert is obtained a row proper vector.The size of all proper vectors according to the characteristic of correspondence value sorted, obtain characteristics of image vector matrix (vsort), the foundation when keeping it as watermark extracting.Extract original image according to eigenvectors matrix at last
Major component matrix (proiection).
3. original image major component matrix is handled
Original image major component matrix is to ask through eigenvectors matrix, and proper vector is to ask through eigenwert, and eigenvectors matrix is all proper vectors according to all eigenwerts of equal value matrix back gained that sorts from big to small.Therefore the different lines of original image major component matrix can reflect that the original image information of (representative) is different, and the forward more row in position reflect that the original image information of (representative) is strong more.N row in the original image major component matrix are to ask according to N row in the eigenvectors matrix; The N row are to obtain according to N eigenwert in the eigenvalue matrix in the eigenvectors matrix; Still claim that the N in the eigenvectors matrix classifies the N major component as, the N in the original image major component matrix classifies N as and draws major component.With N eigenwert in the eigenvalue matrix divided by all eigenwerts in this eigenvalue matrix add up with, be the weights of N major component reflection image information.It is converted into percentage, then is the number percent of N major component reflection image information.Relation is referring to Fig. 5 and Fig. 5 explanation between above-mentioned matrix and term definition.
How much relevant N major component reflection image information weights are with training image quantity.For same width of cloth original image, if training image is more, then along with the increase of columns, it is milder that N major component reflection image information weights successively decrease; If training image is less, then along with the increase of columns, it is more obvious that N major component reflection image information weights successively decrease.For the same major component of same width of cloth original image, the more major component reflection image information weights major component more less than training image of training image reflects that the image information weights are low.
In view of the above, can be according to image size and the watermark quantity that needs to embed, the part or all of row of choosing original image major component matrix embed as the watermark carrier matrix.If image is less, the columns of choosing is many, can improve watermark capacity, and the watermark invisibility also can be stronger, but can cause the robustness of watermark to reduce; If image is bigger, the columns of choosing is few, can reduce watermark capacity, the watermark invisibility also can be a little less than, but the robustness of watermark can be guaranteed.
But nonlinear geometry is attacked the characteristic that can change any position of image, thereby in the image major component matrix that extracts the image before and after attacking, any probabilistic change all can take place the numerical value of bits per inch certificate.If want to keep the characteristic of original image major component matrix, will analyze improvement from the overall permanence of matrix.Because the eigenvectors matrix of using when extracting image major component matrix is constant, thus even each numerical value of image major component matrix can change, but in the image major component matrix fluctuating range between data be similar to close.So draw major component for i that chooses in the original image major component matrix; The weights that are about to i different major component reflection image information add up; Wherein i is less than or equal to N, guarantees to add up and reach within 0.4 to 0.9 this scope, draws major component to this i and carries out proper transformation once more; Like discrete cosine transform (DCT) or Fourier transform (FFT); Obtain original image major component matrix and partly draw the overall quantity relation of major component, promptly based on the original image major component matrix of frequency domain, that is final watermark embeds carrier matrix (vector).
4. watermark pretreatment
The watermark information that will embed changes to binary data, in order to reduce the bit error rate, can carry out Error Correction of Coding to information, strengthens the information strength of watermark.According to the watermark carrier matrix capacity, the watermark information that change will embed, but make it to be less than or equal to the embed watermark capacity.Adopt parity check system in the instance hereinafter, also can adopt other Error Correction of Coding modes.
5. watermark embeds
Embed rule according to watermark, the watermark that obtains in the 3rd step embeds on the carrier matrix and embeds through the pseudo-watermark after the Error Correction of Coding.Adopted watermark embedding rule to embed in the instance hereinafter, but also can adopt other watermarks to embed rule based on syntactics.
6. image recovers
Behind the embed watermark; Watermark is embedded carrier matrix carry out inverse discrete cosine transform (idct) or inverse Fourier transform (ifft); And draw major component with the i in the former major component matrix and replace with watermark embedding carrier matrix; At last the transposed matrix of original image major component matrix with eigenvectors matrix multiplied each other, obtain containing the image of watermark information.
7. watermark extracting
With the eigenvectors matrix that keeps in the step 2 image through non-linear attack is carried out the computing that major component is extracted, obtain the major component matrix of image under fire.The i row of image major component matrix are under fire drawn major component carry out inverse discrete cosine transform (idct) or inverse Fourier transform (ifft), obtain the major component of image under fire matrix based on frequency domain.From the major component of image under fire matrix, extract pseudo-watermark information according to embedding the corresponding extracting mode of rule based on frequency domain with the watermark of adopting.At last pseudo-watermark information is carried out error correction decoding, extract original watermark information.
The invention characteristics:
1. the major component matrix is carried out conversion and obtain the stronger watermark embedding carrier of stability.The data of finding the major component matrix have certain fluctuating range unchangeability, and utilize this point that the major component matrix is carried out conversion, and the watermark with certain robustness that formation can embed watermark embeds carrier.
2. with the 2DPCA technology, promptly two-dimentional principal component analysis (PCA) technology is applied in the digital watermarking field.The 2DPCA technology has obtained certain application at area of pattern recognition (like face recognition technology), but in the digital watermarking field, does not still use the precedent of this technology.This method combines the 2DPCA technology with digital watermark technology, widened 2DPCA The Application of Technology scope, has also realized the opposing of in the digital watermarking nonlinear geometry being attacked.
3. proposed a kind ofly can guarantee effectively to resist the digital watermarking algorithm of nonlinear geometry attack under the prerequisite of digital watermarking robustness and invisibility.
Warp is tested, and this algorithm can effectively be resisted nonlinear geometry attack (like ripples attack, extruding attack, sphere attack, ripple attack, projection attack, rotation attack).Algorithm successfully extracts watermark information from the watermark picture that attacked by nonlinear geometry, the bit error rate has guaranteed the robustness of watermark less than 25%.After adopting this algorithm to the original image embed watermark information, to the image definition influence not quite, guaranteed the invisibility of digital watermarking.Realized having strengthened the practicality of digital watermark technology to printing the opposing that nonlinear geometry is attacked in the scanning process.
Description of drawings
Fig. 1: telescopiny
Fig. 2: image pre-service
Fig. 3: the original image major component is handled
Fig. 4: watermark pretreatment
Fig. 5: matrix relationship and the explanation of term definition relation
Fig. 1 is a telescopiny.At first image is carried out pre-service, image is carried out various nonlinear geometries attack, produce training image.The training image computation of characteristic values, and then extract eigenvectors matrix.According to the eigenvectors matrix that extracts, extract original image major component matrix, therefrom selected part row or whole row carry out frequency domain transform to it, obtain watermark and embed carrier matrix.Embed in watermark according to watermarking algorithm then and carry out the watermark embedding on the carrier matrix.After watermark embeds, watermark is embedded carrier matrix carry out inverse transformation, and replace the appropriate section in the original image major component matrix, utilize the transposed matrix reconstructed image of eigenvectors matrix, obtain the image of embed watermark.
Fig. 2 is the pretreated process of image.This process is fairly simple, original image is carried out the nonlinear geometry attack of suitable intensity and (attacks the extruding attack like ripple; Sphere is attacked, and ripples are attacked, and projection is attacked; Non-linear attack methods such as local rotation attack), obtain training image after, all images is read in.
Fig. 3 is the processing procedure of original image major component matrix.The matrix of all training images is added up, obtain the equal value matrix of all training images.According to average matrix computations eigenwert, and then extract eigenvectors matrix.Extract original image major component matrix through eigenvectors matrix, selected part row or whole row carry out frequency domain transform from original image major component matrix, obtain watermark and embed carrier matrix.
Fig. 4 is the process of watermark pretreatment.The size that embeds carrier matrix according to watermark is calculated embeddable watermark capacity, original watermark information is converted into binary format, and can carries out Error Correction of Coding to it.According to watermark capacity adjustment watermark information, guarantee to be less than or equal to watermark capacity, the accurate embedding of guarantee information through the pseudo-watermark length after the Error Correction of Coding.
Fig. 5 is matrix operation relation and the explanation of term definition relation.Derivation relation between the different matrixes that in the algorithm implementation process, relate to has been described among the figure, and has been concerned between the term that defines in the implementation process.
Embodiment
One. watermark embeds
1. image pre-service
Choose the original image of a width of cloth 400*400.Original image is carried out pre-service; Obtain the image after nonlinear geometries such as original image is attacked by ripple respectively, extruding is attacked, ripples are attacked, sphere is attacked, projection is attacked, local rotation attack are attacked, they and original image are together read in as training image.
2. the characteristics of image vector matrix is extracted and the extraction of image major component matrix
Read all training images, the matrix of all training images that add up is obtained the mean value of each pixel, i.e. the equal value matrix of all training images.
Carrying out the characteristics of image vector matrix extracts.All eigenwerts of computation of mean values matrix at first are referring to table 1 and explanation.Obtain mutually deserved proper vector according to eigenwert, and then obtain eigenvectors matrix (vsort), referring to table 2 and explanation.Utilize eigenvectors matrix that original image is carried out image major component matrix at last and extract, obtain original image major component matrix (projection), referring to table 3 and explanation.
Table 1: the eigenvalue matrix that relates in the case
Table 1 explanation: table 1 is the eigenvalue matrix that relates in the case.Eigenvalue matrix is actual to be 1 dimension matrix, but in order to show more multiple characteristic values, eigenwert has been carried out branch.The image of 400*400 has 400 eigenwerts in the case, and is limited because of the space of a whole page, only showed partial feature value in the table.It can be seen from the table the descending ordering of the eigenwert in the eigenvalue matrix.
Table 2: the eigenvectors matrix that relates in the case
Table 2 explanation: table 2 is the eigenvectors matrixs that relate in the case.N row in the table are the N major component of eigenvectors matrix.Eigenvectors matrix in the case is the two-dimensional matrix of 400*400, and is limited because of the space of a whole page, only showed the Partial Feature vector matrix.
The 1st row proper vector is obtained by the eigenwert in the eigenvalue matrix 19352081;
The 2nd row proper vector is obtained by the eigenwert in the eigenvalue matrix 9683143;
The 3rd row proper vector is obtained by the eigenwert in the eigenvalue matrix 7177435;
The rest may be inferred,
Last 1 row proper vector is obtained by the eigenwert in the eigenvalue matrix 161.24.
Table 3: the original image major component matrix that relates in the case
Table 3 explanation: table 3 is the original image major component matrixes that relate in the case.N row in the table are N and draw major component.Original image major component matrix is the 2 dimension matrixes of 400*400, and is limited because of the space of a whole page, only showed part major component matrix.Preceding 10 preceding 10 row classified as in the original image major component matrix in the table, the 12nd classifies the 201st in original image major component matrix row as, and the 14th, 15 classifies the row of the 399th, 400 in the original image major component matrix as.From table, can find the position forward more draw number of principal components according to big more, this is because the forward major component of drawing in position is to be calculated by the major component that can reflect more image information.
3. original image major component matrix is handled
Choose preceding 10 row of original image major component matrix, promptly draw major component and carry out dct transform for preceding 10 of original image major component matrix, reason is referring to table 4 and explanation.Obtain the original image major component matrix based on frequency domain, i.e. watermark embeds carrier matrix (vector).
Table 4: the major component reflection image information weights that relate in the case
Table 4 explanation: table 4 is each the major component reflection image information weights that relates in the case.Major component reflection image information weights are 1 dimension matrixes, but in order to show more multiple weighing value, weights have been carried out branch.Converting above weights into percentage, promptly is the number percent of N major component reflection image information.With preceding 10 weights additions, add up and reached 0.53 in the case, in can carrying out the weights scope that watermark embeds, so preceding 10 of choosing in the major component matrix draw major component and carry out dct transform.
0.16846 is the weights of eigenwert 19352081 reflection image informations in the table;
0.084294 be the weights of eigenwert 9683143 reflection image informations;
0.062481 be the weights of eigenwert 7177435 reflection image informations;
0.02884 be the weights of eigenwert 2623680 reaction image informations;
The rest may be inferred,
The 1/712415th, the weights of eigenwert 161.24 reflection image informations.
4. watermark pretreatment
Predetermined original watermark information is: 01011110001001010011000011100111 (32bit).Error Correction of Coding is carried out in watermark, add two check bit that equate with current location data in each back.Watermark information after the Error Correction of Coding is: 00,011,100,011,111,111,111,100,000,000,011,100,000,011,100,011,100,000,011 1111000000000000111111111000000111111111 (96bit).
5. watermark embeds
Embed carrier matrix (vector) based on the 3rd watermark that obtains of step, carry out watermark and embed, will pass through the watermark embedded images after the Error Correction of Coding by embedding rule.
6. image recovers
Watermark behind the embed watermark is embedded carrier matrix carry out inverse dct transform, referring to table 5 and explanation.Preceding 10 row of original image major component matrix are replaced with the watermark embedding carrier through inverse transformation, participate in table 6 and explanation.At last original image major component matrix multiply by the transposed matrix of eigenvectors matrix (vsort), recover image.
Table 5: what relate in the case embeds carrier through watermark after the inverse transformation
Table 5 explanation: table 5 is that watermark embeds carrier after the process inverse transformation that relates in the case.Watermark embeds the 2 dimension matrixes that carrier matrix is 400*10, and is limited because of the space of a whole page, only showed part matrix.Variation has taken place through after the inverse transformation with 10 columns values before the original image major component matrix in the watermark carrier matrix that from table, can find out embed watermark.
Table 6: the original image major component matrix after preceding 10 row that relate in the case are replaced
Table 6 and explanation: table 6 is the preceding 10 row original image major component matrixes after being replaced that relate in the case.Preceding 10 row in the table in the preceding 10 original image major component matrixes classified as after being replaced, the 201st row in the 12nd original image major component matrix classified as after being replaced, the 399th, 400 row in the 14th, the 15 original image major component matrix classified as after being replaced.Preceding 10 row of original image major component matrix that can find out this moment are identical through the watermark embedding carrier of inverse transformation with table 5, and the content after 10 row is then identical with content after the 10th row of table 3.
Two. watermark extracting
1. utilize the eigenvectors matrix that keeps in the watermark embed step 2, image major component matrix extracts to carrying out under fire through the image of attacking.
2. preceding 10 row to image major component matrix under fire carry out dct transform, obtain the image array under fire based on frequency domain.According to embedding rule, from image array under fire, extract the watermark information after the Error Correction of Coding based on frequency domain.Through error correction decoding, finally obtain original watermark information.
In above-mentioned case, original image size is 400*400, and the watermark information of embedding is 01011110001001010011000011100111, and watermark capacity is 96bit.Embed according to three kinds of different embedment strengths, the image after the embedding contrasts with former figure and changes not quite, and this watermark embedding method is described, and sentience is enough not strong.Suffer non-linear average accuracy of attacking back extraction watermark information such as ripple attack, extruding attack, ripples are attacked, sphere is attacked, projection attack, rotation attack to be respectively 80.21%; 85.42%; The overall average accuracy of 89.58% 3 kind of intensity is 85.07%, explains that watermark robustness is enough strong.
We are not to carrying out dct transform with the major component matrix yet, embed this mode and test but directly on the major component matrix, carry out watermark.Embedding information, watermark capacity, original image, the columns that relates in the test such as chooses at identical in the equal and above-mentioned case of other processes.After the watermark embedding through three kinds of intensity identical with above-mentioned case; We do not carry out non-linear attack to image as yet and promptly carry out watermark extracting; The watermark extracting accuracy of finding three kinds of intensity all is merely 50%; The non-constant of effect is directly carried out in this explanation on the major component matrix, can't effectively distinguish watermark information.