JP4148966B2 - Pattern matching apparatus, program for realizing the same, and recording medium - Google Patents
Pattern matching apparatus, program for realizing the same, and recording medium Download PDFInfo
- Publication number
- JP4148966B2 JP4148966B2 JP2005307248A JP2005307248A JP4148966B2 JP 4148966 B2 JP4148966 B2 JP 4148966B2 JP 2005307248 A JP2005307248 A JP 2005307248A JP 2005307248 A JP2005307248 A JP 2005307248A JP 4148966 B2 JP4148966 B2 JP 4148966B2
- Authority
- JP
- Japan
- Prior art keywords
- dictionary
- data
- matching
- feature data
- input
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Character Discrimination (AREA)
Description
本発明は、読み取った文字画像を文字として認識するパターン照合装置及びそれを実現するためのプログラム、記録媒体に関する。 The present invention relates to a pattern matching device that recognizes a read character image as a character, a program for realizing the same, and a recording medium.
従来、漢字を含む文字を対象とする文字認識において、様々な識別法が提案されているが、漢字は1字1字のパターンが複雑で、字種も多く、更に印刷文字でも明朝体やゴシック体などがあり、手書き文字まで含めると機械で認識させることが非常に難しい。このため、個々の装置において、マッチング法や構造解析などの種々の方法の組み合わせによって識別精度向上及び処理速度の高速化のための工夫が試みられている。 Conventionally, various recognition methods have been proposed for character recognition including characters including kanji, but kanji has a complicated pattern of one character and many types of characters, and even printed characters can be used in the Mincho style. There are Gothic fonts, etc., and it is very difficult to make it recognized by a machine if even handwritten characters are included. For this reason, in each device, attempts have been made to improve the identification accuracy and increase the processing speed by combining various methods such as a matching method and structural analysis.
従来の文字画像の識別法には、一般にパターン照合法と構造化解析法とがある。印刷文字の識別にはパターン照合法が用いられることが多い。パターン照合法は、画像から抽出した文字パターンを、辞書が持つ標準パターンとマッチングさせ、文字を認識する。このマッチングには複合類似度が用いられることが多い。 Conventional character image identification methods generally include a pattern matching method and a structured analysis method. A pattern matching method is often used for identifying printed characters. In the pattern matching method, a character pattern extracted from an image is matched with a standard pattern held in a dictionary to recognize a character. For this matching, a composite similarity is often used.
また、複合類似度のマッチングには計算時間が掛かるため、まずは単純類似度を計算し、単純類似度の値が高い上位の候補に対してのみ複合類似度を計算する手法が知られている。 In addition, since it takes a long time to calculate the composite similarity, a method is known in which simple similarity is calculated first, and composite similarity is calculated only for higher candidates having a high simple similarity value.
図11は、従来のパターン照合法を説明するフローチャートである。まず、ステップS50において、入力された画像から文字の外接枠に沿って文字画像を切り出す。図12が切り出された文字画像の一例を示す図である。文字画像「あ」に外接するように四角形の枠で切り出されている。 FIG. 11 is a flowchart for explaining a conventional pattern matching method. First, in step S50, a character image is cut out along the circumscribed frame of characters from the input image. FIG. 12 is a diagram illustrating an example of a character image cut out. A square frame is cut out so as to circumscribe the character image “A”.
次に、ステップS51へ進んで、切り出された文字画像からその文字の特徴を抽出する。この特徴抽出の手法としてはメッシュ特徴がよく知られている。メッシュ特徴とは、切り出された文字画像をメッシュに分割し、各メッシュにおける画素数を数値化して正規化を行う処理である。図13は、図12の文字画像をメッシュ特徴で分割した図である。図13では1文字画像を縦横にそれぞれ8等分して64メッシュに区切っている。図14は、図13の各メッシュにおける画素数を数値化して正規化した特徴データである。それぞれのメッシュの中で画像の特徴量(0〜128)を抽出し、8×8のマトリクスで表している。 Next, it progresses to step S51 and the characteristic of the character is extracted from the cut-out character image. A mesh feature is well known as a feature extraction method. The mesh feature is a process of dividing the cut character image into meshes, and normalizing the number of pixels in each mesh. FIG. 13 is a diagram in which the character image of FIG. 12 is divided by mesh features. In FIG. 13, a single character image is divided into 8 meshes vertically and horizontally and divided into 64 meshes. FIG. 14 shows characteristic data obtained by normalizing the number of pixels in each mesh of FIG. Image features (0 to 128) are extracted from each mesh and represented by an 8 × 8 matrix.
次に、ステップS52へ進んで、入力された文字画像の特徴データと、辞書が有する標準パターンである特徴データとの単純類似度を計算する。入力された文字画像の特徴データをX、辞書の或るカテゴリの特徴データをYとすると、単純類似度S(X,Y)は次の式で表される。カテゴリは、1文字のデータに相当する。但し、同じ文字でもフォントによって形状がかなり違うものは別々のカテゴリとなる。
分母の値は、入力された文字画像の特徴データ及び辞書が有する特徴データを正規化しておくと一定になるので分子の計算だけで処理できる。分子の値は、8×8のメッシュ特徴を用いた場合は、数2のように計算される。
ステップS52では、上記の計算を辞書が有する全てのカテゴリに対して行う。なお、入力された文字画像の特徴データと辞書が有する特徴データとの近さを表す指標としては、類似度の他にシティーブロック距離やユークリッド距離などを用いてもよい。 In step S52, the above calculation is performed for all categories of the dictionary. In addition to the similarity, a city block distance, an Euclidean distance, or the like may be used as an index representing the proximity between the input character image feature data and the feature data of the dictionary.
次に、ステップS53へ進んで、全てのカテゴリに対して計算された単純類似度の値の中から上位n個(nは自然数)のカテゴリを抽出する。そして、ステップS54へ進んで、抽出されたn個のカテゴリに対して複合類似度を計算する。次に、ステップS55へ進んで、計算されたn個の複合類似度の中から上位m個(mは自然数)の候補文字を抽出する。そして、ステップS56へ進んで、抽出されたm個の候補文字の文字コードを認識結果として出力する。 Next, proceeding to step S53, the top n categories (n is a natural number) are extracted from the values of simple similarity calculated for all categories. Then, the process proceeds to step S54, and the composite similarity is calculated for the n extracted categories. Next, the process proceeds to step S55, and the top m (m is a natural number) candidate characters are extracted from the calculated n composite similarities. Then, the process proceeds to step S56, and the extracted character codes of the m candidate characters are output as recognition results.
上記のパターン照合法においては、ステップS52の単純類似度の計算処理が、全体の処理量の大部分を占める。そこで処理速度の更なる高速化のための工夫が試みられている。 In the pattern matching method, the simple similarity calculation process in step S52 occupies most of the entire processing amount. Thus, attempts have been made to further increase the processing speed.
例えば特許文献1には、辞書が有するカテゴリを類似カテゴリグループに分け、各グループを代表する特徴データと入力された文字画像の特徴データとのマッチングを図11のステップS52の前に行い、マッチングした上位グループのみステップS52以降の処理を行うことが開示されている。
For example, in
また特許文献2には、入力された文字画像の特徴データを各行に区切り、各行の最大の値をマークし、また辞書が有する特徴データに対しても予め各行単位に最大の値をとる可能性がある場所全てにマークしておき、マークした箇所が一致するか否かを照合し、一致するときのみ図11のステップS52以降の処理を行うことが開示されている。
しかしながら、特許文献1では類似カテゴリグループへ分ける際に理想的な分割を行うのが難しいという問題がある。また入力された文字画像の特徴データとグループの代表ベクトルとのマッチングになるので、辞書データとしては本来近い特徴データを有するカテゴリを含むグループではなく、別のグループが近くなることが多発する。このため複数のグループを候補として残すことになり、あまり候補が絞れないことがある。
However,
また特許文献2では、特徴データの各行に対して最大の値の場所を求めているが、最大の値の場所は非常にぶれやすいため、予め用意しておく辞書データを作成するのが難しく、漏れが発生する可能性が高い。また、漏れを防ぐために広範囲に最大の値を取り得るマークをつければ、大多数のものと一致してしまい、あまり高速化できない。
Further, in
更に、特許文献1及び2では、辞書の特徴データ以外に高速化に使うデータを予め用意しておかねばならず、データ容量の増加に繋がるという問題もある。
Further, in
本発明は、文字認識のマッチングの計算量を減らして高速化するとともに、正確に文字認識するパターン照合装置を提供することを目的とする。また、そのパターン照合装置を実現するためのプログラムとプログラムを記録した記録媒体とを提供することも目的とする。 It is an object of the present invention to provide a pattern matching apparatus that accurately recognizes characters while reducing the amount of calculation for matching for character recognition to increase the speed. Another object of the present invention is to provide a program for realizing the pattern matching device and a recording medium on which the program is recorded.
上記目的を達成するために本発明は、入力された文字画像の特徴データと、辞書が有する複数カテゴリの特徴データとを比較して文字認識するパターン照合装置であって、前記辞書が有する複数カテゴリの特徴データから、各カテゴリの各要素に対して、第1の閾値以下であるか否かを示す2値の値である辞書照合データを求める手段と、前記入力された文字画像の特徴データから、各要素に対して、第2の閾値以上であるか否かを示す2値の値である入力照合データを求める手段と、前記辞書照合データと前記入力照合データとを照合し、一致する要素の個数が所定値以下のカテゴリのみ辞書とのマッチング計算を行う手段とを備えたことを特徴とする。 In order to achieve the above object, the present invention provides a pattern matching apparatus that recognizes characters by comparing feature data of an input character image with feature data of a plurality of categories included in the dictionary, the plurality of categories included in the dictionary. Means for obtaining dictionary collation data which is a binary value indicating whether or not each element of each category is equal to or less than a first threshold value from the feature data of the category, and from the feature data of the input character image , A means for obtaining input collation data that is a binary value indicating whether or not each element is equal to or greater than a second threshold, and collating the dictionary collation data with the input collation data, and matching elements Means for performing matching calculation with a dictionary only for a category whose number is equal to or less than a predetermined value.
この構成によると、辞書照合データと入力照合データとを照合し、全く一致しない若しくは一致する個数が少ない場合のみ、類似度の計算を行うことで高速化を図ることができる。入力された文字画像の特徴データの各要素に対して第2の閾値以上であるか否かを求めることは、閾値をある程度大きくした場合に文字部分であるかどうかを示す意味がある。また辞書が有する複数カテゴリの特徴データの各要素に対して第1の閾値以下であるか否かを求めることは、閾値をある程度小さくした場合に背景部分であるかどうかを示す意味がある。辞書の特徴データは数多くのパターンを平均化したものであるので、閾値を小さくした場合に、その閾値以下であるということは絶対的に背景部分であることを意味し、該当文字が入力された場合にはその箇所は文字部分にはならないことを利用している。また本来背景部分になる要素に文字部分が重なる程に入力された文字画像の特徴データが変形している場合には、辞書とのマッチングが行われないことになる。しかし、この場合マッチングを行ったとしても類似度は数2の計算で求められるので、入力された文字画像の特徴データの大きい部分に相当するxiと対応する辞書の要素yiの積が小さいことから結果的に類似度の値も小さくなり、マッチング計算を全て行ったとしても最終的に候補になる可能性は低くなる。 According to this configuration, the dictionary collation data and the input collation data are collated, and only when there is no coincidence or the number of coincidence is small, the speed can be increased by calculating the similarity. Obtaining whether or not each element of the feature data of the input character image is greater than or equal to the second threshold has a meaning of indicating whether or not it is a character portion when the threshold is increased to some extent. Further, obtaining whether or not each element of the feature data of a plurality of categories included in the dictionary is equal to or less than the first threshold has a meaning indicating whether or not it is a background portion when the threshold is reduced to some extent. Since the feature data of the dictionary is an average of many patterns, when the threshold value is reduced, being below that threshold means that it is absolutely the background part, and the corresponding character has been entered. In some cases, it is used that the part does not become a character part. In addition, when the feature data of the character image input so that the character part overlaps the element that originally becomes the background part, the matching with the dictionary is not performed. However, even if matching is performed in this case, the degree of similarity can be obtained by the calculation of Formula 2, so that the product of x i corresponding to a large portion of the feature data of the input character image and the corresponding element y i of the dictionary is small. As a result, the value of the similarity also becomes small, and even if all the matching calculations are performed, the possibility of finally becoming a candidate is low.
また本発明においては、辞書照合データを予め保持しておく必要はなく、装置の起動時に一度だけ値を求める処理を行えばよいので、辞書の特徴データ以外の余分なデータを持たなくてもよい。 Further, in the present invention, it is not necessary to store dictionary collation data in advance, and it is only necessary to obtain a value once when the apparatus is started up, so there is no need to have extra data other than dictionary feature data. .
入力された文字画像の特徴データより求めた入力照合データと、辞書の特徴データより求めた辞書照合データとの照合によりマッチングを行うか否かを判定できるので、高速な演算が可能である。また認識結果の正確性も増す。更に入力照合データと辞書照合データとの照合をまとまった単位の論理積で行えば判定に要する演算量を減らすことが可能である。また辞書の特徴データから求める処理を装置の起動時に行うことで、予め辞書照合データを持っておく必要がなく、データ容量の削減を図ることが可能である。 Since it is possible to determine whether or not to perform matching by collating input collation data obtained from input character image feature data and dictionary collation data obtained from dictionary feature data, high-speed calculation is possible. Also, the accuracy of the recognition result is increased. Furthermore, if the collation between the input collation data and the dictionary collation data is performed by a logical product of a unit, it is possible to reduce the amount of calculation required for the determination. Further, by performing the processing to be obtained from the feature data of the dictionary at the time of starting the apparatus, it is not necessary to have dictionary collation data in advance, and the data capacity can be reduced.
図1は、パターン照合装置の主要な構成を示すブロック図である。パターン照合装置10は入力装置11と出力装置12とに接続されている。入力装置11は、イメージスキャナなどからなり文字画像を読み取りパターン照合装置10へ読み取った文字画像を送る。出力装置12は、液晶表示装置などからなりパターン照合装置10で認識した文字が出力される。
FIG. 1 is a block diagram showing the main configuration of the pattern matching apparatus. The
パターン照合装置10は、本装置全体を制御する制御部13と、入力装置11から送られてきた画像を1文字分の文字画像に切り出す切り出し部14と、予め定められた方法で、切り出された文字画像の特徴量を抽出し、後述の特徴データを作成する特徴抽出部15と、単純類似度を計算する前にマッチングの計算を行う候補を絞る大分類部16と、辞書21を構成する単純類似度用辞書特徴データ17及び複合類似度用辞書特徴データ18と、入力された文字画像の特徴データと単純類似度用辞書特徴データ17や複合類似度用辞書特徴データ18との類似度を計算するマッチング部19と、大分類処理を行う際に用いる辞書照合データを単純類似度用辞書特徴データ17から作成する辞書照合データ作成部20とを備えている。
The
図2は、パターン照合法を説明するフローチャートである。まず、ステップS10において、切り出し部14は入力装置11に入力された画像を受け取り、画像中の文字の外接枠に沿って文字画像を切り出す。切り出された文字画像の一例は図12と同様である。
FIG. 2 is a flowchart for explaining the pattern matching method. First, in step S10, the
次に、ステップS11へ進んで、切り出された文字画像からその文字の特徴を抽出する。この特徴抽出の手法としてはメッシュ特徴を用いることができる。メッシュ特徴とは、切り出された文字画像をメッシュに分割し、各メッシュにおける画素数を数値化して正規化を行う処理である。文字画像をメッシュ特徴で分割した一例は図13と同様である。図13では1文字画像を縦横にそれぞれ8等分して64メッシュに区切っている。各メッシュにおける画素数を数値化して正規化した特徴データは図14と同様である。それぞれのメッシュの中で画像の特徴量を抽出し、8×8のマトリクスで表している。 Next, it progresses to step S11 and the characteristic of the character is extracted from the cut-out character image. A mesh feature can be used as the feature extraction method. The mesh feature is a process of dividing the cut character image into meshes, and normalizing the number of pixels in each mesh. An example in which the character image is divided by the mesh feature is the same as in FIG. In FIG. 13, a single character image is divided into 8 meshes vertically and horizontally and divided into 64 meshes. The characteristic data obtained by normalizing the number of pixels in each mesh by numerical values is the same as that shown in FIG. Image features are extracted from each mesh and represented by an 8 × 8 matrix.
次に、ステップS12へ進んで、大分類処理を行う。ステップS13で単純類似度を計算する前にマッチングの計算を行う候補を絞る処理である。この処理の詳細については後述する。 Next, it progresses to step S12 and performs a large classification process. This is a process for narrowing down candidates for matching calculation before calculating the simple similarity in step S13. Details of this processing will be described later.
次に、ステップS13へ進んで、ステップS12で絞られた候補に対して単純類似度の計算を行う。単純類似度は、入力された文字画像の特徴データと、単純類似度用辞書特徴データ17とから計算する。入力された文字画像の特徴データをX、辞書の或るカテゴリの特徴データをYとすると、単純類似度S(X,Y)は数1で表される。カテゴリは、1文字のデータに相当する。但し、同じ文字でもフォントによって形状がかなり違うものは別々のカテゴリとなる。
Next, the process proceeds to step S13, and simple similarity is calculated for the candidates narrowed down in step S12. The simple similarity is calculated from the input character image feature data and the simple similarity
分母の値は、入力された文字画像の特徴データ及び辞書が有する特徴データを正規化しておくと一定になるので分子の計算だけで処理できる。分子の値は、8×8のメッシュ特徴を用いた場合は、数2のように計算される。なお、入力された文字画像の特徴データと辞書が有する特徴データとの近さを表す指標としては、類似度の他にシティーブロック距離やユークリッド距離などを用いてもよい。
Since the denominator value becomes constant when the feature data of the input character image and the feature data of the dictionary are normalized, the denominator value can be processed only by calculating the numerator. The value of the numerator is calculated as shown in
次に、ステップS14へ進んで、全てのカテゴリに対して計算された単純類似度の値の中から上位n個(nは自然数)のカテゴリを抽出する。そして、ステップS15へ進んで、抽出されたn個のカテゴリに対して複合類似度を計算する。次に、ステップS16へ進んで、計算されたn個の複合類似度の中から上位m個(mは自然数)の候補文字を抽出する。そして、ステップS17へ進んで、抽出されたm個の候補文字の文字コードを認識結果として出力する。以上が1文字分の文字認識処理であり、通常は切り出す文字画像がなくなるまで繰り返される。 In step S14, the top n categories (n is a natural number) are extracted from the values of simple similarity calculated for all categories. Then, the process proceeds to step S15, and the composite similarity is calculated for the n extracted categories. Next, the process proceeds to step S16, and the top m (m is a natural number) candidate characters are extracted from the calculated n composite similarities. In step S17, the extracted character codes of the m candidate characters are output as recognition results. The above is the character recognition process for one character, and is normally repeated until there is no character image to be cut out.
図3は、辞書照合データ作成部20の動作を示すフローチャートである。まず、ステップS20において、辞書21から単純類似度用辞書特徴データ17を取り出す。
FIG. 3 is a flowchart showing the operation of the dictionary collation
次に、ステップS21へ進んで、辞書照合データ作成部20内に設けられたカウンタ(不図示)の値i(iは自然数)を初期値である1にセットする。次に、ステップS22へ進んで、特徴データの64個の中のi番目(カウンタの値)の要素の値が閾値β(βは自然数)以下であるか否かを判定する。
Next, the process proceeds to step S21, and a value i (i is a natural number) of a counter (not shown) provided in the dictionary collation
ステップS22において、特徴データのi番目の要素の値が閾値β以下の場合は、ステップS23へ進んで該当するbitを1にセットする。一方、ステップS22において、特徴データのi番目の要素の値が閾値βより大きい場合は、ステップS24へ進んで該当するbitを0にセットする。そして、ステップS23又はステップS24からステップS25へ進んでカウンタの値iをインクリメントする。 In step S22, when the value of the i-th element of the feature data is equal to or less than the threshold value β, the process proceeds to step S23 and the corresponding bit is set to 1. On the other hand, if the value of the i-th element of the feature data is larger than the threshold value β in step S22, the process proceeds to step S24 and the corresponding bit is set to 0. Then, the process proceeds from step S23 or step S24 to step S25 to increment the counter value i.
次に、ステップS26へ進んで、カウンタの値iが64より大きいか否かを判定する。ステップS26において、カウンタの値iが64より大きい場合は、特徴データの全要素に対するチェックが終わったと判断して、ステップS27へ進む。一方、ステップS26において、カウンタの値iが64以下の場合は、ステップS22に戻る。 Next, the process proceeds to step S26, where it is determined whether or not the counter value i is larger than 64. In step S26, if the counter value i is larger than 64, it is determined that all the elements of the feature data have been checked, and the process proceeds to step S27. On the other hand, if the counter value i is 64 or less in step S26, the process returns to step S22.
ステップS27では、全てのカテゴリに対して処理が終わったか否かを判定する。ステップS27において、全てのカテゴリに対して処理が終わっている場合は、辞書照合データの作成を終了する。一方、全てのカテゴリに対して処理が終わっていない場合は、ステップS20に戻る。 In step S27, it is determined whether or not processing has been completed for all categories. In step S27, if the processing has been completed for all categories, the creation of dictionary collation data is terminated. On the other hand, if the processing has not been completed for all categories, the process returns to step S20.
例えば、β=2とした場合の辞書照合データの例を説明する。図4(a)は、文字「あ」の辞書の特徴データを示したものであり、64bitの辞書照合データ”1100011100000000000000011000000000000000000001000000000000000000”が作られる。図4(b)は、イメージをわかりやすくするため各要素に対して1になった部分を黒、0になった部分を白で表したものである。 For example, an example of dictionary collation data when β = 2 will be described. FIG. 4A shows characteristic data of the dictionary of the character “A”, and 64-bit dictionary collation data “1100011100000000000000011000000000000000000001000000000000000000” is created. In FIG. 4B, for easy understanding of the image, the portion that is 1 for each element is represented by black, and the portion that is 0 is represented by white.
また、図5(a)は、文字「い」の辞書の特徴データを示したものであり、64bitの辞書照合データ”0011100100111000001110000011110000001100000011000000110000001111”が作られる。図5(b)は、イメージをわかりやすくするため各要素に対して1になった部分を黒、0になった部分を白で表したものである。 FIG. 5A shows the characteristic data of the dictionary of the character “I”, and 64-bit dictionary collation data “0011100100111000001110000011110000001100000011000000110000001111” is created. FIG. 5 (b) shows a portion that becomes 1 for each element in black and a portion that becomes 0 in white for easy understanding of the image.
また、図6(a)は、文字「会」の辞書の特徴データを示したものであり、64bitの辞書照合データ” 1100011110000001000000000000000000000000000000001000000100000000”が作られる。図6(b)は、イメージをわかりやすくするため各要素に対して1になった部分を黒、0になった部分を白で表したものである。 FIG. 6A shows the characteristic data of the dictionary of the character “kai”, and 64-bit dictionary collation data “1100011110000001000000000000000000000000000000001000000100000000” is created. FIG. 6 (b) shows a portion that becomes 1 for each element in black and a portion that becomes 0 in white for easy understanding of the image.
このように、全てのカテゴリについて照合用の64bitデータが作られる。なお、辞書照合データの作成処理は、パターン照合装置10の起動時に1度だけ行えばよい。またROM(不図示)等の容量に余裕があるならば、起動時に作成するのではなく、予め作成したデータを保存しておいてもよい。
In this way, 64-bit data for collation is created for all categories. Note that the dictionary collation data creation process need only be performed once when the
図7は、図2のステップS12の大分類処理を説明するフローチャートである。まず、ステップS30において、入力された文字画像の特徴データから閾値αを用いて入力照合データを作成する。この処理の詳細については後述する。 FIG. 7 is a flowchart for explaining the large classification processing in step S12 of FIG. First, in step S30, input collation data is created from the input character image feature data using the threshold value α. Details of this processing will be described later.
次に、ステップS31へ進んで、ステップS30で作成された入力照合データと、図3のフローで作成された辞書照合データとの照合を行う。この照合は、64bitデータの論理積によって行えばよい。処理装置の能力によって一度に扱えるbit数は異なるので、64bitの処理能力があれば一度に処理すればよいし、32bitの処理能力があれば上位32bitと下位32bitの2つに分けて処理すればよい。同様に、16bitの処理能力であれば4つに分けて処理すればよい。 Next, the process proceeds to step S31, where the input collation data created in step S30 is collated with the dictionary collation data created in the flow of FIG. This collation may be performed by a logical product of 64-bit data. The number of bits that can be handled at a time differs depending on the capacity of the processing device. Therefore, if there is a 64-bit processing capacity, it may be processed at one time. Good. Similarly, if the processing capability is 16 bits, the processing may be divided into four.
次に、ステップS32へ進んで、ステップS31での照合の結果、一致する要素の数がp個(pは自然数)以下であるか否かを判定する。具体的には、ステップS31で照合結果が64bitのbit列になっているので、その中で1になっているbitの数がp個以下かどうか判定すればよい。1になっているかどうかの判定は各ビット毎にチェックを行ってもよいし、例えば8bit単位に分割し、予め8bitの取りうる値で1になっている数を返すテーブルを用いて計算してもよい。図8が8bitの値に対して1になっている数を返すテーブルの例である。また特にp=0の場合においてはステップS31の処理において結果が0であるか否かで判断できるので、一致している数を数える必要がなくより高速に処理が行える。 Next, the process proceeds to step S32, and it is determined whether or not the number of matching elements is equal to or less than p (p is a natural number) as a result of the collation in step S31. Specifically, since the collation result is a 64-bit bit string in step S31, it may be determined whether or not the number of bits that are 1 is less than or equal to p. Whether or not it is 1 may be checked for each bit. For example, it is calculated using a table that divides into 8 bits and returns a number that is 1 in 8 bits. Also good. FIG. 8 is an example of a table that returns a number that is 1 for an 8-bit value. In particular, when p = 0, it can be determined whether or not the result is 0 in the process of step S31, so that it is not necessary to count the number of coincidence, and the process can be performed at a higher speed.
ステップS32において、一致する要素の数がp個以下である場合は、ステップS33へ進んで、当該カテゴリを候補対象としてチェックする。一方、ステップS32において、一致する要素の数がp個より多い場合は、ステップS34へ進んで、当該カテゴリを候補対象としない。 If the number of matching elements is not more than p in step S32, the process proceeds to step S33, and the category is checked as a candidate target. On the other hand, if the number of matching elements is larger than p in step S32, the process proceeds to step S34, and the category is not set as a candidate target.
ステップS33又はステップS34からステップS35へ進んで、全てのカテゴリに対して照合が終わったか否かを判定する。ステップS35において、全てのカテゴリに対して照合が終わっている場合は、ステップS36へ進む。一方、全てのカテゴリに対して照合が終わっていない場合は、ステップS31に戻る。 It progresses to step S35 from step S33 or step S34, and it is determined whether collation was completed with respect to all the categories. If it is determined in step S35 that all categories have been verified, the process proceeds to step S36. On the other hand, if collation has not been completed for all categories, the process returns to step S31.
ステップS36では、ステップS33で候補対象としてチェックしたカテゴリの数がk個(kは自然数)以下であるか否かを判定する。これは、入力される文字画像の特徴データによっては、閾値αの設定値では候補が残りすぎる場合があり、それをチェックする処理である。 In step S36, it is determined whether or not the number of categories checked as candidate targets in step S33 is equal to or less than k (k is a natural number). This is a process of checking if there are too many candidates remaining with the set value of the threshold value α depending on the feature data of the input character image.
ステップS36において、候補対象としてチェックしたカテゴリの数がk個以下の場合は、大分類処理を終了する。一方、ステップS36において、候補対象としてチェックしたカテゴリの数がk個より多い場合は、ステップS37へ進んで閾値αの値を変更する。具体的には、閾値αの値を低くすることにより、文字とみなされる要素を増やす。つまり、ステップS30で作成される64bitの入力照合データにおいて1になるbitを増やし、ステップS31の照合結果でp個以下でない可能性を増やす。 In step S36, if the number of categories checked as candidate targets is k or less, the large classification process is terminated. On the other hand, if the number of categories checked as candidate targets is greater than k in step S36, the process proceeds to step S37 to change the value of the threshold α. Specifically, by reducing the value of the threshold value α, elements that are regarded as characters are increased. That is, the number of 1 bits in the 64-bit input collation data created in step S30 is increased, and the possibility that the collation result in step S31 is not less than p is increased.
図9は、図7のステップS30の入力照合データの作成処理を説明するフローチャートである。まず、ステップS40において、カウンタ(不図示)の値iを初期値である1にセットする。次に、ステップS41へ進んで、入力された文字画像の特徴データの64個の中のi番目(カウンタの値)の要素の値が閾値α(αは自然数)以上であるか否かを判定する。 FIG. 9 is a flowchart for explaining the input collation data creation process in step S30 of FIG. First, in step S40, a value i of a counter (not shown) is set to 1 which is an initial value. Next, the process proceeds to step S41, where it is determined whether or not the value of the i-th (counter value) element among the 64 feature data of the input character image is greater than or equal to a threshold value α (α is a natural number). To do.
ステップS41において、特徴データのi番目の要素の値が閾値α以上の場合は、ステップS42へ進んで該当するbitを1にセットする。一方、ステップS41において、特徴データのi番目の要素の値が閾値αより小さい場合は、ステップS43へ進んで該当するbitを0にセットする。そして、ステップS42又はステップS43からステップS44へ進んでカウンタの値iをインクリメントする。 If the value of the i-th element of the feature data is greater than or equal to the threshold value α in step S41, the process proceeds to step S42 and the corresponding bit is set to 1. On the other hand, if the value of the i-th element of the feature data is smaller than the threshold value α in step S41, the process proceeds to step S43 and the corresponding bit is set to 0. Then, the process proceeds from step S42 or step S43 to step S44 to increment the counter value i.
次に、ステップS45へ進んで、カウンタの値iが64より大きいか否かを判定する。ステップS45において、カウンタの値iが64より大きい場合は、入力された文字画像の特徴データの全要素に対するチェックが終わったと判断して、入力照合データの作成を終了する。一方、ステップS45において、カウンタの値iが64以下の場合は、ステップS41に戻る。 Next, the process proceeds to step S45, where it is determined whether or not the counter value i is larger than 64. In step S45, if the counter value i is larger than 64, it is determined that all elements of the feature data of the input character image have been checked, and the creation of the input collation data is terminated. On the other hand, if the counter value i is 64 or less in step S45, the process returns to step S41.
例えば、α=30、p=0とした場合の大分類処理を説明する。図7のステップS30の処理により入力された文字画像の特徴データから64bitの入力照合データ、例えば”0001000001111110001000000011111001101001100110011011001100000110”が作られる。図10は、この入力照合データのイメージをわかりやすくするため各要素に対して1になった部分を黒、0になった部分を白で表したものである。 For example, a large classification process when α = 30 and p = 0 will be described. 64-bit input collation data, for example, “0001000001111110001000000011111001101001100110011011001100000110” is generated from the feature data of the character image input by the process of step S30 in FIG. FIG. 10 shows the portion of the input verification data in black and the portion of 0 in white for easy understanding of the input collation data image.
図7のステップS31において、例えば図4の「あ」との照合結果は”0000000000000000000000000000000000000000000000000000000000000000”となり、一致する数が0(p=0)であり、候補対象になることが分かる。また図5の「い」との照合結果は”0001000000111000001000000011110000001000000010000000000000000110”となり、一致する数が0ではないので、候補対象にならないことがわかる。また図6の「会」との照合結果は”0000000000000000000000000000000000000000000000001000000100000000”となり、一致する数が0ではないので、候補対象にならないことがわかる。 In step S31 of FIG. 7, for example, the collation result with “A” in FIG. Also, the collation result with “I” in FIG. 5 is “0001000000111000001000000011110000001000000010000000000000000110”, and since the number of matches is not 0, it can be seen that the candidate is not a candidate. In addition, the collation result with “Meeting” in FIG. 6 is “0000000000000000000000000000000000000000000000001000000100000000”, and since the number of matches is not 0, it can be seen that it is not a candidate target.
このように大分類処理を行い、辞書の特徴データをうまく利用することでマッチする可能性がある文字は落とさずに候補を絞り高速化できる。 By performing large classification processing in this way and using the feature data of the dictionary well, candidates can be narrowed down and speeded up without dropping characters that may be matched.
なお、本実施形態で用いた数値は特定の値ではなく、適宜設定すればよい。また図7のステップS36やステップS37で候補が多すぎる場合の処理を行っているが、逆に候補が少なすぎる場合のチェックを行い、αの値を増やすことで候補を増やすことも可能である。さらに入力された文字画像の特徴データの閾値αを変更させるだけでなく、辞書が有する特徴データに対しての閾値βを複数用意しておき、条件に合わせて照合するデータを変えることも可能である。また図7のステップS36やステップS37の処理を行わず、残った候補がいくつであってもかまわないように変更してもよい。 The numerical values used in the present embodiment are not specific values and may be set as appropriate. Further, although processing is performed when there are too many candidates in step S36 and step S37 in FIG. 7, it is also possible to increase the number of candidates by checking if there are too few candidates and increasing the value of α. . In addition to changing the threshold value α of the feature data of the input character image, it is possible to prepare a plurality of threshold values β for the feature data of the dictionary and change the data to be collated according to the conditions. is there. Further, the process of step S36 and step S37 of FIG. 7 may be omitted, and the number of remaining candidates may be changed so that it does not matter.
なお、上記のパターン照合装置10には、上記の動作を実行するためのパターン照合プログラムが搭載されている。また、そのパターン照合プログラムはROM、HDD、CD、DVD等の記録媒体に記録されて用いられる。
The
10 パターン照合装置
21 辞書
10
Claims (6)
前記辞書が有する複数カテゴリの特徴データから、各カテゴリの各要素に対して、第1の閾値以下であるか否かを示す2値の値である辞書照合データを求める手段と、前記入力された文字画像の特徴データから、各要素に対して、第2の閾値以上であるか否かを示す2値の値である入力照合データを求める手段と、前記辞書照合データと前記入力照合データとを照合し、一致する要素の個数が所定値以下のカテゴリのみ辞書とのマッチング計算を行う手段とを備えたことを特徴とするパターン照合装置。 A pattern matching device that recognizes characters by comparing feature data of an input character image and feature data of a plurality of categories of a dictionary,
Means for obtaining dictionary collation data which is a binary value indicating whether or not the value is equal to or less than a first threshold value for each element of each category from the feature data of a plurality of categories included in the dictionary; Means for obtaining input collation data, which is a binary value indicating whether or not each element is greater than or equal to a second threshold value from the feature data of the character image; and the dictionary collation data and the input collation data. A pattern matching apparatus comprising: means for matching and performing a matching calculation with a dictionary only for a category in which the number of matching elements is equal to or less than a predetermined value.
前記辞書が有する複数カテゴリの特徴データから、各カテゴリの各要素に対して、第1の閾値以下であるか否かを示す2値の値である辞書照合データを求め、前記入力された文字画像の特徴データから、各要素に対して、第2の閾値以上であるか否かを示す2値の値である入力照合データを求め、前記辞書照合データと前記入力照合データとを照合し、一致する要素の個数が所定値以下のカテゴリのみ辞書とのマッチング計算を行うことを特徴とするパターン照合プログラム。 From the feature data of a plurality of categories possessed by the dictionary, dictionary collation data which is a binary value indicating whether or not each element of each category is equal to or less than a first threshold is obtained, and the input character image The input collation data which is a binary value indicating whether or not each element is equal to or greater than the second threshold is obtained from the feature data, and the dictionary collation data and the input collation data are collated and matched. A pattern matching program that performs matching calculation with a dictionary only for a category in which the number of elements to be performed is a predetermined value or less.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005307248A JP4148966B2 (en) | 2005-10-21 | 2005-10-21 | Pattern matching apparatus, program for realizing the same, and recording medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005307248A JP4148966B2 (en) | 2005-10-21 | 2005-10-21 | Pattern matching apparatus, program for realizing the same, and recording medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2007115112A JP2007115112A (en) | 2007-05-10 |
| JP4148966B2 true JP4148966B2 (en) | 2008-09-10 |
Family
ID=38097210
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2005307248A Expired - Fee Related JP4148966B2 (en) | 2005-10-21 | 2005-10-21 | Pattern matching apparatus, program for realizing the same, and recording medium |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4148966B2 (en) |
-
2005
- 2005-10-21 JP JP2005307248A patent/JP4148966B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2007115112A (en) | 2007-05-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4787275B2 (en) | Segmentation-based recognition | |
| KR100412317B1 (en) | Character recognizing/correcting system | |
| US20110280481A1 (en) | User correction of errors arising in a textual document undergoing optical character recognition (ocr) process | |
| US10963717B1 (en) | Auto-correction of pattern defined strings | |
| JP2008532176A (en) | Recognition graph | |
| JP2991779B2 (en) | Character recognition method and device | |
| US20010051965A1 (en) | Apparatus for rough classification of words, method for rough classification of words, and record medium recording a control program thereof | |
| JP2005173730A (en) | Business form ocr program, method, and device | |
| Clausner et al. | Icdar2019 competition on recognition of early indian printed documents–reid2019 | |
| JP2730665B2 (en) | Character recognition apparatus and method | |
| CN116092083A (en) | OCR error correction method and device based on knowledge base and storage medium | |
| JPH0634256B2 (en) | Contact character cutting method | |
| JP4148966B2 (en) | Pattern matching apparatus, program for realizing the same, and recording medium | |
| JP4347675B2 (en) | Form OCR program, method and apparatus | |
| US7016535B2 (en) | Pattern identification apparatus, pattern identification method, and pattern identification program | |
| JP3730073B2 (en) | Template creation method, apparatus, and recording medium recording template creation program | |
| JPH11184976A (en) | Dictionary learning system and character recognition device | |
| JP2017146841A (en) | Character recognition device, character recognition method, and program | |
| JP2906758B2 (en) | Character reader | |
| JP5986051B2 (en) | Method for automatically recognizing Arabic text | |
| JP4633271B2 (en) | Dictionary learning method and dictionary learning program | |
| Zhou et al. | Character recognition under severe perspective distortion | |
| JP2866920B2 (en) | Standard pattern creation method and apparatus, and character recognition apparatus and method | |
| CN1110002C (en) | System and method for improving word recognition rate | |
| JP2993533B2 (en) | Information processing device and character recognition device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20071105 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20071129 |
|
| A871 | Explanation of circumstances concerning accelerated examination |
Free format text: JAPANESE INTERMEDIATE CODE: A871 Effective date: 20071129 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080115 |
|
| A975 | Report on accelerated examination |
Free format text: JAPANESE INTERMEDIATE CODE: A971005 Effective date: 20071218 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080325 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080526 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20080624 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20080624 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110704 Year of fee payment: 3 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 Ref document number: 4148966 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110704 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120704 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120704 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130704 Year of fee payment: 5 |
|
| S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: R3D03 |
|
| LAPS | Cancellation because of no payment of annual fees |