Watermark recognition method and device and computer readable storage medium

By calculating the chamfer distance diagram and updating the watermark gradient, it is possible to automatically and quickly identify whether the picture contains watermarks, solving the problem of low recognition efficiency in the prior art, and is suitable for multi-platform watermark recognition.

CN113761991BActive Publication Date: 2024-12-10BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010540186.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-12
Publication Date
2024-12-10
Estimated Expiration
2040-06-12

AI Technical Summary

Technical Problem

In the prior art, image watermark recognition efficiency is low and cannot meet the rapid review needs of massive images, resulting in high cost and inefficient manual recognition.

Method used

By extracting the watermarked images associated with each platform, calculating the chamfered distance map, and updating the watermark gradient until the termination condition is met, it will automatically identify whether the image contains a watermark, which is suitable for multi-platform watermark recognition.

Benefits of technology

It realizes automatic and rapid identification of watermarks with watermark images, improves recognition efficiency, and can identify watermarks added by the same platform and multiple platforms, suitable for multi-platform environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113761991B_ABST
    Figure CN113761991B_ABST
Patent Text Reader

Abstract

The present disclosure proposes a watermark recognition method and device and a computer-readable storage medium, which relate to the field of computer technology. In the present disclosure, by calculating the chamfer distance of all pixels in the picture to be recognized, whether the picture to be recognized contains a watermark is determined according to the value of the chamfer distance, and the watermark in the picture to be recognized can be automatically and quickly recognized, and the recognition efficiency is significantly improved. In addition, in the watermark recognition method of the present disclosure, by calculating the chamfer distance map of the picture to be recognized, the picture to be recognized is associated with the corresponding picture providing platform, so that not only the watermark added to the original picture in a consistent manner can be recognized, that is, the watermark from the same platform can be recognized, but also the watermark added to the original picture in different ways can be recognized, that is, it can be suitable for identifying watermarks from multiple platforms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a watermark recognition method and device and a computer-readable storage medium. Background Art

[0002] As an effective way to protect copyright, digital watermark technology is widely used in a large number of images. Many image content creators and related companies and institutions (hereinafter collectively referred to as "image providing platforms") use digital watermark technology to prevent image content from being illegally copied and stolen. Usually, a semi-transparent watermark image containing its name or logo (i.e., the logo of the company or institution) is embedded in the original image. Its visual significance is very low, and it has the characteristics of small area, light color, and high transparency.

[0003] In order to avoid misuse of copyrighted images and prevent infringement, before using images provided by image provision platforms, it is necessary to identify whether the image content contains watermarks of prohibited platforms (except for watermarks of shooting equipment, Weibo, and beauty cameras). Due to the wide range and rapid spread of Internet technology, image provision platforms generate a huge amount of images every day, and their number and scale have far exceeded the limits of manual identification. Summary of the invention

[0004] The inventors found that in the related art, the manual identification method of reviewing whether the image content contains watermarks is time-consuming and labor-intensive, and the review efficiency is very low, and even cannot meet the timeliness requirements of the review.

[0005] To this end, the present disclosure provides a watermark recognition method that can automatically and quickly recognize watermarked images.

[0006] In an embodiment of the present disclosure, watermarked images associated with each preset platform are extracted respectively, and the corresponding watermark gradient is determined according to the watermarked images associated with each platform; then, the watermark gradient is updated according to the chamfer distance map calculated using the current watermark gradient of each platform; and whether the image to be identified contains a watermark is determined according to the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms. Repeat the step of updating the watermark gradient using the chamfer distance map calculated using the current watermark gradient of each platform until the preset termination condition is met. Determine whether the image to be identified contains a watermark according to the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms. The method of this embodiment can automatically and quickly identify the watermark of watermarked images, and the recognition efficiency is significantly improved. In addition, when identifying, the picture to be identified is associated with the corresponding picture providing platform, which not only allows the identification of watermarks added to the original picture in a consistent manner (i.e., watermarks from the same platform), but also allows the identification of watermarks added to the original picture in different manners (i.e., watermarks from multiple platforms), that is, the identification of watermarks applicable to multiple platforms.

[0007] According to some embodiments of the present disclosure, a watermark recognition method is provided, including:

[0008] Extracting watermarked images associated with each preset platform respectively, and determining corresponding watermark gradients according to the watermarked images associated with each platform;

[0009] updating the watermark gradient according to a chamfer distance map calculated using the current watermark gradient of each platform;

[0010] Repeating the step of updating the watermark gradient according to the chamfer distance map calculated using the current watermark gradient of each platform until a preset termination condition is met;

[0011] Determine whether the image to be identified contains a watermark according to the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms;

[0012] Wherein, updating the watermark gradient according to the chamfer distance map calculated using the current watermark gradient of each platform includes:

[0013] For each image to be identified in the set of images to be identified, the corresponding chamfer distance map is calculated using the current watermark gradient of each platform;

[0014] In the chamfer distance map associated with each image to be identified, the platform corresponding to the chamfer distance map currently having the smallest chamfer distance is used as the associated platform of the image to be identified;

[0015] In each platform, the watermark gradients of the associated pictures to be identified are calculated respectively, and the median of the watermark gradients of the pictures to be identified is used as the updated watermark gradient of the corresponding platform.

[0016] In some embodiments, determining whether the image to be identified contains a watermark according to the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms includes:

[0017] Determine in sequence the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms;

[0018] If the minimum value of the chamfer distance of the corresponding image to be identified is greater than a preset threshold, it is determined that the image to be identified does not contain a watermark;

[0019] If the minimum value of the chamfer distance of the corresponding image to be identified is not greater than the preset threshold, it is determined that the image to be identified contains a watermark.

[0020] In some embodiments, it also includes: if the image to be identified contains a watermark, all pixel points corresponding to chamfer distances less than a preset threshold in the chamfer distance map of the image to be identified are determined as watermark positions of the image to be identified.

[0021] In some embodiments, for each picture to be identified in the set of pictures to be identified, respectively using the current watermark gradient of each platform to calculate the corresponding chamfer distance map includes:

[0022] Performing a Euclidean distance transformation on the edge graph of each to-be-recognized picture in the to-be-recognized picture set to obtain a first transformation result;

[0023] Using the watermark gradient of each platform as a convolution kernel, and performing a convolution operation with the first transformation result to obtain a second transformation result;

[0024] The chamfer distance of each pixel point of the second transformation result is calculated to obtain a chamfer distance map of the image to be identified on the corresponding platform.

[0025] In some embodiments, calculating the chamfer distance of each pixel point of the second transformation result to obtain the chamfer distance map of the image to be identified on the corresponding platform includes:

[0026] Dividing each pixel point in the edge map into a feature point and a non-feature point, wherein the transformation value of the second transformation result of the feature point is less than a preset value, and the transformation value of the second transformation result of the non-feature point is not less than the preset value;

[0027] The chamfer distance from each non-feature point to the nearest feature point is calculated to obtain a chamfer distance map of the image to be identified on the corresponding platform.

[0028] In some embodiments, the method further includes: reconstructing a watermark estimation image according to the determined watermark gradient.

[0029] In some embodiments, the method further includes: if the image to be identified contains a watermark, determining an estimated value of the watermark by jointly solving objective functions of multiple watermarked images.

[0030] According to some further embodiments of the present disclosure, a watermark recognition device is provided, comprising:

[0031] A determination module is configured to extract watermarked images associated with each preset platform respectively, and determine a corresponding watermark gradient according to the watermarked images associated with each platform;

[0032] The updating module is configured to update the watermark gradient according to the chamfer distance map calculated by using the current watermark gradient of each platform, and repeatedly execute the step of updating the watermark gradient according to the chamfer distance map calculated by using the current watermark gradient of each platform until a preset termination condition is met, wherein updating the watermark gradient according to the chamfer distance map calculated by using the current watermark gradient of each platform comprises: for each picture to be identified in the picture set to be identified, respectively using the current watermark gradient of each platform to calculate the corresponding chamfer distance map; in the chamfer distance map associated with each picture to be identified, taking the platform corresponding to the chamfer distance map with the minimum chamfer distance as the associated platform of the picture to be identified; in each platform, respectively calculating the watermark gradient of each associated picture to be identified, and taking the median of the watermark gradient of each picture to be identified as the updated watermark gradient of the corresponding platform;

[0033] The recognition module is configured to determine whether the image to be recognized contains a watermark according to the minimum value of the chamfer distance of each image to be recognized in the current chamfer distance map of all platforms.

[0034] In some embodiments, the recognition module is configured to: determine in turn the minimum value of the chamfer distance of each image to be recognized in the current chamfer distance map of all platforms; if the minimum value of the chamfer distance of the corresponding image to be recognized is greater than a preset threshold, determine that the image to be recognized does not contain a watermark; if the minimum value of the chamfer distance of the corresponding image to be recognized is not greater than the preset threshold, determine that the image to be recognized contains a watermark.

[0035] In some embodiments, the recognition module is further configured to: if the image to be recognized contains a watermark, all pixel points corresponding to chamfer distances in the chamfer distance map of the image to be recognized that are less than a preset threshold are determined as watermark positions of the image to be recognized.

[0036] In some embodiments, the update module is configured to: perform Euclidean distance transform on the edge map of each picture to be identified in the picture set to obtain a first transformation result; use the watermark gradient of each platform as a convolution kernel, and perform a convolution operation with the first transformation result to obtain a second transformation result; calculate the chamfer distance of each pixel point of the second transformation result to obtain the chamfer distance map of the picture to be identified on the corresponding platform.

[0037] In some embodiments, the update module is configured to: divide each pixel point in the edge map into feature points and non-feature points, wherein the transformation value of the second transformation result of the feature point is less than a preset value, and the transformation value of the second transformation result of the non-feature point is not less than a preset value; calculate the chamfer distance from each non-feature point to the nearest feature point to obtain the chamfer distance map of the image to be identified on the corresponding platform.

[0038] In some embodiments, the recognition module is further configured to: reconstruct the watermark estimation image according to the determined watermark gradient.

[0039] In some embodiments, the recognition module is further configured to: if the image to be recognized contains a watermark, determine an estimated value of the watermark by jointly solving an objective function of multiple watermarked images.

[0040] According to some further embodiments of the present disclosure, a watermark recognition device is provided, which includes: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the watermark recognition method described in any embodiment based on instructions stored in the memory.

[0041] According to still some other embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the watermark recognition method described in any embodiment is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. The present disclosure can be more clearly understood according to the following detailed description with reference to the drawings.

[0043] Obviously, the drawings described below are only some embodiments of the present disclosure, and a person skilled in the art can obtain other drawings based on these drawings without creative work.

[0044] Figure 1 A schematic flow chart of a watermark recognition method according to some embodiments of the present disclosure is shown.

[0045] Figure 2A flowchart of a method for updating the watermark gradient according to some embodiments of the present disclosure is shown.

[0046] Figure 3 A schematic diagram of a watermark recognition device according to some embodiments of the present disclosure is shown.

[0047] Figure 4 Schematic diagrams showing watermark recognition devices according to other embodiments of the present disclosure. DETAILED DESCRIPTION

[0048] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure.

[0049] Assume that the same platform adds watermarks with similar structures and shapes to images in a consistent manner to generate watermarked images; while in the process of generating watermarked images on different platforms, the watermarks added to the images have different structures and shapes, and the differences may even be very large.

[0050] In the embodiments of the present disclosure, a watermarked image can be decomposed into a "foreground" image (i.e., a watermarked image), an alphamatte (also called a foreground mask), and a "background" image (i.e., an original image without a watermark). For example, a watermarked image is represented by a symbol J, a "foreground" image (hereinafter referred to as a watermark) is represented by a symbol W, an alpha matte value is represented by a symbol α, and a "background" image (hereinafter referred to as an original image) is represented by a symbol I.

[0051] Assuming that the watermarked image J is obtained by superimposing the watermark W on the original image I without watermark, then the watermarked image J can be expressed as:

[0052] J(p)=α(p)W(p)+(1-α(p))I(p) (1)

[0053] Wherein, p=(x, y) represents the pixel coordinates, α(p) represents the alpha matte value corresponding to the pixel coordinate p, and each alpha matte value represents the opacity of a pixel point in the watermarked image that varies with space.

[0054] According to formula (1), given W and α, the inverse process of adding watermark is performed at each pixel, that is, the process of removing the watermark from the watermarked image at each pixel to obtain the original image can be expressed as:

[0055]

[0056] For each pixel, there are three unknown variables (W, α, I) and a constraint formula (2). Given a watermarked image J, the problem of finding the watermarked image W is still unsolvable. However, if we assume that the watermarks in all the images to be identified are added to all the images in the set in a consistent way, then we can determine the image set {I k Each image to be identified in} has the same W and α:

[0057] J k =αW+(1-α)I k , k = 1, ..., K (3)

[0058] Wherein, K is the total number of pictures to be identified contained in the picture set to be identified.

[0059] Next, the watermark recognition method provided by the present disclosure is described, which can quickly recognize watermarks in pictures to be recognized from the same or different picture providing platforms.

[0060] Figure 1 A schematic flow chart of a watermark recognition method according to some embodiments of the present disclosure is shown. The method may be executed by a watermark recognition device, for example.

[0061] like Figure 1 As shown, the method of this embodiment includes steps 101-105.

[0062] In step 101, watermarked images associated with each preset platform are extracted respectively, and a corresponding watermark gradient is determined according to the watermarked images associated with each platform.

[0063] The preset platform is a preset picture providing platform, and pictures from a certain picture providing platform contain a watermark specific to the picture providing platform.

[0064] First, watermarked images associated with each preset platform are extracted respectively, and a rough bounding box is marked for the watermark in each extracted watermarked image. Then, the image gradient in the bounding box of the watermark in the watermarked image is calculated, and the image gradient in the bounding box is determined as the initialized watermark gradient of the corresponding platform.

[0065] Assume that there are L platforms in total, and the watermark set consisting of L watermarks corresponding to the L platforms can be expressed as Each image to be identified in the image collection The original image set should be represented as Where K is the total number of images to be identified in the image set to be identified. For each platform’s watermark W l(l∈{1, ..., L}), the same platform adds the watermark to the original image in a consistent manner, that is, the watermark for the same platform has a uniform alpha matte value. The alpha matte corresponding to each platform is represented by α l (l∈{1, ..., L}). Extract a watermarked image associated with each of the L platforms, and calculate the image gradient of the watermark in the L watermarked images as the initialization watermark gradient of each corresponding platform, for example, marked as

[0066] Generally, the way and location of adding watermarks to images provided by multiple platforms are uncertain, that is, the watermarks in the watermarked images corresponding to each platform may appear at any position of the image. In the above embodiment, by extracting a watermarked image from each platform as the initialized watermark gradient, a basis is provided for subsequently accurately identifying whether the images to be identified provided by different platforms contain watermarks and identifying which platform the watermark comes from.

[0067] In step 102, the watermark gradient is updated according to the chamfer distance map calculated using the current watermark gradient of each platform.

[0068] First, for each image to be identified in the set of images to be identified, the corresponding chamfer distance map is calculated using the current watermark gradient of each platform. Then, in the chamfer distance map associated with each image to be identified, the platform corresponding to the chamfer distance map with the current minimum chamfer distance is used as the associated platform of the image to be identified. Finally, in each platform, the watermark gradient of each image to be identified associated with each platform is calculated, and the median of the watermark gradient of each image to be identified is used as the updated watermark gradient of the corresponding platform.

[0069] The calculation of the chamfer distance includes: obtaining an edge map of each image to be identified in the image set to be identified, for example, the edge map can be obtained by using the Canny edge detector algorithm with a threshold of 0.4; then, calculating the Euclidean distance transform of the edge map corresponding to each image to be identified in turn to obtain a first transformation result; then, using the watermark gradient of each platform As the convolution kernel, the convolution operation is performed with the Euclidean distance transformation result to obtain the second transformation result; finally, for each pixel in the second transformation result of each image to be identified, the corresponding chamfer distance is calculated, and finally L chamfer distance maps {CD 1 , CD 2 , ..., CD L}.

[0070] In some embodiments, step 102 includes steps 1021 - 1023 .

[0071] like Figure 2 FIG. 1 is a flow chart of a method for updating the watermark gradient according to some embodiments of the present disclosure. The method of this embodiment includes steps 1021-1023.

[0072] In step 1021, for each picture to be identified in the set of pictures to be identified, the corresponding chamfer distance map is calculated using the current watermark gradient of each platform.

[0073] For each picture to be identified in the picture set to be identified, the current watermark gradient of each platform is used to calculate the corresponding chamfer distance map, including: performing Euclidean distance transformation on the edge map of each picture to be identified in the picture set to obtain a first transformation result; using the watermark gradient of each platform as a convolution kernel, performing a convolution operation with the first transformation result to obtain a second transformation result; calculating the chamfer distance of each pixel point of the second transformation result to obtain the chamfer distance map of the picture to be identified on the corresponding platform.

[0074] Among them, the watermark gradient of each platform is used as a convolution kernel to perform a convolution operation with the first transformation result to obtain a second transformation result, for example, including: first, the matrix corresponding to the watermark gradient (i.e., the convolution kernel) of each platform is horizontally and vertically flipped to obtain the transformation matrix corresponding to the watermark gradient of each platform; then, the transformation matrix corresponding to the watermark gradient is convolved with the first transformation result to obtain the second transformation result.

[0075] For example, the edge map of the image A to be identified is subjected to Euclidean distance transformation to obtain a first transformation result. For example, the first transformation result O obtained is expressed as Assume that the watermark gradient W of platform 1 is expressed as the matrix

[0076] Then, the process of using the watermark gradient of platform 1 as the convolution kernel and performing a convolution operation with the first transformation result to obtain the second transformation result can be expressed as follows: First, the matrix corresponding to the watermark gradient of platform 1 (i.e., the convolution kernel) is flipped horizontally and vertically to obtain the transformation matrix W′ corresponding to the watermark gradient of platform 1, which is expressed as Then, the transformation matrix W′ corresponding to the watermark gradient is convolved with the first transformation result O to obtain the second transformation result D, which is expressed as Right now,

[0077] in,

[0078] D 11 =O 11 ×W 22 +O12 ×W 21 +O 21 ×W 12 +O 22 ×W 11 ,

[0079] D 12 =O 12 ×W 22 +O 13 ×W 21 +O 22 ×W 12 +O 23 ×W 11 ,

[0080] D 21 =O 21 ×W 22 +O 22 ×W 21 +O 31 ×W 12 +O 32 ×W 11 ,

[0081] D 22 =O 22 ×W 22 +O 23 ×W 21 +O 32 ×W 12 +O 33 ×W 11 .

[0082] Calculating the chamfer distance of each pixel point of the second transformation result to obtain a chamfer distance map of the image to be identified on the corresponding platform includes: dividing each pixel point in the edge map into feature points and non-feature points, wherein the transformation value of the second transformation result of the feature point is less than a preset value, and the transformation value of the second transformation result of the non-feature point is not less than a preset value; calculating the chamfer distance from each non-feature point to the nearest feature point to obtain a chamfer distance map of the image to be identified on the corresponding platform.

[0083] In some embodiments, before calculating the chamfer distance map corresponding to each to-be-recognized picture, the method further includes preprocessing each to-be-recognized picture in the to-be-recognized picture set, and the preprocessing may include, for example, resizing the to-be-recognized pictures (for example, normalizing to the same size), data cleaning (for example, including processing to-be-recognized pictures with invalid values, and / or processing to-be-recognized pictures with missing values, etc.) and other operations. The preprocessing step may be performed selectively.

[0084] In step 1022, in the chamfer distance maps associated with each image to be identified, the platform corresponding to the chamfer distance map currently having the smallest chamfer distance is used as the associated platform of the image to be identified.

[0085] For example, in the chamfer distance map associated with each image to be identified, the platform corresponding to the chamfer distance map with the minimum chamfer distance is used as the associated platform of the image to be identified. They are roughly classified into {J {0} , J {1} , ..., J {L}}, where J {0} represents the set of images to be identified without watermarks, J {l} The associated platform of all the images to be identified in is platform l, that is, J {l} represents the set of pictures to be identified that are watermarked by platform l (l=1, ..., L). Correspondingly, the original picture set is classified into {I {0} , I {1} , ..., I {L}}, where I {0} =J {0} , that is, the picture to be identified without the watermark is the same as the corresponding original picture.

[0086] In step 1023, in each platform, the watermark gradients of the associated pictures to be identified are calculated respectively, and the median of the watermark gradients of the pictures to be identified is used as the updated watermark gradient of the corresponding platform.

[0087] Assume that the entire set of images to be identified is divided into L classes (i.e., divided into L platforms) according to step 1022, which can be marked as {J {0} , J {1} , ..., J {L}}. Treat the recognition image set {J {1} , J {2} , ..., J {L} For each category (i.e., each platform) in}, the median of the watermark gradients corresponding to all the images to be identified on the platform is calculated, and the median of the watermark gradients corresponding to all the images to be identified on the platform is obtained. That is, in the x direction and y direction of each pixel point p(xy), we have:

[0088]

[0089] Among them, K l Represents a watermarked picture collection J {l} The total number of images included, and, Among them, K 0 Indicates the total number of images without watermark.

[0090] In some embodiments, to remove The boundary region can be calculated, for example, , and using The edge map (for example, the Canny edge detection algorithm with a threshold of 0.4) corresponds to the bounding box pair to crop.

[0091] In step 103, the step of calculating the chamfer distance map using the current watermark gradient of each platform and updating the watermark gradient is repeated until a preset termination condition is met.

[0092] Here, satisfying the preset termination condition may be, for example, reaching a preset number of iterations (for example, may be set to 3).

[0093] In step 104, it is determined whether the picture to be identified contains a watermark according to the minimum value of the chamfer distance of each picture to be identified in the current chamfer distance map of all platforms.

[0094] According to the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms, determining whether the image to be identified contains a watermark includes: determining the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms in turn; if the minimum value of the chamfer distance of the corresponding image to be identified is greater than a preset threshold, determining that the image to be identified does not contain a watermark; if the minimum value of the chamfer distance of the corresponding image to be identified is not greater than the preset threshold, determining that the image to be identified contains a watermark.

[0095] For example, if the image to be identified contains a watermark, then its watermark k∈{1,...,K}; if there is no watermark in the image to be identified, then W k =0,α k =0, for example, it can be expressed as:

[0096] J k =α k W k +(1-α k )I k , k=1, ..., K;

[0097] in where α 0 =0 (5)

[0098] In step 105, if the image to be identified contains a watermark, all pixel points corresponding to the chamfer distances in the chamfer distance map of the image to be identified that are less than a preset threshold are determined as watermark positions of the image to be identified.

[0099] Suppose that the values ​​of the minimum distance pixel in the L chamfer distance maps of a certain image A to be identified are compared, for example, expressed as Examine the distance graph with the minimum value If the distance graph If the minimum pixel value of is greater than the preset threshold, it is determined that the image A to be identified does not contain a watermark; otherwise, it is determined that the image A to be identified contains a watermark, and all pixel points whose chamfer distances in the chamfer distance map are less than the preset threshold can be determined as the positions of the watermark. In addition, it can also be determined that the watermark of the image A to be identified comes from platform l.

[0100] In some embodiments, the watermark estimation image is reconstructed according to the determined watermark gradient. As the total number K of images to be identified increases, the watermark estimation image will gradually converge to the true watermark W m = the gradient of αW, and an offset is added. Therefore, for example, Poisson reconstruction can be used to reconstruct the watermark estimation image.

[0101] Steps 101-105 in the above embodiment can be represented by pseudo code of a programming language as follows:

[0102]

[0103] In the above embodiment, by calculating the chamfer distance, whether the image to be identified contains a watermark is identified according to the minimum value of the chamfer distance, and the watermark of the watermarked image can be automatically and quickly identified. In addition, when identifying, the image to be identified is associated with the corresponding image providing platform, which can not only identify watermarks added to the original image in a consistent manner (i.e., watermarks from the same platform), but also identify watermarks added to the original image in different ways (i.e., watermarks from multiple platforms), that is, it can be applicable to the identification of watermarks on multiple platforms.

[0104] An illustrative specific example of the above embodiment is given below.

[0105] Assume that there are pictures provided by platforms 1 and 2, and there are 5 pictures to be identified, marked as A, B, C, D, and E respectively.

[0106] (1) First, initialize the watermark gradient of each platform.

[0107] For example, a watermarked image is extracted from platform 1, and the watermark gradient of the extracted watermarked image is used as the initial watermark gradient of platform 1, for example, marked as Extract a watermarked image from platform 1, and use the watermark gradient of the extracted watermarked image as the initial watermark gradient of platform 2, for example, marked as

[0108] (2) Then, according to the initial watermark gradients of platform 1 and platform 2 respectively and Calculate the chamfer distance map of the images to be identified A, B, C, D, E, and determine the platform associated with the images to be identified A, B, C, D, E. (i.e., the first iteration)

[0109] For example, calculate the two chamfer distance maps of the image A to be recognized Assume that the image A to be identified includes four pixels. According to the initial watermark gradient of platform 1 Calculated chamfer distance graph According to the initial watermark gradient of platform 2 Calculated chamfer distance graph Therefore, it can be determined that the minimum chamfer distance of the image A to be identified is 0, and the chamfer distance value 0 is based on the watermark gradient of platform 1 Calculated. Then the platform 1 corresponding to the chamfer distance map with the minimum chamfer distance 0 is used as the associated platform of the image A to be identified, that is, the image A to be identified is divided into platform 1. After preliminary estimation, it means that the watermark of the image A to be identified may be the watermark from platform 1. Referring to the calculation method of the chamfer distance map of the image A to be identified, the chamfer distance maps of the images B, C, D, and E to be identified are calculated respectively. Assuming that the initial watermark gradient is used The calculated chamfer distance map divides the to-be-recognized images B and C into platform 1, and the to-be-recognized images D and E into platform 2. That is, after the first iteration, the to-be-recognized images associated with platform 1 are A, B, and C; and the to-be-recognized images associated with platform 2 are D and E. For example, it can be expressed as:

[0110] Platform 1 Platform 2 A, B, C D. E

[0111] (3) Next, the updated watermark gradient is calculated.

[0112] For example, in platform 1 and platform 2, the watermark gradients of the associated images to be identified are calculated respectively, and the median of the watermark gradients of the images to be identified is used as the updated watermark gradient of the corresponding platform. For example, the images to be identified associated with platform 1 are A, B, and C. The watermark gradients corresponding to A, B, and C are calculated to be -2, 2, and 3 respectively. The median of the watermark gradient is 2, so 2 is used as the updated watermark gradient of platform 1, marked as Reference Calculate the updated watermark gradient on platform 2

[0113] (4) Then, based on the updated watermark gradient, the chamfer distance map of the to-be-identified images A, B, C, D, and E is calculated, and the platform associated with the to-be-identified images A, B, C, D, and E is determined. (i.e., the second iteration)

[0114] For example, referring to the method of calculating the chamfer distance map in the first iteration, according to the updated watermark gradient of platform 1 and platform 2 and Calculate the chamfer distance graphs of the images to be identified A, B, C, D, and E. Assume that the minimum chamfer distances of the images to be identified A, B, C, D, and E obtained after calculation correspond to platforms 1, 1, 2, 2, and 2, respectively. That is, after the second iteration, the images to be identified associated with platform 1 are A and B; the images to be identified associated with platform 2 are C, D, and E. For example, it can be expressed as:

[0115] Platform 1 Platform 2 A. B C, D, E

[0116] (5) Calculate the updated watermark gradient, and calculate the chamfer distance map of the images to be identified A, B, C, D, and E based on the updated watermark gradient, and determine the platform associated with the images to be identified A, B, C, D, and E. (i.e., the third iteration)

[0117] For example, first refer to the method in step (3) to calculate the updated watermark gradients of platform 1 and platform 2 and Then, refer to the method in step (2) to calculate the chamfer distance map, and update the watermark gradients of platform 1 and platform 2. and Calculate the chamfer distance graphs of the images to be identified A, B, C, D, and E. Assume that the minimum chamfer distances of the images to be identified A, B, C, D, and E obtained through calculation correspond to platforms 1, 1, 2, 2, and 2, respectively. That is, after the third iteration, the images to be identified associated with platform 1 are A and B; the images to be identified associated with platform 2 are C, D, and E. For example, it can be expressed as:

[0118] Platform 1 Platform 2 A. B C, D, E

[0119] It can be seen that the division result of the third iteration is consistent with the division result of the second iteration, which reflects to some extent that the division has stabilized. Assume that the preset number of iterations is 3, and the iteration is terminated at this time. In practical applications, due to the large number of images to be identified and the number of platforms involved (hundreds, thousands, or even hundreds of millions), the number of iterations can be appropriately increased or decreased according to actual needs.

[0120] (6) Finally, based on the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms (i.e., the chamfer distance map calculated in the second iteration), it is determined whether the image to be identified contains a watermark.

[0121] For example, according to the calculation results of the chamfer distance map in the third iteration, the minimum values ​​of the chamfer distances of the to-be-recognized images A and B associated with platform 1 are 0 and 10 respectively; the minimum values ​​of the chamfer distances of the to-be-recognized images C, D, and E associated with platform 2 are 18, 0, and 2 respectively. Assuming the preset threshold is 5, since the minimum values ​​of the chamfer distances corresponding to the to-be-recognized images B and C are 10 and 18 respectively, both satisfying 10>5 and 18>5, it is determined that the to-be-recognized images B and C do not contain watermarks; in addition, the minimum values ​​of the chamfer distances corresponding to the to-be-recognized images A, D, and E are 0, 0, and 2 respectively, both less than the preset threshold 5, it is determined that the to-be-recognized images A, D, and E contain watermarks. In addition, all pixel points whose chamfer distances in the chamfer distance map corresponding to the to-be-recognized images A, D, and E are less than the preset value (for example, set to 3) can be determined as the watermark positions of the corresponding to-be-recognized images.

[0122] In some embodiments, if it is identified that the image to be identified contains a watermark, the estimated value of the watermark can be determined by jointly solving multiple objective functions of multiple watermarked images. That is, by solving the objective function, the estimated value of the watermark, the alpha matte value, and the original image are calculated. In this embodiment, only the image set containing the watermark is considered. {1} , J {2} , ..., J {L}}, decompose it into a watermark set {W 1 , W 2 , ..., W L}、Alpha Matte value set {α 1 , α 2 , ..., α L} and the original image set {I {1} , I {2} , ..., I {L} The inverse process of watermarking is expressed as a common solution and the original image set The optimization problem of , its objective function can be expressed as:

[0123]

[0124] Among them, L represents the watermarks of the watermarked image set from L platforms, K l Indicates watermarked picture set J {l} The number of images included, and: min means to find the minimum value. It means partial derivative.

[0125] Among them, E data Indicates the distance between the estimated watermark and the true watermark, for example, it can be expressed as:

[0126]

[0127] in, and They are regular terms of the original image I, watermark W, and Alpha Matte value α, for example, they can be defined as:

[0128]

[0129]

[0130]

[0131] Among them, I x and I Y is the horizontal gradient and vertical gradient of the watermarked image, W x and W y The horizontal and vertical gradients of the watermark image.

[0132] use Adjust watermark Compared with the initial estimate With similar gradient values, for example, it can be expressed as:

[0133]

[0134] Introducing auxiliary variables is the watermark image set J of the first category {l} The watermark of the kth image is required to be close to W l (l=1,...,L). Therefore, the objective function of the optimization problem can be transformed into:

[0135]

[0136] in:

[0137]

[0138] Using formula (13), the objective function formula (6) can be decomposed into smaller and simpler optimization problems.

[0139] For {J {1} , J {2} , ..., J {L} The following steps can be performed separately:

[0140] Step I: Decomposition of original image and watermark

[0141] In this step, keep W l and α l unchanged, minimized and and The relevant objective function is:

[0142]

[0143] Step II.: Watermark Update

[0144] By minimizing E aux To estimate J {l} The global watermark W l , W l Watermark with each image Stay consistent. {l} The global watermark W is calculated by The median value of

[0145] Step III: Matte Update

[0146] In this step, solve α l , and keeping other variables unchanged, the minimized objective function is:

[0147]

[0148] The iteratively reweighted least squares (IRLS) method is also used to solve the minimization problem.

[0149] The above steps I, II, and III are repeated several times until convergence. and The estimated value of .

[0150] In the above embodiment, the common and no watermark photo gallery The optimization problem can be solved automatically and reliably, while accurately estimating the watermark and alpha-matte The value of .

[0151] Figure 3 A schematic diagram of a watermark recognition device according to some embodiments of the present disclosure is shown.

[0152] like Figure 3As shown, the watermark recognition device 300 of this embodiment includes: a determination module 301, an update module 302, and an identification module 303.

[0153] The determination module 301 is configured to extract watermarked images associated with each preset platform respectively, and determine a corresponding watermark gradient according to the watermarked images associated with each platform;

[0154] The updating module 302 is configured to update the watermark gradient according to the chamfer distance map calculated by using the current watermark gradient of each platform, and repeatedly execute the step of updating the watermark gradient according to the chamfer distance map calculated by using the current watermark gradient of each platform until a preset termination condition is met, wherein updating the watermark gradient according to the chamfer distance map calculated by using the current watermark gradient of each platform comprises: for each picture to be identified in the set of pictures to be identified, respectively using the current watermark gradient of each platform to calculate the corresponding chamfer distance map; in the chamfer distance map associated with each picture to be identified, taking the platform corresponding to the chamfer distance map with the minimum chamfer distance as the associated platform of the picture to be identified; in each platform, respectively calculating the watermark gradient of each associated picture to be identified, and taking the median of the watermark gradient of each picture to be identified as the updated watermark gradient of the corresponding platform;

[0155] The identification module 303 is configured to determine whether the image to be identified contains a watermark according to the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms.

[0156] In the above embodiment, by calculating the chamfer distance, whether the image to be identified contains a watermark is identified according to the minimum value of the chamfer distance, and the watermark of the watermarked image can be automatically and quickly identified. In addition, when identifying, the image to be identified is associated with the corresponding image providing platform, which can not only identify watermarks added to the original image in a consistent manner (i.e., watermarks from the same platform), but also identify watermarks added to the original image in different ways (i.e., watermarks from multiple platforms), that is, it can be applicable to the identification of watermarks on multiple platforms.

[0157] Figure 4 A schematic diagram showing a watermark recognition device according to some other embodiments of the present disclosure.

[0158] like Figure 4 As shown, the watermark recognition device 400 of this embodiment includes: a memory 401 and a processor 402 coupled to the memory 401 , and the processor 402 is configured to execute the watermark recognition method in any of some embodiments of the present disclosure based on the instructions stored in the memory 401 .

[0159] The memory 401 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs.

[0160] The processor 402 is configured to execute the following watermark recognition method based on the instructions stored in the memory 401: first, extract the watermarked pictures associated with each preset platform respectively, and determine the corresponding watermark gradient according to the watermarked pictures associated with each platform; then, update the watermark gradient according to the chamfer distance map calculated using the current watermark gradient of each platform; repeat the step of updating the watermark gradient by using the chamfer distance map calculated using the current watermark gradient of each platform until the preset termination condition is met; finally, determine whether the picture to be identified contains a watermark according to the minimum value of the chamfer distance of each picture to be identified in the current chamfer distance map of all platforms.

[0161] Among them, updating the watermark gradient according to the chamfer distance map calculated using the current watermark gradient of each platform includes: first, for each picture to be identified in the set of pictures to be identified, the corresponding chamfer distance map is calculated using the current watermark gradient of each platform; then, in the chamfer distance map associated with each picture to be identified, the platform corresponding to the chamfer distance map with the minimum chamfer distance is used as the associated platform of the picture to be identified; then, in each platform, the watermark gradients of the associated pictures to be identified are calculated respectively, and the median value of the watermark gradients of each picture to be identified is used as the updated watermark gradient of the corresponding platform.

[0162] In some embodiments, determining whether a picture to be identified contains a watermark based on the minimum value of the chamfer distance of each picture to be identified in the current chamfer distance map of all platforms includes: determining the minimum value of the chamfer distance of each picture to be identified in the current chamfer distance map of all platforms in turn; if the minimum value of the chamfer distance of the corresponding picture to be identified is greater than a preset threshold, determining that the picture to be identified does not contain a watermark; if the minimum value of the chamfer distance of the corresponding picture to be identified is not greater than the preset threshold, determining that the picture to be identified contains a watermark.

[0163] In some embodiments, for each picture to be identified in the picture set to be identified, the corresponding chamfer distance map is calculated using the current watermark gradient of each platform, including: performing Euclidean distance transformation on the edge map of each picture to be identified in the picture set to be identified to obtain a first transformation result; using the watermark gradient of each platform as a convolution kernel, and performing a convolution operation with the first transformation result to obtain a second transformation result; calculating the chamfer distance of each pixel point of the second transformation result to obtain the chamfer distance map of the picture to be identified on the corresponding platform. Among them, calculating the chamfer distance of each pixel point of the second transformation result to obtain the chamfer distance map of the picture to be identified on the corresponding platform includes: dividing each pixel point in the edge map into feature points and non-feature points, wherein the transformation value of the second transformation result of the feature point is less than a preset value, and the transformation value of the second transformation result of the non-feature point is not less than a preset value; calculating the chamfer distance of each non-feature point to the nearest feature point to obtain the chamfer distance map of the picture to be identified on the corresponding platform.

[0164] In some embodiments, if the image to be identified contains a watermark, for example, all pixel points corresponding to the chamfer distances in the chamfer distance map of the image to be identified that are less than a preset threshold can be determined as the watermark positions of the image to be identified. In some embodiments, for example, a watermark estimation image can be reconstructed based on the determined watermark gradient.

[0165] The watermark recognition device 400 may also include an input / output interface 403, a network interface 404, a storage interface 405, etc. These interfaces 403, 404, 405 and the memory 401 and the processor 402 may be connected, for example, via a bus 406. The input / output interface 403 provides a connection interface for input / output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 404 provides a connection interface for various networked devices. The storage interface 404 provides a connection interface for external storage devices such as SD cards and USB flash drives.

[0166] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer non-transient readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer program code.

[0167] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0168] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0169] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0170] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.

Claims

1. A watermark recognition method, comprising: Extracting watermarked images associated with each preset platform respectively, and determining a watermark gradient for each platform according to the watermarked images associated with each platform; Calculating a chamfer distance map of each to-be-recognized picture in the to-be-recognized picture set by using the current watermark gradient of each platform, and updating the watermark gradient; Repeat the steps of calculating the chamfer distance map of each to-be-identified image according to the current watermark gradient of each platform and updating the watermark gradient until a preset termination condition is met; Determine whether the image to be identified contains a watermark according to the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms; Wherein, calculating the chamfer distance map of each to-be-identified picture by using the current watermark gradient of each platform, and updating the watermark gradient comprises: For each image to be identified in the set of images to be identified, the chamfer distance map of each image to be identified is calculated using the current watermark gradient of each platform; In the chamfer distance map associated with each image to be identified, the platform corresponding to the chamfer distance map currently having the smallest chamfer distance is used as the associated platform of the image to be identified; In each platform, the watermark gradients of the associated images to be identified are calculated respectively, and the median of the watermark gradients of the images to be identified is used as the updated watermark gradient of the corresponding platform; The step of determining whether the image to be identified contains a watermark according to the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms includes: Determine in sequence the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms; If the minimum value of the chamfer distance of the corresponding image to be identified is greater than a preset threshold, it is determined that the image to be identified does not contain a watermark; If the minimum value of the chamfer distance of the corresponding image to be identified is not greater than the preset threshold, it is determined that the image to be identified contains a watermark.

2. The watermark recognition method according to claim 1, characterized in that: Also includes: If the image to be identified contains a watermark, all pixel points corresponding to the chamfer distances in the chamfer distance map of the image to be identified that are less than a preset threshold are determined as watermark positions of the image to be identified.

3. The watermark recognition method according to claim 1, characterized in that: The step of calculating the chamfer distance map of each to-be-identified picture using the current watermark gradient of each platform for each to-be-identified picture in the to-be-identified picture set includes: Performing a Euclidean distance transformation on the edge graph of each to-be-recognized picture in the to-be-recognized picture set to obtain a first transformation result; Using the watermark gradient of each platform as a convolution kernel, and performing a convolution operation with the first transformation result to obtain a second transformation result; The chamfer distance of each pixel point of the second transformation result is calculated to obtain a chamfer distance map of the image to be identified on the corresponding platform.

4. The watermark recognition method according to claim 3, characterized in that: The calculating the chamfer distance of each pixel point of the second transformation result to obtain the chamfer distance map of the image to be identified on the corresponding platform includes: Dividing each pixel point in the edge map into a feature point and a non-feature point, wherein the transformation value of the second transformation result of the feature point is less than a preset value, and the transformation value of the second transformation result of the non-feature point is not less than the preset value; The chamfer distance from each non-feature point to the nearest feature point is calculated to obtain a chamfer distance map of the image to be identified on the corresponding platform.

5. The watermark recognition method according to claim 1, characterized in that: Also includes: According to the determined watermark gradient, the watermark estimation image is reconstructed.

6. The watermark recognition method according to claim 1, characterized in that: Also includes: If the image to be identified contains a watermark, an estimated value of the watermark is determined by jointly solving the objective functions of multiple images with watermarks.

7. A watermark recognition device, comprising: A determination module is configured to extract watermarked images associated with each preset platform respectively, and determine a watermark gradient for each platform according to the watermarked images associated with each platform; The updating module is configured to calculate the chamfer distance map of each picture to be identified in the picture set to be identified by using the current watermark gradient of each platform, update the watermark gradient, and repeatedly perform the step of calculating the chamfer distance map of each picture to be identified by using the current watermark gradient of each platform and updating the watermark gradient until a preset termination condition is met, wherein the updating of the watermark gradient by calculating the chamfer distance map of each picture to be identified by using the current watermark gradient of each platform comprises: for each picture to be identified in the picture set to be identified, respectively calculate the chamfer distance map of each picture to be identified by using the current watermark gradient of each platform; in the chamfer distance map associated with each picture to be identified, take the platform corresponding to the chamfer distance map with the minimum chamfer distance as the associated platform of the picture to be identified; in each platform, respectively calculate the watermark gradient of each associated picture to be identified, and take the median value of the watermark gradient of each picture to be identified as the updated watermark gradient of the corresponding platform; The identification module is configured to determine whether the image to be identified contains a watermark based on the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms, wherein the minimum value of the chamfer distance of each image to be identified in the current chamfer distance map of all platforms is determined in turn, and if the minimum value of the chamfer distance of the corresponding image to be identified is greater than a preset threshold, it is determined that the image to be identified does not contain a watermark; if the minimum value of the chamfer distance of the corresponding image to be identified is not greater than the preset threshold, it is determined that the image to be identified contains a watermark.

8. The watermark recognition method according to claim 7, characterized in that: The identification module is further configured to: If the image to be identified contains a watermark, all pixel points corresponding to the chamfer distances in the chamfer distance map of the image to be identified that are less than a preset threshold are determined as watermark positions of the image to be identified.

9. The watermark recognition method according to claim 7, characterized in that: The update module is configured to: Performing a Euclidean distance transformation on the edge graph of each to-be-recognized picture in the to-be-recognized picture set to obtain a first transformation result; Using the watermark gradient of each platform as a convolution kernel, and performing a convolution operation with the first transformation result to obtain a second transformation result; The chamfer distance of each pixel point of the second transformation result is calculated to obtain a chamfer distance map of the image to be identified on the corresponding platform.

10. The watermark recognition method according to claim 9, characterized in that: The update module is configured to: Dividing each pixel point in the edge map into a feature point and a non-feature point, wherein the transformation value of the second transformation result of the feature point is less than a preset value, and the transformation value of the second transformation result of the non-feature point is not less than the preset value; The chamfer distance from each non-feature point to the nearest feature point is calculated to obtain a chamfer distance map of the image to be identified on the corresponding platform.

11. The watermark recognition method according to claim 7, characterized in that: The recognition module is further configured to reconstruct a watermark estimation image according to the determined watermark gradient.

12. The watermark recognition method according to claim 7, characterized in that: The recognition module is further configured to: if the image to be recognized contains a watermark, determine an estimated value of the watermark by jointly solving the objective function of multiple watermarked images.

13. A watermark recognition device, comprising: Memory; as well as A processor coupled to the memory, wherein the processor is configured to execute the watermark recognition method according to any one of claims 1 to 6 based on instructions stored in the memory.

14. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the watermark recognition method according to any one of claims 1 to 6.