JP2002247398A - Device and method for processing image - Google Patents

Device and method for processing image

Info

Publication number
JP2002247398A
JP2002247398A JP2001040784A JP2001040784A JP2002247398A JP 2002247398 A JP2002247398 A JP 2002247398A JP 2001040784 A JP2001040784 A JP 2001040784A JP 2001040784 A JP2001040784 A JP 2001040784A JP 2002247398 A JP2002247398 A JP 2002247398A
Authority
JP
Japan
Prior art keywords
value
gamma
white
image
image data
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.)
Withdrawn
Application number
JP2001040784A
Other languages
Japanese (ja)
Inventor
Takatsune Akaishi
貴恒 赤石
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2001040784A priority Critical patent/JP2002247398A/en
Publication of JP2002247398A publication Critical patent/JP2002247398A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To prepare a gamma correction table from which an excellent gradation property can be obtained in order to conquer such a problem that the table becomes a gamma table which makes a whole image brighter by making the whole image darker when the image is too bright or brighter when the image is too dark and is not able to excellently reproduce gradations due to too bright shadow sections. SOLUTION: A histogram is prepared from image data (S401) and white and black points and the mean value of the image data are acquired from the histogram (S402). Then a gamma value is calculated by selectively using the calculating method corresponding to the positional relation between the acquired white and black points and the mean value of the image data and the gamma correction table is prepared based on the calculated gamma value and white and black points (S403).

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は画像処理装置および
その方法に関し、例えば、原稿から読み取った画像を補
正するための補正テーブルを作成する画像処理装置およ
びその方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing apparatus and method, and more particularly to an image processing apparatus and method for creating a correction table for correcting an image read from a document.

【0002】[0002]

【従来の技術】透過原稿画像を入力する装置の代表例と
してフィルムスキャナがある。フィルムスキャナは、ポ
ジフィルムおよびネガフィルムの両方をスキャンするこ
とができる。ポジフィルムは露光域が狭いために、撮影
された画像はハイライト部に偏ったり、シャド部に偏っ
たりすることが少なくない。フィルムスキャナには、こ
のような画像をスキャンする場合に備えて階調を自動補
正する機能が盛り込まれている。
2. Description of the Related Art A film scanner is a typical example of a device for inputting a transparent original image. Film scanners can scan both positive and negative films. Since a positive film has a narrow exposure area, a photographed image is often biased toward a highlight portion or a shadow portion. The film scanner has a function of automatically correcting gradation in preparation for scanning such an image.

【0003】図1はフィルムスキャナにおける階調の自
動補正処理を示すフローチャートである。
FIG. 1 is a flowchart showing automatic gradation correction processing in a film scanner.

【0004】ステップS101で、対象の透過原稿画像をプ
リスキャンする。プリスキャンされた画像は、画像特性
の解析や、スキャンイメージの画面表示に利用される。
プリスキャンにおいては、処理負荷を軽減するために、
実際のスキャンよりも低解像度でスキャンされる。
In step S101, a target transparent original image is prescanned. The pre-scanned image is used for analyzing image characteristics and displaying the scanned image on the screen.
In pre-scan, to reduce the processing load,
Scanned at a lower resolution than the actual scan.

【0005】ステップS102で、プリスキャン画像の画素
データに基づき、RGB各色信号および輝度信号のヒスト
グラムを作成する。例えば、輝度信号Yは、RGB信号から
式(1)により作成される。 Y = 0.30R + 0.59G + 0.11B …(1)
In step S102, a histogram of each RGB color signal and luminance signal is created based on the pixel data of the prescan image. For example, the luminance signal Y is created from the RGB signal by Expression (1). Y = 0.30R + 0.59G + 0.11B… (1)

【0006】RGB信号が各8ビット(256階調)の場合、
輝度信号Yも同じく8ビットの信号になる。従って、ヒス
トグラムは、0から255までの256信号レベルそれぞれの
度数をカウントしたものになる。
When each of the RGB signals is 8 bits (256 gradations),
The luminance signal Y is also an 8-bit signal. Therefore, the histogram counts the frequency of each of the 256 signal levels from 0 to 255.

【0007】ステップS103で、ホワイトポイントおよび
ブラックポイントを決定する。RGB信号と輝度信号Yに対
して、ハイライトポイント(この場合は255レベル側)
と、シャドウポイント(この場合は0レベル側)からの
度数の累積値がそれぞれ所定値(全画素数に対する比率
として示される)になる信号レベルを求め、この信号レ
ベルをホワイトポイントおよびブラックポイントとす
る。なお、ホワイトポイントおよびブラックポイントを
設定する比率の最適値は、画像入力デバイスに依存する
ので一概には言えないが、一般に0.5%程度に設定される
場合が多い。
In step S103, a white point and a black point are determined. Highlight point for RGB signal and luminance signal Y (255 level side in this case)
And a signal level at which the cumulative value of the frequency from the shadow point (in this case, the 0 level side) becomes a predetermined value (shown as a ratio to the total number of pixels), and determines the signal level as a white point and a black point. . The optimal value of the ratio for setting the white point and the black point cannot be unconditionally determined because it depends on the image input device, but is generally set to about 0.5% in many cases.

【0008】ステップS104で、輝度信号Yのヒストグラ
ムからガンマ値を決定し、ホワイトポイントおよびブラ
ックポイントを考慮してガンマテーブルを作成する。ガ
ンマ値は、輝度信号Yの平均値が50%になるように算出さ
れる。出力信号が各色8ビットの場合、50%とは「128」
である。具体的には、式(2)によってガンマ値γを算出
する。 γ= log{(YAV - YLO)/(YHI - YLO)}/log(128/255) …(2) ここで、YHI: 輝度信号のホワイトポイント YLO: 輝度信号のブラックポイント YAV: 輝度信号の平均値
In step S104, a gamma value is determined from the histogram of the luminance signal Y, and a gamma table is created in consideration of a white point and a black point. The gamma value is calculated so that the average value of the luminance signal Y becomes 50%. If the output signal is 8 bits for each color, 50% is "128"
It is. Specifically, the gamma value γ is calculated by equation (2). γ = log {(Y AV - Y LO) / (Y HI - Y LO)} / log (128/255) ... (2) where, Y HI: white point of the luminance signal Y LO: Black Point luminance signal Y AV : Average value of luminance signal

【0009】ガンマテーブルの作成は、プリスキャンに
使用したRGB各一次元のルックアップテーブル(LUT)を、
ホワイトポイント、ブラックポイントおよびガンマ値を
使って変換する。まず、プリスキャンLUTの出力値が、
ホワイトポイントおよびブラックポイントになるプリス
キャンLUTの入力値RGB(XRHI、XGHI、XBHI、XRLO、XGLO
およびXBLO)を求める。
To create a gamma table, a one-dimensional lookup table (LUT) for each of RGB used for pre-scanning is used.
Convert using white point, black point and gamma value. First, the output value of the prescan LUT is
Input values RGB (XR HI prescan LUT comprising a white point and black point, XG HI, XB HI, XR LO, XG LO
And XB LO ).

【0010】次に、プリスキャンLUTの入力のハイライ
トポイントからXRHI、XGHIおよびXBH Iまでの出力値を25
5に、シャドウポイントからXRLO、XGLOおよびXBLOまで
を出力値を0に固定する。この処理により、プリスキャ
ンLUTの入力値XRLO〜XRHI、XGLO〜XGHIおよびXBLO〜XB
HIに対応する出力値は、ブラックポイントからホワイト
ポイントの範囲に存在することになる。そして、前記の
範囲に存在するプリスキャンLUTの出力値を0〜255の範
囲に伸長し、さらに、プリスキャンLUTの出力値にガン
マ値γを掛けてガンマテーブルを作成する。
[0010] Next, the output value from the highlight point of the input prescan LUT to XR HI, XG HI and XB H I 25
At 5, the output values from the shadow point to XR LO , XG LO and XB LO are fixed to 0. By this processing, the input values XR LO to XR HI , XG LO to XG HI and XB LO to XB of the prescan LUT
The output value corresponding to HI will be in the range from the black point to the white point. Then, the output value of the prescan LUT existing in the above range is expanded to the range of 0 to 255, and the output value of the prescan LUT is multiplied by the gamma value γ to create a gamma table.

【0011】ステップS105では、ステップS104で作成さ
れたガンマテーブルを使って、ポジフィルムなどをスキ
ャン(「メインスキャン」と呼ぶ)する。
In step S105, a positive film or the like is scanned (called "main scan") using the gamma table created in step S104.

【0012】[0012]

【発明が解決しようとする課題】上記の自動補正用のガ
ンマテーブルの作成にあっては、次のような改善の余地
がある。
There is room for improvement in the creation of the gamma table for automatic correction described above.

【0013】ガンマ値γは輝度信号Yの平均値を50%にす
る計算式で算出されるので、輝度の平均が中心からずれ
るほどガンマ値γが大きくまたは小さくなる。つまり、
明る過ぎる画像の場合は画像全体を暗くする、また、暗
過ぎる画像の場合は画像全体を明るくする働きが強くな
る。その結果、夜景などの平均輝度が低い画像をスキャ
ンすると、画像全体を明るくするガンマテーブルになる
ので、シャドウ部が明るくなり過ぎて階調を良好に再現
することができない。
Since the gamma value γ is calculated by a formula for setting the average value of the luminance signal Y to 50%, the gamma value γ increases or decreases as the average luminance deviates from the center. That is,
In the case of an image that is too bright, the entire image is darkened, and in the case of an image that is too dark, the function of brightening the entire image is enhanced. As a result, when an image having a low average luminance such as a night view is scanned, a gamma table for brightening the entire image is obtained, so that the shadow portion becomes too bright and gradation cannot be reproduced well.

【0014】また、ガンマテーブル作成において、通常
のガンマカーブは式(3)によって計算される。 Y = 255×(y/255)1/γ …(3) ただし、出力データは8ビット 変換前後のデータをそれぞれy、Yとする
In preparing a gamma table, a normal gamma curve is calculated by equation (3). Y = 255 × (y / 255) 1 / γ … (3) where output data before and after 8-bit conversion are y and Y, respectively.

【0015】図2はガンマテーブルの一例を示す図であ
る。図2(ア)に示すように、ガンマ値γ>1.0では、ガン
マカーブが急峻な入力輝度が低い領域で、ガンマ値γが
大きいほど階調が荒くなる。一方、図2(イ)に示すよう
に、ガンマ値γ<1.0では、ガンマカーブが緩やかな入力
輝度が低い領域で、ガンマ値が小さいほど階調が潰れ
る。
FIG. 2 is a diagram showing an example of a gamma table. As shown in FIG. 2A, when the gamma value γ> 1.0, in a region where the input luminance is low where the gamma curve is steep, the gradation becomes rougher as the gamma value γ increases. On the other hand, as shown in FIG. 2A, when the gamma value is γ <1.0, in a region where the input luminance is low where the gamma curve is gentle, the gradation becomes smaller as the gamma value becomes smaller.

【0016】また、別の方法として、ガンマ値γ>1.0の
場合に、入力輝度が低い領域における階調の荒れを防ぐ
ために、図2(ウ)に示すようなガンマカーブを用いるこ
ともある。図2(ウ)に示すガンマカーブは式(4)によって
計算される。 Y = 255×{1 - (1 - y/255)γ} …(4)
As another method, when gamma value γ> 1.0, a gamma curve as shown in FIG. 2C may be used in order to prevent gradation from being roughened in a region where input luminance is low. The gamma curve shown in FIG. 2 (c) is calculated by equation (4). Y = 255 × {1-(1-y / 255) γ }… (4)

【0017】ただし、図2(ウ)に示すようなガンマカー
ブを使用しても、ガンマ値γが大きくなればハイライト
部の階調が潰れる問題が残る。
However, even if a gamma curve as shown in FIG. 2 (c) is used, there remains a problem that the gradation of the highlight portion is destroyed when the gamma value γ increases.

【0018】本発明は、上述の問題を解決するためのも
のであり、 良好な階調性が得られるガンマ補正テーブ
ルを作成することを目的とする。
An object of the present invention is to solve the above-mentioned problem, and an object of the present invention is to create a gamma correction table capable of obtaining good gradation.

【0019】[0019]

【課題を解決するための手段】本発明は、前記の目的を
達成する一手段として、以下の構成を備える。
The present invention has the following configuration as one means for achieving the above object.

【0020】本発明にかかる画像処理装置は、画像デー
タからヒストグラムを作成する作成手段と、前記ヒスト
グラムからホワイトおよびブラックポイント、並びに、
画像データの平均値を取得する取得手段と、取得される
ホワイトおよびブラックポイントと、前記画像データの
平均値との位置関係に応じた算出方法を選択的に使用し
てガンマ値を算出する算出手段と、算出されるガンマ
値、並びに、前記ホワイトおよびブラックポイントに基
づき、ガンマ補正テーブルを作成する作成手段を有する
ことを特徴とする。
An image processing apparatus according to the present invention comprises a creating means for creating a histogram from image data; a white and black point from the histogram;
Obtaining means for obtaining an average value of image data; calculating means for calculating a gamma value by selectively using a calculation method according to a positional relationship between the obtained white and black points and the average value of the image data A gamma correction table based on the calculated gamma value and the white and black points.

【0021】本発明にかかる画像処理方法は、画像デー
タからヒストグラムを作成し、前記ヒストグラムからホ
ワイトおよびブラックポイント、並びに、画像データの
平均値を取得し、取得されるホワイトおよびブラックポ
イントと、前記画像データの平均値との位置関係に応じ
た算出方法を選択的に使用してガンマ値を算出し、算出
されるガンマ値、並びに、前記ホワイトおよびブラック
ポイントに基づき、ガンマ補正テーブルを作成すること
を特徴とする。
According to the image processing method of the present invention, a histogram is created from image data, and white and black points and an average value of the image data are acquired from the histogram. Calculating a gamma value by selectively using a calculation method according to the positional relationship with the average value of the data, and creating a gamma correction table based on the calculated gamma value and the white and black points. Features.

【0022】好ましくは、前記ガンマ値の算出は、前記
ホワイトおよびブラックポイントの範囲の中心から、前
記画像データの平均値が外れるほどガンマ値を大きくま
たは小さくし、さらに外れると小さくまたは大きくする
ことを特徴とする。
Preferably, the calculation of the gamma value includes increasing or decreasing the gamma value from the center of the range of the white and black points as the average value of the image data deviates, and decreasing or increasing the gamma value further from the average value. Features.

【0023】さらに、好ましくは、前記ガンマ補正テー
ブルは、前記ガンマ値に応じた作成方法を選択的に使用
して作成されることを特徴とする。
Further, preferably, the gamma correction table is created by selectively using a creation method according to the gamma value.

【0024】[0024]

【発明の実施の形態】以下、本発明にかかる一実施形態
の画像処理装置を図面を参照して詳細に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, an image processing apparatus according to an embodiment of the present invention will be described in detail with reference to the drawings.

【0025】[構成]図3は実施形態の画像処理装置の
構成例を示すブロック図である。
[Configuration] FIG. 3 is a block diagram showing a configuration example of an image processing apparatus according to the embodiment.

【0026】ホストコンピュータ300には、フィルムス
キャナ301およびモニタ302が接続されている。ホストコ
ンピュータ300には、スキャナ入力が可能なアプリケー
ション303およびスキャナドライバ304がソフトウェアと
してインストールされている。
The host computer 300 is connected to a film scanner 301 and a monitor 302. In the host computer 300, an application 303 capable of performing scanner input and a scanner driver 304 are installed as software.

【0027】ポジフィルムをスキャン可能なフィルムス
キャナ301は、スキャナドライバ304の要求により、RGB
各一次元のLUTをロードし、低解像度のプリスキャンお
よび高解像度のメインスキャンを行う。
A film scanner 301 capable of scanning a positive film has an RGB
Load each one-dimensional LUT and perform low-resolution pre-scan and high-resolution main scan.

【0028】[スキャンの手順]次に、透過原稿画像を
スキャンする一連の手順を説明する。
[Scanning Procedure] Next, a series of procedures for scanning a transparent original image will be described.

【0029】ユーザは、フィルムスキャナ301に透過原
稿をセットし、アプリケーション303を介してスキャナ
ドライバ304へ透過原稿画像のスキャンを要求する。要
求を受けたスキャナドライバ304は、フィルムスキャナ3
01に対して、既定のプリスキャン用LUTをロードし、プ
リスキャンを行うように要求する。フィルムスキャナ30
1は、ロードしたプリスキャン用LUTを使用し、透過原稿
画像をプリスキャンする。
The user sets a transparent original on the film scanner 301 and requests the scanner driver 304 via the application 303 to scan the transparent original image. Upon receiving the request, the scanner driver 304
Requests 01 to load the default prescan LUT and perform prescan. Film scanner 30
Step 1 uses the loaded prescan LUT to prescan the transparent original image.

【0030】プリスキャンにより得られた低解像度のRG
B画像は、スキャナドライバ304に送られ、スキャナドラ
イバ304の画像処理機能により処理されて、透過原稿画
像用のメインスキャン用LUTが作成される。なお、メイ
ンスキャン用LUTは、透過原稿画像ごとに作成される。
また、スキャナドライバ304は、プリスキャン画像を用
いて、作成したメインスキャン用LUTで透過原稿画像を
スキャンした場合をシミュレートし、シミュレート結果
の画像をアプリケーション303を介してモニタ302に表示
させる。
Low resolution RG obtained by prescan
The B image is sent to the scanner driver 304 and processed by the image processing function of the scanner driver 304 to create a main scan LUT for a transparent original image. Note that the main scan LUT is created for each transparent document image.
Further, the scanner driver 304 simulates a case where a transparent original image is scanned by the created main scan LUT using the pre-scan image, and causes the monitor 302 to display an image of the simulation result via the application 303.

【0031】ユーザは、モニタ302に表示された画像を
確認して、アプリケーション303を介してスキャナドラ
イバ304へ、再度、透過原稿画像のスキャン(メインス
キャン)を要求する。要求を受けたスキャナドライバ30
4は、フィルムスキャナ301に対して、作成したメインス
キャン用LUTをロードし、メインスキャンを行うように
要求を発行する。フィルムスキャナ301は、ロードした
メインスキャン用LUTを使用し、透過原稿画像をメイン
スキャンする。
The user confirms the image displayed on the monitor 302 and requests the scanner driver 304 via the application 303 to scan the transparent original image again (main scan). Scanner driver 30 requested
4 issues a request to the film scanner 301 to load the created main scan LUT and perform the main scan. The film scanner 301 uses the loaded main scan LUT to perform a main scan on the transparent original image.

【0032】メインスキャンにより得られた高解像度の
画像は、スキャナドライバ304を介してアプリケーショ
ン303に渡される。
The high-resolution image obtained by the main scan is transferred to the application 303 via the scanner driver 304.

【0033】[画像処理機能]図4はスキャナドライバ3
04の画像処理機能を説明するためのフローチャートであ
る。
[Image processing function] FIG.
14 is a flowchart for describing an image processing function of 04.

【0034】プリスキャン画像の画素データに対して、
RGB信号および輝度信号Yについてヒストグラムを作成す
る(S401)。なお、輝度信号Yは上記の式(1)により求め
る。その際、スキャン画像の上下左右の四端には、外部
の要因によるノイズが含まれる場合があり、プリスキャ
ン画像全体からヒストグラムを作成すると、正確な画像
特性を得ることができない可能性がある。そこで、プリ
スキャン画像の中心部分、例えば縦横7/8×7/8の領域か
らヒストグラムを作成することで、正確な画像特性を得
る。
For the pixel data of the prescan image,
A histogram is created for the RGB signal and the luminance signal Y (S401). Note that the luminance signal Y is obtained by the above equation (1). At this time, noises due to external factors may be included at the four ends of the upper, lower, left, and right sides of the scan image. If a histogram is created from the entire prescan image, accurate image characteristics may not be obtained. Therefore, an accurate image characteristic is obtained by creating a histogram from a central portion of the pre-scan image, for example, a 7/8 × 7/8 area.

【0035】次に、ヒストグラムからホワイトおよびブ
ラックポイントを決定する(S402)。上述したように、RG
B信号および輝度信号Yのハイライトおよびシャドウポイ
ントからの度数の累積値がそれぞれ所定値になる信号レ
ベルを求め、この信号レベルをホワイトおよびブラック
ポイントに決定する。
Next, white and black points are determined from the histogram (S402). As mentioned above, RG
A signal level at which the cumulative value of the frequency from the highlight and shadow points of the B signal and the luminance signal Y becomes a predetermined value is determined, and this signal level is determined as a white and black point.

【0036】輝度信号Yのヒストグラムよりガンマ値γ
を決定し、ホワイトおよびブラックポイントを使ってガ
ンマテーブル(メインスキャン用LUT)を作成する(S40
3)。ここでガンマ値γを決定する方法、および、ガンマ
テーブルを作成する方法の詳細は後述する。
From the histogram of the luminance signal Y, the gamma value γ
Is determined and a gamma table (main scan LUT) is created using the white and black points (S40
3). Here, details of the method of determining the gamma value γ and the method of creating the gamma table will be described later.

【0037】モニタ表示用にプリスキャン画像に変換処
理を施し、メインスキャンで得られる画像をシミュレー
トする(S404)。メインスキャンLUTは、プリスキャンLUT
を基に作成されるが、このステップでは、プリスキャン
画像と同じビット情報の入出力がリニアなLUTを基に、
ガンマテーブルを作成し、作成したガンマテーブルによ
りプリスキャン画像に対してガンマ変換を施してシミュ
レーション画像とする。
The prescan image is subjected to conversion processing for monitor display to simulate an image obtained by the main scan (S404). Main scan LUT is pre-scan LUT
In this step, the input and output of the same bit information as the pre-scan image is based on a linear LUT,
A gamma table is created, and the pre-scan image is subjected to gamma conversion using the created gamma table to obtain a simulation image.

【0038】[ガンマテーブルの作成]次に、ステップ
S403におけるガンマテーブルの作成について詳しく説明
する。
[Preparation of gamma table]
The creation of the gamma table in S403 will be described in detail.

【0039】まず、ガンマ値γの決定方法について説明
する。ガンマ値γは、輝度信号Yの平均値と、ホワイト
およびブラックポイントを使って算出する。
First, a method for determining the gamma value γ will be described. The gamma value γ is calculated using the average value of the luminance signal Y and the white and black points.

【0040】以下では、輝度信号Yのレンジ(ホワイト
ポイントからブラックポイントの範囲)に対する輝度信
号Yの平均値の位置をYpとして説明する。輝度信号の平
均値、ホワイトおよびブラックポイントをそれぞれ
YAV、YHI、YLOとするとYpは式(5)で表される。 Yp = (YAV - YLO)/(YHI - YLO) …(5)
Hereinafter, the position of the average value of the luminance signal Y with respect to the range of the luminance signal Y (the range from the white point to the black point) will be described as Yp. The average value of the luminance signal and the white and black points respectively
Y AV, Y HI, When Y LO Yp is expressed by Equation (5). Yp = (Y AV -Y LO ) / (Y HI -Y LO )… (5)

【0041】また、ガンマ値γは基本的に次式によって
算出する。なお、式(2)は、式(6)のTargetが128/255≒
0.5の場合である。 γ = log(Yp)/log(Target) …(6)
The gamma value γ is basically calculated by the following equation. In Expression (2), the target of Expression (6) is 128/255 ≒
0.5. γ = log (Yp) / log (Target)… (6)

【0042】以下に具体的なガンマ値の算出方法を示
す。
A specific method of calculating the gamma value will be described below.

【0043】(1)0.35≦Yp≦0.65の場合:YpがTarget=
0.5になるようなガンマ値γを設定する。つまり、輝度
の平均値が128になるようなガンマ値γである。
(1) When 0.35 ≦ Yp ≦ 0.65: Yp is Target =
Set the gamma value γ to be 0.5. That is, the gamma value γ is such that the average value of the luminance is 128.

【0044】(2)Yp>0.65の場合:YpがTarget=0.5〜0.
65になるようなガンマ値γを設定する。つまり、輝度の
平均値が128〜169になるようなガンマ値γである。Targ
etの値はYpの値により段階的に変化する。
(2) When Yp> 0.65: Yp is Target = 0.5 to 0.
Set the gamma value γ to be 65. That is, the gamma value γ is such that the average value of the luminance is 128 to 169. Targ
The value of et changes stepwise according to the value of Yp.

【0045】(3)Yp<0.35の場合:YpがTarget=0.35〜
0.65になるようなガンマ値γを設定する。つまり、輝度
の平均値が89〜128になるようなガンマ値γである。Tar
getの値はYpの値により段階的に変化する。
(3) If Yp <0.35: Yp is Target = 0.35-
Set the gamma value γ to be 0.65. That is, the gamma value γ is such that the average value of the luminance is 89 to 128. Tar
The value of get changes stepwise according to the value of Yp.

【0046】(4)Yp>0.75の場合:上記2項では、Ypの
値が0.5から離れるほどガンマ値γが小さくなる。そこ
でYp=0.75を境界(頂点)として、それ以上の場合はガ
ンマ値γが1.0に近付くように設定する。
(4) In the case of Yp> 0.75: In the above item 2, the gamma value γ decreases as the value of Yp departs from 0.5. Therefore, the boundary (vertex) is set to Yp = 0.75, and the gamma value γ is set to approach 1.0 in the case of Yp = 0.75.

【0047】(5)Yp<0.25の場合:上記3項では、Ypの
値が0.5から離れるほどガンマ値γが大きくなる。そこ
でYp=0.25を境界(頂点)として、それ以下の場合はガ
ンマ値γが1.0に近付くように設定する。
(5) When Yp <0.25: In the above item 3, the gamma value γ increases as the value of Yp departs from 0.5. Therefore, the boundary (vertex) is set at Yp = 0.25, and if it is less than that, the gamma value γ is set so as to approach 1.0.

【0048】図5は横軸にYpを、縦軸にガンマ値γをプ
ロットした図である。なお、上記の説明および図5にお
いて、説明を容易にするために具体的な数値を使用した
が、これらの数値はデバイスに依存し変化するものであ
る。
FIG. 5 is a diagram in which Yp is plotted on the horizontal axis and gamma value γ is plotted on the vertical axis. In the above description and FIG. 5, specific numerical values are used for ease of description, but these numerical values depend on the device and change.

【0049】次に、ホワイトおよびブラックポイント
と、ガンマ値γとを使用するガンマテーブルの作成方法
を説明する。
Next, a method for creating a gamma table using white and black points and a gamma value γ will be described.

【0050】(6)その出力値がホワイトおよびブラッ
クポイントになるプリスキャン用LUTの入力値であるRGB
値(XRHI、XGHI、XBHI、XRLO、XGLOおよびXBLO)を求め
る。
(6) RGB which is the input value of the pre-scan LUT whose output value becomes the white and black points
Value (XR HI, XG HI, XB HI, XR LO, XG LO and XB LO) Request.

【0051】(7)ハイライトポイントからXRHI、XGHI
およびXBHIまでのプリスキャン用LUTの出力値を255に固
定し、シャドウポイントからXRLO、XGLOおよびXBLOまで
のプリスキャン用LUTの出力値を0に固定する。
(7) From the highlight point, XR HI and XG HI
And the output value of the pre-scanning LUT to XB HI fixed to 255, to fix the shadow point XR LO, the output value of the LUT for pre-scan until XG LO and XB LO 0.

【0052】(8)上記7項の処理によって、プリスキャ
ン用LUTの、入力値がXRLO〜XRHI、XGLO〜XGHIおよびXB
LO〜XBHIの出力値は、ブラックポイントからホワイトポ
イントの範囲に存在する。そして、この範囲に存在する
プリスキャンLUTの出力値を0〜255の範囲に伸長する。
(8) By the processing of the above item 7, the input values of the pre-scan LUT are XR LO to XR HI , XG LO to XG HI and XB
The output values of LO to XB HI are in the range from the black point to the white point. Then, the output value of the prescan LUT existing in this range is expanded to the range of 0 to 255.

【0053】(9)上記8項の処理が済んだプリスキャン
用LUTの全出力値を、式(3)および(4)の両方でガンマ変
換する。
(9) All output values of the pre-scanning LUT after the processing of the above item 8 are gamma-converted by both equations (3) and (4).

【0054】(10)上記9項で二組ずつ算出されるプリ
スキャン用LUTの出力値の何れかを、ガンマ値γに基づ
き選択してガンマテーブルを完成される。 γ≧1.0の場合は算出される小さな値を採用する γ<1.0の場合は算出される大きな値を採用する
(10) One of the output values of the pre-scanning LUT calculated for each two sets in the above item 9 is selected based on the gamma value γ to complete the gamma table. If γ ≧ 1.0, use the calculated small value If γ <1.0, use the calculated large value

【0055】図6(ア)はγ≧1.0の場合に作成されるガン
マテーブルの一例を示し、図6(イ)はγ<1.0の場合に作
成されるガンマテーブルの一例を示す図である。
FIG. 6A shows an example of a gamma table created when γ ≧ 1.0, and FIG. 6A shows an example of a gamma table created when γ <1.0.

【0056】上記の実施形態においては、ホワイトおよ
びブラックポイントを求める際に、既定の累積度数を定
め、その度数に一致(または超える)信号レベルをホワ
イトおよびブラックポイントにする例を説明した。しか
し、ホワイトおよびブラックポイントを決定するための
累積度数はヒストグラムの特性に応じて変動させてもよ
い。
In the above-described embodiment, an example has been described in which, when white and black points are obtained, a predetermined cumulative frequency is determined, and signal levels that match (or exceed) the frequency are set as white and black points. However, the cumulative frequency for determining the white and black points may be varied according to the characteristics of the histogram.

【0057】例えば、ヒストグラムのレンジ(ホワイト
ポイントからブラックポイントの範囲)が狭く、かつ、
輝度の平均値がある値より高い(明るい画像)場合や、
ある値より低い(暗い画像)場合は、狭いレンジのデー
タを伸長してガンマ変換するので、ハイライトおよびシ
ャドウ部のノイズを拡大することになる。そこで、前記
の特性をもつ画像の場合、ホワイトおよびブラックポイ
ントを決定するための累積度数を通常より大きくしてノ
イズ成分をカットすれば、画像の階調などを良好に再現
することができる。
For example, the range of the histogram (the range from the white point to the black point) is narrow and
If the average brightness is higher than a certain value (bright image)
If the value is lower than a certain value (dark image), data in a narrow range is expanded and gamma converted, so that noise in highlights and shadows is expanded. Therefore, in the case of an image having the above characteristics, if the noise component is cut by increasing the cumulative frequency for determining the white and black points, the tone of the image can be reproduced well.

【0058】また、上記の実施形態においては、ホワイ
トおよびブラックポイントをRGB各信号ごとに決定し、
ガンマ値γは輝度信号Yにより決定する例を説明した
が、例えば、輝度信号Yによってホワイトおよびブラッ
クポイントを決定し、RGB各信号ごとにガンマ値γを決
定しても構わない。
In the above embodiment, the white and black points are determined for each of the RGB signals.
The example in which the gamma value γ is determined by the luminance signal Y has been described. For example, the white and black points may be determined by the luminance signal Y, and the gamma value γ may be determined for each of the RGB signals.

【0059】また、上記の実施形態においては、ポジフ
ィルムのような透過原稿を読み取るフィルムスキャナに
本発明を適用する例を説明した。しかし、本発明の適用
は、ポジフィルムおよびフィルムスキャナに限らない。
つまり、原稿画像をプリスキャンして階調の自動補正を
行う装置であれば、ネガフィルムや非透過性の原稿を読
み取る装置にも本発明を適用可能である。
In the above-described embodiment, an example has been described in which the present invention is applied to a film scanner that reads a transparent original such as a positive film. However, the application of the present invention is not limited to positive films and film scanners.
In other words, the present invention can be applied to a device for reading a negative film or a non-transparent document as long as the device performs pre-scan of a document image and performs automatic gradation correction.

【0060】このように、本実施形態によれば、原稿画
像ごとにその画像特性を解析して、ガンマ値γを決定
し、階調性が豊かな画像が得られるガンマテーブルを作
成することができる。従って、原稿画像の階調を良好に
再現することができる。
As described above, according to the present embodiment, it is possible to determine the gamma value γ by analyzing the image characteristics of each document image and create a gamma table from which an image with rich gradation can be obtained. it can. Therefore, the gradation of the original image can be reproduced well.

【0061】[0061]

【他の実施形態】なお、本発明は、複数の機器(例えば
ホストコンピュータ、インタフェイス機器、リーダ、プ
リンタなど)から構成されるシステムに適用しても、一
つの機器からなる装置(例えば、複写機、ファクシミリ
装置など)に適用してもよい。
[Other Embodiments] Even if the present invention is applied to a system including a plurality of devices (for example, a host computer, an interface device, a reader, a printer, etc.), an apparatus (for example, a copying machine) Machine, facsimile machine, etc.).

【0062】また、本発明の目的は、前述した実施形態
の機能を実現するソフトウェアのプログラムコードを記
録した記憶媒体(または記録媒体)を、システムあるい
は装置に供給し、そのシステムあるいは装置のコンピュ
ータ(またはCPUやMPU)が記憶媒体に格納されたプログ
ラムコードを読み出し実行することによっても、達成さ
れることは言うまでもない。この場合、記憶媒体から読
み出されたプログラムコード自体が前述した実施形態の
機能を実現することになり、そのプログラムコードを記
憶した記憶媒体は本発明を構成することになる。また、
コンピュータが読み出したプログラムコードを実行する
ことにより、前述した実施形態の機能が実現されるだけ
でなく、そのプログラムコードの指示に基づき、コンピ
ュータ上で稼働しているオペレーティングシステム(OS)
などが実際の処理の一部または全部を行い、その処理に
よって前述した実施形態の機能が実現される場合も含ま
れることは言うまでもない。
Further, an object of the present invention is to supply a storage medium (or a recording medium) in which a program code of software for realizing the functions of the above-described embodiments is recorded to a system or an apparatus, and a computer (a computer) of the system or the apparatus. Alternatively, it is needless to say that the present invention can also be achieved by a CPU or an MPU) reading and executing the program code stored in the storage medium. In this case, the program code itself read from the storage medium implements the functions of the above-described embodiment, and the storage medium storing the program code constitutes the present invention. Also,
When the computer executes the readout program code, not only the functions of the above-described embodiments are realized, but also the operating system (OS) running on the computer based on the instructions of the program code.
It goes without saying that a case where the functions of the above-described embodiments are implemented by performing some or all of the actual processing, and the processing performs the functions of the above-described embodiments.

【0063】さらに、記憶媒体から読み出されたプログ
ラムコードが、コンピュータに挿入された機能拡張カー
ドやコンピュータに接続された機能拡張ユニットに備わ
るメモリに書込まれた後、そのプログラムコードの指示
に基づき、その機能拡張カードや機能拡張ユニットに備
わるCPUなどが実際の処理の一部または全部を行い、そ
の処理によって前述した実施形態の機能が実現される場
合も含まれることは言うまでもない。
Further, after the program code read from the storage medium is written into the memory provided in the function expansion card inserted into the computer or the function expansion unit connected to the computer, the program code is read based on the instruction of the program code. Needless to say, the CPU included in the function expansion card or the function expansion unit performs part or all of the actual processing, and the processing realizes the functions of the above-described embodiments.

【0064】本発明を上記記憶媒体に適用する場合、そ
の記憶媒体には、先に説明したフローチャートに対応す
るプログラムコードが格納されることになる。
When the present invention is applied to the storage medium, the storage medium stores program codes corresponding to the flowcharts described above.

【0065】[0065]

【発明の効果】以上説明したように、本発明によれば、
良好な階調性が得られるガンマ補正テーブルを作成する
ことができる。
As described above, according to the present invention,
It is possible to create a gamma correction table from which good gradation can be obtained.

【図面の簡単な説明】[Brief description of the drawings]

【図1】フィルムスキャナにおける調の自動補正処理を
示すフローチャート、
FIG. 1 is a flowchart showing an automatic key correction process in a film scanner.

【図2】ガンマテーブルの一例を示す図、FIG. 2 is a diagram showing an example of a gamma table;

【図3】実施形態の画像処理装置の構成例を示すブロッ
ク図、
FIG. 3 is a block diagram illustrating a configuration example of an image processing apparatus according to the embodiment;

【図4】スキャナドライバの画像処理機能を説明するた
めのフローチャート、
FIG. 4 is a flowchart for explaining an image processing function of the scanner driver;

【図5】ガンマ値の決定方法を説明する図、FIG. 5 is a diagram for explaining a method of determining a gamma value;

【図6】作成されるガンマテーブルの一例を示す図であ
る。
FIG. 6 is a diagram illustrating an example of a created gamma table.

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5B057 BA11 CA01 CA08 CA12 CB01 CB08 CB12 CE11 DB02 DB06 DB09 DC23 DC36 5B069 AA01 BB07 HA11 5C077 LL09 LL19 MP08 NN02 NN03 PP09 PP44 PP45 PP46 PQ19 PQ23 RR06 5C079 HB01 LA12 LA31 MA05 MA11 NA05 PA08  ──────────────────────────────────────────────────続 き Continued on the front page F term (reference) 5B057 BA11 CA01 CA08 CA12 CB01 CB08 CB12 CE11 DB02 DB06 DB09 DC23 DC36 5B069 AA01 BB07 HA11 5C077 LL09 LL19 MP08 NN02 NN03 PP09 PP44 PP45 PP46 PQ19 PQ23 RR06 MA12 LA PA08

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 画像データからヒストグラムを作成する
作成手段と、 前記ヒストグラムからホワイトおよびブラックポイン
ト、並びに、画像データの平均値を取得する取得手段
と、 取得されるホワイトおよびブラックポイントと、前記画
像データの平均値との位置関係に応じた算出方法を選択
的に使用してガンマ値を算出する算出手段と、 算出されるガンマ値、並びに、前記ホワイトおよびブラ
ックポイントに基づき、ガンマ補正テーブルを作成する
作成手段を有することを特徴とする画像処理装置。
A generating means for generating a histogram from image data; an obtaining means for obtaining a white and a black point from the histogram and an average value of the image data; a white and a black point to be obtained; Calculating means for calculating a gamma value by selectively using a calculation method according to the positional relationship with the average value of the image data; and generating a gamma correction table based on the calculated gamma value and the white and black points. An image processing apparatus comprising a creating unit.
【請求項2】 前記算出手段によるガンマ値の算出は、
前記ホワイトおよびブラックポイントの範囲の中心か
ら、前記画像データの平均値が外れるほどガンマ値を大
きくまたは小さくし、さらに外れると小さくまたは大き
くすることを特徴とする請求項1に記載された画像処理
装置。
2. The calculation of a gamma value by the calculation means,
2. The image processing apparatus according to claim 1, wherein the gamma value increases or decreases as the average value of the image data deviates from the center of the range of the white and black points, and decreases or increases as the average value further deviates. .
【請求項3】 前記作成手段は、前記ガンマ値に応じた
作成方法を選択的に使用して、前記ガンマ補正テーブル
を作成することを特徴とする請求項1または請求項2に記
載された画像処理装置。
3. The image according to claim 1, wherein the creation unit creates the gamma correction table by selectively using a creation method according to the gamma value. Processing equipment.
【請求項4】 前記作成手段は、所定のガンマ補正テー
ブルを前記ホワイトおよびブラックポイントでクリップ
し、クリップ後のテーブルの全出力値に対して下記の二
式により変換を行い、前記ガンマ値γがγ≧1の場合は
前記変換により得られる小さい値を、γ<1の場合は前
記変換により得られる大きい値を選択し、選択した値に
より前記ガンマ補正テーブルを作成することを特徴とす
る請求項3に記載の画像処理装置。 Y1 = (2k - 1){y/(2k - 1)}1/γ Y2 = (2k - 1)[1 - {1 - y/(2k - 1)}γ] ここで、yはテーブルの入力値、 Yはテーブルの出力値、 kは画像データの量子化ビット数
4. The creation means clips a predetermined gamma correction table at the white and black points, and converts all output values of the clipped table according to the following two formulas, so that the gamma value γ is The method according to claim 1, wherein a small value obtained by the conversion is selected when γ ≧ 1, and a large value obtained by the conversion is selected when γ <1, and the gamma correction table is created based on the selected value. 4. The image processing device according to 3. Y1 = (2k-1) {y / (2k-1)} 1 / γ Y2 = (2k-1) [1-{1-y / (2k-1)} γ ] where y is a table input Value, Y is the output value of the table, k is the number of quantization bits of the image data
【請求項5】 前記取得手段は、前記ヒストグラムが示
す画像特性に応じて、前記ホワイトおよびブラックポイ
ントを取得するための条件を変動させることを特徴とす
る請求項1から請求項4の何れかに記載された画像処理装
置。
5. The image processing apparatus according to claim 1, wherein the obtaining unit changes a condition for obtaining the white and black points according to an image characteristic indicated by the histogram. The described image processing device.
【請求項6】 画像データからヒストグラムを作成し、 前記ヒストグラムからホワイトおよびブラックポイン
ト、並びに、画像データの平均値を取得し、 取得されるホワイトおよびブラックポイントと、前記画
像データの平均値との位置関係に応じた算出方法を選択
的に使用してガンマ値を算出し、 算出されるガンマ値、並びに、前記ホワイトおよびブラ
ックポイントに基づき、ガンマ補正テーブルを作成する
ことを特徴とする画像処理方法。
6. A histogram is created from the image data, a white and black point and an average value of the image data are obtained from the histogram, and the positions of the obtained white and black points and the average value of the image data are obtained. An image processing method, wherein a gamma value is calculated by selectively using a calculation method according to a relationship, and a gamma correction table is created based on the calculated gamma value and the white and black points.
【請求項7】 前記ガンマ値の算出は、前記ホワイトお
よびブラックポイントの範囲の中心から、前記画像デー
タの平均値が外れるほどガンマ値を大きくまたは小さく
し、さらに外れると小さくまたは大きくすることを特徴
とする請求項6に記載された画像処理方法。
7. The calculation of the gamma value, wherein the gamma value is increased or decreased as the average value of the image data deviates from the center of the range of the white and black points, and decreased or increased as the average deviates. 7. The image processing method according to claim 6, wherein:
【請求項8】 前記ガンマ補正テーブルは、前記ガンマ
値に応じた作成方法を選択的に使用して作成されること
を特徴とする請求項6または請求項7に記載された画像処
理方法。
8. The image processing method according to claim 6, wherein the gamma correction table is created by selectively using a creation method according to the gamma value.
【請求項9】 画像処理装置を制御して、請求項6に記
載された画像処理を実行することを特徴とするプログラ
ム。
9. A program for controlling an image processing device to execute the image processing according to claim 6. Description:
【請求項10】 請求項7に記載されたプログラムが記
録されたことを特徴とする記録媒体。
10. A recording medium on which the program according to claim 7 is recorded.
JP2001040784A 2001-02-16 2001-02-16 Device and method for processing image Withdrawn JP2002247398A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001040784A JP2002247398A (en) 2001-02-16 2001-02-16 Device and method for processing image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001040784A JP2002247398A (en) 2001-02-16 2001-02-16 Device and method for processing image

Publications (1)

Publication Number Publication Date
JP2002247398A true JP2002247398A (en) 2002-08-30

Family

ID=18903324

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001040784A Withdrawn JP2002247398A (en) 2001-02-16 2001-02-16 Device and method for processing image

Country Status (1)

Country Link
JP (1) JP2002247398A (en)

Similar Documents

Publication Publication Date Title
US6975437B2 (en) Method, apparatus and recording medium for color correction
US7081918B2 (en) Image processing method, image processing apparatus and recording medium storing program therefor
US7333136B2 (en) Image processing apparatus for carrying out tone conversion processing and color correction processing using a three-dimensional look-up table
US20040212688A1 (en) Image-capturing apparatus, image processing apparatus and image recording apparatus
JP2004282416A (en) Method and apparatus for processing image
JP2008527852A (en) White balance correction of digital camera images
US20050207642A1 (en) Image processing method and apparatus, program, and storage medium
US7324702B2 (en) Image processing method, image processing apparatus, image recording apparatus, program, and recording medium
JPH1013682A (en) Image processing method
JP2004007425A (en) Image reading system and image reading program
JP3588418B2 (en) Image correction method, image correction device, and recording medium
JP2002033934A (en) Apparatus and method for image processing
JP2004336521A (en) Image processing method, image processor, and image recording apparatus
JPH1075374A (en) Image processing unit and its method
JPH0750761A (en) Color reproducing mthod for image processing system constituted of independent type input/output machine
JPH06103927B2 (en) Tone curve setting method
JP4599216B2 (en) Image processing apparatus, image processing method, program thereof, and recording medium
JP2002247398A (en) Device and method for processing image
JPH09270925A (en) Picture processor and picture processing method
JPH1013623A (en) Image input method
JP2000209437A (en) Image correction method and storage medium storing image correction program
JP2002101312A (en) Image processing system, image processing method and recording medium with program recorded therein to allow computer to execute the image processing method
JP2003051944A (en) Image processing method, image processing system, program and storage medium
JP2002051225A (en) Device and method for processing image
JPH0738757A (en) Image processor for correcting density by areas

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20080513