JP2009303111A - Image processing apparatus and method, and program - Google Patents
Image processing apparatus and method, and program Download PDFInfo
- Publication number
- JP2009303111A JP2009303111A JP2008157694A JP2008157694A JP2009303111A JP 2009303111 A JP2009303111 A JP 2009303111A JP 2008157694 A JP2008157694 A JP 2008157694A JP 2008157694 A JP2008157694 A JP 2008157694A JP 2009303111 A JP2009303111 A JP 2009303111A
- Authority
- JP
- Japan
- Prior art keywords
- image
- processing
- gradation
- face
- gradation curve
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Landscapes
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
Description
本発明は、撮影により取得された画像の階調を補正する画像処理装置および方法並びに画像処理方法をコンピュータに実行させるためのプログラムに関するものである。 The present invention relates to an image processing apparatus and method for correcting the gradation of an image acquired by photographing, and a program for causing a computer to execute the image processing method.
デジタルカメラ等の撮影装置においては、取得した画像に対して、γ処理、階調処理、色補正処理、シャープネス処理およびノイズ低減処理等の画質を補正するための画像処理を施すことにより、画質を向上させることが行われている。例えば、カメラの測光値、測光コントラスト、フラッシュ発光の情報、カメラの露出条件等に基づいて、画像の階調特性を変更する手法が提案されている(特許文献1参照)。また、人物を含む画像については、顔を適切に補正することが望ましい。このため、画像のγを変化させることにより、顔の明るさを適切にするとともに背景の明るさも適切にする手法(特許文献2参照)、顔の明るさおよび画像全体の明るさに基づいて、顔の明るさを適切に仕上げるとともに、背景等の白跳びを防止する手法(特許文献3参照)、およびプレ撮影により取得した画像から顔を検出して、顔の明るさに基づいて露出を適正に設定する手法が提案されている(特許文献4参照)。 In a photographing apparatus such as a digital camera, image quality is improved by performing image processing for correcting image quality such as γ processing, gradation processing, color correction processing, sharpness processing, and noise reduction processing on an acquired image. Improvements are being made. For example, a technique has been proposed in which the gradation characteristics of an image are changed based on camera photometric values, photometric contrast, flash emission information, camera exposure conditions, and the like (see Patent Document 1). For an image including a person, it is desirable to correct the face appropriately. Therefore, by changing the γ of the image, based on the technique of making the brightness of the face appropriate and the brightness of the background appropriate (see Patent Document 2), the brightness of the face and the brightness of the entire image, Appropriate exposure based on the brightness of the face by appropriately adjusting the brightness of the face and detecting a face from the image acquired by the technique (see Patent Document 3) and pre-shooting that prevents background whitening Has been proposed (see Patent Document 4).
一方、撮影時の感度を自動で設定できるデジタルカメラが提案されている。このようなデジタルカメラにおいては、撮影環境の明るさを露出値(EV値)により算出し、露出値に応じてISO感度を自動で設定して撮影を行うものである。このようなデジタルカメラを使用すれば、撮影者は自分でISO感度を設定しなくても、撮影環境の明るさに応じた適切なISO感度で撮影を行うことができる。
上述したように感度を自動設定するデジタルカメラにおいて、例えば露出値で3EV以下となるような暗い撮影環境においてフラッシュを使用しない撮影を行うと、ISO感度が1600以上のように大きくなり、高感度にて撮影を行うこととなる。このような高感度撮影を行う場合においては、明るい撮影環境の場合のように光のコントラストが得られないため、全体的にコントラストが少ない画像が取得されることとなる。しかしながら、このようなコントラストが少ない画像に対してあらかじめ固定された階調カーブを用いて階調処理を施すと、全体的に硬調となり画像のメリハリが出てくるものの、とくに顔を含む場合には顔のコントラストがつきすぎてしまう。 As described above, in a digital camera that automatically sets the sensitivity, for example, when shooting is performed without using a flash in a dark shooting environment where the exposure value is 3 EV or less, the ISO sensitivity is increased to 1600 or higher and the sensitivity is increased. To shoot. When performing such high-sensitivity shooting, light contrast cannot be obtained as in a bright shooting environment, so that an image with low overall contrast is acquired. However, when gradation processing is applied to an image with low contrast using a gradation curve that is fixed in advance, the overall image becomes hard and the image looks sharp. The face contrast is too high.
本発明は上記事情に鑑みなされたものであり、とくに顔を含む画像について、適切にコントラストを補正できるようにすることを目的とする。 The present invention has been made in view of the above circumstances, and an object of the present invention is to make it possible to appropriately correct the contrast particularly for an image including a face.
本発明による画像処理装置は、撮影により取得された画像から顔を検出する顔検出手段と、
前記検出された顔の輝度近傍を不動点として、前記画像の該不動点を基準としたハイライト側およびシャドー側の階調特性を変化させる階調カーブを算出する階調カーブ算出手段と、
前記階調カーブを用いた階調処理を含む画質補正処理を前記画像に対して施すことにより処理済み画像を生成する画像処理手段とを備えたことを特徴とするものである。
An image processing apparatus according to the present invention includes a face detection unit that detects a face from an image acquired by photographing,
A gradation curve calculating means for calculating a gradation curve for changing a gradation characteristic on a highlight side and a shadow side with reference to the fixed point of the image as a fixed point near the detected luminance of the face;
And image processing means for generating a processed image by performing image quality correction processing including gradation processing using the gradation curve on the image.
「顔の輝度近傍」としては、検出した顔において特定された1つの画素の輝度であってもよく、検出された顔を含む顔領域の平均輝度あるいは中間輝度等、検出された顔を代表する輝度であってもよい。また、顔の輝度あるいは平均輝度等そのものの値のみならず、多少の誤差を含むものであってもよい。 The “near face brightness” may be the brightness of one pixel specified in the detected face, and represents the detected face such as the average brightness or intermediate brightness of the face area including the detected face. It may be brightness. In addition to the value of the face brightness or the average brightness itself, it may include some errors.
また、本発明による画像処理装置においては、前記画質補正処理が明るさ補正処理を含む場合、前記階調カーブ算出手段を、該明るさ補正後の前記顔の輝度近傍を不動点とした階調カーブを算出する手段としてもよい。 In the image processing apparatus according to the present invention, when the image quality correction process includes a brightness correction process, the gradation curve calculation unit performs gradation using the vicinity of the brightness of the face after the brightness correction as a fixed point. It may be a means for calculating a curve.
また、本発明による画像処理装置においては、前記画質補正処理がγ処理を含む場合、前記
階調カーブ算出手段を、該γ処理後の前記顔の輝度近傍を不動点とした階調カーブを算出する手段としてもよい。
In the image processing apparatus according to the present invention, when the image quality correction processing includes γ processing, the gradation curve calculating means calculates a gradation curve with the luminance vicinity of the face after the γ processing as a fixed point. It is good also as a means to do.
また、本発明による画像処理装置においては、前記画像が低輝度撮影により取得されたものである場合、前記階調カーブ算出手段を、前記不動点よりもハイライト側を硬調化し、該不動点よりもシャドー側を軟調化するS字階調カーブを算出する手段としてもよい。 Further, in the image processing apparatus according to the present invention, when the image is acquired by low-luminance shooting, the gradation curve calculation unit is used to make the highlight side harder than the fixed point, and from the fixed point. Alternatively, a means for calculating an S-shaped gradation curve for softening the shadow side may be used.
「低輝度撮影」とは、撮影環境の明るさが露出値で5EV以下、好ましくは3EV以下となる撮影である。なお、オートにてISO感度を設定する場合に、ISO感度が1600以上となるような撮影である。 “Low luminance shooting” is shooting in which the brightness of the shooting environment is an exposure value of 5 EV or less, preferably 3 EV or less. Note that when ISO sensitivity is set automatically, the shooting is performed so that the ISO sensitivity is 1600 or more.
また、本発明による画像処理装置においては、前記画質補正処理が色補正処理を含む場合、前記画像処理手段を、前記階調処理の後に前記画像の彩度を低くするよう前記色補正処理を行う手段としてもよい。 In the image processing apparatus according to the present invention, when the image quality correction process includes a color correction process, the image processing unit performs the color correction process so as to lower the saturation of the image after the gradation process. It may be a means.
また、本発明による画像処理装置においては、前記画質補正処理がノイズ低減処理を含む場合、前記画像処理手段を、前記階調処理の後に前記画像のノイズをより低くするよう前記ノイズ低減処理を行う手段としてもよい。 In the image processing apparatus according to the present invention, when the image quality correction process includes a noise reduction process, the image processing unit performs the noise reduction process to lower the noise of the image after the gradation process. It may be a means.
本発明による画像処理方法は、撮影により取得された画像から顔を検出し、
前記検出された顔の輝度近傍を不動点として、前記画像の該不動点を基準としたハイライト側およびシャドー側の階調特性を変化させる階調カーブを算出し、
前記階調カーブを用いた階調処理を含む画質補正処理を前記画像に対して施すことにより処理済み画像を生成することを特徴とするものである。
The image processing method according to the present invention detects a face from an image acquired by photographing,
A gradation curve that changes the gradation characteristics on the highlight side and the shadow side based on the fixed point of the image as a fixed point in the vicinity of the detected luminance of the face is calculated,
A processed image is generated by performing an image quality correction process including a gradation process using the gradation curve on the image.
なお、本発明による画像処理方法をコンピュータに実行させるためのプログラムとして提供してもよい。 The image processing method according to the present invention may be provided as a program for causing a computer to execute the image processing method.
本発明によれば、撮影により取得された画像から顔を検出し、検出された顔の輝度近傍を不動点として、不動点を基準とした画像のハイライト側およびシャドー側の階調特性を変化させる階調カーブを算出し、この階調カーブを用いた階調処理を含む画質補正処理を画像に対して施すようにしたため、階調処理により顔の明るさが変化することがなくなる。このため、顔の明るさを維持しつつ、顔以外の背景の部分を、階調カーブに応じた適切なコントラストを有するものとすることができる。 According to the present invention, a face is detected from an image acquired by photographing, and the gradation characteristics on the highlight side and the shadow side of the image are changed with the detected luminance near the fixed point as a fixed point. Since the gradation curve to be calculated is calculated and the image quality correction process including the gradation process using the gradation curve is performed on the image, the brightness of the face is not changed by the gradation process. For this reason, the background portion other than the face can have an appropriate contrast according to the gradation curve while maintaining the brightness of the face.
また、画質補正処理が明るさ補正処理を含む場合に、明るさ補正後の顔の輝度近傍を不動点とした階調カーブを算出することにより、好ましく補正された顔の明るさを維持しつつ、顔以外の背景の部分を階調カーブに応じた適切なコントラストを有するものとすることができる。 In addition, when the image quality correction process includes a brightness correction process, it is preferable to maintain a corrected face brightness by calculating a gradation curve with the vicinity of the brightness of the face after the brightness correction as a fixed point. The background portion other than the face can have an appropriate contrast according to the gradation curve.
また、画質補正処理がγ処理を含む場合に、γ処理後の顔の輝度近傍を不動点とした階調カーブを算出することにより、好ましくγ処理された画像において、γ処理により補正された顔の明るさを維持しつつ、顔以外の背景の部分を階調カーブに応じた適切なコントラストを有するものとすることができる。 In addition, when the image quality correction processing includes γ processing, a face that has been corrected by γ processing in a γ-processed image is preferably calculated by calculating a tone curve with the luminance vicinity of the face after γ processing as a fixed point. The background portion other than the face can have an appropriate contrast according to the gradation curve while maintaining the brightness of the image.
また、画像が低輝度撮影されたものである場合、不動点よりもハイライト側を硬調化し、不動点よりもシャドー側を軟調化するS字階調カーブを算出することにより、顔の明るさを維持しつつ、顔以外の背景の部分を階調カーブに応じたメリハリのある適切なコントラストを有するものとすることができる。 Further, when the image is taken with low brightness, the brightness of the face is calculated by calculating an S-shaped gradation curve that makes the highlight side harder than the fixed point and softer the shadow side than the fixed point. The background portion other than the face can have an appropriate contrast with sharpness corresponding to the gradation curve.
なお、このような階調処理を行うと、コントラストが高くなるものの、画像の彩度が強調されてしまう。このため、画質補正処理が色補正処理を含む場合に、階調処理の後に画像の彩度を低くするよう色補正処理を行うことにより、処理済み画像の彩度を適切なものとすることができる。 Note that when such gradation processing is performed, the saturation of the image is enhanced, although the contrast is increased. For this reason, when the image quality correction processing includes color correction processing, the saturation of the processed image may be made appropriate by performing color correction processing to lower the saturation of the image after the gradation processing. it can.
また、このような階調処理を行うと、コントラストが高くなるものの、画像に含まれるノイズが強調されてしまう。このため、画質補正処理がノイズ低減処理を含む場合に、階調処理の後にノイズをより低くするようノイズ低減処理を行うことにより、ノイズが低減された処理済み画像を得ることができる。 Further, when such gradation processing is performed, although the contrast is increased, noise included in the image is emphasized. For this reason, when the image quality correction process includes a noise reduction process, a processed image with reduced noise can be obtained by performing the noise reduction process to lower the noise after the gradation process.
以下、図面を参照して本発明の実施形態について説明する。図1および図2は本発明の実施形態による画像処理装置を適用したデジタルカメラ1の外観を示す図である。図1および図2に示すように、このデジタルカメラ1の上部には、レリーズボタン2、電源ボタン3およびズームレバー4が備えられている。
Hereinafter, embodiments of the present invention will be described with reference to the drawings. 1 and 2 are views showing an external appearance of a digital camera 1 to which an image processing apparatus according to an embodiment of the present invention is applied. As shown in FIGS. 1 and 2, a
レリーズボタン2は、2段階の押下により2種類の動作を指示できる構造となっている。例えば、自動露出調整機能(AE:Auto Exposure)、自動焦点調節機能(AF:Auto Focus)を利用した撮影では、デジタルカメラ1は、レリーズボタン2が軽く押下される第1の押下操作(半押しともいう)がなされたときに、露出調整、焦点合わせ等の撮影準備を行う。その状態で、レリーズボタン2が強く押下される第2の押下操作(全押しともいう)がなされると、デジタルカメラ1は露光を開始し、露光により得られた1画面分の画像データを記録メディアに記録する。
The
また、デジタルカメラ1の背面には、液晶等のモニタ5、撮影モード等の設定に利用されるモードダイヤル6、および各種操作ボタン8が備えられている。なお、本実施形態においては、撮影を行う撮影モード、記録メディアに記録された画像をモニタ5に再生する再生モードを設定可能とされている。
On the back of the digital camera 1, a
次いで、デジタルカメラ1の内部構成について説明する。図3は本発明の実施形態による画像処理装置を適用したデジタルカメラの内部構成を示す概略ブロック図である。図3に示すように本実施形態による画像処理装置を適用したデジタルカメラ1は、撮像部10を有する。
Next, the internal configuration of the digital camera 1 will be described. FIG. 3 is a schematic block diagram showing an internal configuration of a digital camera to which the image processing apparatus according to the embodiment of the present invention is applied. As shown in FIG. 3, the digital camera 1 to which the image processing apparatus according to the present embodiment is applied has an
撮像部10は、フォーカスレンズおよびズームレンズからなる撮影レンズ12を有する。撮影レンズ12は、被写体にピントを合わせるためのフォーカスレンズ、ズーム機能を実現するためのズームレンズ等の複数の機能別レンズにより構成される。レンズ駆動部13はステッピングモータ等小型のモータで、CCD18から各機能別レンズのまでの距離が目的に適った距離となるように各機能別レンズの位置を調整する。
The
絞り14は、複数の絞り羽根からなる。絞り駆動部15は、ステッピングモータ等小型のモータで、AE処理部29から出力される絞り値データに応じて、絞りの開口サイズが目的に適ったサイズになるように絞り羽根の位置を調整する。
The
シャッタ16はメカニカルシャッタであり、シャッタ駆動部17によって駆動される。シャッタ駆動部17は、レリーズボタンの押下により発生する信号と、AE処理部29から出力されるシャッタスピードデータとに応じて、シャッタ16の開閉の制御を行う。
The
シャッタ16の後方には撮像素子であるCCD18を有している。CCD18は、多数の受光素子を2次元的に配列した光電面を有しており、撮影レンズ12等の光学系を通過した被写体光がこの光電面に結像し、光電変換される。光電面の前方には、各画素に光を集光するためのマイクロレンズアレイと、R,G,B各色のフィルタが規則的に配列されたカラーフィルタアレイとが配置されている。CCD18は、CCD制御部19から供給される垂直同期信号および水平同期信号に同期して、画素毎に蓄積された電荷を1ラインずつシリアルなアナログ撮影信号として出力する。各画素において電荷を蓄積する時間、すなわち露光時間は、CCD制御部19から与えられる電子シャッタ駆動信号によって決定される。また、CCD18はCCD制御部19により、あらかじめ定められた大きさのアナログ撮像信号が得られるようにゲインが調整されている。
Behind the
CCD18から読み出されたアナログ撮影信号は、アナログフロントエンド(AFE)20に入力される。AFE20は、アナログ信号のノイズを除去する相関2重サンプリング回路(CDS)と、アナログ信号のゲインを調節するオートゲインコントローラ(AGC)と、アナログ信号をデジタル信号に変換するA/Dコンバータ(ADC)とからなる。このデジタル信号に変換された画像データは、画素毎にR,G,Bの濃度値を持つCCD−RAWデータである。
The analog photographing signal read from the
なお、AGCは、後述するようにAE処理部29が出力したISO感度データに応じたゲインによりアナログ信号のゲインを調節する。
Note that the AGC adjusts the gain of the analog signal by a gain according to the ISO sensitivity data output from the
タイミングジェネレータ21は、タイミング信号を発生させるものであり、このタイミング信号をシャッタ駆動部17、CCD制御部19、およびAFE20に供給することにより、レリーズボタンの操作、シャッタ16の開閉、CCD18からの電荷の読み出し、およびAFE20の処理の同期をとっている。
The
また、デジタルカメラ1は撮影時において必要なときに発光されるフラッシュ24を有する。
In addition, the digital camera 1 has a
また、デジタルカメラ1は、AFE20が出力した画像データをデータバス41を介して他の処理部に転送する画像入力コントローラ25、および画像入力コントローラ25から転送された画像データを一時記憶するフレームメモリ26を備える。
The digital camera 1 also has an
フレームメモリ26は、画像データに対して後述の各種処理を行う際に使用する作業用メモリであり、例えば、一定周期のバスクロック信号に同期してデータ転送を行うSDRAM(Synchronous Dynamic Random Access Memory)が使用される。
The
表示制御部27は、フレームメモリ26に格納された画像データをスルー画像としてモニタ5に表示させたり、再生モード時に記録メディア34に保存されている画像をモニタ5に表示させたりするためのものである。
The
AF処理部28およびAE処理部29は、プレ画像に基づいて撮影条件を決定する。このプレ画像とは、レリーズボタン2が半押しされることによって発生する半押し信号を検出したCPU40がCCD18にプレ撮影を実行させた結果、フレームメモリ26に格納された画像データにより表される画像である。
The
AF処理部28は、プレ画像に基づいて焦点位置を検出し、フォーカス駆動量データを出力する(AF処理)。焦点位置の検出方式としては、例えば、所望とする被写体にピントが合った状態では画像のコントラストが高くなるという特徴を利用して合焦位置を検出するパッシブ方式が考えられる。
The
AE処理部29は、プレ画像に基づいて被写体輝度を測定し、測定した被写体輝度に基づく露出値から絞り値、シャッタスピードおよびISO感度を算出し、絞り値データ(Av値)、シャッタスピードデータ(Tv値)およびISO感度データ(Sv値)を露出設定値として出力する(AE処理)。また、AE処理部29は、露出値を画像処理部31に出力する。
The
AWB処理部30は、撮影時のホワイトバランスを自動調整する(AWB処理)。
The
画像処理部31は、本画像の画像データに対して、γ処理、階調処理、シャープネス補正処理、色補正処理、およびノイズ低減処理等の画質補正処理、各画素がRGBそれぞれの信号値を有するように各画素の画素値を補間する補間処理、並びにCCD−RAWデータを輝度信号であるYデータと、青色色差信号であるCbデータおよび赤色色差信号であるCrデータとからなるYCデータに変換するYC処理を行う。この本画像とは、レリーズボタンが全押しされることによって実行される本撮影によりCCD18から取り込まれ、AFE20、画像入力コントローラ25経由でフレームメモリ26に格納された画像データにより表される画像である。
The
ここで、画質補正処理は、補間処理後に行ってもよく、補間処理の前に行ってもよい。本実施形態においては、補間処理後に画質補正処理を行うものとして説明する。 Here, the image quality correction process may be performed after the interpolation process or may be performed before the interpolation process. In the present embodiment, description will be made assuming that image quality correction processing is performed after interpolation processing.
図4は画像処理部31における画質補正処理を行う部分のブロック図である。図4に示すように画像処理部31は、γ補正処理を行うγ処理部51、明るさ補正処理を行う明るさ補正部52、階調処理を行う階調処理部53、色補正処理を行う色補正部54、ノイズ低減処理を行うノイズ補正部55およびシャープネス処理を行うシャープネス処理部56を備える。また、各処理部において使用するパラメータを算出するために、処理前の画像S0を間引いて縮小画像を作成する間引き部57、縮小画像から各処理部において処理を行う際に使用するパラメータを算出するパラメータ算出部58、縮小画像から顔を検出する顔検出部59、検出した顔の平均輝度を算出する顔輝度算出部60、および階調処理部53において使用する階調カーブを算出する階調カーブ算出部61を備える。なお、明るさ補正部52は、顔の明るさのみを補正するものであってもよい。
FIG. 4 is a block diagram of a portion that performs image quality correction processing in the
パラメータ算出部58は、縮小画像の全画素の平均値、最高輝度、最低輝度、高周波成分等の特徴量を算出し、特徴量に基づいて、γ補正、明るさ補正、色補正、ノイズ補正およびシャープネス処理を行う際のパラメータを算出する。具体的には、γ補正量、明るさ補正量、色補正量、ノイズ補正量およびシャープネス処理の強調度をパラメータとして算出する。なお、これらのパラメータを算出する手法は公知の任意の手法を用いることができる。
The
また、後述するように、画像が低輝度撮影により取得されたものでない場合、およびフラッシュ24を用いた撮影により取得されたものである場合、および低輝度撮影であっても撮影により取得した画像に顔が含まれない場合には、パラメータ算出部58が、特徴量に基づいて階調カーブを階調処理のパラメータとして算出する。一方、画像が低輝度撮影でフラッシュ24が使用されずに取得され、かつ撮影により取得した画像から顔が検出された場合には、後述するように階調カーブ算出部61が階調カーブを算出する。
Further, as will be described later, when an image is not acquired by low-luminance shooting, when acquired by shooting using the
顔検出部59は、テンプレートマッチングによる手法、顔の多数のサンプル画像を用いてマシンラーニング学習により得られた顔判別器を用いる手法等により、縮小画像から顔を囲む矩形の領域(顔領域)を顔として検出する。なお、顔を検出する手法はこれに限定されるものではなく、例えば画像における肌色を有しかつ顔の輪郭形状を囲む矩形の領域を顔として検出する手法、顔の輪郭形状をなす領域を顔として検出する手法等、任意の手法を用いることができる。また、画像に顔が複数含まれている場合には、顔検出部59はすべての顔を検出する。そして、顔が検出された場合にのみ、検出された顔の位置を表す情報を顔輝度算出部60に出力する。なお、画像から顔が検出されない場合には、顔検出部59は、その旨の情報をパラメータ算出部58に出力する。
The
顔輝度算出部60は、明るさ補正後の画像について、縮小画像から検出された顔領域に対応する領域に含まれる画素の平均輝度Yf_aveを算出する。なお、顔が複数検出された場合は、すべての顔領域の平均輝度Yf_aveを算出する。
The face
階調カーブ算出部61は、縮小画像が取り得る最低輝度、最高輝度および顔領域の平均輝度Yf_aveを不動点としたS字階調カーブを算出する。例えば、縮小画像が8ビットの画像である場合、階調カーブの特性を規定する入力−出力平面において、(0,0)、(255,255)および(Yf_ave,Yf_ave)を不動点としたS字階調カーブを算出する。以下、階調カーブの算出について具体的に説明する。 The gradation curve calculation unit 61 calculates an S-shaped gradation curve with the minimum luminance, maximum luminance, and average luminance Yf_ave of the face area that can be taken by the reduced image as fixed points. For example, if the reduced image is an 8-bit image, the S-point with (0, 0), (255, 255) and (Yf_ave, Yf_ave) as fixed points on the input-output plane that defines the characteristics of the gradation curve. The character gradation curve is calculated. Hereinafter, the calculation of the gradation curve will be specifically described.
図5は階調カーブの算出を説明するための図である。まず、階調カーブ算出部61は、最低輝度(0,0)、最高輝度(255,255)および顔の平均輝度(Yf_ave,Yf_ave)を不動点に設定する。なお、図5においては、平均輝度Yf_aveの値は80であるものとする。次いで、平均輝度Yf_aveの値に応じて、下記の式(1)、(2)により、ハイライト側の不動点およびシャドー側の不動点を決定するための、ハイライト側不動点の入力値Yin_hおよびシャドー側不動点の入力値Yin_dを算出する。式(1)、(2)により、入力値Yin_hは平均輝度Yf_aveと最高輝度255との中間値、入力値Yin_dは平均輝度Yf_aveと最低輝度0との中間値となる。
FIG. 5 is a diagram for explaining the calculation of the gradation curve. First, the gradation curve calculation unit 61 sets the lowest luminance (0, 0), the highest luminance (255, 255), and the average facial luminance (Yf_ave, Yf_ave) as fixed points. In FIG. 5, it is assumed that the value of the average luminance Yf_ave is 80. Next, the input value Yin_h of the highlight side fixed point for determining the fixed point on the highlight side and the fixed point on the shadow side according to the following formulas (1) and (2) according to the value of the average luminance Yf_ave. And the input value Yin_d of the shadow side fixed point is calculated. According to Expressions (1) and (2), the input value Yin_h is an intermediate value between the average luminance Yf_ave and the
Yin_h=Yf_ave+(255−Yf_ave)/2 (1)
Yin_d=Yf_ave/2 (2)
さらに、階調カーブ算出部61は、平均輝度Yf_aveの値に応じて、ハイライト側の不動点およびシャドー側の不動点を決定するための、ハイライト側不動点の出力値Yout_hおよびシャドー側不動点の出力値Yout_dを決定する。具体的には、図6に示すような、あらかじめ定められた、平均輝度Yf_aveの値の範囲に応じたハイライト側およびシャドー側不動点の出力値Yout_h、Yout_dの関係を参照して、ハイライト側およびシャドー側不動点の出力値Yout_h、Yout_dを決定する。なお、図6においては、平均輝度Yf_aveの区間の0〜40は、0以上40未満であることを示す。また、図6に示す関係は、テーブルとして内部メモリ35に記憶されている。
Yin_h = Yf_ave + (255−Yf_ave) / 2 (1)
Yin_d = Yf_ave / 2 (2)
Further, the gradation curve calculation unit 61 determines the highlight-side fixed point and the shadow-side fixed point according to the value of the average luminance Yf_ave, and the highlight-side fixed point output value Yout_h and the shadow-side fixed point. The point output value Yout_d is determined. Specifically, referring to the relationship between the output values Yout_h and Yout_d of the highlight side and the shadow side fixed point according to the predetermined range of the value of the average luminance Yf_ave as shown in FIG. The output values Yout_h and Yout_d of the side and shadow side fixed points are determined. In FIG. 6, 0 to 40 in the section of the average luminance Yf_ave is 0 or more and less than 40. The relationship shown in FIG. 6 is stored in the
そして、階調カーブ算出部61は、ハイライト側の不動点(Yin_h,Yout_h)およびシャドー側の不動点(Yin_d,Yout_d)を設定し、最低輝度(0,0)、最高輝度(255,255)および顔の平均輝度(Yf_ave,Yf_ave)とともに5つの不動点を通るS字階調カーブを算出する。この際、S字階調カーブを算出する関数は、下記の式(3)に示すように多項式近似関数を用いればよい。 Then, the gradation curve calculation unit 61 sets a fixed point (Yin_h, Yout_h) on the highlight side and a fixed point (Yin_d, Yout_d) on the shadow side, and sets the lowest luminance (0, 0) and the highest luminance (255, 255). ) And the average luminance of the face (Yf_ave, Yf_ave), an S-shaped gradation curve passing through five fixed points is calculated. At this time, as a function for calculating the S-shaped gradation curve, a polynomial approximation function may be used as shown in the following equation (3).
y=a(n)×x^n+a(n-1)×x^n-1+a(n-2)×x^n-2+…a1×x (3)
なお、Yout_h=Yin_hおよびYout_d=Yin_dとなる場合、階調カーブはその区間は直線となる。
y = a (n) × x ^ n + a (n-1) × x ^ n-1 + a (n-2) × x ^ n-2 +… a1 × x (3)
When Yout_h = Yin_h and Yout_d = Yin_d, the gradation curve is a straight line in the section.
このように算出される階調カーブにより階調処理を行うと、とくに画像の明るさが暗く、コントラストに乏しい場合、コントラストを上げて画像にメリハリをつけることができることとなる。また、階調処理により顔の明るさは変更されないため、顔のコントラストが極端に高くなることもなくなる。 When gradation processing is performed using the gradation curve calculated in this way, particularly when the image is dark and the contrast is poor, the contrast can be increased and the image can be sharpened. Further, since the brightness of the face is not changed by the gradation processing, the contrast of the face is not extremely increased.
条件判定部62は、AE処理部29が算出した露出値に基づいて、画像が低輝度撮影により取得されたものであるか否かを判定する。また、フラッシュ24を使用して取得されたものであるか否か、および顔検出部59による顔の検出結果に基づいて、顔が含まれるか否かを判定する。そして、画像が低輝度撮影により取得され、フラッシュ24が使用されず、さらに顔が含まれると判定された場合、その判定結果を第1の判定結果として、判定結果をパラメータ算出部58、顔輝度算出部60および階調カーブ算出部61に出力する。なお、低輝度撮影か否かは、露出値が5EV以下、望ましくは3EV以下の場合に、低輝度撮影と判定することにより行う。一方、第1の判定結果以外の場合には、その判定結果を第2の判定結果として、判定結果をパラメータ算出部58、顔輝度算出部60および階調カーブ算出部61に出力する。
The
圧縮/伸長処理部32は、画像処理部31によって処理が行われた本画像の画像データに対して、例えば、JPEG等の圧縮形式で圧縮処理を行い画像ファイルを生成する。この画像ファイルには、Exifフォーマット等に基づいて、撮影日時等の付帯情報が格納されたタグが付加される。
The compression /
メディア制御部33は、不図示のメディアスロットルに着脱自在にセットされた記録メディア34にアクセスして、画像ファイルの書き込みと読み込みの制御を行う。
The
内部メモリ35は、デジタルカメラ1において設定される各種定数、上述した図6に示すテーブル、およびCPU40が実行するプログラム等を記憶する。
The
CPU40は、操作ボタン8およびAF処理部28等の各種処理部からの信号に応じてデジタルカメラ1の本体各部を制御する。
The
データバス41は、各種処理部、フレームメモリ26およびCPU40等に接続されており、画像データおよび各種指示等のやり取りを行う。
The
次いで、本実施形態において行われる処理について説明する。なお、本実施形態は本撮影により取得した画像に対して画質補正処理を施す点に特徴を有するため、以降の説明においては、本撮影により画像が取得された以降の処理についてのみ説明する。図7は本実施形態において行われる処理を示すフローチャートである。本撮影により画像が取得されるすなわち撮影により取得されたデジタルの画像がフレームメモリ26に記憶され、さらに補間処理が施されると、間引き部57が補間処理後の画像の画素を間引いて縮小画像を生成する(ステップST1)。そして、顔検出部59が縮小画像から顔を検出する(ステップST2)。
Next, processing performed in the present embodiment will be described. Since the present embodiment is characterized in that image quality correction processing is performed on an image acquired by actual shooting, only the processing after the image is acquired by actual shooting will be described in the following description. FIG. 7 is a flowchart showing processing performed in the present embodiment. When an image is acquired by actual shooting, that is, a digital image acquired by shooting is stored in the
一方、条件判定部62は、画像が低輝度撮影により取得されたものであるか否か、およびフラッシュ24を使用して取得されたものであるか否か、および顔が含まれるか否かを判定する(判定処理、ステップST3)。
On the other hand, the
判定結果が第1の判定結果である場合、パラメータ算出部58は、γ補正、明るさ補正、色補正、ノイズ補正およびシャープネス処理のパラメータを算出する(第1のパラメータ算出、ステップST4)。そして、γ処理部51がγ補正を行い(ステップST5)、明るさ補正部52が画像の明るさを補正する(ステップST6)。
When the determination result is the first determination result, the
一方、顔輝度算出部60が、明るさ補正後の画像に含まれる顔の平均輝度Yf_aveを算出し(ステップST7)、階調カーブ算出部61が平均輝度Yf_aveを用いて、上述したように階調カーブを算出する(ステップST8)。
On the other hand, the face
そして、階調処理部53が、階調カーブ算出部61が算出した階調カーブを用いて階調処理を行う(ステップST9)。そして、色補正部54が色補正処理を行う(ステップST10)。この際、色補正部54は、パラメータ算出部58が決定した色補正のパラメータをそのまま用いてもよいが、上述したように算出した階調カーブを用いた階調処理により画像の彩度が高くなるため、彩度を低下させるようにパラメータを修正して、色補正処理を行うことが好ましい。
Then, the
さらに、ノイズ補正部55がノイズ補正処理を行う(ステップST11)。この際、ノイズ補正部55は、パラメータ算出部58が決定したノイズ補正のパラメータをそのまま用いてもよいが、上述したように算出した階調カーブを用いた階調処理により画像のノイズが強調されるため、より多くのノイズを低減するようにパラメータを修正して、ノイズ補正処理を行うことが好ましい。最後にシャープネス処理部56がシャープネス処理を行い(ステップST12)、処理済み画像S1を生成する。
Further, the
一方、判定結果が、第2の判定結果である場合、パラメータ算出部58は、γ補正、明るさ補正、色補正、ノイズ補正およびシャープネス処理のパラメータに加えて階調処理のパラメータを算出する(第2のパラメータ算出、ステップST13)。そして、γ処理部51、明るさ補正部52、階調処理部53、色補正部54、ノイズ補正部55およびシャープネス処理部56が、パラメータ算出部58が算出したパラメータにより処理を行い、処理済み画像S1を生成する(通常の画像処理、ステップST14)。
On the other hand, when the determination result is the second determination result, the
処理済み画像S1は、YC処理が施された後圧縮/伸長処理部32に入力され、圧縮/伸長処理部32が処理済み画像S1の画像ファイルを生成し(ステップST15)、次いでメディア制御部33が画像ファイルを記録メディア34に記録し(ステップST16)、処理を終了する。
The processed image S1 is input to the compression /
このように、本実施形態においては、検出された顔の平均輝度Yf_aveを不動点として、不動点を基準とした画像のハイライト側およびシャドー側の階調特性を変化させる階調カーブを算出し、この階調カーブを用いた階調処理を含む画質補正処理を画像に対して施すようにしたため、階調処理により顔の明るさが変更されることがなくなる。このため、顔の明るさを維持しつつ、背景を階調カーブに応じた適切なコントラストを有するものとすることができる。 As described above, in the present embodiment, the average curve Yf_ave of the detected face is used as a fixed point, and a gradation curve that changes the gradation characteristics on the highlight side and the shadow side of the image based on the fixed point is calculated. Since the image quality correction process including the gradation process using the gradation curve is performed on the image, the brightness of the face is not changed by the gradation process. For this reason, the background can have an appropriate contrast according to the gradation curve while maintaining the brightness of the face.
とくに、顔の平均輝度Yf_aveよりもハイライト側を硬調化し、平均輝度Yf_aveよりもシャドー側を軟調化するS字階調カーブを算出しているため、顔の明るさを維持しつつ、背景を階調カーブに応じたメリハリのある適切なコントラストを有するものとすることができる。 In particular, since the S-shaped gradation curve is calculated to make the highlight side harder than the average brightness Yf_ave and soften the shadow side from the average brightness Yf_ave, the background is maintained while maintaining the brightness of the face. An appropriate contrast with sharpness corresponding to the gradation curve can be obtained.
また、γ処理および明るさ補正が行われた後の顔の平均輝度Yf_aveを不動点とした階調カーブを算出しているため、好ましく補正された画像のγおよび顔の明るさを維持しつつ、背景を階調カーブに応じた適切なコントラストを有するものとすることができる。 Also, since the tone curve is calculated with the average brightness Yf_ave of the face after γ processing and brightness correction as a fixed point, it is preferable to maintain the γ and face brightness of the corrected image. The background can have an appropriate contrast according to the gradation curve.
また、上述したように算出したS字階調カーブを用いて階調処理を行うと、コントラストが高くなるものの、画像の彩度が強調されてしまう。このため、画像の彩度を低くするよう色補正処理を行うことにより、処理済み画像S1の彩度を適切なものとすることができる。 Further, when gradation processing is performed using the S-shaped gradation curve calculated as described above, the contrast of the image increases, but the saturation of the image is enhanced. For this reason, the saturation of the processed image S1 can be made appropriate by performing the color correction processing so as to lower the saturation of the image.
また、上述したように算出したS字階調カーブを用いて階調処理を行うと、コントラストが高くなるものの、画像に含まれるノイズが強調されてしまう。このため、ノイズをより低くするようノイズ低減処理を行うことにより、ノイズが低減された処理済み画像S1を得ることができる。 Further, when gradation processing is performed using the S-shaped gradation curve calculated as described above, although the contrast is increased, noise included in the image is emphasized. For this reason, the processed image S1 in which the noise is reduced can be obtained by performing the noise reduction process so as to reduce the noise.
なお、上記実施形態においては、画像が低輝度撮影により取得され、フラッシュ24が使用されず、さらに顔が含まれると判定された場合に、階調カーブ算出部61により階調カーブを算出しているが、このような条件を設けることなく、低輝度撮影か否かおよびフラッシュ24を用いた撮影か否かに拘わらず、顔が検出された場合にのみ、階調カーブ算出部61により階調カーブを算出するようにしてもよい。
In the above embodiment, when it is determined that the image is acquired by low luminance shooting, the
また、上記実施形態においては、図5に示すように、平均輝度Yf_aveよりもハイライト側を硬調化し、平均輝度Yf_aveよりもシャドー側を軟調化するS字階調カーブを算出しているが、図8に示すように、平均輝度Yf_aveよりもハイライト側を軟調化し、平均輝度Yf_aveよりもシャドー側を硬調化するS字階調カーブ等、顔の平均輝度Yf_aveを不動点として、不動点を基準とした画像のハイライト側およびシャドー側の階調特性を変化させる階調カーブであれば、撮影者が所望とするように階調カーブを算出するようにしてもよい。 In the above embodiment, as shown in FIG. 5, an S-shaped gradation curve is calculated that makes the highlight side harder than the average luminance Yf_ave and softens the shadow side more than the average luminance Yf_ave. As shown in FIG. 8, the fixed point is the fixed point with the average luminance Yf_ave of the face as a fixed point, such as an S-shaped gradation curve that softens the highlight side with respect to the average luminance Yf_ave and hardens the shadow side with respect to the average luminance Yf_ave. If the gradation curve changes the gradation characteristics on the highlight side and shadow side of the reference image, the gradation curve may be calculated as desired by the photographer.
また、上記実施形態においては、検出した顔の平均輝度Yf_aveを不動点としているが、検出した顔において特定された1つの画素の輝度、あるいは検出された顔を含む顔領域の中間輝度等、他の値を不動点としてもよい。 In the above embodiment, the detected face average brightness Yf_ave is a fixed point. However, the brightness of one pixel specified in the detected face or the intermediate brightness of the face area including the detected face, etc. The value of may be a fixed point.
また、上記実施形態においては、本発明による画像処理装置をデジタルカメラ1に適用しているが、画像処理装置を単独で用いるようにしてもよい。この場合、画像処理装置には、撮影により取得された画像および露出値等を入力するための、各種インターフェースが用いられることとなる。 In the above embodiment, the image processing apparatus according to the present invention is applied to the digital camera 1, but the image processing apparatus may be used alone. In this case, various interfaces for inputting an image acquired by photographing, an exposure value, and the like are used in the image processing apparatus.
また、上記実施形態においては、条件判定部62が露出値に基づいて低輝度撮影か否かを判定しているが、AE処理部29が算出したISO感度に基づいて、低輝度撮影か否かを判定するようにしてもよい。この場合、ISO感度で1600以上の場合、低輝度撮影と判定するようにすればよい。
In the above-described embodiment, the
以上、本発明の実施形態について説明したが、コンピュータを、上記の画像処理部31に対応する手段として機能させ、図7に示すような処理を行わせるプログラムも、本発明の実施形態の1つである。また、そのようなプログラムを記録したコンピュータ読取り可能な記録媒体も本発明の実施形態の1つである。
Although the embodiment of the present invention has been described above, a program that causes a computer to function as means corresponding to the above-described
1 デジタルカメラ
2 レリーズボタン
5 モニタ
10 撮像部
31 画像処理部
51 γ処理部
52 明るさ補正部
53 階調処理部
54 色補正部
55 ノイズ補正部
56 シャープネス処理部
57 間引き部
58 パラメータ算出部
59 顔検出部
60 顔輝度算出部
61 階調カーブ算出部
62 条件判定部
DESCRIPTION OF SYMBOLS 1
Claims (9)
前記検出された顔の輝度近傍を不動点として、該不動点を基準とした前記画像のハイライト側およびシャドー側の階調特性を変化させる階調カーブを算出する階調カーブ算出手段と、
前記階調カーブを用いた階調処理を含む画質補正処理を前記画像に対して施すことにより処理済み画像を生成する画像処理手段とを備えたことを特徴とする画像処理装置。 Face detection means for detecting a face from an image acquired by photographing;
A gradation curve calculating means for calculating a gradation curve for changing the gradation characteristics on the highlight side and the shadow side of the image based on the fixed point, the luminance vicinity of the detected face as a fixed point;
An image processing apparatus comprising: an image processing unit configured to generate a processed image by performing an image quality correction process including a gradation process using the gradation curve on the image.
前記検出された顔の輝度近傍を不動点として、該不動点を基準とした前記画像のハイライト側およびシャドー側の階調特性を変化させる階調カーブを算出し、
前記階調カーブを用いた階調処理を含む画質補正処理を前記画像に対して施すことにより処理済み画像を生成することを特徴とする画像処理方法。 Detect faces from images acquired by shooting,
A gradation curve that changes the gradation characteristics on the highlight side and the shadow side of the image with the fixed vicinity of the detected luminance of the face as a fixed point,
An image processing method, wherein a processed image is generated by performing image quality correction processing including gradation processing using the gradation curve on the image.
前記検出された顔の輝度近傍を不動点として、該不動点を基準とした前記画像のハイライト側およびシャドー側の階調特性を変化させる階調カーブを算出する手順と、
前記階調カーブを用いた階調処理を含む画質補正処理を前記画像に対して施すことにより処理済み画像を生成する手順とを有することを特徴とする画像処理方法をコンピュータに実行させるためのプログラム。 A procedure for detecting a face from an image acquired by shooting;
A procedure for calculating a gradation curve that changes the gradation characteristics on the highlight side and the shadow side of the image with reference to the fixed point in the vicinity of the detected luminance of the face as a fixed point;
A program for causing a computer to execute an image processing method, comprising: generating a processed image by performing image quality correction processing including gradation processing using the gradation curve on the image. .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008157694A JP2009303111A (en) | 2008-06-17 | 2008-06-17 | Image processing apparatus and method, and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008157694A JP2009303111A (en) | 2008-06-17 | 2008-06-17 | Image processing apparatus and method, and program |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2009303111A true JP2009303111A (en) | 2009-12-24 |
Family
ID=41549504
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2008157694A Withdrawn JP2009303111A (en) | 2008-06-17 | 2008-06-17 | Image processing apparatus and method, and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2009303111A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2016503926A (en) * | 2013-01-07 | 2016-02-08 | ▲華▼▲為▼終端有限公司Huawei Device Co., Ltd. | Image processing method and apparatus, and photographing terminal |
-
2008
- 2008-06-17 JP JP2008157694A patent/JP2009303111A/en not_active Withdrawn
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2016503926A (en) * | 2013-01-07 | 2016-02-08 | ▲華▼▲為▼終端有限公司Huawei Device Co., Ltd. | Image processing method and apparatus, and photographing terminal |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4567593B2 (en) | Imaging apparatus and imaging method | |
| JP4687492B2 (en) | Camera, imaging method, exposure calculation device, and program | |
| US20080068466A1 (en) | Imaging apparatus, method, and program | |
| JP5180349B2 (en) | Imaging apparatus, method, and program | |
| JP2007221284A (en) | Imaging apparatus, method, and program | |
| JP4717720B2 (en) | Image processing apparatus and method, and program | |
| JP2007188126A (en) | Image brightness calculation apparatus and method, and program | |
| US7864860B2 (en) | Image pickup apparatus and motion vector deciding method | |
| JP5515795B2 (en) | Imaging apparatus and imaging method | |
| JP5532621B2 (en) | Electronic camera and image processing program | |
| JP2020008886A (en) | Focusing position detection device and focusing position detection method | |
| JP2009290260A (en) | Photographing apparatus, control method therefor and program | |
| US20130089270A1 (en) | Image processing apparatus | |
| US7961231B2 (en) | Apparatus, method and computer-readable recording medium containing program for photographing | |
| JP2004153315A (en) | Image processing method and digital camera | |
| JP2010026039A (en) | Photographing apparatus, and control method and program of photographing apparatus | |
| JP2010093780A (en) | Imaging apparatus and imaging method | |
| US8041206B2 (en) | Imaging apparatus and method for controlling flash emission | |
| JP2007208355A (en) | Imaging apparatus, method, and program | |
| JP2009303111A (en) | Image processing apparatus and method, and program | |
| KR101408359B1 (en) | Imaging apparatus and imaging method | |
| JP5248928B2 (en) | Imaging control apparatus, method thereof, and program | |
| JP5184325B2 (en) | Image capturing apparatus, image capturing apparatus control method, and program | |
| JP2010136239A (en) | Photographic apparatus, control method of the photographic apparatus and program | |
| JP2007027984A (en) | Photographic apparatus and control method thereof |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20110906 |