JP2019046377A - Line segment extraction program, image processing device and line segment extraction method - Google Patents

Line segment extraction program, image processing device and line segment extraction method Download PDF

Info

Publication number
JP2019046377A
JP2019046377A JP2017171465A JP2017171465A JP2019046377A JP 2019046377 A JP2019046377 A JP 2019046377A JP 2017171465 A JP2017171465 A JP 2017171465A JP 2017171465 A JP2017171465 A JP 2017171465A JP 2019046377 A JP2019046377 A JP 2019046377A
Authority
JP
Japan
Prior art keywords
line segment
area
image
unit
candidate
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.)
Pending
Application number
JP2017171465A
Other languages
Japanese (ja)
Inventor
勝山 裕
Yutaka Katsuyama
裕 勝山
瀬川 英吾
Eigo Segawa
英吾 瀬川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2017171465A priority Critical patent/JP2019046377A/en
Publication of JP2019046377A publication Critical patent/JP2019046377A/en
Pending legal-status Critical Current

Links

Images

Abstract

To provide a line segment extraction program capable of reducing erroneous extraction when extracting a line segment from an image.SOLUTION: The line segment extraction program causes a computer to execute a series of processing including the steps of: extracting a candidate area of a line segment from an image; identifying a peripheral area as the peripheral of the candidate area of the line segment; and determining whether or not the candidate area of the line segment is the line segment on the basis of an index value which is calculated from a feature quantity in the peripheral area.SELECTED DRAWING: Figure 3

Description

本発明は、線分抽出プログラム、画像処理装置及び線分抽出方法に関する。   The present invention relates to a line segment extraction program, an image processing apparatus, and a line segment extraction method.

従来より、帳簿や伝票等の各種帳票をスキャンすることにより電子化された帳票画像に対して、文字認識処理等を行う帳票画像処理システムが知られている。当該帳票画像処理システムでは、文字認識精度を上げるために、文字と罫線(線分)とを正しく識別することが求められる。   Conventionally, a form image processing system has been known which performs character recognition processing and the like on form images digitized by scanning various forms such as books and slips. The form image processing system is required to correctly identify characters and ruled lines (line segments) in order to improve character recognition accuracy.

特開2000−165371号公報Unexamined-Japanese-Patent No. 2000-165371 特開2008−198157号公報JP, 2008-19815, A 特開平10−334185号公報JP 10-334185 A

しかしながら、帳票には長さや太さの異なる複数の線分が含まれており、それら全ての線分を、例えば線分の形状に基づいて抽出しようとすると、文字の一部を誤抽出してしまうといった問題がある。   However, the form includes a plurality of line segments having different lengths and thicknesses, and when trying to extract all those line segments based on the shape of the line segment, for example, a part of the characters is erroneously extracted. There is a problem of

一つの側面では、画像から線分を抽出する際の誤抽出を低減させることを目的としている。   In one aspect, the object is to reduce erroneous extraction when extracting line segments from an image.

一態様によれば、線分抽出プログラムは、
画像から線分の候補領域を抽出し、
前記線分の候補領域の周囲となる周囲領域を特定し、
前記周囲領域の特徴量から算出される指標値に基づいて、前記線分の候補領域が線分か否かを判定する、処理をコンピュータに実行させる。
According to one aspect, the line segment extraction program
Extract line segment candidate regions from the image,
Identifying a surrounding area around the candidate area of the line segment;
The computer is made to execute processing of determining whether the candidate region of the line segment is a line segment based on the index value calculated from the feature amount of the surrounding region.

画像から線分を抽出する際の誤抽出を低減させることができる。   Erroneous extraction when extracting line segments from an image can be reduced.

帳票画像処理システムのシステム構成の一例を示す図である。FIG. 2 is a diagram showing an example of a system configuration of a form image processing system. 画像処理装置のハードウェア構成の一例を示す図である。It is a figure showing an example of the hardware constitutions of an image processing device. 前処理部及び線分抽出部の機能構成の詳細を示す図である。It is a figure which shows the detail of a function structure of a pre-processing part and a line segment extraction part. 線分抽出処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a line segment extraction process. 線分候補抽出処理の詳細を示すフローチャートである。It is a flow chart which shows the details of line segment candidate extraction processing. 文字サイズ算出処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of a character size calculation process. 上下領域情報算出処理及び左右領域情報算出処理の詳細を示すフローチャートである。It is a flow chart which shows the details of upper and lower area information calculation processing and right and left area information calculation processing. ノイズ判定処理の詳細を示す第1のフローチャートである。It is a first flowchart showing the details of the noise determination process. ノイズ判定処理の詳細を示す第2のフローチャートである。It is a 2nd flow chart which shows the details of noise judging processing. 線分抽出処理の効果を説明するための図である。It is a figure for demonstrating the effect of a line segment extraction process.

以下、各実施形態について添付の図面を参照しながら説明する。なお、本明細書及び図面において、実質的に同一の機能構成を有する構成要素については、同一の符号を付することにより重複した説明を省略する。   Hereinafter, each embodiment will be described with reference to the attached drawings. In the present specification and the drawings, components having substantially the same functional configuration will be denoted by the same reference numerals and redundant description will be omitted.

[第1の実施形態]
<帳票画像処理システムのシステム構成>
はじめに、帳票画像処理システムのシステム構成について説明する。帳票画像処理システムは、帳簿(例えば、仕訳帳、現金出納帳、売掛帳)や伝票(例えば、見積書、請求書、納品書、領収書)等の各種帳票をスキャンすることで電子化した帳票画像に対して、文字認識処理等を行うシステムである。
First Embodiment
<System Configuration of Form Image Processing System>
First, the system configuration of the form image processing system will be described. The form image processing system was digitized by scanning various forms such as books (eg, journals, cash books, accounts receivables) and slips (eg, quotations, invoices, delivery notes, receipts) It is a system that performs character recognition processing and the like on a form image.

図1は、帳票画像処理システムのシステム構成の一例を示す図である。図1に示すように、帳票画像処理システム100は、読取装置110と、読取装置110と接続される画像処理装置120とを有する。   FIG. 1 is a diagram showing an example of a system configuration of a form image processing system. As shown in FIG. 1, the form image processing system 100 includes a reading device 110 and an image processing device 120 connected to the reading device 110.

読取装置110は、スキャナ等の画像形成装置である。読取装置110は、帳票130をスキャンすることで帳票130を電子化し、帳票画像を形成する。読取装置110は、電子化した帳票画像を画像処理装置120に送信する。   The reading device 110 is an image forming apparatus such as a scanner. The reader 110 scans the form 130 to digitize the form 130 and form a form image. The reading device 110 transmits the digitized form image to the image processing device 120.

画像処理装置120には、前処理プログラム、線分抽出プログラム、帳票識別プログラム、文字認識プログラム等がインストールされている。画像処理装置120は、これらのプログラムを実行することで、前処理部121、線分抽出部122、帳票識別部123、文字認識部124として機能する。   In the image processing apparatus 120, a pre-processing program, a line segment extraction program, a form identification program, a character recognition program, and the like are installed. The image processing apparatus 120 functions as a preprocessing unit 121, a line segment extraction unit 122, a form identification unit 123, and a character recognition unit 124 by executing these programs.

前処理部121は、読取装置110より帳票画像を受信し、受信した帳票画像を2値化することで、2値化画像を生成する。また、前処理部121は、生成した2値化画像を線分抽出部122及び文字認識部124に通知する。   The preprocessing unit 121 receives a form image from the reading device 110 and generates a binarized image by binarizing the received form image. Further, the preprocessing unit 121 notifies the line segment extraction unit 122 and the character recognition unit 124 of the generated binarized image.

線分抽出部122は、前処理部121より2値化画像を受信し、受信した2値化画像から罫線(線分)を抽出する。また、線分抽出部122は、抽出した線分の位置を示す線分情報を帳票識別部123に通知する。   The line segment extraction unit 122 receives the binarized image from the pre-processing unit 121, and extracts a ruled line (line segment) from the received binarized image. The line segment extraction unit 122 also notifies the form identification unit 123 of line segment information indicating the position of the extracted line segment.

帳票識別部123は、線分抽出部122より線分情報を受信し、受信した線分情報に基づいて、帳票の種類を識別する。また、帳票識別部123は、識別した帳票の種類を示す帳票情報を文字認識部124に通知する。   The form identification unit 123 receives line segment information from the line segment extraction unit 122, and identifies the type of form based on the received line segment information. Further, the form identification unit 123 notifies the character recognition unit 124 of form information indicating the type of the identified form.

文字認識部124は、前処理部121より2値化画像を受信し、帳票識別部123より帳票情報を受信する。文字認識部124は、受信した帳票情報に基づいて、2値化画像に対して文字認識処理を行う際の対象領域を特定する。更に、文字認識部124は、特定した対象領域より文字を抽出し、文字認識処理を行う。   The character recognition unit 124 receives the binarized image from the pre-processing unit 121, and receives the form information from the form identification unit 123. The character recognition unit 124 specifies a target area when character recognition processing is performed on the binarized image based on the received form information. Furthermore, the character recognition unit 124 extracts characters from the specified target area and performs character recognition processing.

<画像処理装置のハードウェア構成>
次に、画像処理装置120のハードウェア構成について説明する。図2は、画像処理装置のハードウェア構成の一例を示す図である。
<Hardware Configuration of Image Processing Device>
Next, the hardware configuration of the image processing apparatus 120 will be described. FIG. 2 is a diagram illustrating an example of the hardware configuration of the image processing apparatus.

図2に示すように、画像処理装置120は、CPU(Central Processing Unit)201、ROM(Read Only Memory)202、RAM(Random Access Memory)203を有する。CPU201、ROM202、RAM203は、いわゆるコンピュータを形成する。また、画像処理装置120は、補助記憶装置204、操作装置205、表示装置206、I/F(Interface)装置207、ドライブ装置208を有する。なお、画像処理装置120の各ハードウェアは、バス209を介して相互に接続されている。   As shown in FIG. 2, the image processing apparatus 120 includes a central processing unit (CPU) 201, a read only memory (ROM) 202, and a random access memory (RAM) 203. The CPU 201, the ROM 202, and the RAM 203 form a so-called computer. The image processing apparatus 120 further includes an auxiliary storage device 204, an operation device 205, a display device 206, an I / F (Interface) device 207, and a drive device 208. The hardware of the image processing apparatus 120 is connected to one another via a bus 209.

CPU201は、補助記憶装置204にインストールされた各種プログラム(例えば、前処理プログラム、線分抽出プログラム、帳票識別プログラム、文字認識プログラム等)を実行する。   The CPU 201 executes various programs (for example, a pre-processing program, a line segment extraction program, a form identification program, a character recognition program, etc.) installed in the auxiliary storage device 204.

ROM202は、不揮発性メモリであり、主記憶装置として機能する。ROM202は、補助記憶装置204にインストールされた各種プログラムをCPU201が実行するために必要な各種プログラム、データ等を格納する。具体的には、ROM202はBIOS(Basic Input/Output System)やEFI(Extensible Firmware Interface)等のブートプログラム等を格納する。   The ROM 202 is a non-volatile memory and functions as a main storage device. The ROM 202 stores various programs, data, and the like necessary for the CPU 201 to execute various programs installed in the auxiliary storage device 204. Specifically, the ROM 202 stores a boot program such as BIOS (Basic Input / Output System) or EFI (Extensible Firmware Interface).

RAM203は、DRAM(Dynamic Random Access Memory)やSRAM(Static Random Access Memory)等の揮発性メモリであり、主記憶装置として機能する。RAM203は、補助記憶装置204にインストールされた各種プログラムがCPU201によって実行される際に展開される、作業領域を提供する。   The RAM 203 is a volatile memory such as a dynamic random access memory (DRAM) or a static random access memory (SRAM), and functions as a main storage device. The RAM 203 provides a work area which is expanded when the various programs installed in the auxiliary storage device 204 are executed by the CPU 201.

補助記憶装置204は、各種プログラムや、各種プログラムがCPU201によって実行される際に用いられる情報を格納する。   The auxiliary storage device 204 stores various programs and information used when the various programs are executed by the CPU 201.

操作装置205は、画像処理装置120のユーザが画像処理装置120に対して各種指示を入力する際に用いる入力デバイスである。表示装置206は、画像処理装置120の内部情報を表示する表示デバイスである。   The operating device 205 is an input device used when the user of the image processing apparatus 120 inputs various instructions to the image processing apparatus 120. The display device 206 is a display device that displays internal information of the image processing apparatus 120.

I/F装置207は、読取装置110と、画像処理装置120とを通信可能に接続する接続デバイスである。   The I / F device 207 is a connection device that communicably connects the reading device 110 and the image processing device 120.

ドライブ装置208は記録媒体210をセットするためのデバイスである。ここでいう記録媒体210には、CD−ROM、フレキシブルディスク、光磁気ディスク等のように情報を光学的、電気的あるいは磁気的に記録する媒体が含まれる。また、記録媒体210には、ROM、フラッシュメモリ等のように情報を電気的に記録する半導体メモリ等が含まれていてもよい。   The drive device 208 is a device for setting the recording medium 210. The recording medium 210 mentioned here includes a medium for optically, electrically or magnetically recording information, such as a CD-ROM, a flexible disk, a magneto-optical disk or the like. The recording medium 210 may also include a semiconductor memory or the like that electrically records information, such as a ROM, a flash memory, or the like.

なお、補助記憶装置204にインストールされる各種プログラムは、例えば、配布された記録媒体210がドライブ装置208にセットされ、該記録媒体210に記録された各種プログラムがドライブ装置208により読み出されることでインストールされる。   The various programs installed in the auxiliary storage device 204 are installed by, for example, the distributed recording medium 210 being set in the drive device 208 and the various programs recorded in the recording medium 210 being read by the drive device 208 Be done.

<画像処理装置の機能構成>
次に、画像処理装置120の機能構成について説明する。ここでは、画像処理装置120の各部(前処理部121、線分抽出部122、帳票識別部123、文字認識部124)のうち、前処理部121及び線分抽出部122について、機能構成の詳細を説明する。
<Functional Configuration of Image Processing Device>
Next, the functional configuration of the image processing apparatus 120 will be described. Here, details of the functional configuration of the preprocessing unit 121 and the line segment extraction unit 122 among the units (the preprocessing unit 121, the line segment extraction unit 122, the form identification unit 123, and the character recognition unit 124) of the image processing apparatus 120 Explain.

図3は、前処理部及び線分抽出部の機能構成の詳細を示す図である。図3に示すように、前処理部121は、帳票画像取得部311と、2値化部312とを有する。   FIG. 3 is a diagram showing details of functional configurations of the pre-processing unit and the line segment extraction unit. As shown in FIG. 3, the preprocessing unit 121 includes a form image acquisition unit 311 and a binarization unit 312.

帳票画像取得部311は、読取装置110より帳票画像を受信し、受信した帳票画像を2値化部312に通知する。2値化部312は、帳票画像を2値化することで、2値化画像を生成する。また、2値化部312は、生成した2値化画像を線分抽出部122及び文字認識部124に通知する。   The form image acquisition unit 311 receives a form image from the reading device 110 and notifies the binarization unit 312 of the received form image. The binarization unit 312 generates a binarized image by binarizing the form image. Further, the binarization unit 312 notifies the line segment extraction unit 122 and the character recognition unit 124 of the generated binarized image.

線分抽出部122は、2値化画像取得部321と、黒ラン画像抽出部322と、線分候補領域特定部323と、文字領域画像抽出部324と、文字サイズ算出部325と、周囲領域特定部326と、ノイズ判定部327とを有する。   The line segment extraction unit 122 includes a binarized image acquisition unit 321, a black run image extraction unit 322, a line segment candidate area specification unit 323, a character area image extraction unit 324, a character size calculation unit 325, and a surrounding area. It has a specifying unit 326 and a noise determination unit 327.

2値化画像取得部321は、2値化部312より2値化画像を受信し、黒ラン画像抽出部322及び文字領域画像抽出部324に通知する。   The binarized image acquisition unit 321 receives the binarized image from the binarization unit 312, and notifies the black run image extraction unit 322 and the character area image extraction unit 324 of it.

黒ラン画像抽出部322は、2値化画像から黒ラン画像を抽出する。黒ラン画像とは、2値化画像において、黒画素が横方向の1ラインまたは縦方向の1ラインに連続している塊を指す。黒ラン画像抽出部322は、横方向の各ラインで黒ラン画像を抽出し、線分候補領域特定部323に通知する。   The black run image extraction unit 322 extracts a black run image from the binarized image. The black run image is a binarized image in which black pixels are continuous to one line in the horizontal direction or one line in the vertical direction. The black run image extraction unit 322 extracts a black run image in each line in the horizontal direction, and notifies the line candidate region identification unit 323 of the black run image.

なお、黒ラン画像抽出部322は、縦方向の各ラインについても同様の処理を行うことで、縦方向の黒ラン画像を抽出し、線分候補領域特定部323に通知する。   The black run image extraction unit 322 extracts the black run image in the vertical direction by performing the same process on each line in the vertical direction, and notifies the line segment candidate area specification unit 323 of the black run image.

線分候補領域特定部323は抽出部の一例であり、黒ラン画像抽出部322より受信した横方向の黒ラン画像を、隣接する横方向のライン間で統合することで、横方向の線分候補を抽出する。同様に、線分候補領域特定部323は、黒ラン画像抽出部322より受信した縦方向の黒ラン画像を、隣接する縦方向のライン間で統合することで、縦方向の線分候補を抽出する。   The line segment candidate area specifying unit 323 is an example of an extraction unit, and integrates the black run images in the horizontal direction received from the black run image extraction unit 322 between adjacent horizontal lines to obtain line segments in the horizontal direction. Extract candidates. Similarly, the line segment candidate region specifying unit 323 extracts a line segment candidate in the vertical direction by integrating the black run images in the vertical direction received from the black run image extraction unit 322 between adjacent vertical lines. Do.

また、線分候補領域特定部323は、それぞれの線分候補に外接する外接矩形領域(線分候補領域)を特定し、2値化画像における当該外接矩形領域の位置を示す線分候補領域情報を算出する。更に、線分候補領域特定部323は、算出した線分候補領域情報を、周囲領域特定部326に通知する。   The line segment candidate area specifying unit 323 specifies a circumscribed rectangular area (line segment candidate area) circumscribing each of the line segment candidates, and line segment candidate area information indicating the position of the circumscribed rectangular area in the binarized image. Calculate Further, the line segment candidate area specifying unit 323 notifies the surrounding area specifying unit 326 of the calculated line segment candidate area information.

文字領域画像抽出部324は、2値化画像から文字領域画像を抽出する。文字領域画像とは、2値化画像において、黒画素が互いに隣接している塊を指す。文字領域画像抽出部324は、抽出した各文字領域画像をラベリングして、文字サイズ算出部325に通知する。   The character area image extraction unit 324 extracts a character area image from the binarized image. A character area image refers to a block in which black pixels are adjacent to each other in a binarized image. The character area image extraction unit 324 labels each of the extracted character area images and notifies the character size calculation unit 325 of the labeling.

文字サイズ算出部325は、文字領域画像抽出部324より受信した各文字領域画像に基づいて、2値化画像に含まれている各文字の文字幅(Wc)と文字高さ(Hc)とを算出する。   Based on each character area image received from the character area image extraction unit 324, the character size calculation unit 325 determines the character width (Wc) and the character height (Hc) of each character included in the binarized image. calculate.

具体的には、文字サイズ算出部325は、文字領域画像に外接する外接矩形領域を特定し、特定した外接矩形領域の幅についてヒストグラムを作成し、出現頻度が最大となる幅を判定する。文字サイズ算出部325は、出現頻度が最大となる幅を、2値化画像に含まれている各文字の文字幅(Wc)として周囲領域特定部326に通知する。   Specifically, the character size calculation unit 325 specifies a circumscribed rectangular area circumscribing the character area image, creates a histogram for the width of the specified circumscribed rectangular area, and determines the width at which the appearance frequency is maximum. The character size calculation unit 325 notifies the surrounding area specifying unit 326 of the width at which the appearance frequency is maximum as the character width (Wc) of each character included in the binarized image.

同様に、文字サイズ算出部325は、特定した外接矩形領域の高さについてヒストグラムを作成し、出現頻度が最大となる高さを判定する。文字サイズ算出部325は、出現頻度が最大となる高さを、2値化画像に含まれている各文字の文字高さ(Hc)として周囲領域特定部326に通知する。   Similarly, the character size calculation unit 325 creates a histogram for the height of the specified circumscribed rectangular area, and determines the height at which the appearance frequency is maximum. The character size calculation unit 325 notifies the surrounding area specifying unit 326 of the height at which the appearance frequency is maximum as the character height (Hc) of each character included in the binarized image.

周囲領域特定部326は特定部の一例である。周囲領域特定部326は、線分候補領域特定部323より線分候補領域情報を受信し、文字サイズ算出部325より文字幅(Wc)及び文字高さ(Hc)を受信する。また、周囲領域特定部326は、受信した線分候補領域情報に基づいて、2値化画像における線分候補領域の位置を識別する。   The surrounding area specifying unit 326 is an example of a specifying unit. The surrounding area specifying unit 326 receives line segment candidate area information from the line segment candidate area specifying unit 323, and receives a character width (Wc) and a character height (Hc) from the character size calculation unit 325. In addition, the surrounding area specifying unit 326 identifies the position of the line segment candidate area in the binarized image based on the received line segment candidate area information.

そして、周囲領域特定部326は、位置を識別した線分候補領域に対して、上下方向及び左右方向に独立した領域(線分候補領域の周囲に位置する周囲領域)を特定し、特定した周囲領域の位置を示す周囲領域情報をノイズ判定部327に通知する。なお、周囲領域特定部326は、線分候補領域の周囲に位置する周囲領域を特定するにあたり、文字幅(Wc)及び文字高さ(Hc)を用いる。   Then, the surrounding area specifying unit 326 specifies, for the line segment candidate area whose position has been identified, an area independent in the vertical direction and the left and right direction (a surrounding area located around the line candidate area) and specified The noise determination unit 327 is notified of surrounding area information indicating the position of the area. The surrounding area specifying unit 326 uses the character width (Wc) and the character height (Hc) to specify the surrounding area located around the line segment candidate area.

ノイズ判定部327は判定部の一例である。ノイズ判定部327は、周囲領域特定部326より受信した周囲領域情報に基づいて、それぞれの線分候補について周囲領域を特定する。また、ノイズ判定部327は、2値化画像より、特定した周囲領域に含まれる各画素の画素値を抽出し、抽出した画素値に基づいて、それぞれの線分候補が線分であるのかノイズであるのかを判定する。   The noise determination unit 327 is an example of a determination unit. The noise determination unit 327 specifies the surrounding area for each line segment candidate based on the surrounding area information received from the surrounding area specifying unit 326. Also, the noise determination unit 327 extracts the pixel value of each pixel included in the specified surrounding area from the binarized image, and based on the extracted pixel value, whether each line segment candidate is a line segment or not Determine if it is.

ノイズ判定部327は、それぞれの線分候補のうち、線分であると判定した線分候補について、線分の位置を示す線分情報を帳票識別部123に通知する。   The noise determination unit 327 notifies the form identification unit 123 of line segment information indicating the position of the line segment for the line segment candidate determined to be a line segment among the line segment candidates.

<線分抽出処理の流れ>
次に、線分抽出部122により実行される線分抽出処理全体の流れについて説明する。図4は、線分抽出処理の流れを示すフローチャートである。画像処理装置120が起動し、前処理部121が読取装置110より帳票画像を受信し、2値化画像を生成すると、図4に示す線分抽出処理が開始される。
<Flow of line segment extraction process>
Next, the flow of the entire line segment extraction process performed by the line segment extraction unit 122 will be described. FIG. 4 is a flowchart showing the flow of the line segment extraction process. When the image processing apparatus 120 is activated, the preprocessing unit 121 receives a form image from the reading apparatus 110, and generates a binarized image, the line segment extraction process shown in FIG. 4 is started.

ステップS401において、2値化画像取得部321は、2値化部312より2値化画像を受信する。   In step S401, the binarized image acquisition unit 321 receives a binarized image from the binarization unit 312.

ステップS402において、黒ラン画像抽出部322及び線分候補領域特定部323は、線分候補抽出処理を実行し、線分候補領域情報を周囲領域特定部326に通知する。なお、線分候補抽出処理(ステップS402)の詳細は後述する。   In step S402, the black run image extraction unit 322 and the line segment candidate area identification unit 323 execute a line segment candidate extraction process, and notify the surrounding area identification unit 326 of line segment candidate area information. The details of the line segment candidate extraction process (step S402) will be described later.

ステップS403において、文字領域画像抽出部324及び文字サイズ算出部325は、文字サイズ算出処理を実行し、文字幅(Wc)及び文字高さ(Hc)を、周囲領域特定部326に通知する。なお、文字サイズ算出処理(ステップS403)の詳細は後述する。   In step S403, the character area image extraction unit 324 and the character size calculation unit 325 execute character size calculation processing, and notify the surrounding area specifying unit 326 of the character width (Wc) and the character height (Hc). The details of the character size calculation process (step S403) will be described later.

ステップS404において、周囲領域特定部326は、線分候補の数をカウントするカウンタiに1を代入する。   In step S404, the surrounding area specifying unit 326 substitutes 1 into a counter i that counts the number of line segment candidates.

ステップS405において、周囲領域特定部326は、i番目の線分候補についての線分候補領域情報を、線分候補領域特定部323より受信する。   In step S405, the surrounding area identifying unit 326 receives line segment candidate area information on the i-th line segment candidate from the line segment candidate area identifying unit 323.

ステップS406において、周囲領域特定部326は、i番目の線分候補が横方向の線分候補であった場合、i番目の線分候補についての線分候補領域情報に基づいて、線分候補領域に対する周囲領域のうち、上領域及び下領域を特定する。   In step S406, when the i-th line segment candidate is a line segment candidate in the horizontal direction, the surrounding area specifying unit 326 determines a line segment candidate area based on the line segment candidate area information for the i-th line segment candidate. Of the surrounding area for, the upper area and the lower area are identified.

また、周囲領域特定部326は、i番目の線分候補が縦方向の線分候補であった場合、i番目の線分候補についての線分候補領域情報と、文字高さ(Hc)とに基づいて、線分候補領域に対する周囲領域のうち、上領域及び下領域を特定する。   In addition, when the i-th line segment candidate is a line segment candidate in the vertical direction, the surrounding area specifying unit 326 generates line segment candidate area information on the i-th line segment candidate and the character height (Hc). Among the surrounding areas for the line segment candidate area, the upper area and the lower area are identified.

そして、周囲領域特定部326は、特定した上領域及び下領域の2値化画像における位置を示す上領域情報及び下領域情報を算出し、周囲領域情報としてノイズ判定部327に通知する。なお、上下領域情報算出処理(ステップS406)の詳細は後述する。   Then, the surrounding area specifying unit 326 calculates upper area information and lower area information indicating the positions of the specified upper area and lower area in the binarized image, and notifies the noise determining unit 327 as surrounding area information. The details of the upper and lower area information calculation process (step S406) will be described later.

ステップS407において、周囲領域特定部326は、i番目の線分候補が横方向の線分候補であった場合、i番目の線分候補についての線分候補領域情報と、文字幅(Wc)とに基づいて、線分候補領域に対する周囲領域のうち、左領域及び右領域を特定する。   In step S407, when the i-th line segment candidate is a line segment candidate in the horizontal direction, the surrounding area specifying unit 326 determines line segment candidate area information and the character width (Wc) for the i-th line segment candidate. Among the surrounding areas for the line segment candidate area, the left area and the right area are specified based on

また、周囲領域特定部326は、i番目の線分候補が縦方向の線分候補であった場合、i番目の線分候補についての線分候補領域情報に基づいて、線分候補領域に対する周囲領域のうち、左領域及び右領域を特定する。   In addition, when the i-th line segment candidate is a line segment candidate in the vertical direction, the surrounding area specifying unit 326 performs a surrounding of the line segment candidate area based on the line segment candidate area information about the i-th line segment candidate. Of the regions, the left and right regions are identified.

そして、周囲領域特定部326は、特定した左領域及び右領域の2値化画像における位置を示す左領域情報及び右領域情報を算出し、周囲領域情報としてノイズ判定部327に通知する。なお、左右領域情報算出処理の詳細(ステップS407)は後述する。   Then, the surrounding area specifying unit 326 calculates left area information and right area information indicating the positions of the specified left area and right area in the binarized image, and notifies the noise determining unit 327 as surrounding area information. Details of the left and right area information calculation process (step S407) will be described later.

ステップS408において、ノイズ判定部327は、i番目の線分候補についての周囲領域情報に基づいて特定される周囲領域(上領域、下領域、左領域、右領域)に含まれる各画素の画素値を2値化画像より抽出する。そして、ノイズ判定部327は、抽出した画素値に基づいて、i番目の線分候補が、線分であるのかノイズであるのかを判定する。なお、ノイズ判定処理(ステップS408)の詳細は後述する。   In step S408, the noise determination unit 327 calculates the pixel value of each pixel included in the surrounding area (upper area, lower area, left area, right area) specified based on the surrounding area information for the i-th line segment candidate. Are extracted from the binarized image. Then, the noise determination unit 327 determines whether the ith line segment candidate is a line segment or noise based on the extracted pixel value. The details of the noise determination process (step S408) will be described later.

ステップS409において、周囲領域特定部326は、全ての線分候補についてステップS405〜ステップS408までの処理を行ったか否かを判定する。ステップS409において、線分候補の中に、ステップS405〜ステップS408までの処理を行っていない線分候補があると判定した場合には、ステップS410に進む。   In step S409, the surrounding area specifying unit 326 determines whether or not the processing from step S405 to step S408 has been performed for all line segment candidates. If it is determined in step S409 that there are line segment candidates not subjected to the processing in steps S405 to S408 among the line segment candidates, the process proceeds to step S410.

ステップS410において、周囲領域特定部326は、カウンタiをインクリメントし、ステップS405に戻る。   In step S410, the surrounding area specifying unit 326 increments the counter i and returns to step S405.

一方、ステップS409において、全ての線分候補について、ステップS405〜ステップS408までの処理を行ったと判定した場合、線分抽出処理を終了する。   On the other hand, if it is determined in step S409 that the processing from step S405 to step S408 has been performed for all line segment candidates, the line segment extraction processing is ended.

<線分候補抽出処理の詳細>
次に、線分候補抽出処理(図4のステップS402)の詳細について説明する。図5は、線分候補抽出処理の詳細を示すフローチャートである。ここでは、横方向の線分候補を抽出する場合の線分候補抽出処理について、具体例を参照しながら説明する。
<Details of line segment candidate extraction process>
Next, details of the line segment candidate extraction process (step S402 in FIG. 4) will be described. FIG. 5 is a flowchart showing details of the line segment candidate extraction process. Here, line segment candidate extraction processing in the case of extracting line segment candidates in the horizontal direction will be described with reference to a specific example.

ステップS501において、黒ラン画像抽出部322は、2値化画像500を取得し、取得した2値化画像500の横方向の各ラインで、所定の閾値以上の長さを有する黒ラン画像を抽出する。なお、2値化画像500には、横方向の線分511、512と、縦方向の線分531、533とが含まれ、更に、文字列540が含まれているものとする。   In step S501, the black run image extraction unit 322 acquires the binarized image 500, and extracts a black run image having a length equal to or greater than a predetermined threshold in each line in the horizontal direction of the acquired binarized image 500. Do. The binarized image 500 includes horizontal line segments 511 and 512 and vertical line segments 531 and 533, and further includes a character string 540.

ステップS502において、黒ラン画像抽出部322は、ステップS501において抽出した黒ラン画像のうち、隣接するライン間(ここでは、隣接する横方向のライン間)の黒ラン画像を統合することで、横方向の線分候補を抽出する。   In step S502, the black run image extraction unit 322 integrates the black run images between adjacent lines (here, between adjacent horizontal lines) among the black run images extracted in step S501. Extract line segment candidates in the direction.

ステップS503において、黒ラン画像抽出部322は、抽出した線分候補に外接する外接矩形領域521、522、541〜546を特定する。   In step S503, the black run image extraction unit 322 specifies circumscribed rectangular regions 521, 522, and 541 to 546 circumscribing the extracted line segment candidate.

なお、外接矩形領域521は、線分候補として抽出された線分511に外接する外接矩形領域である。線分511は、複数ライン分の黒ラン画像が統合されることで、線分候補として抽出される。   The circumscribed rectangular area 521 is a circumscribed rectangular area circumscribing the line segment 511 extracted as a line segment candidate. The line segment 511 is extracted as a line segment candidate by integrating black run images for a plurality of lines.

同様に、外接矩形領域522は、線分候補として抽出された線分512に外接する外接矩形領域である。線分512は、複数ライン分の黒ラン画像が統合されることで、線分候補として抽出される。   Similarly, the circumscribed rectangular area 522 is a circumscribed rectangular area circumscribing the line segment 512 extracted as a line segment candidate. The line segment 512 is extracted as a line segment candidate by integrating a black run image for a plurality of lines.

一方、外接矩形領域541〜546は、文字列540に含まれる文字の一部に外接する外接矩形領域である。図5に示すように、文字列540に含まれる文字の一部も、複数ライン分の黒ラン画像が統合されることで、線分候補として抽出される。   On the other hand, the circumscribed rectangular regions 541 to 546 are circumscribed rectangular regions circumscribing a part of the characters included in the character string 540. As shown in FIG. 5, some of the characters included in the character string 540 are also extracted as line segment candidates by integrating the black run images for a plurality of lines.

ステップS504において、線分候補領域特定部323は、特定した外接矩形領域521、522、541〜546の2値化画像500内での位置を示す線分候補領域情報を算出し、周囲領域特定部326に通知する。   In step S504, the line segment candidate area identification unit 323 calculates line segment candidate area information indicating the position of the identified circumscribed rectangular areas 521, 522, and 541 to 546 within the binarized image 500, and the surrounding area identification unit Notify 326

<文字サイズ算出処理の流れ>
次に、文字サイズ算出処理(図4のステップS403)の詳細について説明する。図6は、文字サイズ算出処理の詳細を示すフローチャートである。ここでは、文字幅(Wc)を算出する場合の文字サイズ算出処理について、具体例を参照しながら説明する。
<Flow of character size calculation process>
Next, details of the character size calculation process (step S403 in FIG. 4) will be described. FIG. 6 is a flowchart showing details of the character size calculation process. Here, the character size calculation process for calculating the character width (Wc) will be described with reference to a specific example.

ステップS601において、文字領域画像抽出部324は、2値化画像500を取得し、取得した2値化画像500から文字領域画像を抽出し、抽出した各文字領域画像をラベリングして、文字サイズ算出部325に通知する。なお、図6に示すように、2値化画像500には、文字列540が含まれるものとする。   In step S601, the character area image extraction unit 324 acquires the binary image 500, extracts the character area image from the acquired binary image 500, labels each extracted character area image, and calculates the character size. It notifies the part 325. As shown in FIG. 6, the binarized image 500 includes a character string 540.

ステップS602において、文字サイズ算出部325は、文字領域画像抽出部324より通知された各文字領域画像に外接する外接矩形領域621〜635をそれぞれ特定する。   In step S602, the character size calculation unit 325 specifies circumscribed rectangular regions 621 to 635 circumscribing the respective character region images notified from the character region image extraction unit 324.

ステップS603において、文字サイズ算出部325は、特定した各外接矩形領域621〜635の幅を算出し、算出した外接矩形領域の幅について、ヒストグラム640を作成する。   In step S603, the character size calculation unit 325 calculates the widths of the specified circumscribed rectangular regions 621 to 635, and creates a histogram 640 for the calculated widths of the circumscribed rectangular regions.

ステップS604において、文字サイズ算出部325は、作成したヒストグラム640に基づいて、出現頻度が最大となる幅を判定する。また、文字サイズ算出部325は、出現頻度が最大となる幅を文字幅(Wc)に決定し、周囲領域特定部326に通知する。   In step S604, the character size calculation unit 325 determines the width at which the appearance frequency is maximum based on the created histogram 640. In addition, the character size calculation unit 325 determines the width at which the appearance frequency is maximum as the character width (Wc), and notifies the surrounding area identification unit 326 of the width.

<上下領域情報算出処理及び左右領域情報算出処理の詳細>
次に、上下領域情報算出処理(図4のステップS406)及び左右領域情報算出処理(図4のステップS407)の詳細について説明する。上述したとおり、周囲領域特定部326は、線分候補領域それぞれに対して、周囲領域として、上領域、下領域、左領域、右領域を特定する。ここでは、横方向の線分候補についての上下領域情報算出処理及び左右領域情報算出処理について説明する。
<Details of Upper and Lower Region Information Calculation Processing and Left and Right Region Information Calculation Processing>
Next, details of the upper and lower area information calculation process (step S406 in FIG. 4) and the left and right area information calculation process (step S407 in FIG. 4) will be described. As described above, the surrounding area specifying unit 326 specifies the upper area, the lower area, the left area, and the right area as the surrounding area for each of the line segment candidate areas. Here, upper and lower area information calculation processing and left and right area information calculation processing for line segment candidates in the horizontal direction will be described.

図7は、上下領域情報算出処理及び左右領域情報算出処理の詳細を示すフローチャートである。このうち、図7(a)は、周囲領域情報として、上領域情報と下領域情報とを算出する上下領域情報算出処理のフローチャートを表している。図7(c)の具体例を参照しながら、図7(a)に示す上下領域情報算出処理の流れについて説明する。   FIG. 7 is a flowchart showing details of upper and lower area information calculation processing and left and right area information calculation processing. Among these, FIG. 7A shows a flowchart of upper and lower area information calculation processing for calculating upper area information and lower area information as surrounding area information. A flow of upper and lower area information calculation processing shown in FIG. 7A will be described with reference to a specific example of FIG. 7C.

ステップS701において、周囲領域特定部326は、線分候補領域特定部323より線分候補領域情報を取得する。線分候補領域情報には、線分候補に外接する外接矩形領域521の左上の頂点の座標(x,y)と、右下の頂点の座標(x,y)とが含まれているものとする(図7(c)参照)。 In step S 701, the surrounding area identifying unit 326 acquires line segment candidate area information from the line segment candidate area identifying unit 323. The line segment candidate area information includes the coordinates (x 1 , y 1 ) of the upper left vertex of the circumscribed rectangular area 521 circumscribing the line segment candidate and the coordinates (x 2 , y 2 ) of the lower right vertex. (See FIG. 7 (c)).

ステップS702において、周囲領域特定部326は、上領域(Au)の位置を示す上領域情報として、上領域(Au)の左上の頂点の座標(x,y−K×H)と、右下の頂点の座標(x,y−1)とを算出する。なお、“H”は、線分候補に外接する外接矩形領域521の太さを表す。また、“K”は所定数を表す。 In step S702, the surrounding area specifying unit 326 determines, as upper area information indicating the position of the upper area (Au), the coordinates (x 1 , y 1 −K × H) of the upper left vertex of the upper area (Au) and the right The coordinates (x 2 , y 1 −1) of the lower vertex are calculated. “H” represents the thickness of the circumscribed rectangular area 521 circumscribing the line segment candidate. Also, "K" represents a predetermined number.

つまり、上領域(Au)は、線分候補に外接する外接矩形領域521の上側に隣接する矩形領域であって、線分候補に外接する外接矩形領域521と同じ幅(w)を有する。また、上領域(Au)は、線分候補に外接する外接矩形領域521の太さ(H)を基準として所定数(K)倍の高さ(K×H)を有する。   That is, the upper area (Au) is a rectangular area adjacent to the upper side of the circumscribed rectangular area 521 circumscribing the line segment candidate, and has the same width (w) as the circumscribed rectangular area 521 circumscribing the line segment candidate. The upper area (Au) has a height (K × H) times a predetermined number (K) times the thickness (H) of the circumscribed rectangular area 521 circumscribing the line segment candidate.

ステップS703において、周囲領域特定部326は、下領域(Ad)の位置を示す下領域情報として、下領域(Ad)の左上の頂点の座標(x,y+1)と、右下の頂点の座標(x,y+K×H)とを算出する。 In step S703, the surrounding area specifying unit 326, as the lower area information indicating the position of the lower region (Ad), and the upper left vertex coordinates (x 1, y 2 +1) below area (Ad), the lower right apex Coordinates of (x 2 , y 2 + K × H) are calculated.

つまり、下領域(Ad)は、線分候補に外接する外接矩形領域521の下側に隣接する矩形領域であって、線分候補に外接する外接矩形領域521と同じ幅(w)を有する。また、下領域(Ad)は、線分候補に外接する外接矩形領域521の太さ(H)を基準として所定数(K)倍の高さ(K×H)を有する。   That is, the lower area (Ad) is a rectangular area adjacent to the lower side of the circumscribed rectangular area 521 circumscribing the line segment candidate, and has the same width (w) as the circumscribed rectangular area 521 circumscribing the line segment candidate. The lower area (Ad) has a height (K × H) times a predetermined number (K) times the thickness (H) of the circumscribed rectangular area 521 circumscribing the line segment candidate.

図7(b)は、周囲領域情報として、左領域情報と右領域情報とを算出する左右領域情報算出処理のフローチャートを表している。図7(c)の具体例を参照しながら、図7(b)に示す左右領域情報算出処理について説明する。   FIG. 7B shows a flowchart of left / right area information calculation processing for calculating left area information and right area information as surrounding area information. The left and right area information calculation process shown in FIG. 7B will be described with reference to a specific example of FIG. 7C.

ステップS711において、周囲領域特定部326は、線分候補領域特定部323より線分候補領域情報を取得する。上述したとおり、線分候補領域情報には、線分候補に外接する外接矩形領域521の左上の頂点の座標(x,y)と、右下の頂点の座標(x,y)とが含まれているものとする(図7(c)参照)。 In step S711, the surrounding area identifying unit 326 acquires line segment candidate area information from the line segment candidate area identifying unit 323. As described above, in the line segment candidate area information, the coordinates (x 1 , y 1 ) of the upper left vertex of the circumscribed rectangular area 521 circumscribing the line segment candidate and the coordinates (x 2 , y 2 ) of the lower right vertex And are included (see FIG. 7 (c)).

ステップS712において、周囲領域特定部326は、文字サイズ算出部325より文字幅(Wc)を取得する。   In step S 712, the surrounding area specifying unit 326 acquires the character width (Wc) from the character size calculation unit 325.

ステップS713において、周囲領域特定部326は、左領域(Al)の位置を示す左領域情報として、左領域(Al)の左上の頂点の座標(x−Wc,y−K×H)と、右下の頂点の座標(x−1,y+K×H)とを算出する。 In step S 713, the surrounding area specifying unit 326 sets the coordinates (x 1 −Wc, y 1 −K × H) of the upper left vertex of the left area (Al) as the left area information indicating the position of the left area (Al). , Coordinates of the lower right vertex (x 1 −1, y 2 + K × H) are calculated.

つまり、左領域(Al)は、線分候補に外接する外接矩形領域521の左側に隣接する矩形領域であって、文字幅(Wc)と同じ幅(Wc)を有する。また、左領域(Al)は、線分候補に外接する外接矩形領域521の太さ(H)を基準として、(2K)倍したものに、線分候補に外接する外接矩形領域521の太さ(H)を加算した高さ(2×K×H+H)を有する。   That is, the left area (Al) is a rectangular area adjacent to the left side of the circumscribed rectangular area 521 circumscribing the line segment candidate, and has the same width (Wc) as the character width (Wc). The left area (Al) is the thickness of the circumscribed rectangular area 521 circumscribing the line segment candidate by (2K) times the thickness (H) of the circumscribed rectangular area 521 circumscribing the line segment candidate. It has a height (2 × K × H + H) obtained by adding (H).

ステップS714において、周囲領域特定部326は、右領域(Ar)の位置を示す右領域情報として、右領域(Ar)の左上の頂点の座標(x+1,y−K×H)と、右下の頂点の座標(x+Wc,y+K×H)とを算出する。 In step S714, the surrounding area specifying unit 326 sets the coordinates (x 2 + 1, y 1- K × H) of the upper left vertex of the right area (Ar) as right area information indicating the position of the right area (Ar), The coordinates (x 2 + Wc, y 2 + K × H) of the lower right vertex are calculated.

つまり、右領域(Ar)は、線分候補に外接する外接矩形領域521の右側に隣接する矩形領域であって、文字幅(Wc)と同じ幅(Wc)を有する。また、右領域(Ar)は、線分候補に外接する外接矩形領域521の太さ(H)を基準として、(2K)倍したものに、線分候補に外接する外接矩形領域521の太さ(H)を加算した高さ(2×K×H+H)を有する。   That is, the right area (Ar) is a rectangular area adjacent to the right side of the circumscribed rectangular area 521 circumscribing the line segment candidate, and has the same width (Wc) as the character width (Wc). The right area (Ar) is the thickness of the circumscribed rectangular area 521 circumscribing the line segment candidate by (2K) times the thickness (H) of the circumscribed rectangular area 521 circumscribing the line segment candidate. It has a height (2 × K × H + H) obtained by adding (H).

<ノイズ判定処理の詳細>
次に、ノイズ判定処理(図4のステップS408)の詳細について説明する。図8及び図9は、ノイズ判定処理の詳細を示す第1及び第2のフローチャートである。
<Details of noise determination processing>
Next, details of the noise determination process (step S408 in FIG. 4) will be described. 8 and 9 are first and second flowcharts showing the details of the noise determination process.

ステップS801において、ノイズ判定部327は、周囲領域特定部326より、周囲領域情報(上領域(Au)情報、下領域(Ad)情報、左領域(Al)情報、右領域(Ar)情報)を受信する。   In step S801, the noise determination unit 327 causes the surrounding area specifying unit 326 to output surrounding area information (upper area (Au) information, lower area (Ad) information, left area (Al) information, right area (Ar) information). To receive.

ステップS802において、ノイズ判定部327は、周囲領域の数をカウントするカウンタnに1を代入する。   In step S802, the noise determination unit 327 substitutes 1 into a counter n that counts the number of surrounding areas.

ステップS803において、ノイズ判定部327は、n番目の周囲領域に含まれる各画素の画素値を抽出する。ここでは、1番目の周囲領域として、2値化画像より、上領域(Au)に含まれる各画素の画素値を抽出する。   In step S803, the noise determination unit 327 extracts the pixel value of each pixel included in the n-th surrounding area. Here, the pixel value of each pixel included in the upper area (Au) is extracted from the binarized image as the first surrounding area.

ステップS804において、ノイズ判定部327は、抽出した画素値(g(x、y))の平均値mを下式に基づいて算出する。   In step S804, the noise determination unit 327 calculates an average value m of the extracted pixel values (g (x, y)) based on the following equation.

Figure 2019046377
Figure 2019046377

ステップS805において、ノイズ判定部327は、抽出した画素値(g(x、y))の分散値vを下式に基づいて算出する。   In step S805, the noise determination unit 327 calculates the variance v of the extracted pixel value (g (x, y)) based on the following equation.

Figure 2019046377
Figure 2019046377

ステップS806において、ノイズ判定部327は、カウンタnが4未満であるか否かを判定する。ステップS806において、カウンタnが4未満である場合(ステップS806においてYesの場合)には、ステップS807に進む。   In step S806, the noise determination unit 327 determines whether the counter n is less than four. In step S806, when the counter n is less than 4 (in the case of Yes in step S806), the process proceeds to step S807.

ステップS807において、ノイズ判定部327は、カウンタnをインクリメントし、ステップS803に戻る。   In step S807, the noise determination unit 327 increments the counter n, and returns to step S803.

一方、ステップS806において、カウンタnが4以上である場合(ステップS806においてNoの場合)には、ステップS808に進む。   On the other hand, when the counter n is 4 or more in step S806 (No in step S806), the process proceeds to step S808.

ステップS808において、ノイズ判定部327は、上領域内の画素値の分散値(vu)と、下領域内の画素値の分散値(vd)と、左領域内の画素値の分散値(vl)と、右領域内の画素値の分散値(vr)とを取得し、図9のステップS901に進む。   In step S808, the noise determination unit 327 determines the variance (vu) of pixel values in the upper area, the variance (vd) of pixel values in the lower area, and the variance (vl) of pixel values in the left area. And the dispersion value (vr) of the pixel values in the right area, and the process proceeds to step S901 in FIG.

ステップS901において、ノイズ判定部327は、周囲領域についての各分散値に基づいて、線分候補が線分であるのかノイズであるのかを判定するための指標値を算出する。具体的には、ノイズ判定部327は、周囲領域の幅と高さのうち、長さが長い方の値(Tとおく)を用いて、周囲領域についての各分散値を除算することで各分散値を正規化し、指標値(正規化分散値)を算出する(下式参照)。   In step S901, the noise determination unit 327 calculates an index value for determining whether the line segment candidate is a line segment or a noise, based on each variance value of the surrounding area. Specifically, the noise determination unit 327 divides each variance value for the surrounding area by using the longer value (T) of the width and the height of the surrounding area. The variance is normalized to calculate an index value (normalized variance) (see the following equation).

Figure 2019046377
Figure 2019046377

例えば、上領域(Au)の場合、高さ(K×H)より幅(w)の方が長いため、T=wとなり、指標値(Su)は、分散値(vu)/wとなる。同様に、下領域(Ad)の場合、指標値(Sd)は、分散値(vd)/wとなる。   For example, in the case of the upper region (Au), the width (w) is longer than the height (K × H), so T = w, and the index value (Su) becomes the variance value (vu) / w. Similarly, in the case of the lower area (Ad), the index value (Sd) is the variance value (vd) / w.

一方、左領域(Al)の場合、幅(Wc)より高さ(2×K×H+H)の方が長いため、T=(2×K×H+H)となり、指標値(Sl)は、分散値(vl)/(2×K×H+H)となる。同様に、右領域(Ar)の場合、指標値(Sr)は、分散値(vr)/(2×K×H+H)となる。   On the other hand, in the case of the left region (Al), since the height (2 × K × H + H) is longer than the width (Wc), T = (2 × K × H + H), and the index value (Sl) is the dispersion value It becomes (vl) / (2 × K × H + H). Similarly, in the case of the right area (Ar), the index value (Sr) is the variance value (vr) / (2 × K × H + H).

なお、本実施形態では、指標値として正規化分散値を用いる例を示したが、正規化分散値以外の指標値を用いてもよい。例えば、ノイズ判定部327は、それぞれの周囲領域内で各画素の勾配値(勾配の強さ)を求め、周囲領域内の勾配値の平均値を、指標値として用いてもよい。ここで、各画素の勾配値は、例えば、1つの画素とその周囲にある8画素との間の差分値を求め、その最大値と定義してもよい。   In the present embodiment, an example in which the normalized dispersion value is used as the index value is shown, but an index value other than the normalized dispersion value may be used. For example, the noise determination unit 327 may calculate the gradient value (gradient strength) of each pixel in each surrounding area, and use the average value of the gradient values in the surrounding area as an index value. Here, for example, the gradient value of each pixel may be defined as the maximum value by obtaining a difference value between one pixel and eight pixels around it.

あるいは、ノイズ判定部327は、例えば、線分候補領域の平均の画素値を求め、各周囲領域で、線分候補領域の平均の画素値に対して所定の閾値以内の画素値となる、類似している画素を特定して、その画素数を求め、その画素数をそれぞれの周囲領域の画素数で割った平均値を、指標値として用いてもよい。   Alternatively, for example, the noise determination unit 327 obtains an average pixel value of the line segment candidate area, and in each surrounding area, a pixel value within a predetermined threshold with respect to the average pixel value of the line segment candidate area The specified pixel may be specified, the number of pixels may be determined, and the average value obtained by dividing the number of pixels by the number of pixels of each surrounding area may be used as the index value.

ステップS902において、ノイズ判定部327は、算出した指標値(Su、Sd、l、Sr)に基づいて、線分候補が線分であるのかノイズであるのかを判定する。具体的には、ノイズ判定部327は、指標値についての下記の条件が成立するか否かを判定する。
・Su<Th、かつ、Sd<Th
・Sl<Th、かつ、Sr<Th
ただし、Th、Thは所定の閾値である。
In step S902, the noise determination unit 327 determines whether the line segment candidate is a line segment or a noise based on the calculated index values (Su, Sd, l, Sr). Specifically, the noise determination unit 327 determines whether the following conditions for the index value are satisfied.
Su <Th 1 and Sd <Th 1
Sl <Th 2 and Sr <Th 2
However, Th 1 and Th 2 are predetermined threshold values.

ステップS902において上記条件が成立すると判定した場合には(ステップS902においてYesの場合には)、ステップS903に進む。ステップS902において、ノイズ判定部327は、処理対象の線分候補が、線分であると判定する。つまり、周囲領域に分布している黒画素が少なく、正規化分散値が小さい場合には、処理対象の線分候補が、線分であると判定する。   If it is determined in step S902 that the above condition is satisfied (in the case of Yes in step S902), the process proceeds to step S903. In step S902, the noise determination unit 327 determines that the line segment candidate to be processed is a line segment. That is, when there are few black pixels distributed in the surrounding area and the normalized dispersion value is small, it is determined that the line segment candidate to be processed is a line segment.

ステップS904において、ノイズ判定部327は、線分であると判定した線分候補についての線分候補領域情報を、線分情報として、帳票識別部123に出力する。   In step S904, the noise determination unit 327 outputs line segment candidate area information on the line segment candidate determined to be a line segment to the form identification unit 123 as line segment information.

一方、ステップS902において上記条件が成立しないと判定した場合には(ステップS902においてNoの場合には)、ステップS905に進む。ステップS905において、ノイズ判定部327は、処理対象の線分候補が、ノイズであると判定する。つまり、周囲領域に分布している黒画素が多く、正規化分散値が大きい場合には、処理対象の線分候補が、線分ではない(ノイズである)と判定する。   On the other hand, when it is determined in step S902 that the above condition is not satisfied (in the case of No in step S902), the process proceeds to step S905. In step S905, the noise determination unit 327 determines that the line segment candidate to be processed is noise. That is, when there are many black pixels distributed in the surrounding area and the normalized dispersion value is large, it is determined that the line segment candidate to be processed is not a line segment (is a noise).

<線分抽出処理の効果>
次に、線分抽出処理(図4)の効果について説明する。図10は、線分抽出処理の効果を説明するための図である。
<Effect of line segment extraction processing>
Next, the effect of the line segment extraction process (FIG. 4) will be described. FIG. 10 is a diagram for explaining the effect of the line segment extraction process.

図10(a)は、文字列の一部が黒ラン画像として抽出され、線分候補に外接する外接矩形領域1001が特定された様子を示している。このような場合でも、線分抽出処理(図4)によれば、上領域(Au)の分散値(vu)が大きくなる。このため、指標値(Su)<Thが成立せず、ノイズ判定部327は、当該線分候補をノイズと判定する。つまり、線分抽出処理(図4)によれば、誤抽出を低減させることができる。 FIG. 10A shows that a part of the character string is extracted as a black run image, and a circumscribed rectangular area 1001 circumscribing the line segment candidate is identified. Even in such a case, according to the line segment extraction process (FIG. 4), the dispersion value (vu) of the upper area (Au) becomes large. For this reason, index value (Su) <Th 1 is not satisfied, and the noise determination unit 327 determines the line segment candidate as noise. That is, according to the line segment extraction process (FIG. 4), erroneous extraction can be reduced.

図10(b)は、文字列の一部が黒ラン画像として抽出され、線分候補に外接する外接矩形領域1002が特定された様子を示している。このような場合でも、線分抽出処理(図4)によれば、左領域(Al)の分散値(vl)と右領域(Ar)の分散値(vr)が大きくなる。このため、指標値(Sl)<Th及び指標値(Sr)<Thが成立せず、ノイズ判定部327では、当該線分候補をノイズと判定する。つまり、線分抽出処理(図4)によれば、誤抽出を低減させることができる。 FIG. 10B shows that a part of the character string is extracted as a black run image, and a circumscribed rectangular area 1002 circumscribing the line segment candidate is identified. Even in such a case, according to the line segment extraction process (FIG. 4), the variance (vl) of the left area (Al) and the variance (vr) of the right area (Ar) become large. Thus determined, without the index value (Sl) <Th 2, and the index value (Sr) <Th 2 is satisfied, the noise determination unit 327, the line segment candidate and noise. That is, according to the line segment extraction process (FIG. 4), erroneous extraction can be reduced.

図10(c)は、線分が黒ラン画像として抽出され、線分候補に外接する外接矩形領域1003が特定された様子を示している。図10(c)の場合、上領域(Au)において文字列が重なっているため、上領域(Au)の分散値(vu)は大きくなる。   FIG. 10C shows that a line segment is extracted as a black run image, and a circumscribed rectangular area 1003 circumscribing the line segment candidate is identified. In the case of FIG. 10C, since the character strings overlap in the upper area (Au), the dispersion value (vu) of the upper area (Au) is large.

しかしながら、文字列が重なっているのは、線分の一部にすぎないため、指標値(Su)=vu/(2×K×H+H)を算出した場合、指標値(Su)は所定の閾値Thよりも小さくなる。この結果、ノイズ判定部327では、当該線分候補を線分と判定する。つまり、線分抽出処理(図4)によれば、線分の抽出漏れを防ぐことができる。 However, since it is only a part of the line segment that the character strings overlap, when the index value (Su) = vu / (2 × K × H + H) is calculated, the index value (Su) is a predetermined threshold. It becomes smaller than Th 1 . As a result, the noise determination unit 327 determines that the line segment candidate is a line segment. That is, according to the line segment extraction process (FIG. 4), it is possible to prevent the extraction omission of the line segment.

以上の説明から明らかなように、第1の実施形態における画像処理装置は、帳票画像から線分候補を抽出し、抽出した線分候補について、周囲領域を特定する。そして、第1の実施形態における画像処理装置は、特定した周囲領域に含まれる各画素の正規化分散値が、所定の値より小さいか否かに応じて、抽出した線分候補が線分であるのかノイズであるのかを判定する。   As is clear from the above description, the image processing apparatus according to the first embodiment extracts line segment candidates from the form image, and specifies surrounding regions of the extracted line segment candidates. Then, in the image processing apparatus according to the first embodiment, the extracted line segment candidate is a line segment depending on whether the normalized dispersion value of each pixel included in the specified surrounding area is smaller than a predetermined value. Determine if there is a noise.

これにより、第1の実施形態における画像処理装置によれば、帳票画像から線分を抽出する際の誤抽出を低減させることができる。   Thus, according to the image processing apparatus in the first embodiment, it is possible to reduce erroneous extraction when extracting line segments from a form image.

[第2の実施形態]
上記第1の実施形態では、横方向の線分候補についての線分候補抽出処理、上下領域情報算出処理、左右領域情報算出処理を説明したが、縦方向の線分候補についても同様である。
Second Embodiment
In the first embodiment, the line segment candidate extraction process, the upper and lower area information calculation process, and the left and right area information calculation process for line segment candidates in the horizontal direction have been described, but the same applies to the line segment candidates in the vertical direction.

例えば、縦方向の線分候補の場合、画像に含まれる文字の高さを基準として、上領域及び下領域を特定する。縦方向の線分候補の場合、横方向の線分候補についての左右領域情報算出処理において、幅を高さと読み替え、高さを幅と読み替え、左領域を上領域と読み替え、右領域を下領域と読み替えることにより、上下領域情報算出処理を実行することができる。   For example, in the case of a line segment candidate in the vertical direction, the upper area and the lower area are specified based on the height of characters included in the image. In the case of the line segment candidate in the vertical direction, in the left and right area information calculation processing for the line segment candidate in the horizontal direction, the width is read as height, the height is read as width, the left area is read as upper area, and the right area is lower area. The upper and lower area information calculation process can be executed by replacing the above.

同様に、縦方向の線分候補の場合、線分の太さを基準として、左領域及び右領域を特定する。縦方向の線分候補の場合、横方向の線分候補についての上下領域情報算出処理において、幅を高さと読み替え、高さを幅と読み替え、上領域を左領域と読み替え、下領域を右領域と読み替えることにより、左右領域情報算出処理を実行することができる。   Similarly, in the case of a line segment candidate in the vertical direction, the left area and the right area are specified based on the thickness of the line segment. In the case of the line segment candidate in the vertical direction, in the upper and lower area information calculation processing for the line segment candidate in the horizontal direction, the width is read as height, the height is read as width, the upper area is read as the left area, and the lower area is the right area By replacing with, it is possible to execute the left and right area information calculation processing.

また、上記第1の実施形態において説明した周囲領域(上領域、下領域、左領域、右領域)それぞれの幅及び高さの算出方法は一例にすぎず、他の算出方法により幅及び高さを算出してもよい。   In addition, the method of calculating the width and height of each of the surrounding regions (upper region, lower region, left region, right region) described in the first embodiment is merely an example, and the width and height may be calculated by another calculation method. May be calculated.

また、上記第1の実施形態では、指標値(正規化分散値)を算出するにあたり、2値化画像を用いるものとして説明したが、2値化画像に代えて帳票画像を用いてもよい。   Further, in the first embodiment, it has been described that the binarized image is used to calculate the index value (normalized variance value). However, the form image may be used instead of the binarized image.

また、上記第1の実施形態では、文字サイズ算出処理の際、2値化画像全体から文字幅(及び文字高さ)を算出するものとして説明した。しかしながら、2値化画像を複数の領域に分け、それぞれの領域において文字幅(及び文字高さ)を算出するようにしてもよい。   In the first embodiment, the character width (and the character height) is calculated from the entire binarized image in the character size calculation process. However, the binarized image may be divided into a plurality of regions, and the character width (and character height) may be calculated in each of the regions.

また、上記第1の実施形態では、画像処理装置120を、読取装置110とは別体として設けるものとして説明した。しかしながら、画像処理装置120の各部(前処理部121、線分抽出部122、帳票識別部123、文字認識部124)の全部または一部は、読取装置110において実現されてもよい。   In the first embodiment, the image processing apparatus 120 has been described as being provided separately from the reading apparatus 110. However, all or part of each unit (the pre-processing unit 121, the line segment extraction unit 122, the form identification unit 123, and the character recognition unit 124) of the image processing apparatus 120 may be realized by the reading device 110.

また、上記第1の実施形態では、読取装置110として、スキャナ等の画像形成装置を例示したが、例えば、読取装置110として、MFP(Multi-Function Peripheral)等の画像形成装置を用いてもよい。   In the first embodiment, an image forming apparatus such as a scanner is exemplified as the reading apparatus 110. However, for example, an image forming apparatus such as an MFP (Multi-Function Peripheral) may be used as the reading apparatus 110. .

なお、開示の技術では、以下に記載する付記のような形態が考えられる。
(付記1)
画像から線分の候補領域を抽出し、
前記線分の候補領域の周囲となる周囲領域を特定し、
前記周囲領域の特徴量から算出される指標値に基づいて、前記線分の候補領域が線分か否かを判定する、
処理をコンピュータに実行させる線分抽出プログラム。
(付記2)
前記線分の候補領域の上下方向と左右方向の独立した領域を、前記周囲領域として特定することを特徴とする付記1に記載の線分抽出プログラム。
(付記3)
前記画像に含まれる文字の幅を特定し、
前記文字の幅を基準として、前記周囲領域の左右方向の大きさを決定することを特徴とする付記1または2に記載の線分抽出プログラム。
(付記4)
前記画像における線分の太さを特定し、
前記線分の太さを基準として、前記周囲領域の上下方向の大きさを決定することを特徴とする付記3に記載の線分抽出プログラム。
(付記5)
前記画像に含まれる文字の高さを特定し、
前記文字の高さを基準として、前記周囲領域の上下方向の大きさを決定することを特徴とする付記1または2に記載の線分抽出プログラム。
(付記6)
前記画像における線分の太さを特定し、
前記線分の太さを基準として、前記周囲領域の左右方向の大きさを決定することを特徴とする付記5に記載の線分抽出プログラム。
(付記7)
画像から線分の候補領域を抽出する抽出部と、
前記線分の候補領域の周囲となる周囲領域を特定する特定部と、
前記周囲領域の特徴量から算出される指標値に基づいて、前記線分の候補領域が線分か否かを判定する判定部と
を有することを特徴とする画像処理装置。
(付記8)
画像から線分の候補領域を抽出し、
前記線分の候補領域の周囲となる周囲領域を特定し、
前記周囲領域の特徴量から算出される指標値に基づいて、前記線分の候補領域が線分か否かを判定する、
処理をコンピュータが実行する線分抽出方法。
In addition, in the disclosed technology, a form such as that described below can be considered.
(Supplementary Note 1)
Extract line segment candidate regions from the image,
Identifying a surrounding area around the candidate area of the line segment;
It is determined whether the candidate area of the line segment is a line segment based on an index value calculated from the feature amount of the surrounding area.
A line segment extraction program that causes a computer to execute processing.
(Supplementary Note 2)
The line segment extraction program according to Additional Note 1, wherein an independent area in the vertical direction and the left and right direction of the candidate area of the line segment is specified as the surrounding area.
(Supplementary Note 3)
Identify the width of the characters contained in the image,
The line segment extraction program according to claim 1 or 2, characterized in that the size in the left-right direction of the surrounding area is determined based on the width of the character.
(Supplementary Note 4)
Identify the thickness of the line segment in the image,
The line segment extraction program according to Additional Note 3, wherein the vertical size of the surrounding area is determined based on the thickness of the line segment.
(Supplementary Note 5)
Identify the height of the characters contained in the image,
The line segment extraction program according to any one of Appendices 1 or 2, wherein the vertical size of the surrounding area is determined based on the height of the character.
(Supplementary Note 6)
Identify the thickness of the line segment in the image,
The line segment extraction program according to Additional Note 5, wherein the size of the surrounding area in the lateral direction is determined based on the thickness of the line segment.
(Appendix 7)
An extraction unit for extracting line segment candidate regions from the image;
A specification unit that specifies a surrounding area around the candidate area of the line segment;
A determination unit that determines whether the candidate region of the line segment is a line segment based on an index value calculated from the feature amount of the surrounding region.
(Supplementary Note 8)
Extract line segment candidate regions from the image,
Identifying a surrounding area around the candidate area of the line segment;
It is determined whether the candidate area of the line segment is a line segment based on an index value calculated from the feature amount of the surrounding area.
A line segment extraction method in which a computer executes processing.

なお、上記実施形態に挙げた構成等に、その他の要素との組み合わせ等、ここで示した構成に本発明が限定されるものではない。これらの点に関しては、本発明の趣旨を逸脱しない範囲で変更することが可能であり、その応用形態に応じて適切に定めることができる。   Note that the present invention is not limited to the configurations shown here, such as combinations with other elements in the configurations and the like described in the above embodiments. These points can be modified without departing from the spirit of the present invention, and can be appropriately determined according to the application form.

100 :帳票画像処理システム
110 :読取装置
120 :画像処理装置
121 :前処理部
122 :線分抽出部
123 :帳票識別部
124 :文字認識部
321 :2値化画像取得部
322 :黒ラン画像抽出部
323 :線分候補領域特定部
324 :文字領域画像抽出部
325 :文字サイズ算出部
326 :周囲領域特定部
327 :ノイズ判定部
601、602 :線分
611、612 :外接矩形領域
621、622 :外接矩形領域
631〜636 :外接矩形領域
100: form image processing system 110: reading device 120: image processing device 121: pre-processing unit 122: line segment extraction unit 123: form identification unit 124: character recognition unit 321: binarized image acquisition unit 322: black run image extraction Section 323: Line segment candidate area specification section 324: Character area image extraction section 325: Character size calculation section 326: Surrounding area specification section 327: Noise determination section 601, 602: Line segment 611, 612: circumscribed rectangular area 621, 622: Circumscribed rectangular area 631 to 636: circumscribed rectangular area

Claims (6)

画像から線分の候補領域を抽出し、
前記線分の候補領域の周囲となる周囲領域を特定し、
前記周囲領域の特徴量から算出される指標値に基づいて、前記線分の候補領域が線分か否かを判定する、
処理をコンピュータに実行させる線分抽出プログラム。
Extract line segment candidate regions from the image,
Identifying a surrounding area around the candidate area of the line segment;
It is determined whether the candidate area of the line segment is a line segment based on an index value calculated from the feature amount of the surrounding area.
A line segment extraction program that causes a computer to execute processing.
前記線分の候補領域の上下方向と左右方向の独立した領域を、前記周囲領域として特定することを特徴とする請求項1に記載の線分抽出プログラム。   The line segment extraction program according to claim 1, wherein an independent area in the vertical direction and the left and right direction of the candidate area of the line segment is specified as the surrounding area. 前記画像に含まれる文字の幅を特定し、
前記文字の幅を基準として、前記周囲領域の左右方向の大きさを決定することを特徴とする請求項1または2に記載の線分抽出プログラム。
Identify the width of the characters contained in the image,
3. The line segment extraction program according to claim 1, wherein the size of the surrounding area in the left-right direction is determined based on the width of the character.
前記画像における線分の太さを特定し、
前記線分の太さを基準として、前記周囲領域の上下方向の大きさを決定することを特徴とする請求項3に記載の線分抽出プログラム。
Identify the thickness of the line segment in the image,
4. The line segment extraction program according to claim 3, wherein the vertical size of the surrounding area is determined based on the thickness of the line segment.
画像から線分の候補領域を抽出する抽出部と、
前記線分の候補領域の周囲となる周囲領域を特定する特定部と、
前記周囲領域の特徴量から算出される指標値に基づいて、前記線分の候補領域が線分か否かを判定する判定部と
を有することを特徴とする画像処理装置。
An extraction unit for extracting line segment candidate regions from the image;
A specification unit that specifies a surrounding area around the candidate area of the line segment;
A determination unit that determines whether the candidate region of the line segment is a line segment based on an index value calculated from the feature amount of the surrounding region.
画像から線分の候補領域を抽出し、
前記線分の候補領域の周囲となる周囲領域を特定し、
前記周囲領域の特徴量から算出される指標値に基づいて、前記線分の候補領域が線分か否かを判定する、
処理をコンピュータが実行する線分抽出方法。
Extract line segment candidate regions from the image,
Identifying a surrounding area around the candidate area of the line segment;
It is determined whether the candidate area of the line segment is a line segment based on an index value calculated from the feature amount of the surrounding area.
A line segment extraction method in which a computer executes processing.
JP2017171465A 2017-09-06 2017-09-06 Line segment extraction program, image processing device and line segment extraction method Pending JP2019046377A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017171465A JP2019046377A (en) 2017-09-06 2017-09-06 Line segment extraction program, image processing device and line segment extraction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017171465A JP2019046377A (en) 2017-09-06 2017-09-06 Line segment extraction program, image processing device and line segment extraction method

Publications (1)

Publication Number Publication Date
JP2019046377A true JP2019046377A (en) 2019-03-22

Family

ID=65814388

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017171465A Pending JP2019046377A (en) 2017-09-06 2017-09-06 Line segment extraction program, image processing device and line segment extraction method

Country Status (1)

Country Link
JP (1) JP2019046377A (en)

Similar Documents

Publication Publication Date Title
US9430704B2 (en) Image processing system with layout analysis and method of operation thereof
JP4310288B2 (en) Image processing apparatus and method, program, and storage medium
JP4877374B2 (en) Image processing apparatus and program
JP2017041228A (en) Lane detection
EP2908267B1 (en) Image processing device and image processing method
JP5934174B2 (en) Method and program for authenticating a printed document
JP2003058879A (en) Method and device for processing image
US20150228045A1 (en) Methods for embedding and extracting a watermark in a text document and devices thereof
US8194941B2 (en) Character noise eliminating apparatus, character noise eliminating method, and character noise eliminating program
US20180068200A1 (en) Medium storing image processing program, image processing method, and image processing device
RU2581786C1 (en) Determination of image transformations to increase quality of optical character recognition
JP2016162420A (en) Attention area detection device, attention area detection method and program
JP2013235581A (en) Image processing method and device
JP2019016350A (en) Identification of emphasized text in electronic documents
JP6255944B2 (en) Image analysis apparatus, image analysis method, and image analysis program
JP2011087144A (en) Telop character area detection method, telop character area detection device, and telop character area detection program
CN111027545A (en) Card picture mark detection method and device, computer equipment and storage medium
JP2006252562A (en) Image recognition method
JP2019046377A (en) Line segment extraction program, image processing device and line segment extraction method
JP2017134598A (en) Image retrieval device, image retrieval method, and program
JP5005633B2 (en) Image search apparatus, image search method, information processing program, and recording medium
CN111670458A (en) Reading system
JP6922690B2 (en) Character area extraction program, character area extraction device and character area extraction method
JP5277750B2 (en) Image processing program, image processing apparatus, and image processing system
JP4381445B2 (en) Image characteristic determination processing apparatus, image characteristic determination processing method, program for executing the method, and computer-readable storage medium storing the program