Image character recognition method and device

文档序号:908017 发布日期:2021-02-26 浏览:7次 中文

阅读说明:本技术 一种图像文字识别的方法及装置 (Image character recognition method and device ) 是由 王晶 于 2020-12-09 设计创作,主要内容包括:本发明公开了一种图像文字识别的方法及装置,包括图像文字识别的方法和图像文字识别的装置,该方法中,能够检测到图像中的文字,并识别出文字的内容,然后将其以文本的方式输出,本发明相对现有技术能够更快的识别图像中的文字内容,具有很高的识别准确度。而且本发明能够支持文字方向检测,对倾斜或倒置的图像自动进行校正,增强了文字识别的适用性。图像文字识别的装置,该装置能够检测到图像中的文字,并识别出文字的内容,然后将其以文本的方式输出,而且具有很高的识别速度和识别准确度。本装置能够支持文字方向检测,对倾斜或倒置的图像自动进行校正,增强了文字识别的适用性。(The invention discloses a method and a device for recognizing image characters, which comprises a method for recognizing image characters and a device for recognizing image characters. The invention can support character direction detection, automatically correct the inclined or inverted image, and enhance the applicability of character recognition. The device for recognizing the characters in the image can detect the characters in the image, recognize the content of the characters and output the characters in a text mode, and has high recognition speed and recognition accuracy. The device can support character direction detection, automatically correct inclined or inverted images, and enhance the applicability of character recognition.)

1. A method for image character recognition, the method comprising:

A. firstly, acquiring a character image, carrying out scaling and normalization processing on the character image, reading the processed image and identifying the character direction of the image;

B. correcting the character image according to the recognition result of the character direction of the image;

C. carrying out scaling and normalization processing on the corrected character image, and then reading the corrected character image;

D. determining the area coordinates of each line of characters in the image, and determining the inclination angle of each line of characters in the image;

E. acquiring the area coordinates of the image where each line of characters is located and the inclination of the corresponding line of characters, capturing the picture of the coordinate position of each area in the image, storing the picture as an image box, carrying out scaling and normalization processing on the generated image boxes, and storing the processed image box into a linked list;

F. the linked list is obtained, the text content of the incoming image is identified, and the subscript of the identified text in the dictionary is returned.

2. The method for image character recognition according to claim 1, wherein the angle of the line character direction recognition in step a comprises 90 °, 180 °, 270 °.

3. The method of claim 1, wherein step B corrects the text image accordingly based on the result of step A.

4. The method for image character recognition according to claim 1, wherein the step C performs scaling and normalization on the corrected character image, and the content thereof includes:

c1, zooming the character image into shape meeting the requirement of the file detection model;

and C2, normalizing the RGB content of the image.

5. The method of image text recognition of claim 1, further comprising classifying the text image.

6. An apparatus for character recognition of an image, the apparatus comprising: an image character direction detection module, a character detection module and a character recognition module,

image character direction detection module

Acquiring a character image, carrying out scaling and normalization processing on the character image, reading the processed image and identifying the character direction of the image;

correcting the character image according to the recognition result of the character direction of the image, and carrying out scaling and normalization processing on the corrected character image;

character detection module

Acquiring a processed character image, determining the area coordinates of each line of characters in the image, and determining the inclination angle of each line of characters in the image;

acquiring the area coordinates of the image where each line of characters is located and the inclination of the corresponding line of characters, capturing the picture of the coordinate position of each area in the image, storing the picture as an image box, carrying out scaling and normalization processing on the generated image boxes, and storing the processed image box into a linked list;

character recognition module

The linked list is obtained, the text content of the incoming image is identified, and the subscript of the identified text in the dictionary is returned.

Technical Field

The invention relates to the technical field of deep learning, in particular to a method and a device for recognizing image characters.

Background

At present, most image character recognition systems can only perform character detection and character recognition on regular images with certain standards, and once an input character image does not accord with an expected character image, the accuracy of character recognition is greatly reduced, and the usability of the system is not high.

Some image character recognition systems simply realize the detection and recognition of characters, and do not classify images to be recognized, so that the accuracy of the system is greatly reduced when some specific types of pictures are processed.

Disclosure of Invention

The invention aims to provide a method and a device for recognizing images and characters, which solve the problem that a device for transmitting information is lacked in the conventional secret room escape game.

In order to achieve the purpose, the invention provides the following technical scheme: a method of image text recognition, the method comprising:

A. firstly, acquiring a character image, carrying out scaling and normalization processing on the character image, reading the processed image and identifying the character direction of the image;

B. correcting the character image according to the recognition result of the character direction of the image;

C. carrying out scaling and normalization processing on the corrected character image, and then reading the corrected character image;

D. determining the area coordinates of each line of characters in the image, and determining the inclination angle of each line of characters in the image;

E. acquiring the area coordinates of the image where each line of characters is located and the inclination of the corresponding line of characters, capturing the picture of the coordinate position of each area in the image, storing the picture as an image box, carrying out scaling and normalization processing on the generated image boxes, and storing the processed image box into a linked list;

F. obtaining the linked list, identifying the text content of the incoming image, and returning the identified text in the dictionarySubscripts.

Further, the angles for character direction identification in step a include 90 °, 180 °, and 270 °.

Further, step B will perform corresponding correction on the text image according to the result of step a.

Further, in the step C, the corrected text image is scaled and normalized, and the content thereof includes:

c1, zooming the character image into shape meeting the requirement of the file detection model;

and C2, normalizing the RGB content of the image.

Further, the method also comprises the step of classifying the character images.

An apparatus for image text recognition, the apparatus comprising: an image character direction detection module, a character detection module and a character recognition module,

image character direction detection module

Acquiring a character image, carrying out scaling and normalization processing on the character image, reading the processed image and identifying the character direction of the image;

correcting the character image according to the recognition result of the character direction of the image, and carrying out scaling and normalization processing on the corrected character image;

character detection module

Acquiring a processed character image, determining the area coordinates of each line of characters in the image, and determining the inclination angle of each line of characters in the image;

acquiring the area coordinates of the image where each line of characters is located and the inclination of the corresponding line of characters, capturing the picture of the coordinate position of each area in the image, storing the picture as an image box, carrying out scaling and normalization processing on the generated image boxes, and storing the processed image box into a linked list;

character recognition module

Obtaining the linked list, identifying the text content of the incoming image, and returning the identified text in the dictionaryLower part And (4) marking.

Has the advantages that:

the invention provides a method for recognizing image characters. In the method, characters in the image can be detected, the content of the characters can be recognized, and then the characters are output in a text mode.

Compared with the prior art, the method and the device can identify the text content in the image more quickly, and have high identification accuracy. The invention can support character direction detection, automatically correct the inclined or inverted image, and enhance the applicability of character recognition. The invention provides an image character recognition device, which can detect characters in an image, recognize the content of the characters and output the characters in a text mode, and has high recognition speed and recognition accuracy. The device can support character direction detection, automatically correct inclined or inverted images, and enhance the applicability of character recognition.

Drawings

FIG. 1 is a schematic diagram of the process of the present invention;

FIG. 2 is a schematic view of the apparatus of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.

In the description of the present invention, it should be noted that the terms "upper", "lower", "inner", "outer", "front", "rear", "both ends", "one end", "the other end", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.

In the description of the present invention, it is to be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "disposed," "connected," and the like are to be construed broadly, such as "connected," which may be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.

Referring to the drawings, the present invention provides an embodiment: a method of image text recognition, the method comprising:

A. firstly, acquiring a character image, carrying out scaling and normalization processing on the character image, reading the processed image and identifying the character direction of the image;

B. correcting the character image according to the recognition result of the character direction of the image;

C. carrying out scaling and normalization processing on the corrected character image, and then reading the corrected character image;

D. determining the area coordinates of each line of characters in the image, and determining the inclination angle of each line of characters in the image;

E. acquiring the area coordinates of the image where each line of characters is located and the inclination of the corresponding line of characters, capturing the picture of the coordinate position of each area in the image, storing the picture as an image box, carrying out scaling and normalization processing on the generated image boxes, and storing the processed image box into a linked list;

F. obtaining the linked list, identifying the text content of the incoming image, and returning the identified text in the dictionarySubscripts.

The method comprises the following specific steps:

A. firstly, carrying out scaling and normalization processing on a character image, and then sending the processed image into an image character direction detection model for identifying the image character direction;

B. correcting the character image according to the recognition result of the image character direction detection model;

C. carrying out scaling and normalization processing on the corrected character image, and then inputting the character image into a character detection model;

D. the character detection model can accurately identify the area where the characters in the image are located, identify the inclined angle of the character line in the image, and then output the identified character area (in line units) and the inclined angle of the character line;

E. according to the region coordinates of the image where the single-line characters are output by the character detection model and the inclination of the character lines, intercepting the image at the corresponding position in the image, storing the image as an image box, if the image has multiple lines of characters, generating multiple image boxes, carrying out scaling and normalization processing on the generated image boxes, storing the processed image boxes into a linked list, and then transmitting the linked list serving as an input into the character identification model;

F. the character recognition model recognizes the character content of the incoming image (each image box returns a recognition result) and returns the recognized characters in the dictionarySubscripts.

Specifically, the angles of the line character direction recognition in the step a include 90 °, 180 °, and 270 °.

Specifically, step B will perform corresponding correction on the text image according to the result of step a.

Specifically, in the step C, the corrected text image is scaled and normalized, and the content thereof includes:

c1, zooming the character image into shape meeting the requirement of the file detection model;

and C2, normalizing the RGB content of the image.

Specifically, the method further comprises the step of classifying the character images.

An apparatus for image text recognition, the apparatus comprising: an image character direction detection module, a character detection module and a character recognition module,

image character direction detection module

Acquiring a character image, carrying out scaling and normalization processing on the character image, reading the processed image and identifying the character direction of the image;

correcting the character image according to the recognition result of the character direction of the image, and carrying out scaling and normalization processing on the corrected character image;

character detection module

Acquiring a processed character image, determining the area coordinates of each line of characters in the image, and determining the inclination angle of each line of characters in the image;

acquiring the area coordinates of the image where each line of characters is located and the inclination of the corresponding line of characters, capturing the picture of the coordinate position of each area in the image, storing the picture as an image box, carrying out scaling and normalization processing on the generated image boxes, and storing the processed image box into a linked list;

character recognition module

The linked list is obtained, the text content of the incoming image is identified, and the subscript of the identified text in the dictionary is returned.

The character detection module improves the character detection precision in the following modes:

1. classifying the character image, such as: identity card images, business card images, and the like. The region where each type of image characters are located is relatively fixed, so that the character detection accuracy is improved;

2. correcting some less regular images, wherein if some images are deformed due to the problem of shooting angle (some images which are originally rectangular are changed into trapezoids due to the problem of shooting angle), the irregular images are converted into regular images by identifying the coordinates of four corners of the character images;

the character recognition module improves the accuracy of character recognition in the following modes:

1. performing classification training on the character images, such as: identity card images, business card images, and the like. Therefore, the pertinence of model training is increased, and the accuracy of character recognition is improved;

2. the thought of classification processing is added on the basis of the traditional character recognition, so that the accuracy of character recognition is improved, such as: the gender on the ID card picture is only male and female, and other categories do not appear.

It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:用于定位服饰关键点的方法、装置和叠衣机

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!