CN116188293A - Image processing method, device, apparatus, medium, and program product - Google Patents

Image processing method, device, apparatus, medium, and program product Download PDF

Info

Publication number
CN116188293A
CN116188293A CN202211646150.0A CN202211646150A CN116188293A CN 116188293 A CN116188293 A CN 116188293A CN 202211646150 A CN202211646150 A CN 202211646150A CN 116188293 A CN116188293 A CN 116188293A
Authority
CN
China
Prior art keywords
text
image
pixel
image area
noise
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211646150.0A
Other languages
Chinese (zh)
Other versions
CN116188293B (en
Inventor
陈佃文
邵志明
崔向雨
贺琳
黄宇凯
郝玉峰
李科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Speechocean Technology Co ltd
Original Assignee
Beijing Speechocean Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Speechocean Technology Co ltd filed Critical Beijing Speechocean Technology Co ltd
Priority to CN202211646150.0A priority Critical patent/CN116188293B/en
Publication of CN116188293A publication Critical patent/CN116188293A/en
Application granted granted Critical
Publication of CN116188293B publication Critical patent/CN116188293B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4053Super resolution, i.e. output image resolution higher than sensor resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present disclosure relates to an image processing method, apparatus, device, medium, and program product. The image processing method comprises the following steps: in response to detecting text in a noise image, determining text content, text font and image area of the text; and re-drawing the detected text in the image area where the text is positioned according to the text content and the text font, so as to obtain an enhanced image of the noise image. The display effect of the noise image containing text content can be improved through the display method and the display device.

Description

Image processing method, device, apparatus, medium, and program product
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, device, medium, and program product.
Background
With the development of science and technology, images are known as a common information carrier, and because of the wide application prospect, the images are in various scenes of daily life. Currently, high resolution sharp images generally occupy a large amount of memory, and for convenience of storage and transmission, the images are generally compressed. However, the process of image compression introduces significant noise, especially for digital images with text information as the main content, and significant blurring or jaggies of text edges occur during the compression process.
In the related art, an attempt is made to optimize the display effect of a noise image by an image enhancement algorithm, but since text edge noise has a strong interference. Therefore, processing a noisy image containing text information with an image enhancement algorithm does not result in a high resolution, sharp and jagged image of the font edge.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides an image processing method, apparatus, device, medium, and program product.
According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method including:
in response to detecting text in a noise image, determining text content, text font and image area of the text; and re-drawing the detected text in the image area where the text is positioned according to the text content and the text font, so as to obtain an enhanced image of the noise image.
In one embodiment, redrawing the detected text in the image area where the text is located according to the text content and the text font to obtain an enhanced image of the noise image, including: determining a target drawing material matched with the text content in the drawing materials matched with the text fonts; and re-drawing the detected text in the image area where the text is based on the target drawing material to obtain an enhanced image of the noise image.
In one embodiment, the target drawing material includes a default drawing size for drawing text, and each first pixel coordinate corresponding to each text outline point for forming text under the default drawing size; and re-drawing the detected text in an image area where the text is based on the target drawing material to obtain an enhanced image of the noise image, wherein the enhanced image comprises the following components: determining a first proportional relationship between a first size of an image area where the text is located and the default drawing size; determining second pixel coordinates corresponding to the text contour points in the image area where the text is located according to the first proportional relation; the first proportional relation is satisfied between a first pixel coordinate and a second pixel coordinate corresponding to the same text contour point; and drawing each text outline point in the image area where the text is based on each second pixel coordinate to obtain an enhanced image of the noise image.
In one embodiment, the drawing each text contour point in the image area where the text is based on each second pixel coordinate to obtain an enhanced image of the noise image includes: and respectively drawing each text outline point at each second pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
In one embodiment, before redrawing the detected text, the method further comprises: determining other image areas except the image area where the text is located in the noise image; and performing super-resolution processing on the other image areas.
In one embodiment, the drawing each text contour point in the image area where the text is based on each second pixel coordinate to obtain an enhanced image of the noise image includes: determining a second proportional relation between a second size and a third size, wherein the second size is a size of the other image area before super-resolution processing, and the third size is a size of the other image area after super-resolution processing; according to the second proportional relation, determining each corresponding third pixel coordinate of each text contour point in the image area where the text is located; the second proportional relation is met between the second pixel coordinate and the third pixel coordinate corresponding to the same text outline point; and respectively drawing each text outline point at each third pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
In one embodiment, before performing super resolution processing on the other image area, the method further includes: and carrying out image denoising processing on the other image areas.
In one embodiment, before redrawing the detected text, the method further comprises: taking pixel values of other image areas except the image area of the text in the noise image as references, respectively predicting pixel values of all pixel positions in the image area of the text, and obtaining all predicted pixel values respectively corresponding to all pixel positions; and filling pixel values of the pixel positions in the image area where the text is located according to the predicted pixel values.
In one embodiment, the predicting pixel values of each pixel position in the image area where the text is located with reference to pixel values of other image areas in the noise image except the image area where the text is located, to obtain predicted pixel values corresponding to each pixel position, includes: respectively taking each pixel position in an image area where the text is located as a target pixel position; determining a target pixel column and a target pixel row of the target pixel position in the noise image; taking pixel values corresponding to the pixel positions in the other image areas in the target pixel column as references, and predicting the pixel values of the target pixel positions to obtain predicted first pixel values; and predicting the pixel value of the target pixel position by taking the pixel value corresponding to each pixel position in the other image areas in the target pixel row as a reference, so as to obtain a predicted second pixel value; and carrying out weighting processing on the first pixel value and the second pixel value based on the weighting coefficient of the target pixel position to obtain a predicted pixel value for filling the pixel value of the target pixel position.
In one embodiment, the weighting coefficients are determined as follows: determining a number of rows of spaced pixels between the target pixel location and the other image region, and determining a number of columns of spaced pixels between the target pixel location and the other image region; and taking the duty ratio of the interval pixel row number and the interval pixel column number in the total interval number as a weighting coefficient of the target pixel position, wherein the total interval number is the sum of the interval pixel row number and the interval pixel column number.
According to a second aspect of the embodiments of the present disclosure, there is provided an image processing apparatus including:
a determining unit for determining text content, text font and image area of the text in response to detecting the text in the noise image; and the processing unit is used for redrawing the detected text in the image area where the text is positioned according to the text content and the text font, so as to obtain an enhanced image of the noise image.
In one embodiment, the processing unit redraws the detected text in the image area where the text is located according to the text content and the text font, so as to obtain an enhanced image of the noise image: determining a target drawing material matched with the text content in the drawing materials matched with the text fonts; and re-drawing the detected text in the image area where the text is based on the target drawing material to obtain an enhanced image of the noise image.
In one embodiment, the target drawing material includes a default drawing size for drawing text, and each first pixel coordinate corresponding to each text outline point for forming text under the default drawing size; the processing unit redraws the detected text in the image area where the text is based on the target drawing material in the following manner to obtain an enhanced image of the noise image: determining a first proportional relationship between a first size of an image area where the text is located and the default drawing size; determining second pixel coordinates corresponding to the text contour points in the image area where the text is located according to the first proportional relation; the first proportional relation is satisfied between a first pixel coordinate and a second pixel coordinate corresponding to the same text contour point; and drawing each text outline point in the image area where the text is based on each second pixel coordinate to obtain an enhanced image of the noise image.
In one embodiment, the processing unit draws each text contour point in the image area where the text is based on each second pixel coordinate in the following manner, so as to obtain an enhanced image of the noise image: and respectively drawing each text outline point at each second pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
In one embodiment, the determining unit is further configured to: before redrawing the detected text, determining other image areas except the image area where the text is located in the noise image; the processing unit is further configured to perform super-resolution processing on the other image area.
In one embodiment, the processing unit draws each text contour point in the image area where the text is based on each second pixel coordinate in the following manner, so as to obtain an enhanced image of the noise image: determining a second proportional relation between a second size and a third size, wherein the second size is a size of the other image area before super-resolution processing, and the third size is a size of the other image area after super-resolution processing; according to the second proportional relation, determining each corresponding third pixel coordinate of each text contour point in the image area where the text is located; the second proportional relation is met between the second pixel coordinate and the third pixel coordinate corresponding to the same text outline point; and respectively drawing each text outline point at each third pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
In one embodiment, the processing unit is further configured to: and carrying out image denoising processing on the other image areas before carrying out super-resolution processing on the other image areas.
In one embodiment, the processing unit is further configured to: before redrawing the detected text, respectively predicting pixel values of all pixel positions in the image area where the text is located by taking pixel values of other image areas except the image area where the text is located in the noise image as references, so as to obtain each predicted pixel value respectively corresponding to each pixel position; and filling pixel values of the pixel positions in the image area where the text is located according to the predicted pixel values.
In one embodiment, the processing unit uses pixel values of other image areas except the image area where the text is located in the noise image as a reference, and performs pixel value prediction on each pixel position in the image area where the text is located to obtain predicted pixel values corresponding to each pixel position respectively: respectively taking each pixel position in an image area where the text is located as a target pixel position; determining a target pixel column and a target pixel row of the target pixel position in the noise image; taking pixel values corresponding to the pixel positions in the other image areas in the target pixel column as references, and predicting the pixel values of the target pixel positions to obtain predicted first pixel values; and predicting the pixel value of the target pixel position by taking the pixel value corresponding to each pixel position in the other image areas in the target pixel row as a reference, so as to obtain a predicted second pixel value; and carrying out weighting processing on the first pixel value and the second pixel value based on the weighting coefficient of the target pixel position to obtain a predicted pixel value for filling the pixel value of the target pixel position.
In one embodiment, the processing unit determines the weighting coefficients in the following manner: determining a number of rows of spaced pixels between the target pixel location and the other image region, and determining a number of columns of spaced pixels between the target pixel location and the other image region; and taking the duty ratio of the interval pixel row number and the interval pixel column number in the total interval number as a weighting coefficient of the target pixel position, wherein the total interval number is the sum of the interval pixel row number and the interval pixel column number.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including:
a processor; a memory for storing processor-executable instructions;
wherein the processor is configured to: the image processing method of the first aspect or any implementation manner of the first aspect is performed.
According to a fourth aspect of the disclosed embodiments, there is provided a storage medium having stored therein instructions which, when executed by a processor, enable the processor to perform the image processing method of the first aspect or any one of the embodiments of the first aspect.
According to a fifth aspect of the disclosed embodiments, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the image processing method of the first aspect or any implementation manner of the first aspect.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects: according to the method and the device, under the condition that the text exists in the noise image, the text content, the text font and the image area where the text is located are determined, and then the detected text is redrawn in the image area where the text is located according to the text content and the text font, so that an enhanced image of the noise image is obtained. Noise pixels in the original noise image will not be present because of the region in which the new text is redrawn. Therefore, compared with the original noise image, the text in the processed enhanced image is displayed more accurately, and the edges of the fonts are clearer.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic diagram exemplarily showing a noise image.
Fig. 2 is a schematic diagram showing the effect of denoising a noise image by an image enhancement algorithm in the related art.
Fig. 3 is a flowchart illustrating an image processing method according to an exemplary embodiment.
Fig. 4 is a schematic diagram illustrating a determination of an image area in which text is located in a noisy image according to an example embodiment.
FIG. 5 is a flowchart illustrating a method of redrawing text in an image area where the text is located, according to an example embodiment.
FIG. 6 is a flowchart illustrating a method of redrawing detected text in an image area where the text is located based on target rendered material, according to an example embodiment.
FIG. 7 is a flowchart illustrating another method of redrawing detected text in an image area where the text is located based on target drawing material, according to an example embodiment.
Fig. 8 is a flowchart illustrating a method of super-resolution processing of a noise image according to an exemplary embodiment.
Fig. 9 is a flowchart illustrating a method of text redrawing based on super resolution processing of other image areas, according to an example embodiment.
Fig. 10 is a flowchart illustrating a method for text redrawing based on denoising and super resolution processing of other image regions, according to an example embodiment.
FIG. 11 is a flowchart illustrating a method for text redrawing based on pixel value padding, according to an example embodiment.
FIG. 12 is a flowchart illustrating a method of predicting pixel values for an image region in which text is located, according to an exemplary embodiment.
Fig. 13 is a flowchart illustrating a method of determining a weighting coefficient system according to an exemplary embodiment.
Fig. 14 is a schematic diagram showing an enhanced image obtained by the image processing method provided by the present disclosure according to an exemplary embodiment.
Fig. 15 is a block diagram of an image processing apparatus according to an exemplary embodiment.
Fig. 16 is a block diagram of an electronic device for image processing, according to an example embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure.
In the drawings, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The described embodiments are some, but not all, embodiments of the present disclosure. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present disclosure and are not to be construed as limiting the present disclosure. Based on the embodiments in this disclosure, all other embodiments that a person of ordinary skill in the art would obtain without making any inventive effort are within the scope of protection of this disclosure. Embodiments of the present disclosure are described in detail below with reference to the attached drawings.
With the development of science and technology, images are known as a common information carrier, and because of the wide application prospect, the images are in various scenes of daily life. Currently, high resolution sharp images generally occupy a large amount of memory, and for convenience of storage and transmission, the images are generally compressed. However, the process of image compression introduces significant noise, especially for digital images with text information as the main content, and significant blurring or jaggies of text edges occur during the compression process.
In the related art, an attempt is made to optimize the display effect of a noise image by an image enhancement algorithm (e.g., a denoising algorithm, a super resolution algorithm, or an algorithm combining the two, such as waipu 2 x). Fig. 1 is a schematic diagram exemplarily showing a noise image. Fig. 2 is a schematic diagram showing the effect of denoising a noise image by an image enhancement algorithm in the related art. As shown in fig. 1 and 2, the noise image is denoised by the image enhancement algorithm in the related art, and although the number of noise points in the noise image can be reduced, the pixel value of the noise is close to the pixel value of the text itself, so that the noise at the edge of the text has strong interference. Therefore, the existing image enhancement algorithm cannot effectively distinguish the text region from the noise region in the noise image, and cannot remove the text edge noise and retain the edge gradient information of the text at the same time so as to obtain an image with high resolution, clear font edge and no saw tooth.
In view of this, the present disclosure provides an image processing method, which can perform text recognition in a noise image, and redraw a new text consistent with text content and text font between original texts in an image area where the text is located. The method draws the same text content with the same font at the same position of the noise image, can improve the display effect of a text region in the noise image while ensuring that the display content of the noise image is not changed, and further realizes the image enhancement of the noise image containing the text content.
Fig. 3 is a flowchart of an image processing method according to an exemplary embodiment, as shown in fig. 3, including the following steps S11 and S12.
In step S11, in response to detecting text in the noise image, text content, text font, and image area in which the text is located are determined.
By way of example, the detected text may be one or a combination of words, numbers and symbols.
In step S12, the detected text is redrawn in the image area where the text is located according to the text content and the text font, and an enhanced image of the noise image is obtained.
In the embodiment of the disclosure, under the condition that at least one text is detected, text content, text font and an image area where the text is located can be respectively determined for each text in the at least one text, and then each text in the at least one text is drawn one by one. Wherein, noise pixels in the original noise image are not present because of the region in which the redrawn new text is located. Therefore, compared with the original noise image, the text in the processed enhanced image is displayed more accurately, and the edges of the fonts are clearer.
For example, the image area where the text is located may be determined by, for example, selecting a circumscribed rectangular box capable of containing the complete text from the noise image, and recording related data capable of identifying the circumscribed rectangular box. The recording of the related data that can perform the marking function on the external rectangular frame may be, for example, recording a corner coordinate of the external rectangular frame (for example, an upper left corner coordinate of the external rectangular frame), and recording a length and a width of the external rectangular frame. Of course, the coordinates of four corner points of the circumscribed rectangular frame may be recorded at the same time, or recorded in other manners, and the identification manner of the circumscribed rectangular frame is not specifically limited in the present disclosure. In addition, for ease of understanding, an implementation process of determining text content, text font, and image area where text is located is described below with reference to fig. 4.
For example, circumscribed rectangular boxes of letters and symbols may be respectively circled in the noise image. For example, as shown in fig. 4, by circling the respective letters and symbols, a plurality of different circumscribed rectangular boxes identified by A1 to C12 (as shown by the respective dashed boxes in fig. 4) can be obtained. On the basis, text font detection and text content detection can be respectively carried out on the text in each circumscribed rectangular box, so that text content, text fonts and image areas where the text is located, which correspond to the texts in the noise image, are obtained. For example, for text "D" in the noise image, the obtained information may include the upper left corner coordinates of the circumscribed rectangular box A1, the size of the circumscribed rectangular box A1, the text content in the circumscribed rectangular box is "D", and the text font is "Calibri".
In the above embodiment, text content detection, text font detection, and text-in-image region detection can be performed by using a detection model. The detection model may be a pre-trained dedicated model or an open source model, which is not particularly limited in this disclosure.
As a possible implementation, the drawing materials for text drawing may be configured for different fonts, respectively, to redraw the detected text through the preconfigured drawing materials when the presence of the text in the noise image is detected.
Fig. 5 is a flowchart illustrating a method of redrawing text in an image area where the text is located, according to an example embodiment, as shown in fig. 5, including the following steps.
In step S21, among the drawing materials matching the text font, a target drawing material matching the text content is determined.
By way of example, the text fonts referred to in this disclosure may be generic text fonts, or custom text fonts obtained by designing drawn material.
In step S22, the detected text is redrawn in the image area where the text is located based on the target drawing material, resulting in an enhanced image of the noise image.
According to the image processing method provided by the embodiment of the disclosure, the target drawing material matched with the text content can be determined in the drawing materials matched with the text font, and then the detected text is redrawn according to the target drawing material.
For example, the text font may be "Times New Roman", and the drawing material matching the text font may be different drawing materials corresponding to different text contents written in accordance with the "Times New Roman" font, respectively. For example, taking 26 english alphabets as an example, 26 drawing materials obtained by writing 26 english alphabets in the font "Times New Roman" may be used. Of course, the division into 52 drawing materials may be further divided according to the case of english letters, or the division into a larger number of drawing materials may be further performed in other manners, which are merely exemplary illustrations of the drawing materials, and the practical scheme is not limited thereto.
On this basis, the target rendering material may be understood as the rendering material used to render the detected text content, among all rendering materials of the same text font. For example, taking the drawing material of the "Times New Roman" font as an example, if the noise image as shown in fig. 1 is to be subjected to text redrawing, the drawing materials corresponding to "D", "o", "n", "'," e ", and" r "respectively are the target drawing materials among the drawing materials of the" Times New Roman "font.
For example, in order to enable the redrawn text to achieve an effect that coincides with the original text, the drawing size may be adjusted accordingly as the text is redrawn. In this regard, in one embodiment, a default drawing size may be configured for the drawing material. For example, the drawing material includes a default drawing size for drawing text, and respective pixel coordinates at which respective text outline points constituting the text respectively correspond at the default drawing size.
For convenience of description, each pixel coordinate corresponding to each text outline point for forming a text under a default drawing size is referred to as a first pixel coordinate, a size of an image area where the text is located is referred to as a first size, a proportional relationship between the first size and the default drawing size is referred to as a first proportional relationship, and a pixel coordinate corresponding to the text outline point in the image area where the text is located is referred to as a second pixel coordinate.
Fig. 6 is a flowchart illustrating a method of redrawing detected text in an image area where the text is located based on target drawing material, as shown in fig. 6, according to an exemplary embodiment, including the following steps.
In step S31, a first proportional relationship between a first size of an image area where the text is located and a default drawing size is determined.
In step S32, according to the first proportional relation, the coordinates of each second pixel corresponding to each text contour point in the image area where the text is located are determined.
The first ratio relation is satisfied between the first pixel coordinate and the second pixel coordinate corresponding to the same text contour point.
In step S33, each text contour point is drawn in the image area where the text is located based on each second pixel coordinate, resulting in an enhanced image of the noise image.
In one possible implementation manner, each text contour point may be directly drawn at each second pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
Fig. 7 is a flowchart of another method for redrawing detected text in an image area where the text is located, based on target drawing material, as shown in fig. 7, according to an example embodiment, including the following steps.
In step S41, a first proportional relationship between a first size of an image area where the text is located and a default drawing size is determined.
In step S42, according to the first proportional relation, respective second pixel coordinates corresponding to the respective text contour points in the image area where the text is located are determined.
In step S43, each text contour point is drawn at each second pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
In addition, other image areas than the image area where the text of the noise image is located are considered to be free from the interference of the text content. Thus, as a possible implementation, super-resolution processing may be performed on other image areas in the noise image than the image area in which the text is located, before redrawing the detected text.
Fig. 8 is a flowchart illustrating a method of super-resolution processing of a noise image according to an exemplary embodiment, as shown in fig. 8, including the following steps.
In step S51, other image areas than the image area where the text is located in the noise image are determined.
In step S52, super resolution processing is performed on the other image area.
According to the method provided by the embodiment of the disclosure, the display effect of other image areas is further optimized by performing super-resolution processing on the other image areas except the image area where the text is located in the noise image. On the basis, for the enhanced image of the noise image, the display effect of the image area where the characters are located and other image areas except the image area where the characters are located is improved, and the overall image effect is further enhanced.
For example, on the basis of performing super-resolution processing on other image areas, the drawing size can be further adjusted according to the size difference before and after the super-resolution processing in the process of re-drawing the text. For convenience of description, the size of the other image region before super-resolution processing is referred to as a second size, the size of the other image region after super-resolution processing is referred to as a third size, the proportional relationship between the second size and the third size is referred to as a second proportional relationship, and the pixel coordinates satisfying the second proportional relationship with the second pixel coordinates are referred to as third pixel coordinates.
Fig. 9 is a flowchart illustrating a method of text redrawing based on super resolution processing of other image areas, as shown in fig. 9, according to an example embodiment, including the following steps.
In step S61, other image areas than the image area where the text is located in the noise image are determined.
In step S62, super resolution processing is performed on other image areas.
In step S63, a first scale relationship between a first size of an image area where the text is located and a default drawing size is determined, and according to the first scale relationship, respective second pixel coordinates corresponding to respective text contour points in the image area where the text is located are determined.
The execution sequence among step S61, step S62 and step S63 can be adjusted. For example, step S63 may be performed first, then step S61 and step S62 may be performed, or step S61 and step S61 (or S62) may be performed simultaneously.
In step S64, a second proportional relationship between the second size and the third size is determined, and according to the second proportional relationship, respective third pixel coordinates corresponding to each text contour point in the image area where the text is located are determined.
In step S65, each text contour point is drawn at each third pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
Further, similar to the super resolution processing, other image areas of the noise image may also be subjected to denoising processing. For example, the image denoising process may be performed on the other image region before the super-resolution process is performed on the other image region.
Fig. 10 is a flowchart illustrating a method for text redrawing based on denoising and super resolution processing of other image areas, as shown in fig. 10, according to an exemplary embodiment, including the following steps S71 to S75.
In step S71, other image areas than the image area where the text is located in the noise image are determined.
In step S72, image denoising processing and super-resolution processing are sequentially performed on the other image areas.
Of course, the super resolution processing may be performed first, and then the image denoising processing may be performed. On the basis, the image denoising processing is performed first, then the super-resolution processing is performed, so that the interference of noise pixels on the super-resolution processing can be reduced, and the method can be regarded as a preferable scheme for performing enhancement processing on other image areas.
In step S73, a first scale relationship between a first size of an image area where the text is located and a default drawing size is determined, and according to the first scale relationship, respective second pixel coordinates corresponding to respective text contour points in the image area where the text is located are determined.
The execution sequence among step S71, step S72 and step S73 can be adjusted. For example, step S73 may be performed first, then step S71 and step S72 may be performed, or step S71 and step S71 (or S72) may be performed simultaneously.
In step S74, a second proportional relationship between the second size and the third size is determined, and according to the second proportional relationship, respective third pixel coordinates corresponding to each text outline point in the image area where the text is located are determined.
In step S75, each text contour point is drawn at each third pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
For example, in the above embodiment, the area targeted by the denoising process and the super-resolution process may be determined by a pre-marking manner. For example, in the case where the image area where the text in the noise image is located is previously determined, each pixel point in the image area where the text is located may be marked as "0", and each pixel point in the other image areas may be marked as "1". On the basis, the denoising operator or the super-resolution operator is multiplied by the marking value of the pixel point respectively, so that the effect of denoising or super-resolution processing is achieved only for other image areas. For example, taking a denoising operator as an example, when the denoising operator is multiplied by the flag value "1", the result is a denoising operator, and at this time, the pixel point performs denoising processing based on the denoising operator. Correspondingly, when the denoising operator is multiplied by the mark value of 0, the result is 0, and the pixel point is ignored.
In the above embodiment, the denoising method may be a conventional super-resolution processing method, for example, may be a conventional image magnification method (such as a linear interpolation method). Of course, the super-resolution depth network model may be a trained super-resolution depth network model, and the specific manner adopted by the super-resolution processing is not limited in the disclosure. Accordingly, the method used in the denoising process may be an existing mature denoising method, and may be, for example, a conventional denoising filter (such as a gaussian filter and a median filter). Of course, the model may also be a trained deep denoising network model, and the specific mode adopted by the denoising process is not limited in this disclosure.
For example, in order to avoid interference of original pixel points in an image area where a text is located on an enhanced image of a noise image, the noise image is considered to be divided into two parts of the image area where the text is located and other image areas, so that a new image area obtained by redrawing the text and the other image areas are spliced, and the enhanced image is finally obtained.
However, if a method of splitting first and then stitching is adopted, there may be empty pixels in the stitched enhanced image (for example, the empty pixels refer to pixels that do not belong to a new image area drawn, or belong to other image areas in the original noise image). In view of this, the present disclosure contemplates pixel filling of the image region where the text is located, and text redrawing of the pixel filled region.
As a possible implementation manner, before redrawing the detected text, pixel value predictions may be performed on each pixel position in the image area where the text is located, with reference to pixel values of other image areas in the noise image than the image area where the text is located, so as to obtain each predicted pixel value corresponding to each pixel position. On this basis, pixel value filling can be performed for each pixel position in the image area where the text is located according to each predicted pixel value.
Fig. 11 is a flowchart illustrating a method for text redrawing based on pixel value padding, as shown in fig. 11, according to an example embodiment, including the following steps.
In step S81, in response to detecting text in the noise image, text content, text font, and image area in which the text is located are determined.
In step S82, pixel value prediction is performed on each pixel position in the image area where the text is located, with reference to pixel values of other image areas in the noise image than the image area where the text is located, to obtain each predicted pixel value corresponding to each pixel position.
In step S83, pixel value filling is performed for each pixel position in the image area where the text is located, according to each predicted pixel value.
In step S84, the detected text is redrawn in the image area where the text is located according to the text content and the text font, resulting in an enhanced image of the noise image.
By the method provided by the embodiment of the disclosure, the pixel values of other image areas in the noise image can be referred to for filling the pixels of the image area where the text is located, and the method is equivalent to providing canvas matched with the pixel distribution of the original noise image for the text redrawing process. On the basis, the text redrawing is further carried out in the image area where the text filled with the pixel values is located, so that the visual effect of the enhanced image can be ensured while the existence of empty pixel points in the enhanced image is reduced.
For example, the pixel value prediction may be performed on the image region where the text is located in the following manner. For convenience of description, a pixel value obtained by predicting a pixel value of a target pixel position with reference to a pixel row is referred to as a first pixel value, and a pixel value obtained by predicting a pixel value of a target pixel position with reference to a pixel column is referred to as a second pixel value.
Fig. 12 is a flowchart illustrating a method of predicting pixel values for an image region in which text is located, according to an exemplary embodiment, as shown in fig. 12, including the following steps.
In step S91, each pixel position in the image area where the text is located is taken as a target pixel position.
In step S92, a target pixel column and a target pixel row in which the target pixel position is located in the noise image are determined.
In step S93, the pixel value of each pixel position in the other image area in the target pixel column is used as a reference, the pixel value of the target pixel position is predicted to obtain a predicted first pixel value, and the pixel value of each pixel position in the other image area in the target pixel row is used as a reference, the pixel value of the target pixel position is predicted to obtain a predicted second pixel value.
In step S94, the first pixel value and the second pixel value are weighted based on the weighting coefficient of the target pixel position, and a predicted pixel value for filling the target pixel position with the pixel value is obtained.
According to the method provided by the embodiment of the disclosure, for any pixel position in an image area where a text is located, pixel prediction is performed on a pixel row and a pixel column where the pixel position is located, and further two predicted pixel values are weighted, so that joint consideration of the pixel row where the pixel is located in the pixel value prediction process is realized, and further the predicted pixel value is more attached to an actual pixel value.
The pixel value prediction for the target pixel location may be implemented, for example, by a preconfigured prediction network. Among other things, the predictive network may employ a generate antagonism network (Generative Adversarial Networks, GAN) or a Diffusion Model (Diffusion Model).
Wherein the weighting coefficients may be determined as follows.
Fig. 13 is a flowchart of a method of determining a weighting coefficient system, as shown in fig. 13, according to an exemplary embodiment, including the following steps.
In step S101, the number of lines of spaced pixels between the target pixel position and the other image area is determined, and the number of columns of spaced pixels between the target pixel position and the other image area is determined.
In step S102, the ratio of the number of rows of the interval pixels and the number of columns of the interval pixels to the total number of intervals is used as a weighting factor for the target pixel position.
The total interval number is the sum of the number of interval pixel rows and the number of interval pixel columns.
For example, the number of lines of spaced pixels between the target pixel location and other image areas may be determined as follows. For example, if the target pixel position is in the pixel row q, and another pixel position that is closest to the target pixel position in the vertical direction and belongs to another image area is in the pixel row p, the number of pixels spaced between the pixel row q and the pixel row p is the number of spaced pixels. In addition, the manner of determining the number of the interval pixel columns is similar to the manner of determining the number of the interval pixel rows, which is not described herein.
For ease of understanding, the following example illustrates an implementation flow of an enhanced image that results in a noisy image.
For example, a text region in an image is first detected, the upper left corner coordinates of the circumscribed rectangular box and the rectangular box size of each character are obtained, and the content of the text and the font of the text are simultaneously recognized. For example, the set of contour point coordinates used to construct any text at the default rendering size may be represented by con0= [ (xi, yi) ], i=1, 2,3 … n. Where con0 represents a set of contour point coordinates of any text, (xi, yi) represents a first pixel coordinate of an ith contour point at a default drawing size, and n represents the number of contour points used to draw the text.
For example, if the default rendering size is (w 0, h 0) and the first size is (w 1, h 1), the first scale relationship may be expressed as (w 1/w0, h1/h 0). On this basis, the contour point coordinate set con1 = [ (xi x w1/w0, yi x h1/h 0) ] of any text at the first size, i=1, 2,3 … n may be determined according to the first proportional relation (w 1/w0, h1/h 0), and the contour point coordinate set con0 = [ (xi, yi) ], i=1, 2,3 … n of any text, where con1 represents the contour point coordinate set of any text, (xi, yi) represents the second pixel coordinate of the ith contour point at the default drawing size, and n represents the number of contour points used for drawing the text.
For example, the condition of the image region in which the text in the noise image is located can be determined in advanceIn this case, each pixel point in the image area where the text is located is marked with "0", and each pixel point in the other image areas is marked with "1". On the basis, the denoising operator or the super-resolution operator is multiplied by the marking value of the pixel point respectively, so that the effect of denoising or super-resolution processing is achieved only for other image areas. For example, for a denoising process flow, the denoising operator is F, the actual denoising operator at any position in the noisy image (illustrated as
Figure DEST_PATH_IMAGE002
Representation) can pass->
Figure DEST_PATH_IMAGE004
And (5) determining. The mask represents a pixel point mark value, which is consistent with the pixel point mark, and takes a value of 1 or 0. On the basis, if the noise image is I, the denoised image can be expressed as +.>
Figure DEST_PATH_IMAGE006
. Further, the denoised image may be +.>
Figure DEST_PATH_IMAGE008
And performing super-resolution processing. For example, if the super-resolution operator is C, the actual denoising operator for any position in the image (illustrated in +.>
Figure DEST_PATH_IMAGE010
Indicated) is:
Figure DEST_PATH_IMAGE012
. Correspondingly, the super-resolution processed image can be further represented as +.>
Figure DEST_PATH_IMAGE014
On the basis, pixel value filling can be further performed through pixel point marking. For example, by super-resolution operators
Figure 204769DEST_PATH_IMAGE010
And pixel mark value to obtain an image +.>
Figure DEST_PATH_IMAGE016
The image area where the midtext is located (i.e.)>
Figure DEST_PATH_IMAGE018
0) and further, for a first pixel value predicted by a pixel row where the target pixel position is located, the weighting coefficient (k) may be determined by
Figure DEST_PATH_IMAGE020
And (3) representing. Wherein d j Representing the number of lines of pixels spaced between the target pixel location and other image areas, d i Representing the number of columns of spaced pixels between the target pixel location and other image areas. Correspondingly, for the second pixel value predicted by the pixel row where the target pixel position is located, the weighting coefficient (k) thereof can be determined by +. >
Figure DEST_PATH_IMAGE022
And (3) representing.
On this basis, further adjustments can be made to the set of contour point coordinates of the text according to the dimensional scaling relationship before and after the super-resolution processing (i.e., the second scaling relationship referred to above). For example, if the second scaling relationship is m, the contour point coordinate set con2 = [ (xi x w1/w0 x m, yi x h1/h0 x m) ] of the text under the to-be-drawn size, i=1, 2,3 … n. On this basis, contour points can be respectively drawn in the image area where the text is located through the contour point coordinate set con2, and further, the text redrawing is completed, and the enhanced image shown in fig. 14 is obtained. As can be seen from comparing fig. 1, fig. 2 and fig. 14, by the image processing method provided by the present disclosure, an enhanced image with a better display effect in both the image area where the text is located and other image areas can be obtained.
Based on the same conception, the embodiment of the disclosure also provides an image processing device.
It will be appreciated that, in order to implement the above-described functions, the image processing apparatus provided in the embodiments of the present disclosure includes corresponding hardware structures and/or software modules that perform the respective functions. The disclosed embodiments may be implemented in hardware or a combination of hardware and computer software, in combination with the various example elements and algorithm steps disclosed in the embodiments of the disclosure. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application, but such implementation is not to be considered as beyond the scope of the embodiments of the present disclosure.
Fig. 15 is a block diagram of an image processing apparatus according to an exemplary embodiment. Referring to fig. 15, the apparatus 200 includes a determination unit 201 and a processing unit 202.
The determining unit 201 determines text content, text font, and image area where the text is located in response to detecting the text in the noise image. The processing unit 202 is configured to redraw the detected text in an image area where the text is located according to the text content and the text font, so as to obtain an enhanced image of the noise image.
In one embodiment, the processing unit 202 redraws the detected text in the image area where the text is located according to the text content and the text font, to obtain an enhanced image of the noise image: and determining target drawing materials matched with the text content in the drawing materials matched with the text fonts. And re-drawing the detected text in an image area where the text is based on the target drawing material to obtain an enhanced image of the noise image.
In one embodiment, the target drawing material includes a default drawing size for drawing the text, and respective first pixel coordinates for respective text outline points constituting the text corresponding to the default drawing size. The processing unit 202 redraws the detected text in the image area where the text is located based on the target drawing material in the following manner, resulting in an enhanced image of the noise image: a first proportional relationship is determined between a first size of an image region in which text is located and a default rendering size. And determining the corresponding second pixel coordinates of each text contour point in the image area where the text is located according to the first proportional relation. The first ratio relation is satisfied between the first pixel coordinate and the second pixel coordinate corresponding to the same text contour point. And drawing each text outline point in the image area where the text is based on each second pixel coordinate to obtain an enhanced image of the noise image.
In one embodiment, the processing unit 202 draws each text contour point in the image area where the text is located based on each second pixel coordinate in the following manner, to obtain an enhanced image of the noise image: and drawing each text contour point at each second pixel coordinate in the image region where the text is located, and obtaining an enhanced image of the noise image.
In one embodiment, the determining unit 201 is further configured to: before redrawing the detected text, other image areas in the noise image than the image area in which the text is located are determined. The processing unit 202 is further configured to perform super-resolution processing on other image areas.
In one embodiment, the processing unit 202 draws each text contour point in the image area where the text is located based on each second pixel coordinate in the following manner, to obtain an enhanced image of the noise image: and determining a second proportional relation between a second size and a third size, wherein the second size is the size of the other image area before super-resolution processing, and the third size is the size of the other image area after super-resolution processing. And according to the second proportional relation, determining the corresponding third pixel coordinates of each text contour point in the image area where the text is located. The second proportional relation is satisfied between the second pixel coordinate and the third pixel coordinate corresponding to the same text contour point. And drawing each text contour point at each third pixel coordinate in the image region where the text is located, and obtaining an enhanced image of the noise image.
In one embodiment, the processing unit 202 is further configured to: image denoising is performed on the other image region before super-resolution processing is performed on the other image region.
In one embodiment, the processing unit 202 is further configured to: before redrawing the detected text, respectively predicting pixel values of all pixel positions in the image area where the text is located by taking the pixel values of other image areas except the image area where the text is located in the noise image as references, so as to obtain each predicted pixel value respectively corresponding to each pixel position. And filling pixel values for each pixel position in the image area where the text is located according to each predicted pixel value.
In one embodiment, the processing unit 202 performs pixel value prediction on each pixel position in the image area where the text is located by using the pixel values of other image areas in the noise image than the image area where the text is located as a reference, to obtain predicted pixel values corresponding to each pixel position, respectively: and respectively taking each pixel position in the image area where the text is located as a target pixel position. And determining a target pixel column and a target pixel row of the target pixel position in the noise image. And carrying out pixel value prediction on the target pixel position by taking the pixel value corresponding to each pixel position in other image areas in the target pixel column as a reference to obtain a predicted first pixel value. And predicting the pixel value of the target pixel position by taking the pixel value corresponding to each pixel position in other image areas in the target pixel row as a reference, so as to obtain a predicted second pixel value. And weighting the first pixel value and the second pixel value based on the weighting coefficient of the target pixel position to obtain a predicted pixel value for filling the pixel value of the target pixel position.
In one embodiment, the processing unit 202 determines the weighting coefficients as follows: determining a number of lines of spaced pixels between the target pixel location and the other image area, and determining a number of columns of spaced pixels between the target pixel location and the other image area. Taking the duty ratio of the number of the interval pixel rows and the number of the interval pixel columns in the total interval number as a weighting coefficient of the target pixel position, wherein the total interval number is the sum of the number of the interval pixel rows and the number of the interval pixel columns.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 16 is a block diagram of an electronic device 300 for image processing, according to an example embodiment.
As shown in fig. 16, one embodiment of the present disclosure provides an electronic device 300. The electronic device 300 comprises, among other things, a memory 301, a processor 302, and an Input/Output (I/O) interface 303. Wherein the memory 301 is used for storing instructions. A processor 302 for invoking instructions stored in memory 301 to perform the image processing method of the embodiments of the present disclosure. Wherein the processor 302 is coupled to the memory 301, the I/O interface 303, respectively, such as via a bus system and/or other form of connection mechanism (not shown). The memory 301 may be used to store programs and data, including programs of the image processing methods involved in the embodiments of the present disclosure, and the processor 302 performs various functional applications of the electronic device 300 and data processing by running the programs stored in the memory 301.
The processor 302 in the disclosed embodiments may be implemented in hardware in at least one of a digital signal processor (Digital Signal Processing, DSP), field programmable gate array (Field Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA), the processor 302 may be one or a combination of several of a central processing unit (Central Processing Unit, CPU) or other forms of processing units having data processing and/or instruction execution capabilities.
The memory 301 in embodiments of the present disclosure may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random access memory (Random Access Memory, RAM) and/or cache memory (cache), etc. The nonvolatile Memory may include, for example, a Read Only Memory (ROM), a Flash Memory (Flash Memory), a Hard Disk (HDD), a solid state Disk (Solid State Drive, SSD), or the like.
In the embodiment of the present disclosure, the I/O interface 303 may be used to receive an input instruction (e.g., numeric or character information, and generate key signal input related to user setting and function control of the electronic device 300, etc.), and may also output various information (e.g., image or sound, etc.) to the outside. The I/O interface 303 in embodiments of the present disclosure may include one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a mouse, a joystick, a trackball, a microphone, a speaker, a touch panel, and the like.
In some embodiments, the present disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, perform any of the methods described above.
In some embodiments, the present disclosure provides a computer program product comprising a computer program that, when executed by a processor, performs any of the methods described above.
Although operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous.
The methods and apparatus of the present disclosure can be implemented using standard programming techniques with various method steps being performed using rule-based logic or other logic. It should also be noted that the words "apparatus" and "module" as used herein and in the claims are intended to include implementations using one or more lines of software code and/or hardware implementations and/or equipment for receiving inputs.
Any of the steps, operations, or procedures described herein may be performed or implemented using one or more hardware or software modules alone or in combination with other devices. In one embodiment, the software modules are implemented using a computer program product comprising a computer readable medium containing computer program code capable of being executed by a computer processor for performing any or all of the described steps, operations, or programs.
The foregoing description of implementations of the present disclosure has been presented for purposes of illustration and description. The foregoing description is not intended to be exhaustive or to limit the disclosure to the precise form disclosed, and modifications and variations are possible in light of the above teachings or may be acquired from practice of the disclosure. The embodiments were chosen and described in order to explain the principles of the present disclosure and its practical application to enable one skilled in the art to utilize the present disclosure in various embodiments and with various modifications as are suited to the particular use contemplated.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
It is understood that the term "plurality" in this disclosure means two or more, and other adjectives are similar thereto. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. The singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It is further understood that the terms "first," "second," and the like are used to describe various information, but such information should not be limited to these terms. These terms are only used to distinguish one type of information from another and do not denote a particular order or importance. Indeed, the expressions "first", "second", etc. may be used entirely interchangeably. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure.
It will be further understood that "connected" includes both direct connection where no other member is present and indirect connection where other element is present, unless specifically stated otherwise.
It will be further understood that although operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the scope of the appended claims.

Claims (23)

1. An image processing method, characterized in that the image processing method comprises:
in response to detecting text in a noise image, determining text content, text font and image area of the text;
and re-drawing the detected text in the image area where the text is positioned according to the text content and the text font, so as to obtain an enhanced image of the noise image.
2. The image processing method according to claim 1, wherein redrawing the detected text in an image area where the text is located according to the text content and the text font to obtain an enhanced image of the noise image, includes:
determining a target drawing material matched with the text content in the drawing materials matched with the text fonts;
and re-drawing the detected text in the image area where the text is based on the target drawing material to obtain an enhanced image of the noise image.
3. The image processing method according to claim 2, wherein the target drawing material includes a default drawing size for drawing text, and respective first pixel coordinates at which respective text outline points constituting text correspond respectively;
And re-drawing the detected text in an image area where the text is based on the target drawing material to obtain an enhanced image of the noise image, wherein the enhanced image comprises the following components:
determining a first proportional relationship between a first size of an image area where the text is located and the default drawing size;
determining second pixel coordinates corresponding to the text contour points in the image area where the text is located according to the first proportional relation; the first proportional relation is satisfied between a first pixel coordinate and a second pixel coordinate corresponding to the same text contour point;
and drawing each text outline point in the image area where the text is based on each second pixel coordinate to obtain an enhanced image of the noise image.
4. The image processing method according to claim 3, wherein said drawing each text contour point in the image area where the text is located based on each of the second pixel coordinates to obtain an enhanced image of the noise image includes:
and respectively drawing each text outline point at each second pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
5. The image processing method according to claim 3, wherein before redrawing the detected text, the method further comprises:
determining other image areas except the image area where the text is located in the noise image;
and performing super-resolution processing on the other image areas.
6. The image processing method according to claim 5, wherein the drawing each text contour point in the image area where the text is located based on each of the second pixel coordinates, to obtain the enhanced image of the noise image, comprises:
determining a second proportional relation between a second size and a third size, wherein the second size is a size of the other image area before super-resolution processing, and the third size is a size of the other image area after super-resolution processing;
according to the second proportional relation, determining each corresponding third pixel coordinate of each text contour point in the image area where the text is located; the second proportional relation is met between the second pixel coordinate and the third pixel coordinate corresponding to the same text outline point;
and respectively drawing each text outline point at each third pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
7. The image processing method according to claim 5, wherein before performing super-resolution processing on the other image region, the method further comprises:
and carrying out image denoising processing on the other image areas.
8. The image processing method according to any one of claims 1 to 7, characterized in that before redrawing the detected text, the method further comprises:
taking pixel values of other image areas except the image area of the text in the noise image as references, respectively predicting pixel values of all pixel positions in the image area of the text, and obtaining all predicted pixel values respectively corresponding to all pixel positions;
and filling pixel values of the pixel positions in the image area where the text is located according to the predicted pixel values.
9. The image processing method according to claim 8, wherein the predicting pixel values of each pixel position in the image area where the text is located with reference to pixel values of other image areas in the noise image than the image area where the text is located, respectively, to obtain predicted pixel values respectively corresponding to each pixel position, includes:
Respectively taking each pixel position in an image area where the text is located as a target pixel position;
determining a target pixel column and a target pixel row of the target pixel position in the noise image;
taking pixel values corresponding to the pixel positions in the other image areas in the target pixel column as references, and predicting the pixel values of the target pixel positions to obtain predicted first pixel values; and predicting the pixel value of the target pixel position by taking the pixel value corresponding to each pixel position in the other image areas in the target pixel row as a reference, so as to obtain a predicted second pixel value;
and carrying out weighting processing on the first pixel value and the second pixel value based on the weighting coefficient of the target pixel position to obtain a predicted pixel value for filling the pixel value of the target pixel position.
10. The image processing method according to claim 9, wherein the weighting coefficients are determined by:
determining a number of rows of spaced pixels between the target pixel location and the other image region, and determining a number of columns of spaced pixels between the target pixel location and the other image region;
And taking the duty ratio of the interval pixel row number and the interval pixel column number in the total interval number as a weighting coefficient of the target pixel position, wherein the total interval number is the sum of the interval pixel row number and the interval pixel column number.
11. An image processing apparatus, characterized in that the image processing apparatus comprises:
a determining unit for determining text content, text font and image area of the text in response to detecting the text in the noise image;
and the processing unit is used for redrawing the detected text in the image area where the text is positioned according to the text content and the text font, so as to obtain an enhanced image of the noise image.
12. The image processing apparatus according to claim 11, wherein the processing unit redraws the detected text in an image area where the text is located, in accordance with the text content and the text font, to obtain an enhanced image of the noise image, by:
determining a target drawing material matched with the text content in the drawing materials matched with the text fonts;
and re-drawing the detected text in the image area where the text is based on the target drawing material to obtain an enhanced image of the noise image.
13. The image processing apparatus according to claim 12, wherein the target drawing material includes a default drawing size for drawing text, and respective first pixel coordinates at which respective text outline points constituting text correspond respectively;
the processing unit redraws the detected text in the image area where the text is based on the target drawing material in the following manner to obtain an enhanced image of the noise image:
determining a first proportional relationship between a first size of an image area where the text is located and the default drawing size;
determining second pixel coordinates corresponding to the text contour points in the image area where the text is located according to the first proportional relation; the first proportional relation is satisfied between a first pixel coordinate and a second pixel coordinate corresponding to the same text contour point;
and drawing each text outline point in the image area where the text is based on each second pixel coordinate to obtain an enhanced image of the noise image.
14. The image processing apparatus according to claim 13, wherein the processing unit draws each text contour point in an image area where the text is located based on each of the second pixel coordinates in such a manner that an enhanced image of the noise image is obtained:
And respectively drawing each text outline point at each second pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
15. The image processing apparatus according to claim 13, wherein the determining unit is further configured to:
before redrawing the detected text, determining other image areas except the image area where the text is located in the noise image;
the processing unit is further configured to perform super-resolution processing on the other image area.
16. The image processing apparatus according to claim 15, wherein the processing unit draws each text contour point in an image area where the text is located based on each of the second pixel coordinates in such a manner that an enhanced image of the noise image is obtained:
determining a second proportional relation between a second size and a third size, wherein the second size is a size of the other image area before super-resolution processing, and the third size is a size of the other image area after super-resolution processing;
according to the second proportional relation, determining each corresponding third pixel coordinate of each text contour point in the image area where the text is located; the second proportional relation is met between the second pixel coordinate and the third pixel coordinate corresponding to the same text outline point;
And respectively drawing each text outline point at each third pixel coordinate in the image area where the text is located, so as to obtain an enhanced image of the noise image.
17. The image processing apparatus of claim 15, wherein the processing unit is further configured to:
and carrying out image denoising processing on the other image areas before carrying out super-resolution processing on the other image areas.
18. The image processing apparatus according to any one of claims 11 to 17, wherein the processing unit is further configured to:
before redrawing the detected text, respectively predicting pixel values of all pixel positions in the image area where the text is located by taking pixel values of other image areas except the image area where the text is located in the noise image as references, so as to obtain each predicted pixel value respectively corresponding to each pixel position;
and filling pixel values of the pixel positions in the image area where the text is located according to the predicted pixel values.
19. The image processing apparatus according to claim 18, wherein the processing unit performs pixel value prediction for each pixel position in the image area where the text is located, with reference to pixel values of other image areas in the noise image than the image area where the text is located, to obtain predicted pixel values corresponding to each pixel position, respectively:
Respectively taking each pixel position in an image area where the text is located as a target pixel position;
determining a target pixel column and a target pixel row of the target pixel position in the noise image;
taking pixel values corresponding to the pixel positions in the other image areas in the target pixel column as references, and predicting the pixel values of the target pixel positions to obtain predicted first pixel values; and predicting the pixel value of the target pixel position by taking the pixel value corresponding to each pixel position in the other image areas in the target pixel row as a reference, so as to obtain a predicted second pixel value;
and carrying out weighting processing on the first pixel value and the second pixel value based on the weighting coefficient of the target pixel position to obtain a predicted pixel value for filling the pixel value of the target pixel position.
20. The image processing apparatus according to claim 19, wherein the processing unit determines the weighting coefficients by:
determining a number of rows of spaced pixels between the target pixel location and the other image region, and determining a number of columns of spaced pixels between the target pixel location and the other image region;
And taking the duty ratio of the interval pixel row number and the interval pixel column number in the total interval number as a weighting coefficient of the target pixel position, wherein the total interval number is the sum of the interval pixel row number and the interval pixel column number.
21. An electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the method of any one of claims 1-10.
22. A computer readable storage medium having stored thereon a computer program/instruction, which when executed by a processor, implements the method of any of claims 1-10.
23. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the method of any of claims 1-10.
CN202211646150.0A 2022-12-21 2022-12-21 Image processing method, device, apparatus, medium, and program product Active CN116188293B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211646150.0A CN116188293B (en) 2022-12-21 2022-12-21 Image processing method, device, apparatus, medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211646150.0A CN116188293B (en) 2022-12-21 2022-12-21 Image processing method, device, apparatus, medium, and program product

Publications (2)

Publication Number Publication Date
CN116188293A true CN116188293A (en) 2023-05-30
CN116188293B CN116188293B (en) 2023-08-29

Family

ID=86435470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211646150.0A Active CN116188293B (en) 2022-12-21 2022-12-21 Image processing method, device, apparatus, medium, and program product

Country Status (1)

Country Link
CN (1) CN116188293B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060153452A1 (en) * 2005-01-10 2006-07-13 Kjeldsen Frederik Carl M Visual enhancement for reduction of visual noise in a text field
JP2009265329A (en) * 2008-04-24 2009-11-12 Seiko Epson Corp Font drawing device and information processing device
US20140270528A1 (en) * 2013-03-13 2014-09-18 Amazon Technologies, Inc. Local image enhancement for text recognition
US20160140701A1 (en) * 2014-11-14 2016-05-19 Adobe Systems Incorporated Facilitating Text Identification and Editing in Images
CN110598566A (en) * 2019-08-16 2019-12-20 深圳中兴网信科技有限公司 Image processing method, device, terminal and computer readable storage medium
US20200410686A1 (en) * 2019-06-26 2020-12-31 Adobe Inc. Automatic sizing and placement of text within a digital image
CN112749599A (en) * 2019-10-31 2021-05-04 北京金山云网络技术有限公司 Image enhancement method and device and server
CN113592735A (en) * 2021-07-23 2021-11-02 作业帮教育科技(北京)有限公司 Text page image restoration method and system, electronic equipment and computer readable medium
CN114140797A (en) * 2021-12-01 2022-03-04 深圳传音控股股份有限公司 Image processing method, intelligent terminal and storage medium
CN114170608A (en) * 2021-12-01 2022-03-11 上海东普信息科技有限公司 Super-resolution text image recognition method, device, equipment and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060153452A1 (en) * 2005-01-10 2006-07-13 Kjeldsen Frederik Carl M Visual enhancement for reduction of visual noise in a text field
JP2009265329A (en) * 2008-04-24 2009-11-12 Seiko Epson Corp Font drawing device and information processing device
US20140270528A1 (en) * 2013-03-13 2014-09-18 Amazon Technologies, Inc. Local image enhancement for text recognition
US20160140701A1 (en) * 2014-11-14 2016-05-19 Adobe Systems Incorporated Facilitating Text Identification and Editing in Images
US20200410686A1 (en) * 2019-06-26 2020-12-31 Adobe Inc. Automatic sizing and placement of text within a digital image
CN110598566A (en) * 2019-08-16 2019-12-20 深圳中兴网信科技有限公司 Image processing method, device, terminal and computer readable storage medium
CN112749599A (en) * 2019-10-31 2021-05-04 北京金山云网络技术有限公司 Image enhancement method and device and server
CN113592735A (en) * 2021-07-23 2021-11-02 作业帮教育科技(北京)有限公司 Text page image restoration method and system, electronic equipment and computer readable medium
CN114140797A (en) * 2021-12-01 2022-03-04 深圳传音控股股份有限公司 Image processing method, intelligent terminal and storage medium
CN114170608A (en) * 2021-12-01 2022-03-11 上海东普信息科技有限公司 Super-resolution text image recognition method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN116188293B (en) 2023-08-29

Similar Documents

Publication Publication Date Title
US10437466B2 (en) Formula inputting method and apparatus
CN110427932B (en) Method and device for identifying multiple bill areas in image
US11600091B2 (en) Performing electronic document segmentation using deep neural networks
US8625932B2 (en) Seam carving using seam energy re-computation in seam neighborhood
US8180177B1 (en) Seam-based reduction and expansion of images using parallel processing of retargeting matrix strips
CA2193440A1 (en) Method and system for designating objects
US8218900B1 (en) Non-linear image scaling with seam energy
CN109948533B (en) Text detection method, device and equipment and readable storage medium
US8581937B2 (en) Seam-based reduction and expansion of images using partial solution matrix dependent on dynamic programming access pattern
CN109636885B (en) Sequential frame animation production method and system for H5 page
CN111292335B (en) Method and device for determining foreground mask feature map and electronic equipment
US10846889B2 (en) Color handle generation for digital image color gradients using machine learning
CN105160343A (en) Information identification method and device applied to film on-demand-printing system
Zhang et al. Seam warping: a new approach for image retargeting for small displays
US11055526B2 (en) Method, system and apparatus for processing a page of a document
CN116188293B (en) Image processing method, device, apparatus, medium, and program product
CN112598687A (en) Image segmentation method and device, storage medium and electronic equipment
JP2018206260A (en) Image processing system, evaluation model construction method, image processing method, and program
Hsin Saliency histogram equalisation and its application to image resizing
US10424084B2 (en) Digital content rendering that supports alpha is shape (AIS) as part of knockout groups
US11488020B2 (en) Adaptive high-resolution digital image processing with neural networks
CN115187834A (en) Bill identification method and device
EP0855682A2 (en) Scan line rendering of convolutions
CN113936187A (en) Text image synthesis method and device, storage medium and electronic equipment
CN112465931A (en) Image text erasing method, related equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant