JP3196291B2 - Character recognition method and device - Google Patents
Character recognition method and deviceInfo
- Publication number
- JP3196291B2 JP3196291B2 JP05130592A JP5130592A JP3196291B2 JP 3196291 B2 JP3196291 B2 JP 3196291B2 JP 05130592 A JP05130592 A JP 05130592A JP 5130592 A JP5130592 A JP 5130592A JP 3196291 B2 JP3196291 B2 JP 3196291B2
- Authority
- JP
- Japan
- Prior art keywords
- character
- value
- mesh
- feature
- division
- 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
Landscapes
- Character Discrimination (AREA)
Description
【0001】[0001]
【産業上の利用分野】 本発明は、画像で表現された
文字パターンを光学的に読み取り、各文字パターンを対
応する文字コードに変換する文字認識技術に関し、特に
印刷文字を対象とし、各種フォントの文字認識を行うの
に適した文字認識アルゴリズムに関する。BACKGROUND OF THE INVENTION The present invention reads a character pattern represented by image optically relates character recognition technology to convert each character pattern to a corresponding character code, and specifically for printing characters, the various fonts The present invention relates to a character recognition algorithm suitable for performing character recognition.
【0002】[0002]
【従来の技術】従来、文字認識技術の1例として、例え
ば、電子通信学会論文誌’79/11Vol.J62−
D No.11 「マルチフォント印刷漢字認識のため
の粗分類」(従来技術1)などで使われているメッシュ
分割方式によるものがある。これは、文字パターンを均
等な複数のメッシュ領域に分割し、その中の黒画素の割
合を特徴量とするものである。基本的には、特徴をぼか
すことによって位置ずれに対処したものであり、本発明
の如く、ずらしマッチングへの応用は考慮されていな
い。このため、詳細な認識には適さないという問題があ
る。2. Description of the Related Art Conventionally, as an example of character recognition technology, for example, the Transactions of the Institute of Electronics and Communication Engineers, '79 / 11 Vol. J62-
D No. 11 There is a mesh division method used in “rough classification for multi-font printing kanji recognition” (prior art 1). In this method, a character pattern is divided into a plurality of uniform mesh areas, and the ratio of black pixels in the mesh area is used as a feature amount. Basically, the method addresses the displacement by blurring the feature, and does not consider the application to the displacement matching as in the present invention. For this reason, there is a problem that it is not suitable for detailed recognition.
【0003】従来の文字認識技術の他の例として、電子
通信学会論文誌’85/1 Vol.J68−D N
o.1 pp.56−63 「動的整合法による手書き
漢字認識」(従来技術2)がある。これは、文字パター
ンを取り出した後、一定サイズのパターンに正規化し、
正規化されたパターンについて、各画素ごとに縦、横、
斜めの方向性特徴を抽出し、各方向成分ごとに、別の文
字パターンとして求めた後、それぞれの画像について、
各画素ごとに一方向のみのずらしマッチングを行なうこ
とで、文字認識を実現するものである。本方式では、画
素の順序関係の整合性は、ずらす方向の1ライン中での
み行なわれ、他のラインとの整合性はとられていないと
いう問題がある。また、現パターンについて、正規化す
るために特徴数が増えてしまうという問題がある。[0003] As another example of the conventional character recognition technology, see the Transactions of the Institute of Electronics and Communication Engineers, '85 / 1 Vol. J68-DN
o. 1 pp. 56-63 "Handwritten Kanji Recognition by Dynamic Matching Method" (Prior Art 2). This means that after extracting the character pattern, it is normalized to a certain size pattern,
For the normalized pattern, vertical, horizontal,
After extracting the diagonal directional features and obtaining a different character pattern for each directional component, for each image,
By performing shift matching in only one direction for each pixel, character recognition is realized. In this method, the consistency of the order relation of pixels is performed only in one line in the shifting direction, and there is a problem that the consistency with other lines is not obtained. In addition, there is a problem that the number of features increases in order to normalize the current pattern.
【0004】その他、メッシュ分割を動的に行なう文字
認識技術として、電子通信学会論文誌’84/11 V
ol.J67−D No.11 pp.1379−13
83「線密度イコライゼーション−相関法のための非線
形正規化法」(ジュライ具術3)がある。これは、手書
き文字の変形を補正するために、パターン中の黒画素の
重心を基にして分割位置を変化させるものである。これ
は、全体パターンの歪を補正することができるが、ずら
しマッチングのための特徴量抽出には適さない。[0004] In addition, as a character recognition technique for dynamically performing mesh division, the Transactions of the Institute of Electronics, Communication and Communication, '84 / 11 V
ol. J67-D No. 11 pp. 1379-13
83 "Linear Density Equalization-Nonlinear Normalization Method for Correlation Method" (Jurai Surgery 3). This is to change the division position based on the center of gravity of the black pixel in the pattern in order to correct the deformation of the handwritten character. This can correct the distortion of the entire pattern, but is not suitable for extracting feature amounts for shift matching.
【0005】[0005]
【発明が解決しようとする課題】従来技術1に示された
メッシュパターン特徴は、線幅の違いや線の位置ずれに
よって特徴量が大きく変動し、様々なフォントを1つの
辞書で認識するのには適さない。また、ぼかしによって
位置ずれに対処をしており、識別率が低いという問題が
ある。The feature amount of the mesh pattern feature shown in the prior art 1 greatly changes due to a difference in line width or a line displacement, and it is difficult to recognize various fonts with one dictionary. Is not suitable. In addition, the displacement is dealt with by blurring, and there is a problem that the identification rate is low.
【0006】従来技術2では、漢字など複雑な文字の認
識を行なう場合、文字パターンの正規化の数を小さくす
ると、文字パターンそのものが元のパターンと異なった
ものになるため、得られたパターンの特徴からは十分な
認識が行なえないという問題がある。したがって、認識
率をあげるためには分解能を下げることができず、マッ
チングのための特徴数が多くなる。また、マッチングの
ずらし許容度も大きくしないと、文字パターンの変形に
十分対応できなくなってしまう。こうしたことから、上
記従来方式では、認識率を維持しながら、認識速度を上
げることは困難である。また、ずらしについても、縦方
向性特徴については、各行ごとに、そこに含まれる全て
の画素の特徴をずらす必要があり、処理に時間がかかる
という問題点がある。In the prior art 2, when recognizing a complex character such as a kanji, if the number of character pattern normalizations is reduced, the character pattern itself becomes different from the original pattern. There is a problem that sufficient recognition cannot be performed from the feature. Therefore, the resolution cannot be reduced to increase the recognition rate, and the number of features for matching increases. In addition, if the tolerance of the matching shift is not increased, it is not possible to sufficiently cope with the deformation of the character pattern. For these reasons, it is difficult to increase the recognition speed while maintaining the recognition rate in the conventional method. As for the shift, it is necessary to shift the features of all the pixels included in each of the rows in the vertical direction feature, and there is a problem that it takes a long time to perform the process.
【0007】従来技術3のメッシュ分割方式は、パター
ンの変形を補正するためのものであり、特徴数を減らし
て認識速度の高速化を図るためのものではない。The mesh division method of the prior art 3 is for correcting pattern deformation, and is not for reducing the number of features to increase the recognition speed.
【0008】本発明の目的は、各種フォントの認識を高
精度に行なえるようにした文字認識方法を提供すること
にある。It is an object of the present invention to enhance recognition of various fonts.
It is an object of the present invention to provide a character recognition method which can be performed with high accuracy .
【0009】本発明の他の目的は、特徴数を減らすこと
によって、高速に認識処理できる文字認識方法を提供す
ることにある。Another object of the present invention is to provide a character recognition method capable of performing high-speed recognition processing by reducing the number of features.
【0010】[0010]
【課題を解決するための手段】これらの目的を達成する
ために、本発明では、文字パターンを正規化する前に元
の文字パターンから特徴を抽出し、これを正規化する。
正規化は、文字パターンの持つ特徴をできるだけ失わな
い方式、例えばメッシュ分割方式を用いる。In order to achieve these objects, the present invention extracts features from an original character pattern and normalizes them before normalizing the character pattern.
The normalization uses a method in which the characteristics of the character pattern are not lost as much as possible, for example, a mesh division method.
【0011】この場合、文字線のストローク方向に着目
した特徴量を抽出し、この特徴量が隣の画素と大きく異
なる位置を分割位置としてメッシュ分割する。特徴の変
化位置だけで分割すると正規化のための分割数が足りな
い場合は、全体のバランスを保った補間位置での分割を
行なう。In this case, a feature value focused on the stroke direction of the character line is extracted, and mesh division is performed using a position where the feature value is significantly different from an adjacent pixel as a division position. If the number of divisions for normalization is not enough if the division is performed only at the change position of the feature, division is performed at the interpolation position while maintaining the overall balance.
【0012】本発明は、認識対象を印刷文字とし、縦方
向性の特徴については縦1ラインのメッシュごとに、横
方向性の特徴については横1ラインのメッシュごとにず
らした「ずらしマッチング方式」適用する。また、左右
分離、あるいは上下分離が生じた文字パターンについて
は、それぞれの部分について独立に特徴量を抽出して、
ずらしマッチングを行なう。The present invention provides a "shifted matching method" in which a recognition target is a print character, and a feature in the vertical direction is shifted by one vertical mesh, and a feature in the horizontal direction is shifted by one horizontal mesh. Apply. In addition, for character patterns in which horizontal separation or vertical separation has occurred, the feature amount is extracted independently for each part,
Perform shift matching.
【0013】[0013]
【作用】本発明の文字認識方法によれば、文字認識のた
めに抽出する特徴の数を減少した場合でも、従来技術と
同様の認識率を得ることができ、高速度の文字認識が可
能となる。According to the character recognition method of the present invention, even when the number of features extracted for character recognition is reduced, a recognition rate similar to that of the prior art can be obtained, and high-speed character recognition can be performed. Become.
【0014】[0014]
【実施例】先ず、図1を参照して、本発明による文字認
識方法の概要を説明する。First, an outline of a character recognition method according to the present invention will be described with reference to FIG.
【0015】文字パターン101から、画素ごとの特徴
量(画素特徴量)を抽出する。画素特徴量は、その画素
が含まれるストロークの方向性に関する特徴量であり、
縦、横、左斜め、右斜めの4つの方向について求められ
る。これら4つの特徴量のうち、縦方向、横方向の特徴
(102、103)だけをマッチングのための特徴量と
して用いる。このままでは、文字サイズの正規化が為さ
れていないので、縦方向と横方向のそれぞれの特徴につ
いて、文字パターンを一定の分割数で碁盤目状に分割
(メッシュ分割)する。このメッシュ分割の際、特徴の
ぼけを防ぐために、特徴量の値の差が大きくなる位置を
メッシュ分割位置に設定する。また、元の文字パターン
のバランスが崩れないようにメッシュ分割位置を追加
し、得られた各メッシュ内の画素特徴量の平均値をマッ
チングのためのメッシュ特徴量とする(104、10
5)。次に、メッシュ特徴量を用いて対象の絞り込みを
行なった後、縦方向と横方向の各メッシュ特徴量を、特
徴量辞書(106、107)に用意してある縦方向性、
横方向性の特徴量とストローク単位のマッチングが行え
るように、図2に示すようなDP(動的計画法)による
ずらしマッチング(DPマッチング)を行なう。From the character pattern 101, a feature amount (pixel feature amount) for each pixel is extracted. The pixel feature amount is a feature amount related to the directionality of a stroke including the pixel,
It is obtained for four directions: vertical, horizontal, diagonally left, and diagonally right. Of these four feature quantities, only the vertical and horizontal features (102, 103) are used as feature quantities for matching. Since the character size is not normalized in this state, the character pattern is divided into a grid pattern (mesh division) with a fixed division number for each of the vertical and horizontal characteristics. At the time of this mesh division, a position at which the difference between the values of the feature amounts becomes large is set as a mesh division position in order to prevent blurring of the feature. Also, mesh division positions are added so that the balance of the original character pattern is not lost, and the average value of the obtained pixel feature amounts in each mesh is used as the mesh feature amount for matching (104, 10).
5). Next, after narrowing down the objects using the mesh features, the vertical and horizontal mesh features are stored in the feature dictionary (106, 107).
Shift matching (DP matching) by DP (dynamic programming) as shown in FIG. 2 is performed so that matching of the feature amount in the horizontal direction and the stroke unit can be performed.
【0016】図3は、本実施例の文字認識装置の全体ブ
ロック図である。FIG. 3 is an overall block diagram of the character recognition device of the present embodiment.
【0017】スキャナ301で入力された画像データ
は、スキャナコントローラ302を通して、メモリ30
5に格納される。本実施例では、スキャナからの読み込
みによって得られる画像は、一定の閾値によって決定さ
れる2値のパターンである。The image data input by the scanner 301 is transmitted to a memory 30 through a scanner controller 302.
5 is stored. In this embodiment, the image obtained by reading from the scanner is a binary pattern determined by a certain threshold.
【0018】ディスク303は、画像、パターンマッチ
ング用辞書、認識結果などを格納する。必要に応じて、
ディスクコントローラ304を介して、メモリ内容の格
納とメモリへの書き込みを行なう。認識処理はメモリ上
のデータを用いて行われる。メインメモリ305には、
認識時のワークデータや特徴量辞書が記憶される。The disk 303 stores images, dictionary for pattern matching, recognition results, and the like. If necessary,
The contents of the memory are stored and written to the memory via the disk controller 304. The recognition process is performed using data on the memory. In the main memory 305,
Work data and a feature dictionary at the time of recognition are stored.
【0019】CPU306では、システム全体のコント
ロールを行ない、キーボード310からの入力などによ
り、順次処理を進めていく。各認識処理もここで行なわ
れる。ディスプレイ/キーボードコントローラ307
は、CPUから送られた表示内容をメモリ308に格納
し、これをディスプレイ309に表示する。また、キー
ボード310からの入力をメモリ308に蓄え、CPU
からの読みだし要求に応ずる。311は、各装置間を接
続するためのバスである。The CPU 306 controls the entire system, and sequentially proceeds with processing by input from the keyboard 310 or the like. Each recognition process is also performed here. Display / keyboard controller 307
Stores the display content sent from the CPU in the memory 308 and displays it on the display 309. The input from the keyboard 310 is stored in the memory 308, and the
Respond to read requests from Reference numeral 311 denotes a bus for connecting the devices.
【0020】図4に、文字認識処理の概略ブロック図を
示す。画像読みだし部401は、画データ402と、4
03に格納された書式解析結果の文字外接矩形とから、
1文字分ごとの画像データを読みだす。読みだした内容
は、画素特徴量格納メモリ404に格納する。画素特徴
量格納メモリは、a,b,c,dの4枚あり、それぞれ
に白画素が「0」、黒画素が「1」の値を持つ画像デー
タとして格納される。FIG. 4 is a schematic block diagram of the character recognition process. The image reading unit 401 includes image data 402 and 4
From the character circumscribed rectangle of the format analysis result stored in 03,
The image data for each character is read out. The read contents are stored in the pixel feature amount storage memory 404. There are four pixel feature storage memories, a, b, c, and d, each of which is stored as image data having a value of “0” for a white pixel and “1” for a black pixel.
【0021】画素特徴抽出部405では、404に格納
された文字パターンを基に、各画素ごとに、縦、横、左
斜め、右斜めの方向性特徴を4次元分抽出し、それぞ
れ、メモリ404の領域a,b,c,dに格納する。The pixel feature extracting unit 405 extracts, for each pixel, four-dimensional directional features of vertical, horizontal, diagonally left, and diagonally right directions based on the character pattern stored in the memory 404. In areas a, b, c, and d.
【0022】メッシュ分割部406では、404に格納
された画素特徴量を基に、同一メッシュ内には類似の特
徴を持つ画素ができるだけ入るように、所定数のメッシ
ュ分割位置を設定し、メッシュ分割位置格納メモリ40
7に格納する。The mesh division unit 406 sets a predetermined number of mesh division positions based on the pixel feature amounts stored in 404 so that pixels having similar characteristics are included in the same mesh as much as possible. Position storage memory 40
7 is stored.
【0023】メッシュ特徴量抽出部408では、メモリ
407に格納されたメッシュ分割位置から得られる各メ
ッシュごとに、404に格納された画素特徴量中の画素
の持つ特徴の平均を求め、これを、メッシュの特徴量と
する。得られた特徴量は、メッシュ特徴量格納メモリ4
09に格納する。The mesh feature extraction unit 408 calculates the average of the features of the pixels in the pixel feature stored in 404 for each mesh obtained from the mesh division positions stored in the memory 407, and calculates This is the feature amount of the mesh. The obtained feature amount is stored in the mesh feature amount storage memory 4.
09.
【0024】パターンマッチング部410では、メモリ
409に格納された特徴量と、特徴量辞書格納メモリ4
11に格納された特徴量辞書とのパターンマッチングを
行なう。そして、辞書中の各文字とのマッチングの評価
値と、辞書中の各文字の識別番号を、評価値格納メモリ
412に格納する。In the pattern matching unit 410, the feature amount stored in the memory 409 and the feature amount dictionary storage memory 4
11 is subjected to pattern matching with the feature dictionary stored in FIG. Then, the evaluation value of the matching with each character in the dictionary and the identification number of each character in the dictionary are stored in the evaluation value storage memory 412.
【0025】ソート部413では、評価値格納メモリ4
12の内容を評価値を基に、評価の高い順になるように
ソートする。ここでは、評価値と一緒に文字の識別番号
もソートし、このソートで得られる順位が認識候補の順
位となる。In the sorting unit 413, the evaluation value storage memory 4
12 are sorted on the basis of the evaluation value so as to be in descending order of evaluation. Here, the identification numbers of the characters are also sorted together with the evaluation values, and the order obtained by this sorting is the order of the recognition candidates.
【0026】図5に、本文字認識装置の処理の概略フロ
ーチャートを示す。FIG. 5 shows a schematic flowchart of the processing of the character recognition apparatus.
【0027】501:初期化。特徴量辞書の読みだし等
を行なう。501: Initialization. The feature dictionary is read out.
【0028】502:画像データの読みだし方法を決定
する。502: Determine a method of reading image data.
【0029】503:スキャナ起動。スキャナから読み
だす場合は、301のスキャナを起動し、画像データを
メモリに格納する。503: Scanner activation. When reading from the scanner, the scanner 301 is started and the image data is stored in the memory.
【0030】504:画像データ読みだし。ディスクに
格納された画像データを読みだす場合は、303のディ
スクからデータを読みだし、メモリに格納する。504: Image data reading. When reading the image data stored in the disk, the data is read from the disk 303 and stored in the memory.
【0031】505:連結成分抽出。画像データがメモ
リに格納されると、画像全体をスキャンし、上下左右斜
めの8方向のいずれかで連続している黒画素の塊(連結
成分)を抽出し、それに外接する矩形で取り出す。505: Extraction of connected components. When the image data is stored in the memory, the entire image is scanned, and a block (connected component) of black pixels that are continuous in any of the eight directions (up, down, left, and right) is extracted, and is extracted as a rectangle circumscribing it.
【0032】506:書式解析。505で取り出した、
連結成分の並びをもとに、文字列抽出、領域抽出を行な
い、文字列、図、表などを判定する。506: Format analysis. I took it out at 505,
Based on the arrangement of the connected components, character string extraction and region extraction are performed, and character strings, figures, tables, and the like are determined.
【0033】507:文字抽出。書式解析で、文字列と
判断された部分について、文字切り出しを行ない、各行
ごとに1文字づつの境界を設定し、文字の外接矩形を抽
出する。507: Character extraction. Characters are extracted from a portion determined to be a character string in the format analysis, a boundary of one character is set for each line, and a circumscribed rectangle of the character is extracted.
【0034】508:文字認識。抽出された文字パター
ンを認識し、文字コードに変換する。508: Character recognition. Recognize the extracted character pattern and convert it to a character code.
【0035】文字認識の処理は、文字パターンからの特
徴抽出と抽出した特徴のパターンマッチングよりなる。
図6の文字認識処理全体のフローチャートにしたがっ
て、処理内容を詳しく述べる。The character recognition process includes feature extraction from a character pattern and pattern matching of the extracted features.
The processing contents will be described in detail according to the flowchart of the entire character recognition processing of FIG.
【0036】601:認識対象となる文字数をMに設定
する。601: Set the number of characters to be recognized to M.
【0037】602:カウンタmを0クリアする。602: The counter m is cleared to 0.
【0038】603:認識対象文字を全て認識したか判
定する。m<M 604:文字矩形情報と画像データから、次に認識する
文字パターンを、1文字分読みだす。603: It is determined whether all the characters to be recognized have been recognized. m <M 604: A character pattern to be recognized next is read for one character from the character rectangle information and the image data.
【0039】605:特徴抽出。読みだした文字パター
ンについて、パターンマッチングのための特徴量を求め
る。605: Feature extraction. For the read character pattern, a feature amount for pattern matching is obtained.
【0040】606:マッチング対象となる特徴量辞書
の文字数をNに設定する。606: The number of characters of the feature dictionary to be matched is set to N.
【0041】607:カウンタnを0クリアする。607: The counter n is cleared to 0.
【0042】608:特徴量辞書のN文字と比較が終わ
ったか、チェックする。608: Check whether the comparison with the N characters in the feature dictionary has been completed.
【0043】609:411の特徴量辞書格納メモリに
格納された標準特徴量を読みだす。At step 609: 411, the standard feature value stored in the feature value dictionary storage memory is read.
【0044】610:辞書に格納された各文字コードに
対応する標準特徴量と、605で画像からの文字パター
ンから求めた特徴量とのずらしマッチングを行ない、マ
ッチング距離値を求め、これを412のマッチング距離
格納メモリに格納する。610: A shift matching is performed between the standard feature amount corresponding to each character code stored in the dictionary and the feature amount obtained from the character pattern from the image in 605 to obtain a matching distance value. It is stored in the matching distance storage memory.
【0045】611:カウンタnのインクリメントを行
なう。611: The counter n is incremented.
【0046】612:412に格納したマッチングの距
離値を基に、ソートを行なう。612: Sorting is performed based on the matching distance values stored in 412.
【0047】613:認識結果として、ソート結果の上
位10文字の文字コードと、マッチングの距離値を返
す。613: Return the character codes of the top 10 characters of the sorting result and the matching distance value as the recognition result.
【0048】614:カウンタmのインクリメントを行
なう。614: The counter m is incremented.
【0049】図7は、特徴抽出方式全体のフローチャー
トである。特徴量としては、文字パターンを構成するス
トロークの方向性に注目したものを用い、これを、画素
ごとに求めたあと、メッシュ分割して得る。FIG. 7 is a flowchart of the entire feature extraction method. As a feature amount, a feature value that pays attention to the directionality of a stroke forming a character pattern is used, and is obtained for each pixel, and then obtained by mesh division.
【0050】701:文字パターン読み出しでは、ま
ず、画像データと文字矩形データとから、1文字分の文
字パターンを読みだし、404−a,b,c,dの4枚
の画素特徴量格納メモリに格納する。この際、各パター
ンの周囲には、一画素分の余白(白画素の特徴量:0)
を書き込む。図8は、各画素ごとに、黒の部分は1、白
の部分は0が格納されている状態。701: In character pattern reading, first, a character pattern for one character is read from image data and character rectangular data, and stored in four pixel characteristic amount storage memories 404-a, b, c, and d. Store. At this time, a margin of one pixel (white pixel feature amount: 0) is provided around each pattern.
Write. FIG. 8 shows a state where 1 is stored in a black portion and 0 is stored in a white portion for each pixel.
【0051】702:ラン長ラベル作成では、図9に示
したように、404−a,b,c,dの黒画素の位置に
は、それぞれ、その画素を含む、縦、横、左斜め、右斜
め、の各方向の連続した黒画素の数(以下これをラン長
とよぶ)を書き込む。白画素の位置には、すべて0を書
き込む。702: In the creation of the run length label, as shown in FIG. 9, the positions of the black pixels 404-a, b, c, and d include the vertical, horizontal, diagonally left, The number of continuous black pixels in each of the diagonally right directions (hereinafter referred to as a run length) is written. All 0s are written at the positions of the white pixels.
【0052】703:画素特徴量抽出では、404−
a,b,c,dに格納された各方向のラン長の同一の位
置の値を取り出し、式1で正規化し、これを再び、40
4−a,b,c,dに書き込む。これにより、各方向の
画素特徴量は、0から128に正規化される。703: In the pixel feature value extraction, 404-
The values at the same position of the run length in each direction stored in a, b, c, and d are extracted, normalized by Expression 1, and again
4-a, b, c, d are written. As a result, the pixel feature amount in each direction is normalized from 0 to 128.
【0053】[0053]
【数1】 (Equation 1)
【0054】図10のa,b,c,dは、図9のa,
b,c,dの同一の位置に格納されている値をH,V,
L,Rとした場合、これを数1で正規化した値(h,
v,l,r)を格納した状態を示す。例えば、図9の、
位置901、902、903、904の値は、それぞれ
正規化されて、図10の位置1001、1002、10
03、1004の値になる。FIGS. 10A, 10B, 10C, and 10D correspond to FIGS.
The values stored in the same position of b, c, d are H, V,
When L and R are used, the values (h,
v, l, r). For example, in FIG.
The values of the positions 901, 902, 903, and 904 are respectively normalized, and the positions 1001, 1002, 10
03, 1004.
【0055】704:メッシュ分割では、204−a,
204−bに格納した縦方向性、横方向性の画素特徴量
の値をもとに、特徴のぼけを防ぐように、メッシュ分割
を行なう。斜め方向性特徴については、本実施例ではマ
ッチングに用いない為、メッシュ分割しないが、特徴を
斜方軸変換することで、同様にメッシュ分割して特徴抽
出してもよい。704: In the mesh division, 204-a,
Based on the values of the vertical and horizontal pixel features stored in 204-b, mesh division is performed so as to prevent blurring of the features. Since the oblique direction feature is not used for matching in the present embodiment, it is not divided into meshes. However, the features may be similarly divided into meshes by performing oblique axis transformation to extract features.
【0056】705:メッシュ特徴量抽出では、704
で求めたメッシュ分割位置をもとに、404−a,40
2−bに格納された画素特徴量をメッシュ分割し、各メ
ッシュに含まれる画素特徴量の平均値を求め、これを各
メッシュのメッシュ特徴量とし、マッチングに用いる特
徴量とする。705: 704 in the mesh feature extraction
404-a, 40-
The pixel feature amount stored in 2-b is divided into meshes, an average value of the pixel feature amounts included in each mesh is obtained, and the average value is used as a mesh feature amount of each mesh, which is a feature amount used for matching.
【0057】メッシュ分割では、1つのメッシュ内にで
きるだけ多くの特徴が入るように、メッシュ分割位置を
設定する。このために、隣合う画素の特徴量の差分を求
め、これが最も大きくなるような位置で分割を行なう。In the mesh division, the mesh division positions are set so that as many features as possible are included in one mesh. For this purpose, a difference between the feature amounts of adjacent pixels is obtained, and division is performed at a position where the difference is the largest.
【0058】以下、図11のフローチャートに従って、
本文字認識方式におけるメッシュ分割方式について詳し
く述べる。図12から図18は、メッシュ分割の際、4
07に格納されるメッシュ分割位置を求めるための作業
テーブルの内容を示したものである。Hereinafter, according to the flowchart of FIG.
The mesh division method in this character recognition method will be described in detail. FIG. 12 to FIG.
7 shows the contents of a work table for obtaining a mesh division position stored in 07.
【0059】1101:差分投影値抽出では、隣合う画
素の画素特徴量の差分値を求め、これを1方向に投影し
た値を求める。縦方向性画素特徴量については、横に隣
りあう画素の特徴量の差分値を縦方向に投影する。横方
向性画素特徴量については、縦に隣りあう画素の特徴量
の差分値を横方向に投影する。この際、縦方向性画素特
徴量については、左右に並んだ特徴量が、”左側の値<
右側の値”の場合と、”左側の値>右側の値”の場合に
分けて、投影する。同様に、横方向性画素特徴量につい
ても、上下に並んだ特徴量が、”上側の値<下側の値”
の場合と、”上側の値>下側の値”の場合に分けて、投
影する。図12に、図10−aに示した特徴量の、左右
に隣合った画素の値の差分値の縦方向への投影の様子を
示す。1201が、”左側の値<右側の値”の投影値、
1202が、”左側の値>右側の値”の投影値。1101: In the difference projection value extraction, a difference value between pixel feature amounts of adjacent pixels is obtained, and a value obtained by projecting the difference value in one direction is obtained. As for the vertical direction pixel feature amount, a difference value of the feature amount of horizontally adjacent pixels is projected in the vertical direction. As for the horizontal pixel feature amount, the difference value of the feature amount of vertically adjacent pixels is projected in the horizontal direction. At this time, as for the vertical pixel feature amount, the feature amount arranged on the left and right is “left value <
The projection is performed separately for the case of “value on the right side” and the case of “value on the left side> value on the right side. <Lower value ”
And the case of “upper value> lower value” are projected separately. FIG. 12 shows how the feature values shown in FIG. 10A are projected in the vertical direction with respect to the difference between the values of the adjacent pixels on the left and right. 1201 is a projection value of “left value <right value”;
Reference numeral 1202 denotes a projection value of “value on the left> value on the right”.
【0060】1102:差分投影値の極大点取り出しで
は、1101で得た、差分投影値を画素境界の並びの方
向の関数として、極大になる位置を取り出す。図13
に、図12に示した投影値が、並びの位置の関数とし
て、極大となるような画素境界線の位置を”1”で示
す。In step 1102, in extracting the maximum point of the difference projection value, a position where the difference projection value obtained in step 1101 becomes a maximum is extracted as a function of the direction in which the pixel boundaries are arranged. FIG.
In FIG. 12, the position of the pixel boundary line at which the projection values shown in FIG. 12 are maximized as a function of the arrangement position is indicated by “1”.
【0061】1103:極大点ソートでは、1102で
得た極大点の、差分投影値が降順になるようにソートす
る。図14に、図13で極大になる位置を、その位置
の、差分の投影値(図12)の大きさの降順でソートし
た結果を示す。このように、極大点のみを、メッシュ分
割位置とするのは、スキャナで文字パターンを読み込ん
だ際の線境界のがたつきや、ストロークの傾きにより、
投影値が大きい位置が連続した場合に、どこで、分割す
るかを決定するためである。1103: In the local maximum point sorting, the local maximum points obtained in step 1102 are sorted such that the difference projection values are in descending order. FIG. 14 shows the result of sorting the position having the maximum in FIG. 13 in descending order of the magnitude of the difference projection value (FIG. 12) at that position. In this way, only the local maximum point is set as the mesh division position because of the rattling of the line boundary and the inclination of the stroke when the character pattern is read by the scanner.
This is for determining where to divide when the position having a large projection value is continuous.
【0062】1104:極大点による分割位置設定で
は、1103でソートして得られた順序で画素境界を取
り出して、メッシュ分割位置を設定する。図15に、図
14の差分投影値の大きな方から、分割位置として設定
した状態を示す。1104: In the division position setting based on the maximum point, pixel boundaries are extracted in the order obtained by sorting in 1103, and the mesh division position is set. FIG. 15 shows a state where the divisional position is set as the division position from the larger difference projection value in FIG.
【0063】この例では、図12の1201、1202
に示した投影値が、大きな位置から選択している。In this example, 1201 and 1202 in FIG.
Are selected from large positions.
【0064】分割位置を設定する、別の方法としては、
図12の1201と1202のそれぞれから、交互に分
割位置を取り出す方法がある。これは、次のようなもの
である。As another method of setting the division position,
There is a method of alternately extracting a division position from each of 1201 and 1202 in FIG. This is as follows.
【0065】文字パターンの1本のストロークに注目し
た場合、その両側に白画素との境界線が現れることか
ら、たとえば、1201の投影値で設定された分割位置
と、ストロークをはさんで、反対側の分割位置が、12
02に存在するはずである。したがって、分割位置が1
つ得られた場合、その分割位置が、”左の値<右の値”
の投影値(1201)から得られた分割位置であれば、
1201で見つかった分割位置の右側の、ストローク幅
として許容される範囲の、”左の値>右の値”の投影値
(1202)の中から、この範囲の中で極大点を見つ
け、これを分割位置とする。同様に、”左の値>右の
値”の投影値(1202)の中から見つかれば、見つか
った位置の左側の、ストローク幅として許容される範囲
の、”左の値<右の値”の投影値(1201)の中か
ら、極大点を見つけ、これを分割位置とする。いずれの
場合も対応する分割位置が見つからなければ、特に対応
する分割は行なわない。このような分割を行なうこと
で、確実にストロークを抽出するような、分割を行なう
ことができる。When attention is paid to one stroke of the character pattern, since a boundary line with a white pixel appears on both sides of the stroke, for example, the stroke is opposite to the dividing position set by the projection value of 1201 and the stroke. Side split position is 12
02 must be present. Therefore, the division position is 1
If one is obtained, the division position is “left value <right value”
If it is a division position obtained from the projection value (1201) of
From the projection value (1202) of “left value> right value” in the range allowable as a stroke width on the right side of the division position found in 1201, a local maximum point is found in this range, and this is found. It is a division position. Similarly, if it is found in the projection value (1202) of “left value> right value”, “left value <right value” of the range allowable as a stroke width to the left of the found position is used. A local maximum point is found from the projection values (1201), and is set as a division position. In any case, if the corresponding division position is not found, the corresponding division is not performed. By performing such a division, the division can be performed such that the stroke is reliably extracted.
【0066】1105:分割位置のソートでは、110
4で得た分割位置を、位置の順に並ぶように並びかえ
る。図16に、図15の分割位置をソートした状態を示
す。1105: 110 in sorting the division position
The division positions obtained in step 4 are rearranged so as to be arranged in the order of the positions. FIG. 16 shows a state where the division positions in FIG. 15 are sorted.
【0067】1106:補間分割では、1104で、分
割数が足りない場合、1105で設定した分割位置の間
を、全体で一定の分割数になるよう、さらに分割する。1106: In the interpolation division, in 1104, if the number of divisions is not enough, the division between the division positions set in 1105 is further divided so that the total number of divisions is constant.
【0068】補間分割の詳しい内容を以下に述べる。The details of the interpolation division will be described below.
【0069】図17に、極大点によるメッシュ分割位置
と均等分割位置の対応付けの例を示す。 FIG . 17 shows a mesh division position based on the maximum point.
5 shows an example of the correspondence between and equal division positions.
【0070】図17(a)の場合は、1対1に対応して
いるが、図17(b)は、1対2に対応する位置があ
る。In the case of FIG. 17A, there is a one-to-one correspondence, but in FIG. 17B, there is a position corresponding to one-to-two.
【0071】図17(c)に、図17(b)のように、
1対2(あるいはそれ以上)に対応する位置がある場合
に、全体として最もずれが少なくなるように、1対1に
対応づけた状態を示す。As shown in FIG. 17C, as shown in FIG.
In the case where there is a position corresponding to one to two (or more), a state in which one-to-one correspondence is provided so as to minimize the deviation as a whole.
【0072】このように、単純に、最も近い位置との対
応をとるだけでは、だめな場合があり、全体としてのず
れが、最小になるような対応を見つけるのが本方式であ
る。As described above, simply taking the correspondence with the closest position may not be enough, and the present method is to find a correspondence that minimizes the deviation as a whole.
【0073】図18は、図17(c)のマッピングの結
果をもとに、分割数を一定にするために加える分割位置
を示したもの。このように、ストロークに適応した分割
位置と均等分割の分割位置と対応づけることで、元の文
字パターンからの変形をできるだけ防ぐようにメッシュ
分割位置を決定する。FIG. 18 shows division positions added to keep the number of divisions constant based on the mapping result of FIG. 17C. In this manner, by associating the division position adapted to the stroke with the division position of the equal division, the mesh division position is determined so as to prevent deformation from the original character pattern as much as possible.
【0074】図19と図20に、全体としてのずれが最
小になるような対応を求めるために用いるテーブルを示
す。FIG. 19 and FIG. 20 show tables used for obtaining a correspondence that minimizes the deviation as a whole.
【0075】図19及び図20に示すメッシュ分割位置
の値は、図8に示した文字パターンのものとは異なる。
48画素×48画素の文字パターンに対して、上記の特
徴量抽出及び差分投影値の極大点抽出を行なった場合に
得られた分割位置の例を示している。ここでは、0、1
1、12、23、26,33、36、41、43、48
が、差分投影値の極大点抽出により得られた分割位置と
している。また、48画素の文字パターンをメッシュ分
割することから、16等分割位置は、0,3,6,9、
‥‥、48となる。図19のマトリクスで示した位置ず
れ量には、極大点を用いて得られた分割位置と分割対象
の文字パターンを画素数のメッシュ分割数で切り分けた
位置(16等分割位置)との差分値(差の絶対値)を求
めて格納する。例えば、1901に示した“1”という
値は、1902の“11”という値と、1903の“1
2”という値の差分値である。 The mesh division positions shown in FIGS. 19 and 20
Are different from those of the character pattern shown in FIG.
The above characteristics are applied to the character pattern of 48 pixels x 48 pixels.
In the case of extracting the amount of collection and extracting the maximum point of the difference projection value
The example of the obtained division | segmentation position is shown. Here, 0, 1
1, 12, 23, 26, 33, 36, 41, 43, 48
Is the division position obtained by extracting the maximum point of the difference projection value,
are doing. Also, the character pattern of 48 pixels is divided into meshes.
From the division, 16 equal division positions are 0, 3, 6, 9,
‥‥, 48. The position shown in the matrix of FIG.
For the amount of deviation, the division position obtained using the maximum point and the division target
Character pattern was divided by the number of mesh divisions of the number of pixels
Find the difference value (absolute value of difference) from the position (16 equally divided positions)
And store it. For example, "1" shown in 1901
The value is “11” in 1902 and “1” in 1903.
2 ”.
【0076】この際、両端は固定であることと、順序関
係は一定であることと、1対1の対応しか許されないこ
とから、図中の斜線で示した位置が示す対応は許されな
い。At this time, since both ends are fixed, the order relation is fixed, and only one-to-one correspondence is allowed, the correspondence indicated by the hatched position in the figure is not allowed.
【0077】図20に示した、DPによる均等分割位置
との対応づけでは、図19の表の左側の列から順に、D
Pを用いて、最もずれの小さくなる対応を見つける。In association with the equal division position by DP shown in FIG. 20, D
Using P, find the correspondence with the smallest deviation.
【0078】この対応を見つける際、次の条件を満たさ
なければならない。In finding this correspondence, the following conditions must be met:
【0079】(a)対応は1対1。 (b)順序関係は変わらない。(A) Correspondence is one-to-one. (B) The order relation does not change.
【0080】図19のマトリクスの左下を、原点(0,
0)として、横方向の位置をx,縦方向の位置をyとす
る。(x,y)の位置の値は、それぞれの分割位置、f
(x)と、g(y)の差となる。したがって、(x,
y)の位置の値を、C(x,y)とすると、C(x,
y)の値は、数2で表わされる値となる。The lower left of the matrix in FIG.
0), the horizontal position is x, and the vertical position is y. The value of the position of (x, y) is the division position, f
(X) and g (y). Therefore, (x,
Assuming that the value of the position of y) is C (x, y), C (x, y)
The value of y) is a value represented by Expression 2.
【0081】[0081]
【数2】 (Equation 2)
【0082】このC(x,y)は、ずれの大きさをあら
わすので、全体として最もずれを小さくするためには、
トータルでC(x,y)の累積値が最も小さくなるよう
な対応を、全てのxについて、上記条件を満たしながら
決めなければならない。Since C (x, y) represents the magnitude of the deviation, in order to minimize the deviation as a whole,
A measure that minimizes the cumulative value of C (x, y) in total must be determined for all x while satisfying the above conditions.
【0083】T(x,y)は、(x,y)の位置までの
ずれの累積値を示す。マトリクスのxの値を0≦x≦
m、yの値を0≦y≦nとする。T(x,y)を求める
ための漸化式を数3に示す。T (x, y) indicates the accumulated value of the deviation up to the position (x, y). Set the value of x in the matrix to 0 ≦ x ≦
The values of m and y are set to 0 ≦ y ≦ n. Equation 3 shows a recurrence formula for obtaining T (x, y).
【0084】[0084]
【数3】 (Equation 3)
【0085】図20は、上記漸化式のT(m,n)を、
DPにより解いた結果の対応づけを示す。表中の値は、
左から順に、上記条件を満たしながらその位置までのず
れの累積値の最小値を示す。〇印は、全体として最もず
れが小さくなるような対応を示す。また、各値から左下
に伸びている線は、1つ左の列中で上記条件を満たし、
最も小さい累積値を指している。つまり、数3のx≧2
の場合のminで選ばれた位置を示す。このように、図
19から、図20を作成し、これにより累積のずれが最
小になる様な対応づけを設定する。FIG. 20 shows T (m, n) of the above recurrence formula as
The association of the result solved by DP is shown. The values in the table are
In order from the left, the minimum value of the accumulated value of the deviation to the position while satisfying the above condition is shown. The mark “〇” indicates that the deviation is minimized as a whole. In addition, a line extending to the lower left from each value satisfies the above condition in the left column,
It points to the smallest cumulative value. That is, x ≧ 2 in Equation 3
Shows the position selected by min in the case of. In this way, FIG. 20 is created from FIG. 19, and the correspondence is set so that the cumulative deviation is minimized.
【0086】図21は、図20から得た、各分割位置と
均等分割位置との対応関係を示す。FIG. 21 shows the correspondence between each division position and the equal division position obtained from FIG.
【0087】図22と図23に、対応位置をずらして、
全体として、最もずれを小さくするための均等分割位置
との対応設定方式の処理フローチャートを示す。両端は
固定であり、1≦x≦m−1の範囲の対応を求める。The corresponding positions are shifted between FIG. 22 and FIG.
As a whole, a processing flowchart of a method of setting a correspondence with an equal division position for minimizing a deviation is shown. Both ends are fixed, and a correspondence in a range of 1 ≦ x ≦ m−1 is obtained.
【0088】2201:ずれの大きさを図19のマトリ
クスに書き込むためのループのカウンタxの初期値(x
=1)を設定する。2201: The initial value (x of the counter x of the loop for writing the magnitude of the deviation in the matrix of FIG. 19)
= 1) is set.
【0089】2202:x≦m−1を満たすかどうか、
xの値のチェックを行う。2202: Whether or not x ≦ m−1 is satisfied;
Check the value of x.
【0090】2203:カウンタyの初期値(y=x)
を設定する。2203: Initial value of counter y (y = x)
Set.
【0091】2204:y≦x+n−mを満たすかどう
か、yの値のチェックする。2204: Check the value of y to see if y ≦ x + nm is satisfied.
【0092】2205:ずれの大きさを計算。C(x,
y)=|f(x)−g(y)| 2206:yをインクリメント。y=y+1; 2207:xをインクリメント。x=x+1; 2208:トータルのずれ量の計算のための初期値設
定。2205: The size of the deviation is calculated. C (x,
y) = | f (x) -g (y) | 2206: Increment y. y = y + 1; 2207: x is incremented. x = x + 1; 2208: Initial value setting for calculating the total shift amount.
【0093】 T(1,y)=C(1,y)(1≦y≦1+n−m) 2209:トータルのずれ量を計算するための、ループ
のカウンタxの初期値を設定する。x=2; 2210:xの値のチェックを行なう。x≦m−1; 2211:カウンタyの初期値を設定する。y=x; 2212:yの値のチェックを行なう。y≦x+n−
m; 2213:x−1≦z≦y−1の範囲のzのうちで、T
(x−1,z)が最小となるzをZとする。T (1, y) = C (1, y) (1 ≦ y ≦ 1 + nm) 2209: An initial value of a loop counter x for calculating a total shift amount is set. x = 2; 2210: Check the value of x. x ≦ m−1; 2211: Initial value of counter y is set. y = x; 2212: Check the value of y. y ≦ x + n−
m; 2213: Among z in the range of x−1 ≦ z ≦ y−1, T
Let z be the minimum at which (x-1, z) is the minimum.
【0094】2214:F(x,y)に、Zを書き込
む。2214: Z is written to F (x, y).
【0095】 T(x,y)=T(x−1,Z)+C(x,y)。T (x, y) = T (x−1, Z) + C (x, y).
【0096】2215:yをインクリメント。y=y+
1; 2216:xをインクリメント。x=x+1; 2217:カウンタxに、初期値代入。x=m−1; 2218:m−1≦z≦n−1の範囲のzのうちで、T
(m−1,z)が最小になるzをZとする。2215: y is incremented. y = y +
1: 2216: x is incremented. x = x + 1; 2217: Substituting an initial value for the counter x. x = m-1; 2218: Among z in the range of m-1 ≦ z ≦ n−1, T
Let z be the minimum at which (m-1, z) is the minimum.
【0097】2219:均等分割との対応テーブルM
(m−1)に、Zを格納。2219: Correspondence table M with equal division
Z is stored in (m-1).
【0098】M(m−1)=Z; 2220:zに初期値Zを代入する。M (m-1) = Z; 2220: The initial value Z is substituted for z.
【0099】2221:xの値のチェックを行なう。x
>1; 2222:F(x,y)の値を見て、1つ左の分割位置
について、均等分割位置との対応を求める。z=F
(x,z); 2223:xをデクリメント。x=x−1; 2224:均等分割との対応テーブルM(x)に、zを
格納。M(x)=z;以上により、すべての、極大点に
よる分割位置の、均等分割位置との対応関係が得られ
る。2221: The value of x is checked. x
>1; 2222: Look at the value of F (x, y) and find the correspondence between the left-hand division position and the equal division position. z = F
(X, z); 2223: decrement x. x = x−1; 2224: z is stored in the table M (x) corresponding to the equal division. M (x) = z; As described above, a correspondence relationship between all the division positions by the maximum point and the equal division positions is obtained.
【0100】以上の処理により、縦方向性特徴について
は横方向の分割位置、横方向性特徴については縦方向の
分割位置が求められる。さらに、縦方向性特徴について
は、縦方向に均等な分割、横方向性特徴については、横
方向に均等な分割を行なうことで、各特徴ごとの縦方
向、横方向のメッシュ分割位置が得られる。このように
して得られた各メッシュ毎に、メッシュ内の画素の特徴
量の平均値を求める。このようにして得られた特徴量を
もとに、マターンマッチングを行なうが、認識対象が印
刷文字である場合、文字を構成するストロークの方向に
それほど変動は無い。従って、ずらしを、ライン単位に
行なうことで、ずらしマッチングによるコストの増大を
押さえている。 By the above processing, the vertical direction feature
Indicates the horizontal division position, and the vertical
A division position is determined. In addition, for longitudinal features
Is divided equally in the vertical direction.
By performing equal division in the direction, the vertical direction of each feature
The horizontal and vertical mesh division positions are obtained. in this way
Of each pixel in the mesh
Determine the average of the quantities. The pattern matching is performed based on the feature amounts obtained in this manner. When the recognition target is a print character, the direction of the stroke constituting the character does not change much. Therefore, the shift is performed in units of lines, thereby suppressing an increase in cost due to the shift matching.
【0101】文字パターン全体のマッチングを行なうた
めには、端のライン上の特徴量は、必ずマッチング対象
の同一の位置の特徴とマッチングしなければならない、
という制約が生じる。しかし、図24に示したように、
元の文字パターンによっては、ストロークが端のライン
に現れる場合と、現れない場合がある。2301の文字
パターンからは、一番上のラインにストロークが現われ
る2302の特徴が得られるが、2303の文字パター
ンからは、一番上のラインにストロークが現われない、
2304の特徴が得られる。このため、正しくマッチン
グできない場合がある。In order to match the entire character pattern, the feature values on the end lines must always match the features at the same position to be matched.
Is created. However, as shown in FIG.
Depending on the original character pattern, the stroke may or may not appear at the end line. The character pattern 2301 has the characteristic 2302 in which a stroke appears on the top line. However, the character pattern 2303 does not show a stroke in the top line.
2304 features are obtained. For this reason, correct matching may not be possible.
【0102】このような問題を解決するため、図25に
示したように、特徴量の端のラインの外側に、1ライン
分、特徴量0のラインが存在すると仮定して、マッチン
グを行なう。これにより、上記の制約を満たしながら、
正しいマッチングが可能となる。In order to solve such a problem, as shown in FIG. 25, matching is performed on the assumption that one line of feature amount 0 exists outside the end line of the feature amount. Thus, while satisfying the above constraints,
Correct matching becomes possible.
【0103】本実施例では、DPマッチングによるずら
しマッチングを行なっている。文字パターンのマッチン
グの特性から、 (a)左右の順序関係は、入れ替わってはならない。 (b)文字の線幅が異なる場合があるので、マッチング
は1対多も認める。 (c)マッチング漏れの文字線がないように、すべての
特徴量を対応させなければならない。 という、3つの条件を満たしながらの、マッチングにな
る。In this embodiment, shift matching by DP matching is performed. From the characteristics of character pattern matching: (a) The left-right order relationship must not be interchanged. (B) Since the line widths of characters may be different, one-to-many matching is allowed. (C) All features must be associated so that there is no character line that is left out of matching. Matching while satisfying the three conditions.
【0104】図2は、DPマッチングの原理を示す。各
点が、それぞれのラインの対応で生じる特徴量の差によ
り得られるマッチングのコスト値になっている。図の左
下と右上をつなぐ経路の通る各点のコストの合計値が、
最小となるような経路を求め、このコスト値をパターン
マッチングのマッチングコストとする。FIG. 2 shows the principle of DP matching. Each point is a matching cost value obtained by a difference in the feature amount generated by the correspondence of each line. The total cost of each point along the path connecting the lower left and upper right of the figure is
A path that minimizes the path is determined, and this cost value is used as the matching cost for pattern matching.
【0105】上記の条件(a),(b),(c)を満た
すために、経路は、図に示した上、右、右上しか許され
ない。In order to satisfy the above conditions (a), (b) and (c), only the right and upper right paths are allowed as shown in the figure.
【0106】図26は、文字の2次元的なストロークの
位置ずれを、1方向のみのずらしで吸収する原理を示し
たもの。このように、方向成分を抽出した上で、各々で
は、一方向のみにずらしを行なうことで、2次元方向の
ずらしを行なうことによる、処理時間の2次元的な増大
を押さえ、ずらしの許容度を広げることを可能としてい
る。FIG. 26 shows the principle of absorbing the displacement of a two-dimensional stroke of a character by shifting in only one direction. As described above, after extracting the directional component, each shift is performed in only one direction, thereby suppressing a two-dimensional increase in processing time due to shifting in the two-dimensional direction, and allowing the shift. It is possible to spread.
【0107】図27は、マッチング方式のフローチャー
ト。ここでは、M×Nにメッシュ分割して得られた特徴
を、縦方向の1ライン分のメッシュ単位に、横方向のみ
にPメッシュ分まで許容して、ずらす場合を示す。この
場合、Mは、ずらし方向のライン数。Nは、1ライン中
の特徴数となる。先に示したように、マッチングの際
に、両端に特徴量0のメッシュのラインをつけるので、
実際にマッチングの対象となるライン数は、M+2とな
る。以下の説明ではMが16の場合を示す。FIG. 27 is a flowchart of the matching method. Here, a case is shown in which the features obtained by dividing the mesh into M × N are shifted in units of one vertical line of meshes up to P meshes only in the horizontal direction. In this case, M is the number of lines in the shifting direction. N is the number of features in one line. As described above, at the time of matching, mesh lines with feature amount 0 are attached to both ends, so that
The number of lines to be actually matched is M + 2. The following description shows a case where M is 16.
【0108】2601:コスト値計算を行なう。2601: Perform cost value calculation.
【0109】C(x,y)に、認識対象側xラインと,
辞書側yラインの対応を行なったときのマッチングコス
トを入れる。In C (x, y), an x line on the recognition target side,
The matching cost when the dictionary side y line is handled is entered.
【0110】各点のマッチングのコスト値は、次のよう
に求められる。The matching cost value of each point is obtained as follows.
【0111】例えば、図2の、201の位置に示された
コスト値は、x側が6で、y側が7なので、202のパ
ターンの6番のラインの特徴量の上から順に、取り出
す。これと、203のパターンの7番のラインの左から
順に取り出した特徴量と差分の絶対値の合計値を求め、
これをC(6,7)の値とする。For example, the cost value shown at the position 201 in FIG. 2 is 6 on the x side and 7 on the y side, and is extracted in order from the top of the feature amount of the 6th line of the pattern of 202. Then, the total value of the feature value and the absolute value of the difference extracted in order from the left of the seventh line of the pattern 203 is obtained,
This is set as the value of C (6, 7).
【0112】したがって、x軸側の文字パターンの2次
元で表される特徴量を、 A(x,i)(0≦i≦N−1) y軸側の文字パターンの2次元で表される特徴量を、 B(y,j)(0≦j≦N−1)(図2では、x,yが
入れ替わっている) とすると、C(x,y)は、次の式で得られる。Therefore, the feature represented by the two-dimensional character pattern on the x-axis side is represented by A (x, i) (0 ≦ i ≦ N−1) in the two-dimensional character pattern on the y-axis side. Assuming that the feature quantity is B (y, j) (0 ≦ j ≦ N−1) (in FIG. 2, x and y are interchanged), C (x, y) is obtained by the following equation.
【0113】[0113]
【数4】 (Equation 4)
【0114】2602:DPマッチングの初期値設定。2602: Initial value setting for DP matching.
【0115】[0115]
【数5】 (Equation 5)
【0116】2603:ループカウンタxの初期化 x=0 2604:DPマッチングの値の更新(2<=x<=1
5)2603: Initialization of loop counter x x = 0 2604: Update of DP matching value (2 <= x <= 1)
5)
【0117】[0117]
【数6】 (Equation 6)
【0118】2605:カウンタインクリメント x=x+1 2606:ループチェック x<=17 2607:マッチング結果(最小値M)計算2605: counter increment x = x + 1 2606: loop check x <= 17 2607: calculation of matching result (minimum value M)
【0119】[0119]
【数7】 (Equation 7)
【0120】以上の、特徴抽出、マッチングにより得ら
れたコスト値をソートして、文字認識結果とする。The cost values obtained by the above-described feature extraction and matching are sorted to obtain character recognition results.
【0121】ところで、漢字には、偏と作り、あるい
は、冠と足からできているものが存在する。偏と作りか
らできている文字の横方向のストロークの位置関係は、
偏と作りで必ずしも一定とは限らない。同様に、冠と足
からできている文字の、縦方向のストロークの位置関係
も、一定とは限らない。このため、文字パターンを半
分、あるいは、4つに分割して、それぞれのパターンに
ついて、上記方式によるメッシュ分割を行ない、特徴量
を抽出することで、このような、ずれに対処することが
できる。横方向性特徴を文字パターンから、求めたあ
と、これを、左右に2分割してメッシュ分割、マッチン
グする処理内容を、図28に示す。By the way, some kanjis are made from biased characters or from crowns and feet. The positional relationship of the horizontal stroke of the character made from bias and creation is
It is not always the same depending on the bias and construction. Similarly, the positional relationship of vertical strokes of a character made of a crown and a foot is not always constant. For this reason, the character pattern can be divided into half or four, and each pattern can be divided into meshes by the above-described method to extract a feature amount. FIG. 28 shows the contents of processing in which a horizontal direction feature is obtained from a character pattern and then divided into two parts, ie, left and right, mesh division and matching.
【0122】2701:方向性特徴抽出で、縦方向の特
徴抽出を行なう。2701: In the directional feature extraction, vertical feature extraction is performed.
【0123】2702:方向性特徴を抽出した文字パタ
ーンのデータを左右に2分割する。2702: The character pattern data from which the directional feature is extracted is divided into two parts, left and right.
【0124】2703:分割したそれぞれについて、分
割しない場合と同様な、メッシュ分割を行なう。2703: For each of the divisions, the same mesh division is performed as in the case where no division is performed.
【0125】2704:分割したそれぞれについて、ず
らしマッチングを行ない、それぞれのコストの合計値に
よって認識結果とする。2704: Shift matching is performed for each of the divided parts, and a recognition result is obtained based on the total value of the respective costs.
【0126】[0126]
【発明の効果】本発明の認識方法によれば、パターンマ
ッチングの特徴数を正規化するためのメッシュ分割を行
なうとき、分割による特徴量のぼけを防ぎ、ずらしマッ
チングに適した特徴量を得ることができる。また、ずら
しマッチングにより文字の2次元的なずれを吸収しなが
ら、ずらし量の許容度の増加による処理時間の増大を1
次元的な増加に押さえることができる。According to the recognition method of the present invention, when performing mesh division for normalizing the number of features in pattern matching, blurring of the features due to the division is prevented, and a feature suitable for shifted matching is obtained. Can be. Further, while absorbing the two-dimensional displacement of the character by the displacement matching, the increase in the processing time due to the increase in the tolerance of the displacement amount is reduced by one.
It can be suppressed to a dimensional increase.
【図1】本発明の文字認識方法の概略説明図。FIG. 1 is a schematic explanatory diagram of a character recognition method of the present invention.
【図2】DPマッチングの原理説明図。FIG. 2 is a diagram illustrating the principle of DP matching.
【図3】実施例の文字認識装置のシステム構成ブロック
図。FIG. 3 is a system configuration block diagram of the character recognition device of the embodiment.
【図4】文字認識の処理内容のブロック図。FIG. 4 is a block diagram of processing contents of character recognition.
【図5】実施例の文字認識装置の処理フローチャート。FIG. 5 is a processing flowchart of the character recognition device of the embodiment.
【図6】文字認識処理のフローチャート。FIG. 6 is a flowchart of a character recognition process.
【図7】特徴抽出処理のフローチャート。FIG. 7 is a flowchart of a feature extraction process.
【図8】文字パターンの特徴抽出用メモリへの格納状態
を示す図。FIG. 8 is a diagram showing a storage state of a character pattern in a feature extraction memory.
【図9】文字データの各方向のラン長格納状態を示す
図。FIG. 9 is a diagram showing a run length storage state of character data in each direction.
【図10】文字データの各画素の画素方向性特徴量格納
状態を示す図。FIG. 10 is a view showing a pixel directional feature amount storage state of each pixel of character data.
【図11】メッシュ分割方式フローチャート。FIG. 11 is a flowchart of a mesh division method.
【図12】画素特徴量の差分値の格納状態を示す図。FIG. 12 is a diagram illustrating a storage state of a difference value of a pixel feature amount.
【図13】画素特徴量の差分値の極大点の抽出結果を示
図。FIG. 13 is a diagram showing a result of extracting a maximum point of a difference value of a pixel feature amount.
【図14】画素特徴量の差分値の極大値のソート結果を
示す図。FIG. 14 is a view showing a sorting result of local maximum values of difference values of pixel feature amounts.
【図15】画素特徴量の差分値の極大点による、メッシ
ュ分割候補位置の設定を示す図。FIG. 15 is a diagram illustrating setting of mesh division candidate positions based on the local maximum point of the difference value of the pixel feature amount.
【図16】極大点によるメッシュ分割位置のソート結果
を示す図。FIG. 16 is a diagram showing a result of sorting mesh division positions by local maximum points.
【図17】極大点によるメッシュ分割位置と均等分割位
置の対応付けの例を示す図。FIG. 17 is a diagram showing an example of correspondence between a mesh division position and an equal division position by a maximum point.
【図18】補間分割位置の設定状態を示す図。FIG. 18 is a diagram showing a setting state of an interpolation division position.
【図19】分割位置の対応のずれ量を示すマトリクス
図。FIG. 19 is a matrix diagram showing a corresponding shift amount of a division position.
【図20】DPによる分割位置のずれ量を最小にする対
応付けを示す図。FIG. 20 is a diagram showing an association for minimizing a shift amount of a division position due to DP.
【図21】DPにより設定されたずれ量を最小にする対
応付けを示す図。FIG. 21 is a diagram showing an association for minimizing a shift amount set by a DP.
【図22】極大点と均等分割位置の対応を求めるための
処理のフローチャート(その1)。FIG. 22 is a flowchart (part 1) of a process for obtaining a correspondence between a local maximum point and an equal division position.
【図23】極大点と均等分割位置の対応を求めるための
処理のフローチャート。(その2)FIG. 23 is a flowchart of a process for obtaining a correspondence between a local maximum point and an equal division position. (Part 2)
【図24】文字パターンの変動による端のラインのメッ
シュの特徴の変化を示す図。FIG. 24 is a diagram showing a change in a feature of a mesh of an end line due to a change in a character pattern.
【図25】文字パターンの端の変動を吸収するための値
0の特徴量ラインの追加を示す図。FIG. 25 is a diagram showing the addition of a feature amount line having a value of 0 for absorbing a change in the end of a character pattern.
【図26】擬似的2次元DPマッチングの原理を示す
図。FIG. 26 is a diagram showing the principle of pseudo two-dimensional DP matching.
【図27】DPマッチング方式のフローチャート。FIG. 27 is a flowchart of a DP matching method.
【図28】2分割マッチングの処理内容のフローチャー
ト。FIG. 28 is a flowchart of a process of two-division matching.
301…スキャナ、302…スキャナコントローラ、3
03…ディスク、304…ディスクコントローラ、30
5…メインメモリ、306…CPU、307…ディスプ
レイ/キーボードコントローラ、308…メモリ(ビデ
オメモリ)、309…ディスプレイ、310…キーボー
ド、311…システムバス、401…画像読み出し部、
402…画像データ格納メモリ、403…書式解析結果
格納メモリ、404…画素特徴量格納メモリ、405…
画素特徴抽出部、406…メッシュ分割部、407…メ
ッシュ分割位置格納メモリ、408…メッシュ特徴量抽
出部、409…メッシュ特徴量格納メモリ、410…パ
ターンマッチング部、411…特徴量辞書格納メモリ、
412…マッチング評価値格納メモリ、413…ソート
部。301: scanner, 302: scanner controller, 3
03 ... disk, 304 ... disk controller, 30
5 main memory, 306 CPU, 307 display / keyboard controller, 308 memory (video memory), 309 display, 310 keyboard, 311 system bus, 401 image reading unit,
402: image data storage memory, 403: format analysis result storage memory, 404: pixel feature amount storage memory, 405 ...
Pixel feature extraction unit, 406: mesh division unit, 407: mesh division position storage memory, 408: mesh feature amount extraction unit, 409: mesh feature amount storage memory, 410: pattern matching unit, 411: feature amount dictionary storage memory,
412: matching evaluation value storage memory; 413: sorting unit.
───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平4−590(JP,A) 特開 平3−46080(JP,A) 特開 平2−287894(JP,A) 特開 昭63−113690(JP,A) 特開 昭58−123171(JP,A) 「情報処理学会 第45回(平成4年後 期)全国大会 講演論文集(2)」2G −1 p.273−274(1992) ”黒画素方向性特徴のずらしマッチン グによる印刷文字認識方式の開発”「電 子通信学会論文誌」Vol.J68−D No.1 p.56−63(1985) ”動的 方向性整合法による手書き漢字認識" (58)調査した分野(Int.Cl.7,DB名) G06K 9/62 JICSTファイル(JOIS)────────────────────────────────────────────────── ─── Continuation of the front page (56) References JP-A-4-590 (JP, A) JP-A-3-46080 (JP, A) JP-A-2-287894 (JP, A) JP-A-63-1988 113690 (JP, A) JP-A-58-123171 (JP, A) "Information Processing Society of Japan 45th (late 1991) National Convention Lecture Paper Collection (2)" 2G-1 p. 273-274 (1992) "Development of a printed character recognition method by shifting matching of black pixel directional features", "Transactions of the Institute of Electronics and Communication Engineers", Vol. J68-D No. 1 p. 56-63 (1985) "Handwritten Kanji Recognition by Dynamic Directional Matching Method" (58) Fields investigated (Int. Cl. 7 , DB name) G06K 9/62 JICST file (JOIS)
Claims (2)
て、画素ごとの特徴量を求め、隣り合う画素の方向性画
素特徴量の差分値を求め、方向性と同じ方向に射影した
投影値の極大となる位置に基づいてメッシュ分割位置を
決定し、上記文字パターンを前記分割位置においてメッ
シュ領域に分割し、それぞれのメッシュ中に含まれる画
素の特徴量に基づいて各メッシュごとの特徴を求めて文
字を認識する文字認識方法において、 文字を構成するストロークの方向性に関する特徴量を所
定方向に連続した文字パターンの画素の数に基づいて各
画素毎に各方向毎に求め、各方向性特徴量をストローク
が含まれる1ラインごとにまとめ、そのラインに対し垂
直な1方向に限定した、ずらしマッチングを行なうこと
を特徴とする文字認識方法。1. A method for obtaining a feature amount for each pixel from a character pattern represented by a binary image, and obtaining a directional image of adjacent pixels.
Find the difference value of elementary feature quantity and project in the same direction as the directionality
The mesh division position is determined based on the position where the projection value is maximum.
Determined, the character pattern is divided into message <br/> shoe area at the dividing position, recognizing a character recognizing characters in search of features for each mesh based on the feature quantity of the pixels included in each mesh In the method, the feature quantity relating to the directionality of the strokes constituting the character is specified.
Each is based on the number of pixels in the character pattern
A character recognition method characterized by determining for each direction for each pixel , grouping each directional feature amount for each line including a stroke, and performing shift matching limited to one direction perpendicular to the line.
て、画素ごとの特徴量を求め、隣り合う画素の方向性画
素特徴量の差分値を求め、方向性と同じ方向に射影した
投影値の極大となる位置に基づいてメッシュ分割位置を
決定し、上記文字パターンを前記分割位置においてメッ
シュ領域に分割し、それぞれのメッシュ中に含まれる画
素の特徴量に基づいて各メッシュごとの特徴を求めて文
字を認識する文字認識装置において、 文字を構成するストロークの方向性に関する特徴量を所
定方向に連続した文字パターンの画素の数に基づいて各
画素毎に各方向毎に求める算出手段と、各方向性特徴量
をストロークが含まれる1ラインごとにまとめ、そのラ
インに対し垂直な1方向に限定した、ずらしマッチング
を行なうずらしマッチング手段とを備えたことを特徴と
する文字認識装置。2. The method according to claim 1, wherein a characteristic amount of each pixel is obtained for a character pattern represented by a binary image, and a directional image of adjacent pixels is obtained.
Find the difference value of elementary feature quantity and project in the same direction as the directionality
The mesh division position is determined based on the position where the projection value is maximum.
Determined, the character pattern is divided into message <br/> shoe area at the dividing position, recognizing a character recognizing characters in search of features for each mesh based on the feature quantity of the pixels included in each mesh in the apparatus, own the feature quantity related to the direction of the strokes constituting the character
Each is based on the number of pixels in the character pattern
A calculating means for obtaining for each direction for each pixel; and a shift matching means for performing shift matching, which collects each directional feature amount for each line including a stroke and limits the direction to one direction perpendicular to the line. A character recognition device.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP05130592A JP3196291B2 (en) | 1992-03-10 | 1992-03-10 | Character recognition method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP05130592A JP3196291B2 (en) | 1992-03-10 | 1992-03-10 | Character recognition method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH05250518A JPH05250518A (en) | 1993-09-28 |
| JP3196291B2 true JP3196291B2 (en) | 2001-08-06 |
Family
ID=12883211
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP05130592A Expired - Fee Related JP3196291B2 (en) | 1992-03-10 | 1992-03-10 | Character recognition method and device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3196291B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6154627B2 (en) * | 2013-03-11 | 2017-06-28 | 伸彦 井戸 | Association method between feature point sets, association device, and association program |
| CN113591855B (en) * | 2021-08-18 | 2023-07-04 | 易思维(杭州)科技有限公司 | Adhesive VIN code segmentation method |
-
1992
- 1992-03-10 JP JP05130592A patent/JP3196291B2/en not_active Expired - Fee Related
Non-Patent Citations (2)
| Title |
|---|
| "黒画素方向性特徴のずらしマッチングによる印刷文字認識方式の開発"「電子通信学会論文誌」Vol.J68−D No.1 p.56−63(1985) "動的方向性整合法による手書き漢字認識" |
| 「情報処理学会 第45回(平成4年後期)全国大会 講演論文集(2)」2G−1 p.273−274(1992) |
Also Published As
| Publication number | Publication date |
|---|---|
| JPH05250518A (en) | 1993-09-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4408342A (en) | Method for recognizing a machine encoded character | |
| US6327384B1 (en) | Character recognition apparatus and method for recognizing characters | |
| CN115619656B (en) | Digital Archive Correction Methods and Systems | |
| JPH0256708B2 (en) | ||
| US5228095A (en) | Apparatus for recognizing printed characters | |
| JP3196291B2 (en) | Character recognition method and device | |
| US5307424A (en) | Character recognition system | |
| JP3172498B2 (en) | Image recognition feature value extraction method and apparatus, storage medium for storing image analysis program | |
| JP3476595B2 (en) | Image area division method and image binarization method | |
| JP2000076378A (en) | Character recognizing method | |
| JPH01129358A (en) | table numerical calculation device | |
| JP2803709B2 (en) | Character recognition device and character recognition method | |
| JP3095470B2 (en) | Character recognition device | |
| JP2005141458A (en) | Image processing method and apparatus, program, and recording medium | |
| JP3661774B2 (en) | Character string recognition method, character recognition device and program | |
| JP2003317107A (en) | Ruled line extraction method and apparatus | |
| JPH0728939A (en) | Table vectorizer | |
| JP2918363B2 (en) | Character classification method and character recognition device | |
| JP2616994B2 (en) | Feature extraction device | |
| JP2993533B2 (en) | Information processing device and character recognition device | |
| JP2755299B2 (en) | Image processing method | |
| CN121686481A (en) | Newspaper layout text block detection and identification system based on scanning | |
| KR930008060B1 (en) | Document Recognition Method | |
| JPH0656625B2 (en) | Feature extraction method | |
| JP2954218B2 (en) | Image processing method and apparatus |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |