JPH0795331B2 - Character cutting device - Google Patents
Character cutting deviceInfo
- Publication number
- JPH0795331B2 JPH0795331B2 JP60263376A JP26337685A JPH0795331B2 JP H0795331 B2 JPH0795331 B2 JP H0795331B2 JP 60263376 A JP60263376 A JP 60263376A JP 26337685 A JP26337685 A JP 26337685A JP H0795331 B2 JPH0795331 B2 JP H0795331B2
- Authority
- JP
- Japan
- Prior art keywords
- character
- scanning
- detected
- pattern
- column
- 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 - Lifetime
Links
Landscapes
- Character Input (AREA)
Description
【発明の詳細な説明】 (産業上の利用分野) 本発明は、文字切出し装置に関し、更に詳細には帳票に
記入された文字を読取り、読取った文字に基づく文字パ
タン列を1文字領域毎に分離して抽出する文字切出し装
置に関する。TECHNICAL FIELD The present invention relates to a character cutting device, and more specifically, it reads characters written on a form, and a character pattern string based on the read characters is read for each character area. The present invention relates to a character cutting device that separates and extracts.
(従来の技術) 光学式文字認識装置(以下、OCRと略す)においては帳
票に記入された文字を行毎に走査し、光信号を光電変換
器により画像信号に変換し、ラインバッファに格納す
る。そのラインバッファを順次読み出し文字パタン列を
1文字領域毎に分離し、その分離された文字パタンによ
り認識を行っているので、文字パタン列の中から1文字
領域を抽出する文字切出し法はOCRの性能に大きく影響
する。(Prior Art) In an optical character recognition device (hereinafter abbreviated as OCR), characters written on a form are scanned line by line, an optical signal is converted into an image signal by a photoelectric converter, and stored in a line buffer. . The line buffer is sequentially read out and the character pattern string is separated for each character area, and recognition is performed by the separated character pattern. Therefore, the character segmentation method for extracting one character area from the character pattern string is OCR. It greatly affects the performance.
OCRにおいて、文字列が格納されているラインバッファ
の上端から下端に向って1列走査し、この走査と直角な
方向に順次列を移動することにより、ラインバッファの
文字パタンの読出しを行う。また、1列の走査中に黒点
(文字部分を黒点、背景部分を白点)を計数することに
よりヒストグラムを作成し、その黒点ヒストグラムを参
照して、1文字の領域を決定する。In the OCR, one line is scanned from the upper end to the lower end of the line buffer in which the character string is stored, and the character pattern of the line buffer is read by sequentially moving the column in a direction perpendicular to this scanning. Further, a histogram is created by counting black dots (black dots in the character portion and white dots in the background portion) during scanning of one column, and the area of one character is determined by referring to the black dot histogram.
しかしながら、手書文字の場合において記入者が文字を
傾斜して記入しているため、あるいは文字記入枠からは
み出して記入したため、もしくは記入者が文字の一部を
はねたため等の理由により、隣接する文字が重なって、
2文字以上の文字パタンが1文字として切出されるとい
う問題点がある。However, in the case of handwritten characters, the characters are entered obliquely, or the characters are out of the character entry frame, or because the writer has partially spelled out the characters. The letters to be overlapped,
There is a problem that a character pattern of two or more characters is cut out as one character.
この問題点を解決するために本出願人が先に提案した特
願昭60-36574号では黒点ヒストグラムの幅より何文字分
に相当するか判定し、2文字以上の場合には、その文字
パタン列の文字外接枠を検出し、その文字外接枠内の文
字パタン列を記憶手段に保持する。次に文字外接枠の上
下の辺から各々反対側の辺へ向って走査し、記憶手段か
ら文字パタン列の内容を読み出し、その内容が文字部分
であるか背景部分であるか検出する。In order to solve this problem, Japanese Patent Application No. 60-36574 proposed by the applicant of the present invention determines how many characters correspond to the width of the black dot histogram. The character circumscribing frame of the string is detected, and the character pattern string in the character circumscribing frame is held in the storage means. Next, scanning is performed from the upper and lower sides of the character circumscribing frame toward the opposite sides, the content of the character pattern string is read from the storage means, and it is detected whether the content is a character portion or a background portion.
このようにして、上辺からの走査により検出された背景
部分及び下辺からの走査により検出された背景部分、文
字部分、並びに該走査で文字部分が検出されると、該列
の走査を打ち切り、そのため該走査を受けなかった背景
部分の4種類に文字外接枠内の文字パタン列を分類す
る。次に水平走査を行い分類が変化する変化点を検出
し、順次変化点を格納し、同時に変化点の前後の状態
(分類結果)を保持し、該状態の遷移を所定の分類の変
化の遷移の組合せと比較して一致する変化点を検出し、
その変化点により、隣接する文字の一部が重なった文字
パタン列から文字を切出していた。In this way, when the background portion detected by the scanning from the upper side and the background portion detected by the scanning from the lower side, the character portion, and the character portion in the scanning are detected, the scanning of the column is terminated, and therefore, The character pattern sequence in the character circumscribing frame is classified into four types of background portions that have not been scanned. Next, horizontal scanning is performed to detect change points at which the classification changes, sequentially store the change points, and at the same time, hold the states (classification results) before and after the change points, and change the transition of the states to the transition of the change of a predetermined classification. The matching change point is detected by comparing with the combination of
Due to the change point, characters were cut out from a character pattern string in which a part of adjacent characters overlap.
第9図(a)(b)は以上に述べた従来の文字切出し方
式の具体例を示す図である。同図において、100,101は
文字パタンである。103は上辺から下辺への走査方向、1
04は下辺から上辺への走査方向を示す。第9図(a)に
示すように、文字外接枠の上下の辺から各々反対側の辺
へ向って走査を行い当該文字パタン列を4種類(上辺か
らの走査を受けた背景部分:図中“2"で示す。下辺から
の走査を受けた背景部分:図中“4"で示す。両走査を受
けなかった背景部分:図中“0"で示す。文字線部分:図
中“1"で示す)に分類した結果より分類が“4"→“0"→
“2"と変換する領域を検出しその変化点よりA−A′の
ごとき切出し位置を検出していた。FIGS. 9 (a) and 9 (b) are diagrams showing a specific example of the conventional character cutting method described above. In the figure, 100 and 101 are character patterns. 103 is the scanning direction from top to bottom, 1
04 indicates the scanning direction from the lower side to the upper side. As shown in FIG. 9 (a), scanning is performed from the upper and lower sides of the character circumscribing frame toward the opposite sides, and four types of character pattern rows are concerned (background part scanned from the upper side: in the figure. Indicated by "2". Background part scanned from the lower side: indicated by "4" in the figure. Background part not subjected to both scans: indicated by "0" in the figure Character line part: "1" in the figure Classification is “4” → “0” →
The area converted to "2" was detected, and the cutout position such as AA 'was detected from the change point.
(発明が解決しようとする問題点) しかしながら上記従来の文字切出し方式では文字外接枠
内の分類結果の遷移の組合せが所定の組合せと一致する
ものがない隣接した文字の一部が重なった文字パタン列
は1文字を切出すことは出来なかった。すなわち、帳票
の記入者の習慣、くせ等により文字が記入枠より大きく
はみ出したり、はねてしまうために、文字の一部が隣接
する文字に大きく入込んだり、より複雑に重なった場合
には、第9図(b)に示すように上下の辺からの走査の
結果を水平方向に走査して分類が変化する変化点を検出
し、その変化点を保持し、同時に変化点の前後の分類結
果を保持し、該分類結果の組合せを所定の組合せと一致
するものを検出することが出来ないというような問題点
があった。(Problems to be Solved by the Invention) However, in the above-described conventional character cutout method, there is no combination of transitions of classification results in a character circumscribed frame that matches a predetermined combination. The line could not cut out one letter. In other words, when the characters fill out more than the entry frame or bounce off due to the customs or habits of the person who fills out the form, if a part of the character greatly enters into the adjacent character, or if it overlaps more complicatedly, As shown in FIG. 9 (b), the results of scanning from the upper and lower sides are scanned in the horizontal direction to detect change points at which the classification changes, hold the change points, and at the same time classify before and after the change points. There is a problem that it is not possible to hold the results and detect the combination of the classification results that matches the predetermined combination.
本発明は、これらの問題点を解決するためのもので、簡
単な構成で精度の良い文字切出し装置を提供することを
目的とする。An object of the present invention is to solve these problems, and an object thereof is to provide a character cutting device having a simple structure and high accuracy.
(問題点を解決するための手段) 本発明は前記問題点を解決するために、帳票上に記入さ
れた文字列を光電変換して得られる量子化された文字パ
タン列から1文字毎の文字パタンを分離して抽出する文
字切出し装置において、前記文字パタン列を格納するラ
インバッファメモリと、該ラインバッファメモリを文字
パタン列の列方向に1列毎に走査して列方向の黒点ヒス
トグラムを作成し、第1の閾値より大きい黒点ヒストグ
ラムが連続して第2の閾値以上続く黒点ヒストグラムの
幅に基づき切出し対象のブロックを検出するブロック検
出手段と、前記ブロック検出手段で得られたブロックの
幅と第3の閾値とを比較して該幅が何文字に相当するか
を判定する判定手段と、前記ブロック検出手段で検出さ
れたブロックの文字パタン列を行方向に各行毎に走査し
て作成した行方向の黒点ヒストグラムと前記列方向の黒
点ヒストグラムに基づいて文字外接枠を検出する外接枠
検出手段と、前記外接枠検出手段で得られた文字外接枠
内の文字パタン列を記憶する記憶手段と、前記判定手段
が複数文字であると判定した場合には前記文字外接枠の
上辺,下辺から各々反対側の辺に向かって走査して前記
記憶手段から文字パタン列の内容を読出し、該内容が文
字領域であるか背景領域であるかを検出し、この検出処
理により上辺からの走査で検出された背景領域,下辺か
らの走査で検出された背景領域,文字領域,並びに該走
査で文字領域が検出されると、該列の走査を打ち切り、
当該走査を打ち切ったことにより該走査を受けなかった
背景領域の各領域に前記文字外接枠内の文字パタン列を
分類する分類手段と、前記分類手段による文字外接枠内
の分類結果について、水平走査を行って分類が変化する
変化点を検出して順次格納すると共に該変化点の前後の
状態を保持し、該状態の遷移を所定の分類の変化の遷移
の組合せと比較して一致する変化点を検出する変化点検
出手段と、前記変化点検出手段で一致する変化点が検出
されない場合には、前記文字外接枠を水平方向に分割す
る分割手段と、前記分割手段で分割された各分割領域を
新たな文字外接枠として前記分類手段及び変化点検出手
段により各分割領域毎に検出された変化点に基づいて文
字切出し位置を決定する決定手段とから構成されるもの
である。(Means for Solving Problems) In order to solve the above problems, the present invention provides a character for each character from a quantized character pattern string obtained by photoelectrically converting a character string written on a form. In a character segmentation device for separating and extracting patterns, a line buffer memory for storing the character pattern sequence and a line-point black line histogram are created by scanning the line buffer memory column by column in the character pattern sequence. Then, a block detection unit that detects a block to be cut out based on the width of a black dot histogram in which black dot histograms larger than the first threshold continuously continue for the second threshold or more, and a width of the block obtained by the block detection unit. A determination means for comparing with the third threshold value to determine how many characters the width corresponds to, and a character pattern string of the block detected by the block detection means in the row direction. A circumscribing frame detecting means for detecting a character circumscribing frame on the basis of the row-direction black dot histogram created by scanning for each row and the column direction, and a character in the character circumscribing frame obtained by the circumscribing frame detecting means. When the storage means for storing the pattern sequence and the determination means determines that there are a plurality of characters, scanning is performed from the upper side and the lower side of the character circumscribing frame toward opposite sides, and the storage means stores the character pattern sequence. The content is read to detect whether the content is a character area or a background area, and by this detection processing, a background area detected by scanning from the upper side, a background area detected by scanning from the lower side, and a character area. , And when a character area is detected in the scan, the scan of the column is aborted,
A horizontal scanning of a classifying unit that classifies the character pattern string in the character circumscribing frame into each region of the background region that has not been scanned due to the suspension of the scan, and a classification result in the character circumscribing frame by the classifying unit. The change points that change the classification are detected and sequentially stored, the states before and after the change point are retained, and the transition of the state is compared with the combination of the transitions of the change of the predetermined classification, and the change points that match are changed. And a change point detecting means for detecting the change point detecting means and a change point detecting means does not detect a matching change point, the dividing means divides the character circumscribing frame in the horizontal direction, and each division area divided by the dividing means. Is used as a new character circumscribing frame, and the deciding means for deciding the character cut-out position on the basis of the changing point detected for each divided area by the classifying means and the changing point detecting means.
(作用) 本発明によれば以上のように文字切出し装置を構成した
ので、技術的手段は次のように作用する。ブロック検出
手段はラインバッファメモリの文字パタン列の列方向の
黒点ヒストグラムを作成して列方向の黒点ヒストグラム
の幅を求め、これに対応して文字パタン列の切出し処理
を施すブロックを検出するように働く。判定手段は検出
したブロックが何文字分であるかを判定するように働
く。外接枠検出手段はブロック内の文字パタン列の行方
向の黒点ヒストグラムを作成し、これと列方向の黒点ヒ
ストグラムからブロック内の文字パタン列の文字外接枠
を検出するように働く。記憶手段は文字外接枠内の文字
パタンを記憶するように働く。分類手段は、判定手段が
ブロックを複数文字であると判定した場合には文字外接
枠内の上下の辺から各々反対側の辺に向かって走査して
4種類の領域に分類するように働く。この分類結果に対
し、変化点検出手段は水平走査して領域が変化する変化
点を検出して順次格納すると共に変化点の前後の状態を
保持し、該状態の遷移を所定の分類の変化の遷移の組み
合わせとを比較して一致する変化点を検出するように働
く。ここで、一致する変化点が検出されない場合には分
割手段は文字外接枠を水平方向に分割するように働く。
この分割された各分割領域に対し、上記と同様にして分
類手段、変化点検出手段により変化点を検出し、これら
の変化点に基づいて決定手段が文字切出し位置を決定す
るように働く。従って、文字の一部が隣接する文字に深
く入こんだ場合にも精度よく文字切出しを行うことがで
きる。(Function) According to the present invention, since the character cutting device is configured as described above, the technical means functions as follows. The block detection means creates a black dot histogram in the column direction of the character pattern string in the line buffer memory to obtain the width of the black dot histogram in the column direction, and detects the block to which the character pattern string is cut out correspondingly. work. The judging means works to judge how many characters the detected block is. The circumscribing frame detection means creates a black dot histogram in the row direction of the character pattern string in the block, and detects the character circumscribing frame of the character pattern string in the block from this and the black dot histogram in the column direction. The storage means operates to store the character pattern in the character circumscribing frame. When the determining unit determines that the block has a plurality of characters, the classifying unit functions to scan from the upper and lower sides of the character circumscribing frame toward the opposite sides to classify into four types of regions. In response to this classification result, the change point detecting means horizontally scans to detect change points in which the area changes, sequentially stores them, holds the states before and after the change points, and changes the state of the change points of the change of a predetermined classification. It acts to compare transition combinations and detect matching transition points. Here, when no matching change point is detected, the dividing means works to divide the character circumscribing frame in the horizontal direction.
With respect to each of the divided areas, the changing points are detected by the classifying means and the changing point detecting means in the same manner as described above, and the determining means functions to determine the character cut-out position based on these changing points. Therefore, even when a part of a character deeply enters an adjacent character, the character can be cut out with high accuracy.
(実施例) 以下、この発明の一実施例を図面に基づいて説明する。Embodiment An embodiment of the present invention will be described below with reference to the drawings.
第1図は、この発明の一実施例を示すブロック図であ
る。同図において、200は図示されていない光電変換部
よりの画像信号、201はラインバッファ、202は黒点ヒス
トグラム作成回路220、外接枠検出回路221および文字判
定回路222である。203はデータの切替え回路、204はパ
タンメモリ、205,206はパタンメモリ用のアドレスを発
生するx方向のxアドレスカウンタ(以下xカウンタと
いう)とy方向のyアドレスカウンタ(以下yカウンタ
という)である。207は制御回路である。208はパタン領
域分類回路、209は白点より黒点への変化点を検出する
文字線検出回路である。210はパタン領域変化点検出回
路、211は切出し領域の検出回路である。また、各回路
を接続する一重の矢印はデータの流れを示し、二重の矢
印は制御信号を示す。FIG. 1 is a block diagram showing an embodiment of the present invention. In the figure, 200 is an image signal from a photoelectric conversion unit (not shown), 201 is a line buffer, 202 is a black dot histogram creation circuit 220, a circumscribing frame detection circuit 221, and a character determination circuit 222. Reference numeral 203 is a data switching circuit, 204 is a pattern memory, and 205 and 206 are x-direction x-address counters (hereinafter referred to as x-counters) and y-direction y-address counters (hereinafter referred to as y-counters) that generate addresses for pattern memories. Reference numeral 207 is a control circuit. Reference numeral 208 is a pattern area classification circuit, and 209 is a character line detection circuit that detects a change point from a white point to a black point. Reference numeral 210 is a pattern area change point detection circuit, and 211 is a cutout area detection circuit. Further, a single arrow connecting each circuit indicates a data flow, and a double arrow indicates a control signal.
以下に、第1図のブロック図を用いて本実施例動作につ
いて説明を行う。The operation of this embodiment will be described below with reference to the block diagram of FIG.
帳票上の文字列は光電変換器により2値化された画像信
号200に変換され、ラインバッファ201に格納される。制
御回路207の制御により以下の処理が行われる。制御回
路207はラインバッファ201に格納されている画像信号を
ラインバッファ201の先頭位置よ1列単位に読出し、順
次列を更新し、1行分の文字パタンデータを全て読出し
た時点で終了する。また、制御回路207では、ラインバ
ッファ201より1列単位にパタンデータを読出すと同時
に黒点ヒストグラム作成回路220を起動する。黒点ヒス
トグラム作成回路220では、1列の読出し中の黒点数を
計数することにより当該列の黒点ヒストグラムを作成
し、黒点ヒストグラム作成回路220に含まれるヒストグ
ラムメモリ230に格納する。以上の処理を繰返し1行
分、全列の黒点ヒストグラムをヒストグラムメモリ230
に格納した時点で処理を終了する。The character string on the form is converted into a binarized image signal 200 by a photoelectric converter and stored in the line buffer 201. The following processing is performed under the control of the control circuit 207. The control circuit 207 reads the image signal stored in the line buffer 201 from the head position of the line buffer 201 in column units, sequentially updates the columns, and ends when all the character pattern data for one line is read. Further, the control circuit 207 reads out the pattern data from the line buffer 201 on a column-by-column basis and, at the same time, activates the black dot histogram creation circuit 220. The black dot histogram creation circuit 220 creates a black dot histogram of the column by counting the number of black dots being read in one column, and stores the black dot histogram in the histogram memory 230 included in the black dot histogram creation circuit 220. The above processing is repeated, and the black dot histograms of all rows for one row are stored in the histogram memory 230.
The process ends when the data is stored in.
1行分の黒点ヒストグラムを作成した後は、黒点ヒスト
グラム作成回路220中のヒストグラムメモリ230を先頭よ
り読出して、前記黒点ヒストグラムを参照してブロック
の検出を行う。制御回路207は黒点ヒストグラム作成回
路220中のヒストグラムメモリ230より、順次黒点ヒスト
グラムを読出し、黒点ヒストグラムと閾値α(α:定
数、ただし、本実施例においてα=1とする)を比較
し、前記ヒストグラムが大きければ文字のブロックの始
点候補とし、順次黒点ヒストグラムの格納番地を更進
し、読出された黒点ヒストグラムが閾値αより大きい列
を計数し、β(β:定数、ただし、本実施例においては
β=2とする)列連続した場合、前記始点候補を始点と
する。さらに列の更進を続け、始点が検出された後、始
めて黒点ヒストグラムが閾値αより小さくなる列を終点
とし、始点から終点までの長さで示される領域をブロッ
クとする。次に、制御回路207は文字判定回路222を起動
し前記検出されたブロックの長さを読取対象としている
文字の平均的な幅より求められた閾値γ1,γ2(γ1,
γ2定数、ただし、本実施例においてはγ1=75,γ2=12
5とする)と比較する。そして、当該ブロックの長さW
が閾値γ1より小さいときには当該ブロックを1文字と
判定し、γ1≦W≦γ2のときは2文字と判定し、さらに
W>γ2のときは3文字以上と判定する。また、制御回
路207では当該ブロックの判定の後、該ブロックについ
て外接枠検出回路221を起動し、外接枠を検出する。さ
らに、このブロックの外接枠が検出されると、前記外接
枠内の文字パタンをパタンメモリ204に転送する。ここ
で、W>γ2の場合つまり前記ブロックを3文字以上と
判定した場合、始点からγ2まで切出し処理を行って1
文字目と2文字目を分割する。この結果の切出し点を始
点として、その始点からγ2まで切出し処理を行ってさ
らに2文字目と3文字目を分割するごとき順次切出しを
行いWまで処理することとなる。ここで、後述する第5
図に示すように文字外接枠の上辺左端を原点とし、下辺
位置をPB、右辺位置をPRとする。After the black dot histogram for one row is created, the histogram memory 230 in the black dot histogram creating circuit 220 is read from the beginning, and the block is detected by referring to the black dot histogram. The control circuit 207 sequentially reads out the black dot histogram from the histogram memory 230 in the black dot histogram creating circuit 220, compares the black dot histogram with the threshold value α (α: a constant, but in this embodiment, α = 1), and the histogram Is larger than the character block start point candidate, the storage addresses of the black dot histograms are sequentially incremented, and the columns in which the read black dot histogram is larger than the threshold value α are counted, and β (β: a constant, but in the present embodiment, When β = 2) consecutive columns, the starting point candidate is set as the starting point. Further, the column is further updated, and after the start point is detected, the row where the black spot histogram becomes smaller than the threshold value α for the first time is set as the end point, and the region indicated by the length from the start point to the end point is set as the block. Next, the control circuit 207 activates the character determination circuit 222 to set the detected block length to the thresholds γ 1 , γ 2 (γ 1 ,
γ 2 constant, provided that γ 1 = 75 and γ 2 = 12 in this embodiment.
5 and) and compare. Then, the length W of the block
Is smaller than the threshold value γ 1, the block is determined to be one character, when γ 1 ≦ W ≦ γ 2 , it is determined to be 2 characters, and when W> γ 2 is determined to be 3 or more characters. Further, the control circuit 207 activates the circumscribing frame detection circuit 221 for the block after determining the block, and detects the circumscribing frame. Further, when the circumscribing frame of this block is detected, the character pattern in the circumscribing frame is transferred to the pattern memory 204. Here, if W> γ 2 , that is, if it is determined that the block has three or more characters, the cutting process from the starting point to γ 2 is performed to
Split the first and second characters. With the cut-out point of this result as the starting point, the cutting-out processing is performed from that starting point to γ 2, and further the cutting-out processing is performed such that the second character and the third character are divided, and processing is performed up to W. Here, the fifth described later
As shown in the figure, the upper left edge of the character circumscribing frame is the origin, the lower edge position is PB, and the right edge position is PR.
次に、上記のような文字の判定により2文字以上と判定
されたものの処理について第1図に基づいて説明する。Next, the processing of a character that has been determined to be two or more by the above character determination will be described with reference to FIG.
制御回路207はパタンメモリ204のアドレスを与えるxカ
ウンタ205及びyカウンタ206を文字の外接枠の上辺の左
端の位置にセットし、yカウンタ106をインクリメント
して文字外接枠の下辺に向って走査を行う。そして、パ
タンメモリ204のアドレスをX軸,Y軸に対して(x,y)と
し、それぞれxカウンタ、yカウンタの値を用いる。前
記アドレスで示される位置のパタンメモリ204の内容をP
M(x,y)で表わす。本実施例においては白点をPM(x,
y)=0、黒点をPM(x,y)=1、前記上辺からの走査時
に検出された白点をPM(x,y)=2,前記下辺からの走査
時に検出された白点をPM(x,y)=4とした。従って、
本実施例におけるパタンメモリ204は1メッシュに対し
て3ビットのデータ幅を有する。パタン領域分類回路20
8において、文字外接枠の上辺左端にアドレスを設定し
パタンメモリ204より文字パタンを読みだす。PM(x,y)
=0のときは(PM(x,y).OR.2)を新たなPM(x,y)と
し、切換え回路203を介してパタンメモリ204の当該番地
に書き込みを行う。The control circuit 207 sets the x counter 205 and the y counter 206 which give addresses of the pattern memory 204 to the left end position of the upper side of the character circumscribing frame and increments the y counter 106 to scan toward the lower side of the character circumscribing frame. To do. Then, the address of the pattern memory 204 is set to (x, y) for the X axis and the Y axis, and the values of the x counter and the y counter are used. P the contents of the pattern memory 204 at the position indicated by the address
Expressed as M (x, y). In this embodiment, the white point is PM (x,
y) = 0, black points are PM (x, y) = 1, white points detected during scanning from the upper side are PM (x, y) = 2, white points detected during scanning from the lower side are PM (X, y) = 4. Therefore,
The pattern memory 204 in this embodiment has a data width of 3 bits for one mesh. Pattern area classification circuit 20
In 8, the character pattern is read from the pattern memory 204 by setting an address at the upper left end of the character circumscribing frame. PM (x, y)
When = 0, (PM (x, y) .OR.2) is set as a new PM (x, y), and the corresponding address of the pattern memory 204 is written via the switching circuit 203.
制御回路207は、白点から黒点への変化点を検出する文
字線検出回路209がPM(x,y)=1である黒点を検出する
と、該列の走査を打ち切りxカウンタ205を1つインク
リメントし、次の列の走査を文字外接枠の上辺より行
う。また、前記文字外接枠の上辺より走査を行い下辺ま
で到達したときも該列の走査を打ち切り、次列の走査を
行う。以上の走査を順次繰返し、文字外接枠の右端の列
を処理したら終了する。前記上辺よりの走査が終了した
ら制御回路207は、xカウンタ、yカウンタを文字外接
枠の下辺左端に設定し、前記下辺より上辺に向っての走
査を行い、前記上辺よりの走査時と同様の処理を行う。
ただし、PM(x,y)=0のときは、(PM(x,y).OR.4)
をPM(x,y)としてパタンメモリ204に格納する。前記上
辺よりの走査と同様に右端の列の処理をしたら終了す
る。前記2種類の走査が終了し、文字外接枠内のパタン
の分類が終了後、制御回路207は、xカウンタ205及びy
カウンタ206を文字外接枠上の上辺左端設定し、水平走
査を行い文字切出し領域の検出を行う。The control circuit 207 detects the change point from the white point to the black point. When the character line detection circuit 209 detects the black point with PM (x, y) = 1, the scanning of the column is stopped and the x counter 205 is incremented by one. Then, the scanning of the next column is performed from the upper side of the character circumscribing frame. Further, when the scanning is performed from the upper side of the character circumscribing frame and the lower side is reached, the scanning of the column is stopped and the scanning of the next column is performed. The above scanning is sequentially repeated, and when the rightmost column of the character circumscribing frame is processed, the processing ends. When the scanning from the upper side is completed, the control circuit 207 sets the x counter and the y counter to the left end of the lower side of the character circumscribing frame, performs the scanning from the lower side to the upper side, and performs the same scanning as that from the upper side. Perform processing.
However, when PM (x, y) = 0, (PM (x, y) .OR.4)
Is stored in the pattern memory 204 as PM (x, y). When the rightmost column is processed in the same manner as the scanning from the upper side, the process is completed. After the two types of scanning are completed and the patterns in the character circumscribing frame are completed, the control circuit 207 controls the x counter 205 and y counter.
The counter 206 is set to the left end of the upper side of the character circumscribing frame, and horizontal scanning is performed to detect the character cutout area.
ここで上記の列走査の具体例としては前述の第9図
(a)(b)が挙げられる。Here, as a specific example of the above-mentioned column scanning, the above-described FIGS. 9A and 9B can be cited.
次に、文字切出し領域の検出を第1図に基づいて説明す
る。Next, the detection of the character cutout area will be described with reference to FIG.
先ず、パタン領域変化点検出回路210は制御回路207によ
り起動されると、パタンメモリ204から文字パタンデー
タ(垂直走査による分類結果)を読出しながら外接枠内
を水平走査する。また、パタン領域変化点検出回路210
は、パタンメモリ204からの文字パタンデータを処理す
る。First, when the pattern area change point detection circuit 210 is activated by the control circuit 207, it horizontally scans the circumscribed frame while reading character pattern data (classification result by vertical scanning) from the pattern memory 204. Further, the pattern area change point detection circuit 210
Processes the character pattern data from the pattern memory 204.
第2図はパタン領域変化点検出回路210の内部構成を示
すブロック図である。同図において、300はyカウンタ2
06の出力、301はxカウンタ205の出力、302は文字パタ
ンデータを示す303はxカウンタ205用のレジスタ(REG
A)、304は文字パタンデータ保持用のレジスタ(REG
D)、305は文字パタンデータの比較用のコンパレータ、
306は文字パタンデータの変化点が検出された点の1点
前のX軸の座標検出用のレジスタ(xREG I)、307は後
述する切出し位置判定回路211より与えられる信号310に
よってX座標を保持するためのレジスタ(xREG II)308
は変化点が検出されたときのY座標を保持するためのレ
ジスタ(yREG I)である。FIG. 2 is a block diagram showing the internal configuration of the pattern area change point detection circuit 210. In the figure, 300 is a y counter 2
06 output, 301 is x counter 205 output, 302 is character pattern data, 303 is x counter 205 register (REG
A) and 304 are registers (REG for holding character pattern data)
D), 305 are comparators for comparing character pattern data,
306 is a register (xREG I) for detecting the coordinate of the X axis one point before the point where the change point of the character pattern data is detected, and 307 holds the X coordinate by the signal 310 given from the cutout position judging circuit 211 described later. Register (xREG II) 308
Is a register (yREG I) for holding the Y coordinate when the change point is detected.
以下第2図を用いてパタン領域変化点検出回路210の動
作を説明する。The operation of the pattern area change point detection circuit 210 will be described below with reference to FIG.
外接枠内の水平走査によって読出された文字パタンデー
タは、文字パタンデータ保持用レジスタ(REGD)304に
保持される。そして、保持されている文字パタンデータ
すなわち1点前の文字パタンデータと現在読出されてい
る文字パタンデータをコンパレータ305により比較しそ
の比較した結果により変化したと判定されると、その1
点前のX軸方向の座標位置を保持する。すなわちxカウ
ンタの出力301はレジスタ(REGA)303に座標が更進され
る毎に保持され、コンパレータ305によって変化点が検
出されると、レジスタ(REGA)303に保持されている1
点前の座標がレジスタ(XREG I)306に保持される。The character pattern data read by the horizontal scanning in the circumscribing frame is held in the character pattern data holding register (REGD) 304. Then, the stored character pattern data, that is, the character pattern data immediately before one point and the character pattern data currently read out are compared by the comparator 305, and if it is determined that the result is changed, the
The coordinate position in the X-axis direction before the point is held. That is, the output 301 of the x-counter is held in the register (REGA) 303 every time the coordinates are moved further. When the change point is detected by the comparator 305, the output 301 is held in the register (REGA) 303.
The coordinates before the point are held in the register (XREG I) 306.
次に第1図に示す切出し領域検出回路211においては、
パタン領域変化点検出回路210でパタン領域の変化点が
検出されたとき、PM(x-1,y)文字パタンデータ(領
域)をレジスタに保持する。Next, in the cutout area detection circuit 211 shown in FIG.
When the pattern area change point detection circuit 210 detects a change point in the pattern area, the PM (x-1, y) character pattern data (area) is held in the register.
切出し領域検出回路211では、前記PM(x-1,y)の文字パ
タンデータを保持する状態レジスタを3個有し、該状態
レジスタはパタン領域の変化点が検出されたときに、レ
ジスタの内容が隣接するレジスタにシフトする構成とな
っている。さらに、パタン領域の変化点が検出され、状
態レジスタのシフトが完了したら前記3種類状態レジス
タの内容が所定の値と一致するかを検出する。The cut-out area detection circuit 211 has three status registers that hold the PM (x-1, y) character pattern data, and the status registers store the contents of the registers when a change point in the pattern area is detected. Are shifted to adjacent registers. Further, when the change point of the pattern area is detected and the shift of the status register is completed, it is detected whether the contents of the three kinds of status registers match a predetermined value.
第3図は切出し領域検出回路211の内部構成を示すブロ
ック図である。同図において、400は制御回路207からの
制御信号、401はパタンメモリ204よりの文字パタンデー
タ、402はパタン領域変化点検出回路210で検出された変
化点検出信号を示す。403〜406は制御回路207からの文
字パタンデータの遷移の所定の組合せを示す遷移レジス
タ(組合せ回路)である。407〜409はパタン領域変化点
検出回路210により変化点が検出されたときの文字パタ
ンデータの内容を保持する状態レジスタ(ST3〜ST1)で
ある。410〜413は状態レジスタ407〜409と遷移レジスタ
403〜406の一致を検出する比較回路(コンパレータ)で
ある。414は比較回路410〜413の出力を論理和する論理
和回路、415は遷移レジスタ403〜406と状態レジスタが
一致したことを保持するフリップフロップである。FIG. 3 is a block diagram showing an internal configuration of the cutout area detection circuit 211. In the figure, 400 is a control signal from the control circuit 207, 401 is character pattern data from the pattern memory 204, and 402 is a change point detection signal detected by the pattern area change point detection circuit 210. Reference numerals 403 to 406 are transition registers (combination circuits) indicating predetermined combinations of transitions of the character pattern data from the control circuit 207. 407 to 409 are status registers (ST3 to ST1) which hold the contents of the character pattern data when the change point is detected by the pattern area change point detection circuit 210. 410 to 413 are status registers 407 to 409 and transition registers
It is a comparison circuit (comparator) that detects a match of 403 to 406. Reference numeral 414 is an OR circuit that logically ORs the outputs of the comparison circuits 410 to 413, and 415 is a flip-flop that holds that the transition registers 403 to 406 and the state register match.
次に第3図を用いて切出し領域検出回路211の動作を説
明する。文字パタンデータ401は座標位置が更進される
毎に状態レジスタ(ST3)407に保持される。パタン領域
変化点検出回路210でパタン領域の変化点が検出される
と、状態レジスタ(ST3)407の出力は状態レジスタ(ST
2)408に保持される。さらに同時に状態レジスタ(ST
1)409には状態レジスタ408の出力が保持される。以上
のようにして連続する3つの文字パタンデータの変化の
組合せが、3つの状態レジスタ407,408,409に保持され
る。変化点が検出されると、3つの状態レジスタ407〜4
09の組合せと、所定の数種の遷移レジスタ403〜406はそ
れぞれ比較回路410〜413により比較され、一致する組合
せがあれば切出し領域が検出済を示すフリップフロップ
415をセットする。Next, the operation of the cutout area detection circuit 211 will be described with reference to FIG. The character pattern data 401 is held in the status register (ST3) 407 every time the coordinate position is advanced. When the pattern area change point detection circuit 210 detects a change point in the pattern area, the output of the status register (ST3) 407 is
2) Held at 408. At the same time, the status register (ST
1) 409 holds the output of status register 408. As described above, combinations of changes in three consecutive character pattern data are held in the three status registers 407, 408, 409. When a change point is detected, three status registers 407-4
The combination of 09 and a predetermined number of transition registers 403 to 406 are compared by comparison circuits 410 to 413, respectively, and if there is a combination that matches, a flip-flop indicating that the cutout area has been detected.
Set 415.
次に第1図においてフリップフロップ415がセットされ
ると、切出し領域検出回路211からの決定信号がパタン
領域変化点検出回路210の(y REG)308及び(x REGII)
307に供給される。その時に各レジスタに格納されてい
たxカウンタ205もしくはyカウンタ206の内容が各レジ
スタからy1,x2として出力される。Next, when the flip-flop 415 is set in FIG. 1, the decision signal from the cut-out area detection circuit 211 is (y REG) 308 and (x REGII) of the pattern area change point detection circuit 210.
Supplied to 307. At that time, the contents of the x counter 205 or the y counter 206 stored in each register are output as y 1 and x 2 from each register.
状態レジスタ407〜409が所定の組合せと一致した場合、
その行の水平走査は打ち切り、yカウンタ206をインク
リメントし新たな次の行の水平走査を行う。以上の水平
走査が、外接枠内で全て終了した次点でx1(x REG
I),x2(x REG II),y1(y REGI)をもとに切出し位
置を決定する。If the status registers 407-409 match the given combination,
The horizontal scanning of the row is stopped, the y counter 206 is incremented, and a new horizontal scanning of the next row is performed. The horizontal scanning above is x 1 (x REG
The cutout position is determined based on I), x 2 (x REG II), and y 1 (y REGI).
ここで用いた所定の組合せは、“4"→“0"→“2",“2"
→“0"→“4",“4"→“2"および“2"→“4"の4種類で
遷移レジスタ403〜406にそれぞれ格納されている。The predetermined combination used here is "4" → "0" → "2", "2"
→ 4 types of "0" → "4", "4" → "2" and "2" → "4" are stored in the transition registers 403 to 406, respectively.
水平走査が外接枠内で全て終了した時点で状態レジスタ
407〜409が遷移レジスタ403〜406と一致するものがない
ときは、制御回路207は文字外接枠の水平2等分割線を
求める。該水平2等分割線によって分割された2つの領
域を新たな外接枠として制御回路207は2つの外接枠そ
れぞれで切出し手順と同様にして切出し位置を検出す
る。すなわち先ず水平2等分割線より上にある外接枠に
ついて、上下の辺からそれぞれ対辺へ走査を行うことに
より該外接枠内を4種類に分類し、その分類結果につい
て水平走査を行いつつ分類の変化する変化点および変化
点の前後での分類の遷移の組合せを検出し、その組合せ
と所定の組合せとの一致する変化点を検出して前記分割
線の上側の外接枠の切出し位置とする。制御回路207は
次に前記分割線の下側の領域についても同じ方向にて切
出し位置を検出し、それぞれの切出し位置を接続するこ
とにより、文字パタン全体の切出し位置とする。Status register when horizontal scanning is completed within the bounding box
If there is no match in 407 to 409 with the transition registers 403 to 406, the control circuit 207 obtains the horizontal bisector of the character circumscribing frame. The control circuit 207 detects the cutout position in each of the two circumscribing frames in the same manner as the slicing procedure, using the two regions divided by the horizontal bisector as new circumscribing frames. That is, first, for the circumscribing frame above the horizontal bisector, the inside and outside of the circumscribing frame are classified into four types by scanning from the upper and lower sides to the opposite sides, and the classification result is changed while performing horizontal scanning. The change point and the combination of classification transitions before and after the change point are detected, and the change point that matches the combination and the predetermined combination is detected and set as the cutout position of the circumscribed frame above the dividing line. The control circuit 207 then detects the cutout position in the same direction also in the area below the dividing line, and connects the cutout positions to obtain the cutout position of the entire character pattern.
ここで分割された外接枠の上辺より下辺に向う走査時に
黒点が検出されずに下辺に到達した場合は、その走査線
の位置を切出し位置とし、複数の走査線が検出された場
合には文字パタンの外接枠のx軸方向の中央位置に最も
近い走査線を持って切出し位置とする。該切出し位置を
与えるx軸上の位置をxPとする。When black dots are reached without being detected when scanning from the upper side to the lower side of the circumscribed frame that is divided here, the position of that scanning line is taken as the cut-out position, and when multiple scanning lines are detected, the character The scanning line closest to the center position of the circumscribing frame of the pattern in the x-axis direction is set as the cutout position. The position on the x-axis that gives the cut-out position is x P.
以上のように上下の領域で切出し位置x1x2y1あるいはxP
が検出されると検出された2組の切出し線と水平分割線
で接続することにより全体の切出し位置とする。As described above, the cutout position x 1 x 2 y 1 or x P in the upper and lower areas
When is detected, the two cutting lines that have been detected are connected to each other by horizontal dividing lines to form the entire cutting position.
以下に、第4図に示す切出し位置が決定されたパタン例
を使用して、パタンの転送方法を説明する。また、第4
図は、第1図のブロック図におけるパタンメモリ204に
格納されているパタンおよび切出し位置を示している。
座標は横軸をX軸,縦軸をY軸としており、パタンメモ
リ204は第4象限に位置しているものとする。XMおよびY
Mはパタンメモリ204の大きさを示しており、本実施例に
おいてはXM=YM=128メッシュとした。PRおよびPBはパ
タンメモリ204に格納されているパタンの外接枠を示す
ものでX=0,X=PR,Y=0,Y=PRの4本の直線により外接
枠は表わされる。第4図において300,301はパタン、直
線Y=y1,X=x1,X=x2は切出し位置を示している。本実
施例におけるパタンメモリは、1メッシュを表わすデー
タが第5図の構成となっている。同図において、(1)
が1のときは下辺から上辺への列走査時に白点であった
ことを意味し、(1)が0のときは該白点以外であった
ことを意味する。また、(2)が1のときは上辺から下
辺への列走査時に白点であったことを意味し、(2)が
0のときは該白以外であったことを意味する。さらに
(3)が1のときは黒点である点を意味し、(3)が0
のときは白点である点を意味する。従って、転送するパ
タンデータは、(3)で示されるデータだけである。X
=0で表わされる直線上のメッシュをY=0の点よりY
座標を1つづつインクリメントすることによりY=PBの
点までパタンデータを転送する。1列転送終了後X座標
をインクリメントする。1列毎に前記転送を繰返し、X
=x1の列の転送を終了した時点で次の列からX=x2の列
まではY座標が0よりYDまでは、パタンデータをマスク
し固定値0を転送する。次のX=x3の列まではY座標が
0よりYD及びY1よりPBまでをマスクし固定値0を転送す
る。X=x3の列まで転送した時点でパタン300の転送は
終了する。パタン301についても同様な方法によりパタ
ンを転送することが可能である。また、外接枠内に1文
字が含まれるデータについては外接枠内のパタンを同様
な方法により転送することが出来る。The pattern transfer method will be described below using the pattern example in which the cutout position is determined as shown in FIG. Also, the fourth
The figure shows patterns and cut-out positions stored in the pattern memory 204 in the block diagram of FIG.
The coordinates are such that the horizontal axis is the X axis and the vertical axis is the Y axis, and the pattern memory 204 is located in the fourth quadrant. XM and Y
M indicates the size of the pattern memory 204, and in this embodiment, XM = YM = 128 meshes. PR and PB indicate the circumscribing frames of the patterns stored in the pattern memory 204, and the circumscribing frame is represented by four straight lines X = 0, X = PR, Y = 0, Y = PR. In FIG. 4, reference numerals 300 and 301 denote patterns, and straight lines Y = y 1 , X = x 1 , and X = x 2 denote cutout positions. In the pattern memory in this embodiment, data representing one mesh has the structure shown in FIG. In the figure, (1)
When 1 is 1, it means that there was a white spot during column scanning from the lower side to the upper side, and when (1) is 0, it means that it was other than the white spot. Further, when (2) is 1, it means that there was a white spot during column scanning from the upper side to the lower side, and when (2) is 0, it means other than the white point. Furthermore, when (3) is 1, it means a black dot, and (3) is 0.
When, it means a white dot. Therefore, the pattern data to be transferred is only the data shown in (3). X
The mesh on the straight line represented by = 0 is Y from the point of Y = 0.
The pattern data is transferred to the point of Y = PB by incrementing the coordinates one by one. The X coordinate is incremented after the completion of the one-column transfer. Repeat the transfer for each column,
When the transfer of the column of = x 1 is completed, the pattern data is masked and the fixed value 0 is transferred from the next column to the column of X = x 2 from the Y coordinate 0 to Y D. Up to the next column of X = x 3, the Y coordinate from 0 to Y D and Y 1 to PB are masked and a fixed value of 0 is transferred. The transfer of the pattern 300 is completed at the time when the transfer to the column of X = x 3 is completed. The pattern 301 can also be transferred by the same method. Further, for data in which one character is included in the circumscribing frame, the pattern in the circumscribing frame can be transferred by a similar method.
次に、第6図、第7図及び第8図に示すフローチャート
に基づいて本実施例の処理の流れを詳細に説明する。こ
こで、第6図は全体の流れを示し、第7図及び第8図は
それぞれ上下2回の走査によるパタンの領域の分類、及
び切出し領域の決定の流れ図を示している。先ず、第6
図の全体の流れ図より説明する。S400では、読取動作を
開始する。S401ではラインバッファに格納されたパタン
データを1列読出し、第1図での黒点ヒストグラム作成
回路220にて黒点ヒストグラムを作成しヒストグラムメ
モリ230に格納する。S402においては1行分全ての黒点
ヒストグラムの作成終了を検出し、1行全て作成される
までS401の処理を繰返す。S403においては処理した文字
を管理し、1行中全部の文字の切出しが終了するまで以
下の処理を繰返す。S404では黒点ヒストグラムをヒスト
グラムメモリより読出し、黒点ヒストグラムの始点、及
び終点を検出しブロックとする。また、該ブロックの長
さと閾値γ1,γ2とを比較し何文字で構成されるブロッ
クであるかを保持しておく。S405においては第1図の外
接枠検出回路221においてブロックの外接枠を検出し、
その外接枠内のパタンデータをパタンメモリ204に転送
する。S406においては前記保持されたブロックの長さの
判定結果により、1文字であればパタンメモリ204のパ
タンデータを出力段へ転送し次の文字の処理へ進む。2
文字以上であれば、以下の処理を行う。S407において
は、外接枠の上辺及び下辺からそれぞれ対辺へ列走査を
行いパタンの領域の分類を行い結果をパタンメモリ204
に格納する。S408においては外接枠内の水平走査を行い
前記分類結果をパタンメモリ204より読出し切出し領域
の検出を行って切出し位置を決定する。Next, the flow of processing of this embodiment will be described in detail based on the flowcharts shown in FIGS. 6, 7, and 8. Here, FIG. 6 shows the overall flow, and FIGS. 7 and 8 show flow charts for classifying pattern regions and determining cut-out regions by scanning two times, respectively. First, the sixth
The flow chart of the entire figure will be described. In S400, the reading operation is started. In S401, one row of the pattern data stored in the line buffer is read out, a black dot histogram creating circuit 220 in FIG. 1 creates a black dot histogram and stores it in the histogram memory 230. In S402, the completion of creation of all the black dot histograms for one line is detected, and the process of S401 is repeated until all the lines are created. In S403, the processed characters are managed, and the following processes are repeated until the cutting out of all the characters in one line is completed. In S404, the black dot histogram is read from the histogram memory, and the start point and end point of the black dot histogram are detected and set as blocks. Further, the length of the block is compared with the thresholds γ 1 and γ 2 and the number of characters in the block is held. In S405, the circumscribing frame detection circuit 221 of FIG. 1 detects the circumscribing frame of the block,
The pattern data in the circumscribed frame is transferred to the pattern memory 204. In S406, the pattern data of the pattern memory 204 is transferred to the output stage if there is one character according to the judgment result of the length of the held block, and the process proceeds to the next character. Two
If it is more than the character, the following processing is performed. In S407, column scanning is performed from the upper side and the lower side of the circumscribing frame to the opposite side, the pattern areas are classified, and the result is recorded in the pattern memory 204.
To store. In S408, horizontal scanning is performed within the circumscribing frame, the classification result is read from the pattern memory 204, and the cutout area is detected to determine the cutout position.
S411では、切出し位置が決定できたかどうか検出し、検
出済みであれば、S409において、パタンメモリ204内の
パタンを切出し位置に従って転送し、パタンメモリ204
内のパタンを全て転送した時点で次の文字の処理を行
う。また、切出し位置が検出出来ない場合には以下の処
理を行う。S412において、ブロックの外接枠について水
平2等分割線を検出し、S413においては該水平2等分割
線で分割される上側の新たな外接枠を求める。S414,S41
5では指定された外接枠についてS407,S408と同一の処理
を行い、S416で上下の外接枠の処理が両方終了したかを
検出し、下側が終了していなければS418にて下側の外接
枠を検出しS414及びS415で下側の切出し領域を検出す
る。分割した上下の外接枠で切出し位置が決定されると
S417において上下の切出し位置より、ブロックの切出し
位置の合成を行い、S409でパタンメモリ204内のパタン
を転送する。パタンメモリ204内のパタンを全て転送し
た時点で次の文字の処理を行う。In S411, it is detected whether or not the cutout position can be determined. If detected, in S409, the pattern in the pattern memory 204 is transferred according to the cutout position, and the pattern memory 204
When all the patterns in the above are transferred, the next character is processed. If the cutout position cannot be detected, the following processing is performed. In S412, a horizontal bisector is detected for the circumscribing frame of the block, and in S413, a new upper circumscribing frame divided by the horizontal bisector is obtained. S414, S41
In step 5, the same processing as in S407 and S408 is performed on the specified circumscribed frame, and in step S416 it is detected whether the processing of both the upper and lower circumscribed frames has ended. If the lower side has not ended, the lower circumscribed frame in S418. Is detected, and the lower cutout region is detected in S414 and S415. When the cutout position is determined by the upper and lower circumscribed frames
In S417, the block cutout positions are combined from the upper and lower cutout positions, and the pattern in the pattern memory 204 is transferred in S409. When all the patterns in the pattern memory 204 have been transferred, the next character is processed.
次に、第6図におけるS407及びS408の処理について第7
図及び第8図に詳細なフローチャートを示し、その動作
を順に説明する。Next, the processing of S407 and S408 in FIG.
A detailed flowchart is shown in FIG. 8 and FIG. 8, and its operation will be described in order.
第7図は、文字パタン領域の分類と、白点から黒点への
変化点検出の流れを示している。S500で、文字パタンデ
ータが入力されると、S501〜S503では初期化であ、パタ
ンメモリ204のx,yの座標を文字外接枠の上辺左端に設定
し、走査の方向を示す値U/Dを上辺より下辺に向って走
査するので2とする。S504においては、パタンメモリの
内容を調べPM(x,y)=1(黒点)であれば処理をS514
へ移し、PM(x,y≠1(白色)であるときは、S505でパ
タンメモリ204の内容をPM(x,y)=(PM(x,y).OR.U/
D)とする。S506においてはスキャンの方向によりyカ
ウンタの値をインクリメントあるいはデクリメントす
る。S507では1例の終了を検出し、1例終了が検出され
るとS508以下の処理を行い、1例終了が検出されるとS5
08以下の処理を行い、1例終了でなければS504に戻り上
記処理を繰返す。S507で1列終了が検出されるとS508で
は1列終了フラグであるEに1をたてる。S509では当該
列が1列終了を始めて検出した例であるこを示すフラグ
Cにより始めての列であればS510で当該列のXカウンタ
205の値をxSに格納し、前列も1列終了を検出した列で
あるときはS511へ進む。S511においてはフラグCは当該
列が1列終了を検出しているので1をセットし、S512に
進み次の列の処理を行う。S514では、1列終了検出フラ
グCを判定し0であればS516へ進み、フラグCが1であ
れば、1/2(xS+x−1)を切出し点としてxPに登録す
る。検出されたxPは全て登録し、第6図でS417の切出し
位置の合成を行うときに切出し位置として用いる。S516
においてはフラグCをリセットしてS512に進み次列の処
理を行う。FIG. 7 shows the flow of classification of character pattern areas and detection of change points from white points to black points. When character pattern data is input in S500, initialization is performed in S501 to S503, and the x, y coordinates of the pattern memory 204 are set at the upper left end of the character circumscribing frame, and the value U / D indicating the scanning direction is set. Since the scanning is performed from the upper side toward the lower side, it is set to 2. In S504, the contents of the pattern memory are checked, and if PM (x, y) = 1 (black dot), the process is executed in S514.
If PM (x, y ≠ 1 (white), then the contents of the pattern memory 204 are PM (x, y) = (PM (x, y) .OR.U / in S505.
D). In S506, the value of the y counter is incremented or decremented depending on the scanning direction. In S507, the end of one example is detected, when the end of one example is detected, the processing of S508 and subsequent steps is performed, and when the end of one example is detected, S5 is performed.
08 The following processes are performed, and if one example is not completed, the process returns to S504 and the above processes are repeated. When the end of one row is detected in S507, 1 is set to E which is the end of one row flag in S508. In S509, if the column is the first column due to the flag C indicating that it is an example in which the end of one column is detected for the first time, in S510, the X counter of the column is
The value of 205 is stored in x S, and when the previous column is also the column in which the end of one column is detected, the process proceeds to S511. In S511, the flag C is set to 1 because the column has detected the end of one column, and the flow advances to S512 to process the next column. In S514, the one-column end detection flag C is determined, and if it is 0, the process proceeds to S516, and if the flag C is 1, 1/2 (x S + x−1) is registered in x P as a cutout point. All the detected x P are registered and used as the cutout position when the cutout positions of S417 are combined in FIG. S516
In, the flag C is reset, and the process proceeds to S512 to perform the process of the next column.
S517においてxカウンタ205が外接枠の右端であること
が検出されるとS518にて1列終了フラグEにより検出済
であれば次の処理を打切りS521で文字線検出によるパタ
ンの領域の分類処理は終了する。フラグEが1列終了を
未検出であればS519においてU/D=2であればS520でU/D
を4にセットし、xカウンタ205,yカウンタ206を初期化
してS504に戻り処理を行う。U/D=4のときはS521に進
み処理を終了する。When it is detected in S517 that the x counter 205 is at the right end of the circumscribing frame, if the one-row end flag E has been detected in S518, the next process is terminated and in S521, the pattern region classification process by the character line detection is performed. finish. If flag E has not detected the end of one row, U / D in S519 = U / D in S520 if 2
Is set to 4, the x counter 205 and the y counter 206 are initialized, and the process returns to S504 for processing. When U / D = 4, the process proceeds to S521 and ends the processing.
第8図はパタン領域の変化点検出と切出し領域の決定に
ついても流れを示すものであ、パタンメモリ204の文字
外接枠内の水平走査を上辺左端より行い切出し領域の決
定をする。S600,S601ではそれぞれyカウンタ206,xカウ
ンタ205を初期化する。S602では行走査中の領域の変化
を保持するための状態レジスタ(ST1〜ST3)409〜407の
初期化を行う。現在位置の状態を示すものはST3であ
り、走査中現在の領域の前の領域を示すものはST2であ
り、ST2前の領域を示すものはST1である。S603では、パ
タンメモリ204の内容PM(x,y)がST3と比較し一致して
いればS605に進み、一致していなければ該座標は変化点
であるので、S604でST2,ST3の内容をそれぞれST1,ST2へ
シフトする。S605においてはPM(x,y)の内容をST3にシ
フトする。S606では状態レジスタST3が“2"あるいは
“4"であるか判定し、“2"あるいは“4"のときは、xカ
ウンタ205の内容を(x REGI)308に格納する。S608では
状態レジスタST1,ST2,ST3の状態の組合せを判定し、S61
6に示す組合せと一致する場合にはS611〜S613により、x
1により(x REGI)306を、x2にxカウンタ205の内容
を、y1にYカウンタ206の内容を格納する。S614,S615に
おいてyカウンタ206をインクリメントし、文字外接枠
の下辺と一致するまでS601に戻同様の処理を行う。ただ
し、S608で組合せがS616の後半の2項である場合には、
S611では、x1にx REGIの内容から−1を加えたものを格
納する。FIG. 8 also shows the flow for detecting change points of the pattern area and determining the cutout area. The horizontal scan in the character circumscribing frame of the pattern memory 204 is performed from the left end of the upper side to determine the cutout area. In S600 and S601, the y counter 206 and x counter 205 are initialized, respectively. In S602, the state registers (ST1 to ST3) 409 to 407 for holding the changes in the area during row scanning are initialized. The state of the current position is ST3, the region before the current region being scanned is ST2, and the region before ST2 is ST1. In S603, the contents PM (x, y) of the pattern memory 204 are compared with ST3, and if they match, the process proceeds to S605. If they do not match, the coordinate is the change point, so the contents of ST2 and ST3 are changed in S604. Shift to ST1 and ST2 respectively. In S605, the contents of PM (x, y) are shifted to ST3. In S606, it is determined whether the status register ST3 is "2" or "4". When the status register ST3 is "2" or "4", the content of the x counter 205 is stored in (x REGI) 308. In S608, the state combination of the status registers ST1, ST2, ST3 is determined, and S61
If they match the combinations shown in 6, then use S611 to S613 to determine x
1 stores (x REGI) 306, x 2 stores the contents of the x counter 205, and y 1 stores the contents of the Y counter 206. In steps S614 and S615, the y counter 206 is incremented, the process returns to step S601 and the same processing is performed until it matches the lower side of the character circumscribing frame. However, if the combination in S608 is the second half of S616,
In S611, stores the plus -1 from the contents of x REGI to x 1.
S608において、状態レジスタST1〜ST3がS616に示す組合
せと一致しない場合は、S609,S610において、xカウン
タ205をインクリメントし、文字外接枠の右辺と一致す
るまでS603に戻前記処理を繰返す。S615でyカウンタ20
6の値が文字外接枠の下辺と一致した場合は、x1,x2,y1
の値を切出し点とする。In S608, if the status registers ST1 to ST3 do not match the combination shown in S616, the x counter 205 is incremented in S609 and S610, and the process returns to S603 until it matches the right side of the character circumscribing frame, and the above processes are repeated. Y counter 20 with S615
If the value of 6 matches the bottom of the character bounding box, x 1 , x 2 , y 1
The value of is the cut-out point.
以上説明したように、本実施例によれば、前後の文字パ
タンが当該文字パタンに重なった場合でも、当該文字パ
タンが欠落したり、前後の文字パタンの一部が混入する
ことなく文字パタンの切出しを行うことが出来る。As described above, according to the present embodiment, even when the character patterns before and after overlap with the character pattern, the character pattern is omitted without missing the character pattern or mixing a part of the character patterns before and after the character pattern. It can be cut out.
さらに、本実施例においては、2文字が重な合った場合
を示したが、3文字以上重な合った場合においても、重
な合った文字の先頭より2文字を基準に順次切出し点を
決定することにより同様な効果を得ることが出来る。Further, in this embodiment, the case where two characters overlap each other is shown, but even when three characters or more overlap each other, the cut-out points are sequentially determined based on two characters from the beginning of the overlapped characters. By doing so, a similar effect can be obtained.
(発明の効果) 以上説明したように、本発明によれば、文字パタンの外
接枠の上下の辺から各々対辺に向って列走査を行うこと
より背景部分を走査方向別の領域に分類し、その分類結
果により外接枠内の水平走査を行って切出し領域を検出
し、切出し位置を決定するので、精度の高い文字切出し
を行うことができる。また、パタンの外接枠内を走査し
て、変化点の検出を行うことにより実現しているので簡
単な回路構成で実施することが可能である。さらに、本
発明を用いることにより、隣接した文字が重な合った場
合でも切出しが可能であるので、文字記入枠の間隔を小
さくすることができ一行当りの読取可能文字数を増やす
ことができる。従って、多くの種類の帳票に対応でき、
帳票設計の自由度が大きく、従って性能のよいOCRが実
現出来るという効果がある。(Effects of the Invention) As described above, according to the present invention, the background portion is classified into the regions by the scanning direction by performing the column scanning from the upper and lower sides of the circumscribing frame of the character pattern toward the opposite sides, According to the classification result, horizontal scanning in the circumscribing frame is performed to detect the cutout area and the cutout position is determined, so that highly accurate character cutout can be performed. Further, since the change point is detected by scanning the inside of the circumscribing frame of the pattern, it can be implemented with a simple circuit configuration. Furthermore, by using the present invention, it is possible to cut out even when adjacent characters overlap each other, so that the interval between the character entry frames can be reduced and the number of readable characters per line can be increased. Therefore, it can handle many types of forms,
There is a great degree of freedom in designing the form, and therefore OCR with good performance can be realized.
第1図は本発明の一実施例を示すブロック図、第2図は
第1図のパタン領域変化点検出回路の内部構成を示すブ
ロック図、第3図は第1図の切出し領域検出回路の内部
構成を示すブロック図、第4図は第1図の実施例の切出
し位置が決定したパタン図、第5図はパタンメモリの一
メッシュ分のデータの構成図、第6図乃至第8図は第1
図の実施例の文字切出し処理を示すフローチャート、第
9図は従来の方式の具体例の説明図である。 200…画像信号、201…ラインバッファ、202…外接枠作
成回路、203…切替回路、204…パタンメモリ、205…x
アドレスカウンタ(xカウンタ)、206…yアドレスカ
ウンタ(yカウンタ)、207…制御回路、208…パタン領
域分類回路、209…文字線検出回路、210…パタン領域変
換点検出回路、211…切出し領域検出回路、300…yカウ
ンタの出力、301…xカウンタの出力、302…文字パタン
データ、303…レジスタ(REGA)、304…レジスタ(REG
D)、305…コンパレータ、306…レジスタ(xREG I)、3
07…レジスタ(xREG II)、308…レジスタ(yREG I)、
400…制御信号、401…文字パタンデータ、402…変化点
検出信号、403〜406…遷移レジスタ、407〜409…状態レ
ジスタ、410〜413…コンパレータ、414…論理和回路、4
15…フリップフロップ(F/F)。1 is a block diagram showing an embodiment of the present invention, FIG. 2 is a block diagram showing the internal structure of the pattern area change point detection circuit of FIG. 1, and FIG. 3 is a cutout area detection circuit of FIG. FIG. 4 is a block diagram showing an internal structure, FIG. 4 is a pattern diagram in which the cutout position of the embodiment of FIG. 1 is determined, FIG. 5 is a block diagram of data of one mesh of the pattern memory, and FIGS. First
FIG. 9 is a flowchart showing a character cutting process of the embodiment shown in FIG. 200 ... Image signal, 201 ... Line buffer, 202 ... Outer frame creation circuit, 203 ... Switching circuit, 204 ... Pattern memory, 205 ... x
Address counter (x counter), 206 ... y Address counter (y counter), 207 ... Control circuit, 208 ... Pattern area classification circuit, 209 ... Character line detection circuit, 210 ... Pattern area conversion point detection circuit, 211 ... Cutout area detection Circuit, 300 ... y counter output, 301 ... x counter output, 302 ... character pattern data, 303 ... register (REGA), 304 ... register (REG
D), 305 ... Comparator, 306 ... Register (xREG I), 3
07 ... Register (xREG II), 308 ... Register (yREG I),
400 ... Control signal, 401 ... Character pattern data, 402 ... Change point detection signal, 403-406 ... Transition register, 407-409 ... Status register, 410-413 ... Comparator, 414 ... Logical sum circuit, 4
15 ... Flip-flop (F / F).
Claims (1)
得られる量子化された文字パタン列から1文字毎の文字
パタンを分離して抽出する文字切出し装置において、 前記文字パタン列を格納するラインバッファメモリと、 該ラインバッファメモリを文字パタン列の列方向に1列
毎に走査して列方向の黒点ヒストグラムを作成し、第1
の閾値より大きい黒点ヒストグラムが連続して第2の閾
値以上続く黒点ヒストグラムの幅に基づき切出し対象の
ブロックを検出するブロック検出手段と、 前記ブロック検出手段で得られたブロックの幅と第3の
閾値とを比較して該幅が何文字に相当するかを判定する
判定手段と、 前記ブロック検出手段で検出されたブロックの文字パタ
ン列を行方向に各行毎に走査して作成した行方向の黒点
ヒストグラムと前記列方向の黒点ヒストグラムに基づい
て文字外接枠を検出する外接枠検出手段と、 前記外接枠検出手段で得られた文字外接枠内の文字パタ
ン列を記憶する記憶手段と、 前記判定手段が複数文字であると判定した場合には前記
文字外接枠の上辺,下辺から各々反対側の辺に向かって
走査して前記記憶手段から文字パタン列の内容を読出
し、該内容が文字領域であるか背景領域であるかを検出
し、この検出処理により上辺からの走査で検出された背
景領域,下辺からの走査で検出された背景領域,文字領
域,並びに該走査で文字領域が検出されると、該列の走
査を打ち切り、当該走査を打ち切ったことにより該走査
を受けなかった背景領域の各領域に前記文字外接枠内の
文字パタン列を分類する分類手段と、 前記分類手段による文字外接枠内の分類結果について、
水平走査を行って分類が変化する変化点を検出して順次
格納すると共に該変化点の前後の状態を保持し、該状態
の遷移を所定の分類の変化の遷移の組合せと比較して一
致する変化点を検出する変化点検出手段と、 前記変化点検出手段で一致する変化点が検出されない場
合には、前記文字外接枠を水平方向に分割する分割手段
と、 前記分割手段で分割された各分割領域を新たな文字外接
枠として前記分類手段及び変化点検出手段により各分割
領域毎に検出された変化点に基づいて文字切出し位置を
決定する決定手段とを有することを特徴とする文字切出
し装置。1. A character segmentation device for separating and extracting a character pattern for each character from a quantized character pattern sequence obtained by photoelectrically converting a character string entered on a form, wherein the character pattern sequence is A line buffer memory for storing the line buffer memory, and scanning the line buffer memory for each column in the column direction of the character pattern column to create a black dot histogram in the column direction.
Block detection means for detecting a block to be cut out based on the width of a black dot histogram in which a black dot histogram larger than the threshold value continues for a second threshold value or more, and a block width and a third threshold value obtained by the block detection means. And a determination means for determining how many characters the width corresponds to, and a black dot in the row direction created by scanning the character pattern string of the block detected by the block detection means in each row in the row direction. A circumscribing frame detecting means for detecting a character circumscribing frame based on the histogram and the black dot histogram in the column direction, a storage means for storing a character pattern sequence in the character circumscribing frame obtained by the circumscribing frame detecting means, and the judging means. Is determined to be a plurality of characters, the contents of the character pattern string are read from the storage means by scanning from the upper side and the lower side of the character circumscribing frame toward the opposite sides. Then, it is detected whether the content is a character area or a background area, and by this detection processing, a background area detected by scanning from the upper side, a background area detected by scanning from the lower side, a character area, and When a character region is detected by scanning, the scanning of the column is stopped, and the character pattern sequence in the character circumscribed frame is classified into each region of the background region that has not been scanned due to the termination of the scan. And the classification result in the character circumscribed frame by the classification means,
The horizontal scanning is performed to detect change points at which the classification changes, and the changes are stored sequentially, and the states before and after the change points are held, and the transitions of the states are compared with a combination of transitions of changes of a predetermined classification to be matched. Change point detecting means for detecting a change point, when no change point is detected by the change point detecting means, a dividing means for dividing the character circumscribing frame in a horizontal direction, and A character cutout device having a divided area as a new character circumscribing frame, and a determination means for determining a character cutout position based on a change point detected for each divided area by the classification means and the change point detection means. .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP60263376A JPH0795331B2 (en) | 1985-11-22 | 1985-11-22 | Character cutting device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP60263376A JPH0795331B2 (en) | 1985-11-22 | 1985-11-22 | Character cutting device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS62123582A JPS62123582A (en) | 1987-06-04 |
| JPH0795331B2 true JPH0795331B2 (en) | 1995-10-11 |
Family
ID=17388626
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP60263376A Expired - Lifetime JPH0795331B2 (en) | 1985-11-22 | 1985-11-22 | Character cutting device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0795331B2 (en) |
-
1985
- 1985-11-22 JP JP60263376A patent/JPH0795331B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPS62123582A (en) | 1987-06-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5907631A (en) | Document image processing method and system having function of determining body text region reading order | |
| JP3308032B2 (en) | Skew correction method, skew angle detection method, skew correction device, and skew angle detection device | |
| US8059868B2 (en) | License plate recognition apparatus, license plate recognition method, and computer-readable storage medium | |
| JPS6159568A (en) | document processing device | |
| US5164996A (en) | Optical character recognition by detecting geo features | |
| JP4275866B2 (en) | Apparatus and method for extracting character string pattern from color image | |
| JPH0256708B2 (en) | ||
| JPH0256707B2 (en) | ||
| JP2926066B2 (en) | Table recognition device | |
| CN113408532A (en) | Medicine label number identification method based on multi-feature extraction | |
| JPH06208625A (en) | Image processing method and apparatus | |
| JPH0795331B2 (en) | Character cutting device | |
| JPH0581474A (en) | Character string extracting method and character area detecting method | |
| JP2832928B2 (en) | Character recognition method | |
| JPH0433074B2 (en) | ||
| JP2954218B2 (en) | Image processing method and apparatus | |
| JPS62121589A (en) | Character segmenting system | |
| JPS61196381A (en) | Character segmenting system | |
| JP2522511B2 (en) | Image contour tracking unit | |
| JPH03126188A (en) | Character recognizing device | |
| JPS63131287A (en) | Character recognition method | |
| JP3277977B2 (en) | Character recognition method | |
| JPH03177985A (en) | Registering method for character data | |
| JP2002251613A (en) | Graphic recognition method and apparatus | |
| JP2979089B2 (en) | Character recognition method for scene images |