JP2015100091A - Image processing device, imaging apparatus, image processing method and program - Google Patents
Image processing device, imaging apparatus, image processing method and program Download PDFInfo
- Publication number
- JP2015100091A JP2015100091A JP2013240254A JP2013240254A JP2015100091A JP 2015100091 A JP2015100091 A JP 2015100091A JP 2013240254 A JP2013240254 A JP 2013240254A JP 2013240254 A JP2013240254 A JP 2013240254A JP 2015100091 A JP2015100091 A JP 2015100091A
- Authority
- JP
- Japan
- Prior art keywords
- luminance
- value
- gamma curve
- difference
- luminance value
- 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
Links
Images
Landscapes
- Studio Devices (AREA)
Abstract
Description
本発明は、画像処理装置、撮像装置、画像処理方法、及びプログラムに関する。 The present invention relates to an image processing device, an imaging device, an image processing method, and a program.
近年、撮影した人物の顔の輝度、色等をより適正になるように補正を行う顔検出機能を搭載したデジタルスチルカメラ、デジタルカムコーダ等の撮像装置が広く普及している。この顔検出機能の搭載により、逆光シーンなど本来、顔を適正に撮影することが困難なシーンにおいても顔を適正に撮影することが可能になっている。また、撮像装置で撮影した撮影画像を、撮像装置に搭載されている液晶ディスプレイ、プロジェクタ、又は、大型の液晶テレビなどの表示装置に表示することが多い。撮影画像を表示装置に表示するためには、入出力特性を変換するためのガンマカーブを適用することで、撮像画像信号を、表示装置に表示可能な出力範囲に変換する必要がある。これは、撮像装置の出力可能範囲と表示装置の表示可能範囲の特性が異なるためであり、撮像画像信号の特性が表示装置の特性と一致しない場合、正確な階調で表示することができない。 In recent years, imaging devices such as digital still cameras and digital camcorders equipped with a face detection function for correcting the brightness and color of a photographed person's face to be more appropriate have become widespread. By installing this face detection function, it is possible to properly capture a face even in a scene where originally it is difficult to properly capture a face such as a backlight scene. In many cases, a captured image captured by the imaging device is displayed on a display device such as a liquid crystal display, a projector, or a large liquid crystal television mounted on the imaging device. In order to display a captured image on a display device, it is necessary to convert a captured image signal into an output range that can be displayed on the display device by applying a gamma curve for converting input / output characteristics. This is because the characteristics of the outputable range of the imaging device and the displayable range of the display device are different. When the characteristics of the captured image signal do not match the characteristics of the display device, it is not possible to display with accurate gradation.
多くの撮像装置では、撮像素子から出力される撮像画像信号に対して表示装置に出力可能な範囲は狭いため、撮像画像信号を大きく圧縮する必要がある。例えば、撮像素子の出力が10〜14bitであるのに対して、表示装置の出力は8bitであることが多いため、1/4〜1/64以上の圧縮が必要になる。圧縮を行う際に、多くの撮像装置では、低輝度部のガンマカーブの傾きを大きく、また、高輝度部のガンマカーブの傾きを小さくすることが一般的である。即ち、撮像画像信号が高輝度になるにつれ大きく圧縮されるため、非線形な変換が行われる。 In many imaging devices, the range that can be output to the display device with respect to the captured image signal output from the imaging device is narrow, and thus the captured image signal needs to be greatly compressed. For example, the output of the imaging device is 10 to 14 bits, whereas the output of the display device is often 8 bits, so compression of 1/4 to 1/64 or more is necessary. When performing compression, in many imaging apparatuses, it is common to increase the slope of the gamma curve in the low-brightness part and reduce the slope of the gamma curve in the high-brightness part. That is, since the captured image signal is greatly compressed as the luminance becomes high, non-linear conversion is performed.
そのため、輝度値の変化が一様な階調の被写体においても、被写体の輝度値の高低に応じて変換後の出力値の範囲が異なる。例えば、逆光シーンなど被写体の輝度値が低輝度側に存在する場合はコントラストが大きくなるが、反対に被写体の輝度値が高輝度側に存在する場合はコントラストが小さくなってしまう。これにより、表示装置に表示される表示画像の階調に偏りが発生する。特に、人物の顔で階調の偏りが発生した場合、背景の自然物、人工物以上に、ユーザが大きな違和感を抱いてしまう原因になる。そこで、顔を含む撮像画像信号を表示装置の出力特性に変換する際に、顔の階調を保ちながら変換を行うように、ガンマカーブの補正を行うことが重要になってくる。 For this reason, the range of output values after conversion varies depending on the level of the luminance value of the subject even in a subject with a uniform gradation of luminance values. For example, when the luminance value of the subject exists on the low luminance side, such as in a backlight scene, the contrast increases. Conversely, when the luminance value of the subject exists on the high luminance side, the contrast decreases. Thereby, the gradation of the display image displayed on the display device is biased. In particular, when a gradation deviation occurs in a person's face, it causes the user to feel a greater sense of discomfort than a natural object or artificial object in the background. Therefore, when converting a captured image signal including a face into output characteristics of a display device, it is important to correct the gamma curve so that the conversion is performed while maintaining the gradation of the face.
特許文献1が開示する技術によれば、人物の顔など特定領域からの輝度値の平均値が出力の中央値になるようにガンマカーブが生成される。その後、平均値より高輝度側の輝度値の平均値、平均値より低輝度側の輝度値の平均値が算出される。そして、高輝度側の平均値が高輝度側の中央値に、低輝度側の平均値が低輝度側の中央値になるように、ガンマカーブが変換される。この技術によれば、人物の顔など特定領域を出力の中央値に設定することで、顔の輝度値をほぼ一定に保つことができる。その上、出力の中央値を目標に変換が行われるため、変換に伴う圧縮がそれほど大きくなく、顔の階調を維持することが可能である。 According to the technique disclosed in Patent Literature 1, a gamma curve is generated so that an average value of luminance values from a specific area such as a person's face becomes a median value of output. Thereafter, an average value of luminance values on the higher luminance side than the average value and an average value of luminance values on the lower luminance side than the average value are calculated. Then, the gamma curve is converted so that the average value on the high luminance side becomes the median value on the high luminance side and the average value on the low luminance side becomes the median value on the low luminance side. According to this technique, the brightness value of the face can be kept substantially constant by setting a specific area such as a person's face to the median value of the output. In addition, since the conversion is performed with the output median as a target, the compression associated with the conversion is not so large, and the gradation of the face can be maintained.
特許文献2が開示する技術によれば、検出した顔領域のヒストグラムから、ヒストグラム上で顔領域を示す範囲の傾きが約1になるようにガンマカーブの補正が行われる。このとき、ガンマカーブの連続性が維持されるように補正が行われる。この技術によれば、顔領域の輝度値が撮像画像信号のどの範囲に位置したとしても、ガンマカーブの傾きを一定に補正するため、顔の階調を維持することが可能である、
According to the technique disclosed in
しかしながら、特許文献1では、特定領域の輝度値の平均値が常に出力の中心位置になるようにガンマカーブを生成するため、どんな顔が撮影されても常に顔の輝度値が同じになってしまう。また、特定領域以外の輝度値によって高輝度領域、低輝度領域のガンマカーブの中央値を決定することによりガンマカーブの全体形状を最終決定することから、顔以外の被写体の輝度値の状態により顔の階調が影響を受けてしまう問題がある。 However, in Patent Document 1, since the gamma curve is generated so that the average value of the luminance values of the specific region is always the center position of the output, the face luminance value is always the same no matter what face is photographed. . In addition, since the overall shape of the gamma curve is finally determined by determining the median value of the gamma curve in the high brightness area and the low brightness area according to the brightness value other than the specific area, the face depends on the brightness value of the subject other than the face There is a problem that the gradation of the image is affected.
また、特許文献2では、ガンマカーブの顔領域の傾きを約1に補正してしまうため、顔の階調を維持することは可能である。しかしながら、顔領域が低輝度領域、又は、高輝度領域に存在する場合、補正前後のガンマカーブが大きく異なるため、顔以外の背景領域の階調を犠牲にしてしまう問題がある。
In
本発明はこのような状況に鑑みてなされたものであり、画像データの階調特性を変換する際に、特定領域の階調が失われることを抑制する技術を提供することを目的とする。 The present invention has been made in view of such a situation, and an object of the present invention is to provide a technique for suppressing the loss of gradation in a specific area when converting gradation characteristics of image data.
上記課題を解決するために、本発明は、画像データから特定領域を検出する検出手段と、前記特定領域の代表輝度値を取得する取得手段と、前記代表輝度値を所定の目標輝度値に変換し、前記特定領域の最小輝度値を、前記代表輝度値と前記最小輝度値との差である低輝度側輝度差に基づく値に変換し、前記特定領域の最大輝度値を、前記代表輝度値と前記最大輝度値との差である高輝度側輝度差に基づく値に変換するガンマカーブを生成する生成手段と、前記画像データを前記ガンマカーブにより補正する補正手段と、を備え、前記低輝度側輝度差が大きいほど前記低輝度側輝度差に基づく値は小さく、前記高輝度側輝度差が大きいほど前記高輝度側輝度差に基づく値は大きいことを特徴とする画像処理装置を提供する。 In order to solve the above-described problems, the present invention provides a detection unit that detects a specific area from image data, an acquisition unit that acquires a representative luminance value of the specific area, and converts the representative luminance value into a predetermined target luminance value. And converting the minimum luminance value of the specific area to a value based on a low luminance side luminance difference that is a difference between the representative luminance value and the minimum luminance value, and converting the maximum luminance value of the specific area to the representative luminance value. Generating means for generating a gamma curve for converting to a value based on a high-luminance side luminance difference that is a difference between the maximum luminance value and a correcting means for correcting the image data by the gamma curve, A value based on the low-luminance side luminance difference is small as the side luminance difference is large, and an image processing device is provided wherein the value based on the high-luminance side luminance difference is large as the high-luminance side luminance difference is large.
なお、その他の本発明の特徴は、添付図面及び以下の発明を実施するための形態における記載によって更に明らかになるものである。 Other features of the present invention will become more apparent from the accompanying drawings and the following description of the preferred embodiments.
本発明によれば、画像データの階調特性を変換する際に、特定領域の階調が失われることを抑制することが可能となる。 According to the present invention, it is possible to suppress the loss of the gradation of the specific area when converting the gradation characteristics of the image data.
以下、添付図面を参照して、本発明の実施形態を説明する。なお、本発明の技術的範囲は、特許請求の範囲によって確定されるのであって、以下の個別の実施形態によって限定されるわけではない。また、実施形態の中で説明されている特徴の組み合わせすべてが、本発明に必須とは限らない。 Embodiments of the present invention will be described below with reference to the accompanying drawings. The technical scope of the present invention is determined by the claims, and is not limited by the following individual embodiments. In addition, not all combinations of features described in the embodiments are essential to the present invention.
[第1の実施形態]
図1は、第1の実施形態に係る撮像装置100の概略構成を示すブロック図である。図1に示すように、撮像装置100は、いわゆるデジタルスチルカメラ等の撮像装置として構成されている。撮像装置100は、撮像処理部1の撮像素子により撮像された撮像データを用い、画像処理部2により撮像画像を生成し、記録部8により撮像画像の記録を行うように構成されている。但し、撮像装置100は、撮像処理部1を備えていなくてもよい。この場合、撮像装置100は、撮像装置としてではなく、外部から取得した画像データを処理する画像処理装置として動作する。
[First Embodiment]
FIG. 1 is a block diagram illustrating a schematic configuration of an
撮像装置100は、撮影操作やメニュー設定などを行うための操作部9と、撮像画像や撮影情報等の確認を行うための表示部10とを備える。また、撮像装置100は、撮像画像から人物の顔の領域を検出するための顔検出部4と、顔検出部4により検出した顔領域の輝度値を取得する輝度取得部5とを備える。また、撮像装置100は、輝度取得部5により取得した顔領域の輝度値からヒストグラムを生成するヒストグラム生成部6と、撮像画像を、表示部10に表示するための出力画像に変換するためのガンマカーブを生成するガンマカーブ生成部7とを備える。更に、撮像装置100は、撮像装置100の各部を制御する制御処理部3を備える。
The
撮像処理部1は、複数枚のレンズ、絞り等から構成される光学部、撮像素子、撮像素子を駆動するためのドライバ、タイミング生成回路、CDS/AGC回路、A/D変換器等から構成される。光学部は外部から入射した入射光量を調整するための絞り、ND(Neutral Density)フィルター等から構成される。また、撮像処理部1は、レンズ郡を光軸に対して駆動することで、撮影被写体に対する合焦や、手ぶれ等の撮像画像ぶれの軽減を行う。撮像素子は、光電変換による被写体の撮像を行い、CDS/AGC回路は、撮像素子の各画素に蓄えられた電荷(画像信号)に基づく画像情報をサンプリング及び増幅する。なお、サンプリングでは相関二重サンプリング(CDS)(Correlated Double Sampling)が、増幅では自動利得調整(AGC)(Auto Gain Control)が行われる。A/D変換器は、CDS/AGC回路から出力された画像情報(アナログ信号)をデジタル信号に変換する。撮像素子を駆動するためのドライバ及びタイミング生成回路は、撮像素子を駆動するための駆動パルス等を撮像素子へ供給し、撮像素子で撮像した画像の読み出しや露光時間の調整を行う。 The imaging processing unit 1 includes an optical unit including a plurality of lenses, a diaphragm, an imaging device, a driver for driving the imaging device, a timing generation circuit, a CDS / AGC circuit, an A / D converter, and the like. The The optical unit includes a diaphragm for adjusting the amount of incident light incident from the outside, an ND (Neutral Density) filter, and the like. In addition, the imaging processing unit 1 drives the lens group with respect to the optical axis, thereby reducing the in-focus of the photographic subject and the captured image blur such as camera shake. The imaging device images a subject by photoelectric conversion, and the CDS / AGC circuit samples and amplifies image information based on charges (image signals) stored in each pixel of the imaging device. In sampling, correlated double sampling (CDS) (Correlated Double Sampling) is performed, and in amplification, automatic gain control (AGC) (Auto Gain Control) is performed. The A / D converter converts the image information (analog signal) output from the CDS / AGC circuit into a digital signal. A driver and timing generation circuit for driving the image sensor supplies a drive pulse for driving the image sensor to the image sensor, and reads an image captured by the image sensor and adjusts an exposure time.
画像処理部2は、A/D変換器から出力された画像情報(デジタル信号)に対してAWB(Auto White Balance)、ガンマ制御等の種々の信号処理を施し、最終画像の生成を行う。制御処理部3は、マイクロコンピュータやマイクロコントローラなどと称される回路であり、撮像装置100の動作を統括的に制御する。
The
顔検出部4は、撮像処理部1により撮像された撮像画像から人物の顔を検出し、検出位置及び範囲を制御処理部3に通知する。輝度取得部5は、撮像処理部1により撮像された撮像画像から輝度値を取得する。ここで、輝度取得部5は、撮像画像全体の輝度値ではなく、顔検出部4により検出された顔領域のみの輝度値を取得することも可能である。
The
ヒストグラム生成部6は、輝度取得部5により取得した輝度値からヒストグラムを生成する。ここで、ヒストグラム生成部6は、撮像画像全体のヒストグラムではなく、顔検出部4により検出された顔領域のみのヒストグラムを生成することも可能である。
The histogram generation unit 6 generates a histogram from the luminance values acquired by the
ガンマカーブ生成部7は、画像処理部2で撮像画像に対して適用するガンマカーブを生成する。ガンマカーブ生成部7は、あらかじめ設定された複数のガンマカーブから1つを選択し、選択したガンマカーブを輝度値やヒストグラムなどの情報に基づいて補正することができる。
The gamma
表示部10は、画像処理部2で生成した最終画像(表示画像)を表示する。また、表示部10は、表示画像に対し、顔検出部4で検出した顔位置及び範囲を示す画像を重畳することができる。
The
記録部8は、画像処理部2により生成した最終画像を内部メモリ、又は、メモリーカード等の外部メモリに保存する。ユーザ(撮影者)は、操作部9を使用することで、撮像装置100の撮影時のキー操作、設定メニュー等の設定を行う。
The
なお、図1に示す撮像装置100の各部は、図1に示す通りにそれぞれが独立している必要はない。例えば、各部の全て又はその一部の機能は、制御処理部3内に含まれていても構わない。 1 does not have to be independent as shown in FIG. For example, all or some of the functions of each unit may be included in the control processing unit 3.
次に、撮像装置100による画像処理(特に、ガンマカーブの適用処理)の基本原理について説明する。本実施形態では、顔検出部4は、撮像処理部1により撮像された撮像画像から人物の顔の領域(顔の位置及び範囲を示す顔情報)を取得する。その後、輝度取得部5は、撮像処理部1で撮像された撮像画像、及び、顔検出部4により取得された顔情報に基づき、顔領域の輝度情報を取得する。また、ヒストグラム生成部6は、顔領域の輝度のヒストグラムを生成する。
Next, the basic principle of image processing (particularly, gamma curve application processing) by the
なお、本実施形態では、顔領域に注目するため、撮像装置100は、顔領域の輝度情報やヒストグラムを取得するが、注目する領域は、顔領域に限定されない。他の種類の領域に注目する場合は、撮像装置100の構成は、注目する領域の性質に応じて、適宜変更される。例えば、植物に注目する場合、顔検出部4は、顔領域の代わりに植物領域を検出し、輝度取得部5及びヒストグラム生成部6は、検出された植物領域の輝度情報及びヒストグラムを取得する。このように注目する領域のことを、「特定領域」とも呼ぶ。
Note that in this embodiment, the
画像処理部2は、撮像処理部1により撮像された撮像画像にガンマカーブを適用することにより、記録及び表示のための画像を生成する。ガンマカーブ生成部7は、ここで適用されるガンマカーブを生成する。具体的には、ガンマカーブ生成部7は、輝度取得部5により得られた顔領域の代表輝度値(例えば、顔領域の輝度の平均値)が顔の目標輝度値に変換されるような入出力特性を持つガンマカーブを、複数の候補の中から選択する。顔の目標輝度値は、予め設定されている所定の値であってもよいし、制御処理部3が何らかの条件(例えば、撮像画像の輝度)に基づいて決定する値であってもよい。複数の候補は、例えば、ROM等のメモリ(不図示)に格納されている。また、顔領域の代表輝度値を目標輝度値に変換できるガンマカーブが候補の中に存在しない場合は、ガンマカーブ生成部7は、目標輝度値に一番近く変換できるガンマカーブを選択するものとする。この場合、ガンマカーブ生成部7は、顔領域の代表輝度値を目標輝度値に一致するように変換するガンマカーブと、選択したガンマカーブとの差分を算出し、後でガンマカーブを補正する際に差分を考慮する。
The
図2は、ガンマカーブ生成部7によるガンマカーブ(基準ガンマカーブ)の選択処理の概念図である。図2の例では、3つのガンマカーブ201,202,203が候補としてメモリ(不図示)に格納されているものとする。この場合、ガンマカーブ生成部7は、顔領域の代表輝度値を目標輝度値に変換するガンマカーブ203を生成する。
FIG. 2 is a conceptual diagram of a gamma curve (reference gamma curve) selection process by the gamma
なお、ここでは、ガンマカーブ生成部7は、顔領域の輝度の平均値を代表輝度値として用いるものとしたが、平均値に限らず、例えば顔領域の輝度の中央値や最頻値を代表輝度値として用いても構わない。
Here, the gamma
その後、ガンマカーブ生成部7は、輝度取得部5により取得された輝度値と、ヒストグラム生成部6により生成されたヒストグラムから、顔領域の輝度値の範囲を算出する。ここで、顔領域の輝度値の範囲は、顔の平均輝度値から低輝度側の最小輝度値までの範囲と、平均輝度値から高輝度側の最大輝度値までの範囲とを含む。そして、ガンマカーブ生成部7は、これら2つの範囲を算出し、算出された範囲の大きさに基づいて低輝度側及び高輝度側それぞれの補正量を算出し、算出した補正量をガンマカーブに適用する(図3参照)。補正量の算出は、所定の計算式に従って行われる。或いは、ガンマカーブ生成部7は、範囲の大きさと補正量とを対応付けるテーブルから補正量を取得してもよい。
Thereafter, the gamma
これにより、顔領域の目標輝度値、補正された低輝度側の最小点、及び補正された高輝度側の最大点の3点を通るガンマカーブが生成される。このとき、変曲点が発生する場合は、ガンマカーブ生成部7は、近似処理を行うことで滑らかなガンマカーブを生成する。
As a result, a gamma curve is generated that passes through the target luminance value of the face region, the corrected minimum point on the low luminance side, and the corrected maximum point on the high luminance side. At this time, when an inflection point occurs, the gamma
なお、いかなる方法で補正量を算出する場合であっても、低輝度側の補正量は、低輝度側の範囲が大きいほど、大きい。即ち、低輝度側の範囲が大きいほど、顔領域の最小輝度値に対応する出力値は小さい。また、高輝度側の補正量は、高輝度側の範囲が大きいほど、大きい。即ち、高輝度側の範囲が大きいほど、顔領域の最大輝度値に対応する出力値は大きい。これにより、顔領域の輝度に対応する部分のガンマカーブの傾きが適度な大きさに保たれ、顔領域の階調が適切に維持される。 Note that, regardless of the method for calculating the correction amount, the correction amount on the low luminance side is larger as the range on the lower luminance side is larger. That is, the larger the range on the low luminance side, the smaller the output value corresponding to the minimum luminance value of the face area. The correction amount on the high luminance side is larger as the range on the high luminance side is larger. That is, the larger the range on the high luminance side, the larger the output value corresponding to the maximum luminance value of the face area. As a result, the slope of the gamma curve corresponding to the luminance of the face area is maintained at an appropriate level, and the gradation of the face area is appropriately maintained.
ところで、高輝度側の補正量が大きすぎて出力の最大値(高輝度側閾値)に突き当たるために、算出された補正量全てを適用できない場合がある。この場合、ガンマカーブ生成部7は、目標輝度値から高輝度側の出力の最大値を結ぶ部分のガンマカーブの傾きを大きくすることで、顔の階調を大きくする方向に補正を行う(図4参照)。なお、図4に示すように、厳密には、高輝度側の出力の最大値においては、ガンマカーブの傾きが大きくなっているが、目標輝度値においては、ガンマカーブの傾きは小さくなっている。ここで重要なことは、高輝度側の補正量全てを適用できないために高輝度側の階調が失われることを抑制することであり、図4に示すように高輝度側の出力の最大値においてガンマカーブの傾きを大きくすれば、この目的は達成できる。
By the way, since the correction amount on the high luminance side is too large and hits the maximum output value (high luminance side threshold value), all the calculated correction amounts may not be applied. In this case, the gamma
また、低輝度側の補正量が大きい場合、顔以外の背景で低輝度の被写体がより暗く出力されてしまう問題が発生する。そのため、ガンマカーブ生成部7は、画面全体の黒潰れを防ぐために、低輝度側の部分のガンマカーブについては、画面全体の目標輝度値(低輝度側閾値)をリミットとして補正を行う(図5参照)。このような制御を行うことにより、顔の階調を適正に補正することが可能になる。
In addition, when the correction amount on the low luminance side is large, there arises a problem that a low luminance subject is output darker in the background other than the face. Therefore, the gamma
次に、図6を参照して、撮像装置100による画像処理について説明する。図6の各ステップの処理は、特に断らない限り、制御処理部3が撮像装置100の各部を制御することにより実施される。
Next, image processing by the
S101で、撮像処理部1は、撮像を行う。S102で、制御処理部3は、撮像装置100の動作モードがガンマカーブの補正を行うガンマカーブ補正モードであるか否かを判定する。ガンマカーブ補正モードでない場合、本フローチャートの処理は終了する。ガンマカーブ補正モードである場合、処理はS103に進む。
In S101, the imaging processing unit 1 performs imaging. In S102, the control processing unit 3 determines whether or not the operation mode of the
S103で、顔検出部4は、撮像画像に存在する人物の顔を検出し、顔を検出した場合には、顔の位置及び範囲(顔領域)を算出する。S104で、輝度取得部5は、S103で検出された顔領域に存在する画素情報から顔領域の代表輝度値(ここでは、顔領域の輝度の平均値とする)を取得する。S105で、ヒストグラム生成部6は、S103で検出された顔領域に存在する画素情報から顔領域の輝度値のヒストグラムを生成する。
In S103, the
S106で、ガンマカーブ生成部7は、ROM(不図示)に格納されたガンマカーブの候補の中に、顔領域の輝度の平均値を目標輝度値に変換するガンマカーブが存在するか否かを判定する。存在する場合、S107で、ガンマカーブ生成部7は、顔領域の輝度の平均値を目標輝度値に変換するガンマカーブを選択する。一方、そのようなガンマカーブが存在しない場合、S108で、ガンマカーブ生成部7は、顔領域の輝度の平均値を目標輝度値に一番近く変換するガンマカーブを選択する。S107又はS108で選択されたガンマカーブが、補正前のガンマカーブ(基準ガンマカーブ)となる。
In S106, the gamma
S109で、ガンマカーブ生成部7は、S104において取得した顔領域の輝度の平均値、及び、S105において取得したヒストグラムから、顔領域の輝度の範囲を算出する。具体的には、ガンマカーブ生成部7は、平均値に対して低輝度側の最小輝度値との輝度差(低輝度側輝度差)、及び、平均値に対して高輝度側の最大輝度値との輝度差(高輝度側輝度差)を算出する。
In S109, the gamma
S110で、ガンマカーブ生成部7は、低輝度側及び高輝度側の両輝度差を用いて、基準ガンマカーブの低輝度側の最小輝度点、及び高輝度側の最大輝度点の2点の補正を行うための補正量を算出する。図3を参照して説明した通り、補正量は例えば所定の計算式又はテーブルを用いて算出可能であるが、ここではテーブルを用いるものとする。即ち、補正量の算出は、輝度の平均値からの輝度差(輝度の範囲)の大きさと、目標輝度値からの差(補正量)とを対応付けるテーブルを用いて実行される。
In S110, the gamma
S111で、ガンマカーブ生成部7は、基準ガンマカーブを、顔領域の目標輝度値、低輝度側の最小輝度値、及び高輝度側の最大輝度値の3点を通るように補正する。なお、S108において、平均値を目標輝度値に一番近く変換するガンマカーブが基準ガンマカーブとして選択されていた場合がある。この場合、ガンマカーブ生成部7は、平均値を目標輝度値に変換できるガンマカーブと基準ガンマカーブとの差分を算出し、基準ガンマカーブが目標輝度値に変換できるガンマカーブと一致するように補正量を決定する。
In S111, the gamma
S112で、ガンマカーブ生成部7は、高輝度側の最大輝度点の補正結果が出力の最大値(上限値)を超えるか否かを判定する。上限を超える場合、S113で、ガンマカーブ生成部7は、ガンマカーブの高輝度側の最大輝度点の出力値を最大値に補正する。また、ガンマカーブ生成部7は、目標輝度値と高輝度側の最大輝度点を結ぶガンマカーブの部分の傾きを大きくする。これにより、出力値を上限値以内に抑えつつ、顔領域の階調の低下を抑制することができる。
In S112, the gamma
S114で、ガンマカーブ生成部7は、低輝度側の最小輝度点の補正結果が画面全体の目標輝度値未満(低輝度側閾値未満)であるか否かを判定する。画面全体の目標輝度値未満の場合、S115で、ガンマカーブ生成部7は、低輝度側の最小輝度点の補正値が画面全体の目標輝度値なるようにリミットを設ける。これにより、黒潰れの発生を抑制することができる。
In S114, the gamma
S116で、画像処理部2は、S101で取得された撮像画像に対し、ガンマカーブ生成部7が生成したガンマカーブを最終的に生成されたガンマカーブを適用して、出力画像を生成する。これにより、撮像画像における人物の顔の階調を適正にすることが可能となる。
In S116, the
以上説明したように、本実施形態によれば、撮像装置100は、顔領域の代表輝度値と、顔領域の高輝度側の輝度の範囲と、顔領域の低輝度側の輝度の範囲とに基づいて、画像データに適用するガンマカーブを生成する。
As described above, according to the present embodiment, the
これにより、画像データの階調特性を変換する際に、特定領域の階調が失われることを抑制することが可能となる。 As a result, it is possible to suppress the loss of the gradation of the specific area when converting the gradation characteristics of the image data.
[その他の実施形態]
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(又はCPUやMPU等)がプログラムを読み出して実行する処理である。
[Other Embodiments]
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, etc.) of the system or apparatus reads the program. It is a process to be executed.
Claims (10)
前記特定領域の代表輝度値を取得する取得手段と、
前記代表輝度値を所定の目標輝度値に変換し、前記特定領域の最小輝度値を、前記代表輝度値と前記最小輝度値との差である低輝度側輝度差に基づく値に変換し、前記特定領域の最大輝度値を、前記代表輝度値と前記最大輝度値との差である高輝度側輝度差に基づく値に変換するガンマカーブを生成する生成手段と、
前記画像データを前記ガンマカーブにより補正する補正手段と、
を備え、
前記低輝度側輝度差が大きいほど前記低輝度側輝度差に基づく値は小さく、前記高輝度側輝度差が大きいほど前記高輝度側輝度差に基づく値は大きい
ことを特徴とする画像処理装置。 Detecting means for detecting a specific area from the image data;
Obtaining means for obtaining a representative luminance value of the specific area;
The representative luminance value is converted into a predetermined target luminance value, and the minimum luminance value of the specific area is converted into a value based on a low luminance side luminance difference that is a difference between the representative luminance value and the minimum luminance value, Generating means for generating a gamma curve for converting the maximum luminance value of the specific region into a value based on a high luminance side luminance difference which is a difference between the representative luminance value and the maximum luminance value;
Correction means for correcting the image data by the gamma curve;
With
The value based on the low luminance side luminance difference is small as the low luminance side luminance difference is large, and the value based on the high luminance side luminance difference is large as the high luminance side luminance difference is large.
ことを特徴とする請求項1に記載の画像処理装置。 When the value based on the high luminance side luminance difference exceeds the high luminance side threshold, the generation unit converts the maximum luminance value of the specific region into the high luminance side threshold by the gamma curve, 2. The image according to claim 1, wherein the gamma curve is generated such that a slope of the gamma curve is larger than a value based on the high-luminance-side luminance difference does not exceed a high-luminance-side threshold value. Processing equipment.
ことを特徴とする請求項1又は2に記載の画像処理装置。 When the value based on the low-luminance side luminance difference is less than the low-luminance side threshold value, the generation unit converts the gamma curve so that the gamma curve converts the minimum luminance value of the specific region into the low-luminance side threshold value. The image processing apparatus according to claim 1, wherein the image processing apparatus generates an image.
ガンマカーブの複数の候補の中から、前記代表輝度値を前記目標輝度値に変換するガンマカーブを選択し、
前記選択したガンマカーブが、前記特定領域の最小輝度値を前記低輝度側輝度差に基づく値に変換し、前記特定領域の最大輝度値を前記高輝度側輝度差に基づく値に変換するように、前記選択したガンマカーブを補正する
ことにより、前記ガンマカーブを生成する
ことを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。 The generating means includes
A gamma curve for converting the representative luminance value to the target luminance value is selected from a plurality of candidates for the gamma curve,
The selected gamma curve converts the minimum luminance value of the specific region into a value based on the low luminance side luminance difference, and converts the maximum luminance value of the specific region into a value based on the high luminance side luminance difference. The image processing apparatus according to any one of claims 1 to 3, wherein the gamma curve is generated by correcting the selected gamma curve.
前記複数の候補の中から、前記代表輝度値を前記目標輝度値に一番近く変換するガンマカーブを選択し、
前記選択したガンマカーブが、前記代表輝度値を前記目標輝度値に変換し、前記特定領域の最小輝度値を前記低輝度側輝度差に基づく値に変換し、前記特定領域の最大輝度値を前記高輝度側輝度差に基づく値に変換するように、前記選択したガンマカーブを補正する
ことにより、前記ガンマカーブを生成する
ことを特徴とする請求項4に記載の画像処理装置。 When the gamma curve for converting the representative luminance value to the target luminance value does not exist in the plurality of candidates, the generation unit includes:
From the plurality of candidates, select a gamma curve for converting the representative luminance value closest to the target luminance value,
The selected gamma curve converts the representative luminance value to the target luminance value, converts the minimum luminance value of the specific area to a value based on the low luminance side luminance difference, and sets the maximum luminance value of the specific area to the The image processing apparatus according to claim 4, wherein the gamma curve is generated by correcting the selected gamma curve so as to be converted into a value based on a luminance difference on the high luminance side.
ことを特徴とする請求項1乃至5のいずれか1項に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the specific area is a human face area.
ことを特徴とする請求項1乃至6のいずれか1項に記載の画像処理装置。 The representative luminance value is an average value of luminance of the specific region, a median value of luminance of the specific region, or a mode value of luminance of the specific region. The image processing apparatus according to item.
前記画像データを撮像する撮像手段と、
を備えることを特徴とする撮像装置。 An image processing apparatus according to any one of claims 1 to 7,
Imaging means for imaging the image data;
An imaging apparatus comprising:
前記画像処理装置の検出手段が、画像データから特定領域を検出する検出工程と、
前記画像処理装置の取得手段が、前記特定領域の代表輝度値を取得する取得工程と、
前記画像処理装置の生成手段が、前記代表輝度値を所定の目標輝度値に変換し、前記特定領域の最小輝度値を、前記代表輝度値と前記最小輝度値との差である低輝度側輝度差に基づく値に変換し、前記特定領域の最大輝度値を、前記代表輝度値と前記最大輝度値との差である高輝度側輝度差に基づく値に変換するガンマカーブを生成する生成工程と、
前記画像処理装置の補正手段が、前記画像データを前記ガンマカーブにより補正する補正工程と、
を備え、
前記低輝度側輝度差が大きいほど前記低輝度側輝度差に基づく値は小さく、前記高輝度側輝度差が大きいほど前記高輝度側輝度差に基づく値は大きい
ことを特徴とする画像処理方法。 An image processing method by an image processing apparatus,
A detection step in which the detection means of the image processing apparatus detects a specific area from the image data;
An acquisition step in which an acquisition unit of the image processing apparatus acquires a representative luminance value of the specific area;
The generation unit of the image processing device converts the representative luminance value into a predetermined target luminance value, and sets the minimum luminance value of the specific area as a low luminance side luminance that is a difference between the representative luminance value and the minimum luminance value. Generating a gamma curve for converting to a value based on the difference and converting the maximum luminance value of the specific region into a value based on a high luminance side luminance difference that is a difference between the representative luminance value and the maximum luminance value; ,
A correction step in which the correction means of the image processing apparatus corrects the image data with the gamma curve;
With
The value based on the low-luminance side luminance difference is small as the low-luminance side luminance difference is large, and the value based on the high-luminance side luminance difference is large as the high-luminance side luminance difference is large.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013240254A JP2015100091A (en) | 2013-11-20 | 2013-11-20 | Image processing device, imaging apparatus, image processing method and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013240254A JP2015100091A (en) | 2013-11-20 | 2013-11-20 | Image processing device, imaging apparatus, image processing method and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2015100091A true JP2015100091A (en) | 2015-05-28 |
Family
ID=53376441
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013240254A Pending JP2015100091A (en) | 2013-11-20 | 2013-11-20 | Image processing device, imaging apparatus, image processing method and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2015100091A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10382671B2 (en) | 2017-01-19 | 2019-08-13 | Casio Computer Co., Ltd. | Image processing apparatus, image processing method, and recording medium |
CN113709437A (en) * | 2020-05-22 | 2021-11-26 | 夏普株式会社 | Display device, display control method, and recording medium |
-
2013
- 2013-11-20 JP JP2013240254A patent/JP2015100091A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10382671B2 (en) | 2017-01-19 | 2019-08-13 | Casio Computer Co., Ltd. | Image processing apparatus, image processing method, and recording medium |
CN113709437A (en) * | 2020-05-22 | 2021-11-26 | 夏普株式会社 | Display device, display control method, and recording medium |
CN113709437B (en) * | 2020-05-22 | 2024-03-15 | 夏普株式会社 | Display device, display control method, and recording medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8937677B2 (en) | Digital photographing apparatus, method of controlling the same, and computer-readable medium | |
JP5877277B2 (en) | Imaging apparatus and image display method | |
JP6720881B2 (en) | Image processing apparatus and image processing method | |
JP2002027491A (en) | Image input unit, white balance adjusting method, and computer readable recording medium storing program for executing the method | |
US9025050B2 (en) | Digital photographing apparatus and control method thereof | |
EP2839634B1 (en) | Imaging device and image processing method | |
US8477212B2 (en) | Camera device, exposure control method, and program | |
US9066003B2 (en) | Apparatus for adjusting autofocus using luminance correction and method of controlling the same | |
JP4831175B2 (en) | Imaging apparatus and imaging method | |
US9191573B2 (en) | Image capturing apparatus for determining an exposure condition by calculating aphotmetric value for each object region and method of controlling the same | |
US10475162B2 (en) | Image processing device, method, and storage medium for gamma correction based on illuminance | |
JP6243629B2 (en) | Image processing apparatus and method, and imaging apparatus | |
US8982244B2 (en) | Image capturing apparatus for luminance correction, a control method therefor, and a recording medium | |
JP2010183460A (en) | Image capturing apparatus and method of controlling the same | |
JP2015100091A (en) | Image processing device, imaging apparatus, image processing method and program | |
JP2012124652A (en) | Imaging apparatus and image processing method | |
US8154618B2 (en) | Imaging apparatus and method for setting the same | |
JP2015050733A (en) | Exposure control apparatus, exposure control method, control program, and imaging apparatus | |
JP6090565B2 (en) | Imaging apparatus, imaging method, and program | |
JP2017102393A (en) | Imaging apparatus | |
JP5473582B2 (en) | Image processing apparatus, method, and program | |
JP6272006B2 (en) | Imaging apparatus, image processing method, and program | |
US20230370725A1 (en) | Imaging apparatus and control method for imaging apparatus | |
JP2010271507A (en) | Imaging device, exposure adjustment method, and program | |
KR20100019222A (en) | Method and apparatus for controlling automatic white balance using optical sensor, and digital photographing apparatus using thereof |