JP6691455B2 - Form processing program, form processing device, and form processing method - Google Patents

Form processing program, form processing device, and form processing method Download PDF

Info

Publication number
JP6691455B2
JP6691455B2 JP2016161949A JP2016161949A JP6691455B2 JP 6691455 B2 JP6691455 B2 JP 6691455B2 JP 2016161949 A JP2016161949 A JP 2016161949A JP 2016161949 A JP2016161949 A JP 2016161949A JP 6691455 B2 JP6691455 B2 JP 6691455B2
Authority
JP
Japan
Prior art keywords
cell
image
form image
ruled line
counting
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
JP2016161949A
Other languages
Japanese (ja)
Other versions
JP2018032076A (en
Inventor
昌昭 小澤
昌昭 小澤
将平 長谷川
将平 長谷川
武志 馬路
武志 馬路
健敏 落合
健敏 落合
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Frontech Ltd
Original Assignee
Fujitsu Frontech Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Frontech Ltd filed Critical Fujitsu Frontech Ltd
Priority to JP2016161949A priority Critical patent/JP6691455B2/en
Publication of JP2018032076A publication Critical patent/JP2018032076A/en
Application granted granted Critical
Publication of JP6691455B2 publication Critical patent/JP6691455B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Character Input (AREA)

Description

本発明は、光学的に読み取った帳票の帳票画像から所定の文字認識項目の文字認識処理を行うための帳票処理プログラム、帳票処理装置及び帳票処理方法に関する。   The present invention relates to a form processing program, a form processing apparatus, and a form processing method for performing character recognition processing of a predetermined character recognition item from a form image of an optically read form.

従来、金融機関や公共機関をはじめとする様々な組織において、各種の帳票が利用されている。例えば、銀行等では、帳票をスキャナ等の画像読取装置で読み取り、読み取り結果の帳票画像からOCR(光学式文字読取:Optical Character Reader)処理によりテキスト情報を得ることが行われている。これにより、銀行員によるデータ入力などの事務処理を効率化させることが図られている。   Conventionally, various forms have been used in various organizations such as financial institutions and public institutions. For example, in banks and the like, a form is read by an image reading device such as a scanner, and text information is obtained from a read form image by OCR (Optical Character Reader) processing. As a result, it is attempted to improve the efficiency of clerical processing such as data entry by bankers.

帳票画像を文字認識する処理にあたっては、帳票が正立の状態で読取装置による読み取りを行う必要がある。したがって、帳票を読取装置にセットする際は、運用ルールに則り行員等のオペレータが帳票を正立状態にしている。   In the process of character-recognizing a form image, it is necessary to read the form image with a reading device in an upright state. Therefore, when setting the form on the reading device, an operator such as a clerk puts the form upright according to the operation rule.

近年、振込業務(為替)/税金・公金収納業務の銀行負担が大きいことから、行員オペレータを介さず顧客自身が振込操作を行うセルフ化が検討されている。ところが、顧客自身によるオペレーションでは、帳票を正立にセットする運用ルールが適用できず、正立ではない方向で読取装置にセットされる場合がある。そのため、文字認識処理を実行する前に、帳票が正立か否かを判断し、正立でない場合は正立になるように帳票を回転させる必要がある。   In recent years, since the bank burden of the transfer business (exchange) / tax / public money storage business is large, it is considered that the customer himself / herself performs the transfer operation without going through the bank operator. However, in the operation by the customer himself, the operation rule for setting the form upright cannot be applied, and it may be set in the reading device in a direction not upright. Therefore, it is necessary to determine whether or not the form is upright before executing the character recognition process, and rotate the form so that it is upright if it is not upright.

例えば、文字認識した文字列の正立判定結果に基づいて帳票自身が正立か否かを判断する技術がある。また、文字列の偏りや、帳票を構成するセルが縦長なのか横長なのかの特徴を抽出し、帳票の挿入方向が正方向、右90度、左90度、逆方向のいずれであるかを判定する技術が開示されている(例えば、特許文献1を参照。)。   For example, there is a technique that determines whether or not the form itself is upright based on the result of upright determination of the character string that has been recognized. In addition, the deviation of the character string and the characteristics of whether the cells that form the form are vertically long or horizontally long are extracted, and whether the insertion direction of the form is forward, right 90 degrees, left 90 degrees, or reverse direction is extracted. A technique for making a determination is disclosed (for example, see Patent Document 1).

特開平11−102416号公報JP, 11-102416, A

しかしながら、帳票を構成するセルの組合せは複雑であり、格子状の規則正しい表形式のみで構成される帳票ばかりであるとは限らない。また、セル内に記載された文字列が小さいため、文字列による正立判定ができない帳票もある。このような、複雑な表構造の帳票であったり、文字列が小さ過ぎたりする帳票の場合に、画像読取装置に読み取らせた帳票の正立判定ができない、という問題点があった。   However, the combination of cells forming the form is complicated, and it is not always the case that the form is formed only by a grid-like regular table format. In addition, since the character string written in the cell is small, there is a form in which erect determination cannot be performed based on the character string. In the case of such a form having a complicated table structure or a form in which the character string is too small, there is a problem that the erecting of the form read by the image reading device cannot be determined.

本発明は、上述のような実状に鑑みたものであり、複雑な表構造の帳票であったり、文字列が小さ過ぎたりする帳票であっても、画像読取装置に読み取らせた帳票の正立判定を行うことが可能な帳票処理プログラム、帳票処理装置及び帳票処理方法を提供することを目的とする。   The present invention has been made in view of the above situation, and even if the form is a form having a complicated table structure or a character string is too small, the erect form of the form read by the image reading device is upright. An object is to provide a form processing program, a form processing device, and a form processing method capable of making a determination.

本発明は、上記課題を解決するため、下記のような構成を採用した。
すなわち、本発明の一態様によれば、本発明の帳票処理プログラムは、帳票処理装置のコンピュータを、帳票画像を画像読取装置に読み取らせる画像読取手段、前記画像読取手段によって読み取らせた帳票画像から縦横罫線を抽出する罫線抽出手段、前記罫線抽出手段によって抽出された縦横罫線に基づいて(で構成された(略囲われた))セル領域を認識するセル領域認識手段、前記セル領域認識手段によって認識されたすべてのセル領域について、前記帳票画像が正立である可能性のある複数通りの所定の形状パターンの内いずれかに該当するかを判断することにより、前記形状パターン毎に前記該当するセル領域の数を計数するセル形状パターン計数手段、前記セル形状パターン計数手段によ計数結果に基づいて、前記帳票画像が正立であるか否かを判断する帳票画像正立判断手段、として機能させるための帳票処理プログラムである。
The present invention adopts the following configurations in order to solve the above problems.
That is, according to one aspect of the present invention, the form processing program of the present invention is configured such that the computer of the form processing apparatus reads an image reading device from an image reading unit, and a form image read by the image reading unit. Ruled line extraction means for extracting vertical and horizontal ruled lines, cell area recognition means for recognizing (composed of (enclosed by)) cell areas based on the vertical and horizontal ruled lines extracted by the ruled line extraction means, and by the cell area recognition means for recognized all cells regions, by determining whether falling under one of the predetermined shape pattern of plural kinds which may the form image is upright, the corresponding said each shape pattern cell shape pattern counting means for counting the number of cell regions that, on the basis of the by that counting result to the cell shape pattern counting means, said form image Form image erecting determining means for determining whether in a standing, a form processing program for functioning as a.

また、本発明の帳票プログラムは、前記セル形状パターン計数手段が、前記帳票画像の上下左右の4方向の各々について、前記各形状パターン毎に前記該当するセル領域の数を計数して各方向の計数結果を算出し、前記帳票画像正立判断手段が、前記各方向の計数結果が最大値の方向を、前記帳票画像が正立であると判断することが望ましい。 Moreover, the form program of the present invention, the cell shape pattern counting means, wherein for each four directions of up, down, left, and right of the form image, by counting the number of cell regions of the corresponding said each shape pattern, each direction It is preferable that the form image erect determination unit determines that the form image is upright in the direction in which the count result in each direction has the maximum value.

また、本発明の帳票処理プログラムは、前記コンピュータを、更に、前記帳票画像正立判断手段によって前記帳票画像が正立でないと判断された場合、前記帳票画像を(90、180、270度)回転させる帳票画像回転手段として機能させ、前記帳票画像回転手段によって回転させた帳票画像に対して、前記罫線抽出手段および前記セル領域認識手段を実行することが望ましい。   Further, the form processing program of the present invention causes the computer to further rotate the form image (90, 180, 270 degrees) when the form image upright determination unit determines that the form image is not upright. It is preferable that the ruled line extracting means and the cell area recognizing means are executed for the form image rotated by the form image rotating means, and function as the form image rotating means.

また、本発明の帳票処理プログラムは、前記帳票画像が、独自にレイアウトした私製帳票の読み取り画像であることが望ましい。   Further, in the form processing program of the present invention, it is preferable that the form image is a read image of a privately-made form that is uniquely laid out.

また、本発明の一態様によれば、本発明の帳票処理装置は、帳票画像を画像読取装置に読み取らせる画像読取部と、前記画像読取部によって読み取らせた帳票画像から縦横罫線を抽出する罫線抽出部と、前記罫線抽出部によって抽出された縦横罫線に基づいてセル領域を認識するセル領域認識部と、前記セル領域認識部によって認識されたすべてのセル領域について、前記帳票画像が正立である可能性のある複数通りの所定の形状パターンの内いずれかに該当するかを判断することにより、前記形状パターン毎に前記該当するセル領域の数を計数するセル形状パターン計数部と、前記セル形状パターン計数部によ計数結果に基づいて、前記帳票画像が正立であるか否かを判断する帳票画像正立判断部とを備えることを特徴とする。 Further, according to one aspect of the present invention, the form processing apparatus of the present invention includes an image reading unit that causes an image reading device to read a form image, and ruled lines that extract vertical and horizontal ruled lines from the form image read by the image reading unit. An extraction unit, a cell region recognition unit that recognizes a cell region based on vertical and horizontal ruled lines extracted by the ruled line extraction unit, and all the cell regions recognized by the cell region recognition unit , the form image is upright. A cell shape pattern counter that counts the number of the corresponding cell regions for each shape pattern by determining which of the plurality of possible predetermined shape patterns there is, and based on by that counted result in cell shape pattern counting section, characterized in that it comprises a form image erecting determination unit which the form image to determine whether it is upright.

また、本発明の一態様によれば、本発明の帳票処理方法は、帳票処理装置において実行される帳票処理方法であって、帳票画像を画像読取装置に読み取らせ、前記読み取らせた帳票画像から縦横罫線を抽出し、前記抽出された縦横罫線に基づいてセル領域を認識し、前記認識されたすべてのセル領域について、前記帳票画像が正立である可能性のある複数通りの所定の形状パターンの内いずれかに該当するかを判断することにより、前記形状パターン毎に前記該当するセル領域の数を計数し、前記計数の結果に基づいて、前記帳票画像が正立であるか否かを判断することを特徴とする。 According to one aspect of the present invention, the form processing method of the present invention is a form processing method executed in a form processing device, wherein a form image is read by an image reading device, and the read form image is read from the read form image. Vertical and horizontal ruled lines are extracted, cell regions are recognized based on the extracted vertical and horizontal ruled lines, and a plurality of predetermined shape patterns in which the form image may be upright for all the recognized cell regions The number of the corresponding cell regions is counted for each of the shape patterns by determining which one of the above, and whether or not the form image is upright based on the result of the counting . It is characterized by determining.

本発明によれば、複雑な表構造の帳票であったり、文字列が小さ過ぎたりする帳票であっても、画像読取装置に読み取らせた帳票の正立判定を行うことができる。   According to the present invention, it is possible to determine whether a form read by the image reading apparatus is upright even if the form has a complicated table structure or the character string is too small.

本実施の形態における帳票処理装置の外観を示す図である。It is a figure which shows the external appearance of the form processing apparatus in this Embodiment. 本実施の形態における帳票処理装置の構成を示す図である。It is a figure which shows the structure of the form processing apparatus in this Embodiment. 本実施の形態における帳票処理装置のハードウェア構成図である。It is a hardware block diagram of the form processing apparatus in this Embodiment. 本実施の形態における帳票処理装置の機能ブロック図である。It is a functional block diagram of the form processing apparatus in this Embodiment. セル領域のデータ構造を説明するための図である。It is a figure for demonstrating the data structure of a cell area. 正立の可能性があるセル領域の形状パターンを示す図である。It is a figure which shows the shape pattern of the cell area | region which may be upright. 帳票の例を示す図である。It is a figure which shows the example of a form. 本実施の形態における帳票処理の操作フローチャートである。7 is an operation flowchart of form processing according to the present embodiment. 本実施の形態における認識処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the recognition process in this Embodiment. 抽出された縦横罫線の例を示す図である。It is a figure which shows the example of the vertical and horizontal ruled lines extracted. 抽出されたセル領域の例を示す図である。It is a figure which shows the example of the extracted cell area | region. セルテーブルの例を示す図である。It is a figure which shows the example of a cell table. 認識処理のサブルーチン「イメージ自動正立判定/回転処理」の流れを示すフローチャートである。It is a flow chart which shows a flow of a subroutine "image automatic upright determination / rotation processing" of recognition processing. セル領域のカウントの例を示す図である。It is a figure which shows the example of a count of a cell area. イメージ自動正立判定/回転処理のサブルーチン「表形状特徴カウント処理」の流れを示すフローチャートである。It is a flow chart which shows a flow of a subroutine "table shape feature count processing" of image automatic upright determination / rotation processing. 第1乃至第4のカウント処理の対象となるセル領域の例を示す図である。It is a figure which shows the example of the cell area used as the object of the 1st thru | or 4th counting process. 表形状特徴カウント処理のサブルーチン「第1のカウント処理」の流れを示すフローチャートである。It is a flow chart which shows a flow of a subroutine "first count processing" of table shape feature count processing. 表形状特徴カウント処理のサブルーチン「第2のカウント処理」の流れを示すフローチャートである。It is a flow chart which shows a flow of a subroutine "second count processing" of table shape feature count processing. 表形状特徴カウント処理のサブルーチン「第3のカウント処理」の流れを示すフローチャートである。It is a flow chart which shows a flow of a subroutine "third count processing" of table shape feature count processing. 表形状特徴カウント処理のサブルーチン「第4のカウント処理」の流れを示すフローチャート(その1)である。It is a flowchart (the 1) which shows the flow of a subroutine "4th count process" of a table shape feature count process. 表形状特徴カウント処理のサブルーチン「第4のカウント処理」の流れを示すフローチャート(その2)である。It is a flowchart (the 2) which shows the flow of the subroutine "4th count process" of a table shape feature count process. 表形状特徴カウント処理の結果を示す図である。It is a figure which shows the result of the table shape feature count process. 帳票画像の回転例を示す図である。It is a figure which shows the example of rotation of a form image.

以下、本発明の実施の形態について、図面を参照しながら詳細に説明する。
図1は、本実施の形態における帳票処理装置の外観を示す図である。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
FIG. 1 is a diagram showing the external appearance of the form processing apparatus according to the present embodiment.

図1において、帳票処理装置1は、表示装置2および画像読取装置3を備える。ここで、本実施の形態の帳票処理装置1は、例えば金融機関や公共機関等における帳票処理に用いられている。   In FIG. 1, the form processing device 1 includes a display device 2 and an image reading device 3. Here, the form processing apparatus 1 according to the present embodiment is used for form processing in, for example, a financial institution or a public institution.

画像読取装置3は、例えば、イメージスキャナであり、帳票を光学的に読み取り、表示装置2に送出する。   The image reading device 3 is, for example, an image scanner, optically reads a form, and sends it to the display device 2.

表示装置2は、例えば、タッチパネル等の各種ディスプレイを備え、画像読取装置3が読み取った帳票の画像を含む各種の情報を画面に表示する。利用者は、表示装置2に表示された情報に基づいて、画面をタッチ(押下)することで、各種の操作を行うことができる。   The display device 2 includes, for example, various displays such as a touch panel, and displays various information including the image of the form read by the image reading device 3 on the screen. The user can perform various operations by touching (pressing) the screen based on the information displayed on the display device 2.

帳票処理装置1は、例えば、ワークステーション、サーバ、パーソナルコンピュータ等のコンピュータの機能を備えており、後述する帳票処理を実行する。   The form processing apparatus 1 has computer functions such as a workstation, a server, and a personal computer, and executes a form process described later.

図2は、本実施の形態における帳票処理装置の構成を示す図である。
図2において、帳票処理装置1は、制御部20、スキャナ制御部21、文字認識処理部22、罫線解析処理部23、帳票認識処理部24、イメージ正立判定処理部25、及びイメージ回転処理部26を備える。
FIG. 2 is a diagram showing a configuration of the form processing apparatus according to the present embodiment.
In FIG. 2, the form processing apparatus 1 includes a control unit 20, a scanner control unit 21, a character recognition processing unit 22, a ruled line analysis processing unit 23, a form recognition processing unit 24, an image upright determination processing unit 25, and an image rotation processing unit. 26 is provided.

制御部20は、スキャナ制御部21、文字認識処理部22、罫線解析処理部23、帳票認識処理部24、イメージ正立判定処理部25、及びイメージ回転処理部26による一連の処理を制御する。   The control unit 20 controls a series of processes by the scanner control unit 21, the character recognition processing unit 22, the ruled line analysis processing unit 23, the form recognition processing unit 24, the image upright determination processing unit 25, and the image rotation processing unit 26.

スキャナ制御部21は、画像読取装置3を制御し、帳票の記載面を帳票画像データとして取得する。   The scanner control unit 21 controls the image reading device 3 and acquires the description surface of the form as form image data.

文字認識処理部22は、スキャナ制御部21によって取得した帳票画像データから、帳票記載面に記載されている文字を認識する。文字の認識には、文字認識辞書27を使用する。この文字認識処理は、公知の文字認識技術を使用することが可能であるので、詳細な説明は省略する。   The character recognition processing unit 22 recognizes the characters written on the form writing surface from the form image data acquired by the scanner control unit 21. The character recognition dictionary 27 is used for character recognition. A well-known character recognition technique can be used for this character recognition processing, and thus a detailed description thereof will be omitted.

罫線解析処理部23は、スキャナ制御部21によって取得した帳票画像データから、帳票記載面に記載されている罫線を認識する。   The ruled line analysis processing unit 23 recognizes the ruled line described on the form entry surface from the form image data acquired by the scanner control unit 21.

帳票認識処理部24は、罫線解析処理部23によって認識された罫線に囲われた領域を認識し、見出しテーブル28を参照して領域内の記載内容を認識する。   The form recognition processing unit 24 recognizes the area surrounded by the ruled line recognized by the ruled line analysis processing unit 23, and refers to the heading table 28 to recognize the description content in the area.

イメージ正立判定処理部25は、スキャナ制御部21によって取得した帳票画像データに基づき、セル形状パターンを参照して帳票が正立して画像読取装置3に読み取られたのか否かを判定する。   The image upright determination processing unit 25 refers to the form image data acquired by the scanner control unit 21 and refers to the cell shape pattern to determine whether the form is upright and read by the image reading device 3.

イメージ回転処理部26は、イメージ正立判定処理部25によって帳票が正立して読み取られていないと判定された場合、帳票画像を回転させる。   The image rotation processing unit 26 rotates the form image when the image upright determination processing unit 25 determines that the form is not upright.

図3は、本実施の形態における帳票処理装置のハードウェア構成図である。
図3において、帳票処理装置1は、CPU(Central Processing Unit)31、入力装置32、出力装置33、ROM(Read Only Memory)34、RAM(Random Access Memory)35、インターフェース(I/F)36がバス37に接続されて構成されている。
FIG. 3 is a hardware configuration diagram of the form processing apparatus according to the present embodiment.
In FIG. 3, the form processing apparatus 1 includes a CPU (Central Processing Unit) 31, an input device 32, an output device 33, a ROM (Read Only Memory) 34, a RAM (Random Access Memory) 35, and an interface (I / F) 36. It is configured to be connected to the bus 37.

入力装置32は、例えば、画像読取装置3を含むイメージスキャナ、キーボード、ジョイスティック、ライトペン、マウス、タッチパッド、タッチパネル、トラックボール等、帳票画像を含む各種のデータや信号等を入力する。   The input device 32 inputs various data and signals including a form image, such as an image scanner including the image reading device 3, a keyboard, a joystick, a light pen, a mouse, a touch pad, a touch panel, and a trackball.

出力装置33は、例えば、表示装置2を含むLCD(Liquid Crystal Display)等の各種ディスプレイ、プリンタ等であり、画像やその他の情報を出力する。   The output device 33 is, for example, various displays such as an LCD (Liquid Crystal Display) including the display device 2 and a printer, and outputs an image and other information.

ROM34は、帳票処理装置1において実行する帳票処理を実行するプログラムの他、帳票処理装置1の各機能を制御し実行するための制御プログラム及びテーブルデータなどを格納する。   The ROM 34 stores a program for executing form processing executed in the form processing apparatus 1, a control program for controlling and executing each function of the form processing apparatus 1, table data, and the like.

RAM35は、出力装置33用のフレームバッファや一部のアプリケーションプログラム等を格納する。   The RAM 35 stores a frame buffer for the output device 33, some application programs, and the like.

インターフェース36は、USB(Universal Serial Bus)等のシリアルインターフェースやイーサネット(登録商標)等のパラレルインターフェース等、外部機器と接続するためのユニットである。   The interface 36 is a unit for connecting to an external device such as a serial interface such as USB (Universal Serial Bus) or a parallel interface such as Ethernet (registered trademark).

CPU31は、これらの各部を制御する。
本実施の形態における帳票処理は、前述した帳票処理装置1によって実行される。
The CPU 31 controls each of these parts.
The form processing in this embodiment is executed by the form processing apparatus 1 described above.

図4は、本実施の形態における帳票処理装置の機能ブロック図である。図5は、セル領域のデータ構造を説明するための図である。図6は、正立の可能性があるセル領域の形状パターンを示す図である。   FIG. 4 is a functional block diagram of the form processing apparatus according to the present embodiment. FIG. 5 is a diagram for explaining the data structure of the cell area. FIG. 6 is a diagram showing a shape pattern of a cell region that may be upright.

図4において、帳票処理装置1は、画像読取部41、罫線抽出部42、セル領域認識部43、セル形状パターン計数部44、帳票画像正立判断部45、および帳票画像回転部46を備える。帳票処理装置1は、コンピュータの機能を備えており、帳票処理プログラムに従って後述する帳票処理を実行する。帳票処理装置1は、金融機関や公共機関をはじめとする様々な組織において使用する、各種の帳票を処理する。処理する帳票は、例えば、独自にレイアウトした私製帳票を含む。   4, the form processing apparatus 1 includes an image reading unit 41, a ruled line extraction unit 42, a cell area recognition unit 43, a cell shape pattern counting unit 44, a form image upright determination unit 45, and a form image rotation unit 46. The form processing apparatus 1 has a computer function and executes a form process described later according to a form processing program. The form processing apparatus 1 processes various forms used in various organizations such as financial institutions and public institutions. The form to be processed includes, for example, a privately-made form that is uniquely laid out.

画像読取部41は、イメージスキャナ等の画像読取装置3に帳票を読み取らせて帳票画像を取得する。   The image reading unit 41 causes the image reading device 3 such as an image scanner to read the form and obtains the form image.

罫線抽出部42は、画像読取部41によって読み取らせた帳票画像から縦罫線および横罫線を抽出する。例えば、縦罫線であれば、縦方向に連続する画素、すなわち縦方向の直線があるか否かを抽出し、その結果を縦罫線抽出結果として出力する。また、横罫線であれば、横方向に連続する画素、すなわち横方向の直線があるか否かを抽出し、その結果を横罫線抽出結果として出力する。   The ruled line extracting unit 42 extracts vertical ruled lines and horizontal ruled lines from the form image read by the image reading unit 41. For example, in the case of a vertical ruled line, it is extracted whether or not there are pixels continuous in the vertical direction, that is, whether there is a straight line in the vertical direction, and the result is output as a vertical ruled line extraction result. Further, if it is a horizontal ruled line, it is extracted whether or not there are pixels continuous in the horizontal direction, that is, whether there is a straight line in the horizontal direction, and the result is output as a horizontal ruled line extraction result.

セル領域認識部43は、罫線抽出部42によって抽出された縦横罫線に基づいてセル領域を認識する。例えば、2本の縦罫線と2本の横罫線で囲われた矩形の領域をセル領域として認識する。認識されたセル領域は、例えば、左上座標、右下座標、左辺罫線番号、右辺罫線番号、上辺罫線番号、下辺罫線番号のデータ構造をセルテーブル30に保有する。図5に例示したセル領域の場合は、左上座標が(6,3)、右下座標が(13,6)、左辺罫線番号が縦罫線1、右辺罫線番号が縦罫線2、上辺罫線番号が横罫線1、下辺罫線番号が横罫線2となる。   The cell area recognition unit 43 recognizes the cell area based on the vertical and horizontal ruled lines extracted by the ruled line extraction unit 42. For example, a rectangular area surrounded by two vertical ruled lines and two horizontal ruled lines is recognized as a cell area. The recognized cell area has, for example, a data structure of upper left coordinates, lower right coordinates, left side ruled line numbers, right side ruled line numbers, upper side ruled line numbers, and lower side ruled line numbers in the cell table 30. In the case of the cell area illustrated in FIG. 5, the upper left coordinate is (6, 3), the lower right coordinate is (13, 6), the left side ruled line number is the vertical ruled line 1, the right side ruled line number is the vertical ruled line 2, and the upper side ruled line number is The horizontal ruled line 1 and the lower ruled line number are the horizontal ruled line 2.

セル形状パターン計数部44は、正立の可能性があるセル形状の特徴(セル形状パターン)に基づき、セル領域認識部によって認識されたセル領域の形状パターンの数を計数し、形状パターン毎の計数結果を算出する。例えば、セル形状パターン計数部44は、認識されたセル領域の上下左右の4方向の各形状パターンの数を計数して各方向の計数結果を算出する。   The cell shape pattern counting unit 44 counts the number of shape patterns of the cell area recognized by the cell area recognition unit based on the cell shape feature (cell shape pattern) that may be upright, and calculates the shape pattern for each shape pattern. Calculate the counting result. For example, the cell shape pattern counting unit 44 counts the number of shape patterns in the four directions of the recognized cell region in the four directions, and calculates the counting result in each direction.

正立の可能性があるセル形状の特徴は、例えば、図6に示すように、(1)乃至(4)のような特徴である。(1)は、単に横長の領域のみで構成される。例えば、「横長セル」61である。(2)は、左側に「見出し」が記載される領域があり、「見出し」領域の右側に「見出し」領域よりも長い(大きい)領域であって「データ」が記載される領域がある。「見出し」領域と「データ」領域は1対1の関係にある。例えば、「1対1セル」62である。(3)は、左側に「見出し」が記載される領域が1つあり、「見出し」領域の右側に「見出し」領域よりも長い(大きい)領域であって「データ」が記載される複数の領域がある。「見出し」領域と「データ」領域は1対N(複数)の関係にある。例えば、「1対Nセル」63である。(4)は、左側に「見出し」が記載される領域が複数あり、各「見出し」領域の右側に「見出し」領域よりも長い(大きい)領域であって「データ」が記載される領域が、「見出し」領域と同数ある。「見出し」領域と「データ」領域はN(複数)対N(複数)の関係にあり、いわゆる表構造を形成する。例えば、「表構造セル」64である。このような特徴が正立の可能性のあるセル形状であるというのは、帳票が横書きであること、「見出し」に記載される文字数が「データ」に記載される文字数より少ないことに起因する。   The cell-shaped features that may be upright are features (1) to (4) as shown in FIG. 6, for example. (1) is composed of only a horizontally long area. For example, it is a “landscape cell” 61. In (2), there is an area in which the "headline" is written on the left side, and an area longer (larger) than the "headline" area and in which the "data" is written on the right side of the "headline" area. The “heading” area and the “data” area have a one-to-one relationship. For example, “one-to-one cell” 62. In (3), there is one area in which the "heading" is written on the left side, and a plurality of areas (longer than the "heading" area, in which "data" is written, are located on the right side of the "heading" area. There is an area. The “heading” area and the “data” area have a one-to-N (plural) relationship. For example, “1-to-N cell” 63. In (4), there are a plurality of areas in which "headings" are written on the left side, and on the right side of each "headings" area, there is an area that is longer (larger) than the "headings" area and in which "data" is written. , As many as "heading" areas. The “heading” area and the “data” area have a relationship of N (plural) to N (plural) and form a so-called table structure. For example, “table structure cell” 64. The fact that such a feature is a cell shape with the possibility of erecting is because the form is written horizontally and the number of characters written in the "heading" is less than the number of characters written in the "data". .

帳票画像正立判断部45は、セル形状パターン計数部44によって算出された計数結果に基づいて、帳票画像が正立であるか否かを判断する。例えば、帳票画像正立判断部45は、4方向の計数結果の内、最大値の方向を、帳票画像が正立であると判断する。   The form image upright determination unit 45 determines whether or not the form image is upright based on the counting result calculated by the cell shape pattern counting unit 44. For example, the form image erecting determination unit 45 determines that the form image is upright in the direction of the maximum value among the four counting results.

帳票画像回転部46は、帳票画像正立判断部45によって帳票画像が正立でないと判断された場合、帳票画像を回転させる。例えば、90度、180度、または270度回転させる。罫線抽出部42およびセル領域認識部43は、帳票画像回転部46によって回転させた帳票画像に対しても機能する。   The form image rotation unit 46 rotates the form image when the form image upright determination unit 45 determines that the form image is not upright. For example, it is rotated by 90 degrees, 180 degrees, or 270 degrees. The ruled line extraction unit 42 and the cell area recognition unit 43 also function on the form image rotated by the form image rotation unit 46.

なお、セルテーブル30は、帳票処理装置1が備えていても良いし、外部の記憶装置に格納されていても良い。   The cell table 30 may be included in the form processing device 1 or may be stored in an external storage device.

次に、図7乃至図23を用いて、本実施の形態を説明する。
図7は、帳票の例を示す図である。図8は、本実施の形態における帳票処理の操作フローチャートである。図9は、本実施の形態における認識処理の流れを示すフローチャートである。図10は、抽出された縦横罫線の例を示す図である。図11は、抽出されたセル領域の例を示す図である。図12は、セルテーブルの例を示す図である。図13は、認識処理のサブルーチン「イメージ自動正立判定/回転処理」の流れを示すフローチャートである。図14は、セル領域のカウントの例を示す図である。図15は、イメージ自動正立判定/回転処理のサブルーチン「表形状特徴カウント処理」の流れを示すフローチャートである。図16は、第1乃至第4のカウント処理の対象となるセル領域の例を示す図である。図17は、表形状特徴カウント処理のサブルーチン「第1のカウント処理」の流れを示すフローチャートである。図18は、表形状特徴カウント処理のサブルーチン「第2のカウント処理」の流れを示すフローチャートである。図19は、表形状特徴カウント処理のサブルーチン「第3のカウント処理」の流れを示すフローチャートである。図20および図21は、表形状特徴カウント処理のサブルーチン「第4のカウント処理」の流れを示すフローチャートである。図22は、表形状特徴カウント処理の結果を示す図である。図23は、帳票画像の回転例を示す図である。
Next, this embodiment will be described with reference to FIGS. 7 to 23.
FIG. 7 is a diagram showing an example of a form. FIG. 8 is an operation flowchart of form processing according to the present embodiment. FIG. 9 is a flowchart showing the flow of recognition processing in this embodiment. FIG. 10 is a diagram showing an example of the extracted vertical and horizontal ruled lines. FIG. 11 is a diagram showing an example of the extracted cell region. FIG. 12 is a diagram showing an example of a cell table. FIG. 13 is a flowchart showing the flow of the subroutine "image automatic upright determination / rotation processing" of the recognition processing. FIG. 14 is a diagram showing an example of counting cell areas. FIG. 15 is a flowchart showing the flow of the subroutine "table shape feature count processing" of the image automatic upright determination / rotation processing. FIG. 16 is a diagram showing an example of a cell region that is the target of the first to fourth counting processes. FIG. 17 is a flowchart showing the flow of the subroutine "first counting process" of the table shape feature counting process. FIG. 18 is a flowchart showing the flow of the subroutine "second counting process" of the table shape feature counting process. FIG. 19 is a flow chart showing the flow of the subroutine "third counting process" of the table shape feature counting process. 20 and 21 are flowcharts showing the flow of the subroutine "fourth counting process" of the table shape feature counting process. FIG. 22 is a diagram showing a result of the table shape feature counting process. FIG. 23 is a diagram showing an example of rotation of a form image.

本実施の形態における帳票処理は、図1乃至4を用いて説明した帳票処理装置1が帳票処理プログラムに従って実行する。帳票処理装置1は、定義体が登録されていない私製の帳票を対象とすることができる。例えば、図7に示すような帳票を対象とする。   The form processing according to the present embodiment is executed by the form processing apparatus 1 described with reference to FIGS. 1 to 4 according to the form processing program. The form processing apparatus 1 can target a privately-made form for which a definition is not registered. For example, a form as shown in FIG. 7 is targeted.

まず、帳票処理装置1を操作する操作者は、図8のステップS801において、表示装置2に表示された「帳票読み取りキー」を押下することで、帳票処理の操作を開始する。   First, the operator who operates the form processing apparatus 1 starts the operation of the form processing by pressing the “form reading key” displayed on the display device 2 in step S801 of FIG.

帳票処理装置1は、ステップS802において、サブルーチン「認識処理」を実行する。サブルーチン「認識処理」について、図9を用いて詳細に説明する。   The form processing apparatus 1 executes a subroutine "recognition process" in step S802. The subroutine "recognition processing" will be described in detail with reference to FIG.

まず、帳票処理装置1が備える制御部20は、図9のステップS901において、イメージスキャナ等の画像読取装置3に帳票を読み取らせて帳票画像を取得する。   First, in step S901 of FIG. 9, the control unit 20 included in the form processing apparatus 1 causes the image reading device 3 such as an image scanner to read the form and acquires the form image.

制御部20は、ステップS902において、ステップS901で取得した帳票画像から罫線を抽出する。例えば、縦罫線であれば、縦方向に連続する画素、すなわち縦方向の直線があるか否かを抽出し、その結果を縦罫線抽出結果として出力する。また、横罫線であれば、横方向に連続する画素、すなわち横方向の直線があるか否かを抽出し、その結果を横罫線抽出結果として出力する。抽出された縦罫線および横罫線には、それぞれ罫線番号が付与される。罫線番号は、縦罫線と横罫線毎に付与する。例えば、左上座標を原点にして1画素ずつ横方向にスキャンし、一番右の画素まで行ったら縦方向に次の画素列をスキャンする。そして、スキャンしている画素が抽出された縦罫線および横罫線に含まれていることを検出したら、その縦罫線および横罫線に昇順の並びで罫線番号を付与する。このようにして罫線番号を付与することで、図7に例示した帳票の場合、図10に示したように、縦罫線にはT1乃至T14、横罫線にはY1乃至Y18の罫線番号が付与された抽出結果が得られる。   In step S902, the control unit 20 extracts a ruled line from the form image acquired in step S901. For example, in the case of a vertical ruled line, it is extracted whether or not there are pixels continuous in the vertical direction, that is, whether there is a straight line in the vertical direction, and the result is output as a vertical ruled line extraction result. Further, if it is a horizontal ruled line, it is extracted whether or not there are pixels continuous in the horizontal direction, that is, whether there is a straight line in the horizontal direction, and the result is output as a horizontal ruled line extraction result. Ruled line numbers are given to the extracted vertical ruled lines and horizontal ruled lines, respectively. The ruled line number is given to each of the vertical ruled line and the horizontal ruled line. For example, the upper left coordinates are used as the origin to scan one pixel in the horizontal direction, and when the rightmost pixel is reached, the next pixel row is scanned in the vertical direction. Then, when it is detected that the scanned pixel is included in the extracted vertical ruled line and horizontal ruled line, ruled line numbers are given to the vertical ruled line and the horizontal ruled line in an ascending order. By giving ruled line numbers in this way, in the case of the form illustrated in FIG. 7, as shown in FIG. 10, the ruled line numbers of T1 to T14 are given to the vertical ruled lines and Y1 to Y18 are given to the horizontal ruled lines. The extraction result is obtained.

制御部20は、ステップS903において、ステップS902で抽出された縦罫線と横罫線に基づいてセル領域を抽出する。例えば、縦罫線と横罫線の交点を求め、交点を4点とする最小矩形で囲われた領域(2本の縦罫線と2本の横罫線で囲われた領域)をセル領域として抽出する。抽出されたセル領域には、それぞれ固有の識別子(セルID)を付与する。セルIDの付与は、罫線番号の付与と同様に、例えば、左上座標を原点にして1画素ずつ横方向にスキャンし、一番右の画素まで行ったら縦方向に次の画素列をスキャンする。そして、スキャンしている画素が抽出されたセル領域に含まれていることを検出したら、そのセル領域に昇順の並びで罫線番号を付与する。また、認識されたセル領域の数を、例えば変数「セル領域数」に代入する。このようにしてセルIDを付与することで、図7に例示した帳票の場合、図11に示したように、S1乃至S34のセルIDが付与された抽出結果が得られる。   In step S903, the control unit 20 extracts a cell area based on the vertical ruled line and the horizontal ruled line extracted in step S902. For example, the intersection of the vertical ruled line and the horizontal ruled line is obtained, and the area surrounded by the minimum rectangle having four intersections (the area surrounded by the two vertical ruled lines and the two horizontal ruled lines) is extracted as the cell area. A unique identifier (cell ID) is given to each of the extracted cell regions. The cell ID is assigned in the same manner as the ruled line number, for example, by scanning one pixel in the horizontal direction with the upper left coordinate as the origin, and scanning the next pixel row in the vertical direction after reaching the rightmost pixel. When it is detected that the scanned pixel is included in the extracted cell area, ruled line numbers are given to the cell area in an ascending order. Further, the number of recognized cell areas is substituted into the variable “cell area number”, for example. By assigning the cell ID in this way, in the case of the form illustrated in FIG. 7, the extraction result to which the cell IDs of S1 to S34 are assigned can be obtained as illustrated in FIG.

セルIDが付与された各セル領域は、図12に示すように、左上座標、右下座標、左辺罫線番号、右辺罫線番号、上辺罫線番号、下辺罫線番号等のデータ構造と共に、セル情報としてセルテーブル30に保有される。図12に示した例は、図7に例示した帳票のセルテーブル30の例である。セルテーブル30は、セルIDの昇順の並びで保有され、左上座標、右下座標、左辺罫線番号、右辺罫線番号、上辺罫線番号、下辺罫線番号等の情報を持つ。例えば、セルIDが「S1」は、左上座標「(380,20)」、右下座標「(640,40)」、左辺罫線番号「T1」、右辺罫線番号「T2」、上辺罫線番号「Y1」、下辺罫線番号「Y2」の情報を持つ。   As shown in FIG. 12, each cell area to which a cell ID is assigned has a cell structure as cell information along with a data structure such as an upper left coordinate, a lower right coordinate, a left side ruled line number, a right side ruled line number, an upper side ruled line number, and a lower side ruled line number. Held on table 30. The example shown in FIG. 12 is an example of the cell table 30 of the form illustrated in FIG. 7. The cell table 30 is held in an ascending order of cell IDs, and has information such as upper left coordinates, lower right coordinates, left side ruled line numbers, right side ruled line numbers, upper side ruled line numbers, and lower side ruled line numbers. For example, when the cell ID is "S1", the upper left coordinate "(380,20)", the lower right coordinate "(640,40)", the left side ruled line number "T1", the right side ruled line number "T2", and the upper side ruled line number "Y1". , And the lower side ruled line number “Y2”.

制御部20は、ステップS904において、サブルーチン「イメージ自動正立判定/回転処理」を実行する。サブルーチン「イメージ自動正立判定/回転処理」について、図13を用いて詳細に説明する。   In step S904, the control unit 20 executes a subroutine "image automatic upright determination / rotation processing". The subroutine "image automatic upright determination / rotation processing" will be described in detail with reference to FIG.

サブルーチン「イメージ自動正立判定/回転処理」は、図9のステップS901で取得した帳票画像が正立であるのか否か、正立でないのであれば、90度または270度の向き(横向き)になっているのか、若しくは180度の向き(上下反転)になっているのかを判定するために、ステップS1301乃至S1305を実行する。   The subroutine "automatic image erecting determination / rotation processing" determines whether the form image acquired in step S901 of FIG. 9 is upright, and if it is not upright, the orientation is 90 degrees or 270 degrees (sideways). Steps S1301 to S1305 are executed to determine whether the orientation is 180 degrees or the orientation is 180 degrees (vertical upside down).

ステップS1301乃至S1305の処理は、例えば、上下左右方向(4方向)の数だけ繰返し実行する。ただし、後述するように、ステップS1303の判断ステップを満たした場合(ステップS1303:YES)、残りの方向での処理を省略(スキップ)する。なお、ステップS1303の判断ステップを行わずに、4方向全てについてステップS1301のサブルーチン「表形状特徴カウント処理」を実行した後に、各方向での得点を比較判断するようにしてもよい。なお、上下左右方向とは、例えば、画像読取装置3で読み取った帳票画像を表示装置2に表示した場合、利用者が認識する帳票の上下左右方向と一致する方向である。   The processes of steps S1301 to S1305 are repeatedly executed, for example, in the numbers in the vertical and horizontal directions (four directions). However, as will be described later, when the determination step of step S1303 is satisfied (step S1303: YES), the processing in the remaining directions is omitted (skipped). Instead of performing the determination step of step S1303, the subroutine “table shape feature count processing” of step S1301 may be executed for all four directions, and then the scores in each direction may be compared and determined. Note that the up, down, left, and right directions are, for example, the directions that coincide with the up, down, left, and right directions of the form that the user recognizes when the form image read by the image reading device 3 is displayed on the display device 2.

制御部20は、図13のステップS1301において、サブルーチン「表形状特徴カウント処理」を実行する。ここでは、ステップS903で抽出されたセル領域の形状パターンの数を計数する。例えば、図14に示すように、正立の可能性があるセル形状の特徴である、「横長セル」61、「1対1セル」62、「1対Nセル」63、および「表構造セル」64を計数する。詳細は、図15乃至図22を用いて後述する。   The control unit 20 executes the subroutine "table shape feature count processing" in step S1301 of FIG. Here, the number of shape patterns of the cell area extracted in step S903 is counted. For example, as shown in FIG. 14, "horizontal cells" 61, "one-to-one cells" 62, "one-to-N cells" 63, and "table-structured cells", which are features of a cell shape that may be upright, are shown. "64 is counted. Details will be described later with reference to FIGS.

サブルーチン「表形状特徴カウント処理」は、例えば、図15に示すように、ステップS1501において、サブルーチン「第1のカウント処理」を実行し、ステップS1502において、サブルーチン「第2のカウント処理」を実行し、ステップS1503において、サブルーチン「第3のカウント処理」を実行し、そして、ステップS1504において、サブルーチン「第4のカウント処理」を実行する。サブルーチン「第1のカウント処理」は、図16の(A)に示すような横長セル61を対象とする。サブルーチン「第2のカウント処理」は、図16の(B)に示すような1対1セル62を対象とする。サブルーチン「第3のカウント処理」は、図16の(C)または(D)に示すような1対Nセル63を対象とする。サブルーチン「第4のカウント処理」は、図16の(E)に示すような表構造セル64を対象とする。   For example, as shown in FIG. 15, the sub-routine "table shape feature counting process" executes the sub-routine "first counting process" in step S1501 and the sub-routine "second counting process" in step S1502. In step S1503, the subroutine "third counting process" is executed, and in step S1504, the subroutine "fourth counting process" is executed. The subroutine "first counting process" targets a horizontally long cell 61 as shown in FIG. The subroutine "second counting process" targets the one-to-one cell 62 as shown in FIG. The subroutine "third counting process" targets the 1-to-N cell 63 as shown in (C) or (D) of FIG. The sub-routine "fourth counting process" targets the table-structured cell 64 as shown in FIG.

図17を用いて、サブルーチン「第1のカウント処理」を詳細に説明する。
サブルーチン「第1のカウント処理」は、図9のステップS903で抽出したセル領域の数だけ、ステップS1701乃至S1703を繰り返す。ステップS903で抽出したセル領域の数は、図9のステップS903でセル領域を抽出した際に変数「セル領域数」に格納されている。
The subroutine "first counting process" will be described in detail with reference to FIG.
In the subroutine "first counting process", steps S1701 to S1703 are repeated by the number of cell regions extracted in step S903 of FIG. The number of cell areas extracted in step S903 is stored in the variable “cell area number” when the cell areas are extracted in step S903 of FIG.

制御部20は、ステップS1701において、図9のステップS903で抽出した各セル領域のセル情報(セルID、左上座標、右下座標、左辺罫線番号、右辺罫線番号、上辺罫線番号、下辺罫線番号等のデータ構造)をセルテーブル30から順に取得する。そして、セル領域の第1の幾何学比を算出する。例えば、セル領域の縦の長さに対する横の長さの比を第1の幾何学比として算出する。   In step S1701, the control unit 20 determines the cell information (cell ID, upper left coordinate, lower right coordinate, left side ruled line number, right side ruled line number, upper side ruled line number, lower side ruled line number, etc.) of each cell area extracted in step S903 of FIG. Data structure) is sequentially acquired from the cell table 30. Then, the first geometric ratio of the cell area is calculated. For example, the ratio of the horizontal length to the vertical length of the cell area is calculated as the first geometric ratio.

制御部20は、ステップS1702において、ステップS1701で算出した第1の幾何学比が所定の閾値以上か否かを判断する。例えば、第1の幾何学比が1.5以上か否かを判断する。これは、セル領域が横長か否かの判断となる。第1の幾何学比が所定の閾値以上でないと判断された場合(ステップS1702:NO)、ステップS1703をスキップし、ループの先頭(次のステップS1701)から実行する。   In step S1702, the control unit 20 determines whether or not the first geometric ratio calculated in step S1701 is equal to or larger than a predetermined threshold value. For example, it is determined whether the first geometric ratio is 1.5 or more. This determines whether or not the cell area is horizontally long. When it is determined that the first geometric ratio is not equal to or larger than the predetermined threshold value (step S1702: NO), step S1703 is skipped and the process is executed from the beginning of the loop (next step S1701).

他方、第1の幾何学比が所定の閾値以上であると判断された場合(ステップS1702:YES)、制御部20は、ステップS1703において、対象のセル領域が図16の(A)に示すような横長セル61であると判断してカウントアップし、横長セル61と判断されたセル領域の数を計数する。   On the other hand, when it is determined that the first geometric ratio is greater than or equal to the predetermined threshold value (step S1702: YES), the control unit 20 determines in step S1703 that the target cell area is as shown in FIG. The number of cell regions determined to be the horizontally long cells 61 is counted.

図18を用いて、サブルーチン「第2のカウント処理」を詳細に説明する。
サブルーチン「第2のカウント処理」は、図9のステップS903で抽出したセル領域の数だけ、ステップS1801乃至S1808を繰り返す。
The subroutine "second counting process" will be described in detail with reference to FIG.
In the subroutine "second counting process", steps S1801 to S1808 are repeated by the number of cell regions extracted in step S903 of FIG.

制御部20は、ステップS1801において、図9のステップS903で抽出した各セル領域のセル情報をセルテーブル30から順に取得する。最初のステップS1801においては、最初のセル領域(セルIDがS1)のセル情報を取得する。2回目以降のステップS1801においては、セルテーブル30に格納された次のセルIDのセル領域のセル情報を取得する。このセル領域を基準セルとする。   In step S1801, the control unit 20 sequentially acquires the cell information of each cell area extracted in step S903 of FIG. 9 from the cell table 30. In the first step S1801, the cell information of the first cell area (cell ID is S1) is acquired. In step S1801 after the second time, the cell information of the cell area of the next cell ID stored in the cell table 30 is acquired. This cell area is used as a reference cell.

次に、図9のステップS903で抽出したセル領域の数だけ、ステップS1802乃至S1808を繰り返す。   Next, steps S1802 to S1808 are repeated for the number of cell regions extracted in step S903 of FIG.

まず、制御部20は、ステップS1802において、図9のステップS903で抽出した各セル領域のセル情報をセルテーブル30から順に取得する。最初のステップS1802においては、最初のセル領域(セルIDがS1)のセル情報を取得する。2回目以降のステップS1802においては、セルテーブル30に格納された次のセルIDのセル領域のセル情報を取得する。このセル領域を右隣接セルと仮定する。   First, in step S1802, the control unit 20 sequentially acquires the cell information of each cell region extracted in step S903 of FIG. 9 from the cell table 30. In the first step S1802, the cell information of the first cell area (cell ID is S1) is acquired. In step S1802 after the second time, the cell information of the cell area of the next cell ID stored in the cell table 30 is acquired. This cell region is assumed to be the right adjacent cell.

制御部20は、ステップS1803において、基準セルの右辺罫線番号と右隣接セルの左辺罫線番号が一致するか否かを判断する。以降、隣接するセルか否かの判断は、罫線番号が一致するかで判断する。一致しないと判断された場合(ステップS1803:NO)、ステップS1804乃至S1808をスキップし、ループの先頭(次のステップS1802)から実行する。   In step S1803, the control unit 20 determines whether the right side ruled line number of the reference cell and the left side ruled line number of the right adjacent cell match. After that, whether or not the cells are adjacent cells is determined by matching the ruled line numbers. If it is determined that they do not match (step S1803: NO), steps S1804 to S1808 are skipped and the process is executed from the beginning of the loop (next step S1802).

他方、一致すると判断された場合(ステップS1803:YES)、仮定された右隣接セルは基準セルに隣接するセル領域であると判断でき、制御部20は、ステップS1804において、基準セルの上辺罫線番号と右隣接セルの上辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS1804:NO)、ステップS1805乃至S1808をスキップし、ループの先頭(次のステップS1802)から実行する。   On the other hand, if it is determined that they match (step S1803: YES), it can be determined that the assumed right adjacent cell is the cell region adjacent to the reference cell, and the control unit 20 determines in step S1804 that the upper side ruled line number of the reference cell is the same. And the upper side ruled line number of the right adjacent cell match. If it is determined that they do not match (step S1804: NO), steps S1805 to S1808 are skipped and the process is executed from the beginning of the loop (next step S1802).

他方、一致すると判断された場合(ステップS1804:YES)、仮定された右隣接セルと基準セルが帳票画像の縦方向において同じ画素位置から始まっていると判断でき、制御部20は、ステップS1805において、基準セルの下辺罫線番号と右隣接セルの下辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS1805:NO)、ステップS1806乃至S1808をスキップし、ループの先頭(次のステップS1802)から実行する。   On the other hand, if it is determined that they match (step S1804: YES), it can be determined that the assumed right adjacent cell and the reference cell start from the same pixel position in the vertical direction of the form image, and the control unit 20 determines in step S1805. , It is determined whether the lower ruled line number of the reference cell and the lower ruled line number of the right adjacent cell match. When it is determined that they do not match (step S1805: NO), steps S1806 to S1808 are skipped and the process is executed from the beginning of the loop (next step S1802).

他方、一致すると判断された場合(ステップS1805:YES)、仮定された右隣接セルと基準セルが帳票画像の縦方向において同じ画素位置で終わっていると判断でき、ステップS1802で仮定した右隣接セルが真の右隣接セルであると確定されるので、制御部20は、ステップS1806において、基準セルと右隣接セルについて第2の幾何学比を算出する。例えば、基準セルの横の長さに対する右隣接セルの横の長さを第2の幾何学比として算出する。   On the other hand, if it is determined that they match (step S1805: YES), it can be determined that the assumed right adjacent cell and the reference cell end at the same pixel position in the vertical direction of the form image, and the right adjacent cell assumed in step S1802. Is determined to be a true right adjacent cell, the control unit 20 calculates a second geometric ratio for the reference cell and the right adjacent cell in step S1806. For example, the lateral length of the right adjacent cell to the lateral length of the reference cell is calculated as the second geometric ratio.

制御部20は、ステップS1807において、ステップS1806で算出した第2の幾何学比が所定の閾値以上か否かを判断する。例えば、第2の幾何学比が1.5以上か否かを判断する。これは、見出しの右側にデータがあるか否かの判断となる。第2の幾何学比が所定の閾値以上でないと判断された場合(ステップS1807:NO)、ステップS1808をスキップし、ループの先頭(次のステップS1802)から実行する。   In step S1807, the control unit 20 determines whether or not the second geometric ratio calculated in step S1806 is equal to or larger than a predetermined threshold value. For example, it is determined whether the second geometric ratio is 1.5 or more. This is a judgment as to whether or not there is data on the right side of the heading. When it is determined that the second geometric ratio is not equal to or more than the predetermined threshold value (step S1807: NO), step S1808 is skipped and the process is executed from the beginning of the loop (next step S1802).

他方、第2の幾何学比が所定の閾値以上であると判断された場合(ステップS1807:YES)、制御部20は、ステップS1808において、対象のセル領域が、見出しとデータが1対1の関係にある、例えば、図16の(B)に示すような1対1セル62であると判断してカウントアップし、1対1セル62と判断されたセル領域の数を計数する。   On the other hand, when it is determined that the second geometric ratio is greater than or equal to the predetermined threshold value (step S1807: YES), the control unit 20 determines in step S1808 that the target cell area has a heading and data of 1: 1. For example, it is determined that the cells are related to each other, for example, as shown in (B) of FIG. 16 and is counted up, and the number of cell areas determined to be the 1: 1 cell 62 is counted.

図19を用いて、サブルーチン「第3のカウント処理」を詳細に説明する。
サブルーチン「第3のカウント処理」は、図9のステップS903で抽出したセル領域の数だけ、ステップS1901乃至S1911を繰り返す。
The subroutine "third counting process" will be described in detail with reference to FIG.
In the subroutine "third counting process", steps S1901 to S1911 are repeated by the number of cell regions extracted in step S903 of FIG.

制御部20は、ステップS1901において、図9のステップS903で抽出した各セル領域のセル情報をセルテーブル30から順に取得する。最初のステップS1901においては、最初のセル領域(セルIDがS1)のセル情報を取得する。2回目以降のステップS1901においては、セルテーブル30に格納された次のセルIDのセル領域のセル情報を取得する。このセル領域を基準セルとする。   In step S1901, the control unit 20 sequentially acquires the cell information of each cell region extracted in step S903 of FIG. 9 from the cell table 30. In the first step S1901, cell information of the first cell area (cell ID is S1) is acquired. In step S1901 after the second time, the cell information of the cell area of the next cell ID stored in the cell table 30 is acquired. This cell area is used as a reference cell.

次に、図9のステップS903で抽出したセル領域の数だけ、ステップS1902乃至S1911を繰り返す。   Next, steps S1902 to S1911 are repeated by the number of cell regions extracted in step S903 of FIG.

まず、制御部20は、ステップS1902において、図9のステップS903で抽出した各セル領域のセル情報をセルテーブル30から順に取得する。最初のステップS1902においては、最初のセル領域(セルIDがS1)のセル情報を取得する。2回目以降のステップS1902においては、セルテーブル30に格納された次のセルIDのセル領域のセル情報を取得する。このセル領域を右上隣接セルと仮定する。   First, in step S1902, the control unit 20 sequentially acquires the cell information of each cell region extracted in step S903 of FIG. 9 from the cell table 30. In the first step S1902, the cell information of the first cell area (cell ID is S1) is acquired. In step S1902 after the second time, the cell information of the cell area of the next cell ID stored in the cell table 30 is acquired. This cell area is assumed to be the upper right adjacent cell.

制御部20は、ステップS1903において、基準セルの右辺罫線番号と右上隣接セルの左辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS1903:NO)、ステップS1904乃至S1911をスキップし、ループの先頭(次のステップS1902)から実行する。   In step S1903, the control unit 20 determines whether the right side ruled line number of the reference cell and the left side ruled line number of the upper right adjacent cell match. When it is determined that they do not match (step S1903: NO), steps S1904 to S1911 are skipped and the process is executed from the beginning of the loop (next step S1902).

他方、一致すると判断された場合(ステップS1903:YES)、仮定された右隣接セルは基準セルに隣接するセル領域であると判断でき、制御部20は、ステップS1904において、基準セルの上辺罫線番号と右上隣接セルの上辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS1904:NO)、ステップS1905乃至S1911をスキップし、ループの先頭(次のステップS1902)から実行する。   On the other hand, when it is determined that they match (step S1903: YES), it can be determined that the assumed right adjacent cell is a cell area adjacent to the reference cell, and the control unit 20 determines in step S1904 the upper side ruled line number of the reference cell. And the upper side ruled line number of the upper right adjacent cell coincide with each other. When it is determined that they do not match (step S1904: NO), steps S1905 to S1911 are skipped and the process is executed from the beginning of the loop (next step S1902).

他方、一致すると判断された場合(ステップS1904:YES)、仮定された右上隣接セルと基準セルが帳票画像の縦方向において同じ画素位置から始まっていると判断でき、制御部20は、ステップS1905において、基準セルと右上隣接セルについて第3の幾何学比を算出する。例えば、基準セルの横の長さに対する右上隣接セルの横の長さを第3の幾何学比として算出する。   On the other hand, if it is determined that they match (step S1904: YES), it can be determined that the assumed upper right adjacent cell and the reference cell start from the same pixel position in the vertical direction of the form image, and the control unit 20 determines in step S1905. , A third geometric ratio is calculated for the reference cell and the upper right adjacent cell. For example, the horizontal length of the upper right adjacent cell to the horizontal length of the reference cell is calculated as the third geometric ratio.

制御部20は、ステップS1906において、ステップS1905で算出した第3の幾何学比が所定の閾値以上か否かを判断する。例えば、第3の幾何学比が1.5以上か否かを判断する。これは、見出しの右側にデータがあるか否かの判断となる。第3の幾何学比が所定の閾値以上でないと判断された場合(ステップS1906:NO)、ステップS1907乃至S1911をスキップし、ループの先頭(次のステップS1902)から実行する。   In step S1906, the control unit 20 determines whether or not the third geometric ratio calculated in step S1905 is greater than or equal to a predetermined threshold value. For example, it is determined whether or not the third geometric ratio is 1.5 or more. This is a judgment as to whether or not there is data on the right side of the heading. When it is determined that the third geometric ratio is not greater than or equal to the predetermined threshold value (step S1906: NO), steps S1907 to S1911 are skipped and the process is executed from the beginning of the loop (next step S1902).

他方、第3の幾何学比が所定の閾値以上であると判断された場合(ステップS1906:YES)、図9のステップS903で抽出したセル領域の数だけ、ステップS1907乃至S1911を繰り返す。まず、制御部20は、ステップS1907において、セルテーブル30に格納された情報から次のセル領域(セルテーブル30において、ステップS1902で右上隣接セルとしたセル領域の次のセル領域)のセル情報を取得する。このセル領域を右下隣接セルと仮定する。   On the other hand, when it is determined that the third geometric ratio is equal to or larger than the predetermined threshold value (step S1906: YES), steps S1907 to S1911 are repeated by the number of cell regions extracted in step S903 of FIG. First, in step S1907, the control unit 20 obtains the cell information of the next cell area (in the cell table 30, the cell area next to the cell area that is the upper right adjacent cell in step S1902 in the cell table 30). get. This cell region is assumed to be the lower right adjacent cell.

制御部20は、ステップS1908において、右上隣接セルの左辺罫線番号と右下隣接セルの左辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS1908:NO)、ステップS1909乃至S1911をスキップし、ループの先頭(次のステップS1907)から実行する。   In step S1908, the control unit 20 determines whether the left side ruled line number of the upper right adjacent cell and the left side ruled line number of the lower right adjacent cell match. If it is determined that they do not match (step S1908: NO), steps S1909 to S1911 are skipped and the process is executed from the beginning of the loop (next step S1907).

他方、一致すると判断された場合(ステップS1908:YES)、制御部20は、ステップS1909において、右上隣接セルの右辺罫線番号と右下隣接セルの右辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS1909:NO)、ステップS1910乃至S1911をスキップし、ループの先頭(次のステップS1907)から実行する。   On the other hand, when it is determined that they match (step S1908: YES), the control unit 20 determines in step S1909 whether the right-side ruled line number of the upper right adjacent cell and the right side ruled line number of the lower right adjacent cell match. When it is determined that they do not match (step S1909: NO), steps S1910 to S1911 are skipped and the process is executed from the beginning of the loop (next step S1907).

他方、一致すると判断された場合(ステップS1909:YES)、制御部20は、ステップS1910において、基準セルの下辺罫線番号と右下隣接セルの下辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS1910:NO)、ステップS1911をスキップし、ループの先頭(次のステップS1907)から実行する。   On the other hand, when it is determined that they match (step S1909: YES), the control unit 20 determines in step S1910 whether the lower ruled line number of the reference cell and the lower ruled line number of the lower right adjacent cell match. When it is determined that they do not match (step S1910: NO), step S1911 is skipped and the process is executed from the beginning of the loop (next step S1907).

他方、一致すると判断された場合(ステップS1910:YES)、仮定された右下隣接セルと基準セルが帳票画像の縦方向において同じ画素位置で終わっていると判断でき、制御部20は、ステップS1911において、対象のセル領域が、見出しとデータが1対N(複数)の関係にある、例えば、図16(C)または(D)に示すような1対Nセル63であると判断してカウントアップし、1対Nセル63と判断されたセル領域の数を計数する。   On the other hand, if it is determined that they match (step S1910: YES), it can be determined that the assumed lower right adjacent cell and the reference cell end at the same pixel position in the vertical direction of the form image, and the control unit 20 determines in step S1911. In FIG. 16, it is determined that the target cell area is the 1: N cell 63 in which the headline and the data have a 1: N (plurality) relationship, for example, the 1: N cell 63 as shown in FIG. The number of cell areas determined to be 1-to-N cells 63 is counted up.

図20および図21を用いて、サブルーチン「第4のカウント処理」を詳細に説明する。   The subroutine "fourth counting process" will be described in detail with reference to FIGS.

サブルーチン「第4のカウント処理」は、図9のステップS903で抽出したセル領域の数だけ、ステップS2001乃至S2014を繰り返す。   In the subroutine "fourth counting process", steps S2001 to S2014 are repeated by the number of cell regions extracted in step S903 of FIG.

制御部20は、図20のステップS2001において、図9のステップS903で抽出した各セル領域のセル情報をセルテーブル30から順に取得する。最初のステップS2001においては、最初のセル領域(セルIDがS1)のセル情報を取得する。2回目以降のステップS2001においては、セルテーブル30に格納された次のセルIDのセル領域のセル情報を取得する。このセル領域を基準セルとする。   In step S2001 of FIG. 20, the control unit 20 sequentially acquires the cell information of each cell area extracted in step S903 of FIG. 9 from the cell table 30. In the first step S2001, the cell information of the first cell area (cell ID is S1) is acquired. In step S2001 after the second time, the cell information of the cell area of the next cell ID stored in the cell table 30 is acquired. This cell area is used as a reference cell.

次に、図9のステップS903で抽出したセル領域の数だけ、ステップS2002乃至S2014を繰り返す。   Next, steps S2002 to S2014 are repeated for the number of cell regions extracted in step S903 of FIG.

まず、制御部20は、ステップS2002において、図9のステップS903で抽出した各セル領域のセル情報をセルテーブル30から順に取得する。最初のステップS2002においては、最初のセル領域(セルIDがS1)のセル情報を取得する。2回目以降のステップS2002においては、セルテーブル30に格納された次のセルIDのセル領域のセル情報を取得する。このセル領域を右隣接セルと仮定する。   First, in step S2002, the control unit 20 sequentially acquires the cell information of each cell region extracted in step S903 of FIG. 9 from the cell table 30. In the first step S2002, the cell information of the first cell area (cell ID is S1) is acquired. In step S2002 after the second time, the cell information of the cell area of the next cell ID stored in the cell table 30 is acquired. This cell region is assumed to be the right adjacent cell.

制御部20は、ステップS2003において、基準セルの右辺罫線番号と右隣接セルの左辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS2003:NO)、ステップS2004乃至S2014をスキップし、ループの先頭(次のステップS2002)から実行する。   In step S2003, the control unit 20 determines whether or not the right side ruled line number of the reference cell and the left side ruled line number of the right adjacent cell match. When it is determined that they do not match (step S2003: NO), steps S2004 to S2014 are skipped and the process is executed from the beginning of the loop (next step S2002).

他方、一致すると判断された場合(ステップS2003:YES)、仮定された右隣接セルは基準セルに隣接するセル領域であると判断でき、制御部20は、ステップS2004において、基準セルの上辺罫線番号と右隣接セルの上辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS2004:NO)、ステップS2005乃至S2014をスキップし、ループの先頭(次のステップS2002)から実行する。   On the other hand, when it is determined that they match (step S2003: YES), it can be determined that the assumed right adjacent cell is the cell region adjacent to the reference cell, and the control unit 20 determines in step S2004 the upper side ruled line number of the reference cell. And the upper side ruled line number of the right adjacent cell match. If it is determined that they do not match (step S2004: NO), steps S2005 to S2014 are skipped and the process is executed from the beginning of the loop (next step S2002).

他方、一致すると判断された場合(ステップS2004:YES)、仮定された右隣接セルと基準セルが帳票画像の縦方向において同じ画素位置から始まっていると判断でき、制御部20は、ステップS2005において、基準セルと右隣接セルについて第4の幾何学比を算出する。例えば、基準セルの横の長さに対する右隣接セルの横の長さを第4の幾何学比として算出する。   On the other hand, if it is determined that they match (step S2004: YES), it can be determined that the assumed right adjacent cell and the reference cell start from the same pixel position in the vertical direction of the form image, and the control unit 20 determines in step S2005. , A fourth geometric ratio is calculated for the reference cell and the right adjacent cell. For example, the lateral length of the right adjacent cell to the lateral length of the reference cell is calculated as the fourth geometric ratio.

制御部20は、ステップS2006において、ステップS2005で算出した第4の幾何学比が所定の閾値以上か否かを判断する。例えば、第4の幾何学比が1.5以上か否かを判断する。これは、見出しの右側にデータがあるか否かの判断となる。第4の幾何学比が所定の閾値以上でないと判断された場合(ステップS2006:NO)、ステップS2007乃至S2014をスキップし、ループの先頭(次のステップS2002)から実行する。   In step S2006, the control unit 20 determines whether or not the fourth geometric ratio calculated in step S2005 is greater than or equal to a predetermined threshold value. For example, it is determined whether the fourth geometric ratio is 1.5 or more. This is a judgment as to whether or not there is data on the right side of the heading. When it is determined that the fourth geometric ratio is not equal to or larger than the predetermined threshold value (step S2006: NO), steps S2007 to S2014 are skipped and the loop is executed from the beginning (next step S2002).

他方、第4の幾何学比が所定の閾値以上であると判断された場合(ステップS2006:YES)、図9のステップS903で抽出したセル領域の数だけ、ステップS2007乃至S2014を繰り返す。まず、制御部20は、ステップS2007において、図9のステップS903で抽出した各セル領域のセル情報をセルテーブル30から順に取得する。最初のステップS2007においては、最初のセル領域(セルIDがS1)のセル情報を取得する。2回目以降のステップS207においては、セルテーブル30に格納された次のセルIDのセル領域のセル情報を取得する。このセル領域を右下隣接セルとする。   On the other hand, when it is determined that the fourth geometric ratio is equal to or larger than the predetermined threshold value (step S2006: YES), steps S2007 to S2014 are repeated by the number of cell regions extracted in step S903 of FIG. First, in step S2007, the control unit 20 sequentially acquires the cell information of each cell region extracted in step S903 of FIG. 9 from the cell table 30. In the first step S2007, cell information of the first cell area (cell ID is S1) is acquired. In step S207 after the second time, the cell information of the cell area of the next cell ID stored in the cell table 30 is acquired. This cell area is the lower right adjacent cell.

制御部20は、ステップS2008において、右隣接セルの左辺罫線番号と右下隣接セルの左辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS2008:NO)、ステップS2009乃至S2014をスキップし、ループの先頭(次のステップS2007)から実行する。   In step S2008, the control unit 20 determines whether or not the left side ruled line number of the right adjacent cell and the left side ruled line number of the lower right adjacent cell match. When it is determined that they do not match (step S2008: NO), steps S2009 to S2014 are skipped and the process is executed from the beginning of the loop (next step S2007).

他方、一致すると判断された場合(ステップS2008:YES)、制御部20は、ステップS2009において、右隣接セルの右辺罫線番号と右下隣接セルの右辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS2009:NO)、ステップS2010乃至S2014をスキップし、ループの先頭(次のステップS2007)から実行する。   On the other hand, if it is determined that they match (step S2008: YES), the control unit 20 determines in step S2009 whether or not the right side ruled line number of the right adjacent cell and the right side ruled line number of the lower right adjacent cell match. When it is determined that they do not match (step S2009: NO), steps S2010 to S2014 are skipped, and the process is executed from the beginning of the loop (next step S2007).

他方、一致すると判断された場合(ステップS2009:YES)、図9のステップS903で抽出したセル領域の数だけ、ステップS2010乃至S2014を繰り返す。まず、制御部20は、図21のステップS2010において、図9のステップS903で抽出した各セル領域のセル情報をセルテーブル30から順に取得する。最初のステップS2010においては、最初のセル領域(セルIDがS1)のセル情報を取得する。2回目以降のステップS2010においては、セルテーブル30に格納された次のセルIDのセル領域のセル情報を取得する。このセル領域を下隣接セルとする。   On the other hand, if it is determined that they match (step S2009: YES), steps S2010 to S2014 are repeated by the number of cell regions extracted in step S903 of FIG. First, in step S2010 of FIG. 21, the control unit 20 sequentially acquires the cell information of each cell region extracted in step S903 of FIG. 9 from the cell table 30. In the first step S2010, cell information of the first cell area (cell ID is S1) is acquired. In step S2010 after the second time, the cell information of the cell area of the next cell ID stored in the cell table 30 is acquired. This cell region is defined as a lower adjacent cell.

制御部20は、ステップS2011において、基準セルの左辺罫線番号と下隣接セルの左辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS2011:NO)、ステップS2012乃至S2014をスキップし、ループの先頭(次のステップS2010)から実行する。   In step S2011, the control unit 20 determines whether or not the left side ruled line number of the reference cell and the left side ruled line number of the lower adjacent cell match. When it is determined that they do not match (step S2011: NO), steps S2012 to S2014 are skipped and the process is executed from the beginning of the loop (next step S2010).

他方、一致すると判断された場合(ステップS2011:YES)、制御部20は、ステップS2012において、基準セルの右辺罫線番号と下隣接セルの右辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS2012:NO)、ステップS2013乃至S2014をスキップし、ループの先頭(次のステップS2010)から実行する。   On the other hand, if it is determined that they match (step S2011: YES), the control unit 20 determines in step S2012 whether or not the right side ruled line number of the reference cell and the right side ruled line number of the lower adjacent cell match. If it is determined that they do not match (step S2012: NO), steps S2013 to S2014 are skipped and the process is executed from the beginning of the loop (next step S2010).

他方、一致すると判断された場合(ステップS2012:YES)、制御部20は、ステップS2013において、下隣接セルの下辺罫線番号と右下隣接セルの下辺罫線番号が一致するか否かを判断する。一致しないと判断された場合(ステップS2013:NO)、ステップS2014をスキップし、ループの先頭(次のステップS2010)から実行する。   On the other hand, if it is determined that they match (step S2012: YES), the control unit 20 determines in step S2013 whether the lower ruled line number of the lower adjacent cell and the lower ruled line number of the lower right adjacent cell match. When it is determined that they do not match (step S2013: NO), step S2014 is skipped and the process is executed from the beginning of the loop (next step S2010).

他方、一致すると判断された場合(ステップS2013:YES)、制御部20は、ステップS2014において、対象のセル領域が、見出しとデータがN(複数)対N(複数)の関係にある、例えば、図16(E)に示すような表構造セル64であると判断してカウントアップし、表構造セル64と判断されたセル領域の数を計数する。   On the other hand, if it is determined that they match (step S2013: YES), the control unit 20 determines in step S2014 that the target cell region has an N (plural) to N (plural) relationship between the headline and the data, for example, It is determined that the cell is a table-structured cell 64 as shown in FIG. 16 (E), and the count-up is performed.

上述してきたようにして、形状パターン毎の計数結果を算出する。上述の例では、図22に示すように、「横長セル」61の計数結果が「22個」、「1対1セル」62の計数結果が「7個」、「1対Nセル」63の計数結果が「2個」、および「表構造セル」64の計数結果が「4個」となる。   As described above, the counting result for each shape pattern is calculated. In the above-described example, as shown in FIG. 22, the count result of the “horizontally long cell” 61 is “22”, the count result of the “1-to-1 cell” 62 is “7”, and the “1-to-N cell” 63 is 63. The count result is “2” and the count result of the “table structure cell” 64 is “4”.

図13の説明に戻る。
制御部20は、ステップS1302において、ステップS1301のサブルーチン「表形状特徴カウント処理」の処理結果を合計する。すなわち、図17乃至図21を用いて説明したサブルーチン「第1のカウント処理」乃至「第4のカウント処理」の処理結果を合計する。具体的には、図17のステップS1703で計数された横長セル61の数と、図18のステップS1808で計数された1対1セル62の数と、図19のステップS1911で計数された1対Nセル63の数と、図21のステップS2014で計数された表構造セル64の数との合計値を得点とする。
Returning to the explanation of FIG.
In step S1302, the control unit 20 sums up the processing results of the subroutine "table shape feature count processing" in step S1301. That is, the processing results of the subroutines “first counting process” to “fourth counting process” described with reference to FIGS. 17 to 21 are totaled. Specifically, the number of horizontally long cells 61 counted in step S1703 of FIG. 17, the number of 1-to-1 cells 62 counted in step S1808 of FIG. 18, and the number of 1-pair cells counted in step S1911 of FIG. The total value of the number of N cells 63 and the number of table structure cells 64 counted in step S2014 of FIG. 21 is set as a score.

制御部20は、ステップS1303において、ステップS1302で求めた得点が所定の閾値以上か否かを判断する。   In step S1303, the control unit 20 determines whether the score obtained in step S1302 is equal to or higher than a predetermined threshold.

得点が閾値以上であると判断された場合(ステップS1303:YES)、すなわち帳票画像が正立であると判断した場合、ループを抜ける。   When it is determined that the score is equal to or higher than the threshold value (step S1303: YES), that is, when the form image is upright, the loop is exited.

他方、得点が閾値以上でないと判断された場合(ステップS1303:NO)、すなわち帳票画像が正立でないと判断した場合、制御部20は、ステップS1304において、図23に示すように、帳票画像を右に90度回転させる。   On the other hand, when it is determined that the score is not equal to or greater than the threshold value (step S1303: NO), that is, when the form image is not upright, the control unit 20 displays the form image as shown in FIG. 23 in step S1304. Rotate 90 degrees to the right.

制御部20は、ステップS1305において、回転させた帳票画像について再度罫線の抽出(図9のステップS902)、およびセル領域の抽出(図9のステップS903)を行う。   In step S1305, the control unit 20 again extracts ruled lines (step S902 in FIG. 9) and cell areas (step S903 in FIG. 9) from the rotated form image.

なお、図13に例示したサブルーチン「イメージ自動正立判定/回転処理」は、ステップS1303の判断ステップを満たした場合(ステップS1303:YES)、残りの方向での処理を省略(スキップ)する。またはスキップせずに、4方向全て実行した後に、各方向での得点を比較判断するようにしてもよい。すなわち、4方向のそれぞれの得点が最も高い方向を正立と判断する。   Note that the subroutine “image automatic erecting determination / rotation processing” illustrated in FIG. 13 omits (skips) processing in the remaining directions when the determination step of step S1303 is satisfied (step S1303: YES). Alternatively, without skipping, the scores in each direction may be compared and determined after execution in all four directions. That is, the direction with the highest score in each of the four directions is determined to be upright.

図9の説明に戻る。
制御部20は、ステップS905において、サブルーチン「定義体レス認識処理」を実行する。定義体レス認識処理は、公知の技術と同様であり、定義体を用いずに独自にレイアウトした私製帳票を認識するもので、見出しとデータとを求める。また、定義レス認識処理の代わりに定義体認識処理を行ってもよい。定義体認識処理は、公知の技術と同様であり、定義体を用いて帳票のデータを求める。詳細な説明は省略する。
Returning to the explanation of FIG.
In step S905, the control unit 20 executes a subroutine "definition definition less recognition processing". The definition-less recognition process is the same as the known technique, and is a process for recognizing a privately-made form that is uniquely laid out without using a definition, and a headline and data are obtained. Further, the definition recognition processing may be performed instead of the definitionless recognition processing. The definition recognizing process is the same as the known technique, and the form data is obtained using the definition. Detailed description is omitted.

制御部20は、ステップS906において、ステップS905で実行したサブルーチン「定義体レス認識処理」の認識結果を返す。   In step S906, the control unit 20 returns the recognition result of the subroutine “definition body-less recognition processing” executed in step S905.

図8の説明に戻る。
ステップS801で帳票処理装置1を操作した操作者は、ステップS803において、表示装置2に表示されたサブルーチン「定義体レス認識処理」の認識結果を確認する。
Returning to the description of FIG.
The operator who has operated the form processing apparatus 1 in step S801 confirms the recognition result of the subroutine “definition definitionless recognition processing” displayed on the display device 2 in step S803.

操作者は、修正すべき認識結果があれば、ステップS804において、入力装置32を用いて修正する。例えば、帳票中に記載した「振込人住所氏名」のデータが誤認識された場合、操作者は入力装置32を用いて正しい住所または氏名に修正する。   If there is a recognition result to be corrected, the operator corrects it using the input device 32 in step S804. For example, when the data of “transferee address name” described in the form is erroneously recognized, the operator corrects the correct address or name using the input device 32.

そして、操作者は、ステップS805において、表示装置2に表示された「完了キー」を押下することで、帳票処理の操作を終了する。   Then, in step S805, the operator presses the "completion key" displayed on the display device 2 to end the operation of the form processing.

以上、本発明の実施の形態を、図面を参照しながら説明してきたが、本発明が適用される帳票処理装置は、前述の実施の形態に限定されない。   Although the embodiments of the present invention have been described above with reference to the drawings, the form processing apparatus to which the present invention is applied is not limited to the above embodiments.

前述してきた本発明の実施の形態は、帳票処理装置の一機能としてハードウェアまたはDSP(Digital Signal Processor)ボードやCPUボードでのファームウェアもしくはソフトウェアにより実現することができる。   The above-described embodiment of the present invention can be realized by hardware as one function of the form processing apparatus or by firmware or software on a DSP (Digital Signal Processor) board or CPU board.

また、本発明が適用される帳票処理装置は、その機能が実行されるのであれば、前述の実施の形態に限定されることなく、単体の装置であっても、複数の装置からなるシステムあるいは統合装置であっても、LAN、WAN等のネットワークを介して処理が行なわれるシステムであってもよいことは言うまでもない。   Further, the form processing apparatus to which the present invention is applied is not limited to the above-described embodiment as long as the function is executed, and even if it is a single apparatus, a system including a plurality of apparatuses or It goes without saying that the integrated device may be a system in which processing is performed via a network such as LAN or WAN.

また、バスに接続されたCPU、ROMやRAMのメモリ、入力装置、出力装置、外部記録装置、媒体駆動装置、ネットワーク接続装置で構成されるシステムでも実現できる。すなわち、前述してきた実施の形態のシステムを実現するソフトェアのプログラムを記録したROMやRAMのメモリ、外部記録装置、可搬記録媒体を、帳票処理装置に供給し、その帳票処理装置のコンピュータがプログラムを読み出し実行することによっても、達成されることは言うまでもない。   It can also be realized by a system including a CPU connected to a bus, a memory of ROM or RAM, an input device, an output device, an external recording device, a medium driving device, and a network connection device. That is, the ROM or RAM memory recording the software program for realizing the system of the above-described embodiment, the external recording device, and the portable recording medium are supplied to the form processing device, and the computer of the form processing device executes the program. Needless to say, this can be achieved by reading out and executing.

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

プログラムを供給するための可搬記録媒体としては、例えば、フレキシブルディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM、CD−R、DVD−ROM、DVD−RAM、磁気テープ、不揮発性のメモリーカード、ROMカード、電子メールやパソコン通信等のネットワーク接続装置(言い換えれば、通信回線)を介して記録した種々の記録媒体などを用いることができる。   Examples of the portable recording medium for supplying the program include a flexible disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a CD-R, a DVD-ROM, a DVD-RAM, a magnetic tape, and a non-volatile memory card. , A ROM card, various recording media recorded via a network connection device (in other words, a communication line) such as electronic mail or personal computer communication can be used.

また、コンピュータ(情報処理装置)がメモリ上に読み出したプログラムを実行することによって、前述した実施の形態の機能が実現される他、そのプログラムの指示に基づき、コンピュータ上で稼動しているOSなどが実際の処理の一部又は全部を行ない、その処理によっても前述した実施の形態の機能が実現される。   In addition, the functions of the above-described embodiments are realized by the computer (information processing device) executing the program read on the memory, and an OS running on the computer based on the instructions of the program. Performs part or all of the actual processing, and that processing also realizes the functions of the above-described embodiments.

さらに、可搬型記録媒体から読み出されたプログラムやプログラム(データ)提供者から提供されたプログラム(データ)が、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれた後、そのプログラムの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部又は全部を行ない、その処理によっても前述した実施の形態の機能が実現され得る。   Further, the program (data) read from the portable recording medium or the program (data) provided by the program (data) provider is stored in the memory provided in the function expansion board inserted into the computer or the function expansion unit connected to the computer. After being written, based on the instructions of the program, the CPU or the like provided in the function expansion board or the function expansion unit performs a part or all of the actual processing, and the processing also realizes the functions of the above-described embodiments. obtain.

すなわち、本発明は、以上に述べた実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲内で種々の構成又は形状を取ることができる。   That is, the present invention is not limited to the embodiments described above, and various configurations or shapes can be adopted without departing from the scope of the present invention.

1 帳票処理装置
2 表示装置
3 画像読取装置
20 制御部
21 スキャナ制御部
22 文字認識処理部
23 罫線解析処理部
24 帳票認識処理部
25 イメージ正立判定処理部
26 イメージ回転処理部
27 文字認識辞書
28 見出しテーブル
30 セルテーブル
31 CPU(Central Processing Unit)
32 入力装置
33 出力装置
34 ROM(Read Only Memory)
35 RAM(Random Access Memory)
36 インターフェース(I/F)
37 バス
41 画像読取部
42 罫線抽出部
43 セル領域認識部
44 セル形状パターン計数部
45 帳票画像正立判断部
46 帳票画像回転部
61 横長セル
62 1対1セル
63 1対Nセル
64 表構造セル
1 form processing device 2 display device 3 image reading device 20 control unit 21 scanner control unit 22 character recognition processing unit 23 ruled line analysis processing unit 24 form recognition processing unit 25 image upright determination processing unit 26 image rotation processing unit 27 character recognition dictionary 28 Heading table 30 Cell table 31 CPU (Central Processing Unit)
32 input device 33 output device 34 ROM (Read Only Memory)
35 RAM (Random Access Memory)
36 Interface (I / F)
37 bus 41 image reading unit 42 ruled line extraction unit 43 cell area recognition unit 44 cell shape pattern counting unit 45 form image upright determination unit 46 form image rotating unit 61 horizontal cell 62 1 to 1 cell 63 1 to N cell 64 table structure cell

Claims (6)

帳票処理装置のコンピュータを、
帳票画像を画像読取装置に読み取らせる画像読取手段、
前記画像読取手段によって読み取らせた帳票画像から縦横罫線を抽出する罫線抽出手段、
前記罫線抽出手段によって抽出された縦横罫線に基づいてセル領域を認識するセル領域認識手段、
前記セル領域認識手段によって認識されたすべてのセル領域について、前記帳票画像が正立である可能性のある複数通りの所定の形状パターンの内いずれかに該当するかを判断することにより、前記形状パターン毎に前記該当するセル領域の数を計数するセル形状パターン計数手段、
前記セル形状パターン計数手段によ計数結果に基づいて、前記帳票画像が正立であるか否かを判断する帳票画像正立判断手段、
として機能させるための帳票処理プログラム。
Computer of the form processing device,
Image reading means for making the image reading device read the form image,
Ruled line extracting means for extracting vertical and horizontal ruled lines from the form image read by the image reading means,
Cell area recognition means for recognizing a cell area based on the vertical and horizontal ruled lines extracted by the ruled line extraction means,
For all cell regions recognized by the cell region recognizing means, by determining whether falling under one of the predetermined shape pattern of plural kinds which may the form image is erect, each Cell shape pattern counting means for counting the number of the corresponding cell regions for each shape pattern,
Based on the cell shape pattern counting means by that counting result, the form image erecting determination means the voucher image to determine whether it is upright,
Form processing program to function as.
前記セル形状パターン計数手段は、前記帳票画像の上下左右の4方向の各々について、前記各形状パターン毎に前記該当するセル領域の数を計数して各方向の計数結果を算出し、
前記帳票画像正立判断手段は、前記各方向の計数結果が最大値の方向を、前記帳票画像が正立であると判断する、
ことを特徴とする請求項1に記載の帳票処理プログラム。
The cell shape pattern counting means for each four directions of up, down, left and right of the form image, wherein by counting the number of the corresponding cell region wherein each shape pattern, calculates a counting result for each direction,
The form image upright determination unit determines that the direction in which the counting result of each direction is the maximum value indicates that the form image is upright.
The form processing program according to claim 1, characterized in that.
前記コンピュータを、更に、
前記帳票画像正立判断手段によって前記帳票画像が正立でないと判断された場合、前記帳票画像を回転させる帳票画像回転手段、
として機能させ、
前記帳票画像回転手段によって回転させた帳票画像に対して、前記罫線抽出手段および前記セル領域認識手段を実行する、
ことを特徴とする請求項1または2に記載の帳票処理プログラム。
The computer,
When the form image upright determining unit determines that the form image is not upright, a form image rotating unit that rotates the form image,
Function as
Executing the ruled line extraction means and the cell area recognition means on the form image rotated by the form image rotating means,
The form processing program according to claim 1 or 2, characterized in that.
前記帳票画像は、独自にレイアウトした私製帳票の読み取り画像である、ことを特徴とする請求項1乃至3の何れか1項に記載の帳票処理プログラム。   The form processing program according to any one of claims 1 to 3, wherein the form image is a read image of a privately made form that is uniquely laid out. 帳票処理装置において、
帳票画像を画像読取装置に読み取らせる画像読取部と、
前記画像読取部によって読み取らせた帳票画像から縦横罫線を抽出する罫線抽出部と、
前記罫線抽出部によって抽出された縦横罫線に基づいてセル領域を認識するセル領域認識部と、
前記セル領域認識部によって認識されたすべてのセル領域について、前記帳票画像が正立である可能性のある複数通りの所定の形状パターンの内いずれかに該当するかを判断することにより、前記形状パターン毎に前記該当するセル領域の数を計数するセル形状パターン計数部と、
前記セル形状パターン計数部によ計数結果に基づいて、前記帳票画像が正立であるか否かを判断する帳票画像正立判断部と、
を備えることを特徴とする帳票処理装置。
In the form processing device,
An image reading unit that causes the image reading device to read the form image,
A ruled line extraction unit that extracts vertical and horizontal ruled lines from the form image read by the image reading unit;
A cell area recognition unit that recognizes a cell area based on the vertical and horizontal ruled lines extracted by the ruled line extraction unit;
For all cell regions recognized by the cell area recognition unit, by determining whether falling under one of the predetermined shape pattern of plural kinds which may the form image is erect, each A cell shape pattern counting unit that counts the number of the corresponding cell regions for each shape pattern,
Based on by that counting result to the cell shape pattern counting part, and the form image erecting determination unit which the form image to determine whether it is upright,
A form processing apparatus comprising:
帳票処理装置において実行される帳票処理方法であって、
帳票画像を画像読取装置に読み取らせ、
前記読み取らせた帳票画像から縦横罫線を抽出し、
前記抽出された縦横罫線に基づいてセル領域を認識し、
前記認識されたすべてのセル領域について、前記帳票画像が正立である可能性のある複数通りの所定の形状パターンの内いずれかに該当するかを判断することにより、前記形状パターン毎に前記該当するセル領域の数を計数し、
前記計数の結果に基づいて、前記帳票画像が正立であるか否かを判断する、
ことを特徴とする帳票処理方法。
A form processing method executed in a form processing device, comprising:
Let the image reading device read the form image,
Extract vertical and horizontal ruled lines from the scanned form image,
Recognize the cell region based on the extracted vertical and horizontal ruled lines,
Wherein the recognized all cells regions, by determining whether falling under one of the predetermined shape pattern of plural kinds which may the form image is erected, wherein each shape pattern Count the number of applicable cell areas ,
Based on the result of the counting, it is determined whether the form image is upright.
A form processing method characterized by the above.
JP2016161949A 2016-08-22 2016-08-22 Form processing program, form processing device, and form processing method Active JP6691455B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016161949A JP6691455B2 (en) 2016-08-22 2016-08-22 Form processing program, form processing device, and form processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016161949A JP6691455B2 (en) 2016-08-22 2016-08-22 Form processing program, form processing device, and form processing method

Publications (2)

Publication Number Publication Date
JP2018032076A JP2018032076A (en) 2018-03-01
JP6691455B2 true JP6691455B2 (en) 2020-04-28

Family

ID=61303421

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016161949A Active JP6691455B2 (en) 2016-08-22 2016-08-22 Form processing program, form processing device, and form processing method

Country Status (1)

Country Link
JP (1) JP6691455B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11102416A (en) * 1997-09-26 1999-04-13 Fujitsu Ltd Device and method for slip read direction decision
JP4866184B2 (en) * 2006-03-15 2012-02-01 株式会社リコー Image processing apparatus, image direction determination method, and image direction determination program

Also Published As

Publication number Publication date
JP2018032076A (en) 2018-03-01

Similar Documents

Publication Publication Date Title
Bargeron et al. Reflowing digital ink annotations
US6651221B1 (en) System and methods for spacing, storing and recognizing electronic representations of handwriting, printing and drawings
JP5774558B2 (en) Handwritten document processing apparatus, method and program
CN111275880A (en) Bill identification method, device, equipment and storage medium
TWI354939B (en) Card identifying apparatus, card identifying metho
US20110173530A1 (en) Layout constraint manipulation via user gesture recognition
KR20200036098A (en) Apparatus, method and system for detecting character
JP2008234291A (en) Character recognition device and character recognition method
RU2673015C1 (en) Methods and systems of optical recognition of image series characters
CN115589786A (en) Method, device and system for recognizing hand-drawn figure and computer readable storage medium
JP2022522425A (en) Character recognition method using character recognition device and character recognition device
JP6691455B2 (en) Form processing program, form processing device, and form processing method
CN210038810U (en) Intelligent evaluation equipment and system
Reynolds et al. Salient object detection for images taken by people with vision impairments
CN116311289A (en) Handwriting font level evaluation system based on track recognition algorithm
JP5009256B2 (en) Document data creation apparatus, document data creation method, and document data creation program
An et al. Automatic matching of character strokes for computer-aided Chinese handwriting education
Scattolin Recognition of handwritten numerals using elastic matching
JP6342292B2 (en) Form processing program and form processing apparatus
CN110737364B (en) Control method for touch writing acceleration under android system
JP6691453B2 (en) Form processing program, form processing device, and form processing method
JP5217589B2 (en) Form image display device
Genfang et al. The study and prototype system of printed music recognition
US20180211366A1 (en) Flattening and Rectifying A Curved Image
Alabau et al. Transcribing handwritten text images with a word soup game

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20181004

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190827

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190924

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191120

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20191120

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200410

R150 Certificate of patent or registration of utility model

Ref document number: 6691455

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250