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

Image processing device, method, and program Download PDF

Info

Publication number
JP7491763B2
JP7491763B2 JP2020126112A JP2020126112A JP7491763B2 JP 7491763 B2 JP7491763 B2 JP 7491763B2 JP 2020126112 A JP2020126112 A JP 2020126112A JP 2020126112 A JP2020126112 A JP 2020126112A JP 7491763 B2 JP7491763 B2 JP 7491763B2
Authority
JP
Japan
Prior art keywords
brightness
image
value
image processing
correction
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
JP2020126112A
Other languages
Japanese (ja)
Other versions
JP2022023288A (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 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/JP7491763B2/en
Publication of JP2022023288A publication Critical patent/JP2022023288A/en
Application granted granted Critical
Publication of JP7491763B2 publication Critical patent/JP7491763B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

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

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

上記読み取り画像の色ムラ等を補正する画像処理に関して、先行技術例としては、特開平9-149277号公報が挙げられる。特許文献1には、「画像明度変換装置」として、「入力される画像濃度がその都度ばらついても忠実な色のままで、最大のコントラストを得て、好ましい明るさに自動的に適正化できる」旨が記載されている。特許文献1では、明度変換として、明度のヒストグラムを用いる旨が記載されている。 As an example of prior art related to image processing for correcting color unevenness and the like in the scanned image, JP 9-149277 A can be cited. Patent document 1 describes an "image brightness conversion device" that "can maintain faithful colors, obtain maximum contrast, and automatically optimize to a preferred brightness even if the input image density varies from one image to the next." Patent document 1 also describes the use of a brightness histogram for brightness conversion.

特開平9-149277号公報Japanese Patent Application Laid-Open No. 9-149277

帳票の用紙に、紙質に応じたすきムラや、記載時の筆圧や搬送時のばたつき等に応じたよれや折れ曲がり、言い換えると、紙面において厚さの違いの分布が生じている場合がある。その場合、その帳票の読み取り画像には、ランダムな箇所に、色ムラ・明度ムラが生じる場合がある。その読み取り画像を人の眼から見た場合、視認性が良くない場合がある。あるいは、用紙の重なり・裏写り等がある場合には、透けた文字等が読み取り画像に見えてしまうことで、視認性が良くない場合がある。 The paper used for forms may have uneven gaps depending on the paper quality, or wrinkles or folds depending on the writing pressure or flapping during transportation, in other words, a distribution of differences in thickness on the paper surface. In such cases, the scanned image of the form may have uneven color or brightness in random places. When viewed by the human eye, the scanned image may be difficult to see. Alternatively, if the paper overlaps or shows through, see-through characters may be visible in the scanned image, resulting in poor visibility.

本発明の目的は、画像処理技術に関して、読み取り画像の色ムラ・明度ムラを低減して視認性を高めることができる技術を提供することである。 The objective of the present invention is to provide an image processing technology that can reduce color and brightness unevenness in scanned images and improve visibility.

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

本発明のうち代表的な実施の形態によれば、画像処理技術に関して、読み取り画像の色ムラ・明度ムラを低減して視認性を高めることができる。 A representative embodiment of the present invention uses image processing technology to reduce color and brightness unevenness in scanned images, improving visibility.

本発明の実施の形態1の画像処理装置を含む、システムの構成を示す図である。1 is a diagram showing a configuration of a system including an image processing device according to a first embodiment of the present invention; 実施の形態1で、読み取りの対象となる帳票の例を示す図である。FIG. 4 is a diagram showing an example of a document to be read in the first embodiment; 実施の形態1で、補正前画像と補正後画像の例を示す図である。3A to 3C are diagrams showing examples of a pre-correction image and a post-correction image in the first embodiment. 実施の形態1で、補正前画像内の明度分布の例を示す図である。5A to 5C are diagrams illustrating an example of brightness distribution in a pre-corrected image in the first embodiment. 実施の形態1で、補正後画像内の明度分布の例を示す図である。5A to 5C are diagrams illustrating an example of brightness distribution in a corrected image in the first embodiment. 実施の形態1で、主な処理フローのその1を示す図である。FIG. 11 is a diagram showing a first main processing flow in the first embodiment. 実施の形態1で、主な処理フローのその2を示す図である。FIG. 11 is a diagram showing the second main processing flow in the first embodiment. 実施の形態1で、主な処理フローのその3を示す図である。FIG. 11 is a diagram showing the third main processing flow in the first embodiment. 実施の形態1で、対象画像のデータ形式の例を示す図である。FIG. 4 is a diagram showing an example of a data format of a target image in the first embodiment. 実施の形態1で、明度のヒストグラムの例を示す図である。FIG. 4 is a diagram showing an example of a luminance histogram in the first embodiment. 実施の形態1で、ヒストグラム中のポイントおよび範囲の例を示す図である。FIG. 11 is a diagram showing an example of points and ranges in a histogram in the first embodiment. 実施の形態1で、ポイントの範囲での平均値の計算例を示す図である。FIG. 11 is a diagram showing an example of calculating an average value within a range of points in the first embodiment. 実施の形態1で、ルックアップテーブル(LUT)の例を示す図である。FIG. 2 is a diagram showing an example of a look-up table (LUT) in the first embodiment. 実施の形態1の変形例で、ユーザ設定情報の例を示す図である。FIG. 13 is a diagram showing an example of user setting information in a modification of the first embodiment. 実施の形態1の変形例で、読み取り画像の処理例を示す図である。13A and 13B are diagrams illustrating an example of processing of a read image in a modified example of the first embodiment.

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

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

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

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

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

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

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

画像処理装置1は、実施の形態1の画像処理プログラムが実装されているコンピュータである。また、本例では特に、画像処理装置1は、OCR装置(言い換えると帳票認識装置)であり、帳票認識プログラム内に実施の形態1の画像処理プログラムが含まれている。実施の形態1の画像処理プログラムは、実施の形態1の画像処理方法に対応する、色ムラ補正処理を含む画像処理および情報処理をコンピュータ(画像処理装置1)に実行させるプログラムである。 The image processing device 1 is a computer in which the image processing program of the first embodiment is implemented. In particular, in this example, 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 that causes a computer (the 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とが一体である構成でもよい。 This image processing device 1 is configured, for example, by a PC and software installed thereon, but it may also be configured as a dedicated device such as an OCR or multifunction device. Also, in this example, the image processing device 1 and the scanner device 2 are configured separately, but this is not limited thereto, and the image processing device 1 and the scanner device 2 may also be configured as an integrated device.

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

画像処理装置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 that 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, which are connected to each other via a bus or the like. The arithmetic unit 101 is configured with a CPU, a ROM, a RAM, and the like, and realizes a processor or 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, a color unevenness correction processing unit. The arithmetic unit 101 realizes each functional block by reading the control program 121 of the storage device 102 and executing processing 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 device 101 and the like. The storage device 102 stores a control program 121, an image file 122 before correction, an image file 123 after correction, and form recognition result data 124. 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 in which characters, etc. are to be recognized) is set according to the format of each form 3. The form recognition result data 124 is data that includes information such as characters and figures recognized from within the form 3, which is created as a result of the form recognition process. Note that a DB server, a storage device, etc. 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 described below, the image file 122 before correction may contain color unevenness, and the image processing unit 20 performs color unevenness correction processing to reduce the color unevenness. As a result of this processing, an image with reduced color unevenness becomes the corrected image file 123. The corrected image file 123 with reduced color unevenness becomes an ideal image with high visibility when viewed by the user U1. Furthermore, the image processing device 1 may be able to obtain more accurate results by performing form recognition processing using the corrected image file 123.

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

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

外部記憶装置107は、例えばディスク装置やメモリカード装置等が挙げられる。外部記憶装置107には、演算装置101からの制御に基づいて、画像ファイル等の保存が可能である。画像処理装置1は、外部記憶装置107に格納されている画像ファイル等を入力してもよい。 The external storage device 107 may be, for example, a disk device or a memory card device. The external storage device 107 can store image files and the like based on control from the computing device 101. The image processing device 1 may input image files and 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 an image file 122 before correction. The form recognition processing unit 12 performs form recognition processing (OCR processing) on the image file to be recognized (e.g., the corrected image file 122), creates form recognition result data 124 including extracted information such as characters, and stores it in the storage device 102. The form recognition result output unit 13 displays form recognition result information based on the form recognition result data 124 on the display screen. User U1 can view 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 color unevenness correction function, and displays them on the display screen of the display device 106. The setting unit 15 accepts user settings related to the form recognition function and color unevenness correction function through the screen and stores them as setting information.

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

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

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

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

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

図3の(B)は、(A)の補正前画像に対し、実施の形態1による色ムラ補正処理を施した後の補正後画像の例を示す模式図である。(B)の画像は、(A)の画像と比べて、色ムラ・明度ムラが低減されている。なお、(B)の補正後画像は、背景領域が単に1つの色、1つの明度に塗りつぶされているわけではなく、複数の色・明度の分布を有する。 Figure 3 (B) is a schematic diagram showing an example of a corrected image after applying the color unevenness correction process according to embodiment 1 to the pre-corrected image (A). Compared to the image (A), the image (B) has reduced color unevenness and brightness unevenness. Note that the post-correction image (B) has a distribution of multiple colors and brightnesses, rather than the background region being simply filled with one color and one brightness.

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

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

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

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

このように、領域内での明度の変動が大きい現象は、色ムラ・明度ムラに相当する。この明度変動が大きいほど、すなわちムラの度合いが大きいほど、人の眼には視認性が低く感じられる。 In this way, the phenomenon of large fluctuations in brightness within an area corresponds to color unevenness and brightness unevenness. The greater this brightness fluctuation, i.e., the greater the degree of unevenness, the lower the visibility perceived by the human eye.

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

[処理フロー]
図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]
Figures 6 to 8 show the main processing flows by the image processing unit 20 of the image processing device 1 in the first embodiment. Figure 6 is flow 1, which has steps S1 to S6. Figure 7 is flow 2 following Figure 6, which has steps S7 to S9. Figure 8 is flow 3 following Figure 6, which has steps S10 to S13. Broadly speaking, Figure 6 is a flow of histogram calculation and average value (correction value) calculation in the first method. Figure 7 is a flow of correction processing when the color tone preservation function is not used (method Y). Figure 8 is a flow of correction processing when the color tone preservation 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 image file 122 before correction in 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. The histogram is created for the entire image that has been read, and the brightness is calculated for each point. In detail, step S1 includes steps S1A, S1B, and S1C. In step S1A, the image processing unit 20 creates a histogram (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 (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 (HB) of the brightness of the B component (B pixel value) of the target image. The image processing unit 20 holds the data of the created histogram in a memory such as the storage device 102.

図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階調の範囲内の値である。 Figure 9 shows an example of the data format of the target image. The data format of the target image is, for example, a 3 x 8 = 24 bit color image. The target image is a two-dimensional image in the X direction (horizontal direction) and Y direction (vertical direction). Px,y represents the pixel and pixel value at the position (x,y). The pixel Px,y is composed of a set of three sub-pixels, R (red), G (green), and B (blue). The pixels and pixel values of R, G, and B are shown as Rx,y, Gx,y, and Bx,y. That is, the color and 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 device 1, a point is one pixel Px,y in a broad sense, and each of the sub-pixels for R, G, and B in a narrow sense. The pixel value (in other words, brightness) of the pixel Px,y 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. When expressed in 8 bits, for example, the values r, g, and b are values within the range of 256 gradations from 0 to 255. The pixel value before correction of pixel Px, y becomes the corrected pixel value through correction (replacement with the average brightness value in the first method) described below. The corrected pixel value has, for example, a value ra of the R pixel Rx, y, a value ga of the G pixel Gx, y, and a value ba of the B pixel Bx, y. 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は、対象画像の画素毎に、対応する明度毎の頻度値を計数し、この表の頻度値列のその変数に格納する。 Figure 10 shows an example of histogram data created in step S1. (A) in Figure 10 is a histogram table. This table is for the histogram HR of R pixel brightness. This table has a "brightness (R pixel value)" column and a "frequency value" column. "Brightness (R pixel value)" is, for example, a value from 0 to 255 as described above. Each row stores a frequency value for each R pixel value. Here, the frequency value is represented by an abstract variable such as h0, but in reality, a numerical value is stored in that variable. The image processing unit 20 counts the frequency value for each corresponding brightness for each pixel in the target image, and stores it in that variable in the frequency value column of this table.

図10の(B)は、(A)のデータに対応するヒストグラム(HR)のグラフを示す。このグラフは、横軸が明度(R画素値)、縦軸が頻度値(言い換えると計数値)である。頻度値は、0から全画素数までの範囲内の値である。なお、明度を記号V、頻度値を記号Fで表す場合がある。 Figure 10 (B) shows a histogram (HR) graph corresponding to the data in (A). In this graph, the horizontal axis is brightness (R pixel value) and the vertical axis is frequency value (in other words, count value). Frequency value is a value in the range from 0 to the total number of pixels. Note that brightness may be represented by the symbol V and frequency value 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 uses the histogram created in step S1 to calculate an average value (e.g., a weighted average value) of the frequency values of brightness in the specified range for each point in the target image. More specifically, step S2 includes steps S2A, S2B, and S2C. Step S2A is a step of calculating an average value (AR) of the frequency values of brightness in the specified range for each R pixel using the histogram HR of the R pixels. Step S2B is a step of calculating an average value (AG) of the frequency values of brightness in the specified range for each G pixel using the histogram HG of the G pixels. Step S2C is a step of calculating an average value (AB) of the frequency values of brightness in the specified range for each B pixel using the histogram HB of the B pixels.

図11および図12は、ステップS2に関する説明図である。図11は、対象画像の明度のヒストグラム(図10とも対応する)の例である。ここでは、横軸を頻度値F、縦軸を明度Vとして示す。図12は、図11のヒストグラムのうちの一部として、ある明度Viの付近の範囲Wの拡大を示す。例えばあるポイントの画素Px,yにおける明度Vが、図示するような比較的高いある明度Viであったとする。この場合について、ステップS2の平均値を計算する処理例を説明する。説明上、明度Viを、補正対象ポイント明度:V0とも呼ぶ。ステップS1のヒストグラムにおいて、この明度Viでの頻度値Fが頻度値Fiであったとする。頻度値Fiを、補正対象ポイント頻度値:F0とも呼ぶ。 Figures 11 and 12 are explanatory diagrams relating to step S2. Figure 11 is an example of a histogram of the brightness of the target image (also corresponding to Figure 10). Here, the horizontal axis indicates the frequency value F, and the vertical axis indicates the brightness V. Figure 12 shows an enlarged range W around a certain brightness Vi as part of the histogram of Figure 11. For example, assume that the brightness V at a certain point pixel Px,y is a relatively high brightness Vi as shown in the figure. In this case, an example of the process of calculating the average value in step S2 will be described. For the sake of explanation, the brightness Vi is also referred to as the correction target point brightness: V0. In the histogram of step S1, assume that the frequency value F at this brightness Vi is the frequency value Fi. The frequency value Fi is also referred to as the 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 specified range W to the frequency value F0 of the brightness V0. The range W is a range related to the brightness V, and is also called the brightness range. In this example, the range W is defined using a positive/negative width (±k1) related to the brightness V. In other words, the range W is a range from brightness (V0-k1) to brightness (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 the average value for the frequency value F of the brightness V in this range W. The calculated weighted average value is set as the brightness average value V1 and the frequency average value F1. The frequency average value F1 is the frequency at the brightness average value V1. The weighted average value can generally be calculated using the following formula. If the observed value is X, the weight for each observed value is w, and the number of observed values is n, then [weighted average value] = (w1.X1 + w2.X2 + ... + wn.Xn) / (w1 + w2 + ... + wn). If all weights w are equal, this is the arithmetic mean value. In the example of the first embodiment, the weight w is a value obtained by multiplying the frequency value of the histogram corresponding to each brightness by a coefficient. The coefficient may be, for example, 1.

また、実施の形態1の変形例において、画像処理装置1は、第1方式ではなく、第2方式を用いる。第2方式では、画像処理部20は、この範囲Wで、明度Vの頻度値Fに関する最大値を計算する。計算された最大値を、明度最大値V2および頻度最大値F2とする。明度最大値V2は、頻度最大値F2での明度である。 In addition, in a modified example of the first embodiment, the image processing device 1 uses the second method instead of the first method. In the second method, the image processing unit 20 calculates the maximum value related to the frequency value F of the brightness V in this range W. The calculated maximum values are 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の各行に値を格納する。 Figure 13 shows an example of a lookup table (LUT) used in the processing of step S2. An LUT is prepared as data for each of the R, G, and B components. The respective LUTs are referred to as tables TR, TG, and TB. The image processing unit 20 creates and stores the data of each LUT in memory. Figure 13 shows an example of table TR, which is an LUT for an R pixel, for example. 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 Figure 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 (average brightness V1 in Figure 12). Here, the "output value" is shown as an abstract variable from 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 set to 0. As the processing of step S2 progresses, the image processing unit 20 stores values in each row of these tables TR, TG, and TB.

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

図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. There are two methods that can be selected here: a method (method A) in which only the white component is corrected, excluding the black component, for the white and black components of the binarized pixel values, and a method (method B) in which both the white and black components, that is, the entire image, are corrected. 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 settings on the screen provided by the image processing device 1, or the user may select and input the method (A, B) to be used for the form 3 on the screen as appropriate. In step S3, the image processing unit 20 judges whether to apply method A, which corrects only pixel components that become white (value 1) when the target image is binarized, or to apply method B, which also corrects pixel components that become black (value 0). If method A is applied (Y), proceed to step S4, and if method B is applied (N), skip step S4 and proceed to step S5.

ステップS4では、方式Aのために、対象画像に対する2値化処理を行う。2値化処理後の対象画像では、図9の各画素Px,yの値、すなわちRx,y、Gx,y、Bx,yは、値0(黒)または値1(白)をとる。 In step S4, binarization processing is performed on the target image for method A. In the target image after binarization processing, the values of each pixel Px,y in FIG. 9, i.e., Rx,y, Gx,y, and Bx,y, take on a value of 0 (black) or a value of 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 an LUT for the average value (brightness after correction) in the first method. More specifically, step S5 has steps S5A, S5B, and S5C. Step S5A creates an LUT (table TR) for the average value (AR) for the R component. Step S5B creates an LUT (table TG) for the average value (AG) for the G component. Step S5C creates an LUT (table TB) for the average value (AB) for the B component. For example, an LUT like that 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 preserves the color tone of the image in accordance with the color tone preservation function (method X), and a method that does not preserve the color tone (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 method X that preserves the color tone, or method Y. If method X is to be applied (Y), the process proceeds to step S10 in FIG. 8; if method Y is to be applied (N), the process proceeds to step S7 in FIG. 7.

まず、より単純な方式である方式Yの場合について説明する。図7のステップS7で、画像処理部20は、ステップS3でいずれの方式(A,B)を選択していたか、および、対象画像内の対象ポイントにおけるステップS4での二値化処理の結果の値が、黒(値0)であるか白(値1)であるかを確認する。方式A選択時で対象ポイントの二値化結果値が白である場合(Y)、または、方式B選択時の場合(Y)には、ステップS8へ進む。方式A選択時で対象ポイントの二値化結果値が黒である場合(N)には、補正処理(ステップS8)を省略するので、ステップS9へ進む。 First, we will explain the case of method Y, which is a simpler method. In step S7 of FIG. 7, the image processing unit 20 checks which method (A, B) was selected in step S3, and whether the value resulting from the binarization process in step S4 at the target point in the target image is black (value 0) or white (value 1). If method A is selected and the binarization result value of the target point is white (Y), or if method B is selected (Y), the process proceeds to step S8. If method A is selected and the binarization result value of the target point is black (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 to replace the brightness before correction of the target point (pixel Px, y) of the target image with the brightness after correction, i.e., the average value of the first method obtained in step S2. That is, the image processing unit 20 performs a correction process to replace each of the R, G, and B component values of the target point (correction target point brightness V0 in FIG. 12) with the average value obtained in step S2 (average brightness value V1 in FIG. 12). More specifically, step S8 has steps S8A, S8B, and S8C. In step S8A, the image processing unit 20 performs a correction process to replace the R component value (R pixel value) with a weighted average value (AR). In step S8B, the image processing unit 20 performs a correction process to replace the G component value (G pixel value) with a weighted average value (AG). In step S8C, the image processing unit 20 performs a correction process to replace the B component value (B pixel value) with a weighted average value (AB). If a LUT has already been created based on step S5, the process can be sped up in step S8 by using that LUT.

なお、変形例での第2方式の場合、ステップS8の処理は、平均値ではなく、前述の最大値(明度最大値V2)を用いればよい。第2方式では、画像処理部20は、対象ポイントの明度(V0)を、上記明度最大値V2で置き換える。 In the case of the second method of the modified example, the process of step S8 can use the maximum value (maximum brightness value V2) described above, 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 performs the above-mentioned process on all points of the target image in the same manner. In step S9, the image processing unit 20 checks whether the above-mentioned process has been completed for all points of the target image, and if not (N), the process returns to step S7 and is repeated in the same manner. If completed (Y), the correction of the target image is complete, 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 method X is used, in step S10, the image processing unit 20 performs the same process as step S7 in FIG. 7 to check which method (A, B) was selected in step S3 and whether the value resulting from the binarization process in step S4 at the target point in the target image is white (value 1) or black (value 0). If method A is selected and the binarization result value of the target point is white (Y), or if method B is selected (Y), the process proceeds to step S11. If method A is selected and the binarization result value of the target point is black (N), the correction process (steps S11, S12) is omitted, and 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 calculates the average value of the differences between the R, G, and B component values (correction target point brightness V0) of the target point in the target image and the weighted average value (brightness average value V1) of the "output value" column of the LUT in step S5. This difference is D, and this average value is DA. For example, for an R pixel (Rx, y), the difference D is (V0-V1), as shown in Figure 12. The average value DA is the average value of the differences D in the specified 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, for example, as follows. Let DR be the difference related to the R component, DG be the difference related to the G component, and DB be the difference related to the B component. 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 a correction process in which each component value of the target point (correction target point brightness V0) is replaced by a value obtained by subtracting the average value DA obtained in step S11 from each component value. More specifically, step S12 has steps S12A, S12B, and S12C. In step S12A, the image processing unit 20 replaces the R component value with a value (SR) obtained by subtracting the average value DA from the R component value. In step S12B, the image processing unit 20 replaces the G component value with a value (SG) obtained by subtracting the average value DA from the G component value. In step S12C, the image processing unit 20 replaces the B component value with a value (SB) obtained by subtracting the average value DA from the B component value.

補正値である減算値SR,SG,SBは、例えば以下のように計算できる。補正前のR成分値をVR0、補正前のG成分値をVG0、補正前のB成分値をVB0とする。 The subtraction values SR, SG, and SB, which are the correction values, can be calculated, for example, as follows. 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 is performed by subtraction using the same average value DA for all R, G, and B. This makes it possible to suppress large corrections to only specific colors and preserve the color tone. With this processing method, color tone can be preserved while suppressing the calculation processing load. Note that the above processing method for preserving color tone is one example, and other processing methods may also 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 checks whether the above processing has been completed for all points of the target image, and if not (N), the process returns to step S10 and repeats the same process. If completed (Y), the correction of the target image is complete, 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 unevenness in color and brightness in the scanned image of the document, thereby improving visibility.

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

実施の形態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 process (step S2) is performed to calculate a correction value (weighted average value) in a specified range W for each point using the brightness histogram of the entire image (step S1 in FIG. 6). This process (step S2) uses the histogram data created in step S1, so the calculation processing load is relatively small for processing each point. Therefore, the calculation processing load in the correction process of the entire target image is also kept relatively small. That is, the image processing method of the first embodiment can reduce color unevenness and brightness unevenness with high processing efficiency. This process (step S2) is different from a method in which a correction value is calculated by referring to the brightness of an area around a point (e.g., a pixel) in an image. In such a method, processing for each point is required, and the calculation processing load is accordingly large. In addition, the distribution of characters, images, etc. in a document varies, and in such a method, it is unclear whether the area to be referred to for each point is appropriate.

また、ステップS3の方式Aと方式Bとの違いに関して、白成分のみを補正対象とする方式Aを用いる場合、特に比較的白い背景領域(二値化の値が白となる領域)の色ムラ・明度ムラを低減できる。比較的黒い図像領域(二値化の値が黒となる領域)については、色ムラ・明度ムラがあった場合でも、人の眼から見て図像としての認識がしやすく、ムラが気になりにくい。そのため、方式Bでは、その比較的黒い領域の補正処理を省略でき、全体として処理効率化が実現できる。また、方式Bでは、色ムラ補正によって薄い文字等が消えてしまうことを防止することもできる。二値化処理によって黒になるような明度の画素がある場合に、方式Bでは、その画素をそのまま残すことができる。 In addition, with regard to the difference between Method A and Method B in step S3, when Method A is used, which only targets white components for correction, it is possible to reduce color and brightness unevenness, particularly in relatively white background areas (areas where the binarized value is white). In relatively black image areas (areas where the binarized value is black), even if there are color and brightness unevenness, the image is easily recognized by the human eye, and the unevenness is less noticeable. Therefore, in Method B, the correction process for the relatively black areas can be omitted, and overall processing efficiency can be improved. In addition, in Method B, it is possible to prevent light characters and the like from disappearing due to color unevenness correction. In the case of pixels with a brightness that will become black through binarization processing, Method B can leave those pixels as they are.

また、色合い保持機能に関する方式Xと方式Yとの違いに関しては、対象の帳票3等に応じて、方式を選択して適用すればよい。紙面の色合いを保持したい場合には方式Xを適用し、保持する必要が無い場合には方式Yを適用して処理効率化が可能である。 As for the difference between method X and method Y regarding the color-preserving function, the method can be selected and applied according to the target form 3, etc. If you want to preserve the color of the paper surface, apply method X, and if there is no need to preserve the color, apply method Y, making it possible to improve processing efficiency.

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

<他の実施の形態>
実施の形態1の構成に限らず、以下のような変形例も可能である。
<Other embodiments>
The present invention is not limited to the configuration of the first embodiment, and the following modifications 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 first modification automatically changes the processing method to be applied depending on the target image corresponding to the type of the target form 3, etc. FIG. 14 shows an example of user setting information related to the function of the first modification. The image processing device 1 allows the user to set the user on a screen provided to the user, and stores the user setting information in a 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 to be automatically applied to the "form type". The selectable methods include the above-mentioned methods (first method, second method, methods A, B, method X, Y). For example, for form type = A, the first method, method A, and method X are set as those to be automatically applied. By using such a user setting function, the user can automatically apply an appropriate method to various forms 3. Furthermore, the user may input an instruction for the method to be applied each time an image is input, and the user may specify any timing for executing the color unevenness correction.

また、このユーザ設定機能では、帳票種類毎に、色ムラ補正機能自体の適用のオン/オフを設定できるようにしてもよい。例えば、図14の例では、帳票種類=Dについては、「オフ」と設定されている。これにより、帳票種類=Dの場合の読み取り画像については、色ムラ補正処理が行われない。図14のような表に限らず、ユーザ設定画面では、方式毎にボタン等を表示し、ボタン等でオン/オフが設定できるようにしてもよい。 This user setting function may also allow the user to set the application of the color unevenness correction function itself to on/off for each document type. For example, in the example of Figure 14, the function is set to "off" for document type D. As a result, color unevenness correction processing is not performed on scanned images for document type D. In addition to the table in Figure 14, the user setting screen may also display buttons or the like for each method, allowing the user to set the function to on/off using the buttons or the like.

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

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

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

[変形例2]
変形例2の画像処理装置1は、追加的な機能として以下を有する。画像処理装置1は、ユーザに対する画面に、対象の帳票3の対応する読み取り画像を表示し、全体領域のうちで、色ムラ補正を適用する領域と適用しない領域とをユーザが選択可能とする。ユーザは、その画面で、例えば、色ムラ補正を適用する一部の領域を選択指定できる。画像処理部2は、その指定された領域に対し色ムラ補正処理を実行する。例えば図2の帳票3についての読み取り画像の場合に、ユーザが背景領域201等の領域を選択指定してもよい。
[Modification 2]
The image processing device 1 of the second modified example has the following additional functions. The image processing device 1 displays a scanned image of the target form 3 on a screen for the user, and allows the user to select areas of the entire area to which color unevenness correction should be applied and areas to which it should not be applied. On that screen, the user can, for example, select and specify a partial area to which color unevenness correction should be applied. The image processing unit 2 executes color unevenness correction processing on the specified area. For example, in the case of a scanned image of the form 3 in 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 column and a seal column is specified for each form 3. Furthermore, if the image processing device 1 is an OCR device, a format for form recognition, such as the reading field (dashed frame) in FIG. 2, is set according to the form 3. The image processing device 1 of variant example 2 allows the user to select and set the presence or absence of color unevenness correction and the processing method for each reading field (i.e., for each corresponding pixel area) based on the reading field of the format. The user may also be allowed to freely specify the area to be corrected by operating a mouse or the like within the displayed image.

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

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

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

Claims (6)

帳票が光学的に読み取られた画像を入力し、前記画像内でのポイント毎の明度のヒストグラムを作成し、前記ポイント毎の明度を補正対象ポイント明度として、前記ヒストグラムでの前記補正対象ポイント明度に対し設定される明度幅による明度範囲での明度平均値を計算し、前記補正対象ポイント明度を前記明度平均値で置き換えるように補正した画像を生成し出力する処理を行う、
画像処理装置。
a process of inputting an image obtained by optically reading a document, creating a histogram of the brightness of each point in the image, setting the brightness of each point as a correction target point brightness, calculating an average brightness value within a brightness range according to a brightness width set for the correction target point brightness in the histogram, and generating and outputting a corrected image in which the correction target point brightness is replaced with the average brightness value;
Image processing device.
請求項1記載の画像処理装置において、
前記画像内の前記ポイント毎に2値化を行い、2値化した結果が白となる部分には前記補正を適用し、黒となる部分には前記補正を適用しない、
画像処理装置。
2. The image processing apparatus according to claim 1,
binarizing each of the points in the image, applying the correction to a portion that is white as a result of the binarization, and not applying the correction to a portion that is black as a result of the binarization;
Image processing device.
請求項1記載の画像処理装置において、
前記画像は、前記ポイント毎に、R、G、およびBの画素値を有し、
前記ポイント毎の各成分の前記画素値について、それぞれ前記明度平均値との差を計算し、前記差の平均値を計算し、前記各成分の画素値から前記差の平均値を減算したそれぞれの減算値を計算し、前記各成分の画素値を前記減算値で置き換えるように補正する、
画像処理装置。
2. The image processing apparatus according to claim 1,
the image having R, G, and B pixel values for each of the points;
a difference between the pixel value of each component of each point and the average brightness value is calculated, an average value of the differences is calculated, and a subtraction value is calculated by subtracting the average value of the differences from the pixel value of each component, and the pixel value of each component is corrected by replacing the pixel value of each component with the subtraction value;
Image processing device.
帳票が光学的に読み取られた画像を入力し、前記画像内でのポイント毎の明度のヒストグラムを作成し、前記ポイント毎の明度を補正対象ポイント明度として、前記ヒストグラムでの前記補正対象ポイント明度に対し設定される明度幅による明度範囲での頻度最大値での明度を計算し、前記補正対象ポイント明度を前記頻度最大値での明度で置き換えるように補正した画像を生成し出力する処理を行う、
画像処理装置。
a process of inputting an image obtained by optically reading a document, creating a histogram of the brightness of each point in the image, setting the brightness of each point as a correction target point brightness, calculating the brightness at the maximum frequency in a brightness range according to a brightness width set for the correction target point brightness in the histogram, and generating and outputting a corrected image in which the correction target point brightness is replaced with the brightness at the maximum frequency ;
Image processing device.
画像処理装置での画像処理方法であって、
帳票が光学的に読み取られた画像を入力し、前記画像内でのポイント毎の明度のヒストグラムを作成し、前記ポイント毎の明度を補正対象ポイント明度として、前記ヒストグラムでの前記補正対象ポイント明度に対し設定される明度幅による明度範囲での明度平均値を計算し、前記補正対象ポイント明度を前記明度平均値で置き換えるように補正した画像を生成し出力するステップを有する、
画像処理方法。
An image processing method in an image processing device, comprising:
a step of inputting an image obtained by optically reading a document, creating a histogram of brightness for each point in the image, calculating an average brightness value in a brightness range according to a brightness width set for the brightness of the correction target point in the histogram by using the brightness of each point as a correction target point brightness, and generating and outputting a corrected image in which the brightness of the correction target point is replaced with the average brightness value;
Image processing methods.
画像処理装置に画像処理を実行させる画像処理プログラムであって、
前記画像処理として、帳票が光学的に読み取られた画像を入力し、前記画像内でのポイント毎の明度のヒストグラムを作成し、前記ポイント毎の明度を補正対象ポイント明度として、前記ヒストグラムでの前記補正対象ポイント明度に対し設定される明度幅による明度範囲での明度平均値を計算し、前記補正対象ポイント明度を前記明度平均値で置き換えるように補正した画像を生成し出力する処理を前記画像処理装置に対して実行させる、
画像処理プログラム。
An image processing program for causing an image processing device to execute image processing,
As the image processing, the image processing device is caused to execute a process of inputting an image obtained by optically reading a document, creating a histogram of brightness for each point in the image, calculating an average brightness value in a brightness range according to a brightness width set for the brightness of the correction target point in the histogram, and generating and outputting a corrected image in which the brightness of the correction target point is replaced with the average brightness value, with the brightness of each point being set as a correction target point brightness.
Image processing program.
JP2020126112A 2020-07-27 2020-07-27 Image processing device, method, and program Active JP7491763B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020126112A JP7491763B2 (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 JP7491763B2 (en) 2020-07-27 2020-07-27 Image processing device, method, and program

Publications (2)

Publication Number Publication Date
JP2022023288A JP2022023288A (en) 2022-02-08
JP7491763B2 true JP7491763B2 (en) 2024-05-28

Family

ID=80226058

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JP7491763B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016048828A (en) 2014-08-27 2016-04-07 沖電気工業株式会社 Information processing device, information processing method, and program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016048828A (en) 2014-08-27 2016-04-07 沖電気工業株式会社 Information processing device, information processing method, and program

Also Published As

Publication number Publication date
JP2022023288A (en) 2022-02-08

Similar Documents

Publication Publication Date Title
US9524664B2 (en) Display device, display panel driver and drive method of display panel
US9196204B2 (en) Image processing apparatus and image processing method
JP6086393B2 (en) Control signal generation circuit, video display device, control signal generation method, and program thereof
JP4878572B2 (en) Image processing apparatus and image processing method
JP4617076B2 (en) Display correction circuit and display device
JP4966383B2 (en) Liquid crystal display
JP5091995B2 (en) Liquid crystal display
KR100772906B1 (en) Method and apparatus for displaying image signal
JP5079017B2 (en) Display device
JP6298759B2 (en) Image display method and image display apparatus
JPWO2006025486A1 (en) Image correction processing system and image correction processing method
US20170010845A1 (en) Light control device, display device, multiscreen display system, light control method, and program
US20070122061A1 (en) Image processing device, image processing program, and computer-readable recording medium
KR20170040865A (en) Display device and image rendering method thereof
JP2015192435A (en) Image processing apparatus and computer program
JP2018074497A (en) Image processing device, image processing method and program
US8958657B2 (en) Frame rate conversion image processing apparatus, control method, and computer-readable storage medium
JP2020154102A (en) Display device
JP7491763B2 (en) Image processing device, method, and program
JP5293923B2 (en) Image processing method and apparatus, image display apparatus and program
JP6241155B2 (en) Control device and computer program
JP5473981B2 (en) Image generation apparatus, image generation system, image display apparatus, computer program, and image generation method
JP6837860B2 (en) Image display control device, image display control method, and image display control program
WO2018181081A1 (en) Image display device
JP6500638B2 (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

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240425

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240516

R150 Certificate of patent or registration of utility model

Ref document number: 7491763

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150