Bill image character recognition method and device

文档序号:1354692 发布日期:2020-07-24 浏览:17次 中文

阅读说明:本技术 一种票据图像文字识别方法及装置 (Bill image character recognition method and device ) 是由 王栋 郑开发 李宏伟 汪洋 玄佳兴 王俊生 于 2020-01-14 设计创作,主要内容包括:本发明公开了一种票据图像文字识别方法及装置,可以获得目标票据图像;将目标票据图像输入至预设的目标文字区域确定模型中,确定目标票据图像中的目标文字区域;将目标票据图像转化为YUV色彩空间的待识别文字图像,将待识别文字图像中目标文字区域的对比度调高,将除目标文字区域外的区域的对比度调低,以使待识别文字图像中的目标文字区域的对比度高于待识别文字图像中的除目标文字区域外的对比度;将待识别文字图像输入至预设的文字识别模型中,获得目标文字区域中的文字内容。本发明通过准确定位目标文字区域,并调整目标文字区域对比度的技术方案,解决了票据图像分辨率低造成的文字识别准确率低的技术问题,进而提高了文字识别准确率。(The invention discloses a method and a device for identifying characters of bill images, which can obtain target bill images; inputting the target bill image into a preset target character area determination model, and determining a target character area in the target bill image; converting the target bill image into a character image to be recognized in a YUV color space, increasing the contrast of a target character area in the character image to be recognized, and decreasing the contrast of areas except the target character area so that the contrast of the target character area in the character image to be recognized is higher than the contrast of the character image to be recognized except the target character area; and inputting the character image to be recognized into a preset character recognition model to obtain the character content in the target character area. According to the invention, through the technical scheme of accurately positioning the target character area and adjusting the contrast of the target character area, the technical problem of low character recognition accuracy rate caused by low bill image resolution is solved, and the character recognition accuracy rate is further improved.)

1. A bill image character recognition method is characterized by comprising the following steps:

obtaining a target bill image;

inputting the target bill image into a preset target character area determination model, and determining a target character area in the target bill image;

converting the target bill image into a character image to be recognized in a YUV color space, increasing the contrast of a target character area in the character image to be recognized, and decreasing the contrast of an area except the target character area so as to enable the contrast of the target character area in the character image to be recognized to be higher than the contrast of the character image to be recognized except the target character area;

and inputting the character image to be recognized into a preset character recognition model to obtain the character content in the target character area.

2. The method of claim 1, wherein said obtaining a target document image comprises:

performing renaturation processing on the original bill image by an image correction method to obtain a bill correction image;

and performing characteristic enhancement on the bill correction image by an image enhancement method to obtain a target bill image.

3. The method of claim 1, wherein the training process of the predetermined target text region determination model comprises:

obtaining at least one note training image marked with a text area;

performing machine learning on the bill training image to obtain a target character region determination model, wherein the input of the target character region determination model is as follows: the bill image, the output of the target character region determination model is: and determining a target text area in the bill image.

4. The method of claim 1, wherein the converting the target document image into a text image to be recognized in YUV color space comprises:

converting the target bill image into a bill image to be zoomed in a YUV color space;

and zooming the bill image to be zoomed according to the zooming proportion corresponding to the bill type to obtain the character image to be recognized.

5. The method of any of claims 1 to 4, wherein the determining a target text region in the target document image comprises:

and filtering out a target character redundant area in the target bill image by a non-maximum value inhibition method, and determining the target character area in the target bill image.

6. A bill image character recognition device, comprising: a bill image obtaining unit, a character area determining unit, an image converting unit and a character content obtaining unit,

the bill image obtaining unit is used for obtaining a target bill image;

the character area determining unit is used for inputting the target bill image into a preset target character area determining model and determining a target character area in the target bill image;

the image conversion unit is used for converting the target bill image into a character image to be recognized in a YUV color space, increasing the contrast of a target character area in the character image to be recognized, and decreasing the contrast of an area except the target character area, so that the contrast of the target character area in the character image to be recognized is higher than the contrast of the character image to be recognized except the target character area;

and the character content obtaining unit is used for inputting the character image to be recognized into a preset character recognition model to obtain the character content in the target character area.

7. The apparatus according to claim 6, wherein the bill image obtaining unit includes: a bill correction image obtaining unit and an image feature enhancing unit,

the bill correction image obtaining unit is used for carrying out renaturation processing on the original bill image by an image correction method to obtain a bill correction image;

the image characteristic enhancement unit is used for carrying out characteristic enhancement on the bill correction image through an image enhancement method to obtain a target bill image.

8. The apparatus of claim 6, further comprising: a model training unit for training the predetermined target character region determination model, wherein the model training unit includes: a training image obtaining unit and a target character area determination model obtaining unit,

the training image obtaining unit is used for obtaining at least one note training image marked with a character area;

the target character region determination model obtaining unit is used for performing machine learning on the bill training image to obtain a target character region determination model, wherein the input of the target character region determination model is as follows: the bill image, the output of the target character region determination model is: and determining a target text area in the bill image.

9. The apparatus of claim 6, wherein the image translation unit comprises: a YUV color conversion unit and an image scaling unit,

the YUV color conversion unit is used for converting the target bill image into a bill image to be zoomed in a YUV color space;

and the image zooming unit is used for zooming the bill image to be zoomed according to the zooming proportion corresponding to the bill type to obtain the character image to be recognized.

10. The apparatus according to any one of claims 6 to 9, wherein the text region determining unit is specifically configured to filter out a target text redundant region in the target document image by a non-maximum suppression method, and determine a target text region in the target document image.

Technical Field

The invention relates to the field of image processing, in particular to a bill image character recognition method and a bill image character recognition device.

Background

Nowadays, with the continuous development of social informatization, the information on the bill needs to be input into a computer in daily life and work of people.

The existing character recognition device can recognize characters in a bill image, however, in the actual use process, due to the reasons of low resolution of the collected bill image and the like, the recognition accuracy rate of the character recognition device to the characters in the bill image is low easily.

Disclosure of Invention

In view of the above problems, the present invention provides a method and an apparatus for recognizing text in a document image, which overcomes or at least partially solves the above problems, and the technical solution is as follows:

a bill image character recognition method comprises the following steps:

obtaining a target bill image;

inputting the target bill image into a preset target character area determination model, and determining a target character area in the target bill image;

converting the target bill image into a character image to be recognized in a YUV color space, increasing the contrast of a target character area in the character image to be recognized, and decreasing the contrast of an area except the target character area so as to enable the contrast of the target character area in the character image to be recognized to be higher than the contrast of the character image to be recognized except the target character area;

and inputting the character image to be recognized into a preset character recognition model to obtain the character content in the target character area.

Optionally, the obtaining the target bill image includes:

performing renaturation processing on the original bill image by an image correction method to obtain a bill correction image;

and performing characteristic enhancement on the bill correction image by an image enhancement method to obtain a target bill image.

Optionally, the training process of the preset target text region determination model includes:

obtaining at least one note training image marked with a text area;

performing machine learning on the bill training image to obtain a target character region determination model, wherein the input of the target character region determination model is as follows: the bill image, the output of the target character region determination model is: and determining a target text area in the bill image.

Optionally, the converting the target bill image into a text image to be recognized in a YUV color space includes:

converting the target bill image into a bill image to be zoomed in a YUV color space;

and zooming the bill image to be zoomed according to the zooming proportion corresponding to the bill type to obtain the character image to be recognized.

Optionally, the determining a target text area in the target document image includes:

and filtering out a target character redundant area in the target bill image by a non-maximum value inhibition method, and determining the target character area in the target bill image.

A document image character recognition apparatus comprising: a bill image obtaining unit, a character area determining unit, an image converting unit and a character content obtaining unit,

the bill image obtaining unit is used for obtaining a target bill image;

the character area determining unit is used for inputting the target bill image into a preset target character area determining model and determining a target character area in the target bill image;

the image conversion unit is used for converting the target bill image into a character image to be recognized in a YUV color space, increasing the contrast of a target character area in the character image to be recognized, and decreasing the contrast of an area except the target character area, so that the contrast of the target character area in the character image to be recognized is higher than the contrast of the character image to be recognized except the target character area;

and the character content obtaining unit is used for inputting the character image to be recognized into a preset character recognition model to obtain the character content in the target character area.

Optionally, the bill image obtaining unit includes: a bill correction image obtaining unit and an image feature enhancing unit,

the bill correction image obtaining unit is used for carrying out renaturation processing on the original bill image by an image correction method to obtain a bill correction image;

the image characteristic enhancement unit is used for carrying out characteristic enhancement on the bill correction image through an image enhancement method to obtain a target bill image.

Optionally, the apparatus further comprises: a model training unit for training the predetermined target character region determination model, wherein the model training unit includes: a training image obtaining unit and a target character area determination model obtaining unit,

the training image obtaining unit is used for obtaining at least one note training image marked with a character area;

the target character region determination model obtaining unit is used for performing machine learning on the bill training image to obtain a target character region determination model, wherein the input of the target character region determination model is as follows: the bill image, the output of the target character region determination model is: and determining a target text area in the bill image.

Optionally, the image conversion unit includes: a YUV color conversion unit and an image scaling unit,

the YUV color conversion unit is used for converting the target bill image into a bill image to be zoomed in a YUV color space;

and the image zooming unit is used for zooming the bill image to be zoomed according to the zooming proportion corresponding to the bill type to obtain the character image to be recognized.

Optionally, the text region determining unit is specifically configured to filter out a target text redundant region in the target bill image by a non-maximum suppression method, and determine the target text region in the target bill image.

By the technical scheme, the bill image character recognition method and the bill image character recognition device can obtain the target bill image; inputting the target bill image into a preset target character area determination model, and determining a target character area in the target bill image; converting the target bill image into a character image to be recognized in a YUV color space, increasing the contrast of a target character area in the character image to be recognized, and decreasing the contrast of areas except the target character area so that the contrast of the target character area in the character image to be recognized is higher than the contrast of the character image to be recognized except the target character area; and inputting the character image to be recognized into a preset character recognition model to obtain the character content in the target character area. According to the invention, through the technical scheme of accurately positioning the target character area and adjusting the contrast of the target character area, the technical problem of low character recognition accuracy rate caused by low bill image resolution is solved, and the character recognition accuracy rate is further improved.

The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.

Drawings

Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:

fig. 1 is a schematic flow chart illustrating a method for recognizing text in a bill image according to an embodiment of the present invention;

FIG. 2 is a flow chart of another method for recognizing text in a bill image according to an embodiment of the present invention;

FIG. 3 is a flowchart illustrating a method for training a target text region determination model according to an embodiment of the present invention;

fig. 4 is a schematic structural diagram illustrating a bill image character recognition device according to an embodiment of the present invention;

fig. 5 shows a schematic structural diagram of another bill image character recognition device provided by the embodiment of the invention.

Detailed Description

Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

As shown in fig. 1, a method for identifying text in a ticket image according to an embodiment of the present invention may include:

and S100, obtaining a target bill image.

The embodiment of the invention can obtain the target bill image through the image acquisition device. The image acquisition apparatus may include: a camera device is carried by a mobile phone and a camera. The documents may be various securities and documents. For example: bonds, stocks, bills of lading, treasury bonds, invoices, and the like.

In practical application of the present invention, when a user uses different image capturing devices to obtain a bill image, which may have distortion such as tilt and blur, and in order to make the bill image more convenient for character recognition, as shown in fig. 2, in another method for character recognition of a bill image provided in an embodiment of the present invention, step S100 may include:

and S110, performing renaturation processing on the original bill image through an image correction method to obtain a bill correction image.

The image correction method may include: geometric correction methods and gray scale correction methods. The geometric correction method fits the unknown coefficient in the mapping relation through the corresponding relation between the coordinates of some known reference points, namely some pixel points of the undistorted image and the corresponding pixel points of the distorted image, and the unknown coefficient is used as the basis for recovering other pixels. The gray scale correction method may include: gray scale correction, gray scale variation, and histogram modification.

When the embodiment of the invention uses the geometric correction method to carry out the recovery processing on the bill image, the mathematical model established based on the geometric correction method can be used to extract the required information from the bill image, and the bill image is recovered along the reverse process of distorting the bill image to obtain the bill corrected image.

And S120, performing feature enhancement on the bill correction image through an image enhancement method to obtain a target bill image.

The image enhancement method comprises the following steps: spatial and frequency domain methods. The spatial domain method is to remove or weaken image noise through a local mean value solving method and a median filtering method. The frequency domain method is mainly used for enhancing signals of the image based on Fourier transform, and can remove noise in the image by adopting a low-pass filtering method; by adopting a high-pass filtering method, high-frequency signals such as edges and the like can be enhanced, so that a blurred image becomes clear. The embodiment of the invention can highlight the required image characteristics in the bill image and/or inhibit the unnecessary image characteristics in the bill image by an image enhancement method, thereby obtaining a clearer target bill image.

The embodiment of the invention facilitates the character recognition of the target bill image by performing the preprocessing processes of recoverability processing, characteristic enhancement and the like on the bill image, thereby improving the character recognition accuracy of the bill image.

S200, inputting the target bill image into a preset target character area determining model, and determining a target character area in the target bill image.

Optionally, the preset target text region determination model may be a convolutional neural network model. Specifically, the preset target text region determination model may be a VGG (Visual Geometry Group) network model. In practical application, an embodiment of the present invention may first train a target text region determination model, as shown in fig. 3, a method for training a target text region determination model according to an embodiment of the present invention may include:

and S001, obtaining at least one bill training image marked with a text area.

S002, performing machine learning on the bill training image to obtain a target character region determination model, wherein the input of the target character region determination model is as follows: the bill image, the output of the target character region determination model is: and determining a target text area in the bill image.

The embodiment of the invention can perform machine learning on the bill training image marked with the text region through the VGG16 model, so that conv5_3 of the VGG16 model outputs a bill training characteristic diagram of the bill training image, and then convolutes the bill training characteristic diagram through preset convolution parameters to obtain the characteristic vector of the text region marked in the bill training image.

In the practical use of the invention, when a target bill image is input into a preset target character area determination model, the preset target character area determination model extracts a bill feature map of the target bill image, the bill feature map is convolved through preset convolution parameters to obtain a feature vector of the bill feature map, and the feature vector of the bill feature map is compared with the feature vector of a character area marked in a bill training image to determine the target character area in the target bill image.

Optionally, the preselected convolution parameters may include a convolution kernel size of 3 × 3.

Alternatively, the boundary of the target text area may be displayed in a color that is distinguished from the target note image, for example, the boundary of the target text area constitutes a yellow label box.

Optionally, in the process of determining the target text region by using the preset target text region determining model, a plurality of mutually partially overlapped preselected text regions may be determined for one actual text region, and in order to make the finally determined target text region closer to the actual text region, redundant regions in the plurality of mutually partially overlapped preselected text regions need to be filtered. Therefore, the step of determining the target text area in the target document image in the embodiment of the present invention may include:

and filtering out a target character redundant area in the target bill image by a non-maximum value inhibition method, and determining the target character area in the target bill image.

Among them, the Non-Maximum Suppression method (NMS) can suppress elements that are not Maximum, i.e., a Maximum search for one field. In the embodiment of the invention, the target character redundant area in the multiple partially overlapped preselected character areas is filtered by a non-maximum value inhibition method, and the remaining preselected character area after filtering is determined as the target character area.

S300, converting the target bill image into a character image to be recognized in a YUV color space, increasing the contrast of a target character area in the character image to be recognized, and decreasing the contrast of an area except the target character area, so that the contrast of the target character area in the character image to be recognized is higher than the contrast of the character image to be recognized except the target character area.

In practical application, the Color Space (Color Space) of the target bill image collected by the image collecting device is RGB.

Specifically, in the embodiment of the present invention, the contrast of the target text region may be adjusted to be higher than the first contrast, and the contrast of the region other than the target text region may be adjusted to be lower than the second contrast, where the first contrast and the second contrast are separated by a preset value. The preset value can be set according to actual needs. According to the embodiment of the invention, the contrast of the target character area in the character image to be recognized is increased, and the contrast of the area except the target character area is decreased, so that the target character area in the character image to be recognized and the area except the target character area can be obviously distinguished, the complicated step of extracting the target character area from the character image to be recognized is avoided, and the subsequent recognition of characters in the target character area is facilitated.

Optionally, step S300 may include: converting the target bill image into a bill image to be zoomed in a YUV color space; and zooming the bill image to be zoomed according to the zooming proportion corresponding to the bill type to obtain the character image to be recognized.

It will be appreciated that there are many types of documents, each of which has a different actual text area, and that a reasonable scaling of the image can increase the smoothness and clarity of the image. Therefore, the embodiment of the invention can set the corresponding scaling for various types of bills in advance, so that when the bill image to be scaled is scaled, the scaling corresponding to the bill type is used for scaling, so that the character image to be recognized obtained after scaling is clearer, and the character recognition is convenient.

S400, inputting the character image to be recognized into a preset character recognition model, and obtaining character contents in the target character area.

Specifically, the embodiment of the present invention may use a pre-trained character recognition model or use an existing character recognition model to perform character recognition on a target character area in a character image to be recognized, so as to obtain the character content in the target character area.

Specifically, the embodiment of the present invention may use the existing text recognition technology to obtain the text content from the target text area of the text image to be recognized. For example, the embodiment of the present invention may use an OCR (Optical character recognition) technique to recognize a text from a target text region of a text image to be recognized, thereby obtaining text content.

Specifically, the embodiment of the present invention may train and obtain the character recognition model through the existing character recognition technology, and the specific training may include:

obtaining a training sample, and adding labels to characters in the training sample;

importing a training sample to perform machine training to obtain a character recognition model, wherein the input of the character recognition model is as follows: the image carrying the characters, the output of the character recognition model is: and (4) text content.

The bill image character recognition method provided by the embodiment of the invention can obtain a target bill image; inputting the target bill image into a preset target character area determination model, and determining a target character area in the target bill image; converting the target bill image into a character image to be recognized in a YUV color space, increasing the contrast of a target character area in the character image to be recognized, and decreasing the contrast of an area except the target character area so as to enable the contrast of the target character area in the character image to be recognized to be higher than the contrast of the character image to be recognized except the target character area; and inputting the character image to be recognized into a preset character recognition model to obtain the character content in the target character area. According to the technical scheme, the target character area of the target bill image is accurately positioned, the contrast is adjusted to distinguish the target character area from other areas, and then character recognition can be performed on the target character area to obtain the character content, so that the technical problem of low character recognition accuracy rate caused by low bill image resolution is solved, and the character recognition accuracy rate is improved.

Corresponding to the above method embodiment, an embodiment of the present invention further provides a bill image and text recognition apparatus, which has a structure shown in fig. 4 and may include: a document image obtaining unit 100, a text region determining unit 200, an image converting unit 300, and a text content obtaining unit 400.

The bill image obtaining unit 100 is configured to obtain a target bill image.

The embodiment of the invention can obtain the target bill image through the image acquisition device. The image acquisition apparatus may include: a camera device is carried by a mobile phone and a camera. The documents may be various securities and documents. For example: bonds, stocks, bills of lading, treasury bonds, invoices, and the like.

Optionally, as shown in fig. 5, another bill image character recognition apparatus is further provided in an embodiment of the present invention, where the bill image obtaining unit 100 includes: a bill correction image obtaining unit 110 and an image feature enhancing unit 120.

The bill correction image obtaining unit 110 is configured to perform renaturation processing on the original bill image by using an image correction method to obtain a bill correction image.

The image correction method may include: geometric correction methods and gray scale correction methods. The geometric correction method fits the unknown coefficient in the mapping relation through the corresponding relation between the coordinates of some known reference points, namely some pixel points of the undistorted image and the corresponding pixel points of the distorted image, and the unknown coefficient is used as the basis for recovering other pixels. The gray scale correction method may include: gray scale correction, gray scale variation, and histogram modification.

When the embodiment of the invention uses the geometric correction method to carry out the recovery processing on the bill image, the mathematical model established based on the geometric correction method can be used to extract the required information from the bill image, and the bill image is recovered along the reverse process of distorting the bill image to obtain the bill corrected image.

The image feature enhancing unit 120 is configured to perform feature enhancement on the bill correction image by using an image enhancement method to obtain a target bill image.

The image enhancement method comprises the following steps: spatial and frequency domain methods. The spatial domain method is to remove or weaken image noise through a local mean value solving method and a median filtering method. The frequency domain method is mainly used for enhancing signals of the image based on Fourier transform, and can remove noise in the image by adopting a low-pass filtering method; by adopting a high-pass filtering method, high-frequency signals such as edges and the like can be enhanced, so that a blurred image becomes clear. The embodiment of the invention can highlight the required image characteristics in the bill image and/or inhibit the unnecessary image characteristics in the bill image by an image enhancement method, thereby obtaining a clearer target bill image.

The embodiment of the invention facilitates the character recognition of the target bill image by performing the preprocessing processes of recoverability processing, characteristic enhancement and the like on the bill image, thereby improving the character recognition accuracy of the bill image.

The text region determining unit 200 is configured to input the target document image into a preset target text region determining model, and determine a target text region in the target document image.

Optionally, the preset target text region determination model may be a convolutional neural network model. Specifically, the preset target text region determination model may be a VGG (Visual Geometry Group) network model.

Optionally, another bill image and text recognition device provided in the embodiment of the present invention may further include: a model training unit for training the predetermined target character region determination model, wherein the model training unit includes: a training image obtaining unit and a target character area determination model obtaining unit,

the training image obtaining unit is used for obtaining at least one note training image marked with a text area.

The target character region determination model obtaining unit is used for performing machine learning on the bill training image to obtain a target character region determination model, wherein the input of the target character region determination model is as follows: the bill image, the output of the target character region determination model is: and determining a target text area in the bill image.

The embodiment of the invention can perform machine learning on the bill training image marked with the text region through the VGG16 model, so that conv5_3 of the VGG16 model outputs a bill training characteristic diagram of the bill training image, and then convolutes the bill training characteristic diagram through preset convolution parameters to obtain the characteristic vector of the text region marked in the bill training image.

In the practical use of the invention, when a target bill image is input into a preset target character area determination model, the preset target character area determination model extracts a bill feature map of the target bill image, the bill feature map is convolved through preset convolution parameters to obtain a feature vector of the bill feature map, and the feature vector of the bill feature map is compared with the feature vector of a character area marked in a bill training image to determine the target character area in the target bill image.

Optionally, the preselected convolution parameters may include a convolution kernel size of 3 × 3.

Alternatively, the boundary of the target text area may be displayed in a color that is distinguished from the target note image, for example, the boundary of the target text area constitutes a yellow label box.

Optionally, in the process of determining the target text region by using the preset target text region determining model, a plurality of mutually partially overlapped preselected text regions may be determined for one actual text region, and in order to make the finally determined target text region closer to the actual text region, redundant regions in the plurality of mutually partially overlapped preselected text regions need to be filtered.

Therefore, the text region determining unit 200 is specifically configured to filter out a target text redundant region in the target document image by a non-maximum suppression method, and determine a target text region in the target document image.

Among them, the Non-Maximum Suppression method (NMS) can suppress elements that are not Maximum, i.e., a Maximum search for one field. In the embodiment of the invention, the target character redundant area in the multiple partially overlapped preselected character areas is filtered by a non-maximum value inhibition method, and the remaining preselected character area after filtering is determined as the target character area.

The image conversion unit 300 is configured to convert the target document image into a text image to be recognized in a YUV color space, increase the contrast of a target text region in the text image to be recognized, and decrease the contrast of a region other than the target text region, so that the contrast of the target text region in the text image to be recognized is higher than the contrast of the text image to be recognized except the target text region.

In practical application, the Color Space (Color Space) of the target bill image collected by the image collecting device is RGB.

Specifically, in the embodiment of the present invention, the contrast of the target text region may be adjusted to be higher than the first contrast, and the contrast of the region other than the target text region may be adjusted to be lower than the second contrast, where the first contrast and the second contrast are separated by a preset value. The preset value can be set according to actual needs. According to the embodiment of the invention, the contrast of the target character area in the character image to be recognized is increased, and the contrast of the area except the target character area is decreased, so that the target character area in the character image to be recognized and the area except the target character area can be obviously distinguished, the complicated step of extracting the target character area from the character image to be recognized is avoided, and the subsequent recognition of characters in the target character area is facilitated.

Optionally, the image conversion unit 300 includes: a YUV color conversion unit and an image scaling unit.

And the YUV color conversion unit is used for converting the target bill image into a bill image to be zoomed in a YUV color space.

And the image zooming unit is used for zooming the bill image to be zoomed according to the zooming proportion corresponding to the bill type to obtain the character image to be recognized.

It will be appreciated that there are many types of documents, each of which has a different actual text area, and that a reasonable scaling of the image can increase the smoothness and clarity of the image. Therefore, the embodiment of the invention can set the corresponding scaling for various types of bills in advance, so that when the bill image to be scaled is scaled, the scaling corresponding to the bill type is used for scaling, so that the character image to be recognized obtained after scaling is clearer, and the character recognition is convenient.

The text content obtaining unit 400 is configured to input the text image to be recognized into a preset text recognition model, and obtain text content in the target text area.

Specifically, the embodiment of the present invention may use a pre-trained character recognition model or use an existing character recognition model to perform character recognition on a target character area in a character image to be recognized, so as to obtain the character content in the target character area.

Specifically, the embodiment of the present invention may use the existing text recognition technology to obtain the text content from the target text area of the text image to be recognized. For example, the embodiment of the present invention may use an OCR (Optical character recognition) technique to recognize a text from a target text region of a text image to be recognized, thereby obtaining text content.

The bill image character recognition device provided by the embodiment of the invention can obtain a target bill image; inputting the target bill image into a preset target character area determination model, and determining a target character area in the target bill image; converting the target bill image into a character image to be recognized in a YUV color space, increasing the contrast of a target character area in the character image to be recognized, and decreasing the contrast of an area except the target character area so as to enable the contrast of the target character area in the character image to be recognized to be higher than the contrast of the character image to be recognized except the target character area; and inputting the character image to be recognized into a preset character recognition model to obtain the character content in the target character area. According to the technical scheme, the target character area of the target bill image is accurately positioned, the contrast is adjusted to distinguish the target character area from other areas, and then character recognition can be performed on the target character area to obtain the character content, so that the technical problem of low character recognition accuracy rate caused by low bill image resolution is solved, and the character recognition accuracy rate is improved.

In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于边缘引导稀疏注意力机制的车牌实时检测方法

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!