JP2000209437A - Image correction method and storage medium storing image correction program - Google Patents

Image correction method and storage medium storing image correction program

Info

Publication number
JP2000209437A
JP2000209437A JP11004056A JP405699A JP2000209437A JP 2000209437 A JP2000209437 A JP 2000209437A JP 11004056 A JP11004056 A JP 11004056A JP 405699 A JP405699 A JP 405699A JP 2000209437 A JP2000209437 A JP 2000209437A
Authority
JP
Japan
Prior art keywords
image
luminance
luminance value
correction
original image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP11004056A
Other languages
Japanese (ja)
Inventor
Yasushi Kodama
裕史 児玉
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.)
Sharp Corp
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP11004056A priority Critical patent/JP2000209437A/en
Publication of JP2000209437A publication Critical patent/JP2000209437A/en
Pending legal-status Critical Current

Links

Landscapes

  • Picture Signal Circuits (AREA)
  • Processing Of Color Television Signals (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

PROBLEM TO BE SOLVED: To automatically acquire a correction coefficient optimum to an original image by obtaining a mean luminance of a part especially desirably emphasized in the original image as an evaluated luminance, multiplying the evaluated luminance with a value of a monotonously decreasing function whose variable is the evaluated luminance so as to calculate a mean luminance after correction as an expected luminance, calculating a coefficient given by a curve on the basis of the evaluated luminance and the expected luminance thereby correcting all pixels of the original image. SOLUTION: An image display monitor that is an image output device 9 displays an original image and an image after gamma correction. A floppy disk driver 11 reads a medium on which an image correction program is recorded and a CPU 1 loads the program to a RAM 3 via an interface 10. The original image is read and expanded on a memory as a bit map, the entire image is divided into small areas and a mean luminance of a center area is obtained. Furthermore, the mean luminance of the surrounding areas and the mean luminance of the entire screen are found, the means luminance of the center area is compared with the mean luminance of the surrounding area, and it is decided that an object in the middle of the screen is in a back light state when the center part is darker than the surrounding part.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、デジタルスチル
カメラ、イメージスキャナ、またはビデオキャプチャ回
路等で取得したカラー/白黒静止画像のγ補正方法に関
わり、更に詳しくは、原画像の平均輝度により、適切な
γ補正係数を求めてγ補正を行う方法に関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a gamma correction method for a color / monochrome still image obtained by a digital still camera, an image scanner, a video capture circuit, or the like. The present invention relates to a method of performing γ correction by obtaining a suitable γ correction coefficient.

【0002】[0002]

【従来の技術】カラー/白黒を問わず、映像信号を静止
デジタル画像に変換するために、CCDやC-MOS エリアセ
ンサー等の固体撮像素子を備えたデジタルスチルカメラ
やイメージスキャナにより静止画像を取り込み、または
ビデオカメラ等による撮像中のアナログ映像信号をリア
ルタイムにデジタルデータに変換するビデオキャプチャ
ボードにより静止画像を取り込んで、画像処理を行う手
法が普及している。
2. Description of the Related Art In order to convert a video signal into a still digital image irrespective of color / black and white, a still image is captured by a digital still camera or image scanner equipped with a solid-state imaging device such as a CCD or C-MOS area sensor. 2. Description of the Related Art A technique of capturing a still image by a video capture board that converts an analog video signal being captured by a video camera or the like into digital data in real time and performing image processing has become widespread.

【0003】これらのデジタル化された静止画像は、CR
T や液晶ディスプレイ等の表示デバイスに表示したり、
デジタルデータとしての画像ファイルのまま何らかの伝
送手段により伝送される。
[0003] These digitized still images are CR
Display on a display device such as T or liquid crystal display,
The image file as digital data is transmitted by any transmission means.

【0004】また、近年では、インターネットの普及に
より、HTML文書に代表されるマルチメディアテキストに
貼り込む画像データとして利用される機会も多い。
[0004] In recent years, with the spread of the Internet, there are many opportunities to be used as image data to be pasted into multimedia text represented by an HTML document.

【0005】一方、静止画像を取り込むデバイスも、10
0万画素以上のCCD を有したデジタルスチルカメラの低
価格化により、より高画質な静止画像が容易に入手可能
になっている。
On the other hand, devices that capture still images are also
With the price reduction of digital still cameras having CCDs of more than 100,000 pixels, higher quality still images can be easily obtained.

【0006】このように、静止画像の取り込み手段、静
止画像の表示手段および応用手段の高品質化および多用
化に伴い、画像の取り込みデバイスにより取り込まれた
静止画像の画質をますます向上させる要求が高まってい
る。
[0006] As the quality and versatility of the means for capturing still images, the means for displaying still images, and the means of application have been increased, there has been a demand for further improving the image quality of still images captured by image capturing devices. Is growing.

【0007】特に画像の階調特性は画像の明るさ、色の
鮮やかさ、コントラスト等、画質を左右するうえで重要
であり、この階調の補正に有効な方法として、従来より
γ補正処理が知られている。
In particular, the gradation characteristics of an image are important in determining the image quality, such as the brightness, vividness, and contrast of the image. As an effective method for correcting the gradation, γ correction processing has been conventionally used. Are known.

【0008】元来、γ補正は、CRT ディスプレイのブラ
ウン管の輝度特性を補正することを目的として用いられ
る手法であり、このγ補正による入出力特性であるγ曲
線は、入力が小さいときの増幅率を高くし、入力が大き
くなるにしたがい増幅率を1に近づける特性を持たせる
場合が多い。この結果、原画像のダイナミックレンジを
損なうことなく階調補正を行うことが可能であり、出力
デバイスや、画像の利用方法にかかわらず、適正な階調
特性を持たせるうえで有効な手法である。
Originally, γ correction is a method used for the purpose of correcting the luminance characteristics of a cathode ray tube of a CRT display, and the γ curve, which is the input / output characteristic by the γ correction, shows the amplification factor when the input is small. In many cases, the characteristic is increased so that the amplification factor approaches 1 as the input increases. As a result, it is possible to perform tone correction without impairing the dynamic range of the original image, and this is an effective method for providing appropriate tone characteristics regardless of the output device and the method of using the image. .

【0009】このようなγ補正を用いた階調補正方法と
して、例えば、特開平5-76036 号では、γ曲線の階調変
換特性を設定手段から与え、テーブル参照により16種類
のγ曲線から一本のγ曲線を選択し、輝度信号に対して
γ補正を行った後、輝度信号のγ補正前と補正後の比か
ら色信号の階調変換を行う方法が提案されている。
As a gradation correction method using such γ correction, for example, in Japanese Patent Laid-Open No. Hei 5-76036, a gradation conversion characteristic of a γ curve is given from a setting means, and one of 16 types of γ curves is obtained by referring to a table. A method has been proposed in which a γ curve is selected, γ correction is performed on a luminance signal, and then gradation conversion of a color signal is performed based on a ratio of the luminance signal before and after γ correction.

【0010】[0010]

【発明が解決しようとする課題】ところが、このような
従来の階調補正方法では、γ曲線の形状を原画像の画質
特性によらない別の手段で指定する必要があり、原画像
に適した階調補正曲線を選択するために、装置を操作す
る人間の判断、および適切な補正曲線を得るまでの試行
を繰り返す必要があった。
However, in such a conventional tone correction method, it is necessary to specify the shape of the γ curve by another means independent of the image quality characteristics of the original image. In order to select the gradation correction curve, it was necessary to repeat the judgment of the person operating the apparatus and the trial until obtaining an appropriate correction curve.

【0011】また、従来技術によるγ曲線のγ補正係数
はあらかじめ用意された数種類の固定値から選択する必
要があり、原画像に最適な任意のγ曲線を得ることがで
きないという問題があった。
Further, the γ correction coefficient of the γ curve according to the prior art needs to be selected from several kinds of fixed values prepared in advance, and there is a problem that an arbitrary γ curve optimal for the original image cannot be obtained.

【0012】この発明の目的は、上述の問題を解消し
て、原画像に最適なγ補正のためのγ係数を自動的に得
るようにした画像補正方法および画像補正プログラムを
記録したプログラム記録媒体を提供することにある。
An object of the present invention is to solve the above-mentioned problems and to automatically obtain a γ coefficient for γ correction optimal for an original image, and a program recording medium storing an image correction program. Is to provide.

【0013】[0013]

【課題を解決するための手段】この発明は、原画像の中
から特に重視したい部分の平均輝度( 以下、「評価輝度
値」という。) を求め、また、前記評価輝度値を変数と
して単調減少関数の計算結果と前記評価輝度値とを乗算
し、γ補正後の平均輝度を期待輝度値として計算する。
そして評価輝度値と期待輝度値からγ曲線のγ係数を算
出し、計算されたγ係数を用いてγ補正を行う。たとえ
ば、原画像の画素値が採り得る値の範囲(以下「値域」
という。)の中のすべての値についてγ補正後の値を求
め、γ補正テーブルを作り、上記γ補正テーブルを参照
し、原画像の全画素の画素値のγ補正を行う。
According to the present invention, an average luminance (hereinafter, referred to as an "evaluation luminance value") of a portion to be particularly emphasized in an original image is obtained, and the average luminance is monotonously reduced using the evaluation luminance value as a variable. The calculation result of the function is multiplied by the evaluation luminance value, and the average luminance after the γ correction is calculated as the expected luminance value.
Then, the γ coefficient of the γ curve is calculated from the evaluation luminance value and the expected luminance value, and γ correction is performed using the calculated γ coefficient. For example, a range of values that can be taken by pixel values of an original image (hereinafter, “value range”)
That. The values after γ correction are obtained for all the values in the parentheses, a γ correction table is created, and the γ correction of the pixel values of all the pixels of the original image is performed with reference to the γ correction table.

【0014】前記注目エリアは、たとえば、人物を中央
に写した画像の場合は、一般に中央の人物の階調が好み
の階調に補正されることが望ましいため、画面の中央部
を注目エリアとして、そのエリアの平均輝度を評価輝度
値とする、一方、風景を写した画像では、一般に画面全
体が重要であり、画面全体を注目エリアとして、画面全
体の平均輝度を評価輝度値とする。
For example, in the case of an image in which a person is photographed in the center, it is generally desirable that the gradation of the person in the center is corrected to a desired gradation. The average luminance of the area is used as the evaluation luminance value. On the other hand, in an image of a landscape, the entire screen is generally important, and the average luminance of the entire screen is used as the evaluation luminance value with the entire screen as the attention area.

【0015】上記構成によれば、γ補正係数は、原画像
の重視したい部分の平均輝度から算出されるため、原画
像がもともと有している階調特性を大きく変化させるこ
となく、また、原画像個々に適切なγ補正係数を自動的
に算出することが可能である。さらに、上記単調減少関
数の関数式、および、その関数式のパラメータを変更す
ることにより、原画像の平均輝度がどのような値のとき
に、γ補正による増幅率を最も上げるか、言い換えれ
ば、原画像の注目エリアの平均輝度が比較的低い場合に
γ補正により積極的に明るくするのか、あるいは、原画
像の平均輝度が比較的明るい場合に、さらに明るめに補
正するのかといったチューニングも可能となる。
According to the above configuration, since the γ correction coefficient is calculated from the average luminance of the portion of the original image to be emphasized, the gradation characteristic originally possessed by the original image is not largely changed, and It is possible to automatically calculate an appropriate γ correction coefficient for each image. Further, by changing the function formula of the monotonically decreasing function, and the parameters of the function formula, what value the average luminance of the original image has, the highest amplification factor by γ correction, in other words, It is also possible to tune whether to actively increase the brightness by gamma correction when the average luminance of the attention area of the original image is relatively low, or to further increase the brightness when the average luminance of the original image is relatively bright. .

【0016】[0016]

【発明の実施の形態】図9は、この発明に係る画像補正
方法を適用する画像補正装置の構成を示すブロック図で
ある。図9において、CPU1はROM2に予め書き込
んだプログラムおよびハードディスクドライブ装置7か
らRAM3へ読み出したプログラムを実行して、後述す
る原画像に対するγ補正処理を行う。RAM2はその処
理に際して画像データの一時格納用のバッファおよびワ
ーキングエリアとしても用いる。画像入力機器5は例え
ばデジタルスチルカメラ、ビデオキャプチャボード、イ
メージスキャナ等であり、CPU1はインタフェース4
を介してその画像データを読み取り、ハードディスク内
に所定のファイル名を付けて原画像ファイルとして格納
する。ハードディスクドライブ装置7は上記プログラム
および原画像ファイル以外に、γ補正後の画像ファイル
を格納するために用い、CPU1はインタフェース6を
介してファイルの書込/読み出しを行う。画像出力機器
9は例えば画像表示装置(モニタ)であり、原画像およ
びγ補正後の画像を表示する。フロッピィディスクドラ
イブ装置11は画像補正プログラムを記録した媒体(フ
ロッピィディスク)を読み取るものであり、CPU1は
インタフェース10を介してRAM3にロードする。
FIG. 9 is a block diagram showing the configuration of an image correction apparatus to which the image correction method according to the present invention is applied. In FIG. 9, the CPU 1 executes a program previously written in the ROM 2 and a program read from the hard disk drive device 7 to the RAM 3 to perform a gamma correction process on an original image described later. The RAM 2 is also used as a buffer for temporarily storing image data and a working area during the processing. The image input device 5 is, for example, a digital still camera, a video capture board, an image scanner, or the like.
The image data is read through the hard disk, and given a predetermined file name in the hard disk and stored as an original image file. The hard disk drive device 7 is used to store image files after gamma correction in addition to the above-mentioned programs and original image files, and the CPU 1 writes / reads files via the interface 6. The image output device 9 is, for example, an image display device (monitor), and displays an original image and an image after γ correction. The floppy disk drive 11 reads a medium (floppy disk) on which an image correction program is recorded, and the CPU 1 loads the RAM 3 via the interface 10.

【0017】尚、上記画像入力機器は必須ではなく、例
えば図外の通信手段を用いて画像ファイルを受信し、ハ
ードディスクに格納してもよい。また、上記画像出力機
器も必須ではなく、例えばγ補正後の画像ファイルを生
成すること自体を目的とし、その画像ファイルを図外の
通信手段で送信してもよい。
Note that the image input device is not indispensable. For example, an image file may be received using a communication unit (not shown) and stored in the hard disk. Further, the image output device is not indispensable. For example, the purpose is to generate an image file after γ correction, and the image file may be transmitted by a communication unit (not shown).

【0018】図1は上記画像補正装置のCPUが実行す
る処理プログラムの手順を示すフローチャートである。
まず、ステップs1で原画像ファイルを読み込む。この
原画像ファイルは、デジタルスチルカメラ、ビデオキャ
プチャボード、イメージスキャナ等によりデジタル画像
として取り込まれた画像ファイルであり、画像形式は、
たとえばデジタルスチルカメラによる静止画像の場合、
WindowsBMPやJPEG形式等である。また、インターネット
ではJPEGの他、GIF 形式もよく使用される。また、最近
ではGIFに変わるネットワーク用の画像形式としてPNG
等も注目されている。このような各種形式の画像ファイ
ルを該当の形式を指定して読み込む。
FIG. 1 is a flowchart showing the procedure of a processing program executed by the CPU of the image correction apparatus.
First, an original image file is read in step s1. This original image file is an image file captured as a digital image by a digital still camera, a video capture board, an image scanner, or the like.
For example, in the case of a still image from a digital still camera,
Windows BMP and JPEG formats. On the Internet, GIF format is often used in addition to JPEG. In recent years, PNG has been used as a network image format instead of GIF.
Are also attracting attention. The image file of such various formats is read by designating the corresponding format.

【0019】次に、ステップs2で、メモリ上にビット
マップとして展開し、そのビットマップの縦サイズ、横
サイズを各々5分割し、画面全体を25の小エリアに分割
する。このように複数の小エリアに区分し、各小エリア
の輝度、RGB の平均値、IQ値または、B-Y 、R-Y 等の色
差信号等の画像属性を計算することにより、どのような
被写体を撮影した画像であるか、また、それに応じてど
のような手法で画像補正を施したらよいかを予測する。
Next, in step s2, a bit map is developed on the memory, and the vertical size and the horizontal size of the bit map are divided into five, respectively, and the entire screen is divided into 25 small areas. By dividing the image into a plurality of small areas in this way and calculating image attributes such as luminance, RGB average value, IQ value, and color difference signals such as BY and RY for each small area, It predicts whether the image is an image and how to perform image correction according to the image.

【0020】図6は上記画面分割の例を示している。
「中央9エリア」とは、図中のエリア番号6,7,8,11,12,
13,16,17,18 で構成された矩形エリアのことであり、ま
た、「周囲16エリア」とは、画面全体から前記中央エリ
アの部分を除いた周辺エリアのことである。
FIG. 6 shows an example of the screen division.
The “central 9 areas” are area numbers 6, 7, 8, 11, 12,
13, 16, 17, and 18, and the “peripheral 16 areas” are peripheral areas excluding the central area from the entire screen.

【0021】ステップs3では、前記中央9エリアの平
均輝度Ycを求めている。中央9エリアの平均輝度Ycは、
各画素の輝度をRGB 成分より人間の視感度特性に合わ
せ、〔数1〕にて求め、それを中央9エリアの全画素に
ついて積算し、中央9エリアの全画素数で除算すること
により求める。
In step s3, the average luminance Yc of the nine central areas is obtained. The average luminance Yc of the central 9 areas is
The luminance of each pixel is determined from the RGB components in accordance with the human visual sensitivity characteristics, and is obtained by [Equation 1], which is integrated for all the pixels in the central 9 areas, and divided by the total number of pixels in the central 9 areas.

【0022】 Y= 0.3R+0.59G+0.11B …〔数1〕 同様にしてステップs4では周囲16エリアの平均輝度Ya
を求め、ステップs5では画面全体の平均輝度Yfを求め
る。
Y = 0.3R + 0.59G + 0.11B (Equation 1) Similarly, in step s4, the average luminance Ya of the surrounding 16 areas
In step s5, the average luminance Yf of the entire screen is determined.

【0023】そしてステップs6で、上記YcとYaを比較
し、YcがYaよりも小さければ、すなわち中央部が周辺部
より暗ければ、中央にある被写体が逆光であるものと判
断して、中央部の階調を優先的に補正するために、ステ
ップs7でYcを原画像の評価輝度値とする。逆に、Ycが
Yaより大きいか等しい場合には、風景や人物の集合写真
といった画面全体を重視すべき画像であるものと判断
し、ステップs8においてYfを原画像の評価輝度値とす
る。
In step s6, the above Yc and Ya are compared. If Yc is smaller than Ya, that is, if the central portion is darker than the peripheral portion, it is determined that the subject at the center is backlit, and In order to preferentially correct the gradation of the part, Yc is set as the evaluation luminance value of the original image in step s7. Conversely, Yc
If it is greater than or equal to Ya, it is determined that the image should be given importance to the entire screen such as a landscape or a group photo of people, and Yf is set as the evaluation luminance value of the original image in step s8.

【0024】この発明の階調補正の基本としているγ曲
線は、入力信号をx、出力信号をyとし、γ補正係数
(以下単に「γ係数」という。)をγとしたとき、〔数
2〕の式で与えられる。
The gamma curve which is the basis of the tone correction according to the present invention is represented by the following equation (2) when the input signal is x, the output signal is y, and the gamma correction coefficient (hereinafter simply referred to as "gamma coefficient") is gamma. ].

【0025】 y=x^γ (0≦x≦1) …〔数2〕 γが1より小さいとき、yはxよりも大きくなり、逆に
γが1より大きいときは、yはxより小さくなる特徴が
ある。図8はこのγの値をγ<1の範囲で数種類変化さ
せた場合のγ曲線の例を示している。この図からも明ら
かなように、γが小さいほど、中間調の増幅率が上がる
ことがわかる。また、値域の最大・最小では増幅率が1
となるため、γが変わっても原画像のダイナミックレン
ジそのものは変化しないことがわかる。
Y = x ^ γ (0 ≦ x ≦ 1) [Formula 2] When γ is smaller than 1, y is larger than x, and when γ is larger than 1, y is smaller than x. There are features. FIG. 8 shows an example of a γ curve when the value of γ is changed by several types in the range of γ <1. As is clear from this figure, it can be seen that the smaller the γ, the higher the halftone amplification factor. In addition, the amplification factor is 1 at the maximum / minimum value range.
Thus, it can be understood that the dynamic range itself of the original image does not change even if γ changes.

【0026】ここで、原画像の評価輝度値から、γ係数
を導出する手法について説明する。原画像の評価輝度値
Yが求まったとき、YがYの値域に対して小さいとき、
たとえば原画像のRGB が各8bitで0 〜255 の値を取り得
る場合は、Yの値も同様に0〜255 の値を取り得る。こ
のときYの値が20あるいは30といった小さな値のとき
は、小さめのγ係数を適用して輝度を高めたい(輝度増
幅率を高めたい)。一方、評価輝度値Yが値域に対して
大きいとき、たとえば0 〜255 の値域内の中央値以上の
値である場合、輝度増幅率を上げると、γ補正後の画像
は輝度値が高い値に偏ったものとなり、原画像の品位を
損なうおそれがあるため、γ係数値を大きくするか、あ
るいは、γ=1として輝度補正を行わず入力画素値をそ
のまま出力させたい。この実施形態ではγ係数の算出の
ため原画像の評価輝度値Yを変数とし、〔数3〕に示す
式にて、γ補正後の輝度値(以下「期待輝度値Y′」と
いう。)を求める。
Here, a method of deriving the γ coefficient from the evaluation luminance value of the original image will be described. When the evaluation luminance value Y of the original image is obtained, when Y is smaller than the value range of Y,
For example, when the RGB of the original image can take a value of 0 to 255 for each 8 bits, the value of Y can take a value of 0 to 255 similarly. At this time, when the value of Y is a small value such as 20 or 30, it is desirable to increase the luminance by applying a smaller γ coefficient (to increase the luminance amplification factor). On the other hand, when the evaluation luminance value Y is larger than the value range, for example, a value equal to or more than the median value in the value range of 0 to 255, if the luminance amplification rate is increased, the image after γ correction has a higher luminance value. Since the image is biased and the quality of the original image may be impaired, it is desirable to increase the γ coefficient value or to output the input pixel value as it is without performing luminance correction with γ = 1. In this embodiment, the evaluation luminance value Y of the original image is used as a variable for the calculation of the γ coefficient, and the luminance value after the γ correction (hereinafter referred to as “expected luminance value Y ′”) is calculated by the equation shown in [Equation 3]. Ask.

【0027】〔数3〕の上の段の式において、f(Y)はY
の0からcまでの増加に対して、所定値から1まで値が
単調に減少する関数である。また、下の式は評価輝度値
Yがc以上のとき、γ補正を行わないことを意味する。
In the equation at the upper stage of [Equation 3], f (Y) is Y
Is a function whose value monotonously decreases from a predetermined value to 1 with respect to an increase from 0 to c. Further, the following expression means that when the evaluation luminance value Y is equal to or more than c, no γ correction is performed.

【0028】 Y′=Y・f(Y) (0≦Y<c) …〔数3〕 Y′=Y (c≦Y<Ymax ) ここでf(Y)の例として、図2および〔数4〕に示す指数
関数を導入する。
Y ′ = Y · f (Y) (0 ≦ Y <c) (Equation 3) Y ′ = Y (c ≦ Y <Ymax) Here, as an example of f (Y), FIG. 4] is introduced.

【0029】 f(Y)=(a+b)exp(-Y/T)-b+1 …〔数4〕 〔数4〕は図2を見ても明らかなように、点(0,1+a) で
縦軸と交わる指数関数を表している。また〔数4〕に示
す指数関数の時定数Tは、いま、評価輝度値がc以上で
あれば、γ補正を行わない、すなわち、Y=c でf(Y)=1.0
となるように選定することより、〔数4〕に Y = c f(Y) = 1.0 を代入して、次のように導出する。
F (Y) = (a + b) exp (−Y / T) −b + 1 (Equation 4) As apparent from FIG. 2, the point (0,1) + a) indicates an exponential function that intersects the vertical axis. In addition, the time constant T of the exponential function shown in [Equation 4] indicates that if the evaluation luminance value is equal to or greater than c, no γ correction is performed. That is, Y (c) and f (Y) = 1.0
By substituting Y = cf (Y) = 1.0 into [Equation 4], the following is derived.

【0030】 T =c / log{ b/(a+b)} …〔数5〕 〔数4〕および〔数5〕が示す数式のグラフは図5のよ
うになる。図5では、定数aおよびbを数種類変化させ
た場合について示している。たとえば、(a=1.0,b=0.2
)の曲線は直線Y'=Yに比較的近いが、Y=C/2 付近でも
っとも+側に膨らみを持つ曲線となっている。ここで
Y′は、評価輝度値がYである原画像をγ補正した結果
の画像の注目エリアの平均輝度がY′になることを望む
γ補正後の輝度(期待輝度値)であるから、上記(a=1.
0,b=0.2 )の曲線で示されるYとY′の関係から求めた
γ係数でγ補正を行えば、階調変換量の絶対値は小さい
が、原画像の評価輝度値がc/2 付近のときγ補正による
補正効果がもっとも大きくなり、画像をやや明るくする
ことができる。
T = c / log {b / (a + b)} (Equation 5) The graphs of the equations shown by [Equation 4] and [Equation 5] are as shown in FIG. FIG. 5 shows a case where the constants a and b are changed by several types. For example, (a = 1.0, b = 0.2
The curve of ()) is relatively close to the straight line Y '= Y, but has a bulge on the most positive side near Y = C / 2. Here, Y ′ is the luminance (expected luminance value) after the γ correction that desires that the average luminance of the attention area of the image obtained as a result of the γ correction of the original image whose evaluation luminance value is Y is Y ′. Above (a = 1.
0, b = 0.2), if the γ correction is performed using the γ coefficient obtained from the relationship between Y and Y ′, the absolute value of the gradation conversion amount is small, but the evaluation luminance value of the original image is c / 2 In the vicinity, the correction effect by the γ correction is the largest, and the image can be made slightly brighter.

【0031】また、(a=2.5,b=0.4 )の例では、原画像
の評価輝度値が0 〜C の間では、画像を明るくする効果
が(a=1.0,b=0.2 )の例と比較して大きく、さらに、原
画像の評価輝度値が低い場合に画像を明るく補正する効
果が高い。
In the example of (a = 2.5, b = 0.4), the effect of brightening the image is (a = 1.0, b = 0.2) when the evaluation luminance value of the original image is between 0 and C. The effect of correcting the image to be bright when the evaluation luminance value of the original image is low and the evaluation luminance value of the original image is low is high.

【0032】また、(a=2.5,b=4.0 )は、a およびb を
極端に大きくした場合の例であり、(a=2.5,b=0.4 )の
例とは逆に、原画像の評価輝度値が大きい場合の方が画
像をより明るくする効果が高い。
(A = 2.5, b = 4.0) is an example in which a and b are extremely large. Contrary to the example of (a = 2.5, b = 0.4), the evaluation of the original image is The effect of making the image brighter is higher when the luminance value is larger.

【0033】このように、a の値に対してb の値を小さ
くすると、原画像の評価輝度値が低い画像のγ補正後の
画像を明るくする効果が高くなる。また、a の値に比し
て、b の値を大きくすると、原画像の評価輝度値が高い
画像のγ補正後の画像を明るくする効果が高くなる。
As described above, when the value of b is made smaller than the value of a, the effect of brightening the image after the γ correction of the image having a low evaluation luminance value of the original image is enhanced. Further, when the value of b is increased as compared with the value of a, the effect of brightening the image after the γ correction of the image having the high evaluation luminance value of the original image is enhanced.

【0034】上記〔数3〕、〔数5〕により、原画像の
輝度評価値からγ補正後の期待輝度値を求めた場合、評
価輝度値の値域に対する期待輝度値のグラフは概ね図4
のようになる。このように(0<Y<c)では、〔数5〕中の
パラメータa,b により様々な特徴を持たせて期待輝度値
を求めることができる。さらにc の値そのものを調節す
ること、すなわち、γ補正を有効とする原画像評価輝度
値を変更することにより、γ係数の自動生成に特長を持
たせることも可能である。
When the expected luminance value after gamma correction is obtained from the luminance evaluation value of the original image according to the above [Equation 3] and [Equation 5], the graph of the expected luminance value with respect to the evaluation luminance value range is generally shown in FIG.
become that way. As described above, when (0 <Y <c), the expected luminance value can be obtained by giving various characteristics to the parameters a and b in [Equation 5]. Further, by automatically adjusting the value of c, that is, by changing the original image evaluation luminance value for which the γ correction is valid, it is possible to provide a feature to the automatic generation of the γ coefficient.

【0035】次に、〔数3〕に示すf(Y)に〔数6〕のよ
うな、原画像の評価輝度値Yを変数とする1次式を導入
する例を示す。
Next, an example will be described in which a linear expression having the evaluation luminance value Y of the original image as a variable, such as Expression 6, is introduced into f (Y) shown in Expression 3.

【0036】 f(Y)=−{(e-1)/c }Y + e …〔数6〕 〔数6〕の式を〔数3〕に示すf(Y)に用いた場合の〔数
3〕をグラフとして図示すると図3のようになる。この
場合、γ補正後の期待輝度値Y′は f(Y)・Y =−{(e-1)/c }Y2+ eY …〔数7〕 となり、原画像の評価輝度値Yの2次関数となる。
F (Y) = − {(e−1) / c} Y + e (Expression 6) [Expression 6] when the expression of Expression 6 is used for f (Y) shown in Expression 3 3] is shown as a graph in FIG. In this case, the expected luminance value Y ′ after the γ correction is f (Y) · Y = − {(e−1) / c} Y 2 + eY (Equation 7), which is 2 of the evaluation luminance value Y of the original image. It becomes the following function.

【0037】図7は、原画像評価輝度値Yと〔数7〕式
によるγ補正後の期待輝度値Y′との関係を示す図であ
る。このように、原画像の評価輝度値が比較約高い場合
にγ補正後の画像を明るくする効果が大きくなることが
特徴である。
FIG. 7 is a diagram showing the relationship between the original image evaluation luminance value Y and the expected luminance value Y 'after the .gamma. As described above, when the evaluation luminance value of the original image is relatively high in comparison, the effect of brightening the image after the γ correction increases.

【0038】上記〔数3〕、〔数6〕により、原画像の
輝度評価値からγ補正後の期待輝度値を求めた場合も、
評価輝度値の値域に対する期待輝度値のグラフは概ね図
4のようになる。このように(0<Y<c)では、〔数6〕中
のパラメータe により様々な特徴を持たせて期待輝度値
を求めることができる。またc の値そのものを調節する
ことによりγ係数の自動生成に特長を持たせることも可
能である。
In the case where the expected luminance value after γ correction is obtained from the luminance evaluation value of the original image according to [Equation 3] and [Equation 6],
A graph of the expected luminance value with respect to the evaluation luminance value range is substantially as shown in FIG. As described above, when (0 <Y <c), the expected luminance value can be obtained by giving various characteristics by the parameter e in [Equation 6]. Further, by adjusting the value of c itself, it is possible to give a feature to the automatic generation of the γ coefficient.

【0039】以上に述べたようにして、図1のステップ
s9で期待輝度値Y′を求める。
As described above, the expected luminance value Y 'is obtained in step s9 of FIG.

【0040】その後、図1のステップs10では、原画
像の評価輝度値Yと、ステップs9で求めた期待輝度値
Y′とからγ補正の特性を定めるγ係数を求める。
Thereafter, in step s10 of FIG. 1, a γ coefficient that determines the γ correction characteristic is obtained from the evaluation luminance value Y of the original image and the expected luminance value Y ′ obtained in step s9.

【0041】ここでは、評価輝度値Yをγ補正した結果
が期待輝度値Y′となればよいから、 Y′=Y^γ …〔数7〕 γ= logY′/ logY …〔数8〕 の関係からγ係数を求める。ここで、Y′およびYは0
〜1の範囲で正規化されている必要がある。
Here, it is only necessary that the result of the γ correction of the evaluation luminance value Y be the expected luminance value Y ′. Y ′ = Y ^ γ (Equation 7) γ = logY ′ / logY (Equation 8) The γ coefficient is obtained from the relationship. Here, Y ′ and Y are 0
It must be normalized within the range of 〜1.

【0042】図1のステップs11では、上記ステップ
s10で得られたγ係数を用いて、γ補正用のテーブル
を作成する。いま、RGB それぞれのγ補正テーブルの配
列をtableR[]、tableG[]、tableB[]とする。これらの配
列は評価輝度値と同じダイナミックレンジと同数の要素
をもつ。配列の各要素の値は〔数9〕によりRGB のダイ
ナミックレンジの各値をi に代入して求めることができ
る。〔数9〕ではRGBのダイナミックレンジを各8bit(0
〜255)の例として示している。
In step s11 of FIG. 1, a table for γ correction is created by using the γ coefficient obtained in step s10. Now, let the array of the gamma correction tables of RGB be tableR [], tableG [], and tableB []. These arrays have the same dynamic range and the same number of elements as the evaluation luminance values. The value of each element of the array can be obtained by substituting each value of the RGB dynamic range into i according to [Equation 9]. In [Equation 9], the RGB dynamic range is set to 8 bits (0
To 255).

【0043】 tableR[i] =255 *(i/255)^γ tableG[i] =255 *(i/255)^γ …〔数9〕 tableB[i] =255 *(i/255)^γ ステップs12では、上記ステップ10で作成したγ補
正テーブルを参照し原画像の全画素のRGB の値を変換す
る。この例ではRGB に同一のγ補正カープを用いてい
る。
TableR [i] = 255 * (i / 255) ^ γ tableG [i] = 255 * (i / 255) ^ γ (Equation 9) tableB [i] = 255 * (i / 255) ^ γ In step s12, the RGB values of all pixels of the original image are converted with reference to the gamma correction table created in step 10 above. In this example, the same gamma correction carp is used for RGB.

【0044】原画像のある1画素のRGB の値をそれぞれ
r,g,b とすると、γ補正後のRGB の値r',g',b'は〔数
10〕のように求める。
The RGB values of one pixel of the original image are
Assuming that r, g, b, the RGB values r ′, g ′, b ′ after the γ correction are obtained as shown in [Equation 10].

【0045】 r'=tableR[r] g'=tableG[g] …〔数10〕 b'=tableB[b] ステップs13では、上記ステップs12により求めた
γ補正後の画像をファイルとして保存する。
R ′ = tableR [r] g ′ = tableG [g] (Equation 10) b ′ = tableB [b] In step s13, the image after the γ correction obtained in step s12 is stored as a file.

【0046】[0046]

【発明の効果】この発明によれば、CCD 、C-MOS エリア
センサー等の固体撮像素子を用いた電子スチルカメラ、
イメージスキャナ、また、ビデオキャプチャボード等か
ら取り込んだ静止画像において、注目エリアの平均輝度
を変数として、例えば指数関数や1次関数等の単調減少
関数を参照してγ補正後の期待輝度を求めるようにした
ため、無段階に、しかも、自動的にγ補正のためのγ係
数を導出することが可能となる。これによりγ曲線の指
定手段を特に必要とせず、また、原画像の輝度の雰囲気
を損なうことなく、適切なγ補正を行うことが可能とな
る。
According to the present invention, an electronic still camera using a solid-state imaging device such as a CCD or a C-MOS area sensor,
In a still image captured from an image scanner, a video capture board, or the like, an expected luminance after γ correction is obtained by referring to a monotone decreasing function such as an exponential function or a linear function using the average luminance of the attention area as a variable. Therefore, it is possible to derive a γ coefficient for γ correction steplessly and automatically. This makes it possible to perform appropriate gamma correction without particularly requiring a gamma curve designating means and without deteriorating the brightness atmosphere of the original image.

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

【図1】この発明の画像補正装置における処理手順を示
すフローチャート
FIG. 1 is a flowchart showing a processing procedure in an image correction apparatus according to the present invention.

【図2】原画像評価輝度値から期待輝度値を求める指数
関数を示す図
FIG. 2 is a diagram showing an exponential function for obtaining an expected luminance value from an original image evaluation luminance value.

【図3】原画像評価輝度値から期待輝度値を求める1次
関数を示す図
FIG. 3 is a diagram showing a linear function for obtaining an expected luminance value from an original image evaluation luminance value.

【図4】この発明による原画像評価輝度値に対する期待
輝度値の関係を示す図
FIG. 4 is a diagram showing a relationship between an original image evaluation luminance value and an expected luminance value according to the present invention.

【図5】原画像評価輝度値と期待輝度値との関係を示す
FIG. 5 is a diagram showing a relationship between an original image evaluation luminance value and an expected luminance value.

【図6】エリア分割の例を示す図FIG. 6 is a diagram showing an example of area division.

【図7】原画像輝度評価値と期待輝度値との関係を示す
FIG. 7 is a diagram showing a relationship between an original image luminance evaluation value and an expected luminance value.

【図8】γ補正曲線の例を示す図FIG. 8 is a diagram showing an example of a γ correction curve.

【図9】画像補正装置の構成を示す図FIG. 9 is a diagram illustrating a configuration of an image correction device.

【符号の説明】[Explanation of symbols]

4,6,8−インタフェース 7−ハードディスクドライブ装置 11−フロッピィディスクドライブ装置 4, 6, 8-interface 7- hard disk drive 11- floppy disk drive

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5C021 PA63 PA80 RA07 RB03 XA34 5C066 AA00 AA01 BA00 CA08 EC05 GA01 GA02 GB00 KA11 KD06 KE05 KP02 5C077 LL16 MM02 MP08 PP15 PP28 PP32 PP44 PP46 PP68 PQ12 PQ22 PQ23 TT09  ──────────────────────────────────────────────────続 き Continued on the front page F term (reference) 5C021 PA63 PA80 RA07 RB03 XA34 5C066 AA00 AA01 BA00 CA08 EC05 GA01 GA02 GB00 KA11 KD06 KE05 KP02 5C077 LL16 MM02 MP08 PP15 PP28 PP32 PP44 PP46 PP68 PQ12 PQ22 PQ23 TT

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 原画像の注目エリアの平均輝度を評価輝
度値として求め、該評価輝度値からγ補正後の期待する
輝度値を、前記評価輝度値を変数とする単調減少関数で
求め、当該輝度値を期待輝度値とし、前記評価輝度値と
前記期待輝度値とからγ係数を求め、当該γ係数を基に
前記原画像の各画素の値をγ補正する画像補正方法。
1. An average luminance of an attention area of an original image is obtained as an evaluation luminance value, and an expected luminance value after γ correction is obtained from the evaluation luminance value by a monotonic decreasing function using the evaluation luminance value as a variable. An image correction method in which a luminance value is set as an expected luminance value, a γ coefficient is obtained from the evaluation luminance value and the expected luminance value, and a value of each pixel of the original image is γ corrected based on the γ coefficient.
【請求項2】 前記単調減少関数は前記評価輝度値を変
数とする指数関数を含む請求項1に記載の画像補正方
法。
2. The image correction method according to claim 1, wherein the monotone decreasing function includes an exponential function having the evaluation luminance value as a variable.
【請求項3】 前記単調減少関数は前記評価輝度値を変
数とする1次関数を含む請求項1に記載の画像補正方
法。
3. The image correction method according to claim 1, wherein the monotone decreasing function includes a linear function having the evaluation luminance value as a variable.
【請求項4】 画像処理を実行するコンピュータに、原
画像の注目エリアの平均輝度を評価輝度値として求め、
該評価輝度値からγ補正後の期待する輝度値を、前記評
価輝度値を変数とする単調減少関数で求め、当該輝度値
を期待輝度値とし、前記評価輝度値と前記期待輝度値と
からγ係数を求め、当該γ係数を基に前記原画像の各画
素の値をγ補正する画像補正処理を実行させるプログラ
ムを格納した記録媒体。
4. A computer that executes image processing obtains an average luminance of an attention area of an original image as an evaluation luminance value,
From the evaluation luminance value, an expected luminance value after γ correction is obtained by a monotonically decreasing function using the evaluation luminance value as a variable, the luminance value is set as an expected luminance value, and γ is calculated from the evaluation luminance value and the expected luminance value. A recording medium storing a program for obtaining a coefficient and performing an image correction process for performing a γ correction of a value of each pixel of the original image based on the γ coefficient.
JP11004056A 1999-01-11 1999-01-11 Image correction method and storage medium storing image correction program Pending JP2000209437A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11004056A JP2000209437A (en) 1999-01-11 1999-01-11 Image correction method and storage medium storing image correction program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11004056A JP2000209437A (en) 1999-01-11 1999-01-11 Image correction method and storage medium storing image correction program

Publications (1)

Publication Number Publication Date
JP2000209437A true JP2000209437A (en) 2000-07-28

Family

ID=11574230

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11004056A Pending JP2000209437A (en) 1999-01-11 1999-01-11 Image correction method and storage medium storing image correction program

Country Status (1)

Country Link
JP (1) JP2000209437A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005057912A1 (en) * 2003-12-15 2005-06-23 Matsushita Electric Industrial Co., Ltd. Brightness correction apparatus
US7606412B2 (en) 2002-12-12 2009-10-20 Samsung Electronics Co., Ltd. Method and apparatus for generating user preference data regarding color characteristic of image and method and apparatus for converting image color preference using the method and apparatus
KR101010150B1 (en) * 2007-08-31 2011-01-24 가시오게산키 가부시키가이샤 Tone correcting apparatus, tone correcting method, and recording medium for recording the tone correcting program
US8160383B2 (en) 2007-08-31 2012-04-17 Casio Computer Co., Ltd. Tone correcting apparatus providing improved tone correction on image
CN112381896A (en) * 2020-11-13 2021-02-19 湖南国科智瞳科技有限公司 Method and system for correcting brightness of microscopic image and computer equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7606412B2 (en) 2002-12-12 2009-10-20 Samsung Electronics Co., Ltd. Method and apparatus for generating user preference data regarding color characteristic of image and method and apparatus for converting image color preference using the method and apparatus
WO2005057912A1 (en) * 2003-12-15 2005-06-23 Matsushita Electric Industrial Co., Ltd. Brightness correction apparatus
KR101010150B1 (en) * 2007-08-31 2011-01-24 가시오게산키 가부시키가이샤 Tone correcting apparatus, tone correcting method, and recording medium for recording the tone correcting program
US8009927B2 (en) 2007-08-31 2011-08-30 Casio Computer Co., Ltd. Tone correcting apparatus providing improved tone correction on image
US8126285B2 (en) 2007-08-31 2012-02-28 Casio Computer Co., Ltd. Tone correcting apparatus providing improved tone correction on image
US8160383B2 (en) 2007-08-31 2012-04-17 Casio Computer Co., Ltd. Tone correcting apparatus providing improved tone correction on image
CN112381896A (en) * 2020-11-13 2021-02-19 湖南国科智瞳科技有限公司 Method and system for correcting brightness of microscopic image and computer equipment

Similar Documents

Publication Publication Date Title
US7023580B2 (en) System and method for digital image tone mapping using an adaptive sigmoidal function based on perceptual preference guidelines
JP3759761B2 (en) Method and apparatus for changing sharpness
US7580064B2 (en) Digital still camera and image correction method
EP0967791A2 (en) Image processing method, apparatus and memory medium therefor
US20080253650A1 (en) Image Processing Device, Image Processing Method, Image Processing Program Product, and Image-Capturing Device
EP1930853A1 (en) Image signal processing apparatus and image signal processing
JP2000228747A (en) Picture processor
JPH09121361A (en) Digital color processing method
US20070097228A1 (en) Image-processing devices, methods, and programs, and electronic cameras and the like comprising same
JP4479527B2 (en) Image processing method, image processing apparatus, image processing program, and electronic camera
US7613338B2 (en) Image processing method and apparatus, program, and storage medium
EP0442369B1 (en) Gradation correcting apparatus
EP0961487A2 (en) Image processing method and apparatus and recording medium
JP2003304549A (en) Camera and image signal processing system
US7289128B2 (en) Image processing device
JP4774757B2 (en) Image processing apparatus, image processing program, electronic camera, and image processing method
US9019406B2 (en) Imaging apparatus and image processing program for correcting dark area gradation
JP3673092B2 (en) Image quality adjusting apparatus, image quality adjusting method, and recording medium recording image adjusting program
JP4151225B2 (en) Apparatus, method and program for image processing
JP3950551B2 (en) Image processing method, apparatus, and recording medium
JP2000209437A (en) Image correction method and storage medium storing image correction program
JPH09326941A (en) Image processing unit
JP2929983B2 (en) Color image processing equipment
JP2002094810A (en) Picture processor, picture processing method and memory medium having stored programs for the method
JP2000201277A (en) Image correcting method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040805

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041026

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20050705