Embodiment
The embodiment of the invention provides the method that watermark embeds and detects in a kind of digital picture, in order to improve digital picture is resisted geometric attack in transmission course ability.
Referring to Fig. 1, the method for embed watermark comprises in digital picture:
Step 101: the data message that will embed generates the sub-piece of at least one watermark.
Here, the data message that needs are embedded carries out spread spectrum, generates the sub-piece of one or more watermarks.The data message that need embed can be converted to the one dimension binary bit sequence, be divided at least one section then,,, generate the corresponding sub-piece of watermark with the first flag bit sequence of setting with every section sequence.For example: the data message that needs to embed is " 101101 ", and it is divided into three sections, is " 10 ", " 11 ", " 01 ", and the first flag bit sequence is " 1111111 ", can generate three sub-pieces of watermark like this, is respectively
The embodiment of the invention, can also be according to embedded key, the data message of need embedding is converted to the watermark sequence of one dimension binary bits, then, described watermark sequence is divided at least one section sequence, with every section sequence as linear displacement feedback register (Linear Feedback Shift Register, LFSR) initial state is input among the LFSR, obtain corresponding watermark sequence to be embedded, at last, according to each watermark sequence to be embedded, and the first flag bit sequence of setting, the corresponding sub-piece of watermark generated.
Step 102: structure and the corresponding synchronization template of the sub-piece of each watermark.
Synchronization template is made up of the two-dimentional binary bits of setting, and when the sub-piece of a plurality of watermarks, the synchronization template corresponding with the sub-piece of adjacent watermark is opposite fully.For example: first synchronization template is
Second synchronization template is
Perhaps, also same synchronization template can be set.For example:
Step 103: in digital picture, determine the to be embedded zone corresponding with the sub-piece of each watermark.
Digital picture is divided at least one image subblock, and for example: digital picture has several image subblocks of 8 * 8 to form, and like this, can select the to be embedded zone corresponding with the sub-piece of each watermark in digital picture.For example: the sub-piece of above-mentioned each watermark is 3 * 3 two-dimensional matrixs, here also zone of being made up of 3 * 3 image subblocks, the zone to be embedded of Xuan Zeing.
In the embodiment of the invention, can also be according to the distribution of pixel value in each image subblock, determine the textural characteristics value of each image subblock, traversal and the corresponding image-region of the sub-piece of each watermark, calculate the sub-piece of all images in each image-region the textural characteristics value and, when calculate and greater than setting value, and this image-region and other fixed zones to be embedded determine that this image-region is zone to be embedded when non-intersect.
Step 104: obtain the ac coefficient sequence of each image subblock on dct transform domain in each zone to be embedded.
Each image subblock is carried out discrete cosine transform, and (Discrete Cosine Transform DCT), obtains the ac coefficient sequence of each image subblock on dct transform domain.
Step 105: according to each information in the sub-piece of each watermark, and the information of correspondence position in the corresponding synchronization template, revise ac coefficient corresponding in the corresponding ac coefficient sequence, realize the embedding of watermark and synchronization template.
Each information according to each synchronization template, revise the ac coefficient of first frequency range in the corresponding ac coefficient sequence, and according to each information in the sub-piece of each watermark, revise the ac coefficient of second frequency range in the corresponding ac coefficient sequence, like this, revised each ac coefficient sequence is carried out the DCT inverse transformation, can obtain the digital picture of embed watermark information and synchronization template.
In revising corresponding ac coefficient sequence before the corresponding ac coefficient, can also with the difference of odd term and even number item in each ac coefficient sequence and absolute value and the first threshold of preservation compare; When the difference of odd term and even number item in this ac coefficient sequence and absolute value during smaller or equal to described threshold value, then can be according to each information in the sub-piece of corresponding watermark, and the information of correspondence position in the corresponding synchronization template, revise ac coefficient corresponding in this ac coefficient sequence.Otherwise, do not revise ac coefficient corresponding in this ac coefficient sequence.Wherein, determine that threshold value can be definite according to DCT ac coefficient human eye vision threshold model, also can directly set.
Certainly, also can be directly according to each information in the sub-piece of each watermark, and the information of correspondence position in the corresponding synchronization template, revise ac coefficient corresponding in the corresponding ac coefficient sequence.
Wherein, revising ac coefficient corresponding in the corresponding ac coefficient sequence comprises:
With the difference of odd term on first frequency range in this ac coefficient sequence and even number item and positive negativity, compare with the positive negativity of the information of correspondence position in the corresponding synchronization template, the odd term on first frequency range in this ac coefficient sequence and the difference of even number item and positive negativity, consistent with the positive negativity of the information of correspondence position in the corresponding synchronization template, do not revise corresponding ac coefficient; When both are inconsistent, then revise in the described ac coefficient sequence ac coefficient on first frequency range, the odd term in described ac coefficient sequence on first frequency range and the difference of even number item and positive negativity, consistent with the positive negativity of the information of correspondence position in the corresponding synchronization template.Wherein, when the information in the synchronization template is " 1 ", correspond to " just ", when the information in the synchronization template is " 0 ", correspond to " bearing ".
With the difference of odd term on second frequency range in this ac coefficient sequence and even number item and positive negativity, compare with the positive negativity of the information of correspondence position in the sub-piece of corresponding watermark, when both positive negativity is consistent, do not revise corresponding ac coefficient; When both are inconsistent, then revise in the ac coefficient sequence ac coefficient on second frequency range, the difference of odd term in the ac coefficient sequence on second frequency range and even number item and positive negativity, consistent with the positive negativity of the information of correspondence position in the sub-piece of corresponding watermark.Wherein, when the information in the sub-piece of watermark is " 1 ", correspond to " just ", when the information in the sub-piece of watermark is " 0 ", correspond to " bearing ".
Revise in the ac coefficient sequence that ac coefficient comprises on first frequency range:, determine modified value according to the human vision model on the dct transform domain; Revise each ac coefficient on first frequency range according to the modified value of determining.
The process of ac coefficient such as above-mentioned similar on second frequency range has not been stated tired in the modification ac coefficient sequence.
In the above-described embodiments, after the size of the sub-piece of watermark was set, the sequencing of above-mentioned steps 101-103 can exchange.
By said method, revise ac coefficient corresponding in each ac coefficient sequence, then,, carry out the DCT inverse transformation according to revised each ac coefficient sequence, just can obtain to have embedded the digital picture of watermark information and synchronization template.
Like this, after the digital picture that has obtained embed watermark, can detect the watermark information in the digital picture.
The process that detects watermark from digital picture comprises referring to shown in Figure 2:
Step 201: the signal that obtains carrier image is carried out Autocorrelation Detection, recover original image.
Here, the signal that obtains carrier image is carried out Autocorrelation Detection, obtain the image zoom multiple and the anglec of rotation, after having obtained the image zoom multiple and the anglec of rotation, the mode that returns to original image has a variety of, for example, and the secondary linear interpolation.
Wherein, can at first carry out Autocorrelation Detection to the signal that obtains carrier image, obtain the peak distance parameter, determine the prediction watermark region according to the peak distance parameter, then, obtain parameters such as peak distance, angle according to this prediction watermark region being done Autocorrelation Detection, do affined transformation and recover original image.
Step 202: obtain the ac coefficient sequence of each image subblock on the discrete cosine transform dct transform domain in the original image.
The size of each image subblock piece of divided image big or small consistent during with embed watermark.Value to each pixel during each image subblock carries out in the original image is carried out dct transform, obtains the ac coefficient sequence of each image subblock on dct transform domain.
Step 203: according to the ac coefficient on first frequency range of each ac coefficient sequence in the described original image, and the information of each synchronization template of structure, definite embedding zone that embeds the sub-piece of each watermark.
Here, according to the difference of odd term on first frequency range of each ac coefficient sequence in the original image and even number item and positive negativity, extract corresponding informance, generation forecast watermark matrix; In described prediction watermark matrix, search the zone consistent then, determine that the corresponding image-region in zone that finds is the embedding zone that embeds the sub-piece of corresponding watermark with the information of each synchronization template.
The odd term on first frequency range of ac coefficient sequence and the difference of even number item and for timing, the information of extracting is " 1 ", when the difference of odd term on first frequency range of ac coefficient sequence and even number item and when negative, the information of extracting is " 0 ", like this, can generate the prediction watermark matrix corresponding with original image.Then, search the zone consistent, determine that the corresponding image-region in zone that finds is the embedding zone that embeds the sub-piece of corresponding watermark with the information of each synchronization template of constructing at prediction watermark matrix.
Step 204: embed the ac coefficient on the corresponding ac coefficient sequence of each image subblock second frequency range in the zone according to each, extract the information of the sub-piece of corresponding watermark.
According to each embed the odd term on the corresponding ac coefficient sequence of each image subblock second frequency range and even number item in zone difference and positive negativity, extract the information of the sub-piece of corresponding watermark.The odd term on second frequency range of ac coefficient sequence and the difference of even number item and for timing, the information of extracting is " 1 ", when the difference of odd term on second frequency range of ac coefficient sequence and even number item and when negative, the information of extraction is " 0 ", thereby forms the information of the sub-piece of each watermark.
Step 205:, obtain the watermark information that embeds according to the information of extracting the sub-piece of each watermark.
When embed watermark, the mode that the data message that need are embedded generates the sub-piece of watermark all has multiple, and therefore, corresponding basis is extracted the information of the sub-piece of each watermark, and the mode that obtains the watermark information that embeds also has multiple.Comprising:
Determine the similarity between the first zone bit sequence of the second zone bit sequence in the information of the sub-piece of watermark that extracts and setting, when the similarity of determining during greater than threshold value, information to the sub-piece of this watermark is decoded, extract the watermark sequence in the information of the sub-piece of this watermark, according to each watermark sequence, obtain corresponding watermark information at last.
In the embodiment of the invention, when generating the sub-piece of watermark,, so, can adopt quick attack (FCA) technology to decode in the embodiment of the invention based on LFSR.Correlation attack is a kind of effective attack method of stream cipher based on linear displacement feedback register (LFSR).
Here, establish known array Z=(z
1, z
2..., z
n) and unknown LFSR key sequence U=(u
1, u
2..., u
n) between satisfy Pr{z
i=u
i}=1-p, i=1 wherein, 2 ..., n. and channel bit error rate p<0.5.
It is exactly this relevance of utilizing sequence Z and U that fast correlation is attacked, and the initial state with the computation complexity that is significantly less than exhaustive search recovers LFSR just needs the effective watermark information that extracts in the embodiment of the invention.If the progression of LFSR is L.Know by the Shannon theorem, realize unique decoding of watermark sequence, obtain the length of sequence Z
C (p)=1+plog wherein
2P+ (1-p) log
2(1-p) be scale-of-two symmetry (Binary Symmetric Channel, BSC) capacity formula of channel.
When the length of obtaining sequence Z reaches minimum critical value
The time, then the probability of correlation attack method decoding success is near 0.5.And when length reached 2 times of minimum critical value, the probability of decoding success was near 1.
Therefore, according to the information of extracting the sub-piece of each watermark, the watermark information that obtains to embed also comprises::
Determine the similarity between the first zone bit sequence of the second zone bit sequence in the information of the sub-piece of watermark that extracts and setting, when the similarity of determining during greater than second threshold value, setting bit information in the information of the sub-piece of watermark that extracts is formed watermark initial state sequence, described watermark initial state sequence is carried out fast correlation attack decoding, obtain the initial state of corresponding LFSR, make up the initial state of every group of LFSR, obtain the watermark information that embeds.
Below in conjunction with Figure of description the embodiment of the invention is described in further detail.
Embodiment 1, and in the embodiment of the invention, the size of setting the sub-piece of watermark is 64 * 64, for the probability of the decoding success of the method for guaranteeing correlation attack near 1, here, enter length L=15 of the initial state sequence of LSFR, enter length N=482 that obtain sequence Z behind the LSFR.
Step 301: the information that reads each pixel of digital picture.
Here, two-dimensional digital image can be expressed as I (x, y).
Step 302: the textural characteristics value matrix of determining digital picture.
At first (x y), is divided into the image subblock B of polylith 8 * 8 with this two-dimensional digital image I
I, j, then,, determine the textural characteristics value matrix of each image subblock according to the distribution of pixel value in each image subblock.
Here, pixel value 0-255 is divided into 10 intervals, adds up the distribution of the value of each pixel in each image subblock, if 64 pixel values of an image subblock account for interval, this 8 * 8 image subblock B so more than 4 or 4
I, j=1, otherwise B
I, j=0.Like this, (x y) can be represented by the image texture matrix B two-dimensional digital image I.
Step 303:, determine zone to be embedded according to the textural characteristics value of digital picture.
Here, determined the size of the sub-piece of watermark of embed watermark information, for example be: 64 * 64, here, the texture matrix B of traversing graph picture is selected successively
Bigger and disjoint sub-texture matrix-block is as watermark zone to be embedded.
Step 304: the data message that will embed generates the sub-piece of at least one watermark.
With the data message of need embedding, for example: text message, bianry image etc., be converted to the one dimension binary bit sequence, can be 120 bits here; Generate a pseudo-random position sequence according to embedded key, obtain the watermark sequence S of scramble after original series is rearranged as index sequence with pseudo-random sequence.With the S segmentation, per 15 bits are one section, be input in the linear displacement feedback register as initial state, the one dimension output sequence that each initial state correspondence obtains, then, the sub-piece of watermark according to the first series arrangement generation 64 * 64, the figure place of the output sequence of general each initial state correspondence is 64 * 64 of less thaies all, and here, the figure place of output sequence is 482, therefore, fill given flag bit sequence S at vacant place, sequence end
l
Like this, can generate 8 sub-pieces of watermark successively, i.e. 8 64 * 64 two-dimensional sequences.
Step 305: structure and the corresponding synchronization template of the sub-piece of each watermark.
Here, the size of the sub-piece of each watermark is 64 * 64, and therefore, the size of corresponding synchronization template also is 64 * 64.The synchronization template that is the sub-piece correspondence of each watermark can be 64 * 64 two-dimensional sequences of a setting.And the synchronization template of two whenever adjacent sub-piece correspondences of watermark is opposite fully.Like this, be highly resistant to the attack of cutting.
For example, the synchronization template of the sub-piece correspondence of first watermark is shown in Fig. 4 (a), and then the synchronization template of the sub-piece correspondence of second watermark is shown in Fig. 4 (b).
Step 306: with the sub-piece of each watermark, and corresponding synchronization module is embedded in the watermark zone to be embedded of digital picture.
Here, 8 sub-pieces of watermark are arranged, 8 corresponding with it synchronization templates are also arranged, in above-mentioned steps 303, also selected 8 watermark zones to be embedded successively.
The sub-piece of watermark is 64 * 64 two-dimensional sequences, synchronization template also is 64 * 64 two-dimensional sequences, and watermark zone to be embedded is made of 64 * 64 image subblocks, like this, on each image subblock, embed the information of correspondence position on the synchronization template respectively, and the information of correspondence position on the sub-piece of watermark.
And each image subblock is 8 * 8 two-dimensional sequences,, at first each 8 * 8 image subblock is done dct transform here, is transformed into one-dimensional sequence D through zigzag
I, j=(d
1, d
2..., d
64), d wherein
1Be DC coefficient, d
2, d
3..., d
64It is ac coefficient.Then, with the difference of the ac coefficient odd term of each sequence and even number item and absolute value compare with the threshold value of determining, be about to
Compare with the threshold value of determining, when
During greater than threshold value, then do not revise this sequence, i.e. embed watermark information not, and synchronization template information; When
During smaller or equal to threshold value, then according to the information of the correspondence position in the sub-piece of corresponding watermark, and the information of correspondence position in the corresponding synchronization template, revise the ac coefficient of the correspondence in this sequence, realize the embedding of watermark and synchronization template.
In the embodiment of the invention, threshold value can be human eye vision threshold value T
U, v, can pass through DCT ac coefficient human eye vision threshold model, promptly formula (1) calculates acquisition.
Wherein, f
U, 0And f
0, vBe respectively the spatial frequency spatialfrequencies of the level and the vertical direction of 8 * 8DCT piecemeal.Rule of thumb, r=0.7 is set, T
Min=1.1548, K=1.728, f
Min=3.68.
Certainly, also can directly set a threshold value.
In embodiment of the invention step 306, the ac coefficient of revising the correspondence in the sequence comprises:
With the difference of odd term and even number item on sequence first frequency range and positive negativity, compare with the positive negativity of the information of correspondence position on the corresponding synchronization template, when both are consistent, do not revise the ac coefficient on this sequence first frequency range, when both are inconsistent, then revise the ac coefficient on this sequence first frequency range, on this sequence first frequency range the difference of odd term and even number item and positive negativity, consistent with the positive negativity of the information of correspondence position on the corresponding synchronization template.
Here, can be with each sequence
Positive negativity, compare with the positive negativity of the information of correspondence position on the corresponding synchronization template, be specially:
When
For on the occasion of the time, the information of correspondence position be " 1 " on this moment synchronization template, does not then revise the ac coefficient of correspondence.
When
During for negative value, the information of correspondence position is " 0 " on the synchronization template at this moment, does not then revise corresponding ac coefficient.
When
During for negative value, and be " 1 " this moment, and then according to DCT ac coefficient human eye vision sensor model, corresponding ac coefficient value is revised in circulation, until
For on the occasion of, like this, also realized embedding with the information of correspondence position on the synchronization template.
When
For on the occasion of the time, and the information of correspondence position be " 0 " on this moment synchronization template, then equally according to DCT ac coefficient human eye vision sensor model, the ac coefficient value of correspondence is revised in circulation, until
Be negative value, like this, also realized embedding the information of correspondence position on the synchronization template.
Difference and positive negativity with odd term and even number item on sequence second frequency range, compare with the positive negativity of the information of correspondence position on the sub-piece of corresponding watermark, when both are consistent, do not revise the ac coefficient on this sequence second frequency range, when both are inconsistent, then revise the ac coefficient on this sequence second frequency range, on this sequence second frequency range the difference of odd term and even number item and positive negativity, consistent with the positive negativity of the information of correspondence position on the sub-piece of corresponding watermark.
Here, can be with each sequence
Positive negativity, compare with the positive negativity of the information of correspondence position on the sub-piece of corresponding watermark, detailed process is similar to the above, just has been not repeated.
In the embodiment of the invention, can be according to DCT ac coefficient human eye vision sensor model, circulation is revised corresponding ac coefficient value and is comprised:
At first, according to DCT ac coefficient human eye vision sensor model, obtain ac coefficient modified value α.
Determined human eye vision threshold value T
U, v, then according to DCT ac coefficient human eye vision sensor model, promptly formula (2) obtains out modified value α:
Wherein, γ ∈] 0,1[, δ () they are the Kronecker function, α
T=0.649, x
0,0For entire image I (x, mean value y),
DC coefficient for the DCT frequency field of corresponding k 8 * 8 sub-pieces.
Then, revise corresponding ac coefficient value according to the modified value α that obtains.If what calculate is
Positive negativity, then can revise d
4~d
11In one or more, until amended
Positive negativity consistent with the positive negativity of information to be embedded.
According to revised each ac coefficient sequence, carry out the DCT inverse transformation, just can obtain to have embedded the digital picture of watermark information and synchronization template.
Like this, though may have only part texture region embed watermark information, do the detection and the verification that do not influence watermark like this.Because in selected 512 * 512 zones to be embedded, a lot of grain details are arranged, and wherein, the image subblock number that is higher than threshold value generally can not surpass 33% of zone to be embedded, so in such zone to be embedded, can adopt watermark spectrum spreading method based on linear shift register.Thereby guaranteed in the decoding success rate of extracting the correlation attack method of holding near 1.
And, have only the part texture area to revise, in the modification process, revise corresponding ac coefficient value by the modified value α that obtains, thereby just revise the local configuration in watermark zone to be embedded, because according to DCT ac coefficient human eye vision sensor model, obtain out modified value α, like this, the whole visual effect of amended digital picture is unconspicuous, guarantees the stability of embed watermark and the quality of image.
By said method, watermark information has been embedded digital picture suffered.Like this, after the digital picture that has obtained embed watermark, referring to Fig. 5, the process that detects watermark from digital picture is as follows, comprising:
Step 501: the signal that reads in carrier image.
Do not need original image to participate in during detection, and any any prior imformation about former figure.Carrier image may be the digital picture that suffers various geometric attacks.
Step 502: delimit the prediction watermark region.
Here, be that a pair of Fourier transform is right according to the fourier modulus of signal spectrum with its autocorrelation function, the signal that obtains carrier image is carried out fast fourier transform calculate, the autocorrelation function IFFT of prediction watermark (| IFFT (B) |
2).Wherein, expression is carried out contrary fast fourier transform to image block B, then delivery square, carry out contrary fast fourier transform on this basis again.
The range mappings of auto-correlation function value is arrived the scope of gray level image.Utilize the method for handling gray level image to extract its local peaking, calculate the distance between the peak value,, determine that then corresponding image block B has embedded periodically watermark, promptly embedded synchronization template and watermark if the high numerical value of at least one frequency occurs in the distance.Like this, be combined into the prediction watermark region with detecting the image block B that is embedded with periodically watermark.
Step 503:, do affined transformation and recover image according to the prediction watermark region is done the parameter that Autocorrelation Detection obtains.
The prediction watermark region is done Autocorrelation Detection, calculate distance and angle between the peak value, draw affine transformation parameter, according to parameter image is carried out inverse transformation then and recover original image.
Step 504: the sub-piece of prediction embed watermark zone from the original image that recovers.
Recover after the image, that just can carry out the watermark information embedded location determines that concrete operations are as follows;
The first step, according to the difference of odd term on first frequency range in the ac coefficient sequence of each image subblock and even number item and positive negativity, extract corresponding information, generation forecast watermark matrix.
According to the embedded mode of above-mentioned synchronization template, according to
Positive negativity information " 0 " or " 1 " of extracting synchronization template.With its predicted composition watermark matrix.
In second step, embed in the zone feature that synchronization template is opposite, definite zone that embeds the sub-piece of each watermark according to adjacent two.
In prediction watermark matrix, search the zone consistent, determine that the corresponding image-region in zone that finds is the embedding zone that embeds the sub-piece of corresponding watermark with the information of each synchronization template.In each matrix, calculate the degree of correlation by two class embedded templates traversal, when two 512 * 512 prediction watermark region were adjacent, the synchronization template of embedding was separate, can determine that these two 512 * 512 prediction watermark region are the sub-piece of embed watermark zone.Like this, can dope the sub-piece of the watermark zone of carrier image after the arbitrary proportion cutting, guarantee the synchronism again that the DCT frequency field is calculated.
Step 505: go into according to the sub-piece of each water mark inlaying the odd term on second frequency range and even number item in the ac coefficient sequence of each image subblock correspondence in the zone difference and positive negativity, extract the information of the sub-piece of corresponding watermark, i.e. watermark initial state sequence.
On each 512 * 512 embedding zone, carry out the dct transform of 8 * 8 piecemeals, by
Positive negativity extract corresponding watermark information " 0 " or " 1 ", form watermark initial state sequence.
Step 506: the information of extracting the sub-piece of each watermark is carried out fast correlation attack, obtain the watermark information that embeds.
To comprise in the watermark initial state sequence of extracting in the step 505: zone bit sequence S '
l, calculate S '
lDuring about embed watermark, the S of setting
lBetween similarity, if similarity between the two greater than threshold value, is then formed every setting bit one group of watermark initial state sequence U.Here be that per 482 bits are formed one group of watermark initial state sequence U
At given U is carried out Fast W alsh conversion, carry out fast correlation and attack decoding.It is following process that fast correlation is attacked, possible by the institute of enumerating x, finds out the sequence that satisfies such condition
With
If F
0(u ')-f
0(u ")>Th then obtains preceding 8 bits of this group U, calculates F again
7(u) back 8 bits that promptly should group U, whether back 8 bits of acquisition U after by identical search procedure overlap the decoding correctness that decides about this group U according to overlapping one again.Promptly have one to be overlapping, then the decoding about U is correct, has obtained the initial state of one group of LFSR of 15 bits like this.
Wherein Th is a preset threshold, chooses Th=10 in the invention process.
Like this, splice the initial state of one group of LFSR after, in like manner extract other initial state, finally obtain the valid data of watermark.
According to the method that watermark in the above-mentioned digital picture embeds, can construct the device that watermark embeds in a kind of digital picture, referring to Fig. 6, comprising: generation unit 610, determining unit 620, acquiring unit 630 and embedding unit 640.Wherein,
Generation unit 610 is used for the data message that need embed is generated the sub-piece of at least one watermark, and structure and the corresponding synchronization template of the sub-piece of each watermark.
Determining unit 620 is used for determining and the corresponding zone to be embedded of the sub-piece of described each watermark in described digital picture.
Acquiring unit 630 is used for obtaining the ac coefficient sequence of each each image subblock of zone to be embedded on the discrete cosine transform dct transform domain.
Embed unit 640, be used for each information according to the sub-piece of each watermark, and the information of correspondence position in the corresponding synchronization template, revise ac coefficient corresponding in the corresponding ac coefficient sequence, realize the embedding of watermark and synchronization template.
Generation unit 610 can comprise: conversion subelement, acquisition subelement and generation subelement.
The conversion subelement is used for according to embedded key, the data message of need embedding is converted to the watermark sequence of one dimension binary bits.
Obtain subelement, be used for described watermark sequence is divided at least one section sequence, the initial state of every section sequence as linear displacement feedback register LFSR is input among the LFSR, obtain corresponding watermark sequence to be embedded.
Generate subelement, be used for according to each watermark sequence to be embedded, and the first flag bit sequence of setting, the corresponding sub-piece of watermark generated.
Determining unit 620 can comprise: eigenwert subelement and regional subelement to be embedded.
The eigenwert subelement is used for the distribution according to pixel value in each image subblock of described digital picture, determines the textural characteristics value of each image subblock.
Regional subelement to be embedded, be used to travel through and the corresponding image-region of the sub-piece of each watermark, calculate the sub-piece of all images in each image-region the textural characteristics value and, when calculate and greater than setting value, and when this image-region and other fixed zones to be embedded are non-intersect, determine that this image-region is zone to be embedded.
In the embodiment of the invention, this device also comprises: comparing unit, be used for the difference of described ac coefficient sequence odd term and even number item and absolute value and the first threshold of setting compare.
Like this, when the difference of odd term and even number item in the described ac coefficient sequence and absolute value during less than the first threshold of preserving, can be according to each information in the sub-piece of each watermark, and the information of correspondence position in the corresponding synchronization template, revise ac coefficient corresponding in the corresponding ac coefficient sequence.
Embedding unit 640 comprises: first revises subelement and second revises subelement.
First revises subelement, be used for odd term on described ac coefficient sequence first frequency range and even number item difference and positive negativity, inconsistent with the positive negativity of the information of correspondence position in the corresponding synchronization template, revise in the described ac coefficient sequence ac coefficient on first frequency range, the odd term in described ac coefficient sequence on first frequency range and the difference of even number item and positive negativity, consistent with the positive negativity of the information of correspondence position in the corresponding synchronization template.
Second revises subelement, be used for odd term on described ac coefficient sequence second frequency range and even number item difference and positive negativity, inconsistent with the positive negativity of the information of correspondence position in the sub-piece of corresponding watermark, revise in the described ac coefficient sequence ac coefficient on second frequency range, the odd term in described ac coefficient sequence on second frequency range and the difference of even number item and positive negativity, consistent with the positive negativity of the information of correspondence position in the sub-piece of corresponding watermark.
The first modification subelement or second is revised subelement can also determine modified value according to according to the human vision model on the dct transform domain; According to each ac coefficient on modified value modification first or second frequency range of determining.
According to the method for watermark detection in the above-mentioned digital picture, can construct the device of watermark detection in a kind of digital picture, referring to Fig. 7, comprising: recovery unit 710, acquiring unit 720, determining unit 730, extraction unit 740 and decoding unit 750.Wherein,
Recovery unit 710 is used for the signal that obtains carrier image is carried out Autocorrelation Detection, recovers original image.
Acquiring unit 720 is used for obtaining the ac coefficient sequence of each image subblock of described original image on the discrete cosine transform dct transform domain.
Determining unit 730 is used for according to the ac coefficient on first frequency range of each ac coefficient sequence of described original image, and the information of each synchronization template of structure, determines to embed the embedding zone of the sub-piece of each watermark.
Extraction unit 740 is used for extracting the information of the sub-piece of corresponding watermark according to the ac coefficient on the corresponding ac coefficient sequence of each each image subblock of embedding zone second frequency range.
Decoding unit 750 is used for obtaining the watermark information that embeds according to the information of extracting the sub-piece of each watermark.
Wherein, determining unit 730 comprises: generate subelement and coupling subelement.
Generate subelement, be used for according to the difference of the odd term on first frequency range of each ac coefficient sequence of original image and even number item and positive negativity, extraction corresponding informance, generation forecast watermark matrix.
The coupling subelement is used for searching the zone consistent with the information of each synchronization template at described prediction watermark matrix, determines that the corresponding image-region in zone that finds is the embedding zone that embeds the sub-piece of corresponding watermark.
Here, extraction unit 740 according to each embed the odd term on the corresponding ac coefficient sequence of each image subblock second frequency range and even number item in zone difference and positive negativity, extract the information of the sub-piece of corresponding watermark.The odd term on second frequency range of ac coefficient sequence and the difference of even number item and for timing, the information of extracting is " 1 ", when the difference of odd term on second frequency range of ac coefficient sequence and even number item and when negative, the information of extraction is " 0 ", thereby forms the information of the sub-piece of each watermark.
And decoding unit 750 comprises: determine subelement, extraction subelement, initial state subelement and combination subelement.
Determine subelement, be used for determining the similarity between the first zone bit sequence of the second zone bit sequence of information of the sub-piece of watermark that extracts and setting.
Extract subelement, be used for, with the setting bit information composition watermark initial state sequence in the information of the sub-piece of watermark that extracts when the similarity of determining during greater than second threshold value.
The initial state subelement is used for that described watermark initial state sequence is carried out fast correlation and attacks decoding, obtains the initial state of corresponding LFSR.
The combination subelement, the initial state that is used to make up every group of LFSR obtains the watermark information that embeds.
In sum, in the embodiment of the invention, determine zone to be embedded based on the image texture of pixels statistics, processing speed and efficient are very fast.Simultaneously, adopt linear feedback shift register to generate watermark sequence to be embedded, the serious forgiveness that watermark information extracts is below 33%, and, in telescopiny, can take the mode do not handled, thereby guarantee the visual effect of watermarking images subregion or part details area.When detecting the watermark information of digital picture; do not need the participation of original image; the synchronization watermarking embedding is regional again by synchronization template information; extract the watermark information of many bits by the fast correlation attack method; effectively resisted the cutting of arbitrary proportion and attacked and other combination attacks, thus more efficiently everyone rights and interests of having protected the digital picture works.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.