WO2014005456A1 - 一种纸类字符识别方法及相关装置 - Google Patents
一种纸类字符识别方法及相关装置 Download PDFInfo
- Publication number
- WO2014005456A1 WO2014005456A1 PCT/CN2013/074130 CN2013074130W WO2014005456A1 WO 2014005456 A1 WO2014005456 A1 WO 2014005456A1 CN 2013074130 W CN2013074130 W CN 2013074130W WO 2014005456 A1 WO2014005456 A1 WO 2014005456A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- character
- area
- single character
- target
- image data
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 62
- 238000012937 correction Methods 0.000 claims abstract description 21
- 238000007781 pre-processing Methods 0.000 claims description 11
- 239000000284 extract Substances 0.000 claims description 4
- 238000000605 extraction Methods 0.000 claims description 4
- 238000000926 separation method Methods 0.000 claims description 4
- 238000012545 processing Methods 0.000 description 7
- 238000013528 artificial neural network Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000011218 segmentation Effects 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000012567 pattern recognition method Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- ONIBWKKTOPOVIA-UHFFFAOYSA-N Proline Chemical compound OC(=O)C1CCCN1 ONIBWKKTOPOVIA-UHFFFAOYSA-N 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000003292 glue Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
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/14—Image acquisition
- G06V30/146—Aligning or centring of the image pick-up or image-field
- G06V30/147—Determination of region of interest
-
- 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/14—Image acquisition
- G06V30/148—Segmentation of character regions
-
- 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 image processing, and in particular, to a paper character recognition method and related device.
- Banknotes are an important type of bill.
- the number of genuine bills is unique and is a sign of the number of printed national banknotes, so it can be used as proof of identity for banknotes.
- the accuracy of recognition of the machine with the identification function of the banknote number on the market cannot meet the requirements of financial institutions.
- the financial institution handles the business, it finally needs to use the method of manually copying the banknote number to assist in identifying the counterfeit currency. Therefore, it is necessary to develop a high-efficiency, high-accuracy banknote number automatic identification and recording system on the banknote processing machine. Once an abnormal situation occurs (such as an ATM machine receiving counterfeit money or taking out counterfeit money from ATM), it can pass the automatically recorded banknotes. The number is tracked and located.
- the banknote number identification system is mainly divided into two parts, character positioning and character recognition.
- the accuracy of character positioning directly affects the recognition result of characters. Due to the new and old degree of the banknote itself and the light-receiving value of the image collection device, the following problems mainly exist in the character positioning:
- the relative position of the character in the whole image has a certain floating, on the one hand, the relative position of the character during the printing of the banknote will be certain
- the size of the tilt angle also causes a certain floating of the relative position of the character; for the above reasons, the character positioning is prone to deviation, and the identification device cannot accurately recognize the banknote number.
- Embodiments of the present invention provide a paper character recognition method and related apparatus for accurately identifying a character string in an input paper.
- the paper character recognition method provided by the present invention includes: acquiring image data of an input paper; performing tilt correction on the image data; performing preliminary positioning on the target character string of the image data, and obtaining preliminary information on the target character string a region; a region that minimizes a sum of gray values of pixels in the preliminary region; obtains a full region of the target character string; and performs characters on the target character string in the entire region Identification.
- the performing tilt correction on the image data includes: extracting edge points of the image data; performing straight line fitting on the edge points; and obtaining an inclination angle of the edge points after the straight line fitting; The tilt angle adjusts the image data.
- the method before performing preliminary positioning on the target character string of the image data, the method includes: preprocessing the image data, where the preprocessing includes any one or two of currency identification, face value recognition, and direction recognition. More than one combination.
- the preliminary positioning of the target character string of the image data is specifically: acquiring a target area of the target character string according to the result of the pre-processing; the preliminary area is the target character string in the Maximum range information within the target area, the maximum range information including a maximum height H and a maximum width W of the target area.
- the method before performing the vertice positioning of the target character string according to the preliminary area, includes: removing noise data in the preliminary area.
- performing character recognition on the target character string in the entire area including:
- the determining the upper and lower boundaries and the left and right boundaries of each character in the target string includes:
- Obtaining a character pixel point threshold in the target character string determining consecutive character pixel points according to the character pixel point threshold, and using a starting point coordinate and an ending point coordinate in a vertical direction of the consecutive character pixel points as upper and lower boundaries, The starting point coordinates and the end point coordinates in the horizontal direction of successive character pixel points are used as the left and right borders.
- the method includes:
- the two characters are judged to be broken characters according to the spacing between two adjacent characters, and if so, the single character regions of the two characters are combined.
- the method includes:
- the determining, according to the character width of the single character, whether the single character is a sticky word comprising: determining whether a character width of the single character is greater than a width threshold, and if so, the single character is a glued character;
- the method includes:
- the determining the upper and lower boundaries of each character in the target string includes:
- the pixel points before the two pixel points are taken as the upper boundary; If the two pixel points do not satisfy the character pixel point threshold, the pixel points before the two pixel points serve as the lower boundary.
- the paper character recognition method provided by the present invention includes: acquiring a target area of a character string; determining upper and lower boundaries and left and right boundaries of each character in the target area, and obtaining each single character area; according to the spacing between two adjacent characters Determining whether the two characters are broken characters, and if so, combining the single character regions of the two characters; respectively identifying characters in the single character region.
- the determining the upper and lower boundaries and the left and right boundaries of each character in the character string includes: acquiring a threshold of a character pixel point in the character string; determining a continuous character pixel point according to the threshold value of the character pixel point, The starting point coordinates and the end point coordinates in the vertical direction of the consecutive character pixel points are used as upper and lower boundaries, and the starting point coordinates and the ending point coordinates in the horizontal direction of the consecutive character pixel points are used as left and right boundaries.
- the method includes:
- determining whether the single character is a sticky character according to a character width of a single character comprising: determining whether a character width of the single character is greater than a width threshold, and if yes, the single Characters are glued characters;
- Separating the single-character region of the single character includes: re-determining the left and right boundaries of the single character, and if the single-character continuous character pixel points in the horizontal direction satisfy the preset character width, confirm the The area within the preset character width is the separated first single-character area, and starts from the next point of the first single-character area as the left boundary of the separated character, and the right border of the original single character is The right border of the separated character.
- the method includes:
- the determining the upper and lower boundaries of each character in the string includes:
- the pixel points before the two pixel points serve as an upper boundary;
- the middle pixel of the whole area starts to search downward. If two consecutive pixel points do not satisfy the character pixel point threshold, the pixel points before the two pixel points serve as the lower boundary.
- the paper character recognition device comprises: a data acquisition unit for acquiring image data of an input paper; a tilt correction unit for performing tilt correction on the image data; a preliminary positioning unit, configured to Preliminary positioning of the target character string of the image data to obtain a preliminary region of the target character string; a full-area positioning unit, configured to locate an area of the sum of gray values of the pixel points in the preliminary region; obtaining the target character a full area of the string; a character recognition unit for performing character recognition on the target character string in the entire area.
- the tilt correction unit includes: an edge extraction module, configured to extract an edge point of the image data; a line fitting module, configured to perform straight line fitting on the edge point; and a tilt angle acquiring module, configured to Obtaining an inclination angle of the edge point after the straight line fitting; and an adjustment module, configured to adjust the image data according to the inclination angle.
- the paper character recognition device comprises: a target acquisition unit, configured to acquire a left and right border of a character string to obtain each single character region; and a merging unit, configured to determine the two according to a spacing between two adjacent characters Whether the character is a broken character, and if so, merging the single character regions of the two characters; and the identifying unit is configured to respectively identify the characters in the single character region.
- the device further includes:
- the adhesion determining unit is configured to determine whether the single character is a sticky character according to a character width of a single character, and if so, separate the single character region of the single character.
- the embodiments of the present invention have the following advantages:
- the present invention When performing character positioning on the image data of the input paper, the present invention performs tilt correction on the image data first, so that the segmentation and positioning of the characters are more accurate; and, according to the entire region of the target character string, the gray value of the background region is relatively small.
- This feature can perform vertex positioning on the initially located string region, more accurately determine the location of the target string, and further improve the accuracy of string recognition.
- FIG. 1 is a schematic flow chart of a paper character recognition method according to an embodiment of the present invention.
- FIG. 2 is another schematic flow chart of a paper character recognition method according to an embodiment of the present invention.
- FIG. 3 is a schematic diagram showing a logical structure of a paper-based character recognition apparatus according to an embodiment of the present invention
- FIG. 4 is another schematic diagram of a logical structure of a paper-based character recognition apparatus according to an embodiment of the present invention.
- Embodiments of the present invention provide a paper character recognition method and related apparatus for accurately identifying a character string in an input paper.
- an embodiment of an input paper class identification method in an embodiment of the present invention includes:
- the character recognition device acquires image data of the input paper type; specifically, specifically, the input paper type data may be a banknote; the image data includes pixel points, and gray value data of the pixel points.
- the character recognition device can acquire image data of white light gray scale to reduce the complexity of data processing; optionally, the character recognition device also acquires image data that can acquire color to enrich the characteristics of the input paper type identification (some The banknotes have a specific color, and the color data is used to directly identify the currency.
- the type of the image data to be obtained may be determined according to actual needs, and is not limited herein.
- the character recognition means performs tilt correction on the image data. Since the image acquired by the image collection device inevitably tilts, the tilt correction needs to be performed before the character positioning is performed. 103. Perform preliminary positioning on a target character string of the image data.
- the character recognition device performs preliminary positioning on the target character string of the image data to acquire a preliminary region of the target character string.
- the type of the target string may be determined according to actual identification requirements. For example, if the uniqueness of the paper currency needs to be identified, the target character string may be the crown number of the banknote.
- the preliminary area may include broadband and height information of the area.
- the preliminary positioning can be completed by inputting the risk value determination of the paper type data.
- the type of the input paper type can be identified first, and after determining the type, the character recognition device can generally know the target to be identified.
- the area of the input paper class in the string, and the approximate area of the area Specifically, if the input paper type is an asymmetrical pattern (ie, the left or right or the positive or negative pattern or the characters are inconsistent), the direction of the input paper (positive and negative and the orientation of the pattern) needs to be determined before the preliminary positioning is performed. .
- the character recognition means locates an area where the sum of the gradation values of the pixel points in the preliminary area is the smallest, and obtains the entire area of the target character string.
- the character is The identification device can locate the region where the sum of the gray values of the pixel points in the preliminary region is the smallest to further narrow the range of the preliminary region to eliminate noise interference.
- step 103 the preliminary positioning of the target character string is completed.
- the target character string needs to be secondarily located.
- the character recognition means performs character recognition on the target character string in the entire area.
- the target character string in the entire area may be single-characterized according to the empirical value, and then the artificial neural network is used to identify the single character.
- the method for character recognition in the embodiment of the present invention has been described above by way of example only. It is to be understood that there may be other methods for character recognition in practical applications, which are not limited herein.
- the present invention When performing character positioning on the image data of the input paper, the present invention performs tilt correction on the image data first, so that the segmentation and positioning of the characters are more accurate; and, according to the whole region of the target character string For the feature that the gray value of the background region is small, the vertex positioning of the initially located character string region can be performed, and the position of the target character string can be more accurately determined, thereby further improving the accuracy of the string recognition.
- FIG. 2 another embodiment of the input paper type identification method in the embodiment of the present invention includes:
- the character recognition device acquires image data of the input paper type; specifically, specifically, the input paper type data may be a banknote; the image data includes pixel points, and gray value data of the pixel points.
- the character recognition device acquires image data that can acquire white light grayscale to reduce the complexity of data processing; optionally, the character recognition device also acquires image data that can acquire color to enrich the characteristics of the input paper type recognition ( Some of the banknotes have a specific color, and the color data is used to directly identify the currency.
- the type of the image data to be obtained may be determined according to actual needs, and is not limited herein.
- the character recognition means extracts an edge point of the image data. Since the background of the image data obtained by the image collection is single and the boundary of the input paper has a significant gray scale difference, this point can be used to search for edge points in the image data.
- a character recognition device performs a straight line fitting on the edge points.
- the character recognition device acquires an inclination angle of the edge point after the straight line fitting.
- the boundary length of the image data that is, the size of the input paper is known
- the character recognition means adjusts the image data in accordance with the tilt angle such that upper and lower boundaries of the image data are parallel to a horizontal plane. For example, if the image data of the input paper is tilted by 30 degrees clockwise, the character recognition means adjusts the image data back 30 degrees counterclockwise.
- the character recognition device performs preprocessing on the image data, and the preprocessing includes any one or a combination of two or more of currency identification, face value recognition, and direction recognition.
- currency identification and face value recognition help the character recognition device to substantially confirm which region of the input paper string the target character string to be identified is, and the approximate area of the region.
- the input papers are placed in different directions and directions. Therefore, it is necessary to identify the input paper.
- the currency identification and the face value recognition may be implemented by a pattern recognition method or an image processing method.
- the image recognition of the specific position is performed. (For example, identifying the position of the avatar), the positive and negative of the 100 yuan can be discriminated; further, the location where the amount is located is identified, and if "001" is recognized, the 100 yuan can be confirmed to be inverted. .
- the direction recognition may not be performed based on the results of currency recognition and face value recognition, as long as the discrimination is based on the features of the forward and reverse directions of some images.
- the character recognition device acquires a target area of the target character string according to the result of the preprocessing, and obtains maximum range information of the target character string in the target area, where the maximum range information includes a maximum height of the target area. H and maximum width W.
- the target area of the target character string and the maximum range information of the target character string in the target area may be obtained according to the currency type, the face value, and the direction information of the input paper. (The mapping relationship preset in the character recognition device).
- the character recognition device removes the noise data in the preliminary region.
- the character recognition device may preset a noise threshold, and if the gray value of the pixel in the image data satisfies the noise threshold, it is determined as noise, and the data of the noise is removed.
- the character recognition means locates an area where the sum of the gradation values of the pixel points in the preliminary area is the smallest, and obtains the entire area of the target character string.
- the character is The identification device can locate the region where the sum of the gray values of the pixels in the preliminary region is the smallest, to Reduce the range of the preliminary area in one step to eliminate noise interference.
- the target character string can be implemented by performing vertex positioning on the target character string.
- the vertex is positioned to determine a coordinate of any one of the four vertices in the minimum region where the target character string is located; after the coordinates of the vertex are known, the target character may be obtained according to an empirical value of the input paper type
- the width and height information of the string Take the top left vertex positioning as an example, and c/ is the width and height of the target string respectively, as long as the (v, ) is used as the gray level and the minimum area of the feature block, which is the area coordinate of the target string. As shown below:
- (xStart, yStart) min( ⁇ ⁇ I(x, y)), ie(0,W -cw),je(0,H ⁇ ch) , where H and H are the width and height of the area where the preliminary positioning character is located, And the actual width and height of the character.
- (xStart'yStart is the starting coordinate of the character area.
- the horizontal and vertical coordinates are accumulated from different directions, and the other three vertices can be obtained respectively.
- the calculation method is as follows: upper right apex,
- ⁇ xEnd, y Start) ⁇ ⁇ ⁇ I(x,y)) e(W- cw),j ⁇ (0,H-ch) ; lower left top , ,
- the character recognition means determines upper and lower boundaries and left and right boundaries of respective characters in the target character string to obtain respective single character regions.
- the character recognition device may first acquire a character pixel point threshold in the target character string; and then determine consecutive character pixel points according to the character pixel point threshold, and start coordinates of the consecutive character pixel points in a vertical direction. And the end point coordinates are used as the upper and lower boundaries, and the starting point coordinates and the end point coordinates in the horizontal direction of the consecutive character pixel points are used as the left and right borders.
- the method for determining the upper and lower boundaries may be: starting from an intermediate pixel of the entire region, searching upward, if two consecutive pixels do not satisfy the character pixel threshold, the two pixels The previous pixel is taken as the upper boundary; if the lower two pixels do not satisfy the character pixel threshold, the pixel before the two pixels is taken as the lower boundary.
- step 211 Determine, according to the spacing between two adjacent characters, whether the two characters are broken characters.
- the obtained broken characters of each single-character region for one Knowing the currency and face value, the width of each character is known in advance. If yes, step 212 is performed to merge the single character regions of the two characters; if not, step 213 is performed.
- the character recognition means combines the single character regions of the two characters.
- the left border of the first character is taken as the left border of the merged character, and the right border of the second character is taken as the right margin of the merged character.
- the character recognition device may be based on the character width of the single character. Determining whether the single character is a sticky character, and if yes, performing step 214 to separate the single character region of the single character; if not, executing step 215.
- the character recognition device may determine whether the character width of the single character is greater than a width threshold, and if so, the single character is a sticky character.
- the character recognition device separates the single character regions of a single character.
- the character recognition device re-determines the left and right boundaries of the single character. If the character pixels of the single character in the horizontal direction satisfy the preset character width, confirm that the predetermined character width is satisfied.
- the area is the first single-character area separated, and starts from the next point satisfying the preset character width point as the left boundary of the second separated character, and the right border of the original single character is the second The right border of the separated character.
- the character recognition device may determine whether the single-character region satisfies a boundary threshold, and if not, perform step 216 to scale the single-character region according to the boundary threshold; Then, step 217 is performed.
- the character recognition means scales the single character area according to the boundary threshold to normalize the single character area to the same size for subsequent recognition.
- the character recognition means performs character recognition on the target character string in the entire area. Specifically, the target character string in the entire area may be separately segmented according to the empirical value, and then the artificial neural network is used to identify the single character.
- the method for character recognition in the embodiment of the present invention has been described above by using only some examples. It can be understood that, in actual applications, other character recognition methods may be used, which are not limited herein.
- this example uses the binary projection method for horizontal and vertical directions to determine the left and right and upper and lower boundaries of each single character. Due to the influence of noise, tilt, lighting, etc., the binning threshold is too high for character sticking, and the threshold is low and character breaks. Based on the above problem, the maximum variance threshold for the character region is used as the threshold of the binarized projection, and a relatively low threshold is selected as much as possible, so that more noise points can be removed and the probability of sticking of characters is reduced. Too low a threshold is easy to cause the character to break, so when locating each character, the broken characters are also merged. At the same time, for some lossless cases, character sticking will occur now, and the character should be split into two characters when positioning.
- OStortjStorO is the starting coordinate of the character area. First, it is projected vertically.
- the vertical projection value is: VO[
- threshold is the maximum variance threshold for the character region. Then scan from left to right to find the suspected boundary of each character. The specific algorithm is implemented: Scan the projected image from the starting position ⁇ tort, and record the left border of the first character when the first non-zero point is encountered. /x[0] , then find the next zero point, record the right edge of the first character rx[0], the number of characters "paint ter plus 1, continue to scan to xStart + cw as above.
- the number of shadow points is considered to be a noise point and is not counted in the boundary.
- the left and right boundaries of each character are positioned, the left and right boundaries are scaled according to the size of the left and right projection values.
- the specific method is:
- hpro[j] J if( i, j) ⁇ threshold), je (yStart, yStart + c/?), the upper and lower boundary of the character in this example, search
- the method is not to search from top to bottom or from bottom to top, but to search from the middle of the character to both ends, so as to avoid noise interference at the upper and lower boundaries and breakage of intermediate characters.
- the specific implementation method is as follows: First, searching for two consecutive points whose projection value is zero from the middle point middle of the character area, that is, the upper boundary of the character, and then searching for two consecutive zero-projection points from the intermediate point, That is, the lower boundary of the character / ⁇ ⁇ ], then scale the upper and lower boundaries according to the size of the upper and lower projection values, and adjust the character positioning area to the actual size of the character.
- An embodiment of the paper-based character recognition device in the embodiment of the present invention includes:
- the data obtaining unit 301 is configured to acquire image data of the input paper type
- a tilt correction unit 302 configured to perform tilt correction on the image data
- the preliminary positioning unit 303 is configured to perform preliminary positioning on the target character string of the image data, and obtain a preliminary region of the target character string;
- a local area locating unit 304 configured to locate an area where a sum of gray values of pixel points in the preliminary area is the smallest; obtain a whole area of the target character string;
- the character recognition unit 305 is configured to perform character recognition on the target character string in the entire area.
- the tilt correction unit 302 includes:
- An edge extraction module 3021 configured to extract edge points of the image data
- a straight line fitting module 3022 configured to perform straight line fitting on the edge point
- the tilt angle obtaining module 3023 is configured to obtain an inclination angle of the edge point after the straight line fitting, and the adjustment module 3024 is configured to adjust the image data according to the tilt angle.
- the specific operations of each unit include:
- the data acquisition unit 301 acquires image data of the input paper type.
- the input paper type data may be a banknote; the image data includes pixel points, and gray value data of the pixel points.
- image data of white light gray scale can be acquired to reduce the complexity of data processing; optionally, the character recognition device also acquires image data that can acquire color to enrich the characteristics of the input paper type identification (some banknotes have specific The color, the color data is helpful to directly identify the currency); the type of the image data to be obtained may be determined according to actual needs, and is not limited herein.
- the tilt correction unit 302 performs tilt correction on the image data. Specifically, the edge extraction module 3021 extracts edge points of the image data. Since the background of the image data obtained by the collection is single, and the boundary of the input paper has a significant gray difference, the point can be used to search for edge points in the image data; the straight line fitting module 3022 performs straight line fitting on the edge points. The tilt angle acquisition module 3023 acquires the tilt angle of the edge point after the straight line fitting.
- the boundary length of the image data is obtained (that is, the size of the input paper is known), which facilitates subsequent identification of the currency and the face value; the adjustment module 3024
- the image data is adjusted according to the tilt angle such that upper and lower boundaries of the image data are parallel to a horizontal plane. For example, if the image data of the input paper is tilted by 30 degrees clockwise, the character recognition means adjusts the image data back 30 degrees counterclockwise.
- the preliminary positioning unit 303 preprocesses the image data, and the preprocessing includes any one or a combination of two or more of currency identification, face value recognition, and direction recognition.
- currency identification and face value recognition help the character recognition device to substantially confirm which area of the input paper string the target character string needs to be identified, and the approximate area of the area.
- the input papers are placed in different directions and directions. Therefore, it is necessary to identify the input paper.
- the currency identification and the face value recognition may be implemented by a pattern recognition method or an image processing method.
- the image recognition of the specific position is performed. (For example, identifying the position of the avatar), the positive and negative of the 100 yuan can be discriminated; further, the location where the amount is located is identified, and if "001" is recognized, the 100 yuan can be confirmed to be inverted. .
- direction recognition may be performed based on the results of currency recognition and face value recognition, as long as the discrimination based on the features of the forward and reverse directions of some images is performed. Yes.
- the target area of the target character string and the maximum range information of the target character string in the target area may be obtained according to the currency type, the face value, and the direction information of the input paper. (The mapping relationship preset in the character recognition device).
- the character recognition device removes the noise data in the preliminary region.
- the character recognition device may preset a noise threshold, and if the gray value of the pixel in the image data satisfies the noise threshold, it is determined as noise, and the data of the noise is removed.
- the full area positioning unit 304 locates the area where the sum of the gray values of the pixels in the preliminary area is the smallest, and obtains the entire area of the target character string.
- the character is The identification device can locate the region where the sum of the gray values of the pixel points in the preliminary region is the smallest to further narrow the range of the preliminary region to eliminate noise interference.
- the target character string can be implemented by performing vertex positioning on the target character string.
- the vertex is positioned to determine a coordinate of any one of the four vertices in the minimum region where the target character string is located; after the coordinates of the vertex are known, the target character may be obtained according to an empirical value of the input paper type
- the width and height information of the string Take the top left vertex positioning as an example, and c// is the width and height of the target string respectively.
- the coordinates of the area where the target string is located are calculated as follows. Shown as follows: , where / / is the width and height of the area where the initial positioning character is located, and the actual width and height of the character.
- xStart'yStart is the starting coordinate of the character area.
- the horizontal and vertical coordinates are accumulated from different directions, and the other three vertices can be obtained respectively.
- the calculation method is as follows: The upper right vertex,
- ⁇ xEnd, y Start) ⁇ ⁇ Z /( , ), e ( — ⁇ , ⁇ ), e (0,//- c/) ; lower left top , ,
- ⁇ xEnd.yEnd min( ⁇ ⁇ /( ,> ), e( _l, vv), j'e(//_l,c/).
- the character recognition unit 305 performs character recognition on the target character string in the entire area. Specifically, the target character string in the entire area may be separately segmented according to the empirical value, and then the artificial neural network is used to identify the single character.
- the method for character recognition in the embodiment of the present invention has been described above by using only some examples. It can be understood that, in actual applications, other character recognition methods may be used, which are not limited herein.
- FIG. 4 Another embodiment of the paper-based character recognition apparatus in the embodiment of the present invention includes :
- a target obtaining unit 401 configured to acquire a target area of the character string
- the boundary locating unit 402 is configured to determine upper and lower boundaries and left and right boundaries of each character in the target area, to obtain each single-character area; and to be a broken character, if yes, combine the two-character single-character areas;
- the identifying unit 404 is configured to separately identify characters in the single character area.
- the device further includes:
- the adhesion determining unit 405 is configured to determine whether the single character is a sticky character according to a character width of a single character, and if so, separate the single character region of the single character.
- each unit includes:
- the target acquisition unit 401 acquires a target area of the character string.
- the boundary locating unit 402 determines the upper and lower boundaries and the left and right boundaries of the respective characters in the target character string to obtain respective single-character regions.
- the character recognition device may first acquire a character pixel point threshold in the target character string; and then determine consecutive character pixel points according to the character pixel point threshold, and start coordinates of the consecutive character pixel points in a vertical direction. And the end point coordinates are used as the upper and lower boundaries, and the starting point coordinates and the end point coordinates in the horizontal direction of the consecutive character pixel points are used as the left and right borders.
- the method for determining the upper and lower boundaries may be: starting from an intermediate pixel of the entire region, searching upward, if two consecutive pixels do not satisfy the character pixel threshold, the two pixels The previous pixel is taken as the upper boundary; if the lower two pixels do not satisfy the character pixel threshold, the pixel before the two pixels is taken as the lower boundary.
- the merging characters the width of each character is known in advance for a known currency and denomination
- a two-character single-character area is merged.
- the left border of the first character is taken as the left border of the merged character
- the right border of the second character is taken as the right border of the merged character.
- the adhesion determining unit 405 may determine, according to the character width of the single character, whether the single character is a sticky character, and if so, the single character
- the single-character area is separated; exemplarily, the character recognition device re-determines the left and right boundaries of the single character, and if the single character's consecutive character pixel points in the horizontal direction satisfy the preset character width, the content is confirmed to be satisfied.
- the area within the preset character width is the separated first single-character area, and starts from the next point satisfying the preset character width point as the left boundary of the second separated character, the right of the original single character The boundary is the right border of the second separated character.
- the recognition unit 404 performs character recognition on the target character string in the entire area. Specifically, the target character string in the entire area may be firstly segmented according to the empirical value, and then the artificial neural network is used to identify the single character.
- the method for character recognition in the embodiment of the present invention has been described above by way of example only. It can be understood that in the actual application, other character recognition methods may be used, which are not limited herein.
- the disclosed apparatus and method can be implemented in other ways.
- the device embodiments described above are merely illustrative.
- the division of the unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
- the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in the form of an electrical, mechanical or other.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
- the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium.
- a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes: a U disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. .
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)
Abstract
本发明实施例公开了一种纸类字符识别方法及相关装置,用于准确的进行输入纸类中字符串的识别。方法包括:获取输入纸类的图像数据;对所述图像数据进行倾斜校正;对所述图像数据的目标字符串进行初步定位,获取所述目标字符串的初步区域;定位所述初步区域内像素点的灰度值之和最小的区域;获得所述目标字符串的全区域;对所述全区域内的目标字符串进行字符识别。
Description
一种纸类字符识别方法及相关装置
本申请要求于 2012 年 7 月 4 日提交中国专利局、 申请号为
201210230901.0, 发明名称为"一种纸类字符识别方法及相关装置 "的中国专利 申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及图像处理领域, 尤其涉及一种纸类字符识别方法及相关装置。
背景技术
随着经济和社会的发展, 纸币越来越多, 流通也越来越频繁。 纸币是一种 重要的票据, 真钞的号码具有唯一性, 是国家纸币印刷数量的标志, 因此可以 作为纸币的身份证明。 目前市场上存在的具有纸币号码识别功能的机具, 其识 别的准确率都不能达到金融机构的要求,金融机构在处理业务时, 最终需釆用 手工抄写纸币号码的方法来辅助识别假币。因此需在纸币处理机具上开发一种 高效率、高准确率的纸币号码自动识别记录系统,一旦出现异常情况(如 ATM 机收取假币或从 ATM中取出假币等),就可以通过自动记录的纸币号码进行跟 踪定位。
纸币号码识别系统主要分两部分, 字符定位和字符识别。 而字符定位的准 确度直接影响字符的识别结果。由于钞票本身新旧程度及图像釆集设备打光值 的影响, 字符定位主要存在以下问题: 字符在整幅图像中的相对位置有一定的 浮动,一方面由于纸币印刷时字符的相对位置会有一定的浮动; 另一方面图像 釆集时,倾斜角度的大小也后造成字符相对位置有一定的浮动;由于上述原因, 使得字符定位容易出现偏差, 从而导致识别设备无法精确的识别出纸币号码。
发明内容
本发明实施例提供了一种纸类字符识别方法及相关装置,用于准确的进行 输入纸类中字符串的识别。
本发明提供的纸类字符识别方法, 包括: 获取输入纸类的图像数据; 对所 述图像数据进行倾斜校正; 对所述图像数据的目标字符串进行初步定位, 获取 所述目标字符串的初步区域;定位所述初步区域内像素点的灰度值之和最小的 区域; 获得所述目标字符串的全区域; 对所述全区域内的目标字符串进行字符
识别。
可选的, 所述对图像数据进行倾斜校正, 包括: 提取所述图像数据的边缘 点; 对所述边缘点进行直线拟合; 获取所述直线拟合后的边缘点的倾斜角度; 根据所述倾斜角度调整所述图像数据。
可选的, 所述对图像数据的目标字符串进行初步定位之前, 包括: 对所述 图像数据进行预处理, 所述预处理包括为币种识别, 面值识别及方向识别中任 意一种或两种以上的组合。
可选的, 所述对图像数据的目标字符串进行初步定位, 具体为: 根据所述 预处理的结果获取所述目标字符串的目标区域;所述初步区域为所述目标字符 串在所述目标区域内的最大范围信息,所述最大范围信息包括所述目标区域的 最大高度 H和最大宽度 W。
可选的, 所述根据初步区域进行所述目标字符串的顶点定位之前, 包括: 去除所述初步区域中的噪声数据。
可选的, 所述对全区域内的目标字符串进行字符识别, 包括:
确定所述目标字符串中各个字符的上下边界和左右边界,得到各个单字符 区域; 分别识别所述单字符区域内的字符。
可选的, 所述确定所述目标字符串中各个字符的上下边界和左右边界, 包 括:
获取所述目标字符串中的字符像素点阈值;根据所述字符像素点阈值确定 连续的字符像素点,将所述连续的字符像素点垂直方向上的起点坐标和终点坐 标作为上下边界,将所述连续的字符像素点水平方向上的起点坐标和终点坐标 作为左右边界。
可选的, 所述得到各个单字符区域之后, 包括:
根据相邻两个字符之间的间距判断所述两个字符是否为断裂字符, 若是, 则对所述两个字符的单字符区域进行合并。
可选的, 所述得到各个单字符区域之后, 包括:
根据单个字符的字符宽度判断所述单个字符是否为粘连字符, 若是, 则对 所述单个字符的单字符区域进行分离。
可选的, 所述根据单个字符的字符宽度判断所述单个字符是否为粘连字
符, 包括: 判断所述单个字符的字符宽度是否大于宽度阈值, 若是, 则所述单 个字符为粘连字符;
所述对单个字符的单字符区域进行分离, 包括:
重新对所述单个字符进行左右边界的确定,若所述单个字符在水平方向上 连续的字符像素点满足预置字符宽度,则确认所述满足预置字符宽度内的区域 为被分离的第一个单字符区域,并从所述第一个单字符区域的下一点开始作为 被分离字符的左边界, 原所述单个字符的右边界为所述被分离字符的右边界。
可选的, 所述得到各个单字符区域之后, 包括:
判断所述单字符区域是否满足边界阈值, 若否, 则根据所述边界阈值对所 述单字符区域进行缩放。
可选的, 所述确定目标字符串中各个字符的上下边界, 包括:
从所述全区域的中间像素点开始,往上搜索,若连续两个像素点都不满足 所述字符像素点阈值, 则所述两个像素点之前的像素点作为作为上边界; 往下 搜索, 若连续两个像素点都不满足所述字符像素点阈值, 则所述两个像素点之 前的像素点作为作为下边界。
本发明提供的纸类字符识别方法, 包括: 获取字符串的目标区域; 确定所 述目标区域中各个字符的上下边界和左右边界,得到各个单字符区域; 根据相 邻两个字符之间的间距判断所述两个字符是否为断裂字符, 若是, 则对所述两 个字符的单字符区域进行合并; 分别识别所述单字符区域内的字符。
可选的, 所述确定所述字符串中各个字符的上下边界和左右边界, 包括: 获取所述字符串中的字符像素点阈值;根据所述字符像素点阈值确定连续的字 符像素点,将所述连续的字符像素点垂直方向上的起点坐标和终点坐标作为上 下边界,将所述连续的字符像素点水平方向上的起点坐标和终点坐标作为左右 边界。
可选的, 所述得到各个单字符区域之后, 包括:
根据单个字符的字符宽度判断所述单个字符是否为粘连字符, 若是, 则对 所述单个字符的单字符区域进行分离。
可选的, 所述根据单个字符的字符宽度判断所述单个字符是否为粘连字 符, 包括: 判断所述单个字符的字符宽度是否大于宽度阈值, 若是, 则所述单
个字符为粘连字符;
所述对单个字符的单字符区域进行分离, 包括: 重新对所述单个字符进行 左右边界的确定,若所述单个字符在水平方向上连续的字符像素点满足预置字 符宽度, 则确认所述满足预置字符宽度内的区域为被分离的第一个单字符区 域, 并从所述第一个单字符区域的下一点开始作为被分离字符的左边界,原所 述单个字符的右边界为所述被分离字符的右边界。
可选的, 所述得到各个单字符区域之后, 包括:
判断所述单字符区域是否满足边界阈值, 若不, 则根据所述边界阈值对所 述单字符区域进行缩放。
可选的, 所述确定字符串中各个字符的上下边界, 包括:
从所述全区域的中间像素点开始,往上搜索,若连续两个像素点都不满足 所述字符像素点阈值, 则所述两个像素点之前的像素点作为作为上边界; 从所 述全区域的中间像素点开始,往下搜索,若连续两个像素点都不满足所述字符 像素点阈值, 则所述两个像素点之前的像素点作为作为下边界。
本发明提供的纸类字符识别装置, 包括: 数据获取单元, 用于获取输入纸 类的图像数据; 倾斜校正单元, 用于对所述图像数据进行倾斜校正; 初步定位 单元, 用于对所述图像数据的目标字符串进行初步定位, 获取所述目标字符串 的初步区域; 全区域定位单元, 用于定位所述初步区域内像素点的灰度值之和 最小的区域; 获得所述目标字符串的全区域; 字符识别单元, 用于对所述全区 域内的目标字符串进行字符识别。
可选的, 所述倾斜校正单元包括: 边缘提取模块, 用于提取所述图像数据 的边缘点; 直线拟合模块, 用于对所述边缘点进行直线拟合; 倾斜角度获取模 块, 用于获取所述直线拟合后的边缘点的倾斜角度; 调整模块, 用于根据所述 倾斜角度调整所述图像数据。
本发明提供的纸类字符识别装置, 包括: 目标获取单元, 用于获取字符串 左右边界, 得到各个单字符区域; 合并单元, 用于根据相邻两个字符之间的间 距判断所述两个字符是否为断裂字符, 若是, 则对所述两个字符的单字符区域 进行合并; 识别单元, 用于分别识别所述单字符区域内的字符。
可选的, 所述装置还包括:
粘连判定单元,用于根据单个字符的字符宽度判断所述单个字符是否为粘 连字符, 若是, 则对所述单个字符的单字符区域进行分离。
从以上技术方案可以看出, 本发明实施例具有以下优点:
本发明在对输入纸类的图像数据进行字符定位时,对先对图像数据进行倾 斜校正, 使得字符的分割和定位更加准确; 并且, 根据目标字符串的全区域相 对背景区域灰度值较小这个特点, 可以对初步定位后的字符串区进行顶点定 位, 更加精确地确定目标字符串所在的位置, 进一步的提高了字符串识别的精 确度。
附图说明
图 1是本发明实施例纸类字符识别方法的一个流程示意图;
图 2是本发明实施例纸类字符识别方法的另一个流程示意图;
图 3是本发明实施例纸类字符识别装置的一个逻辑结构示意图; 图 4是本发明实施例纸类字符识别装置的另一个逻辑结构示意图。
具体实施方式
本发明实施例提供了一种纸类字符识别方法及相关装置,用于准确的进行 输入纸类中字符串的识别。
请参阅图 1 , 本发明实施例中输入纸类识别方法的一个实施例包括:
101、 获取输入纸类的图像数据;
字符识别装置获取输入纸类的图像数据; 具体的, 具体的, 所述输入纸类 数据可以为纸币; 所述图像数据包括像素点, 以及像素点的灰度值数据。
优选的, 字符识别装置可以获取白光灰度的图像数据, 以减小数据处理的 复杂度; 可选的, 字符识别装置也获取可以获取彩色的图像数据, 以丰富输入 纸类识别的特征(一些纸币有特定的颜色, 彩色数据有助于直接识别币种); 具体获取图像数据的类型可以根据实际需求而定, 此处不作限定。
102、 对所述图像数据进行倾斜校正;
字符识别装置对所述图像数据进行倾斜校正。由于通过图像釆集设备获取 到的釆集图像不可避免的会发生倾斜, 因此, 在进行字符定位之前, 需要先进 行倾斜校正。
103、 对所述图像数据的目标字符串进行初步定位;
字符识别装置对所述图像数据的目标字符串进行初步定位,获取所述目标 字符串的初步区域。
具体的, 目标字符串的类型可以根据实际的识别需求而定, 如, 需要对纸 币的唯一性进行识别, 则所述目标字符串可以为纸币的冠字号码。
具体的, 所述初步区域可以包括该区域的宽带和高度信息。
可选的, 初步定位可以通过输入纸类数据的经险值判定来完成, 如, 可以 先对该输入纸类的类型进行识别,确定类型后, 字符识别装置则可以大致知道 所需要识别的目标字符串在该输入纸类的哪一个区域,该区域的面积大概有多 少。 具体的, 若所述输入纸类为非对称图形(即左右或正反的图案或字符不一 致), 则在进行初步定位之前, 还需要确定该输入纸类的方向 (正反及图案的 朝向)。
104、 定位所述初步区域内像素点的灰度值之和最小的区域;
字符识别装置定位所述初步区域内像素点的灰度值之和最小的区域,获得 所述目标字符串的全区域。
在实际应用中,由于纸币上的字符区域的灰度值一般会低于所在区域的其 他位置的灰度值, 且某一币种、 某一面值的目标字符串所占大小固定, 因此, 字符识别装置可以定位所述初步区域内像素点的灰度值之和最小的区域,以进 一步缩小初步区域的范围, 排除噪声的干扰。
在步骤 103中完成了对目标字符串的初步定位, 为了排除噪声的干扰,提 高字符识别的精确度, 需要对目标字符串进行二次定位。
105、 对所述全区域内的目标字符串进行字符识别。
字符识别装置对所述全区域内的目标字符串进行字符识别。
具体的, 可以根据经验值先对所述全区域内的目标字符串进行单字符分 割,再使用人工神经网络进行单个字符的识别。上述仅以一些例子对本发明实 施例中字符识别的方法进行了说明, 可以理解的是, 在实际应用中, 还可以有 其它的字符识别方法, 具体此处不作限定。
本发明在对输入纸类的图像数据进行字符定位时,对先对图像数据进行倾 斜校正, 使得字符的分割和定位更加准确; 并且, 根据目标字符串的全区域相
对背景区域灰度值较小这个特点, 可以对初步定位后的字符串区进行顶点定 位, 更加精确地确定目标字符串所在位置,进一步的提高了字符串识别的精确 度。
下面对本发明输入纸类识别方法进行详细描述, 请参阅图 2, 本发明实施 例中输入纸类识别方法的另一个实施例包括:
201、 获取输入纸类的图像数据;
字符识别装置获取输入纸类的图像数据; 具体的, 具体的, 所述输入纸类 数据可以为纸币; 所述图像数据包括像素点, 以及像素点的灰度值数据。
优选的, 字符识别装置获取可以获取白光灰度的图像数据, 以减小数据处 理的复杂度; 可选的, 字符识别装置也获取可以获取彩色的图像数据, 以丰富 输入纸类识别的特征(一些纸币有特定的颜色, 彩色数据有助于直接识别币 种); 具体获取图像数据的类型可以根据实际需求而定, 此处不作限定。
202、 提取所述图像数据的边缘点;
字符识别装置提取所述图像数据的边缘点。由于釆集得到图像数据的背景 单一,且输入纸类的边界有明显的灰度差,可以利用这点来搜索图像数据中的 边缘点。
203、 对所述边缘点进行直线拟合;
字符识别装置对所述边缘点进行直线拟合。
204、 获取所述直线拟合后的边缘点的倾斜角度;
字符识别装置获取所述直线拟合后的边缘点的倾斜角度。可选的, 上述边 缘点进行直线拟合后,还可以获得所述图像数据的边界长度(即获知所述输入 纸类的大小;), 有助于后续进行币种和面值的识别。
205、 根据所述倾斜角度调整所述图像数据;
字符识别装置根据所述倾斜角度调整所述图像数据,使得所述图像数据的 上下边界平行于水平面。如, 若所述输入纸类的图像数据顺时针倾斜了 30度, 则字符识别装置将所述图像数据逆时针往回调整 30度。
206、 对所述图像数据进行预处理;
字符识别装置对所述图像数据进行预处理, 所述预处理包括为币种识别, 面值识别及方向识别中任意一种或两种以上的组合。
在实际应用中,币种识别和面值识别有助于字符识别装置大致确认所需要 识别的目标字符串在该输入纸类的哪一个区域, 该区域的面积大概有多少。 而 在实际的输入纸类的扫描过程中,输入纸类放置的正反和方向皆有不同,因此, 还需要对输入纸类进行方向识别。
具体的, 币种识别和面值识别可以通过模式识别方法, 或图像处理方法实 现; 可选的, 若经过面值识别之后确定所述输入纸类为面值 100元人民币, 则 通过对特定位置的图像识别 (如, 识别头像的位置), 可以判别出所述 100元 人民币的正反; 进一步的, 对数额所在的为位置进行识别, 若识别出" 001", 则可以确认所述 100元人民币被倒置。 可选的,也可以不基于币种识别和面值 识别的结果进行方向识别,只要基于一些图像的正反及朝向的特征进行判别即 可。
207、 对图像数据的目标字符串进行初步定位;
字符识别装置根据所述预处理的结果获取所述目标字符串的目标区域,获 取所述目标字符串在所述目标区域内的最大范围信息,所述最大范围信息包括 所述目标区域的最大高度 H和最大宽度 W。
具体的, 所述图像数据进行预处理之后, 可以根据输入纸类的币种、 面值 及方向信息获知所述目标字符串的目标区域及所述目标字符串在所述目标区 域内的最大范围信息 (字符识别装置中预置的映射关系)。
208、 去除所述初步区域中的噪声数据;
可选的,在完成对图像数据的目标字符串进行初步定位之后, 字符识别装 置去除所述初步区域中的噪声数据。具体的,字符识别装置可以预设噪声阈值, 若所述图像数据中的像素点的灰度值满足噪声阈值, 则被判定为噪声,去除所 述噪声的数据。
209、 定位所述初步区域内像素点的灰度值之和最小的区域;
字符识别装置定位所述初步区域内像素点的灰度值之和最小的区域,获得 所述目标字符串的全区域。
在实际应用中,由于纸币上的字符区域的灰度值一般会低于所在区域的其 他位置的灰度值, 且某一币种、 某一面值的目标字符串所占大小固定, 因此, 字符识别装置可以定位所述初步区域内像素点的灰度值之和最小的区域,以进
一步缩小初步区域的范围, 排除噪声的干扰。
具体的, 可以通过对所述目标字符串进行顶点定位实现。 所述顶点定位为 确定所述目标字符串所在的最小区域中, 确定四个顶点中任意一个顶点的坐 标; 在获知该顶点坐标之后, 根据输入纸类类型的经验值, 即可所述目标字符 串的宽度和高度信息。 以左上角顶点定位为例, 和 c/分别为目标字符串的 宽度和高度, 只要定位到以 ( v , ) 为特征块的灰度和最小区域, 既为目 标 字 符 串 所 在 区 域 坐 标 , 计 算 方 法 如 下 式 所 示 :
(xStart, yStart) = min( ^ ^ I(x, y)), i e(0,W -cw),j e(0,H ~ch) , 其中 和 H为初步定 位字符所在区域的宽度和高度, 和 为字符实际宽度和高度。 (xStart'yStart 为字符区域的起始坐标。 同理, 横纵坐标从不同方向累加, 分别可以得到其他 三 个 顶 点 , 计 算 方 法 如 下 所 示 : 右 上 顶 点 ,
{xEnd, y Start) = πά {^ ^ I(x,y)) e(W- cw),j≡(0,H-ch) ; 左 下 顶 、 ,
(xEnd.yEnd) = min( ^ ^ /( ,> ), e( _l, v), 'e(//_l,c7)。 210、 确定所述目标字符串中各个字符的上下边界和左右边界;
字符识别装置确定所述目标字符串中各个字符的上下边界和左右边界,得 到各个单字符区域。
具体的, 字符识别装置可以先获取所述目标字符串中的字符像素点阈值; 再根据所述字符像素点阈值确定连续的字符像素点,将所述连续的字符像素点 垂直方向上的起点坐标和终点坐标作为上下边界,将所述连续的字符像素点水 平方向上的起点坐标和终点坐标作为左右边界。
可选的, 确定上下边界的方法可以为: 从所述全区域的中间像素点开始, 往上搜索, 若连续两个像素点都不满足所述字符像素点阈值, 则所述两个像素 点之前的像素点作为作为上边界; 往下搜索, 若连续两个像素点都不满足所述 字符像素点阈值, 则所述两个像素点之前的像素点作为作为下边界。
211、 根据相邻两个字符之间的间距判断所述两个字符是否为断裂字符; 可选的, 为了进一步提高字符识别的精确度, 所述得到各个单字符区域之 断裂字符 (对于一已知的币种和面值来说, 每个字符的宽度是预先知道的),
若是, 则执行步骤 212对所述两个字符的单字符区域进行合并; 若否, 则执行 步骤 213。
212、 对所述两个字符的单字符区域进行合并;
字符识别装置对所述两个字符的单字符区域进行合并。即将第一字符的左 边界作为合并后字符的左边界, 第二个字符的右边界作为合并后字符的右边 界。
213、 根据单个字符的字符宽度判断所述单个字符是否为粘连字符; 可选的, 为了进一步提高字符识别的精确度, 所述得到各个单字符区域之 后,字符识别装置可以根据单个字符的字符宽度判断所述单个字符是否为粘连 字符, 若是, 则执行步骤 214对所述单个字符的单字符区域进行分离; 若否, 则执行步骤 215。
具体的,字符识别装置可以判断所述单个字符的字符宽度是否大于宽度阈 值, 若是, 则所述单个字符为粘连字符。
214、 对单个字符的单字符区域进行分离;
字符识别装置对单个字符的单字符区域进行分离。
示例性的, 字符识别装置重新对所述单个字符进行左右边界的确定, 若所 述单个字符在水平方向上连续的字符像素点满足预置字符宽度,则确认所述满 足预置字符宽度内的区域为被分离的第一个单字符区域,并从所述满足预置字 符宽度点的下一点开始作为第二个被分离字符的左边界,原所述单个字符的右 边界为所述第二个被分离字符的右边界。
215、 判断所述单字符区域是否满足边界阈值;
可选的,在得到各个单字符区域之后, 字符识别装置可以判断所述单字符 区域是否满足边界阈值, 若不, 则执行步骤 216根据所述边界阈值对所述单字 符区域进行缩放; 若否, 则执行步骤 217。
216、 根据所述边界阈值对所述单字符区域进行缩放;
字符识别装置根据所述边界阈值对所述单字符区域进行缩放,将单字符区 域归一化到相同的大小, 以便后续识别。
217、 对所述全区域内的目标字符串进行字符识别。
字符识别装置对所述全区域内的目标字符串进行字符识别。
具体的, 可以根据经验值先对所述全区域内的目标字符串进行单字符分 割,再使用人工神经网络进行单个字符的识别。上述仅以一些例子对本发明实 施例中字符识别的方法进行了说明, 可以理解的是, 在实际应用中, 还可以有 其它的字符识别方法, 具体此处不作限定。
为了便于理解,下面以一具体应用场景对上述的实施例中描述的纸类字符 识别方法再进行详细描述, 具体为:
在准确地获得目标字符串的全区域后, 需要进一步进行单字符分割, 即找 到每一个字符的准确位置。 为了保证算法准确性和快速性, 本实例釆用分别对 水平和垂直方向做二值投影法确定每个单字符的左右和上下边界。由于受到噪 声, 倾斜, 打光等原因的影响, 二值化阈值过高容易出现字符粘连, 阈值低又 会出现字符断裂。基于以上问题, 这里釆用对字符区域求最大方差阈值作为二 值化投影的阈值, 并且尽量选择一个相对较低的阈值,这样可以去除更多的噪 声点, 减少字符发生粘连的概率。 而过低阈值易造成字符的断裂, 所以定位每 个字符时, 还要把断裂的字符进行合并。 同时对于一些无损的情况, 会出现字 符粘连现在, 字符定位时要将其分割成两个字符。
a) 单字符左右边界定位;
OStortjStorO为字符区域的起始坐标, 首先做垂直方向投影, 垂直方向投 影值为: V O[ | = J M(i, j), i e (xStart - n, xStart + cw+ n) , 其中 是字符实际宽 度, "是将左右边界各向两侧扩的值, 本实例 n=3 , 这可以避免左右点解定位 一些小的偏差带来的影响;
ίθ, if (10, j) < threshold)
M(i ) = \ ;
〔1, if(J(i, j) >= threshlod)
其中 threshold是字符区域的最大方差阈值。 然后从左到右扫描找到每个 字符的疑似边界, 具体算法实现: 是从起始位置^ tort开始对投影图像进行扫 描, 当遇到第一个非零点, 记录为第一个字符的左边界 /x[0] , 接着找下一个零 点, 记录为第一个字符的右边界 rx[0] , 字符数 "画 ter加 1 , 按上述方法一直扫 描到 xStart + cw。
如果垂直方向投影值 f ψΓφ·] < ηώι , ( min是根据币种不同而定的最小投
, x[i]
影点数, 该实例 min = 4 ), 认为该点为噪声点, 不计入边界中。
如果 Γφ·] - /φ· - 1] < ν^, (wth是钞票属性: 单字符的最大宽度距离, 该实 例 W = 10 ) , 即当相邻字符远边界距离小于单字符最大宽度时, 则认为这两个
字符为同一个字符,进行合并,字符数 number减 1。初定位时∑ vpro[j] = U> 5 ,
=,x[l]
7=rx[2]
∑ vPro[j] = l3>5, 都不满足噪声条件, 则认为定位为两个字符, number加 1,
7-/x[2]
接下来判断是否是字符断裂,经判断第二个字符的右边界到第一个字符左边界 的距离为 9, 小于单字符的最大宽度, 即 rx[2]-/x[l] = 9<10, 证明这两个字符属 于同一个字符, 则将 rx[l] = rx[2], number减 1 , 即将两部分合并成一个字符; 如果《[]-/4]> ^, (wth是钞票属性: 单字符的最大宽度距离, 该实例 wth = 10 ), 即右边界的搜索值达到了单字符最大宽度时, 则该字符的右边界无 需再向下搜索, 停止对该字符右边界的搜索, 将当前点设为该字符的右边界, 在二值化处理后" 0"和" 6"字符发生粘连, 在定位时需要将其分割成两个字符。 首先定位字符 "0"的左边界, / [2] = 35 ,如不加任何限定条件搜索下一个零值点, 则将 rx[2] = 55 , 那么该字符的宽度为 20, 等于单字符最大宽度的 2 倍, 即 rx[2]-lx[2] = 20 = 2wth , 显然定位到的字符应该包含两个字符。 由于对于某一币 种, 其单字符最大宽度是固定的, 因此在搜索范围达到时就认为已经找到了字 符的左边界, 这里当搜索到 = 45是, ^ro[45] = 5! = 0 , 则认为已经找到了右边 界, 另 rx[2] = 45 , number加 1; 从上一个字符的左边界开始继续搜索下一个字 符, / [3] = 46 , 当 ζ· = 55时, Ψ/Ό[55] = 0 , 则 rx[3] = 55 , 样就成功的将粘连的两个 字符分隔开。
每个字符左右边界定位完毕后,按照左右投影值的大小缩放左右边界, 具 体方法是:
首先判断字符宽度与实际字符宽度差值。 如果字符宽度小于实际字符宽 度, 则需要对其左右边界向两侧扩充,如果左边界左边的投影值大于右边界右 边的投影值, 即:
+ 1] , 则左边界先左扩充一位, lx[i] = lx[i]-\ . 如果左边界左边的投影值小于右边界右边的投影值, 即: vpro[lx[i]-\]<vpro[rx[i] + \] ^ 则右边界向右扩充一位, φ'] = φ'] + 1; 如果左边界 左边的投影值等于右边界右边的投影值, 即: ^/φ -η^^ ^η+ι], 则左 右边界各扩充一位, ·Φ'] = /Φ']-1, rx[i] = rx[i] + l ^ 依此类推, 直至字符宽度等于 字符实际宽度为止。
如果字符宽度大于实际字符宽度, 则需要对其左右边界向内缩进,如果左 边界右边的投影值大于右边界左边的投影值, 即: ψΓ0[/φ·] + 1] > vpro[rx[i] - 1] , 则右边界先左缩进一位, Γφ·] = Γφ·]-1 ; 如果左边界右边的投影值小于右边界 左边的投影值, 即: vpro[lx[i] + 1]< vpro[rx[i] - 1] , 则左边界向右缩进一位, /φ·] = /φ·] + 1 ; 如果左边界右边的投影值等于右边界右左边的投影值, 即: vpro[lx[i] + 1] = vpro[rx[i] _ 1] , 贝1 J左右边界各缩进一位, lx[i] = lx[i] + 1 , rx[i] = rx[i] - 1 , 依此类推, 直至字符宽度等于字符实际宽度为止。
b )单字符上下边界定位;
在 上 一 步 基 础 上 对 每 个 字 符 区 域 做 水 平 投 影 , hpro[j] = J if( i, j) < threshold), j e (yStart, yStart + c/?) ,本实例中字符上下边界定位 , 搜索方式不是从上往下或是从下往上搜索,而是釆用从字符中部开始向两端搜 索的方式, 这样可以避免上下边界的噪声干扰和中间字符出现断裂的情况。 具 体实现方法是: 首先从字符区域的中间点 middle开始向上搜索连续两个投影值 为零的点, 即为该字符的上边界 然后从中间点开始向下搜索连续两个 为零的投影点, 即为该字符的下边界 /^ φ·] , 然后根据上下投影值的大小缩 放上下边界, 将字符定位区域调整到字符实际大小。
为解决字符上下有噪声干扰的情况,在确定完所有字符的位置后分别求所 有单字符的上边界的平均值(为避免噪声干扰,去除一个最大值和一个最小值 后求平均值)。 然后依次求每个字符上边界与上边界平均值的绝对差值, 如果 绝对差值大于 ΝΡ个像素, 本实例中 ΝΡ=3 , 则将其调整为均值, 同理重复上 步操作, 对下边界进行调整。 下边界以此类推。
上面仅以一些例子对本发明实施例中的应用场景进行了说明,可以理解的 是, 在实际应用中, 还可以有更多的应用场景, 具体此处不作限定。
下面对用于执行上述纸类字符识别方法的本发明纸类字符识别装置的实 施例进行说明, 其逻辑结构请参考图 3 , 本发明实施例中的纸类字符识别装置 一个实施例包括:
数据获取单元 301 , 用于获取输入纸类的图像数据;
倾斜校正单元 302, 用于对所述图像数据进行倾斜校正;
初步定位单元 303 , 用于对所述图像数据的目标字符串进行初步定位, 获 取所述目标字符串的初步区域;
全区域定位单元 304, 用于定位所述初步区域内像素点的灰度值之和最小 的区域; 获得所述目标字符串的全区域;
字符识别单元 305 , 用于对所述全区域内的目标字符串进行字符识别。 具体的, 所述倾斜校正单元 302包括:
边缘提取模块 3021, 用于提取所述图像数据的边缘点;
直线拟合模块 3022, 用于对所述边缘点进行直线拟合;
倾斜角度获取模块 3023 , 用于获取所述直线拟合后的边缘点的倾斜角度; 调整模块 3024, 用于根据所述倾斜角度调整所述图像数据。
本发明实施例中, 各个单元的具体操作包括:
数据获取单元 301获取输入纸类的图像数据; 具体的, 具体的, 所述输入 纸类数据可以为纸币; 所述图像数据包括像素点, 以及像素点的灰度值数据。 优选的, 可以获取白光灰度的图像数据, 以减小数据处理的复杂度; 可选的, 字符识别装置也获取可以获取彩色的图像数据, 以丰富输入纸类识别的特征 (一些纸币有特定的颜色, 彩色数据有助于直接识别币种); 具体获取图像数 据的类型可以根据实际需求而定, 此处不作限定。
倾斜校正单元 302对所述图像数据进行倾斜校正, 具体的, 边缘提取模块 3021 提取所述图像数据的边缘点。 由于釆集得到图像数据的背景单一, 且输 入纸类的边界有明显的灰度差, 可以利用这点来搜索图像数据中的边缘点; 直 线拟合模块 3022对所述边缘点进行直线拟合;倾斜角度获取模块 3023获取所 述直线拟合后的边缘点的倾斜角度。 可选的, 上述边缘点进行直线拟合后, 还 可以获得所述图像数据的边界长度(即获知所述输入纸类的大小), 有助于后 续进行币种和面值的识别; 调整模块 3024根据所述倾斜角度调整所述图像数 据, 使得所述图像数据的上下边界平行于水平面。 如, 若所述输入纸类的图像 数据顺时针倾斜了 30度, 则字符识别装置将所述图像数据逆时针往回调整 30 度。
初步定位单元 303对所述图像数据进行预处理,所述预处理包括为币种识 别, 面值识别及方向识别中任意一种或两种以上的组合。
在实际应用中,币种识别和面值识别有助于字符识别装置大致确认所需要 识别的目标字符串在该输入纸类的哪一个区域, 该区域的面积大概有多少。 而 在实际的输入纸类的扫描过程中,输入纸类放置的正反和方向皆有不同,因此, 还需要对输入纸类进行方向识别。
具体的, 币种识别和面值识别可以通过模式识别方法, 或图像处理方法实 现; 可选的, 若经过面值识别之后确定所述输入纸类为面值 100元人民币, 则 通过对特定位置的图像识别 (如, 识别头像的位置), 可以判别出所述 100元 人民币的正反; 进一步的, 对数额所在的为位置进行识别, 若识别出" 001", 则可以确认所述 100元人民币被倒置。 可选的,也可以不基于币种识别和面值 识别的结果进行方向识别,只要基于一些图像的正反及朝向的特征进行判别即
可。再根据所述预处理的结果获取所述目标字符串的目标区域, 获取所述目标 字符串在所述目标区域内的最大范围信息,所述最大范围信息包括所述目标区 域的最大高度 H和最大宽度 W。 具体的, 所述图像数据进行预处理之后, 可 以根据输入纸类的币种、面值及方向信息获知所述目标字符串的目标区域及所 述目标字符串在所述目标区域内的最大范围信息 (字符识别装置中预置的映射 关系)。
可选的,在完成对图像数据的目标字符串进行初步定位之后, 字符识别装 置去除所述初步区域中的噪声数据。具体的,字符识别装置可以预设噪声阈值, 若所述图像数据中的像素点的灰度值满足噪声阈值, 则被判定为噪声,去除所 述噪声的数据。
全区域定位单元 304 定位所述初步区域内像素点的灰度值之和最小的区 域, 获得所述目标字符串的全区域。
在实际应用中,由于纸币上的字符区域的灰度值一般会低于所在区域的其 他位置的灰度值, 且某一币种、 某一面值的目标字符串所占大小固定, 因此, 字符识别装置可以定位所述初步区域内像素点的灰度值之和最小的区域,以进 一步缩小初步区域的范围, 排除噪声的干扰。
具体的, 可以通过对所述目标字符串进行顶点定位实现。 所述顶点定位为 确定所述目标字符串所在的最小区域中, 确定四个顶点中任意一个顶点的坐 标; 在获知该顶点坐标之后, 根据输入纸类类型的经验值, 即可所述目标字符 串的宽度和高度信息。 以左上角顶点定位为例, 和 c//分别为目标字符串的 宽度和高度, 只要定位到以 ) 为特征块的灰度和最小区域, 既为目 标 字 符 串 所 在 区 域 坐 标 , 计 算 方 法 如 下 式 所 示 :
, 其中 和/ /为初步定 位字符所在区域的宽度和高度, 和 为字符实际宽度和高度。 xStart'yStart) 为字符区域的起始坐标。 同理, 横纵坐标从不同方向累加, 分别可以得到其他 三 个 顶 点 , 计 算 方 法 如 下 所 示 : 右 上 顶 点 ,
{xEnd, y Start) = ι {^ Z /( , ), e ( — Ι, ν), e (0,//— c/) ; 左 下 顶 、 ,
{xEnd.yEnd) = min( ^ ^ /( ,> ), e( _l, vv),j'e(//_l,c/)。
字符识别单元 305对所述全区域内的目标字符串进行字符识别。 具体的, 可以根据经验值先对所述全区域内的目标字符串进行单字符分 割,再使用人工神经网络进行单个字符的识别。上述仅以一些例子对本发明实 施例中字符识别的方法进行了说明, 可以理解的是, 在实际应用中, 还可以有 其它的字符识别方法, 具体此处不作限定。
下面对用于执行上述纸类字符识别方法的本发明纸类字符识别装置的实 施例进行说明, 其逻辑结构请参考图 4, 本发明实施例中纸类字符识别装置的 另一个实施例包括:
目标获取单元 401 , 用于获取字符串的目标区域;
边界定位单元 402, 用于确定所述目标区域中各个字符的上下边界和左右 边界, 得到各个单字符区域; 为断裂字符, 若是, 则对所述两个字符的单字符区域进行合并;
识别单元 404, 用于分别识别所述单字符区域内的字符。
可选的, 所述装置还包括:
粘连判定单元 405 , 用于根据单个字符的字符宽度判断所述单个字符是否 为粘连字符, 若是, 则对所述单个字符的单字符区域进行分离。
本发明实施例中, 各个单元的具体操作包括:
目标获取单元 401获取字符串的目标区域。
在获得字符串的目标区域之后,边界定位单元 402确定所述目标字符串中 各个字符的上下边界和左右边界, 得到各个单字符区域。
具体的, 字符识别装置可以先获取所述目标字符串中的字符像素点阈值; 再根据所述字符像素点阈值确定连续的字符像素点,将所述连续的字符像素点 垂直方向上的起点坐标和终点坐标作为上下边界,将所述连续的字符像素点水 平方向上的起点坐标和终点坐标作为左右边界。
可选的, 确定上下边界的方法可以为: 从所述全区域的中间像素点开始, 往上搜索, 若连续两个像素点都不满足所述字符像素点阈值, 则所述两个像素 点之前的像素点作为作为上边界; 往下搜索, 若连续两个像素点都不满足所述 字符像素点阈值, 则所述两个像素点之前的像素点作为作为下边界。
为了进一步提高字符识别的精确度, 所述得到各个单字符区域之后,合并 符(对于一已知的币种和面值来说, 每个字符的宽度是预先知道的), 若是, 则对所述两个字符的单字符区域进行合并。即将第一字符的左边界作为合并后 字符的左边界, 第二个字符的右边界作为合并后字符的右边界。
可选的, 为了进一步提高字符识别的精确度, 得到各个单字符区域之后, 粘连判定单元 405 可以根据单个字符的字符宽度判断所述单个字符是否为粘 连字符, 若是, 则对所述单个字符的单字符区域进行分离; 示例性的, 字符识 别装置重新对所述单个字符进行左右边界的确定,若所述单个字符在水平方向 上连续的字符像素点满足预置字符宽度,则确认所述满足预置字符宽度内的区 域为被分离的第一个单字符区域,并从所述满足预置字符宽度点的下一点开始 作为第二个被分离字符的左边界,原所述单个字符的右边界为所述第二个被分 离字符的右边界。
完成上述的调整操作后,识别单元 404对所述全区域内的目标字符串进行 字符识别。具体的, 可以根据经验值先对所述全区域内的目标字符串进行单字 符分割,再使用人工神经网络进行单个字符的识别。上述仅以一些例子对本发 明实施例中字符识别的方法进行了说明, 可以理解的是, 在实际应用中, 还可 以有其它的字符识别方法, 具体此处不作限定。
在本申请所提供的几个实施例中,应该理解到, 所揭露的装置和方法可以 通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如, 所述单元的划分,仅仅为一种逻辑功能划分, 实际实现时可以有另外的划分方 式, 例如多个单元或组件可以结合或者可以集成到另一个系统, 或一些特征可 以忽略, 或不执行。 另一点, 所显示或讨论的相互之间的耦合或直接耦合或通 信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性, 机戈或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为 单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者 也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部 单元来实现本实施例方案的目的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在 ,也可以两个或两个以上单元集成在一个单元 中。上述集成的单元既可以釆用硬件的形式实现,也可以釆用软件功能单元的 形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售 或使用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发 明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全 部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储 介质中, 包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器, 或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。 而前述 的存储介质包括: U盘、 移动硬盘、 只读存储器(ROM, Read-Only Memory ), 随机存取存储器(RAM, Random Access Memory ), 磁碟或者光盘等各种可以 存储程序代码的介质。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于 此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到 变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应 所述以权利要求的保护范围为准。
Claims
1、 一种纸类字符识别方法, 其特征在于, 包括:
获取输入纸类的图像数据;
对所述图像数据进行倾斜校正;
对所述图像数据的目标字符串进行初步定位,获取所述目标字符串的初步 区域;
定位所述初步区域内像素点的灰度值之和最小的区域;获得所述目标字符 串的全区域;
对所述全区域内的目标字符串进行字符识别。
2、根据权利要求 1的方法, 其特征在于, 所述对图像数据进行倾斜校正, 包括:
提取所述图像数据的边缘点;
对所述边缘点进行直线拟合;
获取所述直线拟合后的边缘点的倾斜角度;
根据所述倾斜角度调整所述图像数据。
3、 根据权利要求 1的方法, 其特征在于, 所述对图像数据的目标字符串 进行初步定位之前, 包括:
对所述图像数据进行预处理, 所述预处理包括为币种识别, 面值识别及方 向识别中任意一种或两种以上的组合。
4、 根据权利要求 3的方法, 其特征在于, 所述对图像数据的目标字符串 进行初步定位, 具体为:
根据所述预处理的结果获取所述目标字符串的目标区域;
所述初步区域为所述目标字符串在所述目标区域内的最大范围信息,所述 最大范围信息包括所述目标区域的最大高度 H和最大宽度 W。
5、 根据权利要求 1的方法, 其特征在于, 所述根据初步区域进行所述目 标字符串的顶点定位之前, 包括:
去除所述初步区域中的噪声数据。
6、 根据权利要求 1的方法, 其特征在于, 所述对全区域内的目标字符串 进行字符识别, 包括:
确定所述目标字符串中各个字符的上下边界和左右边界,得到各个单字符 区域;
分别识别所述单字符区域内的字符。
7、 根据权利要求 6的方法, 其特征在于, 所述确定所述目标字符串中各 个字符的上下边界和左右边界, 包括:
获取所述目标字符串中的字符像素点阈值;
根据所述字符像素点阈值确定连续的字符像素点,将所述连续的字符像素 点垂直方向上的起点坐标和终点坐标作为上下边界,将所述连续的字符像素点 水平方向上的起点坐标和终点坐标作为左右边界。
8、根据权利要求 6的方法, 其特征在于, 所述得到各个单字符区域之后, 包括:
根据相邻两个字符之间的间距判断所述两个字符是否为断裂字符, 若是, 则对所述两个字符的单字符区域进行合并。
9、根据权利要求 6的方法, 其特征在于, 所述得到各个单字符区域之后, 包括:
根据单个字符的字符宽度判断所述单个字符是否为粘连字符, 若是, 则对 所述单个字符的单字符区域进行分离。
10、 根据权利要求 9的方法, 其特征在于, 所述根据单个字符的字符宽度 判断所述单个字符是否为粘连字符, 包括:
判断所述单个字符的字符宽度是否大于宽度阈值, 若是, 则所述单个字符 为粘连字符;
所述对单个字符的单字符区域进行分离, 包括:
重新对所述单个字符进行左右边界的确定,若所述单个字符在水平方向上 连续的字符像素点满足预置字符宽度,则确认所述满足预置字符宽度内的区域 为被分离的第一个单字符区域,并从所述第一个单字符区域的下一点开始作为 被分离字符的左边界, 原所述单个字符的右边界为所述被分离字符的右边界。
11、根据权利要求 6的方法,其特征在于,所述得到各个单字符区域之后, 包括:
判断所述单字符区域是否满足边界阈值, 若否, 则根据所述边界阈值对所
述单字符区域进行缩放。
12、 根据权利要求 6的方法, 其特征在于, 所述确定目标字符串中各个字 符的上下边界, 包括:
从所述全区域的中间像素点开始,往上搜索,若连续两个像素点都不满足 所述字符像素点阈值, 则所述两个像素点之前的像素点作为作为上边界; 往下 搜索, 若连续两个像素点都不满足所述字符像素点阈值, 则所述两个像素点之 前的像素点作为作为下边界。
13、 一种纸类字符识别方法, 其特征在于, 包括:
获取字符串的目标区域;
确定所述目标区域中各个字符的上下边界和左右边界,得到各个单字符区 域;
根据相邻两个字符之间的间距判断所述两个字符是否为断裂字符, 若是, 则对所述两个字符的单字符区域进行合并;
分别识别所述单字符区域内的字符。
14、 根据权利要求 13的方法, 其特征在于, 所述确定所述字符串中各个 字符的上下边界和左右边界, 包括:
获取所述字符串中的字符像素点阈值;
根据所述字符像素点阈值确定连续的字符像素点,将所述连续的字符像素 点垂直方向上的起点坐标和终点坐标作为上下边界,将所述连续的字符像素点 水平方向上的起点坐标和终点坐标作为左右边界。
15、 根据权利要求 13的方法, 其特征在于, 所述得到各个单字符区域之 后, 包括:
根据单个字符的字符宽度判断所述单个字符是否为粘连字符, 若是, 则对 所述单个字符的单字符区域进行分离。
16、 根据权利要求 15的方法, 其特征在于, 所述根据单个字符的字符宽 度判断所述单个字符是否为粘连字符, 包括:
判断所述单个字符的字符宽度是否大于宽度阈值, 若是, 则所述单个字符 为粘连字符;
所述对单个字符的单字符区域进行分离, 包括:
重新对所述单个字符进行左右边界的确定,若所述单个字符在水平方向上 连续的字符像素点满足预置字符宽度,则确认所述满足预置字符宽度内的区域 为被分离的第一个单字符区域,并从所述第一个单字符区域的下一点开始作为 被分离字符的左边界, 原所述单个字符的右边界为所述被分离字符的右边界。
17、 根据权利要求 13的方法, 其特征在于, 所述得到各个单字符区域之 后, 包括:
判断所述单字符区域是否满足边界阈值, 若不, 则根据所述边界阈值对所 述单字符区域进行缩放。
18、 根据权利要求 13的方法, 其特征在于, 所述确定字符串中各个字符 的上下边界, 包括:
从所述全区域的中间像素点开始,往上搜索,若连续两个像素点都不满足 所述字符像素点阈值, 则所述两个像素点之前的像素点作为作为上边界; 从所述全区域的中间像素点开始,往下搜索,若连续两个像素点都不满足 所述字符像素点阈值, 则所述两个像素点之前的像素点作为作为下边界。
19、 一种纸类字符识别装置, 其特征在于, 包括:
数据获取单元, 用于获取输入纸类的图像数据;
倾斜校正单元, 用于对所述图像数据进行倾斜校正;
初步定位单元, 用于对所述图像数据的目标字符串进行初步定位, 获取所 述目标字符串的初步区域;
全区域定位单元,用于定位所述初步区域内像素点的灰度值之和最小的区 域; 获得所述目标字符串的全区域;
字符识别单元, 用于对所述全区域内的目标字符串进行字符识别。
20、 根据权利要求 19的装置, 其特征在于, 所述倾斜校正单元包括: 边缘提取模块, 用于提取所述图像数据的边缘点;
直线拟合模块, 用于对所述边缘点进行直线拟合;
倾斜角度获取模块, 用于获取所述直线拟合后的边缘点的倾斜角度; 调整模块, 用于根据所述倾斜角度调整所述图像数据。
21、 一种纸类字符识别装置, 其特征在于, 包括:
目标获取单元, 用于获取字符串的目标区域;
界, 得到各个单字符区域; 裂字符, 若是, 则对所述两个字符的单字符区域进行合并;
识别单元, 用于分别识别所述单字符区域内的字符。
22、 根据权利要求 21的装置, 其特征在于, 所述装置还包括: 粘连判定单元,用于根据单个字符的字符宽度判断所述单个字符是否为粘 连字符, 若是, 则对所述单个字符的单字符区域进行分离。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210230901.0A CN102779275B (zh) | 2012-07-04 | 2012-07-04 | 一种纸类字符识别方法及相关装置 |
CN201210230901.0 | 2012-07-04 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014005456A1 true WO2014005456A1 (zh) | 2014-01-09 |
Family
ID=47124185
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2013/074130 WO2014005456A1 (zh) | 2012-07-04 | 2013-04-12 | 一种纸类字符识别方法及相关装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN102779275B (zh) |
WO (1) | WO2014005456A1 (zh) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3193313A4 (en) * | 2014-09-11 | 2017-10-04 | GRG Banking Equipment Co., Ltd. | Banknote recognition method based on sorter dust accumulation and sorter |
CN110378337A (zh) * | 2019-07-05 | 2019-10-25 | 上海交通大学 | 金属切削刀具图纸标识信息视觉输入方法及系统 |
KR20200059598A (ko) | 2018-11-21 | 2020-05-29 | (주) 이즈커뮤니케이션즈 | 영상 처리 모듈의 소형화가 가능한 컴퓨터에의 입력 정보의 추출 방법 및 이 추출 방법이 구현되는 컴퓨터 입력 시스템 |
KR20200059594A (ko) | 2018-11-21 | 2020-05-29 | (주) 이즈커뮤니케이션즈 | 입력 장치의 판별 기능을 갖춘 컴퓨터 입력 시스템 |
CN111274841A (zh) * | 2016-10-24 | 2020-06-12 | 阿里巴巴集团控股有限公司 | 一种条形码的识别方法和装置 |
KR20200134660A (ko) | 2019-05-23 | 2020-12-02 | (주) 이즈커뮤니케이션즈 | 가시광 발광 소자를 입력 장치로서 이용하는 정보 입력 시스템 |
CN115050015A (zh) * | 2022-08-15 | 2022-09-13 | 恒银金融科技股份有限公司 | 金融票据账号字符区的精确分割方法 |
CN117710985A (zh) * | 2023-12-18 | 2024-03-15 | 珠海凌烟阁芯片科技有限公司 | 光学字符识别方法、装置及智能终端 |
Families Citing this family (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102779275B (zh) * | 2012-07-04 | 2015-06-17 | 广州广电运通金融电子股份有限公司 | 一种纸类字符识别方法及相关装置 |
CN103136845B (zh) * | 2013-01-23 | 2015-09-16 | 浙江大学 | 一种基于冠字号图像特征的人民币鉴伪方法 |
CN103544491A (zh) | 2013-11-08 | 2014-01-29 | 广州广电运通金融电子股份有限公司 | 一种面向复杂背景的光学字符识别方法及装置 |
WO2015172304A1 (zh) * | 2014-05-12 | 2015-11-19 | 深圳博众智能科技有限公司 | 一种自动选择纸币不同特征点判断的方法 |
CN104751559B (zh) * | 2015-03-25 | 2017-07-28 | 深圳怡化电脑股份有限公司 | 验钞装置及验钞方法 |
CN106709489B (zh) * | 2015-07-13 | 2020-03-03 | 腾讯科技(深圳)有限公司 | 一种字符识别的处理方法和装置 |
CN105261110B (zh) * | 2015-10-26 | 2018-04-06 | 江苏国光信息产业股份有限公司 | 一种高效dsp纸币冠字号识别方法 |
CN105243730B (zh) * | 2015-10-28 | 2018-02-09 | 深圳怡化电脑股份有限公司 | 纸币识别方法及系统 |
CN105761351A (zh) * | 2016-01-08 | 2016-07-13 | 东方通信股份有限公司 | 基于结构特征的字符识别方法 |
CN106096601B (zh) * | 2016-06-06 | 2019-06-18 | 深圳辰通智能股份有限公司 | 一种自动检测票据中字符类型的方法和系统 |
CN106204616B (zh) * | 2016-07-21 | 2020-07-24 | 深圳怡化电脑股份有限公司 | 一种伊朗纸币币值的识别方法及装置 |
CN106251341B (zh) * | 2016-07-22 | 2019-12-24 | 凌云光技术集团有限责任公司 | 一种印刷品质量检测方法 |
CN106504407B (zh) * | 2016-11-01 | 2019-06-07 | 深圳怡化电脑股份有限公司 | 一种处理纸币图像的方法及装置 |
CN106874909B (zh) * | 2017-01-18 | 2019-10-11 | 深圳怡化电脑股份有限公司 | 一种图像字符的识别方法及其装置 |
CN107742357A (zh) * | 2017-10-10 | 2018-02-27 | 深圳怡化电脑股份有限公司 | 一种纸币冠字号的识别方法及装置 |
CN107798327A (zh) * | 2017-10-31 | 2018-03-13 | 北京小米移动软件有限公司 | 字符识别方法及装置 |
CN108537237A (zh) * | 2018-04-04 | 2018-09-14 | 深圳怡化电脑股份有限公司 | 票据的特征区域提取方法、装置、设备和存储介质 |
CN109087368B (zh) * | 2018-06-14 | 2023-04-07 | 创新先进技术有限公司 | 一种字符串图形化方法和装置 |
CN111079735B (zh) * | 2018-10-22 | 2023-12-22 | 莱芜钢铁集团电子有限公司 | 一种铸坯端面字符识别方法及装置 |
CN110516672A (zh) * | 2019-08-29 | 2019-11-29 | 腾讯科技(深圳)有限公司 | 卡证信息识别方法、装置及终端 |
CN111783781B (zh) * | 2020-05-22 | 2024-04-05 | 深圳赛安特技术服务有限公司 | 基于产品协议字符识别的恶意条款识别方法、装置、设备 |
CN112990150A (zh) * | 2021-05-10 | 2021-06-18 | 恒银金融科技股份有限公司 | 一种基于投影双向累和测定冠字号上下边界的方法 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101021903A (zh) * | 2006-10-10 | 2007-08-22 | 鲍东山 | 视频字幕内容分析系统 |
CN102509383A (zh) * | 2011-11-28 | 2012-06-20 | 哈尔滨工业大学深圳研究生院 | 一种基于特征检测及模板匹配的混合号码识别方法 |
CN102779275A (zh) * | 2012-07-04 | 2012-11-14 | 广州广电运通金融电子股份有限公司 | 一种纸类字符识别方法及相关装置 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101408937B (zh) * | 2008-11-07 | 2011-12-21 | 东莞市微模式软件有限公司 | 一种字符行定位的方法及装置 |
-
2012
- 2012-07-04 CN CN201210230901.0A patent/CN102779275B/zh active Active
-
2013
- 2013-04-12 WO PCT/CN2013/074130 patent/WO2014005456A1/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101021903A (zh) * | 2006-10-10 | 2007-08-22 | 鲍东山 | 视频字幕内容分析系统 |
CN102509383A (zh) * | 2011-11-28 | 2012-06-20 | 哈尔滨工业大学深圳研究生院 | 一种基于特征检测及模板匹配的混合号码识别方法 |
CN102779275A (zh) * | 2012-07-04 | 2012-11-14 | 广州广电运通金融电子股份有限公司 | 一种纸类字符识别方法及相关装置 |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3193313A4 (en) * | 2014-09-11 | 2017-10-04 | GRG Banking Equipment Co., Ltd. | Banknote recognition method based on sorter dust accumulation and sorter |
US9928677B2 (en) | 2014-09-11 | 2018-03-27 | Grg Banking Equipment Co., Ltd. | Banknote recognition method based on sorter dust accumulation and sorter |
CN111274841A (zh) * | 2016-10-24 | 2020-06-12 | 阿里巴巴集团控股有限公司 | 一种条形码的识别方法和装置 |
CN111274841B (zh) * | 2016-10-24 | 2023-05-12 | 创新先进技术有限公司 | 一种条形码的识别方法和装置 |
KR20200059598A (ko) | 2018-11-21 | 2020-05-29 | (주) 이즈커뮤니케이션즈 | 영상 처리 모듈의 소형화가 가능한 컴퓨터에의 입력 정보의 추출 방법 및 이 추출 방법이 구현되는 컴퓨터 입력 시스템 |
KR20200059594A (ko) | 2018-11-21 | 2020-05-29 | (주) 이즈커뮤니케이션즈 | 입력 장치의 판별 기능을 갖춘 컴퓨터 입력 시스템 |
KR20200134660A (ko) | 2019-05-23 | 2020-12-02 | (주) 이즈커뮤니케이션즈 | 가시광 발광 소자를 입력 장치로서 이용하는 정보 입력 시스템 |
CN110378337A (zh) * | 2019-07-05 | 2019-10-25 | 上海交通大学 | 金属切削刀具图纸标识信息视觉输入方法及系统 |
CN110378337B (zh) * | 2019-07-05 | 2023-03-31 | 上海交通大学 | 金属切削刀具图纸标识信息视觉输入方法及系统 |
CN115050015A (zh) * | 2022-08-15 | 2022-09-13 | 恒银金融科技股份有限公司 | 金融票据账号字符区的精确分割方法 |
CN115050015B (zh) * | 2022-08-15 | 2023-09-12 | 恒银金融科技股份有限公司 | 金融票据账号字符区的精确分割方法 |
CN117710985A (zh) * | 2023-12-18 | 2024-03-15 | 珠海凌烟阁芯片科技有限公司 | 光学字符识别方法、装置及智能终端 |
Also Published As
Publication number | Publication date |
---|---|
CN102779275B (zh) | 2015-06-17 |
CN102779275A (zh) | 2012-11-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2014005456A1 (zh) | 一种纸类字符识别方法及相关装置 | |
JP5837205B2 (ja) | 画像領域を使用するテキスト検出 | |
US10860884B2 (en) | Methods and apparatus to determine the dimensions of a region of interest of a target object from an image using target object landmarks | |
JP6139658B2 (ja) | 文字認識方法及び文字認識システム | |
CN105243730B (zh) | 纸币识别方法及系统 | |
CN105261110B (zh) | 一种高效dsp纸币冠字号识别方法 | |
JP5624671B2 (ja) | 文字列切出方法及び文字列切出装置 | |
US9014459B2 (en) | Identification method for valuable file and identification device thereof | |
WO2016127545A1 (zh) | 一种字符切割识别方法 | |
US8027539B2 (en) | Method and apparatus for determining an orientation of a document including Korean characters | |
WO2014131339A1 (zh) | 字符识别方法和字符识别装置 | |
US11836969B2 (en) | Preprocessing images for OCR using character pixel height estimation and cycle generative adversarial networks for better character recognition | |
WO2014026483A1 (zh) | 一种字符识别方法及相关装置 | |
EP2553626A2 (en) | Segmentation of textual lines in an image that include western characters and hieroglyphic characters | |
CN107679479A (zh) | 一种基于图像形态学处理的客观填涂识别方法 | |
JP6628336B2 (ja) | 情報処理システム | |
CN114694161A (zh) | 一种特定版式证件的文本识别方法、设备及存储介质 | |
JP6890849B2 (ja) | 情報処理システム | |
JP6039944B2 (ja) | 帳票種類判別装置および帳票種類判別方法 | |
JP2000357287A (ja) | ナンバープレート認識方法および認識装置 | |
US11722615B2 (en) | Image processing including adjusting image orientation | |
JPH10207978A (ja) | 文字等パターン照合方法及び装置 | |
JP5006250B2 (ja) | 画像補正装置、画像補正方法、画像補正プログラム及び記録媒体 | |
JPH11250179A (ja) | 文字認識装置および文字認識方法 | |
JPH08194779A (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: 13813247 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: 13813247 Country of ref document: EP Kind code of ref document: A1 |