Methods, apparatus, electronic devices and media for removing infiltrated content from text images
By determining the channel reference pixel value and the removal threshold in the text image, the permeated content in the text image is removed, solving the interference problem caused by poor paper quality and improving the reliability of the automatic parsing results of the text image.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-24
- Publication Date
- 2026-03-31
AI Technical Summary
In existing technologies, text images are often affected by poor paper quality, causing content to seep through the back of the paper, which interferes with text image analysis, leading to recognition errors and unreliable analysis results.
By obtaining the channel pixel values of the pixels in the RGB color space of the text image to be processed, determining the channel reference pixel value, and clearing the threshold, the infiltrated content in the text image is removed, and the target text image is obtained.
It improves the reliability of automatic text image parsing results, reduces interference caused by background content penetration, and ensures the accuracy of parsing results.
Smart Images

Figure CN116740724B_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer vision technology, and more particularly to a method, apparatus, electronic device, and medium for removing infiltrated content from text images. Background Technology
[0002] In the field of computer vision, OCR technology mainly refers to the automated parsing and processing of text content in text images using image algorithms. This includes tasks such as text detection, character recognition, document layout analysis, table parsing, and formula parsing. These technologies have already been widely applied in various vertical industries, such as automated document grading, automated insurance claims processing, and automated bank auditing.
[0003] When processing text images, one common input style is poor paper quality, which often causes the text on the next page or the background of the current page to show through the scanned image. This interferes with the text content that the image algorithm is trying to analyze, leading to errors in text recognition and ultimately making the automated analysis results unreliable.
[0004] Therefore, it is essential to remove interfering content from the text background before automatically parsing the text image. Summary of the Invention
[0005] This application provides a method, apparatus, electronic device, and medium for removing infiltrated content from text images, which solves the problem in the prior art where infiltrated content from the back of a text image interferes with the analysis of the text image. This method removes infiltrated content from the back of the text image, thereby improving the reliability of the subsequent automatic analysis results of the text image.
[0006] On the one hand, this application provides a method for removing infiltrated content from text images, including:
[0007] Obtain the text image to be processed, and determine the channel pixel value corresponding to each pixel in the text image to be processed in each color channel of the RGB color space.
[0008] Based on the pixel values of each channel, determine the channel reference pixel value for clearing the text image to be processed;
[0009] The pixel to be processed in the text image is determined based on the channel reference pixel value, and pixel processing is performed on the pixel to be processed to obtain the processed target text image.
[0010] Optionally, determining the channel pixel value corresponding to each pixel in the text image to be processed in each color channel of the RGB color space includes:
[0011] For any pixel, the initial channel pixel value corresponding to the current pixel in each of the color channels is determined based on the pixel value of the current pixel.
[0012] Each initial channel pixel value is processed by interval mapping to obtain the channel pixel value corresponding to the current pixel point in each color channel of the RGB color space.
[0013] Optionally, the step of performing interval mapping processing on each of the initial channel pixel values to obtain the channel pixel value corresponding to the current pixel point in each color channel of the RGB color space includes:
[0014] For any color channel, obtain a preset interval parameter, divide the initial channel pixel value by the interval parameter and round down to obtain the intermediate mapping value of the current color channel;
[0015] Multiply the intermediate mapping value and the interval parameter to obtain the channel pixel value of the current color channel.
[0016] Optionally, determining the channel reference pixel value for clearing the text image based on the pixel values of each channel includes:
[0017] For any pixel, obtain the channel weights corresponding to each of the color channels respectively, and determine the weighted pixel value of the current pixel based on the channel pixel value and channel weight of each color channel;
[0018] Based on the weighted pixel values of each pixel in the text image to be processed, a channel reference pixel value is determined for clearing the text image to be processed.
[0019] Optionally, determining the channel reference pixel value for clearing the text image based on the weighted pixel values of each pixel in the text image to be processed includes:
[0020] The numerical frequency statistics of each weighted pixel value are performed, and the weighted pixel value with the highest numerical frequency is used as the reference weighted pixel value of the text image to be processed.
[0021] The reference weight pixel values are subjected to channel decomposition processing to obtain the channel reference pixel values in each of the color channels.
[0022] Optionally, the difference between the channel weights of each color channel is greater than a preset difference threshold.
[0023] Optionally, determining the pixel to be processed in the text image based on the channel reference pixel value includes:
[0024] Perform spatial transformation on the reference pixel values of each channel to obtain the HSV reference pixel values corresponding to the reference pixel values of each channel in the HSV color space;
[0025] For any pixel, determine the initial channel pixel value corresponding to each color channel in the RGB color space, and the initial HSV pixel value in the HSV color space.
[0026] The initial channel pixel values and the channel reference pixel values are compared in a first comparison process to obtain the corresponding first comparison results.
[0027] The initial HSV pixel value and the HSV reference pixel value are subjected to a second comparison process to obtain the corresponding second comparison result;
[0028] Based on the first comparison result and the second comparison result, it is determined whether the current pixel is the pixel to be processed.
[0029] On the other hand, this application provides a method and apparatus for removing infiltrated content from text images, comprising:
[0030] The channel pixel value determination module is used to acquire the text image to be processed and determine the channel pixel value corresponding to each pixel in the text image to be processed in each color channel of the RGB color space.
[0031] The channel reference pixel value determination module is used to determine the channel reference pixel value for clearing the text image to be processed based on the channel pixel values;
[0032] The target text image acquisition module is used to determine the pixels to be processed in the text image to be processed based on the channel reference pixel value, and to perform pixel processing on the pixels to be processed to obtain the processed target text image.
[0033] Optionally, the channel pixel value determination module includes:
[0034] The initial channel pixel value acquisition submodule is used to determine, for any pixel, the initial channel pixel value corresponding to each of the color channels based on the pixel value of the current pixel.
[0035] The channel pixel value determination submodule is used to perform interval mapping processing on each of the initial channel pixel values to obtain the channel pixel values corresponding to the current pixel point in each color channel of the RGB color space.
[0036] Optional, the channel pixel value determination submodule includes:
[0037] An acquisition unit should be set in the middle to acquire a preset interval parameter for any color channel, divide the initial channel pixel value by the interval parameter and round down to obtain the intermediate mapping value of the current color channel;
[0038] The channel pixel value determination unit is used to multiply the intermediate mapping value and the interval parameter to obtain the channel pixel value of the current color channel.
[0039] Optionally, the channel reference pixel value acquisition module includes:
[0040] The weighted pixel value acquisition submodule is used to obtain the channel weights corresponding to each of the color channels for any pixel, and determine the weighted pixel value of the current pixel based on the channel pixel value and channel weight of each color channel.
[0041] The channel reference pixel value acquisition submodule is used to determine the channel reference pixel value for clearing the text image to be processed based on the weighted pixel value of each pixel in the text image to be processed.
[0042] Optionally, the channel reference pixel value acquisition submodule includes:
[0043] The reference weighted pixel value determination unit is used to perform numerical frequency statistical processing on each of the weighted pixel values, and take the weighted pixel value with the highest numerical frequency as the reference weighted pixel value of the text image to be processed.
[0044] The channel reference pixel value acquisition unit is used to perform channel decomposition processing on the reference weight pixel value to obtain the channel reference pixel value in each of the color channels.
[0045] Optionally, the difference between the channel weights of each color channel is greater than a preset difference threshold.
[0046] Optionally, the target text image acquisition module includes:
[0047] The HSV reference pixel value acquisition submodule is used to perform spatial transformation on the reference pixel values of each channel to obtain the HSV reference pixel values corresponding to each channel reference pixel value in the HSV color space.
[0048] The initial HSV pixel value acquisition submodule is used to determine, for any pixel, the initial channel pixel value corresponding to each color channel in the RGB color space, and the initial HSV pixel value in the HSV color space.
[0049] The first comparison result acquisition module is used to perform a first comparison process on each of the initial channel pixel values and each of the channel reference pixel values to obtain the corresponding first comparison result.
[0050] The second comparison result acquisition module is used to perform a second comparison process on the initial HSV pixel value and the HSV reference pixel value to obtain the corresponding second comparison result.
[0051] The pixel to be processed determination submodule is used to determine whether the current pixel is the pixel to be processed based on the first comparison result and the second comparison result.
[0052] Thirdly, this application also provides a server, including: a memory and a processor;
[0053] Memory; memory for storing executable instructions of the processor;
[0054] The processor executes executable instructions stored in the memory to implement the method for removing infiltrated content from a text image as described in the first aspect.
[0055] Fourthly, this application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method for removing infiltrated content from a text image as described in the first aspect.
[0056] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the method for removing infiltrated content from text images as described in the first aspect of the present invention.
[0057] The removal method provided in this application determines the channel reference pixel value of the text image to be processed, i.e., the removal threshold, by using the channel pixel value of the pixel point. Then, it determines the pixel point to be processed in the text image based on the removal threshold, and then removes the pixel point to be processed to obtain the processed target text image. This solves the problem in the prior art where the back content of the text image to be parsed interferes with the parsing of the text image. It removes the back content of the text image, thereby improving the reliability of the subsequent automatic parsing results of the text image. Attached Figure Description
[0058] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0059] Figure 1 An application scenario diagram of the method for removing infiltrated content from text images provided in this application;
[0060] Figure 2a Example image of text to be processed containing back-side penetration content;
[0061] Figure 2b Example image of the target text image after removing infiltrated content;
[0062] Figure 3 A flowchart illustrating a method for removing infiltrated content from a text image, provided in an embodiment of this application;
[0063] Figure 4 A flowchart illustrating another method for removing infiltrated content from a text image, provided in an embodiment of this application;
[0064] Figure 5 This is a flowchart illustrating another method for removing infiltrated content from a Chinese image according to an exemplary embodiment of this application;
[0065] Figure 6 This is a schematic diagram of a device for removing infiltrated content from a text image according to an exemplary embodiment of this application;
[0066] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0067] Figure 8 A block diagram of an electronic device is shown according to an exemplary embodiment.
[0068] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0069] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0070] In practical applications, when using OCR technology to analyze and process paper text images, a common problem arises: due to poor paper quality, the scanned text image often shows text from the next page or the background of the current page. In this case, because of the interfering text hidden in the text image, the text analysis model will treat the hidden text as part of the text in the image for recognition. This introduces interference into the analysis of the text content, leading to text recognition errors and ultimately resulting in unreliable automated analysis results.
[0071] The method for removing intrusive content from text images provided in this application aims to solve the aforementioned technical problems of the prior art. Specifically, it determines the pixel values of pixels in the text image to be processed, decomposes the pixel values to obtain channel pixel values, and then determines the channel pixel reference values, i.e., the removal threshold, for the text image to be processed based on the channel pixel values. Based on the removal threshold, it determines the pixels to be processed in the text image and removes them, resulting in a target text image without interfering content. This allows for subsequent automated parsing based on the target text image, improving the reliability of the parsing results.
[0072] Figure 1 This is an application scenario diagram of the method for removing infiltrated content from text images provided in this application. Figure 2a This is an example image of a text image to be processed that contains back-side permeation content. Figure 2b Example image of the target text image after removing infiltrated content.
[0073] For easier understanding, the following will be combined with Figure 1 , Figure 2a and Figure 2b The application scenarios applicable to the embodiments of this application are described below. See also... Figure 1 In the process of scanning and automatically parsing paper text images using OCR technology, due to the poor quality of the paper, the resulting text image may contain infiltrated content. This infiltrated content could be text from the next page or text on the back of the current page. For example, see... Figure 2a , Figure 2aThe image contains back-penetrating content. In this case, to ensure the accuracy of the analysis results, it is necessary to remove the back-penetrating content from the text image to obtain the target text image. Specifically, when obtaining the text image to be processed, the RGB channel pixel values of each pixel in the text image can be determined. Since the text content and back-penetrating content are different in each image, i.e., the pixel values are different in each image, to improve the removal accuracy, it is necessary to determine the channel reference pixel values required for removing the back-penetrating content in the current text image based on the determined RGB channel pixel values. Then, based on the channel reference pixel values and the pixel values of each pixel, the pixels that need to be removed, i.e., the pixels to be processed, are determined, and the back-penetrating content removal is performed on the pixels to be processed to obtain the processed target text image. For example, see Figure 2b , Figure 2b The infiltrated content in the image has been completely removed. Therefore, the reliability of the analysis results can be improved when subsequent automated parsing processes are performed on the target text image.
[0074] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0075] Figure 3 This is a flowchart illustrating a method for removing infiltrated content from a text image, provided in an embodiment of this application. The method can be executed by a device for removing infiltrated content from a text image. This device can be a server or an electronic device; the following description uses an electronic device as an example. The method in this embodiment can be implemented through software, hardware, or a combination of both. Figure 3 As shown, the method includes the following steps.
[0076] S210. Obtain the text image to be processed, and determine the corresponding channel pixel value of each pixel in the text image to be processed in each color channel of the RGB color space.
[0077] In this application, the text image to be processed can be understood as a text image containing content that interferes with identification. Specifically, it could be a scanned image of paper containing content that has seeped through to the back. Of course, the text image to be processed can also be other text images that require background processing, such as photographic images containing watermarks indicating time, location, or other identifying information.
[0078] Specifically, the method for obtaining the text image to be processed can be to read it from the preset database of the current execution device based on the image acquisition path, or it can be obtained by directly uploading the image from a scanning device, a shooting device, or other devices. This application does not limit the method of obtaining the text image to be processed.
[0079] In practical applications, a pixel can be understood as a small point that makes up an image. Specifically, an image is divided into several small squares, and each small square can be called a pixel. A pixel value can be understood as the position and color value assigned to a small square, which can be formed by combining different shades of the three primary colors. In the RGB color space, the three primary colors are red, green, and blue. A color channel can be understood as a channel that stores the color information of an image. In the aforementioned color space, color channels specifically include three channels: R, G, and B.
[0080] In this embodiment, after obtaining the text image to be processed, image segmentation processing is performed on the text image to obtain each pixel of the text image to be processed. Further, based on the pixel value of each pixel, the channel pixel value corresponding to each color channel in the RGB color space is determined.
[0081] Specifically, pre-compiled code scripts can be used to perform channel decomposition on the pixel values of each pixel in the text image to obtain the channel pixel values of each pixel in the RGB color space. Alternatively, a pre-trained channel decomposition model can be used to determine the channel pixel values of each pixel. This application does not limit the method for obtaining the channel pixel values.
[0082] S220. Determine the channel reference pixel value for the text image to be cleaned based on the pixel values of each channel.
[0083] Since different text images contain different text content, the pixel values of each pixel in different text images are also different. Therefore, it is necessary to set the reference pixel values required for the text image to be processed when performing the clearing process based on the pixel values of each pixel in the text image to be processed.
[0084] Based on this, in the technical solution of this application, when determining the channel pixel value of each pixel in the text image to be processed, the corresponding channel reference pixel value of the text image to be processed is determined based on the channel pixel value, and the determined channel reference pixel value is used as the clearing threshold to clear each pixel in the text image to be processed, thereby obtaining the processed target text image.
[0085] S230. Determine the pixels to be processed in the text image based on the channel reference pixel value, and perform pixel processing on the pixels to be processed to obtain the processed target text image.
[0086] In this embodiment, the channel reference pixel value determined based on the above implementation method is used as the clearing threshold for clearing processing. Specifically, each pixel in the text image to be processed is compared with the clearing threshold condition, and pixels that do not meet the clearing threshold condition are designated as pixels to be processed. These designated pixels are then cleared to obtain the processed target text image. Specifically, the method for clearing pixels can be to reassign pixel values, such as assigning the channel reference pixel value as the pixel value of the pixel to be processed, or to randomly select the pixel values of pixels that meet the clearing threshold condition as the pixel values of the pixel to be processed; there is no limitation on this method.
[0087] In the above technical solution, the channel reference pixel value of the text image to be processed is determined by using the channel pixel value of the pixel point, i.e., the clearing threshold. Then, the pixel point to be processed in the text image is determined based on the clearing threshold, and then the pixel point to be processed is cleared to obtain the processed target text image. This solves the problem in the prior art that the back content penetration in the text image to be parsed causes interference to the parsing of the text image. It realizes the removal of back content penetration in the text image, thereby improving the reliability of the subsequent automatic parsing results of the text image.
[0088] Figure 4 This is a flowchart illustrating another method for removing infiltrated content from a text image, provided as an embodiment of this application. This embodiment can be understood as a detailed description of the steps mentioned in the methods described above; see also... Figure 4 The method may specifically include:
[0089] S310. Obtain the text image to be processed, and determine the corresponding channel pixel value of each pixel in the text image to be processed in each color channel of the RGB color space.
[0090] Specifically, for the understanding and examples of the technical means, technical effects, and technical terms in step S310, please refer to the explanation of step S210 in the above embodiments.
[0091] Based on the above implementation method, in this embodiment, the determination step in step S310 may specifically include:
[0092] S311. For any pixel, determine the initial channel pixel value corresponding to the current pixel in each color channel based on the current pixel value.
[0093] In real-world scenarios, the acquired text image to be processed includes both text content and background areas. If the channel reference pixel value for the cleanup process is determined based on the channel pixel value corresponding to the text content, the pixel value determined in this way may deviate too much from the background pixel value in the text image to be processed. This would result in a large difference between the target text image after processing and the original text image, ultimately leading to low reliability of the processing result.
[0094] To address this issue, after obtaining the text image to be processed, this application may further include: determining the image content of the text image to be processed, performing image cropping processing on the text image to be processed based on the image content, and obtaining the cropped text image to be processed.
[0095] Specifically, the text content area and the background area of the image to be processed can be used to crop the image, and the background area can be used as the cropped text image to be processed. Further, the steps of determining the channel pixel value and the reference channel pixel value are performed based on the cropped text image to be processed.
[0096] Specifically, based on the identification of each pixel in the text image to be processed, the initial channel pixel value of each pixel in each color channel is determined according to the pixel value of each pixel. The initial channel pixel value can be understood as the initial channel pixel value obtained after performing a three-channel decomposition on the pixel value.
[0097] For example, for any pixel, the pixel value of the current pixel is determined, and a pre-trained neural network model is used to perform channel decomposition to obtain the initial channel pixel values corresponding to each color channel in the RGB color space; optionally, a pre-compiled code script can also be used to perform channel decomposition on the pixel value to obtain the initial channel pixel values corresponding to each color channel in the RGB color space.
[0098] S312. Perform interval mapping processing on each initial channel pixel value to obtain the channel pixel value corresponding to each color channel in the RGB color space for the current pixel point.
[0099] In this embodiment, given the initial channel pixel values, the difference between adjacent pixel values is small. Therefore, directly calculating subsequent channel reference pixel values based on the individual pixel values would complicate the calculation process. Thus, this solution performs interval mapping on the obtained initial channel pixel values, mapping continuous pixel values to discrete pixel values. Specifically, channel pixel values within a preset range are mapped to the same interval, and subsequent channel reference pixel values are calculated based on these mapped values, making the calculation of subsequent pixel values simpler and easier to process.
[0100] Optionally, the process of performing interval mapping on the initial channel pixel value may include: for any color channel, obtaining a preset interval parameter, dividing the initial channel pixel value by the interval parameter and rounding down to obtain the intermediate mapping value of the current color channel; multiplying the intermediate mapping value by the interval parameter to obtain the channel pixel value of the current color channel.
[0101] Specifically, the mapping process described above will be illustrated using any one of the three RGB color channels as an example. For instance, taking the R channel as an example, the initial channel pixel value V of each pixel in the R channel is obtained. r This allows obtaining a preset interval parameter. In this application, the preset interval parameter is set to 3, but in other embodiments, it can be set to other parameters, and there is no limitation on this. Based on this, firstly, V... R Divide by 3 and round down to obtain the intermediate mapping value V of the R channel. r Then the intermediate mapping value V r Multiply by 3 to get the channel pixel value V of the R channel. R .
[0102] Furthermore, based on the above implementation method, the channel pixel values of each pixel in the image to be processed in the G channel and the B channel are determined respectively.
[0103] Based on the above implementation, when determining each pixel in the text image to be processed, if the number of pixels is too large, it may cause the computer to reduce its computing efficiency due to the large amount of data calculation. Therefore, the technical solution of this application also includes pixel sampling processing of each pixel in the text image to be processed based on the number of pixels, so as to obtain the sampled pixels.
[0104] For example, the process of sampling pixels may include: Let the acquired text image to be processed be denoted as I, where I has a height of h and a width of w. The total number of pixels in the text image to be processed is w * h. Here, a sampling pixel threshold is set to 0.05, so the number of pixels to be sampled is n = 0.05 * w * h. Further, sampling without replacement is performed, and n pixels are randomly selected from I. These selected pixels are used as the sampled pixels, and then the channel pixel values and subsequent channel reference pixel values are determined based on the sampled pixels.
[0105] S320. Determine the channel reference pixel value for cleaning the text image to be processed based on the pixel values of each channel.
[0106] Specifically, for the understanding and examples of the technical means, technical effects, and technical terms in step S320, please refer to the explanation of step S220 in the above embodiments.
[0107] Based on the above implementation method, in this embodiment, step S320 may specifically include:
[0108] S321. For any pixel, obtain the channel weights corresponding to each color channel, and determine the weight pixel value of the current pixel based on the channel pixel value and channel weight of each color channel.
[0109] In this embodiment of the application, the channel pixel values of each color channel after the interval mapping processing of each pixel in the text image to be processed are transformed to obtain the pixel value of each pixel. The reference pixel value for clearing processing is determined based on the pixel value, and then the channel reference pixel value is determined based on the reference pixel value for subsequent clearing processing.
[0110] It should be noted that for different pixels, although the channel pixel values of two pixels are different in each color channel, after pixel value conversion, the pixel values of the two pixels may be the same, which leads to low reliability of the subsequent calculation results. In order to improve the reliability of the calculation results, channel weights are pre-set for each color channel, and the difference between the channel weights of each color channel is greater than the preset difference threshold. This can avoid the problem that two pixels with different channel pixel values will have the same pixel value after conversion.
[0111] Specifically, the channel weights corresponding to each color channel are obtained. For example, in the technical solution of this application, the channel weight of the R channel is set to 256. 2 Set the channel weight of channel G to 256. 1 Set the channel weight of channel B to 256. 0 Based on this, the channel weight of the current pixel is multiplied by the corresponding channel pixel value at any pixel distance to obtain the channel weight pixel value of that pixel in that color channel. Then, the channel weight pixel values of that pixel are summed to obtain the weight pixel value of that pixel. For example, the weight pixel value of a pixel is determined based on the following expression.
[0112] V = V R *65536+V G *256+V B
[0113] S322. Based on the weighted pixel values of each pixel in the text image to be processed, determine the channel reference pixel values for clearing the text image to be processed.
[0114] In this embodiment, the weighted pixel value of each pixel in the text image to be processed is determined based on the above implementation method. Then, a reference weighted pixel value for the clearing process is determined based on each weighted pixel value, and the reference weighted pixel value is decomposed to obtain a channel reference pixel value, and then the subsequent clearing process is performed based on the channel reference pixel value.
[0115] Optionally, the method for obtaining the channel reference pixel value in this application may include: performing numerical frequency statistical processing on each weighted pixel value, and taking the weighted pixel value with the highest numerical frequency as the reference weighted pixel value of the text image to be processed; performing channel decomposition processing on the reference weighted pixel value to obtain the channel reference pixel value in each color channel.
[0116] Specifically, the frequency of occurrence of each weighted pixel value is statistically analyzed. The weighted pixel value with the highest frequency is then selected and determined as the reference weighted pixel value for subsequent clearing processing. Furthermore, this reference weighted pixel value is decomposed to obtain the decomposed channel reference pixel values.
[0117] For example, the reference weight pixel value obtained after statistics is denoted as V. max_fre And thus V max_fre Pixel value decomposition is performed to obtain the channel reference pixel values of each color channel in the RGB color space.
[0118] Specifically, a pre-trained channel decomposition model or a pre-compiled code script can be used for decomposition. Optionally, a pre-defined expression can also be used to obtain the reference pixel values for each channel. An example expression is shown below:
[0119] V bg_r =V max_fre / 65536
[0120] V bg_g =(V max_fre -V bg_r *65536) / 256
[0121] V bg_b =V max_fre -V bg_r *65536-V bg_g *256
[0122] Among them, V bg_r Represents the channel reference pixel value for the R channel; V bg_g Represents the channel reference pixel value for the G channel; V bg_b This represents the channel reference pixel value for channel B.
[0123] S330. Determine the pixels to be processed in the text image based on the channel reference pixel value, and perform pixel processing on the pixels to be processed to obtain the processed target text image.
[0124] Specifically, for the understanding and examples of the technical means, technical effects, and technical terms in step S330, please refer to the explanation of step S230 in the above embodiments.
[0125] Based on the above implementation method, in this embodiment, step S330 may specifically include:
[0126] S331. Perform spatial transformation on the reference pixel values of each channel to obtain the HSV reference pixel values corresponding to the reference pixel values of each channel in the HSV color space.
[0127] In this application, based on the determined channel reference pixel values, it is possible to directly determine whether each pixel in the text image to be processed is a pixel to be processed based on the comparison results between the channel pixel values of each pixel and the channel reference pixel values. Of course, to further improve the accuracy of image processing, the technical solution of this application, based on this, also performs a color space transformation on the determined channel reference pixel values to determine the corresponding HSV reference pixel values in the HSV color space. Then, it determines whether each pixel in the text image to be processed is a pixel to be processed based on the comparison results between the channel pixel values of each pixel in the HSV color space and the channel reference pixel values in the HSV color space. It should be noted that the determination of the pixel to be processed can be based on any one of the above comparison results, or it can be based on both of the above comparison results simultaneously; there is no limitation on this.
[0128] The HSV color space can be understood as a color space created based on the intuitive characteristics of color, also known as the Hexcone Model. Specifically, the color parameters in the HSV reference pixel value can include hue (H) value, saturation (S) value, and value of lightness (V).
[0129] Optionally, you can directly obtain the trained channel conversion model and input the channel reference pixel values of each color channel in the RGB color space into the model to obtain the HSV reference pixel values output by the model in the HSV space. Alternatively, you can obtain a preset space conversion expression and perform the space conversion.
[0130] S332. For any pixel, determine the initial channel pixel value corresponding to each color channel in the RGB color space, and the initial HSV pixel value in the HSV color space.
[0131] S333. Perform a first comparison process on the initial channel pixel values and the reference pixel values of each channel to obtain the corresponding first comparison results.
[0132] In the embodiments of this application, the first comparison process can be understood as the comparison process between the channel reference pixel value in the RGB color space and the initial channel pixel value of each pixel. Correspondingly, the first comparison result can be understood as the pixel value comparison result in the RGB color space.
[0133] Specifically, for any given pixel, in the RGB space, the initial channel pixel values of the pixel's R channel, G channel, and B channel are respectively compared with the channel reference pixel value V obtained in the above embodiments. bg_r V bg_g V bg_b Subtraction is performed to obtain the comparison results for each color channel.
[0134] S334. Perform a second comparison process on the initial HSV pixel value and the HSV reference pixel value to obtain the corresponding second comparison result.
[0135] In the embodiments of this application, the second comparison process can be understood as the comparison process between the HSV reference pixel value in the HSV color space and the initial HSV pixel value of each pixel. Correspondingly, the second comparison result can be understood as the pixel value comparison result in the HSV color space.
[0136] Specifically, for any pixel, in the HSV space, the hue value, saturation value, and brightness value of the pixel are respectively subtracted from the hue reference value, saturation reference value, and brightness reference value in the HSV reference pixel value obtained in the above embodiment to obtain the pixel value comparison result in the HSV space.
[0137] S335. Based on the first comparison result and the second comparison result, determine whether the current pixel is a pixel to be processed.
[0138] In this embodiment of the application, a preset first comparison threshold and a preset second comparison threshold can be obtained in advance; the obtained first comparison result is compared with a preset first comparison condition, or the obtained second comparison result is compared with a preset second comparison condition; optionally, if the first comparison result does not meet the requirements of the first comparison condition, or the second comparison result does not meet the requirements of the second comparison condition, it is indicated that the current pixel is a pixel to be processed.
[0139] In this embodiment, the first comparison condition can be that the pixel difference in the comparison results of any two color channels out of the three color channels is greater than a preset threshold. For example, the first comparison condition is that at least two of the pixel differences in the comparison results of each of the three channels must be greater than 62. The second comparison condition can be that the comparison results of each of the three color parameters are all greater than a preset threshold. For example, in the second comparison condition, the difference in the S value is greater than 0.2, and the difference in the V value is greater than 0.25.
[0140] In practical applications, a first comparison process and a second comparison process can be performed simultaneously on each pixel, and the result of the comparison process and the comparison conditions can be used to determine whether each pixel is a pixel to be processed. Optionally, a first comparison process (second comparison process) can be performed first, and then a second comparison process (first comparison process) can be performed on each pixel that meets the first comparison conditions (second comparison conditions) in the comparison results of the first comparison process (second comparison process). Then, the result of the second comparison process (first comparison process) and the second comparison conditions (first comparison conditions) can be used to determine whether each pixel is a pixel to be processed. This application does not limit the order of judgment in the process of determining whether a pixel is a pixel to be processed.
[0141] S336. Perform pixel processing on the pixels to be processed to obtain the processed target text image.
[0142] In this embodiment of the application, when the pixels to be processed in the text image to be processed are determined, each pixel needs to be processed to eliminate the interfering content in the text image to be processed and obtain a target text image with a clean background.
[0143] For example, the processing method of the pixel to be processed in this application can be to directly replace the pixel value of the pixel to be processed with the background color of the text image to be processed, i.e., white; specifically, it can be to replace the channel pixel value of each color channel of the pixel to be processed in the RGB color space with (255, 255, 255).
[0144] In the above scheme, the initial channel pixel values of each pixel in the RGB color space of the text image to be processed are obtained, and the initial channel pixel values are subjected to interval mapping to obtain the channel pixel values of each pixel, so as to simplify the amount of data for subsequent pixel value processing and thus improve processing efficiency. Furthermore, by setting channel weight values for each channel of the pixel, the channel reference pixel value is determined based on the channel weight values and the channel pixel values, and then the pixel to be processed is determined by comparing the channel reference pixel value with the initial channel pixel value of each pixel. In this process, the channel reference pixel value is also spatially transformed to obtain the HSV reference pixel value in the HSV space, and the HSV reference pixel value is compared with the initial HSV pixel value of each pixel in the HSV space, and the pixel to be processed is determined by comparing it with the pixel value comparison result in the RGB color space, so as to realize pixel value comparison based on multiple spaces, improve the accuracy of pixel determination, and thus improve the processing effect of subsequent image processing. Finally, pixel-by-pixel processing is performed on the identified pixels to obtain a clean target text image. This solves the problem in the prior art where back-side content penetration interferes with the parsing of the text image, thus removing back-side penetration content from the text image and improving the reliability of subsequent automatic parsing results.
[0145] Figure 5 This is a flowchart illustrating another method for removing infiltrated content from a Chinese image according to an exemplary embodiment of this application. See also... Figure 5 The method specifically includes:
[0146] Obtain the text image that needs to be cleaned.
[0147] Based on this, the regions of text content and background in the text image to be processed are cropped, and the background region is used as the cropped text image to be processed. Then, based on the cropped text image to be processed, the steps of determining the channel pixel value and the reference channel pixel value are performed.
[0148] Optionally, when determining each pixel in the text image to be processed, if the number of pixels is too large, pixel sampling can be performed on each pixel in the text image to be processed based on the number of pixels to obtain the sampled pixels.
[0149] Specifically, the obtained initial channel pixel values undergo interval mapping, transforming continuous pixel values into discrete pixel values. Specifically, channel pixel values within a preset range are mapped to the same interval, and subsequent channel reference pixel values are calculated based on these mapped channel pixel values, making subsequent pixel value calculations simpler and easier to process.
[0150] Specifically, the channel pixel values of each color channel after interval mapping processing of each pixel in the text image to be processed are transformed to obtain the pixel value of each pixel. The reference pixel value for the clearing processing is determined based on the pixel value, and then the channel reference pixel value is determined based on the reference pixel value for subsequent clearing processing.
[0151] Optionally, determine whether each pixel value is a processing pixel value based on the channel reference pixel value; if yes, retain the pixel value of that pixel; otherwise, replace the pixel value of that pixel with white until all pixels are processed, and obtain the target text image corresponding to the text image to be processed. This effectively removes the interference of the background in the text image, thereby reducing false detections in text detection and further facilitating subsequent parsing and processing, such as layout analysis and document structuring.
[0152] Figure 6 This is a schematic diagram of a device for removing infiltrated content from a text image according to an exemplary embodiment of this application. See also... Figure 6 The device includes:
[0153] The channel pixel value determination module 410 is used to acquire the text image to be processed and determine the channel pixel value corresponding to each pixel in the text image to be processed in each color channel of the RGB color space.
[0154] The channel reference pixel value determination module 420 is used to determine the channel reference pixel value for cleaning the text image to be processed based on the pixel values of each channel.
[0155] The target text image acquisition module 430 is used to determine the pixels to be processed in the text image based on the channel reference pixel value, and to perform pixel processing on the pixels to be processed to obtain the processed target text image.
[0156] Optionally, the channel pixel value determination module 410 includes:
[0157] The initial channel pixel value acquisition submodule is used to determine the initial channel pixel value corresponding to each color channel for any pixel based on the pixel value of the current pixel.
[0158] The channel pixel value determination submodule is used to perform interval mapping processing on each initial channel pixel value to obtain the channel pixel value corresponding to each color channel in the RGB color space for the current pixel point.
[0159] Optional, the channel pixel value determination submodule includes:
[0160] An acquisition unit should be set in the middle to obtain a preset interval parameter for any color channel, divide the initial channel pixel value by the interval parameter and round down to obtain the intermediate mapping value of the current color channel;
[0161] The channel pixel value determination unit is used to multiply the intermediate mapping value and the interval parameter to obtain the channel pixel value of the current color channel.
[0162] Optionally, the channel reference pixel value acquisition module 420 includes:
[0163] The weighted pixel value acquisition submodule is used to obtain the channel weights corresponding to each color channel for any pixel, and determine the weighted pixel value of the current pixel based on the channel pixel value and channel weight of each color channel.
[0164] The channel reference pixel value acquisition submodule is used to determine the channel reference pixel value for cleaning the text image based on the weighted pixel value of each pixel in the text image to be processed.
[0165] Optionally, the channel reference pixel value acquisition submodule includes:
[0166] The reference weight pixel value determination unit is used to perform numerical frequency statistical processing on each weight pixel value and take the weight pixel value with the highest numerical frequency as the reference weight pixel value of the text image to be processed.
[0167] The channel reference pixel value acquisition unit is used to perform channel decomposition processing on the reference weight pixel value to obtain the channel reference pixel value in each color channel.
[0168] Optionally, the difference between the channel weights of each color channel is greater than a preset difference threshold.
[0169] Optionally, the target text image acquisition module 430 includes:
[0170] The HSV reference pixel value acquisition submodule is used to perform spatial transformation on the reference pixel values of each channel to obtain the HSV reference pixel values corresponding to the HSV color space of each channel reference pixel value.
[0171] The initial HSV pixel value acquisition submodule is used to determine, for any pixel, the initial channel pixel value corresponding to each color channel in the RGB color space, and the initial HSV pixel value in the HSV color space.
[0172] The first comparison result acquisition module is used to perform a first comparison process on the pixel values of each initial channel and the reference pixel values of each channel to obtain the corresponding first comparison result.
[0173] The second comparison result acquisition module is used to perform a second comparison process on the initial HSV pixel value and the HSV reference pixel value to obtain the corresponding second comparison result.
[0174] The pixel-to-be-processed determination submodule is used to determine whether the current pixel is a pixel to be processed based on the first comparison result and the second comparison result.
[0175] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device in this embodiment may include:
[0176] At least one processor 501; and
[0177] Memory 502 that is communicatively connected to at least one processor;
[0178] The memory 502 stores instructions that can be executed by at least one processor 501, which, when executed by at least one processor 501, cause the server to perform the method as described in any of the above embodiments.
[0179] Alternatively, the memory 502 can be either standalone or integrated with the processor 501.
[0180] The implementation principle and technical effects of the electronic device provided in this embodiment can be found in the foregoing embodiments, and will not be repeated here.
[0181] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method of any of the foregoing embodiments.
[0182] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method of any of the foregoing embodiments.
[0183] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.
[0184] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0185] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor. The memory may include high-speed RAM, and may also include non-volatile memory (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.
[0186] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0187] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components within a server or host device.
[0188] Figure 8 A block diagram of an electronic device is shown according to an exemplary embodiment. The device may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc.
[0189] The device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0190] Processing component 802 typically controls the overall operation of device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0191] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0192] Power supply component 806 provides power to various components of device 800. Power supply component 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to device 800.
[0193] Multimedia component 808 includes a screen that provides an output interface between device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0194] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0195] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0196] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of device 800. For example, sensor assembly 814 may detect the on / off state of device 800, the relative positioning of components such as the display and keypad of device 800, changes in the position of device 800 or a component of device 800, the presence or absence of user contact with device 800, the orientation or acceleration / deceleration of device 800, and temperature changes of device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0197] Communication component 816 is configured to facilitate wired or wireless communication between device 800 and other devices. Device 800 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0198] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0199] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of the device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0200] A non-transitory computer-readable storage medium, wherein when the instructions in the storage medium are executed by the processor of an electronic device, the electronic device is able to perform the aforementioned screen splitting method of the electronic device.
[0201] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0202] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for erasing permeated content in a text image, characterized by, The method comprises the following steps: acquiring a to-be-processed text image, and determining channel pixel values corresponding to each pixel point in the to-be-processed text image in each color channel of an RGB color space respectively; determining a channel reference pixel value for clearing the to-be-processed text image based on the channel pixel values; determining a to-be-processed pixel point in the to-be-processed text image based on the channel reference pixel value, and performing pixel processing on the to-be-processed pixel point to obtain a target text image after processing; the step of determining the channel pixel values corresponding to each pixel point in the to-be-processed text image in each color channel of the RGB color space respectively comprises the following steps: for any pixel point, determining initial channel pixel values corresponding to the current pixel point in each color channel based on a pixel value of the current pixel point; performing interval mapping processing on each initial channel pixel value respectively to obtain channel pixel values corresponding to the current pixel point in each color channel of the RGB color space respectively; the step of determining the channel reference pixel value for clearing the to-be-processed text image based on the channel pixel values comprises the following steps: for any pixel point, acquiring a channel weight corresponding to each color channel respectively, and determining a weight pixel value of the current pixel point based on the channel pixel value and the channel weight of each color channel; determining the channel reference pixel value for clearing the to-be-processed text image based on the weight pixel value of each pixel point in the to-be-processed text image.
2. The method of claim 1, wherein, the step of performing interval mapping processing on each initial channel pixel value respectively to obtain channel pixel values corresponding to the current pixel point in each color channel of the RGB color space respectively comprises the following steps: for any color channel, acquiring a preset interval parameter, dividing the initial channel pixel value by the interval parameter to obtain an intermediate mapping value of the current color channel; multiplying the intermediate mapping value by the interval parameter to obtain the channel pixel value of the current color channel.
3. The method of claim 1, wherein, the step of determining the channel reference pixel value for clearing the to-be-processed text image based on the weight pixel value of each pixel point in the to-be-processed text image comprises the following steps: performing numerical frequency statistical processing on each weight pixel value, and taking a weight pixel value with the largest numerical frequency as a reference weight pixel value of the to-be-processed text image; performing channel decomposition processing on the reference weight pixel value to obtain a channel reference pixel value in each color channel respectively.
4. The method of claim 3, wherein, a difference between the channel weights of each color channel is greater than a preset difference threshold.
5. The method according to any one of claims 1 to 4, characterized in that, the step of determining the to-be-processed pixel point in the to-be-processed text image based on the channel reference pixel value comprises the following steps: performing spatial transformation on each channel reference pixel value to obtain an HSV reference pixel value corresponding to each channel reference pixel value in an HSV color space; for any pixel point, determining initial channel pixel values corresponding to the current pixel point in each color channel of the RGB color space and an initial HSV pixel value in the HSV color space respectively; performing first comparison processing on each initial channel pixel value and each channel reference pixel value to obtain a corresponding first comparison result; The initial HSV pixel value and the HSV reference pixel value are subjected to a second comparison process, to obtain a corresponding second comparison result; Based on the first comparison result and the second comparison result, it is determined whether the current pixel point is the pixel point to be processed.
6. An apparatus for erasing permeated content in a text image, characterized by comprising: Comprise: The channel pixel value determination module is used for acquiring a text image to be processed, and determining respective channel pixel values corresponding to respective color channels of an RGB color space for respective pixel points in the text image to be processed; The channel reference pixel value determination module is used for determining a channel reference pixel value for the text image to be processed based on the respective channel pixel values; The target text image obtaining module is used for determining a pixel point to be processed in the text image to be processed based on the channel reference pixel value, and performing pixel processing on the pixel point to be processed to obtain a processed target text image; The channel pixel value determination module comprises: The initial channel pixel value obtaining submodule is used for determining respective initial channel pixel values corresponding to respective color channels for a current pixel point based on a pixel value of the current pixel point for any pixel point; The channel pixel value determination submodule is used for performing interval mapping processing on the respective initial channel pixel values to obtain respective channel pixel values corresponding to respective color channels of an RGB color space for the current pixel point; The channel reference pixel value determination module comprises: The weight pixel value obtaining submodule is used for acquiring respective channel weights corresponding to respective color channels for any pixel point, and determining a weight pixel value of a current pixel point based on channel pixel values and channel weights of the respective color channels; The channel reference pixel value obtaining submodule is used for determining a channel reference pixel value for the text image to be processed based on weight pixel values of respective pixel points in the text image to be processed.
7. An electronic device, comprising: Comprise: A processor and a memory in communication connection with the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the text image background interference removal method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the text image background interference removal method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for extracting dominant hue of picture
CN106898026A
Method and device for processing target field, equipment and medium
CN115171090A