JP2007243556A - Imaging apparatus, image processing method, and image processing program - Google Patents

Imaging apparatus, image processing method, and image processing program Download PDF

Info

Publication number
JP2007243556A
JP2007243556A JP2006062634A JP2006062634A JP2007243556A JP 2007243556 A JP2007243556 A JP 2007243556A JP 2006062634 A JP2006062634 A JP 2006062634A JP 2006062634 A JP2006062634 A JP 2006062634A JP 2007243556 A JP2007243556 A JP 2007243556A
Authority
JP
Japan
Prior art keywords
image
index
luminance information
gradation
calculating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2006062634A
Other languages
Japanese (ja)
Inventor
Daisuke Sato
大輔 佐藤
Jo Nakajima
丈 中嶋
Hiroaki Takano
博明 高野
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.)
Konica Minolta Photo Imaging Inc
Original Assignee
Konica Minolta Photo Imaging Inc
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 Konica Minolta Photo Imaging Inc filed Critical Konica Minolta Photo Imaging Inc
Priority to JP2006062634A priority Critical patent/JP2007243556A/en
Publication of JP2007243556A publication Critical patent/JP2007243556A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an imaging apparatus, an image processing method, and an image processing program capable of obtaining a more proper correction image by discriminating a photographed scene of an image acquired, by photographing with high accuracy and applying correction processing to the image, depending on the photographed scene. <P>SOLUTION: The imaging apparatus is provided with a first image acquisition means for acquiring a first image by photographing; a first luminance information acquisition means for acquiring first luminance information in a prescribed first region from a photometric value of a photographing region calculated at the photographing; a second luminance information acquisition means for acquiring second luminance information in a second region around the first region from a photometric value of a photographing region calculated at the photographing; a scene discrimination processing means for discriminating photographing scene, on the basis of the first luminance information, the second luminance information and the first image which are acquired; and a gradation processing condition setting means for setting a gradation processing condition to the first image, on the basis of a discrimination result by the scene discrimination processing means. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、撮影画像の画像処理を行う撮像装置、画像処理方法及び画像処理プログラムに関する。   The present invention relates to an imaging apparatus, an image processing method, and an image processing program that perform image processing of a captured image.

近年デジタルスチルカメラ(携帯電話やラップトップパソコン等の機器に組み込まれたものも含み、以下DSCと略称する)が広く普及し、従来のカラー写真フィルムのシステムと同様に、ハードコピー画像として出力したり、CRT等の媒体に表示したり、CD−R(CD−Recordable)等の記録媒体に記録するシステムが広く利用されている。   In recent years, digital still cameras (including those incorporated in devices such as mobile phones and laptop computers, hereinafter abbreviated as DSC) have become widespread, and, as with conventional color photographic film systems, output as hard copy images. In addition, systems that display on a medium such as a CRT or record on a recording medium such as a CD-R (CD-Recordable) are widely used.

しかし、DSC等で撮影された画像を、上記のように種々の媒体を通じて画像として鑑賞するに当たっては、撮影時の露出調整の不備等により、一般的にそのままでは鑑賞用画像として適切な画像を得ることはできない場合が多い。つまり、適正な鑑賞用の画像とするためには、撮影時の露出の過不足を補うために、適当な画像の階調補正処理が行われることが望ましい。   However, when an image taken with a DSC or the like is viewed as an image through various media as described above, an image suitable for viewing is generally obtained as it is due to inadequate exposure adjustment at the time of shooting. There are many cases where this is not possible. That is, in order to obtain an appropriate appreciation image, it is desirable that an appropriate image gradation correction process is performed in order to compensate for overexposure or underexposure during shooting.

またそれ以外にも、例えば、逆光状態での撮影や、フラッシュを使用した近接撮影等、撮影時の光源状態の影響で、画像内で大きな輝度の偏りが生じている場合には、そのままでは鑑賞目的として適切な画像とはいえず、何らかの補正処理を行うことが望ましい。   In addition, if there is a large luminance deviation in the image due to the influence of the light source state during shooting, such as shooting in a backlight state or close-up shooting using a flash, the image can be viewed as it is. It cannot be said that the image is suitable for the purpose, and it is desirable to perform some correction processing.

このような問題点を解決するために、従来より階調変換処理等の補正処理が行われている。例えば、アンダーやオーバーの露光に対して、平均輝度を補正する変換処理に加えて、画像中に輝度の偏りの大きい大領域が生ずる場合には、判別分析や重回帰分析により補正値を算出して変換処理する等の方法が行われたりしている。   In order to solve such problems, correction processing such as gradation conversion processing has been performed conventionally. For example, in addition to conversion processing that corrects the average luminance for under and over exposure, if a large area with a large luminance deviation occurs in the image, a correction value is calculated by discriminant analysis or multiple regression analysis. For example, a conversion process is performed.

しかしながら、こういった判別回帰分析方法では、例えば、フラッシュ近接撮影と、逆光シーンでの撮影とで算出される補正値が類似している等、撮影シーンを適切に判別した上での補正処理を行うことが困難な場合があった。   However, in this discriminant regression analysis method, for example, correction values calculated by flash close-up shooting and shooting in a backlight scene are similar, for example, correction processing after appropriately determining the shooting scene is performed. Sometimes it was difficult to do.

そのため、上記の補正方法に代わる方法として、画像中の輝度値の分布を用いて適切な補正値を求める方法が提案されている(例えば、特許文献1参照)。また画像中の顔領域候補を抽出し、その平均輝度の偏りの大きさからシーン判別する方法が提案されている(例えば、特許文献2参照)。   For this reason, a method for obtaining an appropriate correction value using a distribution of luminance values in an image has been proposed as an alternative to the above correction method (see, for example, Patent Document 1). Further, a method has been proposed in which face area candidates in an image are extracted and a scene is discriminated from the magnitude of the average luminance bias (see, for example, Patent Document 2).

特許文献1では、画像中の輝度の累積画素数(頻度数)を示すヒストグラムから、高輝度領域と低輝度領域を削除し、さらに頻度数を制限して、輝度平均を算出し、基準輝度との差分値から補正値を求めている。   In Patent Document 1, a high-luminance region and a low-luminance region are deleted from a histogram indicating the cumulative number of pixels (frequency number) of luminance in an image, the frequency number is further limited, a luminance average is calculated, and reference luminance and The correction value is obtained from the difference value.

また、特許文献2では、色相彩度のヒストグラムやパターンマッチング等による顔領域の候補を抽出し、その平均輝度の画像全体に対する偏りを算出し、偏りが大きい場合には、一次元の濃度ヒストグラムに基づき、逆光シーンと近接フラッシュ撮影とを判別している。
特開2002−247393号公報 特開2000−148980号公報
In Patent Document 2, a candidate for a face region is extracted by a hue saturation histogram, pattern matching, or the like, and a bias with respect to the entire image is calculated. If the bias is large, a one-dimensional density histogram is obtained. Based on this, a backlit scene and proximity flash photography are discriminated.
JP 2002-247393 A JP 2000-148980 A

しかしながら、特許文献1に記載の技術では、逆光シーンや近接フラッシュ撮影での輝度の偏りの大きい領域の影響は低減されるが、例えば人物を主要被写体とする撮影シーン等では、顔領域の輝度が十分に適切な値には補正しきれない等という問題がある。   However, in the technique described in Patent Document 1, the influence of a region with a large luminance deviation in a backlight scene or close-up flash photography is reduced. However, for example, in a photographing scene having a person as a main subject, the luminance of the face region is high. There is a problem that it cannot be corrected to a sufficiently appropriate value.

また、特許文献2に記載の技術では、典型的な逆光シーンや近接フラッシュ撮影では顔領域の特定を補償する効果を達成できるが、典型的な構図に当てはまらないと、補償効果が得られなくなるという問題がある。   The technique described in Patent Document 2 can achieve the effect of compensating for the identification of a face area in a typical backlight scene or close-up flash photography, but the compensation effect cannot be obtained unless a typical composition is applied. There's a problem.

本発明の課題は、撮影により取得された画像の撮影シーンを高精度に判別し、この撮影シーンに応じた補正処理を施すことで、より適切な補正画像を得ることが可能な撮像装置、画像処理方法及び画像処理プログラムを提供することである。   An object of the present invention is to determine an imaging scene of an image acquired by imaging with high accuracy, and to perform a correction process according to the imaging scene, thereby obtaining an appropriate correction image, image A processing method and an image processing program are provided.

上記課題を解決するために、請求項1に記載の発明は、
撮影により第1の画像を取得する第1の画像取得手段と、
前記撮影時に算出された撮影領域の測光値から所定の第1領域における第1輝度情報を取得する第1輝度情報取得手段と、
前記算出された撮影領域の測光値から前記第1領域周辺の第2領域における第2輝度情報を取得する第2輝度情報取得手段と、
前記取得された第1輝度情報、第2輝度情報及び第1の画像に基づいて撮影シーンを判別するシーン判別処理手段と、
前記シーン判別処理手段による判別結果に基づいて前記第1の画像に対する階調処理条件を設定する階調処理条件設定手段と、
を備えたことを特徴としている。
In order to solve the above-mentioned problem, the invention described in claim 1
First image acquisition means for acquiring a first image by photographing;
First luminance information acquisition means for acquiring first luminance information in a predetermined first area from a photometric value of the imaging area calculated at the time of shooting;
Second luminance information acquisition means for acquiring second luminance information in a second area around the first area from the calculated photometric value of the imaging area;
Scene discrimination processing means for discriminating a shooting scene based on the acquired first luminance information, second luminance information and the first image;
Gradation processing condition setting means for setting gradation processing conditions for the first image based on a determination result by the scene determination processing means;
It is characterized by having.

更に、請求項2に記載の発明は、請求項1に記載の発明において、
前記シーン判別処理手段は、
前記第1の画像の画像データから色情報を取得し、この取得された色情報に基づいて前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、
前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出手段と、
前記指標1、指標2、指標3、指標4、第1輝度情報及び第2輝度情報に基づいて前記画像データの撮影シーンを判別するシーン判別手段と、
を備えたことを特徴としている。
Furthermore, the invention according to claim 2 is the invention according to claim 1,
The scene discrimination processing means includes
Color information is acquired from the image data of the first image, and the image data is classified into classes composed of combinations of predetermined brightness and hue based on the acquired color information, and for each of the classified classes, First occupancy ratio calculating means for calculating a first occupancy ratio indicating a ratio of the entire image data;
Based on the acquired color information, the image data is classified into a class composed of a combination of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the ratio of the entire image data to each classified class. Second occupancy rate calculating means for calculating the occupancy rate of
First index calculating means for calculating index 1 by multiplying the first occupancy by a preset first coefficient;
A second index calculating means for calculating index 2 by multiplying the first occupancy by a preset second coefficient;
A third index calculating means for calculating index 3 by multiplying the second occupancy by a preset third coefficient;
A fourth index calculating means for calculating index 4 by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a preset fourth coefficient;
Scene discriminating means for discriminating a shooting scene of the image data based on the index 1, the index 2, the index 3, the index 4, the first luminance information and the second luminance information;
It is characterized by having.

更に、請求項3に記載の発明は、請求項1又は2に記載の発明において、
前記第1の画像取得手段により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得手段を備え、
前記シーン判別処理手段は、前記第2の画像取得手段により取得された第2の画像に基づいて撮影シーンを判別することを特徴としている。
Furthermore, the invention according to claim 3 is the invention according to claim 1 or 2,
Second image acquisition means for acquiring a second image obtained by reducing the image size from the first image acquired by the first image acquisition means;
The scene discrimination processing means discriminates a shooting scene based on the second image acquired by the second image acquisition means.

更に、請求項4に記載の発明は、請求項1〜3の何れか一項に記載の発明において、
前記階調処理条件設定手段は、
前記第1の画像、第1輝度情報及び第2輝度情報に基づいて算出された指標に基づき、階調調整パラメータを算出する階調調整パラメータ算出手段を備え、
前記シーン判別処理手段による判別結果と、前記階調調整パラメータ算出手段により算出された前記階調調整パラメータと、に基づいて前記第1の画像に対する階調処理条件を設定することを特徴としている。
Furthermore, the invention according to claim 4 is the invention according to any one of claims 1 to 3,
The gradation processing condition setting means includes:
Gradation adjustment parameter calculation means for calculating a gradation adjustment parameter based on an index calculated based on the first image, the first luminance information, and the second luminance information;
A gradation processing condition for the first image is set based on a determination result by the scene determination processing unit and the gradation adjustment parameter calculated by the gradation adjustment parameter calculation unit.

更に、請求項5に記載の発明は、請求項1〜4の何れか一項に記載の発明において、
前記階調処理条件設定手段により設定された階調処理条件に基づいて、前記第1の画像に対する階調変換処理を行う階調変換処理手段を備えたことを特徴としている。
Furthermore, the invention according to claim 5 is the invention according to any one of claims 1 to 4,
The image processing apparatus is characterized by further comprising gradation conversion processing means for performing gradation conversion processing on the first image based on the gradation processing conditions set by the gradation processing condition setting means.

更に、請求項6に記載の発明は、請求項1〜5の何れか一項に記載の発明において、
前記撮影領域の特定の撮影対象物に関して合焦を行い、その合焦点位置を検知する合焦手段を備え、
前記第1輝度情報取得手段は、前記合焦手段により検知された合焦点位置に基づいて前記第1領域を特定することを特徴としている。
Furthermore, the invention according to claim 6 is the invention according to any one of claims 1 to 5,
Focusing is performed with respect to a specific object to be photographed in the photographing region, and focusing means for detecting the focal position is provided.
The first luminance information acquisition unit is characterized in that the first region is specified based on a focus position detected by the focusing unit.

また、上記課題を解決するために、請求項7に記載の発明は、
撮影により第1の画像を取得する第1の画像取得工程と、
前記撮影時に算出された撮影領域の測光値から所定の第1領域における第1輝度情報を取得する第1輝度情報取得工程と、
前記算出された撮影領域の測光値から前記第1領域周辺の第2領域における第2輝度情報を取得する第2輝度情報取得工程と、
前記取得された第1輝度情報、第2輝度情報及び第2の画像に基づいて撮影シーンを判別するシーン判別処理工程と、
前記シーン判別処理工程による判別結果に基づいて前記第1の画像に対する階調処理条件を設定する階調処理条件設定工程と、
を含むことを特徴としている。
In order to solve the above problem, the invention according to claim 7 provides:
A first image acquisition step of acquiring a first image by photographing;
A first luminance information acquisition step of acquiring first luminance information in a predetermined first area from a photometric value of the imaging area calculated at the time of shooting;
A second luminance information acquisition step of acquiring second luminance information in a second region around the first region from the photometric value of the calculated imaging region;
A scene determination processing step of determining a photographic scene based on the acquired first luminance information, second luminance information, and second image;
A gradation processing condition setting step for setting a gradation processing condition for the first image based on a determination result by the scene determination processing step;
It is characterized by including.

更に、請求項8に記載の発明は、請求項7に記載の発明において、
前記シーン判別処理工程は、
前記第1の画像の画像データから色情報を取得し、この取得された色情報に基づいて前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出工程と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出工程と、
前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出工程と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出工程と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出工程と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出工程と、
前記指標1、指標2、指標3、指標4、第1輝度情報及び第2輝度情報に基づいて前記画像データの撮影シーンを判別するシーン判別工程と、
を含むことを特徴としている。
Further, the invention according to claim 8 is the invention according to claim 7,
The scene discrimination processing step includes
Color information is acquired from the image data of the first image, and the image data is classified into classes composed of combinations of predetermined brightness and hue based on the acquired color information, and for each of the classified classes, A first occupancy ratio calculating step of calculating a first occupancy ratio indicating a ratio of the entire image data;
Based on the acquired color information, the image data is classified into a class composed of a combination of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the ratio of the entire image data to each classified class. A second occupancy rate calculating step for calculating the occupancy rate of
A first index calculation step of calculating index 1 by multiplying the first occupancy by a preset first coefficient;
A second index calculating step of calculating index 2 by multiplying the first occupancy by a preset second coefficient;
A third index calculating step of calculating index 3 by multiplying the second occupancy by a preset third coefficient;
A fourth index calculating step of calculating index 4 by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a preset fourth coefficient;
A scene determination step of determining a shooting scene of the image data based on the index 1, the index 2, the index 3, the index 4, the first luminance information, and the second luminance information;
It is characterized by including.

更に、請求項9に記載の発明は、請求項7又は8に記載の発明において、
前記第1の画像取得工程により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得工程を含み、
前記シーン判別処理工程は、前記第2の画像取得手段により取得された第2の画像に基づいて撮影シーンを判別することを特徴としている。
Furthermore, the invention according to claim 9 is the invention according to claim 7 or 8,
Including a second image acquisition step of acquiring a second image obtained by reducing the image size from the first image acquired by the first image acquisition step;
The scene discrimination processing step is characterized in that a photographic scene is discriminated based on the second image acquired by the second image acquisition means.

更に、請求項10に記載の発明は、請求項7〜9の何れか一項に記載の発明において、
前記階調処理条件設定工程は、
前記第1の画像、第1輝度情報及び第2輝度情報に基づいて算出された指標に基づき、階調調整パラメータを算出する階調調整パラメータ算出工程を含み、
前記シーン判別処理工程による判別結果と、前記階調調整パラメータ算出工程により算出された前記階調調整パラメータと、に基づいて前記第1の画像に対する階調処理条件を設定することを特徴としている。
Furthermore, the invention according to claim 10 is the invention according to any one of claims 7 to 9,
The gradation processing condition setting step includes
A gradation adjustment parameter calculating step of calculating a gradation adjustment parameter based on an index calculated based on the first image, the first luminance information, and the second luminance information;
A gradation processing condition for the first image is set based on a determination result obtained by the scene determination processing step and the gradation adjustment parameter calculated by the gradation adjustment parameter calculation step.

更に、請求項11に記載の発明は、請求項7〜10の何れか一項に記載の発明において、
前記階調処理条件設定工程により設定された階調処理条件に基づいて、前記第1の画像に対する階調変換処理を行う階調変換処理工程を含むことを特徴としている。
Furthermore, the invention according to claim 11 is the invention according to any one of claims 7 to 10,
The image processing apparatus includes a gradation conversion processing step for performing gradation conversion processing on the first image based on the gradation processing conditions set by the gradation processing condition setting step.

更に、請求項12に記載の発明は、請求項7〜11の何れか一項に記載の発明において、
前記撮影領域における特定の撮影対象物に関して合焦を行い、その合焦点位置を検知する合焦工程を含み、
前記第1輝度情報取得工程は、前記合焦工程により検知された合焦点位置に基づいて前記第1領域を特定することを特徴としている。
Furthermore, the invention according to claim 12 is the invention according to any one of claims 7 to 11,
Focusing on a specific object to be photographed in the photographing region, and including a focusing step of detecting the focal point position;
The first luminance information acquisition step is characterized in that the first region is specified based on the focal position detected by the focusing step.

また、上記課題を解決するために、請求項13に記載の発明は、
画像処理を実行するためのコンピュータに、
撮影により第1の画像を取得する第1の画像取得機能と、
前記撮影時に算出された撮影領域の測光値から所定の第1領域における第1輝度情報を取得する第1輝度情報取得機能と、
前記算出された撮影領域の測光値から前記第1領域周辺の第2領域における第2輝度情報を取得する第2輝度情報取得機能と、
前記取得された第1輝度情報、第2輝度情報及び第2の画像に基づいて撮影シーンを判別するシーン判別処理機能と、
前記シーン判別処理機能による判別結果に基づいて前記第1の画像に対する階調処理条件を設定する階調処理条件設定機能と、
を実現させる。
In order to solve the above problems, the invention according to claim 13 is
In the computer for executing image processing,
A first image acquisition function for acquiring a first image by photographing;
A first luminance information acquisition function for acquiring first luminance information in a predetermined first area from a photometric value of the imaging area calculated at the time of shooting;
A second luminance information acquisition function for acquiring second luminance information in a second region around the first region from the photometric value of the calculated imaging region;
A scene discrimination processing function for discriminating a shooting scene based on the acquired first luminance information, second luminance information, and second image;
A gradation processing condition setting function for setting gradation processing conditions for the first image based on a determination result by the scene determination processing function;
Is realized.

更に、請求項14に記載の発明は、請求項13に記載の発明において、
前記シーン判別処理機能は、
前記第1の画像の画像データから色情報を取得し、この取得された色情報に基づいて前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出機能と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出機能と、
前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出機能と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出機能と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出機能と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出機能と、
前記指標1、指標2、指標3、指標4、第1輝度情報及び第2輝度情報に基づいて前記画像データの撮影シーンを判別するシーン判別機能と、
を有することを特徴している。
Furthermore, the invention of claim 14 is the invention of claim 13,
The scene discrimination processing function is
Color information is acquired from the image data of the first image, and the image data is classified into classes composed of combinations of predetermined brightness and hue based on the acquired color information, and for each of the classified classes, A first occupancy ratio calculating function for calculating a first occupancy ratio indicating a ratio of the entire image data;
Based on the acquired color information, the image data is classified into a class composed of a combination of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the ratio of the entire image data to each classified class. A second occupancy ratio calculating function for calculating the occupancy ratio of
A first index calculation function for calculating index 1 by multiplying the first occupancy by a preset first coefficient;
A second index calculation function for calculating index 2 by multiplying the first occupancy by a preset second coefficient;
A third index calculation function for calculating index 3 by multiplying the second occupancy by a preset third coefficient;
A fourth index calculation function for calculating index 4 by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a preset fourth coefficient;
A scene discrimination function for discriminating a shooting scene of the image data based on the index 1, the index 2, the index 3, the index 4, the first luminance information, and the second luminance information;
It is characterized by having.

更に、請求項15に記載の発明は、請求項13又は14に記載の発明において、
前記コンピュータに、
前記第1の画像取得機能により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得機能を実現させ、
前記シーン判別処理機能は、前記第2の画像取得機能により取得された第2の画像に基づいて撮影シーンを判別することを特徴としている。
Furthermore, the invention of claim 15 is the invention of claim 13 or 14,
In the computer,
Realizing a second image acquisition function for acquiring a second image obtained by reducing the image size from the first image acquired by the first image acquisition function;
The scene discrimination processing function discriminates a photographic scene based on the second image acquired by the second image acquisition function.

更に、請求項16に記載の発明は、請求項13〜15の何れか一項に記載の発明において、
前記階調処理条件設定機能は、
前記第1の画像、第1輝度情報及び第2輝度情報に基づいて算出された指標に基づき、階調調整パラメータを算出する階調調整パラメータ算出機能を有し、
前記シーン判別処理機能による判別結果と、前記階調調整パラメータ算出機能により算出された前記階調調整パラメータと、に基づいて前記第1の画像に対する階調処理条件を設定することを特徴としている。
Furthermore, the invention described in claim 16 is the invention described in any one of claims 13-15,
The gradation processing condition setting function is
A gradation adjustment parameter calculation function for calculating a gradation adjustment parameter based on an index calculated based on the first image, the first luminance information, and the second luminance information;
A gradation processing condition for the first image is set based on a determination result by the scene determination processing function and the gradation adjustment parameter calculated by the gradation adjustment parameter calculation function.

更に、請求項17に記載の発明は、請求項13〜16の何れか一項に記載の発明において、
前記コンピュータに、
前記階調処理条件設定機能により設定された階調処理条件に基づいて、前記第1の画像に対する階調変換処理を行う階調変換処理機能を実現させることを特徴としている。
Furthermore, the invention according to claim 17 is the invention according to any one of claims 13 to 16,
In the computer,
A gradation conversion processing function for performing gradation conversion processing on the first image is realized based on the gradation processing conditions set by the gradation processing condition setting function.

更に、請求項18に記載の発明は、請求項13〜17の何れか一項に記載の発明において、
前記コンピュータに、
前記撮影領域の特定の撮影対象物に関して合焦を行い、その合焦点位置を検知する合焦機能を実現させ、
前記第1輝度情報取得機能は、前記合焦手段により検知された合焦点位置に基づいて前記第1領域を特定することを特徴としている。
Furthermore, the invention according to claim 18 is the invention according to any one of claims 13 to 17,
In the computer,
Focusing on a specific object to be photographed in the photographing region, realizing a focusing function for detecting the focal position,
The first luminance information acquisition function is characterized in that the first area is specified based on a focus position detected by the focusing means.

請求項1、7、13に記載の発明によれば、撮影領域における第1輝度情報及び第2輝度情報に基づいて撮影シーンを判別し、この判別された撮影シーンに応じた階調処理条件を設定する。これにより、画像データから高精度に撮影シーンを判別することができ、また主要被写体のオーバー、アンダー露光、順光、逆光シーン等の撮影シーンの判別結果に応じた階調処理を施すことが可能となるため、より適切な補正画像を得ることができる。   According to the first, seventh, and thirteenth aspects of the present invention, the photographic scene is determined based on the first luminance information and the second luminance information in the photographic region, and the gradation processing condition corresponding to the determined photographic scene is set. Set. This makes it possible to discriminate shooting scenes from image data with high accuracy, and to perform gradation processing according to the discrimination results of shooting scenes such as overexposure, underexposure, forward light, and backlight scene of the main subject. Therefore, a more appropriate corrected image can be obtained.

請求項2、8、14に記載の発明によれば、第1の占有率及び第2の占有率から算出された指標に基づいて撮影シーンを判別するため、画像データから高精度に撮影シーンを判別することができ、また主要被写体のオーバー、アンダー露光、順光、逆光シーン等の撮影シーンの判別結果に応じた階調処理を施すことが可能となるため、より適切な補正画像を得ることができる。   According to the inventions described in claims 2, 8, and 14, since the shooting scene is determined based on the index calculated from the first occupancy rate and the second occupancy rate, the shooting scene is accurately detected from the image data. Since it is possible to perform the gradation processing according to the discrimination result of the shooting scene such as the overshoot of the main subject, underexposure, forward light, backlight scene, etc., it is possible to obtain a more appropriate corrected image Can do.

請求項3、9、15に記載の発明によれば、第1の画像から画像サイズを縮小した第2の画像に基づいて撮影シーンを判別するため、より高速に画像データから撮影シーンを判別することができる。   According to the third, ninth, and fifteenth aspects of the present invention, since the shooting scene is determined based on the second image obtained by reducing the image size from the first image, the shooting scene is determined from the image data at a higher speed. be able to.

請求項4、10、16に記載の発明によれば、撮影シーンの判別結果と階調調整パラメータとに基づいて第1の画像に対する階調処理条件を設定するため、より適切な階調処理を施すことが可能となり、より適切な補正画像を得ることができる。   According to the fourth, tenth, and sixteenth aspects of the present invention, since the gradation processing condition for the first image is set based on the result of determining the shooting scene and the gradation adjustment parameter, more appropriate gradation processing is performed. Therefore, a more appropriate corrected image can be obtained.

請求項5、11、17に記載の発明によれば、設定された階調処理条件に基づいて第1の画像に対する階調変換処理を行うため、より適切な補正画像を得ることができる。   According to the fifth, eleventh, and seventeenth aspects, the gradation conversion process is performed on the first image based on the set gradation processing condition, so that a more appropriate corrected image can be obtained.

請求項6、12、18に記載の発明によれば、合焦点位置に基づいて第1領域を特定するため、主要被写体のオーバー、アンダー露光、順光、逆光シーン等の撮影シーンの判別結果に応じた階調処理を施すことが可能となり、より適切な補正画像を得ることができる。   According to the sixth, twelfth and eighteenth aspects of the present invention, since the first area is specified based on the in-focus position, the determination result of the photographic scene such as the overshoot of the main subject, the underexposure, the forward light, the backlight scene, etc. Accordingly, it is possible to perform gradation processing correspondingly, and a more appropriate corrected image can be obtained.

以下、図面を参照して本発明を実施するための最良の形態について詳細に説明する。ただし、発明の範囲は図示例に限定されないものとする。   The best mode for carrying out the present invention will be described below in detail with reference to the drawings. However, the scope of the invention is not limited to the illustrated examples.

(撮像装置1の構成)
まず、本発明に係る撮像装置1の構成について説明する。
図1(a)に、撮像装置1の前面図を示し、図1(b)に、撮像装置1の背面図を示す。撮像装置1は、例えば、デジタルカメラ等であって、金属または合成樹脂等の材料で構成された筐体21の内部または表面に、十字キー22、撮影光学系23、フラッシュ24、ファインダ25、電源スイッチ26、表示部27、レリ一ズボタン28が設けられている。
(Configuration of the imaging device 1)
First, the configuration of the imaging device 1 according to the present invention will be described.
FIG. 1A shows a front view of the imaging apparatus 1, and FIG. 1B shows a rear view of the imaging apparatus 1. The imaging device 1 is, for example, a digital camera or the like, and has a cross key 22, a photographing optical system 23, a flash 24, a finder 25, a power source, on the inside or the surface of a housing 21 made of a material such as metal or synthetic resin. A switch 26, a display unit 27, and a release button 28 are provided.

図2に、撮像装置1の内部構成を示す。撮像装置1は、図2に示すように、プロセッサ31、メモリ32、CCD(Charge Coupled Device)等の撮像素子33、撮影光学系23、タイミングジェネレータ41、シャッタユニット42、絞りユニット43、フォーカスユニット44、表示部27、操作部38、画像データ出力部37により構成される。またプロセッサ31は、撮影制御や撮影画像の処理を行う撮影処理部20と画像処理を行う画像処理部10を有している。   FIG. 2 shows an internal configuration of the imaging apparatus 1. As shown in FIG. 2, the image pickup apparatus 1 includes a processor 31, a memory 32, an image pickup device 33 such as a CCD (Charge Coupled Device), a shooting optical system 23, a timing generator 41, a shutter unit 42, a diaphragm unit 43, and a focus unit 44. , A display unit 27, an operation unit 38, and an image data output unit 37. The processor 31 includes a photographing processing unit 20 that performs photographing control and processing of a photographed image, and an image processing unit 10 that performs image processing.

十字キー22は、上下左右の4方向のボタンからなり、ユーザが種々のモードを選択または設定するためのものである。   The cross key 22 is made up of buttons in four directions, up, down, left and right, and is used by the user to select or set various modes.

撮影光学系23は、複数のレンズ、鏡胴等によって構成され、ズーム機能を有している。撮影光学系23は、レンズが受光した光を撮像素子33に結像させる。フラッシュ24は、被写体輝度が低い時に、プロセッサ31からの制御信号により補助光を照射する。   The photographing optical system 23 includes a plurality of lenses, a lens barrel, and the like, and has a zoom function. The photographing optical system 23 causes the light received by the lens to form an image on the image sensor 33. The flash 24 emits auxiliary light by a control signal from the processor 31 when the subject brightness is low.

ファインダ25は、ユーザが接眼して撮影対象及び撮影領域を確認するためのものである。電源スイッチ26は、撮像装置1における動作のON/OFFを操作するためのスイッチである。   The viewfinder 25 is used for the user to check the shooting target and shooting area by eye contact. The power switch 26 is a switch for operating ON / OFF of the operation in the imaging apparatus 1.

表示部27は、液晶パネルにより構成され、プロセッサ31から入力される表示制御信号に従って、撮像素子33に現在写っている画像、過去に撮影した画像、メニュー画面、設定画面等を表示する。   The display unit 27 includes a liquid crystal panel, and displays an image currently captured on the image sensor 33, an image captured in the past, a menu screen, a setting screen, and the like according to a display control signal input from the processor 31.

レリーズボタン28は、筐体21の上面に設けられており、ユーザによる半押し状態(予備撮影)と全押し状態(本撮影)とを区別して検出可能な2段階押し込みスイッチである。   The release button 28 is a two-stage push-in switch that is provided on the upper surface of the housing 21 and can detect a half-pressed state (preliminary shooting) and a fully-pressed state (main shooting) by the user.

メモリ32は、撮影によって得られた画像データを記憶(保存)する。また、メモリ32は、撮像装置1において実行される各種処理プログラム及び当該処理プログラムで利用されるデータ等を記憶する。   The memory 32 stores (saves) image data obtained by photographing. In addition, the memory 32 stores various processing programs executed in the imaging apparatus 1, data used in the processing programs, and the like.

画像データ出力部37は、保存用の記録媒体(SDメモリカードまたはマルチメディアカード(MMC)等)にメモリ32内の画像データを転送、記録する、あるいは外部装置へ転送する。画像データ出力部37はプロセッサ31により制御される。   The image data output unit 37 transfers and records the image data in the memory 32 to a recording medium for storage (such as an SD memory card or a multimedia card (MMC)), or transfers it to an external device. The image data output unit 37 is controlled by the processor 31.

撮像素子33は、結像された光を電荷に変換する。これにより、例えば、図12(a)に示すような画像データが得られる。この画像には、撮像範囲(撮影範囲)にある物、すなわち、撮影対象物(撮影の目標物)とそれ以外の物(背景)とが含まれている。この全体画像の各画素のRGB値は、例えば、256階調で表される。   The image sensor 33 converts the imaged light into electric charges. Thereby, for example, image data as shown in FIG. This image includes an object in the imaging range (imaging range), that is, an imaging object (imaging target) and other objects (background). The RGB value of each pixel of the entire image is represented by, for example, 256 gradations.

シャッタユニット42は、レリーズボタン28によって検出された状態(半押し状態または全押し状態)に基づいて撮像素子33をリセットするタイミング及び電荷変換を行うタイミング等を制御する。タイミングの制御はタイミングジェネレータ41により行われる。シャッタユニット42による露光量制御については後述する。   The shutter unit 42 controls the timing of resetting the image sensor 33 and the timing of charge conversion based on the state (half-pressed state or fully-pressed state) detected by the release button 28. Timing control is performed by the timing generator 41. The exposure amount control by the shutter unit 42 will be described later.

撮像素子33が受光する光量の調節は、絞りユニット43及び/またはシャッタユニット42によって行われる。フォーカスユニット44は、撮影光学系23を駆動させ撮影被写体に対して焦点を合わせる制御動作を実行する。フォーカスユニット44による合焦点制御については後述する。   Adjustment of the amount of light received by the image sensor 33 is performed by the aperture unit 43 and / or the shutter unit 42. The focus unit 44 performs a control operation for driving the photographing optical system 23 to focus on the photographing subject. Focus control by the focus unit 44 will be described later.

(撮影処理部20の内部構成)
図3に、撮影処理部20の内部構成を示す。撮影処理部20は、撮影時に撮影条件に関わる制御や、撮影された画像の処理を行う。以下、図3を用いて、撮影処理部20の内部構成を説明する。
(Internal configuration of the imaging processing unit 20)
FIG. 3 shows an internal configuration of the imaging processing unit 20. The shooting processing unit 20 performs control related to shooting conditions during shooting and processing of shot images. Hereinafter, the internal configuration of the imaging processing unit 20 will be described with reference to FIG.

図3に示すように、撮影処理部20は、撮影条件に関わるAE制御部51、AF制御部52、そして撮影された画像に対して画像処理を行う画素補間部53、AWB制御部54、ガンマ補正部55等により構成される。   As shown in FIG. 3, the imaging processing unit 20 includes an AE control unit 51, an AF control unit 52, and a pixel interpolation unit 53, an AWB control unit 54, and a gamma that perform image processing on a captured image. It is comprised by the correction | amendment part 55 grade | etc.,.

AE制御部51は、画像撮影時にその露光量の自動制御を行う。通常、撮影待機時の露光量制御は、絞り開放でシャッタ速度を制御することによって行われ、撮影時の露光量は絞りとシャッタ速度とで制御される。   The AE control unit 51 automatically controls the exposure amount at the time of image shooting. Normally, the exposure amount control during shooting standby is performed by controlling the shutter speed with the aperture opened, and the exposure amount during shooting is controlled by the aperture and shutter speed.

AE制御部51における撮影待機時の露光量制御は、例えば以下のように行われる(図4(a)のフローチャート参照)。   For example, the exposure amount control during shooting standby in the AE control unit 51 is performed as follows (see the flowchart in FIG. 4A).

まず絞りユニット43により、絞りが開放固定絞りに設定される(ステップS111)。AE制御部51により、撮像素子33によって得られた画像データから所定の測光エリアのデータが読み出され(ステップS112)、輝度値に相当する情報が取得される(ステップS113)。この輝度値に相当する情報は、AE制御のための情報として用いられ、簡易的にRGB3色成分のうちのG値が用いられることが多い(以下これを輝度情報Gと呼ぶ)。この輝度情報Gに応じて撮像素子33の次のフレームにおける電荷蓄積時間が設定され(ステップS114)、タイミングジェネレータ41により、所定の輝度レベルとなるように、次のフレームにおける電荷蓄積時間が制御される(ステップS117)。これがシャッタ速度の制御であり、電荷が蓄積される様子を図5に示す。すなわち、取得した輝度レベルが大きい(明るい)ときは電荷蓄積時間が短くなり、輝度レベルが小さい(暗い)ときは電荷蓄積時間が長くなることで、露光量を安定させる。   First, the diaphragm unit 43 sets the diaphragm to an open fixed diaphragm (step S111). The AE control unit 51 reads data of a predetermined photometric area from the image data obtained by the image sensor 33 (step S112), and acquires information corresponding to the luminance value (step S113). Information corresponding to the luminance value is used as information for AE control, and the G value of RGB three-color components is often used simply (hereinafter referred to as luminance information G). The charge accumulation time in the next frame of the image sensor 33 is set according to the luminance information G (step S114), and the charge accumulation time in the next frame is controlled by the timing generator 41 so that the predetermined luminance level is obtained. (Step S117). This is control of the shutter speed, and FIG. 5 shows how charges are accumulated. That is, when the acquired luminance level is large (bright), the charge accumulation time is shortened, and when the acquired luminance level is small (dark), the charge accumulation time is lengthened, thereby stabilizing the exposure amount.

このように撮影待機時の露光量制御が行われることで、撮影者は液晶等の表示部27で露光量制御されたライブビュー画像を観察することができる。   By performing exposure amount control during shooting standby in this way, a photographer can observe a live view image whose exposure amount is controlled on the display unit 27 such as a liquid crystal display.

AE制御部51における実際の撮影時の露光量制御は、上記のシャッタ速度制御に加えて、絞りの制御も行われる(図4(b)のフローチャート参照)。上記同様(ステップS112、S113)に得られた測光エリアの輝度情報Gに応じて、絞りユニット43が制御され、絞り値が設定される(ステップS116)。すなわち、取得した輝度レベルが大きい(明るい)ときは絞り値を小さくし、輝度レベルが小さい(暗い)ときは絞り値を大きくすることで、露光量を安定させる。シャッタ速度と組み合わせての調節レベルは、予め定められたプログラム線図のデータに基づき、例えば、撮像素子33の電荷蓄積時間が絞り値に応じて調整される等の制御が行われる(ステップS115、S117)。   In the exposure control at the time of actual photographing in the AE control unit 51, in addition to the shutter speed control described above, aperture control is also performed (see the flowchart in FIG. 4B). Similarly to the above (steps S112 and S113), the aperture unit 43 is controlled according to the luminance information G of the photometric area, and an aperture value is set (step S116). That is, the exposure value is stabilized by decreasing the aperture value when the acquired brightness level is large (bright) and increasing the aperture value when the brightness level is low (dark). The adjustment level in combination with the shutter speed is controlled based on data of a predetermined program diagram, for example, the charge accumulation time of the image sensor 33 is adjusted according to the aperture value (step S115, S117).

このように、撮影時に露光量制御が行われることで、撮影者は任意の、あるいは既定の、絞り値とシャッタ速度の組み合わせで、撮影画像に対する露光量設定を自動的に行うことができる。   As described above, the exposure amount control is performed at the time of photographing, so that the photographer can automatically perform the exposure amount setting for the photographed image with an arbitrary or predetermined combination of the aperture value and the shutter speed.

AF制御部52は、画像撮影時に撮影領域内の特定の撮影対象物に関して焦点を合わせる自動制御を行う。この合焦点制御は、例えば以下のように撮影光学系を駆動することで合焦点位置を検知し、その位置に合わせて停止させることで行われる(図6のフローチャート参照)。すなわち、AF制御部52は、合焦手段として機能する。   The AF control unit 52 performs automatic control for focusing on a specific shooting target in the shooting area when shooting an image. This in-focus control is performed by, for example, driving the photographing optical system as described below to detect the in-focus position and stopping it according to the position (see the flowchart in FIG. 6). That is, the AF control unit 52 functions as a focusing unit.

撮影光学系23の駆動が開始されると(ステップS121)、その駆動に伴い逐次、AF制御部52は、撮像素子33によって得られた画像データから所定の測距エリアのデータを読み出し(ステップS122)、このデータに応じてコントラスト情報を取得する(ステップS123)。これは、合焦点位置に達したかどうかを検知するためであり、次のように判定される。すなわち、コントラスト情報は、測距エリアのデータの各隣接画素間の差を取ることにより、エッジ部のシャープさに依存するように設定、算出されるものであり、測距エリア全体での総和が最大に達した状態が合焦点と判断される(ステップS124、S125)。合焦点位置でないと判断された場合は、撮影光学系の移動が継続される(ステップS126)。   When driving of the photographic optical system 23 is started (step S121), the AF control unit 52 sequentially reads data of a predetermined distance measuring area from the image data obtained by the image sensor 33 (step S122). ), Contrast information is acquired according to this data (step S123). This is for detecting whether or not the in-focus position has been reached, and is determined as follows. That is, the contrast information is set and calculated so as to depend on the sharpness of the edge portion by taking the difference between adjacent pixels in the distance measurement area data. The state that has reached the maximum is determined to be the focal point (steps S124 and S125). If it is determined that the focus position is not reached, the movement of the photographing optical system is continued (step S126).

撮影光学系23の移動に伴うコントラスト情報の変化と合焦点位置検出の様子を図7に示す。上記動作は、光学系を駆動しながら逐次コントラスト情報を取得して、合焦点位置を求めるという測距演算が行われたものであり、その焦点距離に合わせて撮影光学系23は停止される(ステップS127)。すなわち、ステップS124〜127は合焦工程として機能する。   FIG. 7 shows a change in contrast information accompanying the movement of the photographic optical system 23 and how the focal point position is detected. In the above operation, a distance measurement calculation is performed in which contrast information is sequentially acquired while driving the optical system to obtain a focal point position, and the photographing optical system 23 is stopped in accordance with the focal length ( Step S127). That is, steps S124 to 127 function as a focusing process.

このようなAF制御により、撮影時に常に自動的にピントのあった撮影画像を得ることができる。   With such AF control, it is possible to obtain a captured image that is always in focus automatically during shooting.

画素補間部53は、撮像素子33におけるRGB各色成分を分散配置したCCD配列に対して、各色成分毎に画素間の補間を行い、同一画素位置で各色成分値が得られるように画像データを処理する(図8のフローチャート参照)。   The pixel interpolation unit 53 interpolates pixels for each color component with respect to the CCD array in which the RGB color components are dispersedly arranged in the image sensor 33, and processes the image data so that each color component value is obtained at the same pixel position. (Refer to the flowchart of FIG. 8).

画素補間部53は、撮像素子33によって得られたRGB画像データ(ステップS131)をRGBの各画素フィルタパターンでマスキングし(ステップS132、S134、S136)、その後で平均補間(画素補間ともいう)を行う(ステップS133、S135、S137)。このうち、高帯域にまで画素を有するGの画素フィルタパターンは、周辺4画素の中間2値の平均値に置換して平均補間を行うメディアン(中間値)フィルタであり、RとBの画素フィルタパターンは、周辺9画素から同色に対して平均補間を行うものである。   The pixel interpolation unit 53 masks the RGB image data (step S131) obtained by the image sensor 33 with each of the RGB pixel filter patterns (steps S132, S134, S136), and then performs average interpolation (also referred to as pixel interpolation). (Steps S133, S135, S137). Among these, the G pixel filter pattern having pixels up to a high band is a median filter that performs average interpolation by substituting the average value of the intermediate binary values of the surrounding four pixels, and the R and B pixel filters The pattern performs average interpolation with respect to the same color from 9 neighboring pixels.

AWB制御部54は、撮影画像におけるホワイトバランスを自動的に調整する。撮影された画像は、その中にRGBのカラーバランスがとれている(総和すればホワイト)被写体領域があるものという想定で、その領域のホワイトバランスを達成するように、画像のRGBの各成分値に対するレベル調整を行う。このホワイトバランス処理は、例えば以下のように行われる(図9のフローチャート参照)。   The AWB control unit 54 automatically adjusts the white balance in the captured image. Assuming that the photographed image has a subject area in which RGB color balance is achieved (white when summed up), each component value of RGB of the image is achieved so as to achieve white balance in that area. Adjust the level for. This white balance processing is performed, for example, as follows (see the flowchart of FIG. 9).

AWB制御部54は、撮像素子33によって得られた画像データの輝度や彩度のデータから(ステップS141)、本来ホワイトであると思われる領域を推測する(ステップS142)。その領域について、RGB各成分値の平均強度、及びG/R比、G/B比を求め、G値に対するR値、B値の補正ゲインを算出する(ステップS143、S144)。これに基づき、画像全体における各色成分に対するゲインの補正を行う(ステップS145)。   The AWB control unit 54 estimates an area that is supposed to be white from the luminance and saturation data of the image data obtained by the image sensor 33 (step S141). For that region, the average intensity, G / R ratio, and G / B ratio of each RGB component value are obtained, and the R value and B value correction gains for the G value are calculated (steps S143 and S144). Based on this, gain correction for each color component in the entire image is performed (step S145).

このようなAWB制御により、撮影時に生ずる画面全体のカラーバランスの崩れを自動的に補正することができ、実際の被写体の照明状態に拘わらず、安定した色調の画像を得ることができる。   By such AWB control, it is possible to automatically correct the collapse of the color balance of the entire screen that occurs during shooting, and an image with a stable color tone can be obtained regardless of the actual illumination state of the subject.

ガンマ補正部55は、撮影画像の階調性を出力機器の特性に適するように変換する処理を行う。   The gamma correction unit 55 performs processing for converting the gradation of the captured image so as to be suitable for the characteristics of the output device.

ガンマ特性とは階調特性のことであり、入力階調に対してどのように出力階調を設定するかを補正値あるいは補正曲線等で示すものである。図10に入力値に対して、補正した出力値を示す補正曲線の例を示す。ガンマ補正は、この補正値あるいは補正曲線等に従い、入力値に対する出力値への変換を行う変換処理となる。出力機器によってこの階調特性は異なるため、その出力機器に適した階調とするために、このガンマ特性の補正を行う必要がある。これにより撮影されたリニア画像はノンリニア画像に変換されることになる。   The gamma characteristic is a gradation characteristic, and indicates how an output gradation is set with respect to an input gradation by a correction value or a correction curve. FIG. 10 shows an example of a correction curve indicating an output value corrected for the input value. The gamma correction is a conversion process for converting an input value into an output value according to the correction value or the correction curve. Since this gradation characteristic varies depending on the output device, it is necessary to correct this gamma characteristic in order to obtain a gradation suitable for the output device. As a result, the captured linear image is converted into a non-linear image.

出力機器としては一般的にはモニタが設定され、一般的なモニタのガンマ特性に合うように撮影画像のガンマ補正は行われる。   A monitor is generally set as the output device, and gamma correction of the captured image is performed so as to match the gamma characteristic of a general monitor.

(画像処理部10の内部構成)
図11に、画像処理部10の内部構成を示す。画像処理部10は、撮像装置1における撮影画像に対して、シーン判別に基づく階調の補正動作を制御するものであり、撮影処理部20での処理後に、あるいはその処理とは独立して、画像取得、シーン判別、階調処理条件設定等の一連の処理を実行する。以下、図11を用いて、画像処理部10の内部構成を説明する。
(Internal configuration of the image processing unit 10)
FIG. 11 shows an internal configuration of the image processing unit 10. The image processing unit 10 controls a gradation correction operation based on scene discrimination for a captured image in the imaging apparatus 1, and after the processing in the imaging processing unit 20 or independently of the processing, A series of processes such as image acquisition, scene discrimination, and gradation processing condition setting are executed. Hereinafter, the internal configuration of the image processing unit 10 will be described with reference to FIG.

図11に示すように、画像処理部10は、第1画像取得部101、第2画像取得部102、占有率算出部103、指標算出部104、シーン判別部105、階調処理条件設定部106、そして階調変換処理部107により構成される。   As shown in FIG. 11, the image processing unit 10 includes a first image acquisition unit 101, a second image acquisition unit 102, an occupation rate calculation unit 103, an index calculation unit 104, a scene determination unit 105, and a gradation processing condition setting unit 106. , And a gradation conversion processing unit 107.

第1画像取得部101は、レリーズボタン28が全押しされたタイミングで、撮像素子33に写った最新の画像の画像データを第1の画像として取得する。すなわち、第1画像取得部101は、第1の画像取得手段として機能する。また、第1画像取得部101は、第1の画像の撮影時において、撮影領域を複数の測光領域に分割し、各測光領域について個別に測光値(輝度情報)を取得する。   The first image acquisition unit 101 acquires the image data of the latest image captured on the image sensor 33 as the first image when the release button 28 is fully pressed. That is, the first image acquisition unit 101 functions as a first image acquisition unit. In addition, the first image acquisition unit 101 divides the imaging area into a plurality of photometric areas when acquiring the first image, and acquires photometric values (luminance information) individually for each photometric area.

具体的には、取得された複数の輝度情報のうち、撮影領域における第1領域から第1輝度情報を取得するとともに、第1領域の周辺領域に対応する第2領域から第2輝度情報を取得する。すなわち、第1画像取得部101は、第1輝度情報取得手段及び第2輝度情報取得手段として機能する。なお、本実施形態で取得する第1輝度情報及び第2輝度情報は、複数の測光値から算出される輝度値(Brightness Value、以後、第1輝度情報をBV1、第2輝度情報BV2と称する)を意味している。ここで、第1輝度情報BV1及び第2輝度情報BV2の算出方法は特に問わないものとするが、例えば、第1の領域における複数の輝度情報の平均値を第1輝度情報BV1、第2の領域における複数の輝度情報の平均値を第2輝度情報BV2としてもよい。なお、取得した第1の画像の画像データ、第1輝度情報BV1及び第2輝度情報BV2は、メモリ32に保存される。   Specifically, among the plurality of acquired luminance information, the first luminance information is acquired from the first area in the shooting area, and the second luminance information is acquired from the second area corresponding to the peripheral area of the first area. To do. That is, the first image acquisition unit 101 functions as a first luminance information acquisition unit and a second luminance information acquisition unit. The first luminance information and the second luminance information acquired in the present embodiment are luminance values calculated from a plurality of photometric values (Brightness Value, hereinafter, the first luminance information is referred to as BV1 and second luminance information BV2). Means. Here, the calculation method of the first luminance information BV1 and the second luminance information BV2 is not particularly limited. For example, the average value of the plurality of luminance information in the first region is set to the first luminance information BV1, the second luminance information BV2, and the second luminance information BV2. An average value of a plurality of luminance information in the area may be used as the second luminance information BV2. The acquired image data of the first image, the first luminance information BV1 and the second luminance information BV2 are stored in the memory 32.

図13は、撮影領域における測光領域として中心部の測光領域(第1領域)A1と、この第1領域周辺の第2領域A2とに2分割した例である。ここで第1領域A1は、フォーカスユニット44により検知された合焦点位置に基づいて特定されるようになっている。例えば、合焦点位置を含む測光領域を第1領域とする方法もあるし、他には合焦点位置を含む測光領域とそれに隣接する測光領域を第1領域とする方法もある。即ち、撮影領域内において合焦の対象となった主要被写体に対応する第1領域A1から第1輝度情報BV1を取得し、この第1領域(主要被写体)周辺の背景となる第2領域A2から第2輝度情報BV2を取得するようになっている。   FIG. 13 shows an example in which the photometric area in the photographing area is divided into two, a photometric area (first area) A1 at the center and a second area A2 around the first area. Here, the first area A1 is specified based on the in-focus position detected by the focus unit 44. For example, there is a method in which the photometry area including the in-focus position is the first area, and there is another method in which the photometry area including the in-focus position and the photometry area adjacent thereto are the first area. That is, the first luminance information BV1 is acquired from the first area A1 corresponding to the main subject that is the focus target in the shooting area, and the second area A2 that is the background around the first area (main subject) is acquired. The second luminance information BV2 is acquired.

第2画像取得部102は、取得した第1の画像を、M×N個の矩形の領域(垂直方向にM個及び水平方向にN個に分割された領域)に分割する。図12(a)に、第1の画像の一例を示し、図12(b)に、当該第1の画像がM×N(14×22)個の領域に分割された例を示す。なお、分割領域の数は特に限定されない。本実施形態では、分割された各領域を画像データの「画素」と見なし、分割された画像を実質的にサイズが縮小された画像として扱う。この縮小された画像が、第2の画像であり、上記操作により第2の画像を取得することになる。従って第2画像取得部102は、第2の画像取得手段として機能する。   The second image acquisition unit 102 divides the acquired first image into M × N rectangular regions (regions divided into M pieces in the vertical direction and N pieces in the horizontal direction). FIG. 12A shows an example of the first image, and FIG. 12B shows an example in which the first image is divided into M × N (14 × 22) areas. The number of divided areas is not particularly limited. In the present embodiment, each divided area is regarded as a “pixel” of image data, and the divided image is handled as an image with a substantially reduced size. This reduced image is the second image, and the second image is acquired by the above operation. Therefore, the second image acquisition unit 102 functions as a second image acquisition unit.

占有率算出部103は、第2の画像の画像データ、すなわち画像を構成する各画素に対して、色情報を取得する。取得された色情報に基づいて、画像の各画素を、明度と色相の組み合わせからなる所定の階級に分類し(図17参照)、分類された階級毎に、当該階級に属する画素が画像全体に占める割合を示す第1の占有率を算出する。すなわち、占有率算出部103は、第1の占有率算出手段として機能する。   The occupation ratio calculation unit 103 acquires color information for the image data of the second image, that is, for each pixel constituting the image. Based on the acquired color information, each pixel of the image is classified into a predetermined class composed of a combination of lightness and hue (see FIG. 17), and for each classified class, the pixels belonging to the class are included in the entire image. A first occupation ratio indicating the occupation ratio is calculated. That is, the occupation ratio calculation unit 103 functions as a first occupation ratio calculation unit.

また、占有率算出部103は、第2の画像の各画素を、第2の画像の画面の外縁からの距離と明度の組み合わせからなる所定の階級に分類し(図18参照)、分類された階級毎に、当該階級に属する画素が画像全体に占める割合を示す第2の占有率を算出する。すなわち、占有率算出部103は、第2の占有率算出手段としても機能する。   Further, the occupancy rate calculation unit 103 classifies each pixel of the second image into a predetermined class composed of a combination of the distance from the outer edge of the screen of the second image and the brightness (see FIG. 18). For each class, a second occupancy ratio indicating the ratio of pixels belonging to the class to the entire image is calculated. That is, the occupation rate calculation unit 103 also functions as a second occupation rate calculation unit.

占有率算出部103において実行される占有率算出処理については、後に図16を参照して詳細に説明する。   The occupation rate calculation process executed in the occupation rate calculation unit 103 will be described in detail later with reference to FIG.

指標算出部104は、占有率算出部103で算出された第1の占有率に、撮影条件に応じて予め設定された係数を乗算することにより、撮影シーンを特定するための指標1、及び指標2を算出する。すなわち、指標算出部104は、第1の指標算出手段、第2の指標算出手段として機能する。   The index calculation unit 104 multiplies the first occupancy calculated by the occupancy rate calculation unit 103 by a coefficient set in advance according to the shooting conditions, thereby specifying the index 1 for specifying the shooting scene, and the index 2 is calculated. That is, the index calculation unit 104 functions as a first index calculation unit and a second index calculation unit.

また、指標算出部104は、占有率算出部103で算出された第2の占有率に、撮影条件に応じて予め設定された係数を乗算することにより、撮影シーンを特定するための指標3を算出する。すなわち、指標算出部104は、第3の指標算出手段、第2の指標算出手段として機能する。   In addition, the index calculation unit 104 multiplies the second occupancy calculated by the occupancy rate calculation unit 103 by a coefficient set in advance according to the shooting condition, thereby obtaining an index 3 for specifying the shooting scene. calculate. That is, the index calculation unit 104 functions as a third index calculation unit and a second index calculation unit.

さらに、指標算出部104は、第2の画像の画面中央部における平均輝度値と、最大輝度値と平均輝度値との差分値のそれぞれに、撮影条件に応じて予め設定された係数を乗算することにより、撮影シーンを特定するための指標4を算出する。すなわち、指標算出部104は、第4の指標算出手段として機能する。   Further, the index calculation unit 104 multiplies each of the average luminance value in the central portion of the screen of the second image and the difference value between the maximum luminance value and the average luminance value by a coefficient set in advance according to the shooting condition. Thus, the index 4 for specifying the shooting scene is calculated. That is, the index calculation unit 104 functions as a fourth index calculation unit.

また、指標算出部104は、第2の画像の画面中央部における肌色領域の平均輝度値(指標7とする)と、指標1及び指標3と、前述の撮影時の第1輝度情報BV1及び第2輝度情報BV2とに、それぞれ、撮影条件に応じて予め設定された係数を乗算して和をとることにより、新たな指標5を算出する。   In addition, the index calculation unit 104 has an average luminance value (referred to as index 7) of the skin color area in the center of the screen of the second image, index 1 and index 3, and the first luminance information BV1 and the first luminance at the time of shooting described above. A new index 5 is calculated by multiplying the two luminance information BV2 by a coefficient set in advance according to the photographing condition and taking the sum.

また、指標算出部104は、第2の画像の画面中央部における肌色領域の平均輝度値と、指標2及び指標3と、前述の撮影時の第1輝度情報BV1及び第2輝度情報BV2とに、それぞれ、撮影条件に応じて予め設定された係数を乗算して和をとることにより、新たな指標6を算出する。   In addition, the index calculation unit 104 includes the average luminance value of the skin color area in the center of the screen of the second image, the index 2 and the index 3, and the first luminance information BV1 and the second luminance information BV2 at the time of shooting described above. Then, a new index 6 is calculated by multiplying a coefficient set in advance according to the photographing condition and taking the sum.

指標算出部104において実行される指標算出処理については、後に図19を参照して詳細に説明する。   The index calculation process executed in the index calculation unit 104 will be described in detail later with reference to FIG.

シーン判別部105は、指標算出部104で算出された各指標、第1輝度情報BV1及び第2輝度情報BV2に基づいて、第1の画像の撮影シーンを判別する。すなわち、シーン判別部105はシーン判別手段として機能する。ここで、撮影シーンとは、順光、逆光、近接フラッシュ等の被写体を撮影する時の光源条件を示しており、主要被写体(主に人物のことを指すが、これに限るものではない)のオーバー、アンダー等露出条件もこれに含まれるものとする。撮影シーン判別の方法については、後に詳細に説明する。   The scene determination unit 105 determines the shooting scene of the first image based on each index calculated by the index calculation unit 104, the first luminance information BV1, and the second luminance information BV2. That is, the scene determination unit 105 functions as a scene determination unit. Here, the shooting scene indicates a light source condition when shooting a subject such as a front light, a backlight, a proximity flash, etc., and is a main subject (mainly a person, but is not limited to this). This includes exposure conditions such as over and under. The method for determining the shooting scene will be described later in detail.

以上のように、占有率算出部103、指標算出部104そしてシーン判別部105がシーン判別処理手段として機能する。   As described above, the occupation rate calculation unit 103, the index calculation unit 104, and the scene determination unit 105 function as a scene determination processing unit.

階調処理条件設定部106は、階調処理条件設定手段として機能し、シーン判別部105で判別された撮影シーンに基づいて、第1の画像に対する階調処理条件(図26参照)を設定する。すなわち、階調処理条件設定部106は、階調処理条件設定手段として機能する。   The gradation processing condition setting unit 106 functions as a gradation processing condition setting unit, and sets gradation processing conditions (see FIG. 26) for the first image based on the shooting scene determined by the scene determination unit 105. . That is, the gradation processing condition setting unit 106 functions as a gradation processing condition setting unit.

また、階調処理条件設定部106は、指標算出部104で算出された各指標に基づいて、第1の画像に対する階調調整のための階調調整パラメータを算出する。従って、上記階調処理条件設定部106は、階調調整パラメータ算出手段として機能する。階調処理条件の設定については、後に図25を参照して詳細に説明する。   Further, the gradation processing condition setting unit 106 calculates a gradation adjustment parameter for gradation adjustment for the first image based on each index calculated by the index calculation unit 104. Therefore, the gradation processing condition setting unit 106 functions as a gradation adjustment parameter calculation unit. The setting of the gradation processing conditions will be described in detail later with reference to FIG.

階調変換処理部107は、階調変換処理手段として機能し、上記階調処理条件設定部106において設定された階調処理条件に従い、第1の画像に対する階調変換処理を実行する。すなわち、階調変換処理部107は、階調変換処理手段として機能する。   The gradation conversion processing unit 107 functions as a gradation conversion processing unit, and executes gradation conversion processing for the first image in accordance with the gradation processing conditions set in the gradation processing condition setting unit 106. That is, the gradation conversion processing unit 107 functions as a gradation conversion processing unit.

プロセッサ31は、上記画像処理部10で行われる処理以外に、公知技術に基づいて、自動ホワイトバランス処理、ガンマ変換処理等の撮影処理部20での処理や、またその他画像処理、画像フォーマット変換、画像データの記録等の処理動作を制御する機能を有する。   In addition to the processing performed in the image processing unit 10, the processor 31 performs processing in the photographing processing unit 20 such as automatic white balance processing and gamma conversion processing, and other image processing, image format conversion, It has a function of controlling processing operations such as recording of image data.

またプロセッサ31における各部の処理は、基本的にハードウエア処理によって行われるが、一部についてはメモリ32に記憶(保存)されているプログラムを実行する等してソフトウェア処理によって行われる。   The processing of each unit in the processor 31 is basically performed by hardware processing, but a part of the processing is performed by software processing such as executing a program stored (saved) in the memory 32.

(撮像装置1の動作フロー)
次に、本実施形態における撮像装置1の動作について説明する。なお、以下では撮影対象物を「主要被写体」と呼ぶことにする。
まず、図14のフローチャートを参照して、撮像装置1で実行される処理の全体の流れを説明する。
(Operation Flow of Imaging Device 1)
Next, the operation of the imaging device 1 in the present embodiment will be described. Hereinafter, the object to be photographed is referred to as “main subject”.
First, the overall flow of processing executed by the imaging apparatus 1 will be described with reference to the flowchart of FIG.

まず、電源スイッチ26がONに操作されると(電源が投入されると)、メモリ32のリセット等の前処理が行われる(ステップS1)。ユーザは、主要被写体が撮像装置1の被写界に入るように撮像装置1をその主要被写体の方に向け、撮影のための操作を関始する。レリーズボタン28が押されて撮影が行われる(ステップS2)。撮像素子33に結像した画像は電気信号として取り込まれ、CCD配列に基づく補間処理が行われる(ステップS4)。ステップS5では、撮影画像として、第1の画像が取得され、メモリ32に保持される。第1の画像はリニア画像であり、RAW画像と呼称される。すなわち、ステップS2、4,5は第1の画像取得工程として機能する。   First, when the power switch 26 is turned on (when the power is turned on), preprocessing such as resetting of the memory 32 is performed (step S1). The user starts an operation for photographing by directing the imaging device 1 toward the main subject so that the main subject enters the field of the imaging device 1. The release button 28 is pressed to take a picture (step S2). The image formed on the image sensor 33 is captured as an electrical signal, and interpolation processing based on the CCD array is performed (step S4). In step S <b> 5, the first image is acquired as a captured image and held in the memory 32. The first image is a linear image and is called a RAW image. That is, steps S2, 4, and 5 function as a first image acquisition process.

一方、撮影が行われると、第1輝度情報取得工程及び第2輝度情報取得工程であるステップS3では、撮影領域の第1領域A1及び第2領域A2から夫々第1輝度情報BV1及び第2輝度情報BV2が取得される。取得された第1輝度情報BV1及び第2輝度情報BV2はメモリ32に保持される。   On the other hand, when shooting is performed, in step S3 which is the first luminance information acquisition step and the second luminance information acquisition step, the first luminance information BV1 and the second luminance from the first region A1 and the second region A2 of the shooting region, respectively. Information BV2 is acquired. The acquired first luminance information BV1 and second luminance information BV2 are held in the memory 32.

撮影により取得された第1の画像は、AWB(自動ホワイトバランス)の処理を施される(ステップS6)。これは以下に述べる第2の画像の取得が行われてから、第1の画像と第2の画像とに対して別途処理されてもよい。   The first image acquired by shooting is subjected to AWB (automatic white balance) processing (step S6). This may be processed separately for the first image and the second image after the second image described below is acquired.

AWB処理の後、第1の画像の画像データは、一方で複数の分割領域からなる分割画像、すなわち第2の画像として取得される(ステップS7)。分割画像の各分割領域は第2の画像の画素であり、第2の画像は第1の画像のサイズを縮小した画像となる。図12(a)に、第1の画像の一例を示し、図12(b)に、当該第1の画像がM×N(14×22)個のセルに分割された例を示す。各セルが第2の画像の一画素に相当する。実際の画像データのサイズ縮小方法は、単純平均やバイリニア法やバイキュービック法等公知の技術を用いることができる。ステップS7は第2の画像取得工程として機能する。   After the AWB process, the image data of the first image is acquired as a divided image composed of a plurality of divided regions, that is, a second image (step S7). Each divided region of the divided image is a pixel of the second image, and the second image is an image obtained by reducing the size of the first image. FIG. 12A shows an example of the first image, and FIG. 12B shows an example in which the first image is divided into M × N (14 × 22) cells. Each cell corresponds to one pixel of the second image. As an actual image data size reduction method, a known technique such as a simple average, a bilinear method, or a bicubic method can be used. Step S7 functions as a second image acquisition process.

次いで、シーン判別処理工程であるステップS8では、取得された第1輝度情報BV1、第2輝度情報BV2及び第2の画像の画像データに基づいて、撮影シーンを判別するシーン判別処理が行われる。ステップS8の撮影シーン判別処理については、後に図15を参照して説明する。   Next, in step S8, which is a scene determination processing step, a scene determination process for determining a shooting scene is performed based on the acquired first luminance information BV1, second luminance information BV2, and image data of the second image. The shooting scene determination process in step S8 will be described later with reference to FIG.

次いで、階調処理条件設定工程であるステップS9では、ステップS8のシーン判別処理で得られた各指標及び撮影シーンの判別結果に基づいて、第1の画像の階調変換処理のために必要な条件を設定する処理が行われる。ステップS9の階調処理条件設定処理については、後に図25を参照して説明する。   Next, in step S9 which is a gradation processing condition setting step, it is necessary for the gradation conversion processing of the first image based on each index obtained in the scene determination processing in step S8 and the determination result of the shooting scene. Processing for setting conditions is performed. The gradation processing condition setting process in step S9 will be described later with reference to FIG.

一方、AWB処理後の第1の画像については、ガンマ変換処理が行われ、ノンリニア画像に変換される(ステップS10)。但し、ガンマ変換処理は階調の変換処理であり、次に述べるステップS11の階調変換処理と合わせて行ってもよい。   On the other hand, the first image after the AWB process is subjected to a gamma conversion process and converted to a non-linear image (step S10). However, the gamma conversion process is a gradation conversion process, and may be performed together with the gradation conversion process in step S11 described below.

階調変換処理工程であるステップS11では、第2の画像に基づいて設定された階調処理条件に基づいて、撮影画像である第1の画像の画像データに対する階調変換処理が行われる。ガンマ変換は視覚に合わせてノンリニアの階調に変換したが、ステップS11の階調変換は撮影シーンの光源条件等による階調への影響を補正するものであり、ステップS8での判別結果によりステップS9で設定した処理条件に基づき階調変換処理を行う。   In step S11, which is a gradation conversion processing step, gradation conversion processing is performed on the image data of the first image, which is a captured image, based on the gradation processing conditions set based on the second image. The gamma conversion is converted into a non-linear gradation in accordance with the visual sense. However, the gradation conversion in step S11 corrects the influence on the gradation due to the light source condition of the shooting scene, and the step is determined based on the determination result in step S8. The gradation conversion processing is performed based on the processing conditions set in S9.

なお本実施形態では、ステップS9、ステップS11で階調処理条件を設定し、変換処理する形態としているが、撮影された第1の画像に対する画像処理以外に、例えばその撮影シーンに対する最適な画像を取得するための露出条件をリアルタイムに算出し、撮影操作に反映するといった処理等を行うようにしてもよい。その際には、レリーズボタン28が半押しされたタイミング若しくはレリーズボタン28が押されなくても所定のタイミングにおいて撮像素子33に写った最新の画像の画像データを第1の画像とし、この第1の画像の取得時に姿勢情報を取得する態様としてもよい。   In the present embodiment, gradation processing conditions are set and converted in steps S9 and S11. However, in addition to image processing for the first image that has been shot, for example, an optimal image for the shooting scene is selected. Processing such as calculating exposure conditions for acquisition in real time and reflecting them in the shooting operation may be performed. At that time, the image data of the latest image captured on the image sensor 33 at the timing when the release button 28 is half-pressed or at a predetermined timing even when the release button 28 is not pressed is used as the first image. It is good also as an aspect which acquires attitude | position information at the time of acquisition of this image.

次いで、画像記録のため、画像フォーマットの変換が行われる(ステップS12)。一般的にはJPEG形式の画像に変換処理される。その後JPEG形式の画像データが、保存用の記録媒体(SDメモリカードまたはマルチメディアカード(MMC)等)に記録される(ステップS13)。次の撮影に移るか、あるいは電源スイッチ26がOFFに操作されると、撮像装置1における動作は終了する。   Next, the image format is converted for image recording (step S12). Generally, it is converted into an image in JPEG format. Thereafter, the image data in the JPEG format is recorded on a storage medium for storage (such as an SD memory card or a multimedia card (MMC)) (step S13). When the next shooting is started or the power switch 26 is turned off, the operation of the image pickup apparatus 1 ends.

(シーン判別処理のフロー)
次に、図15のフローチャート及び図16〜図24を参照して、撮像装置1でのシーン判別処理(図14のステップS8)について説明する。
(Scene discrimination process flow)
Next, with reference to the flowchart of FIG. 15 and FIGS. 16 to 24, the scene determination process (step S8 of FIG. 14) in the imaging apparatus 1 will be described.

シーン判別処理は、図15に示すように、色空間変換処理(ステップS20)、占有率算出処理(ステップS21)、指標算出処理(ステップS22)、シーン判別(ステップS23)の各処理により構成される。以下、図16〜図24を参照して、図15に示す各処理について詳細に説明する。   As shown in FIG. 15, the scene determination process includes a color space conversion process (step S20), an occupation ratio calculation process (step S21), an index calculation process (step S22), and a scene determination (step S23). The Hereinafter, each process illustrated in FIG. 15 will be described in detail with reference to FIGS. 16 to 24.

まず、図15のステップS20において、色空間変換処理が行われる。
本処理では、撮影された第1の画像から得られた第2の画像の各画素のRGB値、輝度値及びホワイトバランスを示す情報が取得される。なお、輝度値としては、RGB値を公知の変換式に代入して算出した値を用いてもよい。次いで、取得されたRGB値がHSV表色系に変換され、画像の色情報が取得される。HSV表色系とは、画像データを色相(Hue)、彩度(Saturation)、明度(ValueまたはBrightness)の3つの要素で表すものであり、マンセルにより提案された表色体系を元にして考案されたものである。HSV表色系への変換は、HSV変換プログラム等を用いて行われ、通常、入力であるR、G、Bに対して、算出された色相値Hは、スケールを0〜360と定義し、彩度値S、明度値Vは、単位を0〜255と定義している。
First, in step S20 of FIG. 15, a color space conversion process is performed.
In this process, information indicating the RGB value, the luminance value, and the white balance of each pixel of the second image obtained from the photographed first image is acquired. As the luminance value, a value calculated by substituting RGB values into a known conversion formula may be used. Next, the acquired RGB values are converted into the HSV color system, and the color information of the image is acquired. The HSV color system represents image data with three elements of hue (Hue), saturation (Saturation), and lightness (Value or Brightness), and was devised based on the color system proposed by Munsell. It has been done. The conversion to the HSV color system is performed using an HSV conversion program or the like. Usually, the calculated hue value H is defined as 0 to 360 for the input R, G, B, The unit of saturation value S and brightness value V is defined as 0-255.

なお、本実施形態において、「明度」は特に注釈を設けない限り一般に用いられる「明るさ」の意昧である。以下の記載において、HSV表色系のV(0〜255)を「明度」として用いるが、他の如何なる表色系の明るさを表す単位系を用いてもよい。その際、本実施形態で記載する各種係数等の数値を、改めて算出し直すことは言うまでもない。   In the present embodiment, “brightness” means “brightness” which is generally used unless otherwise noted. In the following description, V (0 to 255) of the HSV color system is used as “brightness”, but a unit system representing the brightness of any other color system may be used. At that time, it goes without saying that numerical values such as various coefficients described in the present embodiment are recalculated.

また、本実施形態において、「色相」は特に注釈を設けない限り一般に用いられる「色」の意味である。以下の記載において、HSV表色系のH(0〜360)を「色相」として用いるが、例えば赤色差値(Cr)や青色差値(Cb)によって表現される色を用いてもよい。その際、本実施形態で記載する各種係数等の数値を、改めて算出し直すことは言うまでもない。ステップS20では、上記のようにして求められたH、S、Vの値が色情報として取得される。   In the present embodiment, “hue” means “color” that is generally used unless otherwise noted. In the following description, H (0 to 360) of the HSV color system is used as “hue”, but for example, a color represented by a red difference value (Cr) or a blue difference value (Cb) may be used. At that time, it goes without saying that numerical values such as various coefficients described in the present embodiment are recalculated. In step S20, the values of H, S, and V obtained as described above are acquired as color information.

<占有率算出処理>
次に、ステップS21では、占有率算出処理が行われる。図16のフローチャートを参照して、占有率算出処理について説明する。
<Occupancy rate calculation process>
Next, in step S21, an occupation ratio calculation process is performed. The occupation rate calculation process will be described with reference to the flowchart of FIG.

まず、色空間変換処理で算出されたHSV値に基づいて、第2の画像の各画素が、色相と明度の組み合わせからなる所定の階級に分類され、分類された階級毎に累積画素数を算出することによって2次元ヒストグラムが作成される(ステップS30)。   First, based on the HSV value calculated by the color space conversion process, each pixel of the second image is classified into a predetermined class composed of a combination of hue and brightness, and the cumulative number of pixels is calculated for each classified class. As a result, a two-dimensional histogram is created (step S30).

図17に、明度と色相の組み合わせからなる階級を示す。ステップS30では、明度(V)は、明度値が0〜5(v1)、6〜12(v2)、13〜24(v3)、25〜76(v4)、77〜109(v5)、110〜149(v6)、150〜255(v7)の7つの階級に分割される。図17に示すように、最も低明度の階級における明度の範囲よりも、最も高明度の階級における明度の範囲の方が広い。   FIG. 17 shows a class composed of a combination of brightness and hue. In step S30, the lightness (V) is 0-5 (v1), 6-12 (v2), 13-24 (v3), 25-76 (v4), 77-109 (v5), 110-110. It is divided into seven classes of 149 (v6) and 150 to 255 (v7). As shown in FIG. 17, the brightness range in the highest brightness class is wider than the brightness range in the lowest brightness class.

色相(H)は、色相値が0〜39、330〜359の肌色色相領域(H1及びH2)、色相値が40〜160の緑色色相領域(H3)、色相値が161〜250の青色色相領域(H4)、赤色色相領域(H5)の4つの領域に分割される。なお、赤色色相領域(H5)は、撮影シーンの判別への寄与が少ないとの知見から、以下の計算では用いていない。肌色色相領域は、さらに、肌色領域(H1)と、それ以外の領域(H2)に分割される。以下、肌色色相領域(H=0〜39、330〜359)のうち、下記の式(1)を満たす色相'(H)を肌色領域(H1)とし、式(1)を満たさない領域を(H2)とする。   Hue (H) is a flesh color hue region (H1 and H2) having a hue value of 0 to 39 and 330 to 359, a green hue region (H3) having a hue value of 40 to 160, and a blue hue region having a hue value of 161 to 250. It is divided into four areas (H4) and a red hue area (H5). Note that the red hue region (H5) is not used in the following calculation because it is known that the contribution to the determination of the shooting scene is small. The skin color hue region is further divided into a skin color region (H1) and another region (H2). Hereinafter, among the flesh-colored hue regions (H = 0 to 39, 330 to 359), the hue ′ (H) that satisfies the following formula (1) is defined as the flesh-colored region (H1), and the region that does not satisfy the formula (1) is ( H2).

10<彩度(S)<175;
色相'(H)=色相(H)+60 (0≦色相(H)<300のとき);
色相'(H)=色相(H)−300 (300≦色相(H)<360のとき).
輝度(Y)=R×0.30+G×0.59+B×0.11 (A)
として、
色相'(H)/輝度(Y)<3.0×(彩度(S)/255)+0.7 (1)
従って、第2の画像における階級の数は4×7=28個となる。また、最大の明度値(255)の1割の値以内に、少なくとも3つの階級(v1、v2、v3)を有する。なお、式(A)及び式(1)において明度(V)を用いることも可能である。
10 <saturation (S) <175;
Hue '(H) = Hue (H) +60 (when 0 ≦ hue (H) <300);
Hue ′ (H) = Hue (H) −300 (when 300 ≦ hue (H) <360).
Luminance (Y) = R × 0.30 + G × 0.59 + B × 0.11 (A)
As
Hue '(H) / Luminance (Y) <3.0 × (Saturation (S) / 255) +0.7 (1)
Therefore, the number of classes in the second image is 4 × 7 = 28. Moreover, it has at least three classes (v1, v2, v3) within 10% of the maximum brightness value (255). In addition, it is also possible to use lightness (V) in Formula (A) and Formula (1).

ステップS30の後、第2の画像の各画素が、画面の外縁からの距離と明度の組み合わせからなる所定の階級に分類され、分類された階級毎に累積画素数を算出することによって2次元ヒストグラムが作成される(ステップS31)。   After step S30, each pixel of the second image is classified into a predetermined class composed of a combination of the distance from the outer edge of the screen and the brightness, and the two-dimensional histogram is calculated by calculating the cumulative number of pixels for each classified class. Is created (step S31).

図18(a)に、ステップS31において、第2の画像の外縁からの距離に応じて分割された3つの領域n1〜n3を示す。領域n1が外枠であり、領域n2が外枠の内側の領域であり、領域n3が第2の画像の中央部の領域である。ここでn1〜n3は略同等の画素数となるように分割されることが好ましい。また本実施形態においては3つの分割としたがこれに限定されるものではない。また、ステップS31において、明度は、上述のようにv1〜v7の7つの領域に分割するものとする。図18(b)に、3つの領域n1〜n3と明度の組み合わせからなる階級を示す。図18(b)に示すように、第2の画像を画面の外縁からの距離と明度の組み合わせからなる階級に分類した場合の階級の数は3×7=21個となる。   FIG. 18A shows three regions n1 to n3 divided in accordance with the distance from the outer edge of the second image in step S31. The region n1 is an outer frame, the region n2 is a region inside the outer frame, and the region n3 is a central region of the second image. Here, n1 to n3 are preferably divided so as to have substantially the same number of pixels. In the present embodiment, three divisions are used, but the present invention is not limited to this. In step S31, the brightness is divided into seven areas v1 to v7 as described above. FIG. 18B shows a class composed of combinations of three regions n1 to n3 and brightness. As shown in FIG. 18B, the number of classes when the second image is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness is 3 × 7 = 21.

ステップS30において2次元ヒストグラムが作成されると、明度と色相の組み合わせからなる所定の階級毎に算出された累積画素数の全画素数(M×N個)に占める割合を示す第1の占有率が算出される(ステップS32)。すなわちステップS30とステップS32は第1の占有率算出工程として機能する。   When a two-dimensional histogram is created in step S30, a first occupancy ratio indicating a ratio of the cumulative number of pixels calculated for each predetermined class composed of a combination of brightness and hue to the total number of pixels (M × N) Is calculated (step S32). That is, step S30 and step S32 function as a first occupancy rate calculation step.

明度領域vi、色相領域Hjの組み合わせからなる階級において算出された第1の占有率をRijとすると、各階級における第1の占有率は表1のように表される。   Assuming that the first occupancy calculated in the class composed of the combination of the lightness area vi and the hue area Hj is Rij, the first occupancy in each class is expressed as shown in Table 1.

Figure 2007243556
Figure 2007243556

ステップS31において2次元ヒストグラムが作成されると、画面の外縁からの距離と明度の組み合わせからなる所定の階級毎に算出された累積画素数の全画素数に占める割合を示す第2の占有率が算出され(ステップS33)、本占有率算出処理が終了する。すなわち、ステップS31とステップS33は第2の占有率算出工程として機能する。   When the two-dimensional histogram is created in step S31, the second occupancy ratio indicating the ratio of the cumulative number of pixels calculated for each predetermined class composed of a combination of the distance from the outer edge of the screen and the brightness to the total number of pixels is obtained. Calculation is performed (step S33), and the occupancy rate calculation process ends. That is, step S31 and step S33 function as a second occupancy rate calculating step.

明度領域vi、画面領域njの組み合わせからなる各階級において算出された第2の占有率をQijとすると、各階級における第2の占有率は表2のように表される。   When the second occupancy calculated in each class composed of the combination of the brightness area vi and the screen area nj is Qij, the second occupancy in each class is expressed as shown in Table 2.

Figure 2007243556
Figure 2007243556

なお、各画素を画面の外縁からの距離、明度及び色相からなる階級に分類し、分類された階級毎に累積画素数を算出することによって3次元ヒストグラムを作成してもよい。以下では、2次元ヒストグラムを用いる方式を採用するものとする。
<指標算出処理>
次に、図19のフローチャートを参照して、指標算出処理(図15のステップS22)について説明する。
Note that a three-dimensional histogram may be created by classifying each pixel into a class consisting of a distance from the outer edge of the screen, brightness, and hue, and calculating the cumulative number of pixels for each class. Hereinafter, a method using a two-dimensional histogram is adopted.
<Indicator calculation process>
Next, the index calculation process (step S22 in FIG. 15) will be described with reference to the flowchart in FIG.

まず、第1の指標算出工程であるステップS40では、占有率算出処理において階級毎に算出された第1の占有率に、撮影条件に応じて予め設定された係数(第1の係数)を乗算して和をとることにより、撮影シーンを特定するための指標1が算出される。指標1は、周辺低明度、顔色高明度等の近接フラッシュ撮影や主要被写体がオーバーの時の特徴を複合的に表す指標であり、「近接フラッシュ」、「主要被写体がオーバー」と判別されるべき画像のみを他の撮影シーンから分離するためのものである。   First, in step S40, which is a first index calculation step, the first occupancy calculated for each class in the occupancy ratio calculation process is multiplied by a coefficient (first coefficient) set in advance according to the shooting conditions. As a result, the index 1 for specifying the shooting scene is calculated. The index 1 is an index that compositely represents characteristics of close-up flash photography such as low peripheral brightness and high brightness of the face color and when the main subject is over, and should be determined as “proximity flash” and “main subject over” This is to separate only the image from other shooting scenes.

次いで、第2の指標算出工程であるステップS41では、同じく階級毎に算出された第1の占有率に、撮影条件に応じて予め設定された第1の係数とは異なる係数(第2の係数)を乗算して和をとることにより、撮影シーンを特定するための指標2が算出される。指標2は、空色高明度、顔色低明度等の逆光撮影時の特徴を複合的に表す指標であり、「逆光」、「主要被写体がアンダー」と判別されるべき画像のみを他の撮影シーンから分離するためのものである。   Next, in step S41, which is the second index calculation step, a coefficient (second coefficient) different from the first coefficient preset in accordance with the shooting conditions is added to the first occupancy ratio calculated for each class. ) To obtain the sum, the index 2 for specifying the shooting scene is calculated. The index 2 is an index that compositely represents the characteristics at the time of backlight shooting such as sky blue high brightness and low face color brightness, and only images that should be determined as “backlight” and “main subject is under” are taken from other shooting scenes. It is for separation.

以下、指標1及び指標2の算出方法について詳細に説明する。
表3に、指標1を算出するために必要な第1の係数を階級別に示す。表3に示された各階級の係数は、表1に示した各階級の第1の占有率Rijに乗算する重み係数であり、撮影条件に応じて予め設定されている。
Hereinafter, the calculation method of the index 1 and the index 2 will be described in detail.
Table 3 shows the first coefficient necessary for calculating the index 1 by class. The coefficient of each class shown in Table 3 is a weighting coefficient by which the first occupation ratio Rij of each class shown in Table 1 is multiplied, and is set in advance according to the shooting conditions.

Figure 2007243556
Figure 2007243556

表3によると、高明度(v6)の肌色色相領域(H1)に分布する領域から算出される第1の占有率には、正(+)の係数が用いられ、それ以外の色相である青色色相領域から算出される第1の占有率には、負(−)の係数が用いられる。図20は、肌色領域(H1)における第1の係数と、その他の領域(緑色色相領域(H3))における第1の係数を、明度全体に渡って連続的に変化する曲線(係数曲線)として示したものである。表3及び図20によると、高明度(V=77〜150)の領域では、肌色領域(H1)における第1の係数の符号は正(+)であり、その他の領域(例えば、緑色色相領域(H3))における第1の係数の符号は負(−)であり、両者の符号が異なっていることがわかる。   According to Table 3, a positive (+) coefficient is used for the first occupancy calculated from the region distributed in the skin color hue region (H1) of high brightness (v6), and the other hue is blue. A negative (−) coefficient is used for the first occupancy calculated from the hue region. FIG. 20 shows a first coefficient in the skin color area (H1) and a first coefficient in the other area (green hue area (H3)) as a curve (coefficient curve) that continuously changes over the entire brightness. It is shown. According to Table 3 and FIG. 20, in the region of high brightness (V = 77 to 150), the sign of the first coefficient in the skin color region (H1) is positive (+), and other regions (for example, the green hue region) The sign of the first coefficient in (H3)) is negative (-), and it can be seen that the signs of both are different.

明度領域vi、色相領域Hjにおける第1の係数をCijとすると、指標1を算出するためのHk領域の和は、式(2)のように定義される。   If the first coefficient in the lightness region vi and the hue region Hj is Cij, the sum of the Hk regions for calculating the index 1 is defined as in Expression (2).

Figure 2007243556
Figure 2007243556

従って、H1〜H4領域の和は、下記の式(2−1)〜(2−4)のように表される。   Accordingly, the sum of the H1 to H4 regions is expressed by the following formulas (2-1) to (2-4).

H1領域の和=R11×0+R21×0+(中略)…+R71×(−8) (2−1)
H2領域の和=R12×(−2)+R22×(−1)+(中略)…+R72×(−10)
(2−2)
H3領域の和=R13×5+R23×(−2)+(中略)…+R73×(−12)
(2−3)
H4領域の和=R14×0+R24×(−1)+(中略)…+R74×(−12)
(2−4)
指標1は、式(2−1)〜(2−4)で示されたH1〜H4領域の和を用いて、式(3)のように定義される。
H1 region sum = R11 × 0 + R21 × 0 + (omitted)... + R71 × (−8) (2-1)
Sum of H2 regions = R12 × (−2) + R22 × (−1) + (omitted)... + R72 × (−10)
(2-2)
Sum of H3 regions = R13 × 5 + R23 × (−2) + (omitted)... + R73 × (−12)
(2-3)
Sum of H4 region = R14 × 0 + R24 × (−1) + (omitted)... + R74 × (−12)
(2-4)
The index 1 is defined as in Expression (3) using the sum of the H1 to H4 regions shown in Expressions (2-1) to (2-4).

指標1=H1領域の和+H2領域の和+H3領域の和+H4領域の和+1.5 (3)
表4に、指標2を算出するために必要な第2の係数を階級別に示す。表4に示された各階級の係数は、表1に示した各階級の第1の占有率Rijに乗算する重み係数であり、撮影条件に応じて予め設定されている。
Index 1 = sum of H1 region + sum of H2 region + sum of H3 region + sum of H4 region + 1.5 (3)
Table 4 shows the second coefficient necessary for calculating the index 2 by class. The coefficient of each class shown in Table 4 is a weighting coefficient by which the first occupancy rate Rij of each class shown in Table 1 is multiplied, and is set in advance according to the shooting conditions.

Figure 2007243556
Figure 2007243556

表4によると、肌色色相領域(H1)の中間明度に分布する領域(v4、v5)から算出される占有率には負(−)の係数が用いられ、肌色色相嶺域(H1)の低明度(シャドー)領域(v2、v3)から算出される占有率には係数0が用いられる。図21は、肌色領域(H1)における第2の係数を、明度全体にわたって連続的に変化する曲線(係数曲線)として示したものである。表4及び図21によると、肌色色相領域の、明度値が25〜150の中間明度領域の第2の係数の符号は負(−)であり、明度値6〜24の低明度(シャドー)領域の第2の係数は0であり、両領域での係数に大きな違いがあることがわかる。   According to Table 4, a negative (-) coefficient is used for the occupancy calculated from the areas (v4, v5) distributed in the intermediate brightness of the flesh-color hue area (H1), and the flesh-color hue range (H1) is low. A coefficient 0 is used for the occupation ratio calculated from the brightness (shadow) region (v2, v3). FIG. 21 shows the second coefficient in the skin color region (H1) as a curve (coefficient curve) that continuously changes over the entire brightness. According to Table 4 and FIG. 21, the sign of the second coefficient of the intermediate lightness region having a lightness value of 25 to 150 in the flesh color hue region is negative (−), and the low lightness (shadow) region having a lightness value of 6 to 24 The second coefficient is 0, and it can be seen that there is a large difference in the coefficients in both regions.

明度領域vi、色相領域Hjにおける第2の係数をDijとすると、指標2を算出するためのHk領域の和は、式(4)のように定義される。   When the second coefficient in the lightness area vi and the hue area Hj is Dij, the sum of the Hk areas for calculating the index 2 is defined as in Expression (4).

Figure 2007243556
Figure 2007243556

従って、H1〜H4領域の和は、下記の式(4−1)〜(4−4)のように表される。   Accordingly, the sum of the H1 to H4 regions is expressed by the following formulas (4-1) to (4-4).

H1領域の和=R11×0+R21×0+(中略)…+R71×2 (4−1)
H2領域の和=R12×(−2)+R22×(−1)+(中略)…+R72×2
(4−2)
H3領域の和=R13×2+R23×1+(中略)…+R73×3 (4−3)
H4領域の和=R14×0+R24×(−1)+(中略)…+R74×3 (4−4)
指標2は、式(4−1)〜(4−4)で示されたH1〜H4領域の和を用いて、式(5)のように定義される。
Sum of H1 regions = R11 × 0 + R21 × 0 + (omitted)... + R71 × 2 (4-1)
Sum of H2 region = R12 × (−2) + R22 × (−1) + (omitted)... + R72 × 2
(4-2)
Sum of H3 regions = R13 × 2 + R23 × 1 + (omitted)... + R73 × 3 (4-3)
Sum of H4 region = R14 × 0 + R24 × (−1) + (omitted)... + R74 × 3 (4-4)
The index 2 is defined as in Expression (5) using the sum of the H1 to H4 regions shown in Expressions (4-1) to (4-4).

指標2=H1領域の和+H2領域の和+H3領域の和+H4領域の和+1.7 (5)
指標1及び指標2は、第2の画像の明度と色相の分布量に基づいて算出されるため、画像がカラー画像である場合の撮影シーンの判別に有効である。
Index 2 = sum of H1 regions + sum of H2 regions + sum of H3 regions + sum of H4 regions + 1.7 (5)
Since the index 1 and the index 2 are calculated based on the brightness and hue distribution amount of the second image, they are effective in determining a shooting scene when the image is a color image.

指標1及び指標2が算出されると、第3の指標算出工程であるステップS42で、占有率算出処理において階級毎に算出された第2の占有率に、撮影条件に応じて予め設定された第3の係数(第1の係数、第2の係数とは異なる係数)を乗算して和をとることにより、撮影シーンを特定するための指標3が算出される。指標3は、主要被写体がアンダーな逆光と主要被写体がオーバーな画像間における、画像データの画面の中心と外側の明暗関係の差異を示すものである。   When the index 1 and the index 2 are calculated, the second occupancy ratio calculated for each class in the occupancy ratio calculation process is set in advance according to the shooting conditions in step S42 which is the third index calculation step. By multiplying the third coefficient (coefficient different from the first coefficient and the second coefficient) and taking the sum, an index 3 for specifying the shooting scene is calculated. The index 3 indicates a difference in contrast between the center and the outside of the screen of the image data between the backlight with the main subject under and the image with the main subject over.

以下、指標3の算出方法について説明する。
表5に、指標3を算出するために必要な第3の係数を階級別に示す。表5に示された各階級の係数は、表2に示した各階級の第2の占有率Qijに乗算する重み係数であり、撮影条件に応じて予め設定されている。
Hereinafter, a method for calculating the index 3 will be described.
Table 5 shows the third coefficient necessary for calculating the index 3 by class. The coefficient of each class shown in Table 5 is a weighting coefficient by which the second occupancy Qij of each class shown in Table 2 is multiplied, and is set in advance according to the shooting conditions.

Figure 2007243556
Figure 2007243556

図22は、画面領域n1〜n3における第3の係数を、明度全体に渡って連続的に変化する曲線(係数曲線)として示したものである。   FIG. 22 shows the third coefficient in the screen areas n1 to n3 as a curve (coefficient curve) that continuously changes over the entire brightness.

明度領域vi、画面領域njにおける第3の係数をEijとすると、指標3を算出するためのnk領域(画面領域nk)の和は、式(6)のように定義される。   If the third coefficient in the brightness area vi and the screen area nj is Eij, the sum of the nk area (screen area nk) for calculating the index 3 is defined as in Expression (6).

Figure 2007243556
Figure 2007243556

従って、n1〜n3領域の和は、下記の式(6−1)〜(6−3)のように表される。   Accordingly, the sum of the n1 to n3 regions is represented by the following formulas (6-1) to (6-3).

n1領域の和=Q11×12+Q21×10+(中略)…+Q71×0 (6−1)
n2領域の和=Q12×5+Q22×3+(中略)…+Q72×0 (6−2)
n3領域の和=Q13×(−1)+Q23×(−4)+(中略)…+Q73×(−8)
(6−3)
指標3は、式(6−1)〜(6−3)で示されたn1〜n3領域の和を用いて、式(7)のように定義される。
Sum of n1 region = Q11 × 12 + Q21 × 10 + (omitted)... + Q71 × 0 (6-1)
Sum of n2 regions = Q12 × 5 + Q22 × 3 + (omitted)... + Q72 × 0 (6-2)
Sum of n3 regions = Q13 × (−1) + Q23 × (−4) + (omitted)... + Q73 × (−8)
(6-3)
The index 3 is defined as in Expression (7) using the sum of the n1 to n3 regions shown in Expressions (6-1) to (6-3).

指標3=n1領域の和+n2領域の和+n3領域の和+0.7 (7)
指標3は、第2の画像の明度の分布位置による構図的な特徴(全体画像の画面の外縁からの距離)に基づいて算出されるため、カラー画像だけでなくモノクロ画像の撮影シーンを判別するのにも有効である。
Index 3 = sum of n1 region + sum of n2 region + sum of n3 region + 0.7 (7)
Since the index 3 is calculated based on the compositional feature (distance from the outer edge of the screen of the entire image) based on the lightness distribution position of the second image, the photographing scene of the monochrome image as well as the color image is discriminated. It is also effective.

また、例えば公知の方法によって検出された焦点検出領域に応じて、画面の外縁からの距離と明度の所定の階級から算出される第2占有率に対して乗算される第3の係数の重みを変えることで、より高精度にシーンを判別する指標を算出することが可能である。   Further, for example, according to the focus detection area detected by a known method, the weight of the third coefficient multiplied by the second occupancy calculated from the distance from the outer edge of the screen and the predetermined class of brightness is set. By changing, it is possible to calculate an index for discriminating a scene with higher accuracy.

指標1〜3が算出されると、第4の指標算出工程であるステップS43で、第2の画像の画面中央部(領域n2、n3)における肌色の平均輝度値と、第2の画像の最大輝度植と平均輝度値との差分値のそれぞれに、撮影条件に応じて予め設定された係数を乗算することにより、撮影シーンを特定するための指標4が算出される。   When the indices 1 to 3 are calculated, in step S43, which is a fourth index calculating step, the average luminance value of the skin color at the screen center (regions n2 and n3) of the second image and the maximum of the second image are calculated. An index 4 for specifying a shooting scene is calculated by multiplying each difference value between the brightness plant and the average brightness value by a coefficient set in advance according to the shooting conditions.

以下、図23のフローチャートを参照して、指標4の算出処理について詳細に説明する。
まず、第2の画像のRGB(Red、Green、Blue)値から、式(A)を用いて輝度Yが算出される。次いで、第2の画像の画面中央部(領域n2、n3)における肌色領域の平均輝度値x1が算出される(ステップS50)。次いで、第2の画像の最大輝度値と平均輝度値との差分値x2=最大輝度値−平均輝度値が算出される(ステップS51)。
Hereinafter, the calculation process of the index 4 will be described in detail with reference to the flowchart of FIG.
First, the luminance Y is calculated from the RGB (Red, Green, Blue) values of the second image using Expression (A). Next, the average luminance value x1 of the skin color area in the screen center (areas n2 and n3) of the second image is calculated (step S50). Next, a difference value x2 between the maximum luminance value and the average luminance value of the second image is calculated (maximum luminance value−average luminance value) (step S51).

次いで、第2の画像の輝度の標準偏差x3が算出され(ステップS52)、第2の画像の画面中央部(領域n2、n3)における平均輝度値x4が算出される(ステップS53)。次いで、第2の画像における肌色領域の最大輝度値Yskin_maxと最小輝度値Yskin_minの差分値と、肌色領域の平均輝度値Yskin_aveとの比較値x5が算出される(ステップS54)。この比較値x5は、下記の式(8−1)のように表される。   Next, the standard deviation x3 of the luminance of the second image is calculated (step S52), and the average luminance value x4 in the screen center portion (regions n2, n3) of the second image is calculated (step S53). Next, a comparison value x5 between the difference value between the maximum luminance value Yskin_max and the minimum luminance value Yskin_min of the skin color area in the second image and the average luminance value Yskin_ave of the skin color area is calculated (step S54). This comparison value x5 is expressed as the following formula (8-1).

x5=(Yskin_max−Yskin_min)/2−Yskin_ave
(8−1)
次いで、ステップS50〜S54で算出された値x1〜x5の値の各々に、撮影条件に応じて予め設定された第4の係数を乗算して和をとることにより、指標4が算出され(ステップS55)、指標4算出処理が終了する。指標4は、下記の式(8−2)のように定義される。
x5 = (Yskin_max−Yskin_min) / 2−Yskin_ave
(8-1)
Next, the index 4 is calculated by multiplying each of the values x1 to x5 calculated in steps S50 to S54 by a fourth coefficient that is set in advance according to the shooting conditions to obtain a sum (step 4). S55), the index 4 calculation process ends. The index 4 is defined as the following formula (8-2).

指標4=0.05×x1+1.41×x2+(−0.01)×x3+(−0.01)
×x4+0.01×x5−5.34 (8−2)
この指標4は、第2の画像の画面の構図的な特徴だけでなく、輝度ヒストグラム分布情報を持ち合わせており、特に、主要被写体がオーバーである撮影シーンとアンダー撮影シーンの判別に有効である。
Index 4 = 0.05 × x1 + 1.41 × x2 + (− 0.01) × x3 + (− 0.01)
× x4 + 0.01 × x5−5.34 (8-2)
This index 4 has not only the compositional characteristics of the screen of the second image but also the luminance histogram distribution information, and is particularly effective for discriminating the shooting scene from which the main subject is over and the under shooting scene.

指標4が算出されると、第5の指標算出工程であるステップS44(図19参照)で、指標1、指標3、第2の画像の画面中央部における肌色領域の平均輝度値、第1輝度情報及び第2輝度情報に、撮影条件に応じて予め設定された重み係数を乗算することにより、指標5が算出される。   When the index 4 is calculated, in step S44 (see FIG. 19), which is the fifth index calculation step, the average brightness value of the skin color area at the center of the screen of the index 1, the index 3, and the second image, the first brightness The index 5 is calculated by multiplying the information and the second luminance information by a weighting factor set in advance according to the shooting conditions.

さらに第6の指標算出工程であるステップS45で、指標2、指標3、第2の画像の画面中央部における肌色領域の平均輝度値、第1輝度情報及び第2輝度情報に、撮影条件に応じて予め設定された重み係数を乗算することにより、指標6が算出され、本指標算出処理が終了する。   Further, in step S45, which is the sixth index calculation step, the index 2, index 3, and the average brightness value of the skin color area in the center of the screen of the second image, the first brightness information, and the second brightness information are set according to the shooting conditions. The index 6 is calculated by multiplying the weighting factor set in advance, and this index calculation process ends.

以下、指標5及び指標6の算出方法について詳細に説明する。
第2の画像の画面中央部における肌色領域の平均輝度値を指標7とする。ここでの画面中央部とは、例えば、図18(a)の領域n2及びn3から構成される領域である。このとき、指標5は、指標1、指標3、指標7、第1輝度情報BV1及び第2輝度情報BV2を用いて式(9)のように定義され、指標6は、指標2、指標3、指標7及び第1輝度情報BV1及び第2輝度情報BV2を用いて式(10)のように定義される。
Hereinafter, the calculation method of the index 5 and the index 6 will be described in detail.
The average luminance value of the skin color area at the center of the screen of the second image is taken as index 7. Here, the central portion of the screen is, for example, a region composed of the regions n2 and n3 in FIG. At this time, the index 5 is defined as Expression (9) using the index 1, the index 3, the index 7, the first luminance information BV1, and the second luminance information BV2, and the index 6 is defined as the index 2, the index 3, Using the index 7, the first luminance information BV1 and the second luminance information BV2, it is defined as in Expression (10).

指標5=0.40×指標1+0.23×指標3+0.01×指標7+0.02×BV1−0.35×BV2+3.48 (9)
指標6=0.68×指標2+0.03×指標3−0.02×指標7−0.31×BV1+0.03×BV2+1.22 (10)
ここで式(9)及び式(10)において各指標に乗算される係数は、撮影条件に応じて予め設定されている。
Index 5 = 0.40 × Index 1 + 0.23 × Index 3 + 0.01 × Index 7 + 0.02 × BV1−0.35 × BV2 + 3.48 (9)
Index 6 = 0.68 × Index 2 + 0.03 × Index 3-0.02 × Index 7−0.31 × BV1 + 0.03 × BV2 + 1.22 (10)
Here, the coefficients to be multiplied by the respective indices in the equations (9) and (10) are set in advance according to the photographing conditions.

また、第1輝度情報BV1及び第2輝度情報BV2に基づいて、指標5、指標6を算出する代わりに、指標1、指標2、指標3を算出するのに第1輝度情報BV1及び第2輝度情報BV2を用いてもよい。その場合、指標5、指標6を算出するのに第1輝度情報BV1及び第2輝度情報BV2を用いる必要はない。   Further, instead of calculating the indexes 5 and 6 based on the first luminance information BV1 and the second luminance information BV2, the first luminance information BV1 and the second luminance are used to calculate the indexes 1, 2, and 3. Information BV2 may be used. In this case, it is not necessary to use the first luminance information BV1 and the second luminance information BV2 to calculate the index 5 and the index 6.

なお、図23における平均輝度値(例えば、画面中央部の平均輝度値)の算出方法としては、撮像装置1の各受光部から得られた個別輝度データの単純な加算平均値を求めてもよいし、撮像装置1の測光方式としてよく用いられる中央重点平均測光に類似した、画面中心付近の受光部より得られた輝度データに重み付けを高く、画面の周辺付近の受光部より得られた輝度データに重み付けを低くして加算平均値を求める手法を用いてもよい。また、焦点検出領域に対応した受光部付近より得られた輝度データに重み付けを高くし、焦点検出位置から離れた受光部より得られた輝度データに重み付けを低くして加算平均値を求める手法等を用いてもよい。   As a method of calculating the average luminance value (for example, the average luminance value at the center of the screen) in FIG. 23, a simple addition average value of individual luminance data obtained from each light receiving unit of the imaging device 1 may be obtained. The luminance data obtained from the light receiving unit near the center of the screen, which is similar to the center-weighted average metering that is often used as the photometric method of the imaging device 1, is high in weight, and the luminance data obtained from the light receiving unit near the periphery of the screen Alternatively, a method may be used in which the weighted value is lowered to obtain the average value. In addition, the luminance data obtained from the vicinity of the light receiving unit corresponding to the focus detection area is increased in weight, and the luminance data obtained from the light receiving unit distant from the focus detection position is reduced in weight to obtain an average value, etc. May be used.

<シーン判別>
図15に戻って、シーン判別を説明する。
ステップS22の指標算出処理により指標4〜6が算出されると、これらの指標の値に基づいて撮影シーンが判別される(ステップS23)。表6に、指標4、指標5及び指標6の値による撮影シーンの判別内容を示す。撮影時の第1輝度情報BV1及び第2輝度情報BV2に基づき指標5及び指標6は算出されており、第1輝度情報BV1及び第2輝度情報BV2は撮影シーンの判別に間接的に寄与している。
<Scene discrimination>
Returning to FIG. 15, the scene discrimination will be described.
When the indices 4 to 6 are calculated by the index calculation process in step S22, the shooting scene is determined based on the values of these indices (step S23). Table 6 shows the details of the shooting scene discrimination based on the values of index 4, index 5, and index 6. The indexes 5 and 6 are calculated based on the first luminance information BV1 and the second luminance information BV2 at the time of shooting, and the first luminance information BV1 and the second luminance information BV2 indirectly contribute to the determination of the shooting scene. Yes.

Figure 2007243556
Figure 2007243556

図24は、表6に示した判別内容を、指標4〜6の座標系を用いて表した判別マップである。   FIG. 24 is a discrimination map representing the discrimination contents shown in Table 6 using the coordinate system of the indices 4-6.

(階調処理条件設定のフロー)
次に、図25のフローチャートを参照して、第1の画像のガンマ変換処理後の画像に対する階調処理条件設定(図14のステップS9)について説明する。
(Flow of gradation processing condition setting)
Next, the gradation processing condition setting (step S9 in FIG. 14) for the image after the gamma conversion processing of the first image will be described with reference to the flowchart in FIG.

<階調調整方法選択>
まず、判別された撮影シーンに応じて、ステップS60で第1の画像データのガンマ変換処理後に対する階調調整の方法が決定され、ステップS61で階調調整パラメータが算出されると、ステップS62で階調処理条件(階調変換曲線)が決定される。なお、本実施形態では、ステップS60とステップS62とにおいて階調調整方法と階調調整量の双方を決定する場合を示すが、階調調整量のみを選択、あるいは決定してもよい。
<Tone adjustment method selection>
First, a gradation adjustment method for the first image data after the gamma conversion processing is determined in step S60 according to the determined shooting scene, and when a gradation adjustment parameter is calculated in step S61, in step S62. A gradation processing condition (gradation conversion curve) is determined. In this embodiment, the case where both the gradation adjustment method and the gradation adjustment amount are determined in steps S60 and S62 is shown, but only the gradation adjustment amount may be selected or determined.

ステップS60で階調調整方法を決定する場合、図26に示すように、撮影シーンが順光である場合は階調調整方法A(図26(a))が選択され、逆光である場合は階調調整方法B(図26(b))が選択され、主要被写体がオーバーである場合は階調調整方法C(図26(c))が選択され、アンダーである場合は、階調調整方法B(図26(b))が選択される。   When the gradation adjustment method is determined in step S60, as shown in FIG. 26, the gradation adjustment method A (FIG. 26 (a)) is selected when the shooting scene is front light, and when it is back light, the floor is adjusted. When the tone adjustment method B (FIG. 26B) is selected and the main subject is over, the tone adjustment method C (FIG. 26C) is selected, and when it is under, the tone adjustment method B is selected. (FIG. 26B) is selected.

なお本実施形態においては、第1の画像のガンマ変換後の画像へ適用する階調変換曲線を決定する方法を示したが、階調変換工程をガンマ変換の前に実施する場合には、図26の階調変換曲線に対して、ガンマ変換の逆変換を施した曲線で階調変換が行われる。   In the present embodiment, the method for determining the gradation conversion curve to be applied to the image after the gamma conversion of the first image has been described. However, when the gradation conversion process is performed before the gamma conversion, FIG. The gradation conversion is performed on a curve obtained by performing inverse conversion of gamma conversion on the 26 gradation conversion curves.

<階調調整パラメータ算出>
階調調整方法が決定されると、ステップS61では、指標算出処理で算出された各指標に基づいて、階調調整に必要なパラメータが算出される。すなわち、ステップS61は階調調整パラメータ算出工程として機能する。以下、階調調整パラメータの算出方法について説明する。なお、以下では、8bitの撮影画像データは16bitへと事前に変換されているものとし、撮影画像データの値の単位は16bitであるものとする。
<Calculation of gradation adjustment parameters>
When the gradation adjustment method is determined, in step S61, parameters necessary for gradation adjustment are calculated based on each index calculated in the index calculation process. That is, step S61 functions as a gradation adjustment parameter calculation step. Hereinafter, a method for calculating the gradation adjustment parameter will be described. In the following description, it is assumed that the 8-bit captured image data is converted into 16 bits in advance, and the unit of the value of the captured image data is 16 bits.

階調調整に必要なパラメータ(階調調整パラメータ)として、下記のP1〜P9のパラメータが算出される。   As parameters necessary for gradation adjustment (gradation adjustment parameters), the following parameters P1 to P9 are calculated.

P1:撮影画面全体の平均輝度
P2:ブロック分割平均輝度
P3:肌色領域(H1)の平均輝度
P4:輝度補正値1=P1−P2
P5:再現目標修正値=輝度再現目標値(30360)−P4
P6:オフセット値1=P5−P1
P7:キー補正値
P7':キー補正値2
P8:輝度補正値2
P9:オフセット値2=P5−P8−P1
P1: Average luminance of the entire photographing screen P2: Block division average luminance P3: Average luminance of the skin color area (H1) P4: Luminance correction value 1 = P1-P2
P5: Reproduction target correction value = luminance reproduction target value (30360) -P4
P6: Offset value 1 = P5-P1
P7: Key correction value P7 ': Key correction value 2
P8: Brightness correction value 2
P9: Offset value 2 = P5-P8-P1

ここで、図27及び図28を参照して、パラメータP2(ブロック分割平均輝度)の算出方法について説明する。
まず、画像データを正規化するために、CDF(累積密度関数)を作成する。次いで、得られたCDFから最大値と最小値を決定する。この最大値と最小値は、RGB毎に求める。ここで、求められたRGB毎の最大値と最小値を、それぞれ、Rmax、Rmin、Gmax、Gmin、Bmax、Bminとする。
Here, with reference to FIG. 27 and FIG. 28, a calculation method of the parameter P2 (block division average luminance) will be described.
First, in order to normalize image data, a CDF (cumulative density function) is created. Next, the maximum value and the minimum value are determined from the obtained CDF. The maximum value and the minimum value are obtained for each RGB. Here, the maximum value and the minimum value obtained for each RGB are Rmax, Rmin, Gmax, Gmin, Bmax, and Bmin, respectively.

次いで、画像データの任意の画素(Rx、Gx、Bx)に対する正規化画像データを算出する。RプレーンにおけるRxの正規化データをRpoint、GプレーンにおけるGxの正規化データをGpoint、BプレーンにおけるBxの正規化データをBpointとすると、正規化データRpoint、Gpoint、Bpointは、それぞれ、式(11)〜式(13)のように表される。   Next, normalized image data for any pixel (Rx, Gx, Bx) of the image data is calculated. Assuming that Rx normalization data in the R plane is Rpoint, Gx normalization data in the G plane is Gpoint, and Bx normalization data in the B plane is Bpoint, the normalization data Rpoint, Gpoint, and Bpoint are expressed by the following equation (11), respectively. ) To Expression (13).

Rp0124={(Rx−Rmin)/(Rmax−Rmin)}×65535
(11);
Gpoint={(Gx−Gmin)/(Gmax−Gmin)}×65535
(12);
Bpoint={(Bx−Bmin)/(Bmax−Bmin)}×65535
(13).
次いで、式(14)により画素(Rx、Gx、Bx)の輝度Npointを算出する。
Rp0124 = {(Rx−Rmin) / (Rmax−Rmin)} × 65535
(11);
Gpoint = {(Gx−Gmin) / (Gmax−Gmin)} × 65535
(12);
Bpoint = {(Bx−Bmin) / (Bmax−Bmin)} × 65535
(13).
Next, the luminance Npoint of the pixel (Rx, Gx, Bx) is calculated by Expression (14).

Npoint=(Bpoint+Gpoint+Rpoint)/3 (14)
図27(a)は、正規化する前のRGB画素の輝度の度数分布(ヒストグラム)である。図27(a)において、横軸は輝度、縦軸は画素の頻度である。このヒストグラムは、RGB毎に作成する。輝度のヒストグラムが作成されると、式(11)〜式(13)により、画像データに対し、プレーン毎に正規化を行う。図27(b)は、式(14)により算出された輝度のヒストグラムを示す。撮影画像データが65535で正規化されているため、各画素は、最大値が65535で最小値が0の間で任意の値をとる。
Npoint = (Bpoint + Gpoint + Rpoint) / 3 (14)
FIG. 27A shows a frequency distribution (histogram) of luminance of RGB pixels before normalization. In FIG. 27A, the horizontal axis represents luminance, and the vertical axis represents pixel frequency. This histogram is created for each RGB. When the luminance histogram is created, normalization is performed for each plane with respect to the image data by Expressions (11) to (13). FIG. 27B shows a luminance histogram calculated by the equation (14). Since the captured image data is normalized by 65535, each pixel takes an arbitrary value between the maximum value of 65535 and the minimum value of 0.

図27(b)に示す輝度ヒストグラムを所定の範囲で区切ってブロックに分割すると、図27(c)に示すような度数分布が得られる。図27(c)において、横軸はブロック番号(輝度)、縦軸は頻度である。   When the luminance histogram shown in FIG. 27B is divided into blocks divided by a predetermined range, a frequency distribution as shown in FIG. 27C is obtained. In FIG. 27C, the horizontal axis represents the block number (luminance) and the vertical axis represents the frequency.

次いで、図27(c)に示された輝度ヒストグラムから、ハイライト、シャドー領域を削除する処理を行う。これは、白壁や雪上シーンでは、平均輝度が非常に高くなり、暗闇のシーンでは平均輝度は非常に低くなっているため、ハイライト、シャドー領域は、平均輝度制御に悪影響を与えてしまうことによる。そこで、図27(c)に示した輝度ヒストグラムのハイライト領域、シャドー領域を制限することによって、両領域の影響を減少させる。図28(a)(または図27(c))に示す輝度ヒストグラムにおいて、高輝度領域(ハイライト領域)及び低輝度領域(シャドー領域)を削除すると、図28(b)のようになる。   Next, processing for deleting highlight and shadow areas is performed from the luminance histogram shown in FIG. This is because the average brightness is very high in white walls and snow scenes, and the average brightness is very low in dark scenes, so highlights and shadow areas adversely affect average brightness control. . Therefore, by limiting the highlight area and the shadow area of the luminance histogram shown in FIG. 27C, the influence of both areas is reduced. If the high luminance region (highlight region) and the low luminance region (shadow region) are deleted from the luminance histogram shown in FIG. 28A (or FIG. 27C), the result is as shown in FIG.

次いで、図28(c)に示すように、輝度ヒストグラムにおいて、頻度が所定の閾値より大きい領域を削除する。これは、頻度が極端に多い部分が存在すると、この部分のデータが、撮影画像全体の平均輝度に強く影響を与えてしまうため、誤補正が生じやすいことによる。そこで、図28(c)に示すように、輝度ヒストグラムにおいて、閾値以上の画素数を制限する。図28(d)は、画素数の制限処理を行った後の輝度ヒストグラムである。   Next, as shown in FIG. 28 (c), in the luminance histogram, an area whose frequency is larger than a predetermined threshold is deleted. This is because if there is a part having an extremely high frequency, the data in this part strongly affects the average luminance of the entire captured image, and thus erroneous correction is likely to occur. Therefore, as shown in FIG. 28C, the number of pixels equal to or greater than the threshold is limited in the luminance histogram. FIG. 28D is a luminance histogram after the pixel number limiting process is performed.

正規化された輝度ヒストグラムから、高輝度領域及び低輝度領域を削除し、さらに、累積画素数を制限することによって得られた輝度ヒストグラム(図28(d))の各ブロック番号と、それぞれの頻度に基づいて、輝度の平均値を算出したものがパラメータP2である。   Each block number of the luminance histogram (FIG. 28 (d)) obtained by deleting the high luminance region and the low luminance region from the normalized luminance histogram, and further limiting the number of accumulated pixels, and the respective frequencies The parameter P2 is obtained by calculating the average luminance based on the above.

パラメータP1は、画像データ全体の輝度の平均値であり、パラメータP3は、画像データのうち肌色領域(H1)の輝度の平均値である。パラメータP7のキー補正値、パラメータP7'のキー補正値2、パラメータP8の輝度補正値2は、それぞれ、式(15)、式(16)、式(17)のように定義される。   The parameter P1 is an average value of luminance of the entire image data, and the parameter P3 is an average value of luminance of the skin color area (H1) in the image data. The key correction value of parameter P7, the key correction value 2 of parameter P7 ′, and the luminance correction value 2 of parameter P8 are defined as shown in equations (15), (16), and (17), respectively.

P7(キー捕正値)={P3−((指標6/6)×18000+22000)}
/24.78 (15)
P7'(キー補正値2)={P3−((指標4/6)×10000+30000)}
/24.78 (16)
P8(輝度補正値2)=(指標5/6)×17500 (17)
パラメータP7とP8が、指標5と指標6に基づいており、輝度情報BVを反映していることになる。
P7 (key correction value) = {P3-((index 6/6) × 18000 + 22000)}
/24.78 (15)
P7 ′ (key correction value 2) = {P3-((index 4/6) × 10000 + 30000)}
/24.78 (16)
P8 (Luminance correction value 2) = (Index 5/6) × 17500 (17)
The parameters P7 and P8 are based on the index 5 and the index 6 and reflect the luminance information BV.

<シーン毎の階調処理条件設定>
図25に戻り、階調調整パラメータが算出されると、ステップS62では、その算出された階調調整パラメータに基づいて、撮影画像データに対する階調変換曲線の決定、すなわち階調処理条件が設定される。
<Setting gradation processing conditions for each scene>
Returning to FIG. 25, when the tone adjustment parameter is calculated, in step S62, the tone conversion curve for the photographed image data, that is, the tone processing condition is set based on the calculated tone adjustment parameter. The

すなわち、既に決定された階調調整方法に対応して予め設定された複数の階調変換曲線の中から、シーンに応じて選択されたパラメータの値に対応する階調変換曲線が選択(決定)される。あるいは、パラメータの値に基づいて、階調変換曲線を算出するようにしてもよい。   That is, a gradation conversion curve corresponding to a parameter value selected according to a scene is selected (determined) from a plurality of gradation conversion curves set in advance corresponding to the already determined gradation adjustment method. Is done. Alternatively, the gradation conversion curve may be calculated based on the parameter value.

階調変換曲線が決定されると、階調処理条件設定は終了する。
以下、各撮影シーン(光源条件及び露出条件)毎に、階調変換曲線の決定方法(ステップS62での階調処理条件の決定)について説明する。
When the gradation conversion curve is determined, the gradation processing condition setting ends.
Hereinafter, a method for determining a gradation conversion curve (determination of gradation processing conditions in step S62) for each shooting scene (light source condition and exposure condition) will be described.

<順光の場合>
撮影シーンが順光である場合、パラメータP6を用いて、P1をP5と一致させるオフセット補正(8bit値の平行シフト)を下記の式(18)により行う。
<For direct light>
When the photographic scene is front light, offset correction (parallel shift of 8-bit value) is performed by the following equation (18) using the parameter P6 to make P1 coincide with P5.

出力画像のRGB値=入力画像のRGB値+P6 (18)
従って、撮影シーンが順光の場合、図26(a)に示す複数の階調変換曲線の中から、式(18)に対応する階調変換曲線が選択される。または、式(18)に基づいて階調変換曲線を算出(決定)してもよい。
RGB value of output image = RGB value of input image + P6 (18)
Therefore, when the photographic scene is a continuous light, a gradation conversion curve corresponding to Expression (18) is selected from a plurality of gradation conversion curves shown in FIG. Alternatively, the gradation conversion curve may be calculated (determined) based on Expression (18).

〈逆光の場合〉
撮影シーンが逆光である場合、図26(b)に示す複数の階調変換曲線の中から、パラメータP7(キー補正値)に対応する階調変換曲線が選択される。図26(b)の階調変換曲線の具体例を図29に示す。パラメータP7の値と、選択される階調変換曲線の対応関係を以下に示す。
<Backlight>
When the shooting scene is backlit, a gradation conversion curve corresponding to the parameter P7 (key correction value) is selected from a plurality of gradation conversion curves shown in FIG. FIG. 29 shows a specific example of the gradation conversion curve in FIG. The correspondence between the value of parameter P7 and the selected gradation conversion curve is shown below.

−50<P7<+50 の場合→L3
+50≦P7<+150 の場合→L4
+150≦P7<+250 の場合→L5
−150<P7≦−50 の場合→L2
−250<P7≦−150 の場合→L1
なお、撮影シーンが逆光の場合、この階調変換処理とともに、覆い焼き処理を併せて行うことが好ましい。この場合、逆光度を示す指標6に応じて覆い焼き処理の程度も調整されることが望ましい。
When −50 <P7 <+ 50 → L3
When + 50 ≦ P7 <+150 → L4
When + 150 ≦ P7 <+ 250 → L5
In the case of −150 <P7 ≦ −50 → L2
When −250 <P7 ≦ −150 → L1
When the shooting scene is backlit, it is preferable to perform a dodging process together with the gradation conversion process. In this case, it is desirable to adjust the degree of dodging processing according to the index 6 indicating the backlight intensity.

〈アンダーの場合〉
撮影シーンがアンダーである場合、図26(b)に示す複数の階調変換曲線の中から、パラメータP7'(キー補正値2)に対応する階調変換曲線が選択される。具体的には、撮影シーンが逆光の場合の階調変換曲線の選択方法と同様に、図29に示す階調変換曲線の中から、パラメータP7'の値に対応した階調変換曲線が選択される。なお、撮影シーンがアンダーである場合は、逆光の場合に示したような覆い焼き処理は行わない。
<In case of under>
When the shooting scene is under, the gradation conversion curve corresponding to the parameter P7 ′ (key correction value 2) is selected from the plurality of gradation conversion curves shown in FIG. Specifically, the gradation conversion curve corresponding to the value of the parameter P7 ′ is selected from the gradation conversion curves shown in FIG. 29 in the same manner as the selection method of the gradation conversion curve when the shooting scene is backlit. The When the shooting scene is under, the dodging process as shown in the case of backlight is not performed.

〈主要被写体がオーバーの場合〉
主要被写体がオーバーである場合、パラメータP9を用いてオフセット補正(8bit値の平行シフト)を式(19)により行う。
<When the main subject is over>
When the main subject is over, offset correction (parallel shift of 8-bit value) is performed by the equation (19) using the parameter P9.

出力画像のRGB値=入力画像のRGB値十P9 (19)
従って、主要被写体がオーバーの場合、図26(c)に示す複数の階調変換曲線の中から、パラメータP9に対応する階調変換曲線が選択される。または、式(19)に基づいて階調変換曲線を算出(決定)してもよい。なお、式(19)のパラメータP9の値が、予め設定された所定値αを上回った場合、図29に示す曲線L1〜L5の中から、キー補正値がP9−αに対応する曲線が選択される。
RGB value of output image = RGB value of input image plus P9 (19)
Therefore, when the main subject is over, the gradation conversion curve corresponding to the parameter P9 is selected from the plurality of gradation conversion curves shown in FIG. Alternatively, the gradation conversion curve may be calculated (determined) based on Expression (19). When the value of parameter P9 in equation (19) exceeds a preset predetermined value α, a curve corresponding to the key correction value P9-α is selected from the curves L1 to L5 shown in FIG. Is done.

なお、本実施形態では、実際に撮影画像データに対して階調変換処理を施す場合、上述の階調変換処理条件を16bitから8bitへ変更するものとする。   In the present embodiment, when the gradation conversion process is actually performed on the captured image data, the above-described gradation conversion process condition is changed from 16 bits to 8 bits.

以上のように、上記実施形態によれば、撮影領域における第1輝度情報及び第2輝度情報に基づいて撮影シーンを判別し、この判別された撮影シーンに応じた階調処理条件を設定する。これにより、画像データから高精度に撮影シーンを判別することができ、また主要被写体のオーバー、アンダー露光、順光、逆光シーン等の撮影シーンの判別結果に応じた階調処理を施すことが可能となるため、より適切な補正画像を得ることができる。   As described above, according to the above-described embodiment, the shooting scene is determined based on the first luminance information and the second luminance information in the shooting area, and the gradation processing condition according to the determined shooting scene is set. This makes it possible to discriminate shooting scenes from image data with high accuracy, and to perform gradation processing according to the discrimination results of shooting scenes such as overexposure, underexposure, forward light, and backlight scene of the main subject. Therefore, a more appropriate corrected image can be obtained.

本発明の実施形態は、上記の実施形態に限定されるものではなく、本発明の趣旨に則る限り、様々な変更された形態もその範囲に含まれるものである。   The embodiment of the present invention is not limited to the above-described embodiment, and various modified forms are also included in the scope thereof as long as the gist of the present invention is met.

上記実施形態では、指標4〜6に基づいて撮影シーンを判別することとしたが、これに限らず、例えば、第1輝度情報BV1及び第2輝度情報BV2の値を直接比較することで撮影シーンを判別する態様としてもよい。この場合、第1輝度情報BV1と第2輝度情報BV2との関係が、「第1輝度情報BV1>>第2輝度情報BV2」となる場合には、撮影シーンが近接フラッシュや主要被写体がオーバーと判別し、「第1輝度情報BV1<<第2輝度情報BV2」となる場合には、撮影シーンが逆光と判別することが好ましい。   In the above-described embodiment, the shooting scene is determined based on the indices 4 to 6. However, the present invention is not limited to this. For example, the shooting scene is directly compared with the values of the first luminance information BV1 and the second luminance information BV2. It is good also as a mode which discriminates. In this case, if the relationship between the first luminance information BV1 and the second luminance information BV2 is “first luminance information BV1 >> second luminance information BV2,” the shooting scene is close to the flash or the main subject is over. If it is determined that “first luminance information BV1 << second luminance information BV2”, it is preferable to determine that the shooting scene is backlight.

また、上記実施形態では、第1輝度情報BV1を主要被写体に対応する輝度情報、第2輝度情報BV2を主要被写体周辺、即ち、背景に対応する輝度情報としたが、これに限らず、例えば、第1輝度情報BV1を撮影画面中央部(例えば、図16のn3、n2に相当する領域)の輝度情報、第2輝度情報BV2を撮影画面全体の平均輝度情報としてもよい。   In the above embodiment, the first luminance information BV1 is the luminance information corresponding to the main subject, and the second luminance information BV2 is the luminance information corresponding to the periphery of the main subject, that is, the background. The first luminance information BV1 may be the luminance information of the central portion of the shooting screen (for example, the area corresponding to n3 and n2 in FIG. 16), and the second luminance information BV2 may be the average luminance information of the entire shooting screen.

本発明の実施形態に係る撮像装置1の外観構成例を示す図である。It is a figure showing an example of appearance composition of imaging device 1 concerning an embodiment of the present invention. 撮像装置1の内部構成を示すブロック図である。2 is a block diagram illustrating an internal configuration of the imaging apparatus 1. FIG. 撮影処理部20の内部構成を示すブロック図である。3 is a block diagram illustrating an internal configuration of a photographing processing unit 20. FIG. AE制御部での露光量制御を示すフローチャートである。It is a flowchart which shows exposure amount control in an AE control part. シャッタ速度の制御において撮像素子に電荷が蓄積する様子を示す図である。It is a figure which shows a mode that an electric charge accumulate | stores in an image pick-up element in control of shutter speed. AF制御部での画像の焦点を合わせる制御を示すフローチャートである。It is a flowchart which shows the control which adjusts the focus of the image in AF control part. 撮影光学系の移動に伴うコントラスト情報の変化と合焦点位置検出の様子を示す図である。It is a figure which shows the change of the contrast information accompanying the movement of an imaging optical system, and the mode of a focal point position detection. 画素補間部での、RGB各色成分毎に画素間の補間を行う画像データの処理を示すフローチャートである。It is a flowchart which shows the process of the image data which performs the interpolation between pixels for every RGB color component in a pixel interpolation part. AWB制御部での、撮影画像におけるホワイトバランスを自動的に調整する処理を示すフローチャートである。It is a flowchart which shows the process which automatically adjusts the white balance in a picked-up image in an AWB control part. ガンマ補正曲線の例を示す図である。It is a figure which shows the example of a gamma correction curve. 画像処理部10の内部構成を示すブロック図である。2 is a block diagram showing an internal configuration of an image processing unit 10. FIG. 撮影された第1の画像の一例を示す図(a)と、第1の画像を分割し、M×N画素の縮小画像とした第2の画像の一例を示す図(b)である。FIG. 4A is a diagram illustrating an example of a captured first image, and FIG. 4B is a diagram illustrating an example of a second image obtained by dividing the first image into a reduced image of M × N pixels. 撮影領域における第1領域A1及び第2領域A2の一例を示した図である。It is the figure which showed an example of 1st area | region A1 and 2nd area | region A2 in an imaging | photography area | region. 撮像装置1において実行される処理の全体の流れを示すフローチャートである。3 is a flowchart showing an overall flow of processing executed in the imaging apparatus 1. 画像処理部10において実行されるシーン判別処理を示すフローチャートである。4 is a flowchart illustrating a scene determination process executed in the image processing unit 10. 占有率算出処理を示すフローチャートである。It is a flowchart which shows an occupation rate calculation process. 明度と色相からなる階級を示す図である。It is a figure which shows the class which consists of brightness and hue. 画面の外縁からの距離に応じて決定される領域n1〜n3を示す図(a)と、領域n1〜n3と明度からなる階級を示す図である。It is a figure which shows area | region n1-n3 determined according to the distance from the outer edge of a screen, and a figure which shows the class which consists of area | region n1-n3 and a brightness. 指標算出処理を示すフローチャートである。It is a flowchart which shows an index calculation process. 指標1を算出するための、第1の占有率に乗算する第1の係数を表す曲線を示す図である。It is a figure which shows the curve showing the 1st coefficient by which the 1st occupation rate for calculating the parameter | index 1 is multiplied. 指標2を算出するための、第1の占有率に乗算する第2の係数を表す曲線を示す図である。It is a figure which shows the curve showing the 2nd coefficient by which the 1st occupation rate for calculating the parameter | index 2 is multiplied. 指標3を算出するための、第2の占有率に乗算する第3の係数を表す曲線を領域別(n1〜n3)に示す図である。It is a figure which shows the curve showing the 3rd coefficient by which the 2nd occupation rate for calculating the parameter | index 3 is multiplied for every area | region (n1-n3). 指標4算出処理を示すフローチャートである。It is a flowchart which shows the parameter | index 4 calculation process. 撮影シーン(順光、ストロボ、逆光、アンダー)と指標4〜6の関係を示すプロット図である。It is a plot figure which shows the relationship between an imaging | photography scene (forward light, strobe, backlight, under) and the indices 4-6. 階調処理条件設定を示すフローチャートである。It is a flowchart which shows gradation processing condition setting. 各階調調整方法に対応する階調変換曲線を示す図である。It is a figure which shows the gradation conversion curve corresponding to each gradation adjustment method. 輝度の度数分布(ヒストグラム)(a)、正規化されたヒストグラム(b)及びブロック分割されたヒストグラム(c)を示す図である。It is a figure which shows the frequency distribution (histogram) (a) of a brightness | luminance, the normalized histogram (b), and the block-divided histogram (c). 輝度のヒストグラムからの低輝度領域及ぴ高輝度領域の削除を説明する図((a)及び(b))と、輝度の頻度の制限を説明する図((c)及ぴ(d))である。FIG. 2A and FIG. 2B illustrate the deletion of the low-brightness region and the high-brightness region from the luminance histogram, and FIG. 2B illustrates the limitation on the luminance frequency ((c) and (d)). is there. 撮影シーンが逆光またはアンダーである場合の階調処理条件を表す階調変換曲線を示す図である。It is a figure which shows the gradation conversion curve showing the gradation processing conditions in case a imaging | photography scene is backlight or under.

符号の説明Explanation of symbols

1 撮像装置
10 画像処理部
20 撮像処理部
21 筐体
22 十字キー
23 撮影光学系
24 フラッシュ
25 ファインダ
26 電源スイッチ
27 表示部
28 レリーズボタン
31 プロセッサ
32 メモリ
33 撮像素子
37 画像データ出力部
38 操作部
41 タイミングジェネレータ
42 シャッタユニット
43 絞りユニット
44 フォーカスユニット
51 AE制御部
52 AF制御部
53 画素補間部
54 AWB制御部
55 ガンマ補正部
101 第1画像取得部
102 第2画像取得部
103 占有率算出部
104 指標算出部
105 シーン判別部
106 階調処理条件設定部
107 階調変換処理部
DESCRIPTION OF SYMBOLS 1 Imaging device 10 Image processing part 20 Imaging processing part 21 Case 22 Cross key 23 Shooting optical system 24 Flash 25 Finder 26 Power switch 27 Display part 28 Release button 31 Processor 32 Memory 33 Imaging element 37 Image data output part 38 Operation part 41 Timing generator 42 Shutter unit 43 Aperture unit 44 Focus unit 51 AE control unit 52 AF control unit 53 Pixel interpolation unit 54 AWB control unit 55 Gamma correction unit 101 First image acquisition unit 102 Second image acquisition unit 103 Occupancy rate calculation unit 104 Index Calculation unit 105 Scene discrimination unit 106 Gradation processing condition setting unit 107 Gradation conversion processing unit

Claims (18)

撮影により第1の画像を取得する第1の画像取得手段と、
前記撮影時に算出された撮影領域の測光値から所定の第1領域における第1輝度情報を取得する第1輝度情報取得手段と、
前記算出された撮影領域の測光値から前記第1領域周辺の第2領域における第2輝度情報を取得する第2輝度情報取得手段と、
前記取得された第1輝度情報、第2輝度情報及び第1の画像に基づいて撮影シーンを判別するシーン判別処理手段と、
前記シーン判別処理手段による判別結果に基づいて前記第1の画像に対する階調処理条件を設定する階調処理条件設定手段と、
を備えたことを特徴とする撮像装置。
First image acquisition means for acquiring a first image by photographing;
First luminance information acquisition means for acquiring first luminance information in a predetermined first area from a photometric value of the imaging area calculated at the time of shooting;
Second luminance information acquisition means for acquiring second luminance information in a second area around the first area from the calculated photometric value of the imaging area;
Scene discrimination processing means for discriminating a shooting scene based on the acquired first luminance information, second luminance information and the first image;
Gradation processing condition setting means for setting gradation processing conditions for the first image based on a determination result by the scene determination processing means;
An imaging apparatus comprising:
前記シーン判別処理手段は、
前記第1の画像の画像データから色情報を取得し、この取得された色情報に基づいて前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、
前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出手段と、
前記指標1、指標2、指標3、指標4、第1輝度情報及び第2輝度情報に基づいて前記画像データの撮影シーンを判別するシーン判別手段と、
を備えたことを特徴とする請求項1に記載の撮像装置。
The scene discrimination processing means includes
Color information is acquired from the image data of the first image, and the image data is classified into classes composed of combinations of predetermined brightness and hue based on the acquired color information, and for each of the classified classes, First occupancy ratio calculating means for calculating a first occupancy ratio indicating a ratio of the entire image data;
Based on the acquired color information, the image data is classified into a class composed of a combination of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the ratio of the entire image data to each classified class. Second occupancy rate calculating means for calculating the occupancy rate of
First index calculating means for calculating index 1 by multiplying the first occupancy by a preset first coefficient;
A second index calculating means for calculating index 2 by multiplying the first occupancy by a preset second coefficient;
A third index calculating means for calculating index 3 by multiplying the second occupancy by a preset third coefficient;
A fourth index calculating means for calculating index 4 by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a preset fourth coefficient;
Scene discriminating means for discriminating a shooting scene of the image data based on the index 1, the index 2, the index 3, the index 4, the first luminance information and the second luminance information;
The imaging apparatus according to claim 1, further comprising:
前記第1の画像取得手段により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得手段を備え、
前記シーン判別処理手段は、前記第2の画像取得手段により取得された第2の画像に基づいて撮影シーンを判別することを特徴とする請求項1又は2に記載の撮像装置。
Second image acquisition means for acquiring a second image obtained by reducing the image size from the first image acquired by the first image acquisition means;
The imaging apparatus according to claim 1, wherein the scene determination processing unit determines a photographic scene based on the second image acquired by the second image acquisition unit.
前記階調処理条件設定手段は、
前記第1の画像、第1輝度情報及び第2輝度情報に基づいて算出された指標に基づき、階調調整パラメータを算出する階調調整パラメータ算出手段を備え、
前記シーン判別処理手段による判別結果と、前記階調調整パラメータ算出手段により算出された前記階調調整パラメータと、に基づいて前記第1の画像に対する階調処理条件を設定することを特徴とする請求項1〜3の何れか一項に記載の撮像装置。
The gradation processing condition setting means includes:
Gradation adjustment parameter calculation means for calculating a gradation adjustment parameter based on an index calculated based on the first image, the first luminance information, and the second luminance information;
The gradation processing condition for the first image is set based on a determination result by the scene determination processing unit and the gradation adjustment parameter calculated by the gradation adjustment parameter calculation unit. The imaging device according to any one of Items 1 to 3.
前記階調処理条件設定手段により設定された階調処理条件に基づいて、前記第1の画像に対する階調変換処理を行う階調変換処理手段を備えたことを特徴とする請求項1〜4の何れか一項に記載の撮像装置。   5. A gradation conversion processing unit that performs gradation conversion processing on the first image based on a gradation processing condition set by the gradation processing condition setting unit. The imaging device according to any one of the above. 前記撮影領域の特定の撮影対象物に関して合焦を行い、その合焦点位置を検知する合焦手段を備え、
前記第1輝度情報取得手段は、前記合焦手段により検知された合焦点位置に基づいて前記第1領域を特定することを特徴とする請求項1〜5の何れか一項に記載の撮像装置。
Focusing is performed with respect to a specific object to be photographed in the photographing region, and focusing means for detecting the focal position is provided.
The imaging apparatus according to claim 1, wherein the first luminance information acquisition unit specifies the first region based on a focal position detected by the focusing unit. .
撮影により第1の画像を取得する第1の画像取得工程と、
前記撮影時に算出された撮影領域の測光値から所定の第1領域における第1輝度情報を取得する第1輝度情報取得工程と、
前記算出された撮影領域の測光値から前記第1領域周辺の第2領域における第2輝度情報を取得する第2輝度情報取得工程と、
前記取得された第1輝度情報、第2輝度情報及び第2の画像に基づいて撮影シーンを判別するシーン判別処理工程と、
前記シーン判別処理工程による判別結果に基づいて前記第1の画像に対する階調処理条件を設定する階調処理条件設定工程と、
を含むことを特徴とする画像処理方法。
A first image acquisition step of acquiring a first image by photographing;
A first luminance information acquisition step of acquiring first luminance information in a predetermined first area from a photometric value of the imaging area calculated at the time of shooting;
A second luminance information acquisition step of acquiring second luminance information in a second region around the first region from the photometric value of the calculated imaging region;
A scene determination processing step of determining a photographic scene based on the acquired first luminance information, second luminance information, and second image;
A gradation processing condition setting step for setting a gradation processing condition for the first image based on a determination result by the scene determination processing step;
An image processing method comprising:
前記シーン判別処理工程は、
前記第1の画像の画像データから色情報を取得し、この取得された色情報に基づいて前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出工程と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出工程と、
前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出工程と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出工程と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出工程と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出工程と、
前記指標1、指標2、指標3、指標4、第1輝度情報及び第2輝度情報に基づいて前記画像データの撮影シーンを判別するシーン判別工程と、
を含むことを特徴とする請求項7に記載の画像処理方法。
The scene discrimination processing step includes
Color information is acquired from the image data of the first image, and the image data is classified into classes composed of combinations of predetermined brightness and hue based on the acquired color information, and for each of the classified classes, A first occupancy ratio calculating step of calculating a first occupancy ratio indicating a ratio of the entire image data;
Based on the acquired color information, the image data is classified into a class composed of a combination of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the ratio of the entire image data to each classified class. A second occupancy rate calculating step for calculating the occupancy rate of
A first index calculation step of calculating index 1 by multiplying the first occupancy by a preset first coefficient;
A second index calculating step of calculating index 2 by multiplying the first occupancy by a preset second coefficient;
A third index calculating step of calculating index 3 by multiplying the second occupancy by a preset third coefficient;
A fourth index calculating step of calculating index 4 by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a preset fourth coefficient;
A scene determination step of determining a shooting scene of the image data based on the index 1, the index 2, the index 3, the index 4, the first luminance information, and the second luminance information;
The image processing method according to claim 7, further comprising:
前記第1の画像取得工程により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得工程を含み、
前記シーン判別処理工程は、前記第2の画像取得手段により取得された第2の画像に基づいて撮影シーンを判別することを特徴とする請求項7又は8に記載の画像処理方法。
Including a second image acquisition step of acquiring a second image obtained by reducing the image size from the first image acquired by the first image acquisition step;
9. The image processing method according to claim 7, wherein the scene discrimination processing step discriminates a photographic scene based on the second image acquired by the second image acquisition means.
前記階調処理条件設定工程は、
前記第1の画像、第1輝度情報及び第2輝度情報に基づいて算出された指標に基づき、階調調整パラメータを算出する階調調整パラメータ算出工程を含み、
前記シーン判別処理工程による判別結果と、前記階調調整パラメータ算出工程により算出された前記階調調整パラメータと、に基づいて前記第1の画像に対する階調処理条件を設定することを特徴とする請求項7〜9の何れか一項に記載の画像処理方法。
The gradation processing condition setting step includes
A gradation adjustment parameter calculating step of calculating a gradation adjustment parameter based on an index calculated based on the first image, the first luminance information, and the second luminance information;
The gradation processing condition for the first image is set based on a determination result by the scene determination processing step and the gradation adjustment parameter calculated by the gradation adjustment parameter calculation step. Item 10. The image processing method according to any one of Items 7 to 9.
前記階調処理条件設定工程により設定された階調処理条件に基づいて、前記第1の画像に対する階調変換処理を行う階調変換処理工程を含むことを特徴とする請求項7〜10の何れか一項に記載の画像処理方法。   The gradation conversion processing step of performing gradation conversion processing on the first image based on the gradation processing condition set by the gradation processing condition setting step is included. An image processing method according to claim 1. 前記撮影領域における特定の撮影対象物に関して合焦を行い、その合焦点位置を検知する合焦工程を含み、
前記第1輝度情報取得工程は、前記合焦工程により検知された合焦点位置に基づいて前記第1領域を特定することを特徴とする請求項7〜11に記載の画像処理方法。
Focusing on a specific object to be photographed in the photographing region, and including a focusing step of detecting the focal point position;
The image processing method according to claim 7, wherein the first luminance information acquisition step specifies the first region based on a focus position detected by the focusing step.
画像処理を実行するためのコンピュータに、
撮影により第1の画像を取得する第1の画像取得機能と、
前記撮影時に算出された撮影領域の測光値から所定の第1領域における第1輝度情報を取得する第1輝度情報取得機能と、
前記算出された撮影領域の測光値から前記第1領域周辺の第2領域における第2輝度情報を取得する第2輝度情報取得機能と、
前記取得された第1輝度情報、第2輝度情報及び第2の画像に基づいて撮影シーンを判別するシーン判別処理機能と、
前記シーン判別処理機能による判別結果に基づいて前記第1の画像に対する階調処理条件を設定する階調処理条件設定機能と、
を実現させる画像処理プログラム。
In the computer for executing image processing,
A first image acquisition function for acquiring a first image by photographing;
A first luminance information acquisition function for acquiring first luminance information in a predetermined first area from a photometric value of the imaging area calculated at the time of shooting;
A second luminance information acquisition function for acquiring second luminance information in a second region around the first region from the photometric value of the calculated imaging region;
A scene discrimination processing function for discriminating a shooting scene based on the acquired first luminance information, second luminance information, and second image;
A gradation processing condition setting function for setting gradation processing conditions for the first image based on a determination result by the scene determination processing function;
An image processing program that realizes
前記シーン判別処理機能は、
前記第1の画像の画像データから色情報を取得し、この取得された色情報に基づいて前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出機能と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、この分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出機能と、
前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出機能と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出機能と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出機能と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出機能と、
前記指標1、指標2、指標3、指標4、第1輝度情報及び第2輝度情報に基づいて前記画像データの撮影シーンを判別するシーン判別機能と、
を有することを特徴とする請求項13に記載の画像処理プログラム。
The scene discrimination processing function is
Color information is acquired from the image data of the first image, and the image data is classified into classes composed of combinations of predetermined brightness and hue based on the acquired color information, and for each of the classified classes, A first occupancy ratio calculating function for calculating a first occupancy ratio indicating a ratio of the entire image data;
Based on the acquired color information, the image data is classified into a class composed of a combination of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the ratio of the entire image data to each classified class. A second occupancy ratio calculating function for calculating the occupancy ratio of
A first index calculation function for calculating index 1 by multiplying the first occupancy by a preset first coefficient;
A second index calculation function for calculating index 2 by multiplying the first occupancy by a preset second coefficient;
A third index calculation function for calculating index 3 by multiplying the second occupancy by a preset third coefficient;
A fourth index calculation function for calculating index 4 by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a preset fourth coefficient;
A scene discrimination function for discriminating a shooting scene of the image data based on the index 1, the index 2, the index 3, the index 4, the first luminance information, and the second luminance information;
The image processing program according to claim 13, further comprising:
前記コンピュータに、
前記第1の画像取得機能により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得機能を実現させ、
前記シーン判別処理機能は、前記第2の画像取得機能により取得された第2の画像に基づいて撮影シーンを判別することを特徴とする請求項13又は14に記載の画像処理プログラム。
In the computer,
Realizing a second image acquisition function for acquiring a second image obtained by reducing the image size from the first image acquired by the first image acquisition function;
15. The image processing program according to claim 13, wherein the scene discrimination processing function discriminates a shooting scene based on the second image acquired by the second image acquisition function.
前記階調処理条件設定機能は、
前記第1の画像、第1輝度情報及び第2輝度情報に基づいて算出された指標に基づき、階調調整パラメータを算出する階調調整パラメータ算出機能を有し、
前記シーン判別処理機能による判別結果と、前記階調調整パラメータ算出機能により算出された前記階調調整パラメータと、に基づいて前記第1の画像に対する階調処理条件を設定することを特徴とする請求項13〜15の何れか一項に記載の画像処理プログラム。
The gradation processing condition setting function is
A gradation adjustment parameter calculation function for calculating a gradation adjustment parameter based on an index calculated based on the first image, the first luminance information, and the second luminance information;
The gradation processing condition for the first image is set based on a determination result by the scene determination processing function and the gradation adjustment parameter calculated by the gradation adjustment parameter calculation function. Item 16. The image processing program according to any one of Items 13 to 15.
前記コンピュータに、
前記階調処理条件設定機能により設定された階調処理条件に基づいて、前記第1の画像に対する階調変換処理を行う階調変換処理機能を実現させることを特徴とする請求項13〜16の何れか一項に記載の画像処理プログラム。
In the computer,
The gradation conversion processing function for performing gradation conversion processing on the first image is realized based on the gradation processing conditions set by the gradation processing condition setting function. The image processing program according to any one of the above.
前記コンピュータに、
前記撮影領域の特定の撮影対象物に関して合焦を行い、その合焦点位置を検知する合焦機能を実現させ、
前記第1輝度情報取得機能は、前記合焦手段により検知された合焦点位置に基づいて前記第1領域を特定することを特徴とする請求項13〜17の何れか一項に記載の画像処理プログラム。
In the computer,
Focusing on a specific object to be photographed in the photographing region, realizing a focusing function for detecting the focal position,
The image processing according to any one of claims 13 to 17, wherein the first luminance information acquisition function specifies the first region based on a focal position detected by the focusing means. program.
JP2006062634A 2006-03-08 2006-03-08 Imaging apparatus, image processing method, and image processing program Pending JP2007243556A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006062634A JP2007243556A (en) 2006-03-08 2006-03-08 Imaging apparatus, image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006062634A JP2007243556A (en) 2006-03-08 2006-03-08 Imaging apparatus, image processing method, and image processing program

Publications (1)

Publication Number Publication Date
JP2007243556A true JP2007243556A (en) 2007-09-20

Family

ID=38588651

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006062634A Pending JP2007243556A (en) 2006-03-08 2006-03-08 Imaging apparatus, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP2007243556A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009177399A (en) * 2008-01-23 2009-08-06 Victor Co Of Japan Ltd Automatic exposure controller
JP2012134651A (en) * 2010-12-20 2012-07-12 Canon Inc Image processing device, method, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009177399A (en) * 2008-01-23 2009-08-06 Victor Co Of Japan Ltd Automatic exposure controller
JP2012134651A (en) * 2010-12-20 2012-07-12 Canon Inc Image processing device, method, and program

Similar Documents

Publication Publication Date Title
US10412296B2 (en) Camera using preview image to select exposure
AU2016200002B2 (en) High dynamic range transition
US8305487B2 (en) Method and apparatus for controlling multiple exposures
EP2608527B1 (en) Image pickup apparatus, control method for image pickup apparatus, and storage medium
CN110246101B (en) Image processing method and device
JP2007184888A (en) Imaging apparatus, image processor, image processing method, and image processing program
JP5782311B2 (en) Imaging apparatus and control method thereof
JP2006333205A (en) Imaging apparatus, image processing method and image processing program
CN111434104B (en) Image processing apparatus, image capturing apparatus, image processing method, and recording medium
JP2007228221A (en) Imaging apparatus, image processing apparatus, image processing method and image processing program
JP2007311895A (en) Imaging apparatus, image processor, image processing method and image processing program
JP2007243542A (en) Imaging apparatus, image processing apparatus, image processing method, and image processing program
JP2007293686A (en) Imaging apparatus, image processing apparatus, image processing method and image processing program
JP2007221678A (en) Imaging apparatus, image processor, image processing method and image processing program
JP2007312294A (en) Imaging apparatus, image processor, method for processing image, and image processing program
JP2007288245A (en) Imaging apparatus, image processing method, and image processing program
JP2007184887A (en) Image pickup device, image processor, image processing method and image processing program
JP2007243556A (en) Imaging apparatus, image processing method, and image processing program
JP2007201679A (en) Imaging apparatus, image processing method, and image processing program
JP2007235369A (en) Imaging apparatus, and unit, method, and program for processing image
JP2006197460A (en) Image processing method, image processor, image processing program and image pickup device
JP2007300348A (en) Imaging apparatus, and image processing method, and image processing program
JP2007195097A (en) Imaging apparatus, image processing method, and image processing program
JP2007188464A (en) Imaging apparatus, image processor, image processing method, and image processing program
JP2007293528A (en) Imaging device, image processing device, image processing method and image processing program

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20070827

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20080221