Image-text processing method and device, electronic equipment and readable storage medium

By separating text parts from the original grayscale image and superimposing them onto the half-tone-processed image, the problem of reduced text clarity is solved, improving the text display effect and balancing the graphics and text performance.

CN119323621APending Publication Date: 2025-01-17BEIJING DASUNG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411303416.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

When processing images containing text, halftone technology will lead to reduced text clarity or missing information, and adjusting contrast curves to improve text effects will affect the overall picture, making it difficult to take into account both image quality and text effects.

Method used

By separating the text part from the original grayscale image, a text image is obtained and superimposed on the halftone processed image to be displayed, the grayscale of the text image is adjusted to the same as the image to be displayed, to supplement the text information and improve the Display effect.

Benefits of technology

It has achieved the supplementary text information, improved the text display effect, balanced the graphics and text effects, and ensured the overall performance of text and images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323621A_ABST
    Figure CN119323621A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to an image-text processing method and device, electronic equipment and a readable storage medium, and the image-text processing method comprises the following steps: separating an image and characters in an original grayscale image to obtain a text image; performing halftone processing on the original grayscale image to obtain a to-be-displayed image; and superposing the text image onto the to-be-displayed image to obtain a target image. According to the technical scheme, the text part is separated from the original grayscale image to obtain the text image, and then the text image is overlaid on the to-be-displayed image processed by the halftone algorithm, so that even if the display effect of the text part of the to-be-displayed image is poor, the text display effect is improved due to the fact that the text image is overlaid to achieve supplement of text missing information, and the user experience is improved. Therefore, the image-text effect is balanced on the whole.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] At present, image content is becoming more and more abundant. For example, an image file may contain both text and images. Due to factors such as thin strokes and complex structure of the text part, when using halftone technology to process image files containing text, the clarity of the text will be reduced or even information will be lost. In order to improve the effect of text display, a common method is to adjust the contrast curve, but this method will change the overall picture, and it is difficult to achieve both image quality and text effect. Summary of the invention

[0003] In order to solve the problems in the related art, the embodiments of the present disclosure provide a method and device for processing images and texts, an electronic device, and a readable storage medium.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for processing images and texts, including: Separate the image and text in the original grayscale image to obtain a text image; Performing halftone processing on the original grayscale image to obtain an image to be displayed; The text image is superimposed on the image to be displayed to obtain a target image.

[0005] In one implementation of the present disclosure, the step of separating the image and text in the original grayscale image to obtain the text image includes: Removing the image from the original grayscale image to obtain a text filter; The original grayscale image is processed using the text filter to obtain a text image.

[0006] In an implementation of the present disclosure, removing the image from the original grayscale image to obtain a text filter includes: Binarize the original grayscale image to obtain the initial image; The initial image is sequentially subjected to reconstruction opening operation and black hat operation to obtain a text filter.

[0007] In one implementation of the present disclosure, the step of separating the image and text in the original grayscale image to obtain the text image includes: Get the text filter template; The original grayscale image is processed using the text filter template to obtain a text image.

[0008] In an implementation of the present disclosure, superimposing the text image onto the image to be displayed to obtain a target image includes: Performing text enhancement processing on the text image; The text image after text enhancement processing is superimposed on the image to be displayed to obtain a target image.

[0009] In one implementation of the present disclosure, the text enhancement processing on the text image includes: The grayscale of the characters in the text image is adjusted to be the same as the grayscale of the image to be displayed.

[0010] In an implementation of the present disclosure, the grayscale of the characters in the text image after adjustment is second order.

[0011] In a second aspect, an embodiment of the present disclosure provides a graphic processing device, including: A text acquisition module is configured to separate the image and text in the original grayscale image to obtain a text image; A processing module, configured to perform halftone processing on the original grayscale image to obtain an image to be displayed; The superimposition module is configured to superimpose the text image onto the image to be displayed to obtain a target image.

[0012] In one implementation of the present disclosure, the text acquisition module includes: A first text acquisition unit is configured to remove the image in the original grayscale image to obtain a text filter; The first processing unit is configured to process the original grayscale image using the text filter to obtain a text image.

[0013] In an implementation of the present disclosure, the part of the first text acquisition unit that removes the image in the original grayscale image to obtain the text filter is configured as follows: Binarize the original grayscale image to obtain the initial image; The initial image is sequentially subjected to reconstruction opening operation and black hat operation to obtain a text filter.

[0014] In one implementation of the present disclosure, the text acquisition module includes: A second text acquisition unit is configured to acquire a text filtering template; The second processing unit is configured to process the original grayscale image using the text filtering template to obtain a text image.

[0015] In one implementation of the present disclosure, the superposition module includes: an enhancement processing unit, configured to perform text enhancement processing on the text image; The superimposing unit is configured to superimpose the text image after text enhancement processing onto the image to be displayed to obtain a target image.

[0016] In an implementation of the present disclosure, the part of the enhancement processing unit that performs text enhancement processing on the text image is configured as follows: The grayscale of the characters in the text image is adjusted to be the same as the grayscale of the image to be displayed.

[0017] In an implementation of the present disclosure, the grayscale of the characters in the text image after adjustment is second order.

[0018] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer instructions, and wherein the one or more computer instructions are executed by the processor to implement a method as described in any one of the first aspects.

[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the method described in any one of the first aspects 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 embodiment of the present disclosure, the image and text processing method includes: separating the image and text in the original grayscale image to obtain a text image; performing halftone processing on the original grayscale image to obtain an image to be displayed; and superimposing the text image on the image to be displayed to obtain a target image. In the above technical solution, the text image is obtained by separating the text part from the original grayscale image, and then superimposed on the image to be displayed after the halftone algorithm is processed. Therefore, even if the text part of the image to be displayed has a poor display effect, the missing text information is supplemented by superimposing the text image, which improves the text display effect, thereby balancing the image and text effect as a whole.

[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A flowchart of a method for processing graphics and text according to an embodiment of the present disclosure is shown.

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

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

[0025] Figure 4 A structural block diagram of a graphic and text processing device according to an embodiment of the present disclosure is shown.

[0026] Figure 5 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0027] Figure 6 A schematic diagram showing the structure of a computer system suitable for implementing the method according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0028] 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 not related to the description of the exemplary embodiments are omitted in the accompanying drawings.

[0029] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof exist or are added.

[0030] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may 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.

[0031] As mentioned above, at present, the content of images is becoming richer and richer. For example, an image file may contain both text and images. Due to factors such as the thin strokes and complex structure of the text part, when the image file containing text is processed using halftone technology, the clarity of the text will be reduced or even information will be lost. In order to improve the effect of text display, a common method is to adjust the contrast curve, but this method will change the overall picture, and it is difficult to achieve both image quality and text effect.

[0032] Taking the above-mentioned defects into consideration, the image and text processing method provided by the present invention obtains a text image by separating the text part from the original grayscale image, and then superimposes it on the image to be displayed after being processed by the halftone algorithm. Therefore, even if the display effect of the text part of the image to be displayed is poor, the missing text information is supplemented by superimposing the text image, thereby improving the text display effect and balancing the image and text effects as a whole.

[0033] Figure 1 A flowchart of a method for processing graphics and text according to an embodiment of the present disclosure is shown.

[0034] like Figure 1 As shown, the image and text processing method includes the following steps S110-S130: In step S110, the image and text in the original grayscale image are separated to obtain a text image; In step S120, halftone processing is performed on the original grayscale image to obtain an image to be displayed; In step S130, the text image is superimposed on the image to be displayed to obtain a target image.

[0035] In the disclosed method, the original grayscale image can be the whole image obtained by shooting, or it can be a captured partial image. The original grayscale image contains text and images (or non-text information). The purpose of step S110 is to remove the image from 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 and other information, is generally the same as that of the original grayscale image, except that the image part is removed, so as to facilitate subsequent processing.

[0036] In one implementation of the present disclosure, the technology for 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 text information.

[0037] In another implementation of the present disclosure, the step S110 of separating the image and text in the original grayscale image to obtain the text image includes: Removing the image from the original grayscale image to obtain a text filter; The original grayscale image is processed using the text filter to obtain a text image.

[0038] In the disclosed method, by adopting a method such as morphological operation in image processing, the image in the original grayscale image is removed to obtain a text filter, and 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 image outside the text border is removed, thereby separating the text part in the original grayscale image from the image without changing the format. It is understandable that the original grayscale image can also be edited on the image processing software to obtain the text filter, or the text filter can be generated by other methods, and the present disclosure does not limit this.

[0039] In an implementation of the present disclosure, removing the image from the original grayscale image to obtain a text filter includes: Binarize the original grayscale image to obtain the initial image; The initial image is sequentially subjected to reconstruction opening operation and black hat operation to obtain a text filter.

[0040] In the disclosed method, morphological operations in image processing are used to process the original grayscale image after binarization, and the image in the original grayscale image is removed to obtain a text filter that can filter the text information in the original grayscale image, and then the text filter is used to process the original grayscale image to obtain a text image.

[0041] Basic morphological operations include but are not limited to corrosion, expansion, opening and closing operations, gradient operations, white hat operations, black hat operations, morphological reconstruction operations, etc. Among them, the opening operation is to corrode the image first and then expand it; the closing operation is to expand the image first and then corrode it; the gradient operation is to subtract the eroded image from the expanded image; the white hat operation is to open the image and then subtract the open operation image from the original image; the black hat operation is to close the image and then subtract the original image from the closed operation image; the morphological reconstruction operation is different from the basic corrosion and expansion in that the labeled image is introduced in the corrosion and expansion process, and the template image is used to constrain the reconstruction. Morphological reconstruction operations can be divided into reconstruction opening operations and reconstruction closing operations.

[0042] The morphological operation adopted in the disclosed method is not arbitrary, but a reconstruction operation and a black hat operation are selected, and after the binarization operation, the reconstruction operation and the black hat operation are performed in sequence. The location of the text and the image (also called the picture) is used as the foreground for explanation. The purpose of the binarization operation is to separate the foreground and the white background, wherein the text and the picture in the original grayscale image are set to black. The purpose of the corrosion in the reconstruction operation is to further process the picture that is not completely set to black in the binarization operation to black. The text and the holes in the text in the image obtained after reconstruction are filled with black. Finally, the black hat operation is performed to remove the picture in the original grayscale image, and the text in the image processed by the reconstruction operation is set to white, so as to obtain a black background and white text image as a text filter. The text filter is inverted and added to the original grayscale image to obtain a new grayscale image that only retains the text information in the grayscale image under the white background, that is, the text image is obtained.

[0043] For details, please refer to Figure 2a-2e As shown. Figure 2a As shown, the original grayscale image is recorded as grayscale image i, which contains the picture area and the text area. The grayscale image i is binarized to filter out the pure white area to obtain 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 picture (obtained by processing the picture area), as shown in Figure 2b As shown; then the first image BW is eroded, and the structural element of the erosion kernel is defined as a square with a side length of n1. The erosion kernel is used to shrink the white part of the black image inward, so that the image area is completely set to black, and the text area is also eroded, and the second image BW2 is obtained, as shown Figure 2cAs shown in the figure, the second image BW2 is used as the seed image, and the first image BW is used as the mask for reconstruction. The seed image (white pixels) is continuously expanded until the edge of the restricted (mask) image is reached or there is no further expansion. The intuitive effect is that the position of the white area after corrosion is mapped to the BW image and expands outward. When the edge is encountered, the expansion stops. In this way, the white part of the image area is removed and the text area is set to black text on a white background, which is recorded as the third image image, as shown in the figure. Figure 2d As shown; then perform a black hat operation on the third image image, define the expansion kernel and erosion kernel of the bottom hat operation as structural elements of the same size, and the structural element is a rectangular kernel of n2*n3, use the rectangular kernel to eliminate the text area and retain the image area, and then subtract it from the grayscale image i to remove the image area in the grayscale image i and retain the text area (the icon in the lower left corner is also retained here), recorded as text filter image2, as shown Figure 2e As shown. Figure 2e The obtained text filter image2 is inverted and added to the original grayscale image i to obtain a new grayscale image that only retains the text information in the grayscale image i under a white background, that is, the text image image3 is obtained, as shown in Figure 2f shown.

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

[0045] For details, please refer to Figure 3a-3d As shown. The original grayscale image is Figure 3a As shown in FIG. 3 , which includes image areas and text areas, the original grayscale image is binarized to obtain a binarized image as shown in FIG. 3b . There is no white part inside the black image, so a black hat operation is directly performed on the binarized image to obtain a text filter as shown in FIG. Figure 3c As shown. Figure 3c The obtained text filter is inverted and 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 shown in Figure 3d shown.

[0046] In one implementation of the present disclosure, the step S110 of separating the image and text in the original grayscale image to obtain the text image includes: Get the text filter template; The original grayscale image is processed using the text filter template to obtain a text image.

[0047] In the disclosed method, the original grayscale image can be edited on the image processing software to obtain, for example, the image2 mentioned above as a text filter template, and then the original grayscale image can be processed using the text filter template to remove the image portion of the original grayscale image, thereby obtaining a text image that retains the text information. It should be noted that the implementation method of the text filter template can be used to process templated original grayscale images, in which the text portion of the image remains unchanged and only the image content is different. Therefore, a general text filter template can be made to batch process different original grayscale images. In some cases, for original grayscale images with changing text portions, commonly used templates of single texts can also be made in advance, and the required single texts can be combined to obtain the text filter template.

[0048] In one implementation of the present disclosure, the halftone processing in step S120 may select a simple threshold comparison algorithm, a halftoning algorithm using random numbers, an error diffusion algorithm, a dot diffusion algorithm, a sequential dithering algorithm, and a dithering algorithm, etc., and the present disclosure does not limit this.

[0049] In one implementation of the present disclosure, in step S130, the text image obtained in step S110 can be directly superimposed on the image to be displayed to obtain the target image. Since the text image retains the text format in the original grayscale image and has not been half-toned, its text information is more complete than the text information in the image to be displayed after half-toning processing. By superimposing the text image, the missing text information in the image to be displayed can be supplemented, thereby improving the text display effect.

[0050] In one implementation of the present disclosure, superimposing the text image onto the image to be displayed to obtain a target image in step S130 includes: Performing text enhancement processing on the text image; The text image after text enhancement processing is superimposed on the image to be displayed to obtain a target image.

[0051] In the disclosed method, the text enhancement processing includes but is not limited to adjusting contrast, text sharpening, and image brightening, etc. By performing text enhancement processing on the text image and then superimposing it on the image to be displayed to obtain the target image, the text display effect can be further improved.

[0052] In one implementation of the present disclosure, the text enhancement processing on the text image includes: The grayscale of the characters in the text image is adjusted to be the same as the grayscale of the image to be displayed.

[0053] In the disclosed method, by adjusting the grayscale of the text in the text image to be the same as the grayscale of the image to be displayed, the grayscale of the text and image parts in the target image is obtained to be consistent, for example, 2 levels, 8 levels, 16 levels or other grayscales, which makes it convenient for the display device to display graphic information in one driving mode. Otherwise, it is necessary to drive the display image and text parts separately, saving system resources.

[0054] In one implementation of the present disclosure, the grayscale of the text in the adjusted text image is second order, so that the obtained target image is a second order picture. Therefore, the image and text processing method can be applied to a black and white ink display screen to enhance the image and text display effect of the second order picture.

[0055] In a specific embodiment, the present disclosure provides a method for processing images and texts applied to a black and white ink display screen, comprising 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 the text filter; Step 2: Process the original grayscale image using an error diffusion algorithm to obtain a second-order image to be displayed; Step 3: Binarize the text image and then superimpose it on the second-order image to be displayed to obtain the target image.

[0056] The relevant technical details of the above steps 1 to 3 can be found in the embodiment section above and will not be repeated here.

[0057] Figure 4 The structural block diagram of the image and text processing device according to the embodiment of the present disclosure is shown. The system can be implemented as part or all of the electronic device through software, hardware or a combination of both.

[0058] like Figure 4 As shown, the image and text processing device 400 includes: The text acquisition module 410 is configured to separate the image and text in the original grayscale image to obtain a text image; The processing module 420 is configured to perform halftone processing on the original grayscale image to obtain an image to be displayed; The superimposition module 430 is configured to superimpose the text image onto the image to be displayed to obtain a target image.

[0059] The image and text processing device provided by the present disclosure obtains a text image by separating the text part from the original grayscale image, and then superimposes it on the image to be displayed after being processed by a halftone algorithm. Therefore, even if the display effect of the text part of the image to be displayed is poor, the missing text information is supplemented by superimposing the text image, thereby improving the text display effect and balancing the image and text effects as a whole.

[0060] In one implementation of the present disclosure, the text acquisition module 410 includes: A first text acquisition unit is configured to remove the image in the original grayscale image to obtain a text filter; The first processing unit is configured to process the original grayscale image using the text filter to obtain a text image.

[0061] In an implementation of the present disclosure, the part of the first text acquisition unit that removes the image in the original grayscale image to obtain the text filter is configured as follows: Binarize the original grayscale image to obtain the initial image; The initial image is sequentially subjected to reconstruction opening operation and black hat operation to obtain a text filter.

[0062] In one implementation of the present disclosure, the text acquisition module 410 includes: A second text acquisition unit is configured to acquire a text filtering template; The second processing unit is configured to process the original grayscale image using the text filtering template to obtain a text image.

[0063] In one implementation of the present disclosure, the superposition module 430 includes: an enhancement processing unit, configured to perform text enhancement processing on the text image; The superimposing unit is configured to superimpose the text image after text enhancement processing onto the image to be displayed to obtain a target image.

[0064] In an implementation of the present disclosure, the part of the enhancement processing unit that performs text enhancement processing on the text image is configured as follows: The grayscale of the characters in the text image is adjusted to be the same as the grayscale of the image to be displayed.

[0065] In an implementation of the present disclosure, the grayscale of the characters in the text image after adjustment is second order.

[0066] The present disclosure also discloses an electronic device, Figure 5 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0067] like Figure 5 As shown, the electronic device includes 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 an embodiment of the present disclosure: Separate the image and text in the original grayscale image to obtain a text image; Performing halftone processing on the original grayscale image to obtain an image to be displayed; The text image is superimposed on the image to be displayed to obtain a target image.

[0068] In one implementation of the present disclosure, the step of separating the image and text in the original grayscale image to obtain the text image includes: Removing the image from the original grayscale image to obtain a text filter; The original grayscale image is processed using the text filter to obtain a text image.

[0069] In an implementation of the present disclosure, removing the image from the original grayscale image to obtain a text filter includes: Binarize the original grayscale image to obtain the initial image; The initial image is sequentially subjected to reconstruction opening operation and black hat operation to obtain a text filter.

[0070] In one implementation of the present disclosure, the step of separating the image and text in the original grayscale image to obtain the text image includes: Get the text filter template; The original grayscale image is processed using the text filter template to obtain a text image.

[0071] In an implementation of the present disclosure, superimposing the text image onto the image to be displayed to obtain a target image includes: Performing text enhancement processing on the text image; The text image after text enhancement processing is superimposed on the image to be displayed to obtain a target image.

[0072] In one implementation of the present disclosure, the text enhancement processing on the text image includes: The grayscale of the characters in the text image is adjusted to be the same as the grayscale of the image to be displayed.

[0073] In an implementation of the present disclosure, the grayscale of the characters in the text image after adjustment is second order.

[0074] Figure 6 A schematic diagram showing the structure of a computer system suitable for implementing the method according to an embodiment of the present disclosure is shown.

[0075] like Figure 6As shown, the computer system includes a processing unit, which can execute various methods in the above-mentioned embodiments according to a program stored in a read-only memory (ROM) or a program loaded from a storage part 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 through a bus. An input / output (I / O) interface is also connected to the bus.

[0076] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; 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. The drive is also connected to the I / O interface as needed. Removable media, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive as needed so that the computer program read therefrom 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.

[0077] In particular, 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 a program code for executing the above method. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium.

[0078] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

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

[0080] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer system in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into a device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.

[0081] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a 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 above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A method for processing images and texts, characterized in that: include: Separate the image and text in the original grayscale image to obtain a text image; Performing halftone processing on the original grayscale image to obtain an image to be displayed; The text image is superimposed on the image to be displayed to obtain a target image.

2. The image and text processing method according to claim 1, characterized in that: The step of separating the image and text in the original grayscale image to obtain a text image includes: Removing the image from the original grayscale image to obtain a text filter; The original grayscale image is processed using the text filter to obtain a text image.

3. The image and text processing method according to claim 2, characterized in that: The step of removing the image from the original grayscale image to obtain a text filter comprises: Binarize the original grayscale image to obtain the initial image; The initial image is sequentially subjected to reconstruction opening operation and black hat operation to obtain a text filter.

4. The image and text processing method according to claim 1, characterized in that: The step of separating the image and text in the original grayscale image to obtain a text image includes: Get the text filter template; The original grayscale image is processed using the text filter template to obtain a text image.

5. The image and text processing method according to claim 1, characterized in that: The step of superimposing the text image onto the image to be displayed to obtain a target image includes: Performing text enhancement processing on the text image; The text image after text enhancement processing is superimposed on the image to be displayed to obtain a target image.

6. The image and text processing method according to claim 5, characterized in that: The performing text enhancement processing on the text image comprises: The grayscale of the characters in the text image is adjusted to be the same as the grayscale of the image to be displayed.

7. The image and text processing method according to claim 6, characterized in that: The grayscale of the characters in the text image after adjustment is the second order.

8. A graphic processing device, characterized in that: include: A text acquisition module is configured to separate the image and text in the original grayscale image to obtain a text image; A processing module, configured to perform halftone processing on the original grayscale image to obtain an image to be displayed; The superimposition module is configured to superimpose the text image onto the image to be displayed to obtain a target image.

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.