Adaptive color block watermark embedding and extracting method and system based on deep learning
Through deep learning and image processing technology, the color and transparency of the color block watermark are dynamically adjusted, which solves the problem that the color block watermark is easily affected by background interference, realizes real-time adaptation and precise traceability on the screen display interface, and improves the robustness and extractability of the watermark.
Patent Information
- Application Number
- CN202510778229.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-23
AI Technical Summary
Existing color block watermarks are easily affected by background interference, and it is difficult to strike a balance between concealment and recognition accuracy, especially when the background color is close to the watermark color, which leads to the loss of traceability information and reduced extraction accuracy.
An adaptive color block watermark embedding method based on deep learning is adopted. By acquiring the screen background image in real time, the main color tone is extracted using the clustering algorithm, the watermark color and transparency are dynamically adjusted to generate a color-changing color block watermark, and the OpenCV and U-Net models are combined for image traceability and recognition.
It realizes the real-time adaptation of the color block watermark on the terminal display interface, improves the robustness and extractability, ensures visual concealment and accurate traceability, and can accurately extract the watermark information when taking screenshots or photos.
Smart Images

Figure CN120689191A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field related to color block watermarks, and in particular to a method and system for embedding and extracting adaptive color block watermarks based on deep learning. Background Art
[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.
[0003] The rapid development of information technology has significantly improved the efficiency of data exchange and transmission, driving the digitalization of various industries. However, the frequent presentation of sensitive information on display terminals also brings the risk of data leakage through screen capture and illegal screenshots, resulting in both economic and security losses for businesses and individuals. Global losses due to data leaks are increasing annually, and information security issues are becoming increasingly serious. To this end, screen watermarking technology is increasingly being applied in information protection scenarios. This technology embeds a digital watermark into displayed content, binding traceability information to the image content. This approach does not affect the normal visual experience, but allows for precise traceability through specialized systems in the event of an information leak, providing an effective technical guarantee for data security.
[0004] Currently, with the rapid development of deep convolutional neural networks, blind watermarking technology has been widely used in fields such as image processing, and has achieved significant breakthroughs in robustness, concealment, and security. Among them, color block watermarking, as a form of blind watermarking, has the advantage of extracting watermarks without the need for the original image, but there are still some technical bottlenecks in practical applications:
[0005] 1) Background color interference: Color block watermarks are easily affected by the background color of the original screen image, which can lead to loss of traceability information. Especially when the background color is close to the watermark color, the watermark information may not be correctly extracted, thus losing the traceability function.
[0006] 2) The contradiction between concealment and extraction accuracy: To improve concealment, color block watermarks often adopt a low-contrast design. However, excessive concealment will affect the recognizability and extraction accuracy in the captured image. Excessive pursuit of concealment may lead to a decrease in watermark extraction accuracy, especially in images with poor shooting quality, where this problem is more obvious. Summary of the Invention
[0007] In order to solve the above problems, the present disclosure proposes an adaptive color block watermark embedding and extraction method and system based on deep learning. Color block watermarks of different colors are generated according to the background image of the screen and embedded into the original image, which can reduce the visual impact on the user while ensuring the extraction accuracy. In addition, through the combination of the starting color block and the information color block, the data hidden in the color block information can be accurately extracted.
[0008] In order to achieve the above objectives, the present disclosure adopts the following technical solutions:
[0009] One or more embodiments provide a deep learning-based adaptive color block watermark embedding and extraction method, including a color-changing color block watermark generation and embedding method and an image source identification and extraction method. The color-changing color block watermark generation and embedding method includes the following steps:
[0010] Get the background image of the current screen of the display terminal in real time;
[0011] The clustering method is used to extract the main color of each position area of the background image, and the initial value of the watermark color is determined according to the main color of the background image to generate the initial watermark image;
[0012] For each position area of the background image, calculate the difference between the background main color brightness Lg and the watermark color brightness Lw, and adjust the watermark transparency based on the difference to obtain the transparency parameter;
[0013] Combine the initial watermark image with the transparency parameter to generate a new color block watermark image;
[0014] The color block watermark image is covered on the current screen of the display terminal through a transparent window to complete the embedding of the color block watermark image.
[0015] One or more embodiments provide a deep learning-based adaptive color block watermark embedding and extraction system, including a color-changing color block watermark generation and embedding unit and an image source identification and extraction unit, wherein the color-changing color block watermark generation and embedding unit includes:
[0016] A first acquisition module is configured to acquire the background image of the current screen of the display terminal in real time;
[0017] The initial watermark image generation module is configured to extract the main color of each position area of the background image using a clustering method, determine the initial value of the watermark color according to the main color of the background image, and generate an initial watermark image;
[0018] a transparency parameter calculation module configured to calculate the difference between the background main color brightness Lg and the watermark color brightness Lw for each position area of the background image, and adjust the watermark transparency based on the difference to obtain a transparency parameter;
[0019] a combining module configured to combine the initial watermark image with the transparency parameter to generate a new color block watermark image;
[0020] The embedding module is configured to cover the color block watermark image on the current screen of the display terminal through a transparent window to complete the embedding of the color block watermark image.
[0021] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps of the above-mentioned deep learning-based adaptive color block watermark embedding and extraction method are completed.
[0022] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the steps in the above-mentioned deep learning-based adaptive color block watermark embedding and extraction method are completed.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] In this disclosure, we address the issues of existing color block watermarks being easily interfered with by background interference and struggling to balance both concealment and recognition accuracy. By extracting the primary color tone of the screen background through image segmentation and clustering algorithms, and dynamically adjusting the watermark's color and transparency based on this information, we achieve real-time adaptation of the color block watermark on the terminal display interface and enhance traceability. This method, combining cluster analysis, brightness calculation, and transparency control, significantly improves the robustness and extractability of the watermark while maintaining visual concealment. This method enables real-time, non-invasive watermark embedding without affecting normal user operations, while ensuring accurate traceability in the event of a leak.
[0025] The advantages of the present disclosure and additional advantages will be described in detail in the following specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings, which constitute a part of the present disclosure, are used to provide a further understanding of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure but do not constitute a limitation of the present disclosure.
[0027] Figure 1 This is a flow chart of the method for generating and embedding a color-changing color block watermark according to Embodiment 1 of the present disclosure;
[0028] Figure 2 This is a flow chart of the structure of the image tracing identification and extraction method according to the first embodiment of the present disclosure;
[0029] Figure 3 This is an example of a black and white binary image containing only the starting color block in Embodiment 1 of the present disclosure;
[0030] Figure 4 This is an example of a black and white binary picture containing only information blocks in embodiment 1 of the present disclosure. DETAILED DESCRIPTION
[0031] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.
[0032] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present disclosure belongs.
[0033] It should be noted that the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof. It should be noted that, in the absence of conflict, the various embodiments in the present disclosure and the features in the embodiments can be combined with each other. The embodiments will be described in detail below with reference to the accompanying drawings.
[0034] Example 1
[0035] In the technical solutions disclosed in one or more embodiments, Figures 1 to 4 As shown, a method for embedding and extracting adaptive color block watermarks based on deep learning includes a method for generating and embedding color block watermarks and an image source identification and extraction method. The method for generating and embedding color block watermarks includes the following steps:
[0036] Step 1: Get the background image of the current screen of the display terminal in real time;
[0037] Step 2: Use clustering method to extract the main color of each position area of the background image, determine the initial value of the watermark color according to the main color of the background image, and generate the initial watermark image;
[0038] Step 3: For each position area of the background image, calculate the difference between the background main color brightness Lg and the watermark color brightness Lw, and adjust the watermark transparency based on the difference to obtain the transparency parameter;
[0039] Step 4: Combine the initial watermark image with the transparency parameter to generate a new color block watermark image;
[0040] Step 5: Overlay the color block watermark image on the current screen of the display terminal through a transparent window to complete the embedding of the color block watermark image;
[0041] In this embodiment, existing color block watermarks are easily affected by background interference, making it difficult to balance concealment and recognition accuracy. By extracting the primary color tone of the screen background through image segmentation and clustering algorithms, the watermark's color and transparency are dynamically adjusted based on this information, enabling real-time adaptation of the color block watermark on the terminal display interface and enhancing traceability. This method, combining cluster analysis, brightness calculation, and transparency control, significantly improves the robustness and extractability of the watermark while maintaining visual concealment. This method enables real-time, non-invasive watermark embedding without disrupting normal user operations, while ensuring accurate traceability in the event of a leak.
[0042] In step 1, the background image of the current screen of the display terminal is captured in real time according to the set time or frequency. Frequent extraction of background images can adjust the watermark image in real time according to changes in the background image, thereby improving the embedding effect of the watermark image and ensuring visual concealment.
[0043] In step 2, the method for generating the initial watermark image includes the following steps:
[0044] Step 21: Segment the captured background image to obtain a number of image blocks i;
[0045] The captured background image I is divided into an M×N image array II, which is represented as follows:
[0046] II = reshape(I,M,N);
[0047] Among them, M and N are the number of rows and columns of image segmentation respectively;
[0048] Step 22: extract pixels of each image block i to obtain a pixel matrix;
[0049] For each image block i in the image array II, convert it into a two-dimensional RGB pixel matrix P:
[0050] P=reshape(i, (H×W, 3));
[0051] Where H and W are the height and width of the image block, and each pixel p contains the intensity values of the three channels of red (R), green (G), and blue (B);
[0052] Step 23: Clustering the pixel matrix of each image block i to obtain the extracted primary color of image block i; each image block corresponds to a position area, and the primary color of image block i is the primary color of the corresponding position area of the background image; clustering to obtain the extracted primary color of image block i includes the following steps:
[0053] Step 231: Randomly select k initial centroids for the pixel matrix of image block i;
[0054] Randomly select k data points as the initial cluster centers, i.e. centroids; k is the pre-set number of clusters, and the formula for initializing the centroids is as follows:
[0055]
[0056] in, Represents the i-th initial centroid in the clustering algorithm, i = 1, 2...k;
[0057] The initial centroid is sampled from the pixel matrix P in a uniform distribution and is expressed as follows:
[0058]
[0059] Step 232: For each pixel p, calculate its distance to all centroids C i The Euclidean distance d(p,ci) is as follows;
[0060]
[0061] Among them, (r p 、g p 、b p ) are the three-channel pixel values of pixel p, (r ci 、g ci 、b ci ) are the center of mass C i The three-channel pixel values of
[0062] Step 233: Assign each pixel to the cluster formed by the nearest centroid, using the formula:
[0063]
[0064] Step 234: recalculate the mean of each cluster pixel as the new centroid;
[0065]
[0066] in, Indicates the number of pixels in the cluster;
[0067] Step 235: Repeat the iteration until the center of mass change ΔC is less than the set threshold ε;
[0068]
[0069] Step 236: cluster to obtain k groups of primary colors RGB, and select the primary color with the largest proportion as the primary color of image block i.
[0070] Step 24: Determine the initial value of the watermark color at the corresponding position of image block i according to the main color of image block i, and obtain the initial watermark image. Specifically:
[0071] Step 241: Calculate the brightness value L of the primary color RGB of the image block i;
[0072] L=0.299×R+0.587×G+0.114×B;
[0073] Step 242: If the brightness value L is lower than the set value, it is determined to be a dark background, and the watermark color is initialized to a light color, which can be RGB (255, 242, 0);
[0074] If the brightness value L is not lower than the set value, it is judged to be a light background, and the watermark color is initialized to a dark color, which can be RGB (0, 162, 232).
[0075] In step 3, the transparency is adjusted dynamically by calculating the difference between the background main color brightness Lg and the watermark color brightness Lw, and adjusting the transparency parameter alpha based on the difference. The formula is as follows;
[0076] Lg=0.299×Rg+0.587×Gg+0.114×Bg;
[0077] Lw=0.299×Rw+0.587×Gw+0.114×Bw;
[0078] diff = abs(Lg - Lw);
[0079] Adjust the transparency alpha based on the difference so that the transparency is controlled within the set range. The formula is:
[0080] alpha=max(A, 1-diff);
[0081] Among them, A is the set minimum value;
[0082] Preferably, the transparency setting range is 20% to 100%, and the formula is:
[0083] alpha=max(0.2,1-diff);
[0084] In this embodiment, the smaller the brightness difference is, the closer the background and watermark colors are, and the higher the transparency is adjusted, which enhances visual integration; the larger the difference is, the lower the transparency is, which enhances the visibility and extractability of the watermark.
[0085] In step 4, the transparency parameter is superimposed on the initial watermark image to generate a new color block watermark. The generated watermark has background perception and dynamic adjustment characteristics;
[0086] In step 5, a new color block watermark is displayed at the forefront through a transparent window, covering the terminal or other application interface to achieve watermark embedding.
[0087] In the above-mentioned embodiments, we innovatively developed a technology that dynamically adjusts the color of color blocks based on the screen background image. This technology allows the color blocks to blend perfectly with the background, eliminating visual abruptness while ensuring the accuracy of color block extraction, providing users with a more harmonious and natural visual experience.
[0088] A further technical solution is to use the method of combining OpenCV image processing with U-Net deep learning model to identify and extract the image source. Figure 2 As shown, the following steps are included:
[0089] Step S1: pre-processing the acquired image to be traced;
[0090] Step S2: Generate a binary image based on the U-Net model to obtain a first black-and-white binary image containing the starting color block and a second black-and-white binary image containing the information color block;
[0091] Step S3: for the first black and white binary image, locate the starting square based on the OpenCV edge detection and contour extraction algorithm, identify the position of the starting square in the image, and obtain the ROI rectangular area;
[0092] Step S4: Calculate the conversion relationship between the starting block coordinate system and the information block coordinate system, determine that the ROI rectangular area corresponds to the area of the second black and white mapping, and perform grid division to obtain multiple color blocks;
[0093] Step S5: sequentially detect the proportion of black pixels in each color block, use a threshold method to obtain a binary code for each color block, and finally obtain binary traceability information;
[0094] In step S1, the image to be traced is obtained, and a screenshot or a photo is taken of the screen where the watermark image is embedded;
[0095] Optionally, the acquired image to be traced is preprocessed, including compression, distortion correction, saturation adjustment and other processing, to enhance image quality.
[0096] In step S2, the processed image is semantically segmented using the trained U-Net network to obtain a set of starting color blocks and a set of information color blocks, and two black-and-white binary images are generated, one containing only the starting color blocks and the other containing only the information color blocks.
[0097] The white blocks in the two black and white binary images represent the starting blocks and information blocks, as shown in the figure:
[0098] Starting color block: It is used to locate the starting position of the (M×N) ROI rectangular area in the image to be traced. It is an example image of a black and white binary image containing only the starting color block, such as Figure 3 shown.
[0099] Information color blocks: (M×N-1) information color blocks store binary traceability information. A specific example of a black and white binary image containing only information color blocks is as follows: Figure 4 As shown;
[0100] In step S3, the initial color block detection is performed, all the color block outlines of the first black and white binary image are scanned, and the upper left corner coordinates and the color block side length (m) of each color block are calculated.
[0101] In step S4, since the first black-and-white binary image and the second black-and-white binary image have the same width and height, a rectangular ROI area of size M×N is cropped from the second black-and-white binary image with the upper left corner as the origin, using the coordinates of the upper left corner of the starting color block and the side length (m) calculated in step S3.
[0102] In step S4, the area corresponding to the ROI rectangular area in the second black and white map is divided into grids according to the side length (m), and the number of divisions can be M×N, to obtain M×N small color blocks;
[0103] In step S5, binary character information is extracted, specifically:
[0104] Step S51: setting a black ratio threshold. In this embodiment, it is preferably set to no less than 0.628;
[0105] Step S52: Calculate the black proportion of a single color block. If the black proportion is greater than the black proportion threshold, it is recorded as "1", and if it is less than the black proportion threshold, it is recorded as "0". The binary code corresponding to the single color block is obtained. The binary codes of all color blocks constitute binary traceability information.
[0106] The image traceability identification and extraction of this embodiment is based on the image processing method of OpenCV, which performs distortion correction, compression, saturation and other processing operations on the image. The deep learning method based on the U-Net network converts the watermark image into a black and white binary image containing only the starting block and a black and white binary image containing only the information block. Among them, the white square in the black and white binary image represents the starting block and the information block. Then use OpenCV's edge detection, outline frame recognition and other methods to calculate the starting block coordinates and the information block coordinate system. Use the starting block as a reference system to crop the black and white binary image containing the information block into individual pictures. These pictures are then cropped into M×N blocks. The white square represents 1 and the black square represents 0, and binary traceability information can be obtained.
[0107] The above implementation provides an image provenance recognition solution that integrates OpenCV image processing with U-Net deep learning methods. This solution uniquely and creatively integrates an adaptive color block recognition mechanism, multi-color block recognition capabilities, and a method for fusion and correction of the results. This integration effectively addresses the shortcomings of existing technologies and can effectively meet the needs of simultaneous recognition of screenshot and photo watermarks in practical application scenarios, providing a more efficient and accurate solution for image provenance recognition.
[0108] Example 2
[0109] Based on Example 1, this embodiment provides an adaptive color block watermark embedding and extraction system based on deep learning, including a color-changing color block watermark generation and embedding unit and an image tracing and identification extraction unit. The color-changing color block watermark generation and embedding unit includes:
[0110] A first acquisition module is configured to acquire the background image of the current screen of the display terminal in real time;
[0111] The initial watermark image generation module is configured to extract the main color of each position area of the background image using a clustering method, determine the initial value of the watermark color according to the main color of the background image, and generate an initial watermark image;
[0112] a transparency parameter calculation module configured to calculate the difference between the background main color brightness Lg and the watermark color brightness Lw for each position area of the background image, and adjust the watermark transparency based on the difference to obtain a transparency parameter;
[0113] a combining module configured to combine the initial watermark image with the transparency parameter to generate a new color block watermark image;
[0114] The embedding module is configured to cover the color block watermark image on the current screen of the display terminal through a transparent window to complete the embedding of the color block watermark image.
[0115] Furthermore, the image tracing identification and extraction unit includes the following modules:
[0116] An image preprocessing module is configured to preprocess the acquired image to be traced;
[0117] A binary image generation module is configured to generate a binary image based on a U-Net model to obtain a first black-and-white binary image containing a starting color block and a second black-and-white binary image containing an information color block;
[0118] A starting square positioning module is configured to locate the starting square based on the OpenCV edge detection and contour extraction algorithm for the first black and white binary image, identify the position of the starting square in the image, and obtain the ROI rectangular area;
[0119] The cropping module is configured to calculate the conversion relationship between the starting block coordinate system and the information block coordinate system, determine that the ROI rectangular area corresponds to the area of the second black and white mapping, and perform grid division to obtain multiple color blocks;
[0120] The binary information extraction module is configured to detect the proportion of black pixels in each color block in turn, use the threshold method to obtain the binary code of each color block, and finally obtain binary traceability information.
[0121] It should be noted here that the various modules in this embodiment correspond one-to-one to the various steps in Example 1, and the specific implementation processes are the same, which will not be repeated here.
[0122] Example 3
[0123] This embodiment provides an electronic device, including a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps of the deep learning-based adaptive color block watermark embedding and extraction method of embodiment 1 are completed.
[0124] Example 4
[0125] This embodiment provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the steps of the deep learning-based adaptive color block watermark embedding and extraction method of embodiment 1 are completed.
[0126] The foregoing description is merely a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Those skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present disclosure shall be included within the scope of protection of the present disclosure.
[0127] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Those skilled in the art should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.
Claims
1. The adaptive color block watermark embedding and extraction method based on deep learning is characterized by: The invention includes a color-changing color block watermark generation and embedding method and an image traceability identification and extraction method, wherein the color-changing color block watermark generation and embedding method includes the following steps: Get the background image of the current screen of the display terminal in real time; The clustering method is used to extract the main color of each position area of the background image, and the initial value of the watermark color is determined according to the main color of the background image to generate the initial watermark image; For each position area of the background image, calculate the difference between the background main color brightness Lg and the watermark color brightness Lw, and adjust the watermark transparency based on the difference to obtain the transparency parameter; Combine the initial watermark image with the transparency parameter to generate a new color block watermark image; The color block watermark image is covered on the current screen of the display terminal through a transparent window to complete the embedding of the color block watermark image.
2. The method for adaptive color block watermark embedding and extraction based on deep learning according to claim 1, characterized in that: The method for generating an initial watermark image includes the following steps: Perform image segmentation on the captured background image to obtain several image blocks i; Extract the pixels of each image block i to obtain a pixel matrix; Cluster the pixel matrix of each image block i to obtain the extracted main color of image block i; According to the main color of image block i, the initial value of the watermark color at the corresponding position of image block i is determined to obtain the initial watermark image.
3. The method for adaptive color block watermark embedding and extraction based on deep learning according to claim 2, characterized in that: Clustering is performed to obtain the extracted main color of the image block i, including the following steps: Step 231: Randomly select k initial centroids for the pixel matrix of image block i; Step 232: For each pixel p of the pixel matrix of image block i, calculate its distance to all centroids C i The Euclidean distance of Step 233: assign each pixel to the cluster formed by the nearest centroid; Step 234: recalculate the mean of each cluster pixel as the new centroid; Step 235: Repeat steps 232 to 234 until the centroid change is less than a set threshold. Step 236: cluster to obtain k groups of primary colors RGB, and select the primary color with the largest proportion as the primary color of image block i.
4. The method for adaptive color block watermark embedding and extraction based on deep learning according to claim 1, characterized in that: According to the main color of image block i, determine the initial value of the watermark color at the corresponding position of image block i and obtain the initial watermark image. Specifically: Calculate the brightness value L of the main color RGB of image block i; If the brightness value L is lower than the set value, it is judged as a dark background, and the watermark color is initialized to a light color; If the brightness value L is not lower than the set value, it is judged to be a light background, and the watermark color is initialized to a dark color.
5. The method for embedding and extracting color block watermarks based on deep learning according to claim 1, wherein: Dynamically adjust transparency by calculating the difference between the background main color brightness Lg and the watermark color brightness Lw, and adjusting the transparency parameter alpha based on the difference. The formula is as follows; Lg=0.299×Rg+0.587×Gg+0.114×Bg; Lw=0.299×Rw+0.587×Gw+0.114×Bw; diff = abs(Lg - Lw); Adjust the transparency alpha based on the difference so that the transparency is controlled within the set range. The formula is: alpha=max(A, 1-diff); Among them, A is the set minimum value.
6. The method for embedding and extracting color block watermarks based on deep learning according to claim 1, wherein: The image traceability recognition and extraction method uses a method that combines OpenCV image processing with the U-Net deep learning model, including the following steps: Preprocess the acquired images to be traced; Based on the binary image generation of the U-Net model, a first black-and-white binary image containing the starting color block and a second black-and-white binary image containing the information color block are obtained; For the first black and white binary image, the starting square is located based on the OpenCV edge detection and contour extraction algorithm, the position of the starting square in the image is identified, and the ROI rectangular area is obtained; Calculate the conversion relationship between the starting block coordinate system and the information block coordinate system, determine that the ROI rectangular area corresponds to the area of the second black and white mapping, and perform grid division to obtain multiple color blocks; The proportion of black pixels in each color block is detected in turn, and the threshold method is used to obtain the binary code of each color block, and finally the binary traceability information is obtained.
7. Deep learning-based adaptive color block watermark embedding and extraction system, characterized by: It includes a color-changing color block watermark generation and embedding unit and an image traceability identification and extraction unit, wherein the color-changing color block watermark generation and embedding unit includes: A first acquisition module is configured to acquire the background image of the current screen of the display terminal in real time; The initial watermark image generation module is configured to extract the main color of each position area of the background image using a clustering method, determine the initial value of the watermark color according to the main color of the background image, and generate an initial watermark image; a transparency parameter calculation module configured to calculate the difference between the background main color brightness Lg and the watermark color brightness Lw for each position area of the background image, and adjust the watermark transparency based on the difference to obtain a transparency parameter; a combining module configured to combine the initial watermark image with the transparency parameter to generate a new color block watermark image; The embedding module is configured to cover the color block watermark image on the current screen of the display terminal through a transparent window to complete the embedding of the color block watermark image.
8. The deep learning-based adaptive color block watermark embedding and extraction system according to claim 7, characterized in that: The image traceability recognition and extraction unit includes the following modules: An image preprocessing module is configured to preprocess the acquired image to be traced; A binary image generation module is configured to generate a binary image based on a U-Net model to obtain a first black-and-white binary image containing a starting color block and a second black-and-white binary image containing an information color block; A starting square positioning module is configured to locate the starting square based on the OpenCV edge detection and contour extraction algorithm for the first black and white binary image, identify the position of the starting square in the image, and obtain the ROI rectangular area; The cropping module is configured to calculate the conversion relationship between the starting block coordinate system and the information block coordinate system, determine that the ROI rectangular area corresponds to the area of the second black and white mapping, and perform grid division to obtain multiple color blocks; The binary information extraction module is configured to detect the proportion of black pixels in each color block in turn, use the threshold method to obtain the binary code of each color block, and finally obtain binary traceability information.
9. An electronic device, characterized in that: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps of the deep learning-based adaptive color block watermark embedding and extraction method according to any one of claims 1 to 6 are completed.
10. A computer-readable storage medium, characterized in that Used to store computer instructions, which, when executed by a processor, complete the steps of the deep learning-based adaptive color block watermark embedding and extraction method according to any one of claims 1 to 6.