Character picture type determination method and device and electronic equipment

By performing binarization processing and feature data screening on character pictures, and using similarity values ​​to compare the sub-eigenvalues ​​of preset digits, the problems of increasing calculation amount and decreasing efficiency caused by the expansion of preset libraries in the prior art are solved, and the problem of increasing calculation amount and degradation of efficiency is realized. Efficient character image type determination.

CN119273988APending Publication Date: 2025-01-07BEIJING SHUYAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411386009.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing method of determining character image types requires continuous expansion of the preset character image library, resulting in an increase in computational volume and a decrease in classification efficiency.

Method used

By binarizing the character picture to be recognized, the average number of foreground color pixels is counted, the feature data is determined, and the sub-eigenvalues ​​of the preset number of digits are filtered and compared according to the similarity value, the comparison time is reduced and classification efficiency is improved.

Benefits of technology

This method saves comparison time by filtering and comparing feature values, improves the efficiency of character image type determination, reduces the amount of calculation, and improves classification efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119273988A_ABST
    Figure CN119273988A_ABST
Patent Text Reader

Abstract

The invention provides a character picture type determination method and apparatus, and an electronic device. The method comprises the steps of obtaining a to-be-recognized character picture; carrying out binarization processing on the character picture to be recognized, and carrying out statistics on a to-be-matched average number of the foreground color pixel number; determining feature data of the character picture to be recognized; calculating to-be-classified feature values corresponding to the feature data; screening out a target average number reaching a preset range of the average number to be matched from the average number of the foreground color pixel numbers corresponding to the plurality of picture classifications; according to the target average number, screening target picture classifications from the picture classifications; respectively comparing the sub-feature values with sample feature values of the target picture classification with preset digits according to a preset sequence to obtain comparison results; according to a comparison result, calculating a similarity value between the to-be-classified feature value and the target picture classification; and determining a classification result of the to-be-recognized character picture according to the similarity value. The method can improve the classification efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a method, device and electronic equipment for determining the type of a character image. Background Art

[0002] At present, the method for determining the type of a character image is usually to match the feature data of the character image with the feature data corresponding to the preset character image library. If there is completely matching feature data, the character corresponding to the feature data in the preset character image that completely matches the feature data of the character image is determined as the category corresponding to the character image. However, in order to improve the accuracy of classification, the number of rows in the preset character image library needs to be continuously expanded, resulting in an increase in the amount of calculation and a serious decrease in classification efficiency. Summary of the invention

[0003] The purpose of the present invention is to provide a method, device and electronic device for determining the type of a character image. In order to improve the accuracy of classification, it is necessary to continuously expand the number of rows of a preset character image library, which leads to an increase in the amount of calculation and a serious decrease in classification efficiency, thereby improving recognition efficiency.

[0004] In a first aspect, an embodiment of the present invention provides a method for determining the type of a character image, comprising: obtaining a character image to be recognized; binarizing the character image to be recognized to obtain an intermediate character image; counting the average number of foreground color pixels of the intermediate character image to be matched; and determining feature data of the character image to be recognized based on the pixel value of the intermediate character image; calculating a feature value to be classified corresponding to the feature data; the feature value to be classified includes sub-feature values ​​of a preset order and a preset number of digits; from the average number of foreground color pixels corresponding to a preset plurality of image classifications, screening out a target average number that reaches a preset range of the average number to be matched; based on the target average number, screening a target image classification from the plurality of image classifications; comparing the sub-feature values ​​with the sample feature values ​​of the target image classification with the preset number of digits in the preset order to obtain a comparison result; based on the comparison result, calculating the similarity value between the feature value to be classified and the target image classification; based on the similarity value, determining the classification result of the character image to be recognized.

[0005] In a preferred embodiment of the present invention, the sample feature values ​​of the target image classification with the preset number of bits are stored in a feature index table; the feature index table includes: the sample feature values ​​of the target image classification with the preset number of bits, the probability sum corresponding to the sample feature values ​​with the preset number of bits, and the average number of foreground color pixels corresponding to the target image classification; the sub-feature values ​​are compared with the sample feature values ​​of the target image classification with the preset number of bits in the preset order respectively, and the step of obtaining the comparison result includes: comparing the sub-feature values ​​with the sample feature values ​​of the target image classification with the preset number of bits in the feature index table in the preset order respectively, to obtain the probability sum corresponding to each of the sub-feature values; determining the probability sum corresponding to each of the sub-feature values ​​as the comparison result; and the step of calculating the similarity value between the feature value to be classified and the target image classification according to the comparison result includes: calculating the similarity value between the feature value to be classified and the corresponding target image classification according to the probability sum corresponding to each of the sub-feature values.

[0006] In a preferred embodiment of the present invention, before the step of comparing the above-mentioned sub-feature values ​​with the sample feature values ​​of the above-mentioned target image classification of the above-mentioned preset number of digits in the above-mentioned preset order and obtaining the comparison result, the above-mentioned method includes: obtaining the sample image features of the above-mentioned multiple image classifications and the average number of foreground color pixels corresponding to the multiple image classifications; calculating the sample sub-feature values ​​of each sample image feature and the sub-probabilities corresponding to the above-mentioned sample sub-feature values; determining the sample feature values ​​of the above-mentioned preset number of digits based on the above-mentioned sample sub-feature values; and summing the sub-probabilities of the sample feature values ​​of the above-mentioned preset number of digits to obtain the above-mentioned probability sum corresponding to the sample feature values ​​of the above-mentioned preset number of digits; constructing the above-mentioned feature index table based on the average number of foreground color pixels corresponding to each image classification, the sample feature values ​​of the above-mentioned preset number of digits and the above-mentioned probability sum corresponding to the sample feature values ​​of the above-mentioned preset number of digits.

[0007] In a preferred embodiment of the present invention, the step of calculating the similarity value between the feature value to be classified and the corresponding target image classification according to the probability sum corresponding to each of the above-mentioned sub-feature values ​​includes: adding the above-mentioned probability sum to obtain a calculation result; and determining the above-mentioned calculation result as the similarity value between the feature value to be classified and the corresponding target image classification.

[0008] In a preferred embodiment of the present invention, the step of determining the feature data of the above-mentioned character image to be recognized based on the pixel value of the above-mentioned intermediate character image includes: determining the feature value of each pixel point based on the pixel value of the above-mentioned intermediate character image; and splicing the above-mentioned feature values ​​of all pixels line by line to obtain the feature data of the above-mentioned character image to be recognized.

[0009] In a preferred embodiment of the present invention, the step of binarizing the above-mentioned character image to be recognized to obtain an intermediate character image includes: binarizing the above-mentioned character image to be recognized to obtain a first intermediate character image; normalizing the above-mentioned first intermediate character image to obtain an intermediate character image.

[0010] In a preferred embodiment of the present invention, the step of determining the classification result of the above-mentioned character image to be recognized according to the above-mentioned similarity value includes: classifying the above-mentioned target image with the largest similarity value and determining it as the classification result of the above-mentioned character image to be recognized.

[0011] In a second aspect, an embodiment of the present invention further provides a device for determining the type of a character image, comprising: an average number screening module for the number of foreground color pixels, for obtaining a character image to be identified; binarizing the above-mentioned character image to be identified to obtain an intermediate character image; counting the average number of foreground color pixels to be matched in the above-mentioned intermediate character image; and determining the feature data of the above-mentioned character image to be identified based on the pixel value of the above-mentioned intermediate character image; calculating the feature value to be classified corresponding to the above-mentioned feature data; the above-mentioned feature value to be classified includes sub-feature values ​​of a preset order and a preset number of digits; from the average number of foreground color pixels corresponding to a preset plurality of image classifications, screening out a target average number that reaches a preset range of the above-mentioned average number to be matched; a matching module, for screening a target image classification from the above-mentioned plurality of image classifications based on the above-mentioned target average number; comparing the above-mentioned sub-feature values ​​with the sample feature values ​​of the above-mentioned target image classification with the above-mentioned preset number of digits in the above-mentioned preset order respectively to obtain a comparison result; calculating the similarity value between the above-mentioned feature value to be classified and the above-mentioned target image classification based on the above-mentioned comparison result; and determining the classification result of the above-mentioned character image to be identified based on the above-mentioned similarity value.

[0012] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method for determining the type of the character image.

[0013] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method for determining the type of the character image as described above.

[0014] The embodiments of the present invention have the following beneficial technical effects:

[0015] The embodiment of the present invention provides a method, device and electronic device for determining the type of a character image, including: obtaining a character image to be recognized; binarizing the character image to be recognized to obtain an intermediate character image; counting the average number of foreground color pixels of the intermediate character image to be matched; and determining feature data of the character image to be recognized based on the pixel value of the intermediate character image; calculating a feature value to be classified corresponding to the feature data; the feature value to be classified includes sub-feature values ​​of a preset order and a preset number of digits; from the average number of foreground color pixels corresponding to a plurality of preset image classifications, screening out a target average number that reaches a preset range of the average number to be matched; screening a target image classification from the plurality of image classifications based on the target average number; comparing the sub-feature values ​​with the sample feature values ​​of the target image classification with the preset number of digits in the preset order to obtain a comparison result; calculating the similarity value between the feature value to be classified and the target image classification based on the comparison result; and determining the classification result of the character image to be recognized based on the similarity value. The method first selects a target average that reaches a preset range of the above-mentioned average to be matched from the average of the number of foreground color pixels corresponding to the preset multiple image classifications, and then divides the feature data into sub-feature values ​​of a preset number of digits, and then compares the sub-feature values ​​with the sample feature values ​​corresponding to the preset number of digits of the multiple image classifications in a preset order to obtain a comparison result, thereby determining the classification of the above-mentioned character image to be processed based on the comparison result, thereby saving comparison time and improving classification efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 A schematic diagram of a flow chart of a method for determining the type of a character image provided by an embodiment of the present invention;

[0018] Figure 2 A schematic flow chart of another method for determining the type of a character image provided by an embodiment of the present invention;

[0019] Figure 3 A schematic diagram of the structure of a device for determining the type of a character image provided by an embodiment of the present invention;

[0020] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0021] Icons: 31 - average number screening module of foreground color pixels; 32 - matching module; 41 - processor; 42 - memory; 43 - bus; 44 - communication interface. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0023] The prior art generally extracts features from the acquired character image to be processed to obtain feature data, then calculates the current feature value corresponding to the feature data, and finally compares each bit of the current feature value with the sample feature value corresponding to the preset multiple image classifications to obtain a comparison result; based on the comparison result, calculates the similarity value of the image classification corresponding to the current feature value; and determines the classification of the character image to be processed based on the similarity value. However, in order to improve the accuracy of classification, it is necessary to continuously expand the number of rows of the preset character image library, thereby expanding the sample feature values ​​corresponding to the preset multiple image classifications, resulting in an increase in the amount of calculation and a serious decrease in classification efficiency.

[0024] Based on this, an embodiment of the present invention provides a method, device and electronic device for determining the type of a character image. The method can improve computing efficiency. To facilitate understanding of the embodiment of the present invention, the method for determining the type of a character image is first introduced.

[0025] Example 1

[0026] In an embodiment of the present invention, Figure 1 A schematic flow chart of a method for determining the type of a character image provided by an embodiment of the present invention.

[0027] Depend on Figure 1 As can be seen, the method includes:

[0028] Step S101: Obtain a character image to be recognized.

[0029] Step S102: binarizing the above-mentioned character image to be recognized to obtain an intermediate character image.

[0030] Step S103: Counting the average number of foreground color pixels to be matched in the intermediate character image; and determining the feature data of the character image to be recognized according to the pixel value of the intermediate character image.

[0031] Step S104: Calculate the feature value to be classified corresponding to the feature data; the feature value to be classified includes sub-feature values ​​of a preset order and a preset number of digits.

[0032] Step S105: Filter out a target average number that reaches a preset range of the average number to be matched from the average numbers of foreground color pixels corresponding to the preset multiple image classifications.

[0033] In this embodiment, assuming that the above-mentioned average number to be matched is A and the above-mentioned preset range is 50, step S105 includes: screening the average number of foreground color pixels that is greater than the difference between A and 50 and less than the sum of A and 50, and determining the average number of foreground color pixels that is greater than the difference between A and 50 and less than the sum of A and 50 as the target average number.

[0034] Step S106: Filter a target image category from the multiple image categories according to the target average.

[0035] In this embodiment, the step S106 includes: selecting a target picture category that reaches the target average from the multiple picture categories.

[0036] Step S107: comparing the sub-feature values ​​with the sample feature values ​​of the target image classification of the preset number of digits in the preset order to obtain comparison results.

[0037] Step S108: Calculate the similarity between the feature value to be classified and the target image classification according to the comparison result.

[0038] Step S109: Determine the classification result of the above-mentioned character image to be recognized according to the above-mentioned similarity value.

[0039] The embodiment of the present invention provides a method for determining the type of a character image, comprising: obtaining a character image to be recognized; binarizing the character image to be recognized to obtain an intermediate character image; counting the average number of foreground color pixels of the intermediate character image to be matched; and determining feature data of the character image to be recognized based on the pixel value of the intermediate character image; calculating a feature value to be classified corresponding to the feature data; the feature value to be classified includes sub-feature values ​​of a preset order and a preset number of digits; screening out a target average that reaches a preset range of the average number to be matched from the average number of foreground color pixels corresponding to a plurality of preset image classifications; screening a target image classification from the plurality of image classifications based on the target average number; comparing the sub-feature values ​​with the sample feature values ​​of the target image classification with the preset number of digits in the preset order to obtain a comparison result; calculating the similarity value between the feature value to be classified and the target image classification based on the comparison result; and determining the classification result of the character image to be recognized based on the similarity value. The method first selects a target average that reaches a preset range of the above-mentioned average to be matched from the average of the number of foreground color pixels corresponding to the preset multiple image classifications, and then divides the feature data into sub-feature values ​​of a preset number of digits, and then compares the sub-feature values ​​with the sample feature values ​​corresponding to the preset number of digits of the multiple image classifications in a preset order to obtain a comparison result, thereby determining the classification of the above-mentioned character image to be processed based on the comparison result, thereby saving comparison time and improving classification efficiency.

[0040] Example 2

[0041] Based on the above embodiments, Figure 2 A schematic flow chart of another method for determining the type of a character image provided by an embodiment of the present invention;

[0042] Step S201: Obtain a picture of characters to be recognized.

[0043] Step S202: binarizing the above-mentioned character image to be recognized to obtain an intermediate character image.

[0044] Step S203: Counting the average number of foreground color pixels to be matched in the intermediate character image; and determining the feature data of the character image to be recognized according to the pixel value of the intermediate character image.

[0045] Step S204: Calculate the feature value to be classified corresponding to the feature data; the feature value to be classified includes sub-feature values ​​of a preset order and a preset number of digits.

[0046] Step S205: Filter out a target average number that reaches a preset range of the average number to be matched from the average numbers of foreground color pixels corresponding to the preset multiple image classifications.

[0047] Step S206: Filter a target image category from the multiple image categories according to the target average.

[0048] Step S207: compare the sub-feature values ​​with the sample feature values ​​of the target image classification of the preset number of digits in the feature index table in the preset order to obtain the probability sum corresponding to each of the sub-feature values; determine the probability sum corresponding to each of the sub-feature values ​​as the comparison result; store the sample feature values ​​of the target image classification of the preset number of digits in the feature index table; the feature index table includes: the sample feature values ​​of the target image classification of the preset number of digits, the probability sum corresponding to the sample feature values ​​of the preset number of digits, and the average number of foreground color pixels corresponding to the target image classification.

[0049] Step S208: Calculate the similarity value between the feature value to be classified and the corresponding target image classification according to the probability sum corresponding to each of the sub-feature values.

[0050] Step S209: Determine the classification result of the above-mentioned character image to be recognized according to the above-mentioned similarity value.

[0051] In one embodiment, before the step of comparing the sub-feature values ​​with the sample feature values ​​of the target image classification of the preset number of bits in the preset order to obtain the comparison result, the method includes: obtaining the sample image features of the multiple image classifications and the average number of foreground color pixels corresponding to the multiple image classifications; calculating the sample sub-feature values ​​of each sample image feature and the sub-probabilities corresponding to the sample sub-feature values; determining the sample feature values ​​of the preset number of bits according to the sample sub-feature values; and summing the sub-probabilities of the sample feature values ​​of the preset number of bits to obtain the above-mentioned probability sum corresponding to the sample feature values ​​of the preset number of bits; constructing the above-mentioned feature index table according to the average number of foreground color pixels corresponding to each image classification, the sample feature values ​​of the preset number of bits and the above-mentioned probability sum corresponding to the sample feature values ​​of the preset number of bits.

[0052] To facilitate understanding of the embodiment of the present invention, the following Table 1 provides a feature index table for the embodiment of the present invention:

[0053] Table 1

[0054]

[0055]

[0056] Here, if the first, second, third, and fourth positions of the sample feature value corresponding to the character "越" are 0, 0, 0, and 0 respectively, combine the feature values of the above first, second, third, and fourth positions to obtain "0000"; further, add the probability that the first position is 0, the probability that the second position is 0, the probability that the third position is 0, and the probability that the fourth position is 0, so as to obtain that the sum of the above probabilities corresponding to the 4-bit sample feature value is 2.2.

[0057] Further, the step of calculating the similarity value between the to-be-classified feature value and the corresponding target picture classification according to the sum of the above probabilities corresponding to each of the above sub-feature values includes: performing an addition calculation on the sum of the above probabilities to obtain a calculation result; determining the calculation result as the similarity value between the to-be-classified feature value and the corresponding target picture classification.

[0058] Further, the step of determining the feature data of the to-be-recognized character picture according to the pixel values of the above intermediate-state character picture includes: determining the feature value of each pixel point according to the pixel values of the above intermediate-state character picture; splicing the above feature values of all pixel points row by row to obtain the feature data of the to-be-recognized character picture.

[0059] In actual operation, the step of performing binarization processing on the to-be-recognized character picture to obtain an intermediate-state character picture includes: performing binarization processing on the to-be-recognized character picture to obtain a first intermediate-state character picture; performing normalization processing on the first intermediate-state character picture to obtain an intermediate-state character picture.

[0060] In one of the implementation manners, the step of determining the classification result of the to-be-recognized character picture according to the above similarity value includes: determining the target picture classification with the largest above similarity value as the classification result of the to-be-recognized character picture.

[0061] The embodiment of the present invention provides a method for determining the type of a character image, comprising: obtaining a character image to be recognized; binarizing the character image to be recognized to obtain an intermediate character image; counting the average number of foreground color pixels of the intermediate character image to be matched; and determining feature data of the character image to be recognized according to the pixel value of the intermediate character image; calculating a feature value to be classified corresponding to the feature data; the feature value to be classified includes sub-feature values ​​of a preset order and a preset number of bits; selecting a target average number that reaches a preset range of the average number to be matched from the average numbers of foreground color pixels corresponding to a plurality of preset picture classifications; selecting a target picture classification from the plurality of picture classifications according to the target average number; and classifying the sub-feature values ​​according to the preset order. The sample feature values ​​of the target image classification with the preset number of digits in the feature index table are respectively compared to obtain the probability sum corresponding to each of the sub-feature values; the probability sum corresponding to each of the sub-feature values ​​is determined as the comparison result; the sample feature values ​​of the target image classification with the preset number of digits are stored in the feature index table; the feature index table includes: the sample feature values ​​of the target image classification with the preset number of digits, the probability sum corresponding to the sample feature values ​​with the preset number of digits, and the average number of foreground color pixels corresponding to the target image classification; according to the probability sum corresponding to each of the sub-feature values, the similarity value between the feature value to be classified and the corresponding target image classification is calculated; according to the similarity value, the classification result of the character image to be recognized is determined. The method first selects a target average that reaches a preset range of the above-mentioned average to be matched from the average of the number of foreground color pixels corresponding to the preset multiple image classifications, and then divides the feature data into sub-feature values ​​of a preset number of digits, and then compares the sub-feature values ​​with sample feature values ​​corresponding to the preset number of digits of the multiple image classifications in the feature index table in a preset order to obtain a comparison result, and then determines the classification of the above-mentioned character image to be processed based on the comparison result, thereby saving comparison time and further improving classification efficiency.

[0062] Example 3

[0063] Based on the above embodiments, Figure 3 A schematic diagram of the structure of a device for determining the type of a character image provided by an embodiment of the present invention.

[0064] Depend on Figure 3 As can be seen, the device includes:

[0065] The module 31 for filtering the average number of foreground color pixels is used to obtain a character image to be recognized; binarize the character image to be recognized to obtain an intermediate character image; count the average number of foreground color pixels to be matched in the intermediate character image; and determine the feature data of the character image to be recognized based on the pixel value of the intermediate character image; calculate the feature value to be classified corresponding to the feature data; the feature value to be classified includes sub-feature values ​​of a preset order and a preset number of bits; and filter out a target average number that reaches a preset range of the average number to be matched from the average numbers of foreground color pixels corresponding to multiple preset image classifications.

[0066] The matching module 32 is used to screen the target image classification from the above-mentioned multiple image classifications according to the above-mentioned target average; compare the above-mentioned sub-feature values ​​with the sample feature values ​​of the above-mentioned target image classification with the above-mentioned preset number of digits in the above-mentioned preset order to obtain a comparison result; calculate the similarity value between the above-mentioned feature value to be classified and the above-mentioned target image classification according to the above-mentioned comparison result; and determine the classification result of the above-mentioned character image to be recognized according to the above-mentioned similarity value.

[0067] The foreground color pixel average screening module 31 and the matching module 32 are connected.

[0068] The device for determining the type of a character image provided in an embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method for determining the type of a character image. For the sake of brief description, for matters not mentioned in the embodiment of the device for determining the type of a character image, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0069] The embodiment of the present invention further provides an electronic device, such as Figure 4 As shown, it is a schematic diagram of the structure of the electronic device, wherein the electronic device includes a processor 41 and a memory 42, the memory 42 stores machine executable instructions that can be executed by the processor 41, and the processor 41 executes the machine executable instructions to implement the above-mentioned character image type determination method.

[0070] exist Figure 4 In the illustrated embodiment, the electronic device further includes a bus 43 and a communication interface 44 , wherein the processor 41 , the communication interface 44 and the memory 42 are connected via the bus.

[0071] The memory 42 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 44 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus may be an ISA bus, a PCI bus, or an EISA bus, etc. The above-mentioned bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0072] The processor 41 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 41. The above processor 41 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor 41 reads the information in the memory 42 and completes the steps of the method for determining the type of the character image in the above-mentioned embodiment in combination with its hardware.

[0073] An embodiment of the present invention also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned character image type determination method. The specific implementation can be found in the aforementioned method embodiment, which will not be repeated here.

[0074] The character image type determination method, character image type determination device and computer program product of an electronic device provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the above program code can be used to execute the character image type determination method in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0075] Unless otherwise specifically stated, the relative steps, numerical expressions and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present invention.

[0076] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0077] Finally, it should be noted that the above-mentioned embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention rather than to limit it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-mentioned embodiments, ordinary technicians in this field should understand that any technician familiar with this technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention.

Claims

1. A method for determining the type of a character image, characterized in that: include: Get the image of the character to be recognized; Binarizing the to-be-recognized character image to obtain an intermediate character image; Counting the average number of foreground color pixels to be matched in the intermediate character image; and determining the feature data of the character image to be recognized according to the pixel value of the intermediate character image; Calculating the feature value to be classified corresponding to the feature data; The feature value to be classified includes sub-feature values ​​of a preset order and a preset number of digits; Filtering out a target average number that reaches a preset range of the average number to be matched from the average numbers of foreground color pixels corresponding to the preset multiple image classifications; Filtering a target image classification from the multiple image classifications according to the target average; Compare the sub-feature values ​​with the sample feature values ​​of the target image classification of the preset number of bits in the preset order to obtain a comparison result; According to the comparison result, calculating the similarity value between the feature value to be classified and the target image classification; According to the similarity value, a classification result of the to-be-recognized character image is determined.

2. The method for determining the type of a character image according to claim 1, characterized in that: The sample feature values ​​of the target image classification of the preset number of bits are stored in a feature index table; The feature index table includes: the sample feature values ​​of the preset number of digits of the target image classification, the probability sum corresponding to the sample feature values ​​of the preset number of digits, and the average number of foreground color pixels corresponding to the target image classification; the steps of comparing the sub-feature values ​​with the sample feature values ​​of the preset number of digits of the target image classification in the preset order, and obtaining the comparison result include: Compare the sub-feature values ​​with the sample feature values ​​of the target image classification of the preset number of bits in the feature index table respectively in the preset order to obtain the probability sum corresponding to each sub-feature value; Determine the probability sum corresponding to each of the sub-feature values ​​as the comparison result; The step of calculating the similarity value between the feature value to be classified and the target image classification according to the comparison result includes: According to the probability sum corresponding to each of the sub-feature values, a similarity value between the feature value to be classified and the corresponding target image classification is calculated.

3. The method for determining the type of a character image according to claim 2, characterized in that: Before the step of comparing the sub-feature values ​​with the sample feature values ​​of the target image classification of the preset number of bits in the preset order to obtain the comparison result, the method includes: Obtaining sample image features of the plurality of image classifications and an average number of foreground color pixels corresponding to the plurality of image classifications; Calculate the sample sub-feature value of each sample image feature and the sub-probability corresponding to the sample sub-feature value; Determine the sample characteristic value of the preset number of digits according to the sample sub-characteristic value; and sum the sub-probabilities of the sample characteristic value of the preset number of digits to obtain the probability sum corresponding to the sample characteristic value of the preset number of digits; The feature index table is constructed according to the average number of foreground color pixels corresponding to each image classification, the sample feature values ​​of the preset number of bits, and the probability sum corresponding to the sample feature values ​​of the preset number of bits.

4. The method for determining the type of a character image according to claim 2, wherein: The step of calculating the similarity value between the feature value to be classified and the corresponding target image classification according to the probability sum corresponding to each of the sub-feature values ​​comprises: Adding the probability sum to obtain a calculation result; The calculation result is determined as a similarity value between the feature value to be classified and the corresponding target image classification.

5. The method for determining the type of a character image according to claim 1, characterized in that: The step of determining the feature data of the character image to be recognized according to the pixel value of the intermediate character image comprises: Determine the characteristic value of each pixel according to the pixel value of the intermediate state character image; The characteristic values ​​of all pixels are concatenated row by row to obtain characteristic data of the character image to be recognized.

6. The method for determining the type of a character image according to claim 1, characterized in that: The step of performing binarization processing on the to-be-recognized character image to obtain an intermediate character image comprises: Binarizing the to-be-recognized character image to obtain a first intermediate character image; The first intermediate state character picture is normalized to obtain an intermediate state character picture.

7. The method for determining the type of a character image according to claim 1, characterized in that: The step of determining the classification result of the to-be-recognized character image according to the similarity value comprises: The target image with the largest similarity value is classified and determined as the classification result of the character image to be recognized.

8. A device for determining the type of a character image, characterized in that: include: The average number screening module of the number of foreground color pixels is used to obtain the image of the character to be recognized; Binarization is performed on the character image to be recognized to obtain an intermediate character image; the average number of foreground color pixels of the intermediate character image to be matched is counted; and feature data of the character image to be recognized is determined according to the pixel value of the intermediate character image; and feature values ​​to be classified corresponding to the feature data are calculated; The feature value to be classified includes sub-feature values ​​of a preset order and a preset number of digits; Filtering out a target average number that reaches a preset range of the average number to be matched from the average numbers of foreground color pixels corresponding to the preset multiple image classifications; A matching module, configured to select a target image classification from the plurality of image classifications according to the target average; Compare the sub-feature values ​​with the sample feature values ​​of the target image classification of the preset number of digits in the preset order to obtain a comparison result; calculate the similarity value between the feature value to be classified and the target image classification according to the comparison result; According to the similarity value, a classification result of the to-be-recognized character image is determined.

9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method for determining the type of a character picture according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that: The computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method for determining the type of a character picture according to any one of claims 1 to 7.