Character enhancement processing method and device, electronic equipment and readable storage medium

By separating the text part from the original grayscale image and performing local threshold binarization, the problem of poor text display effect under halftone technology is solved, and a clearer text display effect is achieved.

CN120088139APending Publication Date: 2025-06-03BEIJING DASUNG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411303172.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

When using halftone technology to process image files containing text, the text display effect is poor, especially the "smudge" phenomenon caused by factors such as fine strokes and complex structure of the text part, which affects the text display effect.

Method used

Separate the text part from the original grayscale image to obtain the text image, and perform the elimination operation on the text rendering in the text image to obtain the text adjustment image. The text image is processed through the local threshold binarization algorithm to overcome the 'smudge' phenomenon and improve the text display effect.

Benefits of technology

By separating and processing text images, defects in text display can be effectively overcome and the clarity and display effect of text can be improved, especially in images processed by the halftone algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120088139A_ABST
    Figure CN120088139A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a character enhancement processing method and device, electronic equipment and a readable storage medium, and the character enhancement processing method comprises the steps: obtaining a text image from an original grayscale image; performing elimination operation on character rendering in the text image to obtain a text adjustment image; and superposing the text adjustment image to a to-be-displayed image to obtain a text enhancement image. According to the technical scheme, the text part is separated from the original grayscale image to obtain the text image, and the text rendering in the text image is eliminated to obtain the text adjustment image, so that the text display defect caused by a'blooming 'phenomenon can be overcome, and then the text is superposed on the original grayscale image processed by the halftone algorithm; therefore, even if the display effect of the character part processed by the halftone algorithm is poor, the supplement of character defect information is realized due to superposition of the text adjustment image, and the character display effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technologies, and in particular, to a method, apparatus, electronic device, and readable storage medium for text enhancement processing. Background Art

[0002] Currently, the content of images is becoming more and more abundant. For example, an image file may contain both text and images at the same time. Due to factors such as thin strokes and complex structures in the text part, when using halftone technology to process an image file containing text, the display effect of the text is poor. To improve the display effect of the text, the inventors of the present disclosure proposed an improved method. Specifically, first, the image part in the original grayscale image is removed to obtain a text image retaining the original grayscale text information and perform binarization processing, and then it is superimposed on the second-order image processed by halftone. Since the text information in the text image that has not been processed by halftone is relatively complete, the missing text information in the second-order image can be supplemented, improving the text display effect. However, if global threshold binarization is directly performed on the text image, it will cause the "smudging" phenomenon in the text part. Some strokes are even connected together, and some strokes are missing, affecting the text display effect. Summary of the Invention

[0003] To solve the problems in the related technologies, embodiments of the present disclosure provide a method, apparatus, electronic device, and readable storage medium for text enhancement processing.

[0004] In a first aspect, embodiments of the present disclosure provide a method for text enhancement processing, including: Obtaining a text image from an original grayscale image; Performing an elimination operation on the text rendering in the text image to obtain a text adjustment image; Superimposing the text adjustment image on a to-be-displayed image to obtain a text enhancement image; wherein, the to-be-displayed image is obtained by processing the original grayscale image using a halftone algorithm.

[0005] In an implementation manner of the present disclosure, the performing an elimination operation on the text rendering in the text image to obtain a text adjustment image includes: Processing the text image using a local threshold binarization algorithm based on an average value as a threshold determination to obtain a text adjustment image.

[0006] In an implementation manner of the present disclosure, the processing the text image using a local threshold binarization algorithm based on an average value as a threshold determination to obtain a text adjustment image includes: Calculating the average value of each pixel in the text image and its adjacent pixels. If the average value is greater than a first preset threshold, it is set to white, otherwise it is set to black, to obtain a text adjustment image; or, Identify the text edge region of the text image, calculate the average value of each pixel in the text edge region and its adjacent pixels. If the average value is greater than the first preset threshold, set it to white; otherwise, set it to black to obtain a text adjustment image.

[0007] In one implementation of the present disclosure, the operation of eliminating the text rendering in the text image to obtain a text adjustment image includes: Process the text image using a local threshold binarization algorithm based on the standard deviation as a threshold to obtain a sub-pixel region image, extract the sub-pixel region part from the sub-pixel region image, perform an operation with the text image, and then perform a global binarization operation to obtain a text adjustment image.

[0008] In one implementation of the present disclosure, the process of using a local threshold binarization algorithm based on the standard deviation as a threshold to process the text image to obtain a sub-pixel region image includes: Calculate the standard deviation of each pixel in the text image and its adjacent pixels. If the standard deviation is greater than the second preset threshold, set it to white; otherwise, set it to black to obtain a sub-pixel region image; or, Identify the text edge region of the text image, calculate the standard deviation of each pixel in the text edge region and its adjacent pixels. If the standard deviation is greater than the second preset threshold, set it to white; otherwise, set it to black to obtain a sub-pixel region image.

[0009] In one implementation of the present disclosure, the image to be displayed is a second-order screen; The operation of superimposing the text adjustment image onto the image to be displayed to obtain a text enhanced image includes: Perform a binarization operation on the text adjustment image; Superimpose the binarized text adjustment image onto the image to be displayed to obtain a text enhanced image.

[0010] In one implementation of the present disclosure, the method is applied to an ink display screen.

[0011] In a second aspect, an embodiment of the present disclosure provides a text enhancement processing device, including: An acquisition module, configured to acquire a text image from an original grayscale image; An adjustment module, configured to perform an operation of eliminating text rendering in the text image to obtain a text adjustment image; A superimposition module, configured to superimpose the text adjustment image onto an image to be displayed to obtain a text enhanced image; wherein, the image to be displayed is obtained by processing the original grayscale image using a halftone algorithm.

[0012] In one implementation of the present disclosure, the adjustment module includes: A first processing unit configured to process the text image using a local threshold binarization algorithm based on an average value as a threshold to obtain a text adjustment image.

[0013] In one implementation of the present disclosure, the first processing unit includes: A first processing subunit configured to calculate the average value of each pixel of the text image and its adjacent pixels. If the average value is greater than a first preset threshold, it is set to white; otherwise, it is set to black to obtain a text adjustment image; or, Identify the text edge region of the text image, calculate the average value of each pixel of the text edge region and its adjacent pixels. If the average value is greater than a first preset threshold, it is set to white; otherwise, it is set to black to obtain a text adjustment image.

[0014] In one implementation of the present disclosure, the adjustment module includes: A second processing unit configured to process the text image using a local threshold binarization algorithm based on a standard deviation as a threshold to obtain a sub-pixel region image, extract the sub-pixel region part from the sub-pixel region image, perform an operation with the text image, and then perform a global binarization operation to obtain a text adjustment image.

[0015] In one implementation of the present disclosure, the second processing unit includes: A second processing subunit configured to calculate the standard deviation of each pixel of the text image and its adjacent pixels. If the standard deviation is greater than a second preset threshold, it is set to white; otherwise, it is set to black to obtain a sub-pixel region image; or, Identify the text edge region of the text image, calculate the standard deviation of each pixel of the text edge region and its adjacent pixels. If the standard deviation is greater than a second preset threshold, it is set to white; otherwise, it is set to black to obtain a sub-pixel region image.

[0016] In one implementation of the present disclosure, the image to be displayed is a second-order picture; The superimposing module includes: A binarization unit configured to perform a binarization operation on the text adjustment image; A superimposing unit configured to superimpose the binarized text adjustment image on the image to be displayed to obtain a text enhanced image.

[0017] In one implementation of the present disclosure, the device is applied to an ink display screen.

[0018] In a third aspect, embodiments of the present disclosure provide an electronic device, including a memory and a processor. The memory is configured to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the method according to any one of the first aspect.

[0019] In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium, on which computer instructions are stored. When the computer instructions are executed by a processor, the method according to any one of the first aspect is implemented.

[0020] The technical effects provided by the embodiments of the present disclosure may include the following beneficial effects: According to the technical solution provided by the embodiments of the present disclosure, a text enhancement processing method includes: obtaining a text image from an original grayscale image; performing an elimination operation on the text rendering in the text image to obtain a text adjustment image; and superimposing the text adjustment image on an image to be displayed to obtain a text enhancement image, where the image to be displayed is obtained by processing the original grayscale image using a halftone algorithm. The inventors of the present disclosure found that the system usually adopts a rendering strategy to render and display fonts. Therefore, due to the rendering effect in the image, when directly performing global threshold binarization, the edges and some internal strokes of the text are missing. In the above technical solution, by separating the text part from the original grayscale image to obtain a text image and performing an elimination operation on the text rendering in the text image to obtain a text adjustment image, the defect of text display caused by the "bleeding" phenomenon can be overcome. Then, by superimposing it on the original grayscale image processed by the halftone algorithm, even if the display effect of the text part after the halftone algorithm processing is poor, the supplementary information of the missing text is realized due to the superimposition of the text adjustment image, thus improving the text display effect.

[0021] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A flowchart showing a text enhancement processing method according to an embodiment of the present disclosure.

[0023] Figures 2a - 2f A schematic diagram showing the obtaining of a text image according to a specific embodiment of the present disclosure.

[0024] Figures 3a - 3d A schematic diagram showing the obtaining of a text image according to another specific embodiment of the present disclosure.

[0025] Figures 4a - 4c A schematic comparison diagram showing the text display effect in a text image according to a specific embodiment of the present disclosure.

[0026] Figures 5a - 5cShows a schematic diagram of the comparison effect before and after text enhancement of an image to be displayed according to a specific embodiment of the present disclosure.

[0027] Figure 6 Shows a structural block diagram of a text enhancement processing device according to an embodiment of the present disclosure.

[0028] Figure 7 Shows a structural block diagram of an electronic device according to an embodiment of the present disclosure.

[0029] Figure 8 Shows a schematic structural diagram of a computer system suitable for implementing the method according to an embodiment of the present disclosure. Specific embodiments

[0030] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts irrelevant to the description of the exemplary embodiments are omitted in the drawings.

[0031] In the present disclosure, it should be understood that terms such as "including" or "having" are intended to indicate the presence of features, numbers, steps, actions, components, parts, or combinations thereof disclosed in this specification, and do not intend to exclude the possibility of the presence or addition of one or more other features, numbers, steps, actions, components, parts, or combinations thereof.

[0032] In addition, it should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0033] As mentioned above, currently, image content is becoming increasingly rich. For example, an image file may contain both text and images at the same time. Due to factors such as thin strokes and complex structures in the text part, when using halftone technology to process an image file containing text, the text display effect is poor. To improve the text display effect, the inventors of the present disclosure proposed an improved method. Specifically, first, the image part in the original grayscale image is removed to obtain a text image that retains the original grayscale text information and is subjected to binarization processing, and then it is superimposed on the second-order image after halftone processing. Since the text information in the text image that has not been subjected to halftone processing is relatively complete, the missing text information in the second-order image can be supplemented, thereby improving the text display effect. However, if global threshold binarization is directly performed on the text image, it will cause the "smudging" phenomenon in the text part. Some strokes are even connected together, and some strokes are missing, affecting the text display effect.

[0034] In view of the above deficiencies, the text enhancement processing method provided by the present disclosure can overcome the text display defects caused by the "bleeding" phenomenon by separating the text part from the original grayscale image to obtain a text image and performing an elimination operation on the text rendering in the text image to obtain a text adjustment image, and then superimposing it on the original grayscale image processed by the halftone algorithm. Therefore, even if the display effect of the text part after the halftone algorithm processing is poor, the supplementary information of the missing text is realized by superimposing the text adjustment image, improving the text display effect.

[0035] Figure 1 The flowchart showing the text enhancement processing method according to an embodiment of the present disclosure.

[0036] As Figure 1 shown, the text enhancement processing method includes the following steps S110 - S130: In step S110, a text image is obtained from the original grayscale image; In step S120, an elimination operation is performed on the text rendering in the text image to obtain a text adjustment image; In step S130, the text adjustment image is superimposed on the image to be displayed to obtain a text enhanced image; wherein, the image to be displayed is obtained by processing the original grayscale image using the halftone algorithm.

[0037] In the manner of the present disclosure, the original grayscale image can be an overall image obtained by shooting or a partial image intercepted. The original grayscale image contains text and non - text information such as pictures. The purpose of step S110 is to remove the non - text information in the original grayscale image to obtain a text image that retains the text information. The format of the text in the text image, such as grayscale, position, size, angle, etc., is generally the same as that of the original grayscale image, except that the part of the non - text information is removed, facilitating subsequent processing.

[0038] In an implementation manner of the present disclosure, the technology of separating the image and text in step S110 can refer to existing text segmentation algorithms, such as performing text recognition and segmentation through features such as color, shape, and texture to obtain a text image that retains the text information.

[0039] In another implementation manner of the present disclosure, separating the image and text in the original grayscale image in step S110 to obtain a text image includes: Removing the image in the original grayscale image to obtain a text filter; Processing the original grayscale image using the text filter to obtain a text image.

[0040] In the present disclosure, by adopting, for example, morphological operations in image processing, the images in the original grayscale image are removed to obtain a text filter. The text filter retains the text border information. By processing the original grayscale image with the text filter, the text part within the text border can be retained, and the images outside the text border are removed, so as to separate the text part in the original grayscale image from the images without changing the format. It can be understood that the text filter can also be obtained by editing the original grayscale image on image processing software or generated by other means, and the present disclosure places no restrictions thereon.

[0041] In one implementation manner of the present disclosure, the removing the images in the original grayscale image to obtain a text filter includes: Performing a binarization operation on the original grayscale image to obtain an initial image; Successively performing a reconstruction opening operation and a black hat operation on the initial image to obtain a text filter.

[0042] In the present disclosure, morphological operations in image processing are used to process the binarized original grayscale image, the images in the original grayscale image are removed, a text filter capable of filtering the text information in the original grayscale image is obtained, and then the original grayscale image is processed with the text filter to obtain a text image.

[0043] Basic morphological operations include but are not limited to erosion, dilation, opening and closing operations, gradient operations, white hat operations, black hat operations, morphological reconstruction operations, etc. Among them, the opening operation is to erode the image first and then dilate it; the closing operation is to dilate the image first and then erode it; the gradient operation is to subtract the eroded image from the dilated image; the white hat operation is to perform an opening operation on the image and then subtract the opened image from the original image; the black hat operation is to perform a closing operation on the image and then subtract the original image from the closed image; the difference between the morphological reconstruction operation and the basic erosion and dilation is that a marker image is introduced during the erosion and dilation process and a template image is used to constrain the reconstruction. The morphological reconstruction operation can be further divided into a reconstruction opening operation and a reconstruction closing operation.

[0044] The morphological operations adopted in the present disclosure method are not arbitrary. Instead, the reconstruction opening operation and the black hat operation are selected, and after the binarization operation, the reconstruction opening operation and the black hat operation are sequentially executed. Taking the positions of the text and the image (also called picture) as the foreground for explanation, the purpose of the binarization operation is to separate the foreground from the white background, where the text and pictures in the original grayscale image are set to black. The purpose of erosion in the reconstruction opening operation is to further process the pictures that are not completely set to black in the binarization operation into black. In the image obtained after reconstruction, the text and the holes in the text are filled with black. Finally, the black hat operation is performed to remove the pictures in the original grayscale image, and at the same time, the text in the image processed by the reconstruction opening operation is set to white, obtaining a black-background white-letter image as a text filter. After inverting the text filter and adding it to the original grayscale image, a new grayscale image with only the text information in the grayscale image retained under the white background is obtained, that is, the text image is obtained.

[0045] Specifically, please refer to Figures 2a - 2f as shown. As Figure 2a shown, the original grayscale image is denoted as grayscale image i, which contains a picture area and a text area. The grayscale image i is binarized to screen out the pure white area, obtaining the first image BW. The pure white area in the first image BW includes the area near the text and the white area next to the black pictures (obtained by processing the picture area), as Figure 2b shown; then, an erosion operation is performed on the first image BW. The structural element of the erosion kernel is defined as a square with a side length of n 1 . Using the erosion kernel, the white parts in the black pictures are shrunk inward, so that the picture area is completely set to black, and at the same time, the text area is also eroded, obtaining the second image BW2, as Figure 2c shown; taking the second image BW2 as the seed image and the first image BW as the mask for the reconstruction operation, continuously expanding the seed image (white pixels) until reaching the edge of the limit (mask) image or there is no further expansion. The intuitive effect is that the position of the white area after erosion is mapped to the BW image and expands outward until it stops expanding when encountering the edge. In this way, while removing the white parts in the image area, the text area is set to a white background with black letters, denoted as the third image image, as Figure 2d shown; then, a black hat operation is performed on the third image image. The dilation kernel and erosion kernel of the bottom hat operation are defined as structural elements of the same size, and the structural element is a rectangular kernel of n 2 ×n 3 . Using the rectangular kernel to eliminate the text area and retain the picture area, and then subtracting it from the grayscale image i to remove the image area in the grayscale image i and retain the text area (the lower left corner icon here is also retained), denoted as the text filter image2, as Figure 2e shown. Figure 2eThe obtained text filter image2 is inverted and then added to the original grayscale image i to obtain a new grayscale image with only the text information in the grayscale image i retained under a white background, that is, the text image image3 is obtained, as Figure 2f shown.

[0046] The above method of obtaining the text filter by successively performing binarization, reconstruction opening operation, and black hat operation on the original grayscale image can be used as a general processing flow. In some cases, if there is no white part in the picture area of the initial image after binarization, the step of the reconstruction opening operation can be omitted, and the black hat operation can be directly performed on the binarized image to obtain the text filter.

[0047] Specifically, please refer to Figures 3a - 3d shown. The original grayscale image is as Figure 3a shown, which contains a picture area and a text area. The original grayscale image is binarized to obtain a binarized image as shown in 3b, and there is no white part inside the black picture. Then, the black hat operation is directly performed on the binarized image to obtain the text filter as Figure 3c shown. The Figure 3c obtained text filter is inverted and then added to the original grayscale image to obtain a new grayscale image with only the text information in the original grayscale image retained under a white background, that is, the text image is obtained as Figure 3d shown.

[0048] In an implementation manner of the present disclosure, the operation of eliminating the text rendering in the text image in step S120 to obtain a text adjustment image includes: Processing the text image by using a local threshold binarization algorithm based on the average value as the threshold determination to obtain a text adjustment image.

[0049] In another implementation manner of the present disclosure, the operation of eliminating the text rendering in the text image in step S120 to obtain a text adjustment image includes: Processing the text image by using a local threshold binarization algorithm based on the standard deviation as the threshold determination to obtain a sub-pixel region image, extracting the sub-pixel region part from the sub-pixel region image, performing an operation with the text image, and then performing a global binarization operation to obtain a text adjustment image.

[0050] In the present disclosure, by using a local threshold binarization algorithm to process a text image, sub-pixel rendering regions in the text image can be identified. Among them, the local threshold binarization algorithm can be a local threshold binarization algorithm based on the average value as the threshold determination, or a local threshold binarization algorithm based on the standard deviation as the threshold determination, such as the sauvola algorithm, the Niblack algorithm, or the wolf-jolion algorithm, etc. The local threshold binarization based on the standard deviation as the threshold determination renders the sub-pixel regions white and other regions black, while the local threshold binarization based on the average value as the threshold determination turns the text and some sub-pixel regions black and other regions white.

[0051] Figures 4a - 4c Fig. shows a comparison schematic diagram of the text display effect in a text image according to a specific embodiment of the present disclosure. Among them, Figure 4a is a schematic diagram of the text image Figure 2f after directly performing global binarization on the text in the text image without eliminating sub-pixel rendering, and there is a smudging phenomenon in the text part. Figure 4b is a text adjustment image obtained by processing the text image Figure 2f by using the above-mentioned local threshold binarization algorithm based on the average value as the threshold determination. Figure 4c is a text adjustment image obtained by processing the text image Figure 2f by using the above-mentioned local threshold binarization algorithm based on the standard deviation as the threshold determination, and then through operations and global binarization operations.

[0052] Combined with Figures 4a - 4c shown, compared with Figure 4a , Figure 4b and Figure 4c the text parts of both can eliminate the "smudging" phenomenon and improve the text display effect. Further, in the present disclosure, it is preferred to use the local threshold binarization algorithm based on the average value as the threshold determination to process the text image. In this way, the sub-pixel rendering effect can be partially removed and part of the sub-pixel rendering effect can be retained. On the one hand, it reduces the phenomenon of missing stroke connections caused by text "smudging", and at the same time, compared with the local threshold binarization algorithm based on the standard deviation as the threshold determination, it can retain more text information and reduce text jaggedness, thus improving the text display effect as a whole.

[0053] Figures 5a - 5c Fig. shows a comparison effect schematic diagram of the text enhancement before and after of a to-be-displayed image according to a specific embodiment of the present disclosure. Among them, the to-be-displayed image is processed by the error diffusion algorithm into a second-order picture, Figure 5a is a schematic diagram before the text enhancement of the to-be-displayed image; Figure 5b is a schematic diagram after the text enhancement of the to-be-displayed image, that is, Figure 4b is superimposed Figure 5aObtained after Figure 5c Another schematic diagram after text enhancement of the image to be displayed, that is, Figure 4c superimposed Figure 5a Obtained after. By comparing Figure 5a and Figure 5b , Figure 5c It can be seen that the jagged situation of the text after text enhancement is reduced, the text is clearer, and the display effect is better.

[0054] In an implementation manner of the present disclosure, the method for processing the text image by using a local threshold binarization algorithm based on an average value as a threshold determination to obtain a text adjustment image includes: Calculating the average value of each pixel of the text image and its adjacent pixels. If the average value is greater than a first preset threshold, it is set to white; otherwise, it is set to black to obtain a text adjustment image; or, Identifying the text edge region of the text image, calculating the average value of each pixel of the text edge region and its adjacent pixels. If the average value is greater than a first preset threshold, it is set to white; otherwise, it is set to black to obtain a text adjustment image.

[0055] In the implementation manner of the present disclosure, for the text image, by calculating the average value of each pixel and its adjacent pixels, the pixel region where the average value is greater than the first preset threshold is set to white, and the pixel region where the average value is less than the first preset threshold is set to black, thereby obtaining a text adjustment image. The region where the text is located and part of the sub-pixel rendering region in it are set to black, and other regions are set to white, thereby eliminating part of the sub-pixel rendering region and directly superimposing it on the image to be displayed to obtain a text-enhanced image.

[0056] In the implementation manner of the present disclosure, an existing text edge recognition algorithm can also be used to identify the text edge region of the text image, then calculate the average value of each pixel of the text edge region and its adjacent pixels and compare the average value with the first preset threshold, and set the sub-pixel rendering region to black or white according to the comparison result, specifically referring to the above description. By identifying the text edge region, it is possible to avoid processing each pixel of the text image, thereby reducing the amount of data to be processed and improving the algorithm speed. After obtaining the text adjustment image, it can be directly superimposed on the image to be displayed to obtain a text-enhanced image, or it can be adjusted to be consistent with the gray scale of the image to be displayed as needed. For example, if the gray scale of the image to be displayed is 2 levels, then the text adjustment image is binarized to obtain a binarized image, and then superimposed for display, which is convenient for display devices and other devices to display the text-enhanced image in a single driving manner, saving system resources.

[0057] In an implementation manner of the present disclosure, the method for processing the text image by using a local threshold binarization algorithm based on a standard deviation as a threshold determination to obtain a sub-pixel region image includes: Calculate the standard deviation of each pixel of the text image from its adjacent pixels. If the standard deviation is greater than a second preset threshold, set it to white; otherwise, set it to black to obtain a sub-pixel region image. Or, Identify the text edge region of the text image, calculate the standard deviation of each pixel in the text edge region from its adjacent pixels. If the standard deviation is greater than a second preset threshold, set it to white; otherwise, set it to black to obtain a sub-pixel region image.

[0058] In the present disclosure method, for a text image, it is also possible to calculate the standard deviation of each pixel from its adjacent pixels, set the pixel region with a standard deviation greater than a second preset threshold to white, and set the pixel region with a standard deviation less than the second preset threshold to black, thereby obtaining a text adjustment image, in which the region where the text is located and the sub-pixel rendering region are set to white, and other regions are set to black, to obtain a sub-pixel region image with white text on a black background.

[0059] In the present disclosure method, it is also possible to use an existing text edge recognition algorithm to identify the text edge region of the text image, then calculate the standard deviation of each pixel in the text edge region from its adjacent pixels and compare the standard deviation with a second preset threshold, and set the sub-pixel rendering region to black or white according to the comparison result, specifically referring to the above description. By identifying the text edge region, it is possible to avoid processing each pixel of the text image, thereby reducing the amount of data processed and improving the algorithm speed. After obtaining the sub-pixel region image, it cannot be directly superimposed on the image to be displayed. Instead, it is necessary to extract the sub-pixel region part from the sub-pixel region image, perform an operation with the text image to eliminate the sub-pixel region in the text image, then perform a global binarization operation on the text image after elimination to obtain a text adjustment image, and then superimpose the text adjustment image on the image to be displayed to obtain a text enhanced image.

[0060] The first preset threshold, the second preset threshold, and the threshold for global binarization in the present disclosure method can be set according to experience, or the parameters can be adjusted according to the needs in accordance with the prior art.

[0061] Specifically, taking Figure 4b , Figure 4c as an example for illustration: The first preset threshold can be set to the average value of the pixels in the surrounding 5×5 region minus a constant of 6. Among them, the larger the constant, the whiter it is, and it has a further filtering effect on the image, but if it is too large, it will lead to a weakening of the text enhancement effect. It is recommended that the threshold be 6 to 32.

[0062] Taking the Niblack algorithm as an example, the second preset threshold T = mean + K × standard deviation - offset, where K = -0.2, offset = 0, and the recommended value range of K is -0.2~-0.5. The offset parameter has a large difference for bright and dark images, so 0 is selected here to extract only the sub-pixel area.

[0063] The global binarization threshold is set to 240, and the recommended value range is 200~240. The smaller the threshold, the more the image area can be filtered, but too low a threshold will affect the text area.

[0064] In one implementation of the present disclosure, the image to be displayed is a second-order picture; The step S130 of superimposing the text adjustment image onto the image to be displayed to obtain the text enhanced image includes: Performing a binarization operation on the text-adjusted image; The text-adjusted image after the binarization operation is superimposed on the image to be displayed to obtain a text-enhanced image.

[0065] In the disclosed method, a binarization operation is performed on the text adjustment image after removing the rendering effect, which can avoid text display defects caused by the "blooming" phenomenon, and then it is superimposed on the image to be displayed of the second-order picture to obtain a text enhanced image, which improves the text display effect and makes it convenient for display devices and other equipment to use a driving method to display the text adjustment image, saving system resources.

[0066] In one implementation of the present disclosure, when the ink screen displays a second-order image, it essentially uses black and white pixels to restore grayscale image information. Therefore, the text enhancement processing method provided by the present disclosure can be applied to the ink display screen.

[0067] In a specific embodiment, a text enhancement processing method applied to an ink display screen includes the following steps: Step 1: Binarize the original grayscale image to obtain the initial image, and then perform reconstruction and black hat operations on the initial image to obtain a text filter. Then, the obtained text filter is inverted and added to the original grayscale image to obtain a text image. Step 2: performing an operation of eliminating the text rendering in the text image to obtain a text adjustment image; Step 3: Process the original grayscale image using an error diffusion algorithm to obtain a second-order image to be displayed; Step 4: Superimpose the text-adjusted image onto the image to be displayed to obtain a text-enhanced image.

[0068] The relevant technical details of the above steps 1 to 4 can be referred to the embodiment part of the previous text and will not be repeated here.

[0069] Figure 6 A structural block diagram of a text enhancement processing device according to an embodiment of the present disclosure is shown. Among them, the system can be implemented as part or all of an electronic device through software, hardware, or a combination of both.

[0070] As Figure 6 shown, the text enhancement processing device 600 includes: The acquisition module 610 is configured to acquire a text image from an original grayscale image; The adjustment module 620 is configured to perform an elimination operation on the text rendering in the text image to obtain a text adjustment image; The superimposition module 630 is configured to superimpose the text adjustment image on the image to be displayed to obtain a text enhancement image; wherein, the image to be displayed is obtained by processing the original grayscale image using a halftone algorithm.

[0071] The text enhancement processing device provided by the present disclosure can overcome the text display defects caused by the "bleeding" phenomenon by separating the text part from the original grayscale image to obtain a text image, performing an elimination operation on the text rendering in the text image to obtain a text adjustment image, and then superimposing it on the original grayscale image processed by the halftone algorithm. Therefore, even if the display effect of the text part after the halftone algorithm processing is poor, the supplementary information of the missing text is realized due to the superimposition of the text adjustment image, improving the text display effect.

[0072] In one implementation manner of the present disclosure, the adjustment module 620 includes: The first processing unit is configured to process the text image using a local threshold binarization algorithm based on the average value as a threshold to obtain a text adjustment image.

[0073] In one implementation manner of the present disclosure, the first processing unit includes: The first processing subunit is configured to calculate the average value of each pixel of the text image and its adjacent pixels. If the average value is greater than a first preset threshold, it is set to white; otherwise, it is set to black to obtain a text adjustment image; or, Identify the text edge region of the text image, calculate the average value of each pixel of the text edge region and its adjacent pixels. If the average value is greater than a first preset threshold, it is set to white; otherwise, it is set to black to obtain a text adjustment image.

[0074] In one implementation manner of the present disclosure, the adjustment module includes: A second processing unit, configured to process the text image by using a local threshold binarization algorithm determined based on a standard deviation as a threshold to obtain a sub-pixel region image, extract a sub-pixel region part from the sub-pixel region image, perform an operation with the text image, and then perform a global binarization operation to obtain a text adjustment image.

[0075] In an implementation manner of the present disclosure, the second processing unit includes: A second processing subunit, configured to calculate a standard deviation between each pixel of the text image and adjacent pixels. If the standard deviation is greater than a second preset threshold, set it to white; otherwise, set it to black to obtain a sub-pixel region image; or, Identify a text edge region of the text image, calculate a standard deviation between each pixel of the text edge region and adjacent pixels. If the standard deviation is greater than a second preset threshold, set it to white; otherwise, set it to black to obtain a sub-pixel region image.

[0076] In an implementation manner of the present disclosure, the image to be displayed is a second-order picture; The superimposing module includes: A binarization unit, configured to perform a binarization operation on the text adjustment image; A superimposing unit, configured to superimpose the text adjustment image after the binarization operation onto the image to be displayed to obtain a text enhanced image.

[0077] In an implementation manner of the present disclosure, the device is applied to an ink display screen.

[0078] The present disclosure also discloses an electronic device, Figure 7 showing a structural block diagram of the electronic device according to an embodiment of the present disclosure.

[0079] As Figure 7 shown, the electronic device includes a memory and a processor. Among them, the memory is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the method according to the embodiment of the present disclosure: Obtain a text image from an original grayscale image; Perform an elimination operation on the text rendering in the text image to obtain a text adjustment image; Superimpose the text adjustment image onto an image to be displayed to obtain a text enhanced image; wherein, the image to be displayed is obtained by processing the original grayscale image by using a halftone algorithm.

[0080] In an implementation manner of the present disclosure, the performing an elimination operation on the text rendering in the text image to obtain a text adjustment image includes: Process the text image using a local threshold binarization algorithm based on the average value as the threshold determination to obtain a text adjustment image.

[0081] In one implementation of the present disclosure, the process of using a local threshold binarization algorithm based on the average value as the threshold determination to process the text image to obtain a text adjustment image includes: Calculate the average value of each pixel of the text image and its adjacent pixels. If the average value is greater than a first preset threshold, set it to white; otherwise, set it to black to obtain a text adjustment image; or, Identify the text edge region of the text image, calculate the average value of each pixel of the text edge region and its adjacent pixels. If the average value is greater than a first preset threshold, set it to white; otherwise, set it to black to obtain a text adjustment image.

[0082] In one implementation of the present disclosure, the operation of eliminating the text rendering in the text image to obtain a text adjustment image includes: Process the text image using a local threshold binarization algorithm based on the standard deviation as the threshold determination to obtain a sub-pixel region image, extract the sub-pixel region part from the sub-pixel region image, perform an operation with the text image, and then perform a global binarization operation to obtain a text adjustment image.

[0083] In one implementation of the present disclosure, the process of using a local threshold binarization algorithm based on the standard deviation as the threshold determination to process the text image to obtain a sub-pixel region image includes: Calculate the standard deviation of each pixel of the text image and its adjacent pixels. If the standard deviation is greater than a second preset threshold, set it to white; otherwise, set it to black to obtain a sub-pixel region image; or, Identify the text edge region of the text image, calculate the standard deviation of each pixel of the text edge region and its adjacent pixels. If the standard deviation is greater than a second preset threshold, set it to white; otherwise, set it to black to obtain a sub-pixel region image.

[0084] In one implementation of the present disclosure, the image to be displayed is a second-order screen; The operation of superimposing the text adjustment image onto the image to be displayed to obtain a text enhancement image includes: Perform a binarization operation on the text adjustment image; Superimpose the binarized text adjustment image onto the image to be displayed to obtain a text enhancement image.

[0085] In one implementation of the present disclosure, the method is applied to an ink display screen.

[0086] Figure 8A structural schematic diagram of a computer system suitable for implementing the method according to an embodiment of the present disclosure is shown.

[0087] As Figure 8 shown, the computer system includes a processing unit, which can execute various methods in the above embodiments according to a program stored in a read-only memory (ROM) or a program loaded from a storage section into a random access memory (RAM). In the RAM, various programs and data required for the operation of the computer system are also stored. The processing unit, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0088] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN card, a modem, etc. The communication part performs a communication process via a network such as the Internet. A drive is also connected to the I / O interface as needed. A removable medium, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive as needed so that a computer program read from it can be installed into the storage part as needed. Among them, the processing unit can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.

[0089] Specifically, according to an embodiment of the present disclosure, the method described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes program code for executing the above method. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part, and / or installed from a removable medium.

[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0091] The units or modules described in the embodiments of the present disclosure can be implemented in software or in programmable hardware. The described units or modules can also be set in a processor, and the names of these units or modules do not, in some cases, constitute a limitation on the units or modules themselves.

[0092] On the other hand, the present disclosure also provides a computer-readable storage medium, which can be the computer-readable storage medium included in the electronic device or computer system in the above embodiments; or it can exist separately and be a computer-readable storage medium not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the methods described in the present disclosure.

[0093] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles applied. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features having similar functions disclosed in the present disclosure.

Claims

1. A text enhancement processing method, characterized in that: include: Get text image from original grayscale image; Eliminating the text rendering in the text image to obtain a text adjustment image; The text-adjusted image is superimposed on the image to be displayed to obtain a text-enhanced image; wherein the image to be displayed is obtained by processing the original grayscale image using a halftone algorithm.

2. The text enhancement processing method according to claim 1, characterized in that: The step of performing an operation of eliminating text rendering in the text image to obtain a text adjustment image includes: The text image is processed using a local threshold binarization algorithm based on an average value as a threshold determination to obtain a text adjustment image.

3. The text enhancement processing method according to claim 2, characterized in that: The method of processing the text image using a local threshold binarization algorithm based on an average value as a threshold to obtain a text adjustment image includes: Calculate the average value of each pixel of the text image and its adjacent pixels, and if the average value is greater than a first preset threshold, set it to white, otherwise set it to black, to obtain a text adjustment image; or, The text edge region of the text image is identified, and the average value of each pixel and adjacent pixels in the text edge region is calculated. If the average value is greater than a first preset threshold, it is set to white, otherwise it is set to black, to obtain a text adjustment image.

4. The text enhancement processing method according to claim 1, characterized in that: The step of performing an operation of eliminating text rendering in the text image to obtain a text adjustment image includes: The text image is processed using a local threshold binarization algorithm based on standard deviation as a threshold judgment to obtain a sub-pixel area image, a sub-pixel area part is extracted from the sub-pixel area image, and is operated with the text image, and then a global binarization operation is performed to obtain a text adjustment image.

5. The text enhancement processing method according to claim 4, characterized in that: The method of processing the text image using a local threshold binarization algorithm based on a standard deviation as a threshold determination to obtain a sub-pixel region image includes: Calculate the standard deviation between each pixel of the text image and its adjacent pixels, and if the standard deviation is greater than a second preset threshold, set it to white, otherwise set it to black, to obtain a sub-pixel area image; or, Identify the text edge area of ​​the text image, calculate the standard deviation between each pixel in the text edge area and adjacent pixels, and if the standard deviation is greater than a second preset threshold, set it to white, otherwise set it to black, to obtain a sub-pixel area image.

6. The text enhancement processing method according to claim 1, characterized in that: The image to be displayed is a second-order image; The step of superimposing the text-adjusted image onto the image to be displayed to obtain the text-enhanced image comprises: Performing a binarization operation on the text-adjusted image; The text-adjusted image after the binarization operation is superimposed on the image to be displayed to obtain a text-enhanced image.

7. The text enhancement processing method according to any one of claims 1 to 6, characterized in that: Applied to ink display screen.

8. A text enhancement processing device, characterized in that: include: An acquisition module is configured to acquire a text image from an original grayscale image; An adjustment module is configured to perform an elimination operation on the text rendering in the text image to obtain a text adjustment image; The superposition module is configured to superimpose the text adjustment image onto the image to be displayed to obtain a text enhanced image; wherein the image to be displayed is obtained by processing the original grayscale image using a halftone algorithm.

9. An electronic device, characterized in that: The method comprises a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.