CN110991437B - Character recognition method and device, training method and device for character recognition model - Google Patents

Character recognition method and device, training method and device for character recognition model Download PDF

Info

Publication number
CN110991437B
CN110991437B CN201911192163.3A CN201911192163A CN110991437B CN 110991437 B CN110991437 B CN 110991437B CN 201911192163 A CN201911192163 A CN 201911192163A CN 110991437 B CN110991437 B CN 110991437B
Authority
CN
China
Prior art keywords
character
images
classification result
segmentation
preset
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.)
Active
Application number
CN201911192163.3A
Other languages
Chinese (zh)
Other versions
CN110991437A (en
Inventor
翟新刚
张楠赓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canaan Bright Sight Co Ltd
Original Assignee
Canaan Bright Sight 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 Canaan Bright Sight Co Ltd filed Critical Canaan Bright Sight Co Ltd
Priority to CN201911192163.3A priority Critical patent/CN110991437B/en
Publication of CN110991437A publication Critical patent/CN110991437A/en
Application granted granted Critical
Publication of CN110991437B publication Critical patent/CN110991437B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns

Abstract

The invention provides a character recognition method and a device thereof, a training method of a character recognition model and a device thereof, and corresponding computer readable storage media. The character recognition method comprises the following steps: the method and the device are used for decomposing a multi-character recognition task into a plurality of simpler single-character recognition tasks, the recognition efficiency is better, and the single-character images with better recognition effect and higher recognition accuracy are obtained.

Description

Character recognition method and device, training method and device for character recognition model
Technical Field
The invention belongs to the technical field of image recognition, and particularly relates to a character recognition method and device, a training method of a character recognition model and device.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
With the increasing development and perfection of intelligent systems, the development of remote meter reading technology solves the difficulty of manual meter reading statistical work and becomes an important component of modern management systems. Meters such as water meters, electricity meters, gas meters, etc. with wireless meter reading function have begun to be used gradually in residential areas, high-grade parks.
As the basis and the core in the automatic meter reading system of the character wheel type meter, the character recognition function of the character wheel type meter directly determines the quality of the system. In the character recognition function of the conventional character wheel type meter, a multi-character image of the meter is usually subjected to binarization processing and character segmentation processing, and then a character recognition task is decomposed into two tasks of whole character recognition and double half character recognition, wherein the whole character recognition is generally performed by adopting optical character recognition (Optical Character Recognition, OCR). For the recognition of double half characters, a template matching method is generally adopted for recognition.
However, the above-mentioned existing scheme has the following problems: under the poor imaging condition, a proper binarization threshold method is difficult to find to execute binarization processing, which directly influences the poor segmentation effect of the characters and further influences the recognition accuracy of the characters.
Disclosure of Invention
In order to solve the problem that it is difficult to find a suitable binarization threshold method to perform binarization processing in the prior art, a character recognition method of a character wheel type meter, a training method of a character recognition model of the character wheel type meter, and a corresponding device and a computer readable storage medium thereof are provided, by which the problem can be solved.
The present invention provides the following.
In a first aspect, a character recognition method is provided, applied to a character wheel type meter, including:
acquiring a multi-character image of a character wheel type meter, and respectively performing binarization processing on the multi-character image according to a plurality of preset binary thresholds to obtain a plurality of binary images;
performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single-character images from the plurality of single-character images according to the overlapping degree of the character segmentation positions of the plurality of single-character images and the corresponding ideal segmentation positions;
Character information in the multi-character image is determined from the plurality of target single-character images.
In a second aspect, there is provided a character recognition apparatus applied to a character wheel type meter, comprising:
the binarization module is used for acquiring the multi-character image of the character wheel type meter, and respectively executing binarization processing on the multi-character image according to a plurality of preset binary thresholds to obtain a plurality of binary images;
a character segmentation module for performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
the overlapping degree module is used for determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
and the identification module is used for determining character information in the multi-character image from the plurality of target single-character images.
In a third aspect, there is provided a character recognition apparatus applied to a character wheel type meter, comprising:
one or more multi-core processors;
a memory for storing one or more programs;
when executed by one or more multi-core processors, cause the one or more multi-core processors to implement:
acquiring a multi-character image of a character wheel type meter, and respectively performing binarization processing on the multi-character image according to a plurality of preset binary thresholds to obtain a plurality of binary images;
Performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single-character images from the plurality of single-character images according to the overlapping degree of the character segmentation positions of the plurality of single-character images and the corresponding ideal segmentation positions;
character information in the multi-character image is determined from the plurality of target single-character images.
In a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium storing a program which, when executed by a multi-core processor, causes the multi-core processor to perform a method as above.
In a fifth aspect, there is provided a training method of a character recognition model applied to a character wheel type meter, comprising:
acquiring multi-character images of a character wheel type meter, and respectively performing binarization processing on the multi-character images according to a plurality of preset binary thresholds to obtain a plurality of binary images;
performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single-character images from the plurality of single-character images according to the overlapping degree of the character segmentation positions of the plurality of single-character images and the corresponding ideal segmentation positions;
Marking the target single character images respectively, so as to obtain a plurality of target single character images with prior labels, and training the target single character images with prior labels as training samples.
In a sixth aspect, there is provided a training apparatus of a character recognition model applied to a character wheel type meter, comprising:
the binarization module is used for collecting the multi-character images of the character wheel type meter, and respectively executing binarization processing on the multi-character images according to a plurality of preset binary thresholds to obtain a plurality of binary images;
a character segmentation module for performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
the overlapping degree module is used for determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
the training module is used for marking the target single character images respectively so as to obtain a plurality of target single character images with prior labels, and training the target single character images with the prior labels as training samples.
In a seventh aspect, there is provided a character recognition apparatus, the character recognition model being applied to a character wheel type meter, comprising:
one or more multi-core processors;
a memory for storing one or more programs;
when executed by one or more multi-core processors, cause the one or more multi-core processors to implement:
acquiring multi-character images of a character wheel type meter, and respectively performing binarization processing on the multi-character images according to a plurality of preset binary thresholds to obtain a plurality of binary images;
performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single-character images from the plurality of single-character images according to the overlapping degree of the character segmentation positions of the plurality of single-character images and the corresponding ideal segmentation positions;
marking the target single character images respectively, so as to obtain a plurality of target single character images with prior labels, and training the target single character images with prior labels as training samples.
In an eighth aspect, there is provided a computer readable storage medium storing a program which, when executed by a multi-core processor, causes the multi-core processor to perform the method of the fifth aspect.
The above at least one technical scheme adopted by the embodiment of the application can achieve the following beneficial effects: according to the character recognition scheme, binarization processing and character segmentation processing are carried out on the multi-character image by adopting a plurality of preset binary thresholds to obtain a plurality of single-character images, and a single-character image with proper and better recognition effect is found out from the plurality of single-character images according to the overlapping degree of the character segmentation positions of the single-character images and the corresponding ideal segmentation positions to carry out character recognition, so that on one hand, the multi-character recognition task is decomposed into a plurality of simpler single-character recognition tasks, the recognition efficiency is better, on the other hand, the single-character image with better recognition effect is obtained, and the recognition accuracy is higher. Based on the same or similar reasons, the training scheme of the recognition model provided by the application decomposes the multi-character training task into a plurality of simpler single-character training tasks on one hand, and the training efficiency is better. On the other hand, the character recognition model with higher recognition accuracy can be trained as the single character image with higher recognition effect is obtained for training.
It should be understood that the foregoing description is only an overview of the technical solutions of the present application, so that the technical means of the present application may be more clearly understood and implemented in accordance with the content of the specification. The following description of the present application will be made to explain the present application in detail in order to make the above and other objects, features and advantages of the present application more apparent.
Drawings
The advantages and benefits described herein, as well as other advantages and benefits, will become apparent to those of ordinary skill in the art upon reading the following detailed description of the exemplary embodiments. The drawings are only for purposes of illustrating exemplary embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a flow chart of a character recognition method according to an embodiment of the invention;
fig. 2a is a schematic diagram of a multi-character image, fig. 2b, fig. 2c, and fig. 2d are schematic diagrams of binary pictures of the multi-character image corresponding to different preset binary thresholds, respectively, according to an embodiment of the present invention;
fig. 3a is a schematic diagram of performing horizontal character segmentation on a binary image according to an embodiment of the present invention, and fig. 3b is a schematic diagram of performing vertical character segmentation on a binary image according to an embodiment of the present invention;
FIG. 4 is a diagram showing a ratio of an intersection area to a union area of a character segmentation position of a single character image and a corresponding ideal segmentation position according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a double half character in an embodiment of the invention;
FIG. 6 is a schematic diagram of a character recognition device according to an embodiment of the present invention;
Fig. 7 is a schematic diagram of a character recognition apparatus according to another embodiment of the present invention;
FIG. 8 is a flow chart of a training method of a character recognition model according to an embodiment of the invention;
FIG. 9 is a schematic diagram of a training device for character recognition models according to an embodiment of the present invention;
fig. 10 is a schematic structural view of a training device for a character recognition model according to another embodiment of the present invention.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
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.
In the present invention, it should be understood that terms such as "comprises" or "comprising," etc., are intended to indicate the presence of features, numbers, steps, acts, components, portions, or combinations thereof disclosed in the specification, and are not intended to exclude the possibility of the presence of one or more other features, numbers, steps, acts, components, portions, or combinations thereof.
In addition, it should be noted that, without conflict, the embodiments of the present application and the features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
Fig. 1 is a flowchart of a character recognition method 100 according to an embodiment of the present application, where the character recognition method 100 is used to recognize character information on a character wheel type meter. In this flow, from a device perspective, the execution subject may be one or more electronic devices, more specifically, functional modules associated with cameras in these devices; from the program perspective, the execution subject may be a program mounted on these electronic devices, accordingly.
The flow in fig. 1 may include the following steps 101 to 104.
Step 101: acquiring a multi-character image of a character wheel type meter, and respectively performing binarization processing on the multi-character image according to a plurality of preset binary thresholds to obtain a plurality of binary images;
specifically, the character wheel type meter is a meter device for displaying numbers marked on a plurality of character wheels in a plurality of transparent reading frames respectively by driving the plurality of character wheels to rotate, so that a user can read the numbers, such as a water meter, a gas meter and the like which are common in life. The multi-character image is at least one frame of image acquired by an image pickup device arranged above the character wheel type meter, and referring to fig. 2a, a gray scale of the multi-character image is shown, and multi-character information contained in the multi-character image is used for indicating display numbers in a plurality of transparent reading frames of the character wheel type meter. Of course the multi-character image may have other sources, such as from other devices, or may be an off-the-shelf image, as the application is not limited in this regard.
Specifically, in digital Image processing, the outline of an object of interest can be highlighted by performing binarization processing on an Image, where the binarization processing refers to that a gray-scale Image with 256 brightness levels is selected by a proper threshold value to obtain a Binary Image (Binary Image) which can still reflect the whole and partial characteristics of the Image, and the Binary Image refers to an Image state that each pixel on the Image has only two possible values, and can be expressed by black and white, B & W, and a monochrome Image. Specifically, a pixel gray value greater than or equal to a preset binary threshold in the gray image is set to 255 for representing a specific object, and a pixel gray value less than the preset binary threshold is set to 0 for representing a background area. In this embodiment, the plurality of preset binary thresholds used for binarizing the multi-character image may be specifically determined by a predetermined first threshold range, and for example, a plurality of values may be uniformly found in the first threshold range as the preset binary thresholds.
For example, referring to fig. 2b, fig. 2c and fig. 2d, a plurality of binary images obtained by performing binarization processing on different preset binary thresholds are shown, wherein the preset binary threshold corresponding to the binary image shown in fig. 2b is 0.35 x (gray_max+gray_min), the preset binary threshold corresponding to the binary image shown in fig. 2c is 0.40 x (gray_max+gray_min), and the preset binary threshold corresponding to the binary image shown in fig. 2d is 0.45 x (gray_max+gray_min), wherein the gray_max and the gray_min are respectively the maximum gray value and the minimum gray value in the gray map, and it can be seen that the display effects of the three binary images on the character outline are different, if one of the binary images is simply selected as the preset binary threshold, the recognition error is easy to occur, and the probability of error occurrence is reduced by setting the preset binary thresholds.
Step 102: performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
specifically, the character segmentation process refers to cutting image areas corresponding to different characters in the binary image apart from each other, and removing as much of the background area in each image area as possible for easy recognition. The method has the advantages that the operation amount required by overall recognition of the multi-character image is large, the efficiency is low, time and labor are wasted, the multi-character recognition task can be decomposed into a single-character recognition task through character segmentation processing, and the recognition efficiency is obviously improved. For example, when character segmentation processing is performed on a plurality of binary images as shown in fig. 2b, 2c and 2d, five single character images can be obtained for each binary image, and recognition of a single character image is significantly less difficult than recognition of a multi-character image.
Step 103: determining a plurality of target single-character images from the plurality of single-character images according to the overlapping degree of the character segmentation positions of the plurality of single-character images and the corresponding ideal segmentation positions;
theoretically, the more suitable the binary threshold value is, the better the recognition effect of the segmented single character image is, and the greater the overlapping degree of the character segmentation position of the segmented single character image and the corresponding ideal segmentation position is. Therefore, the application adopts a reverse judgment mode, and finds the single character image with better recognition effect as a target single character image to recognize by analyzing the overlapping degree of the character segmentation position of the segmented single character image and the corresponding ideal segmentation position. Alternatively, the ideal division position is an edge position of the transparent viewfinder corresponding to each character.
Step 104: character information in the multi-character image is determined from the plurality of target single-character images.
According to the method, the binary processing and the character segmentation processing are carried out on the multi-character image by adopting a plurality of preset binary thresholds to obtain a plurality of single-character images, and the single-character images with proper binary threshold and better recognition effect are found out from the plurality of single-character images according to the overlapping degree of the character segmentation positions of the single-character images and the corresponding ideal segmentation positions to carry out character recognition, so that on one hand, the multi-character recognition task is decomposed into a plurality of simpler single-character recognition tasks, the recognition efficiency is better, and on the other hand, the single-character images with better recognition effect are obtained, and the recognition accuracy is higher.
Some embodiments of the present application further provide some specific implementations of the character recognition method based on the character recognition method of fig. 1, and the extension schemes thereof, which are described below.
In an embodiment, the method 100 may further include: determining a plurality of preset binary thresholds from a first threshold range: and determining a reduced first threshold range from the acquired target single character images, and redefining a plurality of preset binary thresholds from the reduced first threshold range to reduce the data processing amount in the next recognition process.
For example, referring to fig. 2b, 2c and 2d, if the most part of the target single character image determined later is from fig. 2b and 2c, the first threshold range may be narrowed to not include the preset binary threshold 0.45 x (gray_max+gray_min). Alternatively, since photographing brightness is different in different periods of the day, a time factor of photographing the multi-character image may be comprehensively considered, so that the first threshold range is narrowed in periods.
It can be understood that the optimal preset binary thresholds corresponding to the acquired multi-character images in different shooting environments are inconsistent, however, the distribution condition of the preset binary thresholds corresponding to the determined target single-character images is counted, so that the range of the first threshold can be adaptively narrowed, the data processing amount required in the subsequent recognition process is further reduced, and the processing efficiency is improved.
In one embodiment, step 102 may include: obtaining a plurality of character segmentation positions respectively corresponding to a plurality of single character images by respectively performing vertical projection and horizontal projection on the plurality of binary images; character segmentation processing is performed on the plurality of binary images according to a plurality of character segmentation positions respectively corresponding to the plurality of single character images to form a plurality of single character images.
For example, referring to fig. 3a and 3b, schematic diagrams of character segmentation of the binary image shown in fig. 2b are shown, and optionally, when character segmentation processing is performed on the binary image in a horizontal direction or a vertical direction, a portion with a character width exceeding a set threshold is selected for character segmentation, so as to avoid adverse effects of impurity portions in the image on character segmentation.
In an embodiment, the method 100 may further include: determining a corresponding ideal segmentation position from the character segmentation position of each of the plurality of single character images; calculating the ratio of the intersection area and the union area of the character segmentation position of each single character image and the corresponding ideal segmentation position, so as to determine the overlapping degree of the character segmentation positions of a plurality of single character images and the corresponding ideal segmentation positions;
specifically, the multi-character image is preset with a plurality of preset character areas, and ideal dividing positions are respectively calibrated in each preset character area. Specifically, the character segmentation position at least partially falls within a preset character region to which the corresponding ideal segmentation position belongs; optionally, the ideal dividing position may be specifically an edge position of a transparent reading frame of the meter, and the ideal dividing position may be determined by performing at least one active calibration after the image capturing device of the character wheel type meter is set.
For example, referring to fig. 4, a schematic diagram of calculating a ratio of an intersection area to a union area of a character segmentation position of a single character image and a corresponding ideal segmentation position is shown, where a region a is a region surrounded by the character segmentation position of the single character image and a region B is a region surrounded by the corresponding ideal segmentation position. In theory, the character segmentation positions of the single character images should all fall into the area surrounded by the corresponding ideal segmentation positions, so that for a plurality of single character images corresponding to each character area, a single character image with the ratio of the intersection area of the character segmentation positions and the corresponding ideal segmentation positions to the union area belonging to the global maximum or exceeding a certain proportion can be selected as a target single character image, and further, the single character image with better recognition effect can be obtained.
In an embodiment, step 103 may specifically include: acquiring a plurality of first single character images corresponding to a target binary threshold value from a plurality of single character images as a plurality of target single character images; the overlapping degree of the first character segmentation positions of the first single character images and the ideal segmentation positions corresponding to the first character segmentation positions exceeds a preset overlapping degree threshold value.
For example, the process adopted according to the judgment criteria in the present embodiment may include the following steps (a) to (f):
(a) Selecting one preset binary threshold value from a plurality of preset binary threshold values as a binary threshold value to be measured,
(b) Acquiring a plurality of single character images corresponding to the binary threshold to be detected, and extracting a plurality of character segmentation positions of the plurality of single character images;
(c) Determining a preset character area and an ideal segmentation position corresponding to each character segmentation position by the plurality of character segmentation positions, and respectively calculating the overlapping degree of the plurality of character segmentation positions and the ideal segmentation position corresponding to each character segmentation position so as to obtain a plurality of first overlapping degrees;
(d) Judging whether all the first overlapping degrees exceed a preset overlapping degree threshold value or not;
(e) If the first overlapping degree exceeds a preset overlapping degree threshold value, determining the binary threshold value to be detected as a target binary threshold value, and selecting a plurality of first single character images corresponding to the binary threshold value to be detected as a plurality of target single character images;
(f) And (c) if the first overlapping degree does not exceed the preset overlapping degree threshold value, selecting another preset binary threshold value from the preset binary threshold values, updating the binary threshold value to be tested, and repeatedly executing the steps (b) - (f) according to the updated binary threshold value to be tested until the target binary threshold value and the target single character images are determined.
Compared with the previous embodiment, the technical solution provided by the present embodiment does not need to globally judge all the single character images acquired according to a plurality of preset binary thresholds, but can sequentially select a certain preset binary threshold from the plurality of preset binary thresholds and perform single judgment, when the overlapping degree of the character segmentation position of each single character image and the corresponding ideal segmentation position in the plurality of single character images acquired according to a certain selected preset binary threshold can exceed a preset overlapping degree threshold, the plurality of single character images corresponding to the preset binary threshold can be considered to reach the recognition standard, and then the next recognition process can be performed.
In an embodiment, step 103 may further include the following steps (x) - (z):
(x) Acquiring a plurality of second single character images corresponding to each preset character area in a plurality of preset character areas from the plurality of single character images, and extracting a plurality of second character segmentation positions of the plurality of second single character images;
(y) calculating the overlapping degree of the plurality of second character segmentation positions and the ideal segmentation positions of the corresponding preset character areas respectively, thereby obtaining a plurality of second overlapping degrees;
(z) determining a second single character image having the highest second overlapping degree from the plurality of second single character images as a target single character image corresponding to each of the plurality of preset character areas.
Specifically, in the present embodiment, by comparing the overlapping degrees of the plurality of single character images corresponding to the same preset character area, it is equivalent to performing the partition discrimination for each preset character area to obtain the single character image with the best recognition effect corresponding to each preset character area. Compared with the method based on threshold judgment, the technical scheme adopted by the embodiment can obtain the target single character image with better recognition effect by independently carrying out partition judgment on the plurality of single character images of each preset character area.
In an embodiment, the method 100 further comprises: and randomly adding edges to the determined target single character image, and then carrying out character recognition. And further, the problems of poor quality of the binarized image and unclean character segmentation in practical application are solved.
In one embodiment, step 104 may include: inputting a plurality of target single character images into a convolutional neural network for classification and identification, wherein the classification result of the convolutional neural network comprises a plurality of whole character categories and a plurality of double-half character categories; wherein the plurality of whole character categories includes: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of two-half character categories include: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
For example, referring to fig. 5, the present embodiment can solve the problem that the number displayed in the transparent reading frame of the character type meter may be double half-character, by classifying the classification result into 20 categories. Compared with the scheme of determining double half characters by means of template matching in the prior art, the method and the device have the advantages that the convolutional neural network is adopted for classification and identification, and identification accuracy and identification efficiency are remarkably improved.
In one embodiment, since the classification result output by the convolutional neural network includes multiple two-half character categories, in order to output a more certain recognition result, the method 100 further includes: outputting a first classification result with the highest probability and a second classification result with the second highest probability by the convolutional neural network, and determining character information of the multi-character image according to the first classification result and the second classification result.
Specifically, the classification categories of the first classification result and the second classification result include three cases, and for each case, the scheme for determining the final recognition result includes:
(1) If the first classification result and the second classification result belong to the whole character category, determining character information of the multi-character image according to the first classification result;
(2) If the first classification result and the second classification result belong to the double-half character category, determining character information of the multi-character image according to the first classification result;
(3) And if the first classification result and the second classification result respectively belong to one of the whole character category and the double-half character category, selecting the classification result belonging to the whole character category from the first classification result and the second classification result to determine the character information of the multi-character image.
Further, in the above case (2), the identification result cannot be uniquely determined, and in order to further output the uniquely determined identification result, further comprising: determining the character digit of the first character indicated by the first classification result in the multi-character image; if the first character is at the lowest position in the multi-character image, determining character information of the multi-character image according to any one character in the double-half character category of the first classification result; if the first character is not at the lowest position in the multi-character image, determining character information of the multi-character image by combining a classification result of a second character in the multi-character image, wherein the second character is an adjacent low-order character of the first character.
For example, when the recognition results of two adjacent digits are both of the two-half character type, a recognition error is likely to occur, for example, the classification result of ten digits is 34, the recognition result of one digit is 90, and at this time, it is reasonable to select 39 or 40 for the combined recognition result of one digit and ten digits, and if 49 is selected, a large deviation is caused. In view of the above situation, the present embodiment adopts a scheme of performing comprehensive judgment by combining the character recognition result of the lower one (for example, one bit) in the multi-character image when the character indicated by the first classification result outputted by the convolutional neural network is in the non-lowest bit (for example, ten bits) in the multi-character image, so as to avoid the situation of recognition error when the recognition results of two adjacent digits are both binary character types.
Fig. 6 is a schematic structural view of a character recognition apparatus 60 according to an embodiment of the present application for performing a character recognition method of the character wheel type meter shown in fig. 1.
As shown in fig. 6, the character recognition device 60 includes:
the binarization module 601 is configured to obtain a multi-character image of the character wheel type meter, and perform binarization processing on the multi-character image according to a plurality of preset binary thresholds, so as to obtain a plurality of binary images;
a character segmentation module 602 for performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
an overlapping degree module 603, configured to determine a plurality of target single-character images from the plurality of single-character images according to overlapping degrees of character segmentation positions of the plurality of single-character images and respective corresponding ideal segmentation positions;
the recognition module 604 is configured to determine character information in the multi-character image from the plurality of target single-character images.
In an embodiment, the apparatus further comprises a binary threshold module for: determining a plurality of preset binary thresholds from a first threshold range: the first threshold range is narrowed by a plurality of target single character images.
In one embodiment, the character segmentation module is configured to: obtaining a plurality of character segmentation positions respectively corresponding to a plurality of single character images by respectively performing vertical projection and horizontal projection on the plurality of binary images; character segmentation processing is performed on the plurality of binary images according to a plurality of character segmentation positions respectively corresponding to the plurality of single character images to form a plurality of single character images.
In one embodiment, the overlap module is configured to: determining a corresponding ideal segmentation position from the character segmentation position of each single character image in the plurality of single character images, wherein the character segmentation position at least partially falls within a preset character region to which the corresponding ideal segmentation position belongs; calculating the ratio of the intersection area and the union area of the character segmentation position of each single character image and the corresponding ideal segmentation position, so as to determine the overlapping degree of the character segmentation positions of a plurality of single character images and the corresponding ideal segmentation positions; the multi-character image is preset with a plurality of preset character areas, and ideal dividing positions are respectively calibrated in each preset character area.
In one embodiment, the overlap module is further to: acquiring a plurality of first single character images corresponding to a target binary threshold value in a plurality of preset binary threshold values from a plurality of single character images as target single character images; the overlapping degree of the first character segmentation positions of the first single character images and the ideal segmentation positions corresponding to the first character segmentation positions exceeds a preset overlapping degree threshold value.
In one embodiment, the overlap module is further to: acquiring a plurality of second single character images corresponding to each preset character area in a plurality of preset character areas from the plurality of single character images, and extracting a plurality of second character segmentation positions of the plurality of second single character images; respectively calculating the overlapping degree of the plurality of second character segmentation positions and the ideal segmentation positions of the corresponding preset character areas, so as to obtain a plurality of second overlapping degrees; the second single character image having the highest second overlapping degree is determined from the plurality of second single character images as a target single character image corresponding to each of the plurality of preset character areas.
In an embodiment, the apparatus is for: and randomly adding edges to the determined target single character image, and then carrying out character recognition.
In an embodiment, the identification module is further configured to: inputting a plurality of target single character images into a convolutional neural network for classification and identification, wherein the classification result of the convolutional neural network comprises a plurality of whole character categories and a plurality of double-half character categories; wherein the plurality of whole character categories includes: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of two-half character categories include: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
In an embodiment, the identification module is further configured to: outputting a first classification result with the highest probability and a second classification result with the second highest probability by the convolutional neural network, and determining character information of the multi-character image according to the first classification result and the second classification result; if the first classification result and the second classification result belong to the whole character category, determining character information of the multi-character image according to the first classification result; if the first classification result and the second classification result belong to the double-half character category, determining character information of the multi-character image according to the first classification result; if the first classification result and the second classification result respectively belong to one of the whole character category and the double-half character category, selecting the classification result belonging to the whole character category from the first classification result and the second classification result to determine the character information of the multi-character image.
In an embodiment, if the first classification result and the second classification result both belong to the two-half character category, the identification module is further configured to: determining the character digit of the first character indicated by the first classification result in the multi-character image; if the first character is at the lowest position in the multi-character image, determining character information of the multi-character image according to any one character in the double-half character category of the first classification result; if the first character is not at the lowest position in the multi-character image, determining character information of the multi-character image by combining a classification result of a second character in the multi-character image, wherein the second character is an adjacent low-order character of the first character.
Fig. 7 is a character recognition apparatus for performing the character recognition method shown in fig. 1 according to an embodiment of the present application, the apparatus comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform:
acquiring a multi-character image of a character wheel type meter, and respectively executing binarization processing on the multi-character image according to a plurality of preset binary thresholds to obtain a plurality of binary images;
Performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
character information in the multi-character image is determined from the plurality of target single-character images.
According to some embodiments of the present application, there is provided a non-volatile computer storage medium having stored thereon computer executable instructions configured to, when executed by a processor, perform:
acquiring a multi-character image of a character wheel type meter, and respectively executing binarization processing on the multi-character image according to a plurality of preset binary thresholds to obtain a plurality of binary images;
performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
character information in the multi-character image is determined from the plurality of target single-character images.
Fig. 8 is a flow chart of a training method 800 of a character recognition model for recognizing character information on a character wheel type meter according to an embodiment of the present application. In this flow, from a device perspective, the execution subject may be one or more electronic devices, more specifically, functional modules associated with cameras in these devices; from the program perspective, the execution subject may be a program mounted on these electronic devices, accordingly.
The flow in fig. 8 may include the following steps 801 to 804.
Step 801: acquiring multi-character images of a character wheel type meter, and respectively performing binarization processing on the multi-character images according to a plurality of preset binary thresholds to obtain a plurality of binary images;
specifically, the character wheel type meter is a meter device for displaying numbers marked on a plurality of character wheels in a plurality of transparent reading frames respectively by driving the plurality of character wheels to rotate, so that a user can read the numbers, such as a water meter, a gas meter and the like which are common in life. The multi-character image is at least one frame of image acquired by an image pickup device arranged above the character wheel type meter, and referring to fig. 2a, a gray scale of the multi-character image is shown, and multi-character information contained in the multi-character image is used for indicating display numbers in a plurality of transparent reading frames of the character wheel type meter. Of course the multi-character image may have other sources, such as from other devices, or may be an off-the-shelf image, as the application is not limited in this regard.
Specifically, in digital Image processing, the outline of an object of interest can be highlighted by performing binarization processing on an Image, where the binarization processing refers to that a gray-scale Image with 256 brightness levels is selected by a proper threshold value to obtain a Binary Image (Binary Image) which can still reflect the whole and partial characteristics of the Image, and the Binary Image refers to an Image state that each pixel on the Image has only two possible values, and can be expressed by black and white, B & W, and a monochrome Image. Specifically, a pixel gray value greater than or equal to a preset binary threshold in the gray image is set to 255 for representing a specific object, and a pixel gray value less than the preset binary threshold is set to 0 for representing a background area. In this embodiment, the plurality of preset binary thresholds used for binarizing the multi-character image may be specifically determined by a predetermined first threshold range, and for example, a plurality of values may be uniformly found in the first threshold range as the preset binary thresholds.
For example, referring to fig. 2b, fig. 2c and fig. 2d, a plurality of binary images obtained by performing binarization processing on different preset binary thresholds are shown, wherein the preset binary threshold corresponding to the binary image shown in fig. 2b is 0.35 x (gray_max+gray_min), the preset binary threshold corresponding to the binary image shown in fig. 2c is 0.40 x (gray_max+gray_min), and the preset binary threshold corresponding to the binary image shown in fig. 2d is 0.45 x (gray_max+gray_min), wherein the gray_max and the gray_min are respectively the maximum gray value and the minimum gray value in the gray map, and it can be seen that the display effect of the three binary images on the character contour is different, if one of the binary images is simply selected as the preset binary threshold, the recognition accuracy of the character recognition model obtained by the final training is not high, and the training effect is reduced by setting a plurality of preset binary thresholds.
Step 802: performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
specifically, the character segmentation process refers to cutting image areas corresponding to different characters in the binary image apart from each other, and removing as much of the background area in each image area as possible to facilitate training. The multi-character image training method has the advantages that the operation amount required by the whole training of the multi-character image is large, the efficiency is low, time and labor are wasted, the multi-character training task can be decomposed into a single-character training task through character segmentation processing, the training efficiency is obviously improved, and meanwhile, the recognition accuracy of the character recognition model is improved. For example, after character segmentation processing is performed on a plurality of binary images as shown in fig. 2b, 2c and 2d, five single character images can be obtained for each binary image, and the difficulty of training the single character images is significantly smaller than that of training the multi-character images. For example, the surface designs of different character wheel meters are inconsistent, the display distances between single characters are also inconsistent, if a scheme for training the multi-character images is adopted, the multi-character images of a plurality of different character wheel meters need to be collected as training samples, the operation scale is extremely large, and the problem can be solved by decomposing the multi-character images into single character images for training.
Step 803: determining a plurality of target single-character images from the plurality of single-character images according to the overlapping degree of the character segmentation positions of the plurality of single-character images and the corresponding ideal segmentation positions;
theoretically, the more suitable the binary threshold is, the better the training effect of the segmented single character image is, and the greater the overlapping degree of the character segmentation position of the segmented single character image and the corresponding ideal segmentation position is. Therefore, the application adopts a reverse judgment mode, and finds the single character image with better training effect as a target single character image to train by analyzing the overlapping degree of the character segmentation position of the segmented single character image and the corresponding ideal segmentation position. Alternatively, the ideal division position is an edge position of the transparent viewfinder corresponding to each character.
Step 804: marking the target single character images respectively, so as to obtain a plurality of target single character images with prior labels, and training the target single character images with prior labels as training samples.
Specifically, each target single character image in the plurality of target single character images is marked with a priori label according to actual character information of the multi-character image, and training of a character recognition model is carried out according to the plurality of target single character images and the priori labels corresponding to the target single character images. For example, the five single character images segmented in fig. 2a may be labeled with a priori labels of "0", "3", "4", respectively. Further, a plurality of target single character images are used as training samples to be input into an untrained character recognition model, character recognition results are output by the untrained character recognition model, the character recognition results are compared with prior labels of corresponding target single character images, various weight parameters in the character recognition model are adjusted according to the comparison results, and then the character recognition model with higher accuracy can be obtained after a large number of samples are trained.
According to the application, binarization processing and character segmentation processing are carried out on the multi-character image by adopting a plurality of preset binary thresholds to obtain a plurality of single character images, and a proper single character image with better training effect is selected from the plurality of single character images according to the overlapping degree of the character segmentation positions of the single character images and the corresponding ideal segmentation positions to train a character recognition model. On the other hand, the character recognition model with higher recognition accuracy can be trained as the single character image with higher recognition effect is obtained for training.
Based on the training method of fig. 8, some embodiments of the present application also provide some specific implementations of the training method, and the extension schemes, which are described below.
In an embodiment, the method 800 may further include: determining a plurality of preset binary thresholds from a first threshold range: determining a target threshold value in a plurality of preset binary threshold values according to the acquired target single character image; and reducing the first threshold range by the target threshold, and redefining a plurality of preset binary thresholds by the reduced first threshold range so as to reduce the data processing amount in the next training process.
For example, referring to fig. 2b, 2c and 2d, if the most part of the target single character image determined later is from fig. 2b and 2c, the first threshold range may be narrowed to not include the preset binary threshold 0.45 x (gray_max+gray_min). It can be understood that the optimal preset binary thresholds corresponding to the acquired multi-character images in different shooting environments are inconsistent, however, the first threshold range can be adaptively narrowed by counting the distribution situation of the preset binary thresholds corresponding to the determined target single-character images, so that the data processing amount required in the subsequent training process is further reduced, and the processing efficiency is improved. Alternatively, since photographing brightness is different in different periods of the day, a time factor of photographing the multi-character image may be comprehensively considered, so that the first threshold range is narrowed in periods.
In one embodiment, step 802 may include: obtaining a plurality of character segmentation positions respectively corresponding to a plurality of single character images by respectively performing vertical projection and horizontal projection on the plurality of binary images; character segmentation processing is performed on the plurality of binary images according to a plurality of character segmentation positions respectively corresponding to the plurality of single character images to form a plurality of single character images.
For example, referring to fig. 3a and 3b, schematic diagrams of character segmentation of the binary image shown in fig. 2b are shown, and optionally, when character segmentation processing is performed on the binary image in a horizontal direction or a vertical direction, a portion with a character width exceeding a set threshold is selected for character segmentation, so as to avoid adverse effects of impurity portions in the image on character segmentation.
In an embodiment, the method 800 may further include: determining a corresponding ideal segmentation position from the character segmentation position of each of the plurality of single character images; calculating the ratio of the intersection area and the union area of the character segmentation position of each single character image and the corresponding ideal segmentation position, so as to determine the overlapping degree of the character segmentation positions of a plurality of single character images and the corresponding ideal segmentation positions;
specifically, the multi-character image is preset with a plurality of preset character areas, and ideal dividing positions are respectively calibrated in each preset character area. Specifically, the character segmentation position at least partially falls within a preset character region to which the corresponding ideal segmentation position belongs; optionally, the ideal dividing position is specifically an edge position of a transparent reading frame of the meter, and the ideal dividing position can be determined by performing active calibration at least once after the image pickup device of the character wheel type meter is arranged.
For example, referring to fig. 4, a schematic diagram of calculating a ratio of an intersection area to a union area of a character segmentation position of a single character image and a corresponding ideal segmentation position is shown, where a region a is a region surrounded by the character segmentation position of the single character image and a region B is a region surrounded by the corresponding ideal segmentation position. In theory, the character segmentation positions of the single character images should all fall into the area surrounded by the corresponding ideal segmentation positions, so that for a plurality of single character images corresponding to each character area, a single character image with the ratio of the intersection area of the character segmentation positions and the corresponding ideal segmentation positions to the union area belonging to the global maximum or exceeding a certain proportion can be selected as a target single character image, and further, the single character image with better training effect can be obtained.
In an embodiment, step 803 may specifically include: acquiring a plurality of first single character images corresponding to a target binary threshold value from a plurality of single character images as a plurality of target single character images; the overlapping degree of the first character segmentation positions of the first single character images and the ideal segmentation positions corresponding to the first character segmentation positions exceeds a preset overlapping degree threshold value.
For example, the process adopted according to the judgment criteria in the present embodiment may include the following steps (a) to (f):
(a) Selecting one preset binary threshold value from a plurality of preset binary threshold values as a binary threshold value to be measured,
(b) Acquiring a plurality of single character images corresponding to the binary threshold to be detected, and extracting a plurality of character segmentation positions of the plurality of single character images;
(c) Determining a preset character area and an ideal segmentation position corresponding to each character segmentation position by the plurality of character segmentation positions, and respectively calculating the overlapping degree of the plurality of character segmentation positions and the ideal segmentation position corresponding to each character segmentation position so as to obtain a plurality of first overlapping degrees;
(d) Judging whether all the first overlapping degrees exceed a preset overlapping degree threshold value or not;
(e) If the first overlapping degree exceeds a preset overlapping degree threshold value, determining the binary threshold value to be detected as a target binary threshold value, and selecting a plurality of first single character images corresponding to the binary threshold value to be detected as a plurality of target single character images;
(f) And (c) if the first overlapping degree does not exceed the preset overlapping degree threshold value, selecting another preset binary threshold value from the preset binary threshold values, updating the binary threshold value to be tested, and repeatedly executing the steps (b) - (f) according to the updated binary threshold value to be tested until the target binary threshold value and the target single character images are determined.
Compared with the previous embodiment, the technical solution provided by the present embodiment does not need to globally judge all the single character images acquired according to a plurality of preset binary thresholds, but can sequentially select a certain preset binary threshold from the plurality of preset binary thresholds and perform single judgment, when the overlapping degree of the character segmentation position of each single character image in the plurality of single character images acquired according to the certain selected preset binary threshold and the corresponding ideal segmentation position can exceed a preset overlapping degree threshold, the plurality of single character images corresponding to the preset binary threshold can be considered to reach the training sample standard, and further the next training process can be performed.
In an embodiment, step 803 may further include the following steps (x) - (z):
(x) Acquiring a plurality of second single character images corresponding to each preset character area in a plurality of preset character areas from the plurality of single character images, and extracting a plurality of second character segmentation positions of the plurality of second single character images;
(y) calculating the overlapping degree of the plurality of second character segmentation positions and the ideal segmentation positions of the corresponding preset character areas respectively, thereby obtaining a plurality of second overlapping degrees;
(z) determining a second single character image having the highest second overlapping degree from the plurality of second single character images as a target single character image corresponding to each of the plurality of preset character areas.
Specifically, in this embodiment, by comparing the overlapping degrees of the plurality of single-character images corresponding to the same preset character area, it is equivalent to performing the partition discrimination for each preset character area to obtain the single-character image corresponding to each preset character area with the best training effect. Compared with the method based on threshold judgment, the technical scheme adopted by the embodiment can obtain the target single character image with better training effect by independently carrying out partition judgment on the plurality of single character images of each preset character area.
In an embodiment, the method 800 further comprises: before marking the target single character images, edges are randomly added to the target single character images. And further, the problems of poor quality of the binarized image and unclean character segmentation in practical application are solved.
In an embodiment, step 804 may include: inputting a plurality of target single character images with prior labels into a convolutional neural network as training samples to carry out classification recognition training, wherein the classification result of the convolutional neural network and/or the classes of the prior labels comprise a plurality of whole character classes and a plurality of double half character classes;
Wherein the plurality of whole character categories includes: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of two-half character categories include: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
For example, referring to fig. 5, for the case that the number displayed in the transparent reading frame of the character type meter may be double half-character, the embodiment can solve the problem by classifying the classification result and the prior label by 20. Compared with the scheme of determining double half characters through a template matching mode in the prior art, the method and the device have the advantages that the convolutional neural network is adopted for classification recognition training, so that the accuracy and the training efficiency of the trained character recognition model are remarkably improved.
In one embodiment, since the classification result output by the convolutional neural network includes multiple two-half character categories, in order to output a more certain recognition result, the method 800 may further include: the first classification result with the highest probability and the second classification result with the second highest probability are output by the convolutional neural network.
Further, the classification categories of the first classification result and the second classification result include the following three cases:
(1) If the first classification result and the second classification result belong to the whole character category, further performing classification recognition training by the first classification result and the prior label of the target single character image;
(2) If the first classification result and the second classification result belong to the double-half character category, performing classification recognition training by the prior labels of the first classification result and the target single-character image;
(3) If the first classification result and the second classification result respectively belong to one of the whole character category and the double-half character category, selecting the classification result belonging to the whole character category from the first classification result and the second classification result, and carrying out classification recognition training on the classification result belonging to the whole character category and the prior label of the target single-character image.
Specifically, the weight parameters of each level in the convolutional neural network can be adjusted after the determined classification result is compared with the prior label of the target single character image. Alternatively, the first classification result and the second classification result can be respectively compared with the prior labels of the target single character images, and then all levels of weight parameters in the convolutional neural network can be adjusted.
Further, in the above case (2), the unique classification result may still not be determined, and in order to further output the uniquely determined classification result, further comprising: determining the character digit of the first character indicated by the first classification result in the multi-character image; if the first character is at the lowest position in the multi-character image, performing classification recognition training according to any one character in the double-half character category of the first classification result; if the first character is not at the lowest position in the multi-character image, performing classification recognition training by combining the classification result of the second character in the multi-character image, wherein the second character is the adjacent low-order character of the first character.
For example, when the classification results of two adjacent digits are both of the two-half character type, a classification error is likely to occur, for example, the classification result of ten digits is 34, the classification result of one digit is 90, at this time, if the classification results of one digit and ten digits are comprehensively considered, it is reasonable to determine that the two digits are 39 or 40, and if 49 is selected, a larger deviation is caused. In view of the above situation, the present embodiment adopts a scheme that, when the character indicated by the first classification result output by the convolutional neural network is in the non-lowest position (for example, ten positions) in the multi-character image, performs comprehensive judgment in combination with the classification result of the character in the lower position (for example, one position) in the multi-character image, so as to avoid the situation that classification errors occur when the classification results of two adjacent digits are both of the two-half character type.
Fig. 9 is a schematic structural diagram of a training apparatus 90 for a character recognition model according to an embodiment of the present application, for performing the training method shown in fig. 8.
As shown in fig. 9, the character recognition device 90 includes:
the binarization module 901 is used for collecting multi-character images of the character wheel type meter, and respectively executing binarization processing on the multi-character images according to a plurality of preset binary thresholds to obtain a plurality of binary images;
A character segmentation module 902, configured to perform character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
an overlapping degree module 903, configured to determine a plurality of target single character images from the plurality of single character images according to overlapping degrees of character segmentation positions of the plurality of single character images and respective corresponding ideal segmentation positions;
the training module 904 is configured to perform marking on the plurality of target single-character images respectively, thereby obtaining a plurality of target single-character images each having an a priori label, and perform training with the plurality of target single-character images each having an a priori label as a training sample.
In an embodiment, the apparatus further comprises a binary threshold module for: determining the plurality of preset binary thresholds from a second threshold range: the second threshold range is narrowed by the plurality of target single character images.
In an embodiment, the character segmentation module is configured to: respectively performing vertical projection and horizontal projection on the plurality of binary images to obtain a plurality of character segmentation positions respectively corresponding to the plurality of single character images; and respectively performing character segmentation processing on the binary images according to the character segmentation positions respectively corresponding to the single character images so as to form the single character images.
In an embodiment, the overlapping degree module is configured to: determining a corresponding ideal segmentation position from the character segmentation position of each single character image in the plurality of single character images, wherein the character segmentation position at least partially falls within a preset character region to which the corresponding ideal segmentation position belongs; calculating the ratio of the intersection area and the union area of the character segmentation position of each single character image and the corresponding ideal segmentation position, so as to determine the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions; the multi-character image is preset with a plurality of preset character areas, and ideal dividing positions are respectively calibrated in each preset character area.
In an embodiment, the overlapping degree module is further configured to: acquiring a plurality of first single character images corresponding to a target binary threshold value in a plurality of preset binary threshold values from the plurality of single character images as target single character images; and the overlapping degree of the plurality of first character segmentation positions of the plurality of first single character images and the corresponding ideal segmentation positions exceeds a preset overlapping degree threshold value.
In an embodiment, the overlapping degree module is further configured to: acquiring a plurality of second single character images corresponding to each preset character area in the plurality of preset character areas from the single character images, and extracting a plurality of second character segmentation positions of the plurality of second single character images; respectively calculating the overlapping degree of the plurality of second character segmentation positions and ideal segmentation positions of the corresponding preset character areas, so as to obtain a plurality of second overlapping degrees; a second single character image having the highest second overlapping degree is determined from the plurality of second single character images as a target single character image corresponding to each of the plurality of preset character areas.
In an embodiment, the device is further configured to: marking the target single character images respectively, randomly adding edges to the target single character images so as to obtain the target single character images with prior labels as training samples for training
In an embodiment, the training module is configured to: inputting a plurality of target single character images with prior labels into a convolutional neural network as training samples to carry out classification recognition training, wherein the classification result of the convolutional neural network and/or the class of the prior labels comprise a plurality of whole character classes and a plurality of double half character classes; wherein the plurality of whole character categories includes: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of two-half character categories includes: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
In an embodiment, the training module is further configured to: outputting a first classification result with the highest probability and a second classification result with the second highest probability by the convolutional neural network, wherein if the first classification result and the second classification result both belong to the whole character class, the classification recognition training is further carried out by the prior labels of the first classification result and the target single character image; if the first classification result and the second classification result belong to the double-half character category, performing classification recognition training by using prior labels of the first classification result and the target single-character image; and if the first classification result and the second classification result respectively belong to one of the whole character class and the double-half character class, selecting the classification result belonging to the whole character class from the first classification result and the second classification result, and carrying out classification recognition training on the classification result belonging to the whole character class and the prior label of the target single character image.
In an embodiment, if the first classification result and the second classification result both belong to the two-half character class, the training module is further configured to: determining the character digit of a first character indicated by the first classification result in the multi-character image; if the first character is at the lowest position in the multi-character image, performing the classification recognition training according to any one character in the double-half character category of the first classification result; and if the first character is not at the lowest position in the multi-character image, carrying out classification recognition training by combining a classification result of a second character in the multi-character image, wherein the second character is an adjacent low-order character of the first character.
FIG. 10 is a schematic diagram of a training apparatus for a character recognition model for performing the training method shown in FIG. 8, according to an embodiment of the present application, the apparatus comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform:
acquiring multi-character images of a character wheel type meter, and respectively performing binarization processing on the multi-character images according to a plurality of preset binary thresholds to obtain a plurality of binary images;
performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
and marking the target single character images respectively so as to obtain a plurality of target single character images with prior labels, and training the target single character images with prior labels as training samples.
According to some embodiments of the present application, there is provided a non-volatile computer storage medium having stored thereon computer executable instructions configured to, when executed by a processor, perform:
acquiring multi-character images of a character wheel type meter, and respectively performing binarization processing on the multi-character images according to a plurality of preset binary thresholds to obtain a plurality of binary images;
performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
and marking the target single character images respectively so as to obtain a plurality of target single character images with prior labels, and training the target single character images with prior labels as training samples.
The embodiments of the present application are described in a progressive manner, and the same and similar parts of the embodiments are all referred to each other, and each embodiment is mainly described in the differences from the other embodiments. In particular, for apparatus, devices and computer readable storage medium embodiments, the description thereof is simplified as it is substantially similar to the method embodiments, as relevant points may be found in part in the description of the method embodiments.
The apparatus, the device, and the computer readable storage medium provided in the embodiments of the present application are in one-to-one correspondence with the methods, so that the apparatus, the device, and the computer readable storage medium also have similar beneficial technical effects as the corresponding methods, and since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the apparatus, the device, and the computer readable storage medium are not repeated herein.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Furthermore, although the operations of the methods of the present invention are depicted in the drawings in a particular order, this is not required to either imply that the operations must be performed in that particular order or that all of the illustrated operations be performed to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
While the spirit and principles of the present invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments nor does it imply that features of the various aspects are not useful in combination, nor are they useful in any combination, such as for convenience of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (42)

1. A character recognition method applied to a character wheel type meter, comprising:
acquiring a multi-character image of a character wheel type meter, and respectively executing binarization processing on the multi-character image according to a plurality of preset binary thresholds to obtain a plurality of binary images;
performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
character information in the multi-character image is determined from the plurality of target single-character images.
2. The character recognition method according to claim 1, wherein the method further comprises:
Determining the plurality of preset binary thresholds from a first threshold range;
the first threshold range is narrowed by the plurality of target single character images.
3. The character recognition method according to claim 1, wherein,
performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images includes:
respectively performing vertical projection and horizontal projection on the plurality of binary images to obtain a plurality of character segmentation positions respectively corresponding to the plurality of single character images;
and respectively performing character segmentation processing on the binary images according to the character segmentation positions respectively corresponding to the single character images so as to form the single character images.
4. The character recognition method according to claim 1, wherein the method further comprises:
determining a corresponding ideal segmentation position from the character segmentation position of each single character image in the plurality of single character images, wherein the character segmentation position at least partially falls within a preset character region to which the corresponding ideal segmentation position belongs;
calculating the ratio of the intersection area and the union area of the character segmentation position of each single character image and the corresponding ideal segmentation position, so as to determine the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
The multi-character image is preset with a plurality of preset character areas, and ideal dividing positions are respectively calibrated in each preset character area.
5. The character recognition method according to claim 4, wherein the determining a plurality of target single character images from the plurality of single character images based on the degree of overlap of the character segmentation locations of the plurality of single character images with the respective corresponding ideal segmentation locations comprises:
acquiring a plurality of first single character images corresponding to a target binary threshold value in a plurality of preset binary threshold values from the plurality of single character images as target single character images;
and the overlapping degree of the plurality of first character segmentation positions of the plurality of first single character images and the corresponding ideal segmentation positions exceeds a preset overlapping degree threshold value.
6. The character recognition method according to claim 4, wherein the determining a plurality of target single character images from the plurality of single character images based on the degree of overlap of the character segmentation locations of the plurality of single character images with the respective corresponding ideal segmentation locations comprises:
acquiring a plurality of second single character images corresponding to each preset character area in the preset character areas from the single character images, and extracting a plurality of second character segmentation positions of the second single character images;
Respectively calculating the overlapping degree of the plurality of second character segmentation positions and the ideal segmentation positions of the corresponding preset character areas, so as to obtain a plurality of second overlapping degrees;
a second single character image having the highest second overlapping degree is determined from the plurality of second single character images as a target single character image corresponding to each of the plurality of preset character areas.
7. The character recognition method according to claim 1, wherein the determining character information in the multi-character image from the plurality of target single-character images includes:
inputting the target single character images into a convolutional neural network for classification and identification, wherein the classification result of the convolutional neural network comprises a plurality of whole character categories and a plurality of double-half character categories;
wherein the plurality of whole character categories includes: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of two-half character categories includes: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
8. The character recognition method according to claim 7, wherein the method further comprises:
outputting a first classification result with the highest probability and a second classification result with the second highest probability by the convolutional neural network, and determining character information of the multi-character image according to the first classification result and the second classification result; wherein,
If the first classification result and the second classification result both belong to the whole character category, determining character information of the multi-character image according to the first classification result;
if the first classification result and the second classification result both belong to the double-half character category, determining character information of the multi-character image according to the first classification result;
and if the first classification result and the second classification result respectively belong to one of the whole character category and the double-half character category, selecting the classification result belonging to the whole character category from the first classification result and the second classification result to determine the character information of the multi-character image.
9. The method of claim 8, wherein if the first classification result and the second classification result both belong to the two-half character class, the method further comprises:
determining the character digit of a first character indicated by the first classification result in the multi-character image;
if the first character is at the lowest position in the multi-character image, determining character information of the multi-character image according to any one character in the double-half character category of the first classification result;
And if the first character is not at the lowest position in the multi-character image, determining character information of the multi-character image by combining a classification result of a second character in the multi-character image, wherein the second character is an adjacent low-order character of the first character.
10. A character recognition device applied to a character wheel type meter, comprising:
the binarization module is used for acquiring the multi-character image of the character wheel type meter, and respectively executing binarization processing on the multi-character image according to a plurality of preset binary thresholds to obtain a plurality of binary images;
a character segmentation module for performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
the overlapping degree module is used for determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
and the identification module is used for determining character information in the multi-character image from the target single-character images.
11. The character recognition apparatus of claim 10, wherein the apparatus further comprises a binary threshold module to:
Determining the plurality of preset binary thresholds from a first threshold range:
the first threshold range is narrowed by the plurality of target single character images.
12. The character recognition apparatus of claim 10, wherein the character segmentation module is to:
respectively performing vertical projection and horizontal projection on the plurality of binary images to obtain a plurality of character segmentation positions respectively corresponding to the plurality of single character images;
and respectively performing character segmentation processing on the binary images according to the character segmentation positions respectively corresponding to the single character images so as to form the single character images.
13. The character recognition apparatus of claim 10, wherein the overlap module is to:
determining a corresponding ideal segmentation position from the character segmentation position of each single character image in the plurality of single character images, wherein the character segmentation position at least partially falls within a preset character region to which the corresponding ideal segmentation position belongs;
calculating the ratio of the intersection area and the union area of the character segmentation position of each single character image and the corresponding ideal segmentation position, so as to determine the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
The multi-character image is preset with a plurality of preset character areas, and ideal dividing positions are respectively calibrated in each preset character area.
14. The character recognition apparatus of claim 13, wherein the overlap module is further to:
acquiring a plurality of first single character images corresponding to a target binary threshold value in a plurality of preset binary threshold values from the plurality of single character images as target single character images;
and the overlapping degree of the plurality of first character segmentation positions of the plurality of first single character images and the corresponding ideal segmentation positions exceeds a preset overlapping degree threshold value.
15. The character recognition apparatus of claim 13, wherein the overlap module is further to:
acquiring a plurality of second single character images corresponding to each preset character area in the preset character areas from the single character images, and extracting a plurality of second character segmentation positions of the second single character images;
respectively calculating the overlapping degree of the plurality of second character segmentation positions and the ideal segmentation positions of the corresponding preset character areas, so as to obtain a plurality of second overlapping degrees;
A second single character image having the highest second overlapping degree is determined from the plurality of second single character images as a target single character image corresponding to each of the plurality of preset character areas.
16. The character recognition apparatus of claim 10, wherein the recognition module is further to:
inputting the target single character images into a convolutional neural network for classification and identification, wherein the classification result of the convolutional neural network comprises a plurality of whole character categories and a plurality of double-half character categories;
wherein the plurality of whole character categories includes: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of two-half character categories includes: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
17. The character recognition device of claim 16, wherein the recognition module is further to:
outputting a first classification result with the highest probability and a second classification result with the second highest probability by the convolutional neural network, and determining character information of the multi-character image according to the first classification result and the second classification result; wherein,
if the first classification result and the second classification result both belong to the whole character category, determining character information of the multi-character image according to the first classification result;
If the first classification result and the second classification result both belong to the double-half character category, determining character information of the multi-character image according to the first classification result;
and if the first classification result and the second classification result respectively belong to one of the whole character category and the double-half character category, selecting the classification result belonging to the whole character category from the first classification result and the second classification result to determine the character information of the multi-character image.
18. The character recognition device of claim 17, wherein if the first classification result and the second classification result both belong to the two-half character class, the recognition module is further configured to:
determining the character digit of a first character indicated by the first classification result in the multi-character image;
if the first character is at the lowest position in the multi-character image, determining character information of the multi-character image according to any one character in the double-half character category of the first classification result;
and if the first character is not at the lowest position in the multi-character image, determining character information of the multi-character image by combining a classification result of a second character in the multi-character image, wherein the second character is an adjacent low-order character of the first character.
19. A training method of a character recognition model applied to recognizing a character wheel type meter, comprising:
acquiring multi-character images of a character wheel type meter, and respectively performing binarization processing on the multi-character images according to a plurality of preset binary thresholds to obtain a plurality of binary images;
performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
and marking the target single character images respectively so as to obtain a plurality of target single character images with prior labels, and training the target single character images with prior labels as training samples.
20. The training method of claim 19, wherein the method further comprises:
determining the plurality of preset binary thresholds from a second threshold range:
the second threshold range is narrowed by the plurality of target single character images.
21. The training method of claim 19,
Performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images includes:
respectively performing vertical projection and horizontal projection on the plurality of binary images to obtain a plurality of character segmentation positions respectively corresponding to the plurality of single character images;
and respectively performing character segmentation processing on the binary images according to the character segmentation positions respectively corresponding to the single character images so as to form the single character images.
22. The training method of claim 19, wherein the method further comprises:
determining a corresponding ideal segmentation position from the character segmentation position of each single character image in the plurality of single character images, wherein the character segmentation position at least partially falls within a preset character region to which the corresponding ideal segmentation position belongs;
calculating the ratio of the intersection area and the union area of the character segmentation position of each single character image and the corresponding ideal segmentation position, so as to determine the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
the multi-character image is preset with a plurality of preset character areas, and ideal dividing positions are respectively calibrated in each preset character area.
23. The training method of claim 22, wherein said determining a plurality of target single-character images from said plurality of single-character images based on the degree of overlap of the character segmentation locations of said plurality of single-character images with the respective corresponding ideal segmentation locations comprises:
acquiring a plurality of first single character images corresponding to a target binary threshold value in a plurality of preset binary threshold values from the plurality of single character images as target single character images;
and the overlapping degree of the plurality of first character segmentation positions of the plurality of first single character images and the corresponding ideal segmentation positions exceeds a preset overlapping degree threshold value.
24. The training method of claim 22, wherein said determining a plurality of target single-character images from said plurality of single-character images based on the degree of overlap of the character segmentation locations of said plurality of single-character images with the respective corresponding ideal segmentation locations comprises:
acquiring a plurality of second single character images corresponding to each preset character area in the plurality of preset character areas from the single character images, and extracting a plurality of second character segmentation positions of the plurality of second single character images;
Respectively calculating the overlapping degree of the plurality of second character segmentation positions and the ideal segmentation positions of the corresponding preset character areas, so as to obtain a plurality of second overlapping degrees;
a second single character image having the highest second overlapping degree is determined from the plurality of second single character images as a target single character image corresponding to each of the plurality of preset character areas.
25. The training method of claim 19, wherein the method further comprises:
and randomly adding edges to the target single character images when marking the target single character images respectively, so as to acquire the target single character images with prior labels as training samples for training.
26. The training method of claim 19, wherein training the plurality of target single character images each having an a priori label as training samples comprises:
inputting a plurality of target single character images with prior labels into a convolutional neural network as training samples to carry out classification recognition training, wherein the classification result of the convolutional neural network and/or the class of the prior labels comprise a plurality of whole character classes and a plurality of double half character classes;
Wherein the plurality of whole character categories includes: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of two-half character categories includes: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
27. The training method of claim 26, wherein the method further comprises:
outputting, by the convolutional neural network, a first classification result having a highest probability and a second classification result having a second highest probability, wherein,
if the first classification result and the second classification result belong to the whole character category, further performing classification recognition training by using the prior labels of the first classification result and the target single character image;
if the first classification result and the second classification result belong to the double-half character category, performing classification recognition training by using prior labels of the first classification result and the target single-character image;
and if the first classification result and the second classification result respectively belong to one of the whole character class and the double-half character class, selecting the classification result belonging to the whole character class from the first classification result and the second classification result, and carrying out classification recognition training on the classification result belonging to the whole character class and the prior label of the target single character image.
28. The training method of claim 27, wherein if the first classification result and the second classification result both belong to the two-half character class, the method further comprises:
determining the character digit of a first character indicated by the first classification result in the multi-character image;
if the first character is at the lowest position in the multi-character image, performing the classification recognition training according to any one character in the double-half character category of the first classification result;
and if the first character is not at the lowest position in the multi-character image, carrying out classification recognition training by combining a classification result of a second character in the multi-character image, wherein the second character is an adjacent low-order character of the first character.
29. A training device of a character recognition model applied to a recognition wheel type meter, comprising:
the binarization module is used for collecting multi-character images of the character wheel type meter, and respectively executing binarization processing on the multi-character images according to a plurality of preset binary thresholds to obtain a plurality of binary images;
a character segmentation module for performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
The overlapping degree module is used for determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
and the training module is used for marking the target single character images respectively so as to obtain a plurality of target single character images with prior labels, and training the target single character images with prior labels as training samples.
30. The training apparatus of claim 29 further comprising a binary threshold module to:
determining the plurality of preset binary thresholds from a second threshold range:
the second threshold range is narrowed by the plurality of target single character images.
31. The training device of claim 29,
the character segmentation module is used for:
respectively performing vertical projection and horizontal projection on the plurality of binary images to obtain a plurality of character segmentation positions respectively corresponding to the plurality of single character images;
and respectively performing character segmentation processing on the binary images according to the character segmentation positions respectively corresponding to the single character images so as to form the single character images.
32. The training device of claim 29,
the overlapping degree module is used for:
determining a corresponding ideal segmentation position from the character segmentation position of each single character image in the plurality of single character images, wherein the character segmentation position at least partially falls within a preset character region to which the corresponding ideal segmentation position belongs;
calculating the ratio of the intersection area and the union area of the character segmentation position of each single character image and the corresponding ideal segmentation position, so as to determine the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
the multi-character image is preset with a plurality of preset character areas, and ideal dividing positions are respectively calibrated in each preset character area.
33. The training device of claim 32,
the overlapping degree module is also used for:
acquiring a plurality of first single character images corresponding to a target binary threshold value in a plurality of preset binary threshold values from the plurality of single character images as target single character images;
and the overlapping degree of the plurality of first character segmentation positions of the plurality of first single character images and the corresponding ideal segmentation positions exceeds a preset overlapping degree threshold value.
34. The training device of claim 32,
the overlapping degree module is also used for:
acquiring a plurality of second single character images corresponding to each preset character area in the plurality of preset character areas from the single character images, and extracting a plurality of second character segmentation positions of the plurality of second single character images;
respectively calculating the overlapping degree of the plurality of second character segmentation positions and the ideal segmentation positions of the corresponding preset character areas, so as to obtain a plurality of second overlapping degrees;
a second single character image having the highest second overlapping degree is determined from the plurality of second single character images as a target single character image corresponding to each of the plurality of preset character areas.
35. The training device of claim 29, wherein the device is further configured to:
and randomly adding edges to the target single character images when marking the target single character images respectively, so as to acquire the target single character images with prior labels as training samples for training.
36. The training device of claim 29,
The training module is used for:
inputting a plurality of target single character images with prior labels into a convolutional neural network as training samples to carry out classification recognition training, wherein the classification result of the convolutional neural network and/or the class of the prior labels comprise a plurality of whole character classes and a plurality of double half character classes;
wherein the plurality of whole character categories includes: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of two-half character categories includes: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
37. The training device of claim 36,
the training module is also configured to:
outputting, by the convolutional neural network, a first classification result having a highest probability and a second classification result having a second highest probability, wherein,
if the first classification result and the second classification result belong to the whole character category, further performing classification recognition training by using the prior labels of the first classification result and the target single character image;
if the first classification result and the second classification result belong to the double-half character category, performing classification recognition training by using prior labels of the first classification result and the target single-character image;
And if the first classification result and the second classification result respectively belong to one of the whole character class and the double-half character class, selecting the classification result belonging to the whole character class from the first classification result and the second classification result, and carrying out classification recognition training on the classification result belonging to the whole character class and the prior label of the target single character image.
38. The training device of claim 37, wherein if the first classification result and the second classification result both belong to the two-half character class,
the training module is also configured to:
determining the character digit of a first character indicated by the first classification result in the multi-character image;
if the first character is at the lowest position in the multi-character image, performing the classification recognition training according to any one character in the double-half character category of the first classification result;
and if the first character is not at the lowest position in the multi-character image, carrying out classification recognition training by combining a classification result of a second character in the multi-character image, wherein the second character is an adjacent low-order character of the first character.
39. A character recognition device applied to a character wheel type meter, comprising:
one or more multi-core processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more multi-core processors, cause the one or more multi-core processors to implement:
acquiring a multi-character image of a character wheel type meter, and respectively executing binarization processing on the multi-character image according to a plurality of preset binary thresholds to obtain a plurality of binary images;
performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
character information in the multi-character image is determined from the plurality of target single-character images.
40. A training device of a character recognition model applied to a recognition wheel type meter, comprising:
one or more multi-core processors;
a memory for storing one or more programs;
The one or more programs, when executed by the one or more multi-core processors, cause the one or more multi-core processors to implement:
acquiring multi-character images of a character wheel type meter, and respectively performing binarization processing on the multi-character images according to a plurality of preset binary thresholds to obtain a plurality of binary images;
performing character segmentation processing on the plurality of binary images to obtain a plurality of single character images;
determining a plurality of target single character images from the plurality of single character images according to the overlapping degree of the character segmentation positions of the plurality of single character images and the corresponding ideal segmentation positions;
and marking the target single character images respectively so as to obtain a plurality of target single character images with prior labels, and training the target single character images with prior labels as training samples.
41. A computer readable storage medium storing a program which, when executed by a multi-core processor, causes the multi-core processor to perform the method of any of claims 1-9.
42. A computer readable storage medium storing a program which, when executed by a multi-core processor, causes the multi-core processor to perform the method of any of claims 19-28.
CN201911192163.3A 2019-11-28 2019-11-28 Character recognition method and device, training method and device for character recognition model Active CN110991437B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911192163.3A CN110991437B (en) 2019-11-28 2019-11-28 Character recognition method and device, training method and device for character recognition model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911192163.3A CN110991437B (en) 2019-11-28 2019-11-28 Character recognition method and device, training method and device for character recognition model

Publications (2)

Publication Number Publication Date
CN110991437A CN110991437A (en) 2020-04-10
CN110991437B true CN110991437B (en) 2023-11-14

Family

ID=70088123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911192163.3A Active CN110991437B (en) 2019-11-28 2019-11-28 Character recognition method and device, training method and device for character recognition model

Country Status (1)

Country Link
CN (1) CN110991437B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767909B (en) * 2020-05-12 2022-02-01 合肥联宝信息技术有限公司 Character recognition method and device and computer readable storage medium
CN111814795A (en) * 2020-06-05 2020-10-23 北京嘉楠捷思信息技术有限公司 Character segmentation method, device and computer readable storage medium
CN113657369A (en) * 2021-08-26 2021-11-16 北京有竹居网络技术有限公司 Character recognition method and related equipment thereof

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0580153A2 (en) * 1992-07-22 1994-01-26 Eastman Kodak Company Method and apparatus for segmenting and classifying unconstrained handwritten characters
JPH07105309A (en) * 1993-10-01 1995-04-21 Fuji Facom Corp Line segmentation method
CN101272386A (en) * 2007-03-23 2008-09-24 凹凸电子(武汉)有限公司 Prefix matching algorithem
CN105303156A (en) * 2014-06-19 2016-02-03 株式会社东芝 Character Detection Apparatus, Method and program
CN106529543A (en) * 2016-11-02 2017-03-22 徐庆 Method and system for dynamically calculating multi-color-grade binary adaptive threshold
CN106940800A (en) * 2016-01-05 2017-07-11 深圳友讯达科技股份有限公司 Measuring instrument Recognition of Reading method and device
WO2018018788A1 (en) * 2016-07-29 2018-02-01 深圳友讯达科技股份有限公司 Image recognition-based meter reading apparatus and method thereof
US10032072B1 (en) * 2016-06-21 2018-07-24 A9.Com, Inc. Text recognition and localization with deep learning
CN108647686A (en) * 2018-05-11 2018-10-12 同济大学 A kind of water meter image Recognition of Reading method based on convolutional neural networks
JP2019021085A (en) * 2017-07-19 2019-02-07 富士通株式会社 Image processing program, image processing method, and image processing device
CN109360396A (en) * 2018-09-27 2019-02-19 长江大学 Remote meter reading method and system based on image recognition technology and NB-IoT technology
CN110188755A (en) * 2019-05-30 2019-08-30 北京百度网讯科技有限公司 A kind of method, apparatus and computer readable storage medium of image recognition

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0580153A2 (en) * 1992-07-22 1994-01-26 Eastman Kodak Company Method and apparatus for segmenting and classifying unconstrained handwritten characters
JPH07105309A (en) * 1993-10-01 1995-04-21 Fuji Facom Corp Line segmentation method
CN101272386A (en) * 2007-03-23 2008-09-24 凹凸电子(武汉)有限公司 Prefix matching algorithem
CN105303156A (en) * 2014-06-19 2016-02-03 株式会社东芝 Character Detection Apparatus, Method and program
CN106940800A (en) * 2016-01-05 2017-07-11 深圳友讯达科技股份有限公司 Measuring instrument Recognition of Reading method and device
US10032072B1 (en) * 2016-06-21 2018-07-24 A9.Com, Inc. Text recognition and localization with deep learning
WO2018018788A1 (en) * 2016-07-29 2018-02-01 深圳友讯达科技股份有限公司 Image recognition-based meter reading apparatus and method thereof
CN106529543A (en) * 2016-11-02 2017-03-22 徐庆 Method and system for dynamically calculating multi-color-grade binary adaptive threshold
JP2019021085A (en) * 2017-07-19 2019-02-07 富士通株式会社 Image processing program, image processing method, and image processing device
CN108647686A (en) * 2018-05-11 2018-10-12 同济大学 A kind of water meter image Recognition of Reading method based on convolutional neural networks
CN109360396A (en) * 2018-09-27 2019-02-19 长江大学 Remote meter reading method and system based on image recognition technology and NB-IoT technology
CN110188755A (en) * 2019-05-30 2019-08-30 北京百度网讯科技有限公司 A kind of method, apparatus and computer readable storage medium of image recognition

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Shivadatt D Chame 等.Overlapped Character Recognition : An Innovative Approach.《2016 IEEE 6th International Conference on Advanced Computing》.2016,464-469. *
刘爽 等.基于旋转校正和滑动窗口定位的智能仪表字符识别.《电测与仪表》.2013,20-23. *

Also Published As

Publication number Publication date
CN110991437A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
CN110991437B (en) Character recognition method and device, training method and device for character recognition model
CN111079763B (en) Training sample generation, model training and character recognition method and device
CN109977191B (en) Problem map detection method, device, electronic equipment and medium
CN111027546B (en) Character segmentation method, device and computer readable storage medium
CN103518224A (en) Method and software for analysing microbial growth
CN108805180B (en) Target object detection method and device
JP2021532459A (en) Target cell labeling methods, devices, storage media and terminal devices
US20210214765A1 (en) Methods and systems for automated counting and classifying microorganisms
CN111398176A (en) Water body water color abnormity remote sensing identification method and device based on pixel scale characteristics
CN110599453A (en) Panel defect detection method and device based on image fusion and equipment terminal
CN110689134A (en) Method, apparatus, device and storage medium for performing machine learning process
CN111695609A (en) Target damage degree determination method, target damage degree determination device, electronic device, and storage medium
CN113609984A (en) Pointer instrument reading identification method and device and electronic equipment
CN115439456A (en) Method and device for detecting and identifying object in pathological image
CN115439654A (en) Method and system for finely dividing weakly supervised farmland plots under dynamic constraint
CN110765963A (en) Vehicle brake detection method, device, equipment and computer readable storage medium
CN116137061B (en) Training method and device for quantity statistical model, electronic equipment and storage medium
CN111814795A (en) Character segmentation method, device and computer readable storage medium
CN109376619B (en) Cell detection method
CN116563837A (en) High-precision map guideboard graphic data resolving method, device, equipment and storage medium
CN112990350B (en) Target detection network training method and target detection network-based coal and gangue identification method
CN115953371A (en) Insulator defect detection method, device, equipment and storage medium
CN113610831B (en) Wood defect detection method based on computer image technology and transfer learning
CN112818993A (en) Character wheel reading meter end identification method and equipment for camera direct-reading meter reader
CN114663681A (en) Method for reading pointer type meter and related product

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
TA01 Transfer of patent application right

Effective date of registration: 20201202

Address after: Room 206, 2 / F, building C, phase I, Zhongguancun Software Park, No. 8, Dongbei Wangxi Road, Haidian District, Beijing 100094

Applicant after: Canaan Bright Sight Co.,Ltd.

Address before: 100094 Zhongguancun Software Park Phase I Building C Block 101, 8 Wangxi Road, Haidian District, Beijing

Applicant before: Canaan Creative Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant