JP2022023288A - Image processing device, method, and program - Google Patents

Image processing device, method, and program Download PDF

Info

Publication number
JP2022023288A
JP2022023288A JP2020126112A JP2020126112A JP2022023288A JP 2022023288 A JP2022023288 A JP 2022023288A JP 2020126112 A JP2020126112 A JP 2020126112A JP 2020126112 A JP2020126112 A JP 2020126112A JP 2022023288 A JP2022023288 A JP 2022023288A
Authority
JP
Japan
Prior art keywords
brightness
image
image processing
value
point
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
JP2020126112A
Other languages
Japanese (ja)
Inventor
洋明 室伏
Hiroaki Murofuse
正行 唐澤
Masayuki Karasawa
和美 鈴木
Kazumi Suzuki
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 Information and Telecommunication Engineering Ltd
Original Assignee
Hitachi Information and Telecommunication Engineering 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 Hitachi Information and Telecommunication Engineering Ltd filed Critical Hitachi Information and Telecommunication Engineering Ltd
Priority to JP2020126112A priority Critical patent/JP2022023288A/en
Publication of JP2022023288A publication Critical patent/JP2022023288A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Input (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

To provide a technology capable of reducing color unevenness and brightness unevenness of a scanned image and improving visibility.SOLUTION: An image processing device according to an embodiment inputs an image in which a form is optically read, creates a brightness histogram for each point in the image, calculates the brightness average value (V1) in a brightness range (W) by the brightness width (±k1) set for the correction target point brightness (V0) by histogram by using the brightness for each point as the correction target point brightness (V0), and performs processing of generating and outputting an image corrected to replace the correction target point brightness (V0) with the brightness average value (V1).SELECTED DRAWING: Figure 12

Description

本発明は、画像処理技術に関し、光学的な読み取り画像を補正する技術に関する。 The present invention relates to an image processing technique and a technique for correcting an optically read image.

帳票等の用紙をスキャナ装置で光学的に読み取った場合の読み取り画像には、色ムラ、言い換えると明度ムラが生じる場合がある。読み取り画像の色ムラ等を補正する画像処理技術としては、シェーディング補正方式等がある。シェーディング補正方式は、画像領域内の色・明度の分布において、読み取り時のレンズ特性等に起因して、周辺領域が暗くなっている読み取り画像の場合に、周辺領域の暗い部分を明るくして均一化するように補正を行う方式である。 When a paper such as a form is optically scanned by a scanner device, the scanned image may have color unevenness, in other words, brightness unevenness. As an image processing technique for correcting color unevenness of a scanned image, there is a shading correction method or the like. The shading correction method brightens and uniforms the dark part of the peripheral area in the case of a scanned image in which the peripheral area is dark due to the lens characteristics at the time of reading in the distribution of color and brightness in the image area. It is a method of making corrections so that it becomes.

上記読み取り画像の色ムラ等を補正する画像処理に関して、先行技術例としては、特開平9-149277号公報が挙げられる。特許文献1には、「画像明度変換装置」として、「入力される画像濃度がその都度ばらついても忠実な色のままで、最大のコントラストを得て、好ましい明るさに自動的に適正化できる」旨が記載されている。特許文献1では、明度変換として、明度のヒストグラムを用いる旨が記載されている。 Regarding the image processing for correcting the color unevenness of the read image, Japanese Patent Application Laid-Open No. 9-149277 is mentioned as an example of the prior art. According to Patent Document 1, as an "image brightness conversion device", "even if the input image density varies each time, the color remains faithful, the maximum contrast can be obtained, and the desired brightness can be automatically adjusted. "It is stated. Patent Document 1 describes that a lightness histogram is used as a lightness conversion.

特開平9-149277号公報Japanese Unexamined Patent Publication No. 9-149277

帳票の用紙に、紙質に応じたすきムラや、記載時の筆圧や搬送時のばたつき等に応じたよれや折れ曲がり、言い換えると、紙面において厚さの違いの分布が生じている場合がある。その場合、その帳票の読み取り画像には、ランダムな箇所に、色ムラ・明度ムラが生じる場合がある。その読み取り画像を人の眼から見た場合、視認性が良くない場合がある。あるいは、用紙の重なり・裏写り等がある場合には、透けた文字等が読み取り画像に見えてしまうことで、視認性が良くない場合がある。 The form paper may have uneven plows depending on the paper quality, and may be twisted or bent according to the writing pressure at the time of writing or fluttering at the time of transportation, in other words, there may be a distribution of differences in thickness on the paper surface. In that case, color unevenness and lightness unevenness may occur in random places in the read image of the form. When the read image is viewed from the human eye, the visibility may not be good. Alternatively, if there is overlap or show-through of the paper, the transparent characters or the like may appear in the read image, and the visibility may not be good.

本発明の目的は、画像処理技術に関して、読み取り画像の色ムラ・明度ムラを低減して視認性を高めることができる技術を提供することである。 An object of the present invention is to provide an image processing technique capable of reducing color unevenness and brightness unevenness of a scanned image and improving visibility.

本発明のうち代表的な実施の形態は、以下に示す構成を有する。実施の形態の画像処理装置は、帳票が光学的に読み取られた画像を入力し、前記画像内でのポイント毎の明度のヒストグラムを作成し、前記ポイント毎の明度を補正対象ポイント明度として、前記ヒストグラムでの前記補正対象ポイント明度に対し設定される明度幅による明度範囲での明度平均値を計算し、前記補正対象ポイント明度を前記明度平均値で置き換えるように補正した画像を生成し出力する処理を行う。 A typical embodiment of the present invention has the following configurations. The image processing apparatus of the embodiment inputs an image in which the form is optically read, creates a brightness histogram for each point in the image, and sets the brightness for each point as the correction target point brightness. A process of calculating the brightness average value in the brightness range according to the brightness width set for the correction target point brightness in the histogram, and generating and outputting an image corrected so as to replace the correction target point brightness with the brightness average value. I do.

本発明のうち代表的な実施の形態によれば、画像処理技術に関して、読み取り画像の色ムラ・明度ムラを低減して視認性を高めることができる。 According to a typical embodiment of the present invention, it is possible to reduce color unevenness and brightness unevenness of a scanned image and improve visibility with respect to an image processing technique.

本発明の実施の形態1の画像処理装置を含む、システムの構成を示す図である。It is a figure which shows the structure of the system including the image processing apparatus of Embodiment 1 of this invention. 実施の形態1で、読み取りの対象となる帳票の例を示す図である。It is a figure which shows the example of the form to be read in Embodiment 1. 実施の形態1で、補正前画像と補正後画像の例を示す図である。It is a figure which shows the example of the image before correction and the image after correction in Embodiment 1. 実施の形態1で、補正前画像内の明度分布の例を示す図である。It is a figure which shows the example of the brightness distribution in the image before correction in Embodiment 1. FIG. 実施の形態1で、補正後画像内の明度分布の例を示す図である。It is a figure which shows the example of the brightness distribution in the corrected image in Embodiment 1. FIG. 実施の形態1で、主な処理フローのその1を示す図である。It is a figure which shows 1 of the main processing flow in Embodiment 1. FIG. 実施の形態1で、主な処理フローのその2を示す図である。It is a figure which shows the 2 of the main processing flow in Embodiment 1. FIG. 実施の形態1で、主な処理フローのその3を示す図である。It is a figure which shows 3 of the main processing flow in Embodiment 1. FIG. 実施の形態1で、対象画像のデータ形式の例を示す図である。It is a figure which shows the example of the data format of the target image in Embodiment 1. FIG. 実施の形態1で、明度のヒストグラムの例を示す図である。It is a figure which shows the example of the histogram of the brightness in Embodiment 1. FIG. 実施の形態1で、ヒストグラム中のポイントおよび範囲の例を示す図である。It is a figure which shows the example of the point and the range in a histogram in Embodiment 1. FIG. 実施の形態1で、ポイントの範囲での平均値の計算例を示す図である。It is a figure which shows the calculation example of the average value in the range of a point in Embodiment 1. FIG. 実施の形態1で、ルックアップテーブル(LUT)の例を示す図である。It is a figure which shows the example of the look-up table (LUT) in Embodiment 1. FIG. 実施の形態1の変形例で、ユーザ設定情報の例を示す図である。It is a modification of Embodiment 1 and is a figure which shows the example of the user setting information. 実施の形態1の変形例で、読み取り画像の処理例を示す図である。It is a modification of Embodiment 1 and is a figure which shows the processing example of the scanned image.

以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、全図面において同一部には原則として同一符号を付し、繰り返しの説明は省略する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In principle, the same parts are designated by the same reference numerals in all drawings, and repeated description will be omitted.

[課題等]
課題等について補足説明する。従来のシェーディング補正方式等の画像補正方法は、画像内の暗い部分(特に周辺領域)を明るくして均一化するように補正する。この方式では、対象画像は補正後に全体的な明度が高くなる。このような画像補正方式は、前述の帳票の読み取り画像におけるランダムな箇所に生じる色ムラ・明度ムラには有効ではない。また、他の画像補正方法としては、画像内の明度ムラがある領域について、明度の平均値等を算出して、その1つの明度値に塗りつぶすように補正する方式も挙げられる。しかし、領域内の全ポイントが同一の明度になると、人の眼から見て違和感が生じる場合がある。また、読み取り画像内において、領域毎に明度を補正する場合、その領域毎の識別や設定が必要であるが、これには処理の難しさや計算処理負荷の高さ等がある。
[Issues, etc.]
A supplementary explanation will be given regarding issues. An image correction method such as a conventional shading correction method corrects a dark part (particularly a peripheral area) in an image so as to brighten and make it uniform. In this method, the target image has a high overall brightness after correction. Such an image correction method is not effective for color unevenness and lightness unevenness that occur at random locations in the above-mentioned form read image. Further, as another image correction method, there is also a method of calculating an average value of lightness or the like in a region having uneven brightness in an image and correcting the area so as to fill it with one lightness value. However, when all the points in the area have the same brightness, a feeling of strangeness may occur from the human eye. Further, when the brightness is corrected for each area in the scanned image, it is necessary to identify and set each area, which is difficult to process and has a high calculation processing load.

これに対し、実施の形態の画像処理方法は、画像内のランダムな箇所の色ムラ・明度ムラについて、明暗を補正する。この補正は、ポイント毎に、暗い箇所を明るくなるように補正すること(言い換えると明度を上げる補正)と、明るい箇所を暗くなるように補正すること(言い換えると明度を下げる補正)との両方を含む補正である。 On the other hand, the image processing method of the embodiment corrects lightness and darkness for color unevenness and lightness unevenness of random parts in an image. This correction is both a correction to make dark areas brighter (in other words, a correction to increase brightness) and a correction to make bright areas darker (in other words, a correction to decrease brightness) for each point. It is a correction including.

具体的には、実施の形態の画像処理方法は、対象画像内における各ポイント(例えば画素)の明度毎に、所定の明度範囲でのヒストグラムを用いて、明度の平均値等を計算し、その平均値等(すなわち補正値)によって、そのポイントの明度を置き換えるように補正するステップを有する。これにより、補正後画像では、ランダムな箇所の色ムラ・明度ムラが低減され、人の眼から見た視認性が向上する。それとともに、全体的な明度はあまり変わらない。 Specifically, in the image processing method of the embodiment, the average value of brightness and the like are calculated for each brightness of each point (for example, a pixel) in the target image by using a histogram in a predetermined brightness range. It has a step of correcting so as to replace the brightness of the point by an average value or the like (that is, a correction value). As a result, in the corrected image, color unevenness and brightness unevenness at random parts are reduced, and the visibility seen from the human eye is improved. At the same time, the overall brightness does not change much.

<実施の形態1>
図1~図13等を用いて、本発明の実施の形態1の画像処理装置、方法、およびプログラムについて説明する。実施の形態1の画像処理方法は、実施の形態1の画像処理装置で実行されるステップを有する方法である。実施の形態1の画像処理プログラムは、実施の形態1の画像処理装置に処理を実行させるプログラムである。
<Embodiment 1>
The image processing apparatus, method, and program according to the first embodiment of the present invention will be described with reference to FIGS. 1 to 13. The image processing method of the first embodiment is a method having a step executed by the image processing apparatus of the first embodiment. The image processing program of the first embodiment is a program that causes the image processing apparatus of the first embodiment to execute the processing.

[画像処理装置]
図1は、実施の形態1の画像処理装置1を含む、システムの構成例を示す。図1のシステムは、画像処理装置1とスキャナ装置2とがLAN等の通信手段で接続されているシステムである。ユーザU1は、画像処理装置1やスキャナ装置2を操作する。ユーザU1は、帳票3(言い換えると用紙)を、スキャナ装置2で読み取らせ、読み取りによって得られた画像(帳票画像ファイル4)を、画像処理装置1で処理させて、帳票認識結果等を得る。
[Image processing device]
FIG. 1 shows a configuration example of a system including the image processing apparatus 1 of the first embodiment. The system of FIG. 1 is a system in which an image processing device 1 and a scanner device 2 are connected by a communication means such as a LAN. The user U1 operates the image processing device 1 and the scanner device 2. The user U1 reads the form 3 (in other words, paper) by the scanner device 2, processes the image (form image file 4) obtained by the reading by the image processing device 1, and obtains the form recognition result and the like.

スキャナ装置2は、セットされた帳票3等の紙面を光学的に走査して画像を読み取る装置である。スキャナ装置2は、読み取りの結果として、帳票画像ファイル4を出力する。帳票画像ファイル4は、LANを通じて、画像処理装置1に転送される。画像処理装置1は、通信インタフェース装置103によって帳票画像ファイル4を受信・入力し、記憶装置102内に補正前の画像ファイル122として格納する。なお、スキャナ装置2は、スキャナ機能およびプリンタ機能等を持つ複合機等としてもよい。 The scanner device 2 is a device that optically scans a set paper surface such as a form 3 to read an image. The scanner device 2 outputs the form image file 4 as a result of reading. The form image file 4 is transferred to the image processing device 1 via a LAN. The image processing device 1 receives and inputs the form image file 4 by the communication interface device 103, and stores the form image file 4 in the storage device 102 as the image file 122 before correction. The scanner device 2 may be a multifunction device or the like having a scanner function, a printer function, and the like.

画像処理装置1は、実施の形態1の画像処理プログラムが実装されているコンピュータである。また、本例では特に、画像処理装置1は、OCR装置(言い換えると帳票認識装置)であり、帳票認識プログラム内に実施の形態1の画像処理プログラムが含まれている。実施の形態1の画像処理プログラムは、実施の形態1の画像処理方法に対応する、色ムラ補正処理を含む画像処理および情報処理をコンピュータ(画像処理装置1)に実行させるプログラムである。 The image processing device 1 is a computer on which the image processing program of the first embodiment is implemented. Further, in this example, in particular, the image processing device 1 is an OCR device (in other words, a form recognition device), and the image processing program of the first embodiment is included in the form recognition program. The image processing program of the first embodiment is a program for causing a computer (image processing device 1) to execute image processing and information processing including color unevenness correction processing corresponding to the image processing method of the first embodiment.

この画像処理装置1は、例えばPCおよびそれに搭載されるソフトウェアで構成されているが、OCRや複合機等の専用装置として構成されてもよい。また、本例では、画像処理装置1とスキャナ装置2とに分かれている構成であるが、これに限らず、画像処理装置1とスキャナ装置2とが一体である構成でもよい。 The image processing device 1 is composed of, for example, a PC and software mounted on the PC, but may be configured as a dedicated device such as an OCR or a multifunction device. Further, in this example, the configuration is divided into the image processing device 1 and the scanner device 2, but the configuration is not limited to this, and the image processing device 1 and the scanner device 2 may be integrated.

画像処理装置1は、入力の帳票画像ファイル4に対し、色ムラ補正処理を含む、帳票認識処理を行う。画像処理装置1は、入力の帳票画像ファイル4を、補正前の画像ファイル122とし、色ムラ補正処理を行い、処理後の出力が、補正後の画像ファイル123となる。実施の形態1の画像処理プログラム(制御プログラム121に含まれている)は、その色ムラ補正処理を行うプログラムである。実施の形態1の画像処理プログラムは、補正前の画像ファイル122を入力として、色ムラ補正処理を行い、補正後の画像ファイル123を出力する。画像処理装置1の帳票認識プログラムは、補正後の画像ファイル123に対し、文字等を認識して抽出する帳票認識処理、言い換えるとOCR処理を行い、その処理の結果を、帳票認識結果データ124として出力する。 The image processing device 1 performs a form recognition process including a color unevenness correction process on the input form image file 4. The image processing device 1 uses the input form image file 4 as the image file 122 before correction, performs color unevenness correction processing, and outputs the processed image file 123 after correction. The image processing program (included in the control program 121) of the first embodiment is a program that performs the color unevenness correction processing. The image processing program of the first embodiment takes the image file 122 before correction as an input, performs color unevenness correction processing, and outputs the corrected image file 123. The form recognition program of the image processing device 1 performs a form recognition process for recognizing and extracting characters and the like, in other words, an OCR process, on the corrected image file 123, and the result of the process is used as the form recognition result data 124. Output.

画像処理装置1であるコンピュータは、演算装置101、記憶装置102(言い換えるとメモリ)、通信インタフェース装置103、入出力インタフェース装置104、入力装置105、表示装置106、外部記憶装置107等を備え、これらはバス等を介して相互に接続されている。演算装置101は、CPU、ROM、RAM等により構成され、装置全体を制御するプロセッサまたはコントローラを実現する。演算装置101は、ソフトウェアプログラム処理により実現される機能ブロックとして、帳票画像入力部11、帳票認識処理部12、帳票認識結果出力部13、表示部14、設定部15、および画像処理部20を有する。画像処理部20は、実施の形態1の画像処理プログラムによって実現され、言い換えると、色ムラ補正処理部である。演算装置101は、記憶装置102の制御プログラム121を読み出してその制御プログラム121に従った処理を実行することにより、各機能ブロックを実現する。制御プログラム121は、実施の形態1の画像処理プログラム、および帳票認識プログラムを含む。 The computer which is the image processing device 1 includes an arithmetic unit 101, a storage device 102 (in other words, a memory), a communication interface device 103, an input / output interface device 104, an input device 105, a display device 106, an external storage device 107, and the like. Are connected to each other via a bus or the like. The arithmetic unit 101 is composed of a CPU, ROM, RAM, and the like, and realizes a processor or a controller that controls the entire device. The arithmetic unit 101 has a form image input unit 11, a form recognition processing unit 12, a form recognition result output unit 13, a display unit 14, a setting unit 15, and an image processing unit 20 as functional blocks realized by software program processing. .. The image processing unit 20 is realized by the image processing program of the first embodiment, in other words, it is a color unevenness correction processing unit. The arithmetic unit 101 realizes each functional block by reading out the control program 121 of the storage device 102 and executing the process according to the control program 121. The control program 121 includes the image processing program of the first embodiment and the form recognition program.

記憶装置102には、不揮発性記憶装置等で構成され、演算装置101等が扱う各種のデータや情報が記憶されている。記憶装置102には、制御プログラム121、補正前の画像ファイル122、補正後の画像ファイル123、および帳票認識結果データ124等が記憶される。図示しないが、制御プログラム121には、プログラムやユーザの設定情報も伴う。設定情報は、例えば、帳票認識のための認識フォーマット情報等がある。認識フォーマット情報では、例えば帳票3毎の形式に応じて、読み取りフィールド(文字等を認識する対象となるフィールド)等が設定されている。帳票認識結果データ124は、帳票認識処理の結果として作成される、帳票3内から認識された文字や図形等の情報を含むデータである。なお、画像処理装置1の外部にDBサーバやストレージ装置等が接続され、それらに各種のデータや情報が格納されてもよい。 The storage device 102 is composed of a non-volatile storage device or the like, and stores various data and information handled by the arithmetic unit 101 and the like. The storage device 102 stores the control program 121, the image file 122 before correction, the image file 123 after correction, the form recognition result data 124, and the like. Although not shown, the control program 121 also includes program and user setting information. The setting information includes, for example, recognition format information for form recognition. In the recognition format information, for example, a reading field (a field for recognizing characters and the like) and the like are set according to the format of each form 3. The form recognition result data 124 is data that is created as a result of the form recognition process and includes information such as characters and figures recognized from within the form 3. A DB server, a storage device, or the like may be connected to the outside of the image processing device 1 and various data and information may be stored in them.

補正前の画像ファイル122は、後述するが、色ムラを含む場合があり、画像処理部20は、その色ムラを低減する色ムラ補正処理を行う。その処理の結果、色ムラが低減された画像が、補正後の画像ファイル123となる。色ムラが低減された補正後の画像ファイル123は、ユーザU1から見て視認性が高い好適な画像となる。また、画像処理装置1は、補正後の画像ファイル123を用いて、帳票認識処理を行うことで、より高精度な結果を得られる可能性がある。 As will be described later, the image file 122 before correction may include color unevenness, and the image processing unit 20 performs color unevenness correction processing for reducing the color unevenness. As a result of the processing, the image in which the color unevenness is reduced becomes the corrected image file 123. The corrected image file 123 with reduced color unevenness is a suitable image with high visibility when viewed from the user U1. Further, the image processing device 1 may obtain a more accurate result by performing the form recognition process using the corrected image file 123.

通信インタフェース装置103は、スキャナ装置2等の外部装置との間で所定の通信インタフェースで通信処理を行う部分である。画像処理装置1は、スキャナ装置2に限らず、外部のサーバ装置やストレージ装置等の装置との間でデータを授受してもよい。 The communication interface device 103 is a portion that performs communication processing with a predetermined communication interface with an external device such as the scanner device 2. The image processing device 1 is not limited to the scanner device 2, and may exchange data with an external device such as a server device or a storage device.

入出力インタフェース装置104には、入力装置105、表示装置106、および外部記憶装置107等が接続されている。入力装置105は、例えばキーボードやマウスや操作パネルが挙げられる。ユーザは、入力装置105を通じて指示等を入力する。表示装置106は、液晶ディスプレイ等が挙げられる。入力装置105および表示装置106は、タッチパネルとしてもよい。表示装置106の表示画面には、所定のグラフィカル・ユーザ・インタフェース(GUI)を伴う画面が表示される。この画面は、帳票認識機能や色ムラ補正機能に係わる設定や確認等を可能とする画面である。ユーザは、その画面を通じて、帳票認識や色ムラ補正に係わる作業が可能である。 An input device 105, a display device 106, an external storage device 107, and the like are connected to the input / output interface device 104. Examples of the input device 105 include a keyboard, a mouse, and an operation panel. The user inputs an instruction or the like through the input device 105. Examples of the display device 106 include a liquid crystal display and the like. The input device 105 and the display device 106 may be a touch panel. The display screen of the display device 106 displays a screen with a predetermined graphical user interface (GUI). This screen is a screen that enables settings and confirmations related to the form recognition function and the color unevenness correction function. The user can perform work related to form recognition and color unevenness correction through the screen.

外部記憶装置107は、例えばディスク装置やメモリカード装置等が挙げられる。外部記憶装置107には、演算装置101からの制御に基づいて、画像ファイル等の保存が可能である。画像処理装置1は、外部記憶装置107に格納されている画像ファイル等を入力してもよい。 Examples of the external storage device 107 include a disk device and a memory card device. The external storage device 107 can store an image file or the like based on the control from the arithmetic unit 101. The image processing device 1 may input an image file or the like stored in the external storage device 107.

帳票画像入力部11は、スキャナ装置2からの帳票画像ファイル122を入力して記憶装置102に補正前の画像ファイル122として格納する。帳票認識処理部12は、認識対象の画像ファイル(例えば補正後の画像ファイル122)に対し、帳票認識処理(OCR処理)を行って、抽出した文字等の情報を含む帳票認識結果データ124を作成し、記憶装置102に格納する。帳票認識結果出力部13は、帳票認識結果データ124に基づいた帳票認識結果情報を表示画面に表示する。ユーザU1は、画面でその帳票認識結果情報を見て、確認や修正を行うことができる。表示部14は、帳票認識機能や色ムラ補正機能に係わる各種の画面を構成し、表示装置106の表示画面に表示する。設定部15は、画面を通じて、帳票認識機能や色ムラ補正機能に関するユーザ設定を受け付けて設定情報として記憶する。 The form image input unit 11 inputs the form image file 122 from the scanner device 2 and stores it in the storage device 102 as the image file 122 before correction. The form recognition processing unit 12 performs form recognition processing (OCR processing) on the image file to be recognized (for example, the corrected image file 122), and creates form recognition result data 124 including information such as extracted characters. And store it in the storage device 102. The form recognition result output unit 13 displays the form recognition result information based on the form recognition result data 124 on the display screen. The user U1 can see the form recognition result information on the screen and confirm or correct it. The display unit 14 configures various screens related to the form recognition function and the color unevenness correction function, and displays them on the display screen of the display device 106. The setting unit 15 receives and stores user settings related to the form recognition function and the color unevenness correction function as setting information through the screen.

画像処理部20(言い換えると色ムラ補正処理部)は、実施の形態1の画像処理プログラムに基づいた画像処理として色ムラ補正処理を行う部分である。補正前の画像ファイル122に対し、この画像処理を行うかどうかは、ユーザU1によっても選択指定できる。デフォルト設定では、この画像処理の機能がオン状態として設定されている。この機能のオン状態では、自動的にこの画像処理が適用される。 The image processing unit 20 (in other words, the color unevenness correction processing unit) is a portion that performs color unevenness correction processing as image processing based on the image processing program of the first embodiment. Whether or not to perform this image processing on the image file 122 before correction can also be selected and specified by the user U1. By default, this image processing function is set to the on state. When this function is on, this image processing is automatically applied.

[帳票]
図2は、帳票3の紙面の例を示す。この帳票3の例は請求書の伝票である。帳票3の紙面には、背景の上に、所定の形式で罫線や文字や図像等が形成されている。背景領域201は、背景の領域の一例であり、背景色として、比較的白に近い、明度が高い領域である。図像領域202は、比較的黒に近い、明度が低い領域の例である。紙質などに応じて背景色は様々である。帳票3内の所定の領域には、人またはコンピュータが記載した文字や図像等があり、OCRによる認識の対象となる。破線の枠(例えば枠203)は、OCRでの読み取りフィールドの例である。
[Form]
FIG. 2 shows an example of the paper surface of the form 3. An example of this form 3 is an invoice slip. On the paper surface of the form 3, ruled lines, characters, iconography and the like are formed in a predetermined format on the background. The background region 201 is an example of a background region, and is a region having a high brightness that is relatively close to white as a background color. The iconographic region 202 is an example of a region having a low lightness, which is relatively close to black. The background color varies depending on the paper quality and the like. In the predetermined area in the form 3, there are characters, images, and the like written by a person or a computer, which are the targets of recognition by OCR. The dashed frame (eg, frame 203) is an example of a read field in OCR.

帳票3は、紙質としては、例えば複写印字が可能な複写用紙(ノーカーボン紙など)である場合もある。帳票3の紙質や、スキャン時の機械的動作(例えば用紙搬送時のばたつき)や、記載時の筆圧等の各種の要因に応じて、帳票3の紙面には、すきムラ、よれ、折れ曲がり等が生じる場合がある。すなわち、紙面には、紙面領域内の分布において、厚さ方向での凹凸、厚さの違いが生じる場合がある。この場合、その帳票3が光学的に読み取られた読み取り画像において、色ムラ、言い換えると明度ムラが生じる場合がある。すなわち、読み取り画像の領域内の分布において、ランダムな箇所に、色ムラ・明度ムラが生じる場合がある。実施の形態での画像処理である色ムラ補正処理は、このような読み取り画像内の色ムラを低減するものである。また、読み取り画像内に、裏写り等による余計な文字等がある場合にも、この色ムラ補正処理によって、低減することができる。 As the paper quality, the form 3 may be, for example, copy paper (carbonless copy paper or the like) capable of copy printing. Depending on various factors such as the paper quality of the form 3, the mechanical operation during scanning (for example, fluttering during paper transportation), and the writing pressure at the time of writing, the paper surface of the form 3 may have uneven plows, twists, bends, etc. May occur. That is, on the paper surface, unevenness and a difference in thickness in the thickness direction may occur in the distribution in the paper surface region. In this case, color unevenness, in other words, brightness unevenness may occur in the scanned image obtained by optically reading the form 3. That is, in the distribution in the region of the scanned image, color unevenness / brightness unevenness may occur at random places. The color unevenness correction processing, which is the image processing in the embodiment, reduces such color unevenness in the read image. Further, even if there are extra characters or the like due to show-through or the like in the scanned image, it can be reduced by this color unevenness correction processing.

[補正前画像-補正後画像]
例えば、図2の帳票3の背景領域201は、基本的には一様な背景色の領域である。この背景領域201等に上記のような厚さ方向の凹凸等が生じていた場合、この帳票3が光学的に読み取られた結果の読み取り画像には、色ムラ・明度ムラが生じている場合がある。
[Image before correction-Image after correction]
For example, the background area 201 of the form 3 in FIG. 2 is basically an area with a uniform background color. If the background area 201 or the like has irregularities in the thickness direction as described above, the scanned image as a result of the form 3 being optically read may have color unevenness and lightness unevenness. be.

図3の(A)は、背景領域に上記のような色ムラ・明度ムラが生じている場合の補正前画像の例を示す模式図である。この補正前画像は、読み取り画像のうちの一部領域の画像例である。この補正前画像では、ランダムな箇所に色・明度の違いが生じており、すなわち色ムラ・明度ムラが生じている。枠線で示す箇所301,302は、色・明度が異なる2か所の例であり、箇所301は比較的暗く、箇所302は比較的明るい。 FIG. 3A is a schematic diagram showing an example of an uncorrected image in the case where the above-mentioned color unevenness / brightness unevenness occurs in the background region. This uncorrected image is an image example of a part of the scanned image. In this uncorrected image, differences in color and lightness occur at random locations, that is, color unevenness and lightness unevenness occur. The locations 301 and 302 shown by the frame lines are examples of two locations having different colors and lightness. The locations 301 are relatively dark and the locations 302 are relatively bright.

図3の(B)は、(A)の補正前画像に対し、実施の形態1による色ムラ補正処理を施した後の補正後画像の例を示す模式図である。(B)の画像は、(A)の画像と比べて、色ムラ・明度ムラが低減されている。なお、(B)の補正後画像は、背景領域が単に1つの色、1つの明度に塗りつぶされているわけではなく、複数の色・明度の分布を有する。 FIG. 3B is a schematic diagram showing an example of the corrected image after the color unevenness correction processing according to the first embodiment is applied to the uncorrected image of (A). The image of (B) has reduced color unevenness and lightness unevenness as compared with the image of (A). In the corrected image of (B), the background area is not simply filled with one color and one lightness, but has a distribution of a plurality of colors and lightness.

[明度分布(色ムラ・明度ムラ)]
図2のような帳票3は、紙面に、背景領域、罫線、ガイダンス文字、ロゴ、記入文字、印鑑等がある。このような帳票3は、写真画像等とは異なり、色・明度のバリエーションが比較的少ない。よって、このような帳票3の読み取り画像は、例えば図4のような明度分布となる。図4の明度分布では、明度は、全明度値には分布しておらず、図示の領域A1~A5のように、いくつかの領域に集まって分布している。
[Brightness distribution (color unevenness / brightness unevenness)]
The form 3 as shown in FIG. 2 has a background area, ruled lines, guidance characters, logos, entry characters, stamps, and the like on the paper. Unlike a photographic image or the like, such a form 3 has relatively few variations in color and lightness. Therefore, such a read image of the form 3 has a brightness distribution as shown in FIG. 4, for example. In the lightness distribution of FIG. 4, the lightness is not distributed in the total lightness value, but is distributed in several areas as shown in the areas A1 to A5 in the figure.

図4は、補正前画像である読み取り画像においてランダムな箇所に色ムラ・明度ムラがある場合における明度分布(言い換えると濃度分布)のグラフを示す。このグラフは、横軸がポイント(画素)の位置座標、縦軸が明度である。このグラフは、2次元画像内のポイントの位置(x,y)と明度Vとの3次元の情報を持つ3次元グラフを、説明用に2次元グラフで表現したものである。横軸のポイント位置は、2次元の位置(x,y)を1次元に並べたものである。 FIG. 4 shows a graph of the brightness distribution (in other words, the density distribution) when there is color unevenness / brightness unevenness at random locations in the scanned image which is the uncorrected image. In this graph, the horizontal axis is the position coordinates of points (pixels), and the vertical axis is the brightness. This graph is a two-dimensional graph representing a three-dimensional graph having three-dimensional information of the position (x, y) of a point in a two-dimensional image and the lightness V for explanation. The point positions on the horizontal axis are two-dimensional positions (x, y) arranged in one dimension.

このグラフは、例えば図2の帳票3の読み取り画像で色ムラがある場合の明度分布を示す。本例では、領域A1~A5に示すように、概略的に5個の集まりで、明度成分を有する。例えば、領域A1は、明度Vが比較的高い領域であり、図2の帳票3のうちの比較的白い背景(例えば背景領域201)の部分に対応する。例えば、領域A5は、明度Vが比較的低い領域であり、図2の帳票3のうちの比較的黒い図像領域(例えば図像領域202)の部分に対応する。 This graph shows, for example, the brightness distribution when there is color unevenness in the read image of the form 3 of FIG. In this example, as shown in regions A1 to A5, approximately five groups have a lightness component. For example, the region A1 is a region having a relatively high brightness V, and corresponds to a portion of the form 3 of FIG. 2 having a relatively white background (for example, the background region 201). For example, the region A5 is a region having a relatively low lightness V, and corresponds to a portion of the relatively black iconographic region (for example, the iconographic region 202) in the form 3 of FIG.

例えば、領域A1内において、ポイント位置毎に明度Vが変動している。領域A1では、明度が、ある範囲403で分布している。最小値401は領域A1内での最小明度値の例、最大値402は領域A1内での最大明度値の例を示す。 For example, in the region A1, the brightness V fluctuates for each point position. In region A1, the brightness is distributed in a certain range 403. The minimum value 401 shows an example of the minimum brightness value in the region A1, and the maximum value 402 shows an example of the maximum brightness value in the region A1.

このように、領域内での明度の変動が大きい現象は、色ムラ・明度ムラに相当する。この明度変動が大きいほど、すなわちムラの度合いが大きいほど、人の眼には視認性が低く感じられる。 As described above, the phenomenon in which the brightness fluctuates greatly in the region corresponds to color unevenness / brightness unevenness. The greater the variation in brightness, that is, the greater the degree of unevenness, the lower the legibility to the human eye.

図5は、図4の補正前画像を、実施の形態1の画像処理方法で色ムラ補正処理した場合の補正後画像における明度分布のグラフを示す。例えば、領域A1において、実線で示す補正前の明度分布の曲線501は、破線で示す補正後の明度分布の曲線502となる。補正前の曲線501上での各ポイント(黒点で示す画素)の明度は、所定の明度範囲503(後述の図12の明度幅±k1による範囲Wに相当する)でのヒストグラムの頻度値に基づいて計算される平均値(後述)によって、白点で示す明度に補正される。それらの結果が曲線502であり、推定明度に相当する。補正後の曲線502は、補正前の曲線501に比べて、明度の変動が小さくなっており、色ムラ・明度ムラが低減されており、人の眼には、視認性が高くなったように感じられる。 FIG. 5 shows a graph of the brightness distribution in the corrected image when the uncorrected image of FIG. 4 is subjected to color unevenness correction processing by the image processing method of the first embodiment. For example, in the region A1, the curve 501 of the brightness distribution before correction shown by the solid line becomes the curve 502 of the brightness distribution after correction shown by the broken line. The brightness of each point (pixels indicated by black dots) on the curve 501 before correction is based on the frequency value of the histogram in a predetermined brightness range 503 (corresponding to the range W according to the brightness width ± k1 in FIG. 12 described later). It is corrected to the brightness indicated by the white dot by the average value (described later) calculated in the above. The result is curve 502, which corresponds to the estimated brightness. The curve 502 after the correction has a smaller variation in brightness than the curve 501 before the correction, and the color unevenness and the brightness unevenness are reduced, so that the visibility is improved to the human eye. felt.

[処理フロー]
図6~図8は、実施の形態1で、画像処理装置1の画像処理部20による主な処理のフローを示す。図6は、フローその1であり、ステップS1~S6を有する。図7は、図6に続くフローその2であり、ステップS7~S9を有する。図8は、図6に続くフローその3であり、ステップS10~S13を有する。大別して、図6は、ヒストグラム計算と第1方式での平均値(補正値)計算のフローである。図7は、色合い保持機能を用いない場合(方式Y)の補正処理のフローである。図8は、色合い保持機能を用いる場合(方式X)の補正処理のフローである。
[Processing flow]
6 to 8 show the main processing flow by the image processing unit 20 of the image processing apparatus 1 in the first embodiment. FIG. 6 is the flow 1 and includes steps S1 to S6. FIG. 7 is a flow No. 2 following FIG. 6, which has steps S7 to S9. FIG. 8 is a flow No. 3 following FIG. 6, which includes steps S10 to S13. Roughly divided, FIG. 6 shows a flow of histogram calculation and average value (correction value) calculation in the first method. FIG. 7 is a flow of correction processing when the hue holding function is not used (method Y). FIG. 8 is a flow of correction processing when the hue holding function is used (method X).

図6で、画像処理部20は、図1の補正前の画像ファイル122を、入力画像、言い換えると対象画像として、以下の処理を行う。ステップS1で、画像処理部20は、対象画像の明度のヒストグラムの作成を行う。ステップS1は、詳しくは、ステップS1A,S1B,S1Cを含む。ステップS1Aで、画像処理部20は、対象画像のR成分(R画素値)の明度のヒストグラム(HRとする)を作成する。ステップS1Bで、画像処理部20は、対象画像のG成分(G画素値)の明度のヒストグラム(HGとする)を作成する。ステップS1Cで、画像処理部20は、対象画像のB成分(B画素値)の明度のヒストグラム(HBとする)を作成する。画像処理部20は、作成したヒストグラムのデータを、記憶装置102等によるメモリ上に保持する。 In FIG. 6, the image processing unit 20 performs the following processing using the uncorrected image file 122 of FIG. 1 as an input image, in other words, a target image. In step S1, the image processing unit 20 creates a histogram of the brightness of the target image. Specifically, step S1 includes steps S1A, S1B, and S1C. In step S1A, the image processing unit 20 creates a histogram (referred to as HR) of the brightness of the R component (R pixel value) of the target image. In step S1B, the image processing unit 20 creates a histogram (referred to as HG) of the brightness of the G component (G pixel value) of the target image. In step S1C, the image processing unit 20 creates a histogram (referred to as HB) of the brightness of the B component (B pixel value) of the target image. The image processing unit 20 holds the created histogram data in the memory of the storage device 102 or the like.

図9は、対象画像のデータ形式の例を示す。対象画像のデータ形式は、例えば3×8=24bitのカラー画像である。対象画像は、X方向(水平方向)およびY方向(垂直方向)による2次元画像である。Px,yは、位置(x,y)にある画素および画素値を表す。画素Px,yは、R(赤),G(緑),B(青)の3つのサブ画素のセットで構成される。R,G,Bのそれぞれの画素および画素値を、Rx,y、Gx,y、Bx,yとして示す。すなわち、1つのポイントの色・明度は、R画素値、G画素値、およびB画素値のセットから構成される。画像処理装置1での処理上で、ポイントとは、広義には1つの画素Px,yであり、狭義にはR,G,B毎のサブ画素である。画素Px,yの画素値(言い換えると明度)は、例えば、R画素Rx,yの値rと、G画素Gx,yの値gと、B画素Bx,yの値bとを有する。値r,g,bは、例えば8bitで表現される場合、0から255までの256階調の範囲内の値である。画素Px,yの補正前の画素値は、後述の補正(第1方式での明度平均値による置換)によって、補正後の画素値となる。補正後の画素値は、例えば、R画素Rx,yの値raと、G画素Gx,yの値gaと、B画素Bx,yの値baとを有する。値ra,ga,baは、256階調の範囲内の値である。 FIG. 9 shows an example of the data format of the target image. The data format of the target image is, for example, a color image of 3 × 8 = 24 bits. The target image is a two-dimensional image in the X direction (horizontal direction) and the Y direction (vertical direction). Px, y represent a pixel and a pixel value at a position (x, y). Pixels Px and y are composed of a set of three sub-pixels, R (red), G (green), and B (blue). The respective pixels and pixel values of R, G, and B are shown as Rx, y, Gx, y, Bx, and y. That is, the color / brightness of one point is composed of a set of R pixel value, G pixel value, and B pixel value. In the processing by the image processing apparatus 1, the point is one pixel Px, y in a broad sense, and is a sub-pixel for each R, G, B in a narrow sense. The pixel value of the pixels Px, y (in other words, the brightness) has, for example, the value r of the R pixel Rx, y, the value g of the G pixel Gx, y, and the value b of the B pixel Bx, y. The values r, g, and b are values within the range of 256 gradations from 0 to 255 when expressed by, for example, 8 bits. The pixel values of the pixels Px and y before correction become the corrected pixel values by the correction described later (replacement by the brightness average value in the first method). The corrected pixel value has, for example, an R pixel Rx, y value ra, a G pixel Gx, y value ga, and a B pixel Bx, y value ba. The values ra, ga, and ba are values within the range of 256 gradations.

図10は、ステップS1で作成するヒストグラムのデータ例を示す。図10の(A)は、ヒストグラムの表である。この表は、R画素の明度のヒストグラムHRの場合である。この表は、「明度(R画素値)」列と「頻度値」列とを有する。「明度(R画素値)」は、例えば上記のように0~255の値である。各行には、R画素値毎の頻度値が格納される。ここでは頻度値をh0等の抽象的な変数で示すが、実際にはその変数に数値が格納される。画像処理部20は、対象画像の画素毎に、対応する明度毎の頻度値を計数し、この表の頻度値列のその変数に格納する。 FIG. 10 shows an example of data of the histogram created in step S1. FIG. 10A is a histogram table. This table is for the histogram HR of the brightness of the R pixel. This table has a "brightness (R pixel value)" column and a "frequency value" column. The "brightness (R pixel value)" is, for example, a value of 0 to 255 as described above. The frequency value for each R pixel value is stored in each row. Here, the frequency value is shown by an abstract variable such as h0, but the numerical value is actually stored in the variable. The image processing unit 20 counts the frequency value for each brightness corresponding to each pixel of the target image and stores it in the variable of the frequency value column in this table.

図10の(B)は、(A)のデータに対応するヒストグラム(HR)のグラフを示す。このグラフは、横軸が明度(R画素値)、縦軸が頻度値(言い換えると計数値)である。頻度値は、0から全画素数までの範囲内の値である。なお、明度を記号V、頻度値を記号Fで表す場合がある。 FIG. 10B shows a histogram (HR) graph corresponding to the data in FIG. 10A. In this graph, the horizontal axis is the brightness (R pixel value), and the vertical axis is the frequency value (in other words, the count value). The frequency value is a value in the range from 0 to the total number of pixels. The brightness may be represented by the symbol V and the frequency value may be represented by the symbol F.

図6のステップS2で、画像処理部20は、ステップS1で作成したヒストグラムを用いて、対象画像中のポイント毎に、指定範囲での明度の頻度値の平均値(例えば加重平均値)を計算する。ステップS2は、詳しくは、ステップS2A,S2B,S2Cを有する。ステップS2Aは、R画素のヒストグラムHRを用いて、R画素毎に、指定範囲での明度の頻度値の平均値(ARとする)を計算するステップである。ステップS2Bは、G画素のヒストグラムHGを用いて、G画素毎に、指定範囲での明度の頻度値の平均値(AGとする)を計算するステップである。ステップS2Cは、B画素のヒストグラムHBを用いて、B画素毎に、指定範囲での明度の頻度値の平均値(ABとする)を計算するステップである。 In step S2 of FIG. 6, the image processing unit 20 calculates the average value (for example, a weighted average value) of the frequency values of the brightness in the specified range for each point in the target image using the histogram created in step S1. do. Step S2 specifically includes steps S2A, S2B, S2C. Step S2A is a step of calculating the average value (referred to as AR) of the frequency value of the brightness in the designated range for each R pixel by using the histogram HR of the R pixel. Step S2B is a step of calculating the average value (referred to as AG) of the frequency value of the brightness in the designated range for each G pixel by using the histogram HG of the G pixel. Step S2C is a step of calculating the average value (referred to as AB) of the frequency values of the brightness in the designated range for each B pixel by using the histogram HB of the B pixel.

図11および図12は、ステップS2に関する説明図である。図11は、対象画像の明度のヒストグラム(図10とも対応する)の例である。ここでは、横軸を頻度値F、縦軸を明度Vとして示す。図12は、図11のヒストグラムのうちの一部として、ある明度Viの付近の範囲Wの拡大を示す。例えばあるポイントの画素Px,yにおける明度Vが、図示するような比較的高いある明度Viであったとする。この場合について、ステップS2の平均値を計算する処理例を説明する。説明上、明度Viを、補正対象ポイント明度:V0とも呼ぶ。ステップS1のヒストグラムにおいて、この明度Viでの頻度値Fが頻度値Fiであったとする。頻度値Fiを、補正対象ポイント頻度値:F0とも呼ぶ。 11 and 12 are explanatory views relating to step S2. FIG. 11 is an example of a histogram of the brightness of the target image (corresponding to FIG. 10). Here, the horizontal axis is shown as the frequency value F, and the vertical axis is shown as the brightness V. FIG. 12 shows an enlargement of the range W near a certain brightness Vi as part of the histogram of FIG. For example, it is assumed that the brightness V at the pixels Px and y at a certain point is a relatively high brightness Vi as shown in the figure. In this case, a processing example for calculating the average value in step S2 will be described. For the sake of explanation, the brightness Vi is also referred to as a correction target point brightness: V0. In the histogram of step S1, it is assumed that the frequency value F at this lightness Vi is the frequency value Fi. The frequency value Fi is also referred to as a correction target point frequency value: F0.

画像処理部20は、明度V0の頻度値F0について、予め設定された指定の範囲Wを適用する。範囲Wは、明度Vに関する範囲であり、明度範囲とも呼ぶ。本例では、範囲Wは、明度Vに関する正負の幅(±k1)を用いて規定される。すなわち、範囲Wは、明度(V0-k1)から明度(V0+k1)までの範囲である。 The image processing unit 20 applies a preset designated range W to the frequency value F0 of the brightness V0. The range W is a range related to the lightness V, and is also called a lightness range. In this example, the range W is defined using the positive and negative widths (± k1) with respect to the lightness V. That is, the range W is a range from lightness (V0-k1) to lightness (V0 + k1).

第1方式では、画像処理部20は、この範囲Wで、明度Vの頻度値Fに関する平均値として例えば加重平均値を計算する。計算された加重平均値を、明度平均値V1および頻度平均値F1とする。頻度平均値F1は、明度平均値V1での頻度である。なお、加重平均値は一般に以下の式で計算できる。観測値をX、観測値毎の重みをw、観測値の数をnとすると、[加重平均値]=(w1・X1+w2・X2+……+wn・Xn)/(w1+w2+……+wn)である。なお、すべての重みwが等しい場合、これは相加平均値となる。実施の形態1の例では、重みwについては、各明度に対応するヒストグラムの頻度値に係数を乗じた値を用いる。その係数は例えば1としてもよい。 In the first method, the image processing unit 20 calculates, for example, a weighted average value as an average value with respect to the frequency value F of the brightness V in this range W. Let the calculated weighted average value be the brightness average value V1 and the frequency average value F1. The frequency average value F1 is the frequency at the lightness average value V1. The weighted average value can be generally calculated by the following formula. Assuming that the observed value is X, the weight for each observed value is w, and the number of observed values is n, [weighted average value] = (w1 · X1 + w2 · X2 + ... + wn · Xn) / (w1 + w2 + ... + wn). If all the weights w are equal, this is the arithmetic mean value. In the example of the first embodiment, for the weight w, a value obtained by multiplying the frequency value of the histogram corresponding to each brightness by a coefficient is used. The coefficient may be 1, for example.

また、実施の形態1の変形例において、画像処理装置1は、第1方式ではなく、第2方式を用いる。第2方式では、画像処理部20は、この範囲Wで、明度Vの頻度値Fに関する最大値を計算する。計算された最大値を、明度最大値V2および頻度最大値F2とする。明度最大値V2は、頻度最大値F2での明度である。 Further, in the modified example of the first embodiment, the image processing apparatus 1 uses the second method instead of the first method. In the second method, the image processing unit 20 calculates the maximum value regarding the frequency value F of the brightness V in this range W. The calculated maximum value is defined as the maximum brightness value V2 and the maximum frequency value F2. The maximum brightness value V2 is the brightness at the maximum frequency value F2.

図13は、ステップS2の処理で使用する表として、ルックアップテーブル(LUT)の例を示す。R,G,B成分毎に、LUTがデータとして用意される。それぞれのLUTを、表TR,TG,TBとする。画像処理部20は、それぞれのLUTのデータを、メモリ上に作成および保持する。図13は、例えばR画素に関するLUTである表TRの例を示す。この表TRは、「入力値」列と「出力値」列とを有する。「入力値」は、補正前の明度であるR画素値(図12での補正対象ポイント明度V0)であり、「出力値」は、補正後の明度、すなわち指定範囲での加重平均値(図12での明度平均値V1)である。ここでは「出力値」は、v0~v255として抽象的な変数で示すが、実際にはその変数には数値が格納される。最初、この表TRは、初期値、例えば「出力値」がすべて0、が設定される。画像処理部20は、ステップS2の処理の進行に伴い、このような表TR,TG,TBの各行に値を格納する。 FIG. 13 shows an example of a look-up table (LUT) as a table used in the process of step S2. A LUT is prepared as data for each of the R, G, and B components. Let each LUT be a table TR, TG, TB. The image processing unit 20 creates and holds the data of each LUT in the memory. FIG. 13 shows an example of a table TR which is a LUT for, for example, an R pixel. This table TR has an "input value" column and an "output value" column. The "input value" is the R pixel value (correction target point brightness V0 in FIG. 12) which is the brightness before correction, and the "output value" is the brightness after correction, that is, the weighted average value in the specified range (FIG. 12). 12) is the average brightness value V1). Here, the "output value" is shown as an abstract variable as v0 to v255, but in reality, a numerical value is stored in the variable. Initially, this table TR is set to an initial value, for example, all "output values" are 0. The image processing unit 20 stores the values in each row of the table TR, TG, and TB as the processing in step S2 progresses.

ある対象画像について、1回、一通りの処理が行われた結果、このようなLUT(TR,TG,TB)が完成する。その場合、このLUTは、対象画像に対応する帳票3に関する補正(特にステップS2の処理)の仕方、言い換えると変換を表す表となっている。よって、画像処理装置1は、その後、同様の種類の帳票3からの対象画像については、このLUTを適用してもよい。その場合、個別の計算処理を省略して、色ムラ補正を高速に実現することができる。 Such a LUT (TR, TG, TB) is completed as a result of performing a series of processing once for a certain target image. In that case, this LUT is a table showing the method of correction (particularly the processing of step S2) regarding the form 3 corresponding to the target image, in other words, the conversion. Therefore, the image processing apparatus 1 may subsequently apply this LUT to the target image from the form 3 of the same type. In that case, color unevenness correction can be realized at high speed by omitting individual calculation processing.

図6で、ステップS3は、適用する方式の選択に応じた分岐のステップである。ここで選択できる方式は、画素値を2値化した白・黒の成分について、黒成分を対象外として白成分のみを補正対象とする方式(方式Aとする)と、白・黒の両方の成分、すなわち画像全体を補正対象とする方式(方式Bとする)との2つである。ユーザは、適用する方式(A,B)を選択できる。画像処理装置1が提供する画面でのユーザ設定で、予め、適用する方式(A,B)を設定しておいてもよいし、適宜に画面でユーザが帳票3に対し使用する方式(A,B)を指示選択入力してもよい。ステップS3で、画像処理部20は、対象画像を2値化処理した際に白(値1)となる画素成分のみを補正対象とする方式Aを適用するか、黒(値0)となる画素成分も補正対象とする方式Bを適用するかを判断する。方式Aを適用する場合(Y)、ステップS4に進み、方式Bを適用する場合(N)、ステップS4を省略してステップS5に進む。 In FIG. 6, step S3 is a branching step according to the selection of the method to be applied. The methods that can be selected here are both a method (referred to as method A) in which the black component is excluded and only the white component is corrected for the white / black component obtained by binarizing the pixel value, and both white and black. There are two methods, that is, a method in which the entire image is corrected (referred to as method B). The user can select the method (A, B) to be applied. The method (A, B) to be applied may be set in advance in the user setting on the screen provided by the image processing device 1, or the method (A, B) used by the user for the form 3 on the screen as appropriate. B) may be instructed, selected and input. In step S3, the image processing unit 20 applies the method A for correcting only the pixel component that becomes white (value 1) when the target image is binarized, or the pixel that becomes black (value 0). It is determined whether or not the method B, which is also the component to be corrected, is applied. When the method A is applied (Y), the process proceeds to step S4, and when the method B is applied (N), step S4 is omitted and the process proceeds to step S5.

ステップS4では、方式Aのために、対象画像に対する2値化処理を行う。2値化処理後の対象画像では、図9の各画素Px,yの値、すなわちRx,y、Gx,y、Bx,yは、値0(黒)または値1(白)をとる。 In step S4, the target image is binarized for the method A. In the target image after the binarization process, the values of each pixel Px, y in FIG. 9, that is, Rx, y, Gx, y, Bx, y take a value 0 (black) or a value 1 (white).

ステップS5で、画像処理部20は、第1方式での平均値(補正後の明度)に関するLUTを作成する。ステップS5は、詳しくは、ステップS5A,S5B,S5Cを有する。ステップS5Aは、R成分についての平均値(AR)のLUT(表TR)の作成である。ステップS5Bは、G成分についての平均値(AG)のLUT(表TG)の作成である。ステップS5Cは、B成分についての平均値(AB)のLUT(表TB)の作成である。例えば、図13のようなLUTが作成される。 In step S5, the image processing unit 20 creates a LUT regarding the average value (corrected brightness) in the first method. Step S5 specifically includes steps S5A, S5B, S5C. Step S5A is the creation of a LUT (Table TR) of the mean value (AR) for the R component. Step S5B is the creation of a LUT (table TG) of the mean value (AG) for the G component. Step S5C is the creation of a LUT (Table TB) of the mean value (AB) for the B component. For example, a LUT as shown in FIG. 13 is created.

ステップS6は、適用する方式の選択に応じた分岐のステップである。ここで選択できる方式は、色合い保持機能に対応して画像の色合いを保持する方式(方式Xとする)と、色合いを保持しない方式(方式Yとする)との2つである。ユーザは、同様に、適用する方式(X,Y)を選択できる。ステップS6で、画像処理部20は、色合いを保持する方式Xを適用するか、方式Yを適用するかを判断する。方式Xを適用する場合(Y)、図8のステップS10に進み、方式Yを適用する場合(N)、図7のステップS7に進む。 Step S6 is a branching step according to the selection of the method to be applied. There are two methods that can be selected here: a method that retains the hue of the image corresponding to the hue holding function (referred to as method X) and a method that does not retain the hue (referred to as method Y). Similarly, the user can select the method (X, Y) to be applied. In step S6, the image processing unit 20 determines whether to apply the method X for retaining the hue or the method Y. When the method X is applied (Y), the process proceeds to step S10 in FIG. 8, and when the method Y is applied (N), the process proceeds to step S7 in FIG.

まず、より単純な方式である方式Yの場合について説明する。図7のステップS7で、画像処理部20は、ステップS3でいずれの方式(A,B)を選択していたか、および、対象画像内の対象ポイントにおけるステップS4での二値化処理の結果の値が、黒(値0)であるか白(値1)であるかを確認する。方式A選択時で対象ポイントの二値化結果値が白である場合(Y)、または、方式B選択時の場合(Y)には、ステップS8へ進む。方式A選択時で対象ポイントの二値化結果値が黒である場合(N)には、補正処理(ステップS8)を省略するので、ステップS9へ進む。 First, the case of the method Y, which is a simpler method, will be described. In step S7 of FIG. 7, which method (A, B) was selected by the image processing unit 20 in step S3, and the result of binarization processing in step S4 at the target point in the target image. Check whether the value is black (value 0) or white (value 1). If the binarization result value of the target point is white when the method A is selected (Y), or when the method B is selected (Y), the process proceeds to step S8. If the binarization result value of the target point is black when the method A is selected (N), the correction process (step S8) is omitted, and the process proceeds to step S9.

ステップS8で、画像処理部20は、対象画像の対象ポイント(画素Px,y)の補正前の明度を、補正後の明度、すなわちステップS2で得た第1方式の平均値で置き換える補正処理を行う。つまり、画像処理部20は、対象ポイントのR,G,Bの各成分値(図12の補正対象ポイント明度V0)を、ステップS2で得た平均値(図12の明度平均値V1)で置き換える補正処理を行う。ステップS8は、詳しくは、ステップS8A,S8B,S8Cを有する。ステップS8Aでは、画像処理部20は、R成分値(R画素値)を、加重平均値(AR)で置き換える補正処理を行う。ステップS8Bでは、画像処理部20は、G成分値(G画素値)を、加重平均値(AG)で置き換える補正処理を行う。ステップS8Cでは、画像処理部20は、B成分値(B画素値)を、加重平均値(AB)で置き換える補正処理を行う。なお、ステップS5に基づいて一旦作成済みのLUTがある場合、ステップS8では、そのLUTを使用することで、処理を高速化できる。 In step S8, the image processing unit 20 performs a correction process of replacing the brightness of the target point (pixel Px, y) of the target image before correction with the corrected brightness, that is, the average value of the first method obtained in step S2. conduct. That is, the image processing unit 20 replaces each component value of R, G, and B of the target point (correction target point brightness V0 in FIG. 12) with the average value (brightness average value V1 in FIG. 12) obtained in step S2. Perform correction processing. Step S8 specifically includes steps S8A, S8B, S8C. In step S8A, the image processing unit 20 performs a correction process of replacing the R component value (R pixel value) with the weighted average value (AR). In step S8B, the image processing unit 20 performs a correction process of replacing the G component value (G pixel value) with the weighted average value (AG). In step S8C, the image processing unit 20 performs a correction process of replacing the B component value (B pixel value) with the weighted average value (AB). If there is a LUT once created based on step S5, the processing can be speeded up by using the LUT in step S8.

なお、変形例での第2方式の場合、ステップS8の処理は、平均値ではなく、前述の最大値(明度最大値V2)を用いればよい。第2方式では、画像処理部20は、対象ポイントの明度(V0)を、上記明度最大値V2で置き換える。 In the case of the second method in the modified example, the processing in step S8 may use the above-mentioned maximum value (maximum brightness value V2) instead of the average value. In the second method, the image processing unit 20 replaces the brightness (V0) of the target point with the maximum brightness value V2.

画像処理部20は、上記のような処理を、対象画像のすべてのポイントについて同様に実行する。ステップS9で、画像処理部20は、対象画像の全ポイントについて上記処理が終了したかを確認し、未終了の場合(N)にはステップS7へ戻って同様の繰り返しである。終了した場合(Y)、対象画像の補正が完了したということであり、フローが終了する。 The image processing unit 20 similarly executes the above processing for all points of the target image. In step S9, the image processing unit 20 confirms whether or not the above processing has been completed for all the points of the target image, and if not, returns to step S7 and repeats the same procedure. When finished (Y), it means that the correction of the target image is completed, and the flow ends.

一方、方式Xを用いる場合、ステップS10で、画像処理部20は、図7のステップS7と同様の処理として、ステップS3でいずれの方式(A,B)を選択していたか、および、対象画像内の対象ポイントにおけるステップS4での二値化処理の結果の値が、白(値1)であるか黒(値0)であるかを確認する。方式A選択時で対象ポイントの二値化結果値が白である場合(Y)、または、方式B選択時の場合(Y)には、ステップS11へ進む。方式A選択時で対象ポイントの二値化結果値が黒である場合(N)には、補正処理(ステップS11,S12)を省略するので、ステップS13へ進む。 On the other hand, when the method X is used, in step S10, which method (A, B) was selected by the image processing unit 20 in step S3 as the same processing as step S7 in FIG. 7, and the target image. It is confirmed whether the value of the result of the binarization process in step S4 at the target point in the above is white (value 1) or black (value 0). If the binarization result value of the target point is white when the method A is selected (Y), or when the method B is selected (Y), the process proceeds to step S11. If the binarization result value of the target point is black when the method A is selected (N), the correction process (steps S11 and S12) is omitted, so the process proceeds to step S13.

ステップS11で、画像処理部20は、対象画像の対象ポイントのR,G,Bの各成分値(補正対象ポイント明度V0)と、ステップS5のLUTの「出力値」列の加重平均値(明度平均値V1)との差の平均値を計算する。この差をDとし、この平均値をDAとする。例えば、R画素(Rx,y)について、図12のように、差Dは、(V0-V1)である。平均値DAは、指定範囲Wでの差Dの平均値である。 In step S11, the image processing unit 20 uses the R, G, and B component values (correction target point brightness V0) of the target points of the target image and the weighted average value (brightness) of the “output value” column of the LUT in step S5. The average value of the difference from the average value V1) is calculated. Let this difference be D, and let this average value be DA. For example, for the R pixel (Rx, y), the difference D is (V0-V1) as shown in FIG. The average value DA is the average value of the difference D in the designated range W.

平均値DAは、例えば以下のように計算できる。R成分に関する差をDR、G成分に関する差をDG、B成分に関する差をDBとする。DA=(DR+DG+DB)÷3。平均値DAは、R,G,Bで共通の値となる。 The average value DA can be calculated as follows, for example. The difference regarding the R component is referred to as DR, the difference regarding the G component is referred to as DG, and the difference regarding the B component is referred to as DB. DA = (DR + DG + DB) ÷ 3. The average value DA is a common value for R, G, and B.

次に、ステップS12で、画像処理部20は、対象ポイントの各成分値(補正対象ポイント明度V0)を、各成分値からステップS11で得た平均値DAを減算した値によって置き換える補正処理を行う。ステップS12は、詳しくは、ステップS12A,S12B,S12Cを有する。ステップS12Aで、画像処理部20は、R成分値を、R成分値から平均値DAを減算した値(SRとする)に置き換える。ステップS12Bで、画像処理部20は、G成分値を、G成分値から平均値DAを減算した値(SGとする)に置き換える。ステップS12Cで、画像処理部20は、B成分値を、B成分値から平均値DAを減算した値(SBとする)に置き換える。 Next, in step S12, the image processing unit 20 performs correction processing in which each component value of the target point (correction target point brightness V0) is replaced with a value obtained by subtracting the average value DA obtained in step S11 from each component value. .. Step S12 specifically includes steps S12A, S12B, S12C. In step S12A, the image processing unit 20 replaces the R component value with a value obtained by subtracting the average value DA from the R component value (referred to as SR). In step S12B, the image processing unit 20 replaces the G component value with a value obtained by subtracting the average value DA from the G component value (referred to as SG). In step S12C, the image processing unit 20 replaces the B component value with a value obtained by subtracting the average value DA from the B component value (referred to as SB).

補正値である減算値SR,SG,SBは、例えば以下のように計算できる。補正前のR成分値をVR0、補正前のG成分値をVG0、補正前のB成分値をVB0とする。 The subtraction values SR, SG, and SB, which are correction values, can be calculated as follows, for example. The R component value before correction is VR0, the G component value before correction is VG0, and the B component value before correction is VB0.

SR=VR0-DA
SG=VG0-DA
SB=VB0-DA
上記のように、R,G,Bの全てで同一の平均値DAによって減算による補正が行われる。これにより、特定色のみの大幅な補正を抑え、色合いを保持することができる。この処理方式では、計算処理負荷を抑えつつ、色合い保持が実現できる。なお、上記色合い保持のための処理方式は一例であり、他の処理方式を適用してもよい。他の処理方式としては、RGB色空間からHSV色空間へ変換し、V値(明度)のみを調整した後、RGB色空間へ再変換する方式を用いてもよい。
SR = VR0-DA
SG = VG0-DA
SB = VB0-DA
As described above, correction by subtraction is performed by the same average value DA for all of R, G, and B. As a result, it is possible to suppress a large correction of only a specific color and maintain the hue. With this processing method, it is possible to maintain the hue while suppressing the calculation processing load. The processing method for maintaining the hue is an example, and other processing methods may be applied. As another processing method, a method of converting from the RGB color space to the HSV color space, adjusting only the V value (brightness), and then reconverting to the RGB color space may be used.

ステップS13で、画像処理部20は、対象画像の全ポイントについて上記処理が終了したかを確認し、未終了の場合(N)にはステップS10へ戻って同様の繰り返しである。終了した場合(Y)、対象画像の補正が完了したということであり、フローが終了する。 In step S13, the image processing unit 20 confirms whether or not the above processing has been completed for all the points of the target image, and if not, returns to step S10 and repeats the same procedure. When finished (Y), it means that the correction of the target image is completed, and the flow ends.

[効果等]
上記のように、実施の形態1の画像処理装置および方法によれば、帳票の読み取り画像の色ムラ・明度ムラを低減して視認性を高めることができる。
[Effects, etc.]
As described above, according to the image processing apparatus and method of the first embodiment, it is possible to reduce color unevenness and brightness unevenness of the read image of the form and improve the visibility.

なお、適用する第1方式や第2方式に応じて、補正後画像の視認性等の効果は異なる。対象の帳票3等に応じて、適用する方式を選択すればよい。多くの帳票3では、第2方式よりも第1方式が有効である。第1方式では、補正後の明度として加重平均値(図12)を用いるので、帳票の背景領域等において、図3の例のように、明度分布が滑らかになるように、色ムラ・明度ムラを低減できる。第2方式を用いる場合、最大頻度値(図12)を用いるので、帳票3によっては、領域毎に同一の明度となり、領域境界で明度が変動するような補正後画像となる場合がある。この場合、人の眼から見て違和感を生じる場合がある。この場合、第1方式を適用した方が、領域境界での明度の変動も無いまたは少ないので、違和感が無い画像が得られる。帳票3によって、例えば裏写りの文字が透けて重畳しているような読み取り画像の場合では、第2方式を適用することで、その裏写りの文字が見えなくなるように補正することができて有効である。 It should be noted that the effects such as the visibility of the corrected image differ depending on the first method and the second method to be applied. The method to be applied may be selected according to the target form 3 or the like. In many forms 3, the first method is more effective than the second method. In the first method, since the weighted average value (FIG. 12) is used as the corrected brightness, color unevenness and brightness unevenness are made so that the brightness distribution becomes smooth in the background area of the form as in the example of FIG. Can be reduced. When the second method is used, since the maximum frequency value (FIG. 12) is used, the brightness may be the same for each area depending on the form 3, and the corrected image may have the brightness fluctuating at the area boundary. In this case, a feeling of strangeness may occur from the human eye. In this case, when the first method is applied, there is no or little change in the brightness at the region boundary, so that an image without a sense of discomfort can be obtained. In the case of a scanned image in which the show-through characters are transparently superimposed by the form 3, for example, by applying the second method, it is possible to correct the show-through characters so that they cannot be seen, which is effective. Is.

実施の形態1の画像処理方法は、特徴の1つとして、上記のように、画像全体の明度のヒストグラム(図6のステップS1)を用いて、ポイント毎に指定の範囲Wでの補正値(加重平均値)を計算する処理(ステップS2)を行うことがある。この処理(ステップS2)は、ステップS1で作成済みのヒストグラムのデータを用いるので、ポイント毎の処理としては、計算処理負荷が比較的少なくて済む。よって、対象画像全体の補正処理での計算処理負荷も比較的少なく抑えられる。すなわち、実施の形態1の画像処理方法では、高い処理効率で、色ムラ・明度ムラの低減が実現できる。この処理(ステップS2)は、例えば、画像内のポイント(例えば画素)の周辺の領域の明度を参照して補正値を計算する方式とは異なる。そのような方式の場合、ポイント毎の処理が必要であるため、その分、計算処理負荷が大きくなる。また、帳票内の文字や図像等の分布は様々であり、そのような方式の場合、ポイント毎に参照する領域が適切であるかどうかが不明である。 As one of the features of the image processing method of the first embodiment, as described above, a histogram of the brightness of the entire image (step S1 in FIG. 6) is used, and a correction value (correction value in a designated range W) is used for each point (step S1 in FIG. 6). A process (step S2) for calculating a weighted average value) may be performed. Since this processing (step S2) uses the histogram data created in step S1, the calculation processing load can be relatively small as the processing for each point. Therefore, the calculation processing load in the correction processing of the entire target image can be suppressed to a relatively small value. That is, in the image processing method of the first embodiment, it is possible to reduce color unevenness and brightness unevenness with high processing efficiency. This process (step S2) is different from, for example, a method of calculating a correction value by referring to the brightness of a region around a point (for example, a pixel) in an image. In the case of such a method, processing for each point is required, so that the calculation processing load increases accordingly. In addition, the distribution of characters, iconography, etc. in the form varies, and in the case of such a method, it is unclear whether the area referred to for each point is appropriate.

また、ステップS3の方式Aと方式Bとの違いに関して、白成分のみを補正対象とする方式Aを用いる場合、特に比較的白い背景領域(二値化の値が白となる領域)の色ムラ・明度ムラを低減できる。比較的黒い図像領域(二値化の値が黒となる領域)については、色ムラ・明度ムラがあった場合でも、人の眼から見て図像としての認識がしやすく、ムラが気になりにくい。そのため、方式Bでは、その比較的黒い領域の補正処理を省略でき、全体として処理効率化が実現できる。また、方式Bでは、色ムラ補正によって薄い文字等が消えてしまうことを防止することもできる。二値化処理によって黒になるような明度の画素がある場合に、方式Bでは、その画素をそのまま残すことができる。 Further, regarding the difference between the method A and the method B in step S3, when the method A in which only the white component is the correction target is used, the color unevenness of the relatively white background area (the area where the binarization value is white) is particularly large.・ Brightness unevenness can be reduced. In the relatively black image area (the area where the binarization value is black), even if there is color unevenness or lightness unevenness, it is easy for the human eye to recognize it as an iconography, and unevenness is a concern. Hateful. Therefore, in the method B, the correction processing of the relatively black region can be omitted, and the processing efficiency can be improved as a whole. Further, in the method B, it is possible to prevent thin characters and the like from disappearing due to color unevenness correction. When there is a pixel having a brightness that becomes black by the binarization process, in the method B, the pixel can be left as it is.

また、色合い保持機能に関する方式Xと方式Yとの違いに関しては、対象の帳票3等に応じて、方式を選択して適用すればよい。紙面の色合いを保持したい場合には方式Xを適用し、保持する必要が無い場合には方式Yを適用して処理効率化が可能である。 Further, regarding the difference between the method X and the method Y regarding the color tone holding function, the method may be selected and applied according to the target form 3 or the like. If it is desired to retain the color tone of the paper surface, the method X can be applied, and if it is not necessary to retain the color, the method Y can be applied to improve the processing efficiency.

実施の形態1の画像処理方法は、特に、背景色(例えば白)が広くあるような読み取り画像や、OCRに係わる帳票3の読み取り画像についての色ムラ補正処理の際に有効であるが、これに限らず、写真画像等を含む任意の画像に対し適用可能である。 The image processing method of the first embodiment is particularly effective in color unevenness correction processing for a scanned image having a wide background color (for example, white) and a scanned image of a form 3 related to OCR. It is applicable to any image including a photographic image and the like.

<他の実施の形態>
実施の形態1の構成に限らず、以下のような変形例も可能である。
<Other embodiments>
Not limited to the configuration of the first embodiment, the following modification examples are also possible.

[変形例1]
変形例1の画像処理装置1は、対象の帳票3の種類等に対応した対象画像に応じて、適用する処理方式を自動的に変更する。図14は、変形例1での機能に関するユーザ設定情報の例を示す。画像処理装置1は、ユーザに提供する画面でユーザ設定を可能とし、ユーザ設定情報をメモリに保持する。図14のユーザ設定情報の表は、「帳票種類」列と、「処理方式」列とを有する。「帳票種類」列は、対象となる帳票3(あるいは画像)の種類を設定する列である。「処理方式」列は、その「帳票種類」に対し自動的に適用する補正処理の方式を設定する列である。選択できる方式は、前述した各方式(第1方式、第2方式、方式A,B、方式X,Y)を含む。例えば、帳票種類=Aについては、第1方式、方式A、および方式Xが、自動適用するものとして設定されている。ユーザは、このようなユーザ設定機能を用いることで、各種の帳票3に対し、自動的に適した方式を適用することができる。また、ユーザは、画像の入力の都度、適用する方式を指示入力してもよいし、色ムラ補正を実行するタイミングについては、任意のタイミングとしてユーザが指定できる。
[Modification 1]
The image processing device 1 of the modification 1 automatically changes the processing method to be applied according to the target image corresponding to the type of the target form 3 and the like. FIG. 14 shows an example of user setting information regarding the function in the modified example 1. The image processing device 1 enables user setting on the screen provided to the user, and holds the user setting information in the memory. The table of user setting information in FIG. 14 has a "form type" column and a "processing method" column. The "form type" column is a column for setting the type of the target form 3 (or image). The "processing method" column is a column for setting the correction processing method automatically applied to the "form type". The methods that can be selected include the above-mentioned methods (first method, second method, method A, B, method X, Y). For example, for the form type = A, the first method, the method A, and the method X are set to be automatically applied. By using such a user setting function, the user can automatically apply a suitable method to various forms 3. Further, the user may instruct and input the method to be applied each time the image is input, and the user can specify the timing for executing the color unevenness correction as an arbitrary timing.

また、このユーザ設定機能では、帳票種類毎に、色ムラ補正機能自体の適用のオン/オフを設定できるようにしてもよい。例えば、図14の例では、帳票種類=Dについては、「オフ」と設定されている。これにより、帳票種類=Dの場合の読み取り画像については、色ムラ補正処理が行われない。図14のような表に限らず、ユーザ設定画面では、方式毎にボタン等を表示し、ボタン等でオン/オフが設定できるようにしてもよい。 Further, in this user setting function, it may be possible to set on / off of application of the color unevenness correction function itself for each form type. For example, in the example of FIG. 14, the form type = D is set to "off". As a result, the color unevenness correction process is not performed on the read image when the form type = D. Not limited to the table as shown in FIG. 14, on the user setting screen, a button or the like may be displayed for each method so that on / off can be set by the button or the like.

また、変形例1の画像処理装置1は、図12のような明度の範囲Wについて、ユーザ設定で可変に設定できる機能を有する。例えば、ユーザ設定画面では、範囲Wを規定する幅k1の値を可変に設定できる。 Further, the image processing device 1 of the modification 1 has a function that the range W of the brightness as shown in FIG. 12 can be variably set by the user setting. For example, on the user setting screen, the value of the width k1 that defines the range W can be set variably.

画像処理装置1は、読み取り画像についての帳票種類を判別し、判別した帳票種類に応じて、自動的に、適用する方式やパラメータ値を選択する。なお、画像処理装置1のデフォルト設定では、予めメーカによって、所定の方式やパラメータ値が、自動適用するものとして設定されている。 The image processing device 1 determines the form type of the scanned image, and automatically selects the method and parameter value to be applied according to the determined form type. In the default setting of the image processing apparatus 1, a predetermined method or parameter value is set to be automatically applied by the manufacturer in advance.

また、画像処理装置1(図1)がOCR装置等である場合、その画像処理装置1は、複数の帳票3を連続的に読み取り、それによる複数の読み取り画像を連続的に処理する。この場合、その画像処理装置1は、設定または指示された帳票種類毎に、適した方式で処理を効率的に行うことができる。また、その画像処理装置1は、複数の読み取り画像について、画像処理部20による色ムラ補正処理をまとめて実行してもよい。その画像処理装置1は、その実行後の複数の画像について、帳票認識処理部12による認識処理をまとめて実行してもよい。 When the image processing device 1 (FIG. 1) is an OCR device or the like, the image processing device 1 continuously reads a plurality of forms 3 and continuously processes a plurality of scanned images. In this case, the image processing device 1 can efficiently perform processing by a suitable method for each set or instructed form type. Further, the image processing device 1 may collectively execute color unevenness correction processing by the image processing unit 20 for a plurality of scanned images. The image processing device 1 may collectively execute recognition processing by the form recognition processing unit 12 for a plurality of images after the execution.

[変形例2]
変形例2の画像処理装置1は、追加的な機能として以下を有する。画像処理装置1は、ユーザに対する画面に、対象の帳票3の対応する読み取り画像を表示し、全体領域のうちで、色ムラ補正を適用する領域と適用しない領域とをユーザが選択可能とする。ユーザは、その画面で、例えば、色ムラ補正を適用する一部の領域を選択指定できる。画像処理部2は、その指定された領域に対し色ムラ補正処理を実行する。例えば図2の帳票3についての読み取り画像の場合に、ユーザが背景領域201等の領域を選択指定してもよい。
[Modification 2]
The image processing device 1 of the modification 2 has the following as an additional function. The image processing device 1 displays the corresponding scanned image of the target form 3 on the screen for the user, and allows the user to select an area to which the color unevenness correction is applied and an area to which the color unevenness correction is not applied in the entire area. The user can select and specify, for example, a part of the area to which the color unevenness correction is applied on the screen. The image processing unit 2 executes color unevenness correction processing on the designated area. For example, in the case of the scanned image of the form 3 of FIG. 2, the user may select and specify an area such as the background area 201.

例えば、帳票3毎に、文字記入欄や印鑑欄等、形式が規定されている。また、画像処理装置1がOCR装置である場合、帳票3に応じて、帳票認識のためのフォーマット、例えば図2の読み取りフィールド(破線枠)が設定されている。変形例2の画像処理装置1は、そのフォーマットの読み取りフィールド等に基づいて、読み取りフィールド毎(すなわち対応する画素領域毎)に、色ムラ補正の有無や処理方式をユーザが選択して設定できるようにする。ユーザが、表示画像内においてマウス等の操作によって自由に補正対象領域等を指定できるようにしてもよい。 For example, a format such as a character entry field and a seal stamp field is defined for each form 3. When the image processing device 1 is an OCR device, a format for recognizing the form, for example, a reading field (broken line frame) in FIG. 2 is set according to the form 3. The image processing device 1 of the modification 2 allows the user to select and set the presence / absence of color unevenness correction and the processing method for each reading field (that is, for each corresponding pixel area) based on the reading field or the like of the format. To. The user may freely specify the correction target area or the like in the displayed image by operating the mouse or the like.

[変形例3]
変形例3の画像処理装置1は、対象画像内の対象ポイント毎に、実施の形態1の画像全体のヒストグラムではなく、対象ポイントを含む一部領域のヒストグラムを参照して、実施の形態1と同様の補正処理を行う。図15は、この方式を用いる場合の読み取り画像の模式図を示す。画像処理部20は、ポイント(画素Px,y)毎に、処理用に、矩形の枠線で示すような一部領域1501を設定し、その一部領域1501内のヒストグラムを作成・参照し、その一部領域1501内で、実施の形態1と同様の補正を行う。この方式を用いる場合、一部領域毎のヒストグラムを作成する処理が必要となるので、計算処理負荷が比較的高くなるが、帳票3によっては視認性が良い補正後画像が得られる可能性もある。
[Modification 3]
The image processing apparatus 1 of the modification 3 refers to the histogram of a part of the area including the target point instead of the histogram of the entire image of the first embodiment for each target point in the target image, and the first embodiment. Perform the same correction process. FIG. 15 shows a schematic diagram of a scanned image when this method is used. The image processing unit 20 sets a partial area 1501 as shown by a rectangular frame for processing for each point (pixels Px, y), creates and refers to a histogram in the partial area 1501, and creates and refers to the histogram. Within the partial area 1501, the same correction as in the first embodiment is performed. When this method is used, a process of creating a histogram for each part of the area is required, so that the calculation processing load is relatively high, but there is a possibility that a corrected image with good visibility can be obtained depending on the form 3. ..

以上、本発明を実施の形態に基づいて具体的に説明したが、本発明は前述の実施の形態に限定されず、要旨を逸脱しない範囲で種々変更可能である。 Although the present invention has been specifically described above based on the embodiments, the present invention is not limited to the above-described embodiments and can be variously modified without departing from the gist.

1…画像処理装置、2…スキャナ装置、3…帳票、4…帳票画像ファイル(読み取り画像)、20…画像処理部。 1 ... Image processing device, 2 ... Scanner device, 3 ... Form, 4 ... Form image file (read image), 20 ... Image processing unit.

Claims (6)

帳票が光学的に読み取られた画像を入力し、前記画像内でのポイント毎の明度のヒストグラムを作成し、前記ポイント毎の明度を補正対象ポイント明度として、前記ヒストグラムでの前記補正対象ポイント明度に対し設定される明度幅による明度範囲での明度平均値を計算し、前記補正対象ポイント明度を前記明度平均値で置き換えるように補正した画像を生成し出力する処理を行う、
画像処理装置。
An image in which the form is optically read is input, a histogram of the brightness of each point in the image is created, the brightness of each point is set as the point brightness to be corrected, and the brightness of the point to be corrected in the histogram is used. On the other hand, a process of calculating the brightness average value in the brightness range according to the set brightness width, generating and outputting a corrected image so as to replace the correction target point brightness with the brightness average value is performed.
Image processing device.
請求項1記載の画像処理装置において、
前記画像内の前記ポイント毎に2値化を行い、2値化した結果が白となる部分には前記補正を適用し、黒となる部分には前記補正を適用しない、
画像処理装置。
In the image processing apparatus according to claim 1,
Binarization is performed for each of the points in the image, and the correction is applied to the portion where the binarized result is white, and the correction is not applied to the portion where the binarization result is black.
Image processing device.
請求項1記載の画像処理装置において、
前記画像は、前記ポイント毎に、R、G、およびBの画素値を有し、
前記ポイント毎の各成分の前記画素値について、それぞれ前記明度平均値との差を計算し、前記差の平均値を計算し、前記各成分の画素値から前記差の平均値を減算したそれぞれの減算値を計算し、前記各成分の画素値を前記減算値で置き換えるように補正する、
画像処理装置。
In the image processing apparatus according to claim 1,
The image has pixel values of R, G, and B for each of the points.
For the pixel value of each component at each point, the difference from the brightness average value was calculated, the average value of the difference was calculated, and the average value of the difference was subtracted from the pixel value of each component. The subtraction value is calculated, and the pixel value of each component is corrected so as to be replaced with the subtraction value.
Image processing device.
帳票が光学的に読み取られた画像を入力し、前記画像内でのポイント毎の明度のヒストグラムを作成し、前記ポイント毎の明度を補正対象ポイント明度として、前記ヒストグラムでの前記補正対象ポイント明度に対し設定される明度幅による明度範囲での明度最大値を計算し、前記補正対象ポイント明度を前記明度最大値で置き換えるように補正した画像を生成し出力する処理を行う、
画像処理装置。
An image in which the form is optically read is input, a histogram of the brightness of each point in the image is created, the brightness of each point is set as the point brightness to be corrected, and the brightness of the point to be corrected in the histogram is used. On the other hand, the maximum brightness value in the brightness range according to the set brightness width is calculated, and a process of generating and outputting a corrected image so as to replace the correction target point brightness with the maximum brightness value is performed.
Image processing device.
画像処理装置での画像処理方法であって、
帳票が光学的に読み取られた画像を入力し、前記画像内でのポイント毎の明度のヒストグラムを作成し、前記ポイント毎の明度を補正対象ポイント明度として、前記ヒストグラムでの前記補正対象ポイント明度に対し設定される明度幅による明度範囲での明度平均値を計算し、前記補正対象ポイント明度を前記明度平均値で置き換えるように補正した画像を生成し出力するステップを有する、
画像処理方法。
It is an image processing method in an image processing device.
An image in which the form is optically read is input, a histogram of the brightness of each point in the image is created, the brightness of each point is set as the point brightness to be corrected, and the brightness of the point to be corrected in the histogram is used. It has a step of calculating a brightness average value in a brightness range according to a set brightness width, and generating and outputting an image corrected so as to replace the correction target point brightness with the brightness average value.
Image processing method.
画像処理装置に画像処理を実行させる画像処理プログラムであって、
帳票が光学的に読み取られた画像を入力し、前記画像内でのポイント毎の明度のヒストグラムを作成し、前記ポイント毎の明度を補正対象ポイント明度として、前記ヒストグラムでの前記補正対象ポイント明度に対し設定される明度幅による明度範囲での明度平均値を計算し、前記補正対象ポイント明度を前記明度平均値で置き換えるように補正した画像を生成し出力する処理を実行させる、
画像処理プログラム。
An image processing program that causes an image processing device to perform image processing.
An image in which the form is optically read is input, a histogram of the brightness of each point in the image is created, the brightness of each point is set as the point brightness to be corrected, and the brightness of the point to be corrected in the histogram is used. On the other hand, the process of calculating the brightness average value in the brightness range according to the set brightness width, generating and outputting the corrected image so as to replace the correction target point brightness with the brightness average value is executed.
Image processing program.
JP2020126112A 2020-07-27 2020-07-27 Image processing device, method, and program Pending JP2022023288A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020126112A JP2022023288A (en) 2020-07-27 2020-07-27 Image processing device, method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020126112A JP2022023288A (en) 2020-07-27 2020-07-27 Image processing device, method, and program

Publications (1)

Publication Number Publication Date
JP2022023288A true JP2022023288A (en) 2022-02-08

Family

ID=80226058

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020126112A Pending JP2022023288A (en) 2020-07-27 2020-07-27 Image processing device, method, and program

Country Status (1)

Country Link
JP (1) JP2022023288A (en)

Similar Documents

Publication Publication Date Title
US7916973B2 (en) Image processing apparatus, an image processing method, and a computer readable medium having recorded thereon a processing program for permitting a computer to perform image processing routines
JP4878572B2 (en) Image processing apparatus and image processing method
JP4883789B2 (en) Image processing apparatus and image processing method
JP4617076B2 (en) Display correction circuit and display device
JP4864332B2 (en) Resolution conversion interpolation method, image processing apparatus, image display apparatus, program, and recording medium
JP6573375B2 (en) Image processing apparatus, image processing apparatus control method, and program
US20070122061A1 (en) Image processing device, image processing program, and computer-readable recording medium
US10497098B2 (en) Display apparatus and image processing method thereof
JP3142550B2 (en) Graphic processing unit
JP2015192435A (en) Image processing apparatus and computer program
JP2018074497A (en) Image processing device, image processing method and program
JP2022023288A (en) Image processing device, method, and program
JP2007079586A (en) Image processor
JP4772049B2 (en) Image data generation apparatus, image data generation method, program, and storage medium
JP6837860B2 (en) Image display control device, image display control method, and image display control program
JP2007079587A (en) Image processor
JP2018147199A (en) Image processing device, and computer program
JP5473981B2 (en) Image generation apparatus, image generation system, image display apparatus, computer program, and image generation method
JP6500638B2 (en) Image processing apparatus and computer program
JP3652167B2 (en) Image processing apparatus and method and storage medium therefor
JP2004226679A (en) Character display method and system
JP2018148378A (en) Image processing device and computer program
JP2023069216A (en) Image processing device, printer, image processing method, and program
JP2022055982A (en) Reading device and image data processing method
JP6418055B2 (en) Image processing apparatus and computer program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230424

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240215

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20240227