JP4823979B2 - Image processing apparatus and method, and program - Google Patents
Image processing apparatus and method, and program Download PDFInfo
- 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
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に記載された手法によれば、人物を含む画像において、顔の階調を好ましいものとすることができるとともに、顔の背景も好ましい階調とすることができる。
しかしながら、画像に含まれる人物の顔は、均一な明るさを有する場合のみならず、ハイライトやシャドーとなる領域を含む場合があり、さらには、顔領域内においてコントラストが変化する場合がある。また、画像の全領域についても、ハイライトやシャドーとなる領域を含む場合があり、さらには、画像全体のコントラストも変化する場合がある。このため、特許文献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
本発明は上記事情に鑑みなされたものであり、画像に含まれる顔等の特定領域および画像の全領域の種々の状況を考慮して、適切に画像を補正できるようにすることを目的とする。 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
図1に示すように、デジタルカメラ1は、撮像部10、前処理部12、信号処理部14、モニタ16および記録部18を備える。
As shown in FIG. 1, the
撮像部10は、図示しない入射光を電気信号に変換する複数の受光素子が2次元的に配設された撮像素子を備え、撮像素子により変換された信号を読み出す機能を有する。撮像素子としては、例えばCCD(Charge Coupled Device)型またはC−MOS(Complimentary−Metal Oxide Semiconductor)型のものがあり、これ以外の信号読出し型のものであってもよい。
The
また、撮像部10は、図示しない駆動部から供給される駆動信号に応じて撮像素子の各受光素子に対応して得られたアナログ撮像信号を取得し、アナログ撮像信号のノイズを除去する処理およびアナログ撮像信号のゲインを調節する処理(以下アナログ処理とする)を行い、さらに、アナログ処理済みのアナログ撮像信号をデジタル信号に変換してデジタルの画像データS0を前処理部12に出力する機能をも有する。ここで、本実施形態においては、画像データS0は8ビットの階調を有するものとする。なお、以降の説明においては、画像データS0により表される画像についても参照符号としてS0を用いるものとする。
In addition, the
前処理部12は、オフセット部20、ホワイトバランス(WB)調整部22、ガンマ補正部24、顔検出部26、第1の特徴量算出部28、第2の特徴量算出部30、および補正値算出部32を備える。
The preprocessing
オフセット部20は、オフセット調整、すなわちデジタルの画像データS0の各画素に対応する画素値を所定のレベルにそろえる機能を有する。
The offset
WB調整部22は、オフセット部20から入力される画像データS0に対してホワイトバランスを調整する機能を有する。
The
ガンマ補正部24は、WB調整部22から入力される画像データS0を後述する補正値算出部32から供給される補正テーブルTBL0を用いて階調補正する機能を有する。なお、ガンマ補正部24は、階調補正された画像データS1を信号処理部14に出力する。画像データS1は、各画素毎に撮像部10における撮像素子の受光素子に対応した色成分を有するRAWデータである。なお、以降の説明においては、画像データS1により表される画像についても参照符号としてS1を用いるものとする。
The
顔検出部26は、画像S0に含まれる顔領域をすべて検出する機能を有する。具体的には、顔検出部26は、テンプレートマッチングによる手法や、顔の多数のサンプル画像を用いてマシンラーニング学習により得られた顔判別器を用いる手法等により、画像S0上における顔を囲む所定範囲の領域を顔領域として検出する。
The
第1の特徴量算出部28は、画像S0に含まれる顔領域の代表値R0、顔領域の輝度、コントラスト度、顔領域のハイライトの割合および顔領域の暗部の割合をそれぞれ特徴量T1〜T4として算出する。なお、特徴量T1〜T4が第1の特徴量となる。以下、特徴量T1〜T4の算出について具体的に説明する。
The first feature
ここで顔検出部26は、図2に示すように顔を囲む矩形の領域を顔領域K1として検出するが、顔領域K1には、顔の周囲の背景、着衣および髪の毛等の顔以外の被写体が含まれる。このため、第1の特徴量算出部28は、顔領域K1の対角線の交点を中心として顔領域K1をあらかじめ定められた縮小率により縮小した領域を、特徴量T1〜T4の算出領域K2として設定する。
Here, the
まず、顔領域の輝度については、上述したように設定した算出領域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
コントラスト度の特徴量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
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
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
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
まず、色差の割合の算出について説明する。第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
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
補正値算出部32は、第1の特徴量算出部28が算出した代表値R0、特徴量T1〜T4および第2の特徴量算出部30が算出した特徴量T4〜T7に基づいて、代表値R0の目標とする明るさである補正値P0を算出し、さらに補正値P0に基づいて補正テーブルTBL0を算出する。以下、補正値P0および補正テーブルTBL0の算出について説明する。
The correction
まず、補正値算出部32は、下記の式(7)により補正値P0を算出する。補正値P0は代表値R0の目標とする明るさである。
First, the correction
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
パラメータ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分加算することを表している。
次いで補正値算出部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
信号処理部14は、入力された画像データS1の全画素に対して、各画素が有する色以外の色を求める補間処理、並びに補間された画像データを輝度信号および色差信号に変換するYC処理(以下、信号処理とする)を行う機能を有する。
The
モニタ16は、不図示の表示制御部により制御されて、信号処理が施された画像S1を表示する。
The
記録部18は、不図示の圧縮部により圧縮された画像データS1を記録メディアに記録する。
The
なお、デジタルカメラ1の各部は制御部40の制御によりその駆動が制御される。
The driving of each unit of the
次いで、第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
一方、顔検出部26が画像S0から顔領域を検出し(ステップST3)、第1の特徴量算出部28が顔領域のヒストグラムを作成し(ステップST4)、ヒストグラムを用いて代表値R0および特徴量T1〜T4(第1の特徴量)、すなわち顔領域の輝度、コントラスト度、顔領域のハイライトの割合および顔領域の暗部の割合を算出する(ステップST5)。
On the other hand, the
また、第2の特徴量算出部30が、画像S0の全領域のヒストグラムを作成し(ステップST6)、ヒストグラムを用いて特徴量T5〜T7(第2の特徴量)、すなわち画像S0の全領域の色差の割合、ハイライト領域の割合および顔領域と全領域との輝度差を算出する(ステップST7)。
Further, the second feature
次いで、補正値算出部32が上記式(7)に基づいて補正値P0を算出し(ステップST8)、さらに補正テーブルTBL0を算出する(ステップST9)。そして、ガンマ補正部24が補正テーブルTBL0に基づいて画像データS0の階調を補正する(ステップST10)。さらに信号処理部14が階調が補正された画像データS1に信号処理を施し(ステップST11)、記録部18が信号処理後の画像データS1を記録メディアに記録し(ステップST12)、処理を終了する。なお、信号処理後の画像データS1をモニタ16に表示するようにしてもよい。
Next, the correction
このように第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
次いで、第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
ステップ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
ステップ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
一方、ステップ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
そして、ガンマ補正部24が新たな補正テーブルTBL1に基づいて画像データS0の階調を補正する(ステップST23)。さらに信号処理部14が階調が補正された画像データS1に信号処理を施し(ステップST24)、記録部18が信号処理後の画像データS1を記録メディアに記録し(ステップST25)、処理を終了する。なお、信号処理後の画像データS1をモニタ16に表示するようにしてもよい。
Then, the
このように、第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
次いで、本発明の第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
次いで、第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
ステップST9に続いて、補正テーブル算出部36は、補正テーブルTBL0を使用してあらかじめ定められた基準値を補正して基準補正値を取得する(ステップST31)。そして基準補正値とは補正の程度が異なる他の補正値を生成する(ステップST32)。例えば、基準補正値よりも補正の程度を強めた補正値および基準補正値よりも補正の程度を弱めた補正値を他の補正値として生成する。そして、補正テーブル算出部36は他の補正値を用いて新たな補正テーブルを算出する(ステップST33)。
Subsequent to step ST9, the correction
図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
ここで、新たな補正テーブル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
図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
このため、制御部40はステップST36に続いて画像が選択されたか否かの監視を開始し(ステップST37)、ステップST37が肯定されると、記録部18が選択された画像の画像データを記録メディアに記録し(ステップST38)、処理を終了する。
Therefore, the
このように、第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
なお、上記第1から第3の実施形態においては、顔検出部26が画像S0から顔領域を検出して検出結果を第1の特徴量算出部28に入力しているが、画像S0を一旦モニタ16に表示し、表示した画像においてユーザが顔領域を指定することにより得られた顔領域の検出結果を第1の特徴量算出部28に入力してもよい。この場合、顔検出部26は不要となる。
In the first to third embodiments, the
また、上記第1から第3の実施形態においては、前処理部12においてホワイトバランス調整および階調の補正のみを行っているが、シャープネス処理、色補正処理等、他の処理を行うようにしてもよい。
In the first to third embodiments, only the white balance adjustment and the gradation correction are performed in the
また、上記第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
以上、本発明の実施形態について説明したが、コンピュータを、上記のガンマ補正部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
1,1A,1B デジタルカメラ
10 撮像部
12 前処理部
14 信号処理部
16 モニタ
18 記録部
20 オフセット部
22 ホワイトバランス調整部
24 ガンマ補正部
26 顔検出部
28 第1の特徴量算出部
30 第2の特徴量算出部
32 補正値算出部
34 補正値修正部
36 補正テーブル算出部
40 制御部
1, 1A,
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 .
前記複数の処理済み画像を表示する表示手段と、
前記複数の処理済み画像における所望とされる処理済み画像の選択を受け付ける選択手段とをさらに備えたことを特徴とする請求項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 .
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)
| 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)
| 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 |
-
2007
- 2007-07-23 JP JP2007190529A patent/JP4823979B2/en not_active Expired - Fee Related
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 |