JP2005130484A - Gradation correction apparatus and gradation correction program - Google Patents

Gradation correction apparatus and gradation correction program Download PDF

Info

Publication number
JP2005130484A
JP2005130484A JP2004286481A JP2004286481A JP2005130484A JP 2005130484 A JP2005130484 A JP 2005130484A JP 2004286481 A JP2004286481 A JP 2004286481A JP 2004286481 A JP2004286481 A JP 2004286481A JP 2005130484 A JP2005130484 A JP 2005130484A
Authority
JP
Japan
Prior art keywords
gradation
original image
gradation correction
lightness
histogram
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
JP2004286481A
Other languages
Japanese (ja)
Inventor
Takeshi Utagawa
健 歌川
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.)
Nikon Corp
Original Assignee
Nikon 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 Nikon Corp filed Critical Nikon Corp
Priority to JP2004286481A priority Critical patent/JP2005130484A/en
Publication of JP2005130484A publication Critical patent/JP2005130484A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To prevent gradation correction from becoming unnatural by local property distortion or inclination change that is specific to equalizing of histograms. <P>SOLUTION: The gradation correction apparatus for converting gradations of an original image comprises a histogram creating part, a first property creating part, a second property creating part, a property compositing part, and a gradation correcting part. The histogram creating part creates a histogram from lightness of the original image. The first property creating part finds a first gradation conversion property for making approximately equal fineness and coarseness of probability densities of the histogram. The second property creating part holds a second gradation conversion property limited to a gradation change, wherein a gradation skip does not occur. The characteristic compositing part performs weighted compositing of the first gradation conversion property and the second gradation conversion property, to create a composited gradation conversion characteristics. The gradation correcting part finds the ratio of input/output gradations of the composited gradation conversion characteristics, using the lightness as an input parameter and multiplies the color components of the source image with this ratio to correct the gradations of the original image. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、原画像の階調を変換する階調補正装置および階調補正プログラムに関する。
特に、本発明は、原画像のヒストグラムを求め、そのヒストグラムの粗密を緩和するように階調変換特性を作成する技術に関する。
The present invention relates to a gradation correction apparatus and a gradation correction program for converting the gradation of an original image.
In particular, the present invention relates to a technique for obtaining a histogram of an original image and creating gradation conversion characteristics so as to reduce the density of the histogram.

従来、画像データに対して、階調補正を行う技術が知られている。
例えば、電子カメラを用いて主要被写体を逆光撮影すると、背景が著しく明るく撮影される場合がある。また、ストロボ撮影を行うと、遠方に位置する背景が極端に暗く撮影される場合がある。
Conventionally, a technique for performing gradation correction on image data is known.
For example, when a main subject is photographed with backlight using an electronic camera, the background may be photographed extremely brightly. Further, when flash photography is performed, a background located far away may be photographed extremely dark.

これら画像は、階調の偏りが強く、微妙な階調変化に乏しくなる。この階調の偏りを階調補正する技術として、ヒストグラム均等化と呼ばれる技術が知られている。
このヒストグラム均等化では、補正対象の原画像から輝度成分を画素単位に抽出し、輝度成分の値ごとに出現度数を求めて、ヒストグラムを作成する。次に、このヒストグラムの度数を累積した後に、出力階調レンジに合わせて累積度数を正規化し、階調補正の特性曲線とする。ヒストグラム均等化では、このように求めた特性曲線に従って原画像の階調補正が行われる。
These images have strong gradation deviations and lack subtle gradation changes. As a technique for correcting the gradation deviation, a technique called histogram equalization is known.
In this histogram equalization, a luminance component is extracted from the original image to be corrected in units of pixels, the appearance frequency is obtained for each value of the luminance component, and a histogram is created. Next, after accumulating the frequencies of this histogram, the accumulated frequencies are normalized in accordance with the output gradation range to obtain a characteristic curve for gradation correction. In the histogram equalization, gradation correction of the original image is performed according to the characteristic curve thus obtained.

このヒストグラム均等化の階調補正により、原画像において出現度数が高い階調については、階調変化を拡げる方向に補正がなされる。逆に、原画像において出現度数の少ない階調については、階調変化を狭める方向に補正がなされる。その結果、階調の偏りを均等化した画像を得ることができる。   By this gradation equalization gradation correction, gradations having a high appearance frequency in the original image are corrected in a direction in which the gradation change is expanded. Conversely, for gradations with a low appearance frequency in the original image, correction is made in a direction that narrows the gradation change. As a result, an image with uniform gradation can be obtained.

しかしながら、この場合には出現度数のピーク部分で、特性曲線の傾きが著しく急になり、階調補正後の画像が不自然になるという問題があった。このような問題に有効な方法であるとして、特許文献1が提案されている。
この特許文献1では、まず、ヒストグラムの度数分布を、所定の上限値でリミットする。次に、この上限リミット後の度数を累積した後に、階調レンジに合わせて正規化し、特性曲線を作成する。このような上限リミットの処理を付加することによって、作成される特性曲線の傾きを制限し、階調補正後の画像に現れる過度な階調補正を回避することができる。
米国特許第5923383号明細書
However, in this case, there is a problem that the slope of the characteristic curve becomes remarkably steep at the peak portion of the appearance frequency, and the image after gradation correction becomes unnatural. Patent document 1 is proposed as an effective method for such a problem.
In Patent Document 1, first, the frequency distribution of the histogram is limited to a predetermined upper limit value. Next, after accumulating the frequency after the upper limit, it is normalized according to the gradation range to create a characteristic curve. By adding such upper limit processing, it is possible to limit the slope of the characteristic curve to be created, and to avoid excessive gradation correction appearing in the image after gradation correction.
US Pat. No. 5,923,383

しかしながら、特許文献1の上限リミットでは、その効果が度数ピークの箇所に限られるため、特性曲線の急激な傾きを全域にわたって抑制することはできず、特性曲線には傾きの急な箇所が現れる。このような傾きの急な特性曲線によって、本来なだらかな階調変化が過度に強調されることになり、やはり不自然な画像になってしまうという問題が相変わらず未解決であった。   However, in the upper limit of Patent Document 1, since the effect is limited to the frequency peak portion, the steep slope of the characteristic curve cannot be suppressed over the entire area, and a steep portion of the characteristic curve appears. Due to such a steep characteristic curve, a gentle gradation change is excessively emphasized, and an unnatural image is still unsolved.

さらに、特殊な撮像画像では、原画像中に特定の階調域がもともと存在しない場合がある(以下、原画像中で出現度数がほぼゼロの階調域を欠落階調域という)。ヒストグラム上では、この欠落階調域に出現度数ゼロが並ぶ。その結果、ヒストグラム均等化では、この欠落階調域において累積度数は殆ど変化せず、特性曲線の傾きもほぼゼロとなる。そのため、階調補正後に、この欠落階調域の幅はほぼゼロ近くまで階調圧縮される。この場合、その欠落階調域を挟んで上側と下側の階調が極端に接近し、本来あるべき階調差が失われてしまう。   Furthermore, in a special captured image, there is a case where a specific gradation area does not originally exist in the original image (hereinafter, a gradation area where the appearance frequency is almost zero in the original image is referred to as a missing gradation area). On the histogram, the appearance frequency of zero is arranged in this missing gradation area. As a result, in the histogram equalization, the cumulative frequency hardly changes in this missing gradation region, and the slope of the characteristic curve becomes almost zero. For this reason, after the gradation correction, the gradation of the missing gradation area is compressed to almost zero. In this case, the upper and lower gradations are extremely close to each other across the missing gradation area, and the original gradation difference is lost.

特に、夜景などの撮像画像では、高輝度側に広範囲の欠落階調域が生じる。ヒストグラム均等化では、この高輝度側の欠落階調域が階調圧縮されることにより、低輝度側が不自然に明るく階調補正されてしまう。その結果、夜景の印象を大きく損なってしまう。
また、このように明るく階調補正される際に、色成分(RGB成分など)のいずれかがレンジオーバーし、不自然な色相に変化してしまうといった弊害もあった。
In particular, in a captured image such as a night view, a wide range of missing gradations occurs on the high luminance side. In the histogram equalization, the missing gradation area on the high luminance side is subjected to gradation compression, so that the low luminance side is unnaturally brightly corrected for gradation. As a result, the night view impression is greatly impaired.
Further, when gradation correction is performed brightly in this way, there is a problem that any of the color components (RGB components, etc.) is over the range and changes to an unnatural hue.

このような欠落階調域の問題は、特許文献1の上限リミットでは一切解決できない。すなわち、上限リミットでは、出現度数が上限値を超えた階調域について対処するものであり、出現度数がゼロに近い欠落階調域については全く対処できないからである。   Such a problem of the missing gradation area cannot be solved at all by the upper limit of Patent Document 1. In other words, the upper limit is for dealing with a gradation range in which the appearance frequency exceeds the upper limit value, and it is not possible to deal with a missing gradation range whose appearance frequency is close to zero.

そこで、本発明は、上述した未解決の欠落階調域の問題を共通課題として、階調補正後の画像が従来よりも自然になるように、ヒストグラム均等化の階調補正を改良することを目的とする。
また、本発明の別の目的は、ヒストグラム均等化の階調変換特性に局所的に現れる特性変化(特に急峻すぎる傾き)を改善することである。
特に、請求項1にかかる発明の別の目的は、ヒストグラム均等化だけでは柔軟性がなく達成が難しい明るさのコントロールを可能にすることである。
さらに、請求項5,6にかかる発明の別の目的は、階調補正の基準値として特に好適な明度値を作成することである。
Therefore, the present invention aims to improve the gradation correction for histogram equalization so that the image after gradation correction becomes more natural than before, with the above-mentioned problem of the unresolved missing gradation area as a common problem. Objective.
Another object of the present invention is to improve characteristic changes that appear locally in the gradation conversion characteristics of histogram equalization (particularly too steep slopes).
In particular, another object of the invention according to claim 1 is to enable brightness control which is difficult to achieve without being flexible only by histogram equalization.
Furthermore, another object of the invention according to claims 5 and 6 is to create a lightness value particularly suitable as a reference value for gradation correction.

《請求項1》
請求項1に記載の発明は、原画像の階調を変換する階調補正装置であって、ヒストグラム作成部、第1特性作成部、第2特性作成部、特性合成部、および階調補正部を備える。
このヒストグラム作成部は、原画像の明度(色の濃さおよび明るさを総合的に表す値)についてヒストグラムを作成する。
第1特性作成部は、ヒストグラムの確率密度の粗密を均等に近づける第1階調変換特性を求める。
第2特性作成部は、階調飛びが生じない階調変化に制限した第2階調変換特性を保持する。なお、第2階調変換特性は、階調飛びが生じる程度の急峻すぎる変化が特性曲線にないことを条件にして作成することが好ましい。
特性合成部は、第1階調変換特性および第2階調変換特性を加重合成して、合成済み階調変換特性を作成する。
階調補正部は、原画像を構成する画素単位に、明度を合成済み階調変換特性に照合して入出力階調の比を求め、その比を原画像の色成分に乗じることにより、原画像を階調補正する。
例えば、色の濃さおよび明るさを総合的に表す明度としては、画素ごとの色成分の最大値を用いることが好ましい。
<Claim 1>
The invention according to claim 1 is a gradation correction device for converting the gradation of an original image, and includes a histogram creation unit, a first property creation unit, a second property creation unit, a property synthesis unit, and a tone correction unit. Is provided.
The histogram creation unit creates a histogram for the lightness (a value that comprehensively represents color density and brightness) of the original image.
The first characteristic creation unit obtains a first gradation conversion characteristic that makes the probability density of the histogram closer to equal.
The second characteristic creation unit holds the second gradation conversion characteristic limited to gradation change that does not cause gradation skip. The second gradation conversion characteristic is preferably created on condition that there is no change in the characteristic curve that is too steep to cause gradation skipping.
The characteristic combination unit weights and combines the first gradation conversion characteristic and the second gradation conversion characteristic to create a combined gradation conversion characteristic.
The gradation correction unit obtains a ratio of input / output gradations by comparing the lightness with a combined gradation conversion characteristic for each pixel constituting the original image, and multiplies the color component of the original image by the ratio. Tone-correct the image.
For example, it is preferable to use the maximum value of the color component for each pixel as the brightness that comprehensively represents the color density and brightness.

また好ましくは、第2特性作成部が保持する第2階調変換特性を、べき乗カーブを含む特性とする。すなわち、第2階調変換特性の少なくとも一部は、入力xに対する出力yがべき乗の関係『y−yo=C(x−xo)a』(ただしa,C,yo,およびxoは調整パラメータ)と一致する。 Preferably, the second gradation conversion characteristic held by the second characteristic creation unit is a characteristic including a power curve. That is, at least a part of the second gradation conversion characteristic is a relation “y−yo = C (x−xo) a ” where output y is a power of input x (where a, C, yo, and xo are adjustment parameters). Matches.

《請求項2》
請求項2に記載の発明は、請求項1に記載の階調補正装置において、ヒストグラム作成部は、原画像から部分画像を抽出し、部分画像からヒストグラムを作成することを特徴とする。
<Claim 2>
According to a second aspect of the present invention, in the gradation correction apparatus according to the first aspect, the histogram creation unit extracts a partial image from the original image and creates a histogram from the partial image.

《請求項3》
請求項3に記載の発明は、請求項2に記載の階調補正装置において、ヒストグラム作成部は、原画像の明るさ、色、および『顔判別などの被写体判別』の少なくとも一つの特徴判別に基づいて部分画像の領域を決定することを特徴とする。
<Claim 3>
According to a third aspect of the present invention, in the gradation correction device according to the second aspect, the histogram creating unit performs at least one feature determination of brightness, color of the original image, and “subject discrimination such as face discrimination”. A region of the partial image is determined on the basis of this.

《請求項4》
請求項4に記載の発明は、請求項1ないし請求項3のいずれか1項に記載の階調補正装置において、第2特性作成部は、原画像の平均輝度に応じて、第2階調変換特性を調整変更することを特徴とする。
<Claim 4>
According to a fourth aspect of the present invention, in the gradation correction device according to any one of the first to third aspects, the second characteristic creating unit generates the second gradation according to the average luminance of the original image. The conversion characteristic is adjusted and changed.

《請求項5》
請求項5に記載の発明は、原画像の階調を変換する階調補正装置であって、第1明度抽出部、第2明度抽出部、明度合成部、特性作成部、および階調補正部を備える。
この第1明度抽出部は、原画像から、色の濃さおよび明るさを総合的に表す値を抽出して第1明度とする。
第2明度抽出部は、原画像を構成する色成分に関する量を加重加算して、第2明度を抽出する。
明度合成部は、第1明度および第2明度を合成して、第3明度を求める。
階調補正部は、原画像を構成する画素単位に、第3明度をパラメータとして入出力階調の比を求め、その比を色成分に乗じることにより、原画像を階調補正する。
例えば、色の濃さおよび明るさを総合的に表す第1明度としては、画素ごとの色成分の最大値を用いることが好ましい。
<Claim 5>
According to a fifth aspect of the present invention, there is provided a gradation correction device for converting a gradation of an original image, the first brightness extraction unit, the second brightness extraction unit, the brightness synthesis unit, the characteristic creation unit, and the tone correction unit. Is provided.
The first lightness extraction unit extracts a value that comprehensively represents the color density and brightness from the original image to obtain the first lightness.
The second lightness extraction unit extracts the second lightness by performing weighted addition of the amounts related to the color components constituting the original image.
The lightness combining unit combines the first lightness and the second lightness to obtain the third lightness.
The gradation correction unit obtains a ratio of input / output gradations using the third brightness as a parameter for each pixel constituting the original image, and multiplies the color component by the ratio to correct the gradation of the original image.
For example, it is preferable to use the maximum value of the color component for each pixel as the first brightness that comprehensively represents the color density and brightness.

《請求項6》
請求項6に記載の発明は、請求項5に記載の階調補正装置において、明度合成部は、
原画像の暗い箇所では、原画像の明るい箇所よりも、第2明度の加重比率を高くする。
<Claim 6>
According to a sixth aspect of the present invention, in the gradation correction apparatus according to the fifth aspect, the lightness synthesis unit includes:
In the dark part of the original image, the weighting ratio of the second brightness is set higher than in the bright part of the original image.

《請求項7》
請求項7の階調補正プログラムは、コンピュータを、請求項1ないし請求項6のいずれか1項に記載の階調補正装置として機能させるためのプログラムコードを含む。
<Claim 7>
A gradation correction program according to a seventh aspect includes a program code for causing a computer to function as the gradation correction apparatus according to any one of the first to sixth aspects.

《請求項1〜4》
請求項1〜4の発明は、2種類の階調変換特性を加重合成して、合成済み階調変換特性を作成する。
この内、一方の第1階調変換特性は、明度のヒストグラムを均等に近づけるように作成された特性である。すなわち、第1階調変換特性では、明度ヒストグラムの確率密度の粗密変化が極端な場合、急峻な傾きが局所的に発生する。さらに、第1階調変換特性は、原画像の明度に欠落域が有れば、その欠落域を相対的に階調圧縮する特性である。
<< Claims 1-4 >>
According to the first to fourth aspects of the present invention, two types of gradation conversion characteristics are weighted and combined to create a combined gradation conversion characteristic.
Among these, one first gradation conversion characteristic is a characteristic created so as to make the brightness histogram closer to each other. That is, in the first gradation conversion characteristic, when the density density change of the lightness histogram is extreme, a steep slope occurs locally. Further, the first gradation conversion characteristic is a characteristic that relatively compresses the gradation of the missing area if there is a missing area in the brightness of the original image.

一方、第2階調変換特性は、階調飛びが生じない範囲に階調変化を制限した特性である。すなわち、第1階調変換特性で急峻な傾きを持つ部分でも、第2階調階調変換特性は、階調飛びが生じない程度の傾きを維持する。さらに、この第2階調変換特性は、欠落階調域か否かとは無関係に、階調域全体について階調飛びが生じない範囲で階調補正を実施する特性である。   On the other hand, the second gradation conversion characteristic is a characteristic in which gradation change is limited to a range in which gradation skip does not occur. That is, even in a portion having a steep inclination in the first gradation conversion characteristic, the second gradation gradation conversion characteristic maintains an inclination that does not cause gradation skipping. Further, the second gradation conversion characteristic is a characteristic for performing gradation correction in a range in which gradation skip does not occur in the entire gradation range regardless of whether or not it is in the missing gradation range.

これら2種類の階調変換特性を加重合成することにより、第1階調変換特性の局所的に急峻な特性が、階調飛びを生じない第2階調変換特性によって効果的に緩和される。その結果、明度ヒストグラムの確率密度を均等にある程度近づけつつ、かつ局所的に急峻な傾きや欠落域に起因する不自然さを抑制した『滑らかな特性曲線の合成済み階調変換特性』が得られる。   By weighting and combining these two types of gradation conversion characteristics, the locally steep characteristics of the first gradation conversion characteristics are effectively relaxed by the second gradation conversion characteristics that do not cause gradation skipping. As a result, a “smooth characteristic curve synthesized tone conversion characteristic” is obtained, in which the probability density of the lightness histogram is evenly approached to some extent and the unnaturalness caused by locally steep slopes and missing areas is suppressed. .

さらに、この合成済み階調変換特性に明度を入力パラメータとして与え、この合成済み階調変換特性の入出力階調の比を求める。この比を色成分に乗することによって階調補正を行う。この明度は、色の濃さおよび明るさを総合した値であり、言い換えると、色座標空間の色立体(画素の色の座標点が表面に乗るように設定した仮想上の立方体)の大きさにおおよそ対応する値である。
したがって、この明度を基準にした階調補正は、色座標空間の原点を中心に色立体(各画素の色の座標点が表面に乗った立方体)を、上述した比に従って比例拡大または比例縮小することにほぼ等しい。この比例拡大によって色立体をたとえ最大に拡大しても、各画素の色の座標点が、色成分の出力階調レンジで決まる最大の色立体よりも外にはみ出すことは少なく、色成分のいずれかがレンジオーバー(色飽和)する可能性は低い。
このような飽和防止の効果により、色飽和による色相変化がなくなり、階調補正後の画像の色相を自然な印象に保つことが可能になる。
したがって、色飽和による画質劣化が少なく、かつ滑らかで豊かに階調変化する補正画像を得ることが可能になる。
Further, the lightness is given to this combined gradation conversion characteristic as an input parameter, and the ratio of the input / output gradation of this combined gradation conversion characteristic is obtained. The gradation correction is performed by multiplying this ratio by the color component. This lightness is a total value of color depth and brightness, in other words, the size of the color solid in the color coordinate space (virtual cube set so that the coordinate point of the pixel color is on the surface). The value roughly corresponds to.
Therefore, the gradation correction based on the brightness is performed by proportionally expanding or reducing a color solid (a cube with the color coordinate point of each pixel on the surface) centering on the origin of the color coordinate space according to the above-described ratio. Is almost equal. Even if the color solid is expanded to the maximum by this proportional expansion, the coordinate point of the color of each pixel is less likely to protrude beyond the maximum color solid determined by the output gradation range of the color component. There is a low possibility of over-range (color saturation).
Due to the effect of preventing saturation, the hue change due to color saturation is eliminated, and the hue of the image after gradation correction can be maintained in a natural impression.
Therefore, it is possible to obtain a corrected image with little deterioration in image quality due to color saturation and smooth and rich gradation change.

従来、上述したような優れた階調変換特性を作成するためには、ベテランの画像処理技術者が、個々の画像ごとに階調補正カーブを試行錯誤しながら作成しなければならず、手間と時間の非常にかかる作業であった。また、経験やセンスといった要素が必要な作業であるため、そのまま機械化することは不可能であった。
しかしながら、請求項1〜4の発明は、従来難しかったこの作業を、単純なアルゴリズムで的確に実現し、かつ安定した品質の階調変換特性を原画像に合わせて作成できるという点で非常に優れた発明である。
Conventionally, in order to create the above-described excellent gradation conversion characteristics, a veteran image processing engineer has to create a gradation correction curve for each individual image by trial and error. It was a time consuming work. Moreover, since it requires work such as experience and sense, it was impossible to mechanize as it is.
However, the inventions of claims 1 to 4 are very excellent in that this work, which has been difficult in the past, can be accurately realized with a simple algorithm and a gradation conversion characteristic of stable quality can be created according to the original image. Invention.

《請求項5,6》
既に述べたように、第1明度(色成分の最大値)を基準に階調補正を行うことにより、色飽和の問題は改善できる。
しかしながら、電子カメラの撮像画像では、特定の色成分(例えばR成分)に限ってノイズが多い場合がある。そのため、この特定の色成分が最大値となる箇所では、第1明度のS/Nが低下する。そのため、この第1明度を基準に階調補正を実施すると、条件によっては階調補正後にノイズが目立つ。
<< Claims 5 and 6 >>
As described above, the color saturation problem can be improved by performing the gradation correction based on the first brightness (maximum value of the color component).
However, in a captured image of an electronic camera, there may be a lot of noise only for a specific color component (for example, R component). For this reason, the S / N of the first brightness is lowered at a location where the specific color component has the maximum value. Therefore, when tone correction is performed based on the first brightness, noise is noticeable after tone correction depending on conditions.

そこで、階調補正後の色飽和などの問題を改善しつつ、ノイズ問題を改善するために、請求項5,6の発明がなされた。
すなわち、色成分に関する量を加重加算して第2明度(例えば輝度Y)を求める。このような第2明度は、特定の色成分のノイズが、加重加算の割合に従って低くなる。
Accordingly, the inventions of claims 5 and 6 have been made in order to improve the noise problem while improving the problems such as color saturation after gradation correction.
That is, the second lightness (for example, luminance Y) is obtained by weighted addition of the amounts related to the color components. In such second brightness, the noise of a specific color component decreases according to the weighted addition ratio.

この第2明度と第1明度とを合成して第3明度を求め、この第3明度を基準に階調補正を行うことにより、階調補正後の色飽和の問題を従来よりも改善しつつ、ノイズ問題も改善することが可能になる。   By combining the second lightness and the first lightness to obtain the third lightness, and performing the gradation correction based on the third lightness, the problem of color saturation after the gradation correction is improved compared to the conventional case. Noise problems can be improved.

特に、請求項6の発明では、第3明度として、明るい箇所では第1明度を優先し、暗い箇所では第2明度を優先する。このような第3明度を基準にヒストグラム均等化を行うことにより、明るい箇所で発生しやすい飽和の問題を第1明度によって確実に改善しつつ、暗い箇所で目立ちやすいノイズ問題を第2明度によって確実に改善することが可能になる。このように明るさで問題を切り分けることにより、飽和とノイズの問題をどちらも適切に改善することが可能になる。   In particular, according to the sixth aspect of the present invention, as the third brightness, the first brightness is prioritized in a bright place and the second brightness is prioritized in a dark place. By performing histogram equalization based on the third lightness, the first lightness reliably improves the saturation problem that tends to occur in bright places, while the second lightness ensures that noise problems that are prominent in dark places are noticeable. It becomes possible to improve. By isolating the problem by brightness in this way, it is possible to appropriately improve both the saturation and noise problems.

《第1の実施形態》
[本実施形態の構成説明]
図1は、階調補正装置11の構成を説明するブロック図である。
この階調補正装置11は、ヒストグラム作成部12、第1特性作成部14、第2特性作成部13、特性合成部15、および階調補正部16を備えて概略構成される。
この内、ヒストグラム作成部12は、部分画像抽出部21、明度抽出部22、明度解析部23、および平滑化部24を備える。
また、第2特性作成部13は、平均輝度算出部31、およびガンマ決定部32を備える。
このような構成の階調補正装置11は、ハードウェアまたはソフトウェアによって実現して、電子カメラに搭載することが好ましい。
また、後述する処理フローを記述した階調補正プログラムを用いて、コンピュータを階調補正装置11として機能させることもできる。
<< First Embodiment >>
[Description of Configuration of this Embodiment]
FIG. 1 is a block diagram illustrating the configuration of the gradation correction device 11.
The tone correction device 11 is roughly configured to include a histogram creation unit 12, a first property creation unit 14, a second property creation unit 13, a property synthesis unit 15, and a tone correction unit 16.
Among these, the histogram creation unit 12 includes a partial image extraction unit 21, a lightness extraction unit 22, a lightness analysis unit 23, and a smoothing unit 24.
The second characteristic creation unit 13 includes an average luminance calculation unit 31 and a gamma determination unit 32.
The gradation correction device 11 having such a configuration is preferably realized by hardware or software and mounted on an electronic camera.
Further, it is possible to cause the computer to function as the gradation correction device 11 using a gradation correction program describing a processing flow described later.

[階調変換特性の作成動作]
図2は、階調補正装置11による階調変換特性の作成処理を説明する流れ図である。
以下、図2のステップ番号に沿って、階調変換特性の作成処理を説明する。
[Create gradation conversion characteristics]
FIG. 2 is a flowchart for explaining the gradation conversion characteristic creation processing by the gradation correction apparatus 11.
In the following, the process of creating gradation conversion characteristics will be described along the step numbers in FIG.

ステップS1: 階調補正装置11には、外部から原画像が入力される。この原画像の各画素は、RGB色成分のデータから構成される。まず、この原画像は、部分画像抽出部21に入力される。
部分画像抽出部21は、この原画像から明るさや肌色領域を識別したり、あるいは公知の顔識別方法を実施することにより、原画像の主な絵柄が、人物・風景のいずれであるかを判定する。
Step S1: An original image is input to the gradation correction device 11 from the outside. Each pixel of the original image is composed of RGB color component data. First, this original image is input to the partial image extraction unit 21.
The partial image extraction unit 21 determines whether the main pattern of the original image is a person or a landscape by identifying brightness or a skin color region from the original image or by performing a known face identification method. To do.

なお、電子カメラには、ユーザーが撮影対象に合わせて撮影モード(風景モードや人物モードなど)を適宜に切り替えるものが知られている。このような電子カメラで撮像された原画像については、電子カメラのシステムコントロール用のMPUから撮影モードの情報を取得することができる。また、原画像のデータファイル内から撮影モードの情報を取得することもできる。部分画像抽出部21は、この撮影モードから、原画像の主な絵柄が、人物・風景のいずれであるかを判定してもよい。   An electronic camera is known in which a user appropriately switches a shooting mode (landscape mode, portrait mode, etc.) according to a shooting target. With respect to the original image captured by such an electronic camera, information on the shooting mode can be acquired from the MPU for system control of the electronic camera. It is also possible to acquire shooting mode information from the data file of the original image. The partial image extraction unit 21 may determine whether the main pattern of the original image is a person or a landscape from this shooting mode.

ステップS2: 部分画像抽出部21は、原画像の主な絵柄が風景であると判定すると、ステップS3に動作を移行する。一方、部分画像抽出部21は、原画像の主な絵柄が人物であると判定すると、ステップS4に動作を移行する。 Step S2: When the partial image extraction unit 21 determines that the main pattern of the original image is a landscape, the operation proceeds to step S3. On the other hand, when the partial image extraction unit 21 determines that the main pattern of the original image is a person, the operation proceeds to step S4.

ステップS3: 主な絵柄が風景の場合、部分画像抽出部21は、後述するヒストグラムの母集団を、画面全域に設定する。設定後、部分画像抽出部21は、ステップS5に動作を移行する。 Step S3: When the main pattern is a landscape, the partial image extraction unit 21 sets a histogram population to be described later over the entire screen. After the setting, the partial image extraction unit 21 shifts the operation to step S5.

ステップS4: 主な絵柄が人物の場合、部分画像抽出部21は、後述するヒストグラムの母集団を、肌色領域や顔領域を含む部分画像に設定する。設定後、部分画像抽出部21は、ステップS5に動作を移行する。 Step S4: When the main design is a person, the partial image extraction unit 21 sets a histogram population to be described later as a partial image including a skin color area and a face area. After the setting, the partial image extraction unit 21 shifts the operation to step S5.

ステップS5: 明度抽出部22は、選択した母集団について、画素単位にRGB値の最大値を抽出し、明度Lとする。この場合、高速化のために、とびとびのサンプリングで明度Lを抽出することが好ましい。また、画像空間上で明度Lを局所加算することにより、明度Lのノイズを予め低減してもよい。 Step S5: The lightness extraction unit 22 extracts the maximum RGB value for each pixel of the selected population and sets it as lightness L. In this case, in order to increase the speed, it is preferable to extract the lightness L by repeated sampling. Further, the lightness L noise may be reduced in advance by locally adding the lightness L on the image space.

ステップS6: 明度解析部23は、抽出された明度Lについて出現度数を解析し、明度Lのヒストグラムを求める。図3(A)は、この明度のヒストグラムの様子を示す説明図である。 Step S6: The lightness analysis unit 23 analyzes the appearance frequency of the extracted lightness L and obtains a histogram of the lightness L. FIG. 3A is an explanatory diagram showing the state of the brightness histogram.

ステップS7: 平滑化部24は、ヒストグラムの分布形状を平滑化する。
このような平滑化としては、度数の移動平均(または移動加重平均)を求める処理が好ましい。また、度数のべき乗(0.5〜0.1乗など)を取るなどのソフトリミット的な平滑化処理も好ましい。さらに、移動平均とべき乗の両方を実施してもよい。
図3(B)は、平滑化後のヒストグラムの様子を示す説明図である。
Step S7: The smoothing unit 24 smoothes the distribution shape of the histogram.
As such smoothing, processing for obtaining a moving average (or moving weighted average) of frequencies is preferable. Further, a soft limit smoothing process such as taking a power of power (0.5 to 0.1 power, etc.) is also preferable. Further, both moving average and power may be performed.
FIG. 3B is an explanatory diagram showing the state of the histogram after smoothing.

ステップS8: 第1特性作成部14は、平滑化後のヒストグラムについて、低明度側から累積度数を求める。 Step S8: The first characteristic creation unit 14 obtains the cumulative frequency from the low brightness side for the smoothed histogram.

ステップS9: 第1特性作成部14は、累積度数の到達値が、階調補正後の出力階調レンジの最大値となるように累積度数を正規化し、第1階調変換特性を得る。
図3(C)に示す実線カーブは、第1階調変換特性の一例である。
Step S9: The first characteristic creating unit 14 obtains the first gradation conversion characteristic by normalizing the cumulative frequency so that the reached value of the cumulative frequency becomes the maximum value of the output gradation range after gradation correction.
The solid line curve shown in FIG. 3C is an example of the first gradation conversion characteristic.

ステップS10: 一方、平均輝度算出部31は、原画像の輝度を求めて平均し、平均輝度を求める。 Step S10: On the other hand, the average luminance calculation unit 31 calculates and averages the luminance of the original image to determine the average luminance.

ステップS11: ガンマ決定部32は、この平均輝度に基づいて、ガンマ変換(y=C(x−xo)a+yo)の調整パラメータa,xo,yoを決定する。
なお、このガンマ変換において階調飛びが許容範囲を超えて生じる場合には、ガンマ変換の変換カーブを制限する。このような制限手法としては、例えば、階調飛びが生じないように、変換カーブの一部を直線などで置き換えればよい。また例えば、階調飛びが生じないように(xo,yo)を設定して、変換カーブの原点をずらしてもよい。
Step S11: The gamma determination unit 32 determines adjustment parameters a, xo, and yo for gamma conversion (y = C (x−xo) a + yo) based on the average luminance.
In this gamma conversion, if the gradation skip occurs beyond the allowable range, the conversion curve of the gamma conversion is limited. As such a limiting method, for example, a part of the conversion curve may be replaced with a straight line or the like so that gradation skip does not occur. For example, the origin of the conversion curve may be shifted by setting (xo, yo) so that gradation skip does not occur.

また、平均輝度に対応して調整パラメータaを変更することにより、明るさ調整が実現できる。例えば、平均輝度が暗いほど、調整パラメータaを小さくすることが好ましい(例えばa=0.1〜0.3)。その結果、原画像の暗さを適度に補正することができる。
このように作成された第2階調変換特性は、第1階調変換特性の急峻な傾き部分を緩和する効果を持つが、それと同時に、原画像の明るさを補正する効果を持たせることができる。
なお、ガンマ変換の調整パラメータCについては、出力階調レンジの最大値に応じて算出すればよい。
このような調整パラメータの決定により、第2階調変換特性が得られる。
Further, brightness adjustment can be realized by changing the adjustment parameter a corresponding to the average luminance. For example, it is preferable to decrease the adjustment parameter a as the average brightness is darker (for example, a = 0.1 to 0.3). As a result, the darkness of the original image can be corrected appropriately.
The second gradation conversion characteristic created in this way has the effect of relaxing the steep slope portion of the first gradation conversion characteristic, and at the same time, it can have the effect of correcting the brightness of the original image. it can.
The adjustment parameter C for gamma conversion may be calculated according to the maximum value of the output gradation range.
By determining such adjustment parameters, the second gradation conversion characteristics can be obtained.

ステップS12: 特性合成部15は、ステップS9で求めた第1階調変換特性と、ステップS11で求めた第2階調変換特性とを加重合成し、合成済み階調変換特性を得る。作成された合成済み階調変換特性は、階調補正部16に設定される。
通常、この加重合成の比率(第1:第2)は、例えば、1:1とか、2:1などの所定比率に固定される。
Step S12: The characteristic synthesis unit 15 performs weighted synthesis of the first gradation conversion characteristic obtained in Step S9 and the second gradation conversion characteristic obtained in Step S11, and obtains a synthesized gradation conversion characteristic. The generated combined gradation conversion characteristic is set in the gradation correction unit 16.
Usually, the weighted composition ratio (first: second) is fixed to a predetermined ratio such as 1: 1 or 2: 1.

なお、ユーザーの好みに応じた微調整を可能にする場合、加重合成の比率をユーザーが設定入力できるよう、マニュアルスライドバーなどをユーザーに提示することが好ましい。この場合、ユーザーは、この加重合成の比率を変更することにより、画像の味の調整が可能になる。具体的には、紅葉の風景などはその印象を大きく変化させることができる。また、池の鯉などの絵柄では、水面反射の印象を大きく変化させ、あたかも偏光フィルタを着脱したかのような印象の変化を得ることができる。
図4は、このようにして得られる合成済み階調変換特性を示す図である。
When fine adjustment according to the user's preference is possible, it is preferable to present a manual slide bar or the like to the user so that the user can set and input the weighted composition ratio. In this case, the user can adjust the taste of the image by changing the weighted composition ratio. Specifically, the scenery of autumn leaves can greatly change the impression. Also, with a pattern such as a pond pond, the impression of water surface reflection can be greatly changed, and an impression can be obtained as if the polarizing filter was attached and detached.
FIG. 4 is a diagram showing the synthesized gradation conversion characteristics obtained in this way.

[階調補正の動作説明]
図5は、階調補正装置11による階調補正の動作を説明する図である。
以下、図5に示すステップ番号に沿って、階調補正の動作を説明する。
[Explanation of gradation correction operation]
FIG. 5 is a diagram for explaining the operation of gradation correction by the gradation correction apparatus 11.
Hereinafter, the operation of gradation correction will be described along the step numbers shown in FIG.

ステップS21: 階調補正部16は、階調補正の処理対象の画素を、原画像から選択する。この処理対象の画素について、画素を構成するRGB値の中から最大値を求めて、明度Lとする。 Step S21: The gradation correction unit 16 selects a pixel to be subjected to gradation correction from the original image. For the pixel to be processed, the maximum value is obtained from the RGB values constituting the pixel, and the brightness L is obtained.

ステップS22: 階調補正部16は、抽出した明度Lを、設定された階調変換特性(上述したケースでは、合成済み階調変換特性)に照合して、入出力階調の比を取得する。なお、『入力階調』と『入出力階調の比』とを対応付けた階調変換特性(式やルックアップテーブル)を用意することにより、比の計算処理を省略することが好ましい。 Step S22: The gradation correction unit 16 collates the extracted lightness L with the set gradation conversion characteristic (in the above-described case, the combined gradation conversion characteristic), and acquires the input / output gradation ratio. . Note that it is preferable to omit the ratio calculation process by preparing a gradation conversion characteristic (formula or look-up table) in which “input gradation” and “input / output gradation ratio” are associated with each other.

ステップS23: 階調補正部16は、取得した比を、処理対象の画素のRGB色成分にそれぞれ乗じて、階調補正済みのRGB色成分を得る。なお、ここでの乗算処理はテーブル参照などによって高速に実行することが好ましい。
このような処理を、原画像全体に実施することにより、階調補正の動作を完了する。なお、階調補正の完了後、必要に応じて彩度補正を実施してもよい。
なお、ステップS5,S21の明度抽出が重複しないようにすることで、処理時間を短縮してもよい。例えば、先に、原画像の全画素について明度Lを抽出して、明度画像として記憶しきおき、この明度画像から部分画像の明度Lを抽出して、ヒストグラムの母集団として使用してもよい。
Step S23: The gradation correction unit 16 multiplies the acquired ratio by the RGB color component of the pixel to be processed to obtain a gradation-corrected RGB color component. The multiplication processing here is preferably executed at high speed by referring to a table or the like.
By performing such processing on the entire original image, the gradation correction operation is completed. Note that saturation correction may be performed as necessary after completion of gradation correction.
Note that the processing time may be shortened by preventing the lightness extraction in steps S5 and S21 from overlapping. For example, the brightness L may be extracted first for all pixels of the original image and stored as a brightness image, and the brightness L of the partial image may be extracted from the brightness image and used as the population of the histogram.

[本実施形態の効果など]
上述したように、本実施形態では、明度Lのヒストグラムの確率密度の粗密を均等に近づける第1階調変換特性と、階調飛びが生じない第2階調変換特性とを加重合成する。このとき、第1階調変換特性の局所的な急峻すぎる傾きが、第2階調変換特性によって緩和される。その結果、明度ヒストグラムを均等化しつつ、急峻な明度変化を抑制した合成済み階調変換特性を作成することができる。さらに、第2の効果は、第2階調変換特性のガンマaを適当に定めることで、画像の明るさを適切にコントロール可能にした点である。
[Effects of this embodiment, etc.]
As described above, in the present embodiment, the first gradation conversion characteristics that make the probability density of the histogram of lightness L close to equal density and the second gradation conversion characteristics that do not cause gradation skip are weighted and combined. At this time, the local excessively steep inclination of the first gradation conversion characteristic is relieved by the second gradation conversion characteristic. As a result, it is possible to create a combined gradation conversion characteristic that suppresses a sharp change in brightness while equalizing the brightness histogram. Furthermore, the second effect is that the brightness of the image can be appropriately controlled by appropriately determining the gamma a of the second gradation conversion characteristic.

その上、本実施形態では、原画像の明度Lを基準として、合成済み階調変換特性の入出力階調の比を求め、この比を色成分に乗ずることで原画像を階調補正する。
図6(A)は、この明度を基準にした階調補正の効果を説明する図である。
この図において、明度L1を持つ画素の色(色座標空間上の位置)は、明度L1の色立体の表面に位置する。本実施形態では、階調補正において、処理対象の画素の明度L1を合成済み階調変換特性に参照して入出力階調比(L2/L1)を求め、この比を処理対象の画素のRGB色成分に乗じる。この場合、図6(A)に示すように、色座標空間のRGB色成分は、色立体表面に乗ったまま移動するため、最大の色立体Mを決してはみ出すことがない。すなわち、階調補正によって特定の色成分が飽和して不自然な色が生じるなどの弊害が起きない。
In addition, in the present embodiment, the ratio of input / output gradations of the combined gradation conversion characteristics is obtained based on the lightness L of the original image, and the original image is subjected to gradation correction by multiplying this ratio by the color component.
FIG. 6A is a diagram for explaining the effect of gradation correction based on this lightness.
In this figure, the color of the pixel having the lightness L1 (position on the color coordinate space) is located on the surface of the color solid having the lightness L1. In the present embodiment, in the gradation correction, the input / output gradation ratio (L2 / L1) is obtained by referring to the lightness L1 of the processing target pixel to the combined gradation conversion characteristics, and this ratio is calculated as RGB of the processing target pixel. Multiply by color component. In this case, as shown in FIG. 6A, the RGB color components in the color coordinate space move on the surface of the color solid, so that the maximum color solid M never protrudes. That is, there is no adverse effect such as generation of an unnatural color due to saturation of a specific color component by gradation correction.

ちなみに、図6(B)に、本実施形態の比較対象として、色成分の線形結合P1,P2を基準に階調補正を行うケースを示す。ここでの線形結合は、例えば、RGB色成分の所定比の線形結合[P=αR+βG+(1−α−β)B]などである。
この場合、処理対象の画素の線形結合P1を階調変換特性に参照して入出力階調比(P2/P1)を求め、この比を処理対象の画素のRGB色成分に乗じる。すると、図6(B)に示すように、色座標空間のベクトルが最大の色立体Mを超える可能性が生じる。その結果、特定の色成分(この場合はR成分)がレンジオーバーし、高輝度箇所に特定色の飽和による不自然な色が出現してしまう。一方、本実施形態では、上述のように、このような飽和は発生しない。
Incidentally, FIG. 6B shows a case where gradation correction is performed on the basis of linear combination P1 and P2 of color components as a comparison target of the present embodiment. The linear combination here is, for example, a linear combination [P = αR + βG + (1−α−β) B] with a predetermined ratio of RGB color components.
In this case, an input / output tone ratio (P2 / P1) is obtained by referring to the linear combination P1 of the pixels to be processed to the tone conversion characteristics, and this ratio is multiplied by the RGB color component of the pixel to be processed. Then, as shown in FIG. 6B, there is a possibility that the vector in the color coordinate space exceeds the maximum color solid M. As a result, the specific color component (in this case, the R component) exceeds the range, and an unnatural color due to saturation of the specific color appears in a high-luminance portion. On the other hand, in the present embodiment, as described above, such saturation does not occur.

また、本実施形態の第2階調変換特性は、主としてべき乗カーブからなる。このべき乗カーブは、形状が滑らかに変化するため、ヒストグラム均等化に見られるような局所的な急峻すぎる傾き変化は発生しない。したがって、本実施形態の第2階調変換特性は、ヒストグラム均等化の弊害を緩和する上で、好適な特性である。
なお、第2階調変換特性は、このべき乗関数に限定されない。例えば、第2階調変換特性としては、局所的な傾き変化の少ない単調増加型(ただし、傾きゼロの領域があってもよい)の特性であることが好ましい。また例えば、第2階調変換特性としては、べき乗カーブや、S字状カーブや、ベジエ曲線のカーブなどが好ましい。
In addition, the second gradation conversion characteristic of the present embodiment mainly includes a power curve. Since the shape of the power curve changes smoothly, a local excessively steep inclination change as seen in histogram equalization does not occur. Therefore, the second gradation conversion characteristic of the present embodiment is a preferable characteristic for alleviating the negative effects of histogram equalization.
The second tone conversion characteristic is not limited to this power function. For example, the second gradation conversion characteristic is preferably a monotonically increasing type characteristic (where there may be an area with zero inclination) with little local inclination change. For example, as the second gradation conversion characteristic, a power curve, an S-shaped curve, a Bezier curve, or the like is preferable.

さらに、本実施形態では、ヒストグラムの母集団を状況に応じて画像の部分範囲に限定する。このように母集団を限定することにより、原画像の一部に生じる極端な階調偏りがヒストグラムに現れる可能性が一段と低くなる。その結果、ヒストグラム均等化における局所的な傾き急変による弊害を改善することができる。
また、本実施形態では、肌色に該当する明るさや色を特徴判別して、主要被写体である人物を含む部分範囲を、ヒストグラムの母集団としている。その結果、人物の肌部分におけるヒストグラムの偏りを的確に検出できる。また、この肌部分のヒストグラムの偏りを、予め設定される肌部分として好ましいヒストグラム分布に補正するように、階調変換特性を作成することができる。その結果、肌部分以外の箇所の影響を受けずに、良好な階調変換特性を作成できる。(例えば、晴天下の暗い影部分などを、肌部分以外の影響を受けずに、適切に明るく補正することが可能となり、暗部潰れの少ないポートレート画像を得ることができる。)
Furthermore, in this embodiment, the population of the histogram is limited to a partial range of the image according to the situation. By limiting the population in this way, the possibility of an extreme gradation deviation occurring in a part of the original image appearing in the histogram is further reduced. As a result, it is possible to improve an adverse effect caused by a local sudden change in inclination in histogram equalization.
In the present embodiment, the brightness and color corresponding to the skin color are characterized and the partial range including the person who is the main subject is used as the histogram population. As a result, it is possible to accurately detect the histogram bias in the skin portion of the person. Further, the gradation conversion characteristic can be created so that the bias of the histogram of the skin portion is corrected to a histogram distribution that is preferable as a preset skin portion. As a result, good gradation conversion characteristics can be created without being affected by a portion other than the skin portion. (For example, it is possible to appropriately brighten a dark shadow portion or the like under a clear sky without being affected by other than the skin portion, and a portrait image with less dark portion crushing can be obtained.)

なお、ヒストグラムの母集団を範囲限定するに際して、部分画像抽出部21が次のような処理(1)〜(3)を行ってもよい。
(1)まず、原画像をマルチエリアに分割し、個々の分割エリアごとに輝度(または色成分)と、全エリアの最大輝度(または最大色成分)との差をパラメータにして求める。
(2)一方、部分画像抽出部21には、このパラメータと、最適な分割エリア(複数の分割エリアの組み合わせでもよい)との対応関係が、予め記憶されている。この対応関係は、多数の実写結果に基づいて用意されたものである。
(3)部分画像抽出部21は、原画像から求めたパラメータを、この対応関係に参照することにより、最適な分割エリア(あるいは分割エリアの優先順に従った重み付け)を決定する。このような範囲設定では、逆光撮影などの状況において、最適な分割エリアを設定することが可能となり、ヒストグラム均等化の弊害を一段と防止できる。
Note that, when the range of the histogram population is limited, the partial image extraction unit 21 may perform the following processes (1) to (3).
(1) First, an original image is divided into multi-areas, and the difference between the luminance (or color component) and the maximum luminance (or maximum color component) of all areas is obtained as a parameter for each divided area.
(2) On the other hand, the partial image extraction unit 21 stores in advance a correspondence relationship between this parameter and an optimal divided area (which may be a combination of a plurality of divided areas). This correspondence is prepared on the basis of a large number of actual shooting results.
(3) The partial image extraction unit 21 determines an optimum divided area (or weighting according to the priority order of the divided areas) by referring to the correspondence obtained with the parameter obtained from the original image. With such a range setting, it is possible to set an optimal divided area in situations such as backlighting, and the adverse effects of histogram equalization can be further prevented.

また、撮影意図を撮影モードやユーザー入力などから判定できれば、この撮影意図に応じて、ヒストグラムの母集団を限定する手法を柔軟に変更してもよい。例えば、紅葉撮影モードであれば、紅葉に該当する赤や黄色や明るさの領域を識別して母集団を限定すればよい。   Further, if the photographing intention can be determined from the photographing mode or user input, the method for limiting the histogram population may be flexibly changed according to the photographing intention. For example, in the autumn leaves photographing mode, the population may be limited by identifying red, yellow, or brightness areas corresponding to autumn leaves.

さらに、本実施形態では、原画像の平均輝度に応じて、第2階調変換特性を変更する。したがって、最終的な合成済み階調変換特性を、原画像の明るさを適度に補正する方向にシフトすることが可能となる。その結果、ヒストグラム均等化という機械的な階調補正に対して、原画像の明るさを適度にするという調整要素を加味することが可能になる。その結果、ベテランの画像処理者でなければ従来作成できなかった複数の調整要素を考慮した階調変換特性が、簡単なアルゴリズムで作成できる。   Furthermore, in the present embodiment, the second gradation conversion characteristic is changed according to the average luminance of the original image. Therefore, it is possible to shift the final combined gradation conversion characteristic in a direction in which the brightness of the original image is appropriately corrected. As a result, it is possible to add an adjustment factor for making the brightness of the original image moderate to the mechanical gradation correction called histogram equalization. As a result, tone conversion characteristics that take into account a plurality of adjustment factors that could not be created by an experienced image processor can be created with a simple algorithm.

その上、原画像の平均輝度(好ましくは分割エリアごとの平均輝度)から、夜景撮影、星夜撮影、または花火撮影であることを認識することもできる。この場合は、暗部を必要以上に明るく補正しないように、第2階調変換特性を制限することもできる。この場合、ヒストグラム均等化において不自然に明るく補正されていた夜景画像などを、夜景の印象を大切に維持して階調補正することが可能になる。   In addition, it can be recognized from the average luminance of the original image (preferably the average luminance for each divided area) that the night scene shooting, starry night shooting, or fireworks shooting. In this case, the second gradation conversion characteristic can be limited so that the dark part is not corrected brighter than necessary. In this case, it is possible to perform tone correction of a night scene image or the like that has been corrected unnaturally in histogram equalization while preserving the impression of the night scene.

さらに、本実施形態では、ヒストグラムの分布形状を平滑化する。この平滑化処理により、ヒストグラムの極端な起伏がなだらかに抑制される。その結果、ヒストグラムの極端な度数変化が小さくなり、ヒストグラム均等化の特性曲線に局所的に現れる急峻な傾きを効果的に抑制することが可能になる。このような作用により、図3(C)に示すように、局所的な傾き変化を抑制した第1階調変換特性を作成できる。
ちなみに、図3(C)には、比較対象として、従来のヒストグラム均等化で求めた変換特性と、従来の上限リミットで求めた変換特性とを併せて示す。これら従来の変換特性に比べて、本実施形態の第1階調変換特性は、局所的な傾き変化が少なく、良好な階調変換特性が得られている。
特に、ヒストグラムの平滑化により、欠落階調域とそれ以外の階調域(出現度数が中程度の領域も含む)との度数差が小さくなり、ヒストグラム均等化における欠落階調域の弊害を改善することもできる。
なお、移動平均(または移動加重平均)のように、欠落階調域を周囲の度数値によって埋めるような平滑化が特に好ましい。このような平滑化では、ヒストグラム分布上において、大きな度数の山部分を引き下げるだけではなく、低い度数の谷部分をバランス良く持ち上げる効果がある。その結果、ヒストグラム均等化の特性曲線の急峻な傾き箇所を抑制しつつ、その抑制した分を特性曲線の緩い傾き箇所にバランス良く配分できる。このような傾き配分の効果により、特性曲線上において、局所的に急峻な箇所が新たに生じることがない。
また、移動平均では、欠落階調域を根本的に除去したり、欠落階調域の幅を狭めたり、欠落階調域とその隣接域との度数変化をなだらかに連続させることができる。その結果、欠落階調域に起因する従来の弊害の多くを確実に改善できる。
Furthermore, in this embodiment, the distribution shape of the histogram is smoothed. By this smoothing process, extreme undulations in the histogram are gently suppressed. As a result, the extreme frequency change of the histogram is reduced, and it is possible to effectively suppress the steep slope that appears locally in the histogram equalization characteristic curve. By such an operation, as shown in FIG. 3C, the first gradation conversion characteristic in which the local inclination change is suppressed can be created.
Incidentally, FIG. 3C shows, as comparison objects, the conversion characteristics obtained by the conventional histogram equalization and the conversion characteristics obtained by the conventional upper limit. Compared to these conventional conversion characteristics, the first gradation conversion characteristics of the present embodiment have a small local inclination change and good gradation conversion characteristics.
In particular, the smoothing of the histogram reduces the frequency difference between the missing gradation area and other gradation areas (including areas with a moderate appearance frequency), improving the negative effects of the missing gradation area in histogram equalization. You can also
It should be noted that smoothing such as moving average (or moving weighted average) that fills the missing gradation area with surrounding frequency values is particularly preferable. Such smoothing not only lowers the large frequency peak portion on the histogram distribution but also has an effect of lifting the low frequency valley portion in a well-balanced manner. As a result, while suppressing the steep slope portion of the characteristic curve for histogram equalization, the suppressed portion can be distributed in a well-balanced manner to the gentle slope portion of the characteristic curve. As a result of such an inclination distribution effect, a locally steep spot does not occur on the characteristic curve.
Further, in the moving average, the missing gradation area can be fundamentally removed, the width of the missing gradation area can be narrowed, and the frequency change between the missing gradation area and its adjacent area can be continued smoothly. As a result, it is possible to reliably improve many of the conventional problems caused by the missing gradation area.

なお、特許文献1の上限リミットはハードリミットであり、本実施形態の平滑化と明確に異なる。つまり、上限リミットでは、欠落階調域とは殆ど無関係なヒストグラム分布のピーク部分を局所的にカットする機能しかない。したがって、特許文献1の上限リミットでは、上述した本実施形態の作用効果を達成できない。   Note that the upper limit of Patent Document 1 is a hard limit, which is clearly different from the smoothing of the present embodiment. In other words, the upper limit has only a function of locally cutting the peak portion of the histogram distribution almost unrelated to the missing gradation area. Therefore, the upper limit of Patent Document 1 cannot achieve the above-described effects of the present embodiment.

なお、本実施形態では、この第1階調変換特性を、第2階調変換特性と加重合成している。しかしながら、これに限定されず、平滑化後のヒストグラムを用いて求めた第1階調変換特性をそのまま使って、階調補正を実施しても勿論よい。この場合も、従来の弊害を改善した階調補正結果を得ることが十分可能である。   In the present embodiment, this first gradation conversion characteristic is weighted and combined with the second gradation conversion characteristic. However, the present invention is not limited to this, and the tone correction may be performed using the first tone conversion characteristic obtained using the smoothed histogram as it is. In this case as well, it is possible to obtain a gradation correction result with improved conventional problems.

また、従来のヒストグラム均等化により第1階調変換特性を作成し、第2階調変換特性と加重合成してもよい。この場合も、従来の弊害を改善した階調補正結果を得ることが十分可能である。
次に、別の実施形態について説明する。
Alternatively, the first gradation conversion characteristic may be created by conventional histogram equalization and weighted with the second gradation conversion characteristic. In this case as well, it is possible to obtain a gradation correction result with improved conventional problems.
Next, another embodiment will be described.

《第2の実施形態》
図7は、第2の実施形態における階調補正装置40の構成を説明する図である。なお、この階調補正装置40は、ハードウェアにより実現してもよい。また、階調補正プログラムにより、コンピュータを階調補正装置して機能させてもよい。
第2の実施形態における構成上の特徴は、第1の実施形態の特性合成部15に代えて、曲線近似部45を配置した点である。なお、第1の実施形態(図1)と同じ構成要件について、図7に同じ参照符号を図示し、ここでの重複説明を省略する。
<< Second Embodiment >>
FIG. 7 is a diagram illustrating the configuration of the gradation correction device 40 according to the second embodiment. The gradation correction device 40 may be realized by hardware. Further, the computer may be caused to function as a gradation correction device by a gradation correction program.
A structural feature of the second embodiment is that a curve approximation unit 45 is arranged in place of the characteristic synthesis unit 15 of the first embodiment. In addition, about the same component as 1st Embodiment (FIG. 1), the same referential mark is shown in FIG. 7, and duplication description here is abbreviate | omitted.

図8は、第2の実施形態における階調変換特性の作成処理を示す流れ図である。
図8において、ステップS1〜S9の動作については、第1の実施形態(図2)と同一動作であるため、ここでの重複説明を省略する。
第2の実施形態における動作上の特徴点は、ステップS30である。すなわち、ヒストグラム均等化あるいはその変形手法で得られた階調変換特性(ここでは第1階調変換特性)を、曲線関数で近似して近似階調変換特性を求める。近似手法としては、最小二乗法などが好ましい。
FIG. 8 is a flowchart showing a process of creating gradation conversion characteristics in the second embodiment.
In FIG. 8, the operations in steps S1 to S9 are the same as those in the first embodiment (FIG. 2), and thus redundant description is omitted here.
The operational feature in the second embodiment is step S30. That is, the approximate gradation conversion characteristic is obtained by approximating the gradation conversion characteristic (here, the first gradation conversion characteristic) obtained by the equalization of the histogram or its modification method with a curve function. As an approximation method, the least square method or the like is preferable.

この場合の曲線関数としては、局所的な傾き変化の少ない単調増加型(ただし、傾きゼロの領域があってもよい)の曲線関数であることが好ましい。例えば、べき乗関数や、S字状カーブの関数や、ベジエ曲線などが好ましい。また例えば、曲線関数については、階調飛びを防止するなどの理由から、曲線の一部を直線に置き換えることが好ましい。
また、複数の曲線関数を用いてそれぞれに曲線近似を行い、近似誤差の一番小さいものを選択してもよい。あるいは、階調変換特性から複数点をサンプルし、これら複数点の大小関係に合致する曲線関数を選択して、曲線近似を実施してもよい。
The curve function in this case is preferably a monotonically increasing type curve function with little local inclination change (however, there may be an area with zero inclination). For example, a power function, an S-shaped curve function, a Bezier curve, or the like is preferable. For example, for a curve function, it is preferable to replace a part of the curve with a straight line in order to prevent gradation skipping.
Alternatively, curve approximation may be performed for each using a plurality of curve functions, and the one with the smallest approximation error may be selected. Alternatively, curve approximation may be performed by sampling a plurality of points from the gradation conversion characteristics and selecting a curve function that matches the magnitude relationship between these points.

近似階調変換特性では、このような曲線近似の作用により、図9に示すように、ヒストグラム均等化の全体傾向を反映しつつも、局所的な傾き変化が効果的に除去される。その結果、ヒストグラム均等化に特有な不自然な階調補正を抑えつつ、階調の偏りの全体傾向を良好に階調補正することが可能になる。
この近似階調変換特性では、欠落階調域や急峻な傾きに起因する従来の弊害の多くが改善されている。特に、階調補正の特性曲線が局所的に歪んで生じる『階調段差(偽輪郭)』や『階調差の欠落』を適切に低減することができる。
In the approximate tone conversion characteristic, the local inclination change is effectively removed by reflecting the overall tendency of the histogram equalization as shown in FIG. As a result, it is possible to satisfactorily perform tone correction on the overall tendency of tone bias while suppressing unnatural tone correction unique to histogram equalization.
In this approximate gradation conversion characteristic, many of the conventional problems due to the missing gradation area and the steep slope are improved. In particular, it is possible to appropriately reduce “gradation steps (false contours)” and “missing gradation differences” that are generated by locally distorting the gradation correction characteristic curve.

なお、このように求めた近似階調変換特性と、上述した第2階調変換特性とを加重合成することにより、合成済み階調変換特性を作成してもよい。この場合は、第2階調変換特性を調整変更することによって、階調補正の様々な要望を柔軟に加味できる。   Note that the synthesized gradation conversion characteristic may be created by performing weighted combination of the approximate gradation conversion characteristic thus obtained and the above-described second gradation conversion characteristic. In this case, various requests for tone correction can be flexibly added by adjusting and changing the second tone conversion characteristics.

また、従来のヒストグラム均等化によって作成した階調変換特性を曲線近似することによって、近似階調変換特性を作成してもよい。この場合も、従来の弊害を改善した階調補正結果を得ることが十分可能である。   Further, the approximate gradation conversion characteristic may be created by approximating the gradation conversion characteristic created by the conventional histogram equalization to a curve. In this case as well, it is possible to obtain a gradation correction result with improved conventional problems.

《第3の実施形態》
第3実施形態の特徴は、上述した実施形態の明度Lの代わりに、図10に示す作成手順で作成される第3明度を使用する点である。なお、第3明度の使用法については、上述した実施形態の明度Lと同じであるため、ここでの説明を省略する。
以下、図10を用いて、この第3明度の作成手順について説明する。
<< Third Embodiment >>
A feature of the third embodiment is that the third lightness created by the creation procedure shown in FIG. 10 is used instead of the lightness L of the above-described embodiment. In addition, about the usage method of 3rd brightness, since it is the same as the brightness L of embodiment mentioned above, description here is abbreviate | omitted.
Hereinafter, the procedure for creating the third brightness will be described with reference to FIG.

ステップS41: 画素単位に原画像のRGB色成分から最大値を求め、第1明度Lとする。
ちなみに、上述した実施形態の明度Lを、第1明度Lとしてそのまま使用すればよい。
Step S41: The maximum value is obtained from the RGB color components of the original image for each pixel, and the first brightness L is obtained.
Incidentally, the lightness L of the above-described embodiment may be used as it is as the first lightness L.

ステップS42: 画素単位に原画像のRGB色成分を下式に従って加重加算し、第2明度Pとする。
P=αR+βG+(1−α−β)B
上式の加重比率については、1:1:1でも1:2:1でもよいし、輝度Yの加重比率(3:6:1など)に一致させてもよい。
Step S42: The RGB color components of the original image are weighted and added in units of pixels according to the following formula to obtain the second brightness P.
P = αR + βG + (1-α-β) B
The weighting ratio of the above formula may be 1: 1: 1 or 1: 2: 1, or may be matched with the weighting ratio of luminance Y (such as 3: 6: 1).

また例えば、ノイズ量の多い色成分ほど、上式の加重比率を小さくすることにより、ノイズの影響を軽減することも好ましい。
なお、ここで加重加算するのは色成分に関する量であればよく、例えば、色成分を線形変換して求めた量でもよいし、色成分をガンマ補正した量でもよい。
また、処理高速化のため、画面上でとびとびにサンプリングした位置について、第2明度Pを求めてもよい。
In addition, for example, it is also preferable to reduce the influence of noise by reducing the weighting ratio of the above equation for a color component with a large amount of noise.
Here, the weighted addition may be an amount related to the color component, for example, an amount obtained by linearly converting the color component, or an amount obtained by performing gamma correction on the color component.
Further, the second brightness P may be obtained for the positions sampled on the screen in order to increase the processing speed.

ステップS43: 画素単位に、第1明度Lと第2明度Pとを合成して、第3明度Mを求める。この場合、暗い箇所ほど、第3明度Mに含まれる第2明度Pの割合を大きくすることが好ましい。例えば、下式により、このような要件を満足する第3明度Mを生成することができる。
M=S・L+(1−S)・P
あるいは、
M=(1+S)・L/2+(1−S)・P/2
ただし、加重比率Sは、対象画素の明るさの評価値であればよい。例えば、Sとしては、第1明度L、第2明度M,またはこれらの平均値や合成値などを、数値範囲0〜1に正規化して使用すればよい。
Step S43: The first lightness L and the second lightness P are synthesized for each pixel to obtain the third lightness M. In this case, it is preferable to increase the ratio of the second lightness P included in the third lightness M in darker places. For example, the third brightness M satisfying such a requirement can be generated by the following expression.
M = S · L + (1−S) · P
Or
M = (1 + S) .L / 2 + (1-S) .P / 2
However, the weight ratio S may be an evaluation value of the brightness of the target pixel. For example, as S, the first lightness L, the second lightness M, or an average value or a composite value thereof may be normalized to the numerical range 0 to 1 and used.

また、このような正規化済みの明るさ評価値に対してべき乗を取るなどして、加重比率Sを非線形化してもよい。このような加重比率Sの非線形化により、ノイズが問題となる暗い箇所において、第3明度Mに含まれる第2明度Pの割合を非線形に大きくすることが可能になる。
この場合、0≦w(S)≦1に規格化された重み関数w(S)として、
M=w(S)・L+(1−w(S))・P
あるいは、
M=(1+w(S))・L/2+(1−w(S))・P/2
となる。
Further, the weight ratio S may be made non-linear by taking a power to such a normalized brightness evaluation value. By making the weighting ratio S non-linear, it becomes possible to increase the ratio of the second lightness P included in the third lightness M in a non-linear manner in a dark place where noise is a problem.
In this case, as a weighting function w (S) normalized to 0 ≦ w (S) ≦ 1,
M = w (S) * L + (1-w (S)) * P
Or
M = (1 + w (S)) * L / 2 + (1-w (S)) * P / 2
It becomes.

また例えば、加重比率Sを折れ線化することによって、ノイズが問題となる程度に暗い箇所において、第3明度Mとして第2明度Pをそのまま選択し、色成分の飽和が問題となる程度に明るい箇所で、第3明度Mとして第1明度Lをそのまま選択することもできる。   Further, for example, when the weight ratio S is changed into a polygonal line, the second lightness P is selected as the third lightness M as it is in a dark place where noise is a problem, and the light component is bright enough to cause color component saturation Thus, the first lightness L can be selected as it is as the third lightness M.

上述した第1および第2の実施形態において、明度Lの代わりに、この第3明度Mを採用した場合、階調補正におけるノイズおよび飽和の問題を、その箇所の明るさに応じて、臨機応変に改善することが可能になる。   In the first and second embodiments described above, when the third lightness M is employed instead of the lightness L, noise and saturation problems in gradation correction can be changed flexibly according to the brightness of the portion. It becomes possible to improve.

《実施形態の補足事項》
なお、本発明の階調補正は、画素値の再量子化(12ビットを8ビットに変換など)と合わせて実施しても勿論よい。このとき、明度を基準にしない階調補正であれば、階調変換特性のデータテーブルの出力値に、再量子化後の値を予め設定しておけばよい。また、明度を基準にした階調補正では、入出力階調の比と色成分との乗算処理に際して再量子化を実施することが好ましい。すなわち、この乗算処理に使用する乗算用データテーブルの出力値に、再量子化後の値を設定すればよい。このような処理により、本発明において、階調補正および再量子化という複数処理を一緒に実行することが可能になる。
<< Additional items of embodiment >>
It should be noted that the gradation correction according to the present invention may of course be performed in combination with requantization of pixel values (such as conversion of 12 bits to 8 bits). At this time, if the gradation correction is not based on lightness, a value after re-quantization may be set in advance as the output value of the data table of gradation conversion characteristics. In gradation correction based on lightness, it is preferable to perform requantization when multiplying the input / output gradation ratio by the color component. That is, the value after requantization may be set as the output value of the multiplication data table used for the multiplication process. By such processing, in the present invention, it is possible to execute a plurality of processings of gradation correction and requantization together.

また、上述した実施形態では、RGB色成分を階調補正するケースについて説明した。しかしながら、本発明はこれに限定されるものではない。例えば、補色成分やYCbCr成分などの色成分(本発明ではYも色成分の一つとする)について階調補正する場合に、本発明を適用することも勿論可能である。   In the above-described embodiment, the case where the gradation correction is performed on the RGB color components has been described. However, the present invention is not limited to this. For example, it is of course possible to apply the present invention when tone correction is performed for a color component such as a complementary color component or a YCbCr component (Y is also a color component in the present invention).

なお、上述した実施形態では、人物/風景を識別して、ヒストグラムの母集団を切り換えている。しかしながら、このような母集団の切り換え処理については省略してもかまわない。また、常に一定範囲(中央の画面1/4など)を、ヒストグラムの母集団に設定してもよい。また例えば、撮影時の焦点検出エリアや、画像圧縮時のROI(関心領域)の情報を情報取得できる場合には、その領域付近を、ヒストグラムの母集団に選択してもよい。   In the above-described embodiment, a person / landscape is identified, and the histogram population is switched. However, such a population switching process may be omitted. Also, a certain range (such as the center screen 1/4) may always be set in the histogram population. Further, for example, when information on a focus detection area at the time of photographing or ROI (region of interest) at the time of image compression can be acquired, the vicinity of the region may be selected as the population of the histogram.

また、上述した実施形態では、各画素から色成分の最大値を抽出して明度Lとし、その明度を基準にしてヒストグラム均等化の階調補正を実施している。しかしながら、本発明はこれに限定されるものではない。例えば、この明度Lの代わりに、輝度Yや特定の色成分(例えばG色成分)などを基準に使用して、ヒストグラム均等化の階調補正を実施してもよい。このような輝度Yなどを基準としたヒストグラム均等化においても、上述した実施形態(第1階調変換特性と第2階調変換特性の合成など)は、局所的に急峻な階調変化を軽減できるなどの効果がある。   Further, in the above-described embodiment, the maximum value of the color component is extracted from each pixel to obtain the lightness L, and gradation equalization for histogram equalization is performed based on the lightness. However, the present invention is not limited to this. For example, instead of the lightness L, gradation correction for histogram equalization may be performed using luminance Y or a specific color component (for example, G color component) as a reference. Even in the histogram equalization based on the luminance Y or the like, the above-described embodiment (combination of the first gradation conversion characteristic and the second gradation conversion characteristic, etc.) reduces locally steep gradation changes. There are effects such as being able to.

以上説明したように、本発明は、画像の階調補正を行う産業分野で利用可能な発明である。   As described above, the present invention is an invention that can be used in the industrial field for performing gradation correction of an image.

階調補正装置11の構成を説明するブロック図である。2 is a block diagram illustrating a configuration of a gradation correction device 11. FIG. 階調変換特性の作成動作を説明する流れ図である。It is a flowchart explaining the production | generation operation | movement of a gradation conversion characteristic. ヒストグラムを平滑化した後、ヒストグラム均等化を実施する動作を説明する図である。It is a figure explaining the operation | movement which implements equalization of a histogram, after smoothing a histogram. 合成済み階調変換特性を示す図である。It is a figure which shows the synthetic | combination gradation conversion characteristic. 階調補正の動作を説明する図である。It is a figure explaining the operation | movement of gradation correction | amendment. 明度に基づく階調補正を説明する図である。It is a figure explaining the gradation correction based on brightness. 階調補正装置40の構成を説明する図である。3 is a diagram illustrating a configuration of a gradation correction device 40. FIG. 階調変換特性の作成処理を示す流れ図である。It is a flowchart which shows the preparation process of a gradation conversion characteristic. 近似階調変換特性を示す図である。It is a figure which shows an approximate gradation conversion characteristic. 明度の作成例を示す流れ図である。It is a flowchart which shows the example of creation of a brightness.

符号の説明Explanation of symbols

11 階調補正装置
12 ヒストグラム作成部
13 第2特性作成部
14 第1特性作成部
15 特性合成部
16 階調補正部
21 部分画像抽出部
22 明度抽出部
23 明度解析部
24 平滑化部
31 平均輝度算出部
32 ガンマ決定部
40 階調補正装置
45 曲線近似部
DESCRIPTION OF SYMBOLS 11 Gradation correction apparatus 12 Histogram creation part 13 2nd characteristic creation part 14 1st characteristic creation part 15 Characteristic composition part 16 Gradation correction part 21 Partial image extraction part 22 Brightness extraction part 23 Brightness analysis part 24 Smoothing part 31 Average brightness | luminance Calculation unit 32 Gamma determination unit 40 Gradation correction device 45 Curve approximation unit

Claims (7)

原画像の階調を変換する階調補正装置であって、
前記原画像の明度(色の濃さおよび明るさを総合的に表す値)についてヒストグラムを作成するヒストグラム作成部と、
前記ヒストグラムの確率密度の粗密を均等に近づける第1階調変換特性を求める第1特性作成部と、
階調飛びが生じない階調変化に制限した第2階調変換特性を出力する第2特性作成部と、
前記第1階調変換特性および前記第2階調変換特性を加重合成して、合成済み階調変換特性を作成する特性合成部と、
前記原画像を構成する画素単位に、前記明度を前記合成済み階調変換特性に照合して入出力階調の比を求め、前記比を前記原画像の色成分に乗じることにより、前記原画像を階調補正する階調補正部と
を備えたことを特徴とする階調補正装置。
A gradation correction device for converting the gradation of an original image,
A histogram creating unit that creates a histogram for the brightness of the original image (a value that comprehensively represents color intensity and brightness);
A first characteristic creating unit that obtains a first gradation conversion characteristic that uniformly approximates the density of probability density of the histogram;
A second characteristic creation unit that outputs a second gradation conversion characteristic limited to gradation changes that do not cause gradation skip;
A characteristic synthesizer that weights and synthesizes the first gradation conversion characteristic and the second gradation conversion characteristic to create a combined gradation conversion characteristic;
For each pixel constituting the original image, the lightness is compared with the combined gradation conversion characteristic to obtain an input / output gradation ratio, and the ratio is multiplied by a color component of the original image. A gradation correction apparatus comprising: a gradation correction unit that performs gradation correction on the image.
請求項1に記載の階調補正装置において、
前記ヒストグラム作成部は、
前記原画像から部分画像を抽出し、前記部分画像から前記ヒストグラムを作成する
ことを特徴とする階調補正装置。
The gradation correction apparatus according to claim 1,
The histogram creation unit
A gradation correction apparatus that extracts a partial image from the original image and creates the histogram from the partial image.
請求項2に記載の階調補正装置において、
前記ヒストグラム作成部は、
前記原画像の明るさ、色、および『顔判別などの被写体判別』の少なくとも一つの特徴判別に基づいて前記部分画像の領域を決定する
ことを特徴とする階調補正装置。
The gradation correction apparatus according to claim 2,
The histogram creation unit
A gradation correction apparatus that determines the area of the partial image based on at least one feature discrimination of brightness, color of the original image, and “subject discrimination such as face discrimination”.
請求項1ないし請求項3のいずれか1項に記載の階調補正装置において、
前記第2特性作成部は、
前記原画像の平均輝度に応じて、前記第2階調変換特性を調整変更する
ことを特徴とする階調補正装置。
The gradation correction device according to any one of claims 1 to 3,
The second characteristic creating unit
The gradation correction apparatus according to claim 1, wherein the second gradation conversion characteristic is adjusted and changed according to an average luminance of the original image.
原画像の階調を変換する階調補正装置であって、
前記原画像から第1明度(色の濃さおよび明るさを総合的に表す値)を抽出する第1明度抽出部と、
前記原画像を構成する色成分に関する量を加重加算して第2明度を抽出する第2明度抽出部と、
前記第1明度および前記第2明度を合成して、第3明度を求める明度合成部と、
前記原画像を構成する画素単位に、前記第3明度をパラメータとして入出力階調の比を求め、前記比を色成分に乗じることにより、前記原画像を階調補正する階調補正部と
を備えたことを特徴とする階調補正装置。
A gradation correction device for converting the gradation of an original image,
A first lightness extraction unit that extracts first lightness (a value that comprehensively represents color intensity and lightness) from the original image;
A second lightness extraction unit for extracting a second lightness by weighted addition of an amount related to a color component constituting the original image;
A lightness composition unit for combining the first lightness and the second lightness to obtain a third lightness;
A gradation correction unit that performs gradation correction on the original image by obtaining a ratio of input / output gradations for each pixel constituting the original image using the third brightness as a parameter and multiplying the ratio by a color component; A gradation correction apparatus comprising:
請求項5に記載の階調補正装置において、
前記明度合成部は、
前記原画像の暗い箇所では、前記原画像の明るい箇所よりも、前記第2明度の加重比率を高くする
ことを特徴とする階調補正装置。
The gradation correction apparatus according to claim 5,
The brightness composition unit
The gradation correction apparatus according to claim 1, wherein a weighting ratio of the second brightness is higher in a dark portion of the original image than in a bright portion of the original image.
コンピュータを、請求項1ないし請求項6のいずれか1項に記載の階調補正装置として機能させるための階調補正プログラム。   A gradation correction program for causing a computer to function as the gradation correction apparatus according to any one of claims 1 to 6.
JP2004286481A 2003-10-02 2004-09-30 Gradation correction apparatus and gradation correction program Pending JP2005130484A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004286481A JP2005130484A (en) 2003-10-02 2004-09-30 Gradation correction apparatus and gradation correction program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2003344722 2003-10-02
JP2004286481A JP2005130484A (en) 2003-10-02 2004-09-30 Gradation correction apparatus and gradation correction program

Publications (1)

Publication Number Publication Date
JP2005130484A true JP2005130484A (en) 2005-05-19

Family

ID=34655829

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004286481A Pending JP2005130484A (en) 2003-10-02 2004-09-30 Gradation correction apparatus and gradation correction program

Country Status (1)

Country Link
JP (1) JP2005130484A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007043460A1 (en) * 2005-10-12 2007-04-19 Matsushita Electric Industrial Co., Ltd. Visual processing apparatus, display apparatus, visual processing method, program and integrated circuit
WO2007122966A1 (en) * 2006-04-19 2007-11-01 Panasonic Corporation Visual processing device, visual processing method, program, display device, and integrated circuit
WO2008149525A1 (en) * 2007-06-01 2008-12-11 Panasonic Corporation Image signal processing device
JPWO2006129601A1 (en) * 2005-06-03 2009-01-08 株式会社ニコン Image processing apparatus, image processing method, image processing program product, and imaging apparatus
CN101800858A (en) * 2009-02-06 2010-08-11 佳能株式会社 Picture pick-up device and control method thereof
JP2010193099A (en) * 2009-02-17 2010-09-02 Canon Inc Image capturing apparatus and method of controlling the same
WO2010128578A1 (en) * 2009-05-07 2010-11-11 Canon Kabushiki Kaisha Image processing method and image processing apparatus
JP2010273392A (en) * 2010-09-08 2010-12-02 Canon Inc Image processing method and image processing device
US7881550B2 (en) 2006-04-28 2011-02-01 Panasonic Corporation Visual processing apparatus, visual processing method, program, recording medium, display device, and integrated circuit
JP2011061537A (en) * 2009-09-10 2011-03-24 Toshiba Corp Video processing apparatus and video processing method
JP2011176691A (en) * 2010-02-25 2011-09-08 Mitsubishi Electric Corp Image processing apparatus and image processing method
JP2012191645A (en) * 2012-05-16 2012-10-04 Canon Inc Imaging apparatus and control method of the same
US8355059B2 (en) 2009-02-06 2013-01-15 Canon Kabushiki Kaisha Image capturing apparatus and control method thereof
CN104463918A (en) * 2014-11-14 2015-03-25 南京航空航天大学 Method for measuring workpiece surface roughness based on image grey information
JP2018125606A (en) * 2017-01-30 2018-08-09 京セラドキュメントソリューションズ株式会社 Image forming apparatus, image forming method, and image forming program

Cited By (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8150099B2 (en) 2005-06-03 2012-04-03 Nikon Corporation Image processing device, image processing method, image processing program product, and imaging device
JP4780104B2 (en) * 2005-06-03 2011-09-28 株式会社ニコン Image processing apparatus, image processing method, image processing program product, and imaging apparatus
JPWO2006129601A1 (en) * 2005-06-03 2009-01-08 株式会社ニコン Image processing apparatus, image processing method, image processing program product, and imaging apparatus
WO2007043460A1 (en) * 2005-10-12 2007-04-19 Matsushita Electric Industrial Co., Ltd. Visual processing apparatus, display apparatus, visual processing method, program and integrated circuit
JP2009277222A (en) * 2005-10-12 2009-11-26 Panasonic Corp Visual processing apparatus, television, information mobile terminal, camera, visual processing method, and processor
US8311357B2 (en) 2005-10-12 2012-11-13 Panasonic Corporation Visual processing device, display device, visual processing method, program, and integrated circuit
US7881549B2 (en) 2005-10-12 2011-02-01 Panasonic Corporaiton Visual processing device, display device, visual processing method, program, and integrated circuit
US7894684B2 (en) 2006-04-19 2011-02-22 Panasonic Corporation Visual processing device, visual processing method, program, display device, and integrated circuit
CN102438097B (en) * 2006-04-19 2015-06-03 松下电器(美国)知识产权公司 Visual processing device, visual processing method
US8406547B2 (en) 2006-04-19 2013-03-26 Panasonic Corporation Visual processing device, visual processing method, program, display device, and integrated circuit
WO2007122966A1 (en) * 2006-04-19 2007-11-01 Panasonic Corporation Visual processing device, visual processing method, program, display device, and integrated circuit
US7881550B2 (en) 2006-04-28 2011-02-01 Panasonic Corporation Visual processing apparatus, visual processing method, program, recording medium, display device, and integrated circuit
US7903898B2 (en) 2006-04-28 2011-03-08 Panasonic Corporation Visual processing apparatus, visual processing method, program, recording medium, display device, and integrated circuit
US8401324B2 (en) 2006-04-28 2013-03-19 Panasonic Corporation Visual processing apparatus, visual processing method, program, recording medium, display device, and integrated circuit
WO2008149525A1 (en) * 2007-06-01 2008-12-11 Panasonic Corporation Image signal processing device
US9077905B2 (en) 2009-02-06 2015-07-07 Canon Kabushiki Kaisha Image capturing apparatus and control method thereof
CN101800858A (en) * 2009-02-06 2010-08-11 佳能株式会社 Picture pick-up device and control method thereof
US8355059B2 (en) 2009-02-06 2013-01-15 Canon Kabushiki Kaisha Image capturing apparatus and control method thereof
JP2010193099A (en) * 2009-02-17 2010-09-02 Canon Inc Image capturing apparatus and method of controlling the same
WO2010128578A1 (en) * 2009-05-07 2010-11-11 Canon Kabushiki Kaisha Image processing method and image processing apparatus
CN102422628A (en) * 2009-05-07 2012-04-18 佳能株式会社 Image processing method and image processing apparatus
JP2010263423A (en) * 2009-05-07 2010-11-18 Canon Inc Method and device for processing image
US9185265B2 (en) 2009-05-07 2015-11-10 Canon Kabushiki Kaisha Image processing method and image processing apparatus for performing a tone correction to acquire a combined image
US8170337B2 (en) 2009-09-10 2012-05-01 Kabushiki Kaisha Toshiba Video processing apparatus and video processing method
JP2011061537A (en) * 2009-09-10 2011-03-24 Toshiba Corp Video processing apparatus and video processing method
JP2011176691A (en) * 2010-02-25 2011-09-08 Mitsubishi Electric Corp Image processing apparatus and image processing method
JP2010273392A (en) * 2010-09-08 2010-12-02 Canon Inc Image processing method and image processing device
JP2012191645A (en) * 2012-05-16 2012-10-04 Canon Inc Imaging apparatus and control method of the same
CN104463918A (en) * 2014-11-14 2015-03-25 南京航空航天大学 Method for measuring workpiece surface roughness based on image grey information
CN104463918B (en) * 2014-11-14 2017-08-04 南京航空航天大学 A kind of method based on gradation of image information measurement workpiece surface roughness
JP2018125606A (en) * 2017-01-30 2018-08-09 京セラドキュメントソリューションズ株式会社 Image forming apparatus, image forming method, and image forming program

Similar Documents

Publication Publication Date Title
Chang et al. Automatic contrast-limited adaptive histogram equalization with dual gamma correction
US7599578B2 (en) Apparatus, program, and method for image tone transformation, and electronic camera
US7755670B2 (en) Tone-conversion device for image, program, electronic camera, and tone-conversion method
EP2076013B1 (en) Method of high dynamic range compression
JP4894595B2 (en) Image processing apparatus and method, and program
US8447132B1 (en) Dynamic range correction based on image content
US7409083B2 (en) Image processing method and apparatus
JP2004158006A (en) Method for emphasizing tonal and spatial characteristics of digital image
KR102567860B1 (en) Improved inverse tone mapping method and corresponding device
JP2005130484A (en) Gradation correction apparatus and gradation correction program
JP5392560B2 (en) Image processing apparatus and image processing method
JP4021261B2 (en) Image processing device
JP4639037B2 (en) Image processing method and apparatus
JP4289225B2 (en) Image processing apparatus and image processing method
JP2002281312A (en) Device, method and program for processing image
JP4013699B2 (en) Image processing apparatus and image processing method
JP2006331445A (en) Image processing apparatus and image processing method
JP2002140700A (en) Method and device for processing color image
JP5381354B2 (en) Image processing apparatus, image processing method, program, and storage medium
DE102015005149A1 (en) Sound correction and edge enhancement performing image processing apparatus, control method therefor and storage medium
JP3731741B2 (en) Color moving image processing method and processing apparatus
JP2007234034A (en) Image processor and image processing method
JP4539674B2 (en) Image processing apparatus, image processing method, and processor used for image processing
JP2005039456A (en) Image processing method and apparatus
JP3558073B2 (en) Image processing apparatus, image processing method, medium recording image processing control program