Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP4823979B2 - Image processing apparatus and method, and program - Google Patents
[go: Go Back, main page]

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

Image processing apparatus and method, and program Download PDF

Info

Publication number
JP4823979B2
JP4823979B2 JP2007190529A JP2007190529A JP4823979B2 JP 4823979 B2 JP4823979 B2 JP 4823979B2 JP 2007190529 A JP2007190529 A JP 2007190529A JP 2007190529 A JP2007190529 A JP 2007190529A JP 4823979 B2 JP4823979 B2 JP 4823979B2
Authority
JP
Japan
Prior art keywords
image
correction
value
calculating
processing apparatus
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.)
Expired - Fee Related
Application number
JP2007190529A
Other languages
Japanese (ja)
Other versions
JP2009027583A (en
Inventor
秀昭 國分
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 JP2007190529A priority Critical patent/JP4823979B2/en
Publication of JP2009027583A publication Critical patent/JP2009027583A/en
Application granted granted Critical
Publication of JP4823979B2 publication Critical patent/JP4823979B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、例えばデジタルカメラ等の撮像装置により取得された画像に対して画像処理を施す画像処理装置および方法並びに画像処理方法をコンピュータに実行させるためのプログラムに関するものである。   The present invention relates to an image processing apparatus and method for performing image processing on an image acquired by an imaging apparatus such as a digital camera, and a program for causing a computer to execute the image processing method.

デジタルカメラ等の撮像装置や、スキャナ等の原稿を読み取る読取装置により取得された画像に対して、階調処理等の画像処理を施すことにより、画像の画質を向上させることが行われている。   The image quality of an image is improved by performing image processing such as gradation processing on an image acquired by an imaging device such as a digital camera or an image reading device such as a scanner.

例えば、画像に含まれる人物の明るさの情報に基づいて、画像が逆光である信頼度および逆光度、並びに人物シーンである信頼度および人物度を判定し、これらの情報に基づいて画像の階調補正を行う手法が提案されている(特許文献1参照)。また、画像から顔領域を検出し、顔領域の輝度値と、画像の全領域の輝度の分布情報とに基づいて、画像を補正するための補正テーブルを算出し、この補正テーブルを用いて画像の色調を補正する手法が提案されている(特許文献2参照)。特許文献2に記載された手法によれば、人物を含む画像において、顔の階調を好ましいものとすることができるとともに、顔の背景も好ましい階調とすることができる。
特開平8−62741号公報 特開2007−124604号公報
For example, the reliability and backlight intensity of the image is determined based on the brightness information of the person included in the image, and the reliability and character level of the person scene are determined, and the image level is determined based on the information. A technique for performing tone correction has been proposed (see Patent Document 1). Further, a face area is detected from the image, a correction table for correcting the image is calculated based on the brightness value of the face area and the luminance distribution information of the entire area of the image, and the correction table is used to calculate the image. There has been proposed a method for correcting the color tone (see Patent Document 2). According to the technique described in Patent Literature 2, it is possible to make the gradation of the face preferable in an image including a person, and it is also possible to set the background of the face to a preferable gradation.
JP-A-8-62741 JP 2007-124604 A

しかしながら、画像に含まれる人物の顔は、均一な明るさを有する場合のみならず、ハイライトやシャドーとなる領域を含む場合があり、さらには、顔領域内においてコントラストが変化する場合がある。また、画像の全領域についても、ハイライトやシャドーとなる領域を含む場合があり、さらには、画像全体のコントラストも変化する場合がある。このため、特許文献1,2に記載された手法のように、顔や画像の全領域の輝度を用いるのみでは、例えばコントラストがある顔の場合、過補正となって顔が明るすぎるものとなってしまう場合がある。   However, the face of a person included in the image may include not only a uniform brightness but also an area that becomes a highlight or shadow, and the contrast may change within the face area. Also, the entire area of the image may include an area that becomes a highlight or a shadow, and the contrast of the entire image may also change. For this reason, using only the brightness of the entire area of the face or image as in the methods described in Patent Documents 1 and 2, for example, in the case of a face with contrast, the face becomes too bright due to overcorrection. May end up.

本発明は上記事情に鑑みなされたものであり、画像に含まれる顔等の特定領域および画像の全領域の種々の状況を考慮して、適切に画像を補正できるようにすることを目的とする。   The present invention has been made in view of the above circumstances, and an object thereof is to allow an image to be corrected appropriately in consideration of various situations of a specific region such as a face included in an image and the entire region of the image. .

本発明による画像処理装置は、入力される画像に含まれる特定領域の代表値および、該特定領域についての複数の特徴をそれぞれ表す複数の第1の特徴量を算出する第1の特徴量算出手段と、
前記画像の全領域の特徴量を表す少なくとも1つの第2の特徴量を算出する第2の特徴量算出手段と、
前記代表値、前記複数の第1の特徴量および前記第2の特徴量に基づいて、前記画像を補正するための補正値を算出する補正値算出手段とを備えたことを特徴とするものである。
An image processing apparatus according to the present invention includes a first feature amount calculating unit that calculates a representative value of a specific region included in an input image and a plurality of first feature amounts respectively representing a plurality of features of the specific region. When,
A second feature amount calculating means for calculating at least one second feature amount representing the feature amount of the entire area of the image;
And a correction value calculating means for calculating a correction value for correcting the image based on the representative value, the plurality of first feature amounts, and the second feature amount. is there.

なお、本発明による画像処理装置においては、前記補正値を、前記特定領域の代表値の目標とする値としてもよい。   In the image processing apparatus according to the present invention, the correction value may be a target value of the representative value of the specific area.

また、本発明による画像処理装置においては、前記画像から前記特定領域を検出する検出手段をさらに備えるものとしてもよい。   The image processing apparatus according to the present invention may further include detection means for detecting the specific area from the image.

また、本発明による画像処理装置においては、前記第1の特徴量算出手段を、前記特定領域の輝度、コントラストおよび該特定領域における特定の輝度の頻度の割合を前記第1の特徴量として算出する手段としてもよい。   In the image processing apparatus according to the present invention, the first feature amount calculating means calculates the luminance and contrast of the specific region and the ratio of the frequency of the specific luminance in the specific region as the first feature amount. It may be a means.

また、本発明による画像処理装置においては、前記第2の特徴量算出手段を、前記全領域の輝度、コントラスト、色差および該全領域における特定の輝度の頻度の割合の少なくとも1つを前記第2の特徴量として算出する手段としてもよい。   In the image processing apparatus according to the present invention, the second feature amount calculating means may be configured to calculate at least one of the luminance, contrast, and color difference of the entire area and the frequency ratio of the specific luminance in the entire area. It is good also as a means to calculate as a feature-value.

また、本発明による画像処理装置においては、前記第1の特徴量算出手段を、前記特定領域の輝度および各色成分のいずれかから前記代表値を算出する手段としてもよい。   In the image processing apparatus according to the present invention, the first feature amount calculation unit may be a unit that calculates the representative value from either the luminance of the specific region or each color component.

また、本発明による画像処理装置においては、前記補正値算出手段を、前記第1の特徴量および前記第2の特徴量を、所定のパラメータにより定められる演算式に適用して前記補正値を算出する手段としてもよい。   In the image processing apparatus according to the present invention, the correction value calculation unit calculates the correction value by applying the first feature amount and the second feature amount to an arithmetic expression determined by a predetermined parameter. It is good also as a means to do.

この場合、前記所定のパラメータを、複数のサンプル画像を用いての評価実験に基づいて設定されたパラメータとしてもよい。   In this case, the predetermined parameter may be a parameter set based on an evaluation experiment using a plurality of sample images.

また、本発明による画像処理装置においては、前記補正値算出手段を、前記補正値に基づいて補正テーブルを算出する手段としてもよい。   In the image processing apparatus according to the present invention, the correction value calculation unit may be a unit that calculates a correction table based on the correction value.

この場合、前記補正テーブルによる前記画像の補正が過補正となるか否かを判定し、該判定が肯定された場合に前記補正テーブルよりも補正量を抑制した新たな補正テーブルを算出する補正値修正手段をさらに備えるものとしてもよい。   In this case, it is determined whether or not the correction of the image by the correction table is overcorrected, and when the determination is affirmative, a correction value for calculating a new correction table in which the correction amount is suppressed compared to the correction table It may be further provided with a correcting means.

またこの場合、前記補正値修正手段を、前記過補正となるか否かの判定を、前記画像における基準値を前記補正テーブルを用いて補正することにより取得される補正値が、所定のしきい値よりも大きく補正されるか否かを判定することにより行う手段としてもよい。   Also, in this case, the correction value obtained by correcting the correction value correction means to determine whether or not the overcorrection is performed using the correction table to correct the reference value in the image is a predetermined threshold. Means for determining whether or not the correction is larger than the value may be used.

また、本発明による画像処理装置においては、前記補正テーブルに基づいて前記画像データを補正する補正手段をさらに備えるものとしてもよい。   The image processing apparatus according to the present invention may further include a correcting unit that corrects the image data based on the correction table.

また、本発明による画像処理装置においては、前記補正テーブルに基づいて、該補正テーブルよりも補正の程度が異なる少なくとも1つの他の補正テーブルを算出する補正テーブル算出手段をさらに備えるものとしてもよい。   The image processing apparatus according to the present invention may further include a correction table calculating unit that calculates at least one other correction table having a degree of correction different from that of the correction table based on the correction table.

この場合、前記補正テーブルおよび前記他の補正テーブルに基づいて前記画像データを補正して複数の処理済み画像データを取得する補正手段と、
前記複数の処理済み画像データにより表される複数の処理済み画像を表示する表示手段と、
前記複数の処理済み画像における所望とされる処理済み画像の選択を受け付ける選択手段とを備えるものとしてもよい。
In this case, correction means for correcting the image data based on the correction table and the other correction table to obtain a plurality of processed image data;
Display means for displaying a plurality of processed images represented by the plurality of processed image data;
The image processing apparatus may further include selection means for receiving selection of a desired processed image from the plurality of processed images.

また、本発明による画像処理装置においては、前記第1の特徴量算出手段を、前記画像における前記特定領域の画素値の分布情報に基づいて、前記複数の第1の特徴量を算出する手段としてもよい。   In the image processing apparatus according to the present invention, the first feature amount calculating unit may be configured to calculate the plurality of first feature amounts based on pixel value distribution information of the specific region in the image. Also good.

また、本発明による画像処理装置においては、前記第2の特徴量算出手段を、前記画像における前記全領域の画素値の分布情報に基づいて、前記第2の特徴量を算出する手段としてもよい。   In the image processing apparatus according to the present invention, the second feature amount calculating unit may be a unit that calculates the second feature amount based on pixel value distribution information of the entire region in the image. .

本発明による画像処理方法は、入力される画像に含まれる特定領域の代表値および、該特定領域についての複数の特徴をそれぞれ表す複数の第1の特徴量を算出し、
前記画像の全領域の特徴量を表す少なくとも1つの第2の特徴量を算出し、
前記複数の第1の特徴量および前記第2の特徴量に基づいて、前記画像を補正するための補正値を算出することを特徴とするものである。
The image processing method according to the present invention calculates a representative value of a specific area included in an input image and a plurality of first feature amounts respectively representing a plurality of features for the specific area,
Calculating at least one second feature amount representing the feature amount of the entire region of the image;
A correction value for correcting the image is calculated based on the plurality of first feature amounts and the second feature amount.

なお、本発明による画像処理方法をコンピュータに実行させるためのプログラムとして提供してもよい。   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.

本発明によれば、入力される画像に含まれる特定領域の代表値および、特定領域についての複数の特徴をそれぞれ表す複数の第1の特徴量が算出され、画像の全領域の特徴量を表す少なくとも1つの第2の特徴量が算出される。そして、代表値、複数の第1の特徴量および第2の特徴量に基づいて、画像を補正するための補正値が算出される。このように、本発明においては、特定領域の複数の特徴量に基づいて補正値を算出するようにしたため、輝度のように1つの特徴量のみに基づいて補正値を算出する場合と比較して、より適切に特定領域を補正することができる。また、画像の全領域の特徴量も考慮しているため、特定領域のみならず、画像全体も適切に補正することができる。   According to the present invention, the representative value of the specific region included in the input image and the plurality of first feature amounts respectively representing the plurality of features of the specific region are calculated, and the feature amount of the entire region of the image is represented. At least one second feature amount is calculated. Then, a correction value for correcting the image is calculated based on the representative value, the plurality of first feature amounts, and the second feature amount. As described above, in the present invention, the correction value is calculated based on a plurality of feature amounts in the specific area, so that the correction value is calculated based on only one feature amount such as luminance. Thus, the specific area can be corrected more appropriately. Further, since the feature amount of the entire area of the image is taken into consideration, not only the specific area but also the entire image can be corrected appropriately.

また、補正値を特定領域の代表値の目標とする値とすることにより、補正値により画像を補正した場合に、特定領域の代表値を目標とする値とすることができる。   Further, by setting the correction value as the target value of the representative value of the specific area, when the image is corrected with the correction value, the representative value of the specific area can be set as the target value.

また、画像から特定領域を検出することにより、本発明の画像処理装置のユーザが画像上において特定領域を指定する作業を行う必要がなくなるため、ユーザの負担を軽減できる。   Further, by detecting the specific area from the image, it is not necessary for the user of the image processing apparatus of the present invention to specify the specific area on the image, so that the burden on the user can be reduced.

また、特定領域の輝度、コントラストおよび特定領域における特定の輝度の頻度の割合を第1の特徴量として算出することにより、特定領域の輝度、コントラストおよび特定の輝度の頻度の割合を考慮して、特定領域の明るさおよびコントラストをより好ましいものとすることができる。とくに特定領域が顔である場合には、顔の明るさおよびコントラストをより好ましいものとすることができる。   In addition, by calculating the ratio of the luminance and contrast of the specific area and the frequency of the specific luminance in the specific area as the first feature amount, the luminance of the specific area, the contrast and the ratio of the frequency of the specific luminance are considered, The brightness and contrast of the specific area can be made more preferable. In particular, when the specific area is a face, the brightness and contrast of the face can be made more preferable.

また、画像の全領域の輝度、コントラスト、色差および全領域における特定の輝度の頻度の割合の少なくとも1つを第2の特徴量として算出することにより、画像全体の輝度、コントラスト、色差および特定の輝度の頻度の割合を考慮して、画像の全領域の明るさ、コントラストあるいは色をより好ましいものとすることができる。   Further, by calculating at least one of the luminance, contrast, color difference of the entire area of the image and the ratio of the frequency of the specific brightness in the entire area as the second feature amount, the brightness, contrast, color difference of the entire image, and the specific frequency are calculated. Considering the ratio of luminance frequency, the brightness, contrast or color of the entire area of the image can be made more preferable.

また、第1の特徴量および第2の特徴量を、所定のパラメータにより定められる演算式に適用することにより、補正値を簡易に算出することができる。   Further, the correction value can be easily calculated by applying the first feature amount and the second feature amount to an arithmetic expression determined by a predetermined parameter.

この場合、所定のパラメータを複数のサンプル画像を用いての評価実験に基づいて設定されたパラメータとすることにより、ロバスト性のよい補正値を算出することができる。   In this case, a robust correction value can be calculated by setting the predetermined parameter to a parameter set based on an evaluation experiment using a plurality of sample images.

また、補正値に基づいて算出した補正テーブルを用いることにより、簡易に画像を補正することができる。   Further, the image can be easily corrected by using the correction table calculated based on the correction value.

また、補正テーブルによる画像の補正が過補正となる場合には、この補正テーブルよりも補正量を抑制した新たな補正テーブルを算出することにより、画像が過補正となることを防止することができる。   In addition, when the correction of the image by the correction table is overcorrection, it is possible to prevent the image from being overcorrected by calculating a new correction table in which the correction amount is suppressed from that of the correction table. .

補正テーブルよりも補正の度合が異なる少なくとも1つの他の補正テーブルを算出することにより、様々な補正の程度の処理済み画像を得ることができる。   By calculating at least one other correction table having a degree of correction different from that of the correction table, processed images having various degrees of correction can be obtained.

この場合、様々な補正の程度の処理済み画像を表示し、所望とされる処理済み画像の選択を受け付けることにより、所望とされる画質の処理済み画像を得ることができる。また、選択された処理済み画像のみを記録しておけばよいため、画像を記録する記録メディアの容量の消費を防止することができる。   In this case, processed images having various degrees of correction are displayed, and a processed image having a desired image quality can be obtained by receiving selection of a desired processed image. Further, since it is only necessary to record the selected processed image, it is possible to prevent the consumption of the capacity of the recording medium for recording the image.

以下、図面を参照して本発明の実施形態について説明する。図1は本発明の第1の実施形態による画像処理装置を適用したデジタルカメラの構成を示す概略ブロック図である。なお、図1に示すデジタルカメラ1においては、本発明と直接関係のない部分について図示および説明を省略する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a schematic block diagram showing the configuration of a digital camera to which the image processing apparatus according to the first embodiment of the present invention is applied. In the digital camera 1 shown in FIG. 1, illustration and description of portions not directly related to the present invention are omitted.

図1に示すように、デジタルカメラ1は、撮像部10、前処理部12、信号処理部14、モニタ16および記録部18を備える。   As shown in FIG. 1, the digital camera 1 includes an imaging unit 10, a preprocessing unit 12, a signal processing unit 14, a monitor 16, and a recording unit 18.

撮像部10は、図示しない入射光を電気信号に変換する複数の受光素子が2次元的に配設された撮像素子を備え、撮像素子により変換された信号を読み出す機能を有する。撮像素子としては、例えばCCD(Charge Coupled Device)型またはC−MOS(Complimentary−Metal Oxide Semiconductor)型のものがあり、これ以外の信号読出し型のものであってもよい。   The imaging unit 10 includes an imaging element in which a plurality of light receiving elements (not shown) that convert incident light into an electrical signal are two-dimensionally arranged, and has a function of reading a signal converted by the imaging element. Examples of the imaging element include a CCD (Charge Coupled Device) type or a C-MOS (Complimentary-Metal Oxide Semiconductor) type, and may be other signal readout type.

また、撮像部10は、図示しない駆動部から供給される駆動信号に応じて撮像素子の各受光素子に対応して得られたアナログ撮像信号を取得し、アナログ撮像信号のノイズを除去する処理およびアナログ撮像信号のゲインを調節する処理(以下アナログ処理とする)を行い、さらに、アナログ処理済みのアナログ撮像信号をデジタル信号に変換してデジタルの画像データS0を前処理部12に出力する機能をも有する。ここで、本実施形態においては、画像データS0は8ビットの階調を有するものとする。なお、以降の説明においては、画像データS0により表される画像についても参照符号としてS0を用いるものとする。   In addition, the imaging unit 10 acquires an analog imaging signal obtained corresponding to each light receiving element of the imaging element in accordance with a drive signal supplied from a driving unit (not shown), and removes noise from the analog imaging signal A function of adjusting the gain of the analog imaging signal (hereinafter referred to as analog processing), converting the analog processed analog imaging signal into a digital signal, and outputting the digital image data S0 to the preprocessing unit 12 Also have. Here, in the present embodiment, it is assumed that the image data S0 has an 8-bit gradation. In the following description, S0 is used as a reference symbol for the image represented by the image data S0.

前処理部12は、オフセット部20、ホワイトバランス(WB)調整部22、ガンマ補正部24、顔検出部26、第1の特徴量算出部28、第2の特徴量算出部30、および補正値算出部32を備える。   The preprocessing unit 12 includes an offset unit 20, a white balance (WB) adjustment unit 22, a gamma correction unit 24, a face detection unit 26, a first feature amount calculation unit 28, a second feature amount calculation unit 30, and a correction value. A calculation unit 32 is provided.

オフセット部20は、オフセット調整、すなわちデジタルの画像データS0の各画素に対応する画素値を所定のレベルにそろえる機能を有する。   The offset unit 20 has a function of adjusting the pixel values corresponding to each pixel of the offset adjustment, that is, the digital image data S0 to a predetermined level.

WB調整部22は、オフセット部20から入力される画像データS0に対してホワイトバランスを調整する機能を有する。   The WB adjustment unit 22 has a function of adjusting white balance for the image data S0 input from the offset unit 20.

ガンマ補正部24は、WB調整部22から入力される画像データS0を後述する補正値算出部32から供給される補正テーブルTBL0を用いて階調補正する機能を有する。なお、ガンマ補正部24は、階調補正された画像データS1を信号処理部14に出力する。画像データS1は、各画素毎に撮像部10における撮像素子の受光素子に対応した色成分を有するRAWデータである。なお、以降の説明においては、画像データS1により表される画像についても参照符号としてS1を用いるものとする。   The gamma correction unit 24 has a function of correcting the gradation of the image data S0 input from the WB adjustment unit 22 using a correction table TBL0 supplied from a correction value calculation unit 32 described later. Note that the gamma correction unit 24 outputs the image data S <b> 1 whose tone has been corrected to the signal processing unit 14. The image data S1 is RAW data having a color component corresponding to the light receiving element of the imaging element in the imaging unit 10 for each pixel. In the following description, S1 is used as a reference symbol for the image represented by the image data S1.

顔検出部26は、画像S0に含まれる顔領域をすべて検出する機能を有する。具体的には、顔検出部26は、テンプレートマッチングによる手法や、顔の多数のサンプル画像を用いてマシンラーニング学習により得られた顔判別器を用いる手法等により、画像S0上における顔を囲む所定範囲の領域を顔領域として検出する。   The face detection unit 26 has a function of detecting all face regions included in the image S0. Specifically, the face detection unit 26 uses a template matching method, a method using a face discriminator obtained by machine learning learning using a large number of sample images of the face, and the like to enclose a predetermined face on the image S0. A range area is detected as a face area.

第1の特徴量算出部28は、画像S0に含まれる顔領域の代表値R0、顔領域の輝度、コントラスト度、顔領域のハイライトの割合および顔領域の暗部の割合をそれぞれ特徴量T1〜T4として算出する。なお、特徴量T1〜T4が第1の特徴量となる。以下、特徴量T1〜T4の算出について具体的に説明する。   The first feature amount calculation unit 28 sets the representative value R0 of the face area included in the image S0, the brightness of the face area, the degree of contrast, the ratio of highlight of the face area, and the ratio of dark part of the face area as the feature amounts T1 to T1, respectively. Calculated as T4. The feature amounts T1 to T4 are the first feature amounts. Hereinafter, the calculation of the feature amounts T1 to T4 will be specifically described.

ここで顔検出部26は、図2に示すように顔を囲む矩形の領域を顔領域K1として検出するが、顔領域K1には、顔の周囲の背景、着衣および髪の毛等の顔以外の被写体が含まれる。このため、第1の特徴量算出部28は、顔領域K1の対角線の交点を中心として顔領域K1をあらかじめ定められた縮小率により縮小した領域を、特徴量T1〜T4の算出領域K2として設定する。   Here, the face detection unit 26 detects a rectangular area surrounding the face as a face area K1 as shown in FIG. 2, and the face area K1 includes subjects other than the face such as the background around the face, clothes, and hair. Is included. Therefore, the first feature amount calculation unit 28 sets a region obtained by reducing the face region K1 with a predetermined reduction ratio around the intersection of the diagonal lines of the face region K1 as the calculation region K2 of the feature amounts T1 to T4. To do.

まず、顔領域の輝度については、上述したように設定した算出領域K2内におけるG画素の画素値の平均値を用いる。なお、G画素の画素値のみならず、B画素またはR画素の画素値の平均値を用いてもよい。また、算出領域K2内において、各画素がRGB各色を有するものとなるように画素値を補間して各画素の画素値の輝度を算出し、算出した輝度の算出領域K2内における平均値を用いてもよい。   First, for the brightness of the face region, the average value of the G pixel values in the calculation region K2 set as described above is used. Note that not only the pixel value of the G pixel but also the average value of the pixel values of the B pixel or the R pixel may be used. In addition, the luminance of the pixel value of each pixel is calculated by interpolating the pixel value so that each pixel has RGB colors in the calculation region K2, and the average value of the calculated luminance in the calculation region K2 is used. May be.

なお、第1の特徴量算出部28は、後述する補正値を算出するために、算出した顔領域の輝度を0〜1000の値をとるように正規化する。正規化した値が特徴量T1となる。また、第1の特徴量算出部28は、正規化前の顔領域の輝度を顔領域の代表値R0として出力する。   Note that the first feature amount calculation unit 28 normalizes the calculated brightness of the face area to take a value of 0 to 1000 in order to calculate a correction value to be described later. The normalized value is the feature amount T1. In addition, the first feature amount calculation unit 28 outputs the luminance of the face area before normalization as the representative value R0 of the face area.

コントラスト度の特徴量T2については、以下のように算出する。まず、第1の特徴量算出部28は、算出領域K2内の輝度の分布情報であるヒストグラムを作成する。具体的には、算出領域K2内のG画素の信号レベルを横軸に、頻度を縦軸にプロットしてヒストグラムを作成する。図3は顔領域について算出したヒストグラムを示す図である。そして、第1の特徴量算出部28は、作成したヒストグラムH1において、頻度の最大値hist_maxに応じて頻度の最小値hist_minを設定する。hist_minは例えば下記の式(1)により算出する。これにより、頻度の最小値hist_minは、頻度の最大値hist_maxの10%の値となる。   The contrast feature value T2 is calculated as follows. First, the first feature amount calculation unit 28 creates a histogram that is luminance distribution information in the calculation region K2. Specifically, a histogram is created by plotting the signal level of the G pixel in the calculation region K2 on the horizontal axis and the frequency on the vertical axis. FIG. 3 shows a histogram calculated for the face area. Then, the first feature amount calculator 28 sets the minimum frequency value hist_min in accordance with the maximum frequency value hist_max in the created histogram H1. For example, hist_min is calculated by the following equation (1). As a result, the minimum frequency hist_min is 10% of the maximum frequency hist_max.

hist_min=hist_max×0.1 (1)
次いで、ヒストグラムH1において、頻度がhist_minを超える最小の信号レベルW_minおよび頻度がhist_minを超える最大の信号レベルW_maxを求め、W_maxとW_minとの差W_histをコントラスト度として下記の式(2)により算出する。
hist_min = hist_max × 0.1 (1)
Next, in the histogram H1, the minimum signal level W_min whose frequency exceeds hist_min and the maximum signal level W_max whose frequency exceeds hist_min are obtained, and the difference W_hist between W_max and W_min is calculated as the contrast level by the following equation (2). .

W_hist=W_max-W_min (2)
ここで、図3に示すヒストグラムH1はコントラストが比較的大きいため、コントラスト度W_histは比較的大きい値となる。一方、図3に破線で示すヒストグラムH2はコントラストが小さいため、コントラスト度W_histは比較的小さい値となる。なお、コントラスト度についても、0〜1000の値をとるように正規化し、正規化した値を特徴量T2とする。
W_hist = W_max-W_min (2)
Here, since the histogram H1 shown in FIG. 3 has a relatively large contrast, the contrast degree W_hist has a relatively large value. On the other hand, since the histogram H2 indicated by the broken line in FIG. 3 has a low contrast, the contrast degree W_hist has a relatively small value. Note that the degree of contrast is also normalized so as to take a value of 0 to 1000, and the normalized value is set as a feature amount T2.

また、顔領域のハイライトの割合については以下のように算出する。まず、第1の特徴量算出部28は、図4に示すように、輝度のヒストグラムH1において、信号レベルがしきい値Th1より大きい領域を図中斜線で示すハイライト領域S_face_highlightと定義し、ヒストグラムH1の全領域S_faceに対するハイライト領域S_face_highlightの割合を、下記の式(3)により顔領域のハイライトの割合highlight_ratio_faceとして算出する。なお、しきい値Th1としては画像データが8ビットであることから例えば250を用いる。   Further, the highlight ratio of the face area is calculated as follows. First, as shown in FIG. 4, the first feature amount calculation unit 28 defines a region where the signal level is higher than the threshold value Th1 in the luminance histogram H1 as a highlight region S_face_highlight indicated by hatching in the drawing, and the histogram The ratio of the highlight area S_face_highlight to the total area S_face of H1 is calculated as the highlight ratio highlight_ratio_face of the face area by the following equation (3). For example, 250 is used as the threshold Th1 because the image data is 8 bits.

highlight_ratio_face=S_face_highlight/S_face (3)
なお、ヒストグラムH1の全領域S_faceはヒストグラムH1の全頻度、ハイライト領域S_face_highlightは、ヒストグラムH1のしきい値Th1より大きい信号レベルの頻度である。そして、算出した顔領域のハイライトの割合highlight_ratio_faceを0〜1000の値をとるように正規化し、正規化した値を特徴量T3とする。
highlight_ratio_face = S_face_highlight / S_face (3)
Note that the entire area S_face of the histogram H1 is the total frequency of the histogram H1, and the highlight area S_face_highlight is the frequency of the signal level greater than the threshold value Th1 of the histogram H1. Then, the calculated highlight ratio of the face area highlight_ratio_face is normalized to take a value of 0 to 1000, and the normalized value is set as a feature amount T3.

また、顔領域の暗部の割合については以下のように算出する。まず、第1の特徴量算出部28は、図5に示すように、輝度のヒストグラムH1において、信号レベルがしきい値Th2より小さい領域を図中斜線で示す暗部領域S_face_darkと定義し、ヒストグラムH1の全領域S_faceに対する暗部領域S_face_darkの割合を下記の式(4)により顔領域の暗部の割合dark_ratio_faceとして算出する。なお、しきい値Th2としては画像データが8ビットであることから例えば50以下の値を用いる。   Further, the ratio of the dark part of the face area is calculated as follows. First, as shown in FIG. 5, the first feature amount calculation unit 28 defines a region where the signal level is lower than the threshold value Th2 in the luminance histogram H1 as a dark portion region S_face_dark indicated by hatching in the drawing, and the histogram H1. The ratio of the dark area S_face_dark to the total area S_face is calculated as the dark area ratio dark_ratio_face of the face area by the following equation (4). As the threshold Th2, for example, a value of 50 or less is used because the image data is 8 bits.

dark_ratio_face=S_face_dark/S_face (4)
なお、ヒストグラムH1の全領域S_faceはヒストグラムH1の全頻度、暗部領域S_face_darkは、ヒストグラムH1のしきい値Th2より小さい信号レベルの頻度である。そして、算出した顔領域の暗部の割合dark_ratio_faceを0〜1000の値をとるように正規化し、正規化した値を特徴量T4とする。
dark_ratio_face = S_face_dark / S_face (4)
Note that the entire area S_face of the histogram H1 is the total frequency of the histogram H1, and the dark area S_face_dark is the frequency of the signal level smaller than the threshold Th2 of the histogram H1. Then, the calculated dark area ratio dark_ratio_face of the face area is normalized to take a value of 0 to 1000, and the normalized value is set as a feature amount T4.

第2の特徴量算出部30は、画像S0の全領域の色差の割合、ハイライト領域の割合および顔領域と全領域との輝度差を特徴量T5〜T7として算出する。なお、特徴量T5〜T7が第2の特徴量となる。以下、特徴量T5〜T7の算出について具体的に説明する。   The second feature amount calculation unit 30 calculates the color difference ratio, the highlight area ratio, and the luminance difference between the face area and the entire area as the feature amounts T5 to T7 in the image S0. The feature amounts T5 to T7 are the second feature amount. Hereinafter, calculation of the feature amounts T5 to T7 will be specifically described.

まず、色差の割合の算出について説明する。第2の特徴量算出部30は、画像S0の各画素について色差Cb,Crを算出し、色差Cb,CrのCb−Cr空間におけるユークリッド距離を各画素の色差Cとして算出する。そして、画像S0の全領域について色差Cのヒストグラムを算出し、さらに算出した色差Cのヒストグラムを色差のレベルが小さい方から累積加算した累積ヒストグラムを作成する。図6は色差Cの累積ヒストグラム(累積色差ヒストグラム)を示す図である。そして、累積色差ヒストグラムHcにおけるしきい値Th3における累積値をCt、最大累積値をCmaxとすると、下記の式(5)により色差の割合C_ratioを算出する。なお、しきい値Th3としては経験的に30程度の値を用いる。   First, calculation of the color difference ratio will be described. The second feature amount calculation unit 30 calculates the color differences Cb and Cr for each pixel of the image S0, and calculates the Euclidean distance of the color differences Cb and Cr in the Cb-Cr space as the color difference C of each pixel. Then, a color difference C histogram is calculated for the entire area of the image S0, and a cumulative histogram is created by cumulatively adding the calculated color difference C histograms starting from the color difference level having the smallest level. FIG. 6 is a diagram illustrating a cumulative histogram of color difference C (cumulative color difference histogram). Then, assuming that the cumulative value at the threshold Th3 in the cumulative color difference histogram Hc is Ct and the maximum cumulative value is Cmax, the color difference ratio C_ratio is calculated by the following equation (5). As the threshold Th3, a value of about 30 is empirically used.

C_rato=Ct/Cmax (5)
そして、算出した色差の割合C_ratioを0〜1000の値をとるように正規化し、正規化した値を特徴量T5とする。
C_rato = Ct / Cmax (5)
Then, the calculated color difference ratio C_ratio is normalized to take a value of 0 to 1000, and the normalized value is set as a feature amount T5.

また、ハイライト領域の割合については、顔領域のハイライト割合と同様に算出する。すなわち、図7に示すように画像S0の全領域の輝度のヒストグラムH3を算出し、輝度のヒストグラムH3において、信号レベルがしきい値Th1より大きい領域をハイライト領域S_all_highlightと定義し、ヒストグラムの全領域S_allに対するハイライト領域S_all_highlightの割合を下記の式(6)により画像S0の全領域のハイライトの割合highlight_ratio_allとして算出する。   Further, the ratio of the highlight area is calculated in the same manner as the highlight ratio of the face area. That is, as shown in FIG. 7, the brightness histogram H3 of the entire area of the image S0 is calculated. In the brightness histogram H3, the area where the signal level is higher than the threshold value Th1 is defined as the highlight area S_all_highlight. The ratio of the highlight area S_all_highlight to the area S_all is calculated as the highlight ratio highlight_ratio_all of the entire area of the image S0 by the following equation (6).

highlight_ratio_all=S_all_highlight/S_all (6)
なお、ヒストグラムH1の全領域S_faceはヒストグラムH3の全頻度、ハイライト領域S_face_highlightは、ヒストグラムH3のしきい値Th1より大きい信号レベルの頻度である。そして、算出した顔領域のハイライトの割合highlight_ratio_faceを0〜1000の値をとるように正規化し、正規化した値を特徴量T6とする。
highlight_ratio_all = S_all_highlight / S_all (6)
Note that the entire area S_face of the histogram H1 is the total frequency of the histogram H3, and the highlight area S_face_highlight is the frequency of the signal level greater than the threshold value Th1 of the histogram H3. Then, the calculated highlight ratio of the face area highlight_ratio_face is normalized to take a value of 0 to 1000, and the normalized value is set as a feature amount T6.

また、顔領域と全領域との輝度差については、第1の特徴量算出部28が算出した顔領域の輝度の平均値から画像S0の全領域の輝度の平均値を減算し、これにより算出した値を0〜1000の値をとるように正規化し、正規化した値を特徴量T7とする。   Further, the luminance difference between the face area and the entire area is calculated by subtracting the average value of the brightness of the entire area of the image S0 from the average value of the brightness of the face area calculated by the first feature amount calculation unit 28. The normalized value is normalized to take a value of 0 to 1000, and the normalized value is set as a feature amount T7.

補正値算出部32は、第1の特徴量算出部28が算出した代表値R0、特徴量T1〜T4および第2の特徴量算出部30が算出した特徴量T4〜T7に基づいて、代表値R0の目標とする明るさである補正値P0を算出し、さらに補正値P0に基づいて補正テーブルTBL0を算出する。以下、補正値P0および補正テーブルTBL0の算出について説明する。   The correction value calculation unit 32 is based on the representative value R0 calculated by the first feature value calculation unit 28, the feature values T1 to T4, and the feature values T4 to T7 calculated by the second feature value calculation unit 30. A correction value P0, which is the target brightness of R0, is calculated, and a correction table TBL0 is calculated based on the correction value P0. Hereinafter, calculation of the correction value P0 and the correction table TBL0 will be described.

まず、補正値算出部32は、下記の式(7)により補正値P0を算出する。補正値P0は代表値R0の目標とする明るさである。   First, the correction value calculation unit 32 calculates the correction value P0 by the following equation (7). The correction value P0 is the target brightness of the representative value R0.

P0=Σ(Ti×Ai)+B (7)
ここで、Tiは第1および第2の特徴量算出部28,30が算出した特徴量T1〜T7、Ai,Bはパラメータであり、とくにAiは各特徴量Tiに対応するパラメータ(i=1〜7)である。
P0 = Σ (Ti × Ai) + B (7)
Here, Ti is the feature amounts T1 to T7 calculated by the first and second feature amount calculation units 28 and 30, and Ai and B are parameters. In particular, Ai is a parameter (i = 1) corresponding to each feature amount Ti. ~ 7).

パラメータAi,Bは、多数のサンプル画像を使用し、各サンプル画像をどの程度明るくすればサンプル画像が好ましい明るさとなるかという観点から、被験者に評価させる実験を行うことにより算出する。具体的には、各サンプル画像を被験者に評価させることにより、各サンプル画像に含まれる顔を好ましい明るさとするための正解補正値Yを取得する。ここで、正解補正値Yは、各サンプル画像に含まれる顔領域の明るさを調整した結果、被験者が好ましいと評価した顔の輝度である。一方、各サンプル画像について特徴量T1〜T7を算出する。そして、取得した正解補正値Yと特徴量T1〜T7とから、最小二乗法を用いて最適化を行い、パラメータAi,Bを取得する。   The parameters Ai and B are calculated by conducting an experiment that allows a subject to evaluate from the viewpoint of using a large number of sample images and how bright each sample image should be to obtain a preferable brightness. Specifically, the correct correction value Y for obtaining the brightness of the face included in each sample image is obtained by allowing the subject to evaluate each sample image. Here, the correct answer correction value Y is the brightness of the face evaluated by the subject as favorable as a result of adjusting the brightness of the face area included in each sample image. On the other hand, feature amounts T1 to T7 are calculated for each sample image. Then, optimization is performed by using the least square method from the acquired correct correction value Y and the feature amounts T1 to T7, and the parameters Ai and B are acquired.

ここで、サンプル画像数をN、各サンプル画像の正解補正値をYj(j=1〜N)、各サンプル画像の特徴量Ti、特徴量の数をM(本実施形態においては7)とすると、下記の式(8)により算出されるEの値が最小となるようにパラメータAi,Bを求めることにより、サンプル画像の算出補正値と正解補正値との誤差が最も小さくなる最適化パラメータを決定することができる。なお、式(8)においてΣ(Ai×Ti)は、サンプル画像jにおけるパラメータAiと特徴量Tiとの乗算値を、特徴量の数M分加算することを表している。

Figure 0004823979
Here, when the number of sample images is N, the correct correction value of each sample image is Yj (j = 1 to N), the feature amount Ti of each sample image, and the number of feature amounts is M (7 in the present embodiment). By obtaining the parameters Ai and B so that the value of E calculated by the following equation (8) is minimized, the optimization parameter that minimizes the error between the calculated correction value and the correct correction value of the sample image is obtained. Can be determined. In Equation (8), Σ (Ai × Ti) represents that the product of the parameter Ai and the feature amount Ti in the sample image j is added by the number M of feature amounts.
Figure 0004823979

次いで補正値算出部32は、補正値P0に基づいて補正テーブルTBL0を算出する。図8は補正テーブルTBL0の算出を説明するための図である。なお、図8においてx軸は入力であり、y軸は出力である。まず補正値算出部32は、図8に示すように点O1(x0,y0)、P(x1,y1)、O2(x2,y2)の3点をxy平面上に設定し、点O1,P0,O2の3点を用いてスプライン補間により補正テーブルTBL0を算出する。ここで、点O1は入力値および出力値の最小値、点O2は入力値および出力値の最大値をそれぞれプロットした点であり、それぞれ(x0,y0)=(0,0)、(x2,y2)=(255,255)を用いる。一方、点Pは代表値R0および出力の目標値すなわち補正値P0をプロットした点であり、代表値R0が100、補正値P0が120であったとすると、(x1,y1)=(100,120)となる。   Next, the correction value calculation unit 32 calculates the correction table TBL0 based on the correction value P0. FIG. 8 is a diagram for explaining calculation of the correction table TBL0. In FIG. 8, the x-axis is input and the y-axis is output. First, as shown in FIG. 8, the correction value calculation unit 32 sets three points O1 (x0, y0), P (x1, y1), and O2 (x2, y2) on the xy plane, and points O1, P0. , O2 is used to calculate the correction table TBL0 by spline interpolation. Here, the point O1 is the minimum value of the input value and the output value, and the point O2 is the point where the maximum value of the input value and the output value is plotted, respectively (x0, y0) = (0, 0), (x2, Use y2) = (255, 255). On the other hand, the point P is a point where the representative value R0 and the output target value, that is, the correction value P0 are plotted. Assuming that the representative value R0 is 100 and the correction value P0 is 120, (x1, y1) = (100, 120 )

信号処理部14は、入力された画像データS1の全画素に対して、各画素が有する色以外の色を求める補間処理、並びに補間された画像データを輝度信号および色差信号に変換するYC処理(以下、信号処理とする)を行う機能を有する。   The signal processing unit 14 performs interpolation processing for obtaining a color other than the color of each pixel for all pixels of the input image data S1, and YC processing for converting the interpolated image data into a luminance signal and a color difference signal ( (Hereinafter referred to as signal processing).

モニタ16は、不図示の表示制御部により制御されて、信号処理が施された画像S1を表示する。   The monitor 16 is controlled by a display control unit (not shown) and displays the image S1 subjected to signal processing.

記録部18は、不図示の圧縮部により圧縮された画像データS1を記録メディアに記録する。   The recording unit 18 records the image data S1 compressed by a compression unit (not shown) on a recording medium.

なお、デジタルカメラ1の各部は制御部40の制御によりその駆動が制御される。   The driving of each unit of the digital camera 1 is controlled by the control unit 40.

次いで、第1の実施形態において行われる処理について説明する。図9は第1の実施形態において行われる処理を示すフローチャートである。なお、ここでは、撮像部10が撮像を行ってデジタルの画像データS0が前処理部12に入力された以降の処理について説明する。画像データS0が前処理部12に入力されると、制御部40からの指示によりオフセット部20が画像データS0のオフセットを調整し(ステップST1)、WB調整部22がホワイトバランスを調整する(ステップST2)。   Next, processing performed in the first embodiment will be described. FIG. 9 is a flowchart showing processing performed in the first embodiment. Here, processing after the imaging unit 10 performs imaging and digital image data S0 is input to the preprocessing unit 12 will be described. When the image data S0 is input to the preprocessing unit 12, the offset unit 20 adjusts the offset of the image data S0 according to an instruction from the control unit 40 (step ST1), and the WB adjustment unit 22 adjusts the white balance (step ST1). ST2).

一方、顔検出部26が画像S0から顔領域を検出し(ステップST3)、第1の特徴量算出部28が顔領域のヒストグラムを作成し(ステップST4)、ヒストグラムを用いて代表値R0および特徴量T1〜T4(第1の特徴量)、すなわち顔領域の輝度、コントラスト度、顔領域のハイライトの割合および顔領域の暗部の割合を算出する(ステップST5)。   On the other hand, the face detection unit 26 detects a face area from the image S0 (step ST3), and the first feature quantity calculation unit 28 creates a histogram of the face area (step ST4), and uses the histogram to represent the representative value R0 and the feature. Amounts T1 to T4 (first feature amounts), that is, the brightness of the face area, the degree of contrast, the ratio of highlight of the face area, and the ratio of dark part of the face area are calculated (step ST5).

また、第2の特徴量算出部30が、画像S0の全領域のヒストグラムを作成し(ステップST6)、ヒストグラムを用いて特徴量T5〜T7(第2の特徴量)、すなわち画像S0の全領域の色差の割合、ハイライト領域の割合および顔領域と全領域との輝度差を算出する(ステップST7)。   Further, the second feature quantity calculation unit 30 creates a histogram of the entire area of the image S0 (step ST6), and uses the histogram to feature quantities T5 to T7 (second feature quantity), that is, the entire area of the image S0. The color difference ratio, the highlight area ratio, and the luminance difference between the face area and the entire area are calculated (step ST7).

次いで、補正値算出部32が上記式(7)に基づいて補正値P0を算出し(ステップST8)、さらに補正テーブルTBL0を算出する(ステップST9)。そして、ガンマ補正部24が補正テーブルTBL0に基づいて画像データS0の階調を補正する(ステップST10)。さらに信号処理部14が階調が補正された画像データS1に信号処理を施し(ステップST11)、記録部18が信号処理後の画像データS1を記録メディアに記録し(ステップST12)、処理を終了する。なお、信号処理後の画像データS1をモニタ16に表示するようにしてもよい。   Next, the correction value calculation unit 32 calculates the correction value P0 based on the above equation (7) (step ST8), and further calculates the correction table TBL0 (step ST9). Then, the gamma correction unit 24 corrects the gradation of the image data S0 based on the correction table TBL0 (step ST10). Further, the signal processing unit 14 performs signal processing on the image data S1 whose gradation has been corrected (step ST11), and the recording unit 18 records the image data S1 after the signal processing on a recording medium (step ST12), and ends the processing. To do. Note that the image data S1 after the signal processing may be displayed on the monitor 16.

このように第1の実施形態においては、顔領域における4つの第1の特徴量T1〜T4および画像S0の全領域についての3つの第2の特徴量T5〜T7に基づいて補正値P0を算出するようにしたものである。このため、輝度のように1つの特徴量のみに基づいて算出した補正値により補正する場合と比較して、より適切に顔領域を補正することができる。また、画像S0の全領域の特徴量も考慮しているため、顔領域のみならず、画像全体も適切に補正することができる。   As described above, in the first embodiment, the correction value P0 is calculated based on the four first feature amounts T1 to T4 in the face region and the three second feature amounts T5 to T7 for the entire region of the image S0. It is what you do. For this reason, it is possible to correct the face area more appropriately as compared with the case where correction is performed using a correction value calculated based on only one feature quantity such as luminance. Further, since the feature amount of the entire area of the image S0 is also taken into consideration, not only the face area but also the entire image can be corrected appropriately.

とくに、顔領域の輝度、コントラスト度およびハイライト部および暗部の頻度の割合を第1の特徴量T1〜T4として算出しているため、顔領域の輝度、コントラスト度およびハイライト部および暗部の頻度の割合を考慮して、顔領域の明るさおよびコントラストをより好ましいものとすることができる。   In particular, since the brightness of the face area, the degree of contrast, and the frequency ratio of the highlight part and the dark part are calculated as the first feature amounts T1 to T4, the brightness of the face area, the contrast degree, and the frequency of the highlight part and the dark part are calculated. Therefore, the brightness and contrast of the face area can be made more preferable.

また、画像の全領域の輝度、コントラスト、色差の割合およびハイライト部の頻度の割合を第2の特徴量T5〜T7として算出しているため、画像の全領域の輝度、コントラスト、色差の割合およびハイライト部の頻度の割合、画像全体の輝度、コントラスト、色差および特定の輝度の頻度の割合を考慮して、画像の全領域の明るさ、コントラストおよび色をより好ましいものとすることができる。   In addition, since the ratio of the luminance, contrast, and color difference of the entire area of the image and the ratio of the frequency of the highlight portion are calculated as the second feature amounts T5 to T7, the ratio of the luminance, contrast, and color difference of the entire area of the image. In addition, the brightness, contrast, and color of the entire area of the image can be made more preferable in consideration of the frequency ratio of the highlight portion, the luminance of the entire image, the contrast, the color difference, and the frequency ratio of the specific luminance. .

また、第1の特徴量および第2の特徴量を、パラメータAi,Bにより定められる式(7)に適用して補正値P0を算出しているため、簡易に補正値P0を算出することができる。   Further, since the correction value P0 is calculated by applying the first feature value and the second feature value to the equation (7) defined by the parameters Ai and B, the correction value P0 can be calculated easily. it can.

この場合、パラメータAi,Bを複数のサンプル画像を用いての評価実験に基づいて設定されたパラメータとしているため、ロバスト性のよい補正値P0を算出することができる。   In this case, since the parameters Ai and B are parameters set based on an evaluation experiment using a plurality of sample images, it is possible to calculate a correction value P0 with high robustness.

次いで、本発明の第2の実施形態について説明する。図10は本発明の第2の実施形態による画像処理装置を適用したデジタルカメラの構成を示す概略ブロック図である。なお、第2の実施形態において第1の実施形態と同一の構成については同一の参照番号を付与し、ここでは詳細な説明は省略する。第2の実施形態によるデジタルカメラ1Aは、補正値算出部32が算出した補正テーブルTBL0により画像S0を補正した場合に、その補正が過補正となるか否かを判定し、この判定が肯定された場合に、補正量を抑制した新たな補正テーブルTBL1を作成する補正値修正部34を備えた点が第1の実施形態と異なる。   Next, a second embodiment of the present invention will be described. FIG. 10 is a schematic block diagram showing the configuration of a digital camera to which the image processing apparatus according to the second embodiment of the present invention is applied. In the second embodiment, the same components as those in the first embodiment are denoted by the same reference numerals, and detailed description thereof is omitted here. The digital camera 1A according to the second embodiment determines whether or not the correction is overcorrection when the image S0 is corrected by the correction table TBL0 calculated by the correction value calculation unit 32, and this determination is affirmed. In this case, the second embodiment is different from the first embodiment in that a correction value correction unit 34 that creates a new correction table TBL1 in which the correction amount is suppressed is provided.

次いで、第2の実施形態において行われる処理について説明する。図11は第2の実施形態において行われる処理を示すフローチャートである。なお、第2の実施形態においては、補正テーブルTBL0算出までの処理は第1の実施形態におけるステップST9までの処理と同一であるため、ここでは補正値算出部32が補正テーブルTBL0を算出した以降の処理について説明する。   Next, processing performed in the second embodiment will be described. FIG. 11 is a flowchart showing processing performed in the second embodiment. Note that in the second embodiment, the processing up to the calculation of the correction table TBL0 is the same as the processing up to step ST9 in the first embodiment, and here, after the correction value calculation unit 32 calculates the correction table TBL0. The process will be described.

ステップST9に続いて、補正値修正部34は、補正テーブルTBL0を使用してあらかじめ定められた基準値を補正した場合に、基準値の補正値がリミット値を超えて過補正となるか否かを判定する(ステップST21)。なお、過補正とは補正の程度が強くて画像が明るすぎるものとなる状態を言う。ここで、基準値は例えば8ビットで30程度の値となるようにあらかじめ設定されている。また、リミット値は、例えば図12のリミット値設定テーブルTBL4に示すように、顔領域の輝度すなわち代表値R0に応じて設定されるものである。なお、図12に示すリミット値設定テーブルTBL4は、顔領域の輝度が0−30の場合にはリミット値が70となり、顔の輝度が200−255の場合はリミット値が30となり、顔の輝度が30−200の場合は70から30に向けて値が直線的に減少するようにリミット値を設定するものである。なお、補正値修正部34は、図12に示すリミット値設定テーブルTBL4を記憶しており、リミット値設定テーブルTBL4を参照して第1の特徴量算出部28が算出した顔領域の輝度である代表値R0に応じてリミット値を設定する。   Following step ST9, when the correction value correction unit 34 corrects a predetermined reference value using the correction table TBL0, whether or not the correction value of the reference value exceeds the limit value and is overcorrected. Is determined (step ST21). Note that overcorrection means a state in which the degree of correction is strong and the image is too bright. Here, the reference value is set in advance to be a value of about 30 with 8 bits, for example. The limit value is set according to the brightness of the face area, that is, the representative value R0, as shown in the limit value setting table TBL4 in FIG. In the limit value setting table TBL4 shown in FIG. 12, the limit value is 70 when the brightness of the face area is 0-30, and the limit value is 30 when the brightness of the face is 200-255. Is 30-200, the limit value is set so that the value decreases linearly from 70 to 30. The correction value correcting unit 34 stores the limit value setting table TBL4 shown in FIG. 12, and is the brightness of the face area calculated by the first feature amount calculating unit 28 with reference to the limit value setting table TBL4. A limit value is set according to the representative value R0.

ステップST21が否定されると、補正値算出部32が算出した補正テーブルTBL0をそのまま使用すべく、図9のステップST10の処理に進む。   If step ST21 is negative, the process proceeds to step ST10 in FIG. 9 to use the correction table TBL0 calculated by the correction value calculation unit 32 as it is.

一方、ステップST21が肯定されると、補正値修正部34は新たな補正テーブルTBL1を算出する(ステップST22)。図13は第2の実施形態における新たな補正テーブルTBL1の算出を説明するための図である。補正値修正部34は、図13に示すように入力を基準値(x3とする)とし、出力をリミット値(y3とする)とする点P1(x3,y3)をxy平面上にプロットし、点P1(x3,y3)および補正テーブルTBL0の算出に用いた点O1(x0,y0)、O2(x2,y2)の3点を用いて、スプライン補間により新たな補正テーブルTBL1を算出する。このように算出された新たな補正テーブルTBL1は、補正量が補正テーブルTBLよりも抑制されたものとなっている。   On the other hand, when step ST21 is affirmed, the correction value correcting unit 34 calculates a new correction table TBL1 (step ST22). FIG. 13 is a diagram for explaining calculation of a new correction table TBL1 in the second embodiment. As shown in FIG. 13, the correction value correcting unit 34 plots a point P1 (x3, y3) whose input is a reference value (x3) and whose output is a limit value (y3) on the xy plane, A new correction table TBL1 is calculated by spline interpolation using the point P1 (x3, y3) and the three points O1 (x0, y0) and O2 (x2, y2) used to calculate the correction table TBL0. In the new correction table TBL1 calculated in this way, the correction amount is suppressed more than the correction table TBL.

そして、ガンマ補正部24が新たな補正テーブルTBL1に基づいて画像データS0の階調を補正する(ステップST23)。さらに信号処理部14が階調が補正された画像データS1に信号処理を施し(ステップST24)、記録部18が信号処理後の画像データS1を記録メディアに記録し(ステップST25)、処理を終了する。なお、信号処理後の画像データS1をモニタ16に表示するようにしてもよい。   Then, the gamma correction unit 24 corrects the gradation of the image data S0 based on the new correction table TBL1 (step ST23). Further, the signal processing unit 14 performs signal processing on the image data S1 whose gradation has been corrected (step ST24), and the recording unit 18 records the image data S1 after the signal processing on a recording medium (step ST25), and ends the processing. To do. Note that the image data S1 after the signal processing may be displayed on the monitor 16.

このように、第2の実施形態においては、補正値算出部32が算出した補正テーブルTBL0を用いての画像S0の補正が過補正となる場合には、補正量を抑制した新たな補正テーブルTBL1を算出し、新たな補正テーブルTBL1により補正を行うようにしたため、画像が過補正となって明るすぎるものとなってしまうことを防止することができる。   As described above, in the second embodiment, when the correction of the image S0 using the correction table TBL0 calculated by the correction value calculation unit 32 is overcorrected, a new correction table TBL1 in which the correction amount is suppressed. Since the correction is performed using the new correction table TBL1, it is possible to prevent the image from being overcorrected and becoming too bright.

次いで、本発明の第3の実施形態について説明する。図14は本発明の第3の実施形態による画像処理装置を適用したデジタルカメラの構成を示す概略ブロック図である。なお、第3の実施形態において第1の実施形態と同一の構成については同一の参照番号を付与し、ここでは詳細な説明は省略する。第3の実施形態によるデジタルカメラ1Bは、補正値算出部32が算出した補正テーブルTBL0を基準として、補正の程度が異なる複数の補正テーブルを算出する補正テーブル算出部36を備えた点が第1の実施形態と異なる。   Next, a third embodiment of the present invention will be described. FIG. 14 is a schematic block diagram showing the configuration of a digital camera to which the image processing apparatus according to the third embodiment of the present invention is applied. Note that in the third embodiment, the same reference numerals are assigned to the same configurations as those in the first embodiment, and detailed description thereof is omitted here. The digital camera 1B according to the third embodiment is provided with a correction table calculation unit 36 that calculates a plurality of correction tables having different degrees of correction using the correction table TBL0 calculated by the correction value calculation unit 32 as a reference. Different from the embodiment.

次いで、第3の実施形態において行われる処理について説明する。図15は第3の実施形態において行われる処理を示すフローチャートである。なお、第3の実施形態においては、補正テーブルTBL0算出までの処理は第1の実施形態におけるステップST9までの処理と同一であるため、ここでは補正値算出部32が補正テーブルTBL0を算出した以降の処理について説明する。   Next, processing performed in the third embodiment will be described. FIG. 15 is a flowchart showing processing performed in the third embodiment. Note that in the third embodiment, the processing up to the calculation of the correction table TBL0 is the same as the processing up to step ST9 in the first embodiment, so here the correction value calculation unit 32 calculates the correction table TBL0. The process will be described.

ステップST9に続いて、補正テーブル算出部36は、補正テーブルTBL0を使用してあらかじめ定められた基準値を補正して基準補正値を取得する(ステップST31)。そして基準補正値とは補正の程度が異なる他の補正値を生成する(ステップST32)。例えば、基準補正値よりも補正の程度を強めた補正値および基準補正値よりも補正の程度を弱めた補正値を他の補正値として生成する。そして、補正テーブル算出部36は他の補正値を用いて新たな補正テーブルを算出する(ステップST33)。   Subsequent to step ST9, the correction table calculation unit 36 corrects a predetermined reference value using the correction table TBL0 to obtain a reference correction value (step ST31). Then, another correction value having a degree of correction different from the reference correction value is generated (step ST32). For example, a correction value with a higher degree of correction than the reference correction value and a correction value with a lower correction degree than the reference correction value are generated as other correction values. And the correction table calculation part 36 calculates a new correction table using another correction value (step ST33).

図16は第3の実施形態における新たな補正テーブルの算出を説明するための図である。なお、ここでは、基準補正値よりも補正の程度を強めた補正値および補正の程度を弱めた補正値の2つの他の補正値を用いた2つの新たな補正テーブルの算出について説明する。図16に示すように、入力を基準値x4、出力を基準補正値y4とする補正テーブルTBL0上の点を点P10(x4,y4)とする。また、基準補正値y4よりも補正の程度を強めた補正値をy5、補正の程度を弱めた補正値をy6とし、点P11(x4,y5)および点P12(x4,y6)をxy平面上にプロットする。   FIG. 16 is a diagram for explaining calculation of a new correction table in the third embodiment. Here, calculation of two new correction tables using two other correction values, that is, a correction value with a higher correction level than the reference correction value and a correction value with a lower correction level will be described. As shown in FIG. 16, a point on the correction table TBL0 in which the input is the reference value x4 and the output is the reference correction value y4 is a point P10 (x4, y4). In addition, a correction value with a higher correction level than the reference correction value y4 is y5, a correction value with a lower correction level is y6, and points P11 (x4, y5) and P12 (x4, y6) are on the xy plane. Plot to.

なお、他の補正値y5,y6の基準補正値y4からの変更の程度は例えば基準補正値y4を基準として±10程度の値を設定すればよい。なお、露出値を用いて±1/3Evのように設定してもよい。この場合、Ev値を補正値に換算して基準補正値の補正の程度を変更する。   The degree of change of the other correction values y5 and y6 from the reference correction value y4 may be set to a value of about ± 10 with reference to the reference correction value y4, for example. The exposure value may be set to ± 1/3 Ev. In this case, the degree of correction of the reference correction value is changed by converting the Ev value into a correction value.

そして、補正テーブル算出部36は、点P11(x4,y5)および補正テーブルTBL0の算出に用いた点O1(x0,y0)、O2(x2,y2)の3点を用いて、スプライン補間により新たな補正テーブルTBL11を算出する。また、点P12(x4,y6)および補正テーブルTBL0の算出に用いた点O1(x0,y0)、O2(x2,y2)の3点を用いて、スプライン補間により新たな補正テーブルTBL12を算出する。   Then, the correction table calculation unit 36 uses the three points of the point P11 (x4, y5) and the points O1 (x0, y0) and O2 (x2, y2) used for the calculation of the correction table TBL0 to newly perform the spline interpolation. A correct correction table TBL11 is calculated. In addition, a new correction table TBL12 is calculated by spline interpolation using the point P12 (x4, y6) and the three points O1 (x0, y0) and O2 (x2, y2) used for calculating the correction table TBL0. .

ここで、新たな補正テーブルTBL11は補正の程度が補正テーブルTBL0よりも強調され、新たな補正テーブルTBL12は補正の程度が補正テーブルTBL0よりも抑制されたものとなっている。   Here, the degree of correction of the new correction table TBL11 is emphasized more than that of the correction table TBL0, and the degree of correction of the new correction table TBL12 is suppressed more than that of the correction table TBL0.

そして、ガンマ補正部24が補正テーブルTBL0および新たな補正テーブルTBL11,TBL12に基づいて画像データS0の階調を補正して複数(ここでは3つ)の階調補正済みの画像データS1,S11,S12を取得する(ステップST34)。そして、階調補正済みの画像データS1,S11,S12に対して信号処理を施し(ステップST35)、モニタ16に3つの画像データS1,S11,S12により表される画像を表示する(ステップST36)。   Then, the gamma correction unit 24 corrects the gradation of the image data S0 based on the correction table TBL0 and the new correction tables TBL11 and TBL12, and a plurality (three in this case) of gradation-corrected image data S1, S11, S12 is acquired (step ST34). Then, signal processing is applied to the tone-corrected image data S1, S11, and S12 (step ST35), and an image represented by the three image data S1, S11, and S12 is displayed on the monitor 16 (step ST36). .

図17はモニタに画像が表示されたデジタルカメラの背面図である。図17に示すようにモニタ16には階調の程度が異なる3つの画像S1,S11,S12が表示される。デジタルカメラ1Bのユーザは、デジタルカメラ1Bの背面にある上下左右キー50を操作してモニタ16上において画像選択枠51を移動させることにより、所望とする階調を有する画像を選択することができる。なお、図17においては、画像S1が選択された状態を示している。そして、決定ボタン52を押下することにより、選択された画像を記録メディアに記録することができる。   FIG. 17 is a rear view of the digital camera with an image displayed on the monitor. As shown in FIG. 17, the monitor 16 displays three images S1, S11, and S12 having different gradation levels. The user of the digital camera 1B can select an image having a desired gradation by moving the image selection frame 51 on the monitor 16 by operating the up / down / left / right key 50 on the back of the digital camera 1B. . Note that FIG. 17 shows a state in which the image S1 is selected. Then, by pressing the enter button 52, the selected image can be recorded on the recording medium.

このため、制御部40はステップST36に続いて画像が選択されたか否かの監視を開始し(ステップST37)、ステップST37が肯定されると、記録部18が選択された画像の画像データを記録メディアに記録し(ステップST38)、処理を終了する。   Therefore, the control unit 40 starts monitoring whether or not an image has been selected following step ST36 (step ST37), and when step ST37 is affirmed, the recording unit 18 records the image data of the selected image. Recording on the medium (step ST38), the process is terminated.

このように、第3の実施形態においては、補正テーブルTBL0よりも補正の度合が異なる少なくとも1つの他の補正テーブルTBL11,TBL12を算出するようにしたため、様々な補正の程度の処理済み画像を得ることができる。   As described above, in the third embodiment, since at least one other correction table TBL11, TBL12 having a degree of correction different from that of the correction table TBL0 is calculated, processed images having various correction degrees are obtained. be able to.

また、様々な補正の程度の処理済み画像をモニタ16に表示し、所望とされる処理済み画像の選択を受け付けることにより、所望とされる画質の処理済み画像を得ることができる。また、選択された処理済み画像のみを記録しておけばよいため、画像を記録する記録メディアの容量の消費を防止することができる。   Further, a processed image having a desired image quality can be obtained by displaying processed images of various correction levels on the monitor 16 and receiving selection of a desired processed image. Further, since it is only necessary to record the selected processed image, it is possible to prevent the consumption of the capacity of the recording medium for recording the image.

なお、上記第1から第3の実施形態においては、顔検出部26が画像S0から顔領域を検出して検出結果を第1の特徴量算出部28に入力しているが、画像S0を一旦モニタ16に表示し、表示した画像においてユーザが顔領域を指定することにより得られた顔領域の検出結果を第1の特徴量算出部28に入力してもよい。この場合、顔検出部26は不要となる。   In the first to third embodiments, the face detection unit 26 detects a face area from the image S0 and inputs the detection result to the first feature amount calculation unit 28. However, the image S0 is temporarily stored. The detection result of the face area obtained by the user specifying the face area in the displayed image displayed on the monitor 16 may be input to the first feature amount calculation unit 28. In this case, the face detection unit 26 is not necessary.

また、上記第1から第3の実施形態においては、前処理部12においてホワイトバランス調整および階調の補正のみを行っているが、シャープネス処理、色補正処理等、他の処理を行うようにしてもよい。   In the first to third embodiments, only the white balance adjustment and the gradation correction are performed in the preprocessing unit 12, but other processes such as a sharpness process and a color correction process are performed. Also good.

また、上記第1から第3の実施形態においては、特定領域として顔領域を用いているが、これに限定されるものではなく、所望とする任意の被写体の領域を特定領域とすることができる。   In the first to third embodiments, the face area is used as the specific area. However, the specific area is not limited to this, and the desired area of the subject can be set as the specific area. .

また、上記第1から第3の実施形態においては、画像の全領域の輝度、コントラスト、色差の割合およびハイライト部の頻度の割合を第2の特徴量として用いているが、このうちの少なくとも1つを第2の特徴量として用いるようにしてもよい。この場合、使用する第2の特徴量に応じてパラメータAi,Bを算出しておけばよい。   In the first to third embodiments, the luminance, contrast, color difference ratio, and highlight portion frequency ratio of the entire area of the image are used as the second feature amount. One may be used as the second feature amount. In this case, the parameters Ai and B may be calculated according to the second feature amount to be used.

また、上記第1から第3の実施形態においては、サンプル画像の顔領域をどの程度明るくすればよいかという観点から被験者に評価を行ってもらい、パラメータAi,Bを算出しているが、逆にサンプル画像の顔領域をどの程度暗くすればよいかという観点から被験者に評価を行ってもらい、パラメータAi,Bを算出するようにしてもよい。   In the first to third embodiments, the subjects are evaluated from the viewpoint of how bright the face area of the sample image should be, and the parameters Ai and B are calculated. From the viewpoint of how dark the face area of the sample image should be, the test subject may be evaluated and the parameters Ai and B may be calculated.

また、上記第1から第3の実施形態においては、顔領域の代表値R0として顔領域の輝度の平均値を用いているが、中央領域ほど重みを大きくした重みづけ平均値およびメディアン値等を代表値R0として用いるようにしてもよい。   Further, in the first to third embodiments, the average value of the brightness of the face area is used as the representative value R0 of the face area. It may be used as the representative value R0.

また、上記第1から第3の実施形態においては、本発明による画像処理装置をデジタルカメラに適用しているが、プリンタ等の画像出力装置およびスキャナ等の画像読取装置に適用してもよく、画像処理装置を単体で提供するようにしてもよい。   In the first to third embodiments, the image processing apparatus according to the present invention is applied to a digital camera. However, the image processing apparatus may be applied to an image output apparatus such as a printer and an image reading apparatus such as a scanner. The image processing apparatus may be provided alone.

また、上記第1から第3の実施形態においては、画像S0から1つの顔領域が検出された場合の処理について説明しているが、複数の顔領域が検出された場合にも本発明を適用できる。ここで、複数の顔領域が検出された場合には、サイズが最も大きい顔領域、画像の最も中央にある顔領域、および顔判別処理を行って特定の人物であると判定された顔領域等、複数の顔領域から1つの顔領域を選択し、その顔領域から第1の特徴量を算出すればよい。なお、顔領域の選択は画像S0をモニタ16に表示することによりユーザに行わせるようにしてもよい。また、複数の顔領域のすべてを用いて第1の特徴量を算出してもよい。この場合、複数の顔領域内の画像データを用いて、第1の特徴量を算出するためのヒストグラムが作成される。   In the first to third embodiments, the processing when one face area is detected from the image S0 has been described. However, the present invention is also applied when a plurality of face areas are detected. it can. Here, when a plurality of face areas are detected, the face area having the largest size, the face area at the center of the image, the face area that has been determined to be a specific person by performing face discrimination processing, etc. A single face area may be selected from a plurality of face areas, and the first feature amount may be calculated from the face area. The face area may be selected by causing the user to display the image S0 on the monitor 16. Further, the first feature amount may be calculated using all of the plurality of face regions. In this case, a histogram for calculating the first feature amount is created using image data in a plurality of face regions.

以上、本発明の実施形態について説明したが、コンピュータを、上記のガンマ補正部21、顔検出部26、第1の特徴量算出部28、第2の特徴量算出部30、補正値算出部32、補正値修正部34および補正テーブル算出部36に対応する手段として機能させ、図9,11,14に示すような処理を行わせるプログラムも、本発明の実施形態の1つである。また、そのようなプログラムを記録したコンピュータ読取り可能な記録媒体も、本発明の実施形態の1つである。   As described above, the embodiment of the present invention has been described. However, the gamma correction unit 21, the face detection unit 26, the first feature amount calculation unit 28, the second feature amount calculation unit 30, and the correction value calculation unit 32 are described above. A program that functions as means corresponding to the correction value correction unit 34 and the correction table calculation unit 36 and performs processing as shown in FIGS. 9, 11, and 14 is also one embodiment of the present invention. A computer-readable recording medium in which such a program is recorded is also one embodiment of the present invention.

本発明の第1の実施形態による画像処理装置を適用したデジタルカメラの構成を示す概略ブロック図1 is a schematic block diagram showing a configuration of a digital camera to which an image processing apparatus according to a first embodiment of the present invention is applied. 顔領域および算出領域の設定を説明するための図The figure for demonstrating the setting of a face area and a calculation area 顔領域について算出したヒストグラムを示す図The figure which shows the histogram which calculated regarding the face area 顔領域におけるハイライト領域の割合の算出を説明するための図The figure for demonstrating calculation of the ratio of the highlight area | region in a face area | region 顔領域における暗部領域の割合の算出を説明するための図The figure for demonstrating calculation of the ratio of the dark part area | region in a face area | region 画像の全領域における色差の累積ヒストグラムを示す図The figure which shows the accumulation histogram of the color difference in all the areas of the image 画像の全領域におけるハイライト領域の割合の算出を説明するための図The figure for demonstrating the calculation of the ratio of the highlight area in the whole area | region of an image 補正テーブルの算出を説明するための図Diagram for explaining calculation of correction table 第1の実施形態において行われる処理を示すフローチャートThe flowchart which shows the process performed in 1st Embodiment. 本発明の第2の実施形態による画像処理装置を適用したデジタルカメラの構成を示す概略ブロック図Schematic block diagram showing the configuration of a digital camera to which an image processing apparatus according to a second embodiment of the present invention is applied. 第2の実施形態において行われる処理を示すフローチャートThe flowchart which shows the process performed in 2nd Embodiment. リミット値設定テーブルを示す図Diagram showing limit value setting table 第2の実施形態における新たな補正テーブルの算出を説明するための図The figure for demonstrating calculation of the new correction table in 2nd Embodiment. 本発明の第3の実施形態による画像処理装置を適用したデジタルカメラの構成を示す概略ブロック図Schematic block diagram showing the configuration of a digital camera to which an image processing apparatus according to a third embodiment of the present invention is applied. 第3の実施形態において行われる処理を示すフローチャートThe flowchart which shows the process performed in 3rd Embodiment 第3の実施形態における新たな補正テーブルの算出を説明するための図The figure for demonstrating calculation of the new correction table in 3rd Embodiment. モニタに画像が表示されたデジタルカメラの背面図Rear view of a digital camera with an image displayed on the monitor

符号の説明Explanation of symbols

1,1A,1B デジタルカメラ
10 撮像部
12 前処理部
14 信号処理部
16 モニタ
18 記録部
20 オフセット部
22 ホワイトバランス調整部
24 ガンマ補正部
26 顔検出部
28 第1の特徴量算出部
30 第2の特徴量算出部
32 補正値算出部
34 補正値修正部
36 補正テーブル算出部
40 制御部
1, 1A, 1B Digital camera 10 Imaging unit 12 Preprocessing unit 14 Signal processing unit 16 Monitor 18 Recording unit 20 Offset unit 22 White balance adjustment unit 24 Gamma correction unit 26 Face detection unit 28 First feature amount calculation unit 30 Second Feature amount calculation unit 32 correction value calculation unit 34 correction value correction unit 36 correction table calculation unit 40 control unit

Claims (16)

入力される画像から顔領域を検出する検出手段と、
前記顔領域の輝度を算出するとともに、該顔領域についての複数の特徴をそれぞれ表す複数の第1の特徴量を算出する第1の特徴量算出手段と、
前記画像の全領域の特徴量を表す少なくとも1つの第2の特徴量を算出する第2の特徴量算出手段と、
前記顔領域の輝度が目標とする値となるように前記画像の階調を補正するための補正値を、あらかじめ算出された、前記複数の第1の特徴量および前記第2の特徴量と前記補正値との関係に基づいて算出する補正値算出手段と
前記補正値に基づいて前記画像の階調を補正する補正手段とを備えたことを特徴とする画像処理装置。
Detecting means for detecting a face area from an input image ;
First feature amount calculating means for calculating a plurality of first feature amounts respectively representing a plurality of features for the face region, and calculating a luminance of the face region ;
A second feature amount calculating means for calculating at least one second feature amount representing the feature amount of the entire area of the image;
The correction values for correcting the gradation of the image so that the luminance of the face area becomes a target value are calculated in advance, and the plurality of first feature amounts and second feature amounts Correction value calculation means for calculating based on the relationship with the correction value ;
An image processing apparatus comprising: a correction unit that corrects the gradation of the image based on the correction value .
前記第1の特徴量算出手段は、前記顔領域の輝度、コントラストおよび該顔領域における特定の輝度の頻度の割合を前記第1の特徴量として算出する手段であることを特徴とする請求項1載の画像処理装置。 The first feature quantity calculating means, according to claim 1, wherein the luminance of the face area, a means for calculating the ratio of the frequency of a particular intensity as the first feature amount in contrast and the facial region serial mounting image processing apparatus. 前記第1の特徴量算出手段は、前記画像における前記顔領域の画素値の分布情報に基づいて、前記コントラストおよび前記顔領域における特定の輝度の頻度の割合を算出する手段であることを特徴とする請求項記載の画像処理装置。 The first feature amount calculating means is means for calculating a ratio of a frequency of the specific brightness in the face and the face area based on distribution information of pixel values of the face area in the image. The image processing apparatus according to claim 2 . 前記第2の特徴量算出手段は、前記全領域についての色差の累積ヒストグラムにおける最大累積値に対する所定色差の累積値の割合である色差の割合、前記全領域における特定の輝度の頻度の割合、および前記顔領域と前記全領域との輝度差の少なくとも1つを前記第2の特徴量として算出する手段であることを特徴とする請求項1から3のいずれか1項記載の画像処理装置。 The second feature amount calculating means includes a color difference ratio that is a ratio of a cumulative value of a predetermined color difference to a maximum cumulative value in a cumulative histogram of color differences for the entire area, a ratio of a frequency of a specific luminance in the entire area , and the image processing apparatus according to any one of claims 1, wherein 3 in that between the face region and the a means for calculating at least one as the second feature quantity of the luminance difference between the entire area. 前記第2の特徴量算出手段は、前記画像における前記全領域の画素値の分布情報に基づいて、前記全領域における特定の輝度の頻度の割合を算出する手段であることを特徴とする請求項記載の画像処理装置。 The second feature amount calculating unit is a unit that calculates a frequency ratio of a specific luminance in the entire region based on distribution information of pixel values of the entire region in the image. 4. The image processing apparatus according to 4 . 前記補正値算出手段は、前記第1の特徴量および前記第2の特徴量を、所定のパラメータにより定められる演算式に適用して前記補正値を算出する手段であることを特徴とする請求項1からのいずれか1項記載の画像処理装置。 The correction value calculating means is means for calculating the correction value by applying the first feature value and the second feature value to an arithmetic expression defined by a predetermined parameter. The image processing apparatus according to any one of 1 to 5 . 前記所定のパラメータは、複数のサンプル画像から取得した、該各サンプル画像に含まれる顔を好ましい明るさとするための補正値である正解補正値、並びに該各サンプル画像から算出した前記第1の特徴量および前記第2の特徴量に基づいて設定されたパラメータであることを特徴とする請求項記載の画像処理装置。 The predetermined parameter is a correct correction value obtained from a plurality of sample images, which is a correction value for making a face included in each sample image a preferable brightness, and the first feature calculated from each sample image. The image processing apparatus according to claim 6, wherein the parameter is a parameter set based on an amount and the second feature amount . 前記顔領域の輝度は、該顔領域の輝度の平均値、該顔領域の中央領域ほど重みを大きくした該顔領域の輝度の重みづけ平均値、および該顔領域の輝度のメディアン値のいずれかであることを特徴とする請求項1から7のいずれか1項記載の画像処理装置。  The brightness of the face area is one of an average value of the brightness of the face area, a weighted average value of the brightness of the face area in which the weight is increased toward the center area of the face area, and a median value of the brightness of the face area The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus. 前記補正値算出手段は、前記補正値に基づいて前記顔領域の輝度が目標とする値となるように前記画像の階調を補正する補正テーブルを算出する手段であることを特徴とする請求項1から8のいずれか1項記載の画像処理装置。 The correction value calculating means is a means for calculating a correction table for correcting the gradation of the image so that the brightness of the face area becomes a target value based on the correction value. The image processing apparatus according to any one of 1 to 8. 前記補正テーブルによる前記画像の補正が過補正となるか否かを判定し、該判定が肯定された場合に前記補正テーブルよりも補正量を抑制した新たな補正テーブルを算出する補正値修正手段をさらに備えたことを特徴とする請求項9記載の画像処理装置。   A correction value correcting unit that determines whether or not the correction of the image by the correction table is overcorrected, and calculates a new correction table that suppresses the correction amount more than the correction table when the determination is affirmative; The image processing apparatus according to claim 9, further comprising: 前記補正値修正手段は、前記過補正となるか否かの判定を、前記画像における基準値を前記補正テーブルを用いて補正することにより取得される補正値が、所定のしきい値よりも大きく補正されるか否かを判定することにより行う手段であることを特徴とする請求項10記載の画像処理装置。   The correction value correcting means determines whether or not the overcorrection occurs, and a correction value acquired by correcting a reference value in the image using the correction table is larger than a predetermined threshold value. The image processing apparatus according to claim 10, wherein the image processing apparatus is a unit that performs determination by determining whether or not correction is performed. 前記補正手段は、前記補正テーブルに基づいて前記画像の階調を補正する手段であることを特徴とする請求項9から11のいずれか1項記載の記載の画像処理装置。 The image processing apparatus according to claim 9 , wherein the correction unit is a unit that corrects gradation of the image based on the correction table. 前記補正テーブルに基づいて、該補正テーブルよりも補正の程度が異なる少なくとも1つの他の補正テーブルを算出する補正テーブル算出手段をさらに備えたことを特徴とする請求項9から11のいずれか1項記載の画像処理装置。   The correction table calculation means for calculating at least one other correction table having a degree of correction different from that of the correction table based on the correction table is further provided. The image processing apparatus described. 前記補正手段は、前記補正テーブルおよび前記他の補正テーブルに基づいて複数の前記画像の階調を補正して複数の処理済み画像取得する手段であり、
前記数の処理済み画像を表示する表示手段と、
前記複数の処理済み画像における所望とされる処理済み画像の選択を受け付ける選択手段とをさらに備えたことを特徴とする請求項13記載の画像処理装置。
The correction means is a means for obtaining a plurality of processed images by correcting a gradation of the plurality of the image based on the correction table and the other correction table,
Display means for displaying the processed image of the multiple,
14. The image processing apparatus according to claim 13, further comprising selection means for receiving selection of a processed image that is desired in the plurality of processed images.
入力される画像から顔領域を検出し、
前記顔領域の輝度を算出するとともに、該顔領域についての複数の特徴をそれぞれ表す複数の第1の特徴量を算出し、
前記画像の全領域の特徴量を表す少なくとも1つの第2の特徴量を算出し、
前記顔領域の輝度が目標とする値となるように前記画像の階調を補正するための補正値を、あらかじめ算出された、前記複数の第1の特徴量および前記第2の特徴量と前記補正値との関係に基づいて算出し、
前記補正値に基づいて前記画像の階調を補正することを特徴とする画像処理方法。
Detect the face area from the input image ,
Calculating the brightness of the face area, and calculating a plurality of first feature amounts respectively representing a plurality of features of the face area ;
Calculating at least one second feature amount representing the feature amount of the entire region of the image;
The correction values for correcting the gradation of the image so that the luminance of the face area becomes a target value are calculated in advance, and the plurality of first feature amounts and second feature amounts Calculate based on the relationship with the correction value,
An image processing method, wherein the gradation of the image is corrected based on the correction value .
入力される画像から顔領域を検出する手順と、
前記顔領域の輝度を算出するとともに、該顔領域についての複数の特徴をそれぞれ表す複数の第1の特徴量を算出する手順と、
前記画像の全領域の特徴量を表す少なくとも1つの第2の特徴量を算出する手順と、
前記顔領域の輝度が目標とする値となるように前記画像の階調を補正するための補正値を、あらかじめ算出された、前記複数の第1の特徴量および前記第2の特徴量と前記補正値との関係に基づいて算出する手順と、
前記補正値に基づいて前記画像の階調を補正する手順とを有することを特徴とする画像処理方法をコンピュータに実行させるためのプログラム。
A procedure for detecting a face area from an input image ;
Calculating the brightness of the face area, and calculating a plurality of first feature amounts respectively representing a plurality of features of the face area ;
Calculating at least one second feature value representing the feature value of the entire region of the image;
The correction values for correcting the gradation of the image so that the luminance of the face area becomes a target value are calculated in advance, and the plurality of first feature amounts and second feature amounts A procedure for calculating based on the relationship with the correction value;
A program for causing a computer to execute an image processing method, comprising: correcting a gradation of the image based on the correction value .
JP2007190529A 2007-07-23 2007-07-23 Image processing apparatus and method, and program Expired - Fee Related JP4823979B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007190529A JP4823979B2 (en) 2007-07-23 2007-07-23 Image processing apparatus and method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007190529A JP4823979B2 (en) 2007-07-23 2007-07-23 Image processing apparatus and method, and program

Publications (2)

Publication Number Publication Date
JP2009027583A JP2009027583A (en) 2009-02-05
JP4823979B2 true JP4823979B2 (en) 2011-11-24

Family

ID=40398937

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007190529A Expired - Fee Related JP4823979B2 (en) 2007-07-23 2007-07-23 Image processing apparatus and method, and program

Country Status (1)

Country Link
JP (1) JP4823979B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5421707B2 (en) * 2009-09-28 2014-02-19 京セラ株式会社 Portable electronic devices
JP5887520B2 (en) * 2010-06-25 2016-03-16 パナソニックIpマネジメント株式会社 Intercom system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1198374A (en) * 1997-09-24 1999-04-09 Konica Corp Method and device for correcting color
JP4655210B2 (en) * 2005-07-05 2011-03-23 ノーリツ鋼機株式会社 Density correction curve generation method and density correction curve generation module
JP4934326B2 (en) * 2005-09-29 2012-05-16 富士フイルム株式会社 Image processing apparatus and processing method thereof

Also Published As

Publication number Publication date
JP2009027583A (en) 2009-02-05

Similar Documents

Publication Publication Date Title
JP5205968B2 (en) Gradation correction method, gradation correction apparatus, gradation correction program, and image device
JP4831067B2 (en) Image processing apparatus, image processing method, image processing program product, and imaging apparatus
JP5743384B2 (en) Image processing apparatus, image processing method, and computer program
CN101090458B (en) Image processing device, imaging device, image output device and methods thereof
JP5100565B2 (en) Image processing apparatus and image processing method
US9071761B2 (en) Information processing apparatus, information processing method, program, and imaging apparatus including optical microscope
CN101753797B (en) Image signal processing apparatus and method
JP5901667B2 (en) Image processing apparatus and method, image processing program, and imaging apparatus
JP5753393B2 (en) Image processing apparatus and method
JP2005051407A (en) Image processing method and apparatus
US9185265B2 (en) Image processing method and image processing apparatus for performing a tone correction to acquire a combined image
EP0442369B1 (en) Gradation correcting apparatus
CN101895692B (en) Image processor and image processing method
US8085316B2 (en) Image-processing unit, imaging apparatus, and computer program product
JP3673092B2 (en) Image quality adjusting apparatus, image quality adjusting method, and recording medium recording image adjusting program
JP4823979B2 (en) Image processing apparatus and method, and program
JP4595569B2 (en) Imaging device
JP2002288650A (en) Image processing apparatus and digital camera, image processing method, recording medium
KR20180138530A (en) Detection apparatus, image processing apparatus, detection method, and image processing method
JP5743456B2 (en) Image processing apparatus, image processing method, and imaging apparatus
JP2003046807A (en) Image display device and image display method
JP5103984B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP2016046701A (en) Image processing apparatus, image processing method, and program
JP5178933B1 (en) Image processing device
JP2005027161A (en) Image processing apparatus and image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100225

RD15 Notification of revocation of power of sub attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7435

Effective date: 20110415

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110428

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110517

RD13 Notification of appointment of power of sub attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7433

Effective date: 20110706

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110707

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20110706

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110816

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110907

R150 Certificate of patent or registration of utility model

Ref document number: 4823979

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140916

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees