JP3582734B2 - Table vectorizer - Google Patents

Table vectorizer Download PDF

Info

Publication number
JP3582734B2
JP3582734B2 JP17402193A JP17402193A JP3582734B2 JP 3582734 B2 JP3582734 B2 JP 3582734B2 JP 17402193 A JP17402193 A JP 17402193A JP 17402193 A JP17402193 A JP 17402193A JP 3582734 B2 JP3582734 B2 JP 3582734B2
Authority
JP
Japan
Prior art keywords
image
ruled line
horizontal
vertical
axis
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP17402193A
Other languages
Japanese (ja)
Other versions
JPH0728939A (en
Inventor
守人 塩原
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP17402193A priority Critical patent/JP3582734B2/en
Publication of JPH0728939A publication Critical patent/JPH0728939A/en
Application granted granted Critical
Publication of JP3582734B2 publication Critical patent/JP3582734B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Character Input (AREA)
  • Image Processing (AREA)
  • Character Discrimination (AREA)
  • Image Analysis (AREA)

Description

【0001】
【産業上の利用分野】
本発明は、例えば、帳票や図面等の表をベクトル化する表のベクトル化装置に関する。
【0002】
帳票や図面等の表をベクトル化することは、OCR(光学的文字読み取り装置)、地図の処理、文書処理等の分野で重要な技術である。例えば、OCRでは、OCR専用の帳票だけでなく、市販されている帳票から文字を認識することが要求されている。
【0003】
帳票の表を自動的にベクトル化することによって、表の同定や、表の抜き取りができ、OCRの認識率向上や、付加価値を生むことができる。また、図面では、部品表等の表のベクトル化は必須である。
【0004】
【従来の技術】
図10は、従来技術の説明図であり、図10中、1は表画像、2は表部分、3は投影像(ドット数)を示す。
【0005】
従来、表のベクトル化装置において、帳票、図面等の表画像1から表部分2をベクトル化する場合、表の罫線を抽出することにより、ベクトル化していた。
この場合、表を構成する罫線は、表画像1に対し、水平、若しくは垂直であることを前提にして、垂直軸(Y軸)、及び水平軸(X軸)への投影像(ドット数)3から求めていた。このベクトル化処理の概要は、次の通りである。
【0006】
先ず、スキャナ等から帳票等を読んで、表画像1(メモリ内の画像)を得る。その後、表画像1に対し、垂直軸、及び水平軸方向の投影像3を求める。
この投影像3は、X−Y座標の各軸(X,Y)方向に対し、ドット数を累積した値(例えば、黒部分のドットを「1」、白部分のドットを「0」とすると、ドット「1」の累積値)である。
【0007】
また、この投影像3は、表の罫線だけでなく、表部分2の文字、数字等のドットも一緒に求めている(罫線以外のドットがノイズとして入っている)。
従って、表部分2の罫線のみを抽出するために、前記投影像(ドット数)3が、所定の閾値以上であるかどうかを判定し、所定の閾値以上であれば、罫線として抽出する。このようにして、罫線のみを抽出することができる。
【0008】
【発明が解決しようとする課題】
上記のような従来のものにおいては、次のような課題があった。
帳票や、図面は、スキャナ等の画像入力装置で読み取った場合、多少傾く。この場合、大きな傾きは座標変換で修正することが可能である。
【0009】
しかし、例えば1°以下の傾きでも、画像中では量子化誤差の影響で直線は数画素の傾きを持つが、この傾きは修正できなかった。傾きが修正できないと、上記のような従来方法では、罫線の抽出の際用いる閾値が一意に決定できない。
【0010】
本発明は、このような従来の課題を解決し、入力した表画像が多少傾いても、正確に表部分のベクトル化ができるようにすることを目的とする。
【0011】
【課題を解決するための手段】
図1は本発明の原理説明図であり、図1中、図10と同じものは、同一符号で示してある。また、5は表のベクトル化装置、6は画像入力部、7は投影部、8はマスク画像生成部、9は罫線探索部、10は第1のフレームメモリ、11は第2のフレームメモリを示す。
【0012】
本発明は上記の課題を解決するため、次のように構成した。
(a) :入力した表画像1から、垂直軸(Y軸)、及び水平軸(X軸)への投影像を求めて、表部分2をベクトル化する表のベクトル化装置において、前記表画像1の表部分に相当する画素に対して、水平軸(X軸)には、水平方向の線分を無視し、垂直方向の線分にのみ限定して投影像を抽出し、垂直軸(Y軸)には、垂直方向の線分を無視し、水平方向の線分のみに限定して投影像を抽出することで、表を構成する罫線の投影像を求める投影部と、前記罫線の投影像と同じ幅の直線を、メモリ(第2のフレームメモリ11)上に、水平及び垂直方向から引き、それをマスク画像として生成するマスク画像生成部8と、該マスク画像生成部で生成したマスク画像に従って、交点間の長さと交点間の画素数の比率で罫線を探索し、表部分をベクトル化する罫線探索部9を設けた表のベクトル化装置。
【0014】
(b) :構成 (a) において、罫線探索部9が、マスク画像に従って罫線を探索する際、前記マスク画像から、直線の交点を抽出し、抽出した交点間の距離に対する画素数の比率から、前記交点間の罫線の存在を決定する表のベクトル化装置。
【0015】
(c) :構成 (a) において、罫線探索部9が、マスク画像に従って罫線を探索する際、直線の木構造を利用して罫線の探索を行う表のベクトル化装置。
(d) :構成 (a) 乃至 (c) のいずれかにおいて、ベクトル化装置に、表画像1の水平成分のベクトル化処理を行う水平成分処理部と、垂直成分のベクトル化処理を行う垂直成分処理部とを設け、入力した表画像1を、水平成分と垂直成分とに分割して、前記水平成分処理部と、垂直成分処理部とで並列処理を行う表のベクトル化装置。
【0016】
【作用】
上記構成に基づく本発明の作用を、図1に基づいて説明する。
帳票や図面等を、画像入力部6から入力し、第1のフレームメモリ10に格納した表画像1に対し、以下の処理を行う。
【0017】
先ず、投影部7は、表画像1に対し、表部分2に相当する画素に対して、垂直/水平罫線の投影像を抽出する。この場合、水平軸(X軸)に投影するのは、垂直方向の線分のみに限定(水平方向の線分を無視)し、逆に垂直軸(Y軸)に対しては、水平方向の線分のみに限定(垂直方向の線分を無視)する。
【0018】
これにより、従来、投影像が互いに接触し分離出来なかったのに対し、明確に区別することができるようになる。
次に、垂直軸(Y軸)、及び水平軸(X軸)の各投影像に対してラベル付けを行う。この処理では、ラベル毎に画素数(ドット数)を数え、或る閾値に達する像のみを残す(ノイズ成分を除去する)。
【0019】
続いて、前記投影像に従って、像の幅を持つ直線を、垂直/水平方向から画像一杯に引き、マスク画像を生成する。その後、マスク画像から、直線の交点の座標を抽出することにより、表の罫線の交点算出を行う。最後に、罫線の探索を行って表部分のベクトル化を行う。この場合、表画像の端と直線との交点も対象として座標を抽出する。
【0020】
そして、交点間に罫線が存在するか否かを検査する。その結果、罫線が存在すれば、その両端の座標を記録する。
以上のようにして、入力した表画像の微妙な傾きに対しても正確に表部分のベクトル化ができるようにすることができる。また、前記表部分のベクトル化処理を行う際、水平成分と垂直成分の処理を並列処理とすることにより、処理の高速化を図ることができる。
【0021】
【実施例】
以下、本発明の実施例を図面に基づいて説明する。
図2〜図9は、本発明の実施例を示した図であり、図2〜図9中、図1、図10と同じものは、同一符号で示してある。また、12は第1の投影用メモリ、13は第2の投影用メモリを示す。
【0022】
§1:表のベクトル化装置の構成の説明・・・図2参照
図2は実施例の装置構成図である。以下、図2に基づいて、表のベクトル化装置の構成を説明する。
【0023】
表のベクトル化装置5は、パソコン、ワークステーション、或いはOCR等の各種処理装置内に設けた装置である。
前記表のベクトル化装置5には、画像入力部6、投影部7、マスク画像生成部8、罫線探索部9、第1のフレームメモリ10、第2のフレームメモリ11、第1の投影用メモリ12、第2の投影用メモリ13等が設けてある。
【0024】
画像入力部6は、帳票、図面等を読み取って表画像を入力するものであり、スキャナや、カメラ等の光学的な装置で構成されている。
投影部7は、入力した表画像を、垂直軸(Y軸)、及び水平軸(X軸)方向に投影するものである。マスク画像生成部8は、マスク画像を生成するものであり、罫線探索部9は、マスク画像に従って罫線の探索処理を行うものである(詳細は後述する)。
【0025】
§2:実施例の処理概要説明・・・図3参照
図3は、実施例の処理フローチャートである。以下、図3に基づいて実施例の処理概要を説明する。なお、図3のS1〜S5は各処理番号を示す。
【0026】
帳票や図面等をスキャナから入力した表画像(従来例参照)に対し、以下の処理を行う。
この場合、入力した表画像は、2値のディジタル画像であり、表画像内では、表部分(罫線部分)は画素値が「1」、それ以外は「0」として、f(x,y)と表す。また、表部分は、表画像に対して座標変換等の処理により、傾きの補正(補正可能な大きな傾きの補正)が行われているものとする。
【0027】
前記入力した表画像に対して、表部分に相当する画素に対して、垂直/水平罫線の投影像(ドット数)を抽出する処理(S1)を行う。
具体的には、水平軸(X軸)に投影するのは、垂直方向の線分のみに限定(水平方向の線分を無視)し、逆に垂直軸(Y軸)に対しては、水平方向の線分のみに限定(垂直方向の線分を無視)する。これにより、従来、投影像が互いに接触し分離出来なかったのに対し、明確に区別することができるようになる。
【0028】
次に、垂直軸、及び水平軸の各投影像に対してラベル付けを行う(S2)。この処理では、ラベル毎に画素数(ドット数)を数え、或る閾値に達する像のみを残す(ノイズ成分を除去する)。なお、この閾値を設定する際、表の罫線は文字等に比べて十分に長いので、容易に定めることができる。
【0029】
続いて、前記投影像に従って、像の幅を持つ直線を画像一杯に引き、マスク画像を生成する(S3)。なお、前記のようにして直線を引いた画像を「マスク画像」と呼ぶ。その後、マスク画像から、直線の交点の座標を抽出することにより、表の罫線の交点算出を行う(S4)。
【0030】
最後に、罫線の探索を行つて(S5)表部分のベクトル化を行う。この場合、表画像の端と直線との交点も対象として座標を抽出する。そして、交点間に罫線が存在するか否かを検査する。その結果、罫線が存在すれば、その両端の座標を記録する。
【0031】
§3:実施例の処理説明
図4は実施例の処理説明図1(投影像抽出処理)、図5は実施例の処理説明図2(マスク画像生成処理)、図6は実施例の処理説明図3(罫線の交点算出処理)、図7は実施例の処理説明図4(罫線の探索処理)、図8は実施例の処理説明図5(ベクトルの階層化処理)である。以下、実施例の各処理を具体的に説明する。
【0032】
(1):表画像の入力処理の説明
表画像の入力処理は、画像入力部6で行う。すなわち、画像入力部6では、帳票や、図面を光学的に読み取り、表をディジタル画像(表画像)に変換する。
【0033】
入力した表画像では、表部分は「1」の値で、それ以外の部分は「0」の値を持つ2値画像である。
この例では、表画像の大きさをN×M画素の大きさとする。前記入力した表画像は、一旦第1のフレームメモリ10に格納する。この場合、第1のフレームメモリの大きさは、表画像の大きさ(N×M画素)と同じであるとする。
【0034】
(2):投影像抽出処理の説明・・・図4参照
投影部7では、前記入力した表画像に対して、投影像抽出処理を行う。この処理では、投影部7が、例えば、9×1画素、及び1×9画素のマスクを設定し、水平方向と垂直方向に対し、別々に第1のフレームメモリ10を走査する。
【0035】
すなわち、水平方向に走査する場合は、9×1画素(水平方向に9画素、垂直方向に1画素)のマスクを使用し、垂直方向に走査する時は、1×9画素(水平方向に1画素、垂直方向に9画素)のマスクを使用する。
【0036】
前記マスクを使用して第1のフレームメモリ10を走査した結果、例えば、マスク内に、「1」である画素が、マスク内総画素数の8割以上あった場合、若しくは、マスクの中心画素を含む画素が、マスク内の画素数の半分以上連続して「1」である画素が存在するならば、該マスクの中心画素を残す。
【0037】
但し、水平軸(X軸)方向に対して残す画素は、第2のフレームメモリ11に残し、垂直軸(Y軸)方向に残す画素は、第1のフレームメモリ10に残す。この場合、第1のフレームメモリ10に格納されていた元の表画像(入力した時の画像)は、消去される。
【0038】
以上の処理により、ノイズとなる画素を除去し、水平方向に残す画像と、垂直方向に残す画素を別のフレームメモリに分離して格納する。
その後、第1のフレームメモリ10と、第2のフレームメモリ11に格納してある表画像から、垂直軸、及び水平軸への投影処理を行い、投影像を求める(画素数を累積する)。
【0039】
そして、図4に示したように、第1のフレームメモリ10を水平方向に走査して、各列の値「1」の画素数を、第1の投影用メモリ12に格納する。この時、各列に対応したアドレスに、画素数(ドット数)を格納する。
【0040】
また、第2のフレームメモリ11を垂直方向に走査して、各列の値「1」の画素数を、第2の投影用メモリ13に格納する。この時、各列に対応したアドレスに、画素数(ドット数)を格納する。
【0042】
(3):像のラベル付け処理の説明・・・図4参照
マスク画像生成部8では、第1の投影用メモリ12、第2の投影用メモリ13に格納してある投影像に対し、塊(ドット数の存在する1塊の部分)毎に番号を付けて、ラベル付け処理を行う。
【0043】
例えば、図4では、投影像が「3、9、1」のように、1つの塊(3画素分)となっている部分を対象として、1つのラベル(例えば、番号)を付ける。
(4):マスク画像生成処理の説明・・・図5参照
次に、図5に示したように、第2のフレームメモリ11に、各塊の幅と同じ幅の直線(画素値=1)を水平、及び垂直に引く(メモリ一杯に直線を引く)。
【0044】
この場合、例えば塊の幅が3画素ならば、幅3画素の直線を引く。このように水平/垂直方向に引いた直線の部分(十字型の画像)を「マスク画像」という。
以上のようにして、マスク画像を生成する。
【0045】
(5):罫線の交点算出処理の説明・・・図6参照
前記のようにして生成したマスク画像から、図6に示したように、直線の交点の座標(x,y)を抽出する。この場合、直線の交点は、垂直/水平方向の各直線を引いた投影像の中で、最も値が高い(ドット数が多い)位置の組とする。
【0046】
すなわち、図6の例では、投影像が「9」の位置で引いた直線と、投影像が「8」の位置で引いた直線の交点の座標を抽出する。このようにして、罫線の交点を抽出する。
【0047】
(6):罫線の探索処理の説明・・・図7参照
前記のようにして罫線の交点を検出した後、罫線探索部9では、次のようにして罫線の探索処理を行う。
【0048】
例えば、図7に示したように、幅Aの直線がある場合、第1のフレームメモリ10を参照し、その幅A内に「1」である画素が存在するならば、罫線が存在すると仮定する。
【0049】
前記交点間で、罫線が存在すると仮定した画素数が、交点間の長さ(最短画素数)の定めた比率(例えば、8割)以上を占める場合、その交点間に罫線が存在すると仮定し、罫線の端点の座標をメモリ14に格納する。この処理を全ての交点で繰り返して行う。
【0050】
罫線探索部9では、なるべく長い罫線を得るために、直線で繋がっている交点間の内、離れているものから順に選び、その間に罫線が存在するか否かを検査する。
【0051】
(7):ベクトルの階層化処理の説明・・・図8参照
例えば、図8のように、交点間の直線の長さを尺度として、該直線を階層化する。
【0052】
例えば、直線AEがあった場合、直線AEは、少し短い直線ADと、直線BEから構成されている(一部重複していてもよい)。また、直線ADは、直線ACと直線BDから構成されている。このような関係を木構造で示すと、図8のように階層化構造となる。
【0053】
この場合、もし、直線AEに罫線が存在しない場合、直線ADと直線BEでの存在を確認しにいき、同様に各直線での罫線の存在を確認しにゆく。もし、直線AEに罫線が存在する場合は、それを構成する直線での罫線の存在は確認しない。
【0054】
§4:並列処理装置の説明・・・図9参照
図9は実施例の並列処理装置構成図である。前記ベクトル化処理を行う装置として、例えば、図9に示したような並列処理装置を使用することにより、処理の高速化を図ることができる。
【0055】
この装置は、入力した表画像を水平成分と垂直成分とに分け、水平方向の罫線抽出処理と、垂直方向の罫線抽出処理とを並列処理として行う装置である。
図示のように、表のベクトル化装置5には、水平成分処理部15と、垂直成分処理部16が設けてあり、これらの各処理部には、それぞれ、投影部7、マスク画像生成部8、罫線探索部9が設けてある。
【0056】
この装置では、画像入力部6から入力した表画像を、水平成分処理部15と垂直成分処理部16に入力し、水平成分と垂直成分毎に前記の処理を並列処理として行う。なお、各部の機能は、図2の装置と同じである。
【0057】
【発明の効果】
以上説明したように、本発明によれば次のような効果がある。
▲1▼:入力した表画像が多少傾いていても、正確に、表をベクトル化することができる。
【0058】
▲2▼:直線の木構造を利用することにより、表を構成する罫線を、なるべく長くすることができる。
▲3▼:表のベクトル化処理を行う装置として、並列処理装置を使用することにより、処理の高速化を図ることができる。
【図面の簡単な説明】
【図1】本発明の原理説明図である。
【図2】実施例の装置構成図である。
【図3】実施例の処理フローチャートである。
【図4】実施例の処理説明図1(投影像抽出処理)である。
【図5】実施例の処理説明図2(マスク画像生成処理)である。
【図6】実施例の処理説明図3(罫線の交点算出処理)である。
【図7】実施例の処理説明図4(罫線の探索処理)である。
【図8】実施例の処理説明図5(ベクトルの階層化処理)である。
【図9】実施例の並列処理装置構成図である。
【図10】従来技術の説明図である。
【符号の説明】
1 表画像
2 表部分
5 表のベクトル化装置
6 画像入力部
7 投影部
8 マスク画像生成部
9 罫線探索部
10 第1のフレームメモリ
11 第2のフレームメモリ
[0001]
[Industrial applications]
The present invention relates to a table vectorizing apparatus for vectorizing a table such as a form or a drawing.
[0002]
Vectorizing tables such as forms and drawings is an important technology in the fields of OCR (optical character reading device), map processing, document processing, and the like. For example, in OCR, it is required to recognize characters from not only a form dedicated to OCR but also a form available on the market.
[0003]
By automatically vectorizing the form table, the table can be identified and the table can be extracted, thereby improving the OCR recognition rate and adding value. In the drawings, vectorization of a table such as a parts table is indispensable.
[0004]
[Prior art]
FIG. 10 is an explanatory diagram of a conventional technique. In FIG. 10, 1 indicates a front image, 2 indicates a front portion, and 3 indicates a projected image (the number of dots).
[0005]
Conventionally, in a table vectorizing apparatus, when vectorizing a table portion 2 from a table image 1 such as a form or drawing, vectorization is performed by extracting ruled lines of the table.
In this case, the ruled lines forming the table are projected on the vertical axis (Y axis) and the horizontal axis (X axis) (the number of dots) on the assumption that the ruled lines constituting the table are horizontal or vertical with respect to the table image 1. I was seeking from 3. The outline of this vectorization processing is as follows.
[0006]
First, a form or the like is read from a scanner or the like to obtain a front image 1 (an image in the memory). Thereafter, a projection image 3 in the vertical axis direction and the horizontal axis direction is obtained for the front image 1.
This projected image 3 has a value obtained by accumulating the number of dots in each axis (X, Y) direction of the XY coordinates (for example, if a dot in a black portion is “1” and a dot in a white portion is “0”). , Dot “1”).
[0007]
The projected image 3 also obtains not only the ruled lines of the table but also the dots such as characters and numerals of the table portion 2 (dots other than the ruled lines are included as noise).
Therefore, in order to extract only the ruled line of the table portion 2, it is determined whether or not the projected image (the number of dots) 3 is equal to or larger than a predetermined threshold value. In this way, only the ruled lines can be extracted.
[0008]
[Problems to be solved by the invention]
The above-described conventional device has the following problems.
Forms and drawings are slightly inclined when read by an image input device such as a scanner. In this case, a large inclination can be corrected by coordinate conversion.
[0009]
However, even if the inclination is, for example, 1 ° or less, the straight line has an inclination of several pixels due to the quantization error in the image, but this inclination cannot be corrected. If the inclination cannot be corrected, the conventional method as described above cannot uniquely determine a threshold used for extracting a ruled line.
[0010]
An object of the present invention is to solve such a conventional problem, and to accurately vectorize a table portion even when an input table image is slightly inclined.
[0011]
[Means for Solving the Problems]
FIG. 1 is a diagram illustrating the principle of the present invention. In FIG. 1, the same components as those in FIG. 10 are denoted by the same reference numerals. 5 is a table vectorizing device, 6 is an image input unit, 7 is a projection unit, 8 is a mask image generation unit, 9 is a ruled line search unit, 10 is a first frame memory, and 11 is a second frame memory. Show.
[0012]
The present invention is configured as follows in order to solve the above problems.
(a) : A table vectorization device for obtaining a projection image on the vertical axis (Y axis) and the horizontal axis (X axis) from the input table image 1 and vectorizing the table portion 2, For pixels corresponding to the table portion of FIG. 1 , on the horizontal axis (X-axis), a horizontal line segment is ignored, and only the vertical line segment is extracted to extract a projected image. On the axis), a projection unit that obtains a projection image of a ruled line constituting a table by ignoring a vertical line segment and extracting a projection image limited to only a horizontal line segment, and a projection of the ruled line A mask image generation unit 8 that draws a straight line having the same width as the image on a memory (second frame memory 11) in the horizontal and vertical directions and generates the same as a mask image, and a mask generated by the mask image generation unit According to the image, the ruled line is searched according to the ratio of the length between intersections and the number of pixels between intersections, and the table part is vectorized. A table vectorization apparatus provided with a ruled line search unit 9 for converting into a rule .
[0014]
(b) : In the configuration (a) , when the ruled line search unit 9 searches for a ruled line in accordance with the mask image, an intersection of straight lines is extracted from the mask image, and a ratio of the number of pixels to the distance between the extracted intersections is calculated as follows. A table vectorization device for determining the existence of a ruled line between the intersections.
[0015]
(c) : In the configuration (a) , when the ruled line search unit 9 searches for a ruled line in accordance with a mask image, a table vectorizing apparatus that searches for a ruled line using a tree structure of a straight line.
(d): in the construction (a) to (c), the vertical performed vectorization unit, and the horizontal component processing unit that performs vectorization processing of the horizontal component of the table image 1, the vectorization processing of the vertical component ingredients A table vectorizing apparatus, comprising a processing unit, dividing an input table image 1 into a horizontal component and a vertical component, and performing parallel processing by the horizontal component processing unit and the vertical component processing unit.
[0016]
[Action]
The operation of the present invention based on the above configuration will be described with reference to FIG.
The following processing is performed on the front image 1 stored in the first frame memory 10 by inputting a form, a drawing, and the like from the image input unit 6.
[0017]
First, the projection unit 7 extracts a projection image of a vertical / horizontal ruled line for a pixel corresponding to the table portion 2 in the table image 1. In this case, the projection on the horizontal axis (X axis) is limited only to the vertical line segment (ignoring the horizontal line segment), and conversely, the vertical axis (Y axis) is projected in the horizontal direction. Limit to line segments only (ignore vertical line segments).
[0018]
This allows the projection images to be clearly distinguished from each other, whereas conventionally, the projection images contact each other and cannot be separated.
Next, labeling is performed on each projected image on the vertical axis (Y axis) and the horizontal axis (X axis). In this process, the number of pixels (the number of dots) is counted for each label, and only an image reaching a certain threshold is left (noise component is removed).
[0019]
Subsequently, in accordance with the projection image, a straight line having the width of the image is drawn from the vertical / horizontal direction to fill the image to generate a mask image. After that, the intersection of the ruled lines in the table is calculated by extracting the coordinates of the intersection of the straight lines from the mask image. Finally, a ruled line is searched to vectorize the table portion. In this case, the coordinates are extracted also for the intersection of the end of the table image and the straight line.
[0020]
Then, it is checked whether or not a ruled line exists between the intersections. As a result, if a ruled line exists, the coordinates of both ends are recorded.
As described above, it is possible to accurately vectorize the table portion even for a subtle inclination of the input table image. In addition, when the vectorization processing of the table portion is performed, the processing of the horizontal component and the vertical component is performed in parallel, so that the processing speed can be increased.
[0021]
【Example】
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
2 to 9 are views showing an embodiment of the present invention. In FIGS. 2 to 9, the same components as those in FIGS. 1 and 10 are denoted by the same reference numerals. Reference numeral 12 denotes a first projection memory, and reference numeral 13 denotes a second projection memory.
[0022]
§1: Description of the configuration of the table vectorization device ... See FIG. 2 FIG. 2 is a device configuration diagram of the embodiment. Hereinafter, the configuration of the table vectorization device will be described with reference to FIG.
[0023]
The table vectorizing device 5 is a device provided in various processing devices such as a personal computer, a workstation, and OCR.
The table vectorizing device 5 includes an image input unit 6, a projection unit 7, a mask image generation unit 8, a ruled line search unit 9, a first frame memory 10, a second frame memory 11, and a first projection memory. 12, a second projection memory 13 and the like.
[0024]
The image input unit 6 reads a form, a drawing, and the like and inputs a table image, and is configured by an optical device such as a scanner or a camera.
The projection unit 7 projects the input table image in the vertical axis (Y axis) and horizontal axis (X axis) directions. The mask image generation unit 8 generates a mask image, and the ruled line search unit 9 performs a ruled line search process according to the mask image (details will be described later).
[0025]
§2: Outline of processing of embodiment ... refer to FIG. 3 FIG. 3 is a processing flowchart of the embodiment. Hereinafter, the processing outline of the embodiment will be described with reference to FIG. Note that S1 to S5 in FIG. 3 indicate each processing number.
[0026]
The following processing is performed on a table image (see a conventional example) obtained by inputting a form or drawing from a scanner.
In this case, the input table image is a binary digital image. In the table image, the pixel value of the table portion (ruled line portion) is “1”, and the other values are “0”, and f (x, y) It expresses. In addition, it is assumed that the table portion has been subjected to inclination correction (correctable large inclination correction) by performing processing such as coordinate transformation on the table image.
[0027]
In the input table image, a process (S1) of extracting a projected image (the number of dots) of a vertical / horizontal ruled line is performed on pixels corresponding to the table portion.
Specifically, the projection on the horizontal axis (X axis) is limited only to the vertical line segment (ignoring the horizontal line segment), and conversely, the horizontal axis (Y axis) is projected horizontally. Limited to line segments in the direction only (ignoring line segments in the vertical direction). This allows the projection images to be clearly distinguished from each other, whereas conventionally, the projection images contact each other and cannot be separated.
[0028]
Next, labeling is performed on each of the projected images on the vertical axis and the horizontal axis (S2). In this process, the number of pixels (the number of dots) is counted for each label, and only an image reaching a certain threshold is left (noise component is removed). When setting the threshold value, the ruled line of the table is sufficiently longer than the characters and the like, and thus can be easily determined.
[0029]
Subsequently, a straight line having an image width is drawn to fill the image according to the projection image, and a mask image is generated (S3). Note that an image obtained by drawing a straight line as described above is referred to as a “mask image”. Thereafter, the intersection of the ruled lines in the table is calculated by extracting the coordinates of the intersection of the straight lines from the mask image (S4).
[0030]
Finally, a ruled line is searched (S5), and the table portion is vectorized. In this case, the coordinates are extracted also for the intersection of the end of the table image and the straight line. Then, it is checked whether or not a ruled line exists between the intersections. As a result, if a ruled line exists, the coordinates of both ends are recorded.
[0031]
§3: Process description of the embodiment FIG. 4 is a process description of the embodiment FIG. 1 (projection image extraction process), FIG. 5 is a process description of the embodiment FIG. 2 (mask image generation process), FIG. 6 is a process description of the embodiment FIG. 3 (ruled line intersection calculation processing), FIG. 7 is a processing explanatory diagram of the embodiment (ruled line search processing), and FIG. 8 is a processing explanatory diagram of the embodiment (vector hierarchical processing). Hereinafter, each process of the embodiment will be specifically described.
[0032]
(1): Description of Table Image Input Processing The table image input processing is performed by the image input unit 6. That is, the image input unit 6 optically reads a form or drawing and converts a table into a digital image (table image).
[0033]
In the input table image, the table portion has a value of “1”, and the other portions are binary images having a value of “0”.
In this example, the size of the table image is N × M pixels. The input table image is temporarily stored in the first frame memory 10. In this case, it is assumed that the size of the first frame memory is the same as the size of the front image (N × M pixels).
[0034]
(2): Description of Projected Image Extraction Process—See FIG. 4 The projection unit 7 performs a projected image extraction process on the input table image. In this processing, the projection unit 7 sets a mask of, for example, 9 × 1 pixels and 1 × 9 pixels, and scans the first frame memory 10 separately in the horizontal and vertical directions.
[0035]
That is, when scanning in the horizontal direction, a mask of 9 × 1 pixels (9 pixels in the horizontal direction and 1 pixel in the vertical direction) is used, and when scanning in the vertical direction, 1 × 9 pixels (1 pixel in the horizontal direction) is used. Pixel, 9 pixels vertically).
[0036]
As a result of scanning the first frame memory 10 using the mask, for example, if the number of pixels “1” is 80% or more of the total number of pixels in the mask, If there is a pixel in which the number of pixels including “1” is “1” continuously for at least half of the number of pixels in the mask, the central pixel of the mask is left.
[0037]
However, pixels to be left in the horizontal axis (X-axis) direction are left in the second frame memory 11, and pixels to be left in the vertical axis (Y-axis) direction are left in the first frame memory 10. In this case, the original table image (image at the time of input) stored in the first frame memory 10 is deleted.
[0038]
With the above processing, pixels that become noise are removed, and the image left in the horizontal direction and the pixel left in the vertical direction are separately stored in different frame memories.
After that, projection processing is performed on the vertical axis and the horizontal axis from the table images stored in the first frame memory 10 and the second frame memory 11, and a projection image is obtained (the number of pixels is accumulated).
[0039]
Then, as shown in FIG. 4, the first frame memory 10 is scanned in the horizontal direction, and the number of pixels having the value “1” in each column is stored in the first projection memory 12. At this time, the number of pixels (the number of dots) is stored in the address corresponding to each column.
[0040]
Further, the second frame memory 11 is scanned in the vertical direction, and the number of pixels having the value “1” in each column is stored in the second projection memory 13. At this time, the number of pixels (the number of dots) is stored in the address corresponding to each column.
[0042]
(3): Description of Image Labeling Process—See FIG. 4 The mask image generation unit 8 compares the projection images stored in the first projection memory 12 and the second projection memory 13 A labeling process is performed by assigning a number to each (a lump portion having the number of dots).
[0043]
For example, in FIG. 4, one label (for example, a number) is attached to a portion where one projection (for three pixels), such as “3, 9, 1”, is projected.
(4): Description of mask image generation processing ... see FIG. 5 Next, as shown in FIG. 5, a line having the same width as the width of each block (pixel value = 1) is stored in the second frame memory 11. Draw horizontally and vertically (draw a straight line to fill the memory).
[0044]
In this case, for example, if the block has a width of 3 pixels, a straight line having a width of 3 pixels is drawn. The straight line portion (cross-shaped image) drawn in the horizontal / vertical direction in this manner is called a “mask image”.
The mask image is generated as described above.
[0045]
(5): Explanation of Rule Line Intersection Calculation Process--See FIG. 6 From the mask image generated as described above, the coordinates (x, y) of the line intersection are extracted as shown in FIG. In this case, the intersection of the straight lines is a set of positions having the highest value (the number of dots is large) in the projected image obtained by drawing each straight line in the vertical / horizontal direction.
[0046]
That is, in the example of FIG. 6, the coordinates of the intersection of the straight line drawn at the position "9" of the projected image and the straight line drawn at the position "8" of the projected image are extracted. In this way, the intersections of the ruled lines are extracted.
[0047]
(6): Description of ruled line search processing--see FIG. 7 After the ruled line intersection is detected as described above, the ruled line search unit 9 performs ruled line search processing as follows.
[0048]
For example, as shown in FIG. 7, if there is a straight line having a width A, the first frame memory 10 is referred to, and if a pixel of “1” exists within the width A, it is assumed that a ruled line exists. I do.
[0049]
If the number of pixels assumed to have a ruled line between the intersections occupies a predetermined ratio (for example, 80%) of the length (shortest pixel number) between the intersections, it is assumed that a ruled line exists between the intersections. The coordinates of the end points of the ruled line are stored in the memory 14. This process is repeated at all intersections.
[0050]
In order to obtain a ruled line that is as long as possible, the ruled line search unit 9 sequentially selects intersections connected by straight lines, starting from the distant ones, and inspects whether a ruled line exists between them.
[0051]
(7): Description of vector hierarchization processing ... See FIG. 8 For example, as shown in FIG. 8, the straight lines between intersections are hierarchized as a scale.
[0052]
For example, if there is a straight line AE, the straight line AE is composed of a slightly shorter straight line AD and a straight line BE (they may partially overlap). The straight line AD includes a straight line AC and a straight line BD. When such a relationship is represented by a tree structure, a hierarchical structure is obtained as shown in FIG.
[0053]
In this case, if there is no ruled line on the straight line AE, the presence of the straight line AD and the straight line BE is checked, and similarly, the presence of the ruled line on each straight line is checked. If a ruled line exists on the straight line AE, the existence of a ruled line on the straight line constituting the ruled line is not confirmed.
[0054]
§4: Description of the parallel processing device ... refer to FIG. 9 FIG. 9 is a configuration diagram of the parallel processing device of the embodiment. By using, for example, a parallel processing device as shown in FIG. 9 as an apparatus for performing the vectorization processing, the processing speed can be increased.
[0055]
This apparatus divides an input table image into a horizontal component and a vertical component, and performs horizontal ruled line extraction processing and vertical ruled line extraction processing as parallel processing.
As shown in the figure, the table vectorizing device 5 is provided with a horizontal component processing unit 15 and a vertical component processing unit 16. These processing units are respectively provided with a projection unit 7 and a mask image generation unit 8. , A ruled line search unit 9 is provided.
[0056]
In this apparatus, the table image input from the image input unit 6 is input to the horizontal component processing unit 15 and the vertical component processing unit 16, and the above-described processing is performed as parallel processing for each of the horizontal component and the vertical component. The function of each unit is the same as that of the apparatus shown in FIG.
[0057]
【The invention's effect】
As described above, the present invention has the following effects.
{Circle around (1)} Even if the input table image is slightly inclined, the table can be accurately vectorized.
[0058]
{Circle around (2)} By using a straight tree structure, ruled lines constituting a table can be made as long as possible.
{Circle around (3)} The processing speed can be increased by using a parallel processing device as a device for performing the table vectorization process.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating the principle of the present invention.
FIG. 2 is an apparatus configuration diagram of an embodiment.
FIG. 3 is a processing flowchart of the embodiment.
FIG. 4 is a process explanatory diagram (projected image extraction process) of the embodiment.
FIG. 5 is a process explanatory diagram (mask image generation process) of the embodiment.
FIG. 6 is an explanatory diagram of a process in the embodiment (process of calculating an intersection of ruled lines);
FIG. 7 is an explanatory diagram of a process in the embodiment (a ruled line search process).
FIG. 8 is an explanatory diagram of a process in the embodiment (a vector hierarchical process).
FIG. 9 is a configuration diagram of a parallel processing device according to an embodiment.
FIG. 10 is an explanatory diagram of a conventional technique.
[Explanation of symbols]
1 Table image 2 Table part 5 Table vectorization device 6 Image input unit 7 Projection unit 8 Mask image generation unit 9 Ruled line search unit 10 First frame memory 11 Second frame memory

Claims (4)

入力した表画像から、垂直軸、及び水平軸への投影像を求めて、表部分をベクトル化する表のベクトル化装置において、
前記表画像の表部分に相当する画素に対して、水平軸(X軸)には、水平方向の線分を無視し、垂直方向の線分にのみ限定して投影像を抽出し、垂直軸(Y軸)には、垂直方向の線分を無視し、水平方向の線分のみに限定して投影像を抽出することで、表を構成する罫線の投影像を求める投影部と、
前記罫線の投影像と同じ幅の直線を、メモリ上に、水平及び垂直方向から引き、それをマスク画像として生成するマスク画像生成部と、
該マスク画像生成部で生成したマスク画像に従って、交点間の長さと交点間の画素数の比率で罫線を探索し、表部分をベクトル化する罫線探索部を設けたことを特徴とする表のベクトル化装置。
From the input table image, in the vertical axis, and in the table vectorization device for vectorizing the table portion to obtain a projected image on the horizontal axis,
For pixels corresponding to the table portion of the table image , the horizontal axis (X-axis) ignores horizontal line segments and extracts only the vertical line segments to extract projected images. (Y-axis), a projection unit that obtains a projection image of a ruled line forming a table by ignoring a vertical line segment and extracting a projection image limited to only a horizontal line segment ;
A mask image generation unit that draws a straight line having the same width as the projection image of the ruled line on a memory in the horizontal and vertical directions, and generates it as a mask image.
A table vector comprising a ruled line search unit for searching for a ruled line at a ratio of the length between intersections and the number of pixels between intersections according to the mask image generated by the mask image generation unit and vectorizing the table part. Device.
前記罫線探索部が、マスク画像に従って罫線を探索する際、前記マスク画像から、直線の交点を抽出し、
抽出した交点間の距離に対する画素数の比率から、前記交点間の罫線の存在を決定することを特徴とした請求項1記載の表のベクトル化装置。
When the ruled line search unit searches for a ruled line according to a mask image, the intersection of straight lines is extracted from the mask image,
2. The table vectorizing apparatus according to claim 1 , wherein the existence of a ruled line between the intersections is determined from the ratio of the number of pixels to the distance between the extracted intersections .
前記罫線探索部が、マスク画像に従って罫線を探索する際の罫線データは、直線の木構造で表されることを特徴とする請求項1記載の表のベクトル化装置。 2. The table vectorizing apparatus according to claim 1 , wherein the ruled line data when the ruled line search unit searches for a ruled line in accordance with a mask image is represented by a straight tree structure . 前記ベクトル化装置に、表画像の水平成分のベクトル化処理を行う水平成分処理部と、垂直成分のベクトル化処理を行う垂直成分処理部とを設け、
入力した表画像を、水平成分と垂直成分とに分割して、前記水平成分処理部と、垂直成分処理部とで並列処理を行うことを特徴とした請求項1乃至3のいずれかに記載の表のベクトル化装置。
The vectorization device includes a horizontal component processing unit that performs a vectorization process of a horizontal component of a table image, and a vertical component processing unit that performs a vectorization process of a vertical component,
The input table image is divided into a horizontal component and a vertical component, and parallel processing is performed by the horizontal component processing unit and the vertical component processing unit . Table vectorizer.
JP17402193A 1993-07-14 1993-07-14 Table vectorizer Expired - Fee Related JP3582734B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17402193A JP3582734B2 (en) 1993-07-14 1993-07-14 Table vectorizer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17402193A JP3582734B2 (en) 1993-07-14 1993-07-14 Table vectorizer

Publications (2)

Publication Number Publication Date
JPH0728939A JPH0728939A (en) 1995-01-31
JP3582734B2 true JP3582734B2 (en) 2004-10-27

Family

ID=15971259

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17402193A Expired - Fee Related JP3582734B2 (en) 1993-07-14 1993-07-14 Table vectorizer

Country Status (1)

Country Link
JP (1) JP3582734B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105938547A (en) * 2016-04-14 2016-09-14 河海大学 Paper hydrologic yearbook digitalization method

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4423557B2 (en) 2004-11-19 2010-03-03 ソニー株式会社 Authentication device, authentication method and program, and authentication information registration device
JP4683312B2 (en) * 2009-07-28 2011-05-18 ソニー株式会社 Authentication apparatus, authentication method, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105938547A (en) * 2016-04-14 2016-09-14 河海大学 Paper hydrologic yearbook digitalization method
CN105938547B (en) * 2016-04-14 2019-02-12 河海大学 A kind of papery Water Year Book digitizing solution

Also Published As

Publication number Publication date
JPH0728939A (en) 1995-01-31

Similar Documents

Publication Publication Date Title
JP4170441B2 (en) Document image inclination detection apparatus and storage medium for document image inclination detection program
JP3308032B2 (en) Skew correction method, skew angle detection method, skew correction device, and skew angle detection device
US5075895A (en) Method and apparatus for recognizing table area formed in binary image of document
JPH0196771A (en) Recognizing system for circular arc part
JPH03122773A (en) Image forming device
JP4395188B2 (en) Document image recognition apparatus and storage medium for document image recognition program
JP2004126648A (en) Image processing method, image processor, and image processing program
US6968085B2 (en) Document matching and annotation lifting
CN114529925B (en) Method for identifying table structure of whole line table
JP3582734B2 (en) Table vectorizer
JP2010044586A (en) Two dimensional-code reader and program thereof
TWM623309U (en) English font image recognition system
WO2000049569A1 (en) Method for extracting feature of binary image
JPH01129358A (en) Arithmetic unit for table numerical value
JP3046653B2 (en) How to correct the inclination of text documents
JPH0876913A (en) Image processor
JPH04255080A (en) Image input device
JP2802132B2 (en) Image forming device
JP3534997B2 (en) Ruled line extraction device and method
JP3104355B2 (en) Feature extraction device
JPH04579A (en) Method for extracting feature point of graphic
JPH10340337A (en) Correction method for inclination, extension and contraction of image data of drawing with drawing frame line graphic
JPH0496878A (en) Picture inclination detecting system
JP3037504B2 (en) Image processing method and apparatus
JPH03269689A (en) Document reading device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20020108

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040614

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040723

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080806

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090806

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090806

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100806

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110806

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees