JP5418064B2 - Image processing apparatus and program - Google Patents
Image processing apparatus and program Download PDFInfo
- Publication number
- JP5418064B2 JP5418064B2 JP2009193243A JP2009193243A JP5418064B2 JP 5418064 B2 JP5418064 B2 JP 5418064B2 JP 2009193243 A JP2009193243 A JP 2009193243A JP 2009193243 A JP2009193243 A JP 2009193243A JP 5418064 B2 JP5418064 B2 JP 5418064B2
- Authority
- JP
- Japan
- Prior art keywords
- rectangle
- specifying
- line segment
- specified
- graphic
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
本発明は、画像処理装置およびプログラムに関する。 The present invention relates to an image processing apparatus and a program.
画像中の表領域を認識する装置としては、例えば、特許文献1に開示された装置がある。この装置は、画像からセル領域の候補領域を特定し、複数の候補領域について表を構成することが可能な組み合わせ候補を選定する。そして、組み合わせの候補毎に表を構成する可能性の度合いを示す評価値を算出し、算出した度合いが最大の候補を選択して表を構成する。
As an apparatus for recognizing a table area in an image, for example, there is an apparatus disclosed in
本発明は、表領域ではない領域が表領域として判定されることを少なくする技術を提供することを目的とする。 An object of the present invention is to provide a technique for reducing a case where an area that is not a table area is determined as a table area.
本発明の請求項1に係る画像処理装置は、画像を二値で表した二値化画像を取得する取得手段と、前記取得手段で取得された二値化画像中の図形部分を特定する図形特定手段と、前記図形特定手段で特定された部分にある線分を特定する線分特定手段と、前記線分特定手段で特定された各線分の交差関係を判定する交差判定手段と、前記線分特定手段で特定された線分と、前記交差判定手段で判定された交差関係とにより、矩形が複数行または複数列で並んだセル構造と、該セル構造を構成せずに独立した独立矩形を特定する構造特定手段と、前記構造特定手段で特定された前記独立矩形に基づいて前記図形特定手段で特定された図形部分が表領域であるか否かを判定する手段であって、前記構造特定手段で特定されたセル構造を構成する矩形のうち、前記構造特定手段で特定された独立矩形が内側にある矩形以外の矩形について、該矩形の面積が前記セル構造の面積において占める割合を算定し、該算定した割合に基づいて、前記図形特定手段で特定された図形部分が表領域であるか否かを判定する表領域判定手段とを有する。
An image processing apparatus according to
本発明の請求項2に係る画像処理装置は、請求項1に記載の画像処理装置において、前記構造特定手段は、特定したセル構造を構成する矩形の内部についてさらに前記セル構造を特定することを特徴とする。
The image processing apparatus according to claim 2 of the present invention is the image processing apparatus according to
本発明の請求項3に係る画像処理装置は、請求項1または請求項2に記載の画像処理装置において、前記セル構造は、1行n列またはn行1列(n≧2)で矩形が並んだ構造であることを特徴とする。
An image processing apparatus according to a third aspect of the present invention is the image processing apparatus according to the first or second aspect , wherein the cell structure has a rectangular shape of 1 row n columns or
本発明の請求項4に係る画像処理装置は、請求項2または請求項3に記載の画像処理装置において、前記構造特定手段は、特定したセル構造を構成する矩形について、該矩形の角部の内側にある前記セル構造を特定することを特徴とする。 An image processing apparatus according to a fourth aspect of the present invention is the image processing apparatus according to the second or third aspect , wherein the structure specifying unit is configured to determine a rectangular shape of the specified cell structure. The cell structure inside is specified.
本発明の請求項5に係るプログラムは、コンピュータを、画像を二値で表した二値化画像を取得する取得手段と、前記取得手段で取得された二値化画像中の図形部分を特定する図形特定手段と、前記図形特定手段で特定された部分にある線分を特定する線分特定手段と、前記線分特定手段で特定された各線分の交差関係を判定する交差判定手段と、前記線分特定手段で特定された線分と、前記交差判定手段で判定された交差関係とにより、矩形が複数行または複数列で並んだセル構造と、該セル構造を構成せずに独立した独立矩形を特定する構造特定手段と、前記構造特定手段で特定された前記独立矩形に基づいて前記図形特定手段で特定された図形部分が表領域であるか否かを判定する手段であって、前記構造特定手段で特定されたセル構造を構成する矩形のうち、前記構造特定手段で特定された独立矩形が内側にある矩形以外の矩形について、該矩形の面積が前記セル構造の面積において占める割合を算定し、該算定した割合に基づいて、前記図形特定手段で特定された図形部分が表領域であるか否かを判定する表領域判定手段として機能させるためのプログラムである。 According to a fifth aspect of the present invention, there is provided a program for identifying a computer with an acquisition unit that acquires a binarized image representing a binary image and a figure portion in the binarized image acquired by the acquisition unit. Figure specifying means, line segment specifying means for specifying line segments in the part specified by the figure specifying means, intersection determination means for determining an intersection relationship of each line segment specified by the line segment specifying means, A cell structure in which rectangles are arranged in a plurality of rows or columns by the line segment specified by the line segment specifying means and the intersection relationship determined by the intersection determining means, and independent independent without constituting the cell structure a structure specifying means for specifying a rectangle, the structure has been geometric portion identified in the previous SL diagram form specifying means based on the independent rectangle identified in particular means a unit that determines whether a table region The cell structure specified by the structure specifying means Among rectangles other than the rectangle in which the independent rectangle specified by the structure specifying means is inside, the ratio of the area of the rectangle in the area of the cell structure is calculated, and based on the calculated ratio And a program for causing the graphic portion specified by the graphic specifying means to function as a table area determining means for determining whether or not the graphic portion is a table area .
本発明の請求項1、5に係る発明によれば、本発明の構成を有さないものと比較して、表領域ではない領域が表領域として判定されることを少なくすることができる。
本発明の請求項2に係る発明によれば、特定したセル構造に含まれる矩形の内部についてさらにセル構造を特定しないものと比較して、表領域ではない領域が表領域として判定されることを少なくすることができる。
本発明の請求項3に係る発明によれば、1行n列またはn行1列(n≧2)で矩形が並んだ構造をセル構造と特定しないものと比較して、表領域ではない領域が表領域として判定されることを少なくすることができる。
本発明の請求項4に係る発明によれば、特定したセル構造に含まれる矩形の角部の内側にセル構造がある図形を、表領域として判定することができる。
According to the inventions according to
According to the invention according to claim 2 of the present invention, it is determined that a region that is not a table region is determined as a table region compared to a case where a cell structure is not further specified for the inside of a rectangle included in the specified cell structure. Can be reduced.
According to the invention of claim 3 of the present invention, an area that is not a table area is compared with a structure in which rectangles are arranged in 1 row and n columns or n rows and 1 column (n ≧ 2) as not specifying a cell structure. Can be reduced as a table area.
According to the fourth aspect of the present invention, a figure having a cell structure inside a corner of a rectangle included in the specified cell structure can be determined as a table region.
[実施形態]
(実施形態の構成)
図1は、本発明の一実施形態に係るコンピュータ装置1のハードウェア構成を示したブロック図である。本実施形態においてコンピュータ装置1は、所謂PC(Personal Computer)であり、図1に示したように、各部は、バス101に接続され、このバス101を介して各部間で情報のやり取りを行う。
[Embodiment]
(Configuration of the embodiment)
FIG. 1 is a block diagram showing a hardware configuration of a
表示部107は、画像を表示する表示装置として液晶ディスプレイを備えており、CPU102の制御の下、コンピュータ装置1を操作するためのメニュー画面や各種メッセージ、画像等を表示する。なお、表示装置は液晶ディスプレイに限定されるものではなく、CRT(Cathode Ray Tube)やEL(electroluminescence)を用いたディスプレイなど他の表示装置であってもよい。
操作部106は、コンピュータ装置1を操作するためのキーボードやマウスを備えている。ユーザがこのキーボードやマウスを操作することにより、コンピュータ装置1に対する各種指示の入力や各種設定が行われる。
画像取得部108は、スキャナが接続されるインターフェースであり、紙面の画像を読み取り、読み取った画像の画像データを生成するスキャナと通信を行い、スキャナから画像データを取得する。
The
The
The
記憶部105はハードディスク装置を具備しており、コンピュータ装置1にオペレーティングシステムの機能を実現させるプログラムや、画像データが示す画像に画像処理を施す画像処理プログラム、スキャナから取得した画像データなどを記憶する。
ROM(Read Only Memory)103は、IPL(Initial Program Loader)を記憶しており、CPU(Central Processing Unit)102は、ROM103に記憶されているIPLを読み出して実行する。IPLが実行されると、記憶部105からオペレーティングシステムの機能を実現させるプログラムが読み出されて実行される。また、オペレーティングシステムの機能を実現させるプログラムが実行されると、CPU102により画像処理プログラムを実行することが可能となる。そして、CPU102により画像処理プログラムが実行されると、コンピュータ装置1は、画像データが示す画像を処理する画像処理装置として機能し、画像中にある図形が表であるか否か判定し、表の領域を特定する機能が実現する。
The
A ROM (Read Only Memory) 103 stores an IPL (Initial Program Loader), and a CPU (Central Processing Unit) 102 reads and executes the IPL stored in the
図2は、画像処理プログラムをCPU102が実行したことにより実現する機能を示したブロック図である。
二値化部200は、画像取得部108で取得された画像データが表す画像を白黒の二値の画像に二値化するブロックであり、二値化された画像(以下、二値化画像と称する)を得る取得手段の一例である。本実施形態においては、二値化画像は、画素の値を1ビットで表しており、黒の画素を「1」、白の画素を「0」とし、白画素が画像の背景を表している。なお、二値化画像は、黒の画素を「0」、白の画素を「1」で表してもよい。また、黒の画素を「10」、白の画素を「1」というように、「0」と「1」以外の数値で黒画素と白画素を表してもよい。
図形特定部201は、二値化画像中の図形の部分を特定するブロックである。画像から図形の部分を特定する技術としては、例えば、特開平3−102964号公報に記載されている技術など公知の技術を採用できる。なお、画像から図形の部分を特定する技術は、特開平3−102964号公報に記載されている技術に限定されず、他の技術を採用してもよい。
線分特定部202は、図形特定部201で特定された図形部分にある線分を特定するブロックである。線分を特定する技術としては、例えば、特開平2−210586号公報に記載されている技術のように、二値化画像を走査し、予め定められた閾値以上に黒画素が連続している部分を線分として特定するという手法など公知の様々な技術を採用できる。なお、図形部分にある線分を特定する技術は、特開平2−210586号公報に記載されている技術に限定されず、他の技術を採用してもよい。
FIG. 2 is a block diagram illustrating functions realized by the
The
The graphic specifying
The line
交差判定部203は、線分特定部202で特定された線分同士の交差関係を判定するブロックであり、線分の始点と終点の座標から、線分同士が交差しているか否か判定する。
構造特定部204は、図形特定部201が特定した図形部分において矩形の升目部分を特定するブロックであり、線分特定部202が特定した線分と、交差判定部203が判定した線分同士の交差関係とを用いて図形部分にある矩形を特定し、複数行または複数列で矩形が並んだ構造や、セル構造を構成せずに独立した矩形などを特定する。
リスト作成部205は、構造特定部204で特定された構造を表すリストを生成するブロックである。
表領域判定部206は、リスト作成部205が作成したリストを用いて図形特定部201が特定した図形部分が表であるか否か判定するブロックである。
The
The
The
The table
(実施形態の動作)
以下、本実施形態の動作例について説明する。なお、以下の説明においては、まず、画像データが示す画像を表ではないと判定する場合の動作について説明し、次に画像データが示す画像を表であると判定する場合の動作について説明する。
(Operation of the embodiment)
Hereinafter, an operation example of this embodiment will be described. In the following description, an operation when it is determined that the image indicated by the image data is not a table will be described first, and then an operation when it is determined that the image indicated by the image data is a table will be described.
(画像を表ではないと判定する場合の動作)
まず、ユーザが画像取得部108に接続されたスキャナに画像が描かれた紙をセットし、紙面の画像の読み取りを行わせると、紙面の画像を表す画像データがスキャナにおいて生成される。次に、ユーザが、スキャナで生成された画像データの取得を指示する操作を操作部106において行うと、画像取得部108がスキャナと通信を行い、スキャナで生成された画像データが取得されて記憶部105に記憶される。
(Operation when determining that an image is not a table)
First, when a user sets paper on which an image is drawn on a scanner connected to the
また、ユーザが、画像処理プログラムの実行を指示する操作を操作部106において行うと、画像処理プログラムがCPU102により実行される。次に、記憶部105に記憶された画像データを指定し、この指定した画像データに対して画像処理を行うように指示する操作をユーザが操作部106において行うと、CPU102は、画像処理プログラムに従って図3に示した処理を実行する。
When the user performs an operation for instructing execution of the image processing program on the
具体的には、まず、CPU102は、ユーザにより指定された画像データの画像を二値化する処理(ステップSA1)を行う。ここで、図4は、二値化処理により得られた二値化画像の一例を示した図であり、図4に示した画像G10は、棒グラフの画像である。なお、CPU102は、画像データの画像を二値化しているため、ここで二値化部200として機能している。
Specifically, first, the
CPU102は、二値化処理が終了すると二値化画像を解析し、二値化画像にある図形の部分を特定する(ステップSA2)。例えば、図4の二値化画像の場合、画像G10の部分が図形の部分として特定される。CPU102は、二値化画像にある図形部分を特定すると、各図形部分を一意に識別する図形識別子を生成し、例えば、画像G10の部分に対して「1」という図形識別子を生成する。なお、CPU102は、二値化画像にある図形部分を特定しているため、ここで図形特定部201として機能している。
When the binarization processing is completed, the
次にCPU102は、特定した図形部分にある線分を特定し、各線分の座標を特定する(ステップSA3)。例えば、図4の二値化画像の場合、画像G10の部分からは、縦方向に描かれた線分L101〜L110と、横方向に描かれた線分L121〜L130とが特定される。なお、線分の座標としては、例えば画像の左下隅を原点として、原点から横方向にx座標、原点から縦方向にy座標をとった場合の座標が特定される。CPU102は、図形部分にある線分の特定をしているため、ここで線分特定部202として機能している。
Next, the
CPU102は、各図形部分にある線分を特定すると、各線分を一意に識別するラベル番号を各線分に付ける。そして、図形部分に付けられた図形識別子と、この図形識別子で特定される部分にある各線分のラベル番号、各線分の両端の座標を対応付け、RAM(Random Access Memory)104に設けられる線分テーブルTB10に格納する(ステップSA4)。ここで、図5は、線分テーブルTB10のフォーマットの一例である。線分テーブルTB10は、図形識別子、ラベル番号、線分の両端の座標、交差する他の線分のラベル番号の列を有している。なお、本説明においては、各線分の符号における数の部分とラベル番号とを同じにしており、例えば、101というラベル番号は、線分L101に付けたラベル番号である。
When the
CPU102は、ステップSA4の処理が終了すると、ラベル番号が付けられた各線分を参照して線分同士の交差関係を判定する(ステップSA5)。そして、一の線分に交差する他の線分のラベル番号を、線分テーブルTB10に格納する。つまり、CPU102は、ここで線分同士の交差関係を判定する交差判定部203として機能する。
例えば、図4の画像の場合、線分L101については、線分L121,L122,L124,L128,L130が交差しているため、線分L101のラベル番号「101」に対応付けて、線分L121,L122,L124,L128,L130のラベル番号が図5に示したように格納される。
When the process of step SA4 is completed, the
For example, in the case of the image of FIG. 4, the line segment L101 is associated with the label number “101” of the line segment L101 because the line segments L121, L122, L124, L128, and L130 intersect with each other. , L122, L124, L128, and L130 are stored as shown in FIG.
CPU102は、ステップSA5の処理が終了すると、線分テーブルTB10に格納されている情報を用いて、特定された図形部分において複数行または複数列で矩形がある部分を特定し(ステップSA6)、特定した矩形間の関係を表すリスト300を作成する(ステップSA7)。つまり、ここでCPU102は、複数行または複数列で矩形が並んだ構造(セル構造)を特定する構造特定部204と、構造特定部204で特定された構造を表すリストを作成するリスト作成部205として機能する。なお、本実施形態においては、CPU102は、複数行または複数列で矩形がある部分を特定する際、n行1列または1行n列(n≧2)で矩形がある部分を特定する。
具体的には、まずCPU102は、ステップSA2で特定した図形の外周となる線分で囲まれて複数行または複数列で矩形が並んでいる部分を特定し、並んでいる各矩形に対してラベルを付ける処理を行う。例えば図4の画像の場合、CPU102は、線分の座標と交差関係から図形の外周となる線分として線分L101,L121,L110,L130を特定し、図7に示したように、複数行で矩形がある部分として矩形R10、矩形R20、矩形R30および矩形R40の部分を特定する。そして、CPU102は、各矩形に対してID10,ID20,ID30,ID40というラベルを付け、図6に示したように図形の図形識別子に対して各ラベルを関連付けたリスト300を作成する。
なお、以下の説明においては、特定した矩形内にさらに矩形がある場合、矩形内に含まれる矩形を下位の矩形と称し、内側に矩形を含んでいる矩形を上位の矩形と称する。例えば、矩形R20の部分は、内側に後述する矩形R21〜R23があるため、矩形R20は、矩形R21〜R23に対して上位の矩形となり、矩形R21〜R23は、矩形R20に対して下位の矩形となる。
When the process of step SA5 is completed, the
Specifically, first, the
In the following description, when there are more rectangles in the specified rectangle, the rectangle included in the rectangle is referred to as a lower rectangle, and the rectangle including the rectangle inside is referred to as an upper rectangle. For example, since the portion of the rectangle R20 includes rectangles R21 to R23 described later, the rectangle R20 is an upper rectangle with respect to the rectangles R21 to R23, and the rectangles R21 to R23 are lower rectangles with respect to the rectangle R20. It becomes.
CPU102は、特定した各矩形について、さらに矩形内において複数行または複数列で矩形がある部分を特定する処理を続ける。例えば、矩形R10については、この矩形内には、複数行または複数列で矩形がないため、この矩形R10については、CPU102は、下位にある矩形の特定を終了する。
For each specified rectangle, the
また、矩形R20については、CPU102は、図8に示したように複数列の矩形R21〜R23を特定し、各矩形に対してID21,ID22,ID23というラベルを付け、図6に示したように各矩形のラベルをリスト300にあるID20に関連付ける。これにより、図6のリスト300を参照すると、ID21,ID22,ID23で特定される矩形がID20で特定される矩形の下位の矩形であることが分かる。
そして、さらに矩形R21については、複数行または複数列ではないものの、内側に矩形がある。この場合、CPU102は、矩形R21の内側にある矩形についてはセル構造を構成しない独立した矩形(独立矩形)として特定する。そして、独立矩形を含む矩形R21については表の一部を構成する矩形ではないものと判断し、表を構成する矩形ではない矩形であることを示す「?」を図6に示したようにID21に対応付ける。
As for the rectangle R20, the
Further, the rectangle R21 is not a plurality of rows or a plurality of columns, but has a rectangle inside. In this case, the
また、矩形R30については、CPU102は、図9に示したように、複数列の矩形R31〜R37を特定し、各矩形に対してID31〜ID37というラベルを付け、図6に示したように各矩形のラベルをリスト300にあるID30に関連付ける。
そして矩形R34と矩形R36については、各矩形内に複数行の矩形があるため、CPU102は、複数行の各矩形に対してラベルを付し、図6に示したように、リスト300にあるID34とID36に対して各矩形のラベルを関連付ける。
なお、矩形R37については、セル構造ではなく内側に独立矩形がある。CPU102は、セル構造でない矩形R37については表の一部を構成する矩形ではないものとし、表を構成する矩形ではない矩形であることを示す「?」を図6に示したようにリスト300にあるID37に対応付ける。
As for the rectangle R30, as shown in FIG. 9, the
As for the rectangle R34 and the rectangle R36, since there are a plurality of rows of rectangles in each rectangle, the
Note that the rectangle R37 has an independent rectangle inside rather than a cell structure. The
また、矩形R40については、CPU102は、図10に示したように、複数列の矩形R41〜R49を特定し、各矩形に対してID41〜ID49というラベルを付け、図6に示したように各矩形のラベルをリスト300にあるID40に関連付ける。
そして、矩形R48については、矩形内に複数行の矩形があるため、CPU102は、複数行の各矩形に対してラベルを付し、図6に示したように、リスト300にあるID48に対して各矩形のラベルを関連付ける。
As for the rectangle R40, as shown in FIG. 10, the
As for the rectangle R48, since there are a plurality of rows of rectangles in the rectangle, the
次にCPU102は、ラベルが付けられた各矩形の面積について上位の矩形の面積に占める割合を算出し、算出した割合を図6のリスト300にあるラベルに対応付ける(ステップSA8)。
例えば、矩形R10,R20,R30,R40の各面積が等しい場合、図形識別子として「1」が付けられた画像G10の面積に占める各矩形の面積の割合は、各々25%となるため、CPU102は、図6に示したように「25%」をリスト300にあるID10,ID20,ID30,ID40に対応付ける。また、例えば矩形R20の面積に占める矩形R21の面積の割合が60%、矩形R20の面積に占める矩形R22の面積の割合が10%、矩形R20の面積に占める矩形R23の面積の割合が30%である場合、CPU102は、図6に示したようにリスト300にあるID21に対して60%、ID22に対して10%、ID23に対して30%を対応付ける。なお、他のラベルが付けられた矩形についても同様に面積の割合を求めると、図4に示した画像の場合、図6に示したように各矩形の面積の割合がラベルに対応付けられる。このように、ここでもCPU102は、リストを作成するためリスト作成部205として機能している。
Next, the
For example, when the areas of the rectangles R10, R20, R30, and R40 are equal, the ratio of the area of each rectangle to the area of the image G10 assigned “1” as the graphic identifier is 25%. As shown in FIG. 6, “25%” is associated with ID10, ID20, ID30, and ID40 in the
次にCPU102は、リスト300において「?」が対応付けられているラベルを特定し、特定したラベル対応付けられている割合を0%に置換する(ステップSA9)。例えば、矩形R21のラベルであるID21には「?」が対応付けられているため、CPU102は、ID21に対して対応付けられている割合を0%に置換する。また、矩形R37のラベルであるID37には「?」が対応付けられているため、CPU102は、ID37に対して対応付けられている割合を0%に置換する。
Next, the
CPU102は、ステップSA9の処理を終了すると、リスト300にあるラベルに対応付けられた割合に基づいて、特定した図形部分が表であるか否か判定する(ステップSA10)。つまり、ここでCPU102は、図形部分が表であるか否か判定する表領域判定部206として機能する。
具体的には、CPU102は、まず下位の矩形について矩形の面積の割合を加算し、加算結果が予め定められた閾値未満である場合、上位の矩形について、対応付けて格納されている割合を0%に置換する。
例えば、矩形R20に対して下位層の矩形である矩形R21〜R23については、ID21に対応付けられている割合が「0%」、ID22に対応付けられている割合が「10%」、ID23に対応付けられている割合が「30%」であるため、加算結果は40%となる。ここで、閾値が例えば85%である場合、加算結果は40%であって閾値未満であるため、上位層の矩形R20については、ID20に対応付けて格納されている割合を0%に置換する。
When the
Specifically, the
For example, for the rectangles R21 to R23 which are lower-layer rectangles with respect to the rectangle R20, the ratio associated with ID21 is “0%”, the ratio associated with ID22 is “10%”, and ID23. Since the associated ratio is “30%”, the addition result is 40%. Here, when the threshold value is 85%, for example, the addition result is 40% and is less than the threshold value. Therefore, for the upper layer rectangle R20, the ratio stored in association with ID20 is replaced with 0%. .
次に、ID341とID342の矩形については、ID341に対応付けられている割合が「80%」、ID342に対応付けられている割合が「20%」であり、加算結果が閾値以上となるため、上位層となる矩形R34のラベルであるID34については、対応づけられている割合を0%に置換せず、そのままとする。
なお、ラベルがID361とID362の矩形についても、「?」が対応づけられていないため、上位層となる矩形R36のラベルであるID36については、対応づけられている割合を0%に置換せず、そのままとする。
また、矩形R31〜R37の矩形については、ID31〜ID37に対応づけられている割合を加算すると加算結果は「65%」となる。ここで、加算結果は65%であって閾値未満であるため、上位層の矩形R30のラベルであるID30については、対応付けて格納されている割合を0%に置換する。
なお、ID481,ID482,ID41〜ID49の矩形については、「?」が対応付けられていないため、ID41〜ID49およびID40に対応付けられている割合が0%に置換されることがない。
Next, for the rectangles of ID 341 and ID 342, the ratio associated with ID 341 is “80%”, the ratio associated with ID 342 is “20%”, and the addition result is equal to or greater than the threshold value. The ID 34 that is the label of the upper-layer rectangle R 34 is left as it is without replacing the associated ratio with 0%.
In addition, since “?” Is not associated with the rectangles whose labels are ID361 and ID362, the associated ratio is not replaced with 0% for ID36 which is the label of the rectangle R36 as the upper layer. Leave it as it is.
For the rectangles R31 to R37, the addition result is “65%” when the proportions associated with ID31 to ID37 are added. Here, since the addition result is 65% which is less than the threshold value, the ratio stored in association with ID30 which is the label of the upper layer rectangle R30 is replaced with 0%.
In addition, since “?” Is not associated with the rectangles of ID481, ID482, ID41 to ID49, the ratio associated with ID41 to ID49 and ID40 is not replaced with 0%.
次にCPU102は、矩形R10,R20,R30,R40のラベルに対応付けられた割合「25%」、「0%」、「0%」、「25%」を加算する。ここで、加算結果は50%となり、加算結果が閾値未満であるため、画像G10については表ではないと判定する。CPU102は、判定結果を得ると、表示部107を制御して判定結果を表示部107に表示させる。
Next, the
(画像を表であると判定する場合の動作)
次に、二値化画像の図形部分を表であると判定する場合の動作について説明する。なお、本動作例においては、図11に示した二値化画像が得られた場合を例に動作の説明を行う。
(Operation when determining that an image is a table)
Next, the operation when it is determined that the graphic portion of the binarized image is a table will be described. In this operation example, the operation will be described by taking as an example the case where the binarized image shown in FIG. 11 is obtained.
まず、本動作例においては、画像データを取得してから二値化画像中の線分同士の交差関係を判定するまでは、上述の動作例と同じ動作を行う。CPU102は、ステップSA1からステップSA5までの処理が終了すると、線分テーブルTB10に格納されている情報を用いて、図形部分において複数行または複数列で矩形がある部分を特定し(ステップSA6)、特定した矩形間の関係を表すリスト300を生成する(ステップSA7)。
First, in the present operation example, the same operation as the above-described operation example is performed from the time when image data is acquired until the intersection relationship between line segments in the binarized image is determined. When the processing from step SA1 to step SA5 is completed, the
例えば、図11に示した画像G11の場合、図12に示したように、矩形R50、矩形R60、矩形R70および矩形R80が、複数行で矩形がある部分として特定される。そして、CPU102は、各矩形に対してID50,ID60,ID70,ID80というラベルを付ける。また、矩形R50、矩形R60、矩形R70および矩形R80の下位の矩形についてもラベルを付け、図13に示したように各ラベルを付けたリスト300を作成する。
For example, in the case of the image G11 shown in FIG. 11, as shown in FIG. 12, the rectangle R50, the rectangle R60, the rectangle R70, and the rectangle R80 are specified as a portion having a rectangle in a plurality of lines. Then, the
次にCPU102は、ラベルが付けられた各矩形の面積について上位の矩形の面積に占める割合を算出し、算出した割合をリスト300にあるラベルに対応付ける(ステップSA8)。例えば、矩形R50,R60,R70,R80の各面積が等しい場合、
図形識別子として「1」が付けられた画像G11の面積に占める各矩形の面積の割合は、各々25%となるため、CPU102は、図13に示したように「25%」をリスト中のID50,ID60,ID70,ID80に対応付ける。なお、他のラベルが付けられた矩形についても同様に面積の割合を求めると、図11に示した画像の場合、図13に示したように各矩形の面積の割合がラベルに対応付けられる。
Next, the
Since the ratio of the area of each rectangle occupying the area of the image G11 with “1” as the graphic identifier is 25%, the
次にCPU102は、図13のリストにおいて「?」に対応付けられているラベルを特定し、特定したラベルに対応付けられている割合を0%に置換する処理を行う(ステップSA9)。なお、図11に示した画像の場合、図13のリストが作成されて「?」が対応付けられているラベルが無いため、いずれのラベルにおいても、対応付けられている面積の割合が0%に置換されることがない。
Next, the
次にCPU102は、リスト300にあるラベルに対応付けられた割合に基づいて、特定した図形部分が表であるか否か判定する(ステップSA10)。ここでCPU102が、矩形R50,R60,R70,R80のラベルに対応付けられた割合「25%」、「25%」、「25%」、「25%」を加算すると、加算結果は100%となる。ここで加算結果が閾値以上であるため、CPU102は、画像G11については表であると判定する。CPU102は、判定結果を得ると、表示部107を制御して判定結果を表示部107に表示させる。
以上説明したように本実施形態によれば、グラフのように表ではない領域は表と認識しないため、表の認識率を高めることができる。
Next, the
As described above, according to the present embodiment, an area that is not a table as in the graph is not recognized as a table, so that the recognition rate of the table can be increased.
[変形例]
以上、本発明の実施形態について説明したが、本発明は上述した実施形態に限定されることなく、他の様々な形態で実施可能である。例えば、上述の実施形態を以下のように変形して本発明を実施してもよい。なお、上述した実施形態及び以下の変形例は、各々を組み合わせてもよい。
[Modification]
As mentioned above, although embodiment of this invention was described, this invention is not limited to embodiment mentioned above, It can implement with another various form. For example, the present invention may be implemented by modifying the above-described embodiment as follows. In addition, you may combine each of embodiment mentioned above and the following modifications.
画像処理プログラムを実行したCPU102は、図14に示したように外枠が矩形でない図形の場合、複数行で矩形がある部分として矩形R101、矩形R102、矩形R103および矩形R104を特定して各矩形に対してID101〜ID104というラベルを付けると共に、複数列で矩形がある部分として、矩形R105と矩形R106を特定してID105、ID106というラベルを付け、図15に示したリスト300を作成してもよい。なお、図15に示したリスト300は、矩形の面積の割合を対応付ける前の状態のリストを示した図である。
When the outer frame is a non-rectangular figure as shown in FIG. 14, the
また、画像処理プログラムを実行したCPU102は、図16に示したように外枠が矩形でない画像の場合、複数行で矩形がある部分として、矩形R201および矩形R202の部分と、矩形R203および矩形R204の部分と、矩形R205および矩形R206の部分とを特定するようにしてもよい。そして、矩形R201,R202に対してID201,ID202、矩形R203,R204に対してID203,ID204、矩形R205,R206に対してID205,ID206というラベルを付け、図17に示したリスト300を作成してもよい。なお、図17に示したリスト300は、矩形の面積の割合を対応付ける前の状態のリストを示した図である。
In addition, in the case where the outer frame is not a rectangle as shown in FIG. 16, the
また、画像処理プログラムを実行したCPU102は、図18に示したように矩形の内側の角部にさらに矩形がある図形の場合、複数行で矩形がある部分として、矩形R301〜R304を特定し、矩形R304の内側において、矩形R3041と矩形R3042を特定してもよい。
そして、矩形R301〜R304に対してID301〜ID304というラベルを付け、さらに矩形R3041,R3042に対してID3041,ID3042というラベルを付け、図19に示したリスト300を作成してもよい。なお、図19に示したリスト300は、矩形の面積の割合を対応付ける前の状態のリストを示した図である。
Further, the
Then, the labels R301 to R304 may be labeled ID301 to ID304, the rectangles R3041 and R3042 may be labeled ID3041 and ID3042, and the
本発明においては、独立矩形の面積が画像中に占める割合を算定し、算定した割合が予め定められた閾値以上である場合には、画像が表ではないと判定するようにしてもよい。
また、本発明においては、独立矩形を内側に含む矩形の面積が画像中に占める割合を算定し、算定した割合が予め定められた閾値以上である場合には、画像が表ではないと判定するようにしてもよい。
In the present invention, the ratio of the area of the independent rectangle in the image may be calculated, and when the calculated ratio is equal to or greater than a predetermined threshold, it may be determined that the image is not a table.
In the present invention, the ratio of the area of the rectangle including the independent rectangle to the inside of the image is calculated, and when the calculated ratio is equal to or greater than a predetermined threshold, it is determined that the image is not a table. You may do it.
上述した実施形態においては、操作部106を操作することにより、ユーザが閾値を設定できるようにしてもよい。
また、閾値を複数設定可能とし、ユーザが複数の閾値のいずれかから閾値を選択するようにしてもよい。例えば、2つの閾値を設定可能とし、一方の閾値を例えば95%とし、他方の閾値を50%というように、2つの閾値の値を異ならせてもよい。
また、閾値を設定する場合、表の画像とグラフの画像とを複数準備し、これらの画像に対しての判定結果からWidrow-Hoffの学習規則やフィッシャーの判別分析などの学習方法により、表であるか否かを判定する際の閾値を設定するようにしてもよい。
In the above-described embodiment, the threshold value may be set by the user by operating the
Further, a plurality of threshold values may be set, and the user may select a threshold value from any one of a plurality of threshold values. For example, the two threshold values may be set so that one threshold value is, for example, 95% and the other threshold value is 50%.
Also, when setting the threshold, prepare multiple images of the table and graph, and use the learning results such as Widrow-Hoff learning rules and Fisher discriminant analysis based on the determination results for these images. You may make it set the threshold value at the time of determining whether it exists.
上述した実施形態においては、CPU102が画像処理プログラムを実行することにより、CPU102が画像データを処理し、画像データ中の表の領域を特定しているが、画像データの画像に上述した画像処理を施す構成は、この構成に限定されるものではない。例えば、上述した処理を行うDSP(Digital Signal Processor)やプログラマブルロジックデバイスなどのハードウェアをバス101に接続し、画像データを、このハードウェアに供給することにより、ハードウェアで上述した処理を行うようにしてもよい。
In the above-described embodiment, the
上述した画像処理プログラムは、磁気記録媒体(磁気テープ、磁気ディスク(HDD(Hard Disk Drive)、FD(Flexible Disk))など)、光記録媒体(光ディスク(CD(Compact Disc)、DVD(Digital Versatile Disk))など)、光磁気記録媒体、半導体メモリなどのコンピュータ読取り可能な記録媒体に記憶した状態で提供し、コンピュータ装置1にインストールしてもよい。また、通信回線を介してダウンロードしてインストールしてもよい。
The above-described image processing program includes a magnetic recording medium (magnetic tape, magnetic disk (HDD (Hard Disk Drive), FD (Flexible Disk), etc.)), optical recording medium (optical disc (CD (Compact Disc)), DVD (Digital Versatile Disk). )), Etc.) may be provided in a state of being stored in a computer-readable recording medium such as a magneto-optical recording medium or a semiconductor memory and installed in the
上述した実施形態においては、PCが画像処理プログラムを実行しているが、PC以外のコンピュータ装置が画像処理プログラムを実行してもよく、例えば、複写機能やスキャナの機能を有する画像形成装置が画像処理プログラムを実行し、上述した処理を画像形成装置が行うようにしてもよい。 In the embodiment described above, the PC executes the image processing program. However, a computer device other than the PC may execute the image processing program. For example, an image forming apparatus having a copying function or a scanner function may be used as an image. The image forming apparatus may execute the processing described above by executing a processing program.
1・・・コンピュータ装置、101・・・バス、102・・・CPU、103・・・ROM、104・・・RAM、105・・・記憶部、106・・・操作部、107・・・表示部、108・・・画像取得部、200・・・二値化部、201・・・図形特定部、202・・・線分特定部、203・・・交差判定部、204・・・構造特定部、205・・・リスト作成部、206・・・表領域判定部
DESCRIPTION OF
Claims (5)
前記取得手段で取得された二値化画像中の図形部分を特定する図形特定手段と、
前記図形特定手段で特定された部分にある線分を特定する線分特定手段と、
前記線分特定手段で特定された各線分の交差関係を判定する交差判定手段と、
前記線分特定手段で特定された線分と、前記交差判定手段で判定された交差関係とにより、矩形が複数行または複数列で並んだセル構造と、該セル構造を構成せずに独立した独立矩形を特定する構造特定手段と、
前記構造特定手段で特定された前記独立矩形に基づいて前記図形特定手段で特定された図形部分が表領域であるか否かを判定する手段であって、前記構造特定手段で特定されたセル構造を構成する矩形のうち、前記構造特定手段で特定された独立矩形が内側にある矩形以外の矩形について、該矩形の面積が前記セル構造の面積において占める割合を算定し、該算定した割合に基づいて、前記図形特定手段で特定された図形部分が表領域であるか否かを判定する表領域判定手段と
を有する画像処理装置。 Acquisition means for acquiring a binarized image representing a binary image;
Graphic specifying means for specifying a graphic part in the binarized image acquired by the acquiring means;
Line segment specifying means for specifying a line segment in a part specified by the graphic specifying means;
Intersection determination means for determining the intersection relationship of each line segment specified by the line segment specifying means;
A cell structure in which rectangles are arranged in a plurality of rows or columns by the line segment specified by the line segment specifying unit and the crossing relationship determined by the crossing determining unit, and independent without constituting the cell structure A structure specifying means for specifying an independent rectangle;
The identified geometric portion in the previous SL diagram form specifying means based on the independent rectangular identified a means for determining whether the tablespace by the structural identification means, identified in the structural specification means Of the rectangles constituting the cell structure, for the rectangles other than the rectangle with the independent rectangle specified by the structure specifying means inside, the ratio of the area of the rectangle to the area of the cell structure is calculated, and the calculated ratio An image processing apparatus comprising: a table area determining unit that determines whether or not the graphic part specified by the graphic specifying unit is a table area .
画像を二値で表した二値化画像を取得する取得手段と、
前記取得手段で取得された二値化画像中の図形部分を特定する図形特定手段と、
前記図形特定手段で特定された部分にある線分を特定する線分特定手段と、
前記線分特定手段で特定された各線分の交差関係を判定する交差判定手段と、
前記線分特定手段で特定された線分と、前記交差判定手段で判定された交差関係とにより、矩形が複数行または複数列で並んだセル構造と、該セル構造を構成せずに独立した独立矩形を特定する構造特定手段と、
前記構造特定手段で特定された前記独立矩形に基づいて前記図形特定手段で特定された図形部分が表領域であるか否かを判定する手段であって、前記構造特定手段で特定されたセル構造を構成する矩形のうち、前記構造特定手段で特定された独立矩形が内側にある矩形以外の矩形について、該矩形の面積が前記セル構造の面積において占める割合を算定し、該算定した割合に基づいて、前記図形特定手段で特定された図形部分が表領域であるか否かを判定する表領域判定手段
として機能させるためのプログラム。 Computer
Acquisition means for acquiring a binarized image representing a binary image;
Graphic specifying means for specifying a graphic part in the binarized image acquired by the acquiring means;
Line segment specifying means for specifying a line segment in a part specified by the graphic specifying means;
Intersection determination means for determining the intersection relationship of each line segment specified by the line segment specifying means;
A cell structure in which rectangles are arranged in a plurality of rows or columns by the line segment specified by the line segment specifying unit and the crossing relationship determined by the crossing determining unit, and independent without constituting the cell structure A structure specifying means for specifying an independent rectangle;
The identified geometric portion in the previous SL diagram form specifying means based on the independent rectangular identified a means for determining whether the tablespace by the structural identification means, identified in the structural specification means Of the rectangles constituting the cell structure, for the rectangles other than the rectangle with the independent rectangle specified by the structure specifying means inside, the ratio of the area of the rectangle to the area of the cell structure is calculated, and the calculated ratio A program for functioning as a table area determination means for determining whether or not the graphic part specified by the graphic specification means is a table area .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009193243A JP5418064B2 (en) | 2009-08-24 | 2009-08-24 | Image processing apparatus and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009193243A JP5418064B2 (en) | 2009-08-24 | 2009-08-24 | Image processing apparatus and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2011044089A JP2011044089A (en) | 2011-03-03 |
JP5418064B2 true JP5418064B2 (en) | 2014-02-19 |
Family
ID=43831461
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009193243A Expired - Fee Related JP5418064B2 (en) | 2009-08-24 | 2009-08-24 | Image processing apparatus and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5418064B2 (en) |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH02252078A (en) * | 1989-03-25 | 1990-10-09 | Sony Corp | Method for identifying area of document |
JP3420864B2 (en) * | 1995-08-09 | 2003-06-30 | 富士通株式会社 | Frame extraction device and rectangle extraction device |
JPH09319878A (en) * | 1996-05-29 | 1997-12-12 | Fuji Xerox Co Ltd | Image discrimination device |
-
2009
- 2009-08-24 JP JP2009193243A patent/JP5418064B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2011044089A (en) | 2011-03-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4361080B2 (en) | Method, program, and apparatus for generating image data | |
JP2005292975A (en) | Button processing method and data processor | |
JP2012022632A (en) | Information processing apparatus and control method thereof | |
KR20060029502A (en) | Method for displaying the state of data process | |
JP6206202B2 (en) | Information processing apparatus and information processing program | |
JP2009098883A (en) | Information processor and information processing program | |
JP2012194879A (en) | Information processing apparatus, information processing method and program | |
JP5418064B2 (en) | Image processing apparatus and program | |
JP5267364B2 (en) | Image processing apparatus and program | |
CN108509112B (en) | Menu display method and device, display equipment and storage medium | |
JP5870839B2 (en) | Information processing apparatus and information processing program | |
JP2008042545A (en) | Image processing apparatus and its program | |
JP2004102320A (en) | Business forms processing device and method, and program for executing method in computer | |
JP2018137509A (en) | Image processing device, image reading device, and program | |
JP5325744B2 (en) | Image processing apparatus and image processing program | |
JP3602061B2 (en) | Three-dimensional graphics display device and method | |
JP2012044478A (en) | Image processing device, method and program for image processing | |
JP6752311B2 (en) | Display device and display method | |
JP2018010691A (en) | Display device and display method | |
JP4890425B2 (en) | Method and program for creating mask image for manga frame image | |
JP2010140435A (en) | Information processor, display control method and program | |
JP2011018997A (en) | Image processing apparatus, and program | |
JP2008092250A (en) | Image processing system and image processing program | |
JP2008090449A (en) | Image processing system and image processing program | |
JP5591092B2 (en) | Display control apparatus, display control method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120719 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130603 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130625 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130812 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20131022 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20131104 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5418064 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |