JP5887242B2 - Image processing apparatus, image processing method, and program - Google Patents

Image processing apparatus, image processing method, and program Download PDF

Info

Publication number
JP5887242B2
JP5887242B2 JP2012215486A JP2012215486A JP5887242B2 JP 5887242 B2 JP5887242 B2 JP 5887242B2 JP 2012215486 A JP2012215486 A JP 2012215486A JP 2012215486 A JP2012215486 A JP 2012215486A JP 5887242 B2 JP5887242 B2 JP 5887242B2
Authority
JP
Japan
Prior art keywords
color
image
colors
separation
background
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
JP2012215486A
Other languages
Japanese (ja)
Other versions
JP2014071556A (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.)
Hitachi Omron Terminal Solutions Corp
Original Assignee
Hitachi Omron Terminal Solutions Corp
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 Hitachi Omron Terminal Solutions Corp filed Critical Hitachi Omron Terminal Solutions Corp
Priority to JP2012215486A priority Critical patent/JP5887242B2/en
Publication of JP2014071556A publication Critical patent/JP2014071556A/en
Application granted granted Critical
Publication of JP5887242B2 publication Critical patent/JP5887242B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、OCR(Optical Character Reader:光学式文字読取装置)等の画像の処理技術に関し、特に文字と背景が同形色でコントラストが低い場合でも、文字と背景を分離する2値化技術に関する。   The present invention relates to an image processing technique such as an OCR (Optical Character Reader), and more particularly to a binarization technique that separates a character and a background even when the character and the background have the same color and low contrast.

カラー画像から2値画像を生成する2値化処理は、OCRの前処理として基本的な処理である。OCRの主要な読取り対象である帳票には、プレ印刷と呼ばれる予め印刷された罫線や文字がある。プレ印刷が読取対象の文字と近接している場合には文字認識の障害となることがある。したがって、従来の帳票OCRにおける2値化処理では、記載文字を黒に(黒化)、プレ印刷と背景を白に(白化)する2値化が一般的である。濃淡画像を入力とする2値化処理の従来技術としては、大津法やNiblack法などを用いて輝度値の2値化閾値を求める手法が知られている。   A binarization process for generating a binary image from a color image is a basic process as a pre-process of OCR. Forms that are the main reading targets of OCR include preprinted ruled lines and characters called pre-printing. When pre-printing is close to a character to be read, character recognition may be an obstacle. Therefore, in the binarization processing in the conventional form OCR, binarization is generally performed in which the written characters are black (blackening) and the pre-printing and the background are white (whitening). As a conventional technique for binarization processing using a grayscale image as an input, a technique for obtaining a binarization threshold value of a luminance value using the Otsu method, Niblack method, or the like is known.

カラー画像を入力とする2値化処理の従来技術として、特許文献1には、カラー画像を撮像し、RBG(赤青緑)の3色のうち、プレ印刷などの記載文字以外の画素の輝度が最も高くなる色を選択した後、その色における画素の濃淡値から閾値を決めて2値化する方式が記載されている。特許文献2には、文字色を推定した後、文字色のみを抽出することで文字色とプレ印刷色を分離する方式が記載されている。特許文献3には、レイアウト解析処理を用いて2値化対象の領域を限定し、その領域内のプレ印刷等の位置が定義された書式情報を参照して背景と罫線の色を抽出することにより、プレ印刷や背景と文字を分離する2値化方式が記載されている。   As a prior art of binarization processing using a color image as input, Patent Document 1 discloses a luminance of pixels other than written characters such as pre-printing among three colors of RBG (red, blue, and green) that are captured by a color image. Describes a method of selecting a color with the highest value and then binarizing it by determining a threshold value from the gray value of the pixel in that color. Patent Document 2 describes a method of separating a character color and a pre-print color by extracting only the character color after estimating the character color. Japanese Patent Application Laid-Open No. 2004-133830 defines a binarization target region using layout analysis processing, and extracts background and ruled line colors with reference to format information in which a pre-printing position or the like is defined in the region. Describes a binarization method for separating pre-printing and background and characters.

一方、2値化の後段の処理にあたる帳票認識の技術においては、認識対象の文字の属性(例:金額、日付、氏名)を特定することと、記載文字を高精度に認識することが課題である。従来では、特許文献3に記載されているように、文字の位置や属性が事前に定義された帳票の書式情報を用いて認識対象の文字領域を切り出して認識することが一般的である。これに対し、特許文献4には、帳票全面の文字を認識し、互いに隣接する項目名(例:金額)とデータ(例:10000円)のペアを抽出することにより、事前定義の書式情報なしで記載文字の属性を認識する技術が記載されている。   On the other hand, in the form recognition technology, which is the latter process of binarization, it is a problem to specify the attributes of characters to be recognized (eg, amount, date, name) and recognize the written characters with high accuracy. is there. Conventionally, as described in Patent Document 3, it is common to cut out and recognize a character area to be recognized using format information of a form in which character positions and attributes are defined in advance. On the other hand, in Patent Document 4, there is no predefined format information by recognizing characters on the entire form and extracting pairs of item names (for example, money) and data (for example, 10,000 yen) adjacent to each other. Describes the technology for recognizing the attributes of written characters.

特開2003−196592号公報JP 2003-196292 A 特開2010−244372号公報JP 2010-244372 A 特開2005−258683号公報JP 2005-258683 A 特開2011−248609号公報JP 2011-248609 A

特許文献4の技術では、項目名を認識する必要があるため、プレ印刷の文字を認識しなければならない。したがって、記載文字に加えて、プレ印刷文字も正しく黒化する必要がある。しかし、一般的な帳票上のプレ印刷文字は、背景色と同系色かつ濃淡差や色差が小さい色で印刷されていることが多い。これは、2値化処理で背景色と同時に白化することを目的としているためである。したがって、特許文献1から3の方式の2値化処理ではプレ印刷文字を正しく黒化することは困難である。   In the technique of Patent Document 4, since it is necessary to recognize an item name, it is necessary to recognize a pre-printed character. Therefore, in addition to the written characters, the preprinted characters need to be blackened correctly. However, pre-printed characters on general forms are often printed in a color similar to the background color and with small shade differences and color differences. This is because the purpose is to whiten simultaneously with the background color in the binarization process. Therefore, it is difficult to correctly blacken the preprinted characters by the binarization processing of the methods of Patent Documents 1 to 3.

特許文献4の帳票認識技術の読取り対象の例として、振込伝票を用いてプレ印刷の2値化の課題を説明する。振込伝票にはプレ印刷罫線やプレ印刷文字等があり、活字文字や手書き文字が記載されている。記載文字やプレ印刷、および紙の地色(背景色)は伝票の種類ごとに異なっている。このような帳票では、通常の2値化手法で適切な2値画像を得ることは困難である。具体的には、色の薄い文字やプレ印刷を黒化するために2値化の閾値を下げると、濃い背景色の帳票では文字部分と背景の両方が黒になる。一方、濃い背景色を白化するために閾値を上げると、薄い文字やプレ印刷も白化されてしまう。さらに、文字や背景の濃淡値が異なる複数の帳票が混在している場合は、さらに困難となる。   As an example of an object to be read by the form recognition technique of Patent Document 4, a problem of binarization of pre-printing will be described using a transfer slip. The transfer slip includes pre-printed ruled lines, pre-printed characters, and the like, and printed characters and handwritten characters are described. The written characters, pre-printing, and paper background color (background color) are different for each type of slip. With such a form, it is difficult to obtain an appropriate binary image by a normal binarization method. Specifically, if the threshold value for binarization is lowered in order to blacken a light-colored character or preprint, both the character portion and the background become black in a dark background color form. On the other hand, if the threshold is increased to whiten a dark background color, light characters and preprints are also whitened. Furthermore, it becomes more difficult when a plurality of forms having different shade values of characters and backgrounds are mixed.

特許文献1に記載の方法では、文字とプレ印刷が異なる色であることを前提としているため、文字とプレ印刷が同系色の場合には、プレ印刷が白化されてしまう。特許文献2に記載の方法では、推定した文字色以外を白化するため、プレ印刷が白化されてしまう。特許文献3に記載の方法では、あらかじめ定義された帳票の書式情報が必要であるため、多様な帳票が混在している場合には対応できない。   In the method described in Patent Document 1, it is assumed that characters and pre-printing are different colors. Therefore, when characters and pre-printing are similar colors, pre-printing is whitened. In the method described in Patent Document 2, since the color other than the estimated character color is whitened, pre-printing is whitened. The method described in Patent Document 3 requires pre-defined form format information, and therefore cannot cope with a mixture of various forms.

上述したような従来技術における問題点に鑑み、本発明の目的は、記載文字やプレ印刷と背景色の濃淡差の大小にかかわらず、文字やプレ印刷を正しく黒化すること、さらに、適切に2値化して文字認識することにある。   In view of the problems in the prior art as described above, the object of the present invention is to properly blacken characters and preprints regardless of the size of the written characters and preprints and the contrast of the background color. It is to binarize and recognize characters.

前記課題を解決するために、本発明は、スキャナで撮像して得られたカラー画像から2値画像を生成する画像処理装置であって、前記カラー画像、および、2値画像を生成するための所定の判定基準を記憶する記憶部と、前記カラー画像のレイアウトを解析し、前記レイアウト解析の結果を用いて、色クラスタリングにより背景色とプレ印刷色と文字色の代表色を求め、文字色と背景色の分離基準と、プレ印刷色と背景色の分離基準と、文字色とプレ印刷色の分離基準を算出し、前記カラー画像における各画素の色情報とレイアウト情報に基づいて、前期色分離基準を切り替えて2値化処理を行い、前記2値化を行った画素値を前記記憶部に格納する画像処理部と、を備えることを特徴とする。   In order to solve the above problems, the present invention is an image processing apparatus that generates a binary image from a color image obtained by imaging with a scanner, and for generating the color image and the binary image. Analyzing the layout of the color image, a storage unit that stores predetermined determination criteria, and using the result of the layout analysis, a representative color of a background color, a preprint color, and a character color is obtained by color clustering, and a character color and Calculate the background color separation standard, the pre-print color and background color separation standard, the character color and the pre-print color separation standard, and the previous color separation based on the color information and layout information of each pixel in the color image An image processing unit that performs binarization processing by switching a reference and stores the binarized pixel value in the storage unit.

本発明における2値化では、記載文字とプレ印刷、および背景色の濃淡差の大小にかかわらず、正しく記載文字やプレ印刷を抽出することができる。この結果、記載文字とプレ印刷文字の両方を高精度に認識することができる。   In the binarization according to the present invention, it is possible to correctly extract written characters and pre-prints regardless of the size of the written characters and pre-prints, and the contrast of the background color. As a result, both written characters and pre-printed characters can be recognized with high accuracy.

第1実施形態の画像処理装置の構成図である。It is a block diagram of the image processing apparatus of 1st Embodiment. 入力対象の帳票画像の例である。It is an example of a form image to be input. 本発明が目的とする2値画像の例である。2 is an example of a binary image targeted by the present invention. 従来技術による2値画像の例を示す図である。It is a figure which shows the example of the binary image by a prior art. 従来技術による2値画像の例を示す図である。It is a figure which shows the example of the binary image by a prior art. 本発明の実施形態の2値化処理の概略を示す図である。It is a figure which shows the outline of the binarization process of embodiment of this invention. 本発明の実施形態のレイアウト解析処理の概略を示す図である。It is a figure which shows the outline of the layout analysis process of embodiment of this invention. 色クラスタリングの例を示す図である。It is a figure which shows the example of a color clustering. HSV色空間の概略を示す図である。It is a figure which shows the outline of HSV color space. 入力画像と本発明による2値画像の例を示す図である。It is a figure which shows the example of the input image and the binary image by this invention. 本発明の第2実施形態の2値化処理の概略を示す図である。It is a figure which shows the outline of the binarization process of 2nd Embodiment of this invention. 図2の入力画像から背景色を検出した例を示す図である。FIG. 3 is a diagram showing an example in which a background color is detected from the input image of FIG. 本発明の第3実施形態の2値化処理の概略を示す図である。It is a figure which shows the outline of the binarization process of 3rd Embodiment of this invention. 本発明の第4実施形態の2値化処理の概略を示す図である。It is a figure which shows the outline of the binarization process of 4th Embodiment of this invention. 本発明の第5実施形態の2値化処理の概略を示す図である。It is a figure which shows the outline of the binarization process of 5th Embodiment of this invention. 本発明の第6実施形態の2値化処理の概略を示す図である。It is a figure which shows the outline of the binarization process of 6th Embodiment of this invention. 背景色の輝度と分離基準の関係を示す図である。It is a figure which shows the relationship between the brightness | luminance of a background color, and a separation standard. 本発明の第6実施形態における、分離基準を切り替えて2値化する処理の概略を示す図である。It is a figure which shows the outline of the process which switches and separates a separation reference | standard in 6th Embodiment of this invention. 本発明の第6実施形態における、画素のクラス分けの概略を示す図である。It is a figure which shows the outline of pixel classification in 6th Embodiment of this invention. 本発明の第6実施形態における、クラス分け結果に基づく再2値化処理の概略を示す図である。It is a figure which shows the outline of the rebinarization process based on the classification result in 6th Embodiment of this invention. 記載文字を黒化する再2値化の例を示す図である。It is a figure which shows the example of the rebinarization which blackens a description character. プレ印刷を黒化する再2値化の例を示す図である。It is a figure which shows the example of the rebinarization which blackens preprinting. ノイズを白化する再2値化の例を示す図である。It is a figure which shows the example of the rebinarization which whitens noise. 2値化と文字認識をする画像処理装置の構成図である。It is a block diagram of the image processing apparatus which performs binarization and character recognition. 営業店窓口端末の構成図である。It is a block diagram of a sales office window terminal.

以下、図面を参照(言及図以外の図面も適宜参照)して、本発明を実施するための形態(以下、実施形態と称する。)について、第1実施形態〜第8実施形態に分けて説明する。   DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, modes for carrying out the present invention (hereinafter referred to as embodiments) will be described by dividing them into first to eighth embodiments with reference to the drawings (refer to drawings other than the referenced drawings as appropriate). To do.

(第1実施形態)
まず、第1実施形態に係る画像処理装置の構成について説明する。図1に示すように、画像処理装置100は、帳票や書面等を撮像して取得したカラー画像から2値画像を生成するコンピュータ装置であり、操作部110と、表示部120と、撮像部130と、記憶部140と、制御部150とを備える。
(First embodiment)
First, the configuration of the image processing apparatus according to the first embodiment will be described. As illustrated in FIG. 1, the image processing apparatus 100 is a computer apparatus that generates a binary image from a color image acquired by capturing a form, a document, or the like, and includes an operation unit 110, a display unit 120, and an imaging unit 130. And a storage unit 140 and a control unit 150.

操作部110は、ユーザが数字や文字の入力操作を行う際に利用するキーボードや、スキャンの開始を指示するためのボタン等からなる操作部である。表示部120は、入力画像や2値画像等を表示する液晶ディスプレイ等からなる表示部である。撮像部130は、フラットベッドスキャナやオートシートフィーダ付きのスキャナ、およびCCD(Charge Coupled Device)等の撮像素子を用いて画像を撮像するデジタルカメラ等の撮像部である。   The operation unit 110 is an operation unit including a keyboard used when a user performs input operations of numbers and characters, a button for instructing start of scanning, and the like. The display unit 120 is a display unit including a liquid crystal display that displays an input image, a binary image, and the like. The imaging unit 130 is an imaging unit such as a digital camera that captures an image using a flatbed scanner, a scanner with an auto sheet feeder, and an imaging device such as a CCD (Charge Coupled Device).

記憶部140は、メモリやハードディスク装置等からなる記憶デバイスであり、撮像部130で撮像された画像や各種内部処理用プログラム、および各種設定データを記憶する。また、例えば、記憶部140は、複数の代表色から被写体(書面など)の背景色を検出するための所定の判定基準として、求めた各クラスタの代表色のうち輝度が最も高い色を被写体の背景色とするという基準を記憶する。また、記憶部140は、2値化のための設定値や判定基準などを記憶する。   The storage unit 140 is a storage device including a memory, a hard disk device, and the like, and stores images captured by the imaging unit 130, various internal processing programs, and various setting data. In addition, for example, the storage unit 140 selects a color with the highest luminance among the obtained representative colors of each cluster as a predetermined determination criterion for detecting the background color of the subject (such as a document) from a plurality of representative colors. The reference for the background color is stored. In addition, the storage unit 140 stores setting values for binarization, determination criteria, and the like.

制御部150は、画像の撮像処理と入力画像の2値化処理等の画像処理を行う制御部であり、撮像処理部151と画像処理部152を有する。   The control unit 150 is a control unit that performs image processing such as image capturing processing and input image binarization processing, and includes an image capturing processing unit 151 and an image processing unit 152.

撮像処理部151は、撮像部130を用いて被写体の撮像制御を行う制御部であり、画像データを入力画像としてメモリ上に展開して一時的に保持するとともに、この画像データをファイルとして記憶部140に格納することができる。   The imaging processing unit 151 is a control unit that performs imaging control of a subject using the imaging unit 130. The image processing unit 151 develops and temporarily stores image data as an input image on a memory, and stores the image data as a file. 140 can be stored.

画像処理部152は、撮像処理部151で作成された入力画像から背景を除去して2値化する手段であり、第1実施形態の画像処理装置100における特徴部分である。具体的には、画像処理部152では、まず撮像処理部151で作成され入力された画像に対してレイアウト解析を行い、背景色、プレ印刷色、文字色を求める。次に、背景色とプレ印刷色、背景色と文字色、プレ印刷色と文字色とを分離する基準をそれぞれ算出する。最後に、レイアウト情報と色情報を用いて、画像中の1画素ごとに3種類の色分離基準を切り替えて2値画像を生成する。この処理フローについては、図6を用いて後述する。   The image processing unit 152 is a unit that removes the background from the input image created by the imaging processing unit 151 and binarizes it, and is a characteristic part of the image processing apparatus 100 of the first embodiment. Specifically, the image processing unit 152 first performs layout analysis on the image created and input by the imaging processing unit 151 to obtain a background color, a pre-print color, and a character color. Next, a standard for separating the background color and the pre-print color, the background color and the character color, and the pre-print color and the character color is calculated. Finally, using the layout information and color information, a binary image is generated by switching three types of color separation criteria for each pixel in the image. This processing flow will be described later with reference to FIG.

本発明で実現する2値化方式の具体例を示す前に、図2から図6を用いて従来の2値化の処理結果と本発明の処理結果の概要を示す。   Before showing a specific example of the binarization method realized in the present invention, an outline of the conventional binarization processing result and the processing result of the present invention will be described with reference to FIGS.

図2は2値化対象の入力画像である。白い紙の帳票200上に、罫線210で囲まれた白い背景色の領域、濃い罫線220で囲まれた濃い背景色の領域、薄い罫線230で囲まれた薄い背景色の領域が存在し、それぞれの領域には「金額」と記載されたプレ印刷文字240から260が存在する。さらに、270等の枠内に認識対象の文字が記載されている。250や260のプレ印刷文字の色は、背景色と同系色であり、背景色よりも若干輝度が低いものとする。本発明の目的は、図2の画像から、図3に示すように記載文字、プレ印刷文字、および、罫線を黒化、それ以外の背景領域を白化する2値化画像を生成することである。   FIG. 2 shows an input image to be binarized. On a white paper form 200, there are a white background color area surrounded by a ruled line 210, a dark background color area surrounded by a dark ruled line 220, and a light background color area surrounded by a thin ruled line 230, respectively. In this area, pre-printed characters 240 to 260 on which “amount” is written exist. Further, characters to be recognized are written in a frame such as 270. The colors of the pre-printed characters 250 and 260 are similar to the background color and have a slightly lower luminance than the background color. An object of the present invention is to generate a binary image from the image in FIG. 2 in which the written characters, pre-printed characters, and ruled lines are blackened and the other background regions are whitened as shown in FIG. .

図2の画像を従来の2値化手法での処理した結果が図4および図5である。図4は、薄いプレ印刷を黒化することを目的として、帳票200全体を低い閾値で2値化した結果である。罫線430やプレ印刷文字460は黒化できているものの、プレ印刷文字450も含めた濃い背景の領域が全て黒化されている。一方、図5は、濃い背景領域を白化することを目的として、帳票200全体を高い閾値で2値化した結果である。罫線530とプレ印刷文字560が閾値以上となるため白化されている。図4と図5から、帳票全面を一律の基準で2値化すると、記載文字とプレ印刷文字の両方を高精度に認識することは困難であることがわかる。この問題に対応するため、局所領域毎に閾値を算出して2値化する従来方式もある。しかし、図2のように背景色とプレ印刷文字の色相や輝度が近い場合には、背景の一部を黒化することで生じるノイズや、文字の一部を白化することで生じる文字のかすれ等が頻発する。このように、背景色とプレ印刷の濃淡差が大きい帳票から記載文字とプレ印刷文字の両方を抽出する2値化画像を生成することは困難であった。これは、プレ印刷文字が薄い帳票と濃い帳票が混在する場合でも同様である。本発明における課題の解決策についての詳細については図6以降で説明する。   The result of processing the image of FIG. 2 by the conventional binarization method is shown in FIGS. FIG. 4 shows the result of binarizing the entire form 200 with a low threshold for the purpose of blackening the thin preprint. Although the ruled line 430 and the pre-printed characters 460 can be blackened, the dark background region including the pre-printed characters 450 is all blackened. On the other hand, FIG. 5 shows the result of binarizing the entire form 200 with a high threshold for the purpose of whitening a dark background region. Since the ruled line 530 and the preprinted character 560 are equal to or greater than the threshold value, they are whitened. 4 and 5, it can be seen that if the entire form is binarized on a uniform basis, it is difficult to recognize both the written characters and the pre-printed characters with high accuracy. In order to deal with this problem, there is a conventional method in which a threshold value is calculated for each local region and binarized. However, if the hue and brightness of the background color and the pre-printed character are close as shown in FIG. 2, noise caused by blackening a part of the background or blurring of a character caused by whitening a part of the character. Etc. occur frequently. Thus, it has been difficult to generate a binarized image that extracts both written characters and pre-printed characters from a form that has a large shade difference between the background color and pre-print. This is the same even when a form with thin pre-printed characters and a dark form are mixed. Details of the solution to the problem in the present invention will be described in FIG.

本発明における画像処理部152で実行される2値化処理フローの一例を図6に示す。各ステップの処理の内容は次のとおりである。なお、以降の記載はカラー画像の入力を前提としているが、グレー画像においても画素の濃淡値(輝度値、明度値)を用いることにより適用可能である。   An example of the binarization processing flow executed by the image processing unit 152 in the present invention is shown in FIG. The contents of the processing in each step are as follows. Note that the following description is based on the premise that a color image is input, but it can also be applied to gray images by using pixel gray values (luminance values, brightness values).

図6のステップ600では、帳票上の罫線や枠、文字行の位置を検出するためのレイアウト解析を行う。   In step 600 of FIG. 6, layout analysis is performed to detect the positions of ruled lines, frames, and character lines on the form.

画像処理部152で実行されるレイアウト解析処理の詳細を図7に示す。まず、ステップ700で帳票画像を2値化する。この2値化処理では、図3のようにプレ印刷文字と記載文字の両方を黒化するのではなく、少なくとも罫線を黒化することを目的としているため、多少のノイズや潰れは許容でき、図3の2値化画像を生成するよりも閾値の設定が容易となる。この点については、ステップ720の枠抽出の際に詳述する。次にステップ710で、ステップ700で生成した2値化画像から罫線を抽出する。罫線抽出方式の一例としては、縦方向、横方向の黒画素の連続性から縦罫線と横罫線を抽出する方式がある。ステップ720では、抽出された罫線から枠を抽出する。枠抽出方式の一例としては、罫線の交点付近の特徴を用いて枠を抽出する特開平11−53466号公報に記載の方式等がある。この方式では、罫線にかすれやノイズが発生しても高精度に枠を抽出することができる。正確に罫線を抽出する必要がないため、ステップ700の2値化処理の閾値設定が容易となる。しかし、あらかじめ決められた2値化閾値では枠を抽出できないと判断した場合、ステップ700に戻り2値化の閾値を変更してから再度ステップ710以降の処理を行うことも可能である。最後に、ステップ730では、ステップ700で生成した2値化画像から文字行を抽出する。この処理の従来手法としては、連結成分融合法と呼ばれる方式がある。この方式は、黒画素の連結する領域を連結成分とし、連結成分の上下・左右方向の整列性から文字行を検出するものである。文字行の概略の位置を検出することが目的であるため、文字にかすれやノイズが発生している2値画像を対象としてもよい。このことからも、ステップ700の閾値設定は容易となることがわかる。なお、ステップ600で罫線や文字の画素を抽出する際に、図7の方式ではなく、入力のカラー画像をグレー画像に変換したのち、ラプラシアンフィルタ等の輪郭を検出するフィルタを用いてもよい。ラプラシアンフィルタは輝度の差分の変化量が極端に大きくなっている部分を抽出するフィルタであり、3×3のフィルタの係数は   Details of the layout analysis processing executed by the image processing unit 152 are shown in FIG. First, in step 700, the form image is binarized. In this binarization processing, not only the pre-printed characters and the written characters are blackened as shown in FIG. 3, but at least the ruled lines are blackened. The threshold value can be set more easily than when the binarized image of FIG. 3 is generated. This point will be described in detail when the frame is extracted in step 720. In step 710, ruled lines are extracted from the binarized image generated in step 700. As an example of the ruled line extraction method, there is a method of extracting a vertical ruled line and a horizontal ruled line from the continuity of black pixels in the vertical direction and the horizontal direction. In step 720, a frame is extracted from the extracted ruled line. As an example of the frame extraction method, there is a method described in Japanese Patent Laid-Open No. 11-53466 in which a frame is extracted using features near the intersection of ruled lines. With this method, a frame can be extracted with high accuracy even if blurring or noise occurs on a ruled line. Since it is not necessary to accurately extract ruled lines, it is easy to set a threshold value for binarization processing in step 700. However, if it is determined that a frame cannot be extracted with a predetermined binarization threshold, it is possible to return to step 700 and change the binarization threshold and then perform the processing from step 710 again. Finally, in step 730, a character line is extracted from the binarized image generated in step 700. As a conventional method of this processing, there is a method called a connected component fusion method. In this method, a region where black pixels are connected is used as a connected component, and a character line is detected from the vertical / horizontal alignment of the connected component. Since the purpose is to detect the approximate position of a character line, a binary image in which the character is blurred or noise may be used. This also shows that the threshold setting in step 700 is easy. Note that when extracting ruled lines and character pixels in step 600, instead of the method shown in FIG. 7, a filter for detecting the contour such as a Laplacian filter may be used after converting the input color image into a gray image. The Laplacian filter is a filter that extracts a portion where the amount of change in luminance difference is extremely large. The coefficient of the 3 × 3 filter is

で与えられる。 Given in.

図6のステップ610では帳票の背景色を求める。背景色の抽出方式の一例として、特開2012−95002号公報に記載の方式等がある。この方式に記載の背景色検出は、帳票画像を複数の部分領域に分割した後、部分領域内の各画素をRGB等の色空間上にマッピングしてクラスタリングし、得られたクラスタの中から記憶部140に格納された所定の判定基準を用いて背景色のクラスタを選定し、このクラスタの代表色を部分領域の背景色とする処理である。   In step 610 of FIG. 6, the background color of the form is obtained. As an example of the background color extraction method, there is a method described in Japanese Patent Laid-Open No. 2012-95002. The background color detection described in this method divides a form image into a plurality of partial areas, maps each pixel in the partial area onto a color space such as RGB, and performs clustering, and stores it from the obtained clusters. This is a process of selecting a background color cluster using a predetermined criterion stored in the section 140 and setting the representative color of this cluster as the background color of the partial area.

図8は、RGB色空間を示した例である。RGB色空間はR(red)、G(green)、B(blue)それぞれの値を軸に持つ3次元空間であり、RGBの各軸の値は0から255をとる。原点(0,0,0)は黒を表し、(255,255,255)は白を表す。処理対象領域内の各画素はRGB色空間上の一点にマッピングできる。領域内の画素をマッピングすると、代表的な色を中心とした複数の分布がでる。図8では、白い背景色(800)に、赤いプレ印刷(810)や緑のプレ印刷(820)が印刷されており、黒い文字(840)が記載されている領域を色クラスタリングした例である。色クラスタリングとは、処理領域中の各画素を色空間上でクラスタリングする処理である。具体的には、ボロノイ分割やユークリッド距離の閾値などを用いて近い色同士を同じクラスタとして色空間内を領域分割することにより実現する。各クラスタにおいて、クラスタの中心に位置する色や最も頻度が高い色を、クラスタの代表色とする。空間内のクラスタの中から背景色のクラスタ(800)を選定するには、クラスタの代表色の輝度が最も高い、明度が最も高い、クラスタの度数が最も高い(面積が広い)等の基準を用いる。なお、明度については、ステップ630の文字色検出において後述する。   FIG. 8 is an example showing an RGB color space. The RGB color space is a three-dimensional space having R (red), G (green), and B (blue) values as axes, and the values of each RGB axis range from 0 to 255. The origin (0, 0, 0) represents black and (255, 255, 255) represents white. Each pixel in the processing target area can be mapped to one point on the RGB color space. When the pixels in the region are mapped, a plurality of distributions centered on representative colors are obtained. FIG. 8 shows an example in which red pre-printing (810) and green pre-printing (820) are printed on a white background color (800), and an area where black characters (840) are described is color clustered. . Color clustering is a process of clustering each pixel in a processing area on a color space. Specifically, this is realized by dividing the color space into regions using the Voronoi division, the Euclidean distance threshold value, and the like as the same cluster. In each cluster, the color located at the center of the cluster or the color with the highest frequency is set as the representative color of the cluster. To select the background color cluster (800) from the clusters in the space, criteria such as the highest brightness of the representative color of the cluster, the highest brightness, and the highest frequency of the cluster (wide area) should be selected. Use. The lightness will be described later in character color detection in step 630.

なお、色クラスタリングは、領域内の全ての画素を利用しても、一部の画素を利用してもよい。例えば、一定間隔でサンプリングした画素を色クラスタリングに用いてもよい。さらに、この例では画素の値を直接クラスタリングの対象にしているが、CCDの特性上発生する偽色やノイズ等の影響を軽減するために、周辺の画素との平均値や重み付き平均値を求め、この値を色クラスタリングに用いてもよい。   Note that color clustering may use all of the pixels in the region or some of the pixels. For example, pixels sampled at regular intervals may be used for color clustering. Furthermore, in this example, pixel values are directly subject to clustering, but in order to reduce the effects of false colors and noise that occur due to CCD characteristics, average values with weighted pixels and weighted average values are set. This value may be obtained and used for color clustering.

図6のステップ620では帳票画像の罫線の色を求める。この処理は、罫線抽出710で罫線であると抽出された画素を色クラスタリングすることで求めることができる。色クラスタリングの結果、背景色と異なる色のクラスタが得られた場合に、このクラスタの代表色を罫線の色とする。罫線の色は複数であってもよい。一般に、帳票上の罫線の色とプレ印刷文字の色は同じであることが多いため、ここで得られた罫線の色はプレ印刷の色とみなすことも可能である。なお、ステップ620の処理対象の画素を、罫線抽出710で罫線であると抽出された画素でなく、枠抽出処理720で枠罫線と判定された罫線の画素にしてもよい。罫線として抽出された画素の中には、罫線と同系色のノイズ成分も含まれるのに対し、抽出された枠を構成する罫線はノイズを含む確率が低いため、より正確に罫線の色を求めることができる。   In step 620 of FIG. 6, the color of the ruled line of the form image is obtained. This process can be obtained by color clustering the pixels extracted as ruled lines in the ruled line extraction 710. When a cluster having a color different from the background color is obtained as a result of the color clustering, the representative color of this cluster is set as the ruled line color. There may be a plurality of ruled line colors. Generally, the color of the ruled line on the form and the color of the pre-printed character are often the same, and thus the color of the ruled line obtained here can be regarded as the pre-printed color. Note that the pixel to be processed in step 620 may be a pixel of a ruled line determined as a frame ruled line in the frame extraction process 720, instead of a pixel extracted as a ruled line in the ruled line extraction 710. Pixels extracted as ruled lines contain noise components of the same color as the ruled lines, but the ruled lines that make up the extracted frame have a low probability of containing noise, so the color of the ruled lines is obtained more accurately. be able to.

ステップ630では文字の色を求める。この処理は、文字行抽出730で文字行であると抽出された領域内の画素を色クラスタリングすることで求めることができる。色クラスタリングの結果、背景色と異なる色のクラスタが得られた場合に、このクラスタの代表色を文字の色とする。文字の色は複数であってもよい。文字色のクラスタを選定するための基準の一例としては、クラスタ代表色の輝度が最も低い、明度が最も低い、彩度が最も低い、背景やプレ印刷と異なる色相である等がある。   In step 630, the color of the character is obtained. This process can be obtained by color clustering the pixels in the area extracted as a character line by the character line extraction 730. When a cluster having a color different from the background color is obtained as a result of the color clustering, the representative color of this cluster is set as the character color. There may be a plurality of character colors. As an example of a criterion for selecting a character color cluster, the cluster representative color has the lowest luminance, the lowest brightness, the lowest saturation, and a hue different from the background or pre-printing.

ここで、色相(H),彩度(S)、明度(V)の指標で色を表現するHSV色空間について、図9と数2から数5を用いて説明する。   Here, the HSV color space that expresses colors by using the indices of hue (H), saturation (S), and brightness (V) will be described with reference to FIG.

RGB色空間はRGBの3色を用いて色を表現するため計算機で扱いやすい。一方、人間はRGB値ではなく色相(Hue:色の種類)、彩度(Saturation:鮮やかさ)、明度(Value:明るさ) の指標で色を知覚していることが分かっている。そこで、本発明の色クラスタリングや色判別処理では、RGB色空間だけでなく、人間の近くに近いHSV色空間の指標を利用してもよい。HSV色空間は図9に示す下向きの円錐形で視覚化できる。HSVの各指標の詳細は次のとおりである。
色相(H):色の種類(赤、青、黄、緑など)。0〜360°の範囲(円周上で変化する)
彩度(S):色の鮮やかさ。0.0〜1.0 (もしくは0〜255)の範囲(水平軸上で変化する)
明度(V):色の明るさ。 0.0〜1.0 (もしくは0〜255)の範囲(垂直軸上で変化する)
RGB色空間からHSV色空間へは、数2から数5を用いて変換できる。人間の知覚は、明度や彩度の変化に比べて、色相の変化に最も敏感であることが、実験によりわかっている。なお、HSV色空間のかわりに、HSL色空間等を用いてもよい。
The RGB color space is easy to handle with a computer because colors are expressed using three colors of RGB. On the other hand, it is known that humans perceive colors not by RGB values but by indices of hue (Hue: color type), saturation (Saturation: vividness), and lightness (Value: brightness). Therefore, in the color clustering and color discrimination processing of the present invention, not only the RGB color space but also an index of the HSV color space close to humans may be used. The HSV color space can be visualized as a downward cone as shown in FIG. Details of each index of HSV are as follows.
Hue (H): Color type (red, blue, yellow, green, etc.). 0 to 360 ° range (changes on the circumference)
Saturation (S): Vividness of color. 0.0 to 1.0 (or 0 to 255) range (changes on the horizontal axis)
Lightness (V): The brightness of the color. Range of 0.0 to 1.0 (or 0 to 255) (changes on the vertical axis)
Conversion from the RGB color space to the HSV color space can be performed using Equations 2 to 5. Experiments have shown that human perception is most sensitive to changes in hue compared to changes in lightness and saturation. An HSL color space or the like may be used instead of the HSV color space.

図6のステップ640では、2値化の際の色の分離基準を求める。ステップ640はステップ650から670の3つから構成されている。   In step 640 of FIG. 6, a color separation criterion for binarization is obtained. Step 640 includes three steps 650 to 670.

ステップ650では、ステップ610で求めた背景色に関する情報とステップ630で求めた文字色に関する情報に基づいて、文字色と背景色を分離する基準を求める。文字色と背景色との分離基準は、RGB色空間やHSV色空間での各クラスタ同士を分離する平面もしくは曲面を求める方法、輝度、明度のヒストグラムから閾値を求める方法がある。少なくとも一方がある程度以上の彩度を持つ有彩色(白〜グレー〜黒など、図9のV軸付近ではない色)である場合には、色相や彩度の範囲を限定することにより、色を分離する方法などがある。これらは単独で用いても、複数を組み合わせてもよい。一般的に、有彩色同士の判別には色相を最優先にして分離し、色相が近い場合には明度や彩度を用いて分離する。   In step 650, a reference for separating the character color and the background color is obtained based on the information on the background color obtained in step 610 and the information on the character color obtained in step 630. As a separation standard for the character color and the background color, there are a method for obtaining a plane or a curved surface for separating clusters in the RGB color space and the HSV color space, and a method for obtaining a threshold value from luminance and lightness histograms. If at least one of the colors is a chromatic color having a certain degree of saturation (such as white to gray to black, which is not near the V-axis in FIG. 9), by limiting the hue and saturation range, There is a method of separation. These may be used alone or in combination. In general, for discrimination between chromatic colors, separation is performed with the highest priority on hue, and when hues are close, separation is performed using lightness or saturation.

ステップ660ではプレ印刷色と背景色の分離基準を、ステップ670では文字色とプレ印刷色の分離基準を、ステップ650と同様にして求める。本発明では、「文字色」は読み取り対象である記載文字の色を指し、「プレ印刷色」は罫線やプレ印刷文字の色を指している。両者は異なることを前提としているものの、同じであってもよい。この場合でも、記載文字とプレ印刷を黒化し、背景を白化することは可能である。なお、用途によっては、650から670の処理のうち、1種類もしくは2種類のみを用いてもよい。   In step 660, the separation standard for the pre-print color and the background color is obtained, and in step 670, the separation standard for the character color and the pre-print color is obtained in the same manner as in step 650. In the present invention, “character color” indicates the color of a written character to be read, and “pre-print color” indicates the color of a ruled line or pre-print character. Although both presuppose that it is different, they may be the same. Even in this case, it is possible to blacken the written characters and the preprint and whiten the background. Depending on the application, one or two of the processes 650 to 670 may be used.

図6のステップ680では、画素のRGB値やHSV値、ステップ610,620,630で得られた背景、プレ印刷、文字のRGB値やHSV値などの色情報と、ステップ600で得られたレイアウト情報と、を用いて、画素ごとに、ステップ640で求めた2値化の分離基準を切り替えて2値化を行う。この処理においては、生成する2値画像の種類に応じて利用する基準が異なる。   In step 680 of FIG. 6, RGB information and HSV values of pixels, background information obtained in steps 610, 620, and 630, color information such as pre-printing, character RGB values and HSV values, and the layout obtained in step 600. Using the information, binarization is performed by switching the binarization separation criterion obtained in step 640 for each pixel. In this processing, the reference used differs depending on the type of binary image to be generated.

図10を用いて3種類の2値画像の例を説明する。図10(a)は入力画像であり、背景色付きの領域に背景色と同系色のプレ印刷文字や罫線が印刷されており、認識対象として輝度の低い数字が記載されている。   An example of three types of binary images will be described with reference to FIG. FIG. 10A shows an input image in which preprinted characters and ruled lines of the same color as the background color are printed in a region with a background color, and numbers with low luminance are described as recognition targets.

図10(a)の画像を、背景を白化し、記載文字とプレ印刷文字、罫線を黒化した2値画像が図10(b)である。この2値画像は、プレ印刷文字と記載文字の両方を認識することを目的とする場合に生成される。この2値画像を生成するには、ステップ650の文字色―背景色の分離基準とステップ660のプレ印刷色―背景色の分離基準の両方を用いる。分離基準の具体的な利用例としては、少なくともどちらか一方の分離基準で背景でないと判定された画素のみを黒化する方法がある。   FIG. 10B is a binary image obtained by whitening the background of the image of FIG. 10A and blackening the written characters, pre-printed characters, and ruled lines. This binary image is generated when the purpose is to recognize both preprinted characters and written characters. In order to generate this binary image, both the character color-background color separation criterion in step 650 and the pre-print color-background color separation criterion in step 660 are used. As a specific example of the use of the separation criterion, there is a method of blackening only pixels that are determined not to be the background according to at least one of the separation criteria.

図10(c)は、図10(a)の画像を、背景とプレ印刷文字、プレ印刷罫線を白化し、記載文字を黒化した2値画像である。この2値画像は、記載文字の認識の際に、プレ印刷による悪影響を低減することを目的とする場合に生成される。特に、プレ印刷と記載文字が接触している場合に有効である。この2値画像を生成するには、ステップ650の文字色―背景色の分離基準とステップ670の文字色―プレ印刷色の分離基準の両方を用いる。分離基準の具体的な利用例としては、両方の分離基準で文字色と判定された画素を黒化する方法がある。   FIG. 10C is a binary image obtained by whitening the background, preprinted characters, and preprinted ruled lines, and blackening the written characters from the image of FIG. This binary image is generated when the purpose is to reduce the adverse effects of pre-printing when recognizing written characters. This is particularly effective when preprinting and written characters are in contact. In order to generate this binary image, both the character color-background color separation criterion in step 650 and the character color-pre-print color separation criterion in step 670 are used. As a specific example of the use of the separation standard, there is a method of blackening a pixel determined to be a character color by both separation standards.

図10(d)は、図10(a)の画像を、記載文字と背景を白化し、プレ印刷文字と罫線を黒化した2値画像である。プレ印刷文字のみを認識することを目的とする場合に生成される。この2値画像を生成するには、ステップ660のプレ印刷色―背景色の分離基準とステップ670の文字色―プレ印刷色の分離基準の両方を用いる。分離基準の具体的な利用例としては、両方の分離基準でプレ印刷色と判定された画素を黒化する方法がある。   FIG. 10D is a binary image obtained by whitening the written characters and the background and blackening the pre-printed characters and the ruled lines from the image of FIG. Generated for the purpose of recognizing only pre-printed characters. In order to generate this binary image, both the pre-print color-background color separation criterion in step 660 and the character color-pre-print color separation criterion in step 670 are used. As a specific example of the use of the separation standard, there is a method of blackening pixels determined to be pre-printed colors by both separation standards.

例えば、ユーザは操作部等から図10(b)、(c)、(d)のうちのいづれの形式で出力するかを選択し、画像処理部は、操作部等から指定された形式で出力するようステップ680の処理を実行する。   For example, the user selects whether to output in one of FIGS. 10B, 10C, or 10D from the operation unit or the like, and the image processing unit outputs in the format specified by the operation unit or the like. The processing of step 680 is executed so as to do this.

ステップ680では、画素の色に基づいて分離基準を切り替えるだけでなく、画素の座標とレイアウト解析結果に基づいて分離基準を変更することができる。これは、レイアウト解析結果を利用することにより、おおまかに記載文字、プレ印刷、背景の判別ができるからである。具体的には、ステップ710で罫線と判定された画素では、プレ印刷色すなわち罫線色であることを前提としてプレ印刷色の判定基準を緩和する。文字行領域内の画素では、文字色の判定基準を緩和する。この処理により、文字や罫線のかすれを防ぐことができる。さらに、プレ印刷色と背景色、および文字色と背景色の差が小さい場合には、分離基準を厳しくすることができる。この処理により、プレ印刷文字や罫線と背景が同系色の場合でもかすれを防ぐことができ、濃い背景上の文字が潰れることを防ぐことができる。   In step 680, not only can the separation criterion be switched based on the color of the pixel, but the separation criterion can be changed based on the coordinates of the pixel and the layout analysis results. This is because by using the layout analysis result, it is possible to roughly determine the written characters, pre-printing, and background. Specifically, for the pixels determined to be ruled lines in step 710, the determination criteria for the pre-print colors are relaxed on the premise that they are pre-print colors, that is, ruled line colors. For pixels in the character line area, the criteria for character color are relaxed. This process can prevent blurring of characters and ruled lines. Further, when the difference between the pre-print color and the background color and the character color and the background color are small, the separation standard can be tightened. This process can prevent blurring even when preprinted characters or ruled lines and the background have similar colors, and can prevent characters on a dark background from being crushed.

このように、図6の処理により、複数の分離基準を切り替えることにより、目的に応じた高精度な2値画像を生成することができる。   As described above, by switching a plurality of separation criteria by the processing of FIG. 6, it is possible to generate a highly accurate binary image according to the purpose.

(第2実施形態)
図11を用いて第2実施形態を説明する。第2実施形態は、第1実施形態における図6のレイアウト解析(ステップ600)と背景色検出(ステップ610)の順序と処理内容が異なる。
(Second Embodiment)
The second embodiment will be described with reference to FIG. In the second embodiment, the order and processing contents of the layout analysis (step 600) and background color detection (step 610) in FIG. 6 in the first embodiment are different.

まずステップ610において帳票画像全面を部分領域に分割して背景色検出を行う。次に、ステップ1100において、検出した背景色の情報を用いてレイアウト解析を行う。ステップ620以降は図6と同じである。   First, in step 610, the entire form image is divided into partial areas to perform background color detection. Next, in step 1100, layout analysis is performed using the detected background color information. Step 620 and subsequent steps are the same as those in FIG.

この第2実施形態では、ステップ1100のレイアウト解析処理の2値画像生成処理が第1実施形態のステップ700と異なる。具体的には、背景色に応じて画素ごとに2値化の閾値を変更する。すなわち、背景色が明るい(薄い)場合には2値化閾値を高くし、背景色が暗い(濃い)場合には2値化閾値を低くする。この処理は、図2のように異なる背景色が混在する帳票でのレイアウト解析の精度を向上させることを目的としている。第1実施形態において、図7のステップ700の2値化処理の閾値設定は図3の2値化閾値設定よりも容易であると説明した。しかし、背景色とプレ印刷色の濃淡差によっては、全ての領域の罫線やプレ印刷文字を抽出できない場合がある。   In the second embodiment, the binary image generation process of the layout analysis process in step 1100 is different from step 700 in the first embodiment. Specifically, the binarization threshold value is changed for each pixel according to the background color. That is, when the background color is light (light), the binarization threshold is increased, and when the background color is dark (dark), the binarization threshold is decreased. The purpose of this processing is to improve the accuracy of layout analysis in a form in which different background colors are mixed as shown in FIG. In the first embodiment, it has been described that the threshold setting of the binarization process in step 700 of FIG. 7 is easier than the binarization threshold setting of FIG. However, depending on the difference in density between the background color and the pre-print color, it may not be possible to extract ruled lines or pre-print characters of all regions.

図12は図2の入力画像の背景色を検出した結果である。図2の220の領域の背景色が図12の1210に、230の領域が1220として検出されている。この背景色よりも暗い色の画素を黒化することにより、上記の課題を解決するレイアウト解析用の2値画像を生成することができる。   FIG. 12 shows the result of detecting the background color of the input image of FIG. The background color of the area 220 in FIG. 2 is detected as 1210 in FIG. 12, and the area 230 is detected as 1220 in FIG. By blackening pixels of a color darker than the background color, a binary image for layout analysis that solves the above problem can be generated.

(第3実施形態)
図13を用いて第3実施形態を説明する。第3実施形態は、第1実施形態における図6のレイアウト解析(ステップ600)の後にステップ1300で領域分割を行い、ステップ610の背景色検出以降の処理は領域毎に実施する(ステップ1310)。この処理は、部分的に背景色やプレ印刷色の色相や濃淡が異なる帳票での2値化の精度を向上させることを目的としている。プレ印刷色や背景色が複数混在した状況で分離基準を設定することが困難であるため、色数を限定できる領域に分けてから分離基準を求める。領域限定の具体的な例としては、ステップ720の枠抽出で検出された枠単位で領域を分割する手法がある。枠内では背景色が同じであり、プレ印刷文字や罫線の色数も少ないという仮定に基づく。この手法では、枠外は全て同じ領域として扱う。領域分割の他の例としては、M×N画素の矩形領域に分割する手法がある。
(Third embodiment)
A third embodiment will be described with reference to FIG. In the third embodiment, after the layout analysis (step 600) in FIG. 6 in the first embodiment, the region is divided in step 1300, and the processing after the background color detection in step 610 is performed for each region (step 1310). The purpose of this process is to improve the accuracy of binarization in a form in which the background color or the pre-print color has different hues or shades. Since it is difficult to set a separation reference in a situation where a plurality of pre-print colors and background colors are mixed, the separation reference is obtained after dividing the region into regions where the number of colors can be limited. As a specific example of area limitation, there is a method of dividing an area in frame units detected by frame extraction in step 720. This is based on the assumption that the background color is the same in the frame and the number of preprinted characters and ruled lines is small. In this method, all areas outside the frame are treated as the same area. As another example of the area division, there is a technique of dividing into rectangular areas of M × N pixels.

(第4実施形態)
図14を用いて第4実施形態を説明する。第4実施形態は、第2実施形態のステップ1100の後にステップ1300の領域分割を行う。ステップ620のプレ印刷色検出以降の処理は領域毎に実施する(ステップ1400)。この処理は、レイアウト解析の精度向上に加えて、部分的に背景色やプレ印刷色の色相や濃淡が異なる帳票での2値化の精度向上を目的としている。なお、本実施形態においても図13と同様に領域毎に背景色を求め直してもよい。
(Fourth embodiment)
The fourth embodiment will be described with reference to FIG. In the fourth embodiment, the region division in step 1300 is performed after step 1100 in the second embodiment. The processing after the preprint color detection in step 620 is performed for each region (step 1400). The purpose of this processing is to improve the accuracy of binarization in a form in which the hue and shade of the background color and pre-printed color are partially different in addition to improving the accuracy of layout analysis. Also in this embodiment, the background color may be obtained again for each region as in FIG.

(第5実施形態)
図15を用いて第5実施形態を説明する。第5実施形態は、第2実施形態のステップ1100の後にステップ620のプレ印刷色検出とステップ630の文字色検出を行い、色情報とレイアウト情報を用いてステップ1500で領域分割を行う。ステップ640の分離基準生成以降の処理は領域毎に実施する(ステップ1510)。領域限定の具体的な例としては、背景色、プレ印刷色、文字色の組み合わせが同一である枠を全て同じ領域とする手法がある。枠外についても、上記の色の組み合わせに応じて領域を分割する。なお、本実施形態においても図13と同様に領域毎に再度色検出を実施してもよい。
(Fifth embodiment)
The fifth embodiment will be described with reference to FIG. In the fifth embodiment, after step 1100 of the second embodiment, pre-print color detection in step 620 and character color detection in step 630 are performed, and region division is performed in step 1500 using color information and layout information. The processing after the generation of the separation reference in step 640 is performed for each region (step 1510). As a specific example of area limitation, there is a method in which all frames having the same combination of background color, preprint color, and character color are set to the same area. Even outside the frame, the region is divided according to the combination of the above colors. In the present embodiment, color detection may be performed again for each region as in FIG.

(第6実施形態)
図16から図23を用いて第6実施形態を説明する。第6実施形態は、背景色の画素を白化し、文字色とプレ印刷色の画素を黒化することのみを目的としている。第1から第5実施形態では、図10(a)の入力に対して、図10(b)から図10(d)の2値画像を生成できるのに対し、第6実施例では、図10(b)の2値画像の生成のみを行う。本実施形態では、背景色とその他の色とを分離する基準を複数算出し、これらの基準を切り替えて2値化を実行する。
(Sixth embodiment)
The sixth embodiment will be described with reference to FIGS. 16 to 23. The sixth embodiment is intended only to whiten the background color pixels and blacken the character color and pre-print color pixels. In the first to fifth embodiments, the binary images shown in FIGS. 10 (b) to 10 (d) can be generated for the input shown in FIG. 10 (a). Only the generation of the binary image of (b) is performed. In the present embodiment, a plurality of criteria for separating the background color and other colors are calculated, and binarization is executed by switching these criteria.

第6実施形態に係る画像処理装置の構成は、第1実施形態と同じ図1になる。ただし、画像処理部152の機能が図16の処理フローをもつことが第1実施形態とは異なる。以降、第6実施形態の画像処理部152の機能の詳細について説明する。   The configuration of the image processing apparatus according to the sixth embodiment is the same as that of the first embodiment shown in FIG. However, the first embodiment differs from the first embodiment in that the function of the image processing unit 152 has the processing flow of FIG. Hereinafter, details of functions of the image processing unit 152 of the sixth embodiment will be described.

第6実施形態における2値化処理フローの一例を図16に示す。まず、図6のステップ610と同じ処理を用いて、分割した部分領域ごとに背景色を検出する。次に、図6のステップ640に相当する処理であるステップ1640にて背景色の画素とそれ以外の画素を分離する基準を算出する。最後に、図6のステップ680に相当する処理であるステップ1680にて、画素ごとに分離基準を切り替えて2値化する。ステップ1640については図17を用いて、ステップ1680については図18から図20を用いて後述する。   An example of the binarization processing flow in the sixth embodiment is shown in FIG. First, the background color is detected for each of the divided partial areas using the same process as in step 610 of FIG. Next, in step 1640, which is a process corresponding to step 640 in FIG. 6, a reference for separating the background color pixel from the other pixels is calculated. Finally, in step 1680, which is a process corresponding to step 680 in FIG. 6, the separation criterion is switched for each pixel and binarized. Step 1640 will be described later with reference to FIG. 17, and step 1680 will be described later with reference to FIGS.

図16のステップ1640は、背景色とそれ以外(文字色やプレ印刷色)を分離するための基準を算出する処理である。分離基準は2値化処理対象の全ての画素について算出される。分離基準の算出には、輝度や明度、彩度、色相等を用いる。本実施形態では、背景色の輝度を用いる例を示す。まず、画素の輝度がα以下であれば2値化処理で必ず黒化し、β以上であれば必ず白化するという基準値αとβを事前に設定しておく。次に、重みpとq(0.0から1.0)を設定し、輝度に基づく3つの分離基準(T1からT3)を数6から数8を用いて算出する。T1からT3の具体的な説明は次のとおりである。T1は、強制的に黒化する値である定数αとする   Step 1640 in FIG. 16 is a process for calculating a reference for separating the background color from the other colors (character color and pre-print color). The separation criterion is calculated for all pixels to be binarized. For the calculation of the separation standard, brightness, brightness, saturation, hue, and the like are used. In this embodiment, an example using the luminance of the background color is shown. First, the reference values α and β are set in advance so that if the luminance of a pixel is less than or equal to α, blackening is always performed in the binarization process, and if the luminance is greater than or equal to β, whitening is always performed. Next, weights p and q (0.0 to 1.0) are set, and three separation criteria (T1 to T3) based on luminance are calculated using Equations 6 to 8. A specific description of T1 to T3 is as follows. T1 is a constant α that is a value forcibly blackened.

。T2とT3は背景色の輝度に応じて変化する値であり、背景色に近いプレ印刷色やノイズを判定するために用いる。T3は、処理対象画素の位置での背景色の輝度(Yb)に重みpを乗算した値とβのうち、小さい方の値とする . T2 and T3 are values that change according to the luminance of the background color, and are used to determine a pre-print color or noise that is close to the background color. T3 is the smaller value of β and the value obtained by multiplying the luminance (Yb) of the background color at the position of the processing target pixel by the weight p and β.

。T2は、T1とT3をq:(1−q)で内分する値である . T2 is a value that internally divides T1 and T3 by q: (1-q).

。一例として、α=160、β=220、p=0.9、q=0.5の場合のT1からT3を、図17にて示す。なお、なお、重みpとqは、定数でも関数でもよい。さらに、T3の値をβ等の背景色に依存しない定数にしてもよい。 . As an example, FIG. 17 shows T1 to T3 when α = 160, β = 220, p = 0.9, and q = 0.5. Note that the weights p and q may be constants or functions. Furthermore, the value of T3 may be a constant such as β that does not depend on the background color.

図16のステップ1680は、図18に示すように3つのステップで構成される。   Step 1680 in FIG. 16 includes three steps as shown in FIG.

図18のステップ1800の画素のクラス分けの処理フローを図19に示す。図19の処理は、入力画像の2値化対象領域内の全ての画素について実行される(ステップ1900、1905)。ステップ1910の判定にて、当該画素の輝度値がT1未満の場合には、ステップ1920にて黒化する画素としてC1(黒化確定)に分類する。ステップ1930の判定にて、輝度値がT1以上T2未満の場合には、ステップ1940にてC2(黒化候補1)に分類する。ステップ1950の判定にて、輝度値がT2以上T3未満の場合には、ステップ1960にてさらに他の分離基準を満たすかどうかを判定し、基準を満たす場合にはステップ1970にてC3(黒化候補2)に分類する。いずれの基準も満たさない場合には、ステップ1980にて白化する画素としてC4(白化確定)に分類する。ステップ1960の判定の具体的な例としては、背景色の明度(Vb)と画素の明度(Vi)の差を用いることができる。   FIG. 19 shows a processing flow of pixel classification in step 1800 of FIG. The process of FIG. 19 is executed for all pixels in the binarization target area of the input image (steps 1900 and 1905). If it is determined in step 1910 that the luminance value of the pixel is less than T1, the pixel to be blackened is classified as C1 (blackening confirmed) in step 1920. If it is determined in step 1930 that the luminance value is equal to or greater than T1 and less than T2, it is classified as C2 (blackening candidate 1) in step 1940. If it is determined in step 1950 that the luminance value is greater than or equal to T2 and less than T3, it is determined whether or not another separation criterion is satisfied in step 1960. If the criterion is satisfied, C3 (blackening is determined in step 1970. Classify as candidate 2). If none of the criteria is satisfied, the pixel is classified as C4 (whitening confirmed) in step 1980 as a pixel to be whitened. As a specific example of the determination in step 1960, the difference between the lightness (Vb) of the background color and the lightness (Vi) of the pixel can be used.

基準:Vb−Vi>γ
ただし、γは定数である。これは、一般的に、背景色の方がプレ印刷色より明度が高い場合が多いからである。その他の条件としては、背景色の色相(Hb)と画素の色相(Hi)の差、背景色の彩度(Sb)と画素の彩度(Si)の差、および画素の明度(Vi)や彩度(Si)の上限値等も利用することができる。これらの条件は単数でも複数の組み合わせでも良い。
Standard: Vb−Vi> γ
Where γ is a constant. This is because generally the background color is often lighter than the preprint color. Other conditions include the difference between the hue (Hb) of the background color and the hue (Hi) of the pixel, the difference between the saturation (Sb) of the background color and the saturation (Si) of the pixel, the lightness (Vi) of the pixel, An upper limit value of saturation (Si) can also be used. These conditions may be singular or a plurality of combinations.

図18のステップ1810では、ステップ1800での分類結果に基づいて2値化する。2値化の一例としては、C1からC3に分類された画素を黒化、C4に分類された画素を白化する。その他の例としては、C1とC2に分類された画素を黒化、C3とC4に分類された画素を白化する。なお、1画素ごとに、クラス分けの直後に2値化(黒化白化の判定)を行うことにより、ステップ1800と1810を同時に実行してもよい。図18のステップ1820では、各クラスの画素の比率に基づいて、ステップ1810で2値化した結果を別の基準で評価して再2値化する。   In step 1810 in FIG. 18, binarization is performed based on the classification result in step 1800. As an example of binarization, pixels classified as C1 to C3 are blackened, and pixels classified as C4 are whitened. As another example, pixels classified into C1 and C2 are blackened, and pixels classified into C3 and C4 are whitened. Note that steps 1800 and 1810 may be executed simultaneously by performing binarization (determination of blackening and whitening) immediately after classification for each pixel. In step 1820 of FIG. 18, based on the ratio of the pixels of each class, the result binarized in step 1810 is evaluated according to another criterion and re-binarized.

図20を用いて再2値化の処理フローを説明する。図20の例では、ステップ1810にてC1からC3の画素を黒化していることを前提として説明している。図20の処理では、画像の処理対象領域をMb×Nb画素の矩形領域に分割したうえで、全ての領域内の画素について実行する(ステップ2000、2005)。ここで、分割した矩形領域のサイズは、背景検出時のサイズと同じでも異なっていてもよい。ステップ2010では、領域内のC1からC3に分類された画素の数をカウントする。カウントした数は、下記のように定義する。   The re-binarization process flow will be described with reference to FIG. In the example of FIG. 20, the description is based on the assumption that the pixels C1 to C3 are blackened in step 1810. In the processing of FIG. 20, the processing target area of the image is divided into rectangular areas of Mb × Nb pixels, and is executed for pixels in all areas (steps 2000 and 2005). Here, the size of the divided rectangular area may be the same as or different from the size at the time of background detection. In step 2010, the number of pixels classified into C1 to C3 in the region is counted. The counted number is defined as follows.

n1:C1(黒化確定)に分類された画素の数
n2:C2(黒化候補1)に分類された画素の数
n3:C3(黒化候補2)に分類された画素の数
n = n1+n2+n3(C1、C2、C3の画素数の合計)
n0= Mb・Nb (領域内の全画素数)
ステップ2020では、領域内において、下記の比率を計算する。これらの比率は、ステップ2030の条件1やステップ2050条件2で用いられる。
n1: Number of pixels classified as C1 (blackening decision) n2: Number of pixels classified as C2 (blackening candidate 1) n3: Number of pixels classified as C3 (blackening candidate 2) n = n1 + n2 + n3 (Total number of pixels of C1, C2, and C3)
n0 = Mb · Nb (total number of pixels in the region)
In step 2020, the following ratio is calculated in the region. These ratios are used in condition 1 in step 2030 and condition 2 in step 2050.

R = n/n0
R1 = n1/n
R12 =(n1+n2)/n
ステップ2030の条件1の例を下記に示す。
条件1:(R>t1)AND(R1>t2)
ただし、t1とt2は事前に定めた定数
条件1では、領域内でC1(黒化確定)の比率が高いことを意味している。したがって、領域内の文字画素の輝度は十分低く、C2とC3の輝度が高い画素はノイズとみなすことができる。このため、条件1を満たす場合には、ステップ2040において、C1に分類された画素のみを黒化し、C2とC3の画素を白化する再2値化処理を行う。
R = n / n0
R1 = n1 / n
R12 = (n1 + n2) / n
An example of condition 1 of step 2030 is shown below.
Condition 1: (R> t1) AND (R1> t2)
However, t1 and t2 indicate that the ratio of C1 (determined blackening) is high in the region under the constant condition 1 determined in advance. Therefore, the brightness of the character pixels in the region is sufficiently low, and the pixels with high brightness of C2 and C3 can be regarded as noise. Therefore, when the condition 1 is satisfied, in step 2040, only the pixels classified as C1 are blackened, and re-binarization processing is performed to whiten the pixels C2 and C3.

図21を用いて、条件1を具体的に説明する。図21は、8×8(Mb=Nb=8)の領域に「田」の文字が記載されている例である。図21(a)は、画素2100等のC3に分類された輝度の高い背景色の領域に、画素2110等のC1に分類された文字の画素が存在する例である。その他に、C2と分類された画素として、背景上のノイズ(2120)や、他の背景色よりも輝度値が低い背景(2130)が存在する。画素2130が他の背景色よりも低い輝度値になるのは、隣接する画素との色の差が大きいためである。このような場合、撮像素子の量子化誤差等から、隣接する画素の影響を受けて実際とは異なる輝度値になることがある。図21(a)を、条件1を用いてC1のみ黒化する再2値化した結果が図21(c)である。さらに、図21(b)に示すように、輝度が高い背景領域(C4)中に輝度が低い文字(C1)が記載されている場合の再2値化結果も図21(c)となる。   The condition 1 will be specifically described with reference to FIG. FIG. 21 is an example in which the characters “ta” are written in an 8 × 8 (Mb = Nb = 8) area. FIG. 21A shows an example in which a pixel of a character classified as C1 such as a pixel 2110 exists in a background color region with a high luminance classified as C3 such as a pixel 2100. In addition, as a pixel classified as C2, there is a background noise (2120) and a background (2130) having a luminance value lower than that of other background colors. The reason why the pixel 2130 has a lower luminance value than the other background colors is because the color difference between the adjacent pixels is large. In such a case, the luminance value may be different from the actual value due to the influence of adjacent pixels due to the quantization error of the image sensor. FIG. 21C shows a result obtained by binarizing FIG. 21A using condition 1 and blackening only C1. Furthermore, as shown in FIG. 21B, the re-binarization result in the case where a character (C1) with low brightness is described in the background area (C4) with high brightness is also shown in FIG. 21 (c).

ステップ2050の条件2の例を下記に示す。
条件2: ((R>t3)AND(R2>t4))
OR((R<t5)AND(n1=0))
ただし、t3からt5は事前に定めた定数
条件2の1行目は、領域内のC1とC2の比率が高いことを意味している。2行目は、輝度の低いC1の画素がなく、C2とC3の比率が低いことを意味している。そこで、C2の画素は、背景色に近い色のプレ印刷文字や罫線であり黒化対象とみなすことができ、C3の輝度が高い画素は、ノイズであり白化対象とみなすことができる。このため、条件2を満たす場合には、ステップ2060において、C1とC2に分類された画素を黒化し、C3の画素を白化する再2値化処理を行う。
An example of condition 2 of step 2050 is shown below.
Condition 2: ((R> t3) AND (R2> t4))
OR ((R <t5) AND (n1 = 0))
However, from t3 to t5, the first line of the predetermined constant condition 2 means that the ratio of C1 and C2 in the region is high. The second row means that there is no C1 pixel with low luminance and the ratio between C2 and C3 is low. Therefore, the C2 pixel is a pre-printed character or ruled line having a color close to the background color and can be regarded as a blackening target, and a pixel having a high luminance of C3 is noise and can be regarded as a whitening target. Therefore, when the condition 2 is satisfied, in step 2060, re-binarization processing is performed in which the pixels classified into C1 and C2 are blackened and the pixel of C3 is whitened.

図22と図23を用いて、条件2を具体的に説明する。図22は条件2の1行目が適用される例である。図22(a)は、画素2200等のC3に分類された輝度の高い背景色の領域に、画素2210等のC2に分類された文字の画素が存在する例である。C2の画素は、背景色に近いプレ印刷文字とみなすことができる。図22(b)は、画素2220等のC4に分類された背景色の領域に、画素2230等のC2に分類された文字の画素と、C3に分類された輝度値が低い背景(2240)が存在する例である。条件2の1行目を用いて図22(a)や図22(b)を再2値化した結果は図21(c)になる。図23は条件2の2行目が適用される例である。図23(a)は、画素2300等のC4に分類された背景色の領域に、画素2310等のC2に分類されたプレ印刷文字の一部と、C3に分類されたノイズ(2320)が存在する例である。条件2の2行目を用いてC1とC2を黒化する再2値化結果が図23(b)である。図23(c)は画素2330等のC4に分類された背景色の領域に、C3に分類されたノイズが存在する例である。図23(c)を再2値化した結果が図23(d)となる。   Condition 2 will be specifically described with reference to FIGS. 22 and 23. FIG. 22 shows an example in which the first line of condition 2 is applied. FIG. 22A shows an example in which a pixel of a character classified as C2 such as a pixel 2210 exists in an area of a background color with high luminance classified as C3 such as a pixel 2200. The pixel C2 can be regarded as a preprinted character close to the background color. In FIG. 22B, in the background color area classified as C4 such as the pixel 2220, the character pixel classified as C2 such as the pixel 2230, and the background (2240) classified as C3 and having a low luminance value. It is an example that exists. FIG. 21C shows the result of binarizing FIG. 22A and FIG. 22B using the first line of condition 2. FIG. 23 shows an example in which the second line of condition 2 is applied. FIG. 23A shows a part of the pre-printed character classified as C2 such as the pixel 2310 and the noise classified as C3 (2320) in the background color area classified as C4 such as the pixel 2300. This is an example. FIG. 23B shows a rebinarization result in which C1 and C2 are blackened using the second line of condition 2. FIG. 23C shows an example in which noise classified as C3 exists in the background color area classified as C4 such as the pixel 2330. FIG. 23D shows the result of binarizing FIG. 23C.

条件1、条件2ともに満たさない領域では、C1、C2、C3の画素は黒化したままである。なお、この条件1と条件2は例であり、領域内の輝度や色相、彩度、明度等の平均や分散、個々の画素値等、他の条件を用いることが可能である。さらに、条件数も変更してもよい。   In an area where neither Condition 1 nor Condition 2 is satisfied, the pixels of C1, C2, and C3 remain blackened. Note that Condition 1 and Condition 2 are examples, and other conditions such as the average and dispersion of luminance, hue, saturation, brightness, and individual pixel values in the region can be used. Further, the number of conditions may be changed.

以上で示したように、第6実施形態では、背景色との差分と小領域内での輝度の分布を用いて、背景色のみを白化する2値化を実現することができる。   As described above, in the sixth embodiment, binarization that whitens only the background color can be realized by using the difference from the background color and the luminance distribution in the small area.

なお、図18において、ステップ1810で2値化処理を終了してもよい。また、図6、図11、図13、図14、図15のステップ640とステップ680のかわりに、本実施形態のステップ1640とステップ1680を用いてもよい。   In FIG. 18, the binarization process may be terminated in step 1810. Further, instead of step 640 and step 680 of FIGS. 6, 11, 13, 14, and 15, step 1640 and step 1680 of this embodiment may be used.

(第7実施形態)
第7実施形態では、2値化だけでなく文字認識も行うことができる画像処理装置の例を説明する。図24は、第1実施形態から第6実施形態のいずれかの画像処理装置100の機能を持つ画像処理装置2400を示す構成図の例である。
(Seventh embodiment)
In the seventh embodiment, an example of an image processing apparatus that can perform not only binarization but also character recognition will be described. FIG. 24 is an example of a configuration diagram illustrating an image processing apparatus 2400 having the functions of the image processing apparatus 100 according to any one of the first to sixth embodiments.

図24に示すように、画像処理装置2400は、制御部2410に文字認識部2411が追加されている以外は、図1に示す画像処理装置100と同様の構成であるので、重複説明を適宜省略する。文字認識部2411は、2値化によって生成した画像から文字認識処理をする。   As shown in FIG. 24, the image processing apparatus 2400 has the same configuration as that of the image processing apparatus 100 shown in FIG. 1 except that a character recognition unit 2411 is added to the control unit 2410. To do. The character recognition unit 2411 performs character recognition processing from an image generated by binarization.

文字認識部2411は、例えば、図2の画像から、2値化処理を行い、文字として「金額」、「1」、「2」、「3」、「4」、「5」等を認識する。個々の文字を認識する処理は、パターン認識の既存手法を用いることができる。   For example, the character recognition unit 2411 performs binarization processing from the image of FIG. 2 and recognizes “amount”, “1”, “2”, “3”, “4”, “5”, and the like as characters. . The process for recognizing individual characters can use an existing method of pattern recognition.

(第8実施形態)
第8実施形態では、第1実施形態から第6実施形態のいずれかの画像処理装置100を利用した、金融機関の営業店窓口に設置される営業店窓口端末装置について説明する。金融機関などでは、営業店窓口に設置された端末装置に接続されたスキャナによって、顧客が記入した取引帳票の画像を撮像し、得られた画像データを保存したり、画像データについて文字認識を行ったりしている。図25に示すように、営業店窓口端末装置2500は、操作部110(図1と同様)と、表示部120(図1と同様)と、スタンド型スキャナなどの撮像部130(図1と同様)と、利用者との授受のための現金を取り扱う現金入出金部2510と、通帳に取引内容を印字する通帳プリンタ部2520と、レシートなどに印字するプリンタ部2530と、端末記憶部2540とこれらを制御する端末制御部2550とを有する。なお、端末制御部2550は図1の制御部150に対応し、端末記憶部2540は図1の記憶部140に対応する。
(Eighth embodiment)
In the eighth embodiment, a store counter terminal device installed at a store counter of a financial institution using the image processing apparatus 100 according to any one of the first to sixth embodiments will be described. In financial institutions, etc., images of transaction forms entered by customers are captured by scanners connected to terminal devices installed at sales offices, and the resulting image data is stored and character recognition is performed on the image data. It is. As shown in FIG. 25, the sales office window terminal device 2500 includes an operation unit 110 (similar to FIG. 1), a display unit 120 (similar to FIG. 1), and an imaging unit 130 such as a stand-type scanner (similar to FIG. 1). ), A cash deposit / withdrawal unit 2510 that handles cash for exchange with a user, a passbook printer unit 2520 that prints transaction contents on a passbook, a printer unit 2530 that prints on receipts, a terminal storage unit 2540, and the like A terminal control unit 2550 for controlling. The terminal control unit 2550 corresponds to the control unit 150 in FIG. 1, and the terminal storage unit 2540 corresponds to the storage unit 140 in FIG.

以下、営業店窓口端末装置2500を利用した業務フローについて説明する。営業店窓口端末装置2500は、利用者から取引科目別の取引帳票を受け取ったオペレータが、帳票と対応する取引データ入力画面を呼び出すための画面番号を操作部110から入力し、表示部120である端末画面に表示された取引画面の各入力フィールドに取引金額等、帳票上の記入データをキーボード入力することにより、目的の取引を実行する。   Hereinafter, a business flow using the sales office window terminal device 2500 will be described. The sales office window terminal device 2500 is a display unit 120 in which an operator who receives a transaction form for each transaction item from a user inputs a screen number for calling a transaction data input screen corresponding to the form from the operation unit 110. The target transaction is executed by inputting the entry data on the form such as the transaction amount into each input field of the transaction screen displayed on the terminal screen.

さらに、端末制御部2550は、撮像部130であるスキャナによって採取した取引帳票の画像を採取し、その画像に基づいてOCR(Optical Character Recognition)機能により記載内容を読取り、取引内容の確認画面を表示部120に表示する。この場合、取引内容の確認画面には、帳票からOCRで読取られた各データ項目の内容、例えば、店番、口座番号、入金額などが表示され、確認画面の表示データに問題がなければ、これらのデータが記録データとして管理装置に送信処理される。なお、認識結果の確認を容易にするために、確認画面に図10(a)の入力画像と図10(b)から(d)のうちの1つもしくは2つ以上の2値画像を表示してもよい。   Further, the terminal control unit 2550 collects an image of the transaction form collected by the scanner which is the imaging unit 130, reads the description content by an OCR (Optical Character Recognition) function based on the image, and displays a confirmation screen of the transaction content Displayed on the unit 120. In this case, the transaction details confirmation screen displays the contents of each data item read from the form by OCR, for example, the store number, account number, deposit amount, etc. Are transmitted to the management apparatus as recording data. In order to facilitate the confirmation of the recognition result, the input image of FIG. 10 (a) and one or more binary images of FIGS. 10 (b) to 10 (d) are displayed on the confirmation screen. May be.

このように、営業店窓口端末装置2500によれば、撮像部130によって採取した画像上からOCR処理を実行することができる。   Thus, according to the branch office terminal device 2500, the OCR process can be executed from the image collected by the imaging unit 130.

100 画像処理装置
110 操作部
120 表示部
130 撮像部
140 記憶部
150 制御部
151 撮像処理部
152 画像処理部
2400 画像処理装置
2410 制御部
2411 文字認識部
2500 営業店窓口端末装置
2510 現金入出金部
2520 通帳プリンタ部
2530 プリンタ部
2540 端末記憶部
2550 端末制御部
DESCRIPTION OF SYMBOLS 100 Image processing apparatus 110 Operation part 120 Display part 130 Imaging part 140 Storage part 150 Control part 151 Imaging process part 152 Image processing part 2400 Image processing apparatus 2410 Control part 2411 Character recognition part 2500 Office counter terminal device 2510 Cash deposit / withdrawal part 2520 Passbook printer unit 2530 Printer unit 2540 Terminal storage unit 2550 Terminal control unit

Claims (3)

スキャナで撮像して得られたカラー画像から2値画像を生成する画像処理装置であって、
前記2値画像を生成するための色分離基準を記憶する記憶部と、
色クラスタリングにより前記カラー画像の複数の色の色情報を求め、
前記求めた複数の色の色情報に基づいて、2以上の色分離基準を算出し、
前記求めた複数の色の色情報と前記色分離基準に基づいて、前記色分離基準を切り替えて前記カラー画像の2値化処理を行い、
前記2値化された画素値を前記記憶部に格納する画像処理部と、
を備え、
前記画像処理部は、
前記カラー画像を部分領域に分割し、
色クラスタリングにより各領域の背景色を求め、
前記背景色とそれ以外の色との色分離基準を複数算出し、
前記色分離基準を切り替えて2値化処理を行い、
各画素の色と前記背景色との差分に基づいて複数の分離基準を算出し、
前記複数の分離基準を用いて画素を複数のクラスに分類し、
前記領域を部分領域に分割し、各部分領域内で、前記の各クラスに属する画素数をカウントして、存在比率を求め、前記存在比率に基づいて黒化するクラスを決定することを特徴とする画像処理装置。
An image processing apparatus that generates a binary image from a color image obtained by imaging with a scanner,
A storage unit for storing color separation criteria for generating the binary image;
Obtaining color information of a plurality of colors of the color image by color clustering;
Two or more color separation criteria are calculated based on the obtained color information of the plurality of colors,
Based on the obtained color information of the plurality of colors and the color separation criterion, the color separation criterion is switched to perform binarization processing of the color image,
An image processing unit for storing the binarized pixel values in the storage unit;
With
The image processing unit
Dividing the color image into partial areas;
Obtain the background color of each area by color clustering,
Calculating a plurality of color separation criteria for the background color and other colors;
Perform binarization processing by switching the color separation standard,
Calculating a plurality of separation criteria based on the difference between the color of each pixel and the background color;
Classifying pixels into a plurality of classes using the plurality of separation criteria;
Dividing the region into partial regions, counting the number of pixels belonging to each class in each partial region, obtaining an existence ratio, and determining a class to be blackened based on the existence ratio An image processing apparatus.
スキャナで撮像して得られたカラー画像から2値画像を生成する画像処理方法であって、  An image processing method for generating a binary image from a color image obtained by imaging with a scanner,
前記2値画像を生成するための色分離基準を記憶する記憶部を用い、  Using a storage unit that stores color separation criteria for generating the binary image,
色クラスタリングにより前記カラー画像の複数の色の色情報を求め、  Obtaining color information of a plurality of colors of the color image by color clustering;
前記求めた複数の色の色情報に基づいて、2以上の色分離基準を算出し、  Two or more color separation criteria are calculated based on the obtained color information of the plurality of colors,
前記求めた複数の色の色情報と前記色分離基準に基づいて、前記色分離基準を切り替えて前記カラー画像の2値化処理を行い、  Based on the obtained color information of the plurality of colors and the color separation criterion, the color separation criterion is switched to perform binarization processing of the color image,
前記2値化された画素値を前記記憶部に格納する画像処理方法であって、さらに、  An image processing method for storing the binarized pixel values in the storage unit, further comprising:
前記カラー画像を部分領域に分割し、  Dividing the color image into partial areas;
色クラスタリングにより各領域の背景色を求め、  Obtain the background color of each area by color clustering,
前記背景色とそれ以外の色との色分離基準を複数算出し、  Calculating a plurality of color separation criteria for the background color and other colors;
前記色分離基準を切り替えて2値化処理を行い、  Perform binarization processing by switching the color separation standard,
各画素の色と前記背景色との差分に基づいて複数の分離基準を算出し、  Calculating a plurality of separation criteria based on the difference between the color of each pixel and the background color;
前記複数の分離基準を用いて画素を複数のクラスに分類し、  Classifying pixels into a plurality of classes using the plurality of separation criteria;
前記領域を部分領域に分割し、各部分領域内で、前記の各クラスに属する画素数をカウントして、存在比率を求め、前記存在比率に基づいて黒化するクラスを決定することを特徴とする画像処理方法。  Dividing the region into partial regions, counting the number of pixels belonging to each class in each partial region, obtaining an existence ratio, and determining a class to be blackened based on the existence ratio Image processing method.
スキャナで撮像して得られたカラー画像から2値画像を生成するためのプログラムであって、
色クラスタリングにより入力されるカラー画像の複数の色の色情報を求めるステップと、
前記求めた複数の色の色情報に基づいて、2以上の色分離基準を算出するステップと、
前記求めた複数の色の色情報と前記色分離基準に基づいて、前記色分離基準を切り替えて前記カラー画像の2値化処理を行うステップと、
前記2値化された画素値を記憶部に格納するステップと、
を計算機に実行させることを特徴とするプログラムであって、さらに、
前記カラー画像を部分領域に分割するステップと、
色クラスタリングにより各領域の背景色を求めるステップと、
前記背景色とそれ以外の色との色分離基準を複数算出するステップと、
前記色分離基準を切り替えて2値化処理を行うステップと、
各画素の色と前記背景色との差分に基づいて複数の分離基準を算出するステップと、
前記複数の分離基準を用いて画素を複数のクラスに分類するステップと、
前記領域を部分領域に分割し、各部分領域内で、前記の各クラスに属する画素数をカウントして、存在比率を求め、前記存在比率に基づいて黒化するクラスを決定するステップと、を計算機に実行させることを特徴とするプログラム。
A program for generating a binary image from a color image obtained by imaging with a scanner,
Obtaining color information of a plurality of colors of a color image input by color clustering;
Calculating two or more color separation criteria based on the obtained color information of the plurality of colors;
Performing binarization processing of the color image by switching the color separation reference based on the obtained color information of the plurality of colors and the color separation reference;
Storing the binarized pixel values in a storage unit;
Is a program characterized by causing a computer to execute,
Dividing the color image into partial regions;
Obtaining a background color for each region by color clustering;
Calculating a plurality of color separation criteria for the background color and other colors;
Performing binarization processing by switching the color separation reference;
Calculating a plurality of separation criteria based on the difference between the color of each pixel and the background color;
Classifying pixels into a plurality of classes using the plurality of separation criteria;
Dividing the region into partial regions, counting the number of pixels belonging to each class in each partial region, obtaining an existence ratio, and determining a class to be blackened based on the existence ratio; A program characterized by being executed by a computer.
JP2012215486A 2012-09-28 2012-09-28 Image processing apparatus, image processing method, and program Active JP5887242B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012215486A JP5887242B2 (en) 2012-09-28 2012-09-28 Image processing apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012215486A JP5887242B2 (en) 2012-09-28 2012-09-28 Image processing apparatus, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2014071556A JP2014071556A (en) 2014-04-21
JP5887242B2 true JP5887242B2 (en) 2016-03-16

Family

ID=50746725

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012215486A Active JP5887242B2 (en) 2012-09-28 2012-09-28 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP5887242B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6294524B1 (en) * 2017-02-15 2018-03-14 ソフネック株式会社 Image processing method and computer program
JP7205292B2 (en) * 2019-02-26 2023-01-17 京セラドキュメントソリューションズ株式会社 Information processing device and image forming device
JP7370574B2 (en) 2019-10-08 2023-10-30 株式会社コミチ Frame extraction method and program
CN111045617B (en) * 2019-12-27 2023-12-08 湖南鼎一致远科技发展有限公司 Picture gray scale printing method, system, control chip and printer

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004094427A (en) * 2002-08-30 2004-03-25 Hitachi Ltd Slip image processor and program for realizing the same device
JP4603807B2 (en) * 2004-03-10 2010-12-22 富士通株式会社 Character recognition device, character recognition method, medium processing method, character recognition program, and computer-readable recording medium on which character recognition program is recorded
JP4825888B2 (en) * 2009-03-17 2011-11-30 株式会社東芝 Document image processing apparatus and document image processing method
JP5337563B2 (en) * 2009-04-08 2013-11-06 日立コンピュータ機器株式会社 Form recognition method and apparatus

Also Published As

Publication number Publication date
JP2014071556A (en) 2014-04-21

Similar Documents

Publication Publication Date Title
US10455117B2 (en) Image processing apparatus, method, and storage medium
CN102469234B (en) Image processing apparatus, image reading apparatus, image forming apparatus, and image processing method
CN110008954B (en) Complex background text image extraction method and system based on multi-threshold fusion
US20070253040A1 (en) Color scanning to enhance bitonal image
JP5830338B2 (en) Form recognition method and form recognition apparatus
JP6139396B2 (en) Method and program for compressing binary image representing document
TWI467515B (en) Multi-color dropout for scanned document
US8712188B2 (en) System and method for document orientation detection
US6757426B2 (en) System and method for image processing by automatic color dropout
KR100542365B1 (en) Appratus and method of improving image
EP1327955A2 (en) Text extraction from a compound document
KR101597739B1 (en) Image processing apparatus, image processing method, and computer readable medium
JP6874387B2 (en) Image processing equipment, image processing methods and programs
CN101551859B (en) Image recognition device and image retrieval device
JP5337563B2 (en) Form recognition method and apparatus
JP5701181B2 (en) Image processing apparatus, image processing method, and computer program
JP2008252862A (en) Image processing apparatus, image processing method, and image processing program
JP4423333B2 (en) Background area specifying method, background area specifying system, background color determining method, control program, and recording medium
JP2007081458A (en) Image processing apparatus and control method of image processing apparatus
JP5887242B2 (en) Image processing apparatus, image processing method, and program
JP5608511B2 (en) Image correction apparatus and image correction method
Fernández-Caballero et al. Display text segmentation after learning best-fitted OCR binarization parameters
US20140086473A1 (en) Image processing device, an image processing method and a program to be used to implement the image processing
JP5929282B2 (en) Image processing apparatus and image processing program
JP2010186246A (en) Image processing apparatus, method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141029

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141029

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150714

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150721

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150817

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160215

R150 Certificate of patent or registration of utility model

Ref document number: 5887242

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350