Watermark embedding method, device, equipment and storage medium
By transforming and Poisson fusion the gradient field of the image digital watermark, an irreversible fusion image is generated, which solves the problem of the image digital watermark being easily removed and improves the effectiveness of copyright protection.
Patent Information
- Application Number
- CN202110322008.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-25
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2041-03-25
AI Technical Summary
Existing image digital watermarks are easily removed, resulting in less effective copyright protection.
By obtaining the gradient field of the watermark and the gradient field of the source image, image transformation and Poisson fusion are performed to generate an irreversible fusion image, ensuring that the watermark cannot recover the source image through image processing technology.
It improves the difficulty of watermark removal, enhances the effectiveness of copyright protection, and maintains the recognition of watermarks.
Smart Images

Figure CN113012016B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital watermark technology, and in particular to a watermark embedding method, device, equipment and storage medium. Background Art
[0002] Digital watermarking is a content-based, non-cryptographic computer information hiding technique. It embeds identifying information (i.e., a digital watermark) directly or indirectly into digital media (including multimedia, documents, and software). This does not affect the original media's usability and is difficult to detect or modify. A digital watermark can be any known form, such as a numerical value, text, or image. Digital watermarking is an effective method for protecting information security, anti-counterfeiting and traceability, and copyright protection.
[0003] Image digital watermarking technology is divided into explicit watermarking technology and implicit watermarking technology. In relevant explicit watermarking technology, the image digital watermark (such as text or image) is usually combined with the source image to obtain an image embedded with the watermark, which can produce a partially transparent visual effect.
[0004] However, the above method is a process of combining a digital watermark with a source image. The source image can be restored from the image embedded with the watermark using image processing technology. The image digital watermark is easy to remove and the effectiveness of copyright protection is low. Summary of the Invention
[0005] The present invention provides a watermark embedding method, device, equipment and storage medium to solve the problem that image digital watermarks are easily removed.
[0006] In a first aspect, the present invention provides a watermark embedding method, comprising:
[0007] Get the gradient field of the watermark and the gradient field of the source image;
[0008] Performing image transformation on the gradient field of the watermark to obtain the transformed gradient field of the watermark;
[0009] According to the transformed gradient field of the watermark and the gradient field of the source image, Poisson fusion is performed on the watermark and the source image to obtain a fused image.
[0010] Optionally, the image transformation includes any one of affine transformation, elastic transformation and thin plate spline interpolation transformation.
[0011] Optionally, the image transformation includes thin plate spline interpolation transformation, and performing image transformation on the gradient field of the watermark to obtain the transformed gradient field of the watermark includes:
[0012] Thin plate spline interpolation transformation is performed on the x-component gradient map and the y-component gradient map of the gradient field of the watermark respectively to obtain the transformed gradient field of the watermark.
[0013] Optionally, performing thin plate spline interpolation transformation on the x-component gradient map and the y-component gradient map of the gradient field of the watermark to obtain the transformed gradient field of the watermark includes:
[0014] The x-component gradient map and the y-component gradient map are transformed as follows to obtain the transformed gradient field of the watermark:
[0015] Dividing the component gradient map into equal intervals to obtain N=i*j initial control points, where the component gradient map is the x-component gradient map or the y-component gradient map, wherein the control point interval in the first direction is w / i, and the control point interval in the second direction is h / j, where w and h are the first direction length and the second direction length of the component gradient map, respectively, and i and j are preset positive integers;
[0016] Randomly perturb the N initial control points within a circle with a radius of R to obtain the N perturbed control points, where R is the minimum value of w / i and h / j;
[0017] The N initial control points are respectively deformed to corresponding positions of the N perturbed control points through thin plate spline interpolation transformation.
[0018] Optionally, performing Poisson fusion on the watermark and the source image according to the transformed gradient field of the watermark and the gradient field of the source image to obtain a fused image includes:
[0019] determining a gradient field of the fused image according to the gradient field of the transformed watermark and the gradient field of the source image;
[0020] The divergence of the gradient field of the fused image is calculated, and the Poisson equation is solved according to the divergence of the gradient field of the fused image and the Dirichlet boundary condition to obtain the fused image.
[0021] Optionally, determining the gradient field of the fused image according to the gradient field of the transformed watermark and the gradient field of the source image includes:
[0022] According to the gradient field of the transformed watermark and the gradient field of the source image, the gradient field V(X) of the fused image is determined by the following formula:
[0023] or,
[0024]
[0025] in, is the gradient field of the source image, is the gradient field of the transformed watermark, and α is the fusion weight.
[0026] In a second aspect, the present invention provides a watermark embedding device, comprising:
[0027] An acquisition module, used for acquiring the gradient field of the watermark and the gradient field of the source image;
[0028] A transformation module, configured to perform image transformation on the gradient field of the watermark to obtain the transformed gradient field of the watermark;
[0029] A fusion module is used to perform Poisson fusion on the watermark and the source image according to the gradient field of the transformed watermark and the gradient field of the source image to obtain a fused image.
[0030] Optionally, the image transformation includes any one of affine transformation, elastic transformation and thin plate spline interpolation transformation.
[0031] Optionally, the image transformation includes a thin plate spline interpolation transformation, and the transformation module is used to:
[0032] Thin plate spline interpolation transformation is performed on the x-component gradient map and the y-component gradient map of the gradient field of the watermark respectively to obtain the transformed gradient field of the watermark.
[0033] Optionally, the transformation module is used to:
[0034] The x-component gradient map and the y-component gradient map are respectively transformed as follows to obtain the gradient field of the transformed watermark:
[0035] Dividing the component gradient map into equal intervals to obtain N=i*j initial control points, where the component gradient map is the x-component gradient map or the y-component gradient map, wherein the control point interval in the first direction is w / i, and the control point interval in the second direction is h / j, where w and h are the first direction length and the second direction length of the component gradient map, respectively, and i and j are preset positive integers;
[0036] Randomly perturb the N initial control points within a circle with a radius of R to obtain the N perturbed control points, where R is the minimum value of w / i and h / j;
[0037] The N initial control points are respectively deformed to corresponding positions of the N perturbed control points through thin plate spline interpolation transformation.
[0038] Optionally, the fusion module includes:
[0039] a determining unit, configured to determine a gradient field of the fused image according to the gradient field of the transformed watermark and the gradient field of the source image;
[0040] The calculation unit is used to calculate the divergence of the gradient field of the fused image, and solve the Poisson equation according to the divergence of the gradient field of the fused image and the Dirichlet boundary condition to obtain the fused image.
[0041] Optionally, the determining unit is configured to:
[0042] According to the gradient field of the transformed watermark and the gradient field of the source image, the gradient field V(X) of the fused image is determined by the following formula:
[0043] or,
[0044]
[0045] in, is the gradient field of the source image, is the gradient field of the transformed watermark, and α is the fusion weight.
[0046] In a third aspect, the present invention provides an electronic device, comprising:
[0047] processor; and
[0048] a memory for storing executable instructions of the processor;
[0049] The processor is configured to execute the watermark embedding method described in any one of the first aspect or possible implementations of the first aspect by executing the executable instructions.
[0050] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the watermark embedding method described in the first aspect or any one of the possible implementations of the first aspect.
[0051] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the watermark embedding method described in the first aspect or any one of the possible implementations of the first aspect.
[0052] The watermark embedding method, apparatus, device, and storage medium provided by the present invention first obtain the gradient field of the watermark and the gradient field of the source image, perform image transformation on the watermark gradient field to obtain the transformed gradient field of the watermark, and then perform Poisson fusion on the watermark and the source image based on the transformed gradient field of the watermark and the gradient field of the source image to obtain a fused image. Because the Poisson fusion process uses the gradient field of the watermark after image transformation, the transformation process is irreversible, and the fused image does not retain the complete pixel information of the covered area of the source image. Therefore, even if the watermark is obtained, it is impossible to simply recover the source image from the fused image using prior assumptions such as the continuity of natural image gradients, which increases the difficulty of watermark removal. This improves the effectiveness of copyright protection while maintaining the recognizability of the watermark. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 A schematic diagram of an application scenario of the watermark embedding method provided by an embodiment of the present invention;
[0054] Figure 2 A flow chart of a watermark embedding method provided by an embodiment of the present invention;
[0055] Figure 3 A flow chart of an embodiment of a watermark embedding method provided by an embodiment of the present invention;
[0056] Figure 4 A flow chart of an embodiment of a watermark embedding method provided by an embodiment of the present invention;
[0057] Figure 5 A schematic diagram of the initial control points on a gradient map;
[0058] Figure 6 for Figure 5 Schematic diagram of N perturbed control points corresponding to N initial control points shown;
[0059] Figure 7 A flow chart of an embodiment of a watermark embedding method provided by an embodiment of the present invention;
[0060] Figure 8 is an example diagram of a watermark and a source image;
[0061] Figure 9 A flow chart of a watermark embedding method provided by an embodiment of the present invention;
[0062] Figure 10 For Figure 7 Schematic diagram of the fused image corresponding to the watermark and the source image shown;
[0063] Figure 11 A schematic structural diagram of a watermark embedding device provided by an embodiment of the present invention;
[0064] Figure 12 A schematic structural diagram of a watermark embedding device provided by an embodiment of the present invention;
[0065] Figure 13 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0066] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to be used to explain the present invention, but should not be understood as limiting the present invention.
[0067] The terms "first" and "second" and the like in the description, claims, and drawings of the embodiments of the present invention are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the embodiments of the present invention described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or apparatus.
[0068] First, some terms used in the embodiments of the present invention are explained below to facilitate understanding by those skilled in the art.
[0069] 1. Gradient field, also referred to as gradient map or image gradient. Image gradient can regard the image as a two-dimensional discrete function. Image gradient is actually the derivative of this two-dimensional discrete function.
[0070] Specifically, the gradient field of a pixel point (x, y) includes two components g x (x,y) and g y (x,y):
[0071]
[0072] Among them, I(x+1,y) is the pixel value of the pixel point (x+1,y), I(x-1,y) is the pixel value of the pixel point (x-1,y), I(x,y+1) is the pixel value of the pixel point (x,y+1), and I(x,y-1) is the pixel value of the pixel point (x,y-1).
[0073] 2. Watermark, also known as digital watermark, can be any known form of watermark, such as a value, text or image.
[0074] Digital watermarking technology is an effective way to protect information security, achieve anti-counterfeiting and traceability, and protect copyrights. Therefore, when obtaining an image embedded with a watermark through digital watermarking technology, it is necessary to ensure that the watermark recognition and the difficulty of removing the digital watermark are maintained to ensure the effectiveness of copyright protection. In related technologies, a digital watermark is combined with a source image to obtain an image embedded with a watermark. However, this method does not damage the complete pixel information of the covered area of the source image. The source image can be restored from the image embedded with the watermark using image processing technology. The image digital watermark is easy to be removed, and the effectiveness of copyright protection is low. To solve this problem, an embodiment of the present invention provides a watermark embedding method, device, equipment, and storage medium. The method first obtains the gradient field of the watermark and the gradient field of the source image, performs image transformation on the gradient field of the watermark, obtains the gradient field of the transformed watermark, and then performs Poisson fusion on the watermark and the source image based on the gradient field of the transformed watermark and the gradient field of the source image to obtain a fused image. Since the Poisson fusion process uses the gradient field of the watermark after image transformation, the transformation process is irreversible, and the fused image does not retain the complete pixel information of the covered area of the source image. Therefore, even if the watermark is obtained, it is impossible to simply restore the source image from the fused image based on prior assumptions such as the continuity of natural image gradients, which increases the difficulty of watermark removal. This improves the effectiveness of copyright protection while maintaining the watermark's recognizability.
[0075] Next, an example is given to illustrate the application scenario involved in the embodiment of the present invention.
[0076] The watermark embedding method provided by the embodiment of the present invention can be applied to at least the following application scenarios, which will be described below with reference to the accompanying drawings.
[0077] For example, Figure 1 A schematic diagram of an application scenario of the watermark embedding method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown in the figure, the input is watermark 1 and source image 2. The goal is to embed watermark 1 into source image 2 (also called source image) to obtain the output of fused image 3 after embedding watermark. After embedding watermark 1, the usability of source image 2 is not affected. Watermark 1 can be a value, text or image, etc. Figure 1 The watermark 1 is taken as the text "TEXT". It should be noted that the watermark 1 can also be an image, or the watermark 1 can also be text and an image.
[0078] The following describes in detail the technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems using specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following embodiments of the present invention are described in conjunction with the accompanying drawings.
[0079] Figure 2This is a flow chart of a watermark embedding method provided by an embodiment of the present invention. The watermark embedding method can be executed by a watermark embedding device, which can be implemented in software and / or hardware. The watermark embedding device can be an electronic device or a chip or circuit of an electronic device. Figure 2 As shown, the method of this embodiment may include:
[0080] S101: Obtain the gradient field of the watermark and the gradient field of the source image.
[0081] Specifically, the source image may be a background image, an image to be embedded with a watermark. Obtaining the gradient field of the watermark may be by calculating the gradient field of each pixel in the watermark to obtain the gradient field of the watermark. Obtaining the gradient field of the source image may be by calculating the gradient field of each pixel in the source image to obtain the gradient field of the source image.
[0082] Among them, the gradient field of a pixel point (x, y) includes two components g x (x,y) and g y (x,y):
[0083] Among them, I(x+1,y), I(x-1,y), I(x,y+1) and I(x,y-1) can be referred to the above explanation.
[0084] S102: Perform image transformation on the gradient field of the watermark to obtain a transformed gradient field of the watermark.
[0085] Specifically, the image transformation in this embodiment can include any one of an affine transformation, an elastic transformation, and a thin-plate spline interpolation transformation. Affine transformation, elastic transformation, and thin-plate spline interpolation transformation are all random transformations. The watermark gradient field includes an x-component gradient map and a y-component gradient map. When performing image transformation on the watermark gradient field, the x-component gradient map and the y-component gradient map can be separately transformed to obtain the transformed watermark gradient field.
[0086] S103 , performing Poisson fusion on the watermark and the source image according to the transformed gradient field of the watermark and the gradient field of the source image to obtain a fused image.
[0087] Specifically, the outline of a watermark is typically relatively simple. After obtaining a fused image embedded with the watermark through alpha synthesis, the source image can be restored from the fused image by calculating the watermark's gradient field and applying prior assumptions such as the continuity of natural image gradients. However, in this embodiment, the image transformation (such as any of the affine transformations, elastic transformations, and thin-plate spline interpolation transformations) is random and irreversible. Therefore, even if the watermark is obtained from the fused image, the calculated watermark's gradient field will be different from the transformed watermark's gradient field used in Poisson fusion. Therefore, it is impossible to simply restore the source image from the fused image using prior assumptions such as the continuity of natural image gradients, and the watermark cannot be simply removed.
[0088] The watermark embedding method provided in this embodiment first obtains the gradient field of the watermark and the gradient field of the source image, performs an image transformation on the gradient field of the watermark to obtain the transformed gradient field of the watermark, and then performs Poisson fusion on the watermark and the source image based on the transformed gradient field of the watermark and the gradient field of the source image to obtain a fused image. Because the Poisson fusion process uses the gradient field of the watermark after image transformation, the transformation process is irreversible, and the fused image does not retain the complete pixel information of the covered area of the source image. Therefore, even if the watermark is obtained from the fused image, it is impossible to simply restore the source image from the fused image through prior assumptions such as the continuity of natural image gradients, which increases the difficulty of watermark removal. This improves the effectiveness of copyright protection while maintaining the recognizability of the watermark.
[0089] Figure 3 A flow chart of a watermark embedding method embodiment provided by the present invention is as follows Figure 3 As shown, in this embodiment, the image transformation takes thin plate spline interpolation transformation as an example, and the gradient field of the watermark includes an x-component gradient map and a y-component gradient map, as shown in FIG. Figure 3 As shown, the method of this embodiment is Figure 2 Based on the method shown, optionally, the above S102 can be implemented by the following steps:
[0090] S102', performing thin plate spline interpolation transformation on the x-component gradient map and the y-component gradient map of the gradient field of the watermark respectively to obtain the transformed gradient field of the watermark.
[0091] The watermark embedding method provided in this embodiment first obtains the gradient field of the watermark and the gradient field of the source image, performs a thin plate spline interpolation transformation on the watermark gradient field to obtain the transformed gradient field of the watermark, and then performs Poisson fusion on the watermark and the source image based on the transformed gradient field of the watermark and the gradient field of the source image to obtain a fused image. Because the Poisson fusion process uses the gradient field of the watermark after the thin plate spline interpolation transformation, the transformation process is irreversible, and the fused image does not retain the complete pixel information of the covered area of the source image. Therefore, even if the watermark is obtained from the fused image, it is impossible to simply restore the source image from the fused image through prior assumptions such as the continuity of natural image gradients, which increases the difficulty of removing the watermark. This improves the effectiveness of copyright protection while maintaining the recognizability of the watermark.
[0092] Figure 4 A flow chart of a watermark embedding method embodiment provided by the present invention is as follows Figure 4 As shown, the method of this embodiment is Figure 3 Based on the method shown, optionally, the above S102' can be implemented by the following steps:
[0093] S1021, perform the following transformations on the x-component gradient map and the y-component gradient map respectively to obtain the transformed gradient field of the watermark:
[0094] The component gradient map is divided into equal intervals to obtain N=i*j initial control points. The component gradient map is an x-component gradient map or a y-component gradient map, wherein the first direction control point interval is w / i, and the second direction control point interval is h / j, where w and h are the first direction length and the second direction length of the component gradient map respectively, and i and j are preset positive integers.
[0095] The first direction may be a width direction, and the second direction may be a height direction. Figure 5 is a schematic diagram of the initial control points on the gradient map, such as Figure 5 As shown, Figure 5 In the example, the first direction is the width direction and the second direction is the height direction. The number of initial control points N is 81. i and j are preset positive integers and can take any value. It should be noted that Figure 5 This is just an example.
[0096] S1022. Randomly perturb the N initial control points within a circle with a radius of R to obtain N perturbed control points, where R is the minimum value of w / i and h / j.
[0097] Specifically, each initial control point is independently and randomly perturbed within a circle with a radius of R. Figure 5 Take the initial control points shown as an example, Figure 6 for Figure 5The schematic diagram of N perturbed control points corresponding to N initial control points is shown. The perturbation distances of different control points can be the same or different. Therefore, the randomness of the control point perturbation is very large, and the thin plate spline interpolation transformation process is irreversible.
[0098] S1023. Transform the N initial control points to corresponding positions of the N perturbed control points respectively through thin plate spline interpolation transformation.
[0099] In this embodiment, thin-plate spline interpolation is performed on the x-component gradient map and the y-component gradient map to obtain the transformed watermark gradient field. In S1022, the N initial control points are randomly perturbed within a circle of radius R. Therefore, it can be seen that the thin-plate spline interpolation transformation is random and the transformation process is irreversible. Therefore, even if a watermark is obtained from the fused image obtained by the method of this embodiment, the calculated watermark gradient field is different from the transformed watermark gradient field used in Poisson fusion. Therefore, it is impossible to simply recover the source image from the fused image using prior assumptions such as the continuity of natural image gradients, and it is impossible to simply remove the watermark.
[0100] Figure 7 A flow chart of a watermark embedding method embodiment provided by the present invention is as follows Figure 7 As shown, the method of this embodiment is Figure 2-Figure 4 Based on any of the methods shown, optionally, the above S103 can be implemented by the following steps:
[0101] S1031 : Determine the gradient field of the fused image according to the transformed gradient field of the watermark and the gradient field of the source image.
[0102] Specifically, as an implementable manner, S1031 may be:
[0103] According to the gradient field of the transformed watermark and the gradient field of the source image, the gradient field V(X) of the fused image is determined by the following formula:
[0104] or,
[0105]
[0106] in, is the gradient field of the source image, is the gradient field of the transformed watermark, and α is the fusion weight.
[0107] S1032: Calculate the divergence of the gradient field of the fused image, solve the Poisson equation according to the divergence of the gradient field of the fused image and the Dirichlet boundary condition, and obtain the fused image.
[0108] Specifically, Poisson's equation is: Where Ω is the fusion area, is the Dirichlet boundary condition, divV(X)overΩ means finding the divergence of V(X) in the fusion region Ω, and solving the Poisson equation according to the divergence of the gradient field of the fused image and the boundary condition to obtain the fused image.
[0109] In this embodiment, the gradient field of the fused image is determined based on the gradient field of the watermark after thin-plate spline interpolation and the gradient field of the source image. The fused image is obtained by solving the Poisson equation based on the divergence of the gradient field of the fused image and the Dirichlet boundary condition. The thin-plate spline interpolation transformation is random and the transformation process is irreversible. Therefore, even if a watermark is obtained from the fused image obtained by the method of this embodiment, the calculated gradient field of the watermark is different from the gradient field of the transformed watermark used in Poisson fusion. Therefore, it is impossible to simply restore the source image from the fused image using prior assumptions such as the continuity of natural image gradients, and the watermark cannot be simply removed. This increases the difficulty of removing the watermark, thereby improving the effectiveness of copyright protection while maintaining the watermark's recognizability.
[0110] The detailed process of the watermark embedding method provided by the present invention is described below with reference to a specific embodiment.
[0111] In this embodiment, Figure 8 is an example diagram of a watermark and source image, such as Figure 8 As shown, watermark 1 is the text "TEXT", and the source image is Figure 8 The blank image shown in 2, by Figure 9 The watermark embedding method shown in the figure can embed the watermark 1 into the blank image 2 to obtain a fused image. It should be noted that Figure 8 The source image in the figure is just an example. The source image can also be other background images. After the watermark is embedded in the source image, the display will be different depending on the color of the coverage area of the background image.
[0112] Figure 9 This is a flow chart of a watermark embedding method provided by an embodiment of the present invention. The watermark embedding method can be executed by a watermark embedding device, which can be implemented in software and / or hardware. The watermark embedding device can be an electronic device or a chip or circuit of an electronic device. Figure 9 As shown, the method of this embodiment may include:
[0113] S201: Obtain the gradient field of the watermark and the gradient field of the source image.
[0114] The specific acquisition process can be found in the description of S101 and will not be repeated here.
[0115] S202: The gradient field of the watermark includes an x-component gradient map and a y-component gradient map. The x-component gradient map and the y-component gradient map are transformed as follows to obtain the transformed gradient field of the watermark:
[0116] The component gradient map is divided into equal intervals to obtain N=i*j initial control points. The component gradient map is an x-component gradient map or a y-component gradient map, wherein the first direction control point interval is w / i, and the second direction control point interval is h / j, where w and h are the first direction length and the second direction length of the component gradient map respectively, and i and j are preset positive integers.
[0117] S203. Randomly perturb the N initial control points within a circle with a radius of R to obtain N perturbed control points, where R is the minimum value of w / i and h / j.
[0118] S204 , deforming the N initial control points to corresponding positions of the N perturbed control points respectively through thin plate spline interpolation transformation.
[0119] For the specific process, see Figure 4 The description in the illustrated embodiment will not be repeated here.
[0120] S205 : Determine the gradient field of the fused image according to the transformed gradient field of the watermark and the gradient field of the source image.
[0121] S206 , calculating the divergence of the gradient field of the fused image, solving the Poisson equation according to the divergence of the gradient field of the fused image and the Dirichlet boundary condition, and obtaining the fused image.
[0122] The specific process of S205-S206 can be found in Figure 7 The description in the illustrated embodiment will not be repeated here.
[0123] Figure 10 For Figure 8 The schematic diagram of the fused image corresponding to the watermark and the source image is shown in Figure 10 As shown, the watermark is embedded in a set area of the source image, and the watermark displayed in the fused image is compared Figure 8 The watermark shown is variable. Even if a watermark is obtained from the fused image obtained by the method of this embodiment, the calculated watermark gradient field is different from the gradient field of the transformed watermark used in Poisson fusion. Therefore, it is impossible to simply restore the source image from the fused image based on prior assumptions such as the continuity of natural image gradients, and the watermark cannot be simply removed. This increases the difficulty of watermark removal, thereby improving the effectiveness of copyright protection while maintaining the watermark's recognizability.
[0124] The following are device embodiments of the present application, which can be used to execute the above method embodiments of the present application. For details not disclosed in the device embodiments of the present application, reference can be made to the above method embodiments of the present application.
[0125] Figure 11 A schematic diagram of the structure of a watermark embedding device provided by an embodiment of the present invention is shown in FIG. Figure 11 As shown, the apparatus of this embodiment may include: an acquisition module 11, a transformation module 12 and a fusion module 13, wherein the acquisition module 11 is used to acquire the gradient field of the watermark and the gradient field of the source image.
[0126] The transformation module 12 is used to perform image transformation on the gradient field of the watermark to obtain the transformed gradient field of the watermark.
[0127] The fusion module 13 is used to perform Poisson fusion on the watermark and the source image according to the transformed gradient field of the watermark and the gradient field of the source image to obtain a fused image.
[0128] In a possible implementation, the image transformation includes any one of affine transformation, elastic transformation, and thin plate spline interpolation transformation.
[0129] In a possible implementation, the image transformation includes a thin plate spline interpolation transformation, and the transformation module 12 is configured to:
[0130] Thin plate spline interpolation transformation is performed on the x-component gradient map and the y-component gradient map of the gradient field of the watermark respectively to obtain the transformed gradient field of the watermark.
[0131] In a possible implementation, the transformation module 12 is configured to:
[0132] The x-component gradient map and the y-component gradient map are transformed as follows to obtain the transformed gradient field of the watermark.
[0133] The component gradient map is divided into equal intervals to obtain N=i*j initial control points. The component gradient map is an x-component gradient map or a y-component gradient map, wherein the first direction control point interval is w / i, and the second direction control point interval is h / j, w and h are the first direction length and the second direction length of the component gradient map respectively, and i and j are preset positive integers.
[0134] Randomly perturb the N initial control points within a circle with a radius of R to obtain N perturbed control points, where R is the minimum value of w / i and h / j.
[0135] The N initial control points are deformed to the corresponding positions of the N perturbed control points through thin plate spline interpolation transformation.
[0136] The device provided in the embodiment of the present invention can execute the above method embodiment. Its specific implementation principles and technical effects can be found in the above method embodiment, and this embodiment will not be repeated here.
[0137] Figure 12 A schematic diagram of the structure of a watermark embedding device provided by an embodiment of the present invention is shown in FIG. Figure 12 As shown, the device of this embodiment is Figure 11 On the basis of the device shown, further, the fusion module 13 may include: a determination unit 131 and a calculation unit 132, wherein,
[0138] The determining unit 131 is configured to determine the gradient field of the fused image according to the transformed gradient field of the watermark and the gradient field of the source image.
[0139] The calculation unit 132 is used to calculate the divergence of the gradient field of the fused image, and solve the Poisson equation according to the divergence of the gradient field of the fused image and the Dirichlet boundary condition to obtain the fused image.
[0140] In a possible implementation, the determining unit 131 is configured to:
[0141] According to the gradient field of the transformed watermark and the gradient field of the source image, the gradient field V(X) of the fused image is determined by the following formula:
[0142] or,
[0143]
[0144] in, is the gradient field of the source image, is the gradient field of the transformed watermark, and α is the fusion weight.
[0145] The device provided in the embodiment of the present invention can execute the above method embodiment. Its specific implementation principles and technical effects can be found in the above method embodiment, and this embodiment will not be repeated here.
[0146] It should be noted that it should be understood that the division of the various modules of the above device is merely a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. Moreover, these modules can all be implemented in the form of software called by a processing element; or they can all be implemented in the form of hardware; or some modules can be implemented in the form of software called by a processing element, and some modules can be implemented in the form of hardware. For example, the processing module can be a separately established processing element, or it can be integrated into a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called by a processing element of the above device to perform the functions of the above processing module. The implementation of other modules is similar. In addition, these modules can all or partly be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the hardware integrated logic circuit in the processor element or by instructions in the form of software.
[0147] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented by scheduling program code on a processing element, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0148] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).
[0149] Figure 13 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention is shown in FIG. Figure 13 As shown, the electronic device of this embodiment may include a processor 21 and a memory 22.
[0150] The memory 22 is used to store executable instructions of the processor 21 .
[0151] The processor 21 is configured to perform the watermark embedding method in the above method embodiment by executing executable instructions.
[0152] Optionally, the memory 22 may be independent or integrated with the processor 21 .
[0153] When the memory 22 is a device independent of the processor 21, the watermark embedding apparatus of this embodiment may further include:
[0154] The bus 23 is used to connect the memory 22 and the processor 21 .
[0155] Optionally, the apparatus of this embodiment may further include: a communication interface 24 , which may be connected to the processor 21 through a bus 23 .
[0156] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-readable storage medium is run on a computer, the computer is enabled to execute the watermark embedding method as described in the above embodiment.
[0157] An embodiment of the present application further provides a computer program product, including a computer program, which implements the watermark embedding method in the above embodiment when executed by a processor.
[0158] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0159] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A watermark embedding method, characterized in that: include: Acquire a gradient field of a watermark and a gradient field of a source image, wherein the gradient field of the watermark includes an x-component gradient map and a y-component gradient map; Performing thin plate spline interpolation transformation on the x-component gradient map and the y-component gradient map of the gradient field of the watermark respectively to obtain a transformed gradient field of the watermark; According to the transformed gradient field of the watermark and the gradient field of the source image, Poisson fusion is performed on the watermark and the source image to obtain a fused image; The step of performing thin plate spline interpolation transformation on the x-component gradient map and the y-component gradient map of the gradient field of the watermark to obtain the transformed gradient field of the watermark comprises: The x-component gradient map and the y-component gradient map are transformed as follows to obtain the transformed gradient field of the watermark: Dividing the component gradient map at equal intervals to obtain N=i*j initial control points, the component gradient map being the x component gradient map or the y component gradient map, wherein the first direction control point interval is w / i, the second direction control point interval is h / j, w and h are respectively the first direction length and the second direction length of the component gradient map, and i and j are preset positive integers; The N initial control points are randomly perturbed within a circle with a radius of R to obtain the N perturbed control points, where R is the minimum value of w / i and h / j; The N initial control points are respectively deformed to corresponding positions of the N perturbed control points through thin plate spline interpolation transformation.
2. The method according to claim 1, characterized in that The step of performing Poisson fusion on the watermark and the source image according to the transformed gradient field of the watermark and the gradient field of the source image to obtain a fused image comprises: Determining the gradient field of the fused image according to the gradient field of the transformed watermark and the gradient field of the source image; The divergence of the gradient field of the fused image is calculated, and the Poisson equation is solved according to the divergence of the gradient field of the fused image and the Dirichlet boundary condition to obtain the fused image.
3. The method according to claim 2, characterized in that Determining the gradient field of the fused image according to the gradient field of the transformed watermark and the gradient field of the source image comprises: According to the gradient field of the transformed watermark and the gradient field of the source image, the gradient field V(X) of the fused image is determined by the following formula: or, in, is the gradient field of the source image, is the gradient field of the transformed watermark, and α is the fusion weight.
4. A watermark embedding device, characterized in that: include: An acquisition module, used for acquiring a gradient field of a watermark and a gradient field of a source image, wherein the gradient field of the watermark includes an x-component gradient map and a y-component gradient map; A transformation module, used for performing thin plate spline interpolation transformation on the x-component gradient map and the y-component gradient map of the gradient field of the watermark respectively, to obtain a transformed gradient field of the watermark; A fusion module, used for performing Poisson fusion on the watermark and the source image according to the gradient field of the transformed watermark and the gradient field of the source image to obtain a fused image; The transformation module is specifically used for: The x-component gradient map and the y-component gradient map are transformed as follows to obtain the transformed gradient field of the watermark: Dividing the component gradient map at equal intervals to obtain N=i*j initial control points, the component gradient map being the x component gradient map or the y component gradient map, wherein the first direction control point interval is w / i, the second direction control point interval is h / j, w and h are respectively the first direction length and the second direction length of the component gradient map, and i and j are preset positive integers; The N initial control points are randomly perturbed within a circle with a radius of R to obtain the N perturbed control points, where R is the minimum value of w / i and h / j; The N initial control points are respectively deformed to corresponding positions of the N perturbed control points through thin plate spline interpolation transformation.
5. The device according to claim 4, characterized in that The fusion module includes: A determination unit, configured to determine a gradient field of the fused image according to the gradient field of the transformed watermark and the gradient field of the source image; The calculation unit is used to calculate the divergence of the gradient field of the fused image, and solve the Poisson equation according to the divergence of the gradient field of the fused image and the Dirichlet boundary condition to obtain the fused image.
6. The device according to claim 5, characterized in that The determining unit is used for: According to the gradient field of the transformed watermark and the gradient field of the source image, the gradient field V(X) of the fused image is determined by the following formula: or, in, is the gradient field of the source image, is the gradient field of the transformed watermark, and α is the fusion weight.
7. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the watermark embedding method according to any one of claims 1 to 3 by executing the executable instructions.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the watermark embedding method according to any one of claims 1 to 3 is implemented.
