JP7106672B2 - Image processing device, control method and control program - Google Patents

Image processing device, control method and control program Download PDF

Info

Publication number
JP7106672B2
JP7106672B2 JP2020554629A JP2020554629A JP7106672B2 JP 7106672 B2 JP7106672 B2 JP 7106672B2 JP 2020554629 A JP2020554629 A JP 2020554629A JP 2020554629 A JP2020554629 A JP 2020554629A JP 7106672 B2 JP7106672 B2 JP 7106672B2
Authority
JP
Japan
Prior art keywords
image
brightness
ruled
region
characters
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
JP2020554629A
Other languages
Japanese (ja)
Other versions
JPWO2020089985A1 (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.)
PFU Ltd
Original Assignee
PFU 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 PFU Ltd filed Critical PFU Ltd
Publication of JPWO2020089985A1 publication Critical patent/JPWO2020089985A1/en
Application granted granted Critical
Publication of JP7106672B2 publication Critical patent/JP7106672B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Character Input (AREA)

Description

本開示は、画像処理装置、制御方法及び制御プログラムに関し、特に、低輝度背景上の高輝度文字を含む原稿の画像を処理する画像処理装置、制御方法及び制御プログラムに関する。 The present disclosure relates to an image processing apparatus, control method, and control program, and more particularly to an image processing apparatus, control method, and control program for processing an original image including high-brightness characters on a low-brightness background.

請求書等の帳票を担当者が手作業によりデータ化している会社では、膨大な数の帳票のデータ化が必要である場合に担当者の業務負担が大きくなるため、帳票のデータ化作業の効率化に対する要望が高まっている。帳票のデータ化作業の効率化を図るためには、帳票に記載されている文字をコンピュータが正しく認識する必要がある。このような帳票において、黒色等の輝度が低い低輝度背景上に、白色等の輝度が高い高輝度文字が配置されている場合がある。一般的に、OCR(Optical Character Recognition)ソフトウェアは、文字の輝度が背景の輝度よりも低いものとして、文字を認識する。そのため、そのような帳票を読み取った画像において、低輝度背景の領域の階調値と高輝度文字の領域の階調値との関係を逆転させてから、文字を認識することが望ましい。 In a company where the person in charge manually converts forms such as invoices into data, the work burden on the person in charge becomes large when it is necessary to convert a huge number of forms into data. There is a growing demand for In order to improve the efficiency of the form data conversion work, it is necessary for the computer to correctly recognize the characters written on the form. In such a form, high-brightness characters such as white may be placed on a low-brightness background such as black. In general, OCR (Optical Character Recognition) software recognizes characters as if the luminance of the characters is lower than the luminance of the background. Therefore, in an image obtained by reading such a form, it is desirable to reverse the relationship between the gradation values of the low-brightness background area and the gradation values of the high-brightness character area before recognizing the characters.

画像の白抜き文字部を検出して、検出された白抜き文字部を白黒反転し、反転された画像部分について、文字認識処理を行う文字認識装置が開示されている(特許文献1)。 A character recognition apparatus is disclosed that detects a white character portion of an image, reverses the detected white character portion, and performs character recognition processing on the reversed image portion (Patent Document 1).

特開平9-269970号公報JP-A-9-269970

低輝度背景上に高輝度文字が配置された帳票を撮像した画像において、低輝度背景の領域の階調値と高輝度文字の領域の階調値との関係を逆転させるためには、低輝度背景の領域を正しく特定する必要がある。特に、そのような帳票に罫線が含まれる場合、その帳票を撮像した画像において、低輝度背景の領域を正しく特定するためには、罫線の成分を良好に除去する必要がある。 In an image of a form in which high-brightness characters are arranged on a low-brightness background, in order to reverse the relationship between the gradation value of the low-brightness background area and the gradation value of the high-brightness character area, the low-brightness You need to correctly identify the background area. In particular, when such a form includes ruled lines, the components of the ruled lines must be removed satisfactorily in order to correctly identify the low-brightness background area in the captured image of the form.

画像処理装置、制御方法及び制御プログラムの目的は、低輝度背景と、低輝度背景上の高輝度文字と、罫線とを含む原稿の画像から文字を良好に検出することを可能とすることにある。 An object of an image processing apparatus, a control method, and a control program is to make it possible to satisfactorily detect characters from an image of a document including a low-luminance background, high-luminance characters on the low-luminance background, and ruled lines. .

実施形態の一側面に係る画像処理装置は、低輝度背景と、低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得する取得部と、多値画像を二値化した二値画像を生成する二値画像生成部と、二値画像から複数の罫線の成分を除去した罫線除去画像を生成する罫線除去画像生成部と、罫線除去画像内で黒色画素が連結する連結領域を検出する領域検出部と、領域検出部により検出された複数の連結領域の大きさの関係、複数の連結領域の位置の関係、又は、複数の連結領域の間の距離の内の少なくとも一つに基づいて、複数の連結領域を結合する結合部と、多値画像において、結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成する逆転画像生成部と、逆転画像から文字を検出する文字検出部と、検出された文字に関する情報を出力する出力部と、を有する。 An image processing apparatus according to an aspect of an embodiment includes an acquisition unit that acquires a multi-valued image of a document including a low-brightness background, high-brightness characters on the low-brightness background, and a plurality of ruled lines; , a ruled-line-removed image generation unit that generates a ruled-line-removed image by removing a plurality of ruled-line components from the binary image, and black pixels in the ruled-line-removed image. and the relationship between the sizes of the plurality of connected regions detected by the region detection unit, the relationship between the positions of the plurality of connected regions, or the distance between the plurality of connected regions and a combining unit that combines a plurality of connected regions based on at least one of: It has a reversed image generation unit that generates a reversed image with a reversed relationship with the gradation value, a character detection unit that detects characters from the reversed image, and an output unit that outputs information about the detected characters.

また、実施形態の一側面に係る制御方法は、出力部を有する画像処理装置の制御方法であって、画像処理装置が、低輝度背景と、低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得し、多値画像を二値化した二値画像を生成し、二値画像から複数の罫線の成分を除去した罫線除去画像を生成し、罫線除去画像内で黒色画素が連結する連結領域を検出し、検出された複数の連結領域の大きさの関係、複数の連結領域の位置の関係、又は、複数の連結領域の間の距離の内の少なくとも一つに基づいて、複数の連結領域を結合し、多値画像において、結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成し、逆転画像から文字を検出し、検出された文字に関する情報を出力部から出力することを含む。 A control method according to an aspect of the embodiment is a control method for an image processing apparatus having an output unit, wherein the image processing apparatus controls a low-brightness background, high-brightness characters on the low-brightness background, and a plurality of ruled lines. acquire a multivalued image of a document containing Detecting connected regions in which black pixels are connected in an image, and determining at least one of the size relationship of the detected connected regions, the positional relationship of the detected connected regions, or the distance between the detected connected regions Based on one, a plurality of connected regions are combined, and in a multilevel image, the relationship between the grayscale value of the low-luminance background region and the grayscale value of the high-luminance character region in the region corresponding to the combined connected region. generating a reversed image in which the is reversed; detecting characters from the reversed image; and outputting information about the detected characters from an output unit.

また、実施形態の一側面に係る制御プログラムは、出力部を有するコンピュータの制御プログラムであって、低輝度背景と、低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得し、多値画像を二値化した二値画像を生成し、二値画像から複数の罫線の成分を除去した罫線除去画像を生成し、罫線除去画像内で黒色画素が連結する連結領域を検出し、検出された複数の連結領域の大きさの関係、複数の連結領域の位置の関係、又は、複数の連結領域の間の距離の内の少なくとも一つに基づいて、複数の連結領域を結合し、多値画像において、結合部により結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成し、逆転画像から文字を検出し、検出された文字に関する情報を出力部から出力することをコンピュータに実行させる。 A control program according to one aspect of an embodiment is a control program for a computer having an output unit, and an image of a document including a low-brightness background, high-brightness characters on the low-brightness background, and a plurality of ruled lines is captured. Acquire a multi-valued image, generate a binary image by binarizing the multi-valued image, generate a ruled-line-removed image by removing multiple ruled-line components from the binary image, and connect black pixels in the ruled-line-removed image. based on at least one of the size relationship of the plurality of detected connected regions, the positional relationship of the plurality of connected regions, or the distance between the plurality of connected regions. , and reverses the relationship between the gradation values of the low-brightness background area and the gradation value of the high-brightness character area in the multivalued image corresponding to the connected areas joined by the joining part A computer is caused to generate a reversed image, detect characters from the reversed image, and output information about the detected characters from an output unit.

本実施形態によれば、画像処理装置、制御方法及び制御プログラムは、低輝度背景と、低輝度背景上の高輝度文字と、罫線とを含む原稿の画像から文字を良好に検出することが可能となる。 According to the present embodiment, the image processing apparatus, control method, and control program can satisfactorily detect characters from an image of a document including a low-luminance background, high-luminance characters on the low-luminance background, and ruled lines. becomes.

本発明の目的及び効果は、特に請求項において指摘される構成要素及び組み合わせを用いることによって認識され且つ得られるだろう。前述の一般的な説明及び後述の詳細な説明の両方は、例示的及び説明的なものであり、特許請求の範囲に記載されている本発明を制限するものではない。 The objects and advantages of the invention may be realized and obtained by means of the elements and combinations particularly pointed out in the claims. Both the foregoing general description and the following detailed description are exemplary and explanatory, and are not limiting of the invention as claimed.

実施形態に従った画像処理システム1の概略構成を示す図である。1 is a diagram showing a schematic configuration of an image processing system 1 according to an embodiment; FIG. 第2記憶装置210及び第2CPU220の概略構成を示す図である。2 is a diagram showing a schematic configuration of a second storage device 210 and a second CPU 220; FIG. 画像読取処理の動作を示すフローチャートである。4 is a flowchart showing the operation of image reading processing; 認識処理の動作を示すフローチャートである。4 is a flowchart showing the operation of recognition processing; 多値画像500の一例を示す模式図である。5 is a schematic diagram showing an example of a multivalued image 500; FIG. 二値画像510の一例を示す模式図である。5 is a schematic diagram showing an example of a binary image 510; FIG. 二値画像600の一例を示す模式図である。6 is a schematic diagram showing an example of a binary image 600; FIG. 罫線除去画像610の一例を示す模式図である。FIG. 6 is a schematic diagram showing an example of a ruled-line-removed image 610. FIG. 罫線除去画像700の一例を示す模式図である。FIG. 7 is a schematic diagram showing an example of a ruled-line-removed image 700; 罫線除去画像720の一例を示す模式図である。FIG. 7 is a schematic diagram showing an example of a ruled-line-removed image 720; 逆転画像800の一例を示す模式図である。FIG. 8 is a schematic diagram showing an example of a reversed image 800; 逆転二値画像810の一例を示す模式図である。FIG. 8 is a schematic diagram showing an example of a reversed binary image 810; 処理装置230の概略構成を示すブロック図である。2 is a block diagram showing a schematic configuration of a processing device 230; FIG.

以下、本開示の一側面に係る画像処理装置、制御方法及び制御プログラムについて図を参照しつつ説明する。但し、本発明の技術的範囲はそれらの実施の形態に限定されず、特許請求の範囲に記載された発明とその均等物に及ぶ点に留意されたい。 An image processing apparatus, a control method, and a control program according to one aspect of the present disclosure will be described below with reference to the drawings. However, it should be noted that the technical scope of the present invention is not limited to those embodiments, but extends to the invention described in the claims and equivalents thereof.

図1は、実施形態に従った画像処理システムの概略構成を示す図である。図1に示すように、画像処理システム1は、画像読取装置100と、情報処理装置200とを有する。 FIG. 1 is a diagram showing a schematic configuration of an image processing system according to an embodiment. As shown in FIG. 1, the image processing system 1 has an image reading device 100 and an information processing device 200 .

画像読取装置100は、例えばスキャナ装置等である。画像読取装置100は、情報処理装置200に接続されている。情報処理装置200は、画像処理装置の一例であり、例えばパーソナルコンピュータ等である。 The image reading device 100 is, for example, a scanner device. The image reading device 100 is connected to the information processing device 200 . The information processing device 200 is an example of an image processing device, such as a personal computer.

画像読取装置100は、第1インタフェース装置101と、撮像装置102と、第1記憶装置110と、第1CPU(Control Processing Unit)120とを有する。 The image reading device 100 has a first interface device 101 , an imaging device 102 , a first storage device 110 , and a first CPU (Control Processing Unit) 120 .

第1インタフェース装置101は、USB(Universal Serial Bus)等のシリアルバスに準じるインタフェース回路を有し、情報処理装置200と電気的に接続して画像データ及び各種の情報を送受信する。また、第1インタフェース装置101の代わりに、無線信号を送受信するアンテナと、所定の通信プロトコルに従って、無線通信回線を通じて信号の送受信を行うための無線通信インタフェース回路とを有する通信装置が用いられてもよい。所定の通信プロトコルは、例えば無線LAN(Local Area Network)である。 The first interface device 101 has an interface circuit conforming to a serial bus such as USB (Universal Serial Bus), and is electrically connected to the information processing device 200 to transmit and receive image data and various information. Further, instead of the first interface device 101, a communication device having an antenna for transmitting and receiving wireless signals and a wireless communication interface circuit for transmitting and receiving signals through a wireless communication line according to a predetermined communication protocol may be used. good. The predetermined communication protocol is, for example, a wireless LAN (Local Area Network).

撮像装置102は、主走査方向に直線状に配列されたCCD(Charge Coupled Device)による撮像素子を備える縮小光学系タイプの撮像センサを有する。さらに、撮像装置102は、光を照射する光源と、撮像素子上に像を結ぶレンズと、撮像素子から出力された電気信号を増幅してアナログ/デジタル(A/D)変換するA/D変換器とを有する。撮像装置102において、撮像センサは、搬送される原稿の表面を撮像してアナログの画像信号を生成して出力し、A/D変換器は、このアナログの画像信号をA/D変換してデジタルの入力画像を生成して出力する。入力画像は、各画素データが、例えばRGB各色毎に8bitで表される計24bitのR(赤色)値、G(緑色)値、B(青色)値からなるカラー多値画像である。なお、CCDの代わりにCMOS(Complementary Metal Oxide Semiconductor)による撮像素子を備える等倍光学系タイプのCIS(Contact Image Sensor)が用いられてもよい。 The imaging device 102 has a reduction optical system type imaging sensor that includes imaging elements that are CCDs (Charge Coupled Devices) linearly arranged in the main scanning direction. Further, the imaging device 102 includes a light source for irradiating light, a lens for forming an image on an imaging element, and an A/D converter for amplifying and analog/digital (A/D)-converting an electric signal output from the imaging element. have a vessel. In the image pickup apparatus 102, the image sensor picks up an image of the surface of the document being conveyed to generate and output an analog image signal, and the A/D converter converts the analog image signal into a digital image. Generate and output the input image of . The input image is a color multivalued image in which each pixel data is composed of a total of 24 bits of R (red) value, G (green) value, and B (blue) value represented by 8 bits for each color of RGB, for example. Incidentally, instead of the CCD, a CIS (Contact Image Sensor) of an equal-magnification optical system type having an imaging element of CMOS (Complementary Metal Oxide Semiconductor) may be used.

第1記憶装置110は、RAM(Random Access Memory)、ROM(Read Only Memory)等のメモリ装置、ハードディスク等の固定ディスク装置、又はフレキシブルディスク、光ディスク等の可搬用の記憶装置等を有する。また、第1記憶装置110には、画像読取装置100の各種処理に用いられるコンピュータプログラム、データベース、テーブル等が格納される。コンピュータプログラムは、コンピュータ読み取り可能な可搬型記録媒体から公知のセットアッププログラム等を用いて第1記憶装置110にインストールされてもよい。可搬型記録媒体は、例えばCD-ROM(compact disk read only memory)、DVD-ROM(digital versatile disk read only memory)等である。また、第1記憶装置110は、撮像装置102により生成された入力画像等を記憶する。 The first storage device 110 includes memory devices such as RAM (Random Access Memory) and ROM (Read Only Memory), fixed disk devices such as hard disks, or portable storage devices such as flexible disks and optical disks. The first storage device 110 also stores computer programs, databases, tables, and the like used for various processes of the image reading apparatus 100 . The computer program may be installed in the first storage device 110 from a computer-readable portable recording medium using a known setup program or the like. Examples of portable recording media include CD-ROMs (compact disk read only memory) and DVD-ROMs (digital versatile disk read only memory). Also, the first storage device 110 stores an input image and the like generated by the imaging device 102 .

第1CPU120は、予め第1記憶装置110に記憶されているプログラムに基づいて動作する。なお、第1CPU120に代えて、DSP(digital signal processor)、LSI(large scale integration)等が用いられてよい。また、第1CPU120に代えて、ASIC(Application Specific Integrated Circuit)、FPGA(Field-Programming Gate Array)等が用いられてもよい。 The first CPU 120 operates based on a program stored in advance in the first storage device 110 . A DSP (digital signal processor), LSI (large scale integration), or the like may be used instead of the first CPU 120 . Also, instead of the first CPU 120, an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programming Gate Array), or the like may be used.

第1CPU120は、第1インタフェース装置101、撮像装置102及び第1記憶装置110等と接続され、これらの各部を制御する。第1CPU120は、撮像装置102の原稿読取制御、第1インタフェース装置101を介した情報処理装置200とのデータ送受信制御等を行う。 The first CPU 120 is connected to the first interface device 101, the imaging device 102, the first storage device 110, and the like, and controls these units. The first CPU 120 performs document reading control of the imaging device 102, data transmission/reception control with the information processing device 200 via the first interface device 101, and the like.

情報処理装置200は、第2インタフェース装置201と、入力装置202と、表示装置203と、第2記憶装置210と、第2CPU220と、処理装置230とを有する。以下、情報処理装置200の各部について詳細に説明する。 The information processing device 200 has a second interface device 201 , an input device 202 , a display device 203 , a second storage device 210 , a second CPU 220 and a processing device 230 . Each unit of the information processing apparatus 200 will be described in detail below.

第2インタフェース装置201は、画像読取装置100の第1インタフェース装置101と同様のインタフェース回路を有し、情報処理装置200と画像読取装置100とを接続する。また、第2インタフェース装置201の代わりに、無線信号を送受信するアンテナと、無線LAN等の所定の通信プロトコルに従って、無線通信回線を通じて信号の送受信を行うための無線通信インタフェース回路とを有する通信装置が用いられてもよい。 The second interface device 201 has an interface circuit similar to that of the first interface device 101 of the image reading device 100 and connects the information processing device 200 and the image reading device 100 . Further, instead of the second interface device 201, a communication device having an antenna for transmitting and receiving wireless signals and a wireless communication interface circuit for transmitting and receiving signals through a wireless communication line according to a predetermined communication protocol such as a wireless LAN is provided. may be used.

入力装置202は、キーボード、マウス等の入力装置及び入力装置から信号を取得するインタフェース回路を有し、利用者の操作に応じた信号を第2CPU220に出力する。 The input device 202 has an input device such as a keyboard and a mouse, and an interface circuit for acquiring signals from the input device, and outputs a signal corresponding to a user's operation to the second CPU 220 .

表示装置203は、出力部の一例である。表示装置203は、液晶、有機EL等から構成されるディスプレイ及びディスプレイに画像データを出力するインタフェース回路を有し、第2記憶装置210と接続されて第2記憶装置210に保存されている画像データをディスプレイに表示する。 The display device 203 is an example of an output unit. The display device 203 has a display composed of a liquid crystal, an organic EL, or the like and an interface circuit for outputting image data to the display. on the display.

第2記憶装置210は、画像読取装置100の第1記憶装置110と同様のメモリ装置、固定ディスク装置、可搬用の記憶装置等を有する。第2記憶装置210には、情報処理装置200の各種処理に用いられるコンピュータプログラム、データベース、テーブル等が格納される。コンピュータプログラムは、例えばCD-ROM、DVD-ROM等のコンピュータ読み取り可能な可搬型記録媒体から、公知のセットアッププログラム等を用いて第2記憶装置210にインストールされてもよい。また、第2記憶装置210は、画像読取装置100から受信した入力画像、及び、処理装置230により入力画像に対して画像処理がなされた各種の処理画像等を記憶する。 The second storage device 210 has a memory device similar to the first storage device 110 of the image reading device 100, a fixed disk device, a portable storage device, and the like. The second storage device 210 stores computer programs, databases, tables, etc. used for various processes of the information processing device 200 . The computer program may be installed in the second storage device 210 from a computer-readable portable recording medium such as CD-ROM, DVD-ROM, etc. using a known setup program or the like. The second storage device 210 also stores an input image received from the image reading device 100 and various processed images obtained by performing image processing on the input image by the processing device 230 .

第2CPU220は、予め第2記憶装置210に記憶されているプログラムに基づいて動作する。なお、第2CPU220に代えて、DSP、LSI、ASIC、FPGA等が用いられてもよい。 The second CPU 220 operates based on a program pre-stored in the second storage device 210 . A DSP, LSI, ASIC, FPGA, or the like may be used instead of the second CPU 220 .

第2CPU220は、第2インタフェース装置201、入力装置202、表示装置203、第2記憶装置210及び処理装置230等と接続され、これらの各部を制御する。第2CPU220は、第2インタフェース装置201を介した画像読取装置100とのデータ送受信制御、入力装置202の入力制御、表示装置203の表示制御、処理装置230による画像処理の制御等を行う。 The second CPU 220 is connected to the second interface device 201, the input device 202, the display device 203, the second storage device 210, the processing device 230, etc., and controls these units. The second CPU 220 performs data transmission/reception control with the image reading device 100 via the second interface device 201, input control of the input device 202, display control of the display device 203, image processing control of the processing device 230, and the like.

処理装置230は、入力画像に対して所定の画像処理を実行する。処理装置230は、CPU、DSP、LSI、ASIC又はFPGA等で構成される。 The processing device 230 performs predetermined image processing on the input image. The processing device 230 is composed of a CPU, DSP, LSI, ASIC, FPGA, or the like.

図2は、第2記憶装置210及び第2CPU220の概略構成を示す図である。 FIG. 2 is a diagram showing a schematic configuration of the second storage device 210 and the second CPU 220. As shown in FIG.

図2に示すように第2記憶装置210には、取得プログラム211、二値画像生成プログラム212、罫線除去画像生成プログラム213、領域検出プログラム214、結合プログラム215、逆転画像生成プログラム216、逆転二値画像生成プログラム217、文字検出プログラム218及び出力制御プログラム219等の各プログラムが記憶される。これらの各プログラムは、プロセッサ上で動作するソフトウェアにより実装される機能モジュールである。第2CPU220は、第2記憶装置210に記憶された各プログラムを読み取り、読み取った各プログラムに従って動作する。これにより、第2CPU220は、取得部221、二値画像生成部222、罫線除去画像生成部223、領域検出部224、結合部225、逆転画像生成部226、逆転二値画像生成部227、文字検出部228及び出力制御部229として機能する。 As shown in FIG. 2, the second storage device 210 stores an acquisition program 211, a binary image generation program 212, a ruled line removal image generation program 213, an area detection program 214, a combination program 215, a reverse image generation program 216, a reverse binary Programs such as an image generation program 217, a character detection program 218 and an output control program 219 are stored. Each of these programs is a functional module implemented by software running on a processor. The second CPU 220 reads each program stored in the second storage device 210 and operates according to each read program. As a result, the second CPU 220 includes an acquisition unit 221, a binary image generation unit 222, a ruled line removal image generation unit 223, an area detection unit 224, a combination unit 225, a reversed image generation unit 226, a reversed binary image generation unit 227, and a character detection unit. It functions as a unit 228 and an output control unit 229 .

図3は、画像読取装置100による画像読取処理の動作を示すフローチャートである。以下、図3に示したフローチャートを参照しつつ、画像読取処理の動作を説明する。なお、以下に説明する動作のフローは、予め第1記憶装置110に記憶されているプログラムに基づき主に第1CPU120により画像読取装置100の各要素と協働して実行される。 FIG. 3 is a flowchart showing the operation of image reading processing by the image reading apparatus 100. As shown in FIG. The operation of the image reading process will be described below with reference to the flowchart shown in FIG. The operation flow described below is executed mainly by the first CPU 120 in cooperation with each element of the image reading apparatus 100 based on a program stored in the first storage device 110 in advance.

最初に、撮像装置102は、原稿として、請求書等の帳票を撮像した入力画像を生成し、第1記憶装置110に保存する(ステップS101)。 First, the imaging device 102 generates an input image obtained by imaging a form such as an invoice as a document, and stores it in the first storage device 110 (step S101).

この原稿には、少なくとも、黒色等の輝度が低い低輝度背景と、低輝度背景上に配置された、白色等の輝度が高い高輝度文字と、複数の罫線とが含まれている。低輝度背景の輝度は所定輝度より低く、高輝度文字の輝度は低輝度背景の輝度より高い。即ち、入力画像において、低輝度背景領域の輝度値は所定輝度値(例えば128)より低く、高輝度文字領域の輝度値は低輝度背景領域の輝度値より高い。また、罫線の輝度は、低輝度背景の輝度と同様に、高輝度文字の輝度より低く、入力画像において、罫線領域の輝度値は、所定輝度値より低く、且つ、高輝度文字領域の輝度値より低い。 This document includes at least a low-brightness background such as black, high-brightness characters such as white placed on the low-brightness background, and a plurality of ruled lines. The brightness of the low-brightness background is lower than the predetermined brightness, and the brightness of the high-brightness characters is higher than the brightness of the low-brightness background. That is, in the input image, the brightness value of the low-brightness background area is lower than a predetermined brightness value (eg, 128), and the brightness value of the high-brightness character area is higher than the brightness value of the low-brightness background area. Similarly to the luminance of the low-luminance background, the luminance of the ruled lines is lower than the luminance of the high-luminance characters. Lower.

この原稿には、さらに、白色等の輝度が高い高輝度背景と、高輝度背景上に配置された、黒色等の輝度が低い低輝度文字とが含まれていてもよい。高輝度背景の輝度は所定輝度より高く、低輝度文字の輝度は高輝度背景の輝度より低い。即ち、入力画像において、高輝度背景領域の輝度値は所定輝度値より高く、低輝度文字領域の輝度値は高輝度背景領域の輝度値より高い。 The document may further include a high-brightness background, such as white, and low-brightness characters, such as black, placed on the high-brightness background. The brightness of the high-brightness background is higher than the predetermined brightness, and the brightness of the low-brightness characters is lower than the brightness of the high-brightness background. That is, in the input image, the brightness value of the high-brightness background area is higher than the predetermined brightness value, and the brightness value of the low-brightness character area is higher than the brightness value of the high-brightness background area.

次に、第1CPU120は、第1記憶装置110に保存された入力画像を第1インタフェース装置101を介して情報処理装置200に送信し(ステップS102)、一連のステップを終了する。 Next, the first CPU 120 transmits the input image saved in the first storage device 110 to the information processing device 200 via the first interface device 101 (step S102), and ends the series of steps.

図4は、情報処理装置200による認識処理の動作を示すフローチャートである。以下、図4に示したフローチャートを参照しつつ、認識処理の動作を説明する。なお、以下に説明する動作のフローは、予め第2記憶装置210に記憶されているプログラムに基づき主に処理装置230により情報処理装置200の各要素と協同して実行される。 FIG. 4 is a flow chart showing the operation of recognition processing by the information processing apparatus 200 . The operation of the recognition process will be described below with reference to the flowchart shown in FIG. The operation flow described below is mainly executed by the processing device 230 in cooperation with each element of the information processing device 200 based on a program stored in the second storage device 210 in advance.

最初に、取得部221は、入力画像を多値画像として第2インタフェース装置201を介して画像読取装置100から取得し、第2記憶装置210に保存する(ステップS201)。なお、取得部221は、カラー多値画像である入力画像から、白黒の多値画像を生成し、多値画像として取得してもよい。その場合、取得部221は、入力画像内の各画素毎に、以下の式に従って輝度値を算出し、算出した輝度値を各画素に対応する画素の階調値とする白黒多値画像を生成する。
輝度値=0.299×(R値)+0.587×(G値)+0.114×(B値)
First, the acquisition unit 221 acquires an input image as a multivalued image from the image reading device 100 via the second interface device 201, and stores it in the second storage device 210 (step S201). Note that the acquisition unit 221 may generate a black-and-white multivalued image from the input image, which is a color multivalued image, and acquire it as a multivalued image. In that case, the acquisition unit 221 calculates the luminance value for each pixel in the input image according to the following formula, and generates a black-and-white multivalued image using the calculated luminance value as the gradation value of the pixel corresponding to each pixel. do.
Luminance value = 0.299 x (R value) + 0.587 x (G value) + 0.114 x (B value)

図5Aは、多値画像500の一例を示す模式図である。 FIG. 5A is a schematic diagram showing an example of a multivalued image 500. FIG.

図5Aに示すように、多値画像500には、高輝度背景領域501と、低輝度文字領域502と、低輝度背景領域503と、高輝度文字領域504と、複数の罫線領域505とが含まれる。高輝度背景領域501は、白色を有し且つ高い輝度を有する。低輝度文字領域502は、黒色を有し且つ高輝度背景領域501が有する輝度より低い輝度を有し、高輝度背景領域501上に配置されている。低輝度背景領域503は、黒色を有し且つ低い輝度を有する。高輝度文字領域504は、白色を有し且つ低輝度背景領域503が有する輝度より高い輝度を有し、低輝度背景領域503上に配置されている。罫線領域505は、黒色を有し且つ低い輝度を有し、低輝度背景領域503と連なっている。低輝度文字502領域及び高輝度文字領域504の少なくとも一部は、罫線領域505で囲まれる範囲内に配置されている。 As shown in FIG. 5A, a multivalued image 500 includes a high-brightness background area 501, a low-brightness character area 502, a low-brightness background area 503, a high-brightness character area 504, and a plurality of ruled line areas 505. be The high brightness background area 501 has a white color and high brightness. The low-brightness character area 502 is black and has a lower brightness than the high-brightness background area 501 , and is arranged on the high-brightness background area 501 . The low luminance background area 503 has a black color and low luminance. The high-brightness character area 504 is white and has a higher brightness than the low-brightness background area 503 , and is placed on the low-brightness background area 503 . The ruled line area 505 has black color and low luminance, and is continuous with the low luminance background area 503 . At least part of the low-luminance character area 502 and the high-luminance character area 504 are arranged within a range surrounded by the ruled line area 505 .

次に、二値画像生成部222は、取得した多値画像を二値化した二値画像を生成する(ステップS202)。二値画像生成部222は、多値画像内で階調値が第1閾値以上である画素を白色画素とし、階調値が第1閾値未満である画素を黒色画素とした画像を二値画像として生成する。第1閾値は、事前の実験により、一般的な背景を形成する画素の階調値と文字を形成する画素の階調値の間の値に設定される。これにより、二値画像では、多値画像内の低輝度文字、低輝度背景及び罫線に対応する画素が黒色画素となり、高輝度背景及び高輝度文字に対応する画素が白色画素となる。 Next, the binary image generator 222 generates a binary image by binarizing the acquired multivalued image (step S202). The binary image generation unit 222 sets pixels having a gradation value equal to or greater than the first threshold in the multivalued image as white pixels and pixels having a gradation value less than the first threshold as black pixels. Generate as The first threshold is set to a value between the gradation value of a pixel forming a general background and the gradation value of a pixel forming a character through preliminary experiments. As a result, in the binary image, the pixels corresponding to the low-brightness characters, the low-brightness background, and the ruled lines in the multi-valued image are black pixels, and the pixels corresponding to the high-brightness background and high-brightness characters are white pixels.

なお、第1閾値は、大津の二値化処理により決定されてもよい。一般に、帳票毎に低輝度背景及び高輝度文字の輝度は異なる。情報処理装置200は、大津の二値化処理により第1閾値を決定することにより、多値画像において、低輝度背景の輝度と、高輝度文字の輝度とがどのような関係を有していても、低輝度背景と高輝度文字とを良好に識別することが可能となる。 Note that the first threshold may be determined by Otsu's binarization process. In general, the brightness of the low-brightness background and high-brightness characters differs for each form. The information processing apparatus 200 determines the relationship between the luminance of the low-luminance background and the luminance of the high-luminance characters in the multivalued image by determining the first threshold value by Otsu's binarization process. Also, it is possible to distinguish well between the low-brightness background and high-brightness characters.

図5Bは、二値画像510の一例を示す模式図である。 FIG. 5B is a schematic diagram showing an example of a binary image 510. As shown in FIG.

図5Bは、図5Aに示す多値画像500を二値化した二値画像510を示す。図5Bに示すように、二値画像510において、高輝度背景領域501に対応する領域511の画素と、高輝度文字領域504に対応する領域514の画素は、白色画素である。一方、二値画像510において、低輝度文字領域502に対応する領域512の画素と、低輝度背景領域503に対応する領域513の画素と、罫線領域505に対応する領域515の画素とは、黒色画素である。 FIG. 5B shows a binary image 510 obtained by binarizing the multivalued image 500 shown in FIG. 5A. As shown in FIG. 5B, in a binary image 510, pixels in a region 511 corresponding to the bright background region 501 and pixels in a region 514 corresponding to the bright text region 504 are white pixels. On the other hand, in the binary image 510, pixels in a region 512 corresponding to the low-luminance character region 502, pixels in a region 513 corresponding to the low-luminance background region 503, and pixels in a region 515 corresponding to the ruled line region 505 are black. is a pixel.

次に、罫線除去画像生成部223は、二値画像において、二値画像内で黒色画素が連結する第1連結領域の内、水平及び垂直方向の長さが第2閾値未満の領域を白色画素に変換することにより、二値画像から低輝度文字の成分を除去する(ステップS203)。 Next, in the binary image, the ruled-line-removed image generation unit 223 removes white pixels from a first connected region in which black pixels are connected in the binary image and whose lengths in the horizontal and vertical directions are less than the second threshold. to remove the low-brightness character component from the binary image (step S203).

罫線除去画像生成部223は、ラベリングにより、二値画像内で黒色画素をグループ化することにより、第1連結領域を特定する。罫線除去画像生成部223は、特定した各第1連結領域の内、水平方向の長さ及び垂直方向の長さが第2閾値未満である第1連結領域を除去対象領域として抽出する。第2閾値は、一般的な帳票で使用される文字の水平及び垂直方向の最大の長さ(例えば40ポイント)に相当する画像上の長さに設定される。なお、第1連結領域の水平方向の長さと比較する第2閾値と、垂直方向の長さと比較する第2閾値は、それぞれ異なる値に設定されてもよい。罫線除去画像生成部223は、二値画像において、抽出した各除去対象領域(黒色画素)を白色画素に変換する。 The ruled-line-removed image generator 223 specifies the first connected region by grouping black pixels in the binary image by labeling. The ruled-line-removed-image generation unit 223 extracts the first connected regions whose horizontal length and vertical length are less than the second threshold from among the specified first connected regions as removal target regions. The second threshold is set to a length on the image corresponding to the maximum horizontal and vertical lengths (for example, 40 points) of characters used in general forms. Note that the second threshold for comparison with the horizontal length of the first connected region and the second threshold for comparison with the vertical length may be set to different values. The ruled-line-removed image generation unit 223 converts each extracted removal target area (black pixel) into a white pixel in the binary image.

図6Aは、低輝度文字の成分が除去された二値画像600の一例を示す模式図である。 FIG. 6A is a schematic diagram showing an example of a binary image 600 from which low-brightness character components have been removed.

図6Aに示す二値画像600は、図5Bに示す二値画像510から低輝度文字の成分が除去された画像である。図6Aに示すように、二値画像600では、低輝度背景領域503に対応する領域603の画素、及び、罫線領域505に対応する領域605の画素のみが黒色画素として残っている。一方、二値画像600では、低輝度文字領域502に対応する領域602の画素は白色画素に変換されている。 A binary image 600 shown in FIG. 6A is an image obtained by removing low-brightness character components from the binary image 510 shown in FIG. 5B. As shown in FIG. 6A, in the binary image 600, only pixels in a region 603 corresponding to the low luminance background region 503 and pixels in a region 605 corresponding to the ruled line region 505 remain as black pixels. On the other hand, in the binary image 600, pixels in an area 602 corresponding to the low-luminance character area 502 are converted to white pixels.

次に、罫線除去画像生成部223は、二値画像から複数の罫線の成分を除去した罫線除去画像を生成する(ステップS204)。罫線除去画像生成部223は、低輝度文字の成分が除去された二値画像に残っている第1連結領域内の、水平又は垂直方向の長さが所定値以下である部分を白色画素に変換することにより、罫線除去画像を生成する。所定値は、例えば一般的な帳票で使用される罫線の最大幅(例えば3ポイント)に相当する画像上の長さに設定される。例えば、罫線除去画像生成部223は、第1連結領域内の各黒色画素から所定値の長さの範囲内に白色画素が存在する場合、その黒色画素を白色画素に変換することにより、白色画素を膨張させる。罫線除去画像生成部223は、二値画像内の白色画素を膨張させることにより、効率良く罫線成分を除去することができ、罫線除去画像の生成処理における処理負荷を低減させることができる。 Next, the ruled-line-removed image generation unit 223 generates a ruled-line-removed image by removing a plurality of ruled-line components from the binary image (step S204). The ruled-line-removed image generation unit 223 converts a portion whose horizontal or vertical length is equal to or less than a predetermined value in the first connected region remaining in the binary image from which the low-brightness character component has been removed into white pixels. By doing so, a ruled-line-removed image is generated. The predetermined value is set, for example, to a length on the image corresponding to the maximum width (for example, 3 points) of a ruled line used in a general form. For example, if a white pixel exists within a range of a predetermined value from each black pixel in the first connected region, the ruled-line-removed image generation unit 223 converts the black pixel into a white pixel, thereby generating a white pixel. inflate. The ruled-line-removed image generation unit 223 can efficiently remove the ruled-line component by dilating the white pixels in the binary image, and can reduce the processing load in generating the ruled-line-removed image.

なお、罫線除去画像生成部223は、各第1連結領域から、水平又は垂直方向の長さが所定値以下である部分を抽出し、抽出した各部分を白色画素に変換することにより、罫線除去画像を生成してもよい。 Note that the ruled-line-removed image generation unit 223 extracts a portion whose length in the horizontal or vertical direction is equal to or less than a predetermined value from each first connected region, converts each extracted portion into white pixels, and removes the ruled line. An image may be generated.

図6Bは、罫線除去画像610の一例を示す模式図である。 FIG. 6B is a schematic diagram showing an example of a ruled line removed image 610. As shown in FIG.

図6Bに示す罫線除去画像610は、図6Aに示す二値画像600から罫線の成分が除去された画像である。図6Bに示すように、罫線除去画像610では、低輝度背景領域503に対応する領域613の画素のみが黒色画素として残り、罫線領域505に対応する領域615の画素は、わずかな領域616の画素を除いて、白色画素に変換されている。罫線除去画像610では、高輝度背景領域に対応する領域とともに、高輝度文字領域504に対応する領域614も膨張している。特に、罫線除去画像610では、高輝度文字領域に対応する領域617が膨張していることにより、低輝度背景領域に対応する領域618と領域619とが分離している。 A ruled-line-removed image 610 shown in FIG. 6B is an image obtained by removing ruled-line components from the binary image 600 shown in FIG. 6A. As shown in FIG. 6B, in the ruled-line-removed image 610, only pixels in a region 613 corresponding to the low-brightness background region 503 remain as black pixels, and pixels in a region 615 corresponding to the ruled-line region 505 are a few pixels in a region 616. are converted to white pixels, except for In the ruled-line-removed image 610, an area 614 corresponding to the high-brightness character area 504 is expanded as well as the area corresponding to the high-brightness background area. In particular, in the ruled-line-removed image 610, an area 617 corresponding to the high-brightness character area is expanded, so that areas 618 and 619 corresponding to the low-brightness background area are separated.

次に、罫線除去画像生成部223は、生成した罫線除去画像からノイズ成分を除去する(ステップS205)。 Next, the ruled-line-removed image generator 223 removes noise components from the generated ruled-line-removed image (step S205).

例えば、罫線除去画像生成部223は、罫線除去画像において、水平又は垂直方向に連続する長さが所定画素数(例えば2画素)以下である黒色画素をノイズ成分として抽出し、白色画素に変換することにより除去する。これにより、罫線除去画像生成部223は、罫線除去画像において、わずかに残った罫線の成分を除去することができる。 For example, the ruled-line-removed image generation unit 223 extracts, as a noise component, black pixels whose continuous length in the horizontal or vertical direction is equal to or less than a predetermined number of pixels (for example, 2 pixels) in the ruled-line-removed image, and converts them into white pixels. remove by As a result, the ruled-line-removed image generation unit 223 can remove the slightly remaining ruled-line component from the ruled-line-removed image.

また、罫線除去画像生成部223は、罫線除去画像において黒色画素が連結する領域の内、水平又は垂直方向の長さが所定長さ(例えば5ポイントに相当する長さ)以下である領域をノイズ成分として抽出し、白色画素に変換することにより除去してもよい。これによっても、罫線除去画像生成部223は、罫線除去画像において、わずかに残った罫線の成分を除去することができる。 In addition, the ruled-line-removed image generation unit 223 generates noise for regions in which black pixels are connected in the ruled-line-removed image and whose length in the horizontal or vertical direction is equal to or less than a predetermined length (for example, a length corresponding to 5 points). It may be removed by extracting it as a component and converting it to a white pixel. This also allows the ruled-line-removed image generation unit 223 to remove the slightly remaining ruled-line component from the ruled-line-removed image.

また、罫線除去画像生成部223は、罫線除去画像において黒色画素が連結する領域の内、その領域で囲まれた領域の全画素数に対する黒色画素数の割合が所定割合未満である領域をノイズ成分として抽出し、白色画素に変換することにより除去してもよい。所定割合は、例えば一般に使用される印鑑における文字又は文様部分の割合の最大値(例えば33%)に設定される。これにより、罫線除去画像生成部223は、罫線除去画像において、印鑑等の成分を除去することができる。 In addition, the ruled-line-removed image generation unit 223 generates a noise component of an area in which black pixels are connected to each other in the ruled-line-removed image and in which the ratio of the number of black pixels to the total number of pixels in the area surrounded by the area is less than a predetermined ratio. , and may be removed by converting to white pixels. The predetermined ratio is set, for example, to the maximum value (for example, 33%) of the ratio of characters or pattern portions in commonly used seals. As a result, the ruled-line-removed image generation unit 223 can remove components such as a seal from the ruled-line-removed image.

図7Aは、ノイズ成分が除去された罫線除去画像700の一例を示す模式図である。 FIG. 7A is a schematic diagram showing an example of a ruled-line-removed image 700 from which noise components have been removed.

図7Aに示す罫線除去画像700は、図6Bに示す罫線除去画像610からノイズ成分が除去された画像である。図7Aに示すように、罫線除去画像700では、低輝度背景領域503に対応する領域703の画素のみが黒色画素として残り、罫線領域505に対応する領域706の画素は全て白色画素に変換されている。 A ruled-line-removed image 700 shown in FIG. 7A is an image obtained by removing noise components from the ruled-line-removed image 610 shown in FIG. 6B. As shown in FIG. 7A, in the ruled-line-removed image 700, only pixels in an area 703 corresponding to the low-brightness background area 503 remain as black pixels, and all pixels in an area 706 corresponding to the ruled-line area 505 are converted to white pixels. there is

次に、領域検出部224は、罫線除去画像内で黒色画素が連結する第2連結領域を検出する(ステップS206)。以下では、第2連結領域を単に連結領域と称する。罫線除去画像生成部223は、ラベリングにより、ノイズ成分が除去された罫線除去画像内で黒色画素をグループ化することにより、連結領域を検出する。 Next, the area detection unit 224 detects a second connected area where black pixels are connected in the ruled-line-removed image (step S206). Below, the second connection region is simply referred to as the connection region. The ruled-line-removed image generator 223 detects connected regions by grouping black pixels in the ruled-line-removed image from which noise components have been removed by labeling.

次に、結合部225は、領域検出部224により検出された複数の連結領域を結合する(ステップS207)。結合部225は、各連結領域の大きさの関係、各連結領域の位置の関係、又は、各連結領域の間の距離の内の少なくとも一つに基づいて、各連結領域を結合する。 Next, the combining unit 225 combines the plurality of connected regions detected by the region detecting unit 224 (step S207). The connecting part 225 connects the connecting regions based on at least one of the size relationship of the connecting regions, the positional relationship of the connecting regions, or the distance between the connecting regions.

結合部225は、検出された連結領域の内の二つの連結領域に係る全ての組合せを抽出する。結合部225は、抽出した組合せ毎に、各組合せに係る二つの連結領域が所定条件を満たすか否かを判定する。所定条件の内の第1条件は、所定方向において二つの連結領域の長さの差が所定差(例えば2画素)以下であることである。所定条件の内の第2条件は、所定方向において二つの連結領域の中心位置の間の距離が第1所定距離(例えば2画素)以下であることである。所定条件の内の第3条件は、所定方向と直交する方向において二つの連結領域が重複せず且つ二つの連結領域の間の距離が第2所定距離(例えば3画素)以下であることである。所定方向は水平方向及び/又は垂直方向であり、所定方向が水平方向である場合、所定方向と直交する方向は垂直方向であり、所定方向が垂直方向である場合、所定方向と直交する方向は水平方向である。所定条件は、第1条件、第2条件及び第3条件の内の任意の一つの条件又は二つの条件でもよい。 The combiner 225 extracts all combinations of two connected regions among the detected connected regions. The combining unit 225 determines whether or not the two connected regions associated with each combination satisfy a predetermined condition for each extracted combination. The first condition among the predetermined conditions is that the length difference between two connected regions in a predetermined direction is less than or equal to a predetermined difference (for example, two pixels). The second condition among the predetermined conditions is that the distance between the center positions of the two connected regions in the predetermined direction is less than or equal to the first predetermined distance (for example, 2 pixels). The third condition among the predetermined conditions is that the two connected regions do not overlap in the direction perpendicular to the predetermined direction and the distance between the two connected regions is a second predetermined distance (for example, 3 pixels) or less. . The predetermined direction is the horizontal direction and/or the vertical direction, if the predetermined direction is the horizontal direction, the direction orthogonal to the predetermined direction is the vertical direction, and if the predetermined direction is the vertical direction, the direction orthogonal to the predetermined direction is Horizontal. The predetermined condition may be any one or two of the first condition, the second condition and the third condition.

連結領域は、連結領域内の高輝度文字領域が膨張することにより二つの連結領域に分割する可能性があり、その場合、二つの連結領域の間の距離は、連結領域内の文字のサイズ以下となる可能性が高い。そのため、第2所定距離は、例えば一般的な帳票で使用される文字の水平及び垂直方向の最小の長さ(例えば40ポイント)に相当する画像上の長さに設定される。なお、所定方向における連結領域の長さ(連結領域の幅)は、連結領域内の高輝度文字領域の一辺より大きいため、第2所定距離は、所定方向における連結領域の長さに設定されてもよい。 A concatenated region may be split into two concatenated regions by dilating a bright character region within the concatenated region, in which case the distance between the two concatenated regions is less than or equal to the size of the characters in the concatenated region. is likely to be Therefore, the second predetermined distance is set, for example, to a length on the image corresponding to the minimum horizontal and vertical lengths (eg, 40 points) of characters used in general forms. Since the length of the connected area in the predetermined direction (the width of the connected area) is greater than one side of the high-brightness character area in the connected area, the second predetermined distance is set to the length of the connected area in the predetermined direction. good too.

図7Aに示す例では、垂直方向において連結領域708の長さL1と連結領域708の長さL2の差は十分に小さいため、連結領域708と連結領域709は第1条件を満たす。また、垂直方向において連結領域708の中心位置P1と連結領域709の中心位置P2の間の距離は十分に小さいため、連結領域708と連結領域709は第2条件を満たす。また、水平方向において連結領域708と連結領域709は重複せず且つ連結領域708と連結領域709の間の距離D1は十分に小さいため、連結領域708と連結領域709は第3条件を満たす。そのため、連結領域708と連結領域709は結合される。 In the example shown in FIG. 7A, the difference between the length L1 of the connection region 708 and the length L2 of the connection region 708 in the vertical direction is sufficiently small, so that the connection region 708 and the connection region 709 satisfy the first condition. Also, since the distance between the central position P1 of the connecting region 708 and the central position P2 of the connecting region 709 in the vertical direction is sufficiently small, the connecting regions 708 and 709 satisfy the second condition. Also, since the connecting regions 708 and 709 do not overlap in the horizontal direction and the distance D1 between the connecting regions 708 and 709 is sufficiently small, the connecting regions 708 and 709 satisfy the third condition. As such, connecting region 708 and connecting region 709 are joined.

一方、垂直方向において連結領域708の長さL1と連結領域710の長さL3の差は十分に小さいため、連結領域708と連結領域710は第1条件を満たす。しかしながら、垂直方向において連結領域708の中心位置P1と連結領域710の中心位置P3の間の距離は十分に大きいため、連結領域708と連結領域710は第2条件を満たさない。また、水平方向において連結領域708と連結領域710は重複しているため、連結領域708と連結領域710は第3条件も満たさない。 On the other hand, since the difference between the length L1 of the connection region 708 and the length L3 of the connection region 710 in the vertical direction is sufficiently small, the connection region 708 and the connection region 710 satisfy the first condition. However, since the distance between the center position P1 of the connection region 708 and the center position P3 of the connection region 710 in the vertical direction is sufficiently large, the connection regions 708 and 710 do not satisfy the second condition. Moreover, since the connecting regions 708 and 710 overlap in the horizontal direction, the connecting regions 708 and 710 do not satisfy the third condition either.

また、水平方向において連結領域708の長さL4と連結領域710の長さL5の差は十分に大きいため、連結領域708と連結領域710は第1条件を満たさない。また、水平方向において連結領域708の中心位置P4と連結領域710の中心位置P5の間の距離は十分に大きいため、連結領域708と連結領域710は第2条件も満たさない。また、垂直方向において連結領域708と連結領域710の間の距離D2は十分に大きいため、連結領域708と連結領域710は第3条件も満たさない。そのため、連結領域708と連結領域710は結合されない。 Also, since the difference between the length L4 of the connection region 708 and the length L5 of the connection region 710 in the horizontal direction is sufficiently large, the connection regions 708 and 710 do not satisfy the first condition. Moreover, since the distance between the center position P4 of the connection region 708 and the center position P5 of the connection region 710 in the horizontal direction is sufficiently large, the connection regions 708 and 710 do not satisfy the second condition either. Moreover, since the distance D2 between the connecting regions 708 and 710 in the vertical direction is sufficiently large, the connecting regions 708 and 710 do not satisfy the third condition either. Therefore, connecting region 708 and connecting region 710 are not connected.

結合部225は、所定の条件を満たす組合せが存在する場合、その組合せに係る二つの連結領域を結合する。なお、結合部225は、特定の連結領域に対して、所定の条件を満たす組合せが複数存在する場合、特定の連結領域と、所定の条件を満たす組合せに係る全ての連結領域とを結合する。 If there is a combination that satisfies a predetermined condition, the joining unit 225 joins the two connected regions related to that combination. Note that, if there are a plurality of combinations that satisfy a predetermined condition for a specific connected region, the connecting unit 225 connects the specific connected region and all connected regions related to the combination that satisfies the predetermined condition.

結合部225は、結合対象の二つの連結領域に含まれる黒色画素に対応する画素のみを有効画素とする画像内で、各画素から第3所定距離内に有効画素が存在する場合、その画素を有効画素に変換することにより、有効画素を膨張させる。第3所定距離は、例えば上記の第3条件で設定された第2所定距離と同じ距離に設定される。また、結合部225は、その画像内で、各有効画素から第3所定距離内に無効画素が存在する場合、その画素を無効画素に変換することにより、有効画素を収縮させる。そして、結合部225は、その画像内の有効画素に対応する罫線除去画像内の白色画素を黒色画素に変換することにより、二つの連結領域を結合する。 If there is an effective pixel within a third predetermined distance from each pixel in an image in which only pixels corresponding to black pixels included in two connected regions to be combined are effective pixels, the combining unit 225 The effective pixels are dilated by transforming them into effective pixels. The third predetermined distance is set, for example, to the same distance as the second predetermined distance set under the third condition. Further, if there is an invalid pixel within the third predetermined distance from each effective pixel in the image, the combining unit 225 shrinks the effective pixel by converting the pixel into an invalid pixel. Then, the combining unit 225 combines the two connected areas by converting the white pixels in the ruled line-removed image corresponding to the effective pixels in the image into black pixels.

なお、結合部225は、結合対象の二つの連結領域を包含する外接矩形で囲まれた領域の全ての白色画素を黒色画素に変換することにより、二つの連結領域を結合してもよい。 Note that the combining unit 225 may combine two connected regions by converting all white pixels in a region surrounded by a circumscribing rectangle that includes the two connected regions to be combined into black pixels.

さらに、結合部225は、全ての連結領域内の白色画素を黒色画素に変換する。結合部225は、全ての連結領域について、各連結領域に含まれる黒色画素に対応する画素のみを有効画素とする画像内で、各画素から第4所定距離内に有効画素が存在する場合、その画素を有効画素に変換することにより、有効画素を膨張させる。第4所定距離は、一般的な帳票で使用される文字の水平又は垂直方向の最大の長さ(例えば40ポイント)に相当する画像上の長さに設定される。また、結合部225は、その画像内で、各有効画素から第4所定距離内に無効画素が存在する場合、その画素を無効画素に変換することにより、有効画素を収縮させる。そして、結合部225は、その画像内の有効画素に対応する罫線除去画像内の白色画素を黒色画素に変換することにより、連結領域内の白色画素を黒色画素に変換する。 In addition, combiner 225 converts white pixels in all connected regions to black pixels. For all connected regions, the combining unit 225 determines that, in an image in which only pixels corresponding to black pixels included in each connected region are effective pixels, if there is an effective pixel within a fourth predetermined distance from each pixel, A valid pixel is dilated by converting the pixel to a valid pixel. The fourth predetermined distance is set to a length on the image corresponding to the maximum horizontal or vertical length (for example, 40 points) of characters used in general forms. Further, if there is an invalid pixel within the fourth predetermined distance from each effective pixel in the image, the combining unit 225 shrinks the effective pixel by converting the pixel into an invalid pixel. Then, the combining unit 225 converts the white pixels in the connected area into black pixels by converting the white pixels in the ruled line-removed image corresponding to the effective pixels in the image into black pixels.

なお、結合部225は、各連結領域を包含する外接矩形で囲まれた領域の全ての白色画素を黒色画素に変換することにより、連結領域内の白色画素を黒色画素に変換してもよい。 Note that the combining unit 225 may convert the white pixels in the connected regions to black pixels by converting all the white pixels in the regions enclosed by the circumscribing rectangles including the connected regions into black pixels.

図7Bは、連結領域が結合された罫線除去画像720の一例を示す模式図である。 FIG. 7B is a schematic diagram showing an example of a ruled-line-removed image 720 in which connected areas are combined.

図7Bに示す罫線除去画像720は、図7Aに示す罫線除去画像700において連結領域が結合された画像である。図7Bに示すように、罫線除去画像720では、罫線除去画像700の連結領域708と連結領域709が結合されるとともに、連結領域708及び連結領域709内の白色画素が黒色画素に変換されて、連結領域721が形成されている。また、罫線除去画像700の連結領域710は他の連結領域と結合されていないが、罫線除去画像720では、連結領域710内の白色画素が黒色画素に変換されて、連結領域722が形成されている。 A ruled-line-removed image 720 shown in FIG. 7B is an image in which connected areas are combined in the ruled-line-removed image 700 shown in FIG. 7A. As shown in FIG. 7B, in the ruled-line-removed image 720, the connected regions 708 and 709 of the ruled-line-removed image 700 are combined, and the white pixels in the connected regions 708 and 709 are converted to black pixels. A connecting region 721 is formed. In the ruled-line-removed image 700, the connected region 710 is not connected to other connected regions, but in the ruled-line-removed image 720, the white pixels in the connected region 710 are converted to black pixels to form a connected region 722. there is

次に、逆転画像生成部226は、多値画像において、連結領域に対応し、且つ、所定サイズ以上である高輝度文字が含まれる領域を、低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させる反転対象領域として抽出する(ステップS208)。この連結領域は、ステップS207において、内部の白色画素が黒色画素に変換された領域であり、結合部225により結合された連結領域、及び、結合部225により結合されていない連結領域の両方を含む。 Next, the reversed image generation unit 226 divides a region corresponding to the connected region and including high-brightness characters of a predetermined size or larger in the multivalued image into the gradation value of the low-brightness background region and the high-brightness character region. is extracted as an inversion target area for reversing the relationship with the gradation value of (step S208). This connected area is an area in which internal white pixels are converted to black pixels in step S207, and includes both connected areas connected by the connecting unit 225 and connected areas not connected by the connecting unit 225. .

まず、逆転画像生成部226は、多値画像において、罫線除去画像の各連結領域に対応する対応領域内の画素の階調値を、階調範囲の最大値から各画素の階調値を減算した減算値に変換することにより反転させた変換画像を生成する。次に、逆転画像生成部226は、変換画像を二値化した変換二値画像を生成する。逆転画像生成部226は、二値画像生成部222と同様にして、変換画像内で階調値が第1閾値以上である画素を白色画素とし、階調値が第1閾値未満である画素を黒色画素とした画像を変換二値画像として生成する。 First, the reversed image generation unit 226 subtracts the gradation value of each pixel in the corresponding region corresponding to each connected region of the ruled-line-removed image from the maximum value of the gradation range in the multivalued image. A reversed transformed image is generated by transforming to the subtracted value. Next, the reversed image generator 226 generates a transformed binary image by binarizing the transformed image. Similar to the binary image generation unit 222, the reverse image generation unit 226 sets pixels in the converted image whose gradation value is equal to or greater than the first threshold as white pixels, and sets pixels whose gradation value is less than the first threshold as white pixels. An image with black pixels is generated as a converted binary image.

次に、逆転画像生成部226は、変換二値画像において、各対応領域に対応する第2対応領域毎に、ラベリングにより、各第2対応領域内で黒色画素をグループ化することにより、黒色画素が連結する第3連結領域を特定する。逆転画像生成部226は、各第2対応領域毎に、水平方向の長さ及び/又は垂直方向の長さが第3閾値以上である第3連結領域が含まれるか否かを判定する。第3閾値は、一般的な帳票で使用される文字の水平及び垂直方向の最小の長さ(例えば8ポイント)に相当する画像上の長さに設定される。なお、第3連結領域の水平方向の長さと比較する第3閾値と、垂直方向の長さと比較する第3閾値は、それぞれ異なる値に設定されてもよい。逆転画像生成部226は、水平方向の長さ及び/又は垂直方向の長さが第3閾値以上である第3連結領域を、所定サイズ以上である高輝度文字に対応する領域とみなす。逆転画像生成部226は、水平方向の長さ及び/又は垂直方向の長さが第3閾値以上である第3連結領域が含まれる第2対応領域に対応する多値画像の対応領域を、反転対象領域として抽出する。 Next, the reversed image generation unit 226 groups black pixels in each second corresponding region by labeling for each second corresponding region corresponding to each corresponding region in the converted binary image, thereby generating a black pixel identifies the third connecting region that connects the . The reversed image generator 226 determines whether or not each second corresponding region includes a third connected region whose horizontal length and/or vertical length is greater than or equal to a third threshold. The third threshold is set to a length on the image corresponding to the minimum horizontal and vertical lengths (for example, 8 points) of characters used in general forms. Note that the third threshold for comparison with the horizontal length of the third connected region and the third threshold for comparison with the vertical length of the third connected region may be set to different values. The reversed image generation unit 226 regards the third connected area whose horizontal length and/or vertical length is equal to or greater than the third threshold as an area corresponding to a high-brightness character of a predetermined size or greater. The reversed image generation unit 226 reverses the corresponding region of the multivalued image corresponding to the second corresponding region including the third connected region whose horizontal length and/or vertical length is equal to or greater than the third threshold. Extract as target area.

次に、逆転画像生成部226は、多値画像において、各反転対象領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成する(ステップS209)。逆転画像生成部226は、多値画像において、各反転対象領域内の各画素の階調値を、階調範囲の最大値から各画素の階調値を減算した減算値に変換することにより反転させて、逆転画像を生成する。 Next, the reversed image generation unit 226 generates a reversed image by reversing the relationship between the gradation values of the low-luminance background region and the gradation value of the high-luminance character region in each region to be reversed in the multivalued image. (Step S209). The reversed image generation unit 226 converts the gradation value of each pixel in each region to be reversed into a subtraction value obtained by subtracting the gradation value of each pixel from the maximum value of the gradation range in the multivalued image. to generate an inverted image.

図8Aは、逆転画像800の一例を示す模式図である。 FIG. 8A is a schematic diagram showing an example of a reversed image 800. FIG.

図8Aに示す逆転画像800は、図5Aに示す多値画像500から生成された画像である。図8Aに示すように、逆転画像800では、低輝度背景領域503に対応する領域803の階調値と、高輝度文字領域504に対応する領域804の階調値との関係が逆転している。即ち、逆転画像800では、高輝度背景領域501に対応する領域801、低輝度文字領域502に対応する領域802、及び、罫線領域505に対応する領域805の階調値は、多値画像500に対して変化していない。一方、逆転画像800では、低輝度背景領域503に対応する領域803、及び、高輝度文字領域504に対応する領域804は、領域804の輝度値が領域803の輝度値より低くなるように変化している。 A reversed image 800 shown in FIG. 8A is an image generated from the multivalued image 500 shown in FIG. 5A. As shown in FIG. 8A, in the reversed image 800, the relationship between the gradation values of the area 803 corresponding to the low-luminance background area 503 and the gradation value of the area 804 corresponding to the high-luminance character area 504 is reversed. . That is, in the reversed image 800, the gradation values of the area 801 corresponding to the high-brightness background area 501, the area 802 corresponding to the low-brightness character area 502, and the area 805 corresponding to the ruled line area 505 are has not changed. On the other hand, in the reversed image 800, a region 803 corresponding to the low-brightness background region 503 and a region 804 corresponding to the high-brightness character region 504 change such that the brightness value of the region 804 is lower than that of the region 803. ing.

また上記したように、逆転画像生成部226は、多値画像において、連結領域に対応する領域内に、所定サイズ以上である高輝度文字が含まれる場合に限り、その対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させる。各連結領域において、背景は低輝度を有すると推定されるが、背景が濃い灰色を有し且つ文字が黒色を有する場合のように、各連結領域において、文字が背景よりさらに低輝度を有する可能性がある。逆転画像生成部226は、所定サイズ以上である高輝度文字が含まれる対応領域のみを反転対象領域として抽出することにより、白色を有する文字、即ち背景より高輝度を有する文字が含まれる対応領域のみを反転対象領域として抽出する。これにより、逆転画像生成部226は、文字が背景より低輝度を有する領域において、背景の階調値と文字の階調値との関係を逆転させることを防止することが可能となる。 In addition, as described above, the reversed image generation unit 226 generates a low-brightness character in the corresponding area only when a high-brightness character of a predetermined size or larger is included in the area corresponding to the connected area in the multivalued image. The relationship between the gradation value of the background area and the gradation value of the high-brightness character area is reversed. In each connected region the background is presumed to have low intensity, but in each connected region the characters can have even lower intensity than the background, such as when the background has dark gray and the characters have black. have a nature. The reversed image generation unit 226 extracts only corresponding regions containing high-brightness characters of a predetermined size or larger as inversion target regions. is extracted as the inversion target region. As a result, the reversed image generator 226 can prevent the relationship between the background gradation value and the character gradation value from being reversed in an area where the character has lower luminance than the background.

次に、逆転二値画像生成部227は、逆転画像を二値化した逆転二値画像を生成する(ステップS210)。逆転二値画像生成部227は、二値画像生成部222と同様に、逆転画像内で階調値が第1閾値以上である画素を白色画素とし、階調値が第1閾値未満である画素を黒色画素とした画像を逆転二値画像として生成する。逆転二値画像では、逆転画像内の文字及び罫線に対応する画素が黒色画素となり、背景に対応する画素が白色画素となる。 Next, the reversed binary image generator 227 generates a reversed binary image by binarizing the reversed image (step S210). Similar to the binary image generation unit 222, the reverse binary image generation unit 227 treats pixels in the reverse image whose gradation value is equal to or greater than the first threshold as white pixels, and pixels whose gradation value is less than the first threshold. is generated as an inverted binary image. In the reversed binary image, pixels corresponding to characters and ruled lines in the reversed image are black pixels, and pixels corresponding to the background are white pixels.

図8Bは、逆転二値画像810の一例を示す模式図である。 FIG. 8B is a schematic diagram showing an example of an inverted binary image 810. As shown in FIG.

図8Bは、図8Aに示す逆転画像800を二値化した逆転二値画像810を示す。図8Bに示すように、逆転二値画像810において、多値画像500の高輝度背景領域501に対応する領域811の画素と、低輝度背景領域503に対応する領域813の画素とは、白色画素である。一方、逆転二値画像810において、低輝度文字領域502に対応する領域812の画素と、高輝度文字領域504に対応する領域814の画素と、罫線領域505に対応する領域815の画素とは、黒色画素である。 FIG. 8B shows an inverted binary image 810 obtained by binarizing the inverted image 800 shown in FIG. 8A. As shown in FIG. 8B, in an inverted binary image 810, pixels in an area 811 corresponding to the high-luminance background area 501 of the multi-valued image 500 and pixels in an area 813 corresponding to the low-luminance background area 503 are white pixels. is. On the other hand, in the reverse binary image 810, the pixels in the region 812 corresponding to the low-luminance character region 502, the pixels in the region 814 corresponding to the high-luminance character region 504, and the pixels in the region 815 corresponding to the ruled line region 505 are Black pixels.

次に、文字検出部228は、逆転画像から生成された逆転二値画像から文字を検出する(ステップS211)。文字検出部228は、公知のOCR(Optical Character Recognition)技術を利用して、逆転二値画像から文字を検出する。 Next, the character detection unit 228 detects characters from the reversed binary image generated from the reversed image (step S211). The character detection unit 228 detects characters from the reverse binary image using a known OCR (Optical Character Recognition) technique.

次に、出力制御部229は、検出された文字を表示装置203に表示し(ステップS212)、一連のステップを終了する。なお、出力制御部229は、検出された文字に関する情報として、検出された文字に代えて又は加えて、逆転画像又は逆転二値画像を表示装置203に表示してもよい。また、出力制御部229は、検出された文字、逆転画像又は逆転二値画像を不図示の通信装置を介して不図示のサーバ等に送信してもよい。このように、出力制御部229は、検出された文字に関する情報を出力する。 Next, the output control unit 229 displays the detected characters on the display device 203 (step S212), and ends the series of steps. Note that the output control unit 229 may display a reversed image or a reversed binary image on the display device 203 instead of or in addition to the detected character as information about the detected character. The output control unit 229 may also transmit the detected characters, reversed image, or reversed binary image to a server or the like (not shown) via a communication device (not shown). Thus, the output control unit 229 outputs information regarding the detected characters.

なお、罫線除去画像生成部223は、ステップS203の処理を省略し、ステップS204において、ステップS202で生成された二値画像から罫線除去画像を生成してもよい。また、罫線除去画像生成部223は、ステップS205の処理を省略し、領域検出部224は、ステップS206において、ステップS204で生成された罫線除去画像から連結領域を検出してもよい。また、逆転画像生成部226は、ステップS208の処理を省略し、ステップS209において、多値画像における全ての連結領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させることにより逆転画像を生成してもよい。また、逆転二値画像生成部227は、ステップS210の処理を省略し、文字検出部228は、ステップS211において、逆転画像から文字を検出してもよい。 Note that the ruled-line-removed image generation unit 223 may omit the process of step S203 and generate the ruled-line-removed image in step S204 from the binary image generated in step S202. Alternatively, the ruled-line-removed image generation unit 223 may omit the process of step S205, and the area detection unit 224 may detect, in step S206, connected areas from the ruled-line-removed image generated in step S204. In addition, the reversed image generating unit 226 omits the processing of step S208, and in step S209, the gradation values of the low-luminance background regions and the gradation values of the high-luminance character regions in all connected regions in the multivalued image are A reverse image may be generated by reversing the relationship. Alternatively, the reversed binary image generation unit 227 may omit the process of step S210, and the character detection unit 228 may detect characters from the reversed image in step S211.

以上詳述したように、図5に示したフローチャートに従って動作することによって、情報処理装置200は、低輝度背景と、低輝度背景上の高輝度文字と、罫線とを含む原稿の画像から文字を良好に検出することが可能となった。 As described in detail above, by operating according to the flowchart shown in FIG. 5, the information processing apparatus 200 extracts characters from a document image including a low-brightness background, high-brightness characters on the low-brightness background, and ruled lines. Good detection is possible.

情報処理装置200は、罫線成分、特に低輝度背景領域と連なる罫線成分を除去することにより、低輝度背景領域を良好に特定することが可能となった。また、情報処理装置200は、罫線成分を除去する際に膨張した高輝度文字領域によって分断された低輝度背景領域を再結合することにより、低輝度背景領域を誤って特定することを抑制することが可能となった。情報処理装置200は、低輝度背景領域を良好に特定することにより、低輝度背景領域の階調値と高輝度文字領域の階調値を良好に反転させることが可能となった。 The information processing apparatus 200 can satisfactorily identify the low-brightness background area by removing the ruled-line component, particularly the ruled-line component connected to the low-brightness background area. In addition, the information processing apparatus 200 suppresses erroneous identification of the low-luminance background region by recombining the low-luminance background region divided by the high-luminance character region expanded when removing the ruled line component. became possible. The information processing apparatus 200 can satisfactorily invert the gradation value of the low-luminance background region and the gradation value of the high-luminance character region by identifying the low-luminance background region satisfactorily.

一般に、帳票には、様々な濃度を有する文字が含まれている可能性がある。文字認識処理において、様々な濃度を有する各文字を認識可能にするためには、文字認識処理の対象とする二値画像において、各文字に対応する画素が黒色画素に変換されている必要がある。そのため、二値画像は、画像内の各画素がより黒色画素に変換され易くなるように生成されることが好ましい。しかし、そのように生成された二値画像では、白色文字の一部も黒色画素に変換される可能性があり、そのように生成された二値画像から白色文字を検出するために二値画像内の白色画素と黒色画素の関係を逆転させると、白色文字が掠れてしまう可能性が高い。情報処理装置200は、多値画像を二値化してから階調値を反転させるのでなく、多値画像から逆転画像を生成してから逆転二値画像を生成することにより、逆転二値画像において文字が掠れてしまうことを防止することが可能となった。 In general, a form may contain characters with various densities. In character recognition processing, in order to be able to recognize each character with various densities, pixels corresponding to each character must be converted to black pixels in the binary image to be subjected to character recognition processing. . Therefore, binary images are preferably generated such that each pixel in the image is more likely to be converted to a black pixel. However, in the binary image so generated, some of the white characters may also be converted to black pixels. If the relationship between the white pixels and the black pixels inside is reversed, there is a high possibility that the white characters will be blurred. The information processing apparatus 200 generates a reversed image from the multivalued image and then generates a reversed binary image instead of binarizing the multivalued image and then inverting the gradation values. It is now possible to prevent characters from being blurred.

また、一般に、汎用的なOCRソフトウェアは、高輝度背景上に配置された低輝度文字を検出するように構成されている。情報処理装置200は、低輝度背景領域と高輝度文字領域の階調値を反転させることにより、低輝度背景上の高輝度文字を含む原稿の画像から、高輝度背景上に配置された低輝度文字を検出するように構成されたOCRソフトウェアを用いて文字を検出できる。また、情報処理装置200は、低輝度背景上の高輝度文字と、高輝度背景上の低輝度文字とを含む原稿の画像から、高輝度文字又は低輝度文字の何れか一方のみを検出するように構成されたOCRソフトウェアを用いて文字を検出できる。 Also, general-purpose OCR software is generally configured to detect low-brightness characters placed on a high-brightness background. The information processing apparatus 200 reverses the gradation values of the low-luminance background area and the high-luminance character area to convert the original image including the high-luminance characters on the low-luminance background into the low-luminance characters arranged on the high-luminance background. Characters can be detected using OCR software configured to detect characters. Further, the information processing apparatus 200 detects only one of high-brightness characters and low-brightness characters from a document image including high-brightness characters on a low-brightness background and low-brightness characters on a high-brightness background. Characters can be detected using OCR software configured for

また、情報処理装置200は、画像内で黒色画素が連結する連結領域を検出し、検出した連結領域毎に低輝度背景領域と高輝度文字領域の階調値を反転させる。これにより、情報処理装置200は、高輝度背景上に低輝度文字が配置されたセルと、低輝度背景上に高輝度文字が配置されたセルとが混合した帳票の画像から、文字を良好に検出することが可能となる。 Further, the information processing apparatus 200 detects a connected area in which black pixels are connected in the image, and inverts the gradation values of the low-luminance background area and the high-luminance character area for each detected connected area. As a result, the information processing apparatus 200 can extract characters from a form image in which cells in which low-brightness characters are arranged on a high-brightness background and cells in which high-brightness characters are arranged on a low-brightness background are mixed. detection becomes possible.

なお、情報処理装置200は、図5Aに示す多値画像500に対して、各背景、文字及び罫線の階調値の関係を反転させたような多値画像から、高輝度背景領域の階調値と低輝度文字領域の階調値との関係を逆転させた逆転画像を生成してもよい。その場合、罫線除去画像生成部223は、二値画像から高輝度の罫線の成分を除去した罫線除去画像を生成し、領域検出部224は、罫線除去画像内で白色画素が連結する連結領域を検出する。結合部225は、分断された連結領域を結合し、逆転画像生成部226は、多値画像において、連結領域に対応する領域内の高輝度背景領域の階調値と低輝度文字領域の階調値との関係を逆転させた逆転画像を生成する。 Note that the information processing apparatus 200 calculates the gradation of the high-brightness background area from a multi-valued image obtained by inverting the relationship of the gradation values of each background, characters, and ruled lines with respect to the multi-valued image 500 shown in FIG. 5A. A reverse image may be generated by reversing the relationship between the value and the gradation value of the low-brightness character area. In this case, the ruled-line-removed image generation unit 223 generates a ruled-line-removed image by removing high-brightness ruled-line components from the binary image. To detect. A combining unit 225 combines the separated connected regions, and a reversed image generation unit 226 calculates the gradation value of the high-brightness background region and the gradation of the low-brightness character region in the region corresponding to the connected region in the multivalued image. Generates an inverted image with the relationship to values reversed.

図9は、他の実施形態に係る情報処理装置における処理装置230の概略構成を示すブロック図である。 FIG. 9 is a block diagram showing a schematic configuration of a processing device 230 in an information processing device according to another embodiment.

処理装置230は、第2CPU220の代わりに、認識処理を実行する。処理装置230は、取得回路231、二値画像生成回路232、罫線除去画像生成回路233、領域検出回路234、結合回路235、逆転画像生成回路236、逆転二値画像生成回路237、文字検出回路238及び出力制御回路239等を有する。 The processing device 230 executes recognition processing instead of the second CPU 220 . The processing device 230 includes an acquisition circuit 231, a binary image generation circuit 232, a ruled line removal image generation circuit 233, an area detection circuit 234, a combination circuit 235, a reversed image generation circuit 236, a reversed binary image generation circuit 237, and a character detection circuit 238. and an output control circuit 239 and the like.

取得回路231は、取得部の一例であり、取得部221と同様の機能を有する。取得回路231は、入力画像を多値画像として第2インタフェース装置201を介して画像読取装置100から取得し、第2記憶装置210に保存する。 The acquisition circuit 231 is an example of an acquisition section and has the same function as the acquisition section 221 . The acquisition circuit 231 acquires the input image as a multivalued image from the image reading device 100 via the second interface device 201 and stores it in the second storage device 210 .

二値画像生成回路232は、二値画像生成部の一例であり、二値画像生成部222と同様の機能を有する。二値画像生成回路232は、第2記憶装置210から多値画像を読み出し、多値画像から二値画像を生成し、第2記憶装置210に保存する。 The binary image generation circuit 232 is an example of a binary image generation section and has the same function as the binary image generation section 222 . The binary image generation circuit 232 reads the multivalued image from the second storage device 210 , generates a binary image from the multivalued image, and stores it in the second storage device 210 .

罫線除去画像生成回路233は、罫線除去画像生成部の一例であり、罫線除去画像生成部223と同様の機能を有する。罫線除去画像生成回路233は、第2記憶装置210から二値画像を読み出し、二値画像から罫線除去画像を生成し、第2記憶装置210に保存する。 The ruled-line-removed image generation circuit 233 is an example of a ruled-line-removed image generation unit, and has the same function as the ruled-line-removed image generation unit 223 . The ruled-line-removed image generation circuit 233 reads the binary image from the second storage device 210 , generates a ruled-line-removed image from the binary image, and stores it in the second storage device 210 .

領域検出回路234は、領域検出部の一例であり、領域検出部224と同様の機能を有する。領域検出回路234は、第2記憶装置210から罫線除去画像を読み出し、罫線除去画像内で連結領域を検出し、検出結果を第2記憶装置210に保存する。 The area detection circuit 234 is an example of an area detection section and has the same function as the area detection section 224 . The area detection circuit 234 reads the ruled-line removed image from the second storage device 210 , detects connected areas in the ruled-line removed image, and saves the detection result in the second storage device 210 .

結合回路235は、結合部の一例であり、結合部225と同様の機能を有する。結合回路235は、第2記憶装置210から、罫線除去画像と、連結領域の検出結果とを読み出し、検出結果に基づいて、罫線除去画像において連結領域を結合し、第2記憶装置210に保存する。 The coupling circuit 235 is an example of a coupling section and has the same function as the coupling section 225 . The combining circuit 235 reads out the ruled-line-removed image and the detection result of the connected regions from the second storage device 210 , combines the connected regions in the ruled-line-removed image based on the detection result, and stores them in the second storage device 210 . .

逆転画像生成回路236は、逆転画像生成部の一例であり、逆転画像生成部226と同様の機能を有する。逆転画像生成回路236は、第2記憶装置210から多値画像及び罫線除去画像を読み出し、読み出した各画像から逆転画像を生成し、第2記憶装置210に保存する。 The reversed image generation circuit 236 is an example of a reversed image generation section and has the same function as the reversed image generation section 226 . The reversed image generating circuit 236 reads out the multivalued image and the ruled line removed image from the second storage device 210 , generates a reversed image from each read image, and stores the reversed image in the second storage device 210 .

逆転二値画像生成回路237は、逆転二値画像生成部の一例であり、逆転二値画像生成部227と同様の機能を有する。逆転二値画像生成回路237は、第2記憶装置210から逆転画像を読み出し、逆転画像から逆転二値画像を生成し、表示装置203に出力する。 The reverse binary image generation circuit 237 is an example of a reverse binary image generation section and has the same function as the reverse binary image generation section 227 . The reverse binary image generation circuit 237 reads the reverse image from the second storage device 210 , generates a reverse binary image from the reverse image, and outputs the reverse binary image to the display device 203 .

文字検出回路238は、文字検出部の一例であり、文字検出部228と同様の機能を有する。文字検出回路238は、第2記憶装置210から逆転画像又は逆転二値画像を読み出し、読み出した画像から文字を検出し、検出結果を第2記憶装置210に保存する。 The character detection circuit 238 is an example of a character detection section and has the same function as the character detection section 228 . The character detection circuit 238 reads the reversed image or reversed binary image from the second storage device 210 , detects characters from the read image, and stores the detection result in the second storage device 210 .

出力制御回路239は、出力制御部の一例であり、出力制御部229と同様の機能を有する。出力制御回路239は、第2記憶装置210から文字の検出結果、逆転画像又は逆転二値画像を読み出し、読み出した情報を表示装置203に出力する。 The output control circuit 239 is an example of an output control section and has the same function as the output control section 229 . The output control circuit 239 reads the character detection result, the reversed image, or the reversed binary image from the second storage device 210 and outputs the read information to the display device 203 .

以上詳述したように、情報処理装置は、処理装置230を用いる場合も、低輝度背景と、低輝度背景上の高輝度文字と、罫線とを含む原稿の画像から文字を良好に検出することが可能となった。 As described in detail above, the information processing apparatus can satisfactorily detect characters from an image of a document including a low-brightness background, high-brightness characters on a low-brightness background, and ruled lines, even when the processing apparatus 230 is used. became possible.

以上、好適な実施形態について説明してきたが、実施形態はこれらに限定されない。例えば、画像読取装置100と情報処理装置200の機能分担は、図1に示す画像処理システム1の例に限られず、画像読取装置100及び情報処理装置200の各部を画像読取装置100と情報処理装置200の何れに配置するかは適宜変更可能である。または、画像読取装置100と情報処理装置200を一つの装置で構成してもよい。 Although the preferred embodiments have been described above, the embodiments are not limited to these. For example, the division of functions between the image reading device 100 and the information processing device 200 is not limited to the example of the image processing system 1 shown in FIG. 200 can be changed as appropriate. Alternatively, the image reading device 100 and the information processing device 200 may be configured as one device.

例えば、画像読取装置100の第1記憶装置110が、情報処理装置200の第2記憶装置210に記憶された各プログラムを記憶し、画像読取装置100の第1CPU120が、情報処理装置200の第2CPU120により実現される各部として動作してもよい。また、画像読取装置100が、情報処理装置200の処理装置230と同様の処理装置を有してもよい。 For example, the first storage device 110 of the image reading device 100 stores each program stored in the second storage device 210 of the information processing device 200, and the first CPU 120 of the image reading device 100 stores the second CPU 120 of the information processing device 200. You may operate|move as each part implement|achieved by. Further, the image reading device 100 may have a processing device similar to the processing device 230 of the information processing device 200 .

その場合、画像読取装置100は表示装置203と同様の表示装置を有する。認識処理は画像読取装置100で実行されるため、ステップS102、S201の入力画像の送受信処理は省略される。ステップS202~S212の各処理は、画像読取装置100の第1CPU120又は処理装置によって実行される。これらの処理の動作は、情報処理装置200の第2CPU220又は処理装置230によって実行される場合と同様である。 In that case, the image reading device 100 has a display device similar to the display device 203 . Since the recognition process is executed by the image reading apparatus 100, the transmission/reception process of the input image in steps S102 and S201 is omitted. Each process of steps S202 to S212 is executed by the first CPU 120 of the image reading device 100 or a processing device. These processing operations are the same as those executed by the second CPU 220 or the processing device 230 of the information processing device 200 .

また、画像処理システム1において、第1インタフェース装置101と第2インタフェース装置201は、インターネット、電話回線網(携帯端末回線網、一般電話回線網を含む)、イントラネット等のネットワークを介して接続してもよい。その場合、第1インタフェース装置101及び第2インタフェース装置201に、接続するネットワークの通信インタフェース回路を備える。また、その場合、クラウドコンピューティングの形態で画像処理のサービスを提供できるように、ネットワーク上に複数の情報処理装置を分散して配置し、各情報処理装置が協働して、認識処理等を分担するようにしてもよい。これにより、画像処理システム1は、複数の画像読取装置が読み取った入力画像について、効率よく認識処理を実行できる。 In the image processing system 1, the first interface device 101 and the second interface device 201 are connected via a network such as the Internet, a telephone line network (including a mobile terminal line network and a general telephone line network), an intranet, or the like. good too. In that case, the first interface device 101 and the second interface device 201 are provided with a communication interface circuit of the network to be connected. In that case, multiple information processing devices are distributed over a network so that image processing services can be provided in the form of cloud computing, and each information processing device cooperates to perform recognition processing, etc. You may make it share. As a result, the image processing system 1 can efficiently perform recognition processing on input images read by a plurality of image reading devices.

1 画像処理システム
200 情報処理装置
221 取得部
222 二値画像生成部
223 罫線除去画像生成部
224 領域検出部
225 結合部
226 逆転画像生成部
227 逆転二値画像生成部
228 文字検出部
229 出力制御部
1 Image processing system 200 Information processing device 221 Acquisition unit 222 Binary image generation unit 223 Line-removed image generation unit 224 Area detection unit 225 Joining unit 226 Reversed image generation unit 227 Reversed binary image generation unit 228 Character detection unit 229 Output control unit

Claims (6)

低輝度背景と、前記低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得する取得部と、
前記低輝度背景に対応する画素が黒色画素となり、前記高輝度文字に対応する画素が白色画素となるように前記多値画像を二値化した二値画像を生成する二値画像生成部と、
前記二値画像から前記複数の罫線の成分を除去した罫線除去画像を生成する罫線除去画像生成部と、
前記罫線除去画像内で黒色画素が連結する連結領域を検出する領域検出部と、
前記領域検出部により検出された複数の連結領域の大きさの関係、前記複数の連結領域の位置の関係、又は、前記複数の連結領域の間の距離の内の少なくとも一つに基づいて、前記複数の連結領域を結合する結合部と、
前記多値画像において、前記結合部により結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成する逆転画像生成部と、
前記逆転画像から文字を検出する文字検出部と、
前記検出された文字に関する情報を出力する出力部と、
を有することを特徴とする画像処理装置。
an acquisition unit that acquires a multivalued image obtained by imaging a document including a low-brightness background, high-brightness characters on the low-brightness background, and a plurality of ruled lines;
a binary image generation unit that generates a binary image by binarizing the multivalued image such that the pixels corresponding to the low-luminance background are black pixels and the pixels corresponding to the high-luminance characters are white pixels ;
a ruled-line-removed image generating unit that generates a ruled-line-removed image by removing components of the plurality of ruled lines from the binary image;
an area detection unit that detects a connected area where black pixels are connected in the ruled-line-removed image;
Based on at least one of the size relationship of the plurality of connected regions detected by the region detection unit, the positional relationship of the plurality of connected regions, or the distance between the plurality of connected regions, a connecting portion that connects a plurality of connecting regions;
In the multi-valued image, a reversed image is generated by reversing the relationship between the gradation values of the low-luminance background region and the gradation values of the high-luminance character region in the region corresponding to the connected region combined by the combining unit. a reverse image generator;
a character detection unit that detects characters from the reversed image;
an output unit that outputs information about the detected characters;
An image processing device comprising:
前記罫線除去画像生成部は、前記二値画像内で黒色画素が連結する領域内の、水平又は垂直方向の長さが所定値以下である部分を白色画素に変換することにより、前記罫線除去画像を生成する、請求項1に記載の画像処理装置。 The ruled-line-removed image generating unit converts a portion having a horizontal or vertical length equal to or less than a predetermined value in a region where black pixels are connected in the binary image into white pixels, thereby generating the ruled-line-removed image. 2. The image processing apparatus according to claim 1, which generates 前記逆転画像生成部は、前記多値画像において、前記結合部により結合された連結領域に対応する領域内に、所定サイズ以上である高輝度文字が含まれる場合に限り、当該対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させる、請求項1または2に記載の画像処理装置。 Only when a region corresponding to the connected region combined by the combining unit in the multivalued image contains a high-brightness character of a predetermined size or larger, the reverse image generation unit 3. The image processing apparatus according to claim 1, wherein the relationship between the gradation value of the low-luminance background area and the gradation value of the high-luminance character area is reversed. 前記逆転画像を二値化した逆転二値画像を生成する逆転二値画像生成部をさらに有し、
前記文字検出部は、前記逆転二値画像から前記文字を検出する、請求項1~3の何れか一項に記載の画像処理装置。
further comprising a reversed binary image generator that generates a reversed binary image by binarizing the reversed image;
4. The image processing apparatus according to claim 1, wherein said character detection unit detects said characters from said reversed binary image.
出力部を有する画像処理装置の制御方法であって、前記画像処理装置が、
低輝度背景と、前記低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得し、
前記低輝度背景に対応する画素が黒色画素となり、前記高輝度文字に対応する画素が白色画素となるように前記多値画像を二値化した二値画像を生成し、
前記二値画像から前記複数の罫線の成分を除去した罫線除去画像を生成し、
前記罫線除去画像内で黒色画素が連結する連結領域を検出し、
前記検出された複数の連結領域の大きさの関係、前記複数の連結領域の位置の関係、又は、前記複数の連結領域の間の距離の内の少なくとも一つに基づいて、前記複数の連結領域を結合し、
前記多値画像において、前記結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成し、
前記逆転画像から文字を検出し、
前記検出された文字に関する情報を前記出力部から出力する、
ことを含むことを特徴とする制御方法。
A control method for an image processing device having an output unit, the image processing device comprising:
Acquiring a multivalued image of a document containing a low-brightness background, high-brightness characters on the low-brightness background, and a plurality of ruled lines,
generating a binary image by binarizing the multivalued image such that pixels corresponding to the low-brightness background are black pixels and pixels corresponding to the high-brightness characters are white pixels ;
generating a ruled-line-removed image by removing components of the plurality of ruled lines from the binary image;
Detecting connected regions where black pixels are connected in the ruled-line-removed image;
the plurality of connected regions based on at least one of the size relationship of the detected plurality of connected regions, the positional relationship of the plurality of connected regions, or the distance between the plurality of connected regions; and
generating a reversed image by reversing the relationship between the gradation values of the low-luminance background region and the gradation value of the high-luminance character region in the region corresponding to the combined connected region in the multivalued image;
detecting characters from the reversed image;
outputting information about the detected characters from the output unit;
A control method comprising:
出力部を有するコンピュータの制御プログラムであって、
低輝度背景と、前記低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得し、
前記低輝度背景に対応する画素が黒色画素となり、前記高輝度文字に対応する画素が白色画素となるように前記多値画像を二値化した二値画像を生成し、
前記二値画像から前記複数の罫線の成分を除去した罫線除去画像を生成し、
前記罫線除去画像内で黒色画素が連結する連結領域を検出し、
前記検出された複数の連結領域の大きさの関係、前記複数の連結領域の位置の関係、又は、前記複数の連結領域の間の距離の内の少なくとも一つに基づいて、前記複数の連結領域を結合し、
前記多値画像において、前記結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成し、
前記逆転画像から文字を検出し、
前記検出された文字に関する情報を前記出力部から出力する、
ことを前記コンピュータに実行させることを特徴とする制御プログラム
A control program for a computer having an output unit,
Acquiring a multivalued image of a document containing a low-brightness background, high-brightness characters on the low-brightness background, and a plurality of ruled lines,
generating a binary image by binarizing the multivalued image such that pixels corresponding to the low-brightness background are black pixels and pixels corresponding to the high-brightness characters are white pixels ;
generating a ruled-line-removed image by removing components of the plurality of ruled lines from the binary image;
Detecting connected regions where black pixels are connected in the ruled-line-removed image;
the plurality of connected regions based on at least one of the size relationship of the detected plurality of connected regions, the positional relationship of the plurality of connected regions, or the distance between the plurality of connected regions; and
generating a reversed image by reversing the relationship between the gradation values of the low-luminance background region and the gradation value of the high-luminance character region in the region corresponding to the combined connected region in the multivalued image;
detecting characters from the reversed image;
outputting information about the detected characters from the output unit;
A control program characterized by causing the computer to execute:
JP2020554629A 2018-10-29 2018-10-29 Image processing device, control method and control program Active JP7106672B2 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2018/040188 WO2020089985A1 (en) 2018-10-29 2018-10-29 Image processing device, control method, and control program

Publications (2)

Publication Number Publication Date
JPWO2020089985A1 JPWO2020089985A1 (en) 2021-05-13
JP7106672B2 true JP7106672B2 (en) 2022-07-26

Family

ID=70463590

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020554629A Active JP7106672B2 (en) 2018-10-29 2018-10-29 Image processing device, control method and control program

Country Status (2)

Country Link
JP (1) JP7106672B2 (en)
WO (1) WO2020089985A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001109844A (en) 1999-10-06 2001-04-20 Internatl Business Mach Corp <Ibm> Character string extracting method, handwritten character extracting method, character string extraction device, and image processor
JP2002279345A (en) 2001-03-16 2002-09-27 Ricoh Co Ltd Image processing device and method, and computer- readable storage medium with stored program
JP2004199622A (en) 2002-12-20 2004-07-15 Ricoh Co Ltd Apparatus and method for image processing, recording media, and program
JP2005071088A (en) 2003-08-25 2005-03-17 Canon Inc Image processor, image processing method, and program, and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001109844A (en) 1999-10-06 2001-04-20 Internatl Business Mach Corp <Ibm> Character string extracting method, handwritten character extracting method, character string extraction device, and image processor
JP2002279345A (en) 2001-03-16 2002-09-27 Ricoh Co Ltd Image processing device and method, and computer- readable storage medium with stored program
JP2004199622A (en) 2002-12-20 2004-07-15 Ricoh Co Ltd Apparatus and method for image processing, recording media, and program
JP2005071088A (en) 2003-08-25 2005-03-17 Canon Inc Image processor, image processing method, and program, and storage medium

Also Published As

Publication number Publication date
JPWO2020089985A1 (en) 2021-05-13
WO2020089985A1 (en) 2020-05-07

Similar Documents

Publication Publication Date Title
JP5701182B2 (en) Image processing apparatus, image processing method, and computer program
JP6970835B2 (en) Image processing device, control method and control program
JP5826081B2 (en) Image processing apparatus, character recognition method, and computer program
KR101172399B1 (en) Image forming apparatus and image improvement method thereof
JP7185477B2 (en) Image processing device, control method and control program
JP2015195549A (en) Image processing system and image processing method
US10354352B2 (en) Image processing apparatus, image processing method, and storage medium
US10970579B2 (en) Image processing apparatus for placing a character recognition target region at a position of a predetermined region in an image conforming to a predetermined format
JP2013042413A (en) Image processing apparatus, image processing method, and computer program
JP2016054564A (en) Image processing system and image processing method
JP7106672B2 (en) Image processing device, control method and control program
WO2020065980A1 (en) Image processing device, control method and control program
US10896344B2 (en) Information processing apparatus, information processing method, and computer program
JP2021149452A (en) Image processing device, control method and control program
JP7022847B2 (en) Image processing device, control method and control program
WO2020157938A1 (en) Image processing device, control method, and control program
US10931852B2 (en) Image processing apparatus, image processing method, and storage medium, with determining whether or not character clipping rectangle determined to be non-character region is character region
WO2020157937A1 (en) Image processing device, control method, and control program
JP2006003993A (en) License plate recognition device
JP2023008183A (en) Imaging apparatus, control method, program, and storage medium
JP2021149459A (en) Image processor, control method, and control program
JP3723150B2 (en) Image reading device
JPH04257980A (en) Picture binarizing system
JPH03149967A (en) Image processing method
JP2003244430A (en) Image processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201022

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20211207

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220202

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220713

R150 Certificate of patent or registration of utility model

Ref document number: 7106672

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150