[go: up one dir, main page]

JPH08221506A - Device and method for recognizing business document - Google Patents

Device and method for recognizing business document

Info

Publication number
JPH08221506A
JPH08221506A JP7028333A JP2833395A JPH08221506A JP H08221506 A JPH08221506 A JP H08221506A JP 7028333 A JP7028333 A JP 7028333A JP 2833395 A JP2833395 A JP 2833395A JP H08221506 A JPH08221506 A JP H08221506A
Authority
JP
Japan
Prior art keywords
rectangular frame
line segment
extracted
form document
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.)
Pending
Application number
JP7028333A
Other languages
Japanese (ja)
Inventor
Hiroaki Kubota
浩明 久保田
Osamu Hori
修 堀
Mieko Asano
三恵子 浅野
Shigeyoshi Shimotsuji
成佳 下辻
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP7028333A priority Critical patent/JPH08221506A/en
Publication of JPH08221506A publication Critical patent/JPH08221506A/en
Pending legal-status Critical Current

Links

Landscapes

  • Character Discrimination (AREA)
  • Character Input (AREA)

Abstract

PURPOSE: To easily and exactly extract a rectangular frame by detecting the intersections of line segments which almost perpendicularly cross each other, picking up four points among these intersection and checking whether four point can be the apexes of the rectangular frame or not by the presence/absence of a line segment between the apexes. CONSTITUTION: The angle of a line segment, whose length is longer than a threshold value set in advance, is averaged and the inclination of an entire image is measured. Then, the calculated angle of the line segment is referred to and the line segments almost horizontal or vertical to the inclination of the image are extracted. Next, a rectangular frame extracting part 4 extracts the rectangular frame formed by the extracted horizontal and vertical line segment by using a prescribed procedure. For each extracted rectangular frame, attributes such as the connecting state and shape of four apexes, the presence/ absence of slanting lines and the kinds and linen width of four sides of the rectangular frame and the slanting lines inside it are measured. The coordinate position of the rectangular frame and the other attributes provided in this case are considered as rectangular frame data. Then, the line segments used for four sides forming the rectangular frame are considered as ruled line data.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、表形式の部分を含む帳
票あるいは文書をデータ化する帳票文書認識装置および
方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a form document recognition apparatus and method for converting a form or document including a tabular portion into data.

【0002】[0002]

【従来の技術】帳票文書には、一般に、表を形成する罫
線と文字が含まれ、場合によってはその他に下線や区切
り線のようなガイドラインあるいは図・写真などの多く
の種類の線分が含まれる。
2. Description of the Related Art Generally, a form document includes ruled lines and characters forming a table, and in some cases, other types of guidelines such as underlines and dividing lines, or many types of line segments such as figures and photographs. Be done.

【0003】上記のような帳票文書を認識するための帳
票文書認識装置では、まず帳票文書中から正確に罫線を
抽出することが重要になる。従来の帳票文書認識装置の
多くは、罫線を抽出する方法として、まず帳票文書の入
力画像から線分を抽出し、抽出した線分のうち所定の条
件を満たすものを罫線として決定するような方法を取っ
ている。例えば、抽出された線分の長さを計測し、これ
が設定したしきい値よりも長いものを罫線とする方法が
ある。
In a form document recognition apparatus for recognizing a form document as described above, it is important to extract ruled lines accurately from the form document. Most conventional form document recognition devices use a method for extracting ruled lines by first extracting a line segment from an input image of a form document and determining, as a ruled line, a line segment that satisfies a predetermined condition. Is taking For example, there is a method in which the length of the extracted line segment is measured and the ruled line is longer than the set threshold value.

【0004】しかしながら、そのような方法では、罫線
のつもりで記述された線分が上記の所定の条件を満たし
ていなかったために罫線として抽出することに失敗した
り、あるいは、文字を構成する線分が上記の所定の条件
を満たしてしまい、これを罫線と誤判別することがあっ
た。例えば、帳票文書画像のかすれや線の途切れなどに
よって抽出した線分がしきい値よりも短くなり、罫線の
抽出に失敗することがあった。また、複雑な帳票文書画
像においては、文字と罫線が接近していたり、文字パタ
ーン中にしきい値を越える長さの線分を含んでいたりす
ることがあり、文字を罫線と誤判別してしまうことがあ
った。
However, in such a method, a line segment intended to be a ruled line fails to be extracted as a ruled line because it does not satisfy the above-mentioned predetermined condition, or a line segment forming a character is used. May satisfy the above-mentioned predetermined condition and may be erroneously determined as a ruled line. For example, the extracted line segment may become shorter than the threshold value due to the blurring of the form document image or the break of the line, and the ruled line extraction may fail. Further, in a complicated form document image, characters and ruled lines may be close to each other, or a character pattern may include a line segment having a length exceeding a threshold value. there were.

【0005】帳票文書を認識するために表部分の構造認
識や文字コード認識を行うとき、表の基本構成要素であ
る長方形枠(矩形領域)を抽出することは重要である。
従来、この長方形枠の抽出方法として、画像中から検出
した交差パターンに基づいて抽出する方法があった。例
えば、特開平2−50774号公報に示される方法で
は、画像中からくさび型やT字型などのパターンを抽出
し、パターンの分析と組合せにより表領域を抽出してい
る。この方法では、ある程度のカスレや線の途切れに対
しては対応できるが、複雑な文書画像においては、文字
列部分のパターンを交差パターンと間違えてしまう場合
があり、確実に文字列パターンを除去できないという欠
点があった。
When performing structure recognition or character code recognition of a table portion for recognizing a form document, it is important to extract a rectangular frame (rectangular area) which is a basic constituent element of the table.
Conventionally, as a method of extracting this rectangular frame, there has been a method of extracting based on the intersection pattern detected from the image. For example, in the method disclosed in Japanese Patent Laid-Open No. 2-50774, a pattern such as a wedge shape or a T shape is extracted from an image, and a table area is extracted by analyzing and combining the patterns. Although this method can deal with some blurring and line breaks, in a complicated document image, the pattern of the character string portion may be mistaken for the intersecting pattern, and the character string pattern cannot be reliably removed. There was a drawback.

【0006】線分と線分の交点という概念を使って長方
形領域を抽出しようという方法もある。例えば、成瀬博
之他「枠罫線情報を用いた帳票文書の構造認識」(電子
情報通信学会論文誌D−II,Vol.J75−D−I
I,No.8)に示されるように、抽出されている罫線
を延長して矩形領域を積極的に作成し、長方形枠として
抽出する方法である。しかし、この方法は、正しい罫線
が抽出されていることを前提として矩形領域を作成する
ものであり、上記のものと同様、文字と表が接触してい
たり、文字部分にノイズがかかっている場合には、文字
と罫線を分類することはできず、正しい罫線が抽出でき
ないので、正しい長方形を抽出することができなかっ
た。
There is also a method of extracting a rectangular area using the concept of line segments and intersections of line segments. For example, Hiroyuki Naruse et al. “Structure Recognition of Form Document Using Frame Ruled Line Information” (IEICE Transactions D-II, Vol. J75-DI)
I, No. As shown in 8), it is a method of extending the extracted ruled line to positively create a rectangular area and extracting it as a rectangular frame. However, this method creates a rectangular area on the assumption that the correct ruled lines are extracted, and like the above case, when the character and the table are in contact with each other or the character part is noisy. Since it was not possible to classify the characters and the ruled lines, and the correct ruled lines could not be extracted, the correct rectangle could not be extracted.

【0007】長方形枠を抽出する際、4つの頂点の接続
状態あるいは頂点付近の形状を求めるものでは、頂点付
近の局所パターンを詳細に認識していたので、処理時間
がかかるといった欠点があった。
When extracting the rectangular frame, the method of obtaining the connection state of four vertices or the shape near the vertices has a drawback that it takes a long processing time because the local pattern near the vertices is recognized in detail.

【0008】[0008]

【発明が解決しようとする課題】以上述べたように、従
来の帳票文書認識装置および方法では、帳票文書の入力
画像から抽出した線分のうち所定の条件を満たすものを
罫線として決定するような方法を取っていたので、帳票
文書に複雑な表が含まれるなどして入力画像中に種々の
線分が込み入って存在していたり、帳票文書の入力画像
の品質が悪かったりする場合、罫線の抽出に失敗した
り、罫線でないものを罫線として抽出してしまうなど正
確な罫線の抽出ができず、正確な長方形枠の抽出ができ
なかった。
As described above, in the conventional form document recognition device and method, the line segment extracted from the input image of the form document is determined to be the ruled line. Since I used the method, if there are various line segments in the input image due to a complicated table included in the form document, or the quality of the input image of the form document is poor, Accurate ruled lines could not be extracted, such as failure in extraction or extraction of non-ruled lines as ruled lines, resulting in incorrect extraction of rectangular frames.

【0009】また、画像中から検出した線分の交差パタ
ーンに基づいて長方形枠を抽出する方法では、複雑な表
を含むような帳票文書に対しては、文字列部分のパター
ンを交差パターンと間違えてしまい、正確な長方形枠の
抽出ができなかった。
Further, in the method of extracting the rectangular frame based on the intersection pattern of the line segments detected from the image, for a form document including a complicated table, the pattern of the character string portion is mistaken for the intersection pattern. I could not extract the rectangular frame accurately.

【0010】また、抽出した罫線を延長して矩形領域を
積極的に作成し、長方形枠として抽出する方法では、文
字と表が接触していたり、文字部分にノイズがかかって
いる場合には、正確な長方形枠の抽出ができなかった。
Further, in the method of extending the extracted ruled lines to positively create a rectangular area and extracting it as a rectangular frame, when the character and the table are in contact with each other or the character part is noisy, It was not possible to accurately extract the rectangular frame.

【0011】さらに、長方形枠を抽出する際、4頂点の
接続状態あるいは頂点付近の形状を検査して長方形枠を
抽出するものでは、頂点付近の局所パターンを詳細に認
識するための処理に時間がかかるといった欠点があっ
た。
Further, in extracting the rectangular frame by extracting the rectangular frame by inspecting the connection state of the four vertices or the shape near the vertices, it takes time to process the local pattern near the vertices in detail. There was a drawback such as this.

【0012】本発明は、上記事情を考慮してなされたも
ので、複雑な表を含む帳票文書や品質の悪い帳票文書画
像においても、長方形枠の抽出を簡易かつ正確に行うこ
とのできる帳票文書認識装置および方法を提供すること
を目的とする。
The present invention has been made in consideration of the above circumstances, and it is possible to easily and accurately extract a rectangular frame even in a form document including a complicated table or a form document image of poor quality. It is an object to provide a recognition device and method.

【0013】また、本発明は、帳票文書画像から長方形
枠の各頂点の接続状態および各頂点の形状を簡易に求め
ることのできる帳票文書認識装置および方法を提供する
ことを目的とする。
It is another object of the present invention to provide a form document recognition apparatus and method capable of easily obtaining the connection state of each vertex of a rectangular frame and the shape of each vertex from a form document image.

【0014】[0014]

【課題を解決するための手段】本発明は、複数の長方形
枠からなる表を含む帳票文書を認識する帳票文書認識装
置において、入力された帳票文書の画像データ中から所
定のしきい値以上の長さを有する線分を抽出する線分抽
出手段と、抽出された前記線分のうち互いに直交するも
の同士の交点を抽出する交点抽出手段と、抽出された前
記交点の集合の中から長方形の4頂点となる4つの交点
を選択し、該4つの交点からなる長方形の辺に相当する
部分に所定のしきい値以上の抽出された線分が存在する
場合、該4つの交点からなる長方形を長方形枠として決
定する長方形枠抽出手段とを具備することを特徴とす
る。
According to the present invention, in a form document recognition apparatus for recognizing a form document including a table composed of a plurality of rectangular frames, a predetermined threshold value or more is input from image data of the input form document. A line segment extraction means for extracting a line segment having a length, an intersection point extraction means for extracting an intersection point of the extracted line segments which are orthogonal to each other, and a rectangular shape from the set of the extracted intersection points. When four intersections having four vertices are selected, and a line segment having a predetermined threshold value or more is present in a portion corresponding to a side of the rectangle having the four intersections, the rectangle having the four intersections is selected. And a rectangular frame extracting unit that determines the rectangular frame.

【0015】また、本発明は、複数の枠からなる表を含
む帳票を認識する帳票文書認識装置において、入力され
た帳票文書の画像データ中から長方形枠を抽出する長方
形枠抽出手段と、抽出された前記長方形枠の各頂点と前
記画像データ中の前記表を構成する枠の各頂点近傍の線
分との間のずれを夫々計測する頂点ずれ計測手段と、計
測された各頂点と線分の間の夫々のずれを表す情報によ
って、前記表を構成する枠の各頂点の接続状態または各
頂点の形状を決定する頂点属性計測手段とを具備するこ
とを特徴とする。
Further, according to the present invention, in a form document recognition apparatus for recognizing a form including a table composed of a plurality of frames, a rectangular frame extracting means for extracting a rectangular frame from the image data of the input form document is extracted. A vertex deviation measuring means for measuring a deviation between each vertex of the rectangular frame and a line segment near each vertex of the frame forming the table in the image data, and each measured vertex and line segment. It is characterized by further comprising: vertex attribute measuring means for determining the connection state of each vertex or the shape of each vertex of the frame forming the table according to the information indicating the respective shifts.

【0016】本発明は、複数の長方形枠からなる表を含
む帳票文書を認識する帳票文書認識方法において、入力
された帳票文書の画像データ中から所定のしきい値以上
の長さを有する線分を抽出し、抽出された前記線分のう
ち互いに直交するもの同士の交点を抽出し、抽出された
前記交点の集合の中から長方形の4頂点となる4つの交
点を選択し、該4つの交点からなる長方形の辺に相当す
る部分に所定のしきい値以上の抽出された線分が存在す
る場合、該4つの交点からなる長方形を長方形枠として
決定することを特徴とする。
According to the present invention, in a form document recognition method for recognizing a form document including a table composed of a plurality of rectangular frames, a line segment having a length equal to or greater than a predetermined threshold value in image data of the input form document. Is extracted, intersections of mutually orthogonal ones of the extracted line segments are extracted, four intersections which are four vertices of a rectangle are selected from the set of the extracted intersections, and the four intersections are selected. If there are extracted line segments equal to or more than a predetermined threshold value in the portion corresponding to the side of the rectangle consisting of, the rectangle consisting of the four intersections is determined as a rectangular frame.

【0017】本発明は、複数の枠からなる表を含む帳票
を認識する帳票文書認識方法において、入力された帳票
文書の画像データ中から長方形枠を抽出し、抽出された
前記長方形枠の各頂点と前記画像データ中の前記表を構
成する枠の各頂点近傍の線分との間のずれを夫々計測
し、計測された各頂点と線分の間の夫々のずれを表す情
報によって、前記表を構成する枠の各頂点の接続状態ま
たは各頂点の形状を決定することを特徴とする。
According to the present invention, in a form document recognition method for recognizing a form including a table including a plurality of frames, a rectangular frame is extracted from image data of an input form document, and each vertex of the extracted rectangular frame is extracted. And the line segment in the vicinity of each apex of the frame constituting the table in the image data are respectively measured, and the table is obtained by the information indicating the respective misalignment between each measured apex and the line segment. It is characterized in that the connection state of each apex of the frame forming the frame or the shape of each apex is determined.

【0018】[0018]

【作用】本発明では、帳票文書画像より抽出された線分
より、(長方形枠を形成することができるような)ある
一定以上の長さをもつ線分をピックアップし、互いにほ
ぼ垂直に(あるいは所定の角度で)交差する線分同士の
交点を検出し、さらに求められた交点より4点をピック
アップし、この4点が長方形枠の頂点となりうるかを頂
点間の線分の有無にてチェックすることにより、長方形
枠を求められる。
In the present invention, line segments having a certain length or more (such as capable of forming a rectangular frame) are picked up from the line segments extracted from the form document image, and they are almost perpendicular to each other (or Detect intersections of intersecting line segments (at a predetermined angle), pick up 4 points from the obtained intersections, and check whether these 4 points can be the vertices of the rectangular frame by checking the presence of line segments between the vertices. By doing so, a rectangular frame can be obtained.

【0019】したがって、本発明によれば、線分と線分
の交点情報を使用しているため、抽出された線分が途切
れている場合でも、あるいは線が完全に交わっていない
場合でも、確実に長方形枠の頂点を検出することが可能
である。さらに、求めた交点より長方形枠が生成できる
かをチェックすることにより、線の分類を長方形枠抽出
の前に行ってしまうのではなく、長方形枠抽出の過程で
罫線であるか文字であるかを判断しながら分類すること
ができ、線種判別の間違いも少なく、罫線と文字パター
ン中の線分と判別を正確に行うことができる。同時に、
複雑な文書画像に対しても正確な長方形枠の抽出を行う
ことが可能となる。
Therefore, according to the present invention, since the intersection information of the line segments is used, even if the extracted line segments are interrupted or the lines do not completely intersect, It is possible to detect the vertices of a rectangular frame. Furthermore, by checking whether a rectangular frame can be generated from the obtained intersections, it is possible to determine whether the line is a ruled line or a character in the process of extracting the rectangular frame, instead of classifying the lines before extracting the rectangular frame. It is possible to classify while judging, and there are few mistakes in line type judgment, and it is possible to accurately distinguish between ruled lines and line segments in character patterns. at the same time,
It is possible to accurately extract a rectangular frame even for a complicated document image.

【0020】また、本発明では、帳票文書画像より抽出
された線分より長方形枠を形成し、長方形枠の各頂点に
対応する線分との距離を計測し、計測された各頂点と線
分との距離によって頂点の接続状態および交点の形状を
決定する。
Further, according to the present invention, a rectangular frame is formed from the line segments extracted from the form document image, the distance to the line segment corresponding to each vertex of the rectangular frame is measured, and each measured vertex and the line segment are measured. The connection state of the vertices and the shape of the intersection are determined by the distance between and.

【0021】したがって、本発明によれば、頂点と線分
の距離を利用するだけで、各頂点の接続状態および頂点
付近の形状を求めることにより、複雑な処理を行うこと
はなく、簡易に、頂点の丸みなどの形状を決定すること
ができる。
Therefore, according to the present invention, by simply using the distance between the vertices and the line segment, the connected state of each vertex and the shape in the vicinity of the vertex are obtained, and thus, complicated processing is not performed, and it is possible to simply Shapes such as roundness of vertices can be determined.

【0022】[0022]

【実施例】以下、図面を参照しながら実施例を説明す
る。図1は、本発明の第1の実施例に係る帳票文書認識
装置の構成を示すブロック図である。本実施例の帳票文
書認識装置は、画像入力部1、線分抽出部2、線分分類
部3、文字列枠抽出部5、文字列認識部6、帳票文書作
成部7、出力部8より構成される。線分分類部3は、内
部に長方形枠抽出部4を持つ。
Embodiments will be described below with reference to the drawings. FIG. 1 is a block diagram showing the configuration of a form document recognition apparatus according to the first embodiment of the present invention. The form document recognition device of this embodiment includes an image input unit 1, a line segment extraction unit 2, a line segment classification unit 3, a character string frame extraction unit 5, a character string recognition unit 6, a form document creation unit 7, and an output unit 8. Composed. The line segment classification unit 3 has a rectangular frame extraction unit 4 inside.

【0023】画像入力部1は、処理対象となる帳票文書
を画像データとして入力するためのものであり、例えば
イメージ・スキャナーなどからなる。線分抽出部2は、
入力した画像データに対して、2値化処理、細線化処
理、線分接続処理などの前処理を施し、入力画像データ
を線分データとして抽出する。線分データには、長さ、
終始点座標などが含まれる。
The image input section 1 is for inputting a form document to be processed as image data, and is composed of, for example, an image scanner. The line segment extraction unit 2
Preprocessing such as binarization processing, thinning processing, and line segment connection processing is performed on the input image data, and the input image data is extracted as line segment data. For line segment data, length,
Includes end point coordinates, etc.

【0024】線分分類部3は、抽出された線分を、長方
形枠データ、罫線データ(長方形枠を構成する線分も含
む)、文字パターンデータに分類して出力する。上記の
長方形枠データは、線分分類過程の中で線分分類部3内
の長方形枠抽出部4にて抽出される。
The line segment classifying unit 3 classifies the extracted line segments into rectangular frame data, ruled line data (including line segments constituting the rectangular frame), and character pattern data and outputs the data. The rectangular frame data is extracted by the rectangular frame extraction unit 4 in the line segment classification unit 3 in the line segment classification process.

【0025】文字列枠抽出部5は、長方形枠データを参
照して、文字パターンデータを文字列に分割し、各文字
列の座標位置や縦横のサイズを計測する。また、文字列
に外接する文字列枠を抽出する。
The character string frame extraction section 5 refers to the rectangular frame data, divides the character pattern data into character strings, and measures the coordinate position and the vertical and horizontal size of each character string. Also, a character string frame circumscribing the character string is extracted.

【0026】文字認識部6は、抽出された文字列を文字
パターン認識処理にて文字コードに変換し、文字列単位
に文字コードデータを出力する。帳票文書作成部7は、
罫線データ、長方形枠データおよび文字コードデータか
ら帳票文書データを作成する。
The character recognition unit 6 converts the extracted character string into a character code by a character pattern recognition process, and outputs character code data in character string units. The form document creation unit 7
Form document data is created from ruled line data, rectangular frame data, and character code data.

【0027】出力部8は、帳票文書データを出力するた
めのものであり、例えば表示装置やプリンタなどからな
る。作成した帳票文書データは、図示しない磁気記憶装
置などに格納することができる。
The output unit 8 is for outputting form document data, and is composed of, for example, a display device or a printer. The created form document data can be stored in a magnetic storage device (not shown) or the like.

【0028】以下、図2に示すフローチャートを参照し
ながら、本実施例の処理の流れを説明する。なお、図3
に、入力する帳票の一例を、図4に、図3の入力帳票を
読み取ったデータの一例を示す。
The flow of processing of this embodiment will be described below with reference to the flow chart shown in FIG. Note that FIG.
FIG. 4 shows an example of the input form, and FIG. 4 shows an example of data obtained by reading the input form shown in FIG.

【0029】[ステップS1]まず、画像入力部1から
処理対象となる帳票文書を光学的に読取る。入力した画
像データは、一旦、図示しない画像メモリなどに格納す
る。
[Step S1] First, the form document to be processed is optically read from the image input unit 1. The input image data is temporarily stored in an image memory (not shown) or the like.

【0030】[ステップS2]線分抽出部2は、入力し
た画像データに対して、2値化処理、細線化処理、線分
接続処理などの前処理を施し、入力画像データをすべて
線分データとして抽出する。
[Step S2] The line segment extraction unit 2 performs preprocessing such as binarization processing, thinning processing, and line segment connection processing on the input image data, and all input image data is line segment data. To extract.

【0031】図5に、線分抽出部2における線分抽出処
理の一例のフローチャートを示す。まず、入力画像デー
タに対し予め設定したしきい値にて2値化処理を施す
(ステップS21)。2値化画像に対し細線化処理を行
う(ステップS22)。得られた細線に対して、チェイ
ンコードを計測し、折れ線近似を行う(ステップS2
3)。そして、折れ線近似された線分単位に、長さ、終
始点座標、角度等の特徴量計測を行う(ステップS2
4)。最後に、上記の特徴量を参照して、複数の線分が
接近しており、かつ、角度の差が小さいもの同士を接続
し、これを抽出した線分として出力する(ステップS2
5)。
FIG. 5 shows a flowchart of an example of line segment extraction processing in the line segment extraction unit 2. First, the input image data is binarized at a preset threshold value (step S21). A thinning process is performed on the binarized image (step S22). A chain code is measured for the obtained thin line, and polygonal line approximation is performed (step S2).
3). Then, the feature amount measurement such as the length, the coordinates of the starting and ending points, and the angle is performed for each line segment that is approximated to the broken line (step S2).
4). Finally, referring to the above feature amount, a plurality of line segments that are close to each other and have a small angle difference are connected to each other and are output as the extracted line segment (step S2).
5).

【0032】[ステップS3]抽出された線分は、線分
分類部3で、罫線または文字パターン中の線分に分類さ
れる。また、線分分類過程の中で、線分分類部3内の長
方形枠抽出部4よって長方形枠が抽出される。
[Step S3] The extracted line segment is classified by the line segment classification unit 3 into a ruled line or a line segment in a character pattern. In the line segment classification process, the rectangular frame extraction unit 4 in the line segment classification unit 3 extracts a rectangular frame.

【0033】図6は、線分分類部3における線分分類処
理の一例のフローチャートである。まず、線分抽出部2
において抽出された線分データの中から、長さが予め設
定したしきい値t1よりも小さい線分を罫線になり得な
い微小線分として除去する(ステップS32)。
FIG. 6 is a flow chart of an example of line segment classification processing in the line segment classification unit 3. First, the line segment extraction unit 2
From the line segment data extracted in (3), a line segment having a length smaller than a preset threshold value t1 is removed as a minute line segment that cannot be a ruled line (step S32).

【0034】除去されなかったt1以上の長さの線分の
うち、長さが予め設定したしきい値t2(t2>t1)
よりも大きい線分の角度を平均し、画像全体の傾きを計
測する(ステップS33)。傾き計算は線分の角度のヒ
ストグラムをとり最大値をとっても良い。もちろん、す
べての線分から傾きを求めても構わない。
The threshold value t2 (t2> t1) whose length is preset among the line segments whose length is equal to or longer than t1 which has not been removed
The angles of the larger line segments are averaged to measure the inclination of the entire image (step S33). The inclination may be calculated by taking a histogram of the angles of the line segments and taking the maximum value. Of course, the inclination may be obtained from all the line segments.

【0035】求めた線分の角度を参照し、画像の傾きに
対してほぼ水平または垂直である線分を抽出する(ステ
ップS34)。長方形枠抽出部4にて、後述するような
手順で、抽出された水平線分および垂直線分によって作
られる長方形枠の抽出を行う(ステップS35)。
By referring to the obtained angle of the line segment, a line segment that is substantially horizontal or vertical to the inclination of the image is extracted (step S34). The rectangular frame extraction unit 4 extracts a rectangular frame formed by the extracted horizontal and vertical line segments by the procedure described below (step S35).

【0036】抽出された長方形枠ごとに、4つの頂点の
接続状態および形状、斜線の有無、長方形枠の4辺とそ
の内部にある斜線の線種および線幅等の属性を計測する
(ステップS36)。
For each of the extracted rectangular frames, the connection state and shape of the four vertices, the presence / absence of diagonal lines, the four sides of the rectangular frame, and the line type and line width of the diagonal lines inside the rectangular frame are measured (step S36). ).

【0037】ここで得られた長方形枠の座標位置および
その他の属性を長方形枠データとする(ステップS3
7)。上記ステップS35の長方形枠抽出処理の結果、
長方形枠を形成する4辺に使われた線分を罫線データと
する(ステップS40)。一方、上記ステップS35の
長方形枠抽出処理の結果、長方形枠を形成する4辺に使
われなかった線分については、その線分の長さと予め定
めたしきい値t3とを比較し(ステップS39)、しき
い値t3よりも長いものは罫線データとし(ステップS
40)、それ以外のものを文字パターンの線分とみなし
文字パターンとする(ステップS42)。
The coordinate position and other attributes of the rectangular frame obtained here are used as rectangular frame data (step S3).
7). As a result of the rectangular frame extraction processing in step S35,
The line segments used on the four sides forming the rectangular frame are set as ruled line data (step S40). On the other hand, as a result of the rectangular frame extraction processing in step S35, for the line segments that are not used for the four sides forming the rectangular frame, the length of the line segment is compared with a predetermined threshold value t3 (step S39). ), Data longer than the threshold value t3 is ruled line data (step S
40), other than that is regarded as a line segment of the character pattern and set as a character pattern (step S42).

【0038】また、ステップS34の水平・垂直線分抽
出処理の結果、水平・垂直でない線分に対して、長方形
枠の属性(斜線、頂点の形状)として使われた線分は罫
線データとする(ステップS39,S40)。一方、長
方形枠の属性(斜線、頂点の形状)として使われなかっ
た線分は文字パターンとする(ステップS39,S4
2)。
As a result of the horizontal / vertical line segment extraction processing in step S34, the line segment used as an attribute (oblique line, apex shape) of the rectangular frame is set as ruled line data for the line segment which is not horizontal / vertical. (Steps S39, S40). On the other hand, the line segment not used as the attribute (oblique line, shape of vertex) of the rectangular frame is a character pattern (steps S39 and S4).
2).

【0039】さらに、ステップS32にて微小線分とし
て除去された線分は文字パターンとする(ステップS4
2)。以上により、線分の分類と長方形枠の抽出が行わ
れ、線分分類部3からは、分類結果である、文字パター
ンデータ、罫線データ、長方形枠データが、それぞれ出
力される。なお、図・写真中の線分や下線・区切り線等
のガイドラインなどその他の線分は、罫線に分類される
こととなる。
Further, the line segment removed as the minute line segment in step S32 is a character pattern (step S4).
2). As described above, the line segment is classified and the rectangular frame is extracted, and the character segment data, the ruled line data, and the rectangular frame data, which are the classification results, are output from the line segment classification unit 3. Other line segments such as line segments in figures / photographs and guidelines such as underlines / divider lines will be classified as ruled lines.

【0040】ところで、上記ステップS35の長方形枠
抽出では、複数の長方形枠からなる大きな長方形枠が重
複して抽出されることがある。例えば図4において、長
方形枠R[3−1−4−7]は、複数の小さい長方形枠
(R[2−1−4−5]とR[3−2−5−7])を含
んでいるため、大きい長方形枠を出力すべき長方形枠デ
ータから消去する処理を行う。ここで、長方形枠R[a
−b−c−d]は左下点Pa、左上点Pb、右上点P
c、右下点Pdを4頂点とする長方形枠と定義する。そ
こで、図6のフローチャートにおいて、ステップS35
の長方形枠抽出あるいはステップS36の長方形枠の属
性計測の後で、重複する長方形枠の消去処理を行なうと
良い。この処理は、4つの頂点の座標値を参照して、も
し、大きい長方形枠が小さい長方形枠を含んでいる場合
は、この大きい長方形枠を消去する。以上により、重複
する長方形枠の消去を行うことができる。
By the way, in the rectangular frame extraction in step S35, a large rectangular frame composed of a plurality of rectangular frames may be extracted in an overlapping manner. For example, in FIG. 4, the rectangular frame R [3-1-4-7] includes a plurality of small rectangular frames (R [2-1-4-5] and R [3-2-5-7]). Therefore, a process of deleting a large rectangular frame from the rectangular frame data to be output is performed. Here, the rectangular frame R [a
-B-c-d] is the lower left point Pa, the upper left point Pb, the upper right point P
c, the lower right point Pd is defined as a rectangular frame having four vertices. Therefore, in the flowchart of FIG. 6, step S35
After the extraction of the rectangular frame or the attribute measurement of the rectangular frame in step S36, it is advisable to delete the overlapping rectangular frames. This processing refers to the coordinate values of the four vertices, and if the large rectangular frame includes the small rectangular frame, deletes the large rectangular frame. As described above, the overlapping rectangular frames can be erased.

【0041】図7は、線分分類部3内の長方形枠抽出部
4において行われる上記ステップS35の処理手順の一
例を示したフローチャートである。まず、垂直な線分と
水平な線分の交点の座標を計算する(ステップS5
1)。ここで求められる交点は、線分上になくても構わ
ない。
FIG. 7 is a flow chart showing an example of the processing procedure of step S35 performed in the rectangular frame extracting section 4 in the line segment classifying section 3. First, the coordinates of the intersection of the vertical line segment and the horizontal line segment are calculated (step S5).
1). The intersection point obtained here does not have to be on the line segment.

【0042】図8に示すようなケースを考慮に入れ、線
分の外側で交わる場合においても抽出すべき交点P6
1,P62として抽出する。ただし、線分の端と交点の
距離Dmがあるしきい値Dよりも大きい場合(Dm>
D)は抽出すべき交点としない。距離Dmは、水平方向
の距離Dxと垂直方向の距離Dyの最大値Dm=MAX
(Dx,Dy)である。線分中に交点が存在する場合、
Di=−1としておく。
Considering the case as shown in FIG. 8, the intersection point P6 to be extracted even when the intersections occur outside the line segment.
1, P62. However, when the distance Dm between the end of the line segment and the intersection is larger than a certain threshold value D (Dm>
D) is not an intersection to be extracted. The distance Dm is the maximum value Dm = MAX of the horizontal distance Dx and the vertical distance Dy.
(Dx, Dy). If there is an intersection in the line segment,
Let Di = -1.

【0043】次に、その抽出された交点に対して冗長で
あるものを除去する(ステップS52)。図9に示すよ
うに複数の交点が一箇所に接近している場合は、1点に
まとめる処理をする。ここでは、交点と線分の端との距
離Dmが小さい方の交点を用いる。距離Dmが等しいと
きは、座標を平均化する。図9のケースでは、交点P7
1と交点P72が非常に近いため、交点と2本の線分と
の距離が小さい線分L71と線分L72の交点P71を
採用し、交点P72を削除する。
Next, those redundant to the extracted intersection are removed (step S52). As shown in FIG. 9, when a plurality of intersections are close to one location, the processing to combine them into one point is performed. Here, the intersection having the smaller distance Dm between the intersection and the end of the line segment is used. When the distances Dm are equal, the coordinates are averaged. In the case of FIG. 9, the intersection P7
Since 1 and the intersection point P72 are very close to each other, the intersection point P71 between the line segment L71 and the line segment L71 in which the distance between the intersection point and the two line segments is small is adopted, and the intersection point P72 is deleted.

【0044】以上で長方形枠の頂点となる可能性のある
交点を抽出することができる。次に、長方形枠の探索を
行う前に、抽出された交点をソートしておく(ステップ
S53)。これにより長方形枠の探索速度を上げること
ができる。ソートは画面の左から右に点が並ぶように行
う。したがって、交点のx座標値でソートを行う。
As described above, it is possible to extract an intersection point which may become the apex of the rectangular frame. Next, the extracted intersections are sorted before the rectangular frame is searched (step S53). This can increase the search speed of the rectangular frame. Sorting is done so that the dots line up from left to right on the screen. Therefore, sorting is performed by the x-coordinate value of the intersection.

【0045】ソート後、左側の点から順に長方形枠の左
の縦線を生成するために2点をピックアップする(ステ
ップS54)。この処理は画面の左から右に進み、ピッ
クアップする点が右側になくなるまで続けられ(ステッ
プS55)、ピックアップする2点がなくなったとき長
方形枠の探索が終了する。
After sorting, two points are picked up in order from the left point to generate the left vertical line of the rectangular frame (step S54). This process proceeds from the left to the right of the screen, and is continued until the picked-up point is not on the right side (step S55), and when the two picked-up points are exhausted, the rectangular frame search ends.

【0046】ピックアップされた2点について、垂直性
のチェックを行う(ステップS56)。線分が存在しな
い場合、次ぎの2点をピックアップする。次に、2点間
に線分が存在するかをチェックする(ステップS5
7)。線分が存在しない場合、次の2点をピックアップ
する。
The verticality of the two picked-up points is checked (step S56). If there is no line segment, pick up the next two points. Next, it is checked whether a line segment exists between the two points (step S5).
7). If there is no line segment, pick up the next two points.

【0047】上記2つのチェックをクリアした場合、長
方形枠の左の縦線が得られたものとして、この縦線から
右側に伸びる横線の探索を行う。そのため、この縦線の
右側に位置する3点目のピックアップを行う(ステップ
S58)。3点目としてピックアップする点がなくなっ
たら、この縦線は長方形枠を構成するものではないの
で、新たな縦線候補を探すために次の2点をピックアッ
プをし直す(ステップS59)。
When the above two checks are cleared, it is assumed that the left vertical line of the rectangular frame has been obtained, and a horizontal line extending from this vertical line to the right is searched. Therefore, the third pickup located on the right side of this vertical line is picked up (step S58). If there are no more points to be picked up as the third point, this vertical line does not form a rectangular frame, so the next two points are picked up again to search for a new vertical line candidate (step S59).

【0048】最初にピックアップした2点のうち上にく
る(x座標が小さい)点と3点目の点を結ぶ線の水平性
のチェックを行う(ステップS60)。水平でない場
合、次の3点目のピックアップを行う。
Of the two points picked up first, the horizontality of the line connecting the upper point (smaller x coordinate) and the third point is checked (step S60). If it is not horizontal, pick up the next third point.

【0049】次に、2点間に線分が存在するかをチェッ
クする(ステップS61)。線分が存在しない場合、次
の3点目をピックアップする。上記2つのチェックをク
リアした場合、長方形枠の上側の横線が得られたものと
して、長方形枠の4番目の頂点の評価を行う。
Next, it is checked whether a line segment exists between the two points (step S61). If there is no line segment, pick up the next third point. When the above two checks are cleared, it is assumed that the horizontal line on the upper side of the rectangular frame has been obtained, and the fourth vertex of the rectangular frame is evaluated.

【0050】まず、左側の縦線と上側の横線により、4
点目の大方の位置を想定し、4点目のピックアップを行
う(ステップS62)。3点目としてピックアップする
点がなくなったら、この横線は長方形枠を構成するもの
ではないので、新たな横線候補を探すために次の3点目
をピックアップをし直す(ステップS63)。
First, by the vertical line on the left side and the horizontal line on the upper side, 4
Assuming most positions of the points, the fourth point pickup is performed (step S62). When there are no more points to pick up as the third point, this horizontal line does not form a rectangular frame, and therefore the next third point is picked up again in order to search for a new horizontal line candidate (step S63).

【0051】4点目の点によってできた2辺(縦線と横
線)の平行性をチェックする(ステップS64)。平行
でない場合、次の4点目のピックアップを行う。次に、
2点間に線分が存在するかをチェックする(ステップS
65)。線分が存在しない場合、次の4点目をピックア
ップする。
The parallelism of the two sides (vertical line and horizontal line) formed by the fourth point is checked (step S64). If they are not parallel, pick up the next 4th point. next,
It is checked whether a line segment exists between the two points (step S
65). If there is no line segment, pick up the next 4th point.

【0052】上記2つのチェックをクリアした場合、長
方形枠のすべての辺を確定することができる。こうして
完成した長方形枠に関して、4つの頂点の座標値を長方
形枠データとして格納する(ステップS66)。
When the above two checks are cleared, all sides of the rectangular frame can be fixed. With respect to the rectangular frame thus completed, the coordinate values of the four vertices are stored as rectangular frame data (step S66).

【0053】図10は、図7における線分チェック処理
(ステップS57,S61,S66)を説明するための
図である。図10において、点P81および点P82は
長方形枠の一辺の両端の点、すなわち、頂点の候補点で
ある。この2点間に線分が存在するかチェックする場
合、まず80のような領域を発生させる。この領域80
はP81とP82の距離分だけの長さを持ち、n画素分
の幅を持つ。この領域80の中に、線分抽出部2によっ
て抽出された線分が領域80の長さ方向に何パーセント
存在するかを確かめる。例えば、領域80には線分L8
1、線分L82、線分L83が存在する。線分L83は
領域外にはみ出しているが、長さのカウントには領域に
含まれる部分のみ加えて、存在するパーセントrを計測
する。このパーセントsがあるしきい値Sよりも大きい
ときは、線分が存在すると認識する。
FIG. 10 is a diagram for explaining the line segment check processing (steps S57, S61, S66) in FIG. In FIG. 10, points P81 and P82 are points at both ends of one side of the rectangular frame, that is, vertex candidate points. When checking whether a line segment exists between these two points, an area such as 80 is first generated. This area 80
Has a length corresponding to the distance between P81 and P82 and a width of n pixels. It is confirmed what percentage of the line segment extracted by the line segment extraction unit 2 exists in the region 80 in the length direction of the region 80. For example, in the area 80, the line segment L8
1, line segment L82, and line segment L83 exist. Although the line segment L83 extends outside the area, only the portion included in the area is added to the length count, and the existing percentage r is measured. When this percentage s is larger than a certain threshold value S, it is recognized that a line segment exists.

【0054】ここで、図3の帳票を入力の具体例とし
て、上記処理を説明する。図3の帳票が画像入力部1か
ら入力されると、線分抽出部2により線分L1〜L22
が得られる。
Here, the above processing will be described by taking the form of FIG. 3 as a specific example of input. When the form of FIG. 3 is input from the image input unit 1, the line segment extraction unit 2 causes the line segments L1 to L22
Is obtained.

【0055】線分分類部3では、長方形枠抽出部4を用
いて水平・垂直線分である線分L1〜L14に対して、
垂直に交わる2本の線分の交点P1〜P15を求める。
前述のように、交点を求める際、線分上に位置せず、線
分の外側で交わるものについても求めるべき交点として
抽出する。例えば、線分L2と線分L9の交点P6、線
分L4と線分L14の交点P14である。
The line segment classifying unit 3 uses the rectangular frame extracting unit 4 for the line segments L1 to L14 which are horizontal / vertical line segments.
Intersection points P1 to P15 of two line segments that vertically intersect are obtained.
As described above, when obtaining an intersection, an intersection that is not located on the line segment but intersects outside the line segment is also extracted as an intersection to be obtained. For example, it is the intersection P6 of the line segment L2 and the line segment L9, and the intersection P14 of the line segment L4 and the line segment L14.

【0056】その後、抽出された交点P1〜P7中から
長方形枠を生成できる4つの頂点を見つける。例えば、
P1、P2、P4、P5の4点から長方形枠R[2−1
−4−5]を生成する。このようにして、大小28個の
長方形枠が探索することができる。
After that, four vertices capable of generating a rectangular frame are found from the extracted intersections P1 to P7. For example,
From four points P1, P2, P4, and P5, a rectangular frame R [2-1
-4-5] is generated. In this way, 28 large and small rectangular frames can be searched.

【0057】ただし、このままでは、大きい長方形枠
(例えば、長方形枠R[3−1−4−7])は、複数の
小さい長方形枠(この場合、R[2−1−4−5]とR
[3−2−5−7])を含んでいるため、大きい長方形
枠を出力すべき長方形枠データから消去する。
However, as it is, the large rectangular frame (for example, the rectangular frame R [3-1-4-7]) becomes a plurality of small rectangular frames (in this case, R [2-1-4-5] and R [2-1-4-5]).
[3-2-5-7]) is included, a large rectangular frame is deleted from the rectangular frame data to be output.

【0058】このようにして、R[2−1−4−5]を
はじめとする8個の長方形枠を出力することができる。
ここで、線分分類部3では、残された長方形枠に対して
属性を計測する。計測する属性項目は、各頂点の接続状
態および形状(角丸み)、枠内の斜線、罫線の線幅、線
種である。この処理より、長方形枠R[2−1−4−
5]内には斜線が存在することが認識できる。
In this way, eight rectangular frames including R [2-1-4-5] can be output.
Here, the line segment classification unit 3 measures the attributes of the remaining rectangular frame. The attribute items to be measured are the connection state and shape (rounded corners) of each vertex, diagonal lines in the frame, line width of ruled lines, and line type. By this processing, the rectangular frame R [2-1-4-4
It can be recognized that there is a diagonal line in [5].

【0059】長方形枠として見つかった線分(L1〜L
14)、長方形枠に付随する斜線(L15)は罫線とし
て分類し、線分(L16〜L22)については文字パタ
ーン中の線分として分類する。このようにして、抽出さ
れた線分を正確に分類することが可能であり、同時に長
方形枠を抽出することができる。
Line segments (L1 to L) found as a rectangular frame
14), diagonal lines (L15) attached to the rectangular frame are classified as ruled lines, and line segments (L16 to L22) are classified as line segments in the character pattern. In this way, the extracted line segments can be accurately classified, and at the same time, the rectangular frame can be extracted.

【0060】次に、図11に、ステップS36の長方形
枠属性計測処理の一例を示す。最初に、斜線抽出処理
(ステップS111)を行い、長方形枠内の斜線の有無
をチェックする。次に、長方形枠の4辺とその内部にあ
る斜線の線種計測(ステップS112)および線幅計測
(ステップS113)を行う。
Next, FIG. 11 shows an example of the rectangular frame attribute measuring process of step S36. First, diagonal line extraction processing (step S111) is performed to check the presence or absence of diagonal lines in the rectangular frame. Next, the line type measurement (step S112) and the line width measurement (step S113) of the four sides of the rectangular frame and the diagonal lines inside the rectangular frame are performed.

【0061】また、必要に応じて次の処理を行なう。頂
点計測処理(ステップS114)を行い、4つの頂点と
対応する縦の辺および横の辺との距離の計測を行う。そ
の頂点距離に基づいて、頂点形状決定処理(ステップS
115)と頂点接続状態成形処理(ステップS116)
のいずれか一方または両方を行う。頂点形状決定処理と
頂点接続状態成形処理の処理順序は任意である。
Further, the following processing is performed if necessary. The vertex measurement process (step S114) is performed to measure the distances between the four vertices and the corresponding vertical and horizontal sides. Based on the vertex distance, vertex shape determination processing (step S
115) and vertex connection state forming processing (step S116)
Do either or both. The processing order of the vertex shape determination processing and the vertex connection state shaping processing is arbitrary.

【0062】図12は、ステップS115の長方形枠の
頂点形状決定処理の一例を説明するための図である。図
12において、長方形枠R[102−101−103−
104]が抽出されたとする。このとき、頂点P101
の形状を計測するために、頂点P101と線分L103
の距離Dx=aおよび頂点P101と線分L101の距
離Dy=bを計測する。この結果、α<Dx<β、か
つ、α<Dy<βなる条件が得られれば、この頂点P1
01に角丸みがあることを決定し、この頂点P101に
90度の円弧C101を発生させる。この場合、線分L
105〜L107の特徴について詳細に処理することな
く、円弧C101を発生させることができる。ただし、
円弧C101発生の基となる線分L105〜L107
は、図6のステップS39の線分対応処理において、罫
線の一部として分類する。
FIG. 12 is a diagram for explaining an example of the vertex shape determination processing of the rectangular frame in step S115. In FIG. 12, a rectangular frame R [102-101-103-
104] is extracted. At this time, the vertex P101
To measure the shape of the apex P101 and line segment L103
The distance Dx = a and the distance Dy = b between the vertex P101 and the line segment L101 are measured. As a result, if the condition of α <Dx <β and α <Dy <β is obtained, this vertex P1
It is determined that 01 has a rounded corner, and a 90-degree arc C101 is generated at this vertex P101. In this case, the line segment L
The arc C101 can be generated without processing the features of 105 to L107 in detail. However,
Line segments L105 to L107 that are the basis of generation of arc C101
Are classified as part of the ruled line in the line segment correspondence process of step S39 in FIG.

【0063】図13および図14は、図11のステップ
S116の長方形枠の頂点接続状態成形処理を説明する
ための図である。前述した長方形枠抽出部4により抽出
された長方形の頂点において、図13や図14のように
1つの線分の外に交点が存在する場合がある。ここで、
交点と、該交点を内部に含まない方の線分との距離Dx
が所定のしきい値γより小さい場合、線の途切れと見な
して、線分を交点まで延長して線分を接続するように処
理を行なっても良い。例えば、図13では、線分L11
1と線分L112について抽出された交点P111と各
線分L111,L112の距離計測の結果、Dx=c、
Dy=−1を得ることになる。この場合、c<γであ
り、線の途切れを接続することができる。また、図14
において、線分L121と線分L122の交点であるP
121と各線分の距離計測の結果、Dx=d、Dy=−
1を得る。この場合、d>γであり、線の途切れとは見
なされず、接続を行わないようにすることができる。
13 and 14 are diagrams for explaining the vertex connection state forming process of the rectangular frame in step S116 of FIG. At the vertices of the rectangle extracted by the rectangular frame extraction unit 4 described above, an intersection may exist outside one line segment as shown in FIGS. 13 and 14. here,
Distance Dx between the intersection and the line segment that does not include the intersection inside
When is smaller than the predetermined threshold value γ, it may be considered that the line is broken, and the line segment may be extended to the intersection and the line segment may be connected. For example, in FIG. 13, line segment L11
1 and the line segment L112, the intersection P111 extracted and the distance measurement results of the line segments L111 and L112, Dx = c,
Dy = -1 will be obtained. In this case, c <γ, and line breaks can be connected. In addition, FIG.
At P, which is the intersection of line segment L121 and line segment L122
As a result of distance measurement of 121 and each line segment, Dx = d, Dy =-
Get one. In this case, d> γ, which is not regarded as a break in the line, and the connection can be prevented.

【0064】以上のようにして、長方形枠の属性計測を
行うことができる。 [ステップS4]文字列枠抽出部5は、ステップS5に
て抽出された長方形枠データを参照して、抽出線分から
分類された文字パターンデータを一纏まりの文字列に分
割し、各文字列の座標位置や縦横のサイズを計測する。
また、各文字列に外接する文字列枠を抽出する。
As described above, the attribute measurement of the rectangular frame can be performed. [Step S4] The character string frame extraction unit 5 refers to the rectangular frame data extracted in step S5, divides the character pattern data classified from the extracted line segment into a set of character strings, and Measure the coordinate position and vertical and horizontal size.
Also, a character string frame circumscribing each character string is extracted.

【0065】[ステップS5]文字認識部6は、抽出さ
れた文字列を文字パターン認識処理にて文字コードに変
換し、文字列単位に文字コードデータを出力する。
[Step S5] The character recognition unit 6 converts the extracted character string into a character code by a character pattern recognition process, and outputs character code data in character string units.

【0066】[ステップS6]帳票文書作成部7は、罫
線データ、長方形枠データ、文字列枠情報を含む文字コ
ードデータから帳票文書データを作成する。
[Step S6] The form document creating unit 7 creates form document data from character code data including ruled line data, rectangular frame data, and character string frame information.

【0067】[ステップS7]出力部8は、帳票文書デ
ータを出力する。以上説明したように、本実施例によれ
ば、線と線の交点情報を使用することにより、抽出され
た線分が途切れている場合でも、あるいは、線が完全に
交わっていない場合でも、確実に長方形枠の頂点を検出
することができる。また、線の分類を、長方形枠抽出の
前に行ってしまうのではなく、長方形枠抽出の過程で罫
線であるか文字であるかを判断しながら分類することが
可能であり、線種判別の性能を上げることが可能であ
り、簡易かつ正確に、複雑な文書画像から長方形枠の抽
出を行うことができる。
[Step S7] The output unit 8 outputs the form document data. As described above, according to the present embodiment, by using the intersection information of the lines, even if the extracted line segment is interrupted, or even if the lines are not completely intersected, It is possible to detect the vertices of a rectangular frame. In addition, it is possible to classify lines by determining whether they are ruled lines or characters in the process of extracting a rectangular frame, instead of performing the classification before extracting the rectangular frame. It is possible to improve the performance, and it is possible to easily and accurately extract a rectangular frame from a complicated document image.

【0068】また、頂点と線分の距離を利用するだけ
で、各頂点の接続状態および頂点付近の形状を求めるこ
とにより、複雑な処理を行うことはなく、簡易に、頂点
の丸みなどの形状を決定することができる。
Further, by simply using the distance between the vertices and the line segment, the connected state of each vertex and the shape in the vicinity of the vertex are obtained, so that complicated processing is not performed, and the shape such as the roundness of the vertex can be easily obtained. Can be determined.

【0069】(第2の実施例)図15は、本発明の第2
の実施例に係る帳票文書認識装置の構成を示すブロック
図である。
(Second Embodiment) FIG. 15 shows a second embodiment of the present invention.
It is a block diagram showing a configuration of a form document recognition apparatus according to the embodiment.

【0070】本実施例の帳票文書認識装置は、第1の実
施例の長方形枠データ抽出機能を持つように簡略化した
ものであり、画像入力部101、線分抽出部102、長
方形枠抽出部104、長方形枠属性計測部105、長方
形枠データ出力部106を備えている。
The form document recognition apparatus of this embodiment is simplified to have the rectangular frame data extraction function of the first embodiment. The image input unit 101, the line segment extraction unit 102, and the rectangular frame extraction unit. 104, a rectangular frame attribute measuring unit 105, and a rectangular frame data output unit 106.

【0071】画像入力部101は、処理対象となる帳票
文書を画像データとして入力するためのものであり、例
えばイメージ・スキャナーなどからなる。第1の実施例
の画像入力部1に相当するものである。
The image input unit 101 is for inputting a form document to be processed as image data, and is composed of, for example, an image scanner. This corresponds to the image input unit 1 of the first embodiment.

【0072】線分抽出部102は、入力した画像データ
に対して、2値化処理、細線化処理、線分接続処理など
の前処理を施し、入力画像データを線分データとして抽
出する。線分データには、長さ、終始点座標などが含ま
れる。第1の実施例の画像入力部2に相当するものであ
る。
The line segment extraction unit 102 performs preprocessing such as binarization processing, thinning processing, and line segment connection processing on the input image data, and extracts the input image data as line segment data. The line segment data includes the length, the coordinates of the end point, and the like. This corresponds to the image input unit 2 of the first embodiment.

【0073】長方形枠抽出部104は、抽出された線分
から長方形枠データを抽出する。第1の実施例の図6の
ステップS32〜S35の処理を行なうものに相当す
る。長方形枠属性計測部105は、抽出した長方形枠に
対して、長方形枠の特徴となる斜線の有無、辺の線幅お
よび線種、頂点の形状および接続状態等の属性データを
計測する。第1の実施例の図6のステップS36の処理
を行なうものに相当する。
The rectangular frame extraction unit 104 extracts rectangular frame data from the extracted line segment. This corresponds to the processing of steps S32 to S35 in FIG. 6 of the first embodiment. The rectangular frame attribute measuring unit 105 measures, for the extracted rectangular frame, attribute data such as presence / absence of diagonal lines that are features of the rectangular frame, side line width and line type, vertex shape, and connection state. This corresponds to the processing of step S36 of FIG. 6 of the first embodiment.

【0074】長方形枠データ出力部106は、得られた
長方形枠データに基づいて、所定の画像フォーマットデ
ータあるいはベクトルデータを生成する。そして、生成
したデータを、例えば表示装置やプリンタなどから出力
する。あるいは、磁気記憶装置などに格納する。
The rectangular frame data output unit 106 generates predetermined image format data or vector data based on the obtained rectangular frame data. Then, the generated data is output from, for example, a display device or a printer. Alternatively, it is stored in a magnetic storage device or the like.

【0075】以上のような構成において、本実施例の処
理の流れは以下のようになる。まず、画像入力部101
から、例えば図3のような処理対象となる帳票文書を光
学的に読取り、画像データとして図示しない画像メモリ
などに格納する。入力した画像データは、一旦、図示し
ない画像メモリなどに格納する。
With the above arrangement, the processing flow of this embodiment is as follows. First, the image input unit 101
Then, for example, the form document to be processed as shown in FIG. 3 is optically read and stored as image data in an image memory (not shown) or the like. The input image data is temporarily stored in an image memory (not shown) or the like.

【0076】次に、線分抽出部102は、例えば第1の
実施例にて図5を参照して説明したような手順で、入力
した画像データに前処理を施し、入力画像データを線分
データとして抽出する。
Next, the line segment extraction unit 102 performs preprocessing on the input image data, for example, in the procedure as described with reference to FIG. 5 in the first embodiment, and converts the input image data into line segments. Extract as data.

【0077】次に、長方形枠抽出部104は、第1の実
施例にて図6のステップS32〜S34を参照して説明
したような手順で、長方形枠を構成する可能性のある所
定の長さ以上の水平・垂直線分を抽出し、例えば図6の
ステップS35、図7を参照して説明したような手順
で、抽出した水平・垂直線分から、長方形枠を抽出す
る。
Next, the rectangular frame extraction unit 104 uses the procedure as described with reference to steps S32 to S34 of FIG. 6 in the first embodiment to set a predetermined length that may form a rectangular frame. The horizontal / vertical line segments above the above are extracted, and a rectangular frame is extracted from the extracted horizontal / vertical line segments by the procedure described with reference to step S35 in FIG. 6 and FIG. 7, for example.

【0078】長方形枠属性計測部105は、例えば図6
のステップS36、図11を参照して説明したような手
順で、上記の抽出された長方形枠に対して、長方形枠の
特徴となる斜線の有無、辺の線幅および線種、頂点の形
状および接続状態等の属性データを計測する。また、必
要に応じてステップS115の頂点形状決定処理とステ
ップS116の頂点接続状態成形処理のいずれか一方ま
たは両方を行う。
The rectangular frame attribute measuring unit 105 is, for example, as shown in FIG.
In step S36 of step S36, the presence or absence of diagonal lines that characterize the rectangular frame, the line width and line type of the side, the shape of the apex, and the like with respect to the extracted rectangular frame described above are described. Measure attribute data such as connection status. Also, one or both of the vertex shape determination process of step S115 and the vertex connection state shaping process of step S116 are performed as necessary.

【0079】なお、長方形枠抽出部104の処理後また
は長方形枠属性計測部105の処理後に、前述したよう
に、重複する長方形枠の消去処理を行なうと好ましい。
最後に、長方形枠データ出力部106は、長方形枠のコ
ードデータに基づいて、長方形枠を画像のフォーマット
あるいはベクトルデータとしてデータ出力する。 この
ように、本実施例によれば、線と線の交点情報を使用す
ることにより、抽出された線分が途切れている場合で
も、あるいは、線が完全に交わっていない場合でも、確
実に長方形枠の頂点を検出することができる。また、線
の分類を、長方形枠抽出の前に行ってしまうのではな
く、長方形枠抽出の過程で罫線であるか文字であるかを
判断しながら分類することが可能であり、線種判別の性
能を上げることが可能であり、簡易かつ正確に、複雑な
文書画像から長方形枠の抽出を行うことができる。
As described above, it is preferable to perform the overlapping rectangular frame erasing process after the rectangular frame extracting unit 104 or the rectangular frame attribute measuring unit 105.
Finally, the rectangular frame data output unit 106 outputs the rectangular frame as image format or vector data based on the code data of the rectangular frame. As described above, according to the present embodiment, by using the intersection information of lines and lines, even if the extracted line segment is interrupted, or even if the lines are not completely intersected, the rectangle The vertices of the frame can be detected. In addition, it is possible to classify lines by determining whether they are ruled lines or characters in the process of extracting a rectangular frame, instead of performing the classification before extracting the rectangular frame. It is possible to improve the performance, and it is possible to easily and accurately extract a rectangular frame from a complicated document image.

【0080】また、頂点と線分の距離を利用するだけ
で、各頂点の接続状態および頂点付近の形状を求めるこ
とにより、複雑な処理を行うことはなく、簡易に、頂点
の丸みなどの形状を決定することができる。また、本発
明は上述した各実施例に限定されるものではなく、その
要旨を逸脱しない範囲で、種々変形して実施することが
できる。
Further, by simply using the distance between the vertices and the line segment, the connected state of each vertex and the shape in the vicinity of the vertex are obtained, so that complicated processing is not performed and the shape such as the roundness of the vertex can be easily obtained. Can be determined. Further, the present invention is not limited to the above-described embodiments, and various modifications can be carried out without departing from the scope of the invention.

【0081】[0081]

【発明の効果】本発明によれば、帳票文書画像中の線分
と線分の交点から長方形を求め、この長方形が帳票文書
の長方形枠か否かを頂点間の線分の存在により判定する
ので、抽出された線分が途切れている場合でも、あるい
は、線が完全に交わっていない場合でも、確実に長方形
枠の頂点を検出することができる。また、線の分類を、
長方形枠抽出の前に行ってしまうのではなく、長方形枠
抽出の過程で罫線であるか文字であるかを判断しながら
分類することができ、線種判別の性能を上げることが可
能であり、複雑な文書画像に対して簡易かつ正確に長方
形枠の抽出を行うことができる。
According to the present invention, a rectangle is obtained from the intersection of a line segment and a line segment in a form document image, and whether or not this rectangle is a rectangular frame of the form document is determined by the existence of the line segment between the vertices. Therefore, the vertices of the rectangular frame can be reliably detected even when the extracted line segments are interrupted or when the lines do not intersect completely. Also, the line classification
It is possible to classify while judging whether it is a ruled line or a character in the process of extracting a rectangular frame instead of performing it before extracting a rectangular frame, and it is possible to improve the performance of line type discrimination, It is possible to easily and accurately extract a rectangular frame from a complicated document image.

【0082】また、本発明によれば、帳票文書画像中か
ら抽出した長方形の頂点と該頂点近傍の線分との間の距
離を利用して、各頂点の接続状態および頂点付近の形状
を求めるので、複雑な処理を行うことはなく、簡易に、
頂点の丸みなどの形状を決定することができる。
Further, according to the present invention, the connection state of each vertex and the shape near the vertex are obtained by using the distance between the vertex of the rectangle extracted from the form document image and the line segment near the vertex. So, without complicated processing, simply
Shapes such as roundness of vertices can be determined.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の第1の実施例に係る帳票文書認識装置
の構成を示すブロック図
FIG. 1 is a block diagram showing a configuration of a form document recognition device according to a first embodiment of the present invention.

【図2】同実施例の処理の流れの概略を示すフローチャ
ート
FIG. 2 is a flowchart showing an outline of a processing flow of the embodiment.

【図3】入力の一例を示す図FIG. 3 is a diagram showing an example of input.

【図4】読み取った入力から生成されたデータの一例を
示す図
FIG. 4 is a diagram showing an example of data generated from read input.

【図5】線分抽出処理の流れを示すフローチャートFIG. 5 is a flowchart showing a flow of line segment extraction processing.

【図6】線分分類処理の流れを示すフローチャートFIG. 6 is a flowchart showing the flow of line segment classification processing.

【図7】長方形枠抽出処理の流れを示すフローチャートFIG. 7 is a flowchart showing the flow of rectangular frame extraction processing.

【図8】長方形枠抽出処理における交点計測を説明する
ための図
FIG. 8 is a diagram for explaining intersection measurement in rectangular frame extraction processing.

【図9】長方形枠抽出処理における冗長交点除去を説明
するための図
FIG. 9 is a diagram for explaining redundant intersection removal in rectangular frame extraction processing.

【図10】長方形枠抽出処理における線分チェックを説
明するための図
FIG. 10 is a diagram for explaining line segment checking in the rectangular frame extraction processing.

【図11】長方形枠属性計測処理の流れを示すフローチ
ャート
FIG. 11 is a flowchart showing the flow of rectangular frame attribute measurement processing.

【図12】長方形枠の頂点形状決定処理を説明するため
の図
FIG. 12 is a diagram for explaining apex shape determination processing of a rectangular frame.

【図13】長方形枠の頂点接続状態成形処理を説明する
ための図
FIG. 13 is a diagram for explaining a vertex connection state forming process of a rectangular frame.

【図14】長方形枠の頂点接続状態成形処理を説明する
ための図
FIG. 14 is a diagram for explaining a vertex connection state forming process of a rectangular frame.

【図15】本発明の第2の実施例に係る帳票文書認識装
置の構成を示すブロック図
FIG. 15 is a block diagram showing a configuration of a form document recognition device according to a second embodiment of the present invention.

【符号の説明】[Explanation of symbols]

1…画像入力部、2…線分抽出部、3…線分分類部、4
…長方形枠抽出部、5…文字列枠抽出部、6…文字列認
識部、7…帳票文書作成部、8…出力部、101…画像
入力部、103…線分抽出部、104…長方形枠抽出
部、105…長方形枠属性計測部、106…長方形枠デ
ータ出力部
1 ... Image input section, 2 ... Line segment extraction section, 3 ... Line segment classification section, 4
... rectangular frame extraction unit, 5 ... character string frame extraction unit, 6 ... character string recognition unit, 7 ... form document creation unit, 8 ... output unit, 101 ... image input unit, 103 ... line segment extraction unit, 104 ... rectangular frame Extraction unit 105 ... Rectangular frame attribute measurement unit 106 ... Rectangular frame data output unit

───────────────────────────────────────────────────── フロントページの続き (72)発明者 下辻 成佳 神奈川県川崎市幸区小向東芝町1番地 株 式会社東芝研究開発センター内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Shigeka Shimotsuji No. 1 Komukai Toshiba-cho, Sachi-ku, Kawasaki-shi, Kanagawa Incorporated, Toshiba Research and Development Center

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】複数の長方形枠からなる表を含む帳票文書
を認識する帳票文書認識装置において、 入力された帳票文書の画像データ中から所定のしきい値
以上の長さを有する線分を抽出する線分抽出手段と、 抽出された前記線分のうち互いに直交するもの同士の交
点を抽出する交点抽出手段と、 抽出された前記交点の集合の中から長方形の4頂点とな
る4つの交点を選択し、該4つの交点からなる長方形の
辺に相当する部分に所定のしきい値以上の抽出された線
分が存在する場合、該4つの交点からなる長方形を長方
形枠として決定する長方形枠抽出手段とを具備すること
を特徴とする帳票文書認識装置。
1. A form document recognition device for recognizing a form document including a table composed of a plurality of rectangular frames, extracting line segments having a length equal to or greater than a predetermined threshold value from image data of the input form document. Line segment extraction means, intersection point extraction means for extracting intersection points of the extracted line segments that are orthogonal to each other, and four intersection points which are four vertexes of a rectangle from the set of the extracted intersection points. If there is an extracted line segment equal to or larger than a predetermined threshold value in a portion corresponding to the side of the rectangle formed by the four intersections, the rectangle formed by determining the rectangle formed by the four intersections as a rectangular frame A form document recognition device comprising:
【請求項2】複数の枠からなる表を含む帳票を認識する
帳票文書認識装置において、 入力された帳票文書の画像データ中から長方形枠を抽出
する長方形枠抽出手段と、 抽出された前記長方形枠の各頂点と前記画像データ中の
前記表を構成する枠の各頂点近傍の線分との間のずれを
夫々計測する頂点ずれ計測手段と、 計測された各頂点と線分の間の夫々のずれを表す情報に
よって、前記表を構成する枠の各頂点の接続状態および
各頂点の形状を決定する頂点属性計測手段とを具備する
ことを特徴とする帳票文書認識装置。
2. A form document recognition device for recognizing a form including a table composed of a plurality of frames, and rectangular frame extracting means for extracting a rectangular frame from image data of an input form document, and the extracted rectangular frame. Of each of the vertices and the line segment near each of the vertices of the frame forming the table in the image data, and a vertex shift measuring means for measuring the shift between each of the measured vertices and the line segment. A form document recognition apparatus comprising: vertex attribute measuring means for determining a connection state of each vertex and a shape of each vertex of a frame forming the table according to information indicating a deviation.
【請求項3】複数の長方形枠からなる表を含む帳票文書
を認識する帳票文書認識方法において、 入力された帳票文書の画像データ中から所定のしきい値
以上の長さを有する線分を抽出し、 抽出された前記線分のうち互いに直交するもの同士の交
点を抽出し、 抽出された前記交点の集合の中から長方形の4頂点とな
る4つの交点を選択し、 該4つの交点からなる長方形の辺に相当する部分に所定
のしきい値以上の抽出された線分が存在する場合、該4
つの交点からなる長方形を長方形枠として決定すること
を特徴とする帳票文書認識方法。
3. A form document recognition method for recognizing a form document including a table composed of a plurality of rectangular frames, wherein a line segment having a length equal to or greater than a predetermined threshold value is extracted from image data of the input form document. Then, the intersections of the extracted line segments that are orthogonal to each other are extracted, and four intersections that are the four vertices of the rectangle are selected from the set of the extracted intersections, and the intersections are composed of the four intersections. If there is an extracted line segment equal to or larger than a predetermined threshold value in the portion corresponding to the side of the rectangle, then 4
A method for recognizing a form document, characterized in that a rectangle composed of three intersections is determined as a rectangular frame.
【請求項4】複数の枠からなる表を含む帳票を認識する
帳票文書認識方法において、 入力された帳票文書の画像データ中から長方形枠を抽出
し、 抽出された前記長方形枠の各頂点と前記画像データ中の
前記表を構成する枠の各頂点近傍の線分との間のずれを
夫々計測し、 計測された各頂点と線分の間の夫々のずれを表す情報に
よって、前記表を構成する枠の各頂点の接続状態または
各頂点の形状を決定することを特徴とする帳票文書認識
方法。
4. A form document recognition method for recognizing a form including a table including a plurality of frames, wherein a rectangular frame is extracted from image data of an input form document, and each vertex of the extracted rectangular frame and the The table is constructed by measuring the deviations between the line segments in the vicinity of the respective vertices of the frame forming the table in the image data, and expressing the respective deviations between the measured vertices and the line segments. Form document recognition method, characterized in that the connection state or the shape of each vertex of the frame is determined.
JP7028333A 1995-02-16 1995-02-16 Device and method for recognizing business document Pending JPH08221506A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7028333A JPH08221506A (en) 1995-02-16 1995-02-16 Device and method for recognizing business document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7028333A JPH08221506A (en) 1995-02-16 1995-02-16 Device and method for recognizing business document

Publications (1)

Publication Number Publication Date
JPH08221506A true JPH08221506A (en) 1996-08-30

Family

ID=12245693

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7028333A Pending JPH08221506A (en) 1995-02-16 1995-02-16 Device and method for recognizing business document

Country Status (1)

Country Link
JP (1) JPH08221506A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007052670A (en) * 2005-08-18 2007-03-01 Nippon Telegr & Teleph Corp <Ntt> Edge detection method, corner evaluation method, apparatus, and program
KR20150028631A (en) * 2013-09-06 2015-03-16 삼성전자주식회사 Method and apparatus for generating structure of table in images
CN111353458A (en) * 2020-03-10 2020-06-30 腾讯科技(深圳)有限公司 Text box marking method and device and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007052670A (en) * 2005-08-18 2007-03-01 Nippon Telegr & Teleph Corp <Ntt> Edge detection method, corner evaluation method, apparatus, and program
KR20150028631A (en) * 2013-09-06 2015-03-16 삼성전자주식회사 Method and apparatus for generating structure of table in images
CN111353458A (en) * 2020-03-10 2020-06-30 腾讯科技(深圳)有限公司 Text box marking method and device and storage medium
CN111353458B (en) * 2020-03-10 2023-08-18 腾讯科技(深圳)有限公司 Text box labeling method, device and storage medium

Similar Documents

Publication Publication Date Title
US5907631A (en) Document image processing method and system having function of determining body text region reading order
US5452374A (en) Skew detection and correction of a document image representation
US5335290A (en) Segmentation of text, picture and lines of a document image
US5199084A (en) Apparatus and method for locating characters on a label
US20030198386A1 (en) System and method for identifying and extracting character strings from captured image data
JP2002133426A (en) Ruled line extraction device for extracting ruled lines from multi-valued images
JP3471578B2 (en) Line direction determining device, image tilt detecting device, and image tilt correcting device
WO1992006449A1 (en) Character recognition methods and apparatus for locating and extracting predetermined data from a document
JPH02306386A (en) Character recognizing device
JPH08221506A (en) Device and method for recognizing business document
JP3268552B2 (en) Area extraction method, destination area extraction method, destination area extraction apparatus, and image processing apparatus
JPH10162139A (en) Image processor, and medium where image processing program is recorded
JP6438369B2 (en) Form image determination program, form image determination method, and form image determination system
JP3077929B2 (en) Character extraction method
JPH0799532B2 (en) Character cutting device
JP3220226B2 (en) Character string direction determination method
JPH0822507A (en) Document recognition device
JPH07160799A (en) Character recognition method
JPS5949671A (en) Optical character reader
JPH10507014A (en) Automatic determination of landscape scan in binary image
JP2988801B2 (en) Address recognition device
JP3190794B2 (en) Character segmentation device
JPH03219384A (en) Character recognizing device
JPH0929179A (en) Addressee reader
JP2832035B2 (en) Character recognition device