WO2014131339A1 - 字符识别方法和字符识别装置 - Google Patents
字符识别方法和字符识别装置 Download PDFInfo
- Publication number
- WO2014131339A1 WO2014131339A1 PCT/CN2014/072328 CN2014072328W WO2014131339A1 WO 2014131339 A1 WO2014131339 A1 WO 2014131339A1 CN 2014072328 W CN2014072328 W CN 2014072328W WO 2014131339 A1 WO2014131339 A1 WO 2014131339A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- threshold
- confidence
- character
- recognition
- segmentation
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/16—Image preprocessing
- G06V30/162—Quantising the image signal
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
Definitions
- the present invention relates to the field of character recognition, and in particular to a character recognition method and a character recognition device.
- a conventional character recognition method includes: a) scanning to acquire a grayscale image of an original; b) obtaining a threshold by analyzing and calculating a gray histogram of the acquired image, and performing binary value on the grayscale image according to the threshold The processing results in a binary image; c) performing character cutting on the binary image, comparing the cut character block with the template character, and selecting the character closest to the template character as the recognition character.
- methods for performing threshold calculation include the Otsu method, the NiBlack method, the minimum error method, or the maximum entropy method. The inventors have found that no matter which threshold method is used, there is a certain limitation in binarizing the grayscale image.
- a main object of the present invention is to provide a character recognition method and a character recognition apparatus, which solve the problem that the conventional character recognition method is only suitable for recognizing an original having a high image contrast, and a low recognition rate of a document having a low image contrast.
- a character recognition method is provided.
- the character recognition method includes: acquiring an array of thresholds, wherein the threshold array includes a plurality of thresholds; selecting a first threshold from the threshold array as the selected threshold; Step a, performing binarization processing on the character image by using the selected threshold to obtain characters a binary image of the image; step b, performing character recognition on the binary image to obtain a recognition result; step C, calculating a confidence level of the recognition result; and step d, determining whether the confidence of the recognition result is greater than a predetermined value of the confidence value, if the recognition result If the confidence level is greater than the predetermined value of the confidence, the recognition result is used as the recognition result of the character image; if the confidence of the recognition result is not greater than the predetermined value of the confidence, the second threshold is selected from the threshold array, and the first threshold is replaced by the second threshold.
- the threshold is used as the selected threshold, and returns to the execution step.
- the step a includes: segmenting the binary image to obtain N segmentation regions, wherein each of the N segmentation regions and one to be identified are respectively The characters correspond.
- Step b includes: performing character recognition on the N divided regions to obtain N recognition results respectively corresponding to the N divided regions.
- Step c includes: calculating a confidence level of the N recognition results.
- Step d includes: determining whether the confidence levels of the N identification results are greater than a predetermined value of the confidence level, and if the confidence levels of the N identification results are greater than a predetermined value of the confidence degree, determining that the confidence of the recognition result is greater than a predetermined value of the confidence level, if N The confidence of any one of the recognition results is not greater than the predetermined value of the confidence, and then the confidence that the recognition result is determined is not greater than the predetermined value of the confidence.
- the method further includes: recording the recognition result of the first segmentation region and the second slice a sub-region, wherein the first sub-region is a segmentation region corresponding to a recognition result in which the confidence value is greater than a predetermined value of the confidence value in the N recognition results, and the second segmentation region is a confidence value in the N recognition results that is not greater than a confidence degree The segmentation area corresponding to the recognition result of the value.
- Step a includes: performing binarization processing on the character image by using the second threshold as the selected threshold, obtaining a binary image of the character image, and dividing the binary image to obtain N cuts The sub-region
- step b includes: performing character recognition on the segmentation regions corresponding to the second segmentation regions among the N segmentation regions. Further, before the binarization process is performed on the character image by using the selected threshold, the method further includes: acquiring a histogram of the character image; calculating a histogram of the character image to obtain a basic threshold; and performing the base threshold as a central threshold Expand to get an array of thresholds.
- ⁇ is the threshold
- the difference between adjacent thresholds in the array TH, TO is the base threshold.
- the character recognition apparatus includes: an obtaining unit, configured to acquire an array of thresholds, wherein the threshold array includes a plurality of thresholds; and a binarization processing unit configured to perform binarization processing on the character image by using the selected threshold to obtain a character image a value image; an identification unit for performing character recognition on the binary image to obtain a recognition result; and a calculation unit for calculating a confidence level of the recognition result; the determination unit determines whether the confidence level of the recognition result is greater than a predetermined value of the confidence degree, wherein if the confidence level of the recognition result is greater than the predetermined value of the confidence degree, the recognition result is used as the recognition result of the character image; And a first threshold or a second threshold is selected as the selected threshold, wherein the first threshold is selected as the selected threshold, and when the first threshold is used as the selected threshold, if the confidence of the recognition result is not greater than the confidence A predetermined value is selected, and a second threshold is selected from the threshold array.
- the binarization processing unit is further configured to slice the binary image to obtain N segmentation regions, wherein each of the N segmentation regions respectively corresponds to a character to be recognized, and the recognition unit further It is used for character recognition of N segmentation regions, and obtains N recognition results respectively corresponding to N segmentation regions, and the calculation unit is further configured to calculate the confidence of the N recognition results, and the determination unit is further configured to determine N recognitions.
- the confidence of the result is greater than the predetermined value of the confidence, if the confidence of the N recognition results are greater than the predetermined value of the confidence, the confidence that the recognition result is determined to be greater than the predetermined value of the confidence, if any of the N recognition results is trusted If the degree is not greater than the predetermined value of the confidence, it is determined that the confidence of the recognition result is not greater than the predetermined value of the confidence.
- the character recognition apparatus further includes: a recording unit, configured to: when the first threshold is selected as the selected threshold, if the confidence of any one of the N identification results is not greater than a predetermined value of the confidence, the first segmentation area is recorded And a second segmentation region, wherein the first segmentation region is a segmentation region corresponding to the recognition result that the confidence value is greater than the confidence value predetermined value in the N recognition results, and the second segmentation region is N recognition results
- the segmentation area corresponding to the recognition result of the predetermined value of the confidence is not greater than the segmentation area corresponding to the recognition result of the predetermined value
- the binarization processing unit is further configured to perform the character image on the second threshold as the selected threshold when the second threshold is selected as the selected threshold Binary processing, obtaining a binary image of the character image, segmenting the binary image, and obtaining N segmentation regions, wherein the recognition unit is further configured to segment the segment corresponding to the second segmentation region among the N segmentation regions The area performs character recognition.
- the obtaining unit includes: an obtaining module, configured to obtain a histogram of the character image before performing binarization processing on the character image by using the selected threshold; and a calculating module, configured to calculate a histogram of the character image, to obtain a basis Threshold; an expansion module, configured to expand the threshold threshold array TH by using the base threshold as a center threshold. Further, the expansion module is configured to expand the threshold threshold array TH by using the basic threshold as a central threshold in the following manner:
- ⁇ ⁇ 0, ⁇ 0+ ⁇ , ⁇ 0- ⁇ , ⁇ 0+2 ⁇ , ⁇ 0-2 ⁇ , ... ⁇ , where ⁇ is the difference between adjacent thresholds in the threshold array TH, and TO is the base threshold.
- the recognition character is evaluated for confidence, and the threshold value is dynamically adjusted by the evaluation result of the confidence degree, and only the recognized character whose confidence degree meets the requirement is the final recognition character, and the traditional character recognition method is only applicable to the recognition image contrast.
- FIG. 1a is a schematic diagram of a banknote number area image with a lower contrast
- FIG. 1b is a schematic diagram of a binary image obtained by binarizing an image in FIG. 1 by using a threshold value obtained by a conventional threshold calculation method
- 2 is a block diagram of a character recognition apparatus according to an embodiment of the present invention
- FIG. 3 is a flowchart of a character recognition method according to a first embodiment of the present invention
- FIG. 4 is a character recognition method according to a second embodiment of the present invention.
- Figure 5 is a flow chart of a character recognition method according to a third embodiment of the present invention
- Figure 6a is a schematic diagram of a character image according to an embodiment of the present invention
- Figure 6b is a gray-scale histogram of the character image of Figure 6a
- 7 is a diagram showing a relationship between binarization processing and character recognition results of character images using different threshold values in a character recognition method according to a second embodiment of the present invention
- FIG. 8 is character recognition according to a third embodiment of the present invention.
- the relationship between the binarization processing of the character image and the character recognition result is performed by using different threshold values.
- the character recognition apparatus 10 includes: an acquisition unit 11, a selection unit 12, a binarization processing unit 13, an identification unit 14, a calculation unit 15, and a determination unit 16.
- the obtaining unit 11 is configured to obtain a threshold array TH, wherein the threshold array TH includes a plurality of thresholds.
- the input original image may be first calculated to obtain a basic threshold T0, wherein the original image is a grayscale image of the region where the character to be recognized is located, such as when identifying the crown number of the banknote, the original image is the area where the banknote crown number is located. Grayscale images, also known as character images.
- a plurality of threshold values are then calculated from the base threshold TO, such that the threshold threshold array TH is expanded from the base threshold value TO.
- the threshold value in the threshold array TH is obtained by extending the base threshold value TO as a center threshold value.
- the binarization processing unit 13 is configured to perform binarization processing on the character image by using the selected threshold to obtain a binary image of the character image.
- the selected threshold is a threshold selected from the threshold array TH.
- the character image is binarized by using a certain data in the threshold array TH, and the character image represented by the gradation is converted into a binary image including only the white pixel represented by "0" and the black pixel represented by "1". For example, if the character image is binarized by using the basic threshold value TO, the pixel whose gray value is greater than or equal to TO in the character image is converted into a pixel “0”, and the pixel whose gray value is smaller than TO in the character image is converted into a pixel. "1".
- the identifying unit 14 is configured to perform character recognition on the binary image to obtain a recognition result.
- the calculating unit 15 is configured to calculate a confidence level of the recognition result.
- Calculating the confidence C of each recognized character comparing the calculated confidence C with a predetermined value of confidence, if the confidence C is greater than the predetermined value of the confidence, indicating that the recognized character is authentic, if C is less than or equal to a predetermined value of confidence , indicating that the recognized character is not trusted, and needs to be re-identified, wherein the confidence C indicates the credibility of the recognition result, and the larger the value, the higher the credibility of the recognition result.
- the judging unit 16 judges whether the confidence level of the recognition result is greater than a predetermined value of the confidence degree, wherein if the confidence level of the recognition result is greater than the confidence degree predetermined value, the recognition result is used as the recognition result of the character image.
- the selecting unit 12 is configured to select a first threshold or a second threshold from the threshold array TH as a selected threshold, where the first threshold is first selected as the selected threshold, and when the first threshold is used as the selected threshold, if the result is identified If the confidence is not greater than the predetermined value of the confidence, then the second threshold is selected from the threshold array.
- the first threshold and the second threshold are merely exemplified, and may be any two different thresholds in the threshold array TH. SP, a plurality of thresholds are stored in the threshold array TH, and the selecting unit 12 sequentially follows the threshold array TH.
- the threshold image is selected to binarize the character image until the confidence C of the recognition result of the binary image after the binarization processing is greater than the confidence predetermined value.
- the binarization processing unit 13 is further configured to slice the binary image to obtain N segmentation regions, wherein each of the N segmentation regions respectively corresponds to a character to be recognized,
- the identifying unit 14 is further configured to perform character recognition on the N divided regions to obtain N recognition results respectively corresponding to the N divided regions, and the calculating unit 15 is further configured to calculate a confidence level of the N recognition results, and the determining unit 16 It is further configured to determine whether the confidence levels of the N identification results are greater than a predetermined value of the confidence level.
- the unit 14 can obtain the character corresponding to each segmentation area by performing character recognition on the segmentation area, thereby obtaining a character string corresponding to the binary image, such as identifying the banknote crown area, and obtaining the banknote including the plurality of characters and numbers. Crown size.
- the character recognition apparatus further includes: a recording unit 17 configured to: when the first threshold is selected as the selected threshold, if the confidence of any one of the N identification results is not greater than a predetermined value of the confidence, the first segmentation area is recorded And a second segmentation region, wherein the first segmentation region is a segmentation region corresponding to the recognition result that the confidence value is greater than the confidence value predetermined value in the N recognition results, and the second segmentation region is N recognition results The confidence level is not greater than the segmentation area corresponding to the recognition result of the predetermined value of the confidence.
- the binarization processing unit 13 is further configured to perform binarization processing on the character image by using the second threshold value as the selected threshold value when the second threshold value is selected as the selected threshold value, to obtain a binary image of the character image, and segmentation The binary image is obtained by N segmentation regions
- the recognition unit 14 is further configured to perform character recognition on the segmentation regions corresponding to the second segmentation regions among the N segmentation regions.
- the obtaining unit 12 may further include: an obtaining module 121, configured to acquire a histogram of the character image before performing binarization processing on the character image by using the selected threshold; and a calculating module 122, configured to calculate a histogram of the character image,
- the basic threshold is obtained.
- the expansion module 123 is configured to expand the threshold threshold by using the basic threshold as the central threshold.
- the expansion module may expand the threshold threshold by using the basic threshold as the central threshold in the following manner:
- ⁇ ⁇ 0, ⁇ 0+ ⁇ , ⁇ 0- ⁇ , ⁇ 0+2 ⁇ , ⁇ 0-2 ⁇ , ... ⁇ , where ⁇ is the difference between adjacent thresholds in the threshold array TH, and TO is the base threshold.
- the character recognition method provided by the embodiment of the present invention is introduced below. It should be noted that the character recognition method provided by the embodiment of the present invention can be performed by the character recognition apparatus of the embodiment of the present invention. Correspondingly, the character recognition apparatus provided by the embodiment of the present invention can also be used in the character recognition method of the embodiment of the present invention.
- the character recognition device of the embodiment of the present invention may be a computer, a printer, a scanning device, or the like.
- Step S11 Acquire an array of thresholds, where the threshold array includes a plurality of thresholds.
- the plurality of thresholds in the threshold array may be preset or stored, or may be calculated by a base threshold during character recognition.
- Step S12 selecting a first threshold from the threshold array as the selected threshold.
- a threshold is arbitrarily selected from the threshold array as a first threshold. If the threshold array is expanded by a basic threshold, preferably, the basic threshold may be selected as the first threshold.
- Step S13 Perform binarization processing on the character image by using the selected threshold to obtain a binary image of the character image.
- Step S14 performing character recognition on the binary image to obtain a recognition result.
- step S15 the confidence of the recognition result is calculated.
- step S16 it is judged whether the confidence of the recognition result is greater than a predetermined value of the confidence. If the confidence level of the recognition result is greater than the confidence predetermined value, step S17 is performed. If the confidence level of the recognition result is not greater than the confidence predetermined value, step S18 is performed.
- step S17 the recognition result is taken as the recognition result of the character image.
- Step S18 Select a second threshold from the threshold array, replace the first threshold with the second threshold as the selected threshold, and return to step S13. A threshold different from the first threshold is arbitrarily selected from the threshold array as a second threshold.
- step S13 further includes: segmenting the binary image to obtain N segmentation regions, wherein each of the N segmentation regions respectively corresponds to a character to be recognized.
- step S14 includes: performing character recognition on the N divided regions to obtain N recognition results respectively corresponding to the N divided regions.
- Step 15 includes: calculating a confidence level of the N recognition results.
- Step 16 includes: determining whether the confidence levels of the N identification results are greater than a predetermined value of the confidence level, and if the confidence levels of the N identification results are greater than a predetermined value of the confidence degree, determining that the confidence of the recognition result is greater than a predetermined value of the confidence level, if N The confidence of any one of the recognition results is not greater than the predetermined value of the confidence, and then the confidence that the recognition result is determined is not greater than the predetermined value of the confidence.
- the method further includes: recording the recognition result of the first segmentation region and the second slice a sub-region, wherein the first sub-region is a segmentation region corresponding to a recognition result in which the confidence value is greater than a predetermined value of the confidence value in the N recognition results, and the second segmentation region is a confidence value in the N recognition results that is not greater than a confidence degree The segmentation area corresponding to the recognition result of the value.
- Step S13 includes: performing binarization processing on the character image by using the second threshold as the selected threshold, obtaining a binary image of the character image, and dividing the binary image to obtain N cuts.
- the sub-region, step S14 includes: performing character recognition on the segmentation regions corresponding to the second segmentation regions among the N segmentation regions.
- 4 is a flow chart of a character recognition method in accordance with a second embodiment of the present invention. This embodiment can be used as a preferred embodiment of the first embodiment shown in FIG. 3. As shown in FIG. 4, the specific processing procedure is as follows: Step S21: Determine a basic threshold T0 according to a histogram of the character image to obtain a threshold array. .
- This step S21 can be taken as a preferred embodiment of the step S11 shown in FIG.
- the character image 30 is processed to obtain a gray histogram of the character image 30 as shown in FIG. 6b, wherein the horizontal axis of the coordinate system is the gray value of the pixel, and the vertical axis is various grays.
- the ratio of the pixels of the degree value to the total number of pixels can be obtained by using any threshold calculation method in the prior art to obtain the basic threshold T0 of the original image, as by the Ostu algorithm (N.Otsu, "A threshold selection method from grey -level histograms", IEEE Trans. Syst., Man, Cybem., vol. SMC-1, pp. 62-66, Jan.
- the basic threshold T0 is obtained.
- the method of obtaining the plurality of threshold values is obtained by spreading the threshold value TO as a center threshold.
- the number of data in the threshold array ⁇ can be set according to requirements.
- the base threshold T0 is equal to 0x41
- the second data ⁇ 0+ ⁇ of the threshold array TH is 0x51
- the third data ⁇ 0- ⁇ of the threshold array TH is 0x31.
- the threshold T is made equal to the first data of the threshold array TH. This step S22 can be taken as a preferred embodiment of the step S12 shown in FIG. Let the threshold T be equal to the first data of the threshold array TH.
- the first data of TH is T0
- the second data is ⁇ 0+ ⁇
- the third data is ⁇ 0- ⁇
- the fourth data is ⁇ 0+2 ⁇
- the fifth data is ⁇ 0-2 ⁇
- the character image is binarized using the threshold T.
- This step S23 can be taken as a preferred embodiment of the step S13 shown in FIG.
- the character image is binarized using the threshold T to obtain a binary image of the character image.
- the binary image 40 is an image obtained by binarizing the character image 30 in FIG. 6a with a threshold of 0x41
- the binary image 50 is obtained by binarizing the character image 30 of FIG.
- the image, binary image 60 is an image obtained by binarizing the character image 30 in Fig. 6a with a threshold of 0x31.
- the binary image is segmented to obtain N segmentation regions.
- the binary image is segmented to obtain N segmentation regions, each of which corresponds to a character to be recognized. As shown in FIG. 7, when the binary image 40 is divided, 10 segmentation regions are obtained.
- the commonly used segmentation method is to use a vertical projection of the binary image, and combine the character pitch, the character width, the character height, and the like to cut the binary image.
- step S25 character recognition is performed on the first segmentation area.
- character recognition is performed in a certain order, such as from left to right.
- processing is started from the first segmentation region on the left side.
- D is the Euclidean distance between the eigenvector and the standard template vector
- D is the Euclidean distance from the ith standard template vector
- eigenvector of the character is the jth component of the eigenvector
- N is the first i standard template vector
- N ⁇ is the jth component of N
- the value range of i is l ⁇ k
- the confidence C in step S15 shown in Fig. 3 can also be calculated in the above manner.
- step S27 it is determined whether the confidence C is greater than a predetermined value of the confidence.
- This step S27 can be taken as a preferred embodiment of the step S16 shown in FIG.
- the calculated confidence C is compared with a predetermined value of the confidence, wherein the predetermined value of the confidence is a value obtained by using the standard template vector in the character recognition method to identify the character, which indicates that the confidence is less than the confidence predetermined
- the identification character of the value is untrustworthy, and its value range is [0, 1], if equal to 0.2.
- the predetermined reliability value is set to 0.2.
- the 10 segmentation regions of the binary image 40 are identified from left to right, and the first four segmentation regions are respectively identified as The character "Z""J""5"”7" indicated by the character string 42 has the confidence levels of the four recognition results of 0.597321, 0.614531, 0.502632, and 0.165150, respectively, due to the first segmentation region to the third segmentation.
- the confidence of the recognition result of the region is greater than the predetermined value of the confidence, indicating that the recognition result of the first segmentation region to the third segmentation region is authentic.
- step S29 is performed, The next segmentation region is identified; when the fourth segmentation region 41 of the binary image 40 is identified, since the confidence of the recognition result of the fourth segmentation region 41 of the binary image 40 is less than the confidence value predetermined value, It is indicated that the recognition result (such as the character "7" indicated by the character 421) is not authentic. Therefore, after the fourth segmentation region of the binary image 40 is subjected to the character recognition, the process proceeds to step S28, and the threshold T is equal to the threshold array TH. Next data (ie the second of the threshold array TH) Data).
- the first to fourth segmentation regions of the binary image 50 are respectively recognized as characters as indicated by the character string 52. "Z""J""5"”7", the confidence of the four recognition results is 0.589010, 0.552231, 0.538618 and 0.002581, respectively, due to the first segmentation area of the binary image 50 to the third segmentation area
- the confidence of the recognition result is greater than the predetermined value of the confidence, indicating that the recognition result of the first segmentation region to the third segmentation region of the binary image 50 is authentic, and therefore, each step is performed after identifying a segmentation region.
- step S29 identifying the next segmentation region; when identifying the fourth segmentation region 51 of the binary image 50, the confidence of the recognition result of the fourth segmentation region 51 of the binary image 50 is less than the confidence
- the predetermined value indicates that the recognition result (such as the character "7" indicated by the character 521) is not authentic. Therefore, after the fourth segmentation area of the binary image 50 is subjected to character recognition, the process proceeds to step S28, and the threshold T is equal to the threshold.
- the next data of the array TH ie the threshold number) TH third data).
- the third data of the threshold T is equal to the threshold array TH for the third character recognition, the 10 segmentation regions of the binary image 60 are recognized from left to right as the character "Z" as indicated by the character string 62, respectively.
- step S29 is performed after each segmentation region is recognized, and the next segmentation region is identified until all the segmentation regions are identified.
- step S28 the threshold T is made equal to the next data of the threshold array TH.
- the recognition result is not credible, it indicates that the quality of the binary image obtained by binarization processing with the current threshold T does not meet the requirement of character recognition, and the next data of the threshold array TH is taken as the threshold T, and the binary value is re-executed.
- a binary image of different quality is obtained when the character image is binarized by using different threshold values T in conjunction with FIGS. 6a, 7, and 8. If the character image to be processed is the character image 30 in FIG.
- the threshold array TH is ⁇ 0x41, 0x51, 0x31, 0x61, 0x21 ⁇ , and the character image 30 is performed with the first data 0x41 of the threshold array TH as a threshold.
- the binary image 40 is obtained during the value processing, and the binary image 50 is obtained by binarizing the character image 30 with the second data 0x51 of the threshold array TH as a threshold.
- the third data 0x31 of the threshold array TH is used as a threshold.
- step S29 it is determined whether all the segmentation areas have been processed. It is determined whether all the segmentation areas have been processed, for example, there are a total of N segmentation regions, and the value of the counter for recording the number of processed segmentation regions is set to 0, before each processing of the first segmentation region. After processing a segmentation area, the value of the counter for recording the number of processed segmentation regions is incremented by 1. When the number of processed segmentation regions is less than N, it means that all the segmentation regions have not been processed, then Go to step S30; when the number of processed segmentation regions is equal to N, indicating that all the segmentation regions have been processed, the character recognition process ends. In step S30, character recognition is performed on the next segmentation region.
- the segmentation area is taken for character recognition. If the segmentation area of this process is the first segmentation area from the left, the next processed segmentation area The second segmentation area starting from the left. Extract the feature vector of the next segmentation region, calculate the Euclidean distance between the feature vector and the standard template vector, sort the k Euclidean distances D 2 D k-1 , D k , and select the standard template corresponding to the smallest Euclidean distance.
- the character represented by the vector is the recognition result of the recognized character.
- FIG. 5 is a flow chart of a character recognition method according to a third embodiment of the present invention, which may also be a preferred embodiment of the first embodiment shown in Figure 3.
- the specific processing is as follows: Steps S41 to S43 are the same as steps S21 to S23.
- step S44 the binary image is segmented to obtain N divided regions, and the N divided regions are set as the regions to be identified.
- the binary image is segmented to obtain N segmentation regions. As shown in FIG.
- Step S45 performing character recognition on the first to-be-identified area. If the area to be identified is N divided areas, the first area to be identified is the first one of the N divided areas, and as shown in FIG. 8, 10 divided areas of the binary image 40 are processed. When processing in the order from left to right, the first segmentation area on the left is the first area to be identified. If the to-be-recognized area is the M-disabled segmentation area, the first to-be-recognized area is the first one of the M-identified segmentation areas, as shown in FIG.
- the fourth segmentation area 41 of the value image 40 fails to be identified. Therefore, when the second recognition is performed, the first to-be-recognized area is the second image of the binary image 50 in the binary image 50 that failed to be recognized at the time of the first recognition.
- the region corresponding to the four segmentation regions 41 that is, the segmentation region 51 of the binary image 50; the recognition of the fourth segmentation region 51 of the binary image 50 fails during the second recognition, and therefore, the third recognition is performed.
- the first to-be-recognized area is the area of the binary image 60 corresponding to the fourth segmentation area 51 of the binary image 50 that failed to be recognized at the second recognition, that is, the fourth sliced area of the binary image 60. 61.
- step S46 Extracting the feature vector of the first identified region, calculating the Euclidean distance Di of the feature vector and the standard template vector, sorting the K Euclidean distances D1, D2, ..., Dk-1, Dk, selecting and the smallest European
- the character represented by the standard template vector corresponding to the distance is the identification character of the first area to be recognized.
- step S47 it is determined whether the confidence C is greater than a predetermined value of the confidence.
- step S48 Comparing the calculated confidence C with a predetermined value of the confidence, wherein the predetermined value of the confidence is less than 1, and when the confidence C is greater than the predetermined value of the confidence, indicating that the recognition result is authentic, then the process proceeds to step S48; If the confidence C is less than or equal to the confidence predetermined value, indicating that the recognition result of the area to be identified is not authentic, then the process goes to step S49.
- the 10 segmentation areas of the binary image 40 are recognized from left to right as characters "Z""J""5""7" as indicated by the character string 44, respectively.
- the confidence C of each recognition result is 0.597321, 0.614531, 0.502632, 0.165150, 0.662693, 0.716749, 0.651325, 0.504233 0.616645 and 0.436257, respectively.
- the predetermined value is 0.2, since only the confidence of the recognition result of the fourth segmentation area 41 is less than the predetermined value of the confidence, the confidence of the recognition results of the remaining nine segmentation regions is greater than the predetermined value of the confidence, therefore,
- the process goes to step S49, where the fourth segmentation area is recorded as the recognition failure area; the first sliced area to the third sliced area and the fifth divided area
- the process proceeds to step S48, and the character corresponding to the segmentation area is recorded as a trusted identification character.
- the recognition result of the segmentation area 51 of the binary image 50 (such as the character "7" indicated by the character 54) is 0.002581, and since the confidence of the recognition result is less than the predetermined value of the confidence, Therefore, after character recognition is performed on the segmentation area 51, the process proceeds to step S49, and the segmentation area is recorded as an area in which recognition is failed.
- the recognition result of the segmentation area 61 of the binary image 60 (such as the character "7" indicated by the character 64) has a confidence of 0.503960, since the confidence of the recognition result is greater than the confidence value predetermined value, Therefore, after character recognition is performed on the segmentation area 61, the process proceeds to step S48, and the character corresponding to the segmentation area is recorded as a trusted identification character. Step S48, recording a character that the trusted identification character record recognizes each time the recognition result is authentic and the corresponding segmentation area number. As shown in FIG. 8, when the first recognition is performed, the recognition result of the first to third segmentation regions and the fifth segmentation region to the tenth segmentation region of the binary image 40 is trusted.
- Step S49 the segmentation area in which the recognition failure is recorded records the segmentation area where the recognition fails each time, and as shown in FIG. 8, when the first recognition is performed, the recognition of the fourth segmentation area 41 of the binary image 40 is performed. The result is not credible, that is, the segmentation region recognition fails.
- Step S50 determining whether all the to-be-identified areas have been processed As shown in FIG.
- Step S51 performing character recognition on the next to-be-identified area.
- character recognition is performed on the next to-be-identified area, for example, the to-be-identified area to be identified in this process is 10 of the binary image 40.
- the next area to be identified is the second segmentation area starting from the left side.
- Extract the feature vector of the next identified region calculate the Euclidean distance of the feature vector from the standard template vector, sort the k Euclidean distances D 2 D k-1 , D k , and select the corresponding Euclidean distance.
- the character represented by the standard template vector is the identification character of the next area to be recognized.
- step S49 records that the fourth segmentation area 41 of the binary image 40 is a segmentation region in which the recognition fails, and therefore, the recognition fails after the first recognition is completed.
- the fourth segmentation area 51 of the binary image 50 is recorded as the segmentation area of the recognition failure in step S49, so that the segmentation area of the recognition failure is completed after the second recognition is completed;
- the failed segmentation region is not recognized after the third recognition is completed.
- the final recognition result of the character image is a combination of trusted character recognition of multiple character recognition, as shown in FIG. 8, the recognition result of the character image (string 70) is the recognition result 45 and the third time of the first recognition.
- the combination of the recognized recognition results 65 that is, the recognized character of the segmentation area in which the recognition is failed in the first recognition is replaced with the third recognized trusted identification character.
- the threshold T is made equal to the next data of the threshold array TH. Same as step S28.
- the character image is binarized using the threshold T.
- the binary image is segmented to obtain N segmentation regions, and the M regions whose recognition fails are selected as the region to be identified as shown in FIG. 8.
- the identified area to be identified this time (ie, the second time) is the one of the 10 segmentation areas corresponding to the previous recognition failure.
- the fourth segmentation area of the value image 50 fails to be identified. Therefore, the to-be-recognized area identified this time (ie, the third time) is a segmentation area corresponding to the previous recognition failure among the 10 segmentation areas, that is, the binary value.
- the fourth segmentation area 61 of the image 60 can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device, or they may be separately fabricated into individual integrated circuit modules, or they may be Multiple modules or steps are made into a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
- the above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Character Input (AREA)
- Image Analysis (AREA)
- Character Discrimination (AREA)
Abstract
本发明公开了一种字符识别方法和字符识别装置。该字符识别方法包括:获取阈值数组;从阈值数组中选取第一阈值作为选定阈值;采用选定阈值对字符图像进行二值化处理,得到字符图像的二值图像;对二值图像进行字符识别,得到识别结果;计算识别结果的置信度;判断识别结果的置信度是否大于置信度预定值,如果识别结果的置信度大于置信度预定值,则将识别结果作为字符图像的识别结果;如果识别结果的置信度不大于置信度预定值,则从阈值数组中选取第二阈值,采用第二阈值替换第一阈值作为选定阈值。通过本发明,解决了传统的字符识别方法仅适用于识别图像对比度高的原稿,而对图像对比度低的原稿识别率较低的问题。
Description
字符识别方法和字符识别装置
本申请要求 2013 年 2 月 26 日提交至中国知识产权局的, 申请号为 201310060434.6, 名称为 "字符识别方法和字符识别装置" 的中国发明专利申请的优 先权, 其全部公开内容结合于此作为参考。 技术领域 本发明涉及字符识别领域, 具体而言, 涉及一种字符识别方法和字符识别装置。 背景技术 传统的字符识别方法包括: a) 扫描, 获取原稿的灰度图像; b) 通过对获取到的 图像的灰度直方图的分析和计算来得到阈值, 根据阈值对灰度图像进行二值化处理得 到二值图像; c)对二值图像进行字符切割, 对切割的字符块和模板字符进行对比, 选 取与模板字符最相近的字符为识别字符。 在传统的字符识别方法中, 进行阈值计算的方法有 Otsu方法、 NiBlack方法、 最 小误差法或最大熵方法等。 发明人发现, 无论采用哪种方法获得的阈值, 在对灰度图 像进行二值化处理时均存在一定的局限性。 具体的, 对于对比度低的原稿, 使用单一 阈值对原稿图像二值化时容易产生失真现象。 比如, 当需要进行字符识别的原稿为纸 币时, 由于纸币在使用过程中容易受到磨损、 污染或涂鸦, 因此, 纸币图像的对比度 较低, 如图 la所示的纸币号码区域图像, 由于字符" C"所在区域受到污染, 当利用传 统的字符识别方法使用单一阈值对图 la所示图像进行二值化处理得到图 lb所示的二 值图像, 从图中可以看出, 很难准确识别出字符 "C"。 因此, 传统的字符识别方法仅适 用于识别图像对比度高的原稿, 而对图像对比度低的原稿识别率较低。 发明内容 本发明的主要目的在于提供一种字符识别方法和字符识别装置, 以解决传统的字 符识别方法仅适用于识别图像对比度高的原稿, 而对图像对比度低的原稿识别率较低 的问题。 为了实现上述目的, 根据本发明的一个方面, 提供了一种字符识别方法。 该字符 识别方法包括: 获取阈值数组, 其中, 阈值数组包括多个阈值; 从阈值数组中选取第 一阈值作为选定阈值; 步骤 a, 采用选定阈值对字符图像进行二值化处理, 得到字符
图像的二值图像; 步骤 b, 对二值图像进行字符识别, 得到识别结果; 步骤 C, 计算识 别结果的置信度; 步骤 d, 判断识别结果的置信度是否大于置信度预定值, 如果识别 结果的置信度大于置信度预定值, 则将识别结果作为字符图像的识别结果; 如果识别 结果的置信度不大于置信度预定值, 则从阈值数组中选取第二阈值, 采用第二阈值替 换第一阈值作为选定阈值, 并返回执行步骤^ 进一步地, 步骤 a包括: 切分二值图像, 得到 N个切分区域, 其中, N个切分区 域中的每一个切分区域分别与一个待识别字符相对应。 步骤 b包括: 对 N个切分区域 进行字符识别, 得到分别对应于 N个切分区域的 N个识别结果。 步骤 c包括: 计算 N 个识别结果的置信度。 步骤 d包括: 判断 N个识别结果的置信度是否均大于置信度预 定值, 如果 N个识别结果的置信度均大于置信度预定值, 则确定识别结果的置信度大 于置信度预定值, 如果 N个识别结果中任意一个的置信度不大于置信度预定值, 则确 定识别结果的置信度不大于置信度预定值。 进一步地, 在选取第一阈值作为选定阈值时, 如果 N个识别结果中任意一个的置 信度不大于置信度预定值, 该方法还包括: 记录第一切分区域的识别结果和第二切分 区域, 其中, 第一切分区域为 N个识别结果中置信度大于置信度预定值的识别结果对 应的切分区域, 第二切分区域为 N个识别结果中置信度不大于置信度预定值的识别结 果对应的切分区域。 在选取第二阈值作为选定阈值时: 步骤 a包括: 采用第二阈值作 为选定阈值对字符图像进行二值化处理, 得到字符图像的二值图像, 切分二值图像, 得到 N个切分区域, 步骤 b包括: 对 N个切分区域中与第二切分区域对应的切分区域 进行字符识别。 进一步地, 在采用选定阈值对字符图像进行二值化处理之前, 该方法还包括: 获 取字符图像的直方图; 对字符图像的直方图进行计算, 得到基础阈值; 以基础阈值为 中心阈值进行拓展得到阈值数组。 进一步地, 采用以下方式由基础阈值为中心阈值进行拓展得到阈值数组 TH: ΤΗ={Τ0,Τ0+Δ, Τ0-Δ,Τ0+2Δ, Τ0-2Δ, .. ·}, 其中, Δ为阈值数组 TH中相邻阈值之间的差值, TO为基础阈值。 为了实现上述目的, 根据本发明的另一方面, 提供了一种字符识别装置。 该字符 识别装置包括: 获取单元, 用于获取阈值数组, 其中, 阈值数组包括多个阈值; 二值 化处理单元, 用于采用选定阈值对字符图像进行二值化处理, 得到字符图像的二值图 像; 识别单元, 用于对二值图像进行字符识别, 得到识别结果; 计算单元, 用于计算
识别结果的置信度; 判断单元, 判断识别结果的置信度是否大于置信度预定值, 其中, 如果识别结果的置信度大于置信度预定值, 则将识别结果作为字符图像的识别结果; 选取单元, 用于从阈值数组中选取第一阈值或第二阈值作为选定阈值, 其中, 首先选 取第一阈值作为选定阈值, 在第一阈值作为选定阈值时, 如果识别结果的置信度不大 于置信度预定值, 则从阈值数组中选取第二阈值。 进一步地, 二值化处理单元还用于切分二值图像, 得到 N个切分区域, 其中, N 个切分区域中的每一个切分区域分别与一个待识别字符相对应, 识别单元还用于对 N 个切分区域进行字符识别, 得到分别对应于 N个切分区域的 N个识别结果, 计算单元 还用于计算 N个识别结果的置信度,判断单元还用于判断 N个识别结果的置信度是否 均大于置信度预定值, 如果 N个识别结果的置信度均大于置信度预定值, 则确定识别 结果的置信度大于置信度预定值, 如果 N个识别结果中任意一个的置信度不大于置信 度预定值, 则确定识别结果的置信度不大于置信度预定值。 进一步地, 该字符识别装置还包括: 记录单元, 用于在选取第一阈值作为选定阈 值时, 如果 N个识别结果中任意一个的置信度不大于置信度预定值, 记录第一切分区 域的识别结果和第二切分区域, 其中, 第一切分区域为 N个识别结果中置信度大于置 信度预定值的识别结果对应的切分区域, 第二切分区域为 N个识别结果中置信度不大 于置信度预定值的识别结果对应的切分区域, 其中, 二值化处理单元还用于在选取第 二阈值作为选定阈值时, 采用第二阈值作为选定阈值对字符图像进行二值化处理, 得 到字符图像的二值图像, 切分二值图像, 得到 N个切分区域, 其中, 识别单元还用于 对 N个切分区域中与第二切分区域对应的切分区域进行字符识别。 进一步地, 获取单元包括: 获取模块, 用于在采用选定阈值对字符图像进行二值 化处理之前, 获取字符图像的直方图; 计算模块, 用于对字符图像的直方图进行计算, 得到基础阈值; 拓展模块, 用于以基础阈值为中心阈值进行拓展得到阈值数组 TH。 进一步地, 拓展模块用于采用以下方式由基础阈值为中心阈值进行拓展得到阈值 数组 TH:
ΤΗ= {Τ0,Τ0+Δ, Τ0-Δ,Τ0+2Δ, Τ0-2Δ, ...} , 其中, Δ为阈值数组 TH中相邻阈值之间的差值, TO为基础阈值。 通过本发明, 对识别字符进行置信度评估, 通过置信度的评估结果对阈值动态调 整, 只有置信度符合要求的识别字符为最终的识别字符, 解决了传统的字符识别方法 仅适用于识别图像对比度高的原稿, 而对图像对比度低的原稿识别率较低的问题。
附图说明 构成本申请的一部分的附图用来提供对本发明的进一步理解, 本发明的示意性实 施例及其说明用于解释本发明, 并不构成对本发明的不当限定。 在附图中: 图 la是对比度较低的纸币号码区域图像的示意图; 图 lb是利用传统的阈值计算方法得到的阈值对图 la中图像进行二值化处理得到 的二值图像的示意图; 图 2是根据本发明一实施例的字符识别装置的模块组成示意图; 图 3是根据本发明第一实施例的字符识别方法的流程图; 图 4是根据本发明第二实施例的字符识别方法的流程图; 图 5是根据本发明第三实施例的字符识别方法的流程图; 图 6a是根据本发明一实施例的字符图像的示意图; 图 6b是图 6a中字符图像的灰度直方图; 图 7是根据本发明第二实施例的字符识别方法中利用不同阈值对字符图像进行二 值化处理和字符识别结果之间的关系图; 以及 图 8是根据本发明第三实施例的字符识别方法中利用不同阈值对字符图像进行二 值化处理和字符识别结果之间的关系图。 具体实施方式 需要说明的是, 在不冲突的情况下, 本申请中的实施例及实施例中的特征可以相 互组合。 下面将参考附图并结合实施例来详细说明本发明。 图 2是本发明一实施例的字符识别装置的模块组成示意图。 如图所示, 该字符识 别装置 10包括: 获取单元 11、 选取单元 12、 二值化处理单元 13、 识别单元 14、 计算 单元 15和判断单元 16。 获取单元 11, 用于获取阈值数组 TH, 其中, 阈值数组 TH包括多个阈值。 例如, 可以先对输入的原始图像进行计算以得到基础阈值 T0, 其中, 原始图像为待识别字符 所在区域的灰度图像, 如在识别纸币的冠字号时, 原始图像为纸币冠字号所在区域的
灰度图像, 也称为字符图像。 然后由基础阈值 TO 计算得到多个阈值, 从而由基础阈 值 TO拓展得到阈值数组 TH, 优选地, 阈值数组 TH中的阈值是以基础阈值 TO为中 心阈值扩展得到的。 二值化处理单元 13, 用于采用选定阈值对字符图像进行二值化处理, 得到字符图 像的二值图像。 选定阈值为从阈值数组 TH中选取得到的阈值。 利用阈值数组 TH中 的某一数据对字符图像进行二值化处理,把以灰度表示的字符图像转换为仅包括以 "0" 表示的白像素和" 1"表示的黑像素的二值图像, 比如, 利用基础阈值 TO对字符图像进 行二值化处理, 则把字符图像中灰度值大于等于 TO的像素转换为像素" 0", 把字符图 像中灰度值小于 TO的像素转换为像素 "1"。 识别单元 14, 用于对二值图像进行字符识别, 得到识别结果。 计算单元 15, 用于计算识别结果的置信度。 计算每个识别字符的置信度 C, 把计 算得到的置信度 C与置信度预定值进行比较, 如果置信度 C大于置信度预定值, 表示 识别的字符可信, 如果 C小于等于置信度预定值, 表示识别的字符不可信, 需要重新 进行识别, 其中, 置信度 C表示识别结果的可信度, 其数值越大, 则识别结果的可信 度越高。 判断单元 16, 判断识别结果的置信度是否大于置信度预定值, 其中, 如果识别结 果的置信度大于置信度预定值, 则将识别结果作为字符图像的识别结果。 选取单元 12, 用于从阈值数组 TH中选取第一阈值或第二阈值作为选定阈值, 其 中, 首先选取第一阈值作为选定阈值, 在第一阈值作为选定阈值时, 如果识别结果的 置信度不大于置信度预定值, 则从阈值数组中选取第二阈值。 这里的第一阈值和第二 阈值仅仅是举例描述, 可以是阈值数组 TH中的任意两个不同的阈值, SP, 在阈值数 组 TH中存储有多个阈值, 选取单元 12从阈值数组 TH中依次选取阈值对字符图像进 行二值化处理, 直到二值化处理之后的二值图像的识别结果的置信度 C大于置信度预 定值。 优选地, 二值化处理单元 13还用于切分二值图像, 得到 N个切分区域, 其中, N 个切分区域中的每一个切分区域分别与一个待识别字符相对应, 此时, 识别单元 14 还用于对 N个切分区域进行字符识别, 得到分别对应于 N个切分区域的 N个识别结 果, 计算单元 15还用于计算 N个识别结果的置信度, 判断单元 16还用于判断 N个识 别结果的置信度是否均大于置信度预定值, 如果 N个识别结果的置信度均大于置信度 预定值, 则确定识别结果的置信度大于置信度预定值, 如果 N个识别结果中任意一个 的置信度不大于置信度预定值, 则确定识别结果的置信度不大于置信度预定值。 识别
单元 14通过对切分区域进行字符识别,可以得到每个切分区域对应的字符, 从而得到 二值图像对应的字符串, 如对纸币冠字号区域进行识别, 得到包括多个字符和数字的 纸币冠字号。 优选地, 字符识别装置还包括: 记录单元 17, 用于在选取第一阈值作为选定阈值 时, 如果 N个识别结果中任意一个的置信度不大于置信度预定值, 记录第一切分区域 的识别结果和第二切分区域, 其中, 第一切分区域为 N个识别结果中置信度大于置信 度预定值的识别结果对应的切分区域, 第二切分区域为 N个识别结果中置信度不大于 置信度预定值的识别结果对应的切分区域。此时, 二值化处理单元 13还用于在选取第 二阈值作为选定阈值时, 采用第二阈值作为选定阈值对字符图像进行二值化处理, 得 到字符图像的二值图像,切分二值图像,得到 N个切分区域, 识别单元 14还用于对 N 个切分区域中与第二切分区域对应的切分区域进行字符识别。 获取单元 12可以进一步包括: 获取模块 121, 用于在采用选定阈值对字符图像进 行二值化处理之前, 获取字符图像的直方图; 计算模块 122, 用于对字符图像的直方 图进行计算, 得到基础阈值; 拓展模块 123, 用于以基础阈值为中心阈值进行拓展得 到阈值数组 TH,该拓展模块可以采用以下方式由基础阈值为中心阈值进行拓展得到阈 值数组 TH:
ΤΗ= {Τ0,Τ0+Δ, Τ0-Δ,Τ0+2Δ, Τ0-2Δ, ...} , 其中, Δ为阈值数组 TH中相邻阈值之间的差值, TO为基础阈值。 以下对本发明实施例提供的字符识别方法进行介绍。 需要说明的是, 本发明实施 例提供的字符识别方法可以通过本发明实施例的字符识别装置来执行。 相应地, 本发 明实施例提供的字符识别装置也可以用于本发明实施例的字符识别方法。 本发明实施 例的字符识别装置可以是计算机、 打印机、 扫描设备等。 图 3是根据本发明第一实施例的字符识别方法的流程图。 如图 3所示, 该字符识 别方法包括以下步骤: 步骤 Sll, 获取阈值数组, 其中, 阈值数组包括多个阈值。 阈值数组中的多个阈值可以是预先设置或存储的, 也可以是在字符识别的过程中 通过一个基础阈值计算得到的。 步骤 S12, 从阈值数组中选取第一阈值作为选定阈值。
从阈值数组中任意选取一个阈值作为第一阈值, 如果阈值数组是通过一个基础阈 值拓展得到的, 优选地, 可以选取该基础阈值作为第一阈值。 步骤 S13, 采用选定阈值对字符图像进行二值化处理, 得到字符图像的二值图像。 步骤 S14, 对二值图像进行字符识别, 得到识别结果。 步骤 S15, 计算识别结果的置信度。 步骤 S16, 判断识别结果的置信度是否大于置信度预定值。 如果识别结果的置信 度大于置信度预定值, 则执行步骤 S17。 如果识别结果的置信度不大于置信度预定值, 则执行步骤 S18。 步骤 S17, 将识别结果作为字符图像的识别结果。 步骤 S18, 从阈值数组中选取第二阈值, 采用第二阈值替换第一阈值作为选定阈 值, 并返回执行步骤 S13。 从阈值数组中任意选取一个与第一阈值不同的阈值作为第二阈值, 如果阈值数组 是通过一个基础阈值拓展得到的, 优选地, 该第二阈值为与基础阈值最临近的一个阈 值。 优选地, 步骤 S13还包括: 切分二值图像, 得到 N个切分区域, 其中, N个切分 区域中的每一个切分区域分别与一个待识别字符相对应。 步骤 S14包括: 对 N个切分 区域进行字符识别, 得到分别对应于 N个切分区域的 N个识别结果。 步骤 15包括: 计算 N个识别结果的置信度。 步骤 16包括: 判断 N个识别结果的置信度是否均大于 置信度预定值, 如果 N个识别结果的置信度均大于置信度预定值, 则确定识别结果的 置信度大于置信度预定值, 如果 N个识别结果中任意一个的置信度不大于置信度预定 值, 则确定识别结果的置信度不大于置信度预定值。 优选地, 在选取第一阈值作为选定阈值时, 如果 N个识别结果中任意一个的置信 度不大于置信度预定值, 该方法还包括: 记录第一切分区域的识别结果和第二切分区 域, 其中, 第一切分区域为 N个识别结果中置信度大于置信度预定值的识别结果对应 的切分区域, 第二切分区域为 N个识别结果中置信度不大于置信度预定值的识别结果 对应的切分区域。 在选取第二阈值作为选定阈值时: 步骤 S13包括: 采用第二阈值作 为选定阈值对字符图像进行二值化处理, 得到字符图像的二值图像, 切分二值图像, 得到 N个切分区域, 步骤 S14包括: 对 N个切分区域中与第二切分区域对应的切分区 域进行字符识别。
图 4是根据本发明第二实施例的字符识别方法的流程图。 该实施例可以作为图 3 所示第一实施例的一种优选实施方式, 如图 4所示, 具体处理过程如下: 步骤 S21, 根据字符图像的直方图, 确定基础阈值 T0, 得到阈值数组 ΤΗ。 该步骤 S21可以作为图 3所示步骤 S11的一种优选实施方式。 如图 6a所示, 对字符图像 30进行处理, 得到如图 6b所示的字符图像 30的灰度 直方图, 其中, 坐标系的横轴为像素的灰度值, 纵轴为具有各种灰度值的像素占总像 素数的比例, 可以利用现有技术中的任意一种阈值计算方法, 得到原始图像的基础阈 值 T0, 如通过 Ostu算法 (出处 N.Otsu, "A threshold selection method from grey-level histograms", IEEE Trans. Syst., Man, Cybem., vol. SMC-1, pp. 62-66, Jan. 1979)得 到基础阈值 T0。 为了满足对不同对比度图像的二值化, 因此, 需要设置多个阈值, 多 个阈值的获得方法是在以基础阈值 TO为中心阈值扩展得到的。 优选的, 从 TO扩展为 Τ0±η*Δ, 由此得到由多个阈值组成的阈值数组 ΤΗ, ΤΗ={Τ0,Τ0+Δ, Τ0-Δ,Τ0+2Δ, Τ0-2Δ, ...} , Δ为相邻阈值之间的差值, 优选取值为 0x10, 当然也可以取比 0x10更 小的数值。 阈值数组 ΤΗ的数据个数可以根据需要设定, 经测试验证, 阈值数组包括 5 个数据、 Δ等于 0x10能够达到识别准确率的要求,从而得到阈值数组 ΤΗ={Τ0,Τ0+0χ10, Τ0-0χ10,Τ0+0χ20, Τ0-0χ20}。 如图 6b所示, 基础阈值 T0等于 0x41, 阈值数组 TH的 第二个数据 Τ0+Δ为 0x51, 阈值数组 TH的第三个数据 Τ0-Δ为 0x31。 步骤 S22, 令阈值 T等于阈值数组 TH的第一个数据。 该步骤 S22可以作为图 3所示步骤 S12的一种优选实施方式。 令阈值 T等于阈值数组 TH的第一个数据, 本实施例中, TH的第一个数据为 T0, 第二个数据为 Τ0+Δ,第三个数据为 Τ0-Δ,第四个数据为 Τ0+2Δ,第五个数据为 Τ0-2Δ, 因此首先令阈值 T= TO对字符图像进行二值化处理。 步骤 S23, 使用阈值 T对字符图像进行二值化处理。 该步骤 S23可以作为图 3所示步骤 S13的一种优选实施方式。 使用阈值 T对字符图像进行二值化, 以得到字符图像的二值图像。 如图 7所示, 二值图像 40是以阈值 0x41对图 6a中字符图像 30进行二值化得到的图像, 二值图像 50是以阈值 0x51对图 6a中字符图像 30进行二值化得到的图像, 二值图像 60是以阈 值 0x31对图 6a中字符图像 30进行二值化得到的图像。
步骤 S24, 切分二值图像得到 N个切分区域。 对二值图像进行切分, 得到 N个切分区域, 每一个切分区域与一个待识别字符相 对应。 如图 7所示, 对二值图像 40进行切分时得到 10个切分区域。 对二值图像进行 切分时, 常用的切分方式为利用二值图像的垂直投影, 结合字符间距、 字符宽度、 字 符高度等, 对二值图像进行切割。 步骤 S25, 对第一个切分区域进行字符识别。 对 N个切分区域, 按照一定的顺序, 如从左到右的顺序, 进行字符识别。 首先从 第一个切分区域开始字符识别, 如图 7所示, 对二值图像 40的切分区域进行处理时, 从左边的第一个切分区域开始处理。 提取第一切分区域的特征向量, 计算特征向量与标准模板向量的欧氏距离:
其中, D为特征向量与标准模板向量的欧氏距离, D,为与第 i个标准模板向量的 欧氏距离, 是字符的特征向量, .是特征向量的第 j个分量, N,是第 i个标准模板 向量, 而 N^是 N,的第 j个分量, i的取值范围为 l~k, k为标准模板向量的数量, 如 对纸币的冠字号进行识别时, 冠字号包括从 0~9的 10个数字及从 A~Z的 26个字母, 则 k=36。 对 k个欧氏距离 D2 Dk-1 , Dk进行排序, 得到最小的欧氏距离, 选择与 最小的欧氏距离对应的标准模板向量所代表的字符作为被识别字符的识别结果。 上述步骤 S24和步骤 S25可以作为图 3所示步骤 S14的一种优选实施方式。 步骤 S26, 计算置信度 C。 计算置信度, 以 C表示, C = _DJD,其中, Dx为最小的欧氏距离, Dy为次小 的欧氏距离。 图 3所示步骤 S15中的置信度 C也可以采用上述方式进行计算。 步骤 S27, 判定置信度 C是否大于置信度预定值。 该步骤 S27可以作为图 3所示步骤 S16的一种优选实施方式。
把计算得到的置信度 C与置信度预定值进行比较, 其中, 置信度预定值是利用字 符识别方法中的标准模板向量对字符进行识别时经试验得到的数值, 它表示置信度小 于置信度预定值的识别字符是不可信的, 其取值范围为 [0,1], 如等于 0.2, 当置信度 C 大于置信度预定值时, 表示识别结果可信, 则转到步骤 S29; 如果置信度 C小于等于 置信度预定值, 表示识别结果不可信, 则转到步骤 S28。 如图 7所示, 设置信度预定 值为 0.2, 进行第一次识别时, 对二值图像 40的 10个切分区域从左向右进行识别, 前 四个切分区域分别被识别为如字符串 42所示的字符" Z""J""5""7", 四个识别结果的置 信度依次为 0.597321、 0.614531、 0.502632和 0.165150, 由于第一个切分区域到第三 个切分区域的识别结果的置信度均大于置信度预定值, 表明第一个切分区域到第三个 切分区域的识别结果是可信的, 因此, 每识别一个切分区域后执行步骤 S29, 对下一 个切分区域进行识别; 在对二值图像 40的第四个切分区域 41识别时, 由于二值图像 40的第四个切分区域 41 的识别结果的置信度小于置信度预定值, 表明识别结果 (如 字符 421所示的字符" 7") 不可信, 因此, 对二值图像 40的第四个切分区域进行符识 别后, 转到步骤 S28, 令阈值 T等于阈值数组 TH的下一个数据(即阈值数组 TH的第 二个数据)。 当令阈值 T等于阈值数组 TH的第二个数据进行第二次识别时,二值图像 50的第 一个切分区域至第四个切分区域分别被识别为如字符串 52所示的字符" Z""J""5""7", 四个识别结果的置信度依次为 0.589010、 0.552231、 0.538618和 0.002581, 由于二值 图像 50 的第一个切分区域至第三个切分区域的识别结果的置信度均大于置信度预定 值,表明二值图像 50的第一个切分区域到第三个切分区域的识别结果是可信的,因此, 每识别一个切分区域后执行步骤 S29, 对下一个切分区域进行识别; 在对二值图像 50 的第四个切分区域 51识别时,由于二值图像 50的第四个切分区域 51的识别结果的置 信度小于置信度预定值, 表明识别结果 (如字符 521所示的字符" 7") 不可信, 因此, 对二值图像 50的第四个切分区域进行字符识别后, 转到步骤 S28, 令阈值 T等于阈值 数组 TH的下一个数据 (即阈值数组 TH的第三个数据)。 当令阈值 T等于阈值数组 TH的第三个数据进行第三次字符识别时, 二值图像 60 的 10 个切分区域从左向右分别被识别为如字符串 62 所示的字符 "Z""J""5""7""5""1""9""6""9""5", 每个识别结果的置信度依次为 0.504003、 0.588911、 0.586431 0.503960、 0.540323 0.733446、 0.640636、 0.562679、 0.634037和 0.332221 , 由于全部 10个切分区域的识别结果的置信度均大于置信度预定值, 因此, 10个切分 区域的识别结果均是可信的,则进行二值图像 60的第一个切分区域至第十个切分区域 的字符识别时, 每识别一个切分区域后执行步骤 S29, 对下一个切分区域进行识别, 直至所有切分区域均完成识别。
步骤 S28, 令阈值 T等于阈值数组 TH的下一个数据。 当识别结果不可信时, 表示以当前的阈值 T进行二值化处理得到的二值图像的质 量达不到字符识别的要求, 则取阈值数组 TH的下一个数据为阈值 T, 重新进行二值 化处理及字符识别。 结合图 6a、图 7和图 8说明利用不同的阈值 T对字符图像进行二值化处理时得到 不同质量的二值图像。 如果待处理的字符图像为图 6a中的字符图像 30, 阈值数组 TH 为 {0x41,0x51,0x31,0x61,0x21}, 当以阈值数组 TH的第一个数据 0x41为阈值对字符图 像 30进行二值化处理时得到二值图像 40, 以阈值数组 TH的第二个数据 0x51为阈值 对字符图像 30进行二值化处理时得到二值图像 50,以阈值数组 TH的第三个数据 0x31 为阈值对字符图像 30进行二值化处理时得到二值图像 60, 从中可以看出二值图像 60 的质量最好、 二值图像 40的质量次之、 二值图像 50的质量最差。 步骤 S29, 判定是否处理完所有的切分区域。 判定所有的切分区域是否全部处理完, 如共有 N个切分区域, 在处理第一个切分 区域之前, 将用于记录已处理的切分区域数的计数器的值设为 0, 每次处理完一个切 分区域, 将用于记录已处理的切分区域数的计数器的值就加 1, 当已处理的切分区域 数小于 N时, 表示未处理完所有的切分区域, 则转到步骤 S30; 当已处理的切分区域 数等于 N时, 表示已处理完所有的切分区域, 则本次字符识别过程结束。 步骤 S30, 对下一个切分区域进行字符识别。 当还有未处理的切分区域时, 则取下一个切分区域进行字符识别, 如本次处理的 切分区域为从左边开始的第一个切分区域, 则下一次处理的切分区域为从左边开始的 第二个切分区域。 提取下一个切分区域的特征向量, 计算特征向量与标准模板向量的欧氏距离 对 k个欧氏距离 D2 Dk-1, Dk进行排序, 选择与最小的欧氏距离对应的标准 模板向量所代表的字符作为被识别字符的识别结果。 本实施例提供的字符识别方法, 对识别字符进行置信度评估, 通过置信度的评估 结果对阈值动态调整, 只有置信度符合要求的识别字符为最终的识别字符, 从而保证 了识别字符的准确度。 图 5是根据本发明第三实施例的字符识别方法的流程图, 该实施例也可以作为图 3所示第一实施例的一种优选实施方式。 具体处理过程如下:
步骤 S41至步骤 S43同步骤 S21至步骤 S23。 步骤 S44, 切分二值图像, 得到 N个切分区域, 将 N个切分区域设定为待识别区 域。 对二值图像进行切分, 得到 N个切分区域, 如图 8所示, 对二值图像 40进行切 分时得到 10 (N=10) 个切分区域, 将这 N个切分区域设定为待识别区域。 步骤 S45, 对第一个待识别区域进行字符识别。 如果待识别区域为 N个切分区域,则第一个待识别区域为 N个切分区域中的第一 个区域, 如图 8所示, 对二值图像 40的 10个切分区域进行处理时, 按照从左向右的 顺序进行处理时, 则左边第一个切分区域为第一个待识别区域。 如果待识别区域为 M个识别失败的切分区域, 则第一个待识别区域为 M个识别 失败的切分区域中的第一个区域, 如图 8所示, 由于第一次识别时二值图像 40的第四 个切分区域 41 识别失败, 因此, 进行第二次识别时, 第一个待识别区域为二值图像 50中与第一次识别时识别失败的二值图像 40的第四个切分区域 41对应的区域, 即二 值图像 50的切分区域 51 ; 由于第二次识别时二值图像 50的第四个切分区域 51识别 失败, 因此, 进行第三次识别时, 第一个待识别区域为二值图像 60中与第二次识别时 识别失败的二值图像 50的第四个切分区域 51对应的区域,即二值图像 60的第四个切 分区域 61。 提取第一待识别区域的特征向量, 计算特征向量与标准模板向量的欧氏距离 Di, 对 k个欧氏距离 Dl、 D2、 ...、 Dk-1、 Dk进行排序, 选择与最小的欧氏距离对应的标 准模板向量所代表的字符为第一个待识别区域的识别字符。 步骤 S46, 计算置信度 C。 同步骤 S26。 步骤 S47, 判定置信度 C是否大于置信度预定值。 把计算得到的置信度 C与置信度预定值进行比较, 其中, 置信度预定值为小于 1 的数值, 当置信度 C大于置信度预定值时, 表示识别结果可信, 则转到步骤 S48; 如 果置信度 C小于等于置信度预定值时, 表示待识别区域的识别结果不可信, 则转到步 骤 S49。
如图 8所示, 进行第一次识别时, 二值图像 40的 10个切分区域从左向右分别识 别为如字符串 44所示的字符" Z""J""5""7""5""1""9""6""9"和" 5",每个识别结果的置信 度 C依次为 0.597321、 0.614531、 0.502632、 0.165150、 0.662693、 0.716749、 0.651325、 0.504233 0.616645和 0.436257, 置信度预定值为 0.2, 由于只有第四个切分区域 41 的识别结果的置信度小于置信度预定值, 其余 9个切分区域的识别结果的置信度均大 于置信度预定值, 因此, 对第四个切分区域 41进行字符识别后, 转到步骤 S49, 记录 第四个切分区域为识别失败的区域; 对第一个切分区域至第三个切分区域以及第五个 切分区域至第十个切分区域进行字符识别后, 每完成一切分区域的识别, 就转到步骤 S48, 将该切分区域对应的字符记录为可信的识别字符。 进行第二次识别时, 二值图像 50的切分区域 51的识别结果(如字符 54所示的字 符" 7") 的置信度为 0.002581, 由于该识别结果的置信度小于置信度预定值, 因此, 对 切分区域 51进行字符识别后, 转到步骤 S49, 记录该切分区域为识别失败的区域。 进行第三次识别时, 二值图像 60的切分区域 61的识别结果(如字符 64所示的字 符" 7") 的置信度为 0.503960, 由于该识别结果的置信度大于置信度预定值, 因此, 对 切分区域 61进行字符识别后, 转到步骤 S48, 将该切分区域对应的字符记录为可信的 识别字符。 步骤 S48, 记录可信的识别字符 记录每次识别时识别结果可信的字符与对应的切分区域序号。 如图 8所示, 进行 第一次识别时,二值图像 40的第一个切分区域至第三个切分区域以及第五个切分区域 至第十个切分区域的识别结果可信, 则记录识别字符与所在切分区域的对应关系。 比 如记录字母" Z"与第一个切分区域对应、 字母" J"与第二个切分区域对应等。 步骤 S49, 记录识别失败的切分区域 记录每次识别时识别失败的切分区域, 如图 8所示, 进行第一次识别时, 由于二 值图像 40的第四个切分区域 41的识别结果不可信, 即该切分区域识别失败, 因此, 第一次识别时记录二值图像 40的第四个切分区域 41为识别失败的切分区域; 进行第 二次识别时, 由于二值图像 50的第四个切分区域 51的识别结果不可信, 因此, 第二 次识别时记录该切分区域为识别失败的切分区域。 步骤 S50, 判定是否处理完所有的待识别区域
如图 8所示, 当待识别区域为二值图像 40中的所有切分区域 (10个切分区域) 时, 则本次 (即第一次) 识别的待识别区域为 10个; 当待识别区域为二值图像 50的 第四个切分区域 51时, 则本次(即第二次)识别的待识别区域为 1个区域。 如果未处 理完所有的待识别区域, 则转到步骤 S51 ; 否则, 转到步骤 S52。 步骤 S51, 对下一个待识别区域进行字符识别 当还有未进行识别的待识别区域时, 则对下一个待识别区域进行字符识别, 如本 次处理的待识别区为二值图像 40的 10个切分区域, 当第一个待识别区域为左边开始 的第一个切分区域时, 则下一待识别区域为左边开始的第二个切分区域。 提取下一个待识别区域的特征向量, 计算其特征向量与标准模板向量的欧氏距离 ¾,对 k个欧氏距离 D2 Dk-1 , Dk进行排序, 选择与最小的欧氏距离对应的 标准模板向量所代表的字符为下一个待识别区域的识别字符。 步骤 S52, 判断是否有识别失败的切分区域 根据本次识别时是否记录识别失败的切分区域来判断本次字符识别是否有识别失 败的区域。如图 8所示, 进行第一次识别时, 步骤 S49记录了二值图像 40的第四个切 分区域 41为识别失败的切分区域, 因此, 第一次识别结束后有识别失败的切分区域; 进行第二次识别时, 步骤 S49记录二值图像 50的第四个切分区域 51为识别失败的切 分区域, 因此第二次识别结束后有识别失败的切分区域; 进行第三次识别时, 由于没 有记录有识别失败的切分区域, 因此, 第三次识别结束后没有识别失败的切分区域。 当有识别失败的切分区域时, 则转到步骤 S53 ; 当没有识别失败的切分区域时, 则字符识别过程结束。 其中, 字符图像的最终识别结果为多次字符识别的可信识别字 符的组合, 如图 8所示, 字符图像的识别结果 (字符串 70) 为第一次识别的识别结果 45与第三次识别的识别结果 65 的组合, 即用第三次识别的可信识别字符替代第一次 识别时识别失败的切分区域的识别字符。 步骤 S53, 令阈值 T等于阈值数组 TH的下一个数据。 同步骤 S28。 步骤 S54, 使用阈值 T对字符图像进行二值化处理。 同步骤 S23。
步骤 S55, 切分二值图像, 得到 N个切分区域, 选择 M个识别失败的区域为待识 别区域 如图 8所示, 对二值图像 50进行切分时, 得到 10个切分区域, 由于上一次 (即 第一次) 识别时第四个切分区域识别失败, 因此, 本次 (即第二次) 识别的待识别区 域为 10个切分区域中的与上一次识别失败对应的切分区域, 即二值图像 50的第四个 切分区域 51 ; 同样地, 对二值图像 60进行切分时, 得到 10个切分区域, 由于上一次 (即第二次)识别时二值图像 50的第四个切分区域识别失败, 因此,本次(即第三次) 识别的待识别区域为 10个切分区域中的与上一次识别失败对应的切分区域,即二值图 像 60的第四切分区域 61。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以用通用 的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多个计算装置所 组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码来实现, 从而, 可以 将它们存储在存储装置中由计算装置来执行, 或者将它们分别制作成各个集成电路模 块, 或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。 这样, 本发明 不限制于任何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领域的技 术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和原则之内, 所作的 任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。
Claims
1. 一种字符识别方法, 其特征在于, 包括:
获取阈值数组, 其中, 所述阈值数组包括多个阈值;
从所述阈值数组中选取第一阈值作为选定阈值;
步骤 a, 采用所述选定阈值对字符图像进行二值化处理, 得到所述字符图 像的二值图像;
步骤 b, 对所述二值图像进行字符识别, 得到识别结果;
步骤 c, 计算所述识别结果的置信度;
步骤 d, 判断所述识别结果的置信度是否大于置信度预定值, 如果所述识别结果的置信度大于所述置信度预定值, 则将所述识别结果作 为所述字符图像的识别结果; 以及
如果所述识别结果的置信度不大于所述置信度预定值, 则从所述阈值数组 中选取第二阈值, 采用所述第二阈值替换所述第一阈值作为所述选定阈值, 并 返回执行所述步骤 a。
2. 根据权利要求 1所述的字符识别方法, 其特征在于,
所述步骤 a包括: 切分所述二值图像, 得到 N个切分区域, 其中, 所述 N 个切分区域中的每一个切分区域分别与一个待识别字符相对应,
所述步骤 b包括: 对所述 N个切分区域进行字符识别, 得到分别对应于所 述 N个切分区域的 N个识别结果,
所述步骤 c包括: 计算所述 N个识别结果的置信度,
所述步骤 d包括: 判断所述 N个识别结果的置信度是否均大于置信度预定 值,
如果所述 N个识别结果的置信度均大于所述置信度预定值, 则确定所述识 别结果的置信度大于所述置信度预定值,
如果所述 N个识别结果中任意一个的置信度不大于所述置信度预定值, 则 确定所述识别结果的置信度不大于所述置信度预定值。
3. 根据权利要求 2所述的字符识别方法, 其特征在于,
在选取所述第一阈值作为所述选定阈值时, 如果所述 N个识别结果中任意 一个的置信度不大于所述置信度预定值, 所述方法还包括:
记录第一切分区域的识别结果和第二切分区域, 其中, 所述第一切分区域 为所述 N个识别结果中置信度大于所述置信度预定值的识别结果对应的切分区 域,所述第二切分区域为所述 N个识别结果中置信度不大于所述置信度预定值 的识别结果对应的切分区域,
在选取所述第二阈值作为所述选定阈值时:
所述步骤 a包括: 采用所述第二阈值作为所述选定阈值对所述字符图像进 行二值化处理, 得到所述字符图像的二值图像, 切分所述二值图像, 得到 N个 切分区域,
所述步骤 b包括: 对所述 N个切分区域中与所述第二切分区域对应的切分 区域进行字符识别。
4. 根据权利要求 1所述的字符识别方法, 其特征在于, 在采用选定阈值对字符图 像进行二值化处理之前, 所述方法还包括:
获取所述字符图像的直方图;
对所述字符图像的直方图进行计算, 得到基础阈值; 以及
以所述基础阈值为中心阈值进行拓展得到所述阈值数组。
5. 根据权利要求 4所述的字符识别方法, 其特征在于, 采用以下方式由所述基础 阈值为中心阈值进行拓展得到所述阈值数组 TH:
ΤΗ= {Τ0,Τ0+Δ, Τ0-Δ,Τ0+2Δ, Τ0-2Δ, ...} ,
其中, Δ为所述阈值数组 ΤΗ中相邻阈值之间的差值, TO为所述基础阈值。
6. 一种字符识别装置, 其特征在于, 包括:
获取单元, 用于获取阈值数组, 其中, 所述阈值数组包括多个阈值; 二值化处理单元, 用于采用选定阈值对字符图像进行二值化处理, 得到所 述字符图像的二值图像;
识别单元, 用于对所述二值图像进行字符识别, 得到识别结果; 计算单元, 用于计算所述识别结果的置信度;
判断单元, 判断所述识别结果的置信度是否大于置信度预定值, 其中, 如 果所述识别结果的置信度大于所述置信度预定值, 则将所述识别结果作为所述 字符图像的识别结果;
选取单元, 用于从所述阈值数组中选取第一阈值或第二阈值作为所述选定 阈值, 其中, 首先选取所述第一阈值作为所述选定阈值, 在所述第一阈值作为 所述选定阈值时, 如果所述识别结果的置信度不大于所述置信度预定值, 则从 所述阈值数组中选取所述第二阈值。
7. 根据权利要求 6所述的字符识别装置, 其特征在于,
所述二值化处理单元还用于切分所述二值图像,得到 N个切分区域,其中, 所述 N个切分区域中的每一个切分区域分别与一个待识别字符相对应,
所述识别单元还用于对所述 N个切分区域进行字符识别,得到分别对应于 所述 N个切分区域的 N个识别结果,
所述计算单元还用于计算所述 N个识别结果的置信度,
所述判断单元还用于判断所述 N个识别结果的置信度是否均大于置信度预 定值, 如果所述 N个识别结果的置信度均大于所述置信度预定值, 则确定所述 识别结果的置信度大于所述置信度预定值, 如果所述 N个识别结果中任意一个 的置信度不大于所述置信度预定值, 则确定所述识别结果的置信度不大于所述 置信度预定值。
8. 根据权利要求 7所述的字符识别装置, 其特征在于, 还包括:
记录单元, 用于在选取所述第一阈值作为所述选定阈值时, 如果所述 N个 识别结果中任意一个的置信度不大于所述置信度预定值, 记录第一切分区域的 识别结果和第二切分区域, 其中, 所述第一切分区域为所述 N个识别结果中置 信度大于所述置信度预定值的识别结果对应的切分区域, 所述第二切分区域为 所述 N个识别结果中置信度不大于所述置信度预定值的识别结果对应的切分区 域,
其中, 所述二值化处理单元还用于在选取所述第二阈值作为所述选定阈值 时, 采用所述第二阈值作为所述选定阈值对所述字符图像进行二值化处理, 得 到所述字符图像的二值图像, 切分所述二值图像, 得到 N个切分区域,
其中,所述识别单元还用于对所述 N个切分区域中与所述第二切分区域对 应的切分区域进行字符识别。
根据权利要求 6所述的字符识别装置, 其特征在于, 所述获取单元包括: 获取模块, 用于在采用选定阈值对字符图像进行二值化处理之前, 获取所 述字符图像的直方图;
计算模块, 用于对所述字符图像的直方图进行计算, 得到基础阈值; 拓展模块, 用于以所述基础阈值为中心阈值进行拓展得到所述阈值数组。 根据权利要求 9所述的字符识别装置, 其特征在于, 所述拓展模块用于采用以 下方式由所述基础阈值为中心阈值进行拓展得到所述阈值数组 TH:
ΤΗ= {Τ0,Τ0+Δ, Τ0-Δ,Τ0+2Δ, Τ0-2Δ, ...} ,
其中, Δ为所述阈值数组 ΤΗ中相邻阈值之间的差值, TO为所述基础阈值。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310060434.6 | 2013-02-26 | ||
CN201310060434.6A CN104008384B (zh) | 2013-02-26 | 2013-02-26 | 字符识别方法和字符识别装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014131339A1 true WO2014131339A1 (zh) | 2014-09-04 |
Family
ID=51369033
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2014/072328 WO2014131339A1 (zh) | 2013-02-26 | 2014-02-20 | 字符识别方法和字符识别装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN104008384B (zh) |
WO (1) | WO2014131339A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109389115A (zh) * | 2017-08-11 | 2019-02-26 | 腾讯科技(上海)有限公司 | 文本识别方法、装置、存储介质和计算机设备 |
CN110942074A (zh) * | 2018-09-25 | 2020-03-31 | 京东数字科技控股有限公司 | 字符切分识别方法、装置、电子设备、存储介质 |
CN111767908A (zh) * | 2019-04-02 | 2020-10-13 | 顺丰科技有限公司 | 字符检测方法、装置、检测设备及存储介质 |
Families Citing this family (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104766057B (zh) * | 2015-03-31 | 2018-02-02 | 安徽创世科技股份有限公司 | 一种字符识别方法 |
CN104915648B (zh) * | 2015-06-02 | 2018-07-20 | 北京天创征腾信息科技有限公司 | 文档/单证方向检测方法和检测装置 |
CN105761351A (zh) * | 2016-01-08 | 2016-07-13 | 东方通信股份有限公司 | 基于结构特征的字符识别方法 |
CN106093052B (zh) * | 2016-06-03 | 2019-10-25 | 南京航空航天大学 | 一种断纱检测方法 |
WO2018039970A1 (zh) * | 2016-08-31 | 2018-03-08 | 富士通株式会社 | 用于字符识别的分类网络的训练装置、字符识别装置及方法 |
CN106355205A (zh) * | 2016-08-31 | 2017-01-25 | 西安西拓电气股份有限公司 | 一种紫外图像数字识别方法及识别装置 |
CN106778736B (zh) * | 2016-11-25 | 2020-06-26 | 四川九洲电器集团有限责任公司 | 一种鲁棒的车牌识别方法及其系统 |
JP6804292B2 (ja) * | 2016-12-28 | 2020-12-23 | オムロンヘルスケア株式会社 | 端末装置 |
CN106874906B (zh) * | 2017-01-17 | 2023-02-28 | 腾讯科技(上海)有限公司 | 一种图片的二值化方法、装置及终端 |
CN106951902B (zh) * | 2017-03-27 | 2020-10-20 | 深圳怡化电脑股份有限公司 | 一种图像二值化处理方法及装置 |
CN107403130A (zh) * | 2017-04-19 | 2017-11-28 | 北京粉笔未来科技有限公司 | 一种字符识别方法及字符识别装置 |
CN109034149A (zh) * | 2017-06-08 | 2018-12-18 | 北京君正集成电路股份有限公司 | 一种字符识别方法及装置 |
CN108345880B (zh) * | 2018-01-26 | 2021-07-27 | 金蝶软件(中国)有限公司 | 发票识别方法、装置、计算机设备和存储介质 |
CN109902768B (zh) * | 2019-04-26 | 2021-06-29 | 上海肇观电子科技有限公司 | 光学字符识别技术的输出结果的处理 |
CN110211282A (zh) * | 2019-05-23 | 2019-09-06 | 深兰科技(上海)有限公司 | 一种自动售货方法及贩卖机 |
CN110443251A (zh) * | 2019-08-13 | 2019-11-12 | 树根互联技术有限公司 | 仪表图像识别方法及装置 |
CN116912839A (zh) * | 2023-09-13 | 2023-10-20 | 中移(苏州)软件技术有限公司 | 文字识别方法、装置及电子设备 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030012440A1 (en) * | 2001-07-11 | 2003-01-16 | Keiko Nakanishi | Form recognition system, form recognition method, program and storage medium |
CN101042735A (zh) * | 2006-03-23 | 2007-09-26 | 株式会社理光 | 图像二值化方法和装置 |
CN101727582A (zh) * | 2008-10-22 | 2010-06-09 | 富士通株式会社 | 文档图像二值化方法及其装置,以及文档图像处理器 |
CN102136068A (zh) * | 2011-03-31 | 2011-07-27 | 中国科学院半导体研究所 | 基于平均灰度的距离选通图像有效信息区的提取方法 |
CN102156868A (zh) * | 2011-03-31 | 2011-08-17 | 汉王科技股份有限公司 | 图像二值化方法和装置 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101930532A (zh) * | 2010-10-29 | 2010-12-29 | 福州中路网络技术开发有限公司 | 基于手机摄像头快速响应矩阵码识读方法 |
-
2013
- 2013-02-26 CN CN201310060434.6A patent/CN104008384B/zh active Active
-
2014
- 2014-02-20 WO PCT/CN2014/072328 patent/WO2014131339A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030012440A1 (en) * | 2001-07-11 | 2003-01-16 | Keiko Nakanishi | Form recognition system, form recognition method, program and storage medium |
CN101042735A (zh) * | 2006-03-23 | 2007-09-26 | 株式会社理光 | 图像二值化方法和装置 |
CN101727582A (zh) * | 2008-10-22 | 2010-06-09 | 富士通株式会社 | 文档图像二值化方法及其装置,以及文档图像处理器 |
CN102136068A (zh) * | 2011-03-31 | 2011-07-27 | 中国科学院半导体研究所 | 基于平均灰度的距离选通图像有效信息区的提取方法 |
CN102156868A (zh) * | 2011-03-31 | 2011-08-17 | 汉王科技股份有限公司 | 图像二值化方法和装置 |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109389115A (zh) * | 2017-08-11 | 2019-02-26 | 腾讯科技(上海)有限公司 | 文本识别方法、装置、存储介质和计算机设备 |
CN109389115B (zh) * | 2017-08-11 | 2023-05-23 | 腾讯科技(上海)有限公司 | 文本识别方法、装置、存储介质和计算机设备 |
CN110942074A (zh) * | 2018-09-25 | 2020-03-31 | 京东数字科技控股有限公司 | 字符切分识别方法、装置、电子设备、存储介质 |
CN110942074B (zh) * | 2018-09-25 | 2024-04-09 | 京东科技控股股份有限公司 | 字符切分识别方法、装置、电子设备、存储介质 |
CN111767908A (zh) * | 2019-04-02 | 2020-10-13 | 顺丰科技有限公司 | 字符检测方法、装置、检测设备及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN104008384A (zh) | 2014-08-27 |
CN104008384B (zh) | 2017-11-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2014131339A1 (zh) | 字符识别方法和字符识别装置 | |
EP2553626B1 (en) | Segmentation of textual lines in an image that include western characters and hieroglyphic characters | |
US9384409B1 (en) | Word segmentation for document image using recursive segmentation | |
WO2019169532A1 (zh) | 车牌识别方法及云系统 | |
US8867828B2 (en) | Text region detection system and method | |
US7835547B2 (en) | Image recognition device, image recognition method, and program for causing computer to execute the method | |
US10438083B1 (en) | Method and system for processing candidate strings generated by an optical character recognition process | |
CN102855478B (zh) | 图像中文本区域定位方法和装置 | |
JP5176763B2 (ja) | 低品質文字の識別方法及び装置 | |
JP2007086954A (ja) | 文字認識処理装置、および文字認識処理方法、並びにコンピュータ・プログラム | |
JP4100885B2 (ja) | 帳票認識装置、方法、プログラムおよび記憶媒体 | |
JP2012252447A (ja) | 情報処理装置および方法、記録媒体、並びにプログラム | |
CN110598581A (zh) | 基于卷积神经网络的光学乐谱识别方法 | |
JP2009129237A (ja) | 画像処理装置及びその方法 | |
CN111723852A (zh) | 针对目标检测网络的鲁棒训练方法 | |
US20130050765A1 (en) | Method and apparatus for document authentication using image comparison on a block-by-block basis | |
US11430235B2 (en) | Image processing apparatus, image processing method, and storage medium | |
JP5672828B2 (ja) | 画像処理装置及び画像処理プログラム | |
CN109460763B (zh) | 一种基于多层次文本组件定位与生长的文本区域提取方法 | |
JP2011257896A (ja) | 文字認識方法及び文字認識装置 | |
US8457404B2 (en) | Image processing apparatus, computer readable medium for image processing and computer data signal for image processing | |
JP5347793B2 (ja) | 文字認識装置、文字認識プログラムおよび文字認識方法 | |
KR101866867B1 (ko) | 동공 중심 검출 방법 | |
JP2005250786A (ja) | 画像認識方法 | |
JP6493559B2 (ja) | 文字認識装置及び文字認識方法 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14756834 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 14756834 Country of ref document: EP Kind code of ref document: A1 |