CN115188001A - Handwritten text recognition method and device, electronic equipment and storage medium - Google Patents

Handwritten text recognition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115188001A
CN115188001A CN202210698931.8A CN202210698931A CN115188001A CN 115188001 A CN115188001 A CN 115188001A CN 202210698931 A CN202210698931 A CN 202210698931A CN 115188001 A CN115188001 A CN 115188001A
Authority
CN
China
Prior art keywords
image
font
text
determining
recognized
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.)
Pending
Application number
CN202210698931.8A
Other languages
Chinese (zh)
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202210698931.8A priority Critical patent/CN115188001A/en
Publication of CN115188001A publication Critical patent/CN115188001A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/32Digital ink
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/1431Illumination control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/18Extraction of features or characteristics of the image
    • G06V30/1801Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/30Character recognition based on the type of data
    • G06V30/302Images containing characters for discriminating human versus automated computer access

Abstract

The embodiment of the application discloses a method and a device for identifying a handwritten text, electronic equipment and a storage medium. The method comprises the following steps: the electronic equipment obtains an image to be identified by carrying out image optimization processing on the original image; identifying the font in the image to be identified to obtain the identified font; determining a handwritten text and a machine-printed text in the image to be recognized according to the recognized font; determining a first area corresponding to the handwritten text in the image to be recognized, and determining an image in the first area as a first image; and performing text recognition processing on the first image in the first area to obtain a first recognition result. The method for recognizing the handwritten text can recognize the handwritten font and perform text recognition on the handwritten font.

Description

Handwritten text recognition method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method and an apparatus for recognizing a handwritten text, an electronic device, and a storage medium.
Background
In the prior art, in order to improve office efficiency, an OCR (Optical Character Recognition) Recognition technology is provided, and after an image is scanned by a scanning device, a Recognition device such as a computer can recognize the image, so as to obtain a recognized text.
However, in the prior art, text content in the whole image is often identified, and different types of fonts in the current page cannot be distinguished.
Disclosure of Invention
The embodiment of the application provides a method and a device for identifying a handwritten text, electronic equipment and a storage medium. The handwritten character recognition method can recognize the handwritten character and perform text recognition on the handwritten character.
In a first aspect, an embodiment of the present application provides a method for recognizing a handwritten text, including:
carrying out image optimization processing on the original image to obtain an image to be identified;
identifying the font in the image to be identified to obtain an identified font;
determining a handwritten text and a machine-printed text in the image to be recognized according to the recognized font;
determining a first area corresponding to the handwritten text in the image to be recognized, and determining an image in the first area as a first image;
and performing text recognition processing on the first image in the first area to obtain a first recognition result.
In a second aspect, an embodiment of the present application provides an apparatus for recognizing a handwritten text, including:
the optimization module is used for carrying out image optimization processing on the original image to obtain an image to be identified;
the first identification module is used for identifying the fonts in the image to be identified to obtain identified fonts;
the first determining module is used for determining a handwritten text and a machine printing text in the image to be recognized according to the recognized font;
the second determining module is used for determining a first area corresponding to the handwritten text in the image to be recognized and determining an image in the first area as a first image;
and the second recognition module is used for performing text recognition processing on the first image in the first area to obtain a first recognition result.
In a third aspect, an embodiment of the present application provides an electronic device, including: a memory storing executable program code, a processor coupled to the memory; the processor calls the executable program codes stored in the memory to execute the steps in the identification method of the handwritten text provided by the embodiment of the application.
In a fourth aspect, an embodiment of the present application provides a storage medium, where the storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor, so as to implement the steps in the recognition method for handwritten texts provided by the embodiment of the present application.
In the embodiment of the application, the electronic equipment obtains the image to be identified by carrying out image optimization processing on the original image; identifying the font in the image to be identified to obtain the identified font; determining a handwritten text and a machine printing text in the image to be recognized according to the recognized font; determining a first area corresponding to the handwritten text in the image to be recognized, and determining an image in the first area as a first image; and performing text recognition processing on the first image in the first area to obtain a first recognition result. The handwritten character recognition method can recognize the handwritten character and perform text recognition on the handwritten character.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a first flowchart of a recognition method for a handwritten text according to an embodiment of the present disclosure.
Fig. 2 is a second flowchart of a recognition method for handwritten text according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a recognition apparatus for handwritten text according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the related art, in the process of text recognition, the whole page of image is often recognized, so as to obtain the text content therein.
However, the entire page image includes some contents that do not need to be recognized, such as illustrations, pictures, icons, and the like, and if the contents that do not need to be recognized in the entire page are recognized, the recognized document may have a phenomenon of disordered layout, disordered text, and the like.
In order to solve the technical problem, embodiments of the present application provide a method and an apparatus for recognizing a handwritten text, an electronic device, and a storage medium. The identification method of the handwritten text can be used for accurately determining the content to be identified in the image to be identified and then identifying the content to be identified.
Referring to fig. 1, fig. 1 is a first flowchart illustrating a method for recognizing a handwritten text according to an embodiment of the present application. The method for recognizing the handwritten text may include the steps of:
110. and carrying out image optimization processing on the original image to obtain an image to be identified.
In some embodiments, after the electronic device obtains the original image, the original image may be preprocessed to obtain a preprocessed image, which is more favorable for text recognition. The original image may be a different type of image such as a banking order, a document, a photograph, etc.
The original image may be an image of a different format type, for example, the original image may be an image of a different format such as pdf format, peg format, etc.
In some embodiments, the electronic device may obtain a file format of an original image, and convert the file format of the original image into a preset file format to obtain an original image to be processed; and then preprocessing the original image to be processed to obtain a preprocessed image.
For example, the original image is an image in pdf format, and the original image may be converted into an image in jpg format, where the image in jpg format is the original image to be processed.
Then, the electronic device may adjust an image direction and an image parameter of the original image to be processed to obtain an image to be recognized.
Specifically, the electronic device may adjust an image direction of the original image to be processed to a preset direction to obtain a first adjusted image. For example, the electronic device may rotate the original image to be processed, so that the direction of the original image to be processed is a preset direction, and a first adjustment image is obtained.
The image parameters may include brightness and contrast, and the electronic device may adjust the brightness and/or contrast of the first adjusted image to obtain the image to be recognized. For example, when the brightness of the first adjustment image is too bright or too dark, the recognition of the text recognition model on the first adjustment image is not facilitated, and at this time, the brightness of the first adjustment image can be adjusted to be preset normal brightness, so that the image to be recognized, which is more favorable for text recognition, is obtained.
For another example, when the text in the first adjusted image is not clear enough, the contrast can be adjusted to further highlight the difference between the text and the background. For example, if the background in the first adjusted image is white and the text is black, the contrast can be adjusted such that the background is whiter and the black is blacker. Thereby obtaining the image to be recognized which is more beneficial to text recognition.
It should be noted that, in the embodiment of the present application, the first adjustment image may be adjusted in a single manner, such as only brightness adjustment. The first adjusted image may also be adjusted in a number of ways, such as using contrast and brightness to adjust the image together.
The image parameters may include other parameters such as a degree of sharpening, a color temperature, a color, and the like, in addition to contrast and brightness. The electronic device can adjust the first adjustment image by adopting various image parameters, so as to obtain the image to be identified.
120. And identifying the font in the image to be identified to obtain the identified font.
In some embodiments, the electronic device may obtain color information of fonts in the image to be recognized under a specific light, and then determine the handwritten fonts and the machine-printed fonts according to the color information.
For example, in the process of scanning a paper document corresponding to an image to be recognized, since the ink of a handwritten font and the ink of a machine-printed font are different, the colors displayed by the handwritten font and the machine-printed font respectively are different under a specific light, such as ultraviolet light. The obtained image to be recognized has different color information corresponding to the handwriting font and the machine printing font.
In some implementations, the electronic device can determine whether a target color is present in the color information. And if the color information contains the target color, determining the fonts corresponding to the target color as machine printing fonts, and determining the fonts corresponding to the colors except the target color in the color information as handwriting fonts.
For example, machine-printed fonts can appear in a particular color under particular light, such as a machine-printed font that is originally blue and purple under ultraviolet radiation. And the handwritten characters are black and still black under the irradiation of an ultraviolet lamp.
When the electronic device determines that the fonts in the image to be recognized have the target color, for example, the target color is purple, the font corresponding to the target color is determined as the machine printing font. And then determining the fonts corresponding to the colors except the target color as the handwriting fonts.
It should be noted that, in the embodiment of the present application, the target color may also be another color, and is not limited to one color.
130. And determining the handwritten text and the machine-printed text in the image to be recognized according to the recognized font.
In some implementations, after the handwritten font and the machine-printed font are identified, text corresponding to the handwritten font can be determined as handwritten text and text corresponding to the machine-printed font can be determined as machine-printed text. Thereby facilitating subsequent recognition of different text.
140. And determining a first area corresponding to the handwritten text in the image to be recognized, and determining the image in the first area as a first image.
In some embodiments, the electronic device may determine a coverage area corresponding to the handwritten text, acquire position information corresponding to the coverage area, and then determine an area corresponding to the handwritten text according to the position information to mark, so as to obtain the first area.
For example, the electronic device may set a coverage area of a certain shape, such as a circle, an ellipse, a rectangle, and the like. Then, a minimum coverage area corresponding to the handwritten text is determined, and the minimum coverage area may be a preset shape, such as a rectangle.
And then, acquiring position information of the minimum coverage, which may be edge position information of the minimum coverage, for example, if the shape of the minimum coverage is a rectangle, acquiring edge position information of the rectangle.
The electronic device can establish a plane coordinate system for the image to be processed, and then acquire the position information of the coverage range corresponding to the handwritten text in the plane coordinate system. And finally, the electronic equipment marks the area corresponding to the handwritten text according to the preset position information, so that a first area is obtained.
150. And performing text recognition processing on the first image in the first area to obtain a first recognition result.
In some embodiments, the electronic device may acquire a text recognition model corresponding to the handwritten text, and then input the first image into the text recognition model to obtain a first recognition result. The text recognition model can accurately recognize and extract the handwritten text.
Before obtaining a text recognition model corresponding to a handwritten text, the electronic device may obtain a base model, then obtain a plurality of preset handwritten texts, such as a chinese handwritten text and an english handwritten text, and then input the preset handwritten text into the base model, thereby training the base model until the base model converges, or until the base model can accurately recognize the preset handwritten text, completing training of the base model, and obtaining a text recognition model for recognizing the handwritten text.
In some embodiments, the electronic device may further determine association information between lines in the first image, where the association information includes relative position information between the lines, and extract the lines in the first image according to the association information to obtain the first recognition result.
For example, in the first image, the handwritten text is composed of a plurality of lines, the electronic device may establish a labeling coordinate system for the first image, and in the standard coordinate system, for different lines, the electronic device may set corresponding feature points for each line, for example, at least three feature points including a start point, a middle point, and an end point on a straight line.
Then, the electronic device may determine the relative position information between different lines through the coordinate information between the feature points between different lines, for example, if there is a first line and a second line, the electronic device may determine a distance between each feature point in the first line and each feature point in the second line, so as to determine the relative position information between the first line and the second line.
And finally, the electronic equipment identifies and extracts the handwritten text according to the relative position information, so that a first identification result is obtained. The font of the text content in the first recognition result is the same as the handwritten text.
In the embodiment of the application, the electronic equipment obtains the image to be identified by carrying out image optimization processing on the original image; identifying the font in the image to be identified to obtain the identified font; determining a handwritten text and a machine-printed text in the image to be recognized according to the recognized font; determining a first area corresponding to the handwritten text in the image to be recognized, and determining an image in the first area as a first image; and performing text recognition processing on the first image in the first area to obtain a first recognition result.
The handwritten character recognition method can recognize the handwritten character and perform text recognition on the handwritten character.
In order to understand the recognition method of the handwritten text provided in the embodiment of the present application, please continue to refer to fig. 2, where fig. 2 is a second flowchart of the recognition method of the handwritten text provided in the embodiment of the present application. The method for recognizing the handwritten text may include the steps of:
201. and acquiring an original image, and correcting image parameters and direction information of the original image to obtain an image to be identified.
In some embodiments, after the electronic device obtains the original image, the original image may be preprocessed to obtain a preprocessed image, which is more favorable for text recognition. The original image may be a different type of image such as a banking order, a document, a photograph, etc.
The original image may be an image of a different format type, for example, the original image may be an image of a different format such as pdf format, peg format, etc.
In some embodiments, the electronic device may obtain a file format of an original image, and convert the file format of the original image into a preset file format to obtain an original image to be processed; and then preprocessing the original image to be processed to obtain a preprocessed image.
For example, the original image is an image in pdf format, and the original image may be converted into an image in jpg format, where the image in jpg format is the original image to be processed.
Then, the electronic device can adjust the image direction and the image parameters of the original image to be processed to obtain the image to be identified.
Specifically, the electronic device may adjust an image direction of the original image to be processed to a preset direction to obtain a first adjusted image. For example, the electronic device may rotate the original image to be processed, so that the direction of the original image to be processed is a preset direction, and a first adjustment image is obtained.
The image parameters may include brightness and contrast, and the electronic device may adjust the brightness and/or contrast of the first adjusted image to obtain the image to be recognized. For example, when the brightness of the first adjustment image is too bright or too dark, the recognition of the text recognition model on the first adjustment image is not facilitated, and at this time, the brightness of the first adjustment image can be adjusted to be preset normal brightness, so that the image to be recognized, which is more favorable for text recognition, is obtained.
For another example, when the text in the first adjusted image is not sharp enough, the difference between the text and the background can be further emphasized by adjusting the contrast. For example, if the background in the first adjusted image is white and the text is black, the contrast can be adjusted such that the background is whiter and the black is blacker. Thereby obtaining the image to be recognized which is more beneficial to text recognition.
It should be noted that, in the embodiment of the present application, the first adjustment image may be adjusted in a single manner, for example, only by brightness adjustment. The first adjusted image may also be adjusted in a number of ways, such as using contrast and brightness to adjust the image together.
The image parameters may include other parameters such as a degree of sharpening, a color temperature, a color, and the like, in addition to contrast and brightness. The electronic device can adjust the first adjustment image by adopting various image parameters, so as to obtain an image to be identified.
202. And acquiring color information of the fonts in the image to be recognized under the specific light.
For example, in the process of scanning the paper document corresponding to the image to be recognized, since the ink of the handwritten font and the ink of the machine-printed font are different, the colors respectively displayed by the handwritten font and the machine-printed font under a specific light, such as an ultraviolet light, are different. The obtained image to be recognized has different color information corresponding to the handwriting font and the machine printing font.
The electronic device may identify color information under a particular light from fonts in the image to be recognized.
203. It is determined whether a target color exists in the color information.
For example, machine-printed fonts can appear in a particular color under particular light, such as a machine-printed font that is originally blue and purple under ultraviolet radiation. And the handwritten characters are black and still black under the irradiation of an ultraviolet lamp.
The electronic device may check all font colors in the image to be recognized according to the color information, thereby determining whether the target color exists in the color information.
204. And if the color information is the target color, determining the fonts corresponding to the target color as machine printing fonts, and determining the fonts corresponding to the colors except the target color in the color information as handwriting fonts.
When the electronic device determines that the fonts in the image to be recognized have the target color, for example, the target color is purple, the font corresponding to the target color is determined as the machine printing font. And then determining the fonts corresponding to the colors except the target color as the handwriting fonts.
It should be noted that, in the embodiment of the present application, the target color may also be another color, and is not limited to one color.
And determining the text corresponding to the handwritten font as the handwritten text. And determining the text corresponding to the machine printing font as the machine printing text.
205. And determining the association information among the lines in the first image, wherein the association information comprises the relative position information among the lines.
For example, in the first image, the handwritten text is composed of a plurality of lines, the electronic device may establish a labeling coordinate system for the first image, and in the standard coordinate system, for different lines, the electronic device may set corresponding feature points for each line, for example, at least three feature points including a start point, a middle point, and an end point on a straight line.
Then, the electronic device may determine the relative position information between different lines through the coordinate information between the feature points between different lines, for example, there are a first line and a second line, and may determine a distance between each feature point in the first line and each feature point in the second line, thereby determining the relative position information between the first line and the second line.
206. And extracting lines in the first image according to the associated information to obtain a first identification result.
The electronic equipment identifies and extracts the handwritten text according to the relative position information, and therefore a first identification result is obtained. The font of the text content in the first recognition result is the same as the handwritten font.
207. And updating the first recognition result into the first area to obtain an editable image.
In some embodiments, after the electronic device obtains the first recognition result, the electronic device may format the content in the first area of the image to be recognized, and then update the first recognition result into the first area, so as to form an editable image corresponding to the first area.
It is understood that the user can copy the text content in the editable image, i.e. the first recognition result, directly to another file, and then copy the text content to another file, where the font of the text content is the same as the handwritten font, and the content of the text content corresponding to the handwritten font is also the same.
208. A second region corresponding to the machine-printed text, and a second image of the second region, are determined.
In some implementations, the electronic device can determine a second region corresponding to the machine-printed text based on the color of the machine-printed font, and then determine the images within the second region as the second image.
It should be noted that the content in the second image is the content corresponding to the machine-printed font.
209. A target file is generated from the editable image and the second image.
The electronic device may generate an object file from the second image and the editable image, where the user may copy the first recognition result corresponding to the handwritten text in the editable image, for example, to another file.
In the embodiment of the application, the handwritten text and the machine-printed text are identified, and after the handwritten text is determined, the content corresponding to the handwritten text can be identified. Therefore, the problem of recognizing the handwritten text is solved.
In the embodiment of the application, the electronic device can acquire the original image, and correct the image parameters and the direction information of the original image to obtain the image to be identified. The method comprises the steps of obtaining color information of a font in an image to be recognized under a specific light ray, determining whether a target color exists in the color information, determining a machine-printed font of the font corresponding to the target color if the target color exists in the color information, and determining the font corresponding to the color except the target color in the color information as a handwritten font.
And then determining the association information among the lines in the first image, wherein the association information comprises the relative position information among the lines, and extracting the lines in the first image according to the association information to obtain a first identification result.
And finally, updating the first recognition result into the first area to obtain an editable image. And determining a second area corresponding to the machine-printed text and a second image of the second area, and generating a target file according to the editable image and the second image.
In the embodiment of the application, the handwritten text can be recognized, and the content corresponding to the handwritten text can be recognized.
Correspondingly, an embodiment of the present application further provides a device for recognizing a handwritten text, as shown in fig. 3, fig. 3 is a schematic structural diagram of the device for recognizing a handwritten text provided in the embodiment of the present application. The recognition device of the handwritten text may include:
and the optimization module 310 is configured to perform image optimization on the original image to obtain an image to be identified.
The optimization module 310 is further configured to adjust an image direction and an image parameter of the original image, so as to obtain an image to be identified.
The optimizing module 310 is further configured to adjust an image direction of the original image to a preset direction, so as to obtain a first image; and adjusting the brightness and/or contrast of the first image to obtain the image to be identified.
The first recognition module 320 is configured to recognize fonts in the image to be recognized, and determine a handwritten font and a machine-printed font.
The first identification module 320 is further configured to obtain color information of a font in the image to be identified under a specific light; and determining the handwriting font and the machine printing font according to the color information.
A first identifying module 320, further configured to determine whether a target color exists in the color information; and if the color information is the target color, determining the fonts corresponding to the target color as machine printing fonts, and determining the fonts corresponding to the colors except the target color in the color information as handwriting fonts.
And the first determining module 330 is configured to determine, according to the recognized font, a handwritten text and a machine-printed text in the image to be recognized.
The second determining module 340 is configured to determine a first area corresponding to the handwritten text in the image to be recognized, and determine an image in the first area as the first image.
The second recognition module 350 is configured to perform text recognition processing on the first image of the first area to obtain a first recognition result.
The second identifying module 350 is further configured to determine association information between lines in the first image, where the association information includes information about relative positions between the lines; and extracting lines in the first image according to the associated information to obtain a first identification result.
The second identification module 350 is further configured to update the first identification result to the first area, so as to obtain an editable image; determining a second area corresponding to the machine-printed text and a second image of the second area; an object file is generated from the editable image and the second image.
In the embodiment of the application, the electronic equipment obtains the image to be identified by carrying out image optimization processing on the original image; identifying the font in the image to be identified to obtain the identified font; determining a handwritten text and a machine-printed text in the image to be recognized according to the recognized font; determining a first area corresponding to the handwritten text in the image to be recognized, and determining an image in the first area as a first image; and performing text recognition processing on the first image in the first area to obtain a first recognition result. The handwritten character recognition method can recognize the handwritten character and perform text recognition on the handwritten character.
Accordingly, an electronic device 400 may include one or more computer-readable storage media, a memory 401, an input unit 402, a display unit 403, a sensor 404, a processor 405 including one or more processing cores, and a power supply 406, as shown in fig. 4. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the memory 401 may be used to store software programs and modules, and the processor 405 may execute various functional applications and data processing by operating the software programs and modules stored in the memory 401. The memory 401 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phone book, etc.) created according to the use of the electronic device, and the like. Further, the memory 401 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 401 may further include a memory controller to provide the processor 405 and the input unit 402 with access to the memory 401.
The input unit 402 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, input unit 402 may include a touch-sensitive surface as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on or near the touch-sensitive surface using a finger, a stylus, or any other suitable object or attachment) thereon or nearby, and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 405, and receives and executes commands sent from the processor 405. In addition, the touch sensitive surface can be implemented in various types, such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 402 may include other input devices in addition to a touch-sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 403 may be used to display information input by or provided to a user and various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 403 may include a Display panel, and optionally, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay the display panel, and when a touch operation is detected on or near the touch-sensitive surface, the touch operation is transmitted to the processor 405 to determine the type of touch event, and then the processor 405 provides a corresponding visual output on the display panel according to the type of touch event. Although in FIG. 4 the touch sensitive surface and the display panel are implemented as two separate components for input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel for input and output functions.
The electronic device may also include at least one sensor 404, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that turns off the display panel and/or the backlight when the electronic device is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when the motion sensor is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration) for recognizing the attitude of electronic equipment, and related functions (such as pedometer and tapping) for vibration recognition; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which may be further configured to the electronic device, detailed descriptions thereof are omitted.
The processor 405 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 401 and calling data stored in the memory 401, thereby performing overall monitoring of the electronic device. Alternatively, processor 405 may include one or more processing cores; preferably, the processor 405 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 405.
The electronic device also includes a power supply 406 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 405 via a power management system, such that functions such as managing charging, discharging, and power consumption are performed via the power management system. The power supply 406 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the electronic device may further include a camera, a bluetooth module, and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 405 in the electronic device loads the computer program stored in the memory 401, and the processor 405 implements various functions by loading the computer program:
carrying out image optimization processing on the original image to obtain an image to be identified;
identifying the font in the image to be identified to obtain an identified font;
determining a handwritten text and a machine-printed text in the image to be recognized according to the recognized font;
determining a first area corresponding to the handwritten text in the image to be recognized, and determining an image in the first area as a first image;
and performing text recognition processing on the first image in the first area to obtain a first recognition result.
In the embodiment of the application, the electronic equipment obtains the image to be identified by carrying out image optimization processing on the original image; identifying the font in the image to be identified to obtain an identified font; determining a handwritten text and a machine-printed text in the image to be recognized according to the recognized font; determining a first area corresponding to the handwritten text in the image to be recognized, and determining an image in the first area as a first image; and performing text recognition processing on the first image in the first area to obtain a first recognition result. The handwritten character recognition method can recognize the handwritten character and perform text recognition on the handwritten character.
The image processing method provided in the embodiments of the present application may be applied to various electronic devices capable of processing images, such as a computer, a mobile phone, and a tablet computer, and may also be applied to other electronic devices capable of processing images.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the methods for recognizing handwritten text provided in the embodiments of the present application. For example, the instructions may perform the steps of:
performing image optimization processing on the original image to obtain an image to be identified;
identifying the font in the image to be identified to obtain an identified font;
determining a handwritten text and a machine printing text in the image to be recognized according to the recognized font;
determining a first area corresponding to the handwritten text in the image to be recognized, and determining an image in the first area as a first image;
and performing text recognition processing on the first image in the first area to obtain a first recognition result.
In the embodiment of the application, the electronic equipment obtains the image to be identified by carrying out image optimization processing on the original image; identifying the font in the image to be identified to obtain the identified font; determining a handwritten text and a machine printing text in the image to be recognized according to the recognized font; determining a first area corresponding to the handwritten text in the image to be recognized, and determining an image in the first area as a first image; and performing text recognition processing on the first image in the first area to obtain a first recognition result. The method for recognizing the handwritten text can recognize the handwritten font and perform text recognition on the handwritten font.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium may execute the steps in any of the methods for recognizing a handwritten text provided in the embodiments of the present application, beneficial effects that can be achieved by any of the methods for recognizing a handwritten text provided in the embodiments of the present application may be achieved, for details, see the foregoing embodiments, and are not described herein again.
The method, the apparatus, the electronic device, and the storage medium for recognizing a handwritten text provided in the embodiments of the present application are described in detail above, and specific examples are applied in the present application to explain the principles and embodiments of the present application, and the description of the above embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for recognizing handwritten text, comprising:
carrying out image optimization processing on the original image to obtain an image to be identified;
identifying the font in the image to be identified to obtain the identified font;
determining a handwritten text and a machine-printed text in the image to be recognized according to the recognized font;
determining a first area corresponding to the handwritten text in the image to be recognized, and determining an image in the first area as a first image;
and performing text recognition processing on the first image in the first area to obtain a first recognition result.
2. The method for recognizing handwritten texts according to claim 1, wherein the performing image optimization on the original image to obtain an image to be recognized includes:
and adjusting the image direction and the image parameters of the original image to obtain the image to be identified.
3. The method according to claim 2, wherein the adjusting the image direction and the image parameter of the original image to obtain the image to be recognized comprises:
adjusting the image direction of the original image to a preset direction to obtain a first image;
and adjusting the brightness and/or contrast of the first image to obtain the image to be identified.
4. The method for recognizing handwritten text according to claim 1, wherein the recognizing the font in the image to be recognized to obtain the recognized font includes:
acquiring color information of a font in the image to be recognized under a specific light;
and determining the handwritten font and the machine printing font according to the color information.
5. The method of claim 4, wherein the determining a handwritten font and a machine-printed font from the color information comprises:
determining whether a target color exists in the color information;
and if the color information is the target color, determining the font corresponding to the target color as the machine printing font, and determining the font corresponding to the color other than the target color in the color information as the handwriting font.
6. The method according to any one of claims 1 to 4, wherein performing text recognition processing on the first image in the first area to obtain a first recognition result comprises:
determining association information among lines in the first image, wherein the association information comprises relative position information among the lines;
and extracting lines in the first image according to the associated information to obtain the first identification result.
7. The method according to any one of claims 1 to 4, wherein after performing text recognition processing on the first image in the first area to obtain a first recognition result, the method further comprises:
updating the first identification result to the first area to obtain an editable image;
determining a second area corresponding to the machine-printed text and a second image of the second area;
and generating a target file according to the editable image and the second image.
8. An apparatus for recognizing handwritten text, comprising:
the optimization module is used for carrying out image optimization processing on the original image to obtain an image to be identified;
the first identification module is used for identifying the fonts in the image to be identified to obtain identified fonts;
the first determining module is used for determining a handwritten text and a machine printing text in the image to be recognized according to the recognized font;
the second determining module is used for determining a first area corresponding to the handwritten text in the image to be recognized and determining an image in the first area as a first image;
and the second identification module is used for performing text identification processing on the first image in the first area to obtain a first identification result.
9. An electronic device, comprising:
a memory storing executable program code, a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the steps in the method of recognition of handwritten text according to any of claims 1 to 7.
10. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the method for recognizing handwritten text according to any one of claims 1 to 7.
CN202210698931.8A 2022-06-20 2022-06-20 Handwritten text recognition method and device, electronic equipment and storage medium Pending CN115188001A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210698931.8A CN115188001A (en) 2022-06-20 2022-06-20 Handwritten text recognition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210698931.8A CN115188001A (en) 2022-06-20 2022-06-20 Handwritten text recognition method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115188001A true CN115188001A (en) 2022-10-14

Family

ID=83513257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210698931.8A Pending CN115188001A (en) 2022-06-20 2022-06-20 Handwritten text recognition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115188001A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112926587A (en) * 2021-02-19 2021-06-08 北京大米未来科技有限公司 Text recognition method and device, readable storage medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112926587A (en) * 2021-02-19 2021-06-08 北京大米未来科技有限公司 Text recognition method and device, readable storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
US10409418B2 (en) Electronic device operating according to pressure state of touch input and method thereof
JP5458161B1 (en) Electronic apparatus and method
KR102240279B1 (en) Content processing method and electronic device thereof
CN109684980B (en) Automatic scoring method and device
EP3251055A1 (en) Information processing apparatus and program
WO2021070972A1 (en) Display apparatus, color supporting apparatus, display method, and program
US20240004520A1 (en) Display apparatus, display method, and medium
CN109902687B (en) Image identification method and user terminal
CN115188001A (en) Handwritten text recognition method and device, electronic equipment and storage medium
JP2005275652A (en) Apparatus and method for processing input trajectory
CN115187988A (en) Regional text recognition method and device, electronic equipment and storage medium
CN115188003A (en) Model-based text recognition method and device, electronic equipment and storage medium
US20220129085A1 (en) Input device, input method, medium, and program
KR102468082B1 (en) Correction method for handwriting input, electronic device and storage medium therefor
CN115187986A (en) Text recognition method and device, electronic equipment and storage medium
CN115188012A (en) Text recognition model updating method and device, electronic equipment and storage medium
CN115187987A (en) Method and device for recognizing text outside special area, electronic equipment and storage medium
CN111144192A (en) Information processing apparatus, information processing method, and storage medium
JP6821998B2 (en) Electronic blackboard, program, method
JP2013020402A (en) Computer device, stroke display system and program
JP2014109876A (en) Information processor, information processing method and program
US20230298367A1 (en) Display apparatus, formatting method, and non-transitory computer-executable medium
US20230266875A1 (en) Display apparatus, input method, and program
JP5104904B2 (en) Information processing system and display processing program
US20220319211A1 (en) Display apparatus, display system, display method, and recording 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