CN110991437A - Character recognition method and device, and training method and device of character recognition model - Google Patents
Character recognition method and device, and training method and device of character recognition model Download PDFInfo
- Publication number
- CN110991437A CN110991437A CN201911192163.3A CN201911192163A CN110991437A CN 110991437 A CN110991437 A CN 110991437A CN 201911192163 A CN201911192163 A CN 201911192163A CN 110991437 A CN110991437 A CN 110991437A
- 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.)
- Granted
Links
- 238000012549 training Methods 0.000 title claims abstract description 137
- 238000000034 method Methods 0.000 title claims abstract description 101
- 230000011218 segmentation Effects 0.000 claims abstract description 284
- 238000012545 processing Methods 0.000 claims abstract description 86
- 238000003860 storage Methods 0.000 claims abstract description 19
- 238000013527 convolutional neural network Methods 0.000 claims description 32
- 238000010586 diagram Methods 0.000 description 27
- 230000000694 effects Effects 0.000 description 24
- 230000008569 process Effects 0.000 description 11
- 238000004590 computer program Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000008901 benefit Effects 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 3
- 230000002829 reductive effect Effects 0.000 description 3
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 3
- 230000002411 adverse Effects 0.000 description 2
- 230000006399 behavior Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 239000012535 impurity Substances 0.000 description 2
- 238000012015 optical character recognition Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000005192 partition Methods 0.000 description 2
- 230000002441 reversible effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000000670 limiting effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/22—Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation 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/267—Segmentation 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/28—Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Multimedia (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Molecular Biology (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Biophysics (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Character Input (AREA)
- Character Discrimination (AREA)
Abstract
The invention provides a character recognition method and a device thereof, a training method and a device thereof of a character recognition model, and a computer readable storage medium corresponding to the training method and the device. The character recognition method comprises the following steps: the method comprises the steps of obtaining a multi-character image of the character wheel type meter, adopting a plurality of preset binary threshold values, respectively executing binarization processing and character segmentation processing to obtain a plurality of single-character images, and 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 single-character images and the corresponding ideal segmentation positions and carrying out character recognition.
Description
Technical Field
The invention belongs to the technical field of image recognition, and particularly relates to a character recognition method and device, and a training method and device of a character recognition model.
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 rise of remote meter reading technology solves the difficulty of manual meter reading statistical work, and becomes an important component of a modern management system. Meters with wireless meter reading functions, such as water meters, electricity meters, gas meters, and the like, have begun to be used gradually in residential areas and high-grade parks.
As the basis and the core of an automatic meter reading system of a character wheel type meter, the character recognition function of the character wheel type meter directly determines the quality of the system. In a conventional character Recognition function of a character wheel type meter, a binarization process and a character segmentation process are generally performed on a multi-character image of the meter, and then a character Recognition task is divided into a whole character Recognition task and a double half character Recognition task, wherein for the Recognition of the whole character, an Optical Character Recognition (OCR) is generally adopted for Recognition. For the recognition of the double-half character, a template matching method is generally adopted for recognition.
However, the above prior art solution has the following problems: under the poor imaging condition, it is difficult to find a proper binarization threshold value method to execute binarization processing, which directly affects the poor segmentation effect of the characters and further affects the recognition accuracy of the characters.
Disclosure of Invention
In order to solve the problem that it is difficult to find a proper binarization threshold value method to execute 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.
The present invention provides the following.
In a first aspect, a character recognition method is provided, which is applied to a print wheel type meter, and comprises:
acquiring a multi-character image of the character wheel type meter, and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 a multi-character image is determined from a plurality of target single-character images.
In a second aspect, there is provided a character recognition apparatus for use with a print wheel type meter, comprising:
the binarization module is used for acquiring a multi-character image of the character wheel type meter and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 recognition 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 for use with 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 the character wheel type meter, and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 a multi-character image is determined from a plurality of target single-character images.
In a fourth aspect, a computer-readable storage medium is provided, which stores a program that, when executed by a multi-core processor, causes the multi-core processor to perform the method as above.
In a fifth aspect, a method for training a character recognition model applied to a print wheel type meter is provided, including:
acquiring a multi-character image of the character wheel type meter, and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 multiple target single-character images respectively to obtain multiple target single-character images with prior labels respectively, and training the multiple target single-character images with the prior labels respectively as training samples.
A sixth aspect provides a training apparatus for a character recognition model applied to a character wheel type meter, comprising:
the binarization module is used for acquiring a multi-character image of the character wheel type meter and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 the target single-character images with the prior labels respectively, and training the target single-character images with the prior labels respectively 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;
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 the character wheel type meter, and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 multiple target single-character images respectively to obtain multiple target single-character images with prior labels respectively, and training the multiple target single-character images with the prior labels respectively as training samples.
In an eighth aspect, there is provided a computer readable storage medium storing a program which, when executed by a multicore processor, causes the multicore processor to perform the method of the fifth aspect.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects: according to the character recognition scheme, a plurality of preset binary thresholds are adopted to carry out binarization processing and character segmentation processing on a multi-character image to obtain a plurality of single-character images, binary thresholds are found 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 select proper single-character images with better recognition effect to carry out character recognition, on one hand, a multi-character recognition task is decomposed into a plurality of simpler single-character recognition tasks, the recognition efficiency is better, on the other hand, single-character images with better recognition effect are obtained, and the recognition accuracy is higher. For the same or similar reasons, the training scheme of the recognition model provided by the invention can decompose the multi-character training task into a plurality of simpler single-character training tasks on one hand, and has better training efficiency. On the other hand, a single character image with higher recognition effect is obtained for training, so that a character recognition model with higher recognition accuracy can be trained.
It should be understood that the above description is only an overview of the technical solutions of the present invention, so as to clearly understand the technical means of the present invention, and thus can be implemented according to the content of the description. In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, embodiments of the present invention are described below.
Drawings
The advantages and benefits described herein, as well as other advantages and benefits, will be 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 refer to like elements throughout. In the drawings:
FIG. 1 is a flow chart illustrating a character recognition method according to an embodiment of the invention;
fig. 2a is a schematic diagram of a multi-character image, and 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 horizontal character segmentation of a binary image according to an embodiment of the present invention, and fig. 3b is a schematic diagram of vertical character segmentation of a binary image according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a ratio of intersection area to union area of character segmentation positions and corresponding ideal segmentation positions of a single character image according to an embodiment of the present invention;
FIG. 5 is a diagram of a double half character in an embodiment of the present invention;
FIG. 6 is a diagram illustrating an exemplary structure of a character recognition apparatus according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a character recognition apparatus according to another embodiment of the present invention;
FIG. 8 is a flowchart illustrating a method for training a character recognition model according to an embodiment of the invention;
FIG. 9 is a schematic structural diagram of an apparatus for training a character recognition model according to an embodiment of the present invention;
FIG. 10 is a schematic structural diagram of an apparatus for training 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 is to be understood that terms such as "including" or "having," or the like, are intended to indicate the presence of the disclosed features, numbers, steps, behaviors, components, parts, or combinations thereof, and are not intended to preclude the possibility of the presence of one or more other features, numbers, steps, behaviors, components, parts, or combinations thereof.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a flow chart illustrating a character recognition method 100 according to an embodiment of the present application, where the character recognition method 100 is used for recognizing character information on a wheel-type meter. In this flow, from a device perspective, the execution subject may be one or more electronic devices, and more specifically, may be a functional module associated with a camera in these devices; from the program perspective, the execution main body may accordingly be a program loaded on these electronic devices.
The flow in fig. 1 may include the following steps 101 to 104.
Step 101: acquiring a multi-character image of the character wheel type meter, and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values to obtain a plurality of binary images;
specifically, above-mentioned character wheel type strapping table indicates to rotate through driving a plurality of character wheels to show the figure of marking on a plurality of character wheels respectively in a plurality of transparent reading frames, so that the user reads the strapping table device of numerical value, for example common water gauge, gas table etc. in the life. The multi-character image is at least one frame of image obtained by the camera 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 present invention is not limited in this respect.
Specifically, in digital Image processing, the contour of an object of interest can be highlighted by performing binarization processing on an Image, wherein the binarization processing refers to selecting a grayscale Image with 256 brightness levels through an appropriate threshold to obtain a Binary Image (Binary Image) which can still reflect the overall and local features of the Image, the Binary Image refers to an Image state in which each pixel on the Image has only two possible values, and the Binary Image can be represented by a black-and-white, B & W, and monochrome Image. Specifically, the gray value of the pixel point greater than or equal to the preset binary threshold in the gray image is set to 255 for representing the specific object, and the gray value of the pixel point less than the preset binary threshold is set to 0 for representing the background area. In this embodiment, the plurality of preset binary threshold values used for the binarization processing of the multi-character image may be specifically determined by a preset first threshold range, and for example, a plurality of values may be uniformly found in the first threshold range as the preset binary threshold values.
For example, referring to fig. 2b, 2c and 2d, a plurality of binary images obtained by binarization processing of different preset binary threshold values are shown, wherein, the preset binary threshold corresponding to the binary image shown in fig. 2b is 0.35 (gray _ max + gray _ min), the preset binary threshold corresponding to the binary image shown in fig. 2c is 0.40 (gray _ max + gray _ min), the preset binary threshold corresponding to the binary image shown in fig. 2d is 0.45 (gray _ max + gray _ min), wherein, gray _ max and gray _ min are the maximum gray value and the minimum gray value in the gray map respectively, it can be seen that the three binary images have different display effects on the character outline, and if one of the three binary images is simply selected as the preset binary threshold, it is easy to cause recognition errors to occur, and the present embodiment reduces the probability of occurrence of errors by setting a plurality of 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 processing means that image areas corresponding to different characters in the binary image are cut apart from each other, and the background area in each image area is removed as much as possible for recognition. The calculation amount required for overall recognition of the multi-character image is large, the efficiency is low, time and labor are wasted, and the multi-character recognition task can be decomposed into a single-character recognition task through character segmentation processing, so that the recognition efficiency is obviously improved. For example, after the character segmentation process 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 recognition difficulty of the single-character image is significantly smaller than that of the 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 appropriate the binary threshold value is, the better the recognition effect of the divided single-character image is, and the larger the degree of overlap between the character division position of the divided single-character image and the corresponding ideal division position is. Therefore, the method and the device adopt a reverse judgment mode, and find the single character image with better recognition effect as the target single character image for recognition 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 a multi-character image is determined from a plurality of target single-character images.
According to the method, a plurality of preset binary thresholds are adopted to carry out binarization processing and character segmentation processing on a multi-character image to obtain a plurality of single-character images, binary thresholds are found 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 select proper single-character images with better recognition effect to carry out character recognition, 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 images with better recognition effect are obtained, and the recognition accuracy is higher.
Based on the character recognition method of fig. 1, some embodiments of the present application also provide some specific embodiments of the character recognition method, and an extension scheme, which are described below.
In an embodiment, the method 100 may further include: determining a plurality of preset binary thresholds from the first threshold range: and determining to reduce a first threshold range according to the obtained target single-character images, and re-determining a plurality of preset binary thresholds according to the reduced first threshold range so as to reduce the data processing amount in the next recognition process.
For example, referring to fig. 2b, 2c and 2d, if the subsequently determined target single-character images are mostly from fig. 2b and 2c, the first threshold range may be narrowed to not include the preset binary threshold of 0.45 (gray _ max + gray _ min). Alternatively, since the photographing brightness is different at different periods of the day, the time factor of photographing the multi-character image may be comprehensively considered, thereby narrowing the first threshold range by periods.
It can be understood that the optimal preset binary thresholds corresponding to the multi-character images acquired under different shooting environments are inconsistent, however, the distribution condition of the preset binary thresholds corresponding to the target single-character images determined by statistics can adaptively narrow the range of the first threshold, further reduce the data processing amount required in the subsequent recognition process, and improve the processing efficiency.
In one embodiment, step 102 may comprise: obtaining a plurality of character segmentation positions respectively corresponding to a plurality of single character images by respectively executing vertical projection and horizontal projection on a plurality of binary images; character segmentation processing is performed on the plurality of binary images respectively in accordance with 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 the horizontal direction or the vertical direction, a portion with a character width exceeding a set threshold is selected for character segmentation, so as to avoid that impurity portions in a picture have adverse effects on character segmentation.
In an embodiment, the method 100 may further include: determining a corresponding ideal dividing position according to the character dividing position of each single-character image in a 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, thereby determining the overlapping degree of the character segmentation positions of the 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 each preset character area is marked with an ideal segmentation position. Specifically, the character segmentation position at least partially falls into a preset character region to which the corresponding ideal segmentation position belongs; alternatively, 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 camera device of the print wheel type meter is set.
For example, referring to fig. 4, a diagram of calculating a ratio of an intersection area to a union area of character segmentation positions of a single-character image and corresponding ideal segmentation positions is shown, where a region a is a region surrounded by the character segmentation positions of the single-character image, and a region B is a region surrounded by the corresponding ideal segmentation positions. Theoretically, the character segmentation positions of the single-character image 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, the single-character image with the ratio of the intersection area and the union area of the character segmentation positions and the corresponding ideal segmentation positions being the global maximum or exceeding a certain proportion can be selected as the target single-character image, and 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 from a plurality of single-character images as a plurality of target single-character images; the overlap degree of a plurality of first character segmentation positions of a plurality of first single-character images and the corresponding ideal segmentation positions exceeds a preset overlap degree threshold value.
For example, the flow adopted according to the judgment criterion in the present embodiment may include the following steps (a) to (f):
(a) selecting one preset binary threshold from a plurality of preset binary thresholds as a to-be-detected binary threshold,
(b) acquiring a plurality of single character images corresponding to a 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 according to the character segmentation positions, and respectively calculating the overlapping degree of the character segmentation positions and the ideal segmentation positions corresponding to each character segmentation position, so as to obtain a plurality of first overlapping degrees;
(d) judging whether the first overlapping degrees exceed a preset overlapping degree threshold value;
(e) if the first overlapping degrees exceed 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) if the first overlapping degrees do not exceed the preset overlapping degree threshold, another preset binary threshold is selected from the preset binary thresholds to update the binary threshold to be detected, and the steps (b) to (f) are repeatedly executed according to the updated binary threshold to be detected until the target binary threshold and the target single-character images are determined.
Compared with the foregoing embodiment, according to the technical scheme provided by this embodiment, a global determination is not required for all single character images obtained according to a plurality of preset binary thresholds, but a certain preset binary threshold may be sequentially selected from the plurality of preset binary thresholds and a single determination may be performed, when the overlap degree between the character segmentation position of each single character image and the corresponding ideal segmentation position in a plurality of single character images obtained according to a certain selected preset binary threshold can exceed a preset overlap degree threshold, it may be considered that the plurality of single character images corresponding to the preset binary threshold reach the recognition standard, and then the next recognition process may be entered, and the above-described scheme significantly improves the recognition speed.
In an embodiment, step 103 may further include the following steps (x) to (z):
(x) Acquiring a plurality of second single-character images corresponding to each preset character region in a plurality of preset character regions 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 degrees of the plurality of second character segmentation positions and the ideal segmentation position of the first preset character region respectively, thereby obtaining a plurality of second overlapping degrees;
(z) determining a second single-character image having the highest second degree of overlap from among the plurality of second single-character images as a target single-character image corresponding to each of the plurality of preset character regions.
Specifically, in the present embodiment, by comparing the overlapping degrees of a plurality of single-character images corresponding to the same preset character region, it is equivalent to perform the partition determination on each preset character region to obtain a single-character image corresponding to each preset character region and having the best recognition effect. Compared with the threshold-based judgment method, the technical scheme adopted by the embodiment can obtain the target single-character image with better recognition effect by separately distinguishing the multiple single-character images in each preset character area.
In an embodiment, the method 100 further comprises: and randomly adding edges into the determined target single-character image and then performing character recognition. And the problems of poor quality of a binary image and unclean character segmentation in practical application are solved.
In one embodiment, step 104 may comprise: 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 classes and a plurality of double-half character classes; wherein, the multiple whole character categories include: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the multiple double half character categories include: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
For example, referring to fig. 5, in the case where double-half characters may appear in the numbers displayed in the transparent reading frame of the character type meter, the present embodiment can solve the problem by classifying the classification results by 20. Compared with the scheme that the double half characters are determined in a template matching mode in the prior art, the method and the device for identifying the double half characters significantly improve the identification accuracy and the identification efficiency by adopting the convolutional neural network for classification identification.
In one embodiment, since the classification result output by the convolutional neural network includes a plurality of types of double half character classes, in order to output a more certain recognition result, the method 100 further includes: and outputting a first classification result with the highest probability and a second classification result with a second high 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 the following 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 both 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 both 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 case (2), the unique identification result still cannot be determined, and in order to further output the uniquely determined identification result, the method may further include: determining the number of character bits 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 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 the classification result of a second character in the multi-character image, wherein the second character is the adjacent lower position character of the first character.
For example, when the two adjacent digits are both of the double half character type, the recognition error is likely to occur, for example, the ten digit classification result is 34, the one digit recognition result is 90, and in this case, if the combined recognition result of the selected one digit and the ten digit is 39 or 40, it is reasonable, and if 49, a large deviation will be caused. In view of the above situation, the present embodiment adopts a scheme of performing comprehensive judgment by combining the character recognition result of a lower digit (e.g., one digit) in the multi-character image when the character indicated by the first classification result output by the convolutional neural network is at a non-lowest digit (e.g., ten digits) in the multi-character image, so as to avoid a situation of recognition error when the recognition results of two adjacent digits are both double half character classes.
Fig. 6 is a schematic structural diagram 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 apparatus 60 includes:
a binarization module 601, configured to obtain a multi-character image of the print wheel type meter, and perform binarization processing on the multi-character image according to a plurality of preset binary threshold values, respectively, to obtain a plurality of binary images;
a character segmentation module 602 configured to perform character segmentation processing on a plurality of binary images to obtain a plurality of single-character images;
an overlap module 603 configured to determine a plurality of target single-character images from the plurality of single-character images according to overlap between the character segmentation positions of the plurality of single-character images and the corresponding ideal segmentation positions;
a recognition module 604 for determining character information in the multi-character image from the plurality of target single-character images.
In one embodiment, the apparatus further comprises a binary threshold module to: determining a plurality of preset binary thresholds from the 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 to: obtaining a plurality of character segmentation positions respectively corresponding to a plurality of single character images by respectively executing vertical projection and horizontal projection on a plurality of binary images; character segmentation processing is performed on the plurality of binary images respectively in accordance with 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 to: determining a corresponding ideal segmentation position according to 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 into 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, thereby determining 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 each preset character area is marked with an ideal segmentation position.
In an embodiment, the overlap 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 a plurality of single-character images as target single-character images; the overlap degree of a plurality of first character segmentation positions of a plurality of first single-character images and the corresponding ideal segmentation positions exceeds a preset overlap degree threshold value.
In an embodiment, the overlap module is further configured to: acquiring a plurality of second single-character images corresponding to each preset character region in a plurality of preset character regions 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 degrees of the plurality of second character segmentation positions and the ideal segmentation position of the first preset character area so as to obtain a plurality of second overlapping degrees; the second single-character image having the highest second degree of overlap 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 regions.
In one embodiment, an apparatus is configured to: and randomly adding edges into the determined target single-character image and then performing character recognition.
In one 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 classes and a plurality of double-half character classes; wherein, the multiple whole character categories include: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the multiple double half character categories include: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
In one embodiment, the identification module is further configured to: outputting a first classification result with the highest probability and a second classification result with a second high probability by a 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 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.
In an embodiment, if the first classification result and the second classification result both belong to the double half character category, the identification module is further configured to: determining the number of character bits 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 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 the classification result of a second character in the multi-character image, wherein the second character is the adjacent lower position character of the first character.
Fig. 7 is a diagram of a character recognition apparatus according to an embodiment of the present application, configured to perform the character recognition method shown in fig. 1, where the apparatus includes:
at least one processor; and the number of the first and second groups,
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:
acquiring a multi-character image of a character wheel type meter, and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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;
determining character information in the multi-character image from the plurality of target single-character images.
According to some embodiments of the present application, there is provided a non-transitory 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 carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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;
determining character information in the multi-character image from the plurality of target single-character images.
Fig. 8 is a flow diagram illustrating a method 800 for training a character recognition model for recognizing character information on a 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, and more specifically, may be a functional module associated with a camera in these devices; from the program perspective, the execution main body may accordingly be a program loaded on these electronic devices.
The flow in fig. 8 may include the following steps 801 to 804.
Step 801: acquiring a multi-character image of the character wheel type meter, and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values to obtain a plurality of binary images;
specifically, above-mentioned character wheel type strapping table indicates to rotate through driving a plurality of character wheels to show the figure of marking on a plurality of character wheels respectively in a plurality of transparent reading frames, so that the user reads the strapping table device of numerical value, for example common water gauge, gas table etc. in the life. The multi-character image is at least one frame of image obtained by the camera 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 present invention is not limited in this respect.
Specifically, in digital Image processing, the contour of an object of interest can be highlighted by performing binarization processing on an Image, wherein the binarization processing refers to selecting a grayscale Image with 256 brightness levels through an appropriate threshold to obtain a Binary Image (Binary Image) which can still reflect the overall and local features of the Image, the Binary Image refers to an Image state in which each pixel on the Image has only two possible values, and the Binary Image can be represented by a black-and-white, B & W, and monochrome Image. Specifically, the gray value of the pixel point greater than or equal to the preset binary threshold in the gray image is set to 255 for representing the specific object, and the gray value of the pixel point less than the preset binary threshold is set to 0 for representing the background area. In this embodiment, the plurality of preset binary threshold values used for the binarization processing of the multi-character image may be specifically determined by a preset first threshold range, and for example, a plurality of values may be uniformly found in the first threshold range as the preset binary threshold values.
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, where the preset binary threshold corresponding to the binary image shown in fig. 2b is 0.35 (gray _ max + gray _ min), the preset binary threshold corresponding to the binary image shown in fig. 2c is 0.40 (gray _ max + gray _ min), and the preset binary threshold corresponding to the binary image shown in fig. 2d is 0.45 (gray _ max + gray _ min), where gray _ max and gray _ min are respectively the maximum gray value and the minimum gray value in the gray map, it can be seen that the display effect of the three binary images on the character contour is obviously different, and if one of the three binary images is simply selected as the preset binary threshold, the recognition accuracy rate of the finally trained character recognition model is not high, in the embodiment, the probability of error occurrence is reduced by setting a plurality of preset binary thresholds, and the training effect is improved.
Step 802: performing character segmentation processing on the plurality of binary images to obtain a plurality of single-character images;
specifically, the character segmentation processing is to segment image regions corresponding to different characters in the binary image from each other, and remove as much background regions in each image region as possible for training. The calculation amount required for the integral training of the multi-character images is large, the efficiency is low, time and labor are wasted, and the multi-character training task can be decomposed into a single-character training task by the character segmentation processing, so that the training efficiency is obviously improved, and the recognition accuracy of the character recognition model is improved. For example, after the character segmentation process is performed on a plurality of binary images as shown in fig. 2b, fig. 2c, and fig. 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 not consistent, the display distances between single characters are not consistent, if a scheme for training a multi-character image is adopted, the multi-character images of various 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 appropriate the binary threshold value is, the better the training effect of the divided single-character image is, and the larger the degree of overlap between the character division position of the divided single-character image and the corresponding ideal division position is. Therefore, the method and the device adopt a reverse judgment mode, and find the single character image with better training effect as the target single character image for training 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 multiple target single-character images respectively to obtain multiple target single-character images with prior labels respectively, and training the multiple target single-character images with the prior labels respectively as training samples.
Specifically, according to actual character information of the multi-character image, a prior label is marked on each target single-character image in the multiple target single-character images, and training of a character recognition model is performed according to the multiple target single-character images and the corresponding prior labels. For example, the five single-character images divided in fig. 2a can be labeled with the prior labels of "0", "3" and "4", respectively. Furthermore, 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 the prior labels corresponding to the target single character images, weight parameters in the character recognition model are adjusted according to the comparison results, and then the character recognition model with high accuracy can be obtained after a large number of samples are trained.
In the invention, a plurality of single character images are obtained by carrying out binarization processing and character segmentation processing on a multi-character image by adopting a plurality of preset binary thresholds, and proper single character images with better training effect are 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 carry out training of a character recognition model. On the other hand, a single character image with higher recognition effect is obtained for training, so that a character recognition model with higher recognition accuracy can be trained.
Based on the training method of fig. 8, some embodiments of the present application also provide some specific embodiments of the training method, and an extension scheme, which are described below.
In an embodiment, the method 800 may further include: determining a plurality of preset binary thresholds from the first threshold range: determining a target threshold value in a plurality of preset binary threshold values from the obtained target single-character image; and reducing the range of the first threshold value by the target threshold value, and re-determining a plurality of preset binary threshold values by the reduced range of the first threshold value so as to reduce the data processing amount in the next training process.
For example, referring to fig. 2b, 2c and 2d, if the subsequently determined target single-character images are mostly from fig. 2b and 2c, the first threshold range may be narrowed to not include the preset binary threshold of 0.45 (gray _ max + gray _ min). It can be understood that the optimal preset binary thresholds corresponding to the multi-character images acquired under different shooting environments are inconsistent, however, the distribution condition of the preset binary thresholds corresponding to the target single-character images determined by statistics can adaptively narrow the range of the first threshold, further reduce the data processing amount required in the subsequent training process, and improve the processing efficiency. Alternatively, since the photographing brightness is different at different periods of the day, the time factor of photographing the multi-character image may be comprehensively considered, thereby narrowing the first threshold range by periods.
In an embodiment, step 802 may comprise: obtaining a plurality of character segmentation positions respectively corresponding to a plurality of single character images by respectively executing vertical projection and horizontal projection on a plurality of binary images; character segmentation processing is performed on the plurality of binary images respectively in accordance with 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 the horizontal direction or the vertical direction, a portion with a character width exceeding a set threshold is selected for character segmentation, so as to avoid that impurity portions in a picture have adverse effects on character segmentation.
In an embodiment, the method 800 may further include: determining a corresponding ideal dividing position according to the character dividing position of each single-character image in a 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, thereby determining the overlapping degree of the character segmentation positions of the 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 each preset character area is marked with an ideal segmentation position. Specifically, the character segmentation position at least partially falls into 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 may be determined by performing at least one active calibration after the camera device of the print wheel type meter is set.
For example, referring to fig. 4, a diagram of calculating a ratio of an intersection area to a union area of character segmentation positions of a single-character image and corresponding ideal segmentation positions is shown, where a region a is a region surrounded by the character segmentation positions of the single-character image, and a region B is a region surrounded by the corresponding ideal segmentation positions. Theoretically, the character segmentation positions of the single-character images 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, the single-character image with the ratio of the intersection area and the union area of the character segmentation positions and the corresponding ideal segmentation positions being the global maximum or exceeding a certain proportion can be selected as the target single-character image, and 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 from a plurality of single-character images as a plurality of target single-character images; the overlap degree of a plurality of first character segmentation positions of a plurality of first single-character images and the corresponding ideal segmentation positions exceeds a preset overlap degree threshold value.
For example, the flow adopted according to the judgment criterion in the present embodiment may include the following steps (a) to (f):
(a) selecting one preset binary threshold from a plurality of preset binary thresholds as a to-be-detected binary threshold,
(b) acquiring a plurality of single character images corresponding to a 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 according to the character segmentation positions, and respectively calculating the overlapping degree of the character segmentation positions and the ideal segmentation positions corresponding to each character segmentation position, so as to obtain a plurality of first overlapping degrees;
(d) judging whether the first overlapping degrees exceed a preset overlapping degree threshold value;
(e) if the first overlapping degrees exceed 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) if the first overlapping degrees do not exceed the preset overlapping degree threshold, another preset binary threshold is selected from the preset binary thresholds to update the binary threshold to be detected, and the steps (b) to (f) are repeatedly executed according to the updated binary threshold to be detected until the target binary threshold and the target single-character images are determined.
Compared with the foregoing embodiment, according to the technical scheme provided by this embodiment, a global determination is not required for all single character images obtained according to a plurality of preset binary thresholds, but a certain preset binary threshold may be sequentially selected from the plurality of preset binary thresholds and a single determination may be performed, when the overlap degree between the character segmentation position and the corresponding ideal segmentation position of each single character image in the plurality of single character images obtained according to the certain selected preset binary threshold exceeds a preset overlap degree threshold, it may be considered that the plurality of single character images corresponding to the preset binary threshold reach the training sample standard, and then the next training process may be entered, and the above-described scheme significantly improves the training efficiency.
In an embodiment, step 803 may further include the following steps (x) to (z):
(x) Acquiring a plurality of second single-character images corresponding to each preset character region in a plurality of preset character regions 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 degrees of the plurality of second character segmentation positions and the ideal segmentation position of the first preset character region respectively, thereby obtaining a plurality of second overlapping degrees;
(z) determining a second single-character image having the highest second degree of overlap from among the plurality of second single-character images as a target single-character image corresponding to each of the plurality of preset character regions.
Specifically, in this embodiment, by comparing the overlapping degrees of a plurality of single-character images corresponding to the same preset character region, it is equivalent to perform partition determination on each preset character region to obtain a single-character image corresponding to each preset character region and having the best training effect. Compared with the threshold-based judgment method, the technical scheme adopted by the embodiment can obtain the target single-character image with better training effect by separately distinguishing the multiple single-character images in each preset character region.
In an embodiment, the method 800 further comprises: before marking the target single-character images respectively, adding edges to the target single-character images randomly. And the problems of poor quality of a binary image and unclean character segmentation in practical application are solved.
In an embodiment, step 804 may comprise: inputting a plurality of target single-character images with prior labels as training samples into a convolutional neural network for 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 multiple whole character categories include: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the multiple double half character categories include: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
For example, referring to fig. 5, for the case where double-half characters may appear in the numbers displayed in the transparent reading frame of a character-type meter, the present embodiment can solve the problem by classifying the classification result and the prior label by 20. Compared with the scheme that double half characters are determined in a template matching mode in the prior art, the method and the device for determining the double half characters significantly improve the accuracy and the training efficiency of the trained character recognition model by adopting the convolutional neural network for classification recognition training.
In one embodiment, since the classification result output by the convolutional neural network includes a plurality of types of double half character classes, 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 both belong to the whole character category, 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 both belong to the double half character category, performing classification recognition training by using the first classification result and the prior label of the target single character image;
(3) and if the first classification result and the second classification result belong to one of the whole character category and the double half character category respectively, selecting the classification result belonging to the whole character category from the first classification result and the second classification result, and performing 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 determined classification result can be compared with the prior label of the target single-character image, and then weight parameters of each stage in the convolutional neural network are adjusted. Optionally, the first classification result and the second classification result may be compared with the prior label of the target single-character image, and then the weight parameters of each stage in the convolutional neural network are adjusted, which is not limited in this application.
Further, in the case (2), the unique classification result still cannot be determined, and in order to further output the uniquely determined classification result, the method may further include: determining the number of character bits 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 classification recognition training according to any 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, performing classification recognition training by combining the classification result of a second character in the multi-character image, wherein the second character is the adjacent lower-position character of the first character.
For example, when the classification results of two adjacent digits are both double half character types, a classification error is likely to occur, for example, the classification result of ten digits is 34, and the classification result of one digit is 90, and at this time, if the classification results of one digit and ten digits are considered together, it is reasonable to determine that the two digits are 39 or 40, 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 classification result of the character of one lower digit (e.g., one digit) in the multi-character image when the character indicated by the first classification result output by the convolutional neural network is at the non-lowest digit (e.g., ten digits) in the multi-character image, so as to avoid the situation of a classification error when the classification results of two adjacent digits are both double half character classes.
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, configured to perform the training method shown in fig. 8.
As shown in fig. 9, the character recognition apparatus 90 includes:
a binarization module 901, configured to collect a multi-character image of a print wheel type meter, and perform binarization processing on the multi-character image according to a plurality of preset binary threshold values, respectively, to obtain a plurality of binary images;
a character segmentation module 902 for performing character segmentation processing on the plurality of binary images to obtain a plurality of single-character images;
an overlap degree module 902, configured to determine a plurality of target single-character images from the plurality of single-character images according to overlap degrees of the character segmentation positions of the plurality of single-character images and the respective corresponding ideal segmentation positions;
the training module 904 is configured to mark the multiple target single-character images respectively, so as to obtain multiple target single-character images each having a priori label, and train the multiple target single-character images each having a priori label as a training sample.
In one embodiment, the apparatus further comprises a binary threshold module to: determining the plurality of preset binary thresholds from a second threshold range: reducing the second threshold range by the plurality of target single-character images.
In one embodiment, the character segmentation module is 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; performing character segmentation processing on the plurality of binary images according to the plurality of character segmentation positions respectively corresponding to the plurality of single-character images to form the 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 of the plurality of single-character images, wherein the character segmentation position at least partially falls into 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, thereby determining 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 each preset character area is marked with an ideal segmentation position.
In an embodiment, the overlap module is further configured to: acquiring a plurality of first single-character images corresponding to a target binary threshold value in the plurality of preset binary threshold values from the plurality of single-character images as the target single-character image; the overlap degree of a plurality of first character segmentation positions of the plurality of first single-character images and the corresponding ideal segmentation positions exceeds a preset overlap degree threshold value.
In an embodiment, the overlap module is further configured to: acquiring a plurality of second single character images corresponding to each preset character region in the plurality of preset character regions 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 degrees of the plurality of second character segmentation positions and the ideal segmentation position of the first preset character area so as to obtain a plurality of second overlapping degrees; determining a second single-character image having a highest second degree of overlap from among the plurality of second single-character images as a target single-character image corresponding to each of the plurality of preset character regions.
In an embodiment, the apparatus is further configured to: marking the target single-character images respectively, and adding edges to the target single-character images randomly so as to obtain a plurality of target single-character images with prior labels respectively as training samples for training
In one embodiment, the training module is to: inputting a plurality of target single-character images with prior labels as training samples into a convolutional neural network for 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 include: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of double half character categories include: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
In one embodiment, the training module is further configured to: outputting a first classification result with the highest probability and a second classification result with a second high 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 performed by the first classification result and a prior label of the target single character image; if the first classification result and the second classification result both belong to the double half character category, performing the classification recognition training by the first classification result and the prior label of the target single character image; 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 performing the classification recognition training on the classification result belonging to the whole character category 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 double-half character class, the training module is further configured to: determining the number of character bits 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 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, performing the classification recognition training by combining the classification result of a second character in the multi-character image, wherein the second character is the adjacent lower-position character of the first character.
Fig. 10 is a schematic diagram of a training apparatus for a character recognition model according to an embodiment of the present application, for performing the training method shown in fig. 8, the apparatus including:
at least one processor; and the number of the first and second groups,
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:
acquiring a multi-character image of a character wheel type meter, and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 to obtain a plurality of target single-character images with prior labels respectively, and training the target single-character images with the prior labels respectively as training samples.
According to some embodiments of the present application, there is provided a non-transitory 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 carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 to obtain a plurality of target single-character images with prior labels respectively, and training the target single-character images with the prior labels respectively as training samples.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, device, and computer-readable storage medium embodiments, the description is simplified because they are substantially similar to the method embodiments, and reference may be made to some descriptions of the method embodiments for their relevance.
The apparatus, the device, and the computer-readable storage medium provided in the embodiment of the present application correspond to the method one to one, and therefore, the apparatus, the device, and the computer-readable storage medium also have advantageous technical effects similar to those of the corresponding method.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention 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 invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
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 computer storage media 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 that can be used to store information that can be accessed by a computing device. Moreover, while the operations of the method of the invention are depicted in the drawings in a particular order, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the spirit and principles of the 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 is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims (44)
1. A character recognition method is applied to a character wheel type meter and is characterized by comprising the following steps:
acquiring a multi-character image of a character wheel type meter, and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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;
determining character information in the multi-character image from the plurality of target single-character images.
2. The character recognition method of claim 1, wherein the method further comprises:
determining the plurality of preset binary thresholds from a first threshold range:
reducing the first threshold range from the plurality of target single-character images.
3. The character recognition method of claim 1,
performing character segmentation processing on the plurality of binary images to obtain a plurality of single-character images includes:
obtaining a plurality of character segmentation positions respectively corresponding to the plurality of single character images by respectively performing vertical projection and horizontal projection on the plurality of binary images;
performing character segmentation processing on the plurality of binary images according to the plurality of character segmentation positions respectively corresponding to the plurality of single-character images to form the plurality of single-character images.
4. The character recognition method of claim 1, wherein the method further comprises:
determining a corresponding ideal segmentation position from the character segmentation position of each of the plurality of single-character images, wherein the character segmentation position at least partially falls into 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, thereby determining 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 each preset character area is marked with an ideal segmentation position.
5. The character recognition method of 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 positions of the plurality of single-character images with the respective corresponding ideal segmentation positions comprises:
acquiring a plurality of first single-character images corresponding to a target binary threshold value in the plurality of preset binary threshold values from the plurality of single-character images as the target single-character image;
the overlap degree of a plurality of first character segmentation positions of the plurality of first single-character images and the corresponding ideal segmentation positions exceeds a preset overlap degree threshold value.
6. The character recognition method of 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 positions of the plurality of single-character images with the respective corresponding ideal segmentation positions comprises:
acquiring a plurality of second single-character images corresponding to each preset character region in the preset character regions 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 degrees of the plurality of second character segmentation positions and the ideal segmentation position of the first preset character area so as to obtain a plurality of second overlapping degrees;
determining a second single-character image having a highest second degree of overlap from among the plurality of second single-character images as a target single-character image corresponding to each of the plurality of preset character regions.
7. The character recognition method of claim 1, wherein the method further comprises:
and randomly adding edges into the determined target single-character image and then performing character recognition.
8. The character recognition method of claim 1, wherein the determining character information in the multi-character image from the plurality of target single-character images comprises:
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 classes and a plurality of double-half character classes;
wherein the plurality of whole character categories include: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of double half character categories include: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
9. The character recognition method of claim 8, wherein the method further comprises:
outputting a first classification result with the highest probability and a second classification result with a second high 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.
10. The character recognition method of claim 9, wherein if the first classification result and the second classification result both belong to the double half character category, the method further comprises:
determining the number of character bits 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 character in the double half character type 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 lower character of the first character.
11. A character recognition device applied to a character wheel type meter, comprising:
the binarization module is used for acquiring a multi-character image of the character wheel type meter and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 recognition module is used for determining character information in the multi-character image from the target single-character images.
12. The character recognition apparatus of claim 11, wherein the apparatus further comprises a binary threshold module to:
determining the plurality of preset binary thresholds from a first threshold range:
reducing the first threshold range from the plurality of target single-character images.
13. The character recognition apparatus of claim 11, wherein the character segmentation module is to:
obtaining a plurality of character segmentation positions respectively corresponding to the plurality of single character images by respectively performing vertical projection and horizontal projection on the plurality of binary images;
performing character segmentation processing on the plurality of binary images according to the plurality of character segmentation positions respectively corresponding to the plurality of single-character images to form the plurality of single-character images.
14. The character recognition apparatus of claim 11, wherein the overlap module is to:
determining a corresponding ideal segmentation position from the character segmentation position of each of the plurality of single-character images, wherein the character segmentation position at least partially falls into 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, thereby determining 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 each preset character area is marked with an ideal segmentation position.
15. The character recognition apparatus of claim 14, wherein the overlap module is further to:
acquiring a plurality of first single-character images corresponding to a target binary threshold value in the plurality of preset binary threshold values from the plurality of single-character images as the target single-character image;
the overlap degree of a plurality of first character segmentation positions of the plurality of first single-character images and the corresponding ideal segmentation positions exceeds a preset overlap degree threshold value.
16. The character recognition apparatus of claim 14, wherein the overlap module is further to:
acquiring a plurality of second single-character images corresponding to each preset character region in the preset character regions 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 degrees of the plurality of second character segmentation positions and the ideal segmentation position of the first preset character area so as to obtain a plurality of second overlapping degrees;
determining a second single-character image having a highest second degree of overlap from among the plurality of second single-character images as a target single-character image corresponding to each of the plurality of preset character regions.
17. The character recognition apparatus of claim 11, wherein the apparatus is configured to:
and randomly adding edges into the determined target single-character image and then performing character recognition.
18. The character recognition apparatus of claim 11, wherein the recognition module is further configured 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 classes and a plurality of double-half character classes;
wherein the plurality of whole character categories include: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of double half character categories include: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
19. The character recognition apparatus of claim 18, wherein the recognition module is further configured to:
outputting a first classification result with the highest probability and a second classification result with a second high 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.
20. The character recognition apparatus of claim 19, wherein if the first classification result and the second classification result both belong to the double half character category, the recognition module is further configured to:
determining the number of character bits 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 character in the double half character type 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 lower character of the first character.
21. A training method of a character recognition model applied to a meter with a recognized character wheel type is characterized by comprising the following steps:
acquiring a multi-character image of a character wheel type meter, and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 to obtain a plurality of target single-character images with prior labels respectively, and training the target single-character images with the prior labels respectively as training samples.
22. The training method of claim 21, wherein the method further comprises:
determining the plurality of preset binary thresholds from a second threshold range:
reducing the second threshold range by the plurality of target single-character images.
23. The training method of claim 21,
performing character segmentation processing on the plurality of binary images to obtain a plurality of single-character images includes:
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;
performing character segmentation processing on the plurality of binary images according to the plurality of character segmentation positions respectively corresponding to the plurality of single-character images to form the plurality of single-character images.
24. The training method of claim 21, wherein the method further comprises:
determining a corresponding ideal segmentation position from the character segmentation position of each of the plurality of single-character images, wherein the character segmentation position at least partially falls into 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, thereby determining 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 each preset character area is marked with an ideal segmentation position.
25. The training method of claim 24, wherein 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 the plurality of preset binary threshold values from the plurality of single-character images as the target single-character image;
the overlap degree of a plurality of first character segmentation positions of the plurality of first single-character images and the corresponding ideal segmentation positions exceeds a preset overlap degree threshold value.
26. The training method of claim 24, wherein 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 region in the plurality of preset character regions 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 degrees of the plurality of second character segmentation positions and the ideal segmentation position of the first preset character area so as to obtain a plurality of second overlapping degrees;
determining a second single-character image having a highest second degree of overlap from among the plurality of second single-character images as a target single-character image corresponding to each of the plurality of preset character regions.
27. The training method of claim 21, wherein the method further comprises:
and when the target single-character images are respectively marked, randomly adding edges into the target single-character images, thereby obtaining the target single-character images with the prior labels as training samples for training.
28. The training method of claim 21, wherein training the plurality of target single-character images each having a priori labels as training samples comprises:
inputting a plurality of target single-character images with prior labels as training samples into a convolutional neural network for 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 include: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of double half character categories include: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
29. The training method of claim 28, 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 both belong to the whole character category, further performing classification recognition training by the first classification result and a prior label of the target single character image;
if the first classification result and the second classification result both belong to the double half character category, performing the classification recognition training by the first classification result and the prior label of the target single character image;
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 performing the classification recognition training on the classification result belonging to the whole character category and the prior label of the target single character image.
30. The training method of claim 29, wherein if the first classification result and the second classification result both belong to the double half character class, the method further comprises:
determining the number of character bits 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 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, performing the classification recognition training by combining the classification result of a second character in the multi-character image, wherein the second character is the adjacent lower-position character of the first character.
31. A training device of a character recognition model applied to a meter of a recognized wheel type, comprising:
the binarization module is used for acquiring a multi-character image of the character wheel type meter and respectively carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 the target single-character images with the prior labels respectively, and training the target single-character images with the prior labels respectively as training samples.
32. The training apparatus of claim 31, wherein the apparatus further comprises a binary threshold module to:
determining the plurality of preset binary thresholds from a second threshold range:
reducing the second threshold range by the plurality of target single-character images.
33. The training apparatus of claim 31,
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;
performing character segmentation processing on the plurality of binary images according to the plurality of character segmentation positions respectively corresponding to the plurality of single-character images to form the plurality of single-character images.
34. The training apparatus of claim 31,
the overlap module is to:
determining a corresponding ideal segmentation position from the character segmentation position of each of the plurality of single-character images, wherein the character segmentation position at least partially falls into 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, thereby determining 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 each preset character area is marked with an ideal segmentation position.
35. The training apparatus of claim 34,
the overlap module is further to:
acquiring a plurality of first single-character images corresponding to a target binary threshold value in the plurality of preset binary threshold values from the plurality of single-character images as the target single-character image;
the overlap degree of a plurality of first character segmentation positions of the plurality of first single-character images and the corresponding ideal segmentation positions exceeds a preset overlap degree threshold value.
36. The training apparatus of claim 34,
the overlap module is further to:
acquiring a plurality of second single character images corresponding to each preset character region in the plurality of preset character regions 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 degrees of the plurality of second character segmentation positions and the ideal segmentation position of the first preset character area so as to obtain a plurality of second overlapping degrees;
determining a second single-character image having a highest second degree of overlap from among the plurality of second single-character images as a target single-character image corresponding to each of the plurality of preset character regions.
37. The training apparatus of claim 31, wherein the apparatus is further configured to:
and when the target single-character images are respectively marked, randomly adding edges into the target single-character images, thereby obtaining the target single-character images with the prior labels as training samples for training.
38. The training apparatus of claim 31,
the training module is configured to:
inputting a plurality of target single-character images with prior labels as training samples into a convolutional neural network for 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 include: 0. 1, 2, 3, 4, 5, 6, 7, 8, 9; the plurality of double half character categories include: 01. 12, 23, 34, 45, 56, 67, 78, 89, 90.
39. The training apparatus of claim 38,
the training module is further 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 both belong to the whole character category, further performing classification recognition training by the first classification result and a prior label of the target single character image;
if the first classification result and the second classification result both belong to the double half character category, performing the classification recognition training by the first classification result and the prior label of the target single character image;
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 performing the classification recognition training on the classification result belonging to the whole character category and the prior label of the target single character image.
40. The training apparatus of claim 39, wherein if the first classification result and the second classification result both belong to the double half character class,
the training module is further configured to:
determining the number of character bits 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 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, performing the classification recognition training by combining the classification result of a second character in the multi-character image, wherein the second character is the adjacent lower-position character of the first character.
41. 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;
when the one or more programs are 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 carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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;
determining character information in the multi-character image from the plurality of target single-character images.
42. A training device of a character recognition model applied to a meter of a recognized wheel type, comprising:
one or more multi-core processors;
a memory for storing one or more programs;
when the one or more programs are 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 carrying out binarization processing on the multi-character image according to a plurality of preset binary threshold values 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 to obtain a plurality of target single-character images with prior labels respectively, and training the target single-character images with the prior labels respectively as training samples.
43. A computer-readable storage medium storing a program that, when executed by a multi-core processor, causes the multi-core processor to perform the method of any one of claims 1-10.
44. A computer-readable storage medium storing a program that, when executed by a multi-core processor, causes the multi-core processor to perform the method of any of claims 21-30.
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 true CN110991437A (en) | 2020-04-10 |
CN110991437B 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) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111767909A (en) * | 2020-05-12 | 2020-10-13 | 合肥联宝信息技术有限公司 | 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 |
CN113591857A (en) * | 2020-04-30 | 2021-11-02 | 阿里巴巴集团控股有限公司 | Character image processing method and device and ancient Chinese book image identification method |
CN113657369A (en) * | 2021-08-26 | 2021-11-16 | 北京有竹居网络技术有限公司 | Character recognition method and related equipment thereof |
Citations (12)
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 device, 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 |
-
2019
- 2019-11-28 CN CN201911192163.3A patent/CN110991437B/en active Active
Patent Citations (12)
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 device, 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)
Title |
---|
SHIVADATT D CHAME 等: "Overlapped Character Recognition : An Innovative Approach", pages 464 - 469 * |
刘爽 等: "基于旋转校正和滑动窗口定位的智能仪表字符识别", pages 20 - 23 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113591857A (en) * | 2020-04-30 | 2021-11-02 | 阿里巴巴集团控股有限公司 | Character image processing method and device and ancient Chinese book image identification method |
CN111767909A (en) * | 2020-05-12 | 2020-10-13 | 合肥联宝信息技术有限公司 | Character recognition method and device and computer readable storage medium |
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 |
CN111814795B (en) * | 2020-06-05 | 2024-08-27 | 嘉楠明芯(北京)科技有限公司 | Character segmentation method, device and computer readable storage medium |
CN113657369A (en) * | 2021-08-26 | 2021-11-16 | 北京有竹居网络技术有限公司 | Character recognition method and related equipment thereof |
CN113657369B (en) * | 2021-08-26 | 2024-05-24 | 北京有竹居网络技术有限公司 | Character recognition method and related equipment thereof |
Also Published As
Publication number | Publication date |
---|---|
CN110991437B (en) | 2023-11-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110991437B (en) | Character recognition method and device, training method and device for character recognition model | |
JP7000627B2 (en) | Target cell labeling methods, devices, storage media and terminal devices | |
CN111079763B (en) | Training sample generation, model training and character recognition method and device | |
CN107945200A (en) | Image binaryzation dividing method | |
CN110599453A (en) | Panel defect detection method and device based on image fusion and equipment terminal | |
CN108805180B (en) | Target object detection method and device | |
US20210214765A1 (en) | Methods and systems for automated counting and classifying microorganisms | |
CN112597773A (en) | Document structuring method, system, terminal and medium | |
CN110689134A (en) | Method, apparatus, device and storage medium for performing machine learning process | |
CN111597845A (en) | Two-dimensional code detection method, device and equipment and readable storage medium | |
CN114612732A (en) | Sample data enhancement method, system and device, medium and target classification method | |
CN112651989A (en) | SEM image molecular sieve particle size statistical method and system based on Mask RCNN example segmentation | |
CN113836850A (en) | Model obtaining method, system and device, medium and product defect detection method | |
CN112883926A (en) | Identification method and device for table medical images | |
CN116030453A (en) | Digital ammeter identification method, device and equipment | |
CN116385374A (en) | Cell counting method based on convolutional neural network | |
CN111814795B (en) | Character segmentation method, device and computer readable storage medium | |
CN112102250A (en) | Method for establishing and detecting pathological image detection model with training data as missing label | |
CN115439456A (en) | Method and device for detecting and identifying object in pathological image | |
CN114565803A (en) | Method, device and mechanical equipment for extracting difficult sample | |
CN113449702A (en) | Target detection method and device for remote sensing image, storage medium and electronic equipment | |
CN113780287A (en) | Optimal selection method and system for multi-depth learning model | |
CN112818993A (en) | Character wheel reading meter end identification method and equipment for camera direct-reading meter reader | |
CN110705633B (en) | Target object detection method and device and target object detection model establishing method and device | |
CN112434585A (en) | Method, system, electronic device and storage medium for identifying virtual reality of lane line |
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 | ||
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. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |