JP2812705B2 - Character extraction device - Google Patents
Character extraction deviceInfo
- Publication number
- JP2812705B2 JP2812705B2 JP1072396A JP7239689A JP2812705B2 JP 2812705 B2 JP2812705 B2 JP 2812705B2 JP 1072396 A JP1072396 A JP 1072396A JP 7239689 A JP7239689 A JP 7239689A JP 2812705 B2 JP2812705 B2 JP 2812705B2
- Authority
- JP
- Japan
- Prior art keywords
- character
- ruled line
- black
- predetermined
- line
- 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
- 238000001514 detection method Methods 0.000 claims description 206
- 230000001186 cumulative effect Effects 0.000 claims description 67
- 238000013500 data storage Methods 0.000 claims description 20
- 230000002093 peripheral effect Effects 0.000 description 27
- 238000000926 separation method Methods 0.000 description 22
- 238000010586 diagram Methods 0.000 description 14
- 238000000034 method Methods 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 4
- 238000007796 conventional method Methods 0.000 description 3
- 238000000605 extraction Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 239000000470 constituent Substances 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 101100096726 Arabidopsis thaliana SSL5 gene Proteins 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
Landscapes
- Character Input (AREA)
Description
【発明の詳細な説明】 (産業上の利用分野) この発明は、罫線を伴なう文字行から文字を切出すた
めの文字切出し装置に関する。Description: TECHNICAL FIELD The present invention relates to a character extracting device for extracting characters from a character line with ruled lines.
(従来の技術) 近年、大量の文書の処理効率を高めるために、文書に
記載された情報を機械的に計算機へ入力できるようにす
ることへの要求が高まっている。この機械的入力に利用
される文字認識装置は、印刷され或は手書きされた文字
群の画像から一文字分の画像を一文字単位に分離し(切
出し)、分離した一文字分の画像の文字認識を行なう。(Prior Art) In recent years, in order to increase the processing efficiency of a large amount of documents, there is an increasing demand for enabling information written in the documents to be mechanically input to a computer. The character recognition device used for this mechanical input separates (cuts out) an image of one character from a printed or handwritten character group image in character units, and performs character recognition of the separated image of one character. .
一般に用いられる文書には文字に加え罫線が付加され
ることも多いが、文字認識のためには付加された罫線を
含まないように一文字分の画像の切出を行なう必要があ
る。Generally used documents are often provided with ruled lines in addition to characters, but for character recognition, it is necessary to cut out an image of one character so as not to include the added ruled lines.
罫線を含まないように切出しを行なう装置や方式とし
ては例えば、特開昭60−160487号公報に開示されている
光学的文字読取装置や、特開昭62−217385号公報に開示
されている文字分離方式がある。Examples of a device and a method for cutting out so as not to include a ruled line include an optical character reading device disclosed in JP-A-60-160487 and a character disclosed in JP-A-62-217385. There is a separation method.
前者の従来装置では、読取部からの画像データを格納
した画像メモリ上に仮想的に行方向及び列方向を設定し
(列方向は行方向に垂直な方向である。以下、仮想的に
設定された行方向及び列方向を所定の行方向及び所定の
列方向と称す)、文書の画像データを行方向に走査し、
この走査で黒画素数を行方向に累積して行方向の周辺分
布を作成し、所定の黒画素数を越える周辺分布の領域を
アンダライン部及び所定の黒画素数未満の周辺分布の領
域を文字部として検出し、さらに列方向における文字部
の縁の位置を文字の列方向における始端位置及び終端位
置として検出する。そしてアンダライン部を除き文字部
のみを走査し、この走査で黒画素数を列方向に累積して
列方向の周辺分布を作成し、列方向の累積黒画素数の変
化から文字の行方向における始端及び終端位置を検出す
る。In the former conventional apparatus, a row direction and a column direction are virtually set on an image memory storing image data from the reading unit (the column direction is a direction perpendicular to the row direction. Hereinafter, virtually set). The row direction and the column direction are referred to as a predetermined row direction and a predetermined column direction), and the image data of the document is scanned in the row direction.
In this scanning, the number of black pixels is accumulated in the row direction to create a peripheral distribution in the row direction, and the area of the peripheral distribution exceeding the predetermined number of black pixels is defined as an underline portion and the area of the peripheral distribution less than the predetermined number of black pixels. The position of the edge of the character portion in the column direction is detected as the start position and the end position of the character in the column direction. Then, only the character portion is scanned except for the underline portion, and the number of black pixels is accumulated in the column direction by this scanning to create a peripheral distribution in the column direction. Detect start and end positions.
この従来装置において、罫線が行方向に沿って付加さ
れているときの行方向における文字の始端及び終端位置
を精度良く検出するためには、画像の真の行方向を所定
の行方向に一致させるように原稿等の画像データを得、
周辺分布作成の際に所定の行方向において文字及び罫線
が重なり合うのを少なくするようにする。In this conventional device, in order to accurately detect the start and end positions of characters in the line direction when the ruled line is added along the line direction, the true line direction of the image is made to coincide with the predetermined line direction. Image data such as manuscript
At the time of creating the marginal distribution, the overlapping of characters and ruled lines in a predetermined line direction is reduced.
また後者の従来方式では、アンダライン等の直線を伴
う文字行を包含する画像上に複数の局所領域を設定し、
これら各局所領域の画像を、パターンマッチングによっ
て所定の方向線素に記号化し、さらに方向線素を分類す
る。そしてアンダライン等の文字認識に不要な線分と同
じ方向を有する方向線素(例えば水平直線成分)から構
成される線分のなかから、所定の条件(例えば長さや存
在領域)を有する線分を検出し、検出した線分を不要線
分として画像から除去する。このようにして不要線分を
除去した画像を得たのち、この画像を走査して行及び列
方向の周辺分布を作成し、作成した周辺分布から所定の
行及び列方向における文字の始端位置と終端位置とを検
出していた。In the latter conventional method, a plurality of local regions are set on an image including a character line with a straight line such as an underline,
The images of these local regions are symbolized into predetermined direction elements by pattern matching, and the direction elements are further classified. Then, a line segment having a predetermined condition (for example, length or existing area) is selected from line segments composed of direction line elements (for example, horizontal straight line components) having the same direction as a line segment unnecessary for character recognition such as an underline. Is detected, and the detected line segment is removed from the image as an unnecessary line segment. After obtaining an image from which unnecessary line segments have been removed in this way, this image is scanned to create a peripheral distribution in the row and column directions, and the starting position of the character in a predetermined row and column direction is determined from the created peripheral distribution. The end position was detected.
(発明が解決しようとする課題) しかしながら上述した前者の従来装置では、画像メモ
リ上に設定した所定の行方向が画像の真の行方向からず
れていると、周辺分布作成の際の所定の行方向における
文字及び罫線の重なりが多くなり、従って同一の主走査
線上に文字の黒画素及び罫線の黒画素が混在し、この結
果所定の行方向の周辺分布から文字の位置及び罫線の位
置を精度良く検出することが困難となる。(Problems to be Solved by the Invention) However, in the former conventional apparatus described above, if the predetermined row direction set in the image memory is deviated from the true row direction of the image, the predetermined The overlap of characters and ruled lines in the direction increases, so that black pixels of the character and black lines of the ruled line are mixed on the same main scanning line. As a result, the position of the character and the position of the ruled line can be accurately determined from the peripheral distribution in a predetermined line direction. It is difficult to detect well.
また上述した前者の従来装置では、所定の行方向が真
の行方向からずれていたとしても、同一文字行内におい
ては所定の行方向における文字始端位置及び終端位置を
全て同一とするため、文字の端が欠けて実質的に文字認
識不可能な不完全な文字を切出してしまう。この文字の
欠けは行の端部に近いほどその欠け程度がひどくなる。Further, in the former conventional device described above, even if the predetermined line direction is deviated from the true line direction, the character start and end positions in the predetermined line direction are all the same within the same character line. An incomplete character that is practically unrecognizable due to a missing end is cut out. The degree of the lack of this character becomes more severe near the end of the line.
しかも所定の行方向及び真の行方向が不一致なことに
加え文字と罫線とが接触していると、文字及び罫線位置
の検出精度はさらに悪化し、文字の欠け具合もさらにひ
どくなる。Moreover, if the character and the ruled line are in contact with each other in addition to the mismatch between the predetermined line direction and the true line direction, the accuracy of detecting the position of the character and the ruled line is further deteriorated, and the degree of missing of the character is further increased.
また上述した後者の従来方式では、読取画像を複数の
局所領域に分割し、各局所領域の読取画像と所定の複数
の基本パターンとをマッチングによって比較し、この比
較結果に基づいて局所領域を方向線素に変換する。この
ような局所マッチング処理は複雑であり、従って従来方
式を採用した装置の装置構成は複雑化し、これがため装
置規模の大型化や装置のコスト高を招くという問題点が
あった。In the latter conventional method described above, the read image is divided into a plurality of local areas, the read image of each local area is compared with a predetermined plurality of basic patterns by matching, and the local area is oriented based on the comparison result. Convert to line elements. Such a local matching process is complicated, and therefore, the device configuration of the device adopting the conventional method is complicated, which causes a problem that the size of the device is increased and the cost of the device is increased.
この発明の目的は、上述した従来の問題点を解決する
ため、所定の行方向及び真の行方向が不一致の場合で
も、累積黒画素数の変化に基づいて、所定の行方向及び
列方向における文字の始端位置と終端位置とを、文字が
欠けないように精度良く検出できる文字切出し装置を提
供することにある。SUMMARY OF THE INVENTION An object of the present invention is to solve the above-described conventional problems, so that even when the predetermined row direction and the true row direction do not match, the predetermined row direction and column direction are determined based on the change in the number of accumulated black pixels. It is an object of the present invention to provide a character cutout device that can accurately detect the start position and the end position of a character so that the character is not lost.
(課題を解決するための手段) この目的の達成を図るため、この発明の文字切出し装
置は、 罫線付文字行を記載した情報媒体の光学的読取りを行
ない情報媒体の画像データを出力する読取部と、 読取部からの画像データを格納する画像データ記憶部
と、 画像データ記憶部の罫線付文字行領域内の画像データ
を走査して所定の列方向の累積黒画素数を走査線毎に検
出し、 ブロック閾値以上の列方向累積黒画素数を黒ブロック要
素及びブロック閾値未満の列方向累積黒画素数を白ブロ
ック要素として検出し、所定の行方向における長さが長
さ閾値を越える黒ブロックを検出したときはブロック閾
値を所定量増加させて当該長さ閾値を越える黒ブロック
の始端位置から黒及び白ブロック要素を再度検出し直
し、長さ閾値以下の黒ブロックの終端位置を検出したと
きは当該長さ閾値以下の黒ブロックの始端位置及び終端
位置を所定の行方向の文字始端位置及び終端位置として
検出すると共にブロック閾値を初期化し、 所定の行方向の文字始端位置及び終端位置に基づいて、
第一罫線検出領域を所定の行方向の文字始端位置に隣接
する位置であって所定の行方向の文字終端位置とは反対
側に罫線を含むように一文字毎に設定すると共に第二罫
線検出領域を所定の行方向の文字終端位置に隣接する位
置であって所定の行方向の文字始端位置とは反対側に罫
線を含むように一文字毎に設定する罫線検出領域設定部
と、 画像データ記憶部の第一及び第二罫線検出領域内の画
像データを走査して所定の行方向の累積黒画素数を走査
線毎に検出し、 行方向累積黒画素数の変化に基づいて第一及び第二罫線
検出領域内の罫線検出処理を一文字毎に行ない、 罫線検出処理結果に基づいて、所定の列方向の文字始端
位置及び終端位置を前記罫線よりも罫線付文字行領域の
中央部側に位置するように一文字毎に設定する文字罫線
分離部と、 読取部、罫線検出領域設定部及び文字罫線分離部の動
作制御を行なうと共に、所定の行方向の文字始端位置及
び終端位置と所定の列方向の文字始端位置及び終端位置
とを罫線付文字行領域内の個々の文字別に出力する制御
部とを備えて成ることを特徴とする。(Means for Solving the Problems) In order to achieve this object, a character extracting device according to the present invention optically reads an information medium in which a character line with a ruled line is described and outputs image data of the information medium. An image data storage unit for storing image data from the reading unit; and scanning the image data in the character line area with a ruled line in the image data storage unit to detect a cumulative number of black pixels in a predetermined column direction for each scanning line. Then, the number of column-direction cumulative black pixels equal to or greater than the block threshold is detected as a black block element and the number of column-direction cumulative black pixels less than the block threshold is detected as a white block element, and the black block whose length in a predetermined row direction exceeds the length threshold is detected. Is detected, the block threshold is increased by a predetermined amount, and the black and white block elements are detected again from the start position of the black block exceeding the length threshold, and the end of the black block having the length threshold or less is detected. When the position is detected, the start position and end position of the black block having the length threshold or less are detected as the character start position and end position in the predetermined line direction, and the block threshold value is initialized, and the character start position in the predetermined line direction is detected. And based on the end position
The first ruled line detection area is set for each character so as to include a ruled line at a position adjacent to the character start position in the predetermined line direction and opposite to the character end position in the predetermined line direction. A ruled line detection area setting unit that sets, for each character, a ruled line adjacent to the character end position in the predetermined line direction and opposite to the character start position in the predetermined line direction; and an image data storage unit Scanning the image data in the first and second ruled line detection areas to detect the cumulative number of black pixels in a predetermined row direction for each scanning line, and based on the change in the cumulative number of black pixels in the row direction, the first and second The ruled line detection processing in the ruled line detection area is performed for each character, and based on the ruled line detection processing result, the character start and end positions in a predetermined column direction are positioned closer to the center of the ruled line character line area than the ruled lines. To set character ruled line for each character And controls the operation of the reading unit, the ruled line detection area setting unit and the character ruled line separating unit, and sets the character start and end positions in a predetermined row direction and the character start and end positions in a predetermined column direction as a character with a ruled line. And a control unit for outputting for each character in the line area.
(作用) このような構成の文字切出し装置によれば、読取部
は、罫線付文字行を記載した情報媒体の光学的読取りを
行ない、この情報媒体の画像データを出力し、画像デー
タ記憶部は、読取部からの画像データを格納する。(Operation) According to the character extracting device having such a configuration, the reading unit optically reads the information medium in which the character line with the ruled line is described, outputs image data of the information medium, and the image data storage unit And the image data from the reading unit.
罫線検出領域設定部は、画像データ記憶部の罫線付文
字行領域内の画像データを走査して所定の列方向の累積
黒画素数を走査線毎に検出する。そして、ブロック閾値
以上の列方向累積黒画素数を黒ブロック要素及びブロッ
ク閾値未満の列方向累積黒画素数を白ブロック要素とし
て検出し、所定の行方向における長さが長さ閾値を越え
る黒ブロックを検出したときはブロック閾値を所定量増
加させて当該長さ閾値を越える黒ブロックの始端位置か
ら黒及び白ブロック要素を再度検出し直し、長さ閾値以
下の黒ブロックの終端位置を検出したときは当該長さ閾
値以下の黒ブロックの始端位置及び終端位置を所定の行
方向の文字始端位置及び終端位置として検出すると共に
ブロック閾値を初期化する。The ruled line detection area setting unit scans the image data in the character line area with a ruled line in the image data storage unit and detects the cumulative number of black pixels in a predetermined column direction for each scanning line. Then, the number of column-direction cumulative black pixels greater than or equal to the block threshold is detected as a black block element and the number of column-direction cumulative black pixels less than the block threshold is detected as a white block element, and the black block whose length in a predetermined row direction exceeds the length threshold is detected. Is detected, the block threshold is increased by a predetermined amount, the black and white block elements are detected again from the start position of the black block exceeding the length threshold, and the end position of the black block having the length threshold or less is detected. Detects the start position and end position of the black block having the length threshold or less as the character start position and end position in a predetermined line direction, and initializes the block threshold.
さらに罫線検出領域設定部は、所定の行方向の文字始
端位置及び終端位置に基づいて、第一罫線検出領域を所
定の行方向の文字始端位置に隣接する位置であって所定
の行方向の文字終端位置とは反対側に罫線を含むように
一文字毎に設定すると共に第二罫線検出領域を所定の行
方向の文字終端位置に隣接する位置であって所定の行方
向の文字始端位置とは反対側に罫線を含むように一文字
毎に設定する。Further, the ruled line detection area setting unit may set the first ruled line detection area at a position adjacent to the character start end position in the predetermined line direction based on the character start end position and the end position in the predetermined line direction. It is set for each character so as to include a ruled line on the side opposite to the end position, and the second ruled line detection area is a position adjacent to the character end position in the predetermined line direction and opposite to the character start position in the predetermined line direction. Set for each character so that a ruled line is included on the side.
そして文字罫線分離部は、画像データ記憶部の第一及
び第二罫線検出領域内の画像データを走査して所定の行
方向の累積黒画素数を走査線毎に検出し、この行方向累
積黒画素数の変化に基づいて第一及び第二罫線検出領域
内の罫線検出処理を行なう。さらに、罫線検出処理結果
に基づいて、所定の列方向の文字始端位置及び終端位置
を罫線よりも罫線付文字行領域の中央部側に位置するよ
うに一文字毎に設定する。The character ruled line separation unit scans the image data in the first and second ruled line detection areas of the image data storage unit, detects the cumulative number of black pixels in a predetermined row direction for each scan line, A ruled line detection process in the first and second ruled line detection areas is performed based on a change in the number of pixels. Further, based on the result of the ruled line detection processing, the character start and end positions in the predetermined column direction are set for each character so as to be located closer to the center of the ruled line character line area than the ruled line.
制御部はこれら読取部、罫線検出領域設定部及び文字
罫線分離部の動作制御を行なうと共に、所定の行方向の
文字始端位置及び終端位置と所定の列方向の始端位置及
び終端位置とを罫線付文字行領域内の個々の文字別に出
力する。The control unit controls the operation of the reading unit, the ruled line detection area setting unit, and the character ruled line separating unit, and determines the start and end positions of the character in the predetermined row direction and the start and end positions in the predetermined column direction with a ruled line. Output for each character in the character line area.
上述のように、所定の行方向における長さが長さ閾値
を越える黒ブロックを検出したときはブロック閾値を所
定量増加させて当該長さ閾値を越える黒ブロックの始端
位置から黒及び白ブロック要素を再度検出し直し、閾値
以下の黒ブロックの終端位置を検出したときは当該長さ
閾値以下の黒ブロックの始端位置及び終端位置を所定の
行方向の文字始端位置及び終端位置として検出する。従
って、長さ閾値を任意好適に設定することによって長さ
が文字幅を越える黒ブロックを検出せずにすみ、しかも
長さが長さ閾値以下となるまで黒及び白ブロック要素の
再検出を繰り返すので文字幅以内の黒ブロックのみを検
出することができ、従って文字始端位置及び終端位置の
検出精度を向上できる。As described above, when a black block whose length in the predetermined row direction exceeds the length threshold is detected, the block threshold is increased by a predetermined amount and the black and white block elements are shifted from the start position of the black block exceeding the length threshold. Is detected again, and when the end position of the black block equal to or less than the threshold value is detected, the start position and end position of the black block equal to or less than the length threshold value are detected as the character start position and end position in the predetermined line direction. Therefore, by setting the length threshold arbitrarily, it is not necessary to detect a black block whose length exceeds the character width, and re-detection of black and white block elements is repeated until the length becomes equal to or less than the length threshold. Therefore, only the black block within the character width can be detected, so that the detection accuracy of the character start position and the character end position can be improved.
さらに所定の列方向の文字始端位置及び終端位置の検
出を、第一及び第二罫線検出領域内における所定の行方
向の累積黒画素数の変化に基づいて検出することによっ
て、これら始端及び終端位置の検出処理を簡単化でき
る。Further, the start and end positions of the characters in the predetermined column direction are detected based on the change in the cumulative number of black pixels in the predetermined row direction in the first and second ruled line detection areas, so that these start and end positions are detected. Detection processing can be simplified.
しかも第一罫線検出領域を、所定の行方向の文字始端
位置に隣接する位置であって所定の行方向の文字終端位
置とは反対側の位置に罫線を含むように設定するので、
文字を構成する黒画素が第一罫線検出領域において所定
の列方向の累積黒画素数として計数されないように或は
ほとんど計数されないようにすることができる。その結
果、第一罫線検出領域内の罫線の位置を精度良く検出で
きる。同様に第二罫線検出領域を、所定の行方向の文字
終端位置と隣接する位置であって所定の行方向の文字始
端位置とは反対側の位置に罫線を含むように設定するの
で、文字を構成する黒画素が第二罫線検出領域における
所定の行方向の累積黒画素数として計数されないように
或はほとんど計数されないようにすることができる。そ
の結果、第二罫線検出領域内の罫線の位置を精度良く検
出できる。Moreover, since the first ruled line detection area is set to include a ruled line at a position adjacent to the character start position in the predetermined line direction and opposite to the character end position in the predetermined line direction,
The black pixels constituting the character can be prevented from being counted or almost not counted as the cumulative number of black pixels in the predetermined column direction in the first ruled line detection area. As a result, the position of the ruled line in the first ruled line detection area can be detected with high accuracy. Similarly, the second ruled line detection area is set to include a ruled line at a position adjacent to the character end position in the predetermined line direction and opposite to the character start position in the predetermined line direction. The constituent black pixels can be prevented from being counted or hardly counted as the cumulative number of black pixels in a predetermined row direction in the second ruled line detection area. As a result, the position of the ruled line in the second ruled line detection area can be detected with high accuracy.
従って第一及び第二罫線検出領域内における罫線の位
置を精度良く検出できるので、これがため文字の欠けを
生じないように或は文字の欠けを従来よりも少なくして
文字を切出すことができる。Therefore, since the position of the ruled line in the first and second ruled line detection areas can be detected with high accuracy, the character can be cut out so that the character is not lost or the character is reduced less than before. .
(実施例) 以下、図面を参照し、この発明の実施例につき説明す
る。尚、図面はこの発明が理解できる程度に概略的に示
してあるにすぎず、従って各構成成分の構成、入出力信
号、入出力信号の流れ、信号線の接続関係、動作の流れ
を図示例に限定するものではない。Hereinafter, embodiments of the present invention will be described with reference to the drawings. It should be noted that the drawings are only schematically shown to the extent that the present invention can be understood. It is not limited to.
装置構成 第1図はこの発明の実施例の構成を概略的に示す機能
ブロック図である。FIG. 1 is a functional block diagram schematically showing a configuration of an embodiment of the present invention.
この実施例の文字切出し装置は、読取部10、画像デー
タ記憶部12、罫線検出領域設定部14、文字罫線分離部16
及び制御部18から成る。The character extracting apparatus according to this embodiment includes a reading unit 10, an image data storage unit 12, a ruled line detection area setting unit 14, a character ruled line separating unit 16
And a control unit 18.
読取部10は罫線付文字行を記載した情報媒体の光学的
読取りを行ないこの情報媒体の画像データを出力し、画
像データ記憶部12は読取部10からの画像データを格納す
る。The reading unit 10 optically reads the information medium on which the character line with the ruled line is described, and outputs image data of the information medium. The image data storage unit 12 stores the image data from the reading unit 10.
罫線検出領域設定部14は画像データ記憶部12の罫線付
文字行領域内の画像データを走査して所定の列方向の累
積黒画素数を走査線毎に検出する。そしてブロック閾値
以上の列方向累積黒画素数を黒ブロック要素及びブロッ
ク閾値未満の列方向累積黒画素数を白ブロック要素とし
て検出し、所定の行方向における長さが長さ閾値を越え
る黒ブロックを検出したときはブロック閾値を所定量増
加させて当該長さ閾値を越える黒ブロックの始端位置か
ら黒及び白ブロック要素を再度検出し直し、長さ閾値以
下の黒ブロックの終端位置を検出したときは当該長さ閾
値以下の黒ブロックの始端位置及び終端位置を所定の行
方向の文字始端位置及び終端位置として検出すると共に
ブロック閾値を初期化する。The ruled line detection area setting unit 14 scans the image data in the character line area with a ruled line in the image data storage unit 12 and detects the cumulative number of black pixels in a predetermined column direction for each scanning line. Then, the number of column-direction cumulative black pixels equal to or greater than the block threshold is detected as a black block element and the number of column-direction cumulative black pixels less than the block threshold is detected as a white block element, and a black block whose length in a predetermined row direction exceeds the length threshold is detected. When detected, the block threshold is increased by a predetermined amount, the black and white block elements are detected again from the start end position of the black block exceeding the length threshold, and the end position of the black block below the length threshold is detected. The start and end positions of the black block having the length threshold or less are detected as the character start and end positions in a predetermined line direction, and the block threshold is initialized.
さらに罫線検出領域設定部14は、所定の行方向の文字
始端位置及び終端位置に基づいて、第一罫線検出領域を
所定の行方向の文字始端位置に隣接する位置であって所
定の行方向の文字終端位置とは反対側に罫線を含むよう
に一文字毎に設定すると共に第二罫線検出領域を所定の
行方向の文字終端位置に隣接する位置であって所定の行
方向の文字始端位置とは反対側に罫線を含むように一文
字毎に設定する。Further, the ruled line detection area setting unit 14 sets the first ruled line detection area at a position adjacent to the character start end position in the predetermined line direction based on the character start position and end position in the predetermined line direction. It is set for each character so as to include a ruled line on the side opposite to the character end position, and the second ruled line detection area is a position adjacent to the character end position in the predetermined line direction and the character start position in the predetermined line direction. Set for each character so as to include a ruled line on the opposite side.
また文字罫線分離部16は、画像データ記憶部12の第一
及び第二罫線検出領域内の画像データを走査し所定の行
方向の累積黒画素数を走査線毎に検出し、この行方向累
積黒画素数の変化に基づいて第一及び第二罫線検出領域
内の罫線検出処理を行なう。さらに、この罫線検出処理
結果に基づいて、所定の列方向の文字始端位置及び終端
位置を罫線よりも罫線付文字行領域の中央部側に位置す
るように一文字毎に設定する。Further, the character ruled line separating section 16 scans the image data in the first and second ruled line detection areas of the image data storage section 12, detects the cumulative number of black pixels in a predetermined row direction for each scanning line, and A ruled line detection process in the first and second ruled line detection areas is performed based on the change in the number of black pixels. Further, based on the result of the ruled line detection processing, the character start and end positions in the predetermined column direction are set for each character so as to be positioned closer to the center of the ruled character line area than the ruled line.
制御部18は、上述の読取部10、罫線検出領域設定部14
及び文字罫線分離部16の動作制御を行なうと共に、所定
の行方向の文字始端位置及び終端位置と所定の列方向の
文字始端位置及び終端位置とを罫線付文字行領域内の個
々の文字別に出力する。The control unit 18 includes the reading unit 10 and the ruled line detection area setting unit 14 described above.
In addition to controlling the operation of the character ruled line separating unit 16, the character start position and end position in the predetermined line direction and the character start position and end position in the predetermined column direction are output for each character in the character line region with ruled lines. I do.
以下、より詳細にこの実施例につき説明する。 Hereinafter, this embodiment will be described in more detail.
(読取部) この実施例の読取部10は、図示せずも、原稿等の記録
媒体からの反射光Pを白黒2値の量子化された電気信号
(画像データ)に変換しこの画像データを画素単位に出
力する光電変換部と、記録媒体の走査のために光電変換
部及び記録媒体を相対的に移動させる走査機構とを備え
て成る。(Reading Unit) The reading unit 10 of this embodiment converts the reflected light P from a recording medium such as a manuscript into a black and white binary quantized electric signal (image data), not shown, and converts this image data. It comprises a photoelectric conversion unit for outputting in pixel units, and a scanning mechanism for relatively moving the photoelectric conversion unit and the recording medium for scanning the recording medium.
(画像データ記憶部) この実施例の画像データ記憶部12は、読取部10からの
画像データを走査順次に格納する画像メモリを用いて構
成され、画像データを1行分以上記憶する。(Image Data Storage Unit) The image data storage unit 12 of this embodiment is configured using an image memory that stores the image data from the reading unit 10 in a scanning order, and stores one line or more of the image data.
画像メモリ上にはX−Y座標系を設定し、例えば横書
き文書を想定してX軸方向を所定の行方向及びX軸方向
を所定の列方向とする。An XY coordinate system is set on the image memory. For example, assuming a horizontally written document, the X-axis direction is a predetermined row direction and the X-axis direction is a predetermined column direction.
画像の真の行方向はX軸方向と一致していてもよいし
X軸方向から多少ずれていてもよい。The true row direction of the image may coincide with the X-axis direction or may slightly deviate from the X-axis direction.
文字の欠けを生ずることなく文字の切出しを行なうた
めには画像の真の行方向をX軸方向と一致させるのが最
も好ましいが、真の行方向がX軸方向から多少ずれてい
ても文字の欠けを従来よりも少なくし或は文字の欠けを
生ずることなく文字の切出しを行なえる。It is most preferable that the true line direction of the image coincides with the X-axis direction in order to cut out the characters without causing the loss of characters. However, even if the true line direction is slightly deviated from the X-axis direction, Characters can be cut out with less chipping than before or without chipping.
(罫線検出領域設定部) この実施例の罫線検出領域設定部14は、第一周辺分布
作成部20と、行周辺分布記憶部22と、黒ブロック検出部
24と、黒ブロック幅判定部26と、検出領域設定部26とか
ら成る。(Ruled line detection area setting unit) The ruled line detection area setting unit 14 of this embodiment includes a first marginal distribution creation unit 20, a row marginal distribution storage unit 22, a black block detection unit
24, a black block width determination unit 26, and a detection area setting unit 26.
第一周辺分布作成部20は、1行の文字行とこの文字行
に付加された罫線とを含む罫線付文字行領域の、所定の
列方向における一方及び他方の端縁位置YT1及びYB1と所
定の行方向における一方及び他方の端縁位置S及びXEと
を制御部18から入力する。位置YT1からYB1までの範囲で
あって位置XSからXEまでの範囲が罫線付文字行領域とな
る。The first marginal distribution creating unit 20 determines one and the other edge positions Y T1 and Y B1 in a predetermined column direction of a ruled character line area including one character line and a ruled line added to the character line. an input from one and the other of the end edge positions S and X E and the control unit 18 in a given row. Range from position Y T1 from the position X S in the range of up to Y B1 to X E is ruled with character line region.
そして第一周辺分布作成部20は、画像データ記憶部12
の罫線付文字行領域内の画像データを走査して、所定の
行方向の各位置X毎に、所定の列方向の走査線上の黒画
素を累積して累積黒画素数(列累積画素数)を検出し検
出した列累積画素数を第一周辺分布記憶部22に保存す
る。Then, the first marginal distribution creating unit 20 includes the image data storage unit 12
The image data in the character line area with a ruled line is scanned, and for each position X in the predetermined row direction, the black pixels on the scanning line in the predetermined column direction are accumulated to accumulate the number of black pixels (column accumulated pixel number) And stores the detected column cumulative pixel number in the first marginal distribution storage unit 22.
黒ブロック検出部24は、各位置X毎に検出された列累
積画素数を、位置Xが大きくなる(或は小さくなる)順
に読出し、読出した列累積画素数をブロック閾値THLと
比較し、閾値THL以上の列累積画素数を黒ブロック要素
及び閾置THL未満の列累積画素数を白ブロック要素とし
て検出し、列累積画素数を変化を調べる。The black block detection unit 24 reads the number of column accumulated pixels detected for each position X in order of increasing (or decreasing) position X, compares the read column accumulated pixel number with a block threshold THL, The number of column accumulated pixels equal to or greater than THL is detected as a black block element and the number of column accumulated pixels smaller than the threshold THL is detected as a white block element, and the change in the number of column accumulated pixels is checked.
ここで、黒ブロックは所定の行方向において連続する
黒ブロック要素のみから成るブロックの塊りであり、黒
ブロックの長さは所定の行方向における長さであるとす
ると、黒ブロック検出部24は白ブロック要素の次に黒ブ
ロック要素となったときの当該ブロック要素の位置Xを
黒ブロックの始端位置XBSとして検出する。始端位置XBS
を検出したら位置XBSの黒ブロック要素に連続する黒ブ
ロックの黒ブロック要素を検出する毎に、当該検出黒ブ
ロック要素の位置Xと始端位置XBSとの離間距離例えば
X−XBS+1を検出する(離間距離を例えばX−XBS+1
とした場合、検出した離間距離は黒ブロックの長さとな
る)。そして当該黒ブロックの長さを黒ブロック幅判定
部26に対して出力し、黒ブロック幅判定部26からの判定
結果をまつ。Here, a black block is a block of blocks consisting only of black block elements that are continuous in a predetermined row direction, and assuming that the length of the black block is the length in the predetermined row direction, the black block detection unit 24 detecting the position X of the block elements when a black block element to the next white block elements as starting position X BS of the black block. Start position X BS
Each for detecting a black block elements black block contiguous to the black block element positions X BS upon detecting, detects a distance for example X-X BS +1 of the position X and the starting end position X BS in the detection black block element (The separation distance is, for example, X-X BS +1
, The detected separation distance is the length of the black block). Then, the length of the black block is output to the black block width determination unit 26, and the determination result from the black block width determination unit 26 is obtained.
黒ブロック検出部24は黒ブロック幅判定部26から黒ブ
ロックの長さが閾値BWJを越える長さであることを表す
第一判定結果を入力した場合には、閾値THLを所定量UT
だけ増加させて当該閾値BWJを越える黒ブロックの始端
位置XBSからXが大きくなる順(或は小さくなる順)に
列累積画素数の変化を調べ黒及び白ブロック要素を再度
検出し直す。この結果、黒ブロック検出部24は閾値BWJ
を越える黒ブロックの終端位置XBLを検出することはな
く、閾値BWJ以下の黒ブロックの終端位置のみを検出で
きる。閾値BWJK以下の黒ブロックは文字を構成する黒画
素のブロックとみなせ、従ってこの黒ブロックの始端位
置及び終端位置が所定の行方向における文字始端位置及
び終端位置となる。When the first determination result indicating that the length of the black block exceeds the threshold BWJ is input from the black block width determination unit 26, the black block detection unit 24 sets the threshold THL to a predetermined amount UT.
Only then increased again detects black and white block element examine changes in the column cumulative number of pixels from the starting position X BS to X becomes large order (or smaller order) of the black blocks exceeding the threshold BWJ again. As a result, the black block detection unit 24 sets the threshold value BWJ
Rather than detecting the end position X BL of black block beyond, can detect only the end position of the following black block threshold BWJ. A black block equal to or smaller than the threshold value BWJK can be regarded as a block of black pixels constituting a character. Therefore, the start position and end position of this black block are the character start position and end position in a predetermined line direction.
閾値THL及び所定量UTは任意好適に設定される定数で
あり、例えば閾値THLの初期値1及びUT=2と設定され
る。The threshold value THL and the predetermined amount UT are arbitrarily and appropriately set constants. For example, the initial value 1 of the threshold value THL and UT = 2 are set.
また黒ブロック検出部24は黒ブロック幅判定部26から
黒ブロックの長さが閾値BWJ以内であることを表す第二
判定結果を入力した場合には、当該閾値BWJ以内の黒ブ
ロックの黒ブロック要素の次の位置Xの列累積画素数を
第一周辺分布記憶部22から読み込み、次の位置Xにおけ
る黒及び白ブロック要素の変化を調べる。When the black block detection unit 24 receives the second determination result indicating that the length of the black block is within the threshold value BWJ from the black block width determination unit 26, the black block element of the black block within the threshold value BWJ is input. Is read from the first peripheral distribution storage unit 22, and the change of the black and white block elements at the next position X is examined.
さらに黒ブロック検出部24は、黒ブロック要素の次に
白ブロック要素を検出した場合(当該黒ブロック要素の
位置Xは黒ブロックの終端位置XBLであるので)黒ブロ
ックの終端位置XBLを検出したとみなし、所定の行方向
における文字の始端位置XL及び終端位置XRを検出したこ
とを表す文字位置検出信号と共に当該黒ブロックの始端
位置XBS及び終端位置XBLを黒ブロック幅判定部26に対し
て出力しこれと共に閾値THLを初期化する。このとき検
出した位置XBS、XBLが行方向における文字始端位置XL及
び終端位置XR(以下、行方向始端位置XL及び行方向終端
位置XRと称す)である。そして黒ブロック検出部24は罫
線付文字行内の残りの文字の行方向始端位置XL及び終端
位置XRを検出すべく、検出したばかりの終端位置XBLの
次の位置XからXが大きくなる(或は小さくなる)順に
黒及び白ブロック要素の変化を調べる。尚、位置XL及び
XRの間には1個の文字が存在するとみなせ、以下この罫
線付文字行領域内の位置XL及びXRの間の領域を一文字領
域と称す。Further, when the black block detection unit 24 detects the white block element next to the black block element (since the position X of the black block element is the black block end position XBL ), the black block end position XBL is detected. was a considered black block width determination unit to start position X BS and the end position X BL of the black block with character position detection signal indicating the detection of the start position X L and the end position X R of the characters in a given row 26, and the threshold value THL is initialized. Position X BS detected this time, a character start position X BL is in the row direction X L and the end position X R (hereinafter, the row direction is referred to as starting position X L and the row direction end position X R). Then, the black block detection unit 24 increases X from the position X next to the end position XBL just detected in order to detect the start position X L and end position X R in the line direction of the remaining characters in the character line with ruled lines. Examine the changes in black and white block elements in order (or smaller). In addition, the position XL and
Between X R regarded as the one character exists, hereinafter referred to the region between the position X L and X R of the border with character line area as the character region.
黒ブロック幅判定部28は黒ブロック検出部24から黒ブ
ロックの長さを入力すると、黒ブロックの長さをブロッ
ク閾値BWJと比較する。黒ブロックの長さが閾値BWJを越
えるときは黒ブロック検出部24に対して第一判定結果を
出力し、黒ブロックの長さが閾値BWJ以下のときは黒ブ
ロック検出部24に対して第二判定結果を出力する。また
黒ブロック幅判定部28は黒ブロック検出部24から文字位
置検出信号と共に黒ブロックの始端位置XBS及び終端位
置XBLを入力すると、これら位置XBS及びXBLを行方向始
端位置XL及び行方向終端位置XRとして検出領域決定部28
に出力する。Upon receiving the length of the black block from the black block detection unit 24, the black block width determination unit 28 compares the length of the black block with the block threshold BWJ. When the length of the black block exceeds the threshold value BWJ, the first determination result is output to the black block detection unit 24, and when the length of the black block is equal to or less than the threshold value BWJ, the second determination result is output to the black block detection unit 24. Output the judgment result. Further, when the black block width determination unit 28 inputs the start position X BS and the end position X BL of black block with character position detection signal from the black block detection unit 24, the row direction starting end position X L and these positions X BS and X BL detected as the row direction end position X R region determining section 28
Output to
閾値BWJは読取対象となる記憶媒体における文字1個
の、所定の行方向における文字幅(所定の行方向におけ
る画素数で表現される)よりも大きい任意好適な値に定
められるものであり、例えば文字幅3mm及び読取部10に
おける光学的読取りの解像度を16画素/mmのときはBWJ=
56とすればよい。The threshold value BWJ is set to any suitable value larger than the character width (expressed by the number of pixels in the predetermined line direction) of one character in the storage medium to be read in the predetermined line direction. When the character width is 3 mm and the resolution of optical reading in the reading unit 10 is 16 pixels / mm, BWJ =
It should be 56.
検出領域位置決定部28は、始端位置XL及び終端位置XR
を入力すると、第一罫線検出領域を行方向始端位置XLに
隣接しかつ行方向終端位置XRとは反対側の位置に罫線を
含むように設定し、従って第一罫線検出領域を一文字領
域の外側に一文字領域の行方向始端位置XL側に隣接させ
て設定する。Detection area position determining unit 28, the starting end position X L and the end position X R
Is input, the first ruled line detection area is set so as to include a ruled line at a position adjacent to the line direction start position X L and on the opposite side of the line direction end position X R. outside to be adjacent in the row direction starting end position X L side of character area of the set by.
第一罫線検出領域内の罫線の検出精度を向上するた
め、第一罫線検出領域の所定の行方向における幅を隣接
する文字間の距離以内の幅とし、文字を構成する黒画素
が第一罫線検出領域内に包含される個数の低減するのが
よい。In order to improve the detection accuracy of the ruled line in the first ruled line detection area, the width of the first ruled line detection area in a predetermined row direction is set to a width within the distance between adjacent characters, and the black pixels constituting the character are the first ruled line. It is preferable to reduce the number included in the detection area.
同様に検出領域位置決定部28は、位置XL及びXRを入力
すると行方向終端位置XRに隣接しかつ行方向始端位置XL
とは反対側の位置に罫線を含むように第二罫線検出領域
を設定し、よって第二罫線検出領域を一文字領域の外側
に一文字領域の行方向終端位置XR側に隣接させて設定す
る。第二罫線検出領域内の罫線の検出精度を向上するた
め、第二罫線検出領域の所定の行方向における幅を隣接
する文字間の距離以内の幅とし、文字を構成する黒画素
が第二罫線領域内に包含される個数を低減するのがよ
い。Similarly detection area position determining unit 28, the position X L and X R entering the the row direction end position X R on adjacent Shikatsu row direction starting end position X L
And sets the second ruled line detection area so as to include a border position opposite, thus the second ruled line detection area adjacent to the outside of the character region in the row direction end position X R side of character area is set. In order to improve the detection accuracy of the ruled line in the second ruled line detection area, the width of the second ruled line detection area in a predetermined line direction is set to a width within the distance between adjacent characters, and the black pixels constituting the character are defined by the second ruled line. It is desirable to reduce the number included in the region.
検出領域位置決定部28は文字行の個々の文字の第一及
び第二罫線検出領域を設定する。The detection area position determination unit 28 sets first and second ruled line detection areas of individual characters in a character line.
例えば次式(1)及び(2)式に従って第一罫線検出
領域を、また例えば次式(3)及び(4)に従って第二
罫線検出領域を設定する。For example, the first ruled line detection area is set according to the following equations (1) and (2), and the second ruled line detection area is set according to the following equations (3) and (4).
但し、所定の行方向の座標Xが次第に大きくなる方向
へ順次に数えてn番目の文字(以下、単にn個目の文字
と称す)の位置XLをXL(n)及び位置XRをXR(n)、n
番目の文字の第一罫線検出領域の所定の行方向における
一方の端縁位置をXLL(n)及び他方の端縁位置をX
LR(n)、及びn番目の文字の第二罫線検出領域の所定
の行方向における一方の端縁位置をXRL(n)及び他方
の端縁位置をXRR(n)、文字行1行内で検出された文
字の総個数をnLS、nを1≦n≦nLSの範囲の自然数、β
を任意好適に設定される定数とする。尚、読取部10の光
学的読取の解像度を16画素/mmとした場合には例えばβ
=32とすればよい。However, sequentially counted n-th character coordinate X of a predetermined row direction to progressively larger direction (hereinafter, simply referred to as n-th character) the position X L and X L (n) and the position X R of X R (n), n
X LL (n) represents one edge position of the first ruled line detection area of the second character in the predetermined line direction, and X represents the other edge position.
LR (n), one edge position in a predetermined line direction of the second ruled line detection area of the n-th character is X RL (n), the other edge position is X RR (n), and one character line is within one line. Is the total number of characters detected in, n is a natural number in the range of 1 ≦ n ≦ n LS , β
Is a constant that is arbitrarily and suitably set. If the resolution of the optical reading of the reading unit 10 is 16 pixels / mm, for example, β
= 32.
XLR(n)=XL(n)−1 ……(1) ・n=1またはXL(n)−1−β>XR(n−1)+1の
とき XLL(n)=XL(n)−1−β ・n≧2かつXL(n)−1−β≦XR(n−1)+1のと
き XLL(n)=XR(n−1)+1 ……(2) XRL(n)=XR(n)+1 ……(3) ・n=nLSまたはXR(n)+1+β<XL(n+1)−1
のとき XRR(n)=XR(n)+1+β ・n≦nLS−1かつXR(n)+1+β≧XL(n+1)−
1のとき XRR(n)=XL(n+1)−1 ……(4) (文字罫線分離部) この実施例の文字罫線分離部16は、第二周辺分布作成
部30と第二周辺分布記憶部32と、罫線検出部34と、罫線
分離位置決定部36とから成る。X LR (n) = XL (n) -1 (1) When n = 1 or XL (n) -1-β> X R (n-1) +1, X LL (n) = X L (n) -1-β · n ≧ 2 and X L (n) -1-β ≦ X R (n-1) +1 when X LL (n) = X R (n-1) +1 ...... ( 2) X RL (n) = X R (n) +1 (3) n = n LS or X R (n) + 1 + β < XL (n + 1) -1
X RR (n) = X R (n) + 1 + β · n ≦ n LS -1 and X R (n) + 1 + β ≧ X L (n + 1) when the -
XRR (n) = XL (n + 1) -1 when (1) (character ruled line separating unit) The character ruled line separating unit 16 of this embodiment includes a second marginal distribution creating unit 30 and a second marginal distribution. It comprises a storage unit 32, a ruled line detection unit 34, and a ruled line separation position determination unit 36.
第二周辺分布作成部30は、画像データ記憶部12の第一
罫線検出領域内の画像データを走査して、所定の列方向
の各位置Y毎に、所定の行方向の走査線上の黒画素を累
積して累積黒画素数(第一行累積画素数)を検出し、検
出した第一行累積画素数を第二周辺分布記憶部32に保存
する。同様にして画像データ記憶部12の第二罫線検出領
域内の画像データを走査して、所定の列方向の各位置Y
毎に、所定の行方向の走査線上の黒画素を累積して累積
黒画素数(第二行累積画素数)を検出し、検出した第二
行累積画素数を第二周辺分布記憶部32に保存する。The second peripheral distribution creating unit 30 scans the image data in the first ruled line detection area of the image data storage unit 12 and, for each position Y in a predetermined column direction, a black pixel on a scanning line in a predetermined row direction. Is accumulated to detect the cumulative number of black pixels (the first row cumulative pixel number), and the detected first row cumulative pixel number is stored in the second peripheral distribution storage unit 32. Similarly, the image data in the second ruled line detection area of the image data storage unit 12 is scanned, and each position Y in the predetermined column direction is scanned.
Each time, the black pixels on the scanning line in the predetermined row direction are accumulated to detect the cumulative black pixel number (second row cumulative pixel number), and the detected second row cumulative pixel number is stored in the second peripheral distribution storage unit 32. save.
また罫線検出部34は、所定の列方向における第一罫線
検出領域の一方の側の端縁位置をYT1とし、第一罫線検
出領域内の文字行余白部分の位置YLS1から第一罫線検出
領域の一方の側の端縁位置YT1へYを順に小さくしてゆ
き第一行累積画素数を読出し(但しYLS1>YT1であってY
LS1からYT1までの間に罫線及び余白が含まれるようにY
LS1を設定する。例えばYLS1=(YT1+YB1)/2とすれば
よい。)、読出した第一行累積画素数を所定の閾値THLL
と比較する。この比較によって行累積画素数の変化を調
べる。The ruled line detector 34, one end edge position of the side of the first ruled line detection area at a predetermined column direction and Y T1, the first ruled line position Y LS1 from the first ruled line detection of character line margin of the detection area Y is sequentially reduced to the edge position Y T1 on one side of the area, and the first row accumulated pixel number is read out (where Y LS1 > Y T1 and Y
Y so that ruled lines and margins are included between LS1 and Y T1
Set LS1 . For example, Y LS1 = (Y T1 + Y B1 ) / 2 may be set. ), The read first row accumulated pixel number is set to a predetermined threshold value THL L
Compare with By this comparison, a change in the row accumulated pixel number is examined.
第一行累積画素数が閾値未満から閾値以上に変化した
ら当該閾値以上の第一行累積画素数の位置Yを第一の罫
線検出処理結果YLTとして検出する。但し、第一行累積
画素数が最初に変化したときの位置Yが第一の罫線検出
結果YLTであるとする。When the cumulative number of pixels in the first row changes from less than the threshold to greater than or equal to the threshold, the position Y of the cumulative number of pixels in the first row that is greater than or equal to the threshold is detected as the first ruled line detection processing result YLT . However, it is assumed that the position Y when the first row accumulated pixel number first changes is the first ruled line detection result YLT .
第一行累積画素数の変化を検出しないまま位置YLS1か
らYT1までの第一行累積画素数を全て読出し終えたとき
には、第一の罫線検出結果YLTを端縁位置YT1とする。When finishing the first line reads all the cumulative number of pixels from the first row accumulated without detecting a change in the number of pixel positions Y LS1 to Y T1 is the first ruled line detection result Y LT and edge position Y T1.
さらに罫線検出部34は、所定の列方向における第一罫
線検出領域の他方の側の端縁位置をYB1とし、第一罫線
領域内の文字行余白部分の位置YLS2から第一罫線領域の
他方の側の端縁位置YB1ヘYを順に大きくして第一行累
積画素数を読出し(但し、YLS2<YB1であってYLS2からY
B1までの間に罫線及び余白を含むようにYLS2を設定す
る。例えばY=LS2=(YT1+YB1)/2とすればよ
い。)、第一行累積画素数の変化を調べる。Furthermore ruled line detector 34, the other side of the first ruled line detection area in a given column direction edge positions and Y B1, from the position Y LS2 character line margin of the first border region of the first ruled line area Y is sequentially increased from the edge position Y B1 on the other side to read out the accumulated pixel number of the first row (however, Y LS2 <Y B1 and Y LS2 to Y LS2
Set YLS2 to include ruled lines and margins before B1 . For example, Y = LS2 = (Y T1 + Y B1 ) / 2. ), And examine the change in the cumulative number of pixels in the first row.
第一行累積画素数が閾値未満から閾値以上に変化した
ら当該値以上の第一行累積画素数の位置Yを第二の罫線
検出処理結果YLBとして検出する。但し、第一行累積画
素数が最初に変化したときの位置Yが第二の罫線検出処
理結果YLBであるとする。When the first row accumulated pixel number changes from less than the threshold to more than the threshold, the position Y of the first row accumulated pixel number equal to or greater than the threshold is detected as the second ruled line detection processing result YLB . However, the position Y when the first row cumulative number of pixels is first changed is assumed to be the second ruled line detection processing result Y LB.
第一行累積画素数の変化を検出しないまま位置YLS2か
らYB1までの第一行累積画素数を全て読出し終えたとき
には、第二の罫線検出処理結果YLBを端縁位置YB1とす
る。When all the first-row accumulated pixel numbers from the positions Y LS2 to Y B1 have been read out without detecting a change in the first-row accumulated pixel number, the second ruled line detection processing result Y LB is set to the edge position Y B1 . .
また罫線検出部34は、第二罫線検出領域は所定の列方
向における一方の側の端縁位置をYT1とし、第二罫線検
出領域内の文字行余白部分の位置YRS1から第二罫線検出
領域の一方の側の端縁位置YT1へYを順に小さくしてゆ
き第二行累積画素数を読出し(但しYRS1>YT1であってY
RS1からYT1までの間に罫線及び余白が含まれるようにY
RS1を設定する。例えばYRS1=(YT1+YB1)/2とすれば
よい。)、第二行累積画素数の変化を調べ、変化を調べ
た結果に応じた第三の検出処理結果YRTを上述の第一罫
線検出領域における場合と同様にして得る。さらに罫線
検出部34は第二罫線検出領域の他方の側の端縁位置をY
B1とし第二罫線領域内の文字行余白部分の位置YRS2から
第二罫線領域の他方の側の端縁位置YB1へYを順に大き
くしてゆき第二行累積画素数を読出し(但しYRS2<YB1
であってYRS2からYB1までの間に罫線及び余白を含むよ
うにYRS2を設定する。例えばYRS2=(YT1+YB1)/2とす
ればよい。)第二行累積画素数の変化を調べ、変化を調
べた結果に応じた第四の検出処理結果YRBを上述の第一
罫線検出領域における場合と同様にして得る。Further, the ruled line detection unit 34 detects the second ruled line from the position Y RS1 of the character line blank portion in the second ruled line detection region with the edge position on one side in the predetermined column direction as Y T1. Y is sequentially reduced to the edge position Y T1 on one side of the area, and the second row accumulated pixel number is read out (where Y RS1 > Y T1 and Y
Y so that ruled lines and margins are included between RS1 and Y T1
Set RS1 . For example, Y RS1 = (Y T1 + Y B1 ) / 2 may be set. ), Examine the change in the second row cumulative number of pixels, the third detection processing result Y RT corresponding to the result of investigating changes obtained in the same manner as in the first ruled line detection region described above. Further, the ruled line detection unit 34 sets the edge position on the other side of the second ruled line detection area to Y
B1 and to the second ruled line read a second row cumulative number of pixels Yuki from position Y RS2 of character lines margin and turn increase the other of Y to the edge position Y B1 side of the second border regions within the region (where Y RS2 <Y B1
Setting the Y RS2 to include ruled lines and blank between be from Y RS2 to Y B1. For example, Y RS2 = (Y T1 + Y B1 ) / 2 may be set. A change in the number of accumulated pixels in the second row is checked, and a fourth detection processing result Y RB corresponding to the result of checking the change is obtained in the same manner as in the above-described first ruled line detection area.
第一及び第二行累積画素数の変化が現れたことは罫線
が検出されたとみなすことができ、これら行累積画素数
が変化したときの検出処理結果YLT、YLB、YRT又はY
RBは、罫線の罫線付文字行領域中央部側の端縁位置を示
すとみなせる。また検出処理結果YLT=YT1、YLB=YB1、
YRT=YT1又はYRB=YB1のときは、YT1≦Y≦YLS1の範囲
の第一罫線検出領域、YLS2≦Y≦YB1の範囲の第一罫線
検出領域、YT1≦Y≦YRS1の範囲の第二罫線検出領域、
又はYRS2≦Y≦YB1の範囲の第二罫線検出領域をおいて
罫線が検出されなかったとみなせる。The appearance of the change in the first and second row cumulative pixel numbers can be regarded as a ruled line being detected, and the detection processing result Y LT , Y LB , Y RT or Y Y when these row cumulative pixel numbers have changed.
RB can be regarded as indicating the edge position of the ruled line in the center of the ruled character line area. In addition, the detection processing results Y LT = Y T1 , Y LB = Y B1 ,
When the Y RT = Y T1 or Y RB = Y B1, Y T1 ≦ Y first ruled line detection area in the range of ≦ Y LS1, Y LS2 ≦ Y ≦ Y B1 first ruled line detection area in the range of, Y T1 ≦ A second ruled line detection area in the range of Y ≦ Y RS1 ,
Alternatively, it can be considered that no ruled line is detected in the second ruled line detection area in the range of Y RS2 ≦ Y ≦ Y B1 .
罫線分離位置決定部36、例えば次の判定式(5)及び
(6)従って、列始端位置YT及び列終端位置YBを罫線の
位置よりも罫線付文字行領域の中央側に設定する。Borders separating position determination unit 36, for example, the following determination formula (5) and (6) thus set to the center side of the character line region with borders than the position of the border column start position Y T and the column end position Y B.
・YLT≧YRTのとき YT=YLT ・YLT<YRTのとき YT=YRT ……(5) ・YLB≧YRBのとき YB=YRB ・YLB<YRBのとき YB=YLB ……(6) (制御部) 制御部18は、読取部10にセッティングされた記録媒体
の書式に応じて、罫線付文字行領域の所定の列方向にお
ける端縁位置YT1、YB1と所定の行方向における端縁位置
XS、XEとを書式情報格納部(図示せず)から読み込む。
そして読み込んだ位置YT1、YB1及び位置XS、XEを罫線検
出領域設定部14に対し出力する。• When Y LT ≥ Y RT Y T = Y LT · When Y LT <Y RT Y T = Y RT ... (5) • When Y LB ≥ Y RB Y B = Y RB · Y LB <Y RB In the case of Y B = Y LB (6) (Control Unit) The control unit 18 determines the edge position in the predetermined column direction of the character line area with ruled lines according to the format of the recording medium set in the reading unit 10. Y T1 , Y B1 and the edge position in the predetermined row direction
Load X S, and X E format information storage unit (not shown).
The read positions Y T1 and Y B1 and the positions X S and X E are output to the ruled line detection area setting unit.
尚、位置YT1、YB1及び位置XS、XEとして書式情報格納
部に予め格納されたもののみならず、従来公知の行検出
手段によって記録媒体の一部或は全体の画像データを走
査して検出された文字行の位置YT1、YB1及び位置XS、XE
を用いるようにしてもよい。Note that not only those previously stored in the format information storage unit as the positions Y T1 and Y B1 and the positions X S and X E but also a part or the entire image data of the recording medium is scanned by a conventionally known line detecting unit. Positions Y T1 and Y B1 and positions X S and X E of the detected character line
May be used.
また制御部18は罫線検出領域設定部14が検出した文字
の位置XL及びXRと、第一及び第二罫線検出領域の位置X
LL及びXLR、及び、位置XRL及びXRRを入力し、これら位
置を罫線付文字行領域内の個々の文字別に保存する。The position X L and X R of character control unit 18 which borders the detection area setting unit 14 detects the position X of the first and second ruled line detection area
LL and X LR , and positions X RL and X RR are input, and these positions are stored for each character in the character line area with ruled lines.
そして制御部18は、第一及び第二罫線検出領域の位置
XLL、XLR及び位置XRL、XRRを、文字罫線分離部16に対し
て個々の文字別に出力する。Then, the control unit 18 determines the positions of the first and second ruled line detection areas.
X LL, X LR and position X RL, the X RR, output to the character ruled line separating section 16 on an individual character.
文字罫線分離部16が一つの文字に関して文字の位置
YT、YBの検出を終えると、制御部18は文字罫線分離部16
から位置YT、YBを入力して保存し保存した位置YT、YBと
当該位置YT、YBを得た文字の位置XL、XRとを対応付けて
文字切出情報として保存する。これと共に制御部18は位
置YT、YBを入力すると次の一文字に関する第一及び第二
罫線検出領域の位置XLL、XLR及び位置XRL、XRRを文字罫
線分離部16に対して出力する。Character line separation unit 16 determines the position of the character with respect to one character
When the detection of Y T and Y B is completed, the control unit 18 returns to the character ruled line separation unit 16.
Position Y T from the position and stored and stored by entering Y B Y T, Y B and the position Y T, the position of the character to obtain a Y B X L, as character extraction information in association with X R save. At the same time, when the control unit 18 inputs the positions Y T and Y B , the control unit 18 transmits the positions X LL and X LR and the positions X RL and X RR of the first and second ruled line detection areas for the next character to the character ruled line separation unit 16. Output.
制御部18は文字罫線分離部16が一文字の文字のYT、YB
の検出を終えると当該一文字の文字のYT、YBとXL、XRと
を出力してもよいし、或は分離部16が罫線付文字行領域
内の全て又は任意好適個数の複数の文字のYT、YBの検出
を終えたら検出済みの文字のYT、YB、XL、XRを各文字別
に出力してもよい。The control unit 18 determines that the character ruled line separation unit 16 has one character Y T , Y B
Of the finish detection of the character of the character Y T, Y B and X L, a plurality of X to R and it may be outputted, or the separation unit 16 is all or any suitable number of character rows in the region with borders After the detection of the characters Y T and Y B is completed, the detected characters Y T , Y B , X L and X R may be output for each character.
動作の説明 次にこの発明の理解を深めるために、この実施例の動
作につきより具体的な動作の一例を挙げて説明する。
尚、以下の説明では文字行1行の文字切出し動作につき
説明するが、この発明が複数行の文字行の文字切出しに
も適用できることは明かである。Description of Operation Next, in order to deepen the understanding of the present invention, the operation of this embodiment will be described using a more specific example of operation.
In the following description, a character extracting operation for one character line will be described. However, it is apparent that the present invention can be applied to character extracting for a plurality of character lines.
制御部18に入力部(図示せず)を介して処理開始信号
を入力すると、制御部18は読取部10に読取開始信号を出
力すると共に書式情報格納部から罫線付文字行領域の端
縁位置YT1、YB1、XS、XEを入力しこれら位置YT1、YB1、
XS、XEを第一行周辺分布作成部20に出力する。When a processing start signal is input to the control unit 18 via an input unit (not shown), the control unit 18 outputs a reading start signal to the reading unit 10 and outputs the edge position of the character line area with ruled lines from the format information storage unit. Enter Y T1 , Y B1 , X S , X E and enter these positions Y T1 , Y B1 ,
X S, and outputs the X E in the first row peripheral distribution generator 20.
読取部10は読取開始信号を入力すると記録媒体の所定
の読取範囲内の光学読取りを開始し、画像データを画素
単位に出力する。記録媒体の地を構成する白画素を例え
ば「0」及び叔父を構成する黒画素を例えば「1」とし
ては画像データを出力する。画像データ記憶部12は読取
部10からの画像データを走査順次に格納する。When a reading start signal is input, the reading unit 10 starts optical reading within a predetermined reading range of a recording medium, and outputs image data in pixel units. Image data is output by setting white pixels constituting the ground of the recording medium to "0" and black pixels constituting the uncle to "1", for example. The image data storage unit 12 stores the image data from the reading unit 10 in a scanning order.
所定の読取範囲の全面の読取りが終り従って読取範囲
の全面の画像データの格納が終了すると、罫線検出領域
設定部14は動作を開始する。以下、罫線検出領域設定部
14の動作につき第2図及び第3図を参照して説明する。When reading of the entire surface of the predetermined reading range is completed and storage of image data of the entire surface of the reading range is completed, the ruled line detection area setting unit 14 starts operating. Hereinafter, the ruled line detection area setting section
The operation 14 will be described with reference to FIGS. 2 and 3.
第2図(A)〜(B)は画像データ及び列累積画素数
の分布の一例を示す図である。第2図(A)は記録媒体
の所定の読取範囲38内に含まれる文字行1行の画像デー
タを示し、同図においてX軸及びY軸は画像メモリ上に
設定したX−Y座標系の座標軸を表す。第2図(B)は
同図(A)に示す文字行につき検出される列累積画素数
の分布を示し、同図の横軸は所定の行方向における位置
Xを及び縦軸は位置Xにおける列累積黒画素数を表す。
第3図(A)〜(B)は罫線検出領域設定部の動作の流
れの一例を示す図である。尚、第2図(A)において一
点鎖線で囲み符号40を付して示す領域は罫線付文字行領
域の一例を示す。FIGS. 2A and 2B are diagrams showing an example of the distribution of image data and the number of column accumulated pixels. FIG. 2A shows image data of one character line included in a predetermined reading range 38 of the recording medium. In FIG. 2A, the X axis and the Y axis are based on the XY coordinate system set on the image memory. Represents a coordinate axis. FIG. 2B shows the distribution of the cumulative number of columns detected for the character row shown in FIG. 2A. The horizontal axis in FIG. 2B indicates the position X in a predetermined row direction, and the vertical axis indicates the position X in the position X. Represents the number of column accumulated black pixels.
FIGS. 3A and 3B are diagrams showing an example of the operation flow of the ruled line detection area setting unit. In FIG. 2A, a region surrounded by a dashed line and denoted by reference numeral 40 is an example of a character line region with a ruled line.
罫線検出領域設定部14が動作を開始すると、まず第一
周辺分布作成部20が罫線付文字行領域40の列累積画素数
の検出を開始する。When the ruled line detection area setting unit 14 starts operation, first, the first marginal distribution creating unit 20 starts detecting the column cumulative pixel number of the ruled line character line area 40.
第一行周辺分布作成部20は、罫線付文字行領域40内に
おける走査位置XをXSとし(S1)、位置Xにおいて画像
データを所定の列方向に走査してYT1からYB1までの間の
黒画素数を計数し、よって位置Xにおける列累積画素数
HL(X)を検出する(S2)。そして検出した列累積画素
数HL(X)を当該位置XのHL(X)として第一周分布記
憶部22に保存する。The first row peripheral distribution generator 20, a scanning position X in a ruled line with a character row region 40 and X S (S1), the scanning image data on a predetermined column from the Y T1 at position X to Y B1 The number of black pixels between them, and thus the cumulative number of pixels in the column at position X
HL (X) is detected (S2). Then, the detected column accumulated pixel number HL (X) is stored in the first circumference distribution storage unit 22 as HL (X) of the position X.
列累積画素数HL(X)は次式(7)によって表せる。 The column accumulated pixel number HL (X) can be expressed by the following equation (7).
但し、P(X、Y)は画像データを表し、P(X、
Y)=1は黒画素を及びP(X、Y)=0は白画素を表
す。 Here, P (X, Y) represents image data, and P (X, Y)
Y) = 1 represents a black pixel and P (X, Y) = 0 represents a white pixel.
次いで第一周辺分布作成部20は罫線付文字行領域40内
における全ての位置Xにおける列累積画素数HL(X)を
検出したか否かを判定する(S3)。第一周辺作成部20は
位置X=XEでなければ次の位置Xにおける列累積画素数
を検出すべくXに1加算し(S4)次いでS2に戻り、また
位置X=XEであれば全ての位置Xにおける列累積画素数
HL(X)を検出したものとみなして列累積画素数の検出
を終える。Next, the first marginal distribution creating unit 20 determines whether or not the column accumulated pixel number HL (X) at all positions X in the ruled-lined character line area 40 has been detected (S3). Returning to the first peripheral creation unit 20 adds 1 to X to detect a column cumulative number of pixels at the position X = X E unless the next position X (S4) then S2, also if the position X = X E Column cumulative number of pixels at all positions X
Assuming that HL (X) has been detected, the detection of the column cumulative pixel number is completed.
列累積画素数の検出が終了すると黒ブロック検出部24
は、行方向始端位置XL及び終端位置XRの検出を開始し、
文字の検出個数n及びHL(X)の読出し位置Xを初期値
1及び初期値XSに初期化する。これと共に位置XSのひと
つ前の位置XS−1における列累積画素数HL(XS−1)を
仮想的にHL(XS−1)=0とする(S5)。次いで位置X
の列累積画素数HL(X)を第一周辺分布記憶部22から読
出し、読出したHL(X)を所定の閾値THL(例えばTHL=
1)と比較して当該HL(X)は黒ブロック要素か否かを
判定する(S6)。黒ブロック検出部24はHL(X)≧THL
となるHL(X)は文字を構成する黒ブロック要素である
とみなし、またHL(X)<THLとなるHL(X)を記録媒
体の地を構成する白ブロック要素であるとみなす。When the detection of the column accumulated pixel number is completed, the black block detection unit 24
Starts detection of the row direction starting end position X L and the end position X R,
The detection number n and the reading position X of HL (X) of the character is initialized to an initial value 1 and the initial value X S. This together with the position X S of the previous position X S columns in -1 accumulated pixel number HL (X S -1) of virtually HL (X S -1) = 0 to (S5). Then position X
Is read from the first marginal distribution storage unit 22, and the read HL (X) is set to a predetermined threshold THL (for example, THL =
It is determined whether or not the HL (X) is a black block element in comparison with 1) (S6). Black block detector 24 is HL (X) ≧ THL
HL (X) is regarded as a black block element constituting a character, and HL (X) satisfying HL (X) <THL is regarded as a white block element constituting the ground of a recording medium.
黒ブロック検出部24はS6で黒ブロック要素を検出した
場合には当該黒ブロック要素を検出した位置Xのひとつ
前の位置X−1の列累積画素数HL(X−1)を第一周辺
分布記憶部22から読み込み、読出したHL(X−1)を閾
値THLと比較しHL(X−1)が白ブロック要素であるか
否かを判定する(S7)。黒ブロック検出部24はS7での判
定結果が白ブロック要素であった場合には位置X−1に
おいて白ブロック要素及び位置Xにおいて黒ブロック要
素を検出したことを表すので、当該位置Xを黒ブロック
の始端位置XBSとして保存し(S8)次いでS9を行ない(S
9の処理については後述する)、またS7での判定結果が
黒ブロック要素であった場合には黒ブロックの長さX−
XBS+1を算出し算出した長さを黒ブロック幅判定部26
に出力する。黒ブロック検出部24から黒ブロックの長さ
を入力した黒ブロック幅判定部26は入力した長さを閾値
BWJと比較する(S10)。黒ブロック幅判定部26は入力し
た長さが閾値BWJを越える場合は第一判定結果を及び入
力した長さが閾値BWJ以下の場合は第二判定結果を黒ブ
ロック検出部24に対して出力する。黒ブロック検出部24
は第一判定結果を入力した場合には当該閾値BWJを越え
る長さの黒ブロックの始端位置XBSから黒及び白ブロッ
ク要素の再検出を行なうべく列累積画素数読出しのため
の位置XをXBS−1としさらに閾値THLを所定量UTだけ増
加させ(S11)次いでS9を行ない、また第二判定結果を
入力した場合にはS11を行なわずにS9を行なう。When a black block element is detected in S6, the black block detection unit 24 calculates the column accumulated pixel number HL (X-1) of the position X-1 immediately before the position X where the black block element is detected by the first peripheral distribution. The HL (X-1) read from the storage unit 22 is compared with the threshold value THL to determine whether HL (X-1) is a white block element (S7). If the result of the determination in S7 is a white block element, the black block detection unit 24 indicates that a white block element has been detected at position X-1 and a black block element has been detected at position X. the Save as starting position X BS (S8) and then subjected to S9 (S
9 will be described later). If the determination result in S7 is a black block element, the length of the black block X−
XBS + 1 is calculated and the calculated length is used as the black block width determination unit 26.
Output to The black block width determination unit 26 that has input the length of the black block from the black block detection unit 24 sets the input length as a threshold.
Compare with BWJ (S10). The black block width determination unit 26 outputs the first determination result to the black block detection unit 24 when the input length exceeds the threshold BWJ, and outputs the second determination result when the input length is equal to or less than the threshold BWJ. . Black block detector 24
The position X to X for a column cumulative number of pixels read out to perform the re-detection of the black and white block element from the starting position X BS of the black block of length exceeding the threshold BWJ if you enter the first determination result The threshold value THL is set to BS- 1, and the threshold value THL is increased by a predetermined amount UT (S11). Then, S9 is performed. If the second determination result is input, S9 is performed without performing S11.
さらに黒ブロック検出部24はS6で白ブロック要素を検
出した場合、当該白ブロック要素の位置Xのひとつ前の
位置X−1の列累積画素数HL(X−1)を第一周辺分布
記憶部22から読み込み、読出したHL(X−1)を閾値TH
Lと比較しHL(X−1)が黒ブロック要素であるか否か
を判定する(S1,2)。黒ブロック検出部24は、S12での
判定結果に黒ブロック要素であった場合には位置X−1
において黒ブロック要素及び位置Xにおいて白ブロック
要素を検出し従って閾値BWJ以下の長さの黒ブロックの
終端位置XBLを検出した(当該白ブロック要素の位置X
のひとつ前の位置X−1がXBLである)とみなし、n=
1か否かを判定する(S13)。Further, when detecting the white block element in S6, the black block detection unit 24 stores the column accumulated pixel number HL (X-1) of the position X-1 immediately before the position X of the white block element in the first peripheral distribution storage unit. 22 and read HL (X-1) to the threshold TH
It is determined whether or not HL (X-1) is a black block element by comparing with L (S1, 2). If the result of the determination in S12 is a black block element, the black block
In detects the end position X BL black block detecting the white block element thus threshold BWJ less in length in the black block element and the position X (position X of the white block element
Is assumed to be XBL before position X-1), and n =
It is determined whether it is 1 (S13).
黒ブロック検出部24はS13でn=1の場合には当該閾
値BWJ以下の長さの黒ブロックは文字を構成するブロッ
クであるとみなし、所定の方向におけるn番目の文字の
終端位置XR(n)として当該閾値BWJ以下の長さの黒ブ
ロックの終端位置XBL=X−1を及び文字の始端位置XL
(n)として当該閾値BWJ以下の長さの黒ブロックの始
端位置XBSを保存する(S14)。次いで黒ブロック検出部
部24は次の文字の行方向始端位置XL(n)及び行方向終
端位置XR(n)を検出すべく閾値THLを初期化しnに1
を加算しさらに位置XをXR(n)とし(S15)次いでS9
を行なう。When n = 1 in S13, the black block detection unit 24 regards a black block having a length equal to or less than the threshold value BWJ as a block forming a character, and determines the end position X R ( n) represents the end position X BL = X−1 of the black block having a length equal to or less than the threshold value BWJ and the start position X L of the character
(N) as to store the start position X BS of the black block of the threshold BWJ following length (S14). Next, the black block detection unit 24 initializes the threshold value THL to detect the line direction start position X L (n) and line direction end position X R (n) of the next character, and resets n to 1
Is added and the position X is set to X R (n) (S15) and then S9
Perform
また黒ブロック検出部24はS13でn=1でない場合に
は当該黒ブロックの始端位置XBSと当該黒ブロックのひ
とつ前に検出された文字を構成する黒ブロックとの離間
距離XBS−(XR(n−1)+1)が零となるか否かを判
定する(S16)。黒ブロック検出部24は、S16で離間距離
XBS−(XR(n−1)+1)が零となる場合には、当該B
WJ以下の長さの黒ブロックは罫線を構成するブロックで
あるとみなし従ってS14、15を行なわずにS9を行ない、
また16で離間距離XBS−(XR(n−1)+1)が零とな
らない場合には、当該BWJ以下の長さの黒ブロックは文
字を構成するブロックであるとみなし従ってS14、15を
行ない次いでS9を行なう。The distance between the black block when a black block detection unit 24 is not n = 1 in S13 constituting the character detected before one start position X BS and the black block in the black block X BS - (X It is determined whether or not R (n-1) +1) becomes zero (S16). Black block detector 24 is separated distance in S16
If X BS − (X R (n−1) +1) becomes zero, the corresponding B
A black block having a length equal to or less than WJ is regarded as a block constituting a ruled line, so that S9 is performed without performing S14 and S15,
If the separation distance X BS − (X R (n−1) +1) is not zero at 16, the black block having a length equal to or less than the BWJ is regarded as a block that constitutes a character, and thus S 14 and S 15 are replaced. Then, S9 is performed.
S9では、黒ブロック検出部24は文字部領域38内の全て
の列累積画素数HL(X)を読み込んだか否かを判定す
る。黒ブロック検出部24は、S9においてX=XEでなけれ
ば全ての列累積画素数HL(X)の読み込みを終えていな
いので次の位置XのHL(X)を読み込むべくXに1を加
算し(S17)次いでS6に戻り、またS9においてX=XEで
あれば黒ブロック検出部24は全ての列累積画素数HL
(X)を読み込み文字部領域38内の全ての文字につき行
方向始端位置XL及び終端位置XRの検出を終了したことを
表す。In S9, the black block detection unit 24 determines whether or not all the column accumulated pixel numbers HL (X) in the character part area 38 have been read. Black block detection unit 24, adds 1 because not finished reading the X = X E unless all columns accumulated pixel number HL (X) in the X to read the next position X HL (X) in S9 and (S17) and then returns to S6, also X = X E a long if black block detection unit 24 all columns cumulative number of pixels in S9 HL
(X) indicates that the detection of the start position X L and the end position X R in the line direction for all the characters in the character portion area 38 has been completed.
黒ブロック検出部24が位置XL及びXRの検出を終了する
と、検出領域位置決定部28は第一及び第二罫線検出領域
の設定を開始する。検出領域位置決定部28は罫線付文字
行領域40内のXが次第に大きくなる方へ数えてn番目の
文字の行方向始端位置XL(n)及び終端位置XR(n)を
黒ブロック検出部24から読み込み、読み込んだ位置X
L(n)、XR(n)と式(1)〜(4)とから、n番目
の文字の第一罫線検出領域の端縁位置XLL(n)、X
LR(n)と第二罫線検出領域の端縁位置XRL(n)、XRR
(n)とを設定して罫線検出領域の設定の行ない(S1
8)、これら位置XL(n)、XR(n)と位置XLL(n)、
XLR(n)、XRL(n)、XRR(n)とを制御部18に対し
て出力する。制御部18は1番目からnLS番目までの文字
の行方向始端及び終端位置と第一及び第二罫線検出領域
の端縁位置とを入力し各文字に保存する。When black block detecting unit 24 finishes the detection of the position X L and X R, the detection area position determining unit 28 starts the setting of the first and second ruled line detection area. The detection area position determination unit 28 detects a black block at the start position X L (n) and end position X R (n) of the n-th character in the line direction, counting X in the ruled-lined character line area 40 in a gradually increasing direction. Read from part 24, read position X
L (n), X R from (n) and the equation (1) ~ (4), n -th of the first ruled line detection area of the character edge position X LL (n), X
LR (n) and edge positions X RL (n), X RR of the second ruled line detection area
(N) to set the ruled line detection area (S1
8), these positions X L (n), X R (n) and the position X LL (n),
X LR (n), X RL (n), and X RR (n) are output to the control unit 18. The control unit 18 inputs the start and end positions in the row direction of the first to nLS- th characters and the edge positions of the first and second ruled line detection areas, and stores them in each character.
検出領域位置決定部28がnLS番目の、行方向始端位置
及び終端位置と第一及び第二罫線検出領域の端縁位置と
を出力すると、罫線検出領域設定部14は動作を終了す
る。When the detection area position determination unit 28 outputs the nLS- th start and end positions in the row direction and the edge positions of the first and second ruled line detection areas, the ruled line detection area setting unit 14 ends the operation.
ここで上述した第3図に示す動作の流れの罫線検出領
域設定部14の効果につき第2図を参照して説明する。第
2図(B)において文字を構成する黒ブロックの存在す
る領域を実線矢印で及び閾値BWJを越える長さの黒ブロ
ックの存在する領域を一点鎖線の矢印で示した。ここ
で、第2図(B)において示す位置X2、X4が第2図
(A)において示す位置XL(1)、XR(1)として検出
され、同様に位置X5、X6が位置XL(2)、XR(2)とし
て、位置X7、X8が位置XL(3)、XR(3)として位置
X9、X11が位置XL(4)、XR(4)として、及び位置
X12、X14が位置XL(5)、XR(5)として検出されるも
のとする。Here, the effect of the ruled line detection area setting unit 14 in the operation flow shown in FIG. 3 will be described with reference to FIG. In FIG. 2 (B), the region where the black block constituting the character exists is indicated by a solid line arrow, and the region where the black block having a length exceeding the threshold value BWJ exists is indicated by a chain line arrow. Here, the positions X 2 and X 4 shown in FIG. 2B are detected as the positions X L (1) and X R (1) shown in FIG. 2A, and similarly, the positions X 5 and X 6. There position X L (2), as X R (2), position X 7, X 8 is positioned X L (3), the position as X R (3)
X 9 and X 11 are as positions X L (4), X R (4) and at positions
X 12, X 14 is positioned X L (5), it shall be detected as X R (5).
例えば第2図(B)に示す列累積画素数の分布を得た
とした場合に閾値THLを初期値(THL1)として設定し文
字を構成する黒ブロックの長さをBWJ以下とする制約を
設けないと、位置X1からX4までの罫線及び文字を構成す
る黒ブロック要素が一塊りの黒ブロックとして検出され
てしまう。しかしながら第2図(B)からも明らかなよ
うに黒ブロックの長さを閾値BWJ以下とする制約を設けB
WJを越える黒ブロックを検出したら閾値THLをTHL1からT
HL2(=THL1+UT)に変更して黒及び白ブロック要素の
再検出を行なうようにすることによって、位置X1からX4
までの文字を構成する黒ブロック要素のみから成る黒ブ
ロックを検出でき、位置X2をXL(1)として及び位置X4
をXR(1)として検出することができる。For example, when it is assumed that the distribution of the column cumulative pixel number shown in FIG. 2 (B) is obtained, the threshold THL is set as the initial value (THL1), and there is no restriction that the length of the black block constituting the character is BWJ or less. When, black block elements constituting the ruled lines and characters from the position X 1 to X 4 is detected as a black block Ichikatamariri. However, as is evident from FIG. 2 (B), a constraint is set so that the length of the black block is not more than the threshold value BWJ.
When a black block exceeding WJ is detected, the threshold value THL is changed from THL1 to T.
By changing to HL2 (= THL1 + UT) and re-detecting the black and white block elements, the positions X 1 to X 4
The black block consisting only of the black block elements constituting the characters up to is detected, the position X 2 is set to X L (1) and the position X 4
Can be detected as X R (1).
また閾値THLをTHL2に固定したままにしておくと、第
2図(A)及び(B)にも示すように、文字間において
ハイフン「−」が存在しかつ隣接する文字A及びB間に
おいて罫線が部分的にない場合にハイフン「−」を検出
できない場合がある。しかしながら一文字の行方向始端
及び終端位置を検出したのち当該検出文字の終端位置X
BL例えばXR(1)=X4の次の位置X4+1から閾値THLを
初期値THL1として黒及び白ブロック要素の検出を行なう
ことによってハイフン「−」の行方向始端位置及び終端
位置の検出も行なえる。すなわちハイフン「−」の行方
向始端位置及び終端位置X5及びX6を位置XL(2)、X
R(2)として検出できる。When the threshold value THL is fixed to THL2, as shown in FIGS. 2A and 2B, a hyphen “−” exists between characters and a ruled line exists between adjacent characters A and B. In some cases, the hyphen "-" cannot be detected when there is no part. However, after detecting the start and end positions of one character in the line direction, the end position X of the detected character is detected.
BL, for example, from the position X 4 +1 next to X R (1) = X 4, using the threshold value THL as the initial value THL1 to detect black and white block elements, thereby detecting the starting position and the ending position of the hyphen “−” in the row direction. Can also do. That hyphen "-" row starting position and end position of X 5 and X 6 position X L (2), X
R (2) can be detected.
またこの実施例によれば閾値BWJ以下の黒ブロックを
検出した場合には当該閾値BWJ以下の黒ブロックのひと
つ前の文字を構成する黒ブロックとの離間距離を調べ、
この離間距離が零である場合すなわち当該値BWJ以下の
黒ブロックとひとつ前の文字を構成する黒ブロックとが
接触している場合には、当該閾値BWJ以下の黒ブロック
を、罫線を構成するブロックとみなし当該閾値BWJK以下
の黒ブロックの始端位置及び終端位置を行方向始端位置
及び終端位置として検出しないようにする。またこの離
間距離が零でない場合すなわち当該閾値BWJ以下の黒ブ
ロックとひとつ前の文字を構成する黒ブロックとが離間
している場合には、当該閾値BWJ以下の黒ブロックを文
字を構成するブロックとみなし当該閾値BWJ以下の黒ブ
ロックの始端位置及び終端位置を行方向始端位置及び終
端位置として検出するようにする。このようにすること
によって、閾値THLとして例えばTHL1を設定した場合に
位置X14からX15までの間において閾値BWJ以下の長さを
有する黒ブロックであって罫線を構成する黒ブロックを
検出した場合でも、この黒ブロックの始端及び終端位置
を行方向始端位置及び終端位置として検出せずにすむ。According to this embodiment, when a black block equal to or less than the threshold BWJ is detected, the separation distance between the black block equal to or less than the threshold BWJ and the black block that constitutes the previous character is checked.
When the separation distance is zero, that is, when the black block of the value BWJ or less is in contact with the black block of the immediately preceding character, the black block of the threshold BWJ or less is converted to a block forming a ruled line. The start position and the end position of the black block that is equal to or less than the threshold value BWJK are not detected as the start position and the end position in the row direction. When the separation distance is not zero, that is, when the black block of the threshold BWJ or less and the black block of the previous character are separated from each other, the black block of the threshold BWJ or less is defined as a block forming the character. The start position and the end position of the black block that is not more than the threshold value BWJ are detected as the start position and the end position in the row direction. By this arrangement, when detecting a black block constituting the A and borders a black block having a length less than the threshold BWJ between from the position X 14 to X 15 in the case of setting the THL1 example as a threshold value THL However, the start and end positions of the black block need not be detected as the start and end positions in the row direction.
次に罫線検出領域設定部14が動作を終了したのちの動
作の流れの説明に戻る。罫線検出領域設定部14が動作を
終了すると、制御部18は行始端位置及び終端位置と第一
及び第二罫線検出領域の端縁位置とを、1番目の文字か
らnLS番目の文字まで一文字毎に文字罫線分離部16に出
力する。文字罫線分離部16は一文字分の行方向始端位置
及び終端位置と第一及び第二罫線検出領域の端縁位置と
を入力し、これら位置に基づいてこれら位置を検出した
一文字の文字の、列方向における始端位置及び終端位置
(以下、列方向始端位置及び列方向終端位置と称す)を
検出し制御部18に出力する。制御部18は文字罫線分離部
16から一文字分の列方向始端及び終端位置を入力する
と、入力した列方向始端及び終端位置と当該列方向始端
及び終端位置を検出した文字の行方向始端位置及び終端
位置とを文字切出情報として出力すると共に、次の一文
字分の行方向始端及び終端位置と第一及び第二罫線検出
領域の端縁位置とを文字罫線分離部16に対し出力する。Next, the description returns to the flow of the operation after the ruled line detection area setting unit 14 ends the operation. If ruled line detection area setting unit 14 ends the operation, the control unit 18 row start position and end position and the edge position of the first and second ruled line detection area, one character from the first character to the n LS-th character It is output to the character ruled line separation unit 16 every time. The character rule separation unit 16 inputs the start position and end position of one character in the row direction and the edge positions of the first and second rule detection areas, and based on these positions, detects the character string of one character whose position is detected. The start position and the end position in the direction (hereinafter, referred to as the start position in the column direction and the end position in the column direction) are detected and output to the control unit 18. The control unit 18 is a character line separation unit
When the start and end positions in the column direction for one character from 16 are input, the input start and end positions in the column direction and the start and end positions in the row direction of the detected character in the column direction are extracted as character extraction information. At the same time, the start and end positions of the next character in the line direction and the edge positions of the first and second ruled line detection areas are output to the character ruled line separation unit 16.
制御部18はnLS番目の文字の列方向始端及び終端位置
を文字罫線分離部16から入力すると、当該nLS番目の文
字の列方向始端位置及び終端位置と行方向始端位置及び
終端位置とを出力したのち1行の文字行に関する文字切
出しを終了する。When the control unit 18 inputs the column start and end positions of the n LS th character from the character ruled line separating section 16, and a column start position and end position in the row direction starting end position and the end position of the n LS-th character After the output, the character extraction for one character line ends.
以下、第4図及び第5図を参照し、文字罫線分離部16
の動作例につき詳細に説明する。Hereinafter, with reference to FIG. 4 and FIG.
Will be described in detail.
第4図(A)は主として一文字分の画像データを示す
図、第4図(B)及び(C)は第4図(A)に示す画像
データの第一行累積画素数及び第二行累積画素数の分布
を示す図である。第5図(A)及び(B)は文字罫線分
離部の動作の流れの一例を示す図である。FIG. 4 (A) is a diagram mainly showing image data of one character, and FIGS. 4 (B) and (C) are the first row cumulative pixel count and the second row cumulative of the image data shown in FIG. 4 (A). It is a figure showing distribution of the number of pixels. FIGS. 5A and 5B are diagrams showing an example of the operation flow of the character ruled line separation unit.
文字罫線分離部16は、制御部18から行方向始端位置及
び終端位置XL(n)及びXR(n)と、第一罫線検出領域
の端縁位置XLL(n)、XLR(n)と、第二罫線検出領域
の端縁位置XRL(n)、XRR(n)とを入力すると、第n
番目の文字の列方向始端位置及び終端位置YT及びYBの検
出を開始し、まず第二周辺分布作成部30が当該n番目の
文字の第一罫線検出領域42内の行累積画素数BLH(Y)
及び第二罫線検出領域44内の行累積画素数BRH(Y)の
検出を開始する。第4図において第一罫線検出領域42を
三点鎖線及び第二検出領域44を四点鎖線で示した。Character ruled line separating section 16, to the row direction starting end position and the end position X L (n) and X R (n) from the control unit 18, end edge positions X LL of the first ruled line detection area (n), X LR (n ) And the edge positions X RL (n) and X RR (n) of the second ruled line detection area, the
Th detected by the start of the column start position and end position Y T and Y B character, first the second peripheral distribution creation unit 30 of the n-th character first ruled line detection area 42 the number of rows accumulated pixel BLH (Y)
Then, the detection of the row cumulative pixel number BRH (Y) in the second ruled line detection area 44 is started. In FIG. 4, the first ruled line detection area 42 is indicated by a three-dot chain line, and the second detection area 44 is indicated by a four-dot chain line.
行累積画素数の検出を開始した第二周辺分布作成部30
は、所定の列方向における走査位置YをYT1に設定し
(*S1)、次に位置Yにおいて画像データを所定の行方
向に走査してXLL(n)からXLR(n)までの間の黒画素
数を計数して第一行累積画素数BLH(Y)を検出し検出
したBLH(Y)を当該位置Yにおける第一行累積画素数
として第二周辺分布記憶部32に記憶する。これと共に位
置Yにおいて画像データを走査してXRL(n)からX
RR(n)までの間の黒画素数を計数して第二行累積画素
数BRH(Y)を検出し検出したBRH(Y)を当該位置Yに
おける第二行累積画素数として第二周辺分布記憶部32に
保存する(*S2)。Second marginal distribution creating unit 30 that has started detecting the row cumulative pixel count
Sets the scanning position Y in the predetermined column direction to Y T1 (* S1), and then scans the image data in the predetermined row direction at the position Y to determine the position from X LL (n) to X LR (n). The number of black pixels between them is counted, the first row cumulative pixel number BLH (Y) is detected, and the detected BLH (Y) is stored in the second peripheral distribution storage unit 32 as the first row cumulative pixel number at the position Y. . At the same time, the image data is scanned at the position Y and X RL (n) is
The number of black pixels up to RR (n) is counted, the second row cumulative pixel number BRH (Y) is detected, and the detected BRH (Y) is used as the second row cumulative pixel number at the position Y to obtain the second peripheral distribution. It is stored in the storage unit 32 (* S2).
行累積画素数BLH(Y)及びBRH(Y)は次式(8)及
び(9)によって表せる。The row accumulated pixel numbers BLH (Y) and BRH (Y) can be expressed by the following equations (8) and (9).
次いで第二周辺分布作成部30は罫線検出領域42及び44
内の全ての位置Yにおいて行累積画素数を検出したか否
かを判定する(*S3)。位置Y=YB1でなければ次の位
置Yにおける行累積画素数を検出すべく位置Yに1加算
し(*S4)、次いで*S2に戻る。位置Y=YEであれば全
ての位置Yにおける列累積画素数BLH(Y)、BRH(Y)
を検出したものとみなして行累積画素数の検出を終え
る。 Next, the second margin distribution creating unit 30 sets the ruled line detection areas 42 and 44
It is determined whether or not the total number of row pixels has been detected at all the positions Y in (* S3). If the position Y is not equal to Y B1 , one is added to the position Y (* S4) in order to detect the number of accumulated pixels at the next position Y (* S4), and then the process returns to * S2. If the position Y = Y E , the column cumulative pixel numbers BLH (Y) and BRH (Y) at all the positions Y
Is detected, and the detection of the row cumulative pixel number is completed.
行累積画素数の検出を終了すると罫線検出部34は列方
向始端位置YT及び列方向終端位置YBの検出を開始し、BL
H(Y)の読出し位置YをYLS1としてのYSに設定する
(*S5)。但し、YS=(YT1−YB1)/2である。次いで位
置Yの列累積画素数BLH(Y)を第二周辺分布記憶部32
から読出し、読出したBLH(Y)を所定の閾値THLLと比
較して当該BLH(Y)は黒ブロック要素か否かを判定す
る(*S6)。Row Upon completion of the cumulative number of pixels detecting ruled line detection unit 34 starts the detection of the column direction starting end position Y T and the column end position Y B, BL
Reading position Y H (Y) is set to Y S as Y LS1 (* S5). Here, Y S = (Y T1 −Y B1 ) / 2. Next, the column accumulated pixel number BLH (Y) at the position Y is stored in the second peripheral distribution storage unit 32.
The BLH (Y) by comparing the read, the read BLH a (Y) with a predetermined threshold value THL L from determines whether black block elements (* S6).
THLLの値は任意好適な値とすることができ、この例で
は例えば次式(10)によってTHLLを得る。The value of THL L may be any suitable value to obtain the THL L, for example by the following equation (10) in this example.
罫線検出部34は*S6で黒ブロック要素を検出した場合
には、罫線を検出したので当該黒ブロック要素の検出位
置Yを罫線検出処理結果YLTとして保存し(*S7)、次
いで*S10を行なう。*S6で黒ブロックを検出しなかっ
た場合には、YLS1からYT1までの全てのBLH(Y)を読出
したか否かを判定する(*S8)。*S7でY=YT1であれ
ば罫線を検出せずに全てのBLH(Y)の読出しを終えた
ので当該位置Y=YT1を罫線検出処理結果YLTとして保存
し(*S7)次いで*S10を行なう。*S7でY=YT1でなけ
れば次の位置YのBLH(Y)を読出すべく位置Yから1
減算し(*S9)、次いで*S6に戻る。 When detecting a black block element in * S6, the ruled line detection unit 34 detects a ruled line, and stores the detection position Y of the black block element as a ruled line detection processing result YLT (* S7), and then * S10 Do. * If it does not detect the black block in S6, judges read Taka whether all BLH a (Y) from Y LS1 to Y T1 (* S8). * If Y = Y T1 in S7, all the BLH (Y) have been read out without detecting the ruled line. Therefore, the position Y = Y T1 is stored as the ruled line detection processing result YLT (* S7) and then * Perform S10. * Unless Y = Y T1 at S7, 1 from position Y to read BLH (Y) at next position Y
Subtract (* S9), then return to * S6.
罫線検出部34は*10で、BLH(Y)の読出し位置YをY
LS2としてのYB2に設定する。次いで位置Yの列累積画素
数BLH(Y)を第二周辺分布記憶部32から読出し、読出
しBLH(Y)を閾値THLLと比較して当該BLH(Y)は黒ブ
ロック要素か否かを判定する(*S11)。The ruled line detector 34 sets the read position Y of BLH (Y) to Y by * 10.
It is set to Y B2 as the LS2. Then read position Y column cumulative number of pixels BLH a (Y) from the second peripheral distribution storage unit 32, the reading BLH a (Y) is compared with a threshold value THL L BLH (Y) is determined whether the black block elements (* S11).
罫線検出部34は*S11で黒ブロック要素を検出した場
合には、罫線を検出したので当該黒ブロック要素の検出
位置Yを罫線検出処理結果YLBとして保存し(S12)、次
いで*S15を行なう。*S11で黒ブロック要素を検出しな
かった場合には、YLS2からYB1までの全てのBLH(Y)を
読出したか否かを判定する(*S13)。*S13でY=YB1
であれば罫線を検出せずに全てのBLH(Y)の読出しを
終えたので当該位置Y=YB1を罫線検出処理結果YLBとし
て保存する(*S12)次いで*S15を行なう。*S13でY
=YB1でなければ次の位置YのBLH(Y)を読出すべく位
置Yに1加算(*S14)、次いで*S11に戻る。When detecting a black block element in * S11, the ruled line detection unit 34 detects a ruled line, and stores the detected position Y of the black block element as a ruled line detection processing result YLB (S12), and then performs * S15. . * If it does not detect the black block elements in S11, determines read Taka whether all BLH a (Y) from Y LS2 to Y B1 (* S13). * Y = Y B1 in S13
Because it if finished reading of all BLH without detecting a ruled line (Y) is to store the position Y = Y B1 as ruled line detection processing result Y LB (* S12) then * S15 performs. * Y in S13
If not = Y B1 , 1 is added to position Y to read BLH (Y) at the next position Y (* S14), and then the process returns to * S11.
罫線検出部34は*S15で、BRH(Y)の読出し位置Yを
YRS1としてのYT2に設定する。次いで位置Yの列累積画
素数BRH(Y)を第二周辺分布記憶部32から読出し、読
出したBRH(Y)を閾値THLRと比較して当該BRH(Y)は
黒ブロック要素か否かを判定する(*S16)。The ruled line detection unit 34 sets the read position Y of BRH (Y) in * S15.
Set to Y T2 as Y RS1 . Then read position Y column cumulative number of pixels BRH a (Y) from the second peripheral distribution storage unit 32, the BRH the read BRH a (Y) compared with a threshold value THL R (Y) is whether black block elements Judge (* S16).
THLRの値は任意好適な値とすることができ、この例で
は例えば次式(11)によってTHLRを得る。The value of THL R can be any suitable value. In this example, THL R is obtained by, for example, the following equation (11).
罫線検出部34は*S16で黒ブロック要素を検出した場
合には、当該黒ブロック要素の検出位置Yを罫線検出処
理結果YRBとして保存し(*S17)、次いで*S20を行な
う。*S17で黒ブロック要素を検出しなかった場合に
は、YRS1からYT1までの全てのBRH(Y)を読出したか否
かを判定する(*S18)。*S18でY=YT1であれば罫線
を検出せずに全てのBRH(Y)の読出しを終えたので当
該位置Y=YT1を罫線検出処理結果YRTとして保存し(*
S17)次いで*S20を行なう。*S18でY=YT1でなければ
次の位置YのBRH(Y)を読出すべく位置Yから1減算
し(*S19)、次いで*S16に戻る。 Border detector 34 when detecting the black block elements * S16 stores the detection position Y of the black block element as ruled line detection processing result Y RB (* S17), then * S20 performs. If no black block element is detected in * S17, it is determined whether or not all BRH (Y) from Y RS1 to Y T1 have been read (* S18). * If Y = Y T1 in S18, all the BRH (Y) have been read out without detecting the ruled line, and the position Y = Y T1 is stored as the ruled line detection processing result Y RT (*
S17) Then, * S20 is performed. Unless Y = Y T1 in * S18, 1 is subtracted from the position Y to read the BRH (Y) at the next position Y (* S19), and then the process returns to * S16.
罫線検出部34は*S20で、BRH(Y)の読出し位置Yを
YRS2としてのYB2に設定する。次いで位置Yの列累積画
素数BRH(Y)を第二周辺分布記憶部32から読出し、読
出したBRH(Y)を閾値THLRと比較して当該BRH(Y)は
黒ブロック要素か否かを判定する(*S21)。The ruled line detection unit 34 sets the read position Y of BRH (Y) in * S20.
Set to Y B2 as Y RS2 . Then read position Y column cumulative number of pixels BRH a (Y) from the second peripheral distribution storage unit 32, the BRH the read BRH a (Y) compared with a threshold value THL R (Y) is whether black block elements It is determined (* S21).
罫線検出部34は*S21で黒ブロック要素を検出した場
合には、当該黒ブロック要素の検出位置Yを罫線検出処
理結果YRBとして保存し(*S22)、第n番目の文字の罫
線検出処理結果として検出したYLT、YLB、YRT及びYRBを
罫線分離位置決定部36に対して出力し罫線検出処理を終
える。*S21で黒ブロック要素を検出しなかった場合に
は、YRS2からYB1までの全てのBRH(Y)を読出したか否
かを判定する(*S23)。*S23でY=YB1であれば罫線
を検出せずに全てのBRH(Y)の読出しを終えたので当
該位置Y=YB1を罫線検出処理結果YRBとして保存し(*
S22)、第n番目の文字の罫線検出処理結果として検出
したYLT、YLB、YRT及びYRBを罫線分離位置決定部36に対
して出力し罫線検出処理を終える。*S23でY=YB1でな
ければ次の位置YのBRH(Y)を読出すべく位置Yに1
加算し(*S24)次いで*S21に戻る。When detecting a black block element in * S21, the ruled line detection unit 34 stores the detected position Y of the black block element as a ruled line detection processing result Y RB (* S22), and executes the ruled line detection processing of the nth character. The detected Y LT , Y LB , Y RT, and Y RB are output to the ruled line separation position determining unit 36, and the ruled line detection process is completed. * If it does not detect the black block elements in S21, determines read Taka whether all BRH a (Y) from Y RS2 to Y B1 (* S23). * If Y = Y B1 in S23, all the BRH (Y) have been read out without detecting the ruled line, and the position Y = Y B1 is stored as the ruled line detection processing result Y RB (*
S22), the n-th character in the ruled line detection processing result as the detected Y LT, Y LB, ends the output was ruled line detection process with respect to Y RT and Y RB borders separating position determination unit 36. * Unless Y = Y B1 in S23, 1 is set at position Y to read out BRH (Y) at next position Y
Add (* S24) and then return to * S21.
罫線分離位置決定部36は、罫線検出部34からの罫線検
出処理結果を入力すると、式(5)及び(6)に従っ
て、第n番目の文字の列始端位置YT及び列終端位置YBを
検出し(*S25)、検出したYT及びYBを制御部18に出力
する。Borders separating position determination unit 36 inputs the ruled line detection processing result from the border detector 34 in accordance with Equation (5) and (6), the n-th column start position of a character Y T and the column end position Y B detected (* S25), and outputs the detected Y T and Y B to the control unit 18.
例えば第4図に示す画像データからは、文字の列始端
位置YTとしてYLTが及び列終端位置としてYRBが検出さ
れ、従って画像の真の行方向が所定の行方向からずれて
おりしかも文字46と罫線48とが接触している場合でも、
文字46と罫線48とを分離して切出すことが可能となる。For example, from the image data shown in FIG. 4, yet it is offset as a column start position Y T letter Y LT Y RB is detected as the and column end position, thus the true row direction of the image from a given row direction Even if the character 46 and the ruled line 48 are in contact,
The character 46 and the ruled line 48 can be separated and cut out.
この発明は上述した実施例にのみ限定されるものでは
なく、従って各構成成分の動作の流れ、入出力信号、動
作のタイミング、接続関係及び構成を任意好適に変更す
ることができる。The present invention is not limited to the above-described embodiment. Therefore, the operation flow of each component, input / output signals, operation timing, connection relationship, and configuration can be arbitrarily and suitably changed.
例えば、上述した実施例では、横書き文書の画像デー
タを例に取って所定の行方向における文字始端及び終端
位置と所定の列方向における文字始端及び終端位置を検
出した例につき説明したが、この発明を縦書き文書に適
用できることは明らかである。For example, in the above-described embodiment, a description has been given of an example in which the character start and end positions in a predetermined line direction and the character start and end positions in a predetermined column direction are detected using image data of a horizontally written document as an example. Obviously, can be applied to vertically written documents.
第6図は縦書き文書の画像データの一例を示す図であ
る。例えば同図に示すように画像メモリ上にX−Y座標
系を設定しX軸を所定の行方向とすれば、上述した実施
例と同様にして所定の行及び列方向文字における文字始
端位置及び終端位置を検出できる。FIG. 6 is a diagram showing an example of image data of a vertically written document. For example, as shown in the figure, if an XY coordinate system is set on the image memory and the X axis is set to a predetermined row direction, the character starting position in the predetermined row and column direction characters and The end position can be detected.
(発明の効果) 上述した説明からも明らかなように、この発明の文字
切出し装置によれば、所定の行方向における長さが長さ
閾値を越える黒ブロックを検出したときはブロック閾値
を所定量増加させて当該長さ閾値を越える黒ブロックの
始端位置から黒及び白ブロック要素を再度検出し直し、
閾値以下の黒ブロックの終端位置を検出したときは当該
長さ閾値以下の黒ブロックの始端位置及び終端位置を所
定の行方向の文字始端位置及び終端位置として検出す
る。従って、長さ閾値を任意好適に設定することによっ
て長さが文字幅を越える黒ブロックを検出せずにすみ、
しかも長さが長さ閾値以下となるまで黒及び白ブロック
要素の再検出を繰り返すので文字幅以内の黒ブロックの
みを検出することができ、従って文字始端位置及び終端
位置の検出精度を向上できる。(Effects of the Invention) As is clear from the above description, according to the character extracting apparatus of the present invention, when a black block whose length in a predetermined line direction exceeds a length threshold is detected, the block threshold is increased by a predetermined amount. Increase and re-detect the black and white block elements from the starting position of the black block exceeding the length threshold again,
When the end position of the black block equal to or less than the threshold value is detected, the start position and the end position of the black block equal to or less than the length threshold value are detected as the character start position and the end position in a predetermined line direction. Therefore, it is not necessary to detect a black block whose length exceeds the character width by setting the length threshold arbitrarily and appropriately,
Moreover, since re-detection of black and white block elements is repeated until the length becomes equal to or less than the length threshold value, only black blocks within the character width can be detected, so that the detection accuracy of the character start position and the character end position can be improved.
さらに所定の列方向の文字始端位置及び終端位置の検
出を、第一及び第二罫線検出領域内における所定の行方
向の累積黒画素数の変化に基づいて行ない従って累積黒
画素数の検出と閾値処理とから行なうので、これら始端
及び終端位置の検出処理を簡単化できる。Further, the detection of the character start position and the end position in the predetermined column direction is performed based on the change of the cumulative black pixel number in the predetermined row direction in the first and second ruled line detection areas. Since the processing is started from the processing, the detection processing of these start and end positions can be simplified.
しかも第一罫線検出領域を、所定の行方向の文字始端
位置に隣接する位置であって所定の行方向の文字終端位
置とは反対側の位置に罫線を含むように設定するので、
文字を構成する黒画素が第一罫線検出領域において所定
の行方向の累積黒画素数として計数されないように或は
ほとんど計数されないようにすることができる。その結
果、第一罫線検出領域内の罫線の位置を精度良く検出で
きる。同様に第二罫線検出領域を、所定の行方向の文字
終端位置と隣接する位置であって所定の行方向の文字始
端位置とは反対側の位置に罫線を含むように設定するの
で、文字を構成する黒画素が第二罫線検出領域における
所定の行方向の累積黒画素数として計数されないように
或はほとんど計数されないようにすることができる。そ
の結果、第二罫線検出領域内の罫線の位置を精度良く検
出できる。Moreover, since the first ruled line detection area is set to include a ruled line at a position adjacent to the character start position in the predetermined line direction and opposite to the character end position in the predetermined line direction,
It is possible to prevent black pixels constituting a character from being counted or hardly counted as the cumulative number of black pixels in the predetermined row direction in the first ruled line detection area. As a result, the position of the ruled line in the first ruled line detection area can be detected with high accuracy. Similarly, the second ruled line detection area is set to include a ruled line at a position adjacent to the character end position in the predetermined line direction and opposite to the character start position in the predetermined line direction. The constituent black pixels can be prevented from being counted or hardly counted as the cumulative number of black pixels in a predetermined row direction in the second ruled line detection area. As a result, the position of the ruled line in the second ruled line detection area can be detected with high accuracy.
従って第一及び第二罫線検出領域内における罫線の位
置を精度良く検出できるので、所定の行方向が画像の真
の行方向から多少ずれていても、及び又は、罫線と文字
とが接触していても、所定の列方向の文字始端位置及び
終端位置を文字の欠けを生じないように或は文字の欠け
を従来よりも少なくして文字を切出すことができる。Therefore, since the position of the ruled line in the first and second ruled line detection areas can be detected with high accuracy, even if the predetermined line direction is slightly shifted from the true line direction of the image, and / or the ruled line is in contact with the character. However, a character can be cut out at a character start position and an end position in a predetermined column direction so that the character is not chipped or the character is cut less than before.
また第一及び第二罫線検出領域内の罫線検出を累積画
素数の変化に基づいて行ない従って累積黒画素数の検出
と閾値処理とから行なうので、これら領域内の罫線検出
を簡単な処理で行なえる。Further, since the ruled line detection in the first and second ruled line detection areas is performed based on the change in the cumulative number of pixels, and therefore the detection of the cumulative black pixel number and the threshold processing are performed, the ruled line detection in these areas can be performed by simple processing. You.
従ってこの発明の文字切出し装置によれば、所定の行
方向が真の行方向からずれている場合でも簡単な処理
で、所定の行及び列方向における文字の始端及び終端位
置を精度良く検出できる装置を提供できる。しかも簡単
な処理なので、装置構成を小型化及び簡単化でき、従っ
て低価格な文字切出し装置を得ることができる。Therefore, according to the character extracting apparatus of the present invention, even if the predetermined line direction is deviated from the true line direction, it is possible to accurately detect the start and end positions of characters in the predetermined line and column directions by simple processing. Can be provided. In addition, since the processing is simple, the structure of the apparatus can be reduced in size and simplified, so that a low-cost character extracting apparatus can be obtained.
この発明を文字認識装置に適用すれば、例えば文字や
罫線が原稿に多少傾斜して印刷されている場合等に読取
部が真の行方向からずれる方向に原稿を主走査したとし
ても、文字を精度良く切出すことができ従って精度の良
い文字認識が行なえる。If the present invention is applied to a character recognition device, for example, when characters or ruled lines are printed on the document with a slight inclination, even if the reading unit main-scans the document in a direction that deviates from the true line direction, characters are not recognized. It is possible to cut out with high accuracy, and therefore, it is possible to perform accurate character recognition.
第1図はこの発明の実施例の構成の一例を示す機能ブロ
ック図、 第2図(A)及び(B)は画像データ及び列累積黒画素
数の分布を示す図、 第3図(A)及び(B)は罫線検出領域設定部の動作の
流れの一例を示す図、 第4図(A)は一文字の画像データの一例を示す図、第
4図(B)及び(C)は第一罫線検出領域内の行累積画
素数の分布の一例及び第二罫線検出領域内の行累積黒画
素数の分布の一例を示す図、 第5図(A)及び(B)は文字罫線分離部の動作の流れ
の一例を示す図、 第6図は縦書き文書の画像データの一例を示す図であ
る。 10……読取部、12……画像データ記憶部 14……罫線検出領域設定部 16……文字罫線分離部 18……制御部 20……第一周辺分布作成部 22……第一周辺分布記憶部 24……黒ブロック検出部 26……黒ブロック幅判定部 28……検出領域位置決定部 30……第二周辺分布作成部 32……第二周辺分布記憶部 34……罫線検出部、36……罫線分離位置決定部。FIG. 1 is a functional block diagram showing an example of the configuration of an embodiment of the present invention. FIGS. 2 (A) and (B) are diagrams showing the distribution of image data and the cumulative number of black pixels in a column. FIG. 3 (A) 4A and 4B are diagrams showing an example of the flow of the operation of the ruled line detection area setting unit, FIG. 4A is a diagram showing an example of one character image data, and FIGS. 4B and 4C are first diagrams. FIGS. 5A and 5B are diagrams showing an example of the distribution of the cumulative number of row pixels in the ruled line detection area and an example of the distribution of the cumulative number of row black pixels in the second ruled line detection area. FIGS. FIG. 6 is a diagram showing an example of an operation flow. FIG. 6 is a diagram showing an example of image data of a vertically written document. 10 reading unit 12 image data storage unit 14 ruled line detection area setting unit 16 character ruled line separation unit 18 control unit 20 first peripheral distribution creating unit 22 first peripheral distribution storage Unit 24 Black block detecting unit 26 Black block width determining unit 28 Detection area position determining unit 30 Second peripheral distribution creating unit 32 Second peripheral distribution storage unit 34 Ruled line detecting unit 36 ... Ruled line separation position determination unit.
フロントページの続き (58)調査した分野(Int.Cl.6,DB名) G06K 9/20 G06K 9/34Continued on the front page (58) Fields surveyed (Int.Cl. 6 , DB name) G06K 9/20 G06K 9/34
Claims (1)
読取りを行ない該情報媒体の画像データを出力する読取
部と、 該読取部からの画像データを格納する画像データ記憶部
と、 前記画像データ記憶部の罫線付文字行領域内の画像デー
タを走査して所定の列方向の累積黒画素数を走査線毎に
検出し、 ブロック閾値以上の列方向累積黒画素数を黒ブロック要
素及びブロック閾値未満の列方向累積黒画素数を白ブロ
ック要素として検出し、所定の行方向における長さ閾値
を越える黒ブロックを検出したときは前記ブロック閾値
を所定量増加させて当該長さ閾値を越える黒ブロックの
始端位置から前記黒及び白ブロック要素を再度検出し直
し、前記長さ閾値以下の黒ブロックの終端位置を検出し
たときは当該長さ閾値以下の黒ブロックの始端位置及び
終端位置を所定の行方向の文字始端位置及び終端位置と
して検出すると共に前記ブロック閾値を初期化し、所定
の行方向の文字始端位置及び終端位置に基づいて、第一
罫線検出領域を所定の行方向の文字始端位置に隣接する
位置であって所定の行方向の文字終端位置とは反対側に
罫線を含むように一文字毎に設定すると共に第二罫線検
出領域を所定の行方向の文字終端位置に隣接する位置で
あって所定の行方向の文字始端位置とは反対側に罫線を
含むように一文字毎に設定する罫線検出領域設定部と、 前記画像データ記憶部の第一及び第二罫線検出領域内の
画像データを走査して所定の行方向の累積黒画素数を走
査線毎に検出し、 該行方向累積黒画素数の変化に基づいて第一及び第二罫
線検出領域内の罫線検出処理を一文字毎に行ない、 該罫線検出処理結果に基づいて、前記所定の列方向の文
字始端位置及び終端位置を一文字毎に設定する文字罫線
分離部とを備えて成ることを特徴とする文字切出し装
置。A reading unit that optically reads an information medium on which a character line with a ruled line is described and outputs image data of the information medium; an image data storage unit that stores image data from the reading unit; The image data in the character line area with a ruled line in the image data storage unit is scanned, and the cumulative number of black pixels in a predetermined column direction is detected for each scanning line. The number of accumulated black pixels in the column direction less than the block threshold is detected as a white block element, and when a black block exceeding the length threshold in a predetermined row direction is detected, the block threshold is increased by a predetermined amount to exceed the length threshold. When the black and white block elements are detected again from the start position of the black block, and the end position of the black block having the length threshold or less is detected, the start position of the black block having the length threshold or less is detected. And the end position are detected as a character start position and end position in a predetermined line direction, and the block threshold value is initialized. Based on the character start position and end position in the predetermined line direction, the first ruled line detection area is set to a predetermined line direction. Is set for each character so as to include a ruled line at a position adjacent to the character start position in the direction and opposite to the character end position in the predetermined line direction, and the second ruled line detection area is set to the character end position in the predetermined line direction A ruled line detection area setting unit that sets a ruled line for each character so as to include a ruled line on a side adjacent to a character starting end position in a predetermined line direction and a first and second ruled line detection in the image data storage unit The image data in the area is scanned to detect the cumulative number of black pixels in a predetermined row direction for each scanning line, and based on the change in the cumulative number of black pixels in the row direction, the ruled lines in the first and second ruled line detection areas are detected. Perform the processing for each character, A character ruler separating unit configured to set a character start position and an end position in the predetermined column direction for each character based on the ruled line detection processing result.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1072396A JP2812705B2 (en) | 1989-03-24 | 1989-03-24 | Character extraction device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1072396A JP2812705B2 (en) | 1989-03-24 | 1989-03-24 | Character extraction device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH02252080A JPH02252080A (en) | 1990-10-09 |
| JP2812705B2 true JP2812705B2 (en) | 1998-10-22 |
Family
ID=13488067
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1072396A Expired - Lifetime JP2812705B2 (en) | 1989-03-24 | 1989-03-24 | Character extraction device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2812705B2 (en) |
-
1989
- 1989-03-24 JP JP1072396A patent/JP2812705B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPH02252080A (en) | 1990-10-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0543593B1 (en) | Method for determining boundaries of words in text | |
| US5613016A (en) | Area discrimination system for text image | |
| EP0834826B1 (en) | Positioning templates in optical character recognition systems | |
| CA2077970C (en) | Optical word recognition by examination of word shape | |
| EP0543594A2 (en) | A method for deriving wordshapes for subsequent comparison | |
| EP0679313A1 (en) | Method and apparatus for alignment of images for template elimination | |
| JPS63158678A (en) | Inter-word space detecting method | |
| EP0375352A1 (en) | Method of searching a matrix of binary data | |
| JP2812705B2 (en) | Character extraction device | |
| JP2812704B2 (en) | Character extraction device | |
| JPH07230525A (en) | Ruled line recognition method and table processing method | |
| JPS6325391B2 (en) | ||
| JP2581809B2 (en) | Character extraction device | |
| JPS6343788B2 (en) | ||
| JPS62121589A (en) | Character segmenting system | |
| JP2975720B2 (en) | Optical character reader | |
| JPS6252337B2 (en) | ||
| JP2859307B2 (en) | Character extraction device | |
| JPS59157774A (en) | Character recognizing device | |
| JP3381803B2 (en) | Tilt angle detector | |
| JPH0575850A (en) | Picture area discriminating device | |
| JPS596418B2 (en) | Character reading method | |
| JPH03222082A (en) | Character recognizing device | |
| JPH0632077B2 (en) | Figure recognition device | |
| JPH09238247A (en) | Optical character reader |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20040930 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Effective date: 20041025 Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20041116 |
|
| R150 | Certificate of patent (=grant) or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Year of fee payment: 3 Free format text: PAYMENT UNTIL: 20071126 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Year of fee payment: 4 Free format text: PAYMENT UNTIL: 20081126 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Year of fee payment: 4 Free format text: PAYMENT UNTIL: 20081126 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091126 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101126 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101126 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Year of fee payment: 7 Free format text: PAYMENT UNTIL: 20111126 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Year of fee payment: 7 Free format text: PAYMENT UNTIL: 20111126 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Year of fee payment: 8 Free format text: PAYMENT UNTIL: 20121126 |
|
| LAPS | Cancellation because of no payment of annual fees |