JP7425288B2 - Information processing device, information processing method, program - Google Patents

Information processing device, information processing method, program Download PDF

Info

Publication number
JP7425288B2
JP7425288B2 JP2019226062A JP2019226062A JP7425288B2 JP 7425288 B2 JP7425288 B2 JP 7425288B2 JP 2019226062 A JP2019226062 A JP 2019226062A JP 2019226062 A JP2019226062 A JP 2019226062A JP 7425288 B2 JP7425288 B2 JP 7425288B2
Authority
JP
Japan
Prior art keywords
specified
information processing
specifying
ruled line
intersection
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.)
Active
Application number
JP2019226062A
Other languages
Japanese (ja)
Other versions
JP2021096543A (en
JP2021096543A5 (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.)
Canon Marketing Japan Inc
Canon IT Solutions Inc
Original Assignee
Canon Marketing Japan Inc
Canon IT Solutions Inc
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 Canon Marketing Japan Inc, Canon IT Solutions Inc filed Critical Canon Marketing Japan Inc
Priority to JP2019226062A priority Critical patent/JP7425288B2/en
Publication of JP2021096543A publication Critical patent/JP2021096543A/en
Publication of JP2021096543A5 publication Critical patent/JP2021096543A5/ja
Priority to JP2024005335A priority patent/JP2024038417A/en
Application granted granted Critical
Publication of JP7425288B2 publication Critical patent/JP7425288B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、情報処理装置、情報処理方法、プログラムに関する。 The present invention relates to an information processing device, an information processing method, and a program.

印刷された帳票から情報を読み取ってシステムに入力する業務を補助するものとしてOCR(光学文字認識)が存在する。帳票をOCR処理する場合、自社が発行した帳票を回収して記入内容を読み取るようなケースでは定型帳票として扱うことができ、所定の座標の矩形を抽出することで目的の情報を読み取ることも容易である。しかし、請求書など不特定多数の発行元から送られてくる帳票はどこにどういう情報が記入されているか事前に特定することができず、帳票を受領してから都度その帳票のレイアウトを解析して情報抽出を行う必要がある。このような帳票は一般に非定型帳票と呼ばれる。 OCR (optical character recognition) exists as a tool that assists in the task of reading information from printed forms and inputting it into a system. When performing OCR processing on a form, it can be treated as a standard form in cases where the form issued by the company is collected and the contents are read, and it is also easy to read the desired information by extracting a rectangle with predetermined coordinates. It is. However, when it comes to invoices and other forms sent from a large number of unspecified issuers, it is not possible to determine in advance what information is entered where, and the layout of the form must be analyzed each time the form is received. It is necessary to perform information extraction. Such forms are generally called non-standard forms.

現実の業務においては非定型帳票を扱うケースはいまだ多く、非定型帳票の解析精度向上がデータ入力業務の生産性を大きく左右する。 In actual business, there are still many cases in which non-routine forms are handled, and improving the accuracy of analyzing non-routine forms has a major impact on the productivity of data entry operations.

特に日本の帳票においては罫線を用いた表が多用され、帳票画像から表領域の抽出及びその中身であるセルの抽出を精度良く行うことが望まれる。 Particularly in Japanese forms, tables with ruled lines are often used, and it is desirable to extract the table area from the form image and the cells that are the contents thereof with high accuracy.

罫線に着目して帳票から表を抽出する手法は古くから存在しているが、スキャン時に発生する傾きや線の歪み、FAXなど低解像度な二値画像への変換によって発生する線のカスレや途切れに対していかに頑健とするかが課題となっている。 Methods for extracting tables from forms by focusing on ruled lines have been around for a long time, but there are problems with tilts and line distortions that occur during scanning, as well as blurred lines and breaks that occur due to conversion to low-resolution binary images such as when faxing. The challenge is how to make it robust.

特開特開平11-53466号公報Unexamined Japanese Patent Publication No. 11-53466

特許文献1には、罫線に途切れが発生した場合でも表を抽出するための方法について記載されている。 Patent Document 1 describes a method for extracting a table even when a break occurs in the ruled lines.

しかし、罫線の検出を、ラン(一定以上の長さで連続する画素)を基準にして行っており、カスレにより線が細かく断片化したような状況に弱いという課題がある。 However, since ruled lines are detected based on runs (pixels that are continuous over a certain length), this method is vulnerable to situations where lines become finely fragmented due to scratches.

また、特に日本の請求書のような数量、金額の合計と明細が表記される表においては、個別の項目が記載された明細表と合計金額などが記載された小計表が接した状態でレイアウトされる場合が多く、データの認識処理のためにはこうした明細表と小計表を分離して認識できることが望まれる。 In addition, especially in tables such as Japanese invoices that display the total amount and details of quantities and amounts, the layout is such that the detail table with individual items and the subtotal table with the total amount are in contact with each other. In many cases, it is desirable to be able to separate and recognize such detailed tables and subtotals for data recognition processing.

そこで、本発明は、スキャン時にカスレやゆがみが発生した帳票画像に対しても精度よく表やセルを抽出することができる仕組みを提供することを目的とする。また複数の表が罫線を共有して接しているような場合にも、それぞれ別の表として認識できる仕組みを提供することを目的とする。 SUMMARY OF THE INVENTION Therefore, an object of the present invention is to provide a mechanism that can accurately extract tables and cells even from a form image that is blurred or distorted during scanning. Another object of the present invention is to provide a mechanism that allows each table to be recognized as a separate table even when multiple tables share a border and are adjacent to each other.

本発明の情報処理装置は、画像中から表の罫線の候補となる垂直または水平となる直線を検出する直線検出部と、直線候補同士の各交点についてその座標付近の罫線の形状を評価する交点評価部と、交点の評価結果から表の領域を推定する表抽部と、表内部の領域をセルに分解するセル抽出部とを有することを特徴とする。 The information processing device of the present invention includes a straight line detection unit that detects a vertical or horizontal straight line that is a candidate for a ruled line of a table from an image, and an intersection point that evaluates the shape of a ruled line near the coordinates of each intersection point between straight line candidates. The present invention is characterized by having an evaluation section, a table extraction section that estimates the area of the table from the evaluation results of the intersection points, and a cell extraction section that breaks down the area inside the table into cells.

本発明によれば、スキャン時にカスレやゆがみが発生した帳票画像に対しても精度よく表やセルを抽出することが可能となる。また、複数の表が罫線を共有して接しているような場合にも、それぞれ別の表として認識することが可能となる。 According to the present invention, it is possible to accurately extract tables and cells even from a form image that is blurred or distorted during scanning. Furthermore, even when multiple tables share a ruled line and are adjacent to each other, they can be recognized as separate tables.

本発明の実施形態における、表抽出システムのシステム構成の一例を示す図である。1 is a diagram showing an example of a system configuration of a table extraction system in an embodiment of the present invention. 本発明の実施形態における、PCのハードウェア構成の一例を示すブロック図である。FIG. 2 is a block diagram showing an example of the hardware configuration of a PC in an embodiment of the present invention. 本発明の実施形態における、帳票画像から表及びセルを抽出する処理を示すフローチャートである。7 is a flowchart showing a process of extracting tables and cells from a form image in an embodiment of the present invention. 本発明の実施形態における、表領域抽出処理の詳細を示すフローチャートである。FIG. 2 is a flowchart showing details of tablespace extraction processing in an embodiment of the present invention. FIG. 本発明の実施形態における、表領域抽出処理の詳細を示すフローチャートである。FIG. 2 is a flowchart showing details of tablespace extraction processing in an embodiment of the present invention. FIG. 本発明の実施形態における、帳票画像から文字を除去する過程を示す図である。FIG. 3 is a diagram showing a process of removing characters from a form image in an embodiment of the present invention. 本発明の実施形態における、表抽出処理の対象とする帳票の一例を示す図である。FIG. 3 is a diagram illustrating an example of a form to be subjected to table extraction processing in an embodiment of the present invention. 本発明の実施形態における、帳票画像からHough変換により直線を検出した状態を示す図である。FIG. 3 is a diagram showing a state in which straight lines are detected from a form image by Hough transformation in an embodiment of the present invention. 本発明の実施形態における、交点評価部が交点の状態を評価する過程を示す図である。It is a figure which shows the process by which an intersection evaluation part evaluates the state of an intersection in embodiment of this invention. 本発明の実施形態における、表領域抽出処理の一例を示す図である。FIG. 3 is a diagram illustrating an example of tablespace extraction processing in the embodiment of the present invention. 本発明の実施形態における、明細表に接した小計表の検出を行う例を示す図である。FIG. 3 is a diagram illustrating an example of detecting a subtotal table adjacent to a detailed table according to an embodiment of the present invention. 本発明の実施形態における、セル領域抽出処理の一例を示す図である。It is a figure showing an example of cell area extraction processing in an embodiment of the present invention. 本発明の実施形態における、セル領域抽出処理の詳細を示すフローチャートである。It is a flowchart showing details of cell area extraction processing in an embodiment of the present invention.

以下、図面を参照して、本発明の実施形態を詳細に説明する。 Embodiments of the present invention will be described in detail below with reference to the drawings.

図1は、本発明における情報処理システムの構成の一例を示す図である。 FIG. 1 is a diagram showing an example of the configuration of an information processing system according to the present invention.

図1に示す通り、表抽出などの処理を実行する情報処理装置101、帳票をスキャンして画像ファイル化するスキャナ102が通信経路を介して接続される構成となっている。 As shown in FIG. 1, an information processing apparatus 101 that performs processing such as table extraction and a scanner 102 that scans a form and converts it into an image file are connected via a communication path.

通信経路はスキャナ102の有する物理インターフェースに応じて、有線LAN,無線LAN,USBなどの形態をとることができる。 The communication path can take the form of a wired LAN, wireless LAN, USB, etc., depending on the physical interface that the scanner 102 has.

また、通信経路上にはファイルサーバ103を置いてもよい。スキャナ102でスキャンした画像を情報処理装置101に取り込む方法として、スキャナ102から情報処理装置101に直接画像を送信する方法、スキャナ102で取り込んだ画像ファイルをいったんファイルサーバ103に保管し、情報処理装置101がファイルサーバ103から画像ファイルを取り出す方法などがあるが、いずれの方法をとっても良い。 Further, a file server 103 may be placed on the communication path. As a method for importing an image scanned by the scanner 102 into the information processing apparatus 101, there is a method in which the image is directly transmitted from the scanner 102 to the information processing apparatus 101, and a method in which the image file retrieved by the scanner 102 is temporarily stored in the file server 103, and then the image file is stored in the information processing apparatus 101. There is a method in which the image file 101 is retrieved from the file server 103, and any method may be used.

図2は、本発明の情報処理装置101、スキャナ102、ファイルサーバ103のハードウェア構成の一例を示すブロック図である。 FIG. 2 is a block diagram showing an example of the hardware configuration of the information processing device 101, scanner 102, and file server 103 of the present invention.

図2に示すように、情報処理装置101等は、システムバス204を介してCPU(Central Processing Unit)201、ROM(Read Only Memory)202、RAM(Random Access Memory)203、入力コントローラ205、ビデオコントローラ206、メモリコントローラ207、よび通信I/Fコントローラ208が接続される。 As shown in FIG. 2, the information processing device 101 and the like are connected via a system bus 204 to a CPU (Central Processing Unit) 201, a ROM (Read Only Memory) 202, a RAM (Random Access Memory) 203, an input controller 205, and a video controller. 206, memory controller 207, and communication I/F controller 208 are connected.

CPU201は、システムバス204に接続される各デバイスやコントローラを統括的に制御する。 The CPU 201 centrally controls each device and controller connected to the system bus 204.

ROM202あるいは外部メモリ211は、CPU201が実行する制御プログラムであるBIOS(Basic Input/Output System)やOS(Operating System)や、本情報処理方法を実現するためのコンピュータ読み取り実行可能なプログラムおよび必要な各種データ(データテーブルを含む)を保持している。 The ROM 202 or external memory 211 stores a BIOS (Basic Input/Output System) and an OS (Operating System), which are control programs executed by the CPU 201, as well as computer-readable and executable programs and various necessary programs for realizing this information processing method. Holds data (including data tables).

RAM203は、CPU201の主メモリ、ワークエリア等として機能する。CPU201は、処理の実行に際して必要なプログラム等をROM202あるいは外部メモリ211からRAM203にロードし、ロードしたプログラムを実行することで各種動作を実現する。 The RAM 203 functions as the main memory, work area, etc. of the CPU 201. The CPU 201 loads necessary programs and the like from the ROM 202 or the external memory 211 into the RAM 203 when executing processing, and executes the loaded programs to realize various operations.

入力コントローラ205は、キーボード209や不図示のマウス等のポインティングデバイス等の入力装置からの入力を制御する。入力装置がタッチパネルの場合、ユーザがタッチパネルに表示されたアイコンやカーソルやボタンに合わせて押下(指等でタッチ)することにより、各種の指示を行うことができることとする。 The input controller 205 controls input from input devices such as a keyboard 209 and a pointing device such as a mouse (not shown). If the input device is a touch panel, the user can issue various instructions by pressing (touching with a finger or the like) an icon, cursor, or button displayed on the touch panel.

また、タッチパネルは、マルチタッチスクリーンなどの、複数の指でタッチされた位置を検出することが可能なタッチパネルであってもよい。 Further, the touch panel may be a touch panel capable of detecting positions touched by multiple fingers, such as a multi-touch screen.

ビデオコントローラ206は、ディスプレイ210などの外部出力装置への表示を制御する。ディスプレイは本体と一体になったノート型パソコンのディスプレイも含まれるものとする。なお、外部出力装置はディスプレイに限ったものははく、例えばプロジェクタであってもよい。また、前述のタッチ操作を受け付け可能な装置については、入力装置も提供する。 Video controller 206 controls display on an external output device such as display 210. The display shall also include the display of a notebook computer that is integrated with the main body. Note that the external output device is not limited to a display, but may be a projector, for example. Furthermore, an input device is also provided for the device capable of accepting the above-mentioned touch operation.

なおビデオコントローラ206は、表示制御を行うためのビデオメモリ(VRAM)を制御することが可能で、ビデオメモリ領域としてRAM203の一部を利用することもできるし、別途専用のビデオメモリを設けることも可能である。 Note that the video controller 206 can control a video memory (VRAM) for display control, and can use part of the RAM 203 as a video memory area, or can provide a separate dedicated video memory. It is possible.

メモリコントローラ207は、外部メモリ211へのアクセスを制御する。外部メモリとしては、ブートプログラム、各種アプリケーション、フォントデータ、ユーザファイル、編集ファイル、および各種データ等を記憶する外部記憶装置(ハードディスク)、フレキシブルディスク(FD)、或いはPCMCIAカードスロットにアダプタを介して接続されるコンパクトフラッシュ(登録商標)メモリ等を利用可能である。 Memory controller 207 controls access to external memory 211. External memory can be an external storage device (hard disk) that stores boot programs, various applications, font data, user files, editing files, various data, etc., a flexible disk (FD), or a PCMCIA card slot connected via an adapter. Compact flash (registered trademark) memory and the like can be used.

通信I/Fコントローラ209は、ネットワークを介して外部機器と接続・通信するものであり、ネットワークでの通信制御処理を実行する。例えば、TCP/IPを用いた通信やISDNなどの電話回線、および携帯電話の3G回線を用いた通信が可能である。 The communication I/F controller 209 connects and communicates with external devices via a network, and executes communication control processing on the network. For example, communication using TCP/IP, a telephone line such as ISDN, and a 3G line of a mobile phone is possible.

尚、CPU201は、例えばRAM203内の表示情報用領域へアウトラインフォントの展開(ラスタライズ)処理を実行することにより、ディスプレイ210上での表示を可能としている。また、CPU201は、ディスプレイ210上の不図示のマウスカーソル等でのユーザ指示を可能とする。 Note that the CPU 201 enables display on the display 210 by, for example, executing an outline font development (rasterization) process in a display information area in the RAM 203. Further, the CPU 201 allows the user to give instructions using a mouse cursor (not shown) on the display 210.

次に図3のフローチャートを用いて、本発明の実施形態における情報処理装置101が実行する表抽出処理について説明する。 Next, table extraction processing executed by the information processing apparatus 101 according to the embodiment of the present invention will be described using the flowchart in FIG. 3.

図3のフローチャートは、情報処理装置101のCPU201が所定の制御プログラムを読み出して実行する処理であり、帳票画像から表及びセルを抽出する処理を示すフローチャートである。 The flowchart in FIG. 3 is a process in which the CPU 201 of the information processing apparatus 101 reads and executes a predetermined control program, and is a flowchart showing a process to extract tables and cells from a form image.

ステップS301では、帳票画像の入力を受け付け、当該帳票画像から表領域を抽出する指示を受け付ける。帳票画像は、スキャナ102によってスキャンされた画像であり、ファイルサーバ103に一度記憶されたものを取得しても良いし、スキャナ102から直接取得しても良い。 In step S301, input of a form image is accepted, and an instruction to extract a table area from the form image is accepted. The form image is an image scanned by the scanner 102, and may be acquired once stored in the file server 103, or may be acquired directly from the scanner 102.

ステップS302では、表領域の抽出処理の前処理として、スキャン時に発生した傾きを補正する処理(斜行補正)を実行する。斜行補正は公知の技術を用いて行うものとするが、一例としてはHough変換を用いた補正が知られている。具体的には、Hough変換により直線を検出し、検出された直線から水平方向の直線を選別する。そして、水平方向の直線の平均角度を取得し、取得した平均角度に基づき、画像全体を回転させることで、補正を行う。
ステップS303では、帳票画像に含まれる文字を除去する。文字を除去する処理については、図6を用いて説明する。
In step S302, as pre-processing for table area extraction processing, processing for correcting the skew that occurs during scanning (skew correction) is executed. The skew correction is performed using a known technique, and one known example is correction using Hough transformation. Specifically, straight lines are detected by Hough transformation, and horizontal straight lines are selected from the detected straight lines. Then, correction is performed by obtaining the average angle of the straight line in the horizontal direction and rotating the entire image based on the obtained average angle.
In step S303, characters included in the form image are removed. The process of removing characters will be explained using FIG. 6.

図6は、帳票画像から文字を除去する過程を示したものである。 FIG. 6 shows the process of removing characters from a form image.

図6の601は、ステップS301で取得し、ステップS302で斜行補正を実行した帳票画像の一例である。 601 in FIG. 6 is an example of a form image acquired in step S301 and subjected to skew correction in step S302.

図6の602は、601の帳票画像を二値化して反転したのちに、横方向にMorphology演算をかけたものを示している。Morphology演算を行うことで、一定以上の長さに達していない線分を除去することができる。すなわち、罫線のように一定以上の長さの線分のみが残り、文字を構成する線分のように一定以上の長さに満たない線分は除去される結果、文字が除去され罫線のみが残ることとなる。なお、除去する線分の長さの閾値を大きくしすぎると本来の罫線まで除去してしまう恐れがあるため、除去する線分の長さの閾値は、文字のサイズよりわずかに大きい程度に設定しておくのが望ましい。 602 in FIG. 6 shows the form image 601 that has been binarized and inverted, and then subjected to Morphology calculations in the horizontal direction. By performing Morphology calculation, line segments that do not reach a certain length can be removed. In other words, only line segments that are longer than a certain length, such as ruled lines, remain, and line segments that are less than a certain length, such as line segments that make up characters, are removed. As a result, the characters are removed and only the ruled lines remain. It will remain. Note that if the threshold for the length of the line segment to be removed is set too large, there is a risk that the original ruled line will also be removed, so the threshold for the length of the line segment to be removed is set to be slightly larger than the character size. It is desirable to keep it.

図6の603は、601の帳票画像を二値化して反転したのちに、縦方向にMorphology演算をかけたものを示している。 603 in FIG. 6 shows the form image 601 that has been binarized and inverted, and then subjected to Morphology calculation in the vertical direction.

図6の604は、処理画像602と処理画像603の和をとったものである。ステップS304以降の処理は、図6の604の処理画像に対して実行する処理である。 604 in FIG. 6 is the sum of the processed image 602 and the processed image 603. The processes after step S304 are processes executed on the processed image 604 in FIG.

ステップS304では、図6の604の処理画像から、罫線の候補となる水平、垂直の方向を持つ直線を検出する。なお、ここで検出されるのは始点・終点の定まった線分ではなく、直線である。 In step S304, straight lines having horizontal and vertical directions that are candidates for ruled lines are detected from the processed image 604 in FIG. Note that what is detected here is not a line segment with fixed starting and ending points, but a straight line.

直線の検出にはHough変換を用いる。Hough変換を用いた直線検出によれば、同一直線上に一定数以上の画素が存在すれば、それらが連続していなくても直線として検出される。これにより、スキャン時にカスレが発生した場合や、ステップS303において罫線の一部が欠けた場合でも頑健に直線を検出することが可能となる。 Hough transformation is used to detect straight lines. According to straight line detection using Hough transformation, if a certain number or more of pixels exist on the same straight line, they are detected as a straight line even if they are not continuous. This makes it possible to robustly detect straight lines even if scratches occur during scanning or if part of the ruled line is missing in step S303.

例えば、図7の701に示す帳票画像に対して、ステップS302~S304の処理を実行すると、図8のような結果が得られる。 For example, when the processes of steps S302 to S304 are executed on the form image 701 in FIG. 7, results as shown in FIG. 8 are obtained.

図8は、ステップS303の処理によって文字が除去された処理画像に対して、Hough変換によって直線を検出した図である。図8の例では、垂直直線v8001~v8007、水平直線h8001~h8007が検出されている。 FIG. 8 is a diagram in which straight lines are detected by Hough transformation in the processed image from which characters have been removed by the process of step S303. In the example of FIG. 8, vertical straight lines v8001 to v8007 and horizontal straight lines h8001 to h8007 are detected.

本実施例においては、これらの垂直直線と水平直線からなるグリッドを罫線候補グリッド802として説明する。 In this embodiment, a grid made up of these vertical straight lines and horizontal straight lines will be described as a ruled line candidate grid 802.

なお、本実施例においては上述の通り黒地に白の罫線となるが、ここでは便宜上、白地に黒の罫線とした図で説明する。 Note that in this embodiment, as described above, the ruled lines are white on a black background, but for convenience, the drawing will be explained using black ruled lines on a white background.

ステップS305では、罫線候補グリッド802上の各交点(すなわち、垂直直線と水平直線との交点)に対して、交点の状態の評価を行う。交点状態の評価の詳細は、図9を用いて説明する。 In step S305, the state of the intersection is evaluated for each intersection on the ruled line candidate grid 802 (that is, the intersection of a vertical straight line and a horizontal straight line). Details of the evaluation of the intersection state will be explained using FIG. 9.

なお、ステップS304においてHough変換を用いた直線検出処理を行っているが、Hough変換により検出される直線は、角度と原点からの距離の2つのパラメータで表現される情報であり、始点と終点の情報は持たない直線となる。そのため、罫線候補グリッド802は矩形状の格子を形成しているものの、罫線候補グリッド上のどの範囲に実際の線分が存在しているかを判断するためには、罫線候補グリッドにより形成される各交点について評価する必要がある。 Note that although straight line detection processing using Hough transformation is performed in step S304, the straight line detected by Hough transformation is information expressed by two parameters: angle and distance from the origin, and the straight line detected by Hough transformation is information expressed by two parameters: angle and distance from the origin. It becomes a straight line with no information. Therefore, although the ruled line candidate grid 802 forms a rectangular grid, each line formed by the ruled line candidate grid must be It is necessary to evaluate the intersection points.

図9は交点評価の詳細を説明するための図である。 FIG. 9 is a diagram for explaining details of intersection evaluation.

図9の左側の801で示すものは、図8を拡大した図である。図9の右側の901で示すものは、801におけるC901の破線で示した領域に対応する処理画像である。 What is indicated by 801 on the left side of FIG. 9 is an enlarged view of FIG. What is shown by 901 on the right side of FIG. 9 is a processed image corresponding to the area shown by the broken line of C901 in 801.

なお、C901の領域のサイズは、罫線候補グリッド802における上下、左右の交点と干渉しない範囲でできるだけ大きく切り取れるよう、動的にサイズを決定するものとする。これは、斜行補正を行っても画像そのものに歪みが残っている場合があり、Hough変換によって検出された直線と実際の画素の間に位置的なずれが発生する場合があるためである。そのような場合でも罫線の交点となる画素を画像辺内にとらえられるよう、できるだけ大きく切り出すようにする。 Note that the size of the area C901 is determined dynamically so that it can be cut as large as possible without interfering with the vertical, horizontal, and horizontal intersections of the ruled line candidate grid 802. This is because even after skew correction is performed, distortion may remain in the image itself, and a positional shift may occur between the straight line detected by Hough transformation and the actual pixel. Even in such a case, the image should be cut out as large as possible so that the pixels at the intersections of the ruled lines can be captured within the image edge.

次に、処理画像901の中から罫線の断片を検出する。具体堤には、処理画像901内の画素の連続領域のうち面積が最大のものを罫線の断片と仮定する。図9の901の例では、「┏」型の領域902が罫線の断片として検出される。 Next, ruled line fragments are detected from the processed image 901. For concrete purposes, it is assumed that among the continuous regions of pixels in the processed image 901, the one with the largest area is a ruled line fragment. In the example 901 in FIG. 9, a "┏"-shaped area 902 is detected as a ruled line fragment.

次に、領域902が処理画像901の外周に接している方向を評価する。図9の例では、「下」と「右」に接している。他の例では交点がT字型の場合は「左」「右」「下」、十字型の場合は「左」「右」「上」「下」となる。なお、外周に接している方向が1つ以下の場合は、罫線ではないノイズとみなして、後述の表領域、セル抽出の評価対象から除外する。 Next, the direction in which the area 902 is in contact with the outer periphery of the processed image 901 is evaluated. In the example of FIG. 9, it is in contact with "bottom" and "right". In other examples, if the intersection is T-shaped, it will be "left", "right", and "bottom", and if it is cross-shaped, it will be "left", "right", "top", and "bottom". Note that if the number of directions touching the outer periphery is one or less, it is regarded as noise that is not a ruled line, and is excluded from evaluation targets for table area and cell extraction, which will be described later.

そして、交点評価の結果として、切り取った矩形領域の中心座標、サイズ、罫線が伸びている方向(領域が外周と接している方向)といった情報がそれぞれの交点に対して格納される。 As a result of the intersection point evaluation, information such as the center coordinates of the cut rectangular area, the size, and the direction in which the ruled line extends (the direction in which the area is in contact with the outer periphery) is stored for each intersection point.

以上がステップS305の交点評価処理の詳細である。 The details of the intersection evaluation process in step S305 have been described above.

次に、ステップS306では、罫線候補グリッド802から表の領域を特定して抽出する。 Next, in step S306, a table area is identified and extracted from the ruled line candidate grid 802.

ステップS306の表領域抽出処理の詳細は、図4、図5のフローチャートを用いて説明する。 Details of the table area extraction process in step S306 will be explained using the flowcharts of FIGS. 4 and 5.

図4のフローチャートで示す処理は、S402~S409の処理を横方向の罫線候補に対して順次実行する処理である(S401)。なお、本実施例においては、処理画像の上部に位置する横方向罫線候補から順次処理していくものとする。 The process shown in the flowchart of FIG. 4 is a process in which the processes of S402 to S409 are sequentially executed on horizontal ruled line candidates (S401). In this embodiment, it is assumed that horizontal ruled line candidates located at the top of the processed image are sequentially processed.

ステップS402では、左端点の検出状況を示すフラグをNoとする。すなわち、左端点が検出されていない状態であることを記録する。左端点とは、「表の左上の角にあたる交点」および「表の左下の角にあたる交点」を意味する。 In step S402, the flag indicating the detection status of the left end point is set to No. In other words, it is recorded that the left end point is not detected. The left end point means "the intersection point at the upper left corner of the table" and "the intersection point at the lower left corner of the table."

ステップS403では、処理対象の横方向罫線候補上にある交点について、ステップS404~ステップS408の処理を順次実行する。なお、本実施例においては、横方向罫線候補上にある交点について左から右に向かって順次処理していくものとする。 In step S403, the processes of steps S404 to S408 are sequentially executed for the intersection points on the horizontal ruled line candidates to be processed. In this embodiment, it is assumed that the intersection points on the horizontal ruled line candidates are sequentially processed from left to right.

ステップS404では、左端点が検出済みであるかを判定する。 In step S404, it is determined whether the left end point has been detected.

検出済みである場合(S404:YES)は、処理をステップS408に移行する。 If detected (S404: YES), the process moves to step S408.

まだ検出されていない場合(S404:NO)は、処理をステップS405に移行する。 If it has not been detected yet (S404: NO), the process moves to step S405.

ステップS405では、処理対象の交点が左端点であるかを判定する。左端点であるかの判断は、ステップS305により評価された内容のうち、「罫線が伸びている方向」に係る情報を用いて判定する。具体的には、「罫線が伸びている方向」が「『右』と『下』」の2方向のみである場合は、表の左上の角であるものとして左端点であると判定される。また「罫線が伸びている方向」が「『右』と『上』」の2方向のみである場合は、表の左下の角であるものとして左端点であると判定される。 In step S405, it is determined whether the intersection to be processed is the left end point. The determination as to whether it is the left end point is made using information related to "the direction in which the ruled line extends" among the contents evaluated in step S305. Specifically, if the ``directions in which ruled lines extend'' are only two directions, ``right'' and ``bottom,'' the left end point is determined to be the upper left corner of the table. Further, if the "directions in which the ruled lines extend" are only two directions, "right" and "top", the left end point is determined to be the lower left corner of the table.

左端点である場合(S405:YES)は、処理をステップS406に移行する。 If it is the left end point (S405: YES), the process moves to step S406.

左端点ではない場合(S405:NO)は、処理をステップ410に移行し、次の交点に対する処理に移行する。 If it is not the left end point (S405: NO), the process moves to step 410, and moves to the process for the next intersection point.

ステップS406では、左端点の検出状況を示すフラグをYESとする。すなわち、左端点を検出済みであることを記録する。 In step S406, the flag indicating the detection status of the left end point is set to YES. In other words, it is recorded that the left end point has been detected.

ステップS407では、表のスキャン方向を取得する。表のスキャン方向とは、ここから上下どちらの方向に表があると仮定して評価をするかというパラメータである。例えば図10のc1001は右と下方向に罫線が伸びているため、スキャン方向は下になる。また、図11のc1101は、右と上方向に罫線が伸びているため、スキャン方向は上になる。 In step S407, the scan direction of the table is acquired. The scan direction of the table is a parameter that determines which direction above or below the table is assumed to be in for evaluation. For example, c1001 in FIG. 10 has ruled lines extending to the right and downward, so the scanning direction is downward. Furthermore, in c1101 of FIG. 11, the ruled line extends to the right and upward, so the scanning direction is upward.

ステップS408では、処理対象の交点が右端点であるかを判定する。右端点であるかの判断は、ステップS305により評価された内容のうち、「罫線が伸びている方向」に係る情報を用いて判定する。具体的には、「罫線が伸びている方向」が「『左』と『下』」の2方向のみである場合は、表の右上の角であるものとして右端点であると判定される。また「罫線が伸びている方向」が「『左』と『上』」の2方向のみである場合は、表の右下の角であるものとして右端点であると判定される。 In step S408, it is determined whether the intersection to be processed is the right end point. The determination as to whether it is the right end point is made using information related to "the direction in which the ruled line extends" among the contents evaluated in step S305. Specifically, if the ``directions in which the ruled lines extend'' are only two directions, ``left'' and ``bottom,'' the right end point is determined to be the upper right corner of the table. Furthermore, if the "directions in which the ruled lines extend" are only two directions, "left" and "top", the right end point is determined to be the lower right corner of the table.

右端点である場合(S408:YES)は、処理をステップS409に移行する。 If it is the right end point (S408: YES), the process moves to step S409.

右端点ではない場合(S408:NO)は、処理をステップS410に移行し、次の交点に対する処理に移行する
ステップS409では、表領域のスキャンを行う。ステップS409の処理の詳細は、図5のフローチャートを用いて説明する。
If it is not the right end point (S408: NO), the process moves to step S410 and moves to the process for the next intersection. In step S409, the table area is scanned. Details of the process in step S409 will be explained using the flowchart of FIG.

図5のフローチャートでは、図4のフローチャートにおいて取得された横方向罫線と対になる横方向罫線(表の対辺となる横方向罫線)を確定するための処理であり、横方向の罫線候補に対して、ステップS502~S504の処理を、ステップS407で取得した表スキャンの方向に順次実行する(ステップS501)。 The flowchart in FIG. 5 is a process for determining the horizontal ruled line that will be paired with the horizontal ruled line obtained in the flowchart in FIG. 4 (horizontal ruled line on the opposite side of the table). Then, the processes of steps S502 to S504 are sequentially executed in the direction of the table scan acquired in step S407 (step S501).

ステップS502では、処理対象の横方向罫線候補が、すでに確定済みの他の表と接しているか(他の表を形成する辺として確定しているか)を判定する。 In step S502, it is determined whether the horizontal ruled line candidate to be processed is in contact with another table that has already been determined (whether it has been determined as a side forming another table).

他の表と干渉している場合(ステップS502:YES)は、処理をステップS505に移行し、これまでにスキャン済みの領域(図4の処理で取得した横方向罫線と、S502でYESと判定された横方向罫線とにより形成される領域)を表領域として確定し記憶する。 If it interferes with another table (step S502: YES), the process moves to step S505, and the area scanned so far (horizontal ruled lines obtained in the process of FIG. 4) is determined to be YES in step S502. The area formed by the horizontal ruled lines) is determined and stored as a table area.

他の表と干渉していない場合(ステップS502:NO)は、処理をステップS503に移行する。 If there is no interference with other tables (step S502: NO), the process moves to step S503.

ステップS503では、処理対象の横方向罫線上に、角点である交点が含まれているかを判定する。角点は、表の四隅を形成する交点であり、ステップS305により評価された内容のうち、「罫線が伸びている方向」に係る情報が、「『右』と『下』のみ」(左上の角点)、「『左』と『下』のみ」(右上の角点)、「『右』と『上』のみ」(左下の角点)、「『左』と『上』のみ」(右下の角点)のいずれかであるものを意味する。 In step S503, it is determined whether the horizontal ruled line to be processed includes an intersection point that is a corner point. The corner points are the intersections forming the four corners of the table, and among the contents evaluated in step S305, the information related to the "direction in which the ruled lines extend" is "only 'right' and 'bottom'" (upper left corner). corner points), "'Left' and 'Bottom' only" (upper right corner points), "'Right' and 'top' only" (lower left corner points), "'Left' and 'top' only" (right (lower corner point) means one of the following.

角点が含まれている場合(ステップS503:YES)は、処理をステップS505に移行し、これまでにスキャン済みの領域(図4の処理で取得した横方向罫線と、S503でYESと判定された横方向罫線とにより形成される領域)を表領域として確定し記憶する。 If a corner point is included (step S503: YES), the process moves to step S505, and the area scanned so far (horizontal ruled lines obtained in the process of FIG. 4 and the area determined as YES in S503) is scanned. (area formed by horizontal ruled lines) is determined and stored as a table area.

角点が含まれていない場合(ステップS503:NO)は、処理をステップS504に移行する。 If no corner points are included (step S503: NO), the process moves to step S504.

図10の例では、角点c1004が見つかったら領域1001(点線で示した領域)を表領域として確定する。なお、ここでは交点c1003は、「『左』と『上』」だけでなく『下』にも罫線が延びているため、角点として評価されない。このような表を認識するため、左右どちらかから角点が発見されたらその時点で表を確定するようにする。角点が見つからなかった場合はステップS504に進む。 In the example of FIG. 10, when the corner point c1004 is found, the area 1001 (the area indicated by the dotted line) is determined as the table area. Note that the intersection c1003 is not evaluated as a corner point because the ruled line extends not only to the "left" and "top" but also to the "bottom". In order to recognize such a table, when a corner point is found from either the left or right side, the table is determined at that point. If no corner point is found, the process advances to step S504.

ステップS504では、処理対象の横方向罫線に含まれる左右の端点の少なくともいずれかについて、「罫線が外側に伸びている端点」が存在するかを判定する。 In step S504, it is determined whether "an end point where the ruled line extends outward" exists for at least one of the left and right end points included in the horizontal ruled line to be processed.

「処理対象の横方向罫線に含まれる左右の端点」とは、図4のフローチャートにおいて取得した左端点と同一の縦方向罫線上の交点または右端点と同一の縦方向罫線上の交点であって、処理対象の横方向罫線に含まれる交点を意味する。また、罫線が外側に伸びているか否かは、当該端点における「罫線が伸びている方向」に基づき判断される。具体的には、左端点については左方向に罫線が伸びている場合に、外側に罫線が伸びていると判定される。同様に、右端点については、右方向に罫線が伸びている場合に、外側に罫線が伸びていると判定される。 "Left and right end points included in the horizontal ruled line to be processed" are the intersection points on the same vertical ruled line as the left end point obtained in the flowchart of FIG. 4, or the intersection points on the same vertical ruled line as the right end point, , means the intersection included in the horizontal ruled line to be processed. Further, whether or not the ruled line extends outward is determined based on the "direction in which the ruled line extends" at the end point. Specifically, for the left end point, if the ruled line extends to the left, it is determined that the ruled line extends outward. Similarly, for the right end point, if the ruled line extends to the right, it is determined that the ruled line extends outward.

「罫線が外側に伸びている端点」が存在すると判定された場合(ステップS504:YES)は、処理をステップS505に移行し、これまでにスキャン済みの領域(図4の処理で取得した横方向罫線と、S504でYESと判定された横方向罫線とにより形成される領域)を表領域として確定し記憶する。 If it is determined that there is an "end point where the ruled line extends outward" (step S504: YES), the process moves to step S505, and the area that has been scanned so far (horizontal direction The area formed by the ruled line and the horizontal ruled line determined as YES in S504 is determined and stored as a table area.

例えば、図11の例では、交点c1103から外側(左側)に向かって罫線が延びているため、ここで表のスキャンを打ち切り、領域11101(点線で示した領域)を表領域として確定する。 For example, in the example of FIG. 11, since the ruled line extends outward (to the left) from the intersection c1103, the scan of the table is terminated here and the area 11101 (the area indicated by the dotted line) is determined as the table area.

「罫線が外側に伸びている端点」が存在しないと判定された場合(ステップS504:NO)は、処理対象の罫線は表の対辺となる横方向罫線ではないと判断されることから、次の横方向罫線に処理対象を移行する。 If it is determined that there is no "end point where the ruled line extends outward" (step S504: NO), it is determined that the ruled line to be processed is not a horizontal ruled line that is the opposite side of the table, so the following Shift the processing target to horizontal ruled lines.

なお、すべての横方向罫線についてS502~S504の処理を実行しても表の対辺となる横方向罫線が見つからなかった場合は、表領域が存在しないと判定し、本フローチャートの処理を終了する(S507)。例えば、図4のフローチャートにおいて取得された右端点及び左端点がノイズによる誤検出であった場合に、このような処理となる。 Note that if a horizontal ruled line that is the opposite side of the table is not found even after performing the processes of S502 to S504 for all horizontal ruled lines, it is determined that the table area does not exist, and the processing of this flowchart is terminated ( S507). For example, when the right end point and left end point acquired in the flowchart of FIG. 4 are erroneously detected due to noise, such processing is performed.

ステップS506では、左端点の検出状況を示すフラグをNoとし、処理を図4のステップS401に移行する。なお、ステップS506の処理が実行された後のS402以降の処理については、S502~S504の処理が実行されていない横罫線候補のみを処理対象としても良い。 In step S506, the flag indicating the detection status of the left end point is set to No, and the process moves to step S401 in FIG. 4. Note that, in the process from S402 onwards after the process in step S506 is executed, only the horizontal ruled line candidates for which the processes in S502 to S504 have not been executed may be processed.

以上の処理により、S301で表抽出要求を受付けた帳票画像から表領域を抽出することが可能となる。 Through the above processing, it becomes possible to extract the table area from the form image for which the table extraction request was accepted in S301.

特に図7に示すように、2つの矩形が組み合わさった表(個別の項目が記載された明細表と合計金額などが記載された小計表が接した表)についても、明細表と小計表を別々の表として認識することが可能となる。その結果、表に含まれるデータの認識処理において、高い精度で認識することが可能となる。 In particular, as shown in Figure 7, for a table that combines two rectangles (a table in which a detailed table with individual items and a subtotal table with total amounts, etc. are in contact), the detailed table and the subtotal table can also be combined. It becomes possible to recognize them as separate tables. As a result, it becomes possible to recognize data included in a table with high accuracy in the recognition process.

次に、ステップS307の処理について説明する。 Next, the process of step S307 will be explained.

ステップS307では、ステップS306において抽出された表領域に含まれるセル領域を抽出する処理である。セル領域抽出処理の詳細は、以下、図13のフローチャートを用いて説明する。 In step S307, a cell area included in the table area extracted in step S306 is extracted. Details of the cell area extraction process will be explained below using the flowchart of FIG. 13.

図13のフローチャートでは、ステップS1302~S1314までの処理を横方向罫線候補に対し順次実行していく(本実施例では上から下に向けて順次実行する)ものであり(S1301)、S1304~S1306の処理を横方向罫線上の交点に対して順次実行していく(本実施例では左から右に順次実行する)ものである。 In the flowchart of FIG. 13, the processes from steps S1302 to S1314 are executed sequentially for horizontal ruled line candidates (in this embodiment, they are executed sequentially from top to bottom) (S1301), and from S1304 to S1306. This process is executed sequentially for the intersection points on the horizontal ruled lines (in this embodiment, it is executed sequentially from left to right).

ステップS1302では、セルの左上の交点(左端点)の検出状況を示すフラグをNOに設定する。すなわち、まだ左上の交点を検出していない旨を示す状態にする。 In step S1302, a flag indicating the detection status of the upper left intersection (left end point) of the cell is set to NO. In other words, the state is set to indicate that the upper left intersection has not yet been detected.

ステップS1034では、左上の交点の検出状況を示すフラグがYESであるか、すなわち左上の交点を検出済みであるかを判定する。 In step S1034, it is determined whether the flag indicating the detection status of the upper left intersection is YES, that is, whether the upper left intersection has been detected.

検出済みである場合(ステップS1304:YES)は、処理をステップS1308に移行する。 If detected (step S1304: YES), the process moves to step S1308.

検出済みではない場合(ステップS1304:NO)は、処理をステップS1305に移行する。 If the detection has not been completed (step S1304: NO), the process moves to step S1305.

ステップS1305では、処理対象の交点が左端点(セルの左上の交点)であるかを判定する。セルの左上の交点であるかの判定は、具体的には、当該交点から延びる罫線の方向が「『右』と『下』」を含む場合(右と下を含めば、左や上に延びる罫線があっても左端点と判断される)に、当該交点はセルの左上の交点であると判定される。例えば図12の例では、交点c1201が左端点であると判定される。 In step S1305, it is determined whether the intersection to be processed is the left end point (the upper left intersection of the cell). Specifically, if the direction of the ruled line extending from the intersection includes "right" and "bottom" (if the direction of the ruled line extending from the intersection includes "right" and "bottom", then it will not extend to the left or top). Even if there is a ruled line, the intersection point is determined to be the left end point), and the intersection point is determined to be the upper left intersection point of the cell. For example, in the example of FIG. 12, the intersection c1201 is determined to be the left end point.

処理対象の交点が左端点であると判定された場合(ステップS1305:YES)は、処理をステップS1306に移行する。 If it is determined that the intersection to be processed is the left end point (step S1305: YES), the process moves to step S1306.

処理対象の交点が左端点ではないと判定された場合(ステップS1305:NO)は、所為をステップS1307に移行し、次の交点(一つ右の交点)に処理を移行する。 If it is determined that the intersection to be processed is not the left end point (step S1305: NO), the process moves to step S1307, and the process moves to the next intersection (one point to the right).

ステップS1306では、左端点の検出状況を示すフラグをYESに設定する。そして、次の交点(一つ右の交点)に処理を移行する(S1307)。図12の例では、交点c1202に処理対象を移行する。 In step S1306, a flag indicating the detection status of the left end point is set to YES. Then, the process moves to the next intersection (the one to the right) (S1307). In the example of FIG. 12, the processing target is shifted to the intersection c1202.

ステップS1308では、処理対象の交点が右端点(セルの右上の交点)であるかを判定する。セルの右上の交点であるかの判定は、具体的には、当該交点から延びる罫線の方向が「『左』と『下』」を含む場合(左と下を含めば、右や上に延びる罫線があっても右端点と判断される)に、当該交点はセルの右上の交点であると判定される。図12の例では、交点c1202が右端点であると判定される。 In step S1308, it is determined whether the intersection to be processed is the right end point (the upper right intersection of the cell). Specifically, if the direction of the ruled line extending from the intersection includes "left" and "bottom" (if the direction of the ruled line extending from the intersection includes "left" and "bottom", it will not extend to the right or top). Even if there is a ruled line, the intersection point is determined to be the right end point), and the intersection point is determined to be the upper right intersection point of the cell. In the example of FIG. 12, the intersection c1202 is determined to be the right end point.

処理対象の交点が右端点であると判定された場合(ステップS1308:YES)は、処理をステップS1309に移行し、横方向罫線候補に対して順次S1310~S1311の処理を実行する。 If it is determined that the intersection to be processed is the right end point (step S1308: YES), the process moves to step S1309, and the processes of S1310 to S1311 are sequentially performed on the horizontal ruled line candidates.

処理対象の交点が右端点ではないと判定された場合(ステップS1308:NO)は、処理をステップS1307に移行し、次の交点(一つ右の交点)に処理を移行する
ステップS1308:YESと判定された場合、処理対象の横罫線候補の1つ下に位置する横罫線候補に対して、ステップS1310~S1311の処理を実行する。なお、ここでの横罫線候補は、横罫線である直線のうち、S1305で検出された左端点と同一の縦方向罫線上の交点と、S1308で検出された右端点と同一の縦方向罫線上の交点とにより特定される線分を示す。
If it is determined that the intersection to be processed is not the rightmost point (step S1308: NO), the process moves to step S1307, and the process moves to the next intersection (one point to the right).Step S1308: YES If it is determined, the processes of steps S1310 to S1311 are executed for the horizontal ruled line candidate located one level below the horizontal ruled line candidate to be processed. Note that the horizontal ruled line candidates here are the intersection point on the vertical ruled line that is the same as the left end point detected in S1305, and the same vertical ruled line as the right end point detected in S1308, among the straight lines that are the horizontal ruled lines. indicates a line segment specified by the intersection point of

ステップS1310では、処理対象の横罫線候補が他の確定済みセルと共有しているかを判定する。 In step S1310, it is determined whether the horizontal ruled line candidate to be processed is shared with another confirmed cell.

共有していると判定された場合(ステップS1310:YES)は、処理をステップS1313に移行する。 If it is determined that the information is shared (step S1310: YES), the process moves to step S1313.

共有していないと判定された場合(ステップS1310:NO)は、処理をステップS1311に移行する。 If it is determined that the information is not shared (step S1310: NO), the process moves to step S1311.

ステップS1311では、処理対象の横罫線候補の左右の端点から内向きの罫線が伸びているかを判定する。内向きの罫線とは、左端点であれば右方向に延びる罫線であり、右端点であれば左方向に延びる罫線である。なお、内向きに延びる罫線が含まれていればよく、他の向きに延びる罫線も含まれていても、本処理はYESと判定される。例えば、図12の例では、左の端点である交点c1204について右方向に延びる罫線があり、右の端点である交点1203について左方向に延びる罫線があるため、ステップS1311においてYESと判定される。 In step S1311, it is determined whether inward ruled lines extend from the left and right end points of the horizontal ruled line candidate to be processed. An inward ruled line is a ruled line that extends to the right if it is the left end point, and a ruled line that extends to the left if it is the right end point. Note that it is sufficient that ruled lines extending inward are included, and even if ruled lines extending in other directions are also included, this process is determined to be YES. For example, in the example of FIG. 12, there is a ruled line that extends to the right about intersection c1204, which is the left end point, and there is a ruled line, which extends to the left about intersection 1203, which is the right end point, so YES is determined in step S1311.

左右の端点から内向きの罫線が延びていると判定された場合(ステップS1311:YES)は、処理をステップS1313に移行する。 If it is determined that an inward ruled line extends from the left and right end points (step S1311: YES), the process moves to step S1313.

左右の端点から内向きの罫線が延びていないと判定された場合(ステップS1311:NO)は、処理をステップS1312に移行し、次の(1つ下の)横方向罫線候補に処理を移行する。 If it is determined that the inward ruled line does not extend from the left and right end points (step S1311: NO), the process moves to step S1312, and the process moves to the next (one level lower) horizontal ruled line candidate. .

ステップS1313では、S1305で検出された左端点とS1308で検出された右端点とにより形成される線分と、S1310でYESと判定された線分またはS1311でYESと判定された線分とにより形成されるセルを、セル領域として確定する。 In step S1313, a line segment is formed by the left end point detected in S1305 and the right end point detected in S1308, and the line segment determined as YES in S1310 or the line segment determined as YES in S1311. The cell is determined as the cell area.

そして、ステップS1314で左端点の検出フラグをNOとして、処理をS1303に戻す。
以上がセル領域を検出する処理である。
なお、本実施例において表領域やセル領域を検出・特定する際に、横方向(水平方向)の罫線を基準に説明したが、縦方向(垂直方向)の罫線を基準に処理を実行しても良い。
Then, in step S1314, the left end point detection flag is set to NO, and the process returns to S1303.
The above is the process of detecting a cell area.
Note that when detecting and specifying table areas and cell areas in this embodiment, the horizontal direction (horizontal direction) ruled lines are used as a reference, but the processing is performed using the vertical direction (vertical direction) ruled lines as a reference. Also good.

本発明は、例えば、システム、装置、方法、プログラムもしくは記録媒体等としての実施態様をとることが可能である。具体的には、複数の機器から構成されるシステムに適用しても良いし、また、一つの機器からなる装置に適用しても良い。 The present invention can be implemented as, for example, a system, an apparatus, a method, a program, a recording medium, or the like. Specifically, the present invention may be applied to a system consisting of a plurality of devices, or may be applied to a device consisting of a single device.

また、本発明におけるプログラムは、図3~図5、図13に示すフローチャートの処理方法をコンピュータが実行可能なプログラムであり、本発明の記憶媒体は図3~図5、図13の処理方法をコンピュータが実行可能なプログラムが記憶されている。なお、本発明におけるプログラムは図3~図5、図13の各装置の処理方法ごとのプログラムであってもよい。 Further, the program according to the present invention is a program that allows a computer to execute the processing methods shown in the flowcharts shown in FIGS. Programs executable by the computer are stored. Note that the program in the present invention may be a program for each processing method of each device shown in FIGS. 3 to 5 and 13.

以上のように、前述した実施形態の機能を実現するプログラムを記録した記録媒体を、システムあるいは装置に供給し、そのシステムあるいは装置のコンピュータ(またはCPUやMPU)が記録媒体に格納されたプログラムを読み出し、実行することによっても本発明の目的が達成されることは言うまでもない。 As described above, a recording medium recording a program that implements the functions of the embodiments described above is supplied to a system or device, and the computer (or CPU or MPU) of the system or device reads the program stored in the recording medium. It goes without saying that the object of the present invention can also be achieved by reading and executing.

この場合、記録媒体から読み出されたプログラム自体が本発明の新規な機能を実現することになり、そのプログラムを記録した記録媒体は本発明を構成することになる。 In this case, the program itself read from the recording medium will realize the novel function of the present invention, and the recording medium on which the program is recorded constitutes the present invention.

プログラムを供給するための記録媒体としては、例えば、フレキシブルディスク、ハードディスク、光ディスク、光磁気ディスク、CD-ROM、CD-R、DVD-ROM、磁気テープ、不揮発性のメモリカード、ROM、EEPROM、シリコンディスク等を用いることが出来る。 Examples of recording media for supplying programs include flexible disks, hard disks, optical disks, magneto-optical disks, CD-ROMs, CD-Rs, DVD-ROMs, magnetic tapes, non-volatile memory cards, ROMs, EEPROMs, and silicon A disk or the like can be used.

また、コンピュータが読み出したプログラムを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムの指示に基づき、コンピュータ上で稼働しているOS(オペレーティングシステム)等が実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。 In addition, by executing a program read by a computer, not only the functions of the above-described embodiments are realized, but also the OS (operating system) etc. running on the computer are realized based on the instructions of the program. It goes without saying that this also includes a case where part or all of the processing is performed and the functions of the embodiments described above are realized by the processing.

さらに、記録媒体から読み出されたプログラムが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPU等が実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。 Furthermore, after the program read from the recording medium is written into the memory of the function expansion board inserted into the computer or the function expansion unit connected to the computer, the function expansion board It goes without saying that this also includes a case where a CPU or the like provided in a function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing.

また、本発明は、複数の機器から構成されるシステムに適用しても、ひとつの機器から成る装置に適用しても良い。また、本発明は、システムあるいは装置にプログラムを供給することによって達成される場合にも適応できることは言うまでもない。この場合、本発明を達成するためのプログラムを格納した記録媒体を該システムあるいは装置に読み出すことによって、そのシステムあるいは装置が、本発明の効果を享受することが可能となる。 Moreover, the present invention may be applied to a system made up of a plurality of devices, or to a device made up of one device. It goes without saying that the present invention can also be applied to a case where the present invention is achieved by supplying a program to a system or device. In this case, by reading a recording medium storing a program for achieving the present invention into the system or device, the system or device can enjoy the effects of the present invention.

さらに、本発明を達成するためのプログラムをネットワーク上のサーバ、データベース等から通信プログラムによりダウンロードして読み出すことによって、そのシステムあるいは装置が、本発明の効果を享受することが可能となる。なお、上述した各実施形態およびその変形例を組み合わせた構成も全て本発明に含まれるものである。 Further, by downloading and reading a program for achieving the present invention from a server, database, etc. on a network using a communication program, the system or device can enjoy the effects of the present invention. Note that all configurations that are combinations of the above-described embodiments and their modifications are also included in the present invention.

101 情報処理装置
102 スキャナ
103 ファイルサーバ
101 Information processing device 102 Scanner 103 File server

Claims (8)

表を含む画像を取得する取得手段と、
前記取得された画像から、表の罫線の候補となる直線を検出する検出手段と、
前記検出された直線同士の各交点について、当該交点から罫線が延びる方向を特定する罫線方向特定手段と、
前記交点のうち、前記罫線方向特定手段により特定された罫線が延びる方向に基づき、表の左上および右上の角を形成する交点を特定する角点特定手段と、
前記角点特定手段により特定された角点に基づき特定される辺と並行な辺であって、外側に向かって延びる罫線がある交点を含む辺を、対辺として特定する対辺特定手段と、
前記角点特定手段により特定された角点から形成される辺と、前記対辺特定手段により特定された対辺と、に基づき特定される領域を表領域として特定する表領域特定手段と、
を備えることを特徴とする情報処理装置。
an acquisition means for acquiring an image including a table;
Detection means for detecting straight lines that are candidates for ruled lines of the table from the acquired image;
ruled line direction identifying means for identifying, for each intersection between the detected straight lines, a direction in which the ruled line extends from the intersection;
Corner point specifying means for specifying, among the intersection points, the intersections forming the upper left and upper right corners of the table based on the direction in which the ruled lines specified by the ruled line direction specifying means extend;
Opposite side specifying means for specifying, as an opposite side, a side that is parallel to the side specified based on the corner point specified by the corner point specifying means and that includes an intersection with a ruled line extending outward;
table area specifying means for specifying an area specified as a table area based on a side formed from the corner point specified by the corner point specifying means and an opposite side specified by the opposite side specifying means;
An information processing device comprising:
表を含む画像を取得する取得手段と、 an acquisition means for acquiring an image including a table;
前記取得された画像から、表の罫線の候補となる直線を検出する検出手段と、 Detection means for detecting straight lines that are candidates for ruled lines of the table from the acquired image;
前記検出された直線同士の各交点について、当該交点から罫線が延びる方向を特定する罫線方向特定手段と、 ruled line direction identifying means for identifying, for each intersection between the detected straight lines, a direction in which the ruled line extends from the intersection;
前記交点のうち、前記罫線方向特定手段により特定された罫線が延びる方向に基づき、表の左下および右下の角を形成する交点を特定する角点特定手段と、 Corner point specifying means for specifying, among the intersection points, the intersections forming the lower left and lower right corners of the table based on the direction in which the ruled lines specified by the ruled line direction specifying means extend;
前記角点特定手段により特定された角点に基づき特定される辺と並行な辺であって、外側に向かって延びる罫線がある交点を含む辺を、対辺として特定する対辺特定手段と、 Opposite side specifying means for specifying, as an opposite side, a side that is parallel to the side specified based on the corner point specified by the corner point specifying means and that includes an intersection with a ruled line extending outward;
前記角点特定手段により特定された角点から形成される辺と、前記対辺特定手段により特定された対辺と、に基づき特定される領域を表領域として特定する表領域特定手段と、table area specifying means for specifying an area specified as a table area based on a side formed from the corner point specified by the corner point specifying means and an opposite side specified by the opposite side specifying means;
を備えることを特徴とする情報処理装置。 An information processing device comprising:
前記対辺特定手段は、前記角点特定手段により特定された角点に基づき特定される辺と並行な辺が、すでに表領域として特定された領域を構成する辺である場合、当該辺を対辺として特定することを特徴とする請求項1または2に記載の情報処理装置。 If a side parallel to the side specified based on the corner points specified by the corner point specifying means is a side that constitutes an area already specified as a table area, the opposite side specifying means determines that the side is the opposite side. 3. The information processing apparatus according to claim 1, wherein the information processing apparatus specifies the information processing apparatus. 前記対辺特定手段は、前記角点特定手段により特定された角点に基づき特定される辺と並行な辺であって、表の四隅を形成する交点に基づき特定される辺を、対辺として特定することを特徴とする請求項1乃至3のいずれか1項に記載の情報処理装置。 The opposite side specifying means specifies, as the opposite side, a side that is parallel to the side specified based on the corner point specified by the corner point specifying means, and that is specified based on the intersection points forming the four corners of the table. The information processing device according to any one of claims 1 to 3 . 前記表領域特定手段により特定された表領域に含まれる交点の罫線が延びる方向に基づき、当該表領域のセルを特定する特定手段をさらに備えることを特徴とする請求項1乃至のいずれか1項に記載の情報処理装置。 5. Any one of claims 1 to 4 , further comprising specifying means for specifying a cell of the table area based on a direction in which ruled lines at intersections included in the table area specified by the table area specifying unit extend. The information processing device described in section. 情報処理装置の取得手段が、表を含む画像を取得する取得工程と、 an acquisition step in which an acquisition means of the information processing device acquires an image including a table;
前記情報処理装置の検出手段が、前記取得された画像から、表の罫線の候補となる直線を検出する検出工程と、 a detection step in which the detection means of the information processing device detects straight lines that are candidates for ruled lines of the table from the acquired image;
前記情報処理装置の罫線方向特定手段が、前記検出された直線同士の各交点について、当該交点から罫線が延びる方向を特定する罫線方向特定工程と、 a ruled line direction specifying step in which the ruled line direction specifying means of the information processing device specifies, for each intersection point between the detected straight lines, a direction in which the ruled line extends from the intersection point;
前記情報処理装置の角点特定手段が、前記交点のうち、前記罫線方向特定工程において特定された罫線が延びる方向に基づき、表の左上および右上の角を形成する交点を特定する角点特定工程と、 Corner point specifying step, in which the corner point specifying means of the information processing device specifies, among the intersection points, an intersection point forming an upper left corner and an upper right corner of the table based on the direction in which the ruled line specified in the ruled line direction specifying step extends; and,
前記情報処理装置の対辺特定手段が、前記角点特定工程において特定された角点に基づき特定される辺と並行な辺であって、外側に向かって延びる罫線がある交点を含む辺を、対辺として特定する対辺特定工程と、 The opposite side specifying means of the information processing device identifies, as the opposite side, a side that is parallel to the side specified based on the corner points specified in the corner point specifying step and that includes an intersection with a ruled line extending outward. an opposite side identifying step of identifying as;
前記情報処理装置の表領域特定手段が、前記角点特定工程において特定された角点から形成される辺と、前記対辺特定工程において特定された対辺と、に基づき特定される領域を表領域として特定する表領域特定工程と、 The table area specifying means of the information processing device defines the area specified based on the side formed from the corner points specified in the corner point specifying step and the opposite side specified in the opposite side specifying step as a table area. a tablespace identification step;
を備えることを特徴とする情報処理方法。 An information processing method comprising:
情報処理装置の取得手段が、表を含む画像を取得する取得工程と、 an acquisition step in which an acquisition means of the information processing device acquires an image including a table;
前記情報処理装置の検出手段が、前記取得された画像から、表の罫線の候補となる直線を検出する検出工程と、 a detection step in which the detection means of the information processing device detects straight lines that are candidates for ruled lines of the table from the acquired image;
前記情報処理装置の罫線方向特定手段が、前記検出された直線同士の各交点について、当該交点から罫線が延びる方向を特定する罫線方向特定工程と、 a ruled line direction specifying step in which the ruled line direction specifying means of the information processing device specifies, for each intersection point between the detected straight lines, a direction in which the ruled line extends from the intersection point;
前記情報処理装置の角点特定手段が、前記交点のうち、前記罫線方向特定工程において特定された罫線が延びる方向に基づき、表の左下および右下の角を形成する交点を特定する角点特定工程と、 Corner point identification, wherein the corner point identification means of the information processing device identifies, among the intersection points, intersections forming the lower left and lower right corners of the table based on the direction in which the ruled lines specified in the ruled line direction identification step extend. process and
前記情報処理装置の対辺特定手段が、前記角点特定工程において特定された角点に基づき特定される辺と並行な辺であって、外側に向かって延びる罫線がある交点を含む辺を、対辺として特定する対辺特定工程と、 The opposite side specifying means of the information processing device identifies, as the opposite side, a side that is parallel to the side specified based on the corner points specified in the corner point specifying step and that includes an intersection with a ruled line extending outward. an opposite side identifying step of identifying as;
前記情報処理装置の表領域特定手段が、前記角点特定工程において特定された角点から形成される辺と、前記対辺特定工程において特定された対辺と、に基づき特定される領域を表領域として特定する表領域特定工程と、 The table area specifying means of the information processing device defines the area specified based on the side formed from the corner points specified in the corner point specifying step and the opposite side specified in the opposite side specifying step as a table area. a tablespace identification step;
を備えることを特徴とする情報処理方法。 An information processing method comprising:
コンピュータを、請求項1乃至のいずれか1項に記載の情報処理装置の各手段として機能させるためのプログラム。 A program for causing a computer to function as each means of the information processing apparatus according to claim 1 .
JP2019226062A 2019-12-16 2019-12-16 Information processing device, information processing method, program Active JP7425288B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2019226062A JP7425288B2 (en) 2019-12-16 2019-12-16 Information processing device, information processing method, program
JP2024005335A JP2024038417A (en) 2019-12-16 2024-01-17 Information processing device, information processing method, program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019226062A JP7425288B2 (en) 2019-12-16 2019-12-16 Information processing device, information processing method, program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2024005335A Division JP2024038417A (en) 2019-12-16 2024-01-17 Information processing device, information processing method, program

Publications (3)

Publication Number Publication Date
JP2021096543A JP2021096543A (en) 2021-06-24
JP2021096543A5 JP2021096543A5 (en) 2022-12-23
JP7425288B2 true JP7425288B2 (en) 2024-01-31

Family

ID=76431389

Family Applications (2)

Application Number Title Priority Date Filing Date
JP2019226062A Active JP7425288B2 (en) 2019-12-16 2019-12-16 Information processing device, information processing method, program
JP2024005335A Pending JP2024038417A (en) 2019-12-16 2024-01-17 Information processing device, information processing method, program

Family Applications After (1)

Application Number Title Priority Date Filing Date
JP2024005335A Pending JP2024038417A (en) 2019-12-16 2024-01-17 Information processing device, information processing method, program

Country Status (1)

Country Link
JP (2) JP7425288B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7268115B1 (en) 2021-11-09 2023-05-02 西松建設株式会社 Rebar arrangement list reader, list reader, bar arrangement list reading method and program

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007213255A (en) 2006-02-08 2007-08-23 Fujitsu Ltd Table recognition device and computer program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007213255A (en) 2006-02-08 2007-08-23 Fujitsu Ltd Table recognition device and computer program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
川中普晴,外4名,表形式退院サマリを対象とした文書画像認識・XML文書作成システムの構築への第一歩,医療情報学27(1),2007年,pp.117-125

Also Published As

Publication number Publication date
JP2024038417A (en) 2024-03-19
JP2021096543A (en) 2021-06-24

Similar Documents

Publication Publication Date Title
JP5423525B2 (en) Handwriting input device, handwriting input method, and handwriting input program
US6356655B1 (en) Apparatus and method of bitmap image processing, storage medium storing an image processing program
US20090021530A1 (en) Display control apparatus and display control method
JP5357612B2 (en) Underline removal device
US9384405B2 (en) Extracting and correcting image data of an object from an image
JP2024038417A (en) Information processing device, information processing method, program
US6711292B2 (en) Block selection of table features
US7796817B2 (en) Character recognition method, character recognition device, and computer product
CN107133615B (en) Information processing apparatus, information processing method, and computer program
US9678642B2 (en) Methods of content-based image area selection
US8145997B2 (en) Method for simultaneously performing a plurality of handwritten searches
US20120237131A1 (en) Information processing apparatus to acquire character information
US10684772B2 (en) Document viewing apparatus and program
JP2000112599A (en) Device and method for processing document image
JP7039882B2 (en) Image analysis device and image analysis program
JP7031389B2 (en) Information processing equipment and programs
JP6156740B2 (en) Information display device, input information correction program, and input information correction method
US8589416B2 (en) System and method of performing data processing on similar forms
JP2004080341A (en) Image processor, image processing method, program, and recording medium
JP2006072839A (en) Image processing method, image processing apparatus, image processing program and recording medium
JP7417116B2 (en) Information processing system, information processing method, program
US7103220B2 (en) Image processing apparatus, method and program, and storage medium
JP2021043680A (en) Information processing device and information processing program
JP7043667B1 (en) Information processing equipment, programs, and information processing methods
US11158058B2 (en) Information processing apparatus and non-transitory computer readable medium for processing images of punched holes

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221215

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20221215

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20231012

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20231017

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20231208

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: 20231219

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240101

R151 Written notification of patent or utility model registration

Ref document number: 7425288

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151