JP2010178105A - Image analysis device and program - Google Patents

Image analysis device and program Download PDF

Info

Publication number
JP2010178105A
JP2010178105A JP2009019060A JP2009019060A JP2010178105A JP 2010178105 A JP2010178105 A JP 2010178105A JP 2009019060 A JP2009019060 A JP 2009019060A JP 2009019060 A JP2009019060 A JP 2009019060A JP 2010178105 A JP2010178105 A JP 2010178105A
Authority
JP
Japan
Prior art keywords
frame line
area
region
line
image data
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.)
Withdrawn
Application number
JP2009019060A
Other languages
Japanese (ja)
Inventor
Masaru Sekiguchi
優 関口
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2009019060A priority Critical patent/JP2010178105A/en
Publication of JP2010178105A publication Critical patent/JP2010178105A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Facsimile Image Signal Circuits (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image analysis device and a program analyzing image data to acquire positional information of each region by an easy technique as compared with a conventional technique. <P>SOLUTION: A region is identified by OCR software, an image displayed by drawing a frame border of its region data is screen-captured to extract the frame border, the coordinate values of the frame border are calculated, and thereby the coordinate values of the region data with the region identified by the OCR software can be obtained, thereby this image analysis device and this program capable of acquiring positional information of each region by an easy technique as compared with a conventional technique can be provided. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、原稿に含まれる領域の座標データを取得するための画像解析装置及びプログラムに関する。   The present invention relates to an image analysis apparatus and a program for acquiring coordinate data of an area included in a document.

従来技術として、入力された画像データに対して、OCR(Optical Character Reader:光学式文字読み取り装置)ソフトで領域識別をした結果の領域枠線の座標データを自動で取得するための画像処理方式がある。
この種の画像処理の技術の一例が特許文献1,2に開示されている。
As a conventional technology, there is an image processing method for automatically acquiring the coordinate data of the area frame line as a result of area identification using OCR (Optical Character Reader) software for the input image data. is there.
An example of this type of image processing technique is disclosed in Patent Documents 1 and 2.

ところで、このOCRソフトを利用する際の前処理として、レイアウト抽出処理がある。一般的に知られているOCRソフトでは、入力された文書画像データを用いて、文字、図・写真などの非文字、表、罫線などの各要素属性値で領域識別(レイアウト抽出)し、その結果を枠線として入力された画像データに上書きする。   By the way, there is layout extraction processing as preprocessing when using this OCR software. The generally known OCR software uses the input document image data to identify areas (layout extraction) with each element attribute value such as characters, non-characters such as figures and photos, tables, ruled lines, etc. The result is overwritten on the image data input as a frame line.

PC(Personal Computer)などの電子計算機における内部処理では、矩形領域の座標データなどを格納したベクトルデータが格納されていれば、直接座標データを取得することができる。
しかし一方で、座標データが描画データとして表現されている場合(ビットマップ等)は、矩形領域の座標データを取得することができない。この場合、ユーザはマウス等のポインタを用いて座標を指定しなければならないが、多数の領域が存在する場合、大変煩雑な処理となる。
In the internal processing in an electronic computer such as a PC (Personal Computer), if vector data storing coordinate data of a rectangular area is stored, the coordinate data can be directly acquired.
However, when the coordinate data is expressed as drawing data (bitmap or the like), the coordinate data of the rectangular area cannot be acquired. In this case, the user must specify coordinates using a pointer such as a mouse. However, when there are a large number of areas, the process is very complicated.

ここで図9は、特定色だけの画像データを示す図であり、図10は、従来方式による枠線抽出処理結果を示す図である。
図9において、一部(右側短辺)が欠けた矩形A(例えば、1mm幅の青色線)の下側の長辺に矩形Aより小さい矩形B(例えば、0.5mm幅の青色線)が重なった状態が示されている。
矩形Aの欠けた部分は、表の領域を表す枠線と重畳した部分であり、無色となっているため、欠けて見える。
図9で示す画像データに対して特許文献1に記載の技術だけで枠線(輪郭線とも言う)で包囲された領域を抽出すると、本来図11に示す結果が得られなければならないところ、図10のように矩形A及び矩形Bの下部分が統合された枠線で包囲された領域の抽出結果になってしまう。特許文献2に記載の技術を用いても図10と同様の結果になる。
Here, FIG. 9 is a diagram showing image data of only a specific color, and FIG. 10 is a diagram showing a result of frame line extraction processing by a conventional method.
In FIG. 9, a rectangular B smaller than the rectangle A (for example, a blue line having a width of 0.5 mm) is formed on the lower long side of the rectangle A (for example, a blue line having a width of 1 mm) from which a part (the short side on the right side) is missing. Overlapping conditions are shown.
The missing portion of the rectangle A is a portion that overlaps the frame line that represents the area of the table.
When an area surrounded by a frame line (also referred to as an outline) is extracted from the image data shown in FIG. 9 only by the technique described in Patent Document 1, the result shown in FIG. As a result, an extraction result of an area surrounded by a frame line in which the lower portions of the rectangle A and the rectangle B are integrated as shown in FIG. Even if the technique described in Patent Document 2 is used, the same result as in FIG. 10 is obtained.

これは、特許文献1に記載の技術では画素の連結成分を見て矩形領域を決定しているためである。図9に示した図形は、矩形Aの画素と矩形Bの画素とが連結している(接触している)ため、矩形Aと矩形Bとが一体化しているものとして見なされる。その結果、図11に示すように意図通りの矩形領域が得られなくなる。   This is because the technique described in Patent Document 1 determines the rectangular area by looking at the connected components of the pixels. The graphic shown in FIG. 9 is regarded as an integration of the rectangle A and the rectangle B because the pixel of the rectangle A and the pixel of the rectangle B are connected (contacted). As a result, the intended rectangular area cannot be obtained as shown in FIG.

ここで、領域識別が施された画像データが印刷出力されてしまうと、線種によって領域の種類を認識することはできるが、当然、各領域の位置情報を保存することはできない。したがって、画像データが印字された原稿を読み取って画像データを入力したとしても、各領域の位置情報を取得するためには、入力された画像データに対して再度領域識別を施さなくてはならなかった。   Here, when image data subjected to region identification is printed out, the type of the region can be recognized by the line type, but naturally the position information of each region cannot be stored. Accordingly, even if a document on which image data is printed is read and image data is input, in order to acquire position information of each area, the input image data must be subjected to area identification again. It was.

そこで本願発明は、画像データを解析し、従来技術に比べてより簡易な手法にて各領域の位置情報を取得可能とすることができる画像解析装置及びプログラムを提供すること目的とする。   SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide an image analysis apparatus and a program that can analyze image data and acquire position information of each region by a simpler method than in the prior art.

上記課題を解決するために、請求項1記載の発明は、カラー原稿に含まれる領域の位置情報を取得する画像解析装置であって、前記カラー原稿に含まれる領域は、領域の属性に応じた枠線により他の領域と区別されて表現されており、前記カラー原稿を読み取ることにより生成された画像データを入力する入力手段と、入力された前記画像データから所定の枠線を抽出する抽出手段と、抽出された前記枠線をトレースすることにより、前記領域の位置情報を取得する取得手段とを備え、前記取得手段は、前記枠線をトレースすべき方向が複数方向存在する場合、それまでトレースした軌跡に応じてトレースすべき方向を決定する決定手段を備えたことを特徴とする。   In order to solve the above-described problem, the invention described in claim 1 is an image analysis apparatus for acquiring position information of an area included in a color original, wherein the area included in the color original corresponds to an attribute of the area. An input means that is distinguished from other regions by a frame line and that inputs image data generated by reading the color document, and an extraction means that extracts a predetermined frame line from the input image data And acquiring means for acquiring positional information of the region by tracing the extracted frame line, and when the acquisition means has a plurality of directions in which the frame line should be traced, A determining means for determining a direction to be traced according to the traced trace is provided.

請求項2記載の発明は、請求項1記載の発明において、前記領域は、文字領域、表領域、及び画像領域を含み、前記入力手段で入力された文字領域もしくは前記表領域のみを前記枠線の色、太さにより判別する判別手段を備えたことを特徴とする。   According to a second aspect of the present invention, in the first aspect of the present invention, the area includes a character area, a table area, and an image area, and only the character area or the table area input by the input means is the frame line. And a discriminating means for discriminating according to the color and the thickness of each.

請求項3記載の発明は、請求項2記載の発明において、前記枠線が他の枠線と重複し、かつ途切れている場合に、前記枠線を補完する補完手段を備えたことを特徴とする。   The invention described in claim 3 is characterized in that, in the invention described in claim 2, when the frame line overlaps with another frame line and is interrupted, the frame line is provided with a complementing means for complementing the frame line. To do.

請求項4記載の発明は、画像データに含まれる領域の位置情報を取得するためのプログラムであって、コンピュータに、前記画像データから所定の領域の枠線を抽出する手順、抽出された前記枠線をトレースすることにより、前記領域の位置情報を取得する手順、前記枠線をトレースすべき方向が複数方向存在する場合、それまでトレースした軌跡に応じてトレースする方向を決定する手順、を実行させることを特徴とする。   The invention according to claim 4 is a program for acquiring position information of an area included in image data, the computer extracting a frame line of a predetermined area from the image data, and the extracted frame Executes a procedure for acquiring position information of the area by tracing a line, and a procedure for determining a direction to trace according to a trace traced so far when there are a plurality of directions in which the frame line should be traced. It is characterized by making it.

請求項5記載の発明は、請求項4記載の発明において、前記領域は、文字領域、表領域、及び画像領域を含み、前記コンピュータに、前記文字領域もしくは前記表領域のみを前記枠線の色、太さにより判別する手順を実行させることを特徴とする。   According to a fifth aspect of the invention, in the fourth aspect of the invention, the area includes a character area, a table area, and an image area, and the computer displays only the character area or the table area as a color of the frame line. A procedure for discriminating according to the thickness is executed.

請求項6記載の発明は、請求項5記載の発明において、前記コンピュータに、前記枠線が他の枠線と重複し、かつ途切れている場合に補完する手順を実行させることを特徴とする。   According to a sixth aspect of the present invention, in the fifth aspect of the present invention, the computer is caused to execute a procedure for complementing when the frame line overlaps with another frame line and is interrupted.

本発明によれば、OCRソフトで領域を識別し、その領域のデータの枠線を描画して表示されたものをスクリーンキャプチャして、枠線を抽出するか、または手書きで書き込まれた枠線の座標値を算出することで、OCRソフトで領域識別をした領域データの座標値を求めることができるので、従来技術に比べてより簡易な手法にて各領域の位置情報を取得可能とすることができる画像解析装置及びプログラムの提供を実現することができる。   According to the present invention, an OCR software identifies an area, draws a frame line of data in the area, screen captures the displayed data, and extracts a frame line or a hand-written frame line By calculating the coordinate value, the coordinate value of the area data identified by the OCR software can be obtained, so that the position information of each area can be acquired with a simpler method than the conventional technology It is possible to provide an image analysis apparatus and a program that can perform the above.

本発明に係る画像解析装置の一実施の形態を示すハードウェア構成図である。It is a hardware block diagram which shows one Embodiment of the image-analysis apparatus based on this invention. 図1に示した画像解析装置の機能ブロック図の一例である。It is an example of a functional block diagram of the image analysis apparatus shown in FIG. 本発明に係る画像解析装置に用いられる全体処理フローの一例である。It is an example of the whole processing flow used for the image analyzer which concerns on this invention. 本発明に係る画像解析装置に用いられる特定色抽出処理フローの一例である。It is an example of the specific color extraction process flow used for the image analysis apparatus which concerns on this invention. 入力原稿画像データの一例である。It is an example of input original image data. 図5に示した入力画像データの領域識別結果の枠線が描画された画像データの一例である。6 is an example of image data in which a frame line of a region identification result of input image data illustrated in FIG. 5 is drawn. 図5に示した入力原稿画像データを、特定色の枠線だけで示した画像データの一例である。FIG. 6 is an example of image data in which the input document image data shown in FIG. 図5に示した入力原稿画像データを、特定色だけで示した画像データの一例である。6 is an example of image data in which the input original image data shown in FIG. 特定色だけの画像データを示す図である。It is a figure which shows the image data of only a specific color. 従来方式による枠線抽出処理結果を示す図である。It is a figure which shows the frame line extraction process result by a conventional system. 本発明に係る画像解析装置による抽出結果を示す図である。It is a figure which shows the extraction result by the image analysis apparatus which concerns on this invention. X方向またはY方向が一致する線の説明図である。It is explanatory drawing of the line in which an X direction or a Y direction corresponds. 途切れた箇所を補完して閉じた矩形になった状態を示す図である。It is a figure which shows the state which complemented the interrupted location and became the closed rectangle. (a)〜(d)は、矩形領域における頂点を示す図である。(A)-(d) is a figure which shows the vertex in a rectangular area. 画素トレースの一例を示す図である。It is a figure which shows an example of a pixel trace. 画素トレースの一例を示す図である。It is a figure which shows an example of a pixel trace. 座標データの一例を示す図である。It is a figure which shows an example of coordinate data.

<特 徴>
本発明では、OCRソフトで領域識別し、その領域データの枠線を描画して表示されたものをスクリーンキャプチャして、枠線を抽出し、その枠線の座標値を算出することで、図11に示すようにOCRソフトで領域識別をした領域データの座標値を求まることができる。
また、本発明では、図9に示した、上下で途切れた矩形Bの短辺の途切れた部分の間隔を求め、その長さにより、途切れた箇所を補完して、図13に示すような閉じた矩形を生成する。
<Features>
In the present invention, a region is identified by OCR software, a frame line of the region data is drawn and displayed, screen capture is performed, a frame line is extracted, and a coordinate value of the frame line is calculated. As shown in FIG. 11, the coordinate value of the area data identified by the OCR software can be obtained.
Further, in the present invention, the interval between the short sides of the short side of the rectangle B shown in FIG. Generate a rectangle.

しかし、枠線の途切れた箇所を補完しただけでは連結成分による領域の抽出ができないため、連結成分の抽出に変わる抽出方法により、図10の領域1及び領域2を抽出する。
ここで、枠線の途切れた箇所を補完しただけでは領域の抽出ができないのは、連結成分が複数の領域を形成する枠線の重複部分であるためである。つまり、領域が部分的に重複している場合には、領域を区別する枠線が重複しており、かかる場合、全ての領域を包含する外接矩形が一領域として抽出されてしまう。したがって、枠線の途切れた箇所を補完しただけでは、領域を正確に抽出することができない。
具体的には、矩形領域は、図14(a)〜(d)にて示す頂点をそれぞれ1つずつ持っていて、かつ交差点を持たないことを特徴としている。これらの特徴を矩形パターンとする。この矩形パターンに一致するよう、画素の連結成分をトレースする(図15参照。)。図15において□は未トレースの画素を示し、■はトレース済みの画素を示す。トレースする順序は、図15において、左上から下方向、左上から右方向、もしくは同時に進行してもかまわない。
However, since it is not possible to extract a region using a connected component simply by complementing the broken part of the frame line, the region 1 and the region 2 in FIG. 10 are extracted by an extraction method instead of extracting a connected component.
Here, the reason why the region cannot be extracted simply by complementing the discontinuity of the frame line is that the connected component is an overlapping portion of the frame line forming a plurality of regions. That is, when the regions partially overlap, the border lines that distinguish the regions overlap, and in such a case, a circumscribed rectangle that includes all the regions is extracted as one region. Therefore, it is not possible to accurately extract the region simply by complementing the broken part of the frame line.
Specifically, the rectangular area is characterized by having one vertex shown in each of FIGS. 14A to 14D and no intersection. These features are rectangular patterns. The connected components of the pixels are traced so as to match this rectangular pattern (see FIG. 15). In FIG. 15, □ indicates an untraced pixel, and ■ indicates a traced pixel. The order of tracing in FIG. 15 may proceed from the upper left to the lower direction, from the upper left to the right direction, or simultaneously.

図15及び図16は、図13に示した二つの枠線を画素で表した模式図である。
図16において、左上の画素から右方向及び下方向に同時にトレースを行った状態を示す。
画素をトレースする順番が交差点(◆の位置)に到達したとき、◆の直前の画素の位置から、トレースする方向を決定していく。図16の場合、◆の直前のトレース済みの画素(■)の位置は◆の左側にあるため、次にトレースする画素は右隣の画素になる。
FIGS. 15 and 16 are schematic diagrams in which the two frame lines shown in FIG. 13 are represented by pixels.
FIG. 16 shows a state in which tracing is performed simultaneously from the upper left pixel in the right direction and the lower direction.
When the order of tracing the pixels reaches the intersection (the position of ◆), the tracing direction is determined from the position of the pixel immediately before ◆. In the case of FIG. 16, since the position of the traced pixel (■) immediately before ◆ is on the left side of ◆, the next pixel to be traced is the pixel on the right.

<定 義>
構成の説明に先立って、本実施形態における変数を以下のように定義する。
図5に示すSiは、入力原稿画像データ(例えば、モノクロデータ)の一例である。
図6に示すSrは、図5に示した入力画像データの領域識別結果の枠線が描画された画像データの一例である。L1は文字「報告書」を囲む線(例えば、青色線)、L2は文字領域(この場合、青色線)、L3は図領域(赤色線)、L4は文字領域(青色線)、L5は表領域(緑色線)、L6は文字領域(青色線)をそれぞれ示す。
図7に示すSvは、図5に示した入力原稿画像データを、特定色(本実施形態の場合、青色、赤色、緑色)の枠線だけで示した画像データである。
<Definition>
Prior to the description of the configuration, variables in the present embodiment are defined as follows.
Si shown in FIG. 5 is an example of input document image data (for example, monochrome data).
Sr shown in FIG. 6 is an example of image data in which a frame line of the region identification result of the input image data shown in FIG. 5 is drawn. L1 is a line (for example, blue line) surrounding the character “report”, L2 is a character area (blue line in this case), L3 is a figure area (red line), L4 is a character area (blue line), and L5 is a table An area (green line) and L6 indicate a character area (blue line), respectively.
Sv shown in FIG. 7 is image data in which the input document image data shown in FIG. 5 is indicated only by a frame line of a specific color (in this embodiment, blue, red, and green).

ここで、枠線の色に対応する特定色のカラーマップを Vn(R,G,B) とする。
特定の画素に対する座標値を S*(X,Y) とする(*はSiまたはSrまたはSvのいずれかである。)。
Sr(X,Y)のカラーマップを Sr(R,G,B)とする。
Here, let Vn (R, G, B) be the color map of the specific color corresponding to the color of the frame line.
The coordinate value for a specific pixel is S * (X, Y) (* is either Si, Sr, or Sv).
Let Sr (R, G, B) be the color map of Sr (X, Y).

<構 成>
図1は、本発明を適用した画像解析装置の一実施の形態を示すハードウェア構成図である。
同図に示す画像解析装置は、主にCPU(Central Processing Unit:中央処理装置)101、入力画像メモリ部104、領域情報格納部106、画像処理部107、スキャナ部102、外部記憶部103、表示部105、及び通信制御部108で構成されている。
入力画像メモリ部104、領域情報格納部106、画像処理部107は、ROM(read-only memory)、RAM(random-access memory)で構成されている。
通信制御部108はネットワーク網109に接続されている。外部記憶部103は、CD(Compact Disc)/DVD(Digital Versatile Disc)/メモリカード110やハードディスク111に接続されている。
<Configuration>
FIG. 1 is a hardware configuration diagram showing an embodiment of an image analysis apparatus to which the present invention is applied.
The image analysis apparatus shown in FIG. 1 mainly includes a CPU (Central Processing Unit) 101, an input image memory unit 104, an area information storage unit 106, an image processing unit 107, a scanner unit 102, an external storage unit 103, a display Unit 105 and communication control unit 108.
The input image memory unit 104, the region information storage unit 106, and the image processing unit 107 are composed of ROM (read-only memory) and RAM (random-access memory).
The communication control unit 108 is connected to the network 109. The external storage unit 103 is connected to a CD (Compact Disc) / DVD (Digital Versatile Disc) / memory card 110 and a hard disk 111.

CPU101は、画像解析装置全体の制御を行う。スキャナ部102は、原稿または、外部記憶部103から原稿ファイルを読み取る。入力画像メモリ部104は、スキャナ部102が読み取った入力画像を記憶する。表示部105は、入力画像をプレビュー表示する。画像処理部107は、文字抽出処理・判定処理を行う。領域情報格納部106は、抽出・判定結果の領域情報を格納する。処理結果の情報を前述の外部記憶部に記憶する。また、通信制御部108を介して、ネットワーク網109から入力画像を取り寄せたり、処理結果の情報を配信したりする。   The CPU 101 controls the entire image analysis apparatus. The scanner unit 102 reads a document or a document file from the external storage unit 103. The input image memory unit 104 stores the input image read by the scanner unit 102. The display unit 105 displays a preview of the input image. The image processing unit 107 performs character extraction processing / determination processing. The area information storage unit 106 stores area information of extraction / determination results. Information on the processing result is stored in the aforementioned external storage unit. In addition, an input image is obtained from the network 109 or processing result information is distributed via the communication control unit 108.

図2は、図1に示した画像解析装置の機能ブロック図の一例である。
図2に示す制御手段220は、抽出手段200、取得手段201、決定手段202、判別手段203、及び補完手段204を備える。
抽出手段200は、画像データから所定の領域の枠線を抽出する。
取得手段201は、抽出された枠線をトレースすることにより、領域の位置情報を取得する。
決定手段202は、枠線をトレースすべき方向が複数方向存在する場合、それまでトレースした軌跡に応じてトレースする方向を決定する。
FIG. 2 is an example of a functional block diagram of the image analysis apparatus shown in FIG.
The control unit 220 illustrated in FIG. 2 includes an extraction unit 200, an acquisition unit 201, a determination unit 202, a determination unit 203, and a complement unit 204.
The extraction unit 200 extracts a frame line of a predetermined area from the image data.
The acquisition unit 201 acquires the position information of the region by tracing the extracted frame line.
When there are a plurality of directions in which the frame line is to be traced, the determining unit 202 determines the direction to be traced according to the trace traced so far.

ここで、領域は、文字領域、表領域、画像領域を含んでいる。
判別手段203は、文字領域もしくは表領域のみを枠線の色、太さにより判別する。
補完手段204は、枠線が他の枠線と重複し、かつ途切れている場合に、枠線を補完する。
(原稿を読み取って画像データを入力する)入力手段205は、図1のスキャナ部102に対応し、記憶手段206は、図1の外部記憶部103に対応する。
Here, the area includes a character area, a table area, and an image area.
The discriminating means 203 discriminates only the character area or the table area by the color and thickness of the frame line.
The complement means 204 complements the frame line when the frame line overlaps with another frame line and is interrupted.
The input unit 205 (reads a document and inputs image data) corresponds to the scanner unit 102 in FIG. 1, and the storage unit 206 corresponds to the external storage unit 103 in FIG.

制御手段220は、図1のCPU101に対応する。
表示手段207は、図1の表示部105に対応し、通信制御手段208は、図1の通信制御部108に対応する。
画像処理手段209は、図1の画像処理部107に対応し、情報格納手段210は、図1の領域情報格納部106に対応する。
The control means 220 corresponds to the CPU 101 in FIG.
The display unit 207 corresponds to the display unit 105 in FIG. 1, and the communication control unit 208 corresponds to the communication control unit 108 in FIG.
The image processing unit 209 corresponds to the image processing unit 107 in FIG. 1, and the information storage unit 210 corresponds to the area information storage unit 106 in FIG.

図5に例示した原稿画像には文字要素と、図形などの非文字と、表とから構成されているものとする。
この原稿画像でOCRソフトを用いて領域識別(レイアウト認識)を行うと、図6のような結果になる。枠線L1,L2,L4,L6(例えば青色線)が文字領域、枠線L3(例えば赤色線)が非文字領域、枠線L5(例えば緑色線)が表領域である。ただし、OCRソフトによっては枠線の色が変わることがあるが、ここではすべて前述通りの配色とする。図6にすべての枠線だけの画像を表示したものが図7である。
The document image illustrated in FIG. 5 includes character elements, non-characters such as graphics, and a table.
When region identification (layout recognition) is performed on this original image using OCR software, the result shown in FIG. 6 is obtained. Frame lines L1, L2, L4, and L6 (for example, blue lines) are character regions, frame line L3 (for example, red line) is a non-character region, and frame line L5 (for example, green line) is a table region. However, the color of the border may change depending on the OCR software. FIG. 7 shows an image of only all the frame lines in FIG.

図3は、本発明に係る画像解析装置に用いられる全体処理フローの一例である。
処理がスタートすると(ステップF201)、ステップF202の入力画像データSiでは、ファイル読み込み、スキャナによるスキャンデータ、ネットワーク経由などの入力手段によって得られたカラー画像の画像データをカラー画像データとして入力する。
ステップF203ではOCRソフトによって領域識別をした結果の領域枠線を描画した画像データを読み込む。
ステップF204において、Srからユーザが指定した特定色Vn(R,G,B)を抽出し、特定色だけの画像データSvを生成する。
特定色抽出処理は、特許文献2記載の方法で特定色を抽出する処理である。特定色(例えば青色の枠線L1,L2,L4,L6)だけの画像データの例示が図8である。
FIG. 3 is an example of an overall processing flow used in the image analysis apparatus according to the present invention.
When the process starts (step F201), the input image data Si in step F202 inputs color image image data obtained by input means such as file reading, scanner scan data, or via a network.
In step F203, the image data in which the area frame line as a result of area identification by the OCR software is drawn is read.
In step F204, the specific color Vn (R, G, B) designated by the user is extracted from Sr, and image data Sv of only the specific color is generated.
The specific color extraction process is a process of extracting a specific color by the method described in Patent Document 2. FIG. 8 shows an example of image data of only specific colors (for example, blue frame lines L1, L2, L4, and L6).

図4は、本発明に係る画像解析装置に用いられる特定色抽出処理フローの一例である。
特定色抽出処理については、図4の特定色抽出処理フローに沿って説明する。
まず、ユーザが特定色のカラーマップ値Vn(R,G,B)を決め、範囲内にあるすべての画素に対して特定色の有無を調べるループで処理する(ステップF302)。
特定色Vn(R,G,B)にSiの特定の座標値Si(X,Y)のカラーマップSi(R,G,B)を引いた値Vo(R,G,B)を求める(ステップF303)。
FIG. 4 is an example of a specific color extraction processing flow used in the image analysis apparatus according to the present invention.
The specific color extraction process will be described along the specific color extraction process flow of FIG.
First, the user determines a color map value Vn (R, G, B) for a specific color, and performs processing in a loop for checking the presence or absence of the specific color for all pixels within the range (step F302).
Determine the value Vo (R, G, B) by subtracting the color map Si (R, G, B) of the specific coordinate value Si (X, Y) of Si from the specific color Vn (R, G, B) (Step) F303).

ここで、ステップF303について補足する。
V1, Siの値を以下のように定め、
V1(255, 255, 255)
Si (128, 128, 128)
V1 − Si = Vo とすると、
次の数式(1)〜(3)でVoが求まる。
R : 255 − 128 =127 ・・・(1)
G : 255 − 128 =127 ・・・(2)
B : 255 − 128 =127 ・・・(3)
Here, it supplements about step F303.
Determine the values of V1, Si as follows:
V1 (255, 255, 255)
Si (128, 128, 128)
If V1 − Si = Vo,
Vo is obtained by the following mathematical formulas (1) to (3).
R: 255−128 = 127 (1)
G: 255 − 128 = 127 (2)
B: 255 − 128 = 127 (3)

よって、Vo(127, 127, 127) となる。
但し、特定色Vn(R,G,B)のn は序数である。
Therefore, Vo (127, 127, 127).
However, n of the specific color Vn (R, G, B) is an ordinal number.

Vo(R,G,B)とSr(R,G,B)とが一定の範囲内で一致するか否かの判定をする(ステップF304)。   It is determined whether Vo (R, G, B) and Sr (R, G, B) match within a certain range (step F304).

ここで、ステップF304について補足する。
ステップF304 は、色の誤差を吸収するための処理である。
判定例を以下に示す。
Vo(127, 127, 127)及び
Sr(128, 128,128)について判定する。
範囲の閾値を5としたとき、
Vo .Vo
-5 Sr +5
R : 122 ≦ 128 ≦ 132 となるので、一致した
G : 122 ≦ 128 ≦ 132 となるので、一致した
B : 122 ≦ 128 ≦ 132 となるので、一致した
最終判定 : 一致した
但し、「Vo」は負の閾値を示し、「.Vo」は正の閾値を示す。
Here, it supplements about step F304.
Step F304 is a process for absorbing a color error.
An example of determination is shown below.
Vo (127, 127, 127) and
Sr (128, 128, 128) is determined.
When the range threshold is 5,
Vo .Vo
-5 Sr +5
R: 122 ≤ 128 ≤ 132
G: 122 ≤ 128 ≤ 132
B: 122 ≤ 128 ≤ 132
Final judgment: Matched However, “Vo” indicates a negative threshold, and “.Vo” indicates a positive threshold.

また、これとは別に
Vo(125,100, 127)及び
Sr(128, 128, 128)について判定する。
範囲の閾値を5としたとき、
Vo .Vo
-5 Sr +5
R : 120 ≦ 128 ≦ 130 となるので、一致した
G : .95 ≦ 128 ≦ 105 となるので、一致せず(範囲外)
B : 122 ≦ 128 ≦ 132 となるので、一致した
最終判定 : 一致せず
Apart from this
Vo (125, 100, 127) and
Sr (128, 128, 128) is determined.
When the range threshold is 5,
Vo .Vo
-5 Sr +5
R: 120 ≤ 128 ≤ 130
G: .95 ≤ 128 ≤ 105, so they do not match (out of range)
B: 122 ≤ 128 ≤ 132
Final judgment: No match

範囲内で一致したものであれば、特定色だけの画像データSvの座標(X,Y)に当該画素で描画する(ステップF305)。
以上の処理で、特定色のみの画像データが出力される(ステップF306)。
If they match within the range, the pixel is drawn at the coordinates (X, Y) of the image data Sv of only a specific color (step F305).
With the above processing, image data of only a specific color is output (step F306).

図2に戻って、ステップF205において、特定色だけの画像データSvから線抽出処理で線を抽出する。線抽出処理には参考技術[特開2001−291097号公報参考]または、図4に示した方法を用いて、線を抽出することとする。
ステップF206では、抽出した線の太さBを算出する。
それぞれの線がX方向またはY方向が一致する線を取り出す(ステップF207)。
Returning to FIG. 2, in step F205, lines are extracted from the image data Sv of only a specific color by line extraction processing. In the line extraction process, lines are extracted using a reference technique [see Japanese Patent Application Laid-Open No. 2001-291097] or the method shown in FIG.
In step F206, the thickness B of the extracted line is calculated.
A line in which each line matches the X direction or the Y direction is extracted (step F207).

ここで、図12は、Y方向で一致した線を楕円(線1、線2)で囲んだものである。なお、楕円は説明の便宜からつけたものである。また、説明の便宜から、線1及び線2の太さをBとし、Y方向の基準線上では一致するものの、Y方向の基準線に平行な線上では一致していないものとする(基準線は説明の便宜上記載した線であり、実際の画像データに含まれない。)。
線1と線2との間隔が太さBと一致するか否かの判定を行う(ステップF208)。
線1と線2との間隔と太さBとが一致するのであれば(ステップF208/Yes)、線1と線2との間隔の画素を補完してつなぎ合わせて閉じた矩形になるようにする(ステップF209)。
これらの特徴を含むパターンを矩形パターンとする。この矩形パターンに一致するよう、画素の連結成分をトレースする。ここで、トレースとは、線(枠線)を構成する画素を順次追跡することをいう(図15)。トレースする順序は下方向、右方向、同時進行でもかまわない。
Here, FIG. 12 shows a line that coincides in the Y direction surrounded by an ellipse (line 1, line 2). The ellipse is added for convenience of explanation. Also, for convenience of explanation, it is assumed that the thickness of line 1 and line 2 is B and matches on the reference line in the Y direction but does not match on the line parallel to the reference line in the Y direction (the reference line is These lines are described for convenience of explanation and are not included in the actual image data.)
It is determined whether or not the distance between the line 1 and the line 2 matches the thickness B (step F208).
If the distance between line 1 and line 2 matches the thickness B (step F208 / Yes), the pixels in the distance between line 1 and line 2 are complemented and joined to form a closed rectangle. (Step F209).
A pattern including these features is a rectangular pattern. The connected components of the pixels are traced so as to match this rectangular pattern. Here, tracing means sequentially tracking pixels constituting a line (frame line) (FIG. 15). The order of tracing may be downward, rightward, or simultaneous progress.

図16でトレース対象の画素(■)が交差点(◆)に到達したとき、直前の画素(■)の向きから、トレースする方向を決定していく。図16の場合、直前の画素(■)のトレースは右方向であるため、トレース対象の画素(□)の次は右方向へトレースすることになる。
以上の一連のトレース処理(ステップF210)を経て、矩形領域であるか否かの判定を行う(ステップF211)。
矩形領域の判定処理には、頂点の形状が図14(a)〜(d)のすべてに一致しており、かつ前述したトレースの結果閉じた矩形であること、をすべて満たしていれば、矩形領域として判断する。つまり、(枠)線が欠けている部分は、他の(枠)線により分断されていないのに欠けている部分は補完すべきでない、と判断することになる。したがって、図12に示すような、Y方向の基準線上では線1及び線2が一致するものの、Y方向の基準線に平行な線(右側の線)上では線1及び線2が一致しないので、閉じた矩形となるような補完はおこなわない。
矩形領域として判断した枠線に対して、座標データの算出を行う(ステップF212)。座標データの算出には、参考技術[特許文献1]に開示された矩形抽出処理で座標データを抽出することとする。
In FIG. 16, when the trace target pixel (■) reaches the intersection (♦), the tracing direction is determined from the direction of the immediately preceding pixel (■). In the case of FIG. 16, since the trace of the immediately preceding pixel (■) is in the right direction, the trace is performed in the right direction after the pixel (□) to be traced.
After the series of trace processes (step F210), it is determined whether or not the area is a rectangular area (step F211).
In the rectangular area determination processing, if the shape of the vertex matches all of FIGS. 14A to 14D and the above-described trace closed rectangle is satisfied, the rectangle is satisfied. Judge as a region. That is, it is determined that a portion lacking a (frame) line should not be complemented with a portion that is not divided by another (frame) line. Therefore, as shown in FIG. 12, line 1 and line 2 match on the reference line in the Y direction, but line 1 and line 2 do not match on the line parallel to the reference line in the Y direction (right side line). , It doesn't do the completion which becomes a closed rectangle.
Coordinate data is calculated for the frame line determined as a rectangular area (step F212). For the calculation of the coordinate data, the coordinate data is extracted by the rectangle extraction process disclosed in the reference technique [Patent Document 1].

座標データについては、原稿画像データの左上を原点(0,0)とし、領域1の座標データは(Xs,Ys,Xe,Ye)から構成される(図17)。
以上の処理を行うことで、枠線の座標値を取り出すことができる。
As for the coordinate data, the upper left corner of the document image data is the origin (0, 0), and the coordinate data of area 1 is composed of (Xs, Ys, Xe, Ye) (FIG. 17).
By performing the above processing, the coordinate value of the frame line can be extracted.

<プログラム及び記憶媒体>
以上で説明した本発明にかかる画像解析装置は、コンピュータで画像解析処理を実行させるプログラムによって実現されている。コンピュータとしては、例えばパーソナルコンピュータやワークステーションなどの汎用的なものが挙げられるが、本発明はこれに限定されるものではない。よって、一例として、プログラムにより本発明を実現する場合の説明を以下で行う。
<Program and storage medium>
The image analysis apparatus according to the present invention described above is realized by a program that causes a computer to execute image analysis processing. Examples of the computer include general-purpose computers such as personal computers and workstations, but the present invention is not limited to this. Therefore, as an example, a case where the present invention is realized by a program will be described below.

画像データに含まれる領域の位置情報を取得するためのプログラムであって、
コンピュータに、
(1)画像データから所定の領域の枠線を抽出する手順、
(2)抽出された枠線をトレースすることにより、領域の位置情報を取得する手順、
(3)枠線をトレースすべき方向が複数方向存在する場合、それまでトレースした軌跡に応じて辿る方向を決定する手順、
を実行させるプログラムが挙げられる。
A program for acquiring position information of an area included in image data,
On the computer,
(1) A procedure for extracting a border of a predetermined area from image data,
(2) Procedure for obtaining position information of an area by tracing the extracted frame line,
(3) When there are multiple directions in which the frame line should be traced, a procedure for determining the direction to be traced according to the trajectory traced so far,
The program which performs is mentioned.

また、上記構成に加え、
領域は、文字領域、表領域、及び画像領域を含み、コンピュータに、
(4)文字領域もしくは表領域のみを枠線の色、太さ、位置により判別する手順を実行させるプログラムであってもよい。
In addition to the above configuration,
The area includes a character area, a table area, and an image area.
(4) A program that executes a procedure for discriminating only a character area or a table area based on the color, thickness, and position of a frame line may be used.

さらに、上記構成に加え、コンピュータに、
(5)枠線が他の枠線と重複し、かつ途切れている場合に補完する手順を実行させるプログラムであってもよい。
In addition to the above configuration,
(5) A program that executes a procedure for complementing when a frame line overlaps with another frame line and is interrupted.

これにより、プログラムが実行可能なコンピュータ環境さえあれば、どこにおいても本発明にかかる画像解析装置を実現することができる。   Thus, the image analysis apparatus according to the present invention can be realized anywhere as long as there is a computer environment capable of executing the program.

このようなプログラムは、コンピュータに読み取り可能な記憶媒体に記憶されていてもよい。
ここで、記憶媒体としては、例えば、CD−ROM(Compact Disc Read Only Memory)、フレキシブルディスク(FD)、CD−R(CD Recordable)、DVD(Digital Versatile Disk)などのコンピュータで読み取り可能な記憶媒体、フラッシュメモリ、RAM(Random Access Memory)、ROM(Read Only Memory)、FeRAM(強誘電体メモリ)等の半導体メモリやHDD(Hard Disc Drive)が挙げられる。
Such a program may be stored in a computer-readable storage medium.
Here, examples of the storage medium include a computer-readable storage medium such as a CD-ROM (Compact Disc Read Only Memory), a flexible disk (FD), a CD-R (CD Recordable), and a DVD (Digital Versatile Disk). , Flash memory, RAM (Random Access Memory), ROM (Read Only Memory), semiconductor memory such as FeRAM (ferroelectric memory), and HDD (Hard Disc Drive).

なお、上述した実施の形態は、本発明の好適な実施の形態の一例を示すものであり、本発明はそれに限定されることなく、その要旨を逸脱しない範囲内において、種々変形実施   The above-described embodiment shows an example of a preferred embodiment of the present invention, and the present invention is not limited thereto, and various modifications may be made without departing from the scope of the invention.

101 CPU
102 スキャナ部
103 外部記憶部
104 入力画像メモリ部
105 表示部
106 領域情報格納部
107 画像処理部
108 通信制御部
109 ネットワーク
110 CD/DVD
111 ハードディスク
101 CPU
102 Scanner Unit 103 External Storage Unit 104 Input Image Memory Unit 105 Display Unit 106 Area Information Storage Unit 107 Image Processing Unit 108 Communication Control Unit 109 Network 110 CD / DVD
111 hard disk

特許第2948840号公報Japanese Patent No. 2948840 特開2003−295847号公報JP 2003-295847 A

Claims (6)

カラー原稿に含まれる領域の位置情報を取得する画像解析装置であって、
前記カラー原稿に含まれる領域は、領域の属性に応じた枠線により他の領域と区別されて表現されており、
前記カラー原稿を読み取ることにより生成された画像データを入力する入力手段と、
入力された前記画像データから所定の枠線を抽出する抽出手段と、
抽出された前記枠線をトレースすることにより、前記領域の位置情報を取得する取得手段とを備え、
前記取得手段は、前記枠線をトレースすべき方向が複数方向存在する場合、それまでトレースした軌跡に応じてトレースすべき方向を決定する決定手段を備えたことを特徴とする画像解析装置。
An image analysis apparatus for acquiring position information of an area included in a color document,
The area included in the color document is expressed separately from other areas by a frame line according to the attribute of the area,
Input means for inputting image data generated by reading the color original;
Extracting means for extracting a predetermined frame line from the input image data;
Obtaining the position information of the region by tracing the extracted frame line, and
The image analysis apparatus according to claim 1, wherein the acquisition unit includes a determination unit that determines a direction to be traced according to a trajectory traced so far when there are a plurality of directions in which the frame line is to be traced.
前記領域は、文字領域、表領域、及び画像領域を含み、
前記入力手段で入力された文字領域もしくは前記表領域のみを前記抽出手段で抽出された枠線の色、太さ、及び前記取得手段で取得した位置情報により判別する判別手段を備えたことを特徴とする請求項1記載の画像解析装置。
The region includes a character region, a table region, and an image region,
And a discriminating unit that discriminates only the character region or the table region input by the input unit based on the color and thickness of the frame line extracted by the extracting unit and the position information acquired by the acquiring unit. The image analysis apparatus according to claim 1.
前記枠線が他の枠線と重複し、かつ途切れている場合に、前記枠線を補完する補完手段を備えたことを特徴とする請求項2記載の画像解析装置。   The image analysis apparatus according to claim 2, further comprising a complementing unit that complements the frame line when the frame line overlaps with another frame line and is interrupted. 画像データに含まれる領域の位置情報を取得するためのプログラムであって、
コンピュータに、
前記画像データから所定の領域の枠線を抽出する手順、
抽出された前記枠線をトレースすることにより、前記領域の位置情報を取得する手順、
前記枠線をトレースすべき方向が複数方向存在する場合、それまでトレースした軌跡に応じてトレースする方向を決定する手順、
を実行させることを特徴とするプログラム。
A program for acquiring position information of an area included in image data,
On the computer,
A procedure for extracting a border of a predetermined area from the image data;
A procedure for obtaining position information of the region by tracing the extracted frame line,
A procedure for determining a direction to be traced according to a trajectory traced so far when there are a plurality of directions in which the frame line should be traced;
A program characterized by having executed.
前記領域は、文字領域、表領域、及び画像領域を含み、前記コンピュータに、前記文字領域もしくは前記表領域のみを前記枠線の色、太さ、位置により判別する手順を実行させることを特徴とする請求項4記載のプログラム。   The area includes a character area, a table area, and an image area, and causes the computer to execute a procedure for determining only the character area or the table area based on a color, a thickness, and a position of the frame line. The program according to claim 4. 前記コンピュータに、前記枠線が他の枠線と重複し、かつ途切れている場合に補完する手順を実行させることを特徴とする請求項5記載のプログラム。   6. The program according to claim 5, wherein the program causes the computer to execute a complementing procedure when the frame line overlaps with another frame line and is interrupted.
JP2009019060A 2009-01-30 2009-01-30 Image analysis device and program Withdrawn JP2010178105A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009019060A JP2010178105A (en) 2009-01-30 2009-01-30 Image analysis device and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009019060A JP2010178105A (en) 2009-01-30 2009-01-30 Image analysis device and program

Publications (1)

Publication Number Publication Date
JP2010178105A true JP2010178105A (en) 2010-08-12

Family

ID=42708603

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009019060A Withdrawn JP2010178105A (en) 2009-01-30 2009-01-30 Image analysis device and program

Country Status (1)

Country Link
JP (1) JP2010178105A (en)

Similar Documents

Publication Publication Date Title
JP4824987B2 (en) Pattern matching apparatus and semiconductor inspection system using the same
US8000529B2 (en) System and method for creating an editable template from a document image
US8548253B2 (en) Fast line linking
JP2012203458A (en) Image processor and program
JP2007279828A (en) Business form processor, business form format preparation device, business form, program for processing business form and program for preparing business form format
JP2006066478A (en) Pattern matching device and scanning electron microscope employing it
JP2007148677A (en) Image processor and image processing method
JP2009211626A (en) Image processing device and method
CN112800824B (en) Method, device, equipment and storage medium for processing scanned file
US8254693B2 (en) Image processing apparatus, image processing method and program
JP2006323779A (en) Image processing method and device
JP5684550B2 (en) Pattern matching apparatus and semiconductor inspection system using the same
JP2010102396A (en) Person detection device, person detection method, and program
US20220172334A1 (en) Image inspection apparatus and non-transitory computer readable medium storing image inspection program
JP2010178105A (en) Image analysis device and program
US8990681B2 (en) Method for aligning a modified document and an original document for comparison and difference highlighting
JP2009025856A (en) Document discrimination program and document discrimination device
KR102102394B1 (en) Method and apparatus for preprocessing image for recognition of character
JP2023533297A (en) Segmentation of consecutive dynamic scans
CN114202665A (en) Image similarity determining method and device, equipment and storage medium
JP2008269131A (en) Image processor and image processing program
AU2014277851A1 (en) Detecting a gap between text columns from text line fragments
JP3947173B2 (en) Table image processing apparatus, program recording medium, and table image processing method
US9269031B2 (en) Method of detecting regions in an edge-based representation
CN113378595B (en) Two-dimensional code positioning method, device, equipment and storage medium

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20120403