Watermark removal method, device and computer readable storage medium

By identifying watermark areas and pixels in the image, generating and using matrices for convolution operations, the problem of poor generalization ability of the neural network model is solved, accurate and rapid elimination of watermarks is achieved, and the accuracy and elimination of image recognition are improved. efficiency.

CN114092300BActive Publication Date: 2024-10-11CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010857473.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-24
Publication Date
2024-10-11
Estimated Expiration
2040-08-24

AI Technical Summary

Technical Problem

When using a pre-trained neural network model to eliminate watermarks in the prior art, the generalization ability of the model is poor, resulting in low watermark elimination accuracy.

Method used

By identifying the watermark area and watermark pixels in the image to be processed, the associated first matrix and second matrix are generated, and a convolution operation is used to generate a target pixel value, which replaces the pixel value of the watermark pixel to eliminate the watermark.

Benefits of technology

It achieves accurate and rapid elimination of watermarks, improves the accuracy of image recognition, does not rely on training data, and improves the efficiency of watermark elimination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114092300B_ABST
    Figure CN114092300B_ABST
Patent Text Reader

Abstract

The present disclosure proposes a watermark removal method, device and computer-readable storage medium, and relates to the field of computer technology. In the present disclosure, a watermark area in an image to be processed is identified, and watermark pixels are identified in the watermark area. A target pixel value that can replace the pixel value of the watermark pixel is calculated and generated based on a first matrix related to the pixel values ​​of adjacent pixels of the generated watermark pixel and a second matrix related to the generated smoothness weight, so that the watermark in the image to be processed can be smoothly removed. The accuracy of watermark removal does not depend on the training data of the model, which ensures the accuracy of watermark removal. In addition, the embodiments of the present disclosure do not require a training model, which improves the efficiency of watermark removal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Adding watermarks to images is a common technique. The watermarks implanted in the original images have the characteristics of small area, light color, high transparency, etc. However, in the field of image recognition, the watermarks in the images will affect the accuracy of image recognition. Therefore, in order to improve the accuracy of image recognition, these watermarks need to be removed.

[0003] In some related technologies, image data is used as training data to train a neural network model, and the watermark is removed through the pre-trained neural network model. Summary of the invention

[0004] The inventors found that in the related art, a pre-trained neural network model is used to complete watermark removal. The accuracy of watermark removal is heavily dependent on the training data used to train the neural network model, and the generalization ability of the model is poor.

[0005] Accordingly, the present disclosure provides a method that can accurately and quickly remove watermarks.

[0006] According to some embodiments of the present disclosure, a watermark removal method is provided, comprising:

[0007] Identify the watermark area in the image to be processed;

[0008] Identifying watermark pixels in the watermark area;

[0009] For the i-th watermark pixel point among the watermark pixel points, generating an associated first matrix and a second matrix, wherein 1≤i≤N, N is the total number of identified watermark pixel points, the first matrix includes the pixel values ​​of the i-th watermark pixel point and the neighboring pixel points of the i-th watermark pixel point, and the second matrix includes the smoothness weight of each pixel point in the first matrix;

[0010] Generate a target pixel value using the first matrix and the second matrix;

[0011] The pixel value of the i-th watermark pixel is replaced by the target pixel value to remove the watermark in the image to be processed.

[0012] In some embodiments, generating a target pixel value using the first matrix and the second matrix includes: performing a convolution operation on the first matrix and the second matrix to obtain a first result; and taking a ratio of the first result value to the sum of elements of the second matrix as the target pixel value.

[0013] In some embodiments, performing a convolution operation on the first matrix and the second matrix includes: using the second matrix as a convolution kernel, performing a preset flipping process to obtain a third matrix; and multiplying the first matrix and the third matrix to complete the convolution operation.

[0014] In some embodiments, generating a first matrix associated with the ith watermark pixel includes: using a matrix composed of pixel values ​​of all neighboring pixels of the watermark pixel in the watermark area as the first matrix.

[0015] In some embodiments, generating a second matrix associated with the ith watermark pixel point includes: in the first matrix, among the pixels adjacent to the pixel point corresponding to the jth element, counting the number of pixels having the same pixel value as the jth pixel point, 1≤j≤M, M being the total number of elements in the first matrix; using the number of pixels as the smoothness weight of the pixel point corresponding to the jth element; and using a matrix composed of the smoothness weights of the pixel points corresponding to all elements in the first matrix as the second matrix.

[0016] In some embodiments, identifying the watermark region in the image to be processed includes: determining a region in the image to be processed where the density of watermark pixels is greater than a preset density threshold as the watermark region.

[0017] In some embodiments, identifying a watermark area in an image to be processed includes: sliding a preset detection window in the image to be processed, and taking the area determined by the detection window as the detection area; determining whether the density of watermark pixels in the detection area is greater than a preset density threshold; and determining the detection area where the density of watermark pixels is greater than the preset density threshold as the watermark area.

[0018] According to some other embodiments of the present disclosure, a watermark removal device is provided, comprising:

[0019] A first recognition module is configured to recognize a watermark area in the image to be processed;

[0020] A second recognition module is configured to recognize watermark pixels in the watermark area;

[0021] A first generating module is configured to generate, for an i-th watermark pixel among the watermark pixels, a first matrix and a second matrix associated therewith, wherein 1≤i≤N, N is the total number of identified watermark pixels, the first matrix includes pixel values ​​of the i-th watermark pixel and neighboring pixels of the i-th watermark pixel, and the second matrix includes a smoothness weight of each pixel in the first matrix;

[0022] A second generating module is configured to generate a target pixel value using the first matrix and the second matrix;

[0023] The watermark removal module is configured to replace the pixel value of the i-th watermark pixel point with the target pixel value to remove the watermark in the image to be processed.

[0024] According to some further embodiments of the present disclosure, a watermark removal apparatus is provided, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the watermark removal method described in any embodiment based on instructions stored in the memory.

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

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

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

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

[0029] Figure 2 A schematic diagram of a process for generating a target pixel value by using a first matrix and a second matrix according to some embodiments of the present disclosure is shown.

[0030] Figure 3 A schematic diagram of a process for generating a second matrix associated with watermark pixels according to some embodiments of the present disclosure is shown.

[0031] Figure 4 A schematic diagram of a process for identifying a watermark region in an image to be processed according to some embodiments of the present disclosure is shown.

[0032] Figure 5 A schematic diagram of a watermark removal device according to some embodiments of the present disclosure is shown.

[0033] Figure 6 A schematic diagram showing a watermark removal device according to some other embodiments of the present disclosure. DETAILED DESCRIPTION

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

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

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

[0037] In step 101, the image to be processed is converted into an image in HSV (Hue, Saturation, Value) format.

[0038] For example, the image to be processed can be an image in RGB (Red, Green, Blue) format. After converting the image to be processed into HSV format, the color representation of the image can be more intuitive, which is convenient for color comparison and subsequent operations, making it easier to distinguish between watermark areas and non-watermark areas, and to smoothly eliminate the watermark.

[0039] In step 102, a watermark region in the image to be processed is identified.

[0040] In some embodiments, a region in the image to be processed where the density of watermark pixels is greater than a preset density threshold is determined as a watermark region.

[0041] Figure 2 A schematic diagram of a process for identifying a watermark area in an image to be processed according to some embodiments of the present disclosure is shown.

[0042] In some embodiments, an initial value of a preset detection window size (eg, 3×3) and an initial value of a preset density threshold (eg, 50%) are firstly set.

[0043] In step 201, a preset detection window is slid in the image to be processed, and the area determined by the detection window is used as the detection area.

[0044] In step 202, it is determined in turn whether the density of watermark pixels in each detection area is greater than a preset density threshold.

[0045] If the judgment result is that the density of the watermark pixels in the detection area is greater than the preset density threshold, step 203 is executed.

[0046] If the judgment result is that the density of watermark pixels in all detection areas is not greater than the preset density threshold, step 204 is executed.

[0047] In step 203, the detection area where the density of watermark pixels is greater than a preset density threshold is determined as the watermark area.

[0048] In step 404, the size of the preset detection window or the preset density threshold is adjusted, and steps 201-202 are repeatedly executed.

[0049] When the density of watermark pixels in all detection areas is not greater than a preset density threshold, the size of the preset detection window or the preset density threshold is adjusted until the watermark area is identified.

[0050] The watermark area is determined by sliding the detection window in sequence according to whether the density of the watermark pixels meets the preset watermark pixel density, avoiding the problem of using a larger or smaller area as the watermark area, which would cause the recognition accuracy of the watermark area to be low or the recognition speed to be slow. Figure 1 , in step 103, watermark pixels are identified in the watermark area.

[0051] For example, the watermark pixel in the watermark area is determined according to the pixel value of the preset watermark pixel. If the pixel value of a certain pixel in the watermark area matches the pixel value of the preset watermark pixel (ie, they are equal within a preset error range), the pixel is determined as the watermark pixel.

[0052] For example, as shown in Table 1, the pixel value matrix represented by the HSV value of each pixel point of the image to be processed is shown. The pixel value corresponding to the element filled with the gray part represents the watermark area in the image to be processed, and W1 and W2 represent two watermark pixels in the watermark area respectively.

[0053] Table 1

[0054]

[0055] In step 104, for the i-th watermark pixel point among the watermark pixel points, an associated first matrix and a second matrix are generated, wherein 1≤i≤N, N is the total number of identified watermark pixel points, the first matrix includes the pixel values ​​of the i-th watermark pixel point and the adjacent pixel points of the i-th watermark pixel point, and the second matrix includes the smoothness weight of each pixel point in the first matrix.

[0056] In some embodiments, generating a first matrix associated with the i-th watermark pixel includes: using a matrix composed of pixel values ​​of all neighboring pixels of the watermark pixel in the watermark region as the first matrix. In addition, setting the pixel value of the watermark pixel in the first matrix to 0.

[0057] In some embodiments, when all the neighboring pixels of the watermark pixel are located in the watermark area, the matrix composed of the pixel values ​​of all the neighboring pixels of the watermark pixel located in the watermark area is used as the first matrix; when some of the neighboring pixels of the watermark pixel are located in the watermark area, the pixel values ​​of some of the neighboring pixels of the watermark pixel located in the watermark area are used as elements in the first matrix, and the pixel values ​​of the neighboring pixels located outside the watermark area and in the image to be processed are used as elements in the first matrix to obtain the final first matrix. If there are neighboring pixels located outside the image to be processed, the pixel values ​​of the missing neighboring pixels can be padded with 0, for example.

[0058] For example, according to the image to be processed shown in Table 1, there are two watermark pixels, that is, N = 2. The first watermark pixel is W1, and the second watermark pixel is W2.

[0059] As shown in Table 2, 5 neighboring pixels of the watermark pixel W1 are located in the watermark area, and 3 neighboring pixels are not in the watermark area but are located in the image to be processed. The element at index (1, 1) represents the watermark pixel W1, and its pixel value is set to 0. Then, the first matrix associated with the watermark pixel W1 is expressed as

[0060] Table 2

[0061]

[0062] As shown in Table 3, the eight neighboring pixels of the watermark pixel W2 are all located in the watermark area. The element at index (1, 1) represents the watermark pixel W2, and its pixel value is set to 0. Then, the first matrix associated with the watermark pixel W2 is expressed as

[0063] Table 3

[0064] 20 20 30 20 0 50 40 30 30

[0065] Figure 3 A schematic diagram of a process for generating a second matrix associated with watermark pixels according to some embodiments of the present disclosure is shown.

[0066] In step 301, in a first matrix, among the pixels adjacent to the pixel corresponding to the jth element, the number of pixels having the same pixel value as the jth pixel is counted, 1≤j≤M, where M is the total number of elements in the first matrix.

[0067] The pixel points adjacent to the pixel point corresponding to the j-th element may be, for example, 8 adjacent pixel points, or may be 4 adjacent pixel points on the top, bottom, left, and right.

[0068] In step 302, the number of pixels is used as the smoothness weight of the pixel corresponding to the jth element. The more adjacent pixels having the same pixel value as a certain pixel, the greater the smoothness weight of the pixel.

[0069] In step 303, a matrix consisting of smoothness weights of pixels corresponding to all elements in the first matrix is ​​used as a second matrix.

[0070] In the above embodiment, a second matrix associated with each watermark pixel is generated, and a second matrix composed of smoothness weights is obtained according to the number of adjacent pixels having the same pixel value, which lays a foundation for the subsequent smooth removal of the watermark.

[0071] For example, in the first matrix, among the pixels adjacent to the pixel corresponding to the j-th element, the number of pixels having the same pixel value as the j-th pixel is counted, 1≤j≤M, M is the total number of elements in the first matrix; the number of pixels is used as the smoothness weight of the pixel corresponding to the j-th element; and the matrix formed by the smoothness weights of the pixels corresponding to all the elements in the first matrix is ​​used as the second matrix.

[0072] For example, the smoothness weight of each element of the first matrix associated with W1 is counted. The first matrix contains 9 elements, that is, M is 9. For the pixel value 10 corresponding to the j=1th element, the matrix composed of the pixel values ​​of the adjacent pixels of the element is first determined, for example, as shown in Table 4. Among the pixel values ​​corresponding to the four adjacent elements of the upper, lower, left, and right, one (the left adjacent element) is equal to the pixel value 10 of the element. That is, the smoothness weight at j=1 is 1.

[0073] Table 4

[0074]

[0075] Referring to the same method, the smoothness weights of the pixel values ​​corresponding to the j=2, 3, ..., 9 elements are 3, 1, 0, 0, 1, 1, 0, 2 respectively. That is, the second matrix associated with W1 can be expressed as

[0076] The second matrix associated with the i-th watermark pixel can also be generated by Figure 3 The method for generating the second matrix is ​​shown.

[0077] In step 105, a target pixel value is generated using the first matrix and the second matrix.

[0078] In some embodiments, the second matrix is ​​used as a convolution kernel and a preset flipping process (such as horizontal flipping and vertical flipping) is performed to obtain a third matrix; the first matrix and the third matrix are multiplied to complete the convolution operation to obtain a first result; and the ratio of the first result value to the sum of the elements of the second matrix is ​​used as the target pixel value.

[0079] For example, for the second matrix associated with W1 Perform horizontal and vertical flips to obtain the third matrix, which is expressed as Then, the first matrix associated with W1 and the third matrix associated with W1 Multiply them, that is The first result is 310. The sum of the elements of the second matrix is ​​calculated to be 1+3+1+0+0+1+1+0+2=9. The ratio of the first result to the sum of the elements of the second matrix is ​​calculated. The ratio 34.44 is used as the target pixel value.

[0080] Figure 4 A schematic diagram of a process for generating target pixel values ​​by using a first matrix and a second matrix according to some embodiments of the present disclosure is shown.

[0081] In step 401, the second matrix is ​​used as a convolution kernel and a preset flipping process is performed to obtain a third matrix.

[0082] The preset flipping process may be, for example, horizontal flipping and vertical flipping.

[0083] In step 402, the first matrix is ​​multiplied with the third matrix to complete the convolution operation and obtain the first result. The convolution operation can take into account the smoothness weights of all neighboring pixels of the watermark pixel and obtain the weighted processing result of the watermark pixel, which lays the foundation for the subsequent smooth removal of the watermark.

[0084] In step 403, the ratio of the first result value to the sum of the elements of the second matrix is ​​used as the target pixel value. The first result value can be normalized to a representation range of pixel values ​​(eg, 0-255) to improve the accuracy of the target pixel value of the replaced watermark pixel point.

[0085] In the above embodiment, the method of generating target pixel values ​​using the first matrix and the second matrix can achieve smooth watermark removal.

[0086] return Figure 1 In step 106, the pixel value of the i-th watermark pixel is replaced by the target pixel value to remove the watermark in the image to be processed.

[0087] In the above embodiment, by identifying the watermark area and the watermark pixels in the watermark area in the image to be processed, a target pixel value that can replace the pixel value of the watermark pixel is calculated and generated according to the first matrix related to the pixel values ​​of the adjacent pixels of the generated watermark pixel and the second matrix related to the generated smoothness weight, so that the watermark in the image to be processed can be smoothly removed, and the accuracy of watermark removal does not depend on the training data of the model, thereby ensuring the accuracy of watermark removal. In addition, the above embodiment does not require a training model, thereby improving the efficiency of watermark removal.

[0088] Figure 5 A schematic diagram of a watermark removal device according to some embodiments of the present disclosure is shown.

[0089] like Figure 5 As shown, the watermark removal device 500 of this embodiment includes: a first recognition module 501, a second recognition module 502, a first generation module 503, a second generation module 504, and a watermark removal module 505.

[0090] The first recognition module 501 is configured to recognize a watermark region in the image to be processed.

[0091] In some embodiments, identifying the watermark region in the image to be processed includes: determining a region in the image to be processed where the density of watermark pixels is greater than a preset density threshold as the watermark region.

[0092] In other embodiments, identifying the watermark area in the image to be processed includes: sliding a preset detection window in the image to be processed, and using the area determined by the detection window as the detection area; determining whether the density of watermark pixels in the detection area is greater than a preset density threshold; and determining the detection area where the density of watermark pixels is greater than the preset density threshold as the watermark area.

[0093] The second recognition module 502 is configured to recognize watermark pixels in the watermark area.

[0094] The first generation module 503 is configured to generate the associated first matrix and second matrix for the i-th watermark pixel point in the watermark pixel points, wherein 1≤i≤N, N is the total number of identified watermark pixel points, the first matrix includes the pixel values ​​of the i-th watermark pixel point and the adjacent pixel points of the i-th watermark pixel point, and the second matrix includes the smoothness weight of each pixel point in the first matrix. In some embodiments, generating the first matrix associated with the i-th watermark pixel point includes: using the matrix composed of the pixel values ​​of all adjacent pixel points of the watermark pixel point located in the watermark area as the first matrix. Generating the second matrix associated with the i-th watermark pixel point includes: in the first matrix, among the pixel points adjacent to the pixel point corresponding to the j-th element, counting the number of pixel points having the same pixel value as the j-th pixel point, 1≤j≤M, M is the total number of elements in the first matrix; using the number of pixel points as the smoothness weight of the pixel point corresponding to the j-th element; using the matrix composed of the smoothness weights of the pixel points corresponding to all elements in the first matrix as the second matrix.

[0095] The second generation module 504 is configured to generate a target pixel value using the first matrix and the second matrix. In some embodiments, generating the target pixel value using the first matrix and the second matrix includes: performing a convolution operation on the first matrix and the second matrix to obtain a first result; and using the ratio of the first result value to the sum of the elements of the second matrix as the target pixel value. Among them, performing a convolution operation on the first matrix and the second matrix includes: using the second matrix as a convolution kernel and performing a preset flipping process to obtain a third matrix; and performing a multiplication operation on the first matrix and the third matrix to complete the convolution operation.

[0096] The watermark removal module 505 is configured to replace the pixel value of the i-th watermark pixel with the target pixel value to remove the watermark in the image to be processed.

[0097] The watermark removal device in the above embodiment can achieve smooth and rapid removal of watermarks, and can ensure the accuracy of watermark removal.

[0098] Figure 6 A schematic diagram showing a watermark removal device according to some other embodiments of the present disclosure.

[0099] like Figure 6 As shown, the watermark removal device 600 of this embodiment includes: a memory 601 and a processor 602 coupled to the memory 601, and the processor 602 is configured to execute the watermark removal method in any of some embodiments of the present disclosure based on the instructions stored in the memory 601.

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

[0101] The watermark removal device 600 may also include an input / output interface 603, a network interface 604, a storage interface 605, etc. These interfaces 603, 604, 605, the memory 601, and the processor 602 may be connected, for example, via a bus 606. The input / output interface 603 provides a connection interface for input / output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 604 provides a connection interface for various networked devices. The storage interface 605 provides a connection interface for external storage devices such as SD cards and USB flash drives.

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

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

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

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

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

Claims

1. A watermark removal method, include: Identify the watermark area in the image to be processed; Identifying watermark pixels in the watermark area; For the i-th watermark pixel point among the watermark pixel points, generate an associated first matrix and a second matrix, wherein 1 ≤ i ≤ N, N is the total number of identified watermark pixel points, the first matrix includes the pixel values ​​of the i-th watermark pixel point and the neighboring pixel points of the i-th watermark pixel point, and the second matrix includes the smoothness weight of each pixel point in the first matrix; Generate a target pixel value using the first matrix and the second matrix; The pixel value of the i-th watermark pixel is replaced by the target pixel value to remove the watermark in the image to be processed; The step of generating a target pixel value by using the first matrix and the second matrix includes: Performing a convolution operation on the first matrix and the second matrix to obtain a first result; Taking the ratio of the first result value to the sum of the elements of the second matrix as the target pixel value; The step of generating a first matrix associated with the i-th watermark pixel point includes: The matrix composed of pixel values ​​of all adjacent pixels of the watermark pixel in the watermark area is used as the first matrix; The step of generating a second matrix associated with the i-th watermark pixel point includes: In the first matrix, among the pixel points adjacent to the pixel point corresponding to the j-th element, the number of pixel points having the same pixel value as the j-th pixel point is counted, 1 ≤ j ≤ M, where M is the total number of elements in the first matrix; The number of pixels is used as the smoothness weight of the pixel corresponding to the jth element; A matrix consisting of smoothness weights of the pixels corresponding to all elements in the first matrix is ​​used as the second matrix.

2. The watermark removal method according to claim 1, in, Performing a convolution operation on the first matrix and the second matrix includes: Using the second matrix as a convolution kernel, performing a preset flipping process to obtain a third matrix; The first matrix is ​​multiplied by the third matrix to complete a convolution operation.

3. The watermark removal method according to claim 1, in, Identifying the watermark area in the image to be processed includes: The area in the image to be processed where the density of watermark pixels is greater than a preset density threshold is determined as the watermark area.

4. The watermark removal method according to claim 1, identifying the watermark area in the image to be processed include: Slide a preset detection window in the image to be processed, and use the area determined by the detection window as the detection area; Determine whether the density of watermark pixels in the detection area is greater than a preset density threshold; The detection area where the density of watermark pixels is greater than a preset density threshold is determined as the watermark area.

5. A watermark removal device, in, include: A first recognition module is configured to recognize a watermark area in the image to be processed; A second recognition module is configured to recognize watermark pixels in the watermark area; A first generating module is configured to generate an associated first matrix and a second matrix for an i-th watermark pixel among the watermark pixels, wherein 1 ≤ i ≤ N, N is the total number of identified watermark pixels, the first matrix includes the pixel values ​​of the i-th watermark pixel and the pixel values ​​of the i-th watermark pixel, the second matrix includes the smoothness weight of each pixel in the first matrix, wherein a matrix consisting of the pixel values ​​of all the neighboring pixel points of the watermark pixel in the watermark area is used as the first matrix, wherein in the first matrix, among the pixel points neighboring the pixel point corresponding to the j-th element, the number of pixel points having the same pixel value as the j-th pixel point is counted, 1 ≤ j ≤M, M is the total number of elements in the first matrix, the number of pixel points is used as the smoothness weight of the pixel point corresponding to the j-th element, and the matrix consisting of the smoothness weights of the pixel points corresponding to all the elements in the first matrix is ​​used as the second matrix; a second generating module configured to generate a target pixel value using the first matrix and the second matrix, wherein a convolution operation is performed on the first matrix and the second matrix to obtain a first result, and a ratio of the first result value to a sum of elements of the second matrix is ​​used as the target pixel value; The watermark removal module is configured to replace the pixel value of the i-th watermark pixel point with the target pixel value to remove the watermark in the image to be processed.

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

7. A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the watermark removal method according to any one of claims 1 to 4.