CN112767227A - Image watermarking method capable of resisting screen shooting - Google Patents
Image watermarking method capable of resisting screen shooting Download PDFInfo
- Publication number
- CN112767227A CN112767227A CN202110271166.7A CN202110271166A CN112767227A CN 112767227 A CN112767227 A CN 112767227A CN 202110271166 A CN202110271166 A CN 202110271166A CN 112767227 A CN112767227 A CN 112767227A
- Authority
- CN
- China
- Prior art keywords
- image
- watermark
- embedding
- matrix
- screen
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 238000000605 extraction Methods 0.000 claims abstract description 50
- 230000008569 process Effects 0.000 claims abstract description 37
- 238000012937 correction Methods 0.000 claims abstract description 17
- 239000011159 matrix material Substances 0.000 claims description 59
- 238000001228 spectrum Methods 0.000 claims description 49
- 238000013507 mapping Methods 0.000 claims description 11
- 239000000654 additive Substances 0.000 claims description 8
- 230000000996 additive effect Effects 0.000 claims description 8
- 230000009466 transformation Effects 0.000 claims description 7
- 238000001914 filtration Methods 0.000 claims description 5
- 230000000877 morphologic effect Effects 0.000 claims description 5
- 230000001360 synchronised effect Effects 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000011156 evaluation Methods 0.000 claims description 3
- 238000000819 phase cycle Methods 0.000 claims description 3
- 238000004364 calculation method Methods 0.000 claims description 2
- 238000012935 Averaging Methods 0.000 claims 1
- 241000638935 Senecio crassissimus Species 0.000 claims 1
- 238000001514 detection method Methods 0.000 description 4
- 239000000284 extract Substances 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000013519 translation Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000005311 autocorrelation function Methods 0.000 description 1
- 230000003796 beauty Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/0021—Image watermarking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2201/00—General purpose image data processing
- G06T2201/005—Image watermarking
- G06T2201/0065—Extraction of an embedded watermark; Reliable detection
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Editing Of Facsimile Originals (AREA)
- Image Processing (AREA)
Abstract
本发明提出一种可抗屏幕拍摄的图像水印方法,解决了现有图像水印方法不利于水印有效提取的问题,所述方法包括水印嵌入过程与水印提取过程,所述水印嵌入过程将水印嵌入宿主图像,水印提取过程基于所述水印嵌入过程,对已嵌入水印且经屏幕拍摄的宿主图像进行透视矫正后,进行水印提取操作,提取宿主图像已嵌入的水印信息,保证了水印提取信息的有效性。
The present invention provides an image watermarking method that is resistant to screen shooting, and solves the problem that the existing image watermarking method is not conducive to effective watermark extraction. The method includes a watermark embedding process and a watermark extraction process, and the watermark embedding process embeds the watermark into the host. Image, the watermark extraction process is based on the watermark embedding process. After the perspective correction is performed on the host image that has been embedded in the watermark and captured by the screen, the watermark extraction operation is performed to extract the embedded watermark information of the host image, which ensures the validity of the watermark extraction information. .
Description
技术领域technical field
本发明涉及图像认证的技术领域,更具体地,涉及一种可抗屏幕拍摄的图像水印方法。The present invention relates to the technical field of image authentication, and more particularly, to an image watermarking method that is resistant to screen shooting.
背景技术Background technique
数字水印是一种将特定的信息嵌入信息载体中的技术,所嵌入的信息称为水印,被嵌入水印的信息载体称为水印载体。通过在数字图像、电子文档等作品中嵌入标识版权方的水印信息实现版权保护,当作品在公开环境中出现版权纠纷时,版权方可从盗版作品中提取水印信息作为鉴定盗版侵权的凭证,从而保护其自身利益。通常为了同步信息水印的提取检测,还嵌入一个用于同步的伪随机序列,称为模板水印。Digital watermarking is a technology that embeds specific information into an information carrier, the embedded information is called a watermark, and the information carrier embedded with the watermark is called a watermark carrier. Copyright protection is achieved by embedding watermark information identifying the copyright owner in works such as digital images and electronic documents. When a copyright dispute occurs in a work in an open environment, the copyright owner can extract the watermark information from the pirated work as a certificate to identify the pirated copyright infringement. protect its own interests. Usually, for the extraction and detection of synchronization information watermark, a pseudo-random sequence for synchronization is also embedded, which is called template watermark.
尽管现阶段图像水印技术在数字化处理过程中可以获得很好的效果,但是在实际应用场景中,水印图像可能不是可直接获取的数字电子图像,而是利用智能手机来拍摄水印图像获取的照片,这主要是因为智能手机具有易于携带、拍照速度快、拍照角度灵活等优势。然而,由于手机拍摄的水印图像通常会有变形,导致直接对手机拍摄图片进行水印检测的难度较大。实际应用中,手机拍摄的角度与拍摄平面难以保证平行,所以成像过程中会引入透视投影变形,这阻碍了水印的检测和提取,甚至使水印检测提取失败,因此需要嵌入的数字水印要有对抗屏幕拍摄以及几何变换的稳健性。Although the current image watermarking technology can achieve good results in the process of digital processing, in practical application scenarios, the watermarked image may not be a digital electronic image that can be directly obtained, but a photo obtained by using a smartphone to shoot the watermarked image. This is mainly because smartphones have the advantages of being easy to carry, fast in taking pictures, and flexible in taking pictures. However, because the watermark images captured by mobile phones are usually deformed, it is difficult to directly perform watermark detection on pictures captured by mobile phones. In practical applications, it is difficult to ensure that the angle taken by the mobile phone is parallel to the shooting plane, so perspective projection deformation will be introduced in the imaging process, which hinders the detection and extraction of watermarks, and even makes the detection and extraction of watermarks fail. Therefore, the embedded digital watermark must be confronted. Screen shots as well as robustness to geometric transformations.
2012年,A.Pramila,A.Keskinarkaus and T.等人在Signal ImageVideo Process中发表了“Toward an interactive poster using digital watermarkingand a mobile phone camera”的文章,文章中提出在纸质印刷品中嵌入水印,并利用手机拍摄提取水印信息的方法,嵌入算法中主要分为载体图像处理和秘密信息处理两个过程,其中,载体图像处理包括了维纳滤波、对图像和JND图像进行分块处理;秘密信息处理过程包括对信息进行汉明编码,将信息以4个比特长度进行拆分,4个比特表示一个角度,按照角度对原始伪随机图进行旋转,根据设计的水印嵌入公式将旋转后的伪随机图嵌入到图像块中,最终得到水印图像。在提取水印信息时,左上角的图像块作为同步块,对每个图像块计算自相关函数并检验自相关峰值的排列,估计角度提取水印信息。该文献提出的水印方法在打印拍摄场景下具有一定的可行性,但是对拍摄的距离有较大的限制,不利于水印的有效提取。2019年,H.Fang,W.Zhang,H.Zhou,H.Cui and N.Yu等人在IEEETrans.Inf.Forensics Security中发表“Screen-Shooting Resilient Watermarking”的文章,该文章中提出了一种抗屏摄水印算法,利用强度的尺度不变特征变换算法来定位特征区域,并在相关区域的离散余弦系数(DCT)中进行水印的嵌入和提取。该方法在应用的过程中给水印图像加上可见的特制边框,便于在屏幕拍摄时准确地定位到目标图像的位置信息,进行透视矫正,虽然具有较好的抗屏摄性能,但是该方法采用的加特制边框操作,在一定程度上影响了图像的美观而限制了算法的应用,并且边框容易遭受破坏,使得后续的水印提取失败。In 2012, A. Pramila, A. Keskinarkaus and T. et al. published the article "Toward an interactive poster using digital watermarking and a mobile phone camera" in Signal ImageVideo Process. The article proposes to embed watermarks in paper prints and use mobile phone photography to extract watermark information. In the embedding algorithm, the main It is divided into two processes: carrier image processing and secret information processing. Among them, the carrier image processing includes Wiener filtering and block processing of images and JND images; The original pseudo-random image is rotated according to the angle, and the rotated pseudo-random image is embedded into the image block according to the designed watermark embedding formula, and finally the watermark image is obtained. When extracting the watermark information, the image block in the upper left corner is used as the synchronization block, and the autocorrelation function is calculated for each image block and the arrangement of the autocorrelation peak value is checked, and the watermark information is extracted by estimating the angle. The watermarking method proposed in this document has certain feasibility in printing and shooting scenarios, but has a large limitation on the shooting distance, which is not conducive to the effective extraction of watermarks. In 2019, H.Fang, W.Zhang, H.Zhou, H.Cui and N.Yu et al. published the article "Screen-Shooting Resilient Watermarking" in IEEETrans.Inf.Forensics Security, which proposed a The anti-screening watermarking algorithm uses the intensity scale-invariant feature transformation algorithm to locate the feature area, and embeds and extracts the watermark in the discrete cosine coefficient (DCT) of the relevant area. This method adds a visible special frame to the watermark image in the process of application, which is convenient for accurately locating the position information of the target image and performing perspective correction when shooting on the screen. Although it has good anti-screen shooting performance, this method adopts The operation of adding a special border to a certain extent affects the beauty of the image and limits the application of the algorithm, and the border is easily damaged, which makes the subsequent watermark extraction fail.
发明内容SUMMARY OF THE INVENTION
为解决现有图像水印方法不利于水印有效提取的问题,本发明提出一种可抗屏幕拍摄的图像水印方法,可靠性高,保证水印提取信息的有效性。In order to solve the problem that the existing image watermarking method is not conducive to effective watermark extraction, the present invention proposes an image watermarking method that is resistant to screen shooting, has high reliability, and ensures the effectiveness of watermark extraction information.
为了达到上述技术效果,本发明的技术方案如下:In order to achieve above-mentioned technical effect, technical scheme of the present invention is as follows:
一种可抗屏幕拍摄的图像水印方法,所述方法包括水印嵌入过程与水印提取过程,所述水印嵌入过程将水印嵌入宿主图像,水印提取过程基于所述水印嵌入过程,对已嵌入水印且经屏幕拍摄的宿主图像进行透视矫正后,进行水印提取操作,提取宿主图像已嵌入的水印信息。An image watermarking method that is resistant to screen shooting, the method includes a watermark embedding process and a watermark extraction process, the watermark embedding process embeds the watermark into a host image, and the watermark extraction process is based on the watermark embedding process. After the perspective correction of the host image captured on the screen is performed, a watermark extraction operation is performed to extract the embedded watermark information of the host image.
在本技术方案中提出了可抗屏幕拍摄的图像水印方法,针对现有图像水印方法不利于水印有效提取的问题,提出相配合的水印嵌入过程与水印提取过程,在面对已嵌入水印且经屏幕拍摄的宿主图像的后期水印提取时,对宿主图像进行透视矫正,使得水印图像经过屏幕拍摄之后,仍然可以检测水印,保证了后续水印提取信息的有效性。In this technical solution, an image watermarking method that is resistant to screen shooting is proposed. Aiming at the problem that the existing image watermarking method is not conducive to the effective extraction of watermarks, a matching watermark embedding process and watermark extraction process are proposed. When extracting the later watermark of the host image captured on the screen, perspective correction is performed on the host image, so that the watermark can still be detected after the watermark image is captured on the screen, which ensures the validity of the subsequent watermark extraction information.
优选地,所述水印嵌入过程至少包括:Preferably, the watermark embedding process at least includes:
S1.利用密钥生成伪随机序列和模板序列,结合水印比特信息生成待嵌入的二维水印矩阵;S1. use the key to generate a pseudo-random sequence and a template sequence, and combine the watermark bit information to generate a two-dimensional watermark matrix to be embedded;
S2.确定宿主图像,对宿主图像做二维离散傅立叶变换,将变换后的直流成分平移到离散傅立叶幅度谱的中心,在傅立叶系数幅度谱的上半平面中嵌入水印,并将嵌入区域内点的坐标映射到对数极坐标上;S2. Determine the host image, perform two-dimensional discrete Fourier transform on the host image, translate the transformed DC component to the center of the discrete Fourier amplitude spectrum, embed a watermark in the upper half plane of the Fourier coefficient amplitude spectrum, and embed the points in the region The coordinates are mapped to log polar coordinates;
S3.将对数极坐标作为二维水印矩阵的坐标,在具有相同对数极坐标的傅立叶系数中嵌入相同的水印比特信息;S3. The log-polar coordinates are used as the coordinates of the two-dimensional watermark matrix, and the same watermark bit information is embedded in the Fourier coefficients with the same log-polar coordinates;
S4.由于傅里叶幅度谱具有中心对称性,将上半平面的对应系数复制到下半平面,然后对嵌入水印比特信息后的傅立叶系数进行逆傅立叶变换,得到含水印的图像。S4. Since the Fourier amplitude spectrum has center symmetry, the corresponding coefficients of the upper half plane are copied to the lower half plane, and then the inverse Fourier transform is performed on the Fourier coefficients after embedding the watermark bit information to obtain the watermarked image.
优选地,所述水印提取过程至少包括:Preferably, the watermark extraction process at least includes:
SA.对经屏幕拍摄且已嵌入水印的宿主图像进行透视矫正,裁剪出目标图像区域作为待测图像;SA. Perform perspective correction on the host image captured by the screen and embedded with the watermark, and crop out the target image area as the image to be measured;
SB.对待测图像做二维离散傅立叶变换,将变换后的直流成分平移到离散傅立叶幅度谱中心,以离散傅立叶幅度谱中心作为直角坐标系的原点,在傅立叶系数幅度谱的上半平面中提取水印,将提取范围内幅度系数的直角坐标映射到对数极坐标上;SB. Do a two-dimensional discrete Fourier transform on the image to be measured, translate the transformed DC component to the center of the discrete Fourier amplitude spectrum, take the center of the discrete Fourier amplitude spectrum as the origin of the rectangular coordinate system, and extract it from the upper half plane of the Fourier coefficient amplitude spectrum. Watermark, which maps the rectangular coordinates of the amplitude coefficients in the extraction range to the log polar coordinates;
SC.计算一个二维傅立叶系数幅度矩阵:对经过映射后拥有相同对数极坐标的幅度系数求均值,将其作为二维傅立叶系数幅度矩阵的一个元素;SC. Calculate a two-dimensional Fourier coefficient magnitude matrix: average the magnitude coefficients that have the same log-polar coordinates after mapping, and use it as an element of the two-dimensional Fourier coefficient magnitude matrix;
SD.根据相位相关原理,将原始模板与傅立叶系数幅度矩阵进行快速匹配计算,根据最大相关值的坐标位置,确定水印矩阵在二维傅立叶系数幅度矩阵中的位置,得到与嵌入水印同步的幅度矩阵;SD. According to the principle of phase correlation, the original template and the Fourier coefficient amplitude matrix are quickly matched and calculated, and the position of the watermark matrix in the two-dimensional Fourier coefficient amplitude matrix is determined according to the coordinate position of the maximum correlation value, and the amplitude matrix synchronized with the embedded watermark is obtained. ;
SE.利用伪随机序列对幅度矩阵进行解扩频调制,提取到水印信息。SE. The amplitude matrix is despread and modulated with a pseudo-random sequence, and the watermark information is extracted.
优选地,步骤S1中所述结合水印比特信息生成待嵌入的二维水印矩阵的过程为:Preferably, the process of generating the two-dimensional watermark matrix to be embedded in combination with the watermark bit information in step S1 is as follows:
S101.设密钥为key,利用密钥key生成长度为Sg的双极性伪随机序列g={gi;1≤i≤Sg,gi∈{-1,1}}和长度为Sz的模板序列Z={Zi;1≤i≤Sz,Zi∈{-1,1}},gi、Zi分别表示双极性伪随机序列的第i个元素、模板序列的第i个元素;S101. Let the key be key, and use the key key to generate a bipolar pseudo-random sequence g={g i with length S g ; 1≤i≤S g , g i ∈ {-1,1}} and the length is The template sequence of S z Z={Z i ; 1≤i≤S z , Z i ∈{-1,1}}, g i and Z i represent the i-th element of the bipolar pseudo-random sequence, the template sequence, respectively the ith element of ;
S102.设水印比特信息的序列表示为b={bi;1≤i≤Sb,bi∈{0,1}},对序列b中的每一比特进行扩频调制:若bi为“1”,则扩频调制为g的同相序列,得到扩频序列Wi={wij;wij∈{-1,+1},1≤j≤Sg}=+1×g;若bi为“0”,则扩频调制为g的反相序列,即Wi=-1×g,得到水印信息数组W={Wi;1≤i≤Sb};S102. Set the sequence of watermark bit information as b={b i ; 1≤i≤S b , b i ∈ {0,1}}, perform spread spectrum modulation on each bit in sequence b: if b i is "1", the spread spectrum modulation is the in-phase sequence of g, and the spread spectrum sequence W i ={w ij ; w ij ∈{-1,+1}, 1≤j≤S g }=+1×g; if b i is "0", then the spread spectrum modulation is the inverse sequence of g, that is, W i =-1×g, and the watermark information array W={W i ; 1≤i≤S b };
S103.将水印信息数组W和模板序列Z按列顺序排成一个H行C列的二维水印矩阵WZ={wz(h,c);0≤h<H,0≤c<C}。S103. Arrange the watermark information array W and the template sequence Z into a two-dimensional watermark matrix WZ={wz(h,c); 0≤h<H, 0≤c<C} with H rows and C columns in column order.
优选地,在二维水印矩阵WZ={wz(h,c);0≤h<H,0≤c<C}的元素wz(h,c)由双极性比特“1”和“-1”构成,二维水印矩阵生成后,模板序列Z按列顺序存放在二维水印矩阵WZ的相邻列中,构成原始模板Zb,使得每个有意义水印比特信息调制生成的扩频序列占用二维水印矩阵WZ的相邻若干列。Preferably, the element wz(h,c) of the two-dimensional watermark matrix WZ={wz(h,c); 0≤h<H, 0≤c<C} consists of bipolar bits "1" and "-1" After the two-dimensional watermark matrix is generated, the template sequence Z is stored in the adjacent columns of the two-dimensional watermark matrix WZ in column order to form the original template Z b , so that the spread spectrum sequence generated by the modulation of each meaningful watermark bit information occupies Adjacent columns of the two-dimensional watermark matrix WZ.
优选地,步骤S2中,宿主图像的确定过程包括:当原始图像为彩色图像时,原始图像转换到YCbCr色彩空间,选择Y通道图像作为宿主图像;当原始图像为灰度图像时,不作转换,直接作为宿主图像。Preferably, in step S2, the process of determining the host image includes: when the original image is a color image, the original image is converted to the YCbCr color space, and the Y channel image is selected as the host image; when the original image is a grayscale image, no conversion is performed, directly as the host image.
优选地,步骤S2中,宿主图像做l×l的二维离散傅立叶变换,l=max(ly,lx),ly和lx分别表示宿主图像的长和宽,变换后的直流成分平移到离散傅立叶幅度谱的中心,离散傅立叶幅度谱的中心作为直角坐标系的原点,嵌入区域位于傅立叶系数幅度谱的归一化频率值为fn的中频附近,所述将嵌入区域内点的坐标映射到对数极坐标上的过程为:嵌入区域的傅立叶系数的直角坐标(u,v)或者极坐标(ρ,θ)变换成离散对数极坐标(α,β),变换公式为:Preferably, in step S2, the host image is subjected to l×l two-dimensional discrete Fourier transform, l=max(l y , l x ), ly and l x represent the length and width of the host image, respectively, and the transformed DC component Translate to the center of the discrete Fourier amplitude spectrum, the center of the discrete Fourier amplitude spectrum is used as the origin of the rectangular coordinate system, and the embedding area is located near the intermediate frequency where the normalized frequency value of the Fourier coefficient amplitude spectrum is f n . The process of mapping coordinates to log-polar coordinates is: the rectangular coordinates (u, v) or polar coordinates (ρ, θ) of the Fourier coefficients of the embedded region are transformed into discrete log-polar coordinates (α, β), and the transformation formula is:
D=fn×lD= fn ×l
a-H/2×D≤ρ<aH/2×Da -H/2 ×D≤ρ<a H/2 ×D
其中,a表示一个大于1且接近于1的常数,a=21/H,ρ表示极径,表示该幅值点到对应于傅立叶幅度谱中心点的距离,θ表示傅立叶系数在极坐标中的角度,θ=arctan(u/v);在傅立叶系数的中低频区域嵌入水印,D取为傅立叶变换归一化频率值为fn的中频附近,fn的取值在0.15~0.25之间;Q表示保证α≥0的偏移常数;floor()函数表示向下取整函数,平衡水印的鲁棒性和不可见性。Among them, a represents a constant greater than 1 and close to 1, a=2 1/H , ρ represents the polar diameter, which represents the distance from the amplitude point to the center point corresponding to the Fourier amplitude spectrum, θ represents the angle of the Fourier coefficient in polar coordinates, θ=arctan(u/v); the watermark is embedded in the mid-low frequency region of the Fourier coefficient, D is taken as the Fourier transform normalized frequency value near the intermediate frequency of f n , f n The value is between 0.15 and 0.25; Q represents the offset constant that guarantees α≥0; the floor() function represents the round-down function to balance the robustness and invisibility of the watermark.
优选地,极径ρ满足:Preferably, the polar diameter ρ satisfies:
a-H/2×D≤ρ<aH/2×Da -H/2 ×D≤ρ<a H/2 ×D
对应直角坐标系中水印嵌入区域是个环形,离散对数极坐标(α,β)的坐标范围满足:The watermark embedding area in the corresponding rectangular coordinate system is a ring, and the coordinate range of discrete log polar coordinates (α, β) satisfies:
0≤α<H,0≤β<C;0≤α<H, 0≤β<C;
根据加性嵌入公式或乘性嵌入公式嵌入水印,其中,加性嵌入公式为:Embed the watermark according to the additive embedding formula or the multiplicative embedding formula, where the additive embedding formula is:
c(u,v)=c(u,v)+σ×wz(α,β)c(u,v)=c(u,v)+σ×wz(α,β)
乘性嵌入公式为:The multiplicative embedding formula is:
c(u,v)=c(u,v)×(I+σ×wz(α,β));c(u,v)=c(u,v)×(I+σ×wz(α,β));
步骤S4中所述对嵌入水印比特信息后的傅立叶系数进行逆傅立叶变换时,当原始图像是彩色图像时,需将YCbCr空间的Y通道替换成嵌有水印的图像,并变换到RGB彩色空间。When performing inverse Fourier transform on the Fourier coefficients after embedding the watermark bit information in step S4, when the original image is a color image, it is necessary to replace the Y channel of the YCbCr space with an image embedded with a watermark, and transform it into the RGB color space.
在此,通过加性嵌入公式或乘性嵌入公式嵌入水印不需要对提箱的傅里叶系数进行内插运算,消除了图像内插插值失真的缺陷,在傅立叶幅度谱的下半平面根据傅立叶变换关于幅度谱中心直流成分点的对称处,可对称嵌入相同的水印。Here, embedding the watermark through the additive embedding formula or the multiplicative embedding formula does not require interpolation of the Fourier coefficients of the box, which eliminates the defect of image interpolation distortion. The same watermark can be embedded symmetrically about the symmetry of the DC component point in the center of the amplitude spectrum.
优选地,步骤SA中所述对经屏幕拍摄且已嵌入水印的宿主图像进行透视矫正的过程为:Preferably, the process of performing perspective correction on the host image captured by the screen and embedded with the watermark described in step SA is:
SA01.设经屏幕拍摄且已嵌入水印的宿主图像为I0,将I0转换为灰度图像,对灰度图像进行高斯滤波得到图像I1;SA01. Set the host image captured by the screen and embedded with the watermark as I 0 , convert I 0 into a grayscale image, and perform Gaussian filtering on the grayscale image to obtain an image I 1 ;
SA02.采用Sobel算法检测图像I1边缘,得到边缘点图像I2;SA02. Adopt the Sobel algorithm to detect the edge of the image I 1 to obtain the edge point image I 2 ;
SA03.对图像I2进行形态学闭运算,得到图像I3,从图像I3中删除小于P的连通分量,生成二值图像I4,P表示一个被删除连通分量的像素评价阈值;SA03. Carry out morphological closing operation on image I 2 to obtain image I 3 , delete connected components less than P from image I 3 , generate binary image I 4 , and P represents a pixel evaluation threshold of deleted connected components;
SA04.设目标图像为I′,跟踪二值图像I4中对象的外边界区域,将最大的连通区域作为目标图像I′的轮廓,计算包含图像I′轮廓的最小多边形凸包,得到多边形凸包的顶点集合points;SA04. Set the target image as I', track the outer boundary area of the object in the binary image I 4 , take the largest connected area as the contour of the target image I', calculate the minimum polygonal convex hull containing the contour of the image I', and obtain the polygonal convexity package's vertex collection points;
SA05.计算目标图像I′的边缘直线:按逆时针顺序遍历多边形凸包的顶点集合points,每两个点确定一条直线,角度相近的两条线段中选取长度最大的计算其参数表达式,得到一系列直线;当直线数量大于4时,删除与相邻两条直线夹角过大的直线;SA05. Calculate the edge straight line of the target image I': traverse the vertex set points of the polygonal convex hull in a counterclockwise order, determine a straight line for every two points, select the longest length of the two line segments with similar angles to calculate its parameter expression, and obtain A series of straight lines; when the number of straight lines is greater than 4, delete the lines with too large angle with the two adjacent straight lines;
SA06.计算目标图像I′的四个顶点:确认四条直线的交点,得到目标图像I′的顶点集合vecs;当顶点坐标超出宿主图像I0的范围时,水印图像经屏幕拍摄的不完整,将宿主图像I0范围外的内容进行补0填充;SA06. Calculate the four vertices of the target image I': confirm the intersection of the four straight lines, and obtain the vertex set vecs of the target image I'; when the vertex coordinates are beyond the range of the host image I 0 , the watermark image is incomplete through the screen shot, and the The content outside the range of the host image I 0 is filled with 0;
SA07.设目标图像I′的最小边长为Lm,根据顶点集合vecs和Lm对宿主图像I0进行透视矫正,将变换后的目标图像裁剪出来,得到图像Inew。SA07. Set the minimum side length of the target image I' as L m , perform perspective correction on the host image I 0 according to the vertex sets vecs and L m , and cut out the transformed target image to obtain the image I new .
在此,步骤SA01中,对灰度图像进行高斯滤波可以削弱摩尔纹噪声对后续操作的影响,步骤SA03中,对图像I2进行形态学闭运算可以增加图像边缘的连续性,另外P表示一个相对较小的值,步骤SA04中,计算包含图像I′轮廓的最小多边形凸包可以减少对轮廓完整且连续的依赖性。Here, in step SA01, performing Gaussian filtering on the grayscale image can weaken the influence of moiré noise on subsequent operations. In step SA03, performing morphological closing operation on the image I 2 can increase the continuity of the image edge, and P represents a For relatively small values, in step SA04, computing the minimum polygonal convex hull containing the contour of the image I' can reduce the dependence on the contour being complete and continuous.
优选地,步骤SB中所述的待测图像为图像Inew,待测图像进行l′×l′的二维离散傅立叶变换,l′=max(ly′,lx′),ly′和lx′分别是待测图像的长和宽,提取区域位于傅立叶系数幅度谱的上半平面归一化频率值为fn的中频附近,提取公式为:Preferably, the image to be tested in step SB is the image I new , and the image to be tested is subjected to a two-dimensional discrete Fourier transform of l′×l′, where l′=max( ly ′,l x ′ ), ly ′ and l x ′ are the length and width of the image to be tested, respectively, and the extraction area is located near the intermediate frequency with the normalized frequency f n on the upper half plane of the Fourier coefficient amplitude spectrum. The extraction formula is:
a-λH×D′≤ρ<aλH×D′a -λH ×D′≤ρ<a λH ×D′
D′=fn×l′D′=f n ×l′
其中,ρ为提取区域幅度系数径向的范围,λ是控制提取区域大小的参数,将提取范围内幅度系数的直角坐标映射到对数极坐标上的公式为:Among them, ρ is the radial range of the amplitude coefficients in the extraction area, λ is a parameter controlling the size of the extraction area, and the formula for mapping the rectangular coordinates of the amplitude coefficients in the extraction range to the log polar coordinates is:
其中,Q′表示一个保证α≥0的偏移常数。where Q' represents an offset constant that guarantees α≥0.
与现有技术相比,本发明技术方案的有益效果是:Compared with the prior art, the beneficial effects of the technical solution of the present invention are:
本发明提出一种可抗屏幕拍摄的图像水印方法,针对现有图像水印方法不利于水印有效提取的问题,提出相配合的水印嵌入过程与水印提取过程,在面对已嵌入水印且经屏幕拍摄的宿主图像的后期水印提取时,对宿主图像进行透视矫正,使得水印图像经过屏幕拍摄之后,仍然可以检测水印,保证了水印提取信息的有效性。The invention proposes an image watermarking method that is resistant to screen shooting. Aiming at the problem that the existing image watermarking method is not conducive to the effective extraction of watermarks, a matching watermark embedding process and watermark extraction process are proposed. During the later watermark extraction of the host image, the perspective correction is performed on the host image, so that the watermark can still be detected after the watermark image is shot on the screen, which ensures the validity of the watermark extraction information.
附图说明Description of drawings
图1表示本发明实施例中提出的可抗屏幕拍摄的图像水印方法的整体框架示意图;FIG. 1 shows a schematic diagram of an overall framework of an image watermarking method that is resistant to screen shooting proposed in an embodiment of the present invention;
图2表示本发明实施例中提出的可抗屏幕拍摄的图像水印方法中水印嵌入过程的流程图;Fig. 2 shows the flow chart of the watermark embedding process in the image watermarking method for resisting screen shooting proposed in the embodiment of the present invention;
图3表示本发明实施例中提出的生成的二维水印矩阵WZ的排列示意图;3 shows a schematic diagram of the arrangement of the generated two-dimensional watermark matrix WZ proposed in the embodiment of the present invention;
图4表示本发明实施例中提出的可抗屏幕拍摄的图像水印方法中水印提取过程的流程图。FIG. 4 shows a flowchart of a watermark extraction process in a method for image watermarking resistant to screen shooting proposed in an embodiment of the present invention.
具体实施方式Detailed ways
附图仅用于示例性说明,不能理解为对本专利的限制;The accompanying drawings are for illustrative purposes only, and should not be construed as limitations on this patent;
为了更好地说明本实施例,附图某些部位会有省略、放大或缩小,并不代表实际尺寸;In order to better illustrate this embodiment, some parts of the drawings are omitted, enlarged or reduced, which do not represent the actual size;
对于本领域技术人员来说,附图中某些公知内容说明可能省略是可以理解的。For those skilled in the art, it is understandable that descriptions of certain well-known contents in the accompanying drawings may be omitted.
附图中描述位置关系的用于仅用于示例性说明,不能理解为对本专利的限制;The positional relationship described in the accompanying drawings is only for exemplary illustration, and should not be construed as a limitation on this patent;
下面结合附图和实施例对本发明的技术方案做进一步的说明。The technical solutions of the present invention will be further described below with reference to the accompanying drawings and embodiments.
实施例1Example 1
本发明提出一种可抗屏幕拍摄的图像水印方法,总体如图1所示,参见图1所述方法包括水印嵌入过程与水印提取过程,水印嵌入过程将水印嵌入宿主图像,水印提取过程基于所述水印嵌入过程,对已嵌入水印且经屏幕拍摄的宿主图像进行透视矫正后,进行水印提取操作,提取宿主图像已嵌入的水印信息,在面对已嵌入水印且经屏幕拍摄的宿主图像的后期水印提取时,对宿主图像进行透视矫正,使得水印图像经过屏幕拍摄之后,仍然可以检测水印,保证了后续水印提取信息的有效性。The present invention proposes an image watermarking method that is resistant to screen shooting, as shown in FIG. 1 as a whole. Referring to FIG. 1, the method includes a watermark embedding process and a watermark extraction process. The watermark embedding process embeds the watermark into the host image, and the watermark extraction process is based on the In the watermark embedding process described above, after perspective correction is performed on the host image that has been embedded in the watermark and captured by the screen, a watermark extraction operation is performed to extract the watermark information that has been embedded in the host image. During watermark extraction, perspective correction is performed on the host image, so that the watermark can still be detected after the watermark image is captured on the screen, which ensures the validity of the subsequent watermark extraction information.
具体的,参见图2,在本实施例中,水印嵌入过程包括:Specifically, referring to FIG. 2, in this embodiment, the watermark embedding process includes:
S1.利用密钥生成伪随机序列和模板序列,结合水印比特信息生成待嵌入的二维水印矩阵;其中,结合水印比特信息生成待嵌入的二维水印矩阵的过程为:S1. use the key to generate pseudo-random sequence and template sequence, and combine the watermark bit information to generate the two-dimensional watermark matrix to be embedded; wherein, the process of generating the two-dimensional watermark matrix to be embedded in combination with the watermark bit information is:
S101.设密钥为key,利用密钥key生成长度为Sg的双极性伪随机序列g={gi;1≤i≤Sg,gi∈{-1,1}}和长度为Sz的模板序列Z={Zi;1≤i≤Sz,Zi∈{-1,1}},gi、Zi分别表示双极性伪随机序列的第i个元素、模板序列的第i个元素,伪随机序列g的数值为±1;S101. Let the key be key, and use the key key to generate a bipolar pseudo-random sequence g={g i with length S g ; 1≤i≤S g , g i ∈ {-1,1}} and the length is The template sequence of S z Z={Z i ; 1≤i≤S z , Z i ∈{-1,1}}, g i and Z i represent the i-th element of the bipolar pseudo-random sequence, the template sequence, respectively The i-th element of , the value of the pseudo-random sequence g is ±1;
S102.设水印比特信息的序列表示为b={bi;1≤i≤Sb,bi∈{0,1}},对序列b中的每一比特进行扩频调制:若bi为“1”,则扩频调制为g的同相序列,得到扩频序列Wi={wij;wij∈{-1,+1},1≤j≤Sg}=+1×g;若bi为“0”,则扩频调制为g的反相序列,即Wi=-1×g,得到水印信息数组W={Wi;1≤i≤Sb},每个水印比特信息扩频调制得到的Sg位序列按列排成长度相同的两列;S102. Set the sequence of watermark bit information as b={b i ; 1≤i≤S b , b i ∈ {0,1}}, perform spread spectrum modulation on each bit in sequence b: if b i is "1", the spread spectrum modulation is the in-phase sequence of g, and the spread spectrum sequence W i ={w ij ; w ij ∈{-1,+1}, 1≤j≤S g }=+1×g; if b i is "0", then the spread spectrum modulation is the inverse sequence of g, that is, W i =-1×g, and the watermark information array W={W i ; 1≤i≤S b } is obtained, and each watermark bit information The S g bit sequence obtained by spread spectrum modulation is arranged in two columns with the same length;
S103.将水印信息数组W和模板序列Z按列顺序排成一个H行C列的二维水印矩阵WZ={wz(h,c);0≤h<H,0≤c<C},模板序列Z的长度满足:Sz=H×C-Sb×Sg,将模板序列Z按列排序,与水印比特信息调制后的序列一起组成H×C的水印矩阵WZ,在二维水印矩阵WZ={wz(h,c);0≤h<H,0≤c<C}的元素wz(h,c)由双极性比特“1”和“-1”构成,二维水印矩阵WZ生成后,模板序列Z按列顺序存放在二维水印矩阵WZ的相邻列中,构成原始模板Zb,使得每个有意义水印比特信息调制生成的扩频序列占用二维水印矩阵WZ的相邻若干列,具体参见图3。S103. Arrange the watermark information array W and the template sequence Z into a two-dimensional watermark matrix with H rows and C columns in column order WZ={wz(h,c); 0≤h<H, 0≤c<C}, template The length of the sequence Z satisfies: S z =H×CS b ×S g , the template sequence Z is sorted by column, and the sequence modulated by the watermark bit information forms an H×C watermark matrix WZ, in the two-dimensional watermark matrix WZ= {wz(h,c); 0≤h<H,0≤c<C} element wz(h,c) consists of bipolar bits "1" and "-1", after the two-dimensional watermark matrix WZ is generated , the template sequence Z is stored in the adjacent columns of the two-dimensional watermark matrix WZ in column order to form the original template Z b , so that the spread spectrum sequence generated by the modulation of each meaningful watermark bit information occupies several adjacent columns of the two-dimensional watermark matrix WZ column, see Figure 3 for details.
S2.确定宿主图像,对宿主图像做二维离散傅立叶变换,将变换后的直流成分平移到离散傅立叶幅度谱的中心,在傅立叶系数幅度谱的上半平面中嵌入水印,并将嵌入区域内点的坐标映射到对数极坐标上;实际实施时,近似均匀也是可以的。S2. Determine the host image, perform two-dimensional discrete Fourier transform on the host image, translate the transformed DC component to the center of the discrete Fourier amplitude spectrum, embed a watermark in the upper half plane of the Fourier coefficient amplitude spectrum, and embed the points in the region The coordinates are mapped to log polar coordinates; in practice, it is possible to be approximately uniform.
在本实施例中,宿主图像的确定过程包括:当原始图像为彩色图像时,原始图像转换到YCbCr色彩空间,选择Y通道图像作为宿主图像;当原始图像为灰度图像时,不作转换,直接作为宿主图像。In this embodiment, the process of determining the host image includes: when the original image is a color image, converting the original image to the YCbCr color space, and selecting a Y channel image as the host image; when the original image is a grayscale image, no conversion is performed, and the as the host image.
宿主图像做l×l的二维离散傅立叶变换,l=max(ly,lx),ly和lx分别表示宿主图像的长和宽,变换后的直流成分平移到离散傅立叶幅度谱的中心,离散傅立叶幅度谱的中心作为直角坐标系的原点,嵌入区域位于傅立叶系数幅度谱的归一化频率值为fn的中频附近,在本实施例中,取fn=0.25,所述将嵌入区域内点的坐标映射到对数极坐标上的过程为:嵌入区域的傅立叶系数的直角坐标(u,v)或者极坐标(ρ,θ)变换成离散对数极坐标(α,β),变换公式为:The host image is subjected to l×l two-dimensional discrete Fourier transform, l=max(l y ,l x ), ly and l x represent the length and width of the host image, respectively, and the transformed DC component is translated into the discrete Fourier amplitude spectrum. The center, the center of the discrete Fourier amplitude spectrum is taken as the origin of the rectangular coordinate system, and the embedded area is located near the intermediate frequency where the normalized frequency value of the Fourier coefficient amplitude spectrum is f n , in this embodiment, f n =0.25, the The process of mapping the coordinates of the points in the embedded region to log polar coordinates is: transform the rectangular coordinates (u, v) or polar coordinates (ρ, θ) of the Fourier coefficients of the embedded region into discrete log polar coordinates (α, β) , the transformation formula is:
D=fn×lD= fn ×l
a-H/2×D≤ρ<aH/2×Da -H/2 ×D≤ρ<a H/2 ×D
其中,a表示一个大于1且接近于1的常数,a=21/H,ρ表示极径,表示该幅值点到对应于傅立叶幅度谱中心点的距离,θ表示傅立叶系数在极坐标中的角度,θ=arctan(u/v);在傅立叶系数的中低频区域嵌入水印,D取为傅立叶变换归一化频率值为fn的中频附近,fn的取值在0.15~0.25之间;Q表示保证α≥0的偏移常数;floor()函数表示向下取整函数,平衡水印的鲁棒性和不可见性。极径ρ满足:Among them, a represents a constant greater than 1 and close to 1, a=2 1/H , ρ represents the polar diameter, which represents the distance from the amplitude point to the center point corresponding to the Fourier amplitude spectrum, θ represents the angle of the Fourier coefficient in polar coordinates, θ=arctan(u/v); the watermark is embedded in the mid-low frequency region of the Fourier coefficient, D is taken as the Fourier transform normalized frequency value near the intermediate frequency of f n , f n The value is between 0.15 and 0.25; Q represents the offset constant that guarantees α≥0; the floor() function represents the round-down function to balance the robustness and invisibility of the watermark. The polar diameter ρ satisfies:
a-H/2×D≤ρ<aH/2×Da -H/2 ×D≤ρ<a H/2 ×D
对应直角坐标系中水印嵌入区域是个环形,离散对数极坐标(α,β)的坐标范围满足:The watermark embedding area in the corresponding rectangular coordinate system is a ring, and the coordinate range of discrete log polar coordinates (α, β) satisfies:
0≤α<H,0≤β<C;0≤α<H, 0≤β<C;
根据加性嵌入公式或乘性嵌入公式嵌入水印,其中,加性嵌入公式为:Embed the watermark according to the additive embedding formula or the multiplicative embedding formula, where the additive embedding formula is:
c(u,v)=c(u,v)+σ×wz(α,β)c(u,v)=c(u,v)+σ×wz(α,β)
乘性嵌入公式为:The multiplicative embedding formula is:
c(u,v)=c(u,v)×(1+σ×wz(α,β));c(u,v)=c(u,v)×(1+σ×wz(α,β));
通过加性嵌入公式或乘性嵌入公式嵌入水印不需要对提箱的傅里叶系数进行内插运算,消除了图像内插插值失真的缺陷,在傅立叶幅度谱的下半平面根据傅立叶变换关于幅度谱中心直流成分点的对称处,可对称嵌入相同的水印,在本实施例中,按照乘性嵌入公式嵌入水印信息比特wz(α,β)。Embedding the watermark by the additive embedding formula or the multiplicative embedding formula does not need to interpolate the Fourier coefficients of the box, which eliminates the defect of image interpolation and interpolation distortion. The same watermark can be embedded symmetrically at the symmetrical position of the central DC component point. In this embodiment, the watermark information bits wz(α, β) are embedded according to the multiplicative embedding formula.
S3.将对数极坐标作为二维水印矩阵的坐标,在具有相同对数极坐标的傅立叶系数中嵌入相同的水印比特信息;S3. The log-polar coordinates are used as the coordinates of the two-dimensional watermark matrix, and the same watermark bit information is embedded in the Fourier coefficients with the same log-polar coordinates;
S4.对嵌入水印比特信息后的傅立叶系数进行逆傅立叶变换,得到含水印的图像。S4. Perform inverse Fourier transform on the Fourier coefficients after embedding the watermark bit information to obtain a watermarked image.
参见图4,在本实施例中,水印提取过程包括:Referring to Figure 4, in this embodiment, the watermark extraction process includes:
SA.对经屏幕拍摄且已嵌入水印的宿主图像进行透视矫正,裁剪出目标图像区域作为待测图像;具体透视矫正的过程包括:SA. Perform perspective correction on the host image captured by the screen and embedded with the watermark, and crop out the target image area as the image to be measured; the specific perspective correction process includes:
SA01.设经屏幕拍摄且已嵌入水印的宿主图像为I0,将I0转换为灰度图像,对灰度图像进行标准差为5的高斯滤波得到图像I1,可以削弱摩尔纹噪声对后续操作的影响;SA01. Set the host image captured by the screen and embedded with the watermark as I 0 , convert I 0 into a grayscale image, and perform Gaussian filtering with a standard deviation of 5 on the grayscale image to obtain an image I 1 , which can weaken the moire noise and affect the subsequent the impact of the operation;
SA02.采用Sobel算法检测图像I1边缘,得到边缘点图像I2;具体实施时,默认阈值threshold,再次采用Sobel算法检测图像I1边缘,阈值可取为threshold×0.5,得到边缘点图像I2;SA02. Adopt the Sobel algorithm to detect the edge of the image I 1 , and obtain the edge point image I 2 ; During the specific implementation, the default threshold value threshold, adopt the Sobel algorithm again to detect the edge of the image I 1 , and the threshold value can be taken as the threshold × 0.5, and obtain the edge point image I 2 ;
SA03.对图像I2进行形态学闭运算,可以增加图像边缘的连续性,得到图像I3,从图像I3中删除小于P的连通分量,生成二值图像I4,P表示一个被删除连通分量的像素评价阈值;具体实施时,形态学闭运算所需的结构元素对象se可选择半径r为5的平坦型圆盘结构元素,从图像I3中删除少于P个像素的所有连通分量(对象),P可取为100,生成另一个二值图像I4;SA03. Perform morphological closing operation on the image I 2 , which can increase the continuity of the edge of the image to obtain the image I 3 , delete the connected components smaller than P from the image I 3 , and generate a binary image I 4 , where P represents a deleted connected component The pixel evaluation threshold of the component; during the specific implementation, the structuring element object se required for the morphological closing operation can select a flat disc structuring element with a radius r of 5, and delete all connected components less than P pixels from the image I3 (object), P can be taken as 100, and another binary image I 4 is generated;
SA04.设目标图像为I′,跟踪二值图像I4中对象的外边界区域,将最大的连通区域作为目标图像I′的轮廓,计算包含图像I′轮廓的最小多边形凸包,可以减少对轮廓完整且连续的依赖性,得到多边形凸包的顶点集合points;SA04. Set the target image as I', track the outer boundary area of the object in the binary image I4 , take the largest connected area as the contour of the target image I', and calculate the minimum polygonal convex hull containing the contour of the image I', which can reduce the number of The complete and continuous dependency of the contour, the vertex set points of the polygonal convex hull are obtained;
SA05.计算目标图像I′的边缘直线:按逆时针顺序遍历多边形凸包的顶点集合points,每两个点确定一条直线,角度相近的两条线段中选取长度最大的计算其参数表达式,具体的,根据直线间的夹角Ag和直线长度Lg来筛选直线,夹角Ag小于Mg的两条线段选取长度Lg最大的计算其参数表达式,Mg可取为10,然后得到一系列直线;当直线数量大于4时,删除与相邻两条直线夹角过大的直线;SA05. Calculate the edge straight line of the target image I': traverse the vertex set points of the polygonal convex hull in counterclockwise order, determine a straight line for every two points, and select the longest length of the two line segments with similar angles to calculate its parameter expression, specifically , according to the angle A g between the straight lines and the straight line length L g to filter the straight lines, the two line segments with the included angle A g less than M g select the one with the largest length L g to calculate its parameter expression, M g can be taken as 10, and then get A series of straight lines; when the number of straight lines is greater than 4, delete the lines with too large angle with the two adjacent straight lines;
SA06.计算目标图像I′的四个顶点:确认四条直线的交点,得到目标图像I′的顶点集合vecs;当顶点坐标超出宿主图像I0的范围时,水印图像经屏幕拍摄的不完整,将宿主图像I0范围外的内容进行补0填充;SA06. Calculate the four vertices of the target image I': confirm the intersection of the four straight lines, and obtain the vertex set vecs of the target image I'; when the vertex coordinates are beyond the range of the host image I 0 , the watermark image is incomplete through the screen shot, and the The content outside the range of the host image I 0 is filled with 0;
SA07.设目标图像I′的最小边长为Lm,根据顶点集合vecs和Lm对宿主图像I0进行透视矫正,将变换后的目标图像裁剪出来,得到图像Inew。SA07. Set the minimum side length of the target image I' as L m , perform perspective correction on the host image I 0 according to the vertex sets vecs and L m , and cut out the transformed target image to obtain the image I new .
SB.对待测图像做二维离散傅立叶变换,将变换后的直流成分平移到离散傅立叶幅度谱中心,以离散傅立叶幅度谱中心作为直角坐标系的原点,在傅立叶系数幅度谱的上半平面中提取水印,将提取范围内幅度系数的直角坐标映射到对数极坐标上;SB. Do a two-dimensional discrete Fourier transform on the image to be measured, translate the transformed DC component to the center of the discrete Fourier amplitude spectrum, take the center of the discrete Fourier amplitude spectrum as the origin of the rectangular coordinate system, and extract it from the upper half plane of the Fourier coefficient amplitude spectrum. Watermark, which maps the rectangular coordinates of the amplitude coefficients in the extraction range to the log polar coordinates;
所述的待测图像为图像Inew,待测图像进行l′×l′的二维离散傅立叶变换,l′=max(ly′,lx′),ly′和lx′分别是待测图像的长和宽,提取区域位于傅立叶系数幅度谱的上半平面归一化频率值为fn的中频附近,提取公式为:The image to be tested is the image I new , and the image to be tested is subjected to a two-dimensional discrete Fourier transform of l′×l′, where l′=max( ly ′, l x ′), and ly ′ and l x ′ are respectively The length and width of the image to be measured, the extraction area is located near the intermediate frequency with the normalized frequency value f n of the upper half plane of the Fourier coefficient amplitude spectrum, and the extraction formula is:
a-λH×D′≤ρ<aλH×D′a -λH ×D′≤ρ<a λH ×D′
D′=fn×l′D′=f n ×l′
其中,ρ为提取区域幅度系数径向的范围,λ是控制提取区域大小的参数,考虑到图片缩放攻击对图像频域的影响,提取区域要大于嵌入区域,λ取值一般大于1/2,这里取λ=1,将提取范围内幅度系数的直角坐标映射到对数极坐标上的公式为:Among them, ρ is the radial range of the amplitude coefficient of the extraction area, and λ is a parameter that controls the size of the extraction area. Considering the impact of image scaling attacks on the image frequency domain, the extraction area should be larger than the embedded area, and the value of λ is generally greater than 1/2. Here λ=1 is taken, and the formula for mapping the rectangular coordinates of the amplitude coefficients in the extraction range to the log polar coordinates is:
其中,Q′表示一个保证α≥0的偏移常数,如可取H′/2,一般取H′>H,如可取H′=2H;此时,0≤α<H′,0≤β<C;Among them, Q' represents an offset constant that guarantees α≥0, such as H'/2, generally H'>H, such as H'=2H; at this time, 0≤α<H', 0≤β< C;
SC.计算一个二维傅立叶系数幅度矩阵:对经过映射后拥有相同对数极坐标的幅度系数求均值,将其作为二维傅立叶系数幅度矩阵的一个元素;SC. Calculate a two-dimensional Fourier coefficient magnitude matrix: average the magnitude coefficients that have the same log-polar coordinates after mapping, and use it as an element of the two-dimensional Fourier coefficient magnitude matrix;
具体的,建立二维傅立叶系数幅度矩阵amp,对具有相同离散对数极坐标(α,β)的傅立叶系数(这些系数在直角坐标系下位于一个扇区内)取均值,得到amp(α,β),将其作为amp的一个元素,可以得到二维的傅立叶系数幅度矩阵amp={amp(α,β)|0≤α<H′,0≤β<C};Specifically, a two-dimensional Fourier coefficient magnitude matrix amp is established, and the Fourier coefficients with the same discrete log polar coordinates (α, β) (these coefficients are located in a sector in a rectangular coordinate system) are averaged to obtain amp(α, β), taking it as an element of amp, the two-dimensional Fourier coefficient amplitude matrix amp={amp(α,β)|0≤α<H′, 0≤β<C};
SD.根据相位相关原理,将原始模板与傅立叶系数幅度矩阵进行快速匹配计算,根据最大相关值的坐标位置,确定水印矩阵在二维傅立叶系数幅度矩阵中的位置,得到与嵌入水印同步的幅度矩阵;SD. According to the principle of phase correlation, the original template and the Fourier coefficient amplitude matrix are quickly matched and calculated, and the position of the watermark matrix in the two-dimensional Fourier coefficient amplitude matrix is determined according to the coordinate position of the maximum correlation value, and the amplitude matrix synchronized with the embedded watermark is obtained. ;
由于图像的旋转变换在图像的傅立叶幅度谱的对数极坐标域表现为角度(β方向)方向的循环平移,图像的缩放变换表现为对数极径(即α方向)方向上的平移;因此将原始模板Zb与幅度矩阵amp根据相关定理进行相位相关快速匹配计算,根据最大相关值的坐标位置,确定水印矩阵WZ在DFT幅度系数均值矩阵amp中的位置,得到与嵌入水印WZ同步的幅度矩阵:Since the rotation transformation of the image in the log polar coordinate domain of the Fourier amplitude spectrum of the image is represented as a circular translation in the angular (β direction) direction, the scaling transformation of the image is represented by a translation in the log polar diameter (ie the α direction) direction; therefore The original template Z b and the amplitude matrix amp are used for fast matching calculation of phase correlation according to the correlation theorem. According to the coordinate position of the maximum correlation value, the position of the watermark matrix WZ in the DFT amplitude coefficient mean matrix amp is determined, and the amplitude synchronized with the embedded watermark WZ is obtained. matrix:
将原始模板Zb补0形成与幅度矩阵amp同样大小的矩阵g(h,c),它们之间的平移相关值是:The original template Z b is filled with 0 to form a matrix g(h, c) of the same size as the magnitude matrix amp, and the translation correlation value between them is:
0≤k<H′,0≤l<C0≤k<H′, 0≤l<C
又根据二维相关定理,即空域中的两个二维函数的相关与它们的二维DFT频域函数的乘积互为傅立叶变换与反变换对,因此有:According to the two-dimensional correlation theorem, that is, the correlation of two two-dimensional functions in the space domain and the product of their two-dimensional DFT frequency domain functions are mutual Fourier transform and inverse transform pairs, so there are:
其中,“*”表示复数共轭,AMP(h,c)=DFT(amp(h,c)),G(h,c)=DFT(g(h,c)),即AMP(h,c)、G(h,c)分别是amp(h,c)、g(h,c)的二维傅立叶变换系数,所以可以采用下列公式快速计算相关值r(k,l):Among them, "*" represents complex conjugate, AMP(h,c)=DFT(amp(h,c)), G(h,c)=DFT(g(h,c)), namely AMP(h,c) ) and G(h,c) are the two-dimensional Fourier transform coefficients of amp(h,c) and g(h,c) respectively, so the following formula can be used to quickly calculate the correlation value r(k,l):
r(k,l)=IDFT[AMP(h,c)G*(h,c)]r(k,l)=IDFT[AMP(h,c)G * (h,c)]
也可计算平移相位相关值 Shift phase correlation values can also be calculated
其中,是AMP(h,c)的相角;in, is the phase angle of AMP(h,c);
由于原始模板矩阵跟嵌入模板的幅度矩阵具有相关性,因此由相关值矩阵r(k,l)或者的最大值可以确定嵌入水印位置,得到与嵌入水印WZ同步的幅度矩阵 Since the original template matrix has a correlation with the magnitude matrix of the embedded template, the correlation value matrix r(k,l) or The maximum value of can determine the embedded watermark position, and obtain the amplitude matrix synchronized with the embedded watermark WZ
SE.利用伪随机序列对幅度矩阵进行解扩频调制,提取到水印信息。SE. The amplitude matrix is despread and modulated with a pseudo-random sequence, and the watermark information is extracted.
利用原始伪随机序列g对矩阵进行解扩频调制,得到有意义的多比特水印信息;根据嵌入Wi时的位置和顺序从中取出与对应的Sg个DFT系数,并组成一段长为Sg的序列Ci。按照解扩频原理,把Ci与长为Sg的原始伪随机序列g进行点乘运算得到C′i,如果C′i的正数平均值与负数平均值之和大于0,则判定提取的水印比特b′i为“1”,否则判定提取的水印比特b′i为“0”,解扩频之后得到二进制的有意义水印信息序列b′。Using the original pseudo-random sequence g pair The matrix is despread and modulated to obtain meaningful multi-bit watermark information; according to the position and order of embedding Wi from Take out the corresponding S g DFT coefficients from the , and form a sequence C i with a length of S g . According to the principle of despreading, the point product of C i and the original pseudo-random sequence g of length S g is performed to obtain C' i . If the sum of the positive and negative average values of C' i is greater than 0, it is determined that The watermark bit b' i of , is "1", otherwise it is determined that the extracted watermark bit b' i is "0", and a binary meaningful watermark information sequence b' is obtained after despreading.
附图中描述位置关系的用于仅用于示例性说明,不能理解为对本专利的限制;The positional relationship described in the accompanying drawings is only for exemplary illustration, and should not be construed as a limitation on this patent;
显然,本发明的上述实施例仅是为清楚地说明本发明所作的举例,而并非是对本发明的实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等均应包含在本发明权利要求的保护范围之内。Obviously, the above-mentioned embodiments of the present invention are only examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those of ordinary skill in the art, changes or modifications in other different forms can also be made on the basis of the above description. There is no need and cannot be exhaustive of all implementations here. Any modification, equivalent replacement and improvement made within the spirit and principle of the present invention shall be included within the protection scope of the claims of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110271166.7A CN112767227B (en) | 2021-03-12 | 2021-03-12 | Image watermarking method capable of resisting screen shooting |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110271166.7A CN112767227B (en) | 2021-03-12 | 2021-03-12 | Image watermarking method capable of resisting screen shooting |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112767227A true CN112767227A (en) | 2021-05-07 |
CN112767227B CN112767227B (en) | 2023-03-31 |
Family
ID=75691058
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110271166.7A Active CN112767227B (en) | 2021-03-12 | 2021-03-12 | Image watermarking method capable of resisting screen shooting |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112767227B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113392381A (en) * | 2021-06-29 | 2021-09-14 | 合肥高维数据技术有限公司 | Watermark generation method, watermark decoding method, storage medium, and electronic device |
CN114202452A (en) * | 2021-11-16 | 2022-03-18 | 合肥高维数据技术有限公司 | Screen watermark generation method, storage device and electronic device based on stain simulation |
CN117574336A (en) * | 2023-11-16 | 2024-02-20 | 扬州大学 | A real-time screen watermarking method and system for tracing screen shooting leaks |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040086191A1 (en) * | 2002-10-31 | 2004-05-06 | Microsoft Corporation | Passive embedded interaction code |
JP2006086822A (en) * | 2004-09-16 | 2006-03-30 | Sanyo Electric Co Ltd | Electronic watermark embedding apparatus and method thereof, and electronic watermark extracting apparatus and method thereof |
US20070077987A1 (en) * | 2005-05-03 | 2007-04-05 | Tangam Gaming Technology Inc. | Gaming object recognition |
CN101079147A (en) * | 2007-06-25 | 2007-11-28 | 中山大学 | Multiple bit digital watermark method capable of resisting printing, scanning and geometric transformation |
US20110141238A1 (en) * | 2009-06-29 | 2011-06-16 | Sony Corporation | Stereo image data transmitting apparatus, stereo image data transmitting method, stereo image data receiving data receiving method |
EP2902966A1 (en) * | 2014-02-03 | 2015-08-05 | Prosper Creative Co., Ltd. | Image inspecting apparatus and image inspecting program |
WO2016044097A1 (en) * | 2014-09-18 | 2016-03-24 | Qualcomm Mems Technologies, Inc. | Color to gap mapping based on curve shape matching |
CN110852204A (en) * | 2019-10-28 | 2020-02-28 | 乐山师范学院 | Intelligent remote calligraphy digital learning evaluation information processing system and method |
-
2021
- 2021-03-12 CN CN202110271166.7A patent/CN112767227B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040086191A1 (en) * | 2002-10-31 | 2004-05-06 | Microsoft Corporation | Passive embedded interaction code |
JP2006086822A (en) * | 2004-09-16 | 2006-03-30 | Sanyo Electric Co Ltd | Electronic watermark embedding apparatus and method thereof, and electronic watermark extracting apparatus and method thereof |
US20070077987A1 (en) * | 2005-05-03 | 2007-04-05 | Tangam Gaming Technology Inc. | Gaming object recognition |
CN101079147A (en) * | 2007-06-25 | 2007-11-28 | 中山大学 | Multiple bit digital watermark method capable of resisting printing, scanning and geometric transformation |
US20110141238A1 (en) * | 2009-06-29 | 2011-06-16 | Sony Corporation | Stereo image data transmitting apparatus, stereo image data transmitting method, stereo image data receiving data receiving method |
EP2902966A1 (en) * | 2014-02-03 | 2015-08-05 | Prosper Creative Co., Ltd. | Image inspecting apparatus and image inspecting program |
WO2016044097A1 (en) * | 2014-09-18 | 2016-03-24 | Qualcomm Mems Technologies, Inc. | Color to gap mapping based on curve shape matching |
CN110852204A (en) * | 2019-10-28 | 2020-02-28 | 乐山师范学院 | Intelligent remote calligraphy digital learning evaluation information processing system and method |
Non-Patent Citations (1)
Title |
---|
HAN FANG 等: "Screen-Shooting Resilient Watermarking", 《IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113392381A (en) * | 2021-06-29 | 2021-09-14 | 合肥高维数据技术有限公司 | Watermark generation method, watermark decoding method, storage medium, and electronic device |
CN114202452A (en) * | 2021-11-16 | 2022-03-18 | 合肥高维数据技术有限公司 | Screen watermark generation method, storage device and electronic device based on stain simulation |
CN117574336A (en) * | 2023-11-16 | 2024-02-20 | 扬州大学 | A real-time screen watermarking method and system for tracing screen shooting leaks |
CN117574336B (en) * | 2023-11-16 | 2025-03-14 | 扬州大学 | Real-time screen watermarking method and system for tracking screen shooting leakage |
Also Published As
Publication number | Publication date |
---|---|
CN112767227B (en) | 2023-03-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Fang et al. | Screen-shooting resilient watermarking | |
Piva | An overview on image forensics | |
CN112767227B (en) | Image watermarking method capable of resisting screen shooting | |
JP2002247344A (en) | Method and apparatus for processing image | |
US11057539B2 (en) | Method of embedding watermark data in an image by adjusting a pixel when color channel values are above or below a threshold and based on a pixel of a transformed noise-based image being white or black | |
Su et al. | Geometrically resilient digital image watermarking by using interest point extraction and extended pilot signals | |
Gourrame et al. | A zero-bit Fourier image watermarking for print-cam process | |
CN110599388A (en) | Blind robust digital watermark embedding and detecting method based on positioning point assistance | |
Murali et al. | Comparision and analysis of photo image forgery detection techniques | |
Kwok et al. | Alternative anti-forensics method for contrast enhancement | |
Munib et al. | Robust image watermarking technique using triangular regions and Zernike moments for quantization based embedding | |
CN113344763B (en) | Robust watermarking algorithm based on JND and oriented to screen shooting | |
Khan et al. | A secure true edge based 4 least significant bits steganography | |
CN109064376B (en) | DFT domain image anti-screen-shot watermarking algorithm based on Harris-Laplace and SIFT descriptors | |
Lee et al. | Digital watermarking based on JND model and QR code features | |
CN112541853B (en) | Data processing method, device and equipment | |
Juarez-Sandoval et al. | Digital image ownership authentication via camouflaged unseen-visible watermarking | |
JP6138706B2 (en) | Digital watermark embedding method or digital watermark detection method | |
JP6006675B2 (en) | Marker detection apparatus, marker detection method, and program | |
Thongkor et al. | Robust image watermarking for camera-captured image using image registration technique | |
Liu | Automatic Localization and Detection Applicable to Robust Image Watermarking Resisting against Camera Shooting | |
Manjunatha et al. | A survey on image forgery detection techniques | |
Keskinarkaus | Digital watermarking techniques for printed images | |
Lee et al. | Photograph watermarking | |
Pramila | Reading watermarks with a camera phone from printed images |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20240730 Address after: 710000 B2-216, 7th Floor, Xixian Talent Building, Century Building, Fengdong New City, Xi'an City, Shaanxi Province Patentee after: Xi'an Chenzhen Zhishan Information Technology Co.,Ltd. Country or region after: China Address before: 510275 No. 135 West Xingang Road, Guangzhou, Guangdong, Haizhuqu District Patentee before: SUN YAT-SEN University Country or region before: China |
|
TR01 | Transfer of patent right |