A digital watermark embedding and extracting method, device, equipment and storage medium

By determining the watermark embedding region in the document image and embedding the watermark using an adaptive brightness adjustment algorithm, the problem of watermark susceptibility to damage in existing technologies is solved, achieving high concealment and robustness against JPEG compression in document images.

CN114626967BActive Publication Date: 2026-01-23SUNGROW POWER SUPPLY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210267459.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-17
Publication Date
2026-01-23
Estimated Expiration
2042-03-17

AI Technical Summary

Technical Problem

Existing digital watermarking methods are easily corrupted by screenshots and JPEG compression in document images, making them poorly concealed and difficult to resist combined attacks.

Method used

By acquiring the original image and the digital watermark image, the watermark embedding area is determined. Based on JPEG compression, a high sampling rate is retained for the luminance component. An adaptive luminance adjustment algorithm is used to adjust the pixel brightness of the preset pixel area to embed the watermark image.

Benefits of technology

It improves the concealment and robustness of digital watermarks, and can effectively resist combined attacks of screenshots and JPEG compression.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114626967B_ABST
    Figure CN114626967B_ABST
Patent Text Reader

Abstract

The application discloses a digital watermark embedding and extracting method, device and equipment and a storage medium. The original image and the digital watermark image are acquired; at least one watermark embedding area of the original image is determined, and the concealment of the digital watermark is improved; based on the fact that the JPEG compression usually retains a higher sampling rate for the luminance component, the luminance of the pixel points in each preset pixel area which is not overlapped in the watermark embedding area is adaptively adjusted in sequence through an adaptive luminance adjustment algorithm, so that the digital watermark image is embedded in the watermark embedding area to obtain a digital watermark embedding image, and the digital watermark embedding image has good robustness to the joint attack of the screenshot and the JPEG compression saving.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of digital watermarking technology, and in particular to a digital watermark embedding and extraction method, device, equipment and storage medium. BACKGROUND

[0002] With the development of network and multimedia technology, digital watermarking technology, as an important means of digital copyright protection, is widely used by enterprises in the protection of their digital assets such as technical documents, PPTs and PDFs.

[0003] Existing digital watermarking methods are mainly aimed at natural scene images. For poster, PPT and technical document images, existing Discrete Cosine Transformation (DCT) and Singular Value Decomposition (SVD) frequency domain watermarking algorithms are easily destroyed by screenshots, and for document images mixed with a large number of text and pictures, there are a large number of blank areas and high-contrast areas with clear edges, the concealment is poor, and the information hiding amount is reduced; and spatial watermarking algorithms such as Least Significant Bit (LSB) algorithm are easily destroyed by JPEG compression and saving.

[0004] Therefore, the existing digital watermarking method has poor application effect in document images and is difficult to resist the joint attack of screenshots and JPEG compression and saving. SUMMARY

[0005] The present application provides a digital watermark embedding and extraction method, device, equipment and storage medium to solve the problem that the existing digital watermarking method has poor application effect in document images and is difficult to resist the joint attack of screenshots and JPEG compression, has good robustness to screenshots and JPEG compression, and has high concealment.

[0006] According to one aspect of the present application, a digital watermark embedding method is provided, comprising:

[0007] obtaining an original image and a digital watermark image;

[0008] determining at least one watermark embedding region of the original image;

[0009] According to the digital watermark image, the brightness of the pixel points of each mutually non-overlapping preset pixel region in the watermark embedding region is adaptively adjusted, so that the digital watermark image is embedded in the watermark embedding region to obtain a digital watermark embedding image.

[0010] According to another aspect of the present application, a digital watermark extraction method is provided, comprising:

[0011] obtaining a luminance component image of a to-be-extracted watermark image and a preset pixel size, the to-be-extracted watermark image being a digital watermark embedding image obtained by using a digital watermark embedding method; each pixel point of the luminance component image being a luminance component of each pixel point of the to-be-extracted watermark image in a YUV color mode; and the preset pixel size being a pixel size of a preset pixel region;

[0012] performing image segmentation on the luminance component image to obtain a plurality of target pixel regions which do not overlap with each other, based on the preset pixel size and from a starting position of the luminance component image;

[0013] extracting watermark information of each target pixel region, the watermark information being determined according to luminance of pixel points in the target pixel region;

[0014] if the watermark information does not constitute a digital watermark image, moving the starting position of the luminance component image in the target pixel region where the starting position is located by a unit pixel as a step, and returning to perform the steps of performing image segmentation on the luminance component image to obtain a plurality of target pixel regions which do not overlap with each other, based on the preset pixel size and from the starting position of the luminance component image, and extracting watermark information of each target pixel region, until a digital watermark image is determined or the starting position completes traversal in the corresponding target pixel region.

[0015] According to another aspect of the present application, there is provided a digital watermark embedding device, comprising:

[0016] an obtaining module configured to obtain an original image and a digital watermark image;

[0017] a region determining module configured to determine at least one watermark embedding region of the original image;

[0018] a watermark embedding module configured to adaptively adjust luminance of pixel points of each preset pixel region which does not overlap with each other in the watermark embedding region according to the digital watermark image, so that the digital watermark image is embedded in the watermark embedding region to obtain a digital watermark embedding image.

[0019] According to another aspect of the present application, there is provided a digital watermark extracting device, comprising:

[0020] an obtaining module configured to obtain a luminance component image of a to-be-extracted watermark image and a preset pixel size, the to-be-extracted watermark image being a digital watermark embedding image obtained by using a digital watermark embedding method; each pixel point of the luminance component image being a luminance component of each pixel point of the to-be-extracted watermark image in a YUV color mode; and the preset pixel size being a pixel size of a preset pixel region;

[0021] The segmentation module is configured to segment the luminance component image based on a preset pixel size to obtain a plurality of target pixel regions that do not overlap with each other from a starting position of the luminance component image.

[0022] The extraction module is configured to extract watermark information of each target pixel region, wherein the watermark information is determined according to luminance of a pixel point in the target pixel region.

[0023] The determination module is configured to, if the watermark information does not constitute a digital watermark image, move the starting position of the luminance component image in a target pixel region where the starting position is located by a unit pixel as a step, and return to execute the steps of segmenting the luminance component image based on a preset pixel size to obtain a plurality of target pixel regions that do not overlap with each other, and extracting watermark information of each target pixel region, until a digital watermark image is determined or the starting position is iterated in a corresponding target pixel region.

[0024] According to another aspect of the present application, an electronic device is provided, which comprises:

[0025] at least one processor; and

[0026] a memory connected to the at least one processor in communication; wherein

[0027] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the digital watermark embedding method and / or the digital watermark extraction method according to any one of the embodiments of the present application.

[0028] According to another aspect of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to implement the digital watermark embedding method and / or the digital watermark extraction method according to any one of the embodiments of the present application when the processor executes the computer instructions.

[0029] The technical solution of the embodiments of the present application improves the concealment of the digital watermark by obtaining an original image and a digital watermark image, and determining at least one watermark embedding region of the original image. The adaptive luminance adjustment algorithm is used to sequentially adjust luminance of pixel points in each preset pixel region in the watermark embedding region that does not overlap with each other, so that the digital watermark image is embedded in the watermark embedding region to obtain a digital watermark embedding image, which has good robustness against the joint attack of screenshot and JPEG compression.

[0030] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This is a flowchart of a digital watermark embedding method provided in Embodiment 1 of the present invention;

[0033] Figure 2 This is a flowchart of a digital watermark embedding method provided in Embodiment 2 of the present invention;

[0034] Figure 3 This is a flowchart of a digital watermark embedding method provided in Embodiment 3 of the present invention;

[0035] Figure 4 This is a flowchart of a digital watermark extraction method provided in Embodiment 4 of the present invention;

[0036] Figure 5 This is a flowchart of a digital watermark extraction method provided in Embodiment 5 of the present invention;

[0037] Figure 6 This is a schematic diagram of the structure of a digital watermark embedding device according to Embodiment Six of the present invention;

[0038] Figure 7 This is a schematic diagram of the structure of a digital watermark extraction device according to Embodiment Seven of the present invention;

[0039] Figure 8 This is a schematic diagram of the structure of an electronic device that implements the digital watermark embedding method or digital watermark extraction method of the present invention. Detailed Implementation

[0040] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0041] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0042] Example 1

[0043] Figure 1 This is a flowchart of a digital watermark embedding method provided in Embodiment 1 of the present invention. This embodiment is applicable to embedding watermark images in natural scene images or document images. The method can be executed by a digital watermark embedding device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:

[0044] S110. Obtain the original image and the digital watermark image.

[0045] The original image refers to the image into which the digital watermark image needs to be embedded. The original image can be a natural scene image or a document image such as a PPT, poster, or technical document. A document image is defined as an image containing both textual and non-textual information. Compared to natural scene images, document images are characterized by: a clear black-and-white distinction; greater histogram dispersion; and a smaller proportion of low-brightness pixels, which are often located in the center of the image.

[0046] The colors of each pixel in the original image can be displayed using either the RGB or YUV color mode. The RGB color mode divides color into three channels: red, green, and blue, with each channel mixed in different proportions to describe a color. The YUV color mode describes a color using one luminance component and two chrominance components; Y represents luminance, U represents chrominance, and V represents chrominance intensity. The most significant characteristic of the YUV color mode is its separation of luminance and chrominance information; even without chrominance information, the image's grayscale variations can still be displayed based on luminance information.

[0047] A digital watermarked image is an image containing watermark information. Generally, digital watermarked images need to be pre-defined according to user requirements, and they can also be encrypted as needed. The structural form of a digital watermarked image can be a QR code image or other pre-defined images with symbolic meaning, such as symbolic text, letters, or numbers; this embodiment of the invention does not impose any limitations on this. Generally, digital watermarked images use a binary sequence, which can directly correspond to a (0,1) data bit stream; that is, a digital watermarked image can be represented using multiple (0,1) bits of watermark information.

[0048] For example, a method for obtaining a digital watermark image may be to obtain the digital watermark image from a database, the cloud, or other storage devices. A method for obtaining an original image may be to obtain the original image from a database, the cloud, or other storage devices, or to obtain the original image through an image acquisition device.

[0049] S120. Determine at least one watermark embedding region of the original image.

[0050] The watermark embedding region refers to the area in the original image to which the watermark is to be embedded. The number of watermark embedding regions can be one or more non-overlapping regions. Embedding watermark information in multiple watermark embedding regions of the original image can achieve a more robust watermark effect.

[0051] It is easy to understand that the number of horizontal and vertical pixels in the watermark embedding area should be greater than the maximum number of pixels in the same direction of the digital watermark image structure. Otherwise, the digital watermark image cannot be fully embedded into the watermark embedding area of ​​the original image, resulting in the inability to extract complete watermark information, or the digital watermark image exceeds the watermark embedding area, resulting in the watermark information not being concealed.

[0052] In a specific example, the method for determining the watermark embedding area of ​​the original image can be either to select a preset pixel size region with the highest average brightness value of each pixel in the original image as the watermark embedding area, or to select a preset pixel size region with the highest average gray value of each pixel in the original image as the watermark embedding area, thereby achieving a certain degree of concealment of the watermark information.

[0053] Understandably, the selection of the watermark embedding region is crucial to the concealment effect of the watermark information, and an appropriate watermark embedding region selection method can improve the concealment of digital watermark embedding. Therefore, the watermark embedding region can also be scientifically selected based on the minimum perceptible distortion of each pixel in the original image. Minimum Noticeable Distortion (JND) represents the maximum image distortion that the human eye cannot perceive, reflecting the human eye's tolerance to image changes. In the field of image processing, JND can be used to measure the human eye's sensitivity to distortion in different areas of an image.

[0054] In another specific example, the Nonlinear Additively Masking Model (NAMM) is a computational model that achieves minimal perceptible distortion. NAMM can be used to select watermark embedding regions with higher concealment.

[0055] S130. The brightness of the pixels in each non-overlapping preset pixel region in the watermark embedding region is adaptively adjusted according to the digital watermark image, so that the digital watermark image is embedded in the watermark embedding region to obtain the digital watermark embedded image.

[0056] The preset pixel region is a region of a preset pixel size, such as a rectangular region like a square matrix. For example, the preset pixel size of the preset pixel region can be 3×5, 3×3, or 5×5. The watermark embedding area can be divided into multiple non-overlapping preset pixel regions based on the preset pixel size. Generally, to easily determine the center point of the preset pixel region, a square matrix with an odd side length is chosen, such as a 3×3 or 5×5 square matrix. If the region is not a square matrix, the position of the center point can also be predetermined.

[0057] Specifically, the target brightness value of each pixel in the preset pixel region corresponding to each bit of watermark information in the digital watermark image is determined sequentially, and the brightness value of the pixels in the preset pixel region is adjusted to the target brightness value. The change in brightness of each preset pixel region reflects the watermark information embedded in the watermark embedding region of the original image. The brightness of the pixel is represented by the luminance component (Y component) in YUV color mode and by the numerical ratio of R, G, and B in RGB color mode, thereby achieving the embedding of the digital watermark image into the watermark embedding region to obtain a digital watermark embedded image. Since JPEG compression usually retains a high sampling rate for the luminance component, the digital watermark embedded image based on the adaptive brightness adjustment algorithm has good robustness against the combined attack of screenshotting and JPEG compression.

[0058] For example, the adaptive adjustment of the brightness of pixels in each non-overlapping preset pixel region can be based on statistical values ​​such as the average, maximum, or minimum brightness of each pixel in the preset pixel region; it can also be based on the minimum perceptible distortion corresponding to each pixel in the preset pixel region; or it can be a combination of the above two methods.

[0059] In one specific embodiment, when adjusting the brightness of each pixel within a preset pixel area, different embedding step sizes can be used for the center pixel and non-center pixels. The embedding step size can be determined based on the minimum perceptible distortion and / or the average brightness of the pixels within the preset pixel area.

[0060] The technical solution provided by this invention improves the concealment of the digital watermark by acquiring the original image and the digital watermark image and determining at least one watermark embedding region of the original image. Based on the fact that JPEG compression usually retains a high sampling rate for the luminance component, the brightness of the pixels in each non-overlapping preset pixel region in the watermark embedding region is adaptively adjusted sequentially by an adaptive brightness adjustment algorithm, so that the digital watermark image is embedded in the watermark embedding region to obtain the digital watermark embedded image. This solution has good robustness against the combined attack of screenshotting and JPEG compression.

[0061] Optionally, the digital watermark image is an encrypted image.

[0062] Specifically, the purpose of encrypting digital watermarked images is twofold: first, to prevent the leakage of watermark information; and second, to reduce noise in the watermarked image, ensuring a more even distribution of energy and better integration with existing image noise. The encrypted image must be highly sensitive to initial values; incorrect initial values ​​will prevent the image from being read.

[0063] The image encryption methods described in this embodiment are not limited, but commonly include Arnold transform, Baker transform, cat face transform, and chaotic sequences. Among these, the Logistic mapping method of the chaotic sequence method generates pseudo-random sequences, which have good initial value sensitivity and randomness, and can use initial values ​​as keys.

[0064] Example 2

[0065] Figure 2 This is a flowchart of a digital watermark embedding method provided in Embodiment 2 of the present invention. This embodiment further refines step S130 of the above embodiment. Figure 2 As shown, the method includes:

[0066] S210. Obtain the original image and the digital watermark image.

[0067] S220. Determine at least one watermark embedding region of the original image.

[0068] S230. Obtain the original image brightness matrix corresponding to the watermark embedding area. The original image brightness matrix includes the brightness components of each pixel in the watermark embedding area of ​​the original image in the YUV color mode.

[0069] The original image brightness matrix is ​​a matrix composed of the brightness components of each pixel in the watermark embedding area of ​​the original image in the YUV color mode.

[0070] Specifically, for the original image in YUV color mode, the brightness of each pixel in the watermark embedding area is extracted to obtain the original image brightness matrix. It should be noted that the image space standard commonly used in daily life is RGB color mode; therefore, the original image needs to be converted to YUV color mode before the brightness components of each pixel in the watermark embedding area are extracted. The method for converting the original image from RGB color mode to YUV color mode can employ any existing color mode conversion technology, and this embodiment of the invention does not impose any limitations on this.

[0071] S240. Divide the original image brightness matrix into multiple non-overlapping preset pixel regions.

[0072] Specifically, the pixel size of the preset pixel area is set according to actual needs. Generally, for ease of calculation, the preset area can be set as a square area with an odd number of pixels on each side, such as a 3×3 pixel square area.

[0073] The original image brightness matrix is ​​divided into multiple non-overlapping preset square matrices based on a preset pixel size.

[0074] For example, the original image brightness matrix can be divided into multiple non-overlapping preset pixel regions by dividing the original image brightness matrix into multiple non-overlapping preset pixel regions with a preset pixel size. If the pixel size of the original image brightness matrix is ​​w×h, it can be divided into m×n non-overlapping preset pixel regions with a preset pixel size of k×k, where...

[0075] It should be noted that when dividing pixel regions, images with edges less than a preset number of pixels wide can be ignored.

[0076] S250. Based on the watermark information in the digital watermark image, the brightness of the pixels in each preset pixel region of the original image brightness matrix is ​​adaptively adjusted to obtain the target image brightness matrix.

[0077] The watermark information can be a data stream composed of each bit of watermark information in the digital watermark image. When performing adaptive brightness adjustment, 1 bit of watermark information is used to embed within a preset pixel area, and the brightness of each pixel in the preset pixel area is adjusted based on the watermark information of the digital watermark image.

[0078] Specifically, the target image brightness matrix is ​​obtained by adjusting the brightness of pixels in each preset pixel region of the original image brightness matrix using an adaptive adjustment algorithm. The adaptive adjustment algorithm determines the adaptive brightness value of each pixel in the preset pixel region corresponding to the watermark information based on the watermark information of the digital watermark image, and then adjusts the brightness of each pixel in the preset pixel region of the original image brightness matrix according to the adaptive brightness value to obtain the target image brightness matrix.

[0079] The target image brightness matrix is ​​used to reflect the updated brightness of the watermark embedding region of the original image. The updated brightness can characterize the embedded digital watermark image. Since JPEG compression usually retains a high sampling rate for the brightness component, it has good robustness against joint attacks on screenshots and JPEG compression.

[0080] S260. The target image brightness matrix and the original image chromaticity components in the watermark embedding region are combined to obtain a digital watermark embedded image.

[0081] Among them, digital watermark embedded image refers to the original image after the watermark image is embedded.

[0082] Specifically, a digital watermarked image can be obtained by combining the luminance component (Y component) contained in the target luminance matrix with the chrominance components (U and V components) of the original image in the watermark embedding area.

[0083] It should be noted that if the original image is in RGB color mode, the digital watermark embedded image in YUV color mode can also be converted into a digital watermark embedded image in RGB color mode.

[0084] The technical solution of this invention extracts the original image brightness matrix corresponding to the watermark embedding region from the original image, divides the original image brightness matrix into multiple non-overlapping preset pixel regions, and adjusts the brightness of each preset pixel region in the original image brightness matrix using an adaptive adjustment algorithm to obtain the target image brightness matrix. The target image brightness matrix and the chromaticity components of the original image in the watermark embedding region are then synthesized to obtain a digital watermark embedded image. This allows the embedding of each data bitstream of the digital watermark image into the original image through changes in the brightness components. Since JPEG compression typically retains a high sampling rate for the brightness components, it exhibits good robustness against combined attacks using screenshots and JPEG compression. Furthermore, embedding 1 bit of watermark information within a preset pixel region of a preset pixel size allows the digital watermark image to be extracted with a finite number of traversals, simplifying the digital watermark image extraction process.

[0085] Optionally, based on the watermark information in the digital watermark image, the brightness of pixels in each preset pixel region of the original image brightness matrix is ​​adaptively adjusted sequentially to obtain the target image brightness matrix, including:

[0086] For each preset pixel region, obtain the embedding step size corresponding to the center pixel and the average brightness of each non-center pixel. The embedding step size is the product of the minimum perceptible distortion corresponding to the center pixel and the embedding strength coefficient.

[0087] The center brightness value of the center pixel is determined based on the watermark information, average brightness, and embedding step size corresponding to the preset pixel area.

[0088] The brightness adjustment value of the non-center pixel is determined based on the watermark information corresponding to the preset pixel area and the embedding step size.

[0089] The brightness of the center pixel in the preset pixel area is adjusted to the center brightness value, and the brightness of the non-center pixels in the preset pixel area is adjusted based on the brightness adjustment value to obtain the target image brightness matrix.

[0090] Each preset pixel region can include a center pixel and non-center pixels. For example, for a 3×3 preset pixel region with a pixel matrix of [0,1,2,3,4,5,6,7,8], the center pixel is the 4th pixel, and the remaining pixels are non-center pixels.

[0091] Specifically, for each preset pixel region, the center brightness value of the center pixel and the brightness adjustment value of the non-center pixels are determined respectively. Based on the original image brightness matrix, the brightness of the center pixel of the preset pixel region is adjusted to the center brightness value, and the brightness of all non-center pixels in the preset pixel region is adjusted based on the brightness adjustment value to obtain the target image brightness matrix.

[0092] In one specific embodiment, the center brightness value can be determined based on the watermark information (i.e., 0 or 1) embedded in the preset pixel area, the embedding step size corresponding to the center pixel within the preset pixel area, and the average brightness of each non-center pixel. The brightness adjustment value can be determined based on the embedding step size corresponding to the center pixel within the preset pixel area.

[0093] Among them, the average brightness of each non-center pixel is

[0094]

[0095] avgY is the average brightness of non-center pixels within the preset pixel region, Y(i,j) is the brightness of the pixel in the i-th row and j-th column, and k is the number of pixels in the preset pixel region.

[0096] Wherein, the embedding step size corresponding to the center pixel is the product of the minimum perceptible distortion corresponding to the center pixel and the embedding strength coefficient, i.e.

[0097] λ = α × JND;

[0098] λ is the embedding step size corresponding to the center pixel, JND is the minimum perceptible distortion corresponding to the center pixel, and α is the embedding strength coefficient. The embedding strength coefficient can be set according to actual needs. The embedding step size λ affects the concealment and robustness of the digital watermark image; the larger λ is, the better the robustness and the worse the concealment.

[0099] The embedding step size is determined based on the minimum perceptible distortion of the center pixel within the preset pixel area. The center brightness value of the center pixel is determined based on the watermark information corresponding to the preset pixel area, the embedding step size, and the average brightness of each non-center pixel. The brightness adjustment value of the non-center pixels is determined based on the watermark information corresponding to the preset pixel area and the embedding step size. This allows for adaptive adjustment of each pixel within the preset pixel area by taking into account the sensitivity of the human eye to brightness, thus ensuring the concealment and robustness of the digital watermark image.

[0100] Optionally, the center brightness value of the center pixel is determined based on the watermark information, average brightness, and embedding step size corresponding to the preset pixel area, including:

[0101] If the watermark information corresponding to the preset pixel area is the first watermark information, then the center brightness value of the center pixel is determined as the sum of the average brightness value and the embedding step size.

[0102] If the watermark information corresponding to the preset pixel area is the second watermark information, the center brightness value of the center pixel is determined as the difference between the average brightness value and the embedding step size.

[0103] The first watermark information and the second watermark information are respectively watermark information of one bit in the watermark information represented by binary data. For example, if the first watermark information is watermark information 0, then the second watermark information is watermark information 1, or if the first watermark information is watermark information 1, then the second watermark information is watermark information 0.

[0104] Therefore, the specific implementation algorithm for adaptively adjusting the pixel brightness of each preset pixel region in the original image brightness matrix according to the watermark information in the digital watermark image is as follows:

[0105]

[0106] in, W is the center point of the b-th preset pixel region within the watermark embedding area. b Let b be the b-th bit of the watermark information in the digital watermark image. The value of b is related to the number of bits of watermark information in the digital watermark image.

[0107] Based on the watermark information corresponding to the preset pixel area, the center brightness value of the center pixel is determined as the sum of the average brightness value and the embedding step size, or the difference between the average brightness value and the embedding step size. This allows the watermark information embedded in the preset pixel area to be reflected based on the relationship between the embedding step size of the center pixel and the average brightness value. Furthermore, by taking into account the human eye's sensitivity to brightness, the embedding step size of the center pixel is determined. This approach can ensure the concealment of the digital watermark image while facilitating its extraction.

[0108] Optionally, the brightness adjustment value of non-center pixels is determined based on the watermark information corresponding to the preset pixel area and the embedding step size, including:

[0109] Get the number of non-center pixels in a preset pixel region;

[0110] If the watermark information corresponding to the preset pixel area is the second watermark information, then the brightness adjustment value of the non-center pixel is determined to be the ratio of the embedding step size to the number of non-center pixels.

[0111] If the watermark information corresponding to the preset pixel area is the first watermark information, then the brightness adjustment value of the non-center pixel is determined to be the opposite of the ratio.

[0112] Specifically, the number of non-center pixels in the preset pixel area is k×k-1. If the watermark information corresponding to the preset pixel area is the second watermark information, the brightness adjustment value of the non-center pixels is determined as the ratio of the embedding step size to the number of non-center pixels, that is, the brightness adjustment value B2=-λ / (k×k-1), which means increasing the brightness of the non-center pixels in the preset pixel area by the brightness adjustment value. If the watermark information corresponding to the preset pixel area is the first watermark information, the brightness adjustment value of the non-center pixels is determined as the negative of the ratio of the embedding step size to the number of non-center pixels, that is, the brightness adjustment value B2=λ / (k×k-1), which means decreasing the brightness of the non-center pixels in the preset pixel area by the brightness adjustment value.

[0113] The ratio of the embedding step size to the number of non-center pixels is used as the brightness adjustment value of the non-center pixels in the preset pixel area. This brightness adjustment value is used to adjust the brightness of the non-center pixels in the preset pixel area, so that the overall brightness of each pixel area in the watermark embedding area does not change, and information can be embedded in areas where the brightness is all 0 or 255.

[0114] Example 3

[0115] Figure 3 This is a flowchart of a digital watermark embedding method provided in Embodiment 3 of the present invention. This embodiment further refines steps S120 or S220 of the above embodiments. Figure 3 As shown, the method includes:

[0116] S310, Obtain the original image and the digital watermark image.

[0117] S320. Determine the grayscale image of the original image.

[0118] In RGB color mode, each pixel in a grayscale image has the same color values ​​for the red, green, and blue channels, and different gray levels are represented by the magnitude of these color values. In YUV color mode, the color of each pixel in a grayscale image is represented by the luminance component (Y component).

[0119] In a specific example, for the original image in RGB color mode, the average of the color values ​​of the red, green, and blue channels is used as the grayscale value of the grayscale image.

[0120] In another specific example, for the original image in YUV color mode, a grayscale image is obtained by extracting the luminance component of the time-lapse image.

[0121] S330. By using a nonlinear additive masking model, determine the minimum perceptible distortion matrix of the grayscale image, and map the minimum perceptible distortion matrix onto the grayscale image to obtain the mapped image.

[0122] Among them, the Nonlinear Additively Masking Model (NAMM) is a computational model for achieving minimum perceptible distortion. The NAMM model belongs to the spatial-pixel domain model, taking into account the overlapping effects of brightness-adaptive masking and contrast masking. It can more intuitively provide the minimum perceptible distortion (JND) threshold in the pixel domain, and is used to evaluate the influence of different image locations on human vision.

[0123] Specifically, NAMM (Minimum Perceptible Distortion Matrix) determines the minimum perceptible distortion of each pixel in a grayscale image. Mapping this matrix onto the grayscale image yields a mapped image. The grayscale value of each pixel in the mapped image represents its corresponding minimum perceptible distortion. In other words, the mapped image reflects the minimum perceptible distortion of each pixel in the original image. A higher minimum perceptible distortion value indicates a higher threshold at which the human eye can perceive the pixel's distortion.

[0124] For example, the nonlinear additively masking model (NAMM) is formed by the nonlinear superposition of background brightness adaptation and contrast masking, i.e.

[0125] JND(x,y)=T b (x,y)+T c (x,y)+C l ×min{T b (x,y),T c (x,y)};

[0126] Among them, T b (x,y) represents the adaptive perceptible threshold for background brightness, T c (x,y) represents the perceptible threshold of contrast masking, C l To represent the overlap effect between the two components under the luminance component, we can take C. l =0.3.

[0127] T b (x,y) can be represented as:

[0128]

[0129] Among them, I Y (x, y) represents the average background brightness of the pixel located at coordinates (x, y). Its calculation method is as follows:

[0130]

[0131] The B matrix operator is:

[0132]

[0133] T c (x,y) can be represented as:

[0134] T c (x,y)=γ luma ×G(x,y);

[0135] Where, γ luma It is the control parameter for the luminance component, γ luma =0.117. G(x,y) is the maximum value of the gradient in the four directions (0°, 45°, 90° and 135°) of the pixel with coordinates (x,y).

[0136] S340. The candidate regions are obtained by traversing the mapped image according to the preset sliding template. The size of the preset sliding template is determined by the digital watermark image and the pixel size of the preset pixel region.

[0137] Since the 1-bit watermark information of the digital watermark image needs to be embedded in a preset pixel area, the size of the candidate area is at least the product of the pixel size of the digital watermark image and the preset pixel area. Therefore, the size of the preset sliding template is determined by the pixel size of the digital watermark image and the preset pixel area.

[0138] By traversing the mapped image using a preset sliding template, multiple candidate regions of the same size as the preset sliding template can be obtained. From these candidate regions, an appropriate watermark embedding region can be selected.

[0139] S350. Select the candidate areas that meet the preset conditions as the watermark embedding areas.

[0140] Specifically, the preset conditions could be that the average value of the minimum perceptible distortion in the candidate areas is the largest, the average value of the minimum perceptible distortion is greater than a preset threshold, or the proportion of the minimum perceptible distortion that is greater than a preset threshold is the largest.

[0141] The preset number of watermark embedding areas can be one or more, which can be set according to actual needs.

[0142] Optionally, if there are multiple candidate areas that meet the preset conditions, then each candidate area that meets the preset conditions and does not overlap with each other will be determined as the watermark embedding area.

[0143] Specifically, if multiple watermark embedding areas are determined, it is necessary to ensure that the multiple watermark embedding areas do not overlap in order to ensure that the digital watermark image embedded in multiple watermark embedding areas is not covered.

[0144] S360. The brightness of the pixels in each non-overlapping preset pixel region in the watermark embedding region is adaptively adjusted according to the digital watermark image, so that the digital watermark image is embedded in the watermark embedding region to obtain the digital watermark embedded image.

[0145] The technical solution of this invention uses a nonlinear additive masking model to determine the minimum perceptible distortion matrix of a grayscale image, maps the minimum perceptible distortion matrix onto the grayscale image to obtain a mapped image, traverses the mapped image according to a preset sliding template to obtain candidate regions, determines the average grayscale value of each pixel in each candidate region, and determines at least one candidate region with the largest average grayscale value as the watermark embedding region. This method can determine the optimal watermark embedding region based on the pixel distortion threshold that can be perceived by the human eye, thereby improving the concealment of the digital watermark image and making it difficult for people to detect the embedding of the digital watermark.

[0146] Optionally, the minimum perceptible distortion matrix of the grayscale image is determined using a nonlinear additive masking model, including:

[0147] The target grayscale image is obtained by extracting the grayscale image based on the resolution of the grayscale image using a preset extraction frequency.

[0148] The coefficient matrix of the nonlinear additive masking model for the target grayscale image is determined by using a nonlinear additive masking model.

[0149] The minimum perceptible distortion matrix of the grayscale image is obtained by interpolating the coefficient matrix of the nonlinear additive masking model based on a preset interpolation frequency, wherein the preset extraction frequency and the preset interpolation frequency are reciprocals of each other.

[0150] Specifically, directly using a nonlinear additive masking model to determine the coefficient matrix of the grayscale image as the minimum perceptible distortion matrix requires extensive computation, consumes significant hardware resources, and has low computational efficiency, resulting in a long time to determine the watermark embedding region. Therefore, first extracting the target grayscale image based on a preset extraction frequency to reduce its resolution, and then calculating using a nonlinear additive masking model, can reduce the computational load and improve operational efficiency. If the resolution of the grayscale image is reduced to 1 / 3 before performing NAMM model coefficient calculation, the computation time can be shortened to 1 / 8 of the original time.

[0151] After the NAMM model is computed, the coefficient matrix of the nonlinear additive masking model is interpolated based on a preset interpolation frequency to obtain the minimum perceptible distortion matrix of the grayscale image. The preset extraction frequency and the preset interpolation frequency are reciprocals of each other, which can restore the obtained minimum perceptible distortion matrix to the size of the grayscale image, so as to facilitate the one-to-one mapping of the minimum perceptible distortion matrix to the grayscale image.

[0152] Example 4

[0153] Figure 4 This is a flowchart of a digital watermark extraction method provided in Embodiment 4 of the present invention. This embodiment is applicable to the extraction of digital watermarks from digitally embedded images obtained by the digital watermark embedding method used in the above embodiments. This method can be executed by a digital watermark extraction device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 4 As shown, the method includes:

[0154] S410. Obtain the luminance component image and preset pixel size of the watermark image to be extracted. The watermark image to be extracted is a digital watermark embedded image obtained by the digital watermark embedding method of any one of the embodiments 1 to 3. Each pixel of the luminance component image is the luminance component of each pixel of the watermark image to be extracted in the YUV color mode. The preset pixel size is the pixel size of the preset pixel area of ​​any one of the embodiments 1 to 3.

[0155] The watermark image to be extracted is a digital watermark embedded image obtained by using the digital watermark embedding method of any one of the embodiments 1 to 3.

[0156] It's important to note that digital watermark extraction is the inverse of digital watermark embedding. Only digital watermark extraction methods that match the digital watermark embedding method can extract the watermark from the embedded image. For images embedded using other methods, the correct watermark cannot be successfully extracted. Therefore, when extracting the watermark from the image, it's necessary to obtain the preset parameters used in the digital watermark extraction method, such as the pixel size of the preset pixel region, to achieve the inverse process of digital watermark embedding.

[0157] Specifically, the luminance component image of the image to be extracted is obtained. Each pixel in this luminance component image represents the luminance component of the image to be extracted in the YUV color mode. If the image to be extracted uses the RGB color mode, it needs to be converted from the RGB color mode to the YUV color mode before luminance component extraction is performed to obtain the luminance component image of the image to be extracted. The method for converting the original image from RGB color mode to YUV color mode can employ any existing color mode conversion technology; this embodiment of the invention does not impose any limitations on this.

[0158] S420. Starting from the starting position of the luminance component image, perform image segmentation on the luminance component image based on a preset pixel size to obtain multiple non-overlapping target pixel regions.

[0159] The starting position of the luminance component image can be set according to actual needs. Generally, the position of the (0,0)th pixel of the luminance component image, that is, the position of the (0,0)th pixel of the watermark image to be extracted, can be selected as the starting position. Of course, the position of the last pixel or other pixels can also be used as the starting position. This embodiment of the invention does not impose any restrictions on this.

[0160] Specifically, starting from the starting position, the luminance component image is segmented based on a preset pixel size to obtain multiple non-overlapping target pixel regions. It can be understood that the target pixel regions are exactly the same size as the preset pixel regions divided from the original image's luminance matrix during the digital watermark embedding process.

[0161] For example, if the pixel size of the luminance component image is w×h and the preset pixel size is k×k, it can be divided into m×n non-overlapping target pixel regions with a preset pixel size of k×k, where, It should be noted that when dividing the target pixel region, images with edges less than a preset number of pixels wide can be ignored.

[0162] S430. Extract the watermark information of each target pixel region. The watermark information is determined based on the brightness of the pixels in the target pixel region.

[0163] Specifically, the watermark information is extracted from each target pixel region. Since the brightness of each pixel in the preset pixel region is used to represent the embedded watermark information when embedding the digital watermark image, the watermark information can be determined based on the brightness of the pixels in the target pixel region.

[0164] S440. If the watermark information does not constitute a digital watermark image, then within the target pixel region where the starting position is located, move the starting position of the luminance component image in units of pixels, and return to execute the step of performing image segmentation on the luminance component image based on the pixel size of the preset pixel region to obtain multiple non-overlapping target pixel regions, until the digital watermark image is determined or the starting position is within the corresponding target pixel region and the traversal is completed.

[0165] Specifically, when embedding a digital watermark image, the digital watermark image is only embedded in the watermark embedding area. However, there may be a discrepancy between the target pixel area obtained by dividing the brightness component image from the starting position of the watermark image to be extracted and the preset pixel areas in the watermark embedding area during the digital watermark image embedding process. Therefore, it is impossible to form a digital watermark image if the watermark information is determined based on the brightness of the pixels in the target pixel area.

[0166] This digital watermark extraction method does not require starting point alignment. Instead, it moves the starting position of the luminance component image within the target pixel region where the starting point is located, with a step size of one pixel. At each move of the starting point, it returns to the previous position and performs image segmentation of the luminance component image based on the pixel size of the preset pixel region to obtain multiple non-overlapping target pixel regions. The watermark information of each target pixel region is then extracted. When the traversal or determination of the digital watermark image within the corresponding target pixel region at the starting point is complete, all digital watermark images embedded in the image to be extracted can be obtained.

[0167] It should be noted that if there is one or a known number of digital watermark images in the watermark image to be extracted, then after determining that all the correct digital watermark images have been extracted, there is no need to continue the traversal operation; if the watermark image to be extracted includes an unknown number of multiple digital watermark images, then it is necessary to complete the traversal within the corresponding target pixel area at the starting position before it can be determined that all the digital watermark images embedded in the watermark image to be extracted have been extracted.

[0168] This demonstrates that by searching the maximum number of pixels contained in the target pixel region, the watermark image can be extracted blindly, exhibiting resistance to arbitrary width cropping.

[0169] The technical solution of this invention involves acquiring the luminance component image and a preset pixel size of the image to be watermarked. Starting from the starting position of the luminance component image, the image is segmented based on the preset pixel size to obtain multiple non-overlapping target pixel regions. Watermark information is extracted from each target pixel region, and the watermark information is determined based on the pixel brightness in the target pixel region. If the watermark information does not constitute a digital watermark image, the starting position of the luminance component image is moved in units of pixels within the target pixel region where the starting position is located. The process is repeated until a digital watermark image is determined or the starting position is found within the corresponding target pixel region. No starting point alignment is required. After a maximum number of searches per target pixel region, the watermark image can be extracted blindly, and it has the ability to resist arbitrary width cropping.

[0170] Optionally, after determining the digital watermark image, it also includes

[0171] Obtain the key of the digital watermark image embedded in the watermark image to be extracted;

[0172] Decrypting digital watermarked images based on a key;

[0173] Information recognition is performed on the decrypted digital watermark image.

[0174] Specifically, if the digital watermark image embedded during the digital watermark embedding process is an encrypted image, and the digital watermark image directly extracted from the watermark image to be extracted is also an encrypted image, it is also necessary to obtain the key of the digital watermark image embedded in the watermark image to be extracted, decrypt the digital watermark image based on the key, and perform information recognition on the decrypted digital watermark image to obtain the relevant information loaded in the digital watermark image.

[0175] Example 5

[0176] Figure 5 This is a flowchart of a digital watermark embedding method provided in Embodiment 5 of the present invention. This embodiment further refines step S420 of the above embodiment. Figure 5 As shown, the method includes:

[0177] S510. Obtain the luminance component image and preset pixel size of the watermark image to be extracted. The watermark image to be extracted is a digital watermark embedded image obtained by the digital watermark embedding method of any one of the embodiments of Example 1 to 3. Each pixel of the luminance component image is the luminance component of each pixel of the watermark image to be extracted in the YUV color mode. The preset pixel size is the pixel size of the preset pixel area of ​​any one of the embodiments of Example 1 to 3.

[0178] S520. Starting from the starting position of the luminance component image, perform image segmentation on the luminance component image based on a preset pixel size to obtain multiple non-overlapping target pixel regions.

[0179] S530. For each target pixel region, extract the brightness of each pixel in the target pixel region.

[0180] Specifically, for each target pixel region obtained from each segmentation, the brightness of each pixel in the brightness component image is extracted within the target pixel region.

[0181] S540: Determine the watermark information of the target pixel area based on the brightness of each pixel.

[0182] Specifically, based on the brightness variation pattern of each pixel within the target pixel region when the digital watermark image is embedded in the original image, the watermark information embedded in each target pixel region is determined.

[0183] For example, the watermark information embedded in the digital watermark image embedding method is 0 or 1. The method for determining the watermark information of the target pixel area based on the brightness of each pixel can be to determine the watermark information based on the brightness of the center pixel and the average brightness of the non-center pixels within the target pixel area.

[0184] S550. If the watermark information does not constitute a digital watermark image, then within the target pixel area where the starting position is located, move the starting position of the luminance component image in units of pixels, and return to execute the step of performing image segmentation on the luminance component image based on the pixel size of the preset pixel area to obtain multiple non-overlapping target pixel areas, until the digital watermark image is determined or the starting position is within the corresponding target pixel area and the traversal is completed.

[0185] By acquiring the luminance component image and preset pixel size of the watermark image to be extracted, the watermark image to be extracted is a digital watermark embedded image obtained by the digital watermark embedding method of any one of the embodiments 1 to 3; each pixel of the luminance component image is the luminance component of each pixel of the watermark image to be extracted in the YUV color mode; the preset pixel size is the pixel size of the preset pixel area of ​​any one of the embodiments 1 to 3; starting from the starting position of the luminance component image, the luminance component image is segmented based on the preset pixel size to obtain multiple non-overlapping target pixel areas; for each target pixel area, the luminance of each pixel in the target pixel area is extracted; if the watermark information does not constitute a digital watermark image, the starting position of the luminance component image is moved in units of pixels within the target pixel area where the starting position is located, and the step of segmenting the luminance component image based on the pixel size of the preset pixel area to obtain multiple non-overlapping target pixel areas is returned to be executed until the digital watermark image or the starting position is determined to be within the corresponding target pixel area and the traversal is completed; starting point alignment is not required, and the watermark image can be extracted blindly after searching the maximum number of pixels contained in the target pixel area, and it has the ability to resist arbitrary width cropping. Meanwhile, the embedded watermark information can be determined by extracting the brightness of each pixel within the target pixel. The extraction method is simple, fast, and easy to implement.

[0186] Optionally, the watermark information for the target pixel region is determined based on the brightness of each pixel, including:

[0187] Determine the average brightness of each non-center pixel in the target pixel region;

[0188] If the brightness of the center pixel is greater than the average brightness, then the watermark information embedded in the target pixel area is determined to be the first watermark information.

[0189] If the brightness of the center pixel is less than or equal to the average brightness, then the watermark information embedded in the target pixel area is determined to be the second watermark information.

[0190] Specifically, the average brightness of each non-center pixel within the target pixel region is calculated. The brightness of the center pixel is compared with that of the average pixel. Based on the strategy of embedding the digital watermark image into the original image, if the brightness of the center pixel is greater than the average brightness, the watermark information embedded in the target pixel region is determined to be the first watermark information; if the brightness of the center pixel is less than or equal to the average brightness, the watermark information embedded in the target pixel region is determined to be the second watermark information.

[0191] Example 6

[0192] Figure 6 This is a schematic diagram of a digital watermark embedding device provided in Embodiment Six of the present invention. Figure 6 As shown, the device includes: an acquisition module 610, a region determination module 620, and a watermark embedding module 630.

[0193] The acquisition module 610 is used to acquire the original image and the digital watermark image;

[0194] Region determination module 620 is used to determine at least one watermark embedding region of the original image;

[0195] The watermark embedding module 630 is used to adaptively adjust the pixel brightness of each non-overlapping preset pixel region in the watermark embedding region according to the digital watermark image, so that the digital watermark image is embedded in the watermark embedding region to obtain a digital watermark embedded image.

[0196] Optionally, the watermark embedding module 630 includes:

[0197] A brightness matrix acquisition unit is used to acquire the original image brightness matrix corresponding to the watermark embedding area. The original image brightness matrix is ​​composed of the brightness components of each pixel in the watermark embedding area of ​​the original image in the YUV color mode.

[0198] A region division unit is used to divide the original image brightness matrix into multiple non-overlapping preset pixel regions;

[0199] An adaptive adjustment unit is used to adaptively adjust the brightness of pixels in each preset pixel region of the original image brightness matrix according to the watermark information in the digital watermark image to obtain the target image brightness matrix.

[0200] The synthesis unit is used to synthesize the brightness matrix of the target image and the chromaticity components of the original image in the watermark embedding area to obtain a digital watermark embedded image.

[0201] Optionally, the adaptive adjustment unit includes:

[0202] The acquisition subunit is used to acquire, for each preset pixel region, the embedding step size corresponding to the center pixel and the average brightness of each non-center pixel, wherein the embedding step size is the product of the minimum perceptible distortion corresponding to the center pixel and the embedding strength coefficient.

[0203] The first determining subunit is used to determine the center brightness value of the center pixel based on the watermark information corresponding to the preset pixel area, the average brightness value and the embedding step size.

[0204] The second determining subunit is used to determine the brightness adjustment value of the non-center pixel based on the watermark information corresponding to the preset pixel area and the embedding step size.

[0205] A brightness adjustment subunit is used to adjust the brightness of the center pixel of the preset pixel region to the center brightness value, and adjust the brightness of the non-center pixels of the preset pixel region based on the brightness adjustment value to obtain the target image brightness matrix.

[0206] Optionally, the first determining subunit is specifically used for:

[0207] If the watermark information corresponding to the preset pixel area is the first watermark information, then the center brightness value of the center pixel is determined as the sum of the average brightness value and the embedding step size;

[0208] If the watermark information corresponding to the preset pixel area is the second watermark information, the center brightness value of the center pixel is determined as the difference between the average brightness value and the embedding step size.

[0209] Optionally, the second determining subunit is specifically used for:

[0210] Obtain the number of non-center pixels in the preset pixel region;

[0211] If the watermark information corresponding to the preset pixel area is the second watermark information, then the brightness adjustment value of the non-center pixel is determined to be the ratio of the embedding step size to the number of non-center pixels;

[0212] If the watermark information corresponding to the preset pixel area is the first watermark information, then the brightness adjustment value of the non-center pixel is determined to be the opposite of the ratio.

[0213] Optionally, the region determination module 620 includes:

[0214] A grayscale determination unit is used to determine the grayscale image of the original image;

[0215] The matrix determination unit is used to determine the minimum perceptible distortion matrix of the grayscale image through a nonlinear additive masking model, and to map the minimum perceptible distortion matrix onto the grayscale image to obtain a mapped image.

[0216] The traversal unit is used to traverse the mapped image according to a preset sliding template to obtain each candidate region. The size of the preset sliding template is determined by the digital watermark image and the pixel size of the preset pixel region.

[0217] The embedding area determination unit determines the candidate areas that meet the preset conditions as the watermark embedding areas.

[0218] Optionally, if there are multiple candidate areas that meet the preset conditions, then each candidate area that meets the preset conditions and does not overlap with each other will be determined as the watermark embedding area.

[0219] Optionally, the matrix determining unit is specifically used for:

[0220] The target grayscale image is obtained by extracting the grayscale image based on the resolution of the grayscale image using a preset extraction frequency.

[0221] The coefficient matrix of the nonlinear additive masking model for the target grayscale image is determined by using a nonlinear additive masking model.

[0222] The minimum perceptible distortion matrix of the grayscale image is obtained by interpolating the coefficient matrix of the nonlinear additive masking model based on a preset interpolation frequency, wherein the preset extraction frequency and the preset interpolation frequency are reciprocals of each other.

[0223] Optionally, the digital watermark image is an encrypted image.

[0224] The digital watermark embedding device provided in the embodiments of the present invention can execute the digital watermark embedding method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.

[0225] Example 7

[0226] Figure 7 This is a schematic diagram of a digital watermark extraction device provided in Embodiment 7 of the present invention. Figure 7 As shown, the device includes: an acquisition module 710, a segmentation module 720, an extraction module 730, and a determination module 740.

[0227] The acquisition module 710 is used to acquire the luminance component image and the preset pixel size of the watermark image to be extracted. The watermark image to be extracted is a digital watermark embedded image obtained by the digital watermark embedding method described in any embodiment. Each pixel of the luminance component image is the luminance component of each pixel of the watermark image to be extracted in the YUV color mode. The preset pixel size is the pixel size of the preset pixel area described in any embodiment.

[0228] The segmentation module 720 is used to segment the brightness component image from the starting position of the brightness component image based on a preset pixel size to obtain multiple non-overlapping target pixel regions.

[0229] The extraction module 730 is used to extract watermark information of each target pixel region, wherein the watermark information is determined based on the pixel brightness of the target pixel region;

[0230] The determining module 740 is used to, if the watermark information does not constitute a digital watermark image, move the starting position of the luminance component image in units of pixels within the target pixel region where the starting position is located, return to perform image segmentation of the luminance component image based on the pixel size of the preset pixel region to obtain multiple non-overlapping target pixel regions, and extract the watermark information of each target pixel region, until the digital watermark image is determined or the starting position is within the corresponding target pixel region and the traversal is completed.

[0231] Optionally, the extraction module 730 includes:

[0232] An extraction unit is used to extract the brightness of each pixel in each target pixel region;

[0233] The determining unit is used to determine the watermark information of the target pixel region based on the brightness of each pixel.

[0234] Optionally, the determining unit is specifically used for:

[0235] Determine the average brightness of each non-center pixel in the target pixel region;

[0236] If the brightness of the center pixel is greater than the average brightness, then the watermark information embedded in the target pixel area is determined to be the first watermark information.

[0237] If the brightness of the center pixel is less than or equal to the average brightness, then the watermark information embedded in the target pixel region is determined to be the second watermark information.

[0238] Optional, also includes

[0239] The key acquisition module is used to acquire the key of the digital watermark image embedded in the watermark image to be extracted;

[0240] A decryption module is used to decrypt the digital watermark image based on the key;

[0241] The recognition module performs information recognition on the decrypted digital watermark image.

[0242] Example 8

[0243] Figure 8 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0244] like Figure 8 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0245] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0246] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as digital watermark embedding methods or digital watermark extraction methods.

[0247] In some embodiments, the digital watermark embedding method or digital watermark extraction method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the digital watermark embedding method or digital watermark extraction method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the digital watermark embedding method or digital watermark extraction method by any other suitable means (e.g., by means of firmware).

[0248] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0249] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0250] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0251] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0252] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0253] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0254] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0255] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A digital watermark embedding method, characterized in that, include: Obtain the original image and the digital watermark image; Determine at least one watermark embedding region of the original image; The brightness of pixels in each non-overlapping preset pixel region in the watermark embedding region is adaptively adjusted according to the digital watermark image, so that the digital watermark image is embedded in the watermark embedding region to obtain a digital watermark embedded image. Wherein, determining at least one watermark embedding region of the original image based on the minimum perceptible distortion of each pixel of the original image includes: Determine the grayscale image of the original image; The minimum perceptible distortion matrix of the grayscale image is determined by using a nonlinear additive masking model, and the minimum perceptible distortion matrix is ​​mapped onto the grayscale image to obtain a mapped image. The mapping image is traversed according to a preset sliding template to obtain each candidate region; the candidate regions that meet the preset conditions are determined as watermark embedding regions.

2. The method according to claim 1, characterized in that, The step of adaptively adjusting the pixel brightness of each non-overlapping preset pixel region in the watermark embedding area based on the digital watermark image includes: Obtain the original image brightness matrix corresponding to the watermark embedding area. The original image brightness matrix is ​​composed of the brightness components of each pixel in the watermark embedding area of ​​the original image in the YUV color mode. The original image brightness matrix is ​​divided into multiple non-overlapping preset pixel regions; Based on the watermark information in the digital watermark image, the brightness of the pixels in each preset pixel region in the original image brightness matrix is ​​adaptively adjusted sequentially to obtain the target image brightness matrix. The target image luminance matrix and the original image chromaticity components in the watermark embedding region are combined to obtain a digital watermark embedded image.

3. The method according to claim 2, characterized in that, The step of adaptively adjusting the pixel brightness of each preset pixel region in the original image brightness matrix according to the watermark information in the digital watermark image to obtain the target image brightness matrix includes: For each preset pixel region, the embedding step size corresponding to the center pixel and the average brightness of each non-center pixel are obtained. The embedding step size is the product of the minimum perceptible distortion corresponding to the center pixel and the embedding strength coefficient. The center brightness value of the center pixel is determined based on the watermark information corresponding to the preset pixel area, the average brightness value, and the embedding step size. The brightness adjustment value of the non-center pixel is determined based on the watermark information corresponding to the preset pixel area and the embedding step size. The brightness of the center pixel of the preset pixel region is adjusted to the center brightness value, and the brightness of the non-center pixels of the preset pixel region is adjusted based on the brightness adjustment value to obtain the target image brightness matrix.

4. The method according to claim 3, characterized in that, The step of determining the center brightness value of the center pixel based on the watermark information corresponding to the preset pixel region, the average brightness value, and the embedding step size includes: If the watermark information corresponding to the preset pixel area is the first watermark information, then the center brightness value of the center pixel is determined as the sum of the average brightness value and the embedding step size; If the watermark information corresponding to the preset pixel area is the second watermark information, the center brightness value of the center pixel is determined as the difference between the average brightness value and the embedding step size.

5. The method according to claim 3, characterized in that, The step of determining the brightness adjustment value of the non-center pixel based on the watermark information corresponding to the preset pixel region and the embedding step size includes: Obtain the number of non-center pixels in the preset pixel region; If the watermark information corresponding to the preset pixel area is the second watermark information, then the brightness adjustment value of the non-center pixel is determined to be the ratio of the embedding step size to the number of non-center pixels; If the watermark information corresponding to the preset pixel area is the first watermark information, then the brightness adjustment value of the non-center pixel is determined to be the opposite of the ratio.

6. The method according to any one of claims 1-5, characterized in that, The size of the preset sliding template is determined by the digital watermark image and the pixel size of the preset pixel region.

7. The method according to claim 6, characterized in that, If there are multiple candidate areas that meet the preset conditions, then each candidate area that meets the preset conditions and does not overlap will be determined as the watermark embedding area.

8. The method according to claim 6, characterized in that, The determination of the minimum perceptible distortion matrix of the grayscale image using a nonlinear additive masking model includes: The target grayscale image is obtained by extracting the grayscale image based on the resolution of the grayscale image using a preset extraction frequency. The coefficient matrix of the nonlinear additive masking model for the target grayscale image is determined by using a nonlinear additive masking model. The minimum perceptible distortion matrix of the grayscale image is obtained by interpolating the coefficient matrix of the nonlinear additive masking model based on a preset interpolation frequency, wherein the preset extraction frequency and the preset interpolation frequency are reciprocals of each other.

9. The method according to any one of claims 1-5, characterized in that, The digital watermarked image is an image that has been encrypted.

10. A method for extracting digital watermarks, characterized in that, include: Obtain the luminance component image and preset pixel size of the watermark image to be extracted, wherein the watermark image to be extracted is a digital watermark embedded image obtained by any of the digital watermark embedding methods described in claims 1-9; Each pixel of the luminance component image is the luminance component of each pixel of the watermark image to be extracted in the YUV color mode; the preset pixel size is the pixel size of the preset pixel region as described in any one of claims 1-9; Starting from the starting position of the brightness component image, the brightness component image is segmented based on a preset pixel size to obtain multiple non-overlapping target pixel regions; Extract watermark information from each of the target pixel regions, wherein the watermark information is determined based on the pixel brightness in the target pixel region; If the watermark information does not constitute a digital watermark image, then within the target pixel region where the starting position is located, the starting position of the luminance component image is moved in units of pixels, and the process of performing image segmentation on the luminance component image based on the pixel size of the preset pixel region to obtain multiple non-overlapping target pixel regions and extracting the watermark information of each target pixel region is repeated until a digital watermark image is determined or the starting position is within the corresponding target pixel region.

11. The method according to claim 10, characterized in that, The extraction of watermark information for each of the target pixel regions includes: For each target pixel region, extract the brightness of each pixel in the target pixel region; The watermark information of the target pixel region is determined based on the brightness of each pixel.

12. The method according to claim 11, characterized in that, Determining the watermark information of the target pixel region based on the brightness of each pixel includes: Determine the average brightness of each non-center pixel in the target pixel region; If the brightness of the center pixel is greater than the average brightness, then the watermark information embedded in the target pixel area is determined to be the first watermark information. If the brightness of the center pixel is less than or equal to the average brightness, then the watermark information embedded in the target pixel region is determined to be the second watermark information.

13. The method according to claim 10, characterized in that, Following the determination of the digital watermark image, the process also includes: Obtain the key of the digital watermark image embedded in the watermark image to be extracted; Decrypt the digital watermark image based on the key; Information recognition is performed on the decrypted digital watermark image.

14. A digital watermark embedding device, characterized in that, include: The acquisition module is used to acquire the original image and the digital watermark image; A region determination module is used to determine at least one watermark embedding region of the original image; The watermark embedding module is used to adaptively adjust the brightness of pixels in each non-overlapping preset pixel region in the watermark embedding region according to the digital watermark image, so that the digital watermark image is embedded in the watermark embedding region to obtain a digital watermark embedded image. The region determination module includes: A grayscale determination unit is used to determine the grayscale image of the original image; The matrix determination unit is used to determine the minimum perceptible distortion matrix of the grayscale image through a nonlinear additive masking model, and to map the minimum perceptible distortion matrix onto the grayscale image to obtain a mapped image. The traversal unit is used to traverse the mapped image according to a preset sliding template to obtain each candidate region; The embedding area determination unit determines the candidate areas that meet the preset conditions as the watermark embedding areas.

15. A digital watermark extraction device, characterized in that, include: The acquisition module is used to acquire the luminance component image and preset pixel size of the watermark image to be extracted, wherein the watermark image to be extracted is a digital watermark embedded image obtained by the digital watermark embedding method according to any one of claims 1-9. Each pixel of the luminance component image is the luminance component of each pixel of the watermark image to be extracted in the YUV color mode; the preset pixel size is the pixel size of the preset pixel region as described in any one of claims 1-9; The segmentation module is used to segment the brightness component image from the starting position of the brightness component image based on a preset pixel size to obtain multiple non-overlapping target pixel regions. An extraction module is used to extract watermark information from each of the target pixel regions, wherein the watermark information is determined based on the brightness of the pixels in the target pixel regions; The determination module is used to, if the watermark information does not constitute a digital watermark image, move the starting position of the luminance component image in units of pixels within the target pixel region where the starting position is located, return to perform image segmentation of the luminance component image based on the pixel size of the preset pixel region to obtain multiple non-overlapping target pixel regions, and extract the watermark information of each target pixel region, until a digital watermark image is determined or the starting position is within the corresponding target pixel region and the traversal is completed.

16. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the digital watermark embedding method of any one of claims 1-9, and / or to perform the digital watermark embedding method of any one of claims 10-13.

17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute and implement the digital watermark embedding method of any one of claims 1-9, and / or implement the digital watermark embedding method of any one of claims 10-13.