JP2021096543A - Information processor, information processing method, and program - Google Patents

Information processor, information processing method, and program Download PDF

Info

Publication number
JP2021096543A
JP2021096543A JP2019226062A JP2019226062A JP2021096543A JP 2021096543 A JP2021096543 A JP 2021096543A JP 2019226062 A JP2019226062 A JP 2019226062A JP 2019226062 A JP2019226062 A JP 2019226062A JP 2021096543 A JP2021096543 A JP 2021096543A
Authority
JP
Japan
Prior art keywords
ruled line
specifying means
specifying
specified
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.)
Granted
Application number
JP2019226062A
Other languages
Japanese (ja)
Other versions
JP2021096543A5 (en
JP7425288B2 (en
Inventor
唯仁 八尾
Tadahito Yao
唯仁 八尾
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

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

Abstract

To extract tables and cells with high accuracy even for a form image that have been skewed or distorted during scanning and to recognize each table as a separate table even when multiple tables share a ruled line and are adjacent to each other.SOLUTION: Straight lines that become candidates for ruled lines of a table are detected in an image, ruled lines that extend from each intersection point of the straight line candidates are identified, and an area of the table is estimated based on a direction in which the identified ruled lines extend.SELECTED DRAWING: Figure 1

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 an aid to the work of reading information from a printed form and inputting it into a system. When OCR processing a form, it can be treated as a standard form in the case where the form issued by the company is collected and the entered contents are read, and it is easy to read the target information by extracting the rectangle with the predetermined coordinates. Is. However, it is not possible to specify in advance what kind of information is entered in the forms sent from an unspecified number of issuers such as invoices, and the layout of the forms is analyzed each time after receiving the forms. It is necessary to extract information. Such forms are generally called atypical forms.

現実の業務においては非定型帳票を扱うケースはいまだ多く、非定型帳票の解析精度向上がデータ入力業務の生産性を大きく左右する。 In actual work, there are still many cases where atypical forms are handled, and improving the analysis accuracy of atypical forms greatly affects the productivity of data entry work.

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

罫線に着目して帳票から表を抽出する手法は古くから存在しているが、スキャン時に発生する傾きや線の歪み、FAXなど低解像度な二値画像への変換によって発生する線のカスレや途切れに対していかに頑健とするかが課題となっている。 The method of extracting a table from a form by focusing on the ruled lines has existed for a long time, but the inclination and line distortion that occur during scanning, and the line blurring and breaks that occur due to conversion to a low-resolution binary image such as FAX. The issue is how to be robust against.

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

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

しかし、罫線の検出を、ラン(一定以上の長さで連続する画素)を基準にして行っており、カスレにより線が細かく断片化したような状況に弱いという課題がある。 However, the detection of ruled lines is performed on the basis of runs (pixels that are continuous with a certain length or longer), and there is a problem that the lines are vulnerable to fine fragmentation due to blurring.

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

そこで、本発明は、スキャン時にカスレやゆがみが発生した帳票画像に対しても精度よく表やセルを抽出することができる仕組みを提供することを目的とする。また複数の表が罫線を共有して接しているような場合にも、それぞれ別の表として認識できる仕組みを提供することを目的とする。 Therefore, an object of the present invention is to provide a mechanism capable of accurately extracting a table or a cell even for a form image in which blurring or distortion occurs during scanning. Another object of the present invention is to provide a mechanism that can be recognized as separate tables even when a plurality of tables share a ruled line and are in contact with each other.

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

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

本発明の実施形態における、表抽出システムのシステム構成の一例を示す図である。It is a figure which shows an example of the system structure of the table extraction system in embodiment of this invention. 本発明の実施形態における、PCのハードウェア構成の一例を示すブロック図である。It is a block diagram which shows an example of the hardware composition of the PC in embodiment of this invention. 本発明の実施形態における、帳票画像から表及びセルを抽出する処理を示すフローチャートである。It is a flowchart which shows the process of extracting the table and the cell from the form image in embodiment of this invention. 本発明の実施形態における、表領域抽出処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the tablespace extraction process in embodiment of this invention. 本発明の実施形態における、表領域抽出処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the tablespace extraction process in embodiment of this invention. 本発明の実施形態における、帳票画像から文字を除去する過程を示す図である。It is a figure which shows the process of removing a character from a form image in embodiment of this invention. 本発明の実施形態における、表抽出処理の対象とする帳票の一例を示す図である。It is a figure which shows an example of the form which is the object of the table extraction processing in embodiment of this invention. 本発明の実施形態における、帳票画像からHough変換により直線を検出した状態を示す図である。It is a figure which shows the state which the straight line was detected by the Hough transform from the form image in embodiment of this invention. 本発明の実施形態における、交点評価部が交点の状態を評価する過程を示す図である。It is a figure which shows the process which the intersection evaluation part evaluates the state of an intersection in embodiment of this invention. 本発明の実施形態における、表領域抽出処理の一例を示す図である。It is a figure which shows an example of the tablespace extraction process in embodiment of this invention. 本発明の実施形態における、明細表に接した小計表の検出を行う例を示す図である。It is a figure which shows the example which performs the detection of the subtotal table which was in contact with the specification table in embodiment of this invention. 本発明の実施形態における、セル領域抽出処理の一例を示す図である。It is a figure which shows an example of the cell area extraction processing in embodiment of this invention. 本発明の実施形態における、セル領域抽出処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the cell area extraction processing in embodiment of this invention.

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

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

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

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

また、通信経路上にはファイルサーバ103を置いてもよい。スキャナ102でスキャンした画像を情報処理装置101に取り込む方法として、スキャナ102から情報処理装置101に直接画像を送信する方法、スキャナ102で取り込んだ画像ファイルをいったんファイルサーバ103に保管し、情報処理装置101がファイルサーバ103から画像ファイルを取り出す方法などがあるが、いずれの方法をとっても良い。 Further, the file server 103 may be placed on the communication path. As a method of importing the image scanned by the scanner 102 into the information processing device 101, a method of directly transmitting the image from the scanner 102 to the information processing device 101, an image file captured by the scanner 102 is temporarily stored in the file server 103, and the information processing device The 101 may take out an image file from the file server 103, or the like, but 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, the scanner 102, and the 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 apparatus 101 and the like include 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 via the system bus 204. The 206, the memory controller 207, and the communication I / F controller 208 are connected.

CPU201は、システムバス204に接続される各デバイスやコントローラを統括的に制御する。 The CPU 201 comprehensively 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 the external memory 211 is a control program executed by the CPU 201, such as a BIOS (Basic Input / Output System) or an OS (Operating System), a computer-readable and executable program for realizing the information processing method, and various necessary programs. Holds data (including data table).

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

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

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

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

なおビデオコントローラ206は、表示制御を行うためのビデオメモリ(VRAM)を制御することが可能で、ビデオメモリ領域としてRAM203の一部を利用することもできるし、別途専用のビデオメモリを設けることも可能である。 The video controller 206 can control a video memory (VRAM) for display control, can use a 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カードスロットにアダプタを介して接続されるコンパクトフラッシュ(登録商標)メモリ等を利用可能である。 The memory controller 207 controls access to the external memory 211. External memory is connected to an external storage device (hard disk), flexible disk (FD), or PCMCIA card slot that stores boot programs, various applications, font data, user files, edit files, various data, etc. 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 to and communicates with an external device via a network, and executes communication control processing on the network. For example, communication using TCP / IP, a telephone line such as ISDN, and communication using a 3G line of a mobile phone are possible.

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

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

図3のフローチャートは、情報処理装置101のCPU201が所定の制御プログラムを読み出して実行する処理であり、帳票画像から表及びセルを抽出する処理を示すフローチャートである。 The flowchart of 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 of extracting a table and a cell from a form image.

ステップS301では、帳票画像の入力を受け付け、当該帳票画像から表領域を抽出する指示を受け付ける。帳票画像は、スキャナ102によってスキャンされた画像であり、ファイルサーバ103に一度記憶されたものを取得しても良いし、スキャナ102から直接取得しても良い。 In step S301, the input of the form image is accepted, and the instruction to extract the 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, a process for correcting the inclination generated during scanning (skew correction) is executed as a preprocessing for the tablespace extraction process. The skew correction is performed by using a known technique, and as an example, a correction using a Hough transform is known. Specifically, a straight line is detected by the Hough transform, and a horizontal straight line is selected from the detected straight line. Then, the average angle of the straight line in the horizontal direction is acquired, and the correction is performed by rotating the entire image based on the acquired average angle.
In step S303, the characters included in the form image are removed. The process of removing characters will be described with reference to FIG.

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

図6の601は、ステップS301で取得し、ステップS302で斜行補正を実行した帳票画像の一例である。 601 of 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 of FIG. 6 shows a form image of 601 that has been binarized, inverted, and then subjected to a morphology operation in the horizontal direction. By performing the Morphology operation, it is possible to remove a line segment that does not reach a certain length or longer. That is, only line segments having a certain length or longer remain, such as ruled lines, and line segments having a length less than a certain length, such as line segments constituting characters, are removed. As a result, characters are removed and only ruled lines are left. It will remain. If the threshold value of the length of the line segment to be removed is set too large, the original ruled line may be removed. Therefore, the threshold value of 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演算をかけたものを示している。 FIG. 603 of FIG. 6 shows a form image of 601 that has been binarized, inverted, and then subjected to a morphology operation in the vertical direction.

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

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

直線の検出にはHough変換を用いる。Hough変換を用いた直線検出によれば、同一直線上に一定数以上の画素が存在すれば、それらが連続していなくても直線として検出される。これにより、スキャン時にカスレが発生した場合や、ステップS303において罫線の一部が欠けた場合でも頑健に直線を検出することが可能となる。 The Hough transform is used to detect a straight line. According to the straight line detection using the Hough transform, if a certain number of pixels or more are present on the same straight line, they are detected as a straight line even if they are not continuous. As a result, it is possible to robustly detect a straight line even when blurring occurs during scanning or when a 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 shown in 701 of FIG. 7, the result as shown in FIG. 8 is obtained.

図8は、ステップS303の処理によって文字が除去された処理画像に対して、Hough変換によって直線を検出した図である。図8の例では、垂直直線v8001〜v8007、水平直線h8001〜h8007が検出されている。 FIG. 8 is a diagram in which a straight line is detected by the Hough transform on the processed image in which the characters are removed by the processing in 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 composed of these vertical straight lines and horizontal straight lines will be described as a ruled line candidate grid 802.

なお、本実施例においては上述の通り黒地に白の罫線となるが、ここでは便宜上、白地に黒の罫線とした図で説明する。 In this embodiment, as described above, a white ruled line is used on a black background, but here, for convenience, a figure in which a black ruled line is used on a white background will be described.

ステップ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 the vertical straight line and the horizontal straight line). Details of the evaluation of the intersection state will be described with reference to FIG.

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

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

図9の左側の801で示すものは、図8を拡大した図である。図9の右側の901で示すものは、801におけるC901の破線で示した領域に対応する処理画像である。 What is shown 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 region shown by the broken line of C901 in 801.

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

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

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

そして、交点評価の結果として、切り取った矩形領域の中心座標、サイズ、罫線が伸びている方向(領域が外周と接している方向)といった情報がそれぞれの交点に対して格納される。 Then, as a result of the intersection 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 circumference) is stored for each intersection.

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

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

ステップS306の表領域抽出処理の詳細は、図4、図5のフローチャートを用いて説明する。 The details of the tablespace extraction process in step S306 will be described with reference to the flowcharts of FIGS. 4 and 5.

図4のフローチャートで示す処理は、S402〜S409の処理を横方向の罫線候補に対して順次実行する処理である(S401)。なお、本実施例においては、処理画像の上部に位置する横方向罫線候補から順次処理していくものとする。 The process shown in the flowchart of FIG. 4 is a process of sequentially executing the processes of S402 to S409 for the horizontal ruled line candidates (S401). In this embodiment, the horizontal ruled line candidates located at the upper part 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. That is, it is recorded that the left end point is not detected. The left end point means "an intersection corresponding to the upper left corner of the table" and "an intersection corresponding to 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 intersections on the horizontal ruled line candidates to be processed. In this embodiment, the intersections 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 it has been detected (S404: YES), the process proceeds to step S408.

まだ検出されていない場合(S404:NO)は、処理をステップS405に移行する。 If it has not been detected yet (S404: NO), the process proceeds 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 or not the point is the left end point is made by using the information related to the "direction in which the ruled line extends" among the contents evaluated in step S305. Specifically, when the "direction in which the ruled line extends" is only two directions, "" right "and" bottom "", it is determined that the left end point is the upper left corner of the table. If the "direction in which the ruled line extends" is only two directions, "" right "and" top "", it is determined that the corner is the lower left corner of the table and is the left end point.

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

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

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

ステップS407では、表のスキャン方向を取得する。表のスキャン方向とは、ここから上下どちらの方向に表があると仮定して評価をするかというパラメータである。例えば図10のc1001は右と下方向に罫線が伸びているため、スキャン方向は下になる。また、図11のc1101は、右と上方向に罫線が伸びているため、スキャン方向は上になる。 In step S407, the scanning direction of the table is acquired. The scanning direction of the table is a parameter for evaluating by assuming that the table is in the vertical direction from here. For example, in c1001 of FIG. 10, since the ruled lines extend to the right and downward, the scanning direction is downward. Further, in c1101 of FIG. 11, since the ruled lines extend to the right and upward, 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 or not the point is the right end point is made by using the information related to the "direction in which the ruled line extends" among the contents evaluated in step S305. Specifically, when the "direction in which the ruled line extends" is only two directions, "" left "and" bottom "", it is determined that the right end point is the upper right corner of the table. If the "direction in which the ruled line extends" is only two directions, "" left "and" top "", it is determined that the corner is the lower right corner of the table and is the right end point.

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

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

図5のフローチャートでは、図4のフローチャートにおいて取得された横方向罫線と対になる横方向罫線(表の対辺となる横方向罫線)を確定するための処理であり、横方向の罫線候補に対して、ステップS502〜S504の処理を、ステップS407で取得した表スキャンの方向に順次実行する(ステップS501)。 The flowchart of FIG. 5 is a process for determining a horizontal ruled line (horizontal ruled line that is the opposite side of the table) that is paired with the horizontal ruled line acquired in the flowchart of FIG. 4, and is a process for determining the horizontal ruled line candidate. 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 is determined as an edge forming another table).

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

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

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

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

角点が含まれていない場合(ステップS503:NO)は、処理をステップS504に移行する。 If the corner points are not included (step S503: NO), the process proceeds 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. Here, the intersection c1003 is not evaluated as a corner point because the ruled line extends not only to "" left "and" top "" but also to "bottom". In order to recognize such a table, if a corner point is found from either the left or right side, the table should be confirmed at that point. If no corner point is found, the process proceeds to step S504.

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

「処理対象の横方向罫線に含まれる左右の端点」とは、図4のフローチャートにおいて取得した左端点と同一の縦方向罫線上の交点または右端点と同一の縦方向罫線上の交点であって、処理対象の横方向罫線に含まれる交点を意味する。また、罫線が外側に伸びているか否かは、当該端点における「罫線が伸びている方向」に基づき判断される。具体的には、左端点については左方向に罫線が伸びている場合に、外側に罫線が伸びていると判定される。同様に、右端点については、右方向に罫線が伸びている場合に、外側に罫線が伸びていると判定される。 The "left and right end points included in the horizontal ruled line to be processed" are intersections on the same vertical ruled line as the left end point acquired in the flowchart of FIG. 4 or intersections 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, when the ruled line extends to the left with respect to the left end point, it is determined that the ruled line extends to the outside. Similarly, with respect to the right end point, when the ruled line extends to the right, it is determined that the ruled line extends outward.

「罫線が外側に伸びている端点」が存在すると判定された場合(ステップS504:YES)は、処理をステップS505に移行し、これまでにスキャン済みの領域(図4の処理で取得した横方向罫線と、S504でYESと判定された横方向罫線とにより形成される領域)を表領域として確定し記憶する。 When it is determined that there is an "end point where the ruled line extends outward" (step S504: YES), the process is shifted to step S505, and the area scanned so far (horizontal direction acquired by the process of FIG. 4). The area formed by the ruled line and the horizontal ruled line determined to be 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 from the intersection c1103 toward the outside (left side), the scan of the table is stopped 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 the horizontal ruled line that is the opposite side of the table. Move the processing target to the horizontal ruled line.

なお、すべての横方向罫線についてS502〜S504の処理を実行しても表の対辺となる横方向罫線が見つからなかった場合は、表領域が存在しないと判定し、本フローチャートの処理を終了する(S507)。例えば、図4のフローチャートにおいて取得された右端点及び左端点がノイズによる誤検出であった場合に、このような処理となる。 If the horizontal ruled lines that are the opposite sides of the table are not found even after executing the processes of S502 to S504 for all the 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 the left end point acquired in the flowchart of FIG. 4 are erroneous detections 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 proceeds to step S401 in FIG. Regarding the processing after S402 after the processing of step S506 is executed, only the horizontal ruled line candidates for which the processing of S502 to S504 has not been executed may be the processing target.

以上の処理により、S301で表抽出要求を受付けた帳票画像から表領域を抽出することが可能となる。 By the above processing, the table area can be extracted from the form image for which the table extraction request is received in S301.

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

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

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

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

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

ステップ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 it has been detected (step S1304: YES), the process proceeds to step S1308.

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

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

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

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

ステップS1306では、左端点の検出状況を示すフラグをYESに設定する。そして、次の交点(一つ右の交点)に処理を移行する(S1307)。図12の例では、交点c1202に処理対象を移行する。 In step S1306, the flag indicating the detection status of the left end point is set to YES. Then, the process shifts to the next intersection (one right intersection) (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 intersection at the upper right of the cell). Specifically, the determination of whether or not the intersection is at the upper right of the cell is made when the direction of the ruled line extending from the intersection includes "" left "and" bottom "" (if the left and bottom are included, it extends to the right or above. Even if there is a ruled line, it is determined to be the rightmost point), and the intersection is determined to be the intersection at the upper right of the cell. In the example of FIG. 12, it is determined that the intersection c1202 is the right end point.

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

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

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

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

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

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

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

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

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

そして、ステップS1314で左端点の検出フラグをNOとして、処理をS1303に戻す。
以上がセル領域を検出する処理である。
なお、本実施例において表領域やセル領域を検出・特定する際に、横方向(水平方向)の罫線を基準に説明したが、縦方向(垂直方向)の罫線を基準に処理を実行しても良い。
Then, in step S1314, the detection flag at the left end point is set to NO, and the process is returned to S1303.
The above is the process of detecting the cell area.
In this embodiment, when the table area and the cell area are detected and specified, the horizontal (horizontal) ruled lines are used as a reference, but the processing is executed based on the vertical (vertical) ruled lines. Is 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, it may be applied to a system composed of a plurality of devices, or may be applied to a device composed of one device.

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

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

この場合、記録媒体から読み出されたプログラム自体が本発明の新規な機能を実現することになり、そのプログラムを記録した記録媒体は本発明を構成することになる。 In this case, the program itself read from the recording medium realizes 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、シリコンディスク等を用いることが出来る。 Recording media for supplying programs include, for example, 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(オペレーティングシステム)等が実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。 Further, by executing the program read by the computer, not only the function of the above-described embodiment is realized, but also the OS (operating system) or the like running on the computer is actually operated based on the instruction of the program. Needless to say, there are cases where a part or all of the processing is performed and the processing realizes the functions of the above-described embodiment.

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

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

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

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

Claims (9)

表を含む画像を取得する取得手段と、
前記取得された画像から、表の罫線の候補となる直線を検出する検出手段と、
前記検出された罫線同士の各交点について、当該交点から罫線が延びる方向を特定する罫線方向特定手段と、
前記特定手段により特定された罫線が延びる方向を用いて、前記画像に含まれる表の領域を特定する表領域特定手段と、
を備えることを特徴とする情報処理装置。
An acquisition method for acquiring an image including a table, and
A detection means for detecting a straight line that is a candidate for a ruled line in a table from the acquired image,
For each intersection of the detected ruled lines, a ruled line direction specifying means for specifying a direction in which the ruled line extends from the intersection, and a ruled line direction specifying means.
A table area specifying means for specifying a table area included in the image by using the direction in which the ruled line specified by the specifying means extends.
An information processing device characterized by being equipped with.
前記表領域特定手段は、前記罫線方向特定手段により特定された罫線が延びる方向に基づき検出される、表の四隅を形成する交点に基づき、表領域を特定することを特徴とする請求項1に記載の情報処理装置。 The first aspect of claim 1, wherein the tablespace specifying means specifies a tablespace based on intersections forming four corners of a table, which are detected based on a direction in which a ruled line specified by the ruled line direction specifying means extends. The information processing device described. 前記交点のうち、前記罫線方向特定手段により特定された罫線が延びる方向に基づき、表の左上および右上の角を形成する交点を特定する角点特定手段と、
前記角点特定手段により特定された角点から形成される辺の対辺となる辺を特定する対辺特定手段と、
を備え、
前記表領域特定手段は、前記角点特定手段により特定された角点から形成される辺と、前記対辺特定手段により特定された対辺とからなる領域を表領域として特定することを特徴とする請求項1または2に記載の情報処理装置。
Among the intersections, the corner point specifying means for specifying the intersections forming the upper left and upper right corners of the table based on the direction in which the ruled line specified by the ruled line direction specifying means extends.
The opposite side specifying means for specifying the opposite side of the side formed from the corner points specified by the corner point specifying means, and the opposite side specifying means.
With
The tablespace specifying means is characterized in that a region including a side formed from a corner point specified by the corner point specifying means and a opposite side specified by the opposite side specifying means is specified as a table area. Item 2. The information processing apparatus according to item 1 or 2.
前記交点のうち、前記罫線方向特定手段により特定された罫線が延びる方向に基づき、表の左下および右下の角を形成する交点を特定する角点特定手段と、
前記角点特定手段により特定された角点から形成される辺の対辺となる辺を特定する対辺特定手段と、
を備え、
前記表領域特定手段は、前記角点特定手段により特定された角点から形成される辺と、前記対辺特定手段により特定された対辺とからなる領域を表領域として特定することを特徴とする請求項1または2に記載の情報処理装置。
Among the intersections, the corner point specifying means for specifying the intersections forming the lower left and lower right corners of the table based on the direction in which the ruled line specified by the ruled line direction specifying means extends.
The opposite side specifying means for specifying the opposite side of the side formed from the corner points specified by the corner point specifying means, and the opposite side specifying means.
With
The tablespace specifying means is characterized in that a region including a side formed from a corner point specified by the corner point specifying means and a opposite side specified by the opposite side specifying means is specified as a table area. Item 2. The information processing apparatus according to item 1 or 2.
前記対辺特定手段は、前記前記角点特定手段により特定された角点から形成される辺と並行な辺であって、表の四隅を形成する交点を含む辺を、対辺として特定することを特徴とする請求項3または4に記載の情報処理装置。 The opposite side specifying means is a side parallel to the side formed from the corner points specified by the corner point specifying means, and is characterized in that the side including the intersection forming the four corners of the table is specified as the opposite side. The information processing apparatus according to claim 3 or 4. 前記対辺特定手段は、前記前記角点特定手段により特定された角点から形成される辺と並行な辺であって、外側に向かって延びる罫線がある交点を含む辺を、対辺として特定することを特徴とする請求項3乃至5のいずれか1項に記載の情報処理装置。 The opposite side specifying means specifies a side parallel to the side formed from the corner points specified by the corner point specifying means and including an intersection having a ruled line extending outward as the opposite side. The information processing apparatus according to any one of claims 3 to 5, wherein the information processing apparatus is characterized. 前記表領域特定手段により特定された表領域に含まれる交点の罫線が延びる方向に基づき、当該表領域のセルを特定する特定手段をさらに備えることを特徴とする請求項1乃至6のいずれか1項に記載の情報処理装置。 Any one of claims 1 to 6, further comprising a specific means for specifying a cell in the tablespace based on a direction in which a ruled line of an intersection included in the tablespace specified by the tablespace specifying means extends. The information processing device described in the section. 情報処理装置の取得手段が、表を含む画像を取得する取得工程と、
前記情報処理装置の検出手段が、前記取得された画像から、表の罫線の候補となる直線を検出する検出工程と、
前記情報処理装置の罫線方向特定手段が、前記検出された罫線同士の各交点について、当該交点から罫線が延びる方向を特定する罫線方向特定工程と、
前記情報処理装置の表領域特定手段が、前記特定工程により特定された罫線が延びる方向を用いて、前記画像に含まれる表の領域を特定する表領域特定工程と、
を備えることを特徴とする情報処理方法。
The acquisition process of acquiring the image including the table by the acquisition means of the information processing device,
A detection step in which the detection means of the information processing device detects a straight line as a candidate for a ruled line in a table from the acquired image.
The ruled line direction specifying means of the information processing apparatus has a ruled line direction specifying step of specifying a direction in which a ruled line extends from the intersection of each of the detected ruled lines.
A tablespace specifying step in which the tablespace specifying means of the information processing apparatus specifies a table area included in the image by using the direction in which the ruled line specified by the specifying step extends.
An information processing method characterized by being provided with.
コンピュータを、
表を含む画像を取得する取得手段と、
前記取得された画像から、表の罫線の候補となる直線を検出する検出手段と、
前記検出された罫線同士の各交点について、当該交点から罫線が延びる方向を特定する罫線方向特定手段と、
前記特定手段により特定された罫線が延びる方向を用いて、前記画像に含まれる表の領域を特定する表領域特定手段として機能させるためのプログラム。
Computer,
An acquisition method for acquiring an image including a table, and
A detection means for detecting a straight line that is a candidate for a ruled line in a table from the acquired image,
For each intersection of the detected ruled lines, a ruled line direction specifying means for specifying a direction in which the ruled line extends from the intersection, and a ruled line direction specifying means.
A program for functioning as a table area specifying means for specifying a table area included in the image by using the direction in which the ruled line specified by the specific means extends.
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 processor, information processing method, and 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 processor, information processing method, and program

Publications (3)

Publication Number Publication Date
JP2021096543A true JP2021096543A (en) 2021-06-24
JP2021096543A5 JP2021096543A5 (en) 2022-12-23
JP7425288B2 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 processor, information processing method, and program

Family Applications After (1)

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

Country Status (1)

Country Link
JP (2) JP7425288B2 (en)

Cited By (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 (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09288714A (en) * 1996-04-19 1997-11-04 Hitachi Ltd Method and device for recognizing table
JPH1153466A (en) * 1997-07-31 1999-02-26 Hitachi Ltd Table recognizing method
JP2007213255A (en) * 2006-02-08 2007-08-23 Fujitsu Ltd Table recognition device and computer program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09288714A (en) * 1996-04-19 1997-11-04 Hitachi Ltd Method and device for recognizing table
JPH1153466A (en) * 1997-07-31 1999-02-26 Hitachi Ltd Table recognizing method
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), JPN6023042498, 2007, pages 117 - 125, ISSN: 0005174387 *

Cited By (2)

* 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
JP2023070290A (en) * 2021-11-09 2023-05-19 西松建設株式会社 Rebar arrangement list reader, list reader, rebar arrangement list reading method and program

Also Published As

Publication number Publication date
JP2024038417A (en) 2024-03-19
JP7425288B2 (en) 2024-01-31

Similar Documents

Publication Publication Date Title
US6356655B1 (en) Apparatus and method of bitmap image processing, storage medium storing an image processing program
JP5423525B2 (en) Handwriting input device, handwriting input method, and handwriting input program
US9384405B2 (en) Extracting and correcting image data of an object from an image
US8218890B2 (en) Method and apparatus for cropping images
JP2024038417A (en) Information processor, information processing method, and program
CN107133615B (en) Information processing apparatus, information processing method, and computer program
US6711292B2 (en) Block selection of table features
US7796817B2 (en) Character recognition method, character recognition device, and computer product
CN111630522A (en) Entry region extraction device and entry region extraction program
US20130300676A1 (en) Electronic device, and handwritten document display method
US10452943B2 (en) Information processing apparatus, control method of information processing apparatus, and storage medium
US10684772B2 (en) Document viewing apparatus and program
US20130229341A1 (en) Handwriting input device and computer-readable medium
WO2018184255A1 (en) Image correction method and device
US9678642B2 (en) Methods of content-based image area selection
JP2021043775A (en) Information processing device and program
JP6156740B2 (en) Information display device, input information correction program, and input information correction method
JP7031389B2 (en) Information processing equipment and programs
JP5917461B2 (en) Information processing apparatus and program
US8589416B2 (en) System and method of performing data processing on similar forms
US20210303842A1 (en) Information processing device and non-transitory computer readable medium
JP6373664B2 (en) Electronic device, method and program
JP7417116B2 (en) Information processing system, information processing method, program
JP2013149210A (en) Image processing program, image processing method and image processor
JP2021043680A (en) Information processing device and information processing program

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