[go: up one dir, main page]

JP2009303111A - Image processing apparatus and method, and program - Google Patents

Image processing apparatus and method, and program Download PDF

Info

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
Application number
JP2008157694A
Other languages
Japanese (ja)
Inventor
Koichi Sakamoto
浩一 坂本
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.)
Fujifilm Corp
Original Assignee
Fujifilm 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 Fujifilm Corp filed Critical Fujifilm Corp
Priority to JP2008157694A priority Critical patent/JP2009303111A/en
Publication of JP2009303111A publication Critical patent/JP2009303111A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To suitably correct contract in an image especially including a face. <P>SOLUTION: A face detection part 59 detects a face from an image acquired by photography. A face luminance calculation part 60 calculates the average luminance of the face. A gradation curve calculation part 61 sets the maximum luminance which can be obtained in the image, an optimum degree and the average luminance of the face as fixed points and calculates a gradation curve for changing gradation characteristics on the high-light side and shadow side of the image based on the fixed points. A gradation processing part 53 performs gradation processing using the calculated gradation curve. <P>COPYRIGHT: (C)2010,JPO&INPIT

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感度で撮影を行うことができる。
特開2003−234955号公報 特開2007−74328号公報 特開2007−124604号公報 特開2007−201979号公報
On the other hand, a digital camera capable of automatically setting the sensitivity at the time of shooting has been proposed. In such a digital camera, the brightness of the shooting environment is calculated from the exposure value (EV value), and shooting is performed with the ISO sensitivity automatically set according to the exposure value. If such a digital camera is used, the photographer can perform photographing with an appropriate ISO sensitivity corresponding to the brightness of the photographing environment without setting the ISO sensitivity by himself.
JP 2003-234955 A JP 2007-74328 A JP 2007-124604 A JP 2007-201979 A

上述したように感度を自動設定するデジタルカメラにおいて、例えば露出値で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 release button 2, a power button 3, and a zoom lever 4 are provided on the top of the digital camera 1.

レリーズボタン2は、2段階の押下により2種類の動作を指示できる構造となっている。例えば、自動露出調整機能(AE:Auto Exposure)、自動焦点調節機能(AF:Auto Focus)を利用した撮影では、デジタルカメラ1は、レリーズボタン2が軽く押下される第1の押下操作(半押しともいう)がなされたときに、露出調整、焦点合わせ等の撮影準備を行う。その状態で、レリーズボタン2が強く押下される第2の押下操作(全押しともいう)がなされると、デジタルカメラ1は露光を開始し、露光により得られた1画面分の画像データを記録メディアに記録する。   The release button 2 has a structure in which two types of operations can be instructed by pressing in two steps. For example, in shooting using an automatic exposure adjustment function (AE: Auto Exposure) and an automatic focus adjustment function (AF: Auto Focus), the digital camera 1 performs a first pressing operation (half-pressing) in which the release button 2 is lightly pressed. (Also called exposure), preparation for shooting such as exposure adjustment and focusing is performed. In this state, when a second pressing operation (also referred to as full pressing) in which the release button 2 is strongly pressed is performed, the digital camera 1 starts exposure and records image data for one screen obtained by the exposure. Record on media.

また、デジタルカメラ1の背面には、液晶等のモニタ5、撮影モード等の設定に利用されるモードダイヤル6、および各種操作ボタン8が備えられている。なお、本実施形態においては、撮影を行う撮影モード、記録メディアに記録された画像をモニタ5に再生する再生モードを設定可能とされている。   On the back of the digital camera 1, a monitor 5 such as a liquid crystal, a mode dial 6 used for setting a shooting mode, and various operation buttons 8 are provided. In the present embodiment, it is possible to set a shooting mode for shooting and a playback mode for playing back an image recorded on a recording medium on the monitor 5.

次いで、デジタルカメラ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 imaging unit 10.

撮像部10は、フォーカスレンズおよびズームレンズからなる撮影レンズ12を有する。撮影レンズ12は、被写体にピントを合わせるためのフォーカスレンズ、ズーム機能を実現するためのズームレンズ等の複数の機能別レンズにより構成される。レンズ駆動部13はステッピングモータ等小型のモータで、CCD18から各機能別レンズのまでの距離が目的に適った距離となるように各機能別レンズの位置を調整する。   The imaging unit 10 includes a photographing lens 12 including a focus lens and a zoom lens. The photographic lens 12 includes a plurality of functional lenses such as a focus lens for focusing on a subject and a zoom lens for realizing a zoom function. The lens driving unit 13 is a small motor such as a stepping motor, and adjusts the position of each functional lens so that the distance from the CCD 18 to each functional lens is a suitable distance for the purpose.

絞り14は、複数の絞り羽根からなる。絞り駆動部15は、ステッピングモータ等小型のモータで、AE処理部29から出力される絞り値データに応じて、絞りの開口サイズが目的に適ったサイズになるように絞り羽根の位置を調整する。   The diaphragm 14 includes a plurality of diaphragm blades. The aperture drive unit 15 is a small motor such as a stepping motor, and adjusts the position of the aperture blade so that the aperture size of the aperture becomes a size suitable for the purpose according to the aperture value data output from the AE processing unit 29. .

シャッタ16はメカニカルシャッタであり、シャッタ駆動部17によって駆動される。シャッタ駆動部17は、レリーズボタンの押下により発生する信号と、AE処理部29から出力されるシャッタスピードデータとに応じて、シャッタ16の開閉の制御を行う。   The shutter 16 is a mechanical shutter and is driven by a shutter driving unit 17. The shutter drive unit 17 controls the opening and closing of the shutter 16 according to a signal generated by pressing the release button and the shutter speed data output from the AE processing unit 29.

シャッタ16の後方には撮像素子であるCCD18を有している。CCD18は、多数の受光素子を2次元的に配列した光電面を有しており、撮影レンズ12等の光学系を通過した被写体光がこの光電面に結像し、光電変換される。光電面の前方には、各画素に光を集光するためのマイクロレンズアレイと、R,G,B各色のフィルタが規則的に配列されたカラーフィルタアレイとが配置されている。CCD18は、CCD制御部19から供給される垂直同期信号および水平同期信号に同期して、画素毎に蓄積された電荷を1ラインずつシリアルなアナログ撮影信号として出力する。各画素において電荷を蓄積する時間、すなわち露光時間は、CCD制御部19から与えられる電子シャッタ駆動信号によって決定される。また、CCD18はCCD制御部19により、あらかじめ定められた大きさのアナログ撮像信号が得られるようにゲインが調整されている。   Behind the shutter 16 is a CCD 18 which is an image sensor. The CCD 18 has a photoelectric surface in which a large number of light receiving elements are two-dimensionally arranged, and subject light that has passed through an optical system such as the photographing lens 12 forms an image on the photoelectric surface and is subjected to photoelectric conversion. In front of the photocathode, a microlens array for condensing light on each pixel and a color filter array in which filters of R, G, and B colors are regularly arranged are arranged. The CCD 18 outputs the charge accumulated for each pixel as a serial analog photographing signal line by line in synchronization with the vertical synchronization signal and horizontal synchronization signal supplied from the CCD control unit 19. The time for accumulating charges in each pixel, that is, the exposure time, is determined by an electronic shutter drive signal given from the CCD controller 19. The gain of the CCD 18 is adjusted by the CCD control unit 19 so that an analog imaging signal having a predetermined size can be obtained.

CCD18から読み出されたアナログ撮影信号は、アナログフロントエンド(AFE)20に入力される。AFE20は、アナログ信号のノイズを除去する相関2重サンプリング回路(CDS)と、アナログ信号のゲインを調節するオートゲインコントローラ(AGC)と、アナログ信号をデジタル信号に変換するA/Dコンバータ(ADC)とからなる。このデジタル信号に変換された画像データは、画素毎にR,G,Bの濃度値を持つCCD−RAWデータである。   The analog photographing signal read from the CCD 18 is input to an analog front end (AFE) 20. The AFE 20 includes a correlated double sampling circuit (CDS) that removes noise from the analog signal, an auto gain controller (AGC) that adjusts the gain of the analog signal, and an A / D converter (ADC) that converts the analog signal into a digital signal. It consists of. The image data converted into the digital signal is CCD-RAW data having R, G, and B density values for each pixel.

なお、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 AE processing unit 29 as will be described later.

タイミングジェネレータ21は、タイミング信号を発生させるものであり、このタイミング信号をシャッタ駆動部17、CCD制御部19、およびAFE20に供給することにより、レリーズボタンの操作、シャッタ16の開閉、CCD18からの電荷の読み出し、およびAFE20の処理の同期をとっている。   The timing generator 21 generates a timing signal. By supplying this timing signal to the shutter drive unit 17, the CCD control unit 19, and the AFE 20, the release button is operated, the shutter 16 is opened and closed, and the charge from the CCD 18 is supplied. And the processing of the AFE 20 are synchronized.

また、デジタルカメラ1は撮影時において必要なときに発光されるフラッシュ24を有する。   In addition, the digital camera 1 has a flash 24 that emits light when necessary during photographing.

また、デジタルカメラ1は、AFE20が出力した画像データをデータバス41を介して他の処理部に転送する画像入力コントローラ25、および画像入力コントローラ25から転送された画像データを一時記憶するフレームメモリ26を備える。   The digital camera 1 also has an image input controller 25 that transfers the image data output from the AFE 20 to another processing unit via the data bus 41, and a frame memory 26 that temporarily stores the image data transferred from the image input controller 25. Is provided.

フレームメモリ26は、画像データに対して後述の各種処理を行う際に使用する作業用メモリであり、例えば、一定周期のバスクロック信号に同期してデータ転送を行うSDRAM(Synchronous Dynamic Random Access Memory)が使用される。   The frame memory 26 is a working memory used when performing various processes described later on image data. For example, an SDRAM (Synchronous Dynamic Random Access Memory) that performs data transfer in synchronization with a bus clock signal having a constant period. Is used.

表示制御部27は、フレームメモリ26に格納された画像データをスルー画像としてモニタ5に表示させたり、再生モード時に記録メディア34に保存されている画像をモニタ5に表示させたりするためのものである。   The display control unit 27 displays the image data stored in the frame memory 26 on the monitor 5 as a through image, or displays the image stored on the recording medium 34 on the monitor 5 in the reproduction mode. is there.

AF処理部28およびAE処理部29は、プレ画像に基づいて撮影条件を決定する。このプレ画像とは、レリーズボタン2が半押しされることによって発生する半押し信号を検出したCPU40がCCD18にプレ撮影を実行させた結果、フレームメモリ26に格納された画像データにより表される画像である。   The AF processing unit 28 and the AE processing unit 29 determine shooting conditions based on the pre-image. The pre-image is an image represented by image data stored in the frame memory 26 as a result of the CPU 40 that has detected a half-press signal generated when the release button 2 is half-pressed causing the CCD 18 to perform pre-photographing. It is.

AF処理部28は、プレ画像に基づいて焦点位置を検出し、フォーカス駆動量データを出力する(AF処理)。焦点位置の検出方式としては、例えば、所望とする被写体にピントが合った状態では画像のコントラストが高くなるという特徴を利用して合焦位置を検出するパッシブ方式が考えられる。   The AF processing unit 28 detects the focal position based on the pre-image and outputs focus driving amount data (AF processing). As a focus position detection method, for example, a passive method that detects a focus position using a feature that the contrast of an image is high when a desired subject is in focus can be considered.

AE処理部29は、プレ画像に基づいて被写体輝度を測定し、測定した被写体輝度に基づく露出値から絞り値、シャッタスピードおよびISO感度を算出し、絞り値データ(Av値)、シャッタスピードデータ(Tv値)およびISO感度データ(Sv値)を露出設定値として出力する(AE処理)。また、AE処理部29は、露出値を画像処理部31に出力する。   The AE processing unit 29 measures the subject brightness based on the pre-image, calculates the aperture value, shutter speed and ISO sensitivity from the exposure value based on the measured subject brightness, and obtains aperture value data (Av value) and shutter speed data ( Tv value) and ISO sensitivity data (Sv value) are output as exposure setting values (AE process). Further, the AE processing unit 29 outputs the exposure value to the image processing unit 31.

AWB処理部30は、撮影時のホワイトバランスを自動調整する(AWB処理)。   The AWB processing unit 30 automatically adjusts the white balance at the time of shooting (AWB processing).

画像処理部31は、本画像の画像データに対して、γ処理、階調処理、シャープネス補正処理、色補正処理、およびノイズ低減処理等の画質補正処理、各画素がRGBそれぞれの信号値を有するように各画素の画素値を補間する補間処理、並びにCCD−RAWデータを輝度信号であるYデータと、青色色差信号であるCbデータおよび赤色色差信号であるCrデータとからなるYCデータに変換するYC処理を行う。この本画像とは、レリーズボタンが全押しされることによって実行される本撮影によりCCD18から取り込まれ、AFE20、画像入力コントローラ25経由でフレームメモリ26に格納された画像データにより表される画像である。   The image processing unit 31 performs image quality correction processing such as γ processing, gradation processing, sharpness correction processing, color correction processing, and noise reduction processing on the image data of the main image, and each pixel has a RGB signal value. Thus, the interpolation processing for interpolating the pixel value of each pixel, and the CCD-RAW data are converted into YC data composed of Y data that is a luminance signal, Cb data that is a blue color difference signal, and Cr data that is a red color difference signal. YC processing is performed. The main image is an image that is captured from the CCD 18 by main shooting executed when the release button is fully pressed and is represented by image data stored in the frame memory 26 via the AFE 20 and the image input controller 25. .

ここで、画質補正処理は、補間処理後に行ってもよく、補間処理の前に行ってもよい。本実施形態においては、補間処理後に画質補正処理を行うものとして説明する。   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 image processing unit 31. As shown in FIG. 4, the image processing unit 31 performs a γ processing unit 51 that performs γ correction processing, a brightness correction unit 52 that performs brightness correction processing, a gradation processing unit 53 that performs gradation processing, and color correction processing. A color correction unit 54, a noise correction unit 55 that performs noise reduction processing, and a sharpness processing unit 56 that performs sharpness processing are provided. In addition, in order to calculate parameters used in each processing unit, a thinning unit 57 that creates a reduced image by thinning out the image S0 before processing, and parameters used when processing in each processing unit is performed from the reduced image. A tone curve for calculating a tone curve used in the parameter calculating unit 58, a face detecting unit 59 for detecting a face from the reduced image, a face brightness calculating unit 60 for calculating the average brightness of the detected face, and a tone processing unit 53 A calculation unit 61 is provided. The brightness correction unit 52 may correct only the brightness of the face.

パラメータ算出部58は、縮小画像の全画素の平均値、最高輝度、最低輝度、高周波成分等の特徴量を算出し、特徴量に基づいて、γ補正、明るさ補正、色補正、ノイズ補正およびシャープネス処理を行う際のパラメータを算出する。具体的には、γ補正量、明るさ補正量、色補正量、ノイズ補正量およびシャープネス処理の強調度をパラメータとして算出する。なお、これらのパラメータを算出する手法は公知の任意の手法を用いることができる。   The parameter calculation unit 58 calculates a feature value such as an average value, maximum brightness, minimum brightness, and high frequency component of all pixels of the reduced image, and based on the feature value, γ correction, brightness correction, color correction, noise correction, and Calculate parameters for sharpness processing. Specifically, the γ correction amount, the brightness correction amount, the color correction amount, the noise correction amount, and the enhancement degree of sharpness processing are calculated as parameters. Note that any known method can be used as a method for calculating these parameters.

また、後述するように、画像が低輝度撮影により取得されたものでない場合、およびフラッシュ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 flash 24, and even when low-luminance shooting is performed, When the face is not included, the parameter calculation unit 58 calculates a gradation curve as a gradation processing parameter based on the feature amount. On the other hand, when the image is acquired with low brightness shooting without using the flash 24 and a face is detected from the image acquired by shooting, the gradation curve calculation unit 61 calculates the gradation curve as described later. To do.

顔検出部59は、テンプレートマッチングによる手法、顔の多数のサンプル画像を用いてマシンラーニング学習により得られた顔判別器を用いる手法等により、縮小画像から顔を囲む矩形の領域(顔領域)を顔として検出する。なお、顔を検出する手法はこれに限定されるものではなく、例えば画像における肌色を有しかつ顔の輪郭形状を囲む矩形の領域を顔として検出する手法、顔の輪郭形状をなす領域を顔として検出する手法等、任意の手法を用いることができる。また、画像に顔が複数含まれている場合には、顔検出部59はすべての顔を検出する。そして、顔が検出された場合にのみ、検出された顔の位置を表す情報を顔輝度算出部60に出力する。なお、画像から顔が検出されない場合には、顔検出部59は、その旨の情報をパラメータ算出部58に出力する。   The face detection unit 59 detects a rectangular region (face region) surrounding the face from the reduced image by a template matching method, a method using a face discriminator obtained by machine learning learning using a large number of sample images of a face, and the like. Detect as a face. Note that the method for detecting a face is not limited to this. For example, a method for detecting a rectangular region having a skin color in an image and surrounding the contour shape of the face as a face, and a region forming the face contour shape as a face. Any method such as a detection method can be used. When the image includes a plurality of faces, the face detection unit 59 detects all the faces. Only when a face is detected, information indicating the position of the detected face is output to the face luminance calculation unit 60. When no face is detected from the image, the face detection unit 59 outputs information to that effect to the parameter calculation unit 58.

顔輝度算出部60は、明るさ補正後の画像について、縮小画像から検出された顔領域に対応する領域に含まれる画素の平均輝度Yf_aveを算出する。なお、顔が複数検出された場合は、すべての顔領域の平均輝度Yf_aveを算出する。   The face luminance calculation unit 60 calculates the average luminance Yf_ave of the pixels included in the area corresponding to the face area detected from the reduced image, for the image after brightness correction. If a plurality of faces are detected, the average luminance Yf_ave of all face areas is calculated.

階調カーブ算出部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 maximum luminance 255, and the input value Yin_d is an intermediate value between the average luminance Yf_ave and the minimum luminance 0.

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 internal memory 35 as a table.

そして、階調カーブ算出部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 condition determination unit 62 determines whether or not the image is obtained by low-luminance shooting based on the exposure value calculated by the AE processing unit 29. Further, it is determined whether or not a face is included based on whether or not it is obtained using the flash 24 and the face detection result by the face detection unit 59. When it is determined that the image is acquired by low-luminance shooting, the flash 24 is not used, and a face is further included, the determination result is set as the first determination result, and the determination result is set as the parameter calculation unit 58 and the face luminance. It outputs to the calculation part 60 and the gradation curve calculation part 61. Whether or not low-luminance shooting is performed is determined by determining low-luminance shooting when the exposure value is 5 EV or less, preferably 3 EV or less. On the other hand, in cases other than the first determination result, the determination result is output to the parameter calculation unit 58, the face luminance calculation unit 60, and the gradation curve calculation unit 61 as the second determination result.

圧縮/伸長処理部32は、画像処理部31によって処理が行われた本画像の画像データに対して、例えば、JPEG等の圧縮形式で圧縮処理を行い画像ファイルを生成する。この画像ファイルには、Exifフォーマット等に基づいて、撮影日時等の付帯情報が格納されたタグが付加される。   The compression / decompression processing unit 32 generates an image file by compressing the image data of the main image processed by the image processing unit 31 in a compression format such as JPEG. A tag storing incidental information such as shooting date and time is added to the image file based on the Exif format or the like.

メディア制御部33は、不図示のメディアスロットルに着脱自在にセットされた記録メディア34にアクセスして、画像ファイルの書き込みと読み込みの制御を行う。   The media control unit 33 accesses a recording medium 34 that is detachably set on a media throttle (not shown), and controls writing and reading of an image file.

内部メモリ35は、デジタルカメラ1において設定される各種定数、上述した図6に示すテーブル、およびCPU40が実行するプログラム等を記憶する。   The internal memory 35 stores various constants set in the digital camera 1, the table shown in FIG. 6 described above, a program executed by the CPU 40, and the like.

CPU40は、操作ボタン8およびAF処理部28等の各種処理部からの信号に応じてデジタルカメラ1の本体各部を制御する。   The CPU 40 controls each part of the main body of the digital camera 1 in accordance with signals from various processing units such as the operation button 8 and the AF processing unit 28.

データバス41は、各種処理部、フレームメモリ26およびCPU40等に接続されており、画像データおよび各種指示等のやり取りを行う。   The data bus 41 is connected to various processing units, the frame memory 26, the CPU 40, and the like, and exchanges image data and various instructions.

次いで、本実施形態において行われる処理について説明する。なお、本実施形態は本撮影により取得した画像に対して画質補正処理を施す点に特徴を有するため、以降の説明においては、本撮影により画像が取得された以降の処理についてのみ説明する。図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 frame memory 26 and further subjected to interpolation processing, the thinning unit 57 thins out pixels of the image after interpolation processing to reduce the reduced image. Is generated (step ST1). Then, the face detection unit 59 detects a face from the reduced image (step ST2).

一方、条件判定部62は、画像が低輝度撮影により取得されたものであるか否か、およびフラッシュ24を使用して取得されたものであるか否か、および顔が含まれるか否かを判定する(判定処理、ステップST3)。   On the other hand, the condition determination unit 62 determines whether the image is acquired by low-luminance shooting, whether the image is acquired using the flash 24, and whether a face is included. Determine (determination process, step ST3).

判定結果が第1の判定結果である場合、パラメータ算出部58は、γ補正、明るさ補正、色補正、ノイズ補正およびシャープネス処理のパラメータを算出する(第1のパラメータ算出、ステップST4)。そして、γ処理部51がγ補正を行い(ステップST5)、明るさ補正部52が画像の明るさを補正する(ステップST6)。   When the determination result is the first determination result, the parameter calculation unit 58 calculates parameters for γ correction, brightness correction, color correction, noise correction, and sharpness processing (first parameter calculation, step ST4). Then, the γ processing unit 51 performs γ correction (step ST5), and the brightness correction unit 52 corrects the brightness of the image (step ST6).

一方、顔輝度算出部60が、明るさ補正後の画像に含まれる顔の平均輝度Yf_aveを算出し(ステップST7)、階調カーブ算出部61が平均輝度Yf_aveを用いて、上述したように階調カーブを算出する(ステップST8)。   On the other hand, the face luminance calculation unit 60 calculates the average luminance Yf_ave of the face included in the image after brightness correction (step ST7), and the gradation curve calculation unit 61 uses the average luminance Yf_ave as described above. A tone curve is calculated (step ST8).

そして、階調処理部53が、階調カーブ算出部61が算出した階調カーブを用いて階調処理を行う(ステップST9)。そして、色補正部54が色補正処理を行う(ステップST10)。この際、色補正部54は、パラメータ算出部58が決定した色補正のパラメータをそのまま用いてもよいが、上述したように算出した階調カーブを用いた階調処理により画像の彩度が高くなるため、彩度を低下させるようにパラメータを修正して、色補正処理を行うことが好ましい。   Then, the gradation processing unit 53 performs gradation processing using the gradation curve calculated by the gradation curve calculating unit 61 (step ST9). Then, the color correction unit 54 performs color correction processing (step ST10). At this time, the color correction unit 54 may use the color correction parameters determined by the parameter calculation unit 58 as they are, but the image saturation is high by the gradation processing using the gradation curve calculated as described above. For this reason, it is preferable to perform color correction processing by correcting parameters so as to reduce saturation.

さらに、ノイズ補正部55がノイズ補正処理を行う(ステップST11)。この際、ノイズ補正部55は、パラメータ算出部58が決定したノイズ補正のパラメータをそのまま用いてもよいが、上述したように算出した階調カーブを用いた階調処理により画像のノイズが強調されるため、より多くのノイズを低減するようにパラメータを修正して、ノイズ補正処理を行うことが好ましい。最後にシャープネス処理部56がシャープネス処理を行い(ステップST12)、処理済み画像S1を生成する。   Further, the noise correction unit 55 performs noise correction processing (step ST11). At this time, the noise correction unit 55 may use the noise correction parameter determined by the parameter calculation unit 58 as it is, but the noise of the image is emphasized by the gradation process using the gradation curve calculated as described above. Therefore, it is preferable to perform a noise correction process by correcting parameters so as to reduce more noise. Finally, the sharpness processing unit 56 performs sharpness processing (step ST12), and generates a processed image S1.

一方、判定結果が、第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 parameter calculation unit 58 calculates the gradation processing parameters in addition to the parameters of γ correction, brightness correction, color correction, noise correction, and sharpness processing ( Second parameter calculation, step ST13). Then, the γ processing unit 51, the brightness correction unit 52, the gradation processing unit 53, the color correction unit 54, the noise correction unit 55, and the sharpness processing unit 56 perform processing using the parameters calculated by the parameter calculation unit 58, and have been processed. An image S1 is generated (normal image processing, step ST14).

処理済み画像S1は、YC処理が施された後圧縮/伸長処理部32に入力され、圧縮/伸長処理部32が処理済み画像S1の画像ファイルを生成し(ステップST15)、次いでメディア制御部33が画像ファイルを記録メディア34に記録し(ステップST16)、処理を終了する。   The processed image S1 is input to the compression / decompression processing unit 32 after YC processing is performed, and the compression / decompression processing unit 32 generates an image file of the processed image S1 (step ST15), and then the media control unit 33 Records the image file on the recording medium 34 (step ST16), and ends the process.

このように、本実施形態においては、検出された顔の平均輝度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 flash 24 is not used, and a face is further included, the gradation curve calculation unit 61 calculates the gradation curve. However, without providing such a condition, the gradation curve calculation unit 61 performs gradation only when a face is detected regardless of whether low-luminance photography or photography using the flash 24 is used. A curve may be calculated.

また、上記実施形態においては、図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 condition determination unit 62 determines whether or not low-luminance shooting is performed based on the exposure value. May be determined. In this case, when the ISO sensitivity is 1600 or more, it may be determined that the low-luminance shooting is performed.

以上、本発明の実施形態について説明したが、コンピュータを、上記の画像処理部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 image processing unit 31 and perform processing as shown in FIG. 7 is also one of the embodiments of the present invention. It is. A computer-readable recording medium that records such a program is also one embodiment of the present invention.

本発明の実施形態による画像処理装置を適用したデジタルカメラの外観を示す図(正面側)The figure (front side) which shows the external appearance of the digital camera to which the image processing apparatus by embodiment of this invention is applied 本発明の実施形態による画像処理装置を適用したデジタルカメラの外観を示す図(背面側)The figure (back side) which shows the appearance of the digital camera to which the image processing device by an embodiment of the present invention is applied. 本発明の実施形態による画像処理装置を適用したデジタルカメラの内部構成を示す概略ブロック図1 is a schematic block diagram showing an internal configuration of a digital camera to which an image processing apparatus according to an embodiment of the present invention is applied. 画像処理部における画質補正処理を行う部分のブロック図Block diagram of the portion that performs image quality correction processing in the image processing unit 階調カーブの算出を説明するための図Diagram for explaining the calculation of gradation curve 平均輝度Yf_aveの値に応じたハイライト側およびシャドー側不動点の出力値Yout_h、Yout_dの関係を示す図The figure which shows the relationship of the output value Yout_h and Yout_d of the highlight side and the shadow side fixed point according to the value of the average luminance Yf_ave 本実施形態において行われる処理を示すフローチャートA flowchart showing processing performed in the present embodiment 階調カーブの他の例を示す図Diagram showing another example of gradation curve

符号の説明Explanation of symbols

1 デジタルカメラ
2 レリーズボタン
5 モニタ
10 撮像部
31 画像処理部
51 γ処理部
52 明るさ補正部
53 階調処理部
54 色補正部
55 ノイズ補正部
56 シャープネス処理部
57 間引き部
58 パラメータ算出部
59 顔検出部
60 顔輝度算出部
61 階調カーブ算出部
62 条件判定部
DESCRIPTION OF SYMBOLS 1 Digital camera 2 Release button 5 Monitor 10 Image pick-up part 31 Image processing part 51 γ processing part 52 Brightness correction part 53 Tone processing part 54 Color correction part 55 Noise correction part 56 Sharpness processing part 57 Decimation part 58 Parameter calculation part 59 Face Detection unit 60 Face luminance calculation unit 61 Gradation curve calculation unit 62 Condition determination unit

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.
前記階調カーブ算出手段は、前記検出された顔を含む顔領域の平均輝度を不動点とする階調カーブを算出する手段であることを特徴とする請求項1記載の画像処理装置。   2. The image processing apparatus according to claim 1, wherein the gradation curve calculating means is a means for calculating a gradation curve having an average luminance of a face area including the detected face as a fixed point. 前記画質補正処理が明るさ補正処理を含む場合、前記階調カーブ算出手段は、該明るさ補正後の前記顔の輝度近傍を不動点とした階調カーブを算出する手段であることを特徴とする請求項1または2記載の画像処理装置。   When the image quality correction process includes a brightness correction process, the gradation curve calculation means is a means for calculating a gradation curve with the brightness vicinity of the face after the brightness correction as a fixed point. The image processing apparatus according to claim 1 or 2. 前記画質補正処理がγ処理を含む場合、前記階調カーブ算出手段は、該γ処理後の前記顔の輝度近傍を不動点とした階調カーブを算出する手段であることを特徴とする請求項請求項1から3のいずれか1項記載の画像処理装置。   2. The gradation curve calculating means is a means for calculating a gradation curve with the vicinity of the brightness of the face after the γ processing as a fixed point when the image quality correction processing includes γ processing. The image processing apparatus according to claim 1. 前記画像が低輝度撮影により取得されたものである場合、前記階調カーブ算出手段は、前記不動点よりもハイライト側を硬調化し、該不動点よりもシャドー側を軟調化するS字階調カーブを算出する手段であることを特徴とする請求項1から4のいずれか1項記載の画像処理装置。   When the image is obtained by low-luminance shooting, the gradation curve calculation means hardens the highlight side with respect to the fixed point and softens the shadow side with respect to the fixed point. 5. The image processing apparatus according to claim 1, wherein the image processing apparatus is a means for calculating a curve. 前記画質補正処理が色補正処理を含む場合、前記画像処理手段は、前記階調処理の後に前記画像の彩度を低くするよう前記色補正処理を行う手段であることを特徴とする請求項5記載の画像処理装置。   The image processing means is means for performing the color correction processing so as to lower the saturation of the image after the gradation processing when the image quality correction processing includes color correction processing. The image processing apparatus described. 前記画質補正処理がノイズ低減処理を含む場合、前記画像処理手段は、前記階調処理の後に前記画像のノイズをより低くするよう前記ノイズ低減処理を行う手段であることを特徴とする請求項5または6記載の画像処理装置。   6. The image processing unit according to claim 5, wherein when the image quality correction processing includes noise reduction processing, the image processing means performs the noise reduction processing so as to lower noise of the image after the gradation processing. Or the image processing apparatus of 6. 撮影により取得された画像から顔を検出し、
前記検出された顔の輝度近傍を不動点として、該不動点を基準とした前記画像のハイライト側およびシャドー側の階調特性を変化させる階調カーブを算出し、
前記階調カーブを用いた階調処理を含む画質補正処理を前記画像に対して施すことにより処理済み画像を生成することを特徴とする画像処理方法。
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. .
JP2008157694A 2008-06-17 2008-06-17 Image processing apparatus and method, and program Withdrawn JP2009303111A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (1)

* Cited by examiner, † Cited by third party
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