Text watermark image preprocessing method and system
Through the preprocessing method of text watermark images, including non-blind detection and multiple image processing steps, the extraction and recovery efficiency of text watermark images is improved, and the problems of low recognition efficiency and low manual correction efficiency caused by deformation are solved, and the batch automatic deal with.
Patent Information
- Application Number
- CN202411845368.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-01-14
AI Technical Summary
In the prior art, text watermark images are inefficient in recognition due to deformation when taken by smartphones or digital cameras, and manual correction efficiency is low and cannot adapt to batch automatic processing.
A preprocessing method for text watermark images is adopted, including obtaining watermark preprocessing targets, performing non-blind detection to evaluate watermark intensity, and obtaining The difference points are targeted pre-processed, the processing threshold evaluation effect is set, and the pre-processing is performed again if the standards are not met.
It improves the extraction and recovery efficiency of text watermark images, enhances the visibility and clarity of watermarks, adapts to batch automatic processing, and solves the problem of low manual correction efficiency.
Smart Images

Figure CN119313537A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of watermark processing, and in particular relates to a preprocessing method and system for a text watermark image. Background Art
[0002] The data and information in electronic text documents are easy to store and transmit quickly, and they are easily leaked and difficult to trace because they are “once you have seen them”. In addition, the camera function has become a must-have feature of smartphones. With the development and popularization of smartphones, taking photos with mobile phones has become particularly simple, which has brought about the security issues of electronic text documents. Therefore, embedding watermark information that is not recognizable to the naked eye in text documents displayed on electronic screens or printed out is an important way to solve the above problems.
[0003] When a text document containing watermark information is photographed by a smart phone or digital camera, it is inevitable that the document will be tilted or the shooting angle will be deflected, which will usually cause various deformations in the generated document image, greatly affecting the recognition efficiency of the text watermark. Therefore, in order to improve the extraction, recognition or recovery efficiency of the text watermark image, it is necessary to correct the document image with geometric deformation. In the prior art, most of the methods are manually corrected for text watermark images, which has low operating efficiency and cannot adapt to batch automatic processing. Summary of the invention
[0004] The purpose of the embodiment of the present invention is to provide a method for preprocessing a text watermark image, aiming to solve the problem raised in the third part of the background technology.
[0005] The embodiment of the present invention is implemented as follows: a method for preprocessing a text watermark image, the method comprising: Obtaining a preprocessing target of a watermark, wherein the preprocessing target includes watermark extraction and watermark recovery, and obtaining a preprocessing method corresponding to the preprocessing target; Acquire text image information, the text image information includes watermarked images and non-watermarked images, perform non-blind detection based on the text image information, obtain detection results, and evaluate watermark strength based on the detection results, the watermark strength is used to evaluate whether the watermark is significant enough; Perform watermark preprocessing according to the preprocessing target, the preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening, obtain the preprocessing difference points corresponding to watermark extraction and watermark restoration, perform targeted preprocessing according to the difference points, and obtain the preprocessing results; Obtain a processing threshold value, which is the standard after preprocessing. Compare the processing threshold value with the preprocessing result to judge the preprocessing effect. If the processing effect does not meet the standard, perform preprocessing again.
[0006] Preferably, the step of acquiring text image information, wherein the text image information includes images with watermarks and images without watermarks, performing non-blind detection according to the text image information, acquiring detection results, and evaluating watermark strength according to the detection results, wherein the watermark strength is used to evaluate whether the watermark is sufficiently significant, specifically includes: Acquire watermark image information and non-watermark image information, and perform non-blind detection based on the watermark image information and non-watermark image information, wherein the non-blind detection is to use the original text to assist the detection of the watermark; Obtaining a detection result, wherein the detection result includes watermark existence, watermark type identification, and watermark location positioning, and evaluating the watermark strength according to the detection result, wherein the watermark strength is used to evaluate whether the watermark is sufficiently significant; Obtain the watermark strength result, and judge the feasibility of watermark content extraction or recovery based on the watermark strength result. If the watermark strength is stronger, the feasibility is higher.
[0007] Preferably, the watermark preprocessing is performed according to the preprocessing target, the preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening, obtaining the preprocessing difference points corresponding to watermark extraction and watermark restoration, performing targeted preprocessing according to the difference points, and obtaining the preprocessing result, specifically including: Perform denoising, image enhancement, grayscale and binarization, alignment and sharpening according to the preprocessing objectives; Obtaining the preprocessing difference points corresponding to watermark extraction and watermark restoration, wherein the difference points are enhancing the visibility and clarity of the watermark during extraction, and retaining the details of the watermark and reconstructing the watermark text during restoration; Perform targeted preprocessing according to the difference points and obtain the preprocessing results.
[0008] Preferably, the step of obtaining a processing threshold, which is a standard after preprocessing, comparing the processing threshold with the preprocessing result, judging the preprocessing effect, and performing preprocessing again if the processing effect does not meet the standard, specifically includes: Obtaining a processing threshold, where the processing threshold is a standard that meets the criteria after preprocessing, and comparing the processing threshold with the preprocessing result; If the processing threshold is less than the preprocessing result, the text watermark preprocessing is judged to be qualified; If the processing threshold is greater than the preprocessing result, the text watermark preprocessing is judged to be unqualified and re-preprocessing is performed.
[0009] Preferably, the alignment process of watermark recovery adopts angle detection, and the alignment process of watermark extraction adopts precise angle correction.
[0010] Another object of an embodiment of the present invention is to provide a text watermark image preprocessing system, the system comprising: A processing target module obtains a preprocessing target of a watermark, wherein the preprocessing target includes watermark extraction and watermark recovery, and obtains a preprocessing method corresponding to the preprocessing target; A non-blind detection module obtains text image information, the text image information includes watermarked images and non-watermarked images, performs non-blind detection based on the text image information, obtains detection results, and evaluates watermark strength based on the detection results. The watermark strength is used to evaluate whether the watermark is significant enough; The difference point module performs watermark preprocessing according to the preprocessing target. The preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening. The preprocessing difference points corresponding to watermark extraction and watermark restoration are obtained. Targeted preprocessing is performed according to the difference points to obtain the preprocessing results. The judging module obtains a processing threshold value, which is a standard after preprocessing, compares the processing threshold value with the preprocessing result, and judges the preprocessing effect. If the processing effect does not meet the standard, preprocessing is performed again.
[0011] Preferably, the non-blind detection module includes: A non-blind detection unit, which obtains watermark image information and non-watermark image information, and performs non-blind detection based on the watermark image information and non-watermark image information, wherein the non-blind detection uses the original text to assist in the detection of the watermark; A watermark strength unit, which obtains a detection result, including watermark existence, watermark type identification and watermark position location, and evaluates the watermark strength according to the detection result, and the watermark strength is used to evaluate whether the watermark is significant enough; The feasibility unit obtains the watermark strength result and determines the feasibility of watermark content extraction or recovery according to the watermark strength result. If the watermark strength is strong, the feasibility is high.
[0012] Preferably, the difference point module includes: A preprocessing unit performs denoising, image enhancement, grayscale and binarization, alignment and sharpening according to the preprocessing target; A difference point unit, which obtains the preprocessing difference points corresponding to watermark extraction and watermark restoration, wherein the difference points are to enhance the visibility and clarity of the watermark during extraction, and to retain the details of the watermark and reconstruct the watermark text during restoration; The preprocessing result unit performs targeted preprocessing according to the difference points to obtain the preprocessing results.
[0013] Preferably, the evaluation module includes: A threshold unit, which obtains a processing threshold, wherein the processing threshold is a standard that meets the criteria after preprocessing, and compares the processing threshold with the preprocessing result; Qualified unit, if the processing threshold is less than the preprocessing result, the text watermark preprocessing is judged to be qualified; For unqualified units, if the processing threshold is greater than the preprocessing result, the text watermark preprocessing is judged to be unqualified and re-preprocessing is performed.
[0014] Preferably, the alignment process of watermark recovery adopts angle detection, and the alignment process of watermark extraction adopts precise angle correction.
[0015] The embodiment of the present invention provides a method for preprocessing a text watermark image, which comprises the following steps: obtaining a preprocessing target for the watermark, obtaining a corresponding preprocessing method according to the preprocessing target, obtaining watermark image information and non-watermark image information, performing non-blind detection according to the watermark image information and non-watermark image information, obtaining a detection result, wherein the detection result includes watermark existence, watermark type identification and watermark position positioning, evaluating the watermark strength according to the detection result, the watermark strength is used to evaluate whether the watermark is significant enough, obtaining a watermark strength result, judging the feasibility of watermark content extraction or recovery according to the watermark strength result, and if the watermark strength is strong, the feasibility is high, and the watermark content is extracted or recovered according to the preprocessing result. The processing target is preprocessed to obtain the corresponding preprocessing difference points of watermark extraction and watermark restoration. The difference points are to enhance the visibility and clarity of the watermark during extraction, retain the details of the watermark and reconstruct the watermark text during restoration, and perform targeted preprocessing according to the difference points to obtain the preprocessing results and the processing threshold. The processing threshold is the standard after preprocessing. The processing threshold is compared with the preprocessing result. If the processing threshold is greater than the preprocessing result, it is judged that the text watermark preprocessing is unqualified and re-preprocessing is performed. This solves the problem that most of the text watermark images are corrected manually, the operation efficiency of such methods is low, and they cannot adapt to batch automatic processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flowchart of a method for preprocessing a text watermark image provided by an embodiment of the present invention; Figure 2 A flowchart of the steps of obtaining text image information, performing non-blind detection based on the text image information, and evaluating the watermark strength based on the detection result provided by an embodiment of the present invention; Figure 3 A flowchart of the steps of performing watermark preprocessing according to a preprocessing target and performing targeted preprocessing according to a difference point provided in an embodiment of the present invention; Figure 4 A flowchart of the steps of obtaining a processing threshold, comparing the processing threshold with a preprocessing result, and judging the preprocessing effect provided in an embodiment of the present invention; Figure 5 An architectural diagram of a text watermark image preprocessing system provided by an embodiment of the present invention; Figure 6 An architectural diagram of a non-blind detection module provided by an embodiment of the present invention; Figure 7An architectural diagram of a difference point module provided in an embodiment of the present invention; Figure 8 This is an architecture diagram of the evaluation module provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0018] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.
[0019] like Figure 1 As shown, a text watermark image preprocessing method provided by an embodiment of the present invention comprises: S100, obtaining a preprocessing target of a watermark, wherein the preprocessing target includes watermark extraction and watermark recovery, and obtaining a preprocessing method corresponding to the preprocessing target.
[0020] In this step, the preprocessing target of the watermark is obtained, including watermark extraction and watermark recovery. Watermark extraction is to extract the hidden information from the image embedded with the watermark. During the extraction process, the preprocessing goal is to improve the visibility of the watermark information so that it can be distinguished from background noise and other image content; watermark recovery refers to restoring the watermark information embedded in the image, especially when the watermark is compressed, cropped or otherwise processed, the recovery process should restore the original watermark content from the image as much as possible; Obtain the preprocessing method corresponding to the preprocessing target. Watermark extraction and watermark recovery preprocessing include noise processing, image enhancement, grayscale and binarization processing, alignment processing and sharpening processing. Through the above preprocessing methods, it can effectively provide support for watermark extraction or recovery, and improve the accuracy and effect of the extraction and recovery process. Selecting the appropriate preprocessing method according to the actual situation of the text watermark can maximize the retention of watermark information and reduce the impact of interference and noise.
[0021] S200, obtaining text image information, wherein the text image information includes images with watermarks and images without watermarks, performing non-blind detection based on the text image information, obtaining detection results, and evaluating watermark strength based on the detection results, wherein the watermark strength is used to evaluate whether the watermark is significant enough.
[0022] In this step, we obtain text image information, which includes watermarked images and non-watermarked images. Watermarked images are images with embedded text watermarks. They are the target images for watermark detection and recovery. Non-watermarked images are the same as watermarked images, but without embedded watermarks. They are used as reference images for comparison with watermarked images to help determine whether a watermark exists. By obtaining these two types of images, we can perform subsequent watermark detection and strength evaluation. Non-blind detection is performed based on text image information. Non-blind detection refers to detecting the presence, location and strength of a watermark by comparing the original image (image without watermark) with the watermarked image (image with watermark), obtaining the detection result, and evaluating the watermark strength based on the detection result. The evaluation of the watermark strength is used to determine whether the watermark is significant enough, that is, whether the watermark leaves an obvious trace in the image. The strength of a watermark usually depends on how and to what extent it is embedded. Stronger watermarks are usually easier to detect and extract, while weaker watermarks may be more difficult to detect or even be masked by compression or noise.
[0023] S300, performing watermark preprocessing according to the preprocessing target, wherein the preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening, obtaining preprocessing difference points corresponding to watermark extraction and watermark restoration, performing targeted preprocessing according to the difference points, and obtaining preprocessing results.
[0024] In this step, watermark preprocessing is performed according to the preprocessing goal. The main goal of preprocessing is to improve the image quality and ensure that the watermark signal is as prominent as possible. Preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening. Although watermark extraction and watermark recovery both require preprocessing, the preprocessing methods are different due to the different goals of the two processes, which is the difference. Targeted preprocessing is performed based on the difference points. For example, during image enhancement, watermark extraction requires the use of histogram equalization to enhance the contrast of the image to ensure that the watermark area is distinguished from the background. Watermark recovery uses CLAHE to enhance the contrast of local areas of the image, especially the parts where the watermark is embedded deeper, to obtain the preprocessing results.
[0025] S400, obtaining a processing threshold, which is a standard after preprocessing, comparing the processing threshold with the preprocessing result, and judging the preprocessing effect. If the processing effect does not meet the standard, re-preprocessing is performed.
[0026] In this step, the processing threshold is obtained. In the process of watermark extraction or restoration, the processing threshold is used to evaluate the effect of preprocessing to ensure that the visibility, clarity and detail restoration of the watermark meet the expected standards. According to the preprocessing goals (such as denoising, image enhancement, sharpening, etc.), we need to set a suitable processing threshold and evaluate the processing effect by comparing the preprocessing results with the processing threshold. If the processing effect is not up to standard, it is necessary to adjust the preprocessing strategy and perform preprocessing again until the desired effect is achieved.
[0027] like Figure 2 As shown, as a preferred embodiment of the present invention, the steps of acquiring text image information, the text image information including watermarked images and non-watermarked images, performing non-blind detection according to the text image information, acquiring detection results, and evaluating watermark strength according to the detection results, wherein the watermark strength is used to evaluate whether the watermark is significant enough, specifically include: S201, obtaining watermark image information and non-watermark image information, and performing non-blind detection based on the watermark image information and non-watermark image information, wherein the non-blind detection uses the original text to assist in watermark detection.
[0028] In this step, watermark image information and non-watermark image information are obtained, and text image information is obtained. Text image information includes watermarked images and non-watermarked images. Watermarked images are images with embedded text watermarks. They are the target images for watermark detection and recovery. Non-watermarked images are the same as watermarked images, but without embedded watermarks. They are used as reference images for comparison with watermarked images to help determine whether a watermark exists. By obtaining these two types of images, we can perform subsequent watermark detection and strength evaluation. By comparing the watermarked image and the non-watermarked image, the differences between the two are analyzed. These differences may come from the watermark embedding process. By performing Fourier transform on the two images, their differences in the frequency domain are analyzed. Watermarks are usually embedded in the low-frequency or high-frequency areas of the image. Combined with the original text information, it assists in detection and improves the accuracy of watermark detection.
[0029] S202, obtaining a detection result, wherein the detection result includes watermark existence, watermark type identification and watermark position location, and evaluating the watermark strength according to the detection result, wherein the watermark strength is used to evaluate whether the watermark is significant enough.
[0030] In this step, the detection results are obtained, including watermark existence, watermark type identification and watermark position positioning. Watermark existence is used to determine whether there is a watermark in the image, watermark type is used to identify the type of watermark, and watermark position positioning is used to determine the position or area where the watermark is embedded; The existence of watermark is identified by comparing the difference between the watermarked image and the image without watermark. Watermark type identification is to determine the specific form of the watermark. Different types of watermarks have different embedding methods and detection methods, including text watermarks, image watermarks and digital watermarks. Text watermarks can be identified by template matching technology. Watermark location positioning is to determine the specific embedding area of the watermark in the image. By comparing the difference between the watermarked image and the image without watermark, the watermark area can be identified. The watermark strength is evaluated based on the detection results. The watermark strength determines the prominence of the watermark in the image, that is, whether the watermark can be clearly seen in the image or whether it is covered by the noise of the image. By comparing the changes in the frequency domain, the impact of the watermark in the frequency domain is evaluated. A significant watermark usually produces obvious fluctuations in the frequency domain, especially in the low-frequency area. The signal of an insignificant watermark may not be obvious or even covered by noise.
[0031] S203, obtaining a watermark strength result, and judging the feasibility of watermark content extraction or recovery according to the watermark strength result. If the watermark strength is stronger, the feasibility is higher.
[0032] In this step, the watermark strength result is obtained. A stronger watermark strength means that the watermark signal is more prominent in the image and has less impact on the image quality, so it is easier to recover or extract the watermark. A weaker watermark strength means that the watermark signal may be masked by noise or compression, and the feasibility of recovering or extracting the watermark is lower. When the watermark strength is strong, it means that the watermark occupies a prominent position in the image, has less interference with the image, and the visibility of the watermark signal is high. Therefore, the feasibility of extracting or recovering the watermark is high; when the watermark strength is weak, the watermark signal is more hidden in the image and may be interfered by noise, compression or other processing, so the feasibility of watermark extraction or recovery is low, and preprocessing is required for lower watermarks.
[0033] like Figure 3 As shown, as a preferred embodiment of the present invention, the watermark preprocessing is performed according to the preprocessing target, and the preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening. The preprocessing difference points corresponding to watermark extraction and watermark restoration are obtained, and targeted preprocessing is performed according to the difference points to obtain the preprocessing result. The steps specifically include: S301, performing denoising, image enhancement, grayscale and binarization, alignment and sharpening according to the preprocessing target.
[0034] In this step, watermark preprocessing is performed according to the preprocessing target. The goal of denoising is to reduce the noise in the watermark image. The image is smoothed by the Gaussian kernel to reduce the high-frequency noise in the image. The kernel function of the Gaussian filter is: , Where σ is the standard deviation of the Gaussian kernel, which controls the smoothness of the filter; The purpose of image enhancement is to highlight the watermark and thus improve its visibility, for example, by changing the brightness of the image to make the watermark area more prominent; Converting color images to grayscale or binary images helps to simplify image processing, especially for text watermarks, where binary processing helps to separate the watermark area. The purpose of alignment is to ensure the geometric match between the watermark image and the reference image, especially in the watermark recovery process, the image may be deviated due to transformations such as rotation and scaling. Through alignment, the accuracy of the watermark position can be ensured; The goal of sharpening is to enhance the details of the image, especially the watermark area, making the watermark clearer. Sharpening emphasizes the edges and textures of the image to make the watermark stand out.
[0035] S302, obtaining preprocessing difference points corresponding to watermark extraction and watermark restoration, wherein the difference points are enhancing the visibility and clarity of the watermark during extraction, and retaining the details of the watermark and reconstructing the watermark text during restoration.
[0036] In this step, the preprocessing difference points corresponding to watermark extraction and watermark recovery are obtained. Although both watermark extraction and watermark recovery require preprocessing, the preprocessing methods are different due to the different goals of the two processes, which are the differences. As shown in Table 1: Table 1 Comparison of differences
[0037] S303, performing targeted preprocessing according to the difference points to obtain a preprocessing result.
[0038] In this step, targeted preprocessing is performed based on the difference points. The goal of watermark extraction is to make the watermark as visible and clear as possible in the image so as to extract the watermark content. To achieve this goal, the focus of preprocessing is to enhance the visibility and clarity of the watermark and remove interference signals. The main preprocessing steps include denoising, image enhancement, sharpening and binarization; The goal of watermark restoration is to restore the original details and text content of the watermark as much as possible, and to ensure that the restored watermark is as consistent as possible with the original watermark. During the restoration process, the focus of preprocessing is to retain the detailed information of the watermark, ensure the accuracy of the watermark position, and reduce image distortion. The main preprocessing steps include denoising, image enhancement, alignment processing, and sharpening; Obtain preprocessing results, such as the watermark text is clearer and has a higher contrast, which is convenient for subsequent extraction, or the preprocessed image has an obvious watermark recovery effect, the watermark text becomes clearer and the position is accurate, and most of the details are restored.
[0039] like Figure 4 As shown, as a preferred embodiment of the present invention, the processing threshold is obtained, and the processing threshold is the standard after preprocessing. The processing threshold is compared with the preprocessing result to judge the preprocessing effect. If the processing effect does not meet the standard, the step of re-preprocessing is specifically included: S401, obtaining a processing threshold, where the processing threshold is a standard that meets the criteria after preprocessing, and comparing the processing threshold with the preprocessing result.
[0040] In this step, the processing threshold is obtained. The processing threshold is a standard set based on the specific requirements of the image and the task objectives. These standards can be based on specific indicators of image quality, such as clarity, contrast, and noise, or indicators closely related to the watermarking task, such as watermark visibility and text readability; Image contrast determines the difference between the watermark and the background, and directly affects the visibility of the watermark. Improving the contrast makes the watermark easier to detect and extract. For example, the grayscale contrast of the image is set to 10, the image clarity threshold is set to 1000, the image noise threshold is set to 20, the watermark significance threshold is set to 0.7, and the watermark readability threshold is set to 90%; Compare the processing threshold with the preprocessing result, calculate the contrast of the watermark area by the grayscale standard deviation, and compare it with the contrast standard deviation of 10; calculate the sharpness of the image by the Laplace variance, and get the sharpness value and compare it with the set clarity threshold of 1000; calculate the noise by the local standard deviation, and compare it with the set image noise threshold of 20; measure the watermark significance by calculating the local information entropy, and compare it with the watermark significance threshold of 0.7; use OCR technology to recognize text in the watermark area, get the recognition rate, and compare it with the watermark readability threshold of 90%.
[0041] S402: If the processing threshold is less than the preprocessing result, it is determined that the text watermark preprocessing is qualified.
[0042] In this step, if the processing threshold is less than the preprocessing result, and if the preprocessing result meets or exceeds the set processing threshold, it means that the image quality has been sufficiently improved, and the watermark extraction or recovery task can continue, then the text watermark preprocessing is judged to be qualified.
[0043] S403: If the processing threshold is greater than the preprocessing result, it is determined that the text watermark preprocessing is unqualified and re-preprocessing is performed.
[0044] In this step, if the processing threshold is greater than the preprocessing result, if the preprocessing result of any item does not reach the set threshold, for example, the contrast standard deviation is 8, which is lower than 10, then the item needs to be reprocessed and the parameters or methods need to be adjusted until the image meets the processing threshold.
[0045] like Figure 5 As shown, a text watermark image preprocessing system provided by an embodiment of the present invention includes: The processing target module 100 is used to obtain a preprocessing target of a watermark, wherein the preprocessing target includes watermark extraction and watermark recovery, and obtain a preprocessing method corresponding to the preprocessing target.
[0046] In this system, the processing target module 100 obtains the pre-processing target of the watermark, including watermark extraction and watermark recovery. Watermark extraction is to extract the hidden information from the image embedded with the watermark. During the extraction process, the pre-processing target is to improve the visibility of the watermark information so that it can be distinguished from the background noise and other image contents. Watermark recovery refers to restoring the watermark information embedded in the image, especially when the watermark is compressed, cropped or otherwise processed, the recovery process should restore the original watermark content from the image as much as possible. Obtain the preprocessing method corresponding to the preprocessing target. Watermark extraction and watermark recovery preprocessing include noise processing, image enhancement, grayscale and binarization processing, alignment processing and sharpening processing. Through the above preprocessing methods, it can effectively provide support for watermark extraction or recovery, and improve the accuracy and effect of the extraction and recovery process. Selecting the appropriate preprocessing method according to the actual situation of the text watermark can maximize the retention of watermark information and reduce the impact of interference and noise.
[0047] The non-blind detection module 200 is used to obtain text image information, which includes watermarked images and non-watermarked images, perform non-blind detection based on the text image information, obtain detection results, and evaluate watermark strength based on the detection results. The watermark strength is used to evaluate whether the watermark is significant enough.
[0048] In this system, the non-blind detection module 200 obtains text image information, which includes watermarked images and non-watermarked images. The watermarked image is an image with a text watermark embedded in it. It is the target image for watermark detection and recovery. The non-watermarked image is the same as the watermarked image, but without the embedded watermark. It is used as a reference image to compare with the watermarked image to help determine whether the watermark exists. By obtaining these two types of images, we can perform subsequent watermark detection and strength evaluation. Non-blind detection is performed based on text image information. Non-blind detection refers to detecting the presence, location and strength of a watermark by comparing the original image (image without watermark) with the watermarked image (image with watermark), obtaining the detection result, and evaluating the watermark strength based on the detection result. The evaluation of the watermark strength is used to determine whether the watermark is significant enough, that is, whether the watermark leaves an obvious trace in the image. The strength of a watermark usually depends on how and to what extent it is embedded. Stronger watermarks are usually easier to detect and extract, while weaker watermarks may be more difficult to detect or even be masked by compression or noise.
[0049] The difference point module 300 is used to perform watermark preprocessing according to the preprocessing target, and the preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening, obtain the preprocessing difference points corresponding to watermark extraction and watermark restoration, perform targeted preprocessing according to the difference points, and obtain the preprocessing results.
[0050] In this system, the difference point module 300 performs watermark preprocessing according to the preprocessing target. The main goal of preprocessing is to improve the image quality and ensure that the watermark signal is as prominent as possible. Preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening. Although watermark extraction and watermark recovery both require preprocessing, the preprocessing methods will be different due to the different goals of the two processes, which is the difference point. Targeted preprocessing is performed based on the difference points. For example, during image enhancement, watermark extraction requires the use of histogram equalization to enhance the contrast of the image to ensure that the watermark area is distinguished from the background. Watermark recovery uses CLAHE to enhance the contrast of local areas of the image, especially the parts where the watermark is embedded deeper, to obtain the preprocessing results.
[0051] The evaluation module 400 is used to obtain a processing threshold value, which is a standard after preprocessing. The processing threshold value is compared with the preprocessing result to evaluate the preprocessing effect. If the processing effect does not meet the standard, preprocessing is performed again.
[0052] In this system, the evaluation module 400 obtains the processing threshold. In the process of watermark extraction or restoration, the processing threshold is used to evaluate the effect of preprocessing to ensure that the visibility, clarity and detail restoration of the watermark meet the expected standards. According to the preprocessing goals (such as denoising, image enhancement, sharpening, etc.), we need to set a suitable processing threshold and evaluate the processing effect by comparing the preprocessing results with the processing threshold. If the processing effect does not meet the standard, it is necessary to adjust the preprocessing strategy and perform preprocessing again until the desired effect is achieved.
[0053] like Figure 6 As shown, as a preferred embodiment of the present invention, the non-blind detection module 200 includes: The non-blind detection unit 201 is used to obtain watermark image information and non-watermark image information, and perform non-blind detection based on the watermark image information and non-watermark image information. The non-blind detection uses the original text to assist in the detection of the watermark.
[0054] In this module, the non-blind detection unit 201 obtains watermark image information and non-watermark image information, and obtains text image information. The text image information includes watermarked images and non-watermarked images. The watermarked image is an image with a text watermark embedded in it. It is the target image for watermark detection and recovery. The non-watermarked image is the same as the watermarked image, but it is not embedded with a watermark. It is used as a reference image to compare with the watermarked image to help determine whether a watermark exists. By obtaining these two types of images, we can perform subsequent watermark detection and strength evaluation; By comparing the watermarked image and the non-watermarked image, the differences between the two are analyzed. These differences may come from the watermark embedding process. By performing Fourier transform on the two images, their differences in the frequency domain are analyzed. Watermarks are usually embedded in the low-frequency or high-frequency areas of the image. Combined with the original text information, it assists in detection and improves the accuracy of watermark detection.
[0055] The watermark strength unit 202 is used to obtain a detection result, which includes watermark existence, watermark type identification and watermark position positioning, and evaluate the watermark strength based on the detection result. The watermark strength is used to evaluate whether the watermark is significant enough.
[0056] In this module, the watermark strength unit 202 obtains the detection result, which includes watermark existence, watermark type identification and watermark position positioning. The watermark existence is used to determine whether there is a watermark in the image, the watermark type is used to identify the type of the watermark, and the watermark position positioning is used to determine the position or area where the watermark is embedded; The existence of watermark is identified by comparing the difference between the watermarked image and the image without watermark. Watermark type identification is to determine the specific form of the watermark. Different types of watermarks have different embedding methods and detection methods, including text watermarks, image watermarks and digital watermarks. Text watermarks can be identified by template matching technology. Watermark location positioning is to determine the specific embedding area of the watermark in the image. By comparing the difference between the watermarked image and the image without watermark, the watermark area can be identified. The watermark strength is evaluated based on the detection results. The watermark strength determines the prominence of the watermark in the image, that is, whether the watermark can be clearly seen in the image or whether it is covered by the noise of the image. By comparing the changes in the frequency domain, the impact of the watermark in the frequency domain is evaluated. A significant watermark usually produces obvious fluctuations in the frequency domain, especially in the low-frequency area. The signal of an insignificant watermark may not be obvious or even covered by noise.
[0057] The feasibility unit 203 is used to obtain the watermark strength result and judge the feasibility of watermark content extraction or recovery according to the watermark strength result. If the watermark strength is stronger, the feasibility is higher.
[0058] In this module, the feasibility unit 203 obtains the watermark strength result. A stronger watermark strength means that the watermark signal is more prominent in the image and has less impact on the image quality, so the difficulty of recovering or extracting the watermark is lower. A weaker watermark strength means that the watermark signal may be masked by noise or compression, and the feasibility of recovering or extracting the watermark is lower. When the watermark strength is strong, it means that the watermark occupies a prominent position in the image, has less interference with the image, and the visibility of the watermark signal is high. Therefore, the feasibility of extracting or recovering the watermark is high; when the watermark strength is weak, the watermark signal is more hidden in the image and may be interfered by noise, compression or other processing, so the feasibility of watermark extraction or recovery is low, and preprocessing is required for lower watermarks.
[0059] like Figure 7 As shown, as a preferred embodiment of the present invention, the difference point module 300 includes: The preprocessing unit 301 is used to perform denoising, image enhancement, grayscale and binarization, alignment and sharpening according to the preprocessing target.
[0060] In this module, the preprocessing unit 301 performs watermark preprocessing according to the preprocessing target. The goal of denoising is to reduce the noise in the watermark image. The image is smoothed by the Gaussian kernel to reduce the high-frequency noise in the image. The kernel function of the Gaussian filter is: , Where σ is the standard deviation of the Gaussian kernel, which controls the smoothness of the filter; The purpose of image enhancement is to highlight the watermark and thus improve its visibility, for example, by changing the brightness of the image to make the watermark area more prominent; Converting color images to grayscale or binary images helps to simplify image processing, especially for text watermarks, where binary processing helps to separate the watermark area. The purpose of alignment is to ensure the geometric match between the watermark image and the reference image, especially in the watermark recovery process, the image may be deviated due to transformations such as rotation and scaling. Through alignment, the accuracy of the watermark position can be ensured; The goal of sharpening is to enhance the details of the image, especially the watermark area, making the watermark clearer. Sharpening emphasizes the edges and textures of the image to make the watermark stand out.
[0061] The difference point unit 302 is used to obtain the preprocessing difference points corresponding to watermark extraction and watermark restoration. The difference points are to enhance the visibility and clarity of the watermark during extraction and to retain the details of the watermark and reconstruct the watermark text during restoration.
[0062] In this module, the difference point unit 302 obtains the preprocessing difference points corresponding to watermark extraction and watermark restoration. Although both watermark extraction and watermark restoration require preprocessing, the preprocessing methods will be different due to the different goals of the two processes, which are the difference points.
[0063] The preprocessing result unit 303 is used to perform targeted preprocessing according to the difference points to obtain preprocessing results.
[0064] In this module, the preprocessing result unit 303 performs targeted preprocessing based on the difference points. The goal of watermark extraction is to make the watermark as visible and clear as possible in the image so as to extract the watermark content. To achieve this goal, the focus of preprocessing is to enhance the visibility and clarity of the watermark and remove interference signals. The main preprocessing steps include denoising, image enhancement, sharpening and binarization; The goal of watermark restoration is to restore the original details and text content of the watermark as much as possible, and to ensure that the restored watermark is as consistent as possible with the original watermark. During the restoration process, the focus of preprocessing is to retain the detailed information of the watermark, ensure the accuracy of the watermark position, and reduce image distortion. The main preprocessing steps include denoising, image enhancement, alignment processing, and sharpening; Obtain preprocessing results, such as the watermark text is clearer and has a higher contrast, which is convenient for subsequent extraction, or the preprocessed image has an obvious watermark recovery effect, the watermark text becomes clearer and the position is accurate, and most of the details are restored.
[0065] like Figure 8 As shown, as a preferred embodiment of the present invention, the evaluation module 400 includes: The threshold unit 401 is used to obtain a processing threshold, which is a standard after preprocessing, and compare the processing threshold with the preprocessing result.
[0066] In this module, the threshold unit 401 obtains the processing threshold, which is a standard set based on the specific requirements of the image and the task objectives. These standards can be based on specific indicators of image quality, such as clarity, contrast and noise, or indicators closely related to the watermark task, such as watermark visibility and text readability; Image contrast determines the difference between the watermark and the background, and directly affects the visibility of the watermark. Improving the contrast makes the watermark easier to detect and extract. For example, the grayscale contrast of the image is set to 10, the image clarity threshold is set to 1000, the image noise threshold is set to 20, the watermark significance threshold is set to 0.7, and the watermark readability threshold is set to 90%; Compare the processing threshold with the preprocessing result, calculate the contrast of the watermark area by the grayscale standard deviation, and compare it with the contrast standard deviation of 10; calculate the sharpness of the image by the Laplace variance, and get the sharpness value and compare it with the set clarity threshold of 1000; calculate the noise by the local standard deviation, and compare it with the set image noise threshold of 20; measure the watermark significance by calculating the local information entropy, and compare it with the watermark significance threshold of 0.7; use OCR technology to recognize text in the watermark area, get the recognition rate, and compare it with the watermark readability threshold of 90%.
[0067] The qualified unit 402 is used to determine that the text watermark preprocessing is qualified if the processing threshold is less than the preprocessing result.
[0068] In this module, if the processing threshold of the qualified unit 402 is less than the preprocessing result, and if the preprocessing result meets or exceeds the set processing threshold, it means that the quality of the image has been sufficiently improved and the watermark extraction or recovery task can continue, then the text watermark preprocessing is judged to be qualified.
[0069] The unqualified unit 403 is used to judge that the text watermark preprocessing is unqualified if the processing threshold is greater than the preprocessing result, and perform preprocessing again.
[0070] In this module, if the processing threshold of the unqualified unit 403 is greater than the preprocessing result, if the preprocessing result of any item does not reach the set threshold, for example, the contrast standard deviation is 8, which is lower than 10, then the item needs to be reprocessed and the parameters or methods need to be adjusted until the image meets the processing threshold.
[0071] In one embodiment, a computer device is provided, the computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented: Obtaining a preprocessing target of a watermark, wherein the preprocessing target includes watermark extraction and watermark recovery, and obtaining a preprocessing method corresponding to the preprocessing target; Acquire text image information, the text image information includes watermarked images and non-watermarked images, perform non-blind detection based on the text image information, obtain detection results, and evaluate watermark strength based on the detection results, the watermark strength is used to evaluate whether the watermark is significant enough; Perform watermark preprocessing according to the preprocessing target, the preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening, obtain the preprocessing difference points corresponding to watermark extraction and watermark restoration, perform targeted preprocessing according to the difference points, and obtain the preprocessing results; Obtain a processing threshold value, which is the standard after preprocessing. Compare the processing threshold value with the preprocessing result to judge the preprocessing effect. If the processing effect does not meet the standard, perform preprocessing again.
[0072] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor performs the following steps: Obtaining a preprocessing target of a watermark, wherein the preprocessing target includes watermark extraction and watermark recovery, and obtaining a preprocessing method corresponding to the preprocessing target; Acquire text image information, the text image information includes watermarked images and non-watermarked images, perform non-blind detection based on the text image information, obtain detection results, and evaluate watermark strength based on the detection results, the watermark strength is used to evaluate whether the watermark is significant enough; Perform watermark preprocessing according to the preprocessing target, the preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening, obtain the preprocessing difference points corresponding to watermark extraction and watermark restoration, perform targeted preprocessing according to the difference points, and obtain the preprocessing results; Obtain a processing threshold value, which is the standard after preprocessing. Compare the processing threshold value with the preprocessing result to judge the preprocessing effect. If the processing effect does not meet the standard, perform preprocessing again.
[0073] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0074] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0075] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0076] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
[0077] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for preprocessing a text watermark image, characterized in that: The method comprises: Obtaining a preprocessing target of a watermark, wherein the preprocessing target includes watermark extraction and watermark recovery, and obtaining a preprocessing method corresponding to the preprocessing target; Acquire text image information, the text image information includes watermarked images and non-watermarked images, perform non-blind detection based on the text image information, obtain detection results, and evaluate watermark strength based on the detection results, the watermark strength is used to evaluate whether the watermark is significant enough; Perform watermark preprocessing according to the preprocessing target, the preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening, obtain the preprocessing difference points corresponding to watermark extraction and watermark restoration, perform targeted preprocessing according to the difference points, and obtain the preprocessing results; Obtain a processing threshold value, which is the standard after preprocessing. Compare the processing threshold value with the preprocessing result to judge the preprocessing effect. If the processing effect does not meet the standard, perform preprocessing again.
2. A text watermark image preprocessing method according to claim 1, characterized in that: The step of obtaining text image information, wherein the text image information includes images with watermarks and images without watermarks, performing non-blind detection according to the text image information, obtaining detection results, and evaluating watermark strength according to the detection results, wherein the watermark strength is used to evaluate whether the watermark is significant enough, specifically includes: Acquire watermark image information and non-watermark image information, and perform non-blind detection based on the watermark image information and non-watermark image information, wherein the non-blind detection is to use the original text to assist the detection of the watermark; Obtaining a detection result, wherein the detection result includes watermark existence, watermark type identification, and watermark location positioning, and evaluating the watermark strength according to the detection result, wherein the watermark strength is used to evaluate whether the watermark is sufficiently significant; Obtain the watermark strength result, and judge the feasibility of watermark content extraction or recovery based on the watermark strength result. If the watermark strength is stronger, the feasibility is higher.
3. A text watermark image preprocessing method according to claim 1, characterized in that: The watermark preprocessing is performed according to the preprocessing target, and the preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening, obtaining the preprocessing difference points corresponding to watermark extraction and watermark restoration, performing targeted preprocessing according to the difference points, and obtaining the preprocessing result, specifically including: Perform denoising, image enhancement, grayscale and binarization, alignment and sharpening according to the preprocessing objectives; Obtaining the preprocessing difference points corresponding to watermark extraction and watermark restoration, wherein the difference points are enhancing the visibility and clarity of the watermark during extraction, and retaining the details of the watermark and reconstructing the watermark text during restoration; Perform targeted preprocessing according to the difference points and obtain the preprocessing results.
4. A text watermark image preprocessing method according to claim 1, characterized in that: The step of obtaining a processing threshold, which is a standard after preprocessing, comparing the processing threshold with the preprocessing result, and judging the preprocessing effect, and performing preprocessing again if the processing effect does not meet the standard, specifically includes: Obtaining a processing threshold, where the processing threshold is a standard that meets the criteria after preprocessing, and comparing the processing threshold with the preprocessing result; If the processing threshold is less than the preprocessing result, the text watermark preprocessing is judged to be qualified; If the processing threshold is greater than the preprocessing result, the text watermark preprocessing is judged to be unqualified and re-preprocessing is performed.
5. The method for preprocessing a text watermark image according to claim 1, characterized in that: The alignment process of watermark recovery adopts angle detection, and the alignment process of watermark extraction adopts precise angle correction.
6. A text watermark image preprocessing system, characterized in that: The system comprises: A processing target module obtains a preprocessing target of a watermark, wherein the preprocessing target includes watermark extraction and watermark recovery, and obtains a preprocessing method corresponding to the preprocessing target; A non-blind detection module obtains text image information, the text image information includes watermarked images and non-watermarked images, performs non-blind detection based on the text image information, obtains detection results, and evaluates watermark strength based on the detection results. The watermark strength is used to evaluate whether the watermark is significant enough; The difference point module performs watermark preprocessing according to the preprocessing target. The preprocessing includes denoising, image enhancement, grayscale and binarization, alignment and sharpening. The preprocessing difference points corresponding to watermark extraction and watermark restoration are obtained. Targeted preprocessing is performed according to the difference points to obtain the preprocessing results. The judging module obtains a processing threshold value, which is a standard after preprocessing, compares the processing threshold value with the preprocessing result, and judges the preprocessing effect. If the processing effect does not meet the standard, preprocessing is performed again.
7. A text watermark image preprocessing system according to claim 6, characterized in that: The non-blind detection module comprises: A non-blind detection unit, which obtains watermark image information and non-watermark image information, and performs non-blind detection based on the watermark image information and non-watermark image information, wherein the non-blind detection uses the original text to assist in the detection of the watermark; A watermark strength unit, which obtains a detection result, including watermark existence, watermark type identification and watermark position location, and evaluates the watermark strength according to the detection result, and the watermark strength is used to evaluate whether the watermark is significant enough; The feasibility unit obtains the watermark strength result and determines the feasibility of watermark content extraction or recovery according to the watermark strength result. If the watermark strength is strong, the feasibility is high.
8. A text watermark image preprocessing system according to claim 7, characterized in that: The difference point module includes: A preprocessing unit performs denoising, image enhancement, grayscale and binarization, alignment and sharpening according to the preprocessing target; A difference point unit, which obtains the preprocessing difference points corresponding to watermark extraction and watermark restoration, wherein the difference points are to enhance the visibility and clarity of the watermark during extraction, and to retain the details of the watermark and reconstruct the watermark text during restoration; The preprocessing result unit performs targeted preprocessing according to the difference points to obtain the preprocessing results.
9. A text watermark image preprocessing system according to claim 8, characterized in that: The evaluation module comprises: A threshold unit, which obtains a processing threshold, wherein the processing threshold is a standard that meets the criteria after preprocessing, and compares the processing threshold with the preprocessing result; Qualified unit, if the processing threshold is less than the preprocessing result, the text watermark preprocessing is judged to be qualified; For unqualified units, if the processing threshold is greater than the preprocessing result, the text watermark preprocessing is judged to be unqualified and re-preprocessing is performed.
10. A text watermark image preprocessing system according to claim 9, characterized in that: The alignment process of watermark recovery adopts angle detection, and the alignment process of watermark extraction adopts precise angle correction.
Citation Information
Patent Citations
Watermark embedding method and device, equipment and storage medium
CN117494082A
Anti-screen-shooting robust watermarking algorithm based on Harris-SIFT feature region
CN117764803A
Depth separable convolution multimedia watermark embedding and extracting method
CN118864218A
Cited By
Grain emergency guarantee system optimization method, system and device based on deep learning
CN120218739A