JP2007201679A - 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
JP2007201679A
JP2007201679A JP2006016133A JP2006016133A JP2007201679A JP 2007201679 A JP2007201679 A JP 2007201679A JP 2006016133 A JP2006016133 A JP 2006016133A JP 2006016133 A JP2006016133 A JP 2006016133A JP 2007201679 A JP2007201679 A JP 2007201679A
Authority
JP
Japan
Prior art keywords
image
index
calculating
processing
gradation
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
JP2006016133A
Other languages
Japanese (ja)
Inventor
Jo Nakajima
丈 中嶋
Daisuke Sato
大輔 佐藤
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 JP2006016133A priority Critical patent/JP2007201679A/en
Publication of JP2007201679A publication Critical patent/JP2007201679A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)
  • Studio Devices (AREA)
  • Image Processing (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an imaging apparatus, an image processing method, and an image processing program, which provide a more proper correction image by discriminating a photographing scene from image data with high accuracy to thereby attain more proper correction processing in accordance with an over/under exposure of a principal object and a forward/rear light scene or the like. <P>SOLUTION: The imaging apparatus estimates a position of the principal object in an image on the basis of a position of a focused area selected by AF control at photographing and can discriminate the photographing scene from the image data with high accuracy by utilizing the position for index calculation for image scene discrimination and can attain the more proper correction processing in accordance with a result of the discrimination of scenes such as the over/under exposure of the principal object and the forward/rear light scene or the like. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

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

近年デジタルスチルカメラ(携帯電話やラップトップパソコン等の機器に組み込まれたものも含み、以下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 bias in the image due to the influence of the light source state at the time of shooting, for example, shooting in a backlit 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 conventionally performed. 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. And conversion methods are performed.

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

上記のような補正方法に代わる方法として、画像中の輝度値の分布を用いて適切な補正値を求める方法が提案されている(例えば、特許文献1参照)。また画像中の顔領域候補を抽出し、その平均輝度の偏りの大きさからシーン判別する方法が提案されている(例えば、特許文献2参照)。   As a method instead of the correction method as described above, a method for obtaining an appropriate correction value using a distribution of luminance values in an image has been proposed (for example, see 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号公報
Further, in Patent Document 2, a candidate for a face region is extracted by a hue saturation histogram or pattern matching, and a deviation of the average luminance with respect to the entire image is calculated. If the deviation 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に記載の技術は、逆光シーンや近接フラッシュ撮影での輝度の偏りの大きい領域の影響は低減されるが、例えば人物を主要被写体とする撮影シーンなどでは、顔領域の輝度が十分に適切な値には補正しきれないなどという問題がある。   Although the technique described in Patent Document 1 reduces the influence of a region with a large luminance deviation in a backlight scene or close-up flash photography, for example, in a photographing scene where a person is a main subject, the brightness of the face region is sufficiently high. There is a problem that it cannot be corrected to an appropriate value.

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

本発明の目的は、上記の課題を解決し、画像データからより高精度に撮影シーンを判別することにより、主要被写体のオーバー、アンダー露光、順光、逆光シーンなどに応じて、より適切な補正処理を達成し、より適切な補正画像を得ることができる撮像装置、画像処理方法、及び画像処理プログラムを提供することである。   The object of the present invention is to solve the above-mentioned problems and to determine a shooting scene with higher accuracy from image data, thereby making it possible to perform more appropriate correction according to overshoot, underexposure, forward light, backlight scene, etc. of the main subject. To provide an imaging apparatus, an image processing method, and an image processing program that can achieve processing and obtain a more appropriate corrected image.

本発明は上記の課題を解決するために、以下の特徴を有するものである。   The present invention has the following features in order to solve the above problems.

1. 撮影レンズを透過した光を受光した複数の検出エリアからの出力信号に基づいて、前記複数の検出エリアから合焦エリアを選定するAF制御手段と、前記AF制御手段により選定された合焦エリアにおいてフォーカスされた画像を、撮影によって第1の画像として取得する第1の画像取得手段と、前記第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得手段と、前記第2の画像に基づき撮影シーンの判別処理を行うシーン判別処理手段と、前記シーン判別処理手段によって得られたシーン判別結果に基づき、前記第1の画像に対する階調処理条件を設定する階調処理条件設定手段と、を有し、前記シーン判別処理手段はさらに、前記第1の画像の撮影時における、前記AF制御手段による合焦エリアの選定結果に基づいてシーンの判別処理を行う、ことを特徴とする撮像装置。   1. AF control means for selecting a focus area from the plurality of detection areas based on output signals from the plurality of detection areas that have received light transmitted through the photographing lens, and in the focus area selected by the AF control means A first image acquisition means for acquiring a focused image as a first image by photographing; a second image acquisition means for acquiring a second image obtained by reducing an image size from the first image; A scene discrimination processing unit that performs a shooting scene discrimination process based on the second image, and a tone process that sets a tone processing condition for the first image based on a scene discrimination result obtained by the scene discrimination processing unit Condition setting means, and the scene discrimination processing means is further based on a focus area selection result by the AF control means at the time of photographing the first image. Performing determination processing of a scene Te, imaging apparatus, characterized in that.

2. 前記シーン判別処理手段は、前記第2の画像の画像データについて色情報を取得し、取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、前記AF制御手段による合焦エリアの選定結果に基づいて、前記画像データの画面を分割する画角を決定する分割画角決定手段と、前記取得された色情報に基づいて、前記画像データを前記分割画角決定手段により決定された画角と明度との組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、少なくとも前記画像データの所定の部分における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出手段と、前記指標1、前記指標2、前記指標3、及び前記指標4に基づいて、前記画像データのシーンを特定するシーン判別手段と、を有する、ことを特徴とする1に記載の撮像装置。   2. The scene determination processing unit acquires color information for the image data of the second image, and classifies the image data into a class composed of a combination of predetermined brightness and hue based on the acquired color information, For each of the classified classes, based on a first occupancy ratio calculating unit that calculates a first occupancy ratio indicating a ratio of the entire image data, and the focus area selection result by the AF control unit, A divided angle of view determination means for determining an angle of view for dividing a screen of image data, and a combination of the angle of view and the lightness determined by the divided angle of view determination means based on the acquired color information. And a second occupancy ratio calculating means for calculating a second occupancy ratio indicating a ratio of the entire image data for each of the classified classes, and the first occupancy ratio is preset. The The index 2 is calculated by multiplying the first index calculating means for calculating the index 1 by multiplying the first coefficient and the second coefficient set in advance to the first occupation ratio. Second index calculating means, third index calculating means for calculating index 3 by multiplying the second occupancy by a preset third coefficient, and at least a predetermined portion of the image data A fourth index calculating means for calculating the index 4 by multiplying the average brightness of the skin color by a fourth coefficient set in advance, the index 1, the index 2, the index 3, and the index 4 The image pickup apparatus according to claim 1, further comprising: a scene determination unit that specifies a scene of the image data based on the image data.

3. 前記階調処理条件設定手段は、前記第2の画像に基づき階調調整パラメータを算出する階調調整パラメータ算出手段を有し、前記シーン判別処理手段によるシーン判別結果と前記階調調整パラメータ算出手段により算出された前記階調調整パラメータとに基づき、前記第1の画像に対する階調処理条件を設定する、ことを特徴とする1または2に記載の撮像装置。   3. The gradation processing condition setting means includes gradation adjustment parameter calculation means for calculating a gradation adjustment parameter based on the second image, and a scene determination result by the scene determination processing means and the gradation adjustment parameter calculation means 3. The imaging apparatus according to claim 1 or 2, wherein a gradation processing condition for the first image is set based on the gradation adjustment parameter calculated by (1).

4. 前記階調処理条件設定手段により設定された階調処理条件に基づき、前記第1の画像に対する階調変換処理を行う階調変換処理手段を有する、ことを特徴とする1乃至3の何れか1項に記載の撮像装置。   4). Any one of 1 to 3, 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. The imaging device according to item.

5. 撮影レンズを透過した光を受光した複数の検出エリアからの出力信号に基づいて、前記複数の検出エリアから合焦エリアを選定するAF制御工程と、前記AF制御工程で選定された合焦エリアにおいてフォーカスされた画像を、撮影によって第1の画像として取得する第1の画像取得工程と、前記第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得工程と、前記第2の画像に基づき撮影シーンの判別処理を行うシーン判別処理工程と、前記シーン判別処理工程によって得られたシーン判別結果に基づき、前記第1の画像に対する階調処理条件を設定する階調処理条件設定工程と、を備え、前記シーン判別処理工程ではさらに、前記第1の画像の撮影時における、前記AF制御工程での合焦エリアの選定結果に基づいてシーンの判別処理を行う、ことを特徴とする画像処理方法。   5. In an AF control step of selecting a focus area from the plurality of detection areas based on output signals from a plurality of detection areas receiving light transmitted through the photographing lens, and in the focus area selected in the AF control step A first image acquisition step of acquiring a focused image as a first image by photographing; a second image acquisition step of acquiring a second image obtained by reducing an image size from the first image; A scene determination processing step for performing shooting scene determination processing based on the second image, and a gradation processing for setting a gradation processing condition for the first image based on the scene determination result obtained by the scene determination processing step A condition setting step, wherein the scene determination processing step is further based on a focus area selection result in the AF control step at the time of shooting the first image. Performing determination processing over emissions, an image processing method, characterized in that.

6. 前記シーン判別処理工程は、前記第2の画像の画像データについて色情報を取得し、取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出工程と、前記AF制御工程における合焦エリアの選定結果に基づいて、前記画像データの画面を分割する画角を決定する分割画角決定工程と、前記取得された色情報に基づいて、前記画像データを前記分割画角決定工程において決定された画角と明度との組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出工程と、前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出工程と、前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出工程と、前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出工程と、少なくとも前記画像データの所定の部分における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出工程と、前記指標1、前記指標2、前記指標3、及び前記指標4に基づいて、前記画像データのシーンを特定するシーン判別工程と、を備える、ことを特徴とする5に記載の画像処理方法。   6). The scene determination processing step acquires color information for the image data of the second image, and classifies the image data into a class composed of a combination of predetermined brightness and hue based on the acquired color information, For each of the classified classes, based on a first occupancy ratio calculating step for calculating a first occupancy ratio indicating a ratio of the entire image data, and on a focusing area selection result in the AF control step, A divided angle of view determination step for determining an angle of view for dividing a screen of image data, and a combination of the angle of view and the lightness determined in the divided angle of view determination step based on the acquired color information. And a second occupancy ratio calculating step for calculating a second occupancy ratio indicating the ratio of the entire image data for each of the classified classes, and the first occupancy ratio is set in advance. The first index calculation step of calculating the index 1 by multiplying the first coefficient thus calculated, and the index 2 is calculated by multiplying the first occupancy by a second coefficient set in advance. A second index calculating step, a third index calculating step for calculating the index 3 by multiplying the second occupancy by a preset third coefficient, and at least a predetermined value of the image data A fourth index calculating step of calculating index 4 by multiplying the average luminance of the skin color in the portion by a preset fourth coefficient, index 1, index 2, index 3, and index 6. The image processing method according to 5, further comprising: a scene determination step that specifies a scene of the image data based on 4.

7. 前記階調処理条件設定工程は、前記第2の画像に基づき階調調整パラメータを算出する階調調整パラメータ算出工程を備え、前記シーン判別処理工程におけるシーン判別結果と前記階調調整パラメータ算出工程において算出された前記階調調整パラメータとに基づき、前記第1の画像に対する階調処理条件を設定する、ことを特徴とする5または6に記載の画像処理方法。   7). The gradation processing condition setting step includes a gradation adjustment parameter calculation step of calculating a gradation adjustment parameter based on the second image, and the scene determination result in the scene determination processing step and the gradation adjustment parameter calculation step 7. The image processing method according to claim 5, wherein a gradation processing condition for the first image is set based on the calculated gradation adjustment parameter.

8. 前記階調処理条件設定工程において設定された階調処理条件に基づき、前記第1の画像に対する階調変換処理を行う階調変換処理工程を備える、ことを特徴とする5乃至7の何れか1項に記載の画像処理方法。   8). Any one of 5 to 7, further comprising a gradation conversion processing step for performing gradation conversion processing on the first image based on the gradation processing conditions set in the gradation processing condition setting step. The image processing method according to item.

9. コンピュータに画像処理を実行させるための画像処理プログラムであって、撮影レンズを透過した光を受光した複数の検出エリアからの出力信号に基づいて、前記複数の検出エリアから合焦エリアを選定するAF制御機能と、前記AF制御機能により選定された合焦エリアにおいてフォーカスされた画像を、撮影によって第1の画像として取得する第1の画像取得機能と、前記第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得機能と、前記第2の画像に基づき撮影シーンの判別処理を行うシーン判別処理機能と、前記シーン判別処理機能によって得られたシーン判別結果に基づき、前記第1の画像に対する階調処理条件を設定する階調処理条件設定機能と、を有し、前記シーン判別処理機能はさらに、前記第1の画像の撮影時における、前記AF制御機能による合焦エリアの選定結果に基づいてシーンの判別処理を行う、ことを特徴とする画像処理プログラム。   9. An image processing program for causing a computer to execute image processing, and selecting an in-focus area from a plurality of detection areas based on output signals from a plurality of detection areas receiving light transmitted through a photographing lens A control function, a first image acquisition function for acquiring an image focused in the in-focus area selected by the AF control function as a first image by photographing, and an image size reduced from the first image Based on a second image acquisition function for acquiring a second image, a scene determination processing function for performing a shooting scene determination process based on the second image, and a scene determination result obtained by the scene determination processing function, A gradation processing condition setting function for setting gradation processing conditions for the first image, and the scene determination processing function further includes the first image. An image processing apparatus at the time of shooting, the controller 6 determines the scene based on the selection result of the focusing area by the AF control function, characterized in that.

10. 前記シーン判別処理機能は、前記第2の画像の画像データについて色情報を取得し、取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出機能と、前記AF制御機能による合焦エリアの選定結果に基づいて、前記画像データの画面を分割する画角を決定する分割画角決定機能と、前記取得された色情報に基づいて、前記画像データを前記分割画角決定機能により決定された画角と明度との組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出機能と、前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出機能と、前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出機能と、前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出機能と、少なくとも前記画像データの所定の部分における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出機能と、前記指標1、前記指標2、前記指標3、及び前記指標4に基づいて、前記画像データのシーンを特定するシーン判別機能と、を有する、ことを特徴とする9に記載の画像処理プログラム。   10. The scene determination processing function acquires color information for the image data of the second image, and classifies the image data into a class composed of a combination of predetermined brightness and hue based on the acquired color information, For each classified class, based on a first occupancy ratio calculation function for calculating a first occupancy ratio indicating a ratio of the entire image data, and a focus area selection result by the AF control function, A division angle of view determination function for determining an angle of view for dividing a screen of image data, and a combination of the angle of view and brightness determined by the division angle of view determination function for the image data based on the acquired color information A second occupancy ratio calculating function for calculating a second occupancy ratio indicating a ratio of the entire image data for each classified class, and the first occupancy ratio is preset. The The index 2 is calculated by multiplying the first index calculation function for calculating the index 1 by multiplying the first coefficient and the second coefficient set in advance to the first occupation ratio. A second index calculation function, a third index calculation function for calculating index 3 by multiplying the second occupancy by a preset third coefficient, and at least a predetermined portion of the image data A fourth index calculation function for calculating the index 4 by multiplying the average brightness of the skin color by a fourth coefficient set in advance, the index 1, the index 2, the index 3, and the index 4 The image processing program according to claim 9, further comprising: a scene determination function that specifies a scene of the image data based on the image data.

11. 前記階調処理条件設定機能は、前記第2の画像に基づき階調調整パラメータを算出する階調調整パラメータ算出機能を有し、前記シーン判別処理機能によるシーン判別結果と前記階調調整パラメータ算出機能により算出された前記階調調整パラメータとに基づき、前記第1の画像に対する階調処理条件を設定する、ことを特徴とする9または10に記載の画像処理プログラム。   11. The gradation processing condition setting function has a gradation adjustment parameter calculation function for calculating a gradation adjustment parameter based on the second image, and a scene determination result by the scene determination processing function and the gradation adjustment parameter calculation function The image processing program according to claim 9 or 10, wherein a gradation processing condition for the first image is set on the basis of the gradation adjustment parameter calculated by the above.

12. 前記階調処理条件設定機能により設定された階調処理条件に基づき、前記第1の画像に対する階調変換処理を行う階調変換処理機能を有する、ことを特徴とする9乃至11の何れか1項に記載の画像処理プログラム。   12 Any one of 9 to 11 having a gradation conversion processing function for performing gradation conversion processing on the first image based on a gradation processing condition set by the gradation processing condition setting function. The image processing program according to item.

本発明によれば、撮影時のAF制御で選定された合焦エリアの位置に基づいて画面内の主要被写体の位置を推定し、画像のシーン判別のための指標算出に利用することにより、画像データからより高精度に撮影シーンを判別することができ、また主要被写体のオーバー、アンダー露光、順光、逆光シーンなどのシーン判別結果に応じて、より適切な補正処理を達成し、より適切な補正画像を得ることのできる撮像装置、画像処理方法、及び画像処理プログラムが提供できる。   According to the present invention, the position of the main subject in the screen is estimated based on the position of the in-focus area selected by AF control at the time of shooting, and is used for calculating an index for scene discrimination of the image. It is possible to discriminate shooting scenes with higher accuracy from data, and achieve more appropriate correction processing according to the scene discrimination results such as over-exposure, under-exposure, forward light, backlight scene etc. of the main subject, and more appropriate An imaging apparatus, an image processing method, and an image processing program that can obtain a corrected image can be provided.

以下、図面を参照して、本発明の実施形態を説明する。まず、本実施形態に係る撮像装置の構成例について説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. First, a configuration example of the imaging apparatus according to the present embodiment will be described.

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

図2に、撮像装置1の内部構成を示す。撮像装置1は、図2に示すように、プロセッサ31、メモリ32、CCD(Charge Coupled Device)等の撮像素子33、多点AFセンサ34、撮影光学系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 imaging device 1 includes a processor 31, a memory 32, an imaging device 33 such as a CCD (Charge Coupled Device), a multipoint AF sensor 34, a photographing optical system 23, a timing generator 41, a shutter unit 42, an aperture. The unit 43, the focus unit 44, the display unit 27, the operation unit 38, and the image data output unit 37 are configured. The processor 31 includes a photographing processing unit 20 that performs photographing control and photographed image processing, 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に結像させる。またその一部は、多点AFセンサ34に結像する。フラッシュ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. A part of the image is formed on the multipoint AF sensor 34. 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は、結像された光を電荷に変換する。これにより、例えば、図14(a)に示すような画像データが得られる。この画像には、撮像範囲(撮影範囲)にある物、すなわち、撮影対象物(撮影の目標物)とそれ以外の物(背景)とが含まれている。この全体画像の各画素のRGB値は、例えば、256階調で表される。   The image sensor 33 converts the imaged light into electric charges. Thereby, for example, image data as shown in FIG. 14A is obtained. 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.

多点AFセンサ34は、同じく結像された光を電荷に変換し、撮影処理部20にデータを渡す。撮影処理部20内のAF制御部52でAF制御のために用いられる。AF制御については後述する。   Similarly, the multipoint AF sensor 34 converts the imaged light into electric charges and passes the data to the imaging processing unit 20. The AF control unit 52 in the photographing processing unit 20 is used for AF control. The AF control will be described later.

シャッタユニット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を駆動させ撮影被写体に対して焦点を合わせる制御動作を実行する。   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.

(撮影処理部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. 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. The correction unit 55 is configured.

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 combined with the shutter speed is controlled based on data of a predetermined program diagram, for example, such that 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 set the exposure amount with respect to the photographed image by using an arbitrary or predetermined combination of the aperture value and the shutter speed.

AF制御部52は、画像撮影時に画像の焦点を合わせる自動制御を行う。この合焦点制御は、例えば以下のように撮影光学系23を駆動することで合焦点位置を検知し、その位置に合わせて停止させることで行われる。   The AF control unit 52 performs automatic control for focusing an image when capturing an image. This in-focus control is performed by, for example, driving the photographing optical system 23 as described below to detect the in-focus position and stopping it according to the position.

まず、撮像素子33によって得られた画像データに基づいて、所定の検出エリア(以下、測距エリアという)での合焦点操作を行う一般的な場合を説明する(図6のフローチャート参照)。   First, a general case of performing a focusing operation in a predetermined detection area (hereinafter referred to as a distance measurement area) based on image data obtained by the image sensor 33 will be described (see the flowchart in FIG. 6).

撮影光学系23の駆動が開始されると(ステップS121)、その駆動に伴い逐次、AF制御部52は、撮像素子33によって得られた画像データから所定の測距エリアのデータを読み出し(ステップS122)、このデータに応じてコントラスト情報を取得する(ステップS123)。これは、合焦点位置に達したかどうかを検知するためであり、次のように判定される。すなわち、コントラスト情報は、測距エリアのデータの各隣接画素間の差を取ることにより、エッジ部のシャープさに依存するように設定、算出されるものであり、測距エリア全体での総和が最大に達した状態が合焦点と判断される(ステップS124、S125)。合焦点位置でないと判断された場合は、撮影光学系23の移動が継続される(ステップ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 23 is continued (step S126).

撮影光学系23の移動に伴うコントラスト情報の変化と合焦点位置検出の様子を図7に示す。上記動作は、光学系を駆動しながら逐次コントラスト情報を取得して、合焦点位置を求めるという測距演算が行われたものであり、その焦点距離に合わせて撮影光学系23は停止される(ステップS127)。   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).

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

AF制御には、上述のように撮像素子33によって得られた画像データを用いて合焦点操作を行う場合以外に、別途AFセンサを設けてAF制御のための測距を行う場合もある。また、予め測距エリアが定められているのではなく、被写体に応じて、測距演算によるその被写体との距離情報などに基づき、複数の測距エリアの中から焦点を合わせるべき合焦エリアを選択する場合もある。本実施形態では多点AFセンサ34を用いて合焦エリアを選択するが、その詳細については後述する。   In the AF control, in addition to the case where the focusing operation is performed using the image data obtained by the image sensor 33 as described above, there is a case where a separate AF sensor is provided to perform distance measurement for the AF control. In addition, a focus detection area is not determined in advance, but a focus area to be focused from a plurality of distance measurement areas is determined based on distance information for the subject according to a distance measurement calculation. You may choose. In the present embodiment, the focus area is selected using the multipoint AF sensor 34, and details thereof will be described later.

画素補間部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画像データ(ステップS141)をRGBの各画素フィルタパターンでマスキングし(ステップS142、S144、S146)、その後で平均補間(画素補間ともいう)を行う(ステップS143、S145、S147)。このうち、高帯域にまで画素を有するGの画素フィルタパターンは、周辺4画素の中間2値の平均値に置換して平均補間を行うメディアン(中間値)フィルタであり、RとBの画素フィルタパターンは、周辺9画素から同色に対して平均補間を行うものである。   The pixel interpolation unit 53 masks the RGB image data (step S141) obtained by the image sensor 33 with each of the RGB pixel filter patterns (steps S142, S144, and S146), and then performs average interpolation (also referred to as pixel interpolation). Perform (Steps S143, S145, S147). 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によって得られた画像データの輝度や彩度のデータから(ステップS131)、本来ホワイトであると思われる領域を推測する(ステップS132)。その領域について、RGB各成分値の平均強度、及びG/R比、G/B比を求め、G値に対するR値、B値の補正ゲインを算出する(ステップS133、S134)。これに基づき、画像全体における各色成分に対するゲインの補正を行う(ステップS135)。   The AWB control unit 54 estimates a region that is supposed to be white from the luminance and saturation data of the image data obtained by the image sensor 33 (step S131) (step S132). For that region, the average intensity of each RGB component value, the G / R ratio, and the G / B ratio are obtained, and the R value and B value correction gains for the G value are calculated (steps S133 and S134). Based on this, gain correction for each color component in the entire image is performed (step S135).

このような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 to set an output gradation 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.

(AF制御時の合焦エリアの選定動作)
AF制御時に行われる合焦エリアの選定動作について、図11を用いて説明する。図11(a)は、多点AFセンサ34の配置図である。
(Focus area selection operation during AF control)
The focusing area selection operation performed during AF control will be described with reference to FIG. FIG. 11A is a layout diagram of the multipoint AF sensor 34.

図11(a)において、多点AFセンサは、A、B1、B2、C1、C2、そしてD1〜D4の9個のセンサからなる。多点AFセンサはマルチAFセンサとも呼ばれ、それぞれが独立した測距機能を有し、それぞれの測距エリアを代表する。本実施形態では、図11(a)のように配置した9個のセンサからなるが、センサの数や配置については、目的に応じて適切に選定すればよい。   In FIG. 11A, the multi-point AF sensor includes nine sensors A, B1, B2, C1, C2, and D1 to D4. Multi-point AF sensors are also called multi-AF sensors, each having an independent ranging function, and representing each ranging area. In the present embodiment, the sensor is composed of nine sensors arranged as shown in FIG. 11A, but the number and arrangement of sensors may be appropriately selected according to the purpose.

撮像される画面60に対して各センサは図11(a)のように配置され、それぞれが代表する測距エリアに対して合焦するための被写体距離情報を求め、その情報に基づきどの測距エリアで合焦するべきか、すなわち合焦エリアの選定がAF制御部52で行われる。従ってAF制御部52は、AF制御手段として機能する。   Each sensor is arranged as shown in FIG. 11A with respect to the screen 60 to be imaged, and subject distance information for focusing on a distance measuring area represented by each sensor is obtained, and which distance measurement is based on that information The AF control unit 52 selects whether to focus in the area, that is, the focus area is selected. Therefore, the AF control unit 52 functions as an AF control unit.

合焦エリアは予め定められている場合もあるが、本実施形態では、AFセンサ34を用いて複数の測距エリアから合焦エリアを選定する。その意図は、撮影時にフォーカスしたい主要被写体(人間など)の画面内での位置が、場合によって異なることがあるため、その主要被写体の画面内での位置に応じて、画面内に配置したどの測距エリアを合焦エリアとするかを定めることである。   Although the focus area may be determined in advance, in the present embodiment, the focus area is selected from a plurality of distance measurement areas using the AF sensor 34. The intent is that the position of the main subject (such as a person) that you want to focus on during shooting may vary depending on the situation, so depending on the position of the main subject on the screen, It is to determine whether the distance area is the focusing area.

主要被写体の位置に合焦エリアを合わせるために、各測距エリアでの被写体との距離情報を用いるが、合焦エリアの選定方法については後述する。   In order to adjust the focus area to the position of the main subject, distance information with respect to the subject in each distance measurement area is used. A method for selecting the focus area will be described later.

図12は、多点AFセンサ34を用いた合焦エリアの選定を含むAF制御の流れを示すフローチャートである。図12を用いてAF制御時の合焦エリアの選定動作を説明する。   FIG. 12 is a flowchart showing a flow of AF control including selection of a focusing area using the multipoint AF sensor 34. The focusing area selection operation during AF control will be described with reference to FIG.

図12に示した処理全体は、AF制御工程として機能する、すなわちAF制御機能であり、AF制御部52が撮影光学系23及びフォーカスユニット44等を制御して実行する。図12のフローのステップS151からステップS157において合焦エリアの選定動作を行い、ステップS158で選択された合焦エリアにおいてフォーカスするように撮影光学系23を移動する。   The entire process shown in FIG. 12 functions as an AF control process, that is, an AF control function, and is executed by the AF control unit 52 controlling the imaging optical system 23, the focus unit 44, and the like. In step S151 to step S157 in the flow of FIG. 12, a focusing area selection operation is performed, and the photographing optical system 23 is moved so as to focus in the focusing area selected in step S158.

図12において、AF制御の処理が開始されると、撮影光学系23がリセット状態(通常は無限遠の被写体にフォーカスする光学系位置)になり、駆動が開始される(ステップS151)。その駆動に伴い逐次、AF制御部52は、図11(a)のように配置されたそれぞれのAFセンサ毎にそれぞれの測距エリア毎のデータを読み出し(ステップS152)、このデータに応じて、それぞれの測距エリア毎の、その光学系位置でのコントラスト情報を取得する(ステップS153)。   In FIG. 12, when the AF control process is started, the photographing optical system 23 is in a reset state (usually an optical system position for focusing on an object at infinity), and driving is started (step S151). Along with the driving, the AF control unit 52 sequentially reads out data for each ranging area for each AF sensor arranged as shown in FIG. 11A (step S152), and according to this data, Contrast information at the optical system position for each distance measurement area is acquired (step S153).

これは、それぞれの測距エリア毎に合焦点位置に達したかどうかを検知するためであり、次のように判定される。すなわち、それぞれの測距エリア毎のコントラスト情報は、それぞれの測距エリアのデータの各隣接画素間の差を取ることにより、エッジ部のシャープさに依存するように設定、算出されるものであり、それぞれの測距エリア全体での総和が最大に達した状態(光学系位置)がそれぞれの測距エリアでの合焦点と判断される。すなわち、それぞれの測距エリア毎の合焦点までの光学系駆動量(デフォーカス量)に基づいて、それぞれの測距エリアでの被写体との距離情報が得られる。   This is to detect whether or not the in-focus position has been reached for each distance measurement area, and is determined as follows. That is, the contrast information for each distance measurement area is set and calculated so as to depend on the sharpness of the edge portion by taking the difference between adjacent pixels of the data of each distance measurement area. The state (optical system position) in which the total sum of the entire distance measurement areas reaches the maximum is determined as the focal point in each distance measurement area. That is, based on the optical system drive amount (defocus amount) up to the focal point for each distance measurement area, distance information with respect to the subject in each distance measurement area is obtained.

ステップS154では、その時点の光学系位置でのコントラスト情報が記憶され、ステップS155では撮影光学系23の駆動が終了(撮影可能な最近接距離にフォーカスする光学系位置まで移動)したかどうかが判定される。撮影光学系23の駆動が終了の場合(ステップS155:YES)は、ステップS157が実行される。撮影光学系23の駆動が終了していない場合(ステップS155:NO)は、撮影光学系23の移動が継続され(ステップS156)、ステップS152からの処理が、撮影光学系23の駆動が終了するまで繰り返される。   In step S154, the contrast information at the optical system position at that time is stored, and in step S155, it is determined whether or not the driving of the photographic optical system 23 has ended (moved to the optical system position focused on the closest distance that can be photographed). Is done. If driving of the photographic optical system 23 is completed (step S155: YES), step S157 is executed. If the driving of the photographic optical system 23 has not ended (step S155: NO), the movement of the photographic optical system 23 is continued (step S156), and the processing from step S152 ends the driving of the photographic optical system 23. Repeat until.

撮影光学系23の移動に伴うコントラスト情報の変化と合焦点位置検出の様子は既に図7に示した通りである。   The change in contrast information accompanying the movement of the photographic optical system 23 and the state of in-focus position detection have already been shown in FIG.

上記動作は、撮影光学系23を移動しながら逐次コントラスト情報を取得して、合焦点位置を求めるという測距演算が、それぞれの測距エリア毎に行われたものであり、そのそれぞれの測距エリア毎の合焦点位置に対応する光学系駆動量により、それぞれの測距エリア毎のデフォーカス量が算出される(ステップS157)。このデフォーカス量は、それぞれの測距エリア毎の被写体との距離情報を表す。   In the above operation, the distance measurement calculation is performed for each distance measurement area by sequentially acquiring contrast information while moving the photographic optical system 23 to obtain the in-focus position. A defocus amount for each distance measurement area is calculated based on the optical system drive amount corresponding to the focal position for each area (step S157). The defocus amount represents distance information with respect to the subject for each distance measurement area.

それぞれの測距エリア毎の被写体との距離情報が求められると、ステップS158で、各測距エリアの中から焦点を合わせるべき合焦エリアが選定される。すなわち画面内での主要被写体の位置が推定され、それに対応する測距エリアが合焦エリアとして選定される。   When distance information with respect to the subject for each distance measurement area is obtained, a focus area to be focused is selected from each distance measurement area in step S158. That is, the position of the main subject in the screen is estimated, and the corresponding ranging area is selected as the focusing area.

画面内で二次元的に分布した距離情報から主要被写体の位置を推定する方法は様々に考案されており、公知の技術を使用することができる。通常、主要被写体は画面中央に位置することが多いこと、主要被写体は背景と比べて撮像装置との距離が近い場合が多いこと、しかし対象物の距離が近すぎたり、近くても端部に位置したり、その対象物が小さすぎるときは、主要被写体とは考えにくいこと、などの被写体距離に関わる経験則などを用いた選定アルゴリズムが開発されている。   Various methods for estimating the position of the main subject from distance information distributed two-dimensionally in the screen have been devised, and known techniques can be used. Usually, the main subject is often located at the center of the screen, and the main subject is often closer to the imaging device than the background, but the target is too close or close to the edge. Selection algorithms using empirical rules related to subject distance, such as being difficult to consider as a main subject when the object is positioned or too small, have been developed.

また主要被写体は人間であることが多いことから、人間を判別する他の情報をも合わせて用いることで、画面内の人間の位置に合わせて測距エリアを選定する技術も考案されている。例えば、肌の色や、顔としての特徴などを用いて判別するなどの手法を合わせて用いたりもされている。   In addition, since the main subject is often a human being, a technique for selecting a distance measuring area in accordance with the position of the human in the screen by using other information for identifying the human has also been devised. For example, techniques such as discrimination using skin color or facial features are also used.

合焦エリアが選定されると、その合焦エリアのデフォーカス量(その測距エリアでの合焦点位置までの光学系駆動量であり、被写体との距離情報を表す)に従って、撮影光学系23を駆動し、その合焦エリアで被写体にフォーカスして(ステップS159)、AF制御処理を終了する。   When the in-focus area is selected, the photographic optical system 23 is in accordance with the defocus amount of the in-focus area (the optical system drive amount up to the in-focus position in the distance measurement area and representing distance information with the subject). Is driven, the subject is focused in the focused area (step S159), and the AF control process is terminated.

またこの選定された合焦エリアは、上記のように撮影時に焦点を合わせるだけでなく、本実施形態においては、合焦エリアの位置がメモリ32に一時的に保持され、後述のシーン判別処理の精度向上のためにも用いられる。シーン判別処理については、後で詳細に説明する。   In addition, the selected focusing area is not only focused at the time of shooting as described above, but in the present embodiment, the position of the focusing area is temporarily held in the memory 32, and scene selection processing described later is performed. Also used to improve accuracy. The scene discrimination process will be described later in detail.

(画像処理部10の内部構成)
図13に、画像処理部10の内部構成を示す。画像処理部10は、撮像装置1における撮影画像に対して、シーン判別に基づく階調の補正動作を制御するものであり、撮影処理部20での処理後に、あるいはその処理とは独立して、画像取得、シーン判別、階調処理条件設定などの一連の処理を実行する。図13を用いて、画像処理部10の内部構成を説明する。
(Internal configuration of the image processing unit 10)
FIG. 13 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. The internal configuration of the image processing unit 10 will be described with reference to FIG.

図13に示すように、画像処理部10は、第1画像取得部101、第2画像取得部102、占有率算出部103、指標算出部104、シーン判別部105、階調処理条件設定部107、そして階調変換処理部108により構成される。   As illustrated in FIG. 13, 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 107. , And a gradation conversion processing unit 108.

第1画像取得部101は、レリーズボタン28が全押しされたタイミングで、撮像素子33に写った最新の画像の画像データを第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.

また撮影時のAF制御において選定された合焦エリア位置も合わせて取得する。本実施形態で取得する合焦エリア位置は、撮影時のAF制御部52における合焦エリア選定結果に基づくもので、後でのシーン判別処理に用いるため、一時的に画像データに付加記録されるものである。取得した第1の画像の画像データ、及び合焦エリア位置はメモリ32に保持される。   Further, the focus area position selected in the AF control at the time of shooting is also acquired. The in-focus area position acquired in this embodiment is based on the in-focus area selection result in the AF control unit 52 at the time of shooting, and is temporarily added to the image data for use in later scene discrimination processing. Is. The acquired image data of the first image and the focus area position are held in the memory 32.

第2画像取得部102は、取得した第1の画像を、N×M個の矩形の領域(垂直方向にM個及び水平方向にN個に分割された領域)に分割する。図14(a)に、第1の画像の一例を示し、図14(b)に、当該第1の画像が22×14個の領域に分割された例を示す。なお、分割領域の数は特に限定されない。本実施形態では、分割された各領域を画像データの「画素」と見なし、分割された画像を実質的にサイズが縮小された画像として扱う。この縮小された画像が、第2の画像であり、上記操作により第2の画像を取得することになる。従って第2画像取得部102は、第2の画像取得手段として機能する。   The second image acquisition unit 102 divides the acquired first image into N × M rectangular regions (regions divided into M pieces in the vertical direction and N pieces in the horizontal direction). FIG. 14A shows an example of the first image, and FIG. 14B shows an example in which the first image is divided into 22 × 14 regions. 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の画像の画像データ、すなわち画像を構成する各画素に対して、色情報を取得する。取得された色情報に基づいて、画像の各画素を、明度と色相の組み合わせからなる所定の階級に分類し(図18参照)、分類された階級毎に、当該階級に属する画素が画像全体に占める割合を示す第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. 18), 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は、前述の第1の画像の画像データ取得時に合わせて取得した合焦エリア位置に基づいて、前記第2の画像の画像データの画面を複数領域に分割する画角(分割画角)を決定するとともに、各画素を、前記分割画角と明度との組み合わせからなる所定の階級に分類し(図19参照)、分類された階級毎に、当該階級に属する画素が画像全体に占める割合を示す第2の占有率を算出する。すなわち、占有率算出部103は分割画角決定手段、及び第2の占有率算出手段としても機能する。   Further, the occupancy ratio calculation unit 103 divides the screen of the image data of the second image into a plurality of areas based on the focus area position acquired together with the acquisition of the image data of the first image. (Division angle of view) is determined, and each pixel is classified into a predetermined class composed of a combination of the divided angle of view and brightness (see FIG. 19). For each classified class, pixels belonging to the class are classified. A second occupancy ratio indicating the ratio of the entire image is calculated. That is, the occupation rate calculation unit 103 also functions as a divided field angle determination unit and a second occupation rate calculation unit.

占有率算出部103において実行される、分割画角の決定を含む占有率算出処理については、後に図17を参照して詳細に説明する。   The occupation rate calculation process including determination of the divided angle of view 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の指標算出手段としても機能する。   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 also functions as a third index calculation unit.

さらに、指標算出部104は、第2の画像の所定の部分における平均輝度値と、最大輝度値と平均輝度値との差分値のそれぞれに、撮影条件に応じて予め設定された係数を乗算することにより、撮影シーンを特定するための指標4を算出する。すなわち、指標算出部104は第4の指標算出手段として機能する。   Furthermore, the index calculation unit 104 multiplies each of the average luminance value in the predetermined portion 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 conditions. 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に、それぞれ、撮影条件に応じて予め設定された係数を乗算して和をとることにより、新たな指標5を算出する。   In addition, the index calculation unit 104 has coefficients set in advance for the average luminance value (referred to as index 7) of the skin color area in the predetermined portion of the second image, and index 1 and index 3, respectively, according to the shooting conditions. Is multiplied to obtain a sum to calculate a new index 5.

また、指標算出部104は、当該平均輝度値と、指標2及び指標3に、それぞれ、撮影条件に応じて予め設定された係数を乗算して和をとることにより、新たな指標6を算出する。   Further, the index calculation unit 104 calculates a new index 6 by multiplying the average luminance value, the index 2 and the index 3 by a coefficient set in advance according to the shooting conditions, and taking the sum. .

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

シーン判別部105は、指標算出部104で算出された各指標に基づいて、第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. 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 over and under degrees. The method for determining the shooting scene will be described later in detail.

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

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

また、階調処理条件設定部107は、指標算出部104で算出された各指標に基づいて、第1の画像に対する階調調整のための階調調整パラメータを算出する。従って、上記階調処理条件設定部107は、階調調整パラメータ算出手段として機能する。階調処理条件の設定については、後に図26を参照して詳細に説明する。   Further, the gradation processing condition setting unit 107 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 107 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.

階調変換処理部108は、階調変換処理手段として機能し、上記階調処理条件設定部107において設定された階調処理条件に従い、第1の画像に対する階調変換処理を実行する。   The gradation conversion processing unit 108 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 107.

プロセッサ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 by executing a program stored (saved) in the memory 32.

(撮像装置1の動作フロー)
次に、本実施形態における撮像装置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”.

まず、図15のフローチャートを参照して、撮像装置1で実行される処理の全体の流れを説明する。なお、これらの処理はプログラムを用いてコンピュータに実行させることができる。以下で説明する各工程は、画像処理プログラムの各機能としても同様の説明ができる。   First, the overall flow of processing executed by the imaging apparatus 1 will be described with reference to the flowchart of FIG. These processes can be executed by a computer using a program. Each process described below can be similarly described as each function of the image processing program.

まず、電源スイッチ26がONに操作されると(電源が投入されると)、メモリ32のリセット等の前処理が行われる(ステップS1)。ユーザは、主要被写体が撮像装置1の被写界に入るように撮像装置1をその主要被写体の方に向け、撮影のための操作を開始する。レリーズボタン28が押されて撮影が行われる(ステップS2)。撮像素子33に結像した画像は電気信号として取り込まれ、CCD配列に基づく補間処理が行われる(ステップS4)。ステップS5では、撮影画像として、第1の画像が取得され、メモリ32に保持される。第1の画像はリニア画像であり、RAW画像と呼称される。   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 directs the imaging device 1 toward the main subject so that the main subject enters the field of the imaging device 1, and starts an operation for photographing. 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.

一方、撮影が行われると、ステップS3では、合焦エリア位置情報の取り込みが行われる。ここで取得する合焦エリア位置情報は、撮影時のAF制御において選定された合焦エリア位置であり、後で撮影画像のシーン判別処理が行われる際に利用されるものである。取得した合焦エリア位置情報はメモリ32に保持される。ステップS5及びステップS3は第1の画像取得工程として機能する。   On the other hand, when shooting is performed, in step S3, in-focus area position information is captured. The in-focus area position information acquired here is the in-focus area position selected in the AF control at the time of shooting, and is used when the scene determination process of the shot image is performed later. The acquired focus area position information is held in the memory 32. Steps S5 and S3 function as a first image acquisition process.

撮影により取得された第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の画像のサイズを縮小した画像となる。図14(a)に、第1の画像の一例を示し、図14(b)に、当該第1の画像が22×14個のセルに分割された例を示す。各セルが第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. 14A shows an example of the first image, and FIG. 14B shows an example in which the first image is divided into 22 × 14 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では、取得された第2の画像の画像データに基づいて、撮影シーンを判別するシーン判別処理が行われる。ステップS8における撮影シーン判別処理については、後に図16を参照して説明する。   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 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の画像の階調変換処理のために必要な条件を設定する処理が行われる。ステップS7の階調処理条件設定処理については、後に図26を参照して説明する。   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 S7 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 is to correct the influence on the gradation due to the light source condition of the shooting scene. The gamma conversion is based on the scene discrimination result in step S8. A gradation conversion process is performed based on the processing conditions set in step S9.

なお本実施形態では、ステップS9、ステップS11で階調処理条件を設定し、変換処理する形態としているが、撮影された第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.

次いで、画像記録のため、画像フォーマットの変換が行われる(ステップ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.

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

シーン判別処理は、図16に示すように、色空問変換処理(ステップS20)、占有率算出処理(ステップS21)、指標算出処理(ステップS22)、シーン判別(ステップS23)の各処理により構成される。但し、占有率算出処理(ステップS21)は、図17のフローチャートに示すように分割画角決定処理を含む。以下、図17〜図25を参照して、図16に示す各処理について詳細に説明する。   As shown in FIG. 16, the scene discrimination process is configured by each process of a color space conversion process (step S20), an occupation rate calculation process (step S21), an index calculation process (step S22), and a scene discrimination (step S23). Is done. However, the occupation rate calculation process (step S21) includes a divided field angle determination process as shown in the flowchart of FIG. Hereinafter, each process illustrated in FIG. 16 will be described in detail with reference to FIGS. 17 to 25.

まず、図16のステップS20において、色空間変換処理が行われる。   First, in step S20 of FIG. 16, a color space conversion process is performed.

まず、撮影された第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, information indicating the RGB value, luminance value, and 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 this embodiment, “brightness” means “brightness” 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では、占有率算出処理が行われる。図17のフローチャートを参照して、占有率算出処理について説明する。
<分割画角決定処理>
まず、第1の画像取得工程で取得された合焦エリア位置の情報に基づいて、第2の画像を分割するための分割画角が決定される(ステップS29)。
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.
<Division angle determination processing>
First, based on the information on the focus area position acquired in the first image acquisition step, a divided field angle for dividing the second image is determined (step S29).

図11には、撮影画面における複数の測距エリアの配置が示されている。すなわち、第1の画像に基づいて取得された第2の画像においても、配置された測距エリアから選択された合焦エリアの位置は、画面内での主要被写体の位置に対応するものと推定される。従って、合焦エリアの位置を中心として、画面分割の画角を設定することにより、主要被写体の位置を考慮した画面分割を行うことができる。   FIG. 11 shows the arrangement of a plurality of ranging areas on the shooting screen. That is, also in the second image acquired based on the first image, the position of the focusing area selected from the arranged ranging areas is estimated to correspond to the position of the main subject in the screen. Is done. Therefore, by setting the angle of view for screen division around the position of the focus area, screen division can be performed in consideration of the position of the main subject.

具体的に合焦エリア位置に対応して、分割画角を決定した例を図11(b)から図11(e)に示す。   Specifically, an example in which the divided field angles are determined corresponding to the focus area position is shown in FIGS. 11B to 11E.

図11(b)は、画面中央の測距エリアAが合焦エリアとして選択された場合の分割画角を示す。分割も画面中央を基準として上下左右が対称となるように、n1、n2、n3の3つの領域に分割されている。   FIG. 11B shows a divided angle of view when the distance measuring area A at the center of the screen is selected as the focusing area. The division is also divided into three areas n1, n2, and n3 so that the vertical and horizontal directions are symmetrical with respect to the center of the screen.

図11(c)は、画面左側の測距エリアB1が合焦エリアとして選択された場合の分割画角を示す。分割も画面左側を基準として左よりの上下対称となるように、n1、n2、n3の3つの領域に分割されている。画面右側の測距エリアB2が合焦エリアとして選択された場合は、これと左右が逆になった分割となる。   FIG. 11C shows a divided angle of view when the distance measuring area B1 on the left side of the screen is selected as the focusing area. The division is also divided into three areas n1, n2, and n3 so as to be vertically symmetrical with respect to the left side of the screen. When the distance measuring area B2 on the right side of the screen is selected as the focusing area, the left and right sides are reversed.

図11(d)は、画面上側の測距エリアC1が合焦エリアとして選択された場合の分割画角を示す。分割も画面上側を基準として上よりの左右対称となるように、n1、n2、n3の3つの領域に分割されている。画面下側の測距エリアC2が合焦エリアとして選択された場合は、これと上下が逆になった分割となる。   FIG. 11D shows a divided field angle when the distance measuring area C1 on the upper side of the screen is selected as the focusing area. The division is also divided into three regions n1, n2, and n3 so as to be symmetrical with respect to the upper side with respect to the upper side of the screen. When the distance measuring area C2 on the lower side of the screen is selected as the focusing area, the division is reversed upside down.

図11(e)は、画面左上側の測距エリアD1が合焦エリアとして選択された場合の分割画角を示す。分割も画面左上側を基準として左上よりに、n1、n2、n3の3つの領域に分割されている。画面左下、右上、右下側の測距エリアD2、D3、D4がそれぞれ合焦エリアとして選択された場合は、それぞれ対応する左下、右上、右下よりに分割されることになる。   FIG. 11E shows a divided field angle when the distance measuring area D1 on the upper left side of the screen is selected as the focusing area. The division is also divided into three areas n1, n2, and n3 from the upper left with reference to the upper left side of the screen. When the distance measurement areas D2, D3, and D4 on the lower left, upper right, and lower right sides of the screen are selected as the focusing areas, they are divided from the corresponding lower left, upper right, and lower right.

このようにステップS29は分割画角決定工程として機能する。
<占有率算出処理>
次に、色空問変換処理で算出されたHSV値に基づいて、第2の画像の各画素が、色相と明度の組み合わせからなる所定の階級に分類され、分類された階級毎に累積画素数を算出することによって2次元ヒストグラムが作成される(ステップS30)。
Thus, step S29 functions as a divided field angle determination step.
<Occupancy rate calculation process>
Next, based on the HSV value calculated in 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 for each classified class Is calculated to create a two-dimensional histogram (step S30).

図18に、明度と色相の組み合わせからなる階級を示す。ステップS30では、明度(V)は、明度値が0〜5(v1)、6〜12(v2)、13〜24(v3)、25〜76(v4)、77〜109(v5)、110〜149(v6)、150〜255(v7)の7つの階級に分割される。図18に示すように、最も低明度の階級における明度の範囲よりも、最も高明度の階級における明度の範囲の方が広い。   FIG. 18 shows a class composed of combinations 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. 18, 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 field angle and the lightness determined in the above-described divided field angle determination step, and the cumulative number of pixels for each classified class. Is calculated to create a two-dimensional histogram (step S31).

図19(a)に、ステップS31において使用される3つの領域、すなわち前述の分割画角決定工程において決定された画角に応じて第2の画像が分割された3つの領域n1〜n3を示す。領域n1が外枠であり、領域n2が外枠の内側の領域であり.領域n3が第2の画像の中央部の領域である。ここでn1〜n3は前述の選定された合焦エリア位置が中央(測距エリアA)である場合の分割(図11(b))を示している。分割された領域は略同等の画素数となるように分割することが好ましい。また本実施形態においては3つの分割としたがこれに限定されるものではない。   FIG. 19A shows three regions n1 to n3 in which the second image is divided in accordance with the three regions used in step S31, that is, the angle of view determined in the above-described divided angle of view determination step. . Region n1 is the outer frame, region n2 is the inner region of the outer frame,. A region n3 is a central region of the second image. Here, n1 to n3 indicate divisions (FIG. 11 (b)) in the case where the selected focusing area position is the center (ranging area A). It is preferable to divide the divided areas 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.

また、ステップS31において、明度は、上述のようにv1〜v7の7つの領域に分割するものとする。図19(b)に、3つの領域n1〜n3と明度の組み合わせからなる階級を示す。図19(b)に示すように、第2の画像を前述の分割画角決定工程において決定された画角と明度との組み合わせからなる階級に分類した場合の階級の数は3×7=21個となる。   In step S31, the brightness is divided into seven areas v1 to v7 as described above. FIG. 19B shows a class composed of combinations of three regions n1 to n3 and brightness. As shown in FIG. 19B, the number of classes when the second image is classified into a class composed of combinations of the field angle and the lightness determined in the above-described divided field angle determination step is 3 × 7 = 21. It becomes a piece.

ステップS30において2次元ヒストグラムが作成されると、明度と色相の組み合わせからなる所定の階級毎に算出された累積画素数の全画素数(N×M個)に占める割合を示す第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 (N × M) 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 2007201679
Figure 2007201679

ステップS31において2次元ヒストグラムが作成されると、前述の分割画角決定工程において決定された画角と明度との組み合わせからなる所定の階級毎に算出された累積画素数の全画素数に占める割合を示す第2の占有率が算出され(ステップS33)、本占有率算出処理が終了する。すなわちステップS31とステップS33は第2の占有率算出工程として機能する。   When a two-dimensional histogram is created in step S31, the ratio of the cumulative number of pixels calculated for each predetermined class composed of the combination of the field angle and the lightness determined in the aforementioned divided field angle determination step to the total number of pixels Is calculated (step S33), and this 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 2007201679
Figure 2007201679

なお、各画素を分割画角、明度及び色相からなる階級に分類し、分類された階級毎に累積画素数を算出することによって3次元ヒストグラムを作成してもよい。以下では、2次元ヒストグラムを用いる方式を採用するものとする。
<指標算出処理>
次に、図20のフローチャートを参照して、指標算出処理(図16のステップS22)について説明する。
Note that a three-dimensional histogram may be created by classifying each pixel into a class composed of divided angle of view, 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. 16) 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 representing the degree of overshoot of the main subject, and is for separating only the image that should be determined as “the main subject is over” from other shooting scenes.

次いで、第2の指標算出工程であるステップS41では、同じく階級毎に算出された第2の占有率に、撮影条件に応じて予め設定された第1の係数とは異なる係数(第2の係数)を乗算して和をとることにより、撮影シーンを特定するための指標2が算出される。指標2は、空色高明度、顔色低明度等の逆光撮影時の特徴を複合的に表す指標であり、「逆光」、「主要被写体がアンダー」と判別されるべき画像のみを他の撮影シーンから分離するためのものである。   Next, in step S41, which is a second index calculation step, a coefficient different from the first coefficient set in advance according to the shooting conditions (second coefficient) is similarly calculated for the second occupation 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の算出方法について詳細に説明する。   Hereinafter, the calculation method of the index 1 and the index 2 will be described in detail.

表3に、指標1を算出するために必要な第1の係数を階級別に示す。表3に示された各階級の係数は、表1に示した各階級の第1の占有率Rijに乗算する重み係数であり、撮影条件に応じて予め設定されている。   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 2007201679
Figure 2007201679

表3によると、高明度(v6)の肌色色相領域(H1)に分布する領域から算出される第1の占有率には、正(+)の係数が用いられ、それ以外の色相である青色色相領域から算出される第1の占有率には、負(−)の係数が用いられる。図21は、肌色領域(H1)における第1の係数と、その他の領域(緑色色相領域(H3))における第1の係数を、明度全体に渡って連続的に変化する曲線(係数曲線)として示したものである。表3及び図21によると、高明度(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. 21 shows a curve (coefficient curve) in which the first coefficient in the skin color area (H1) and the first coefficient in the other area (green hue area (H3)) continuously change over the entire brightness. It is shown. According to Table 3 and FIG. 21, 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 2007201679
Figure 2007201679

従って、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 x (-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 2007201679
Figure 2007201679

表4によると、肌色色相領域(H1)の中間明度に分布する領域(v4、v5)から算出される占有率には負(−)の係数が用いられ、肌色色相嶺域(H1)の低明度(シャドー)領域(v2、v3)から算出される占有率には係数0が用いられる。図22は、肌色領域(H1)における第2の係数を、明度全体にわたって連続的に変化する曲線(係数曲線)として示したものである。表4及び図22によると、肌色色相領域の、明度値が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. 22 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. 22, 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 2007201679
Figure 2007201679

従って、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の算出方法について説明する。   Hereinafter, a method for calculating the index 3 will be described.

表5に、指標3を算出するために必要な第3の係数を階級別に示す。表5に示された各階級の係数は、表2に示した各階級の第2の占有率Qijに乗算する重み係数であり、撮影条件に応じて予め設定されている。   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 2007201679
Figure 2007201679

図23は、画面領域n1〜n3における第3の係数を、明度全体に渡って連続的に変化する曲線(係数曲線)として示したものである。   FIG. 23 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 2007201679
Figure 2007201679

従って、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)
The index 3 is calculated based on the compositional feature (the angle of view determined in the above-described divided angle-of-view determination step, that is, the main subject position) based on the lightness distribution position of the second image. It is also effective for determining a monochrome image shooting scene.

また、例えば合焦エリア位置に応じて、前述の分割画角決定工程において決定された画角と明度の所定の階級から算出される第2占有率に対して乗算される第3の係数の重みを変えることで、より高精度にシーンを判別する指標を算出することが可能である。   Further, for example, the weight of the third coefficient multiplied by the second occupancy calculated from the predetermined class of the angle of view and the lightness determined in the above-described divided field angle determination step according to the focus area position By changing, it is possible to calculate an index for discriminating a scene with higher accuracy.

指標1〜3が算出されると、第4の指標算出工程であるステップS43で、第2の画像の主要被写体部における肌色の平均輝度値と、第2の画像の最大輝度値と平均輝度値との差分値のそれぞれに、撮影条件に応じて予め設定された係数を乗算することにより、撮影シーンを特定するための指標4が算出される。   When the indices 1 to 3 are calculated, the average brightness value of the skin color in the main subject portion of the second image, the maximum brightness value, and the average brightness value of the second image are obtained in step S43, which is the fourth index calculating step. The index 4 for specifying the shooting scene is calculated by multiplying each of the difference values by a coefficient set in advance according to the shooting conditions.

以下、図24のフローチャートを参照して、指標4の算出処理について詳細に説明する。   Hereinafter, the calculation process of the index 4 will be described in detail with reference to the flowchart of FIG.

まず、第2の画像のRGB(Red、Green、Blue)値から、式(A)を用いて輝度Yが算出される。次いで、第2の画像の主要被写体部における肌色領域の平均輝度値x1が算出される(ステップS50)。ここで、主要被写体部とは、例えば図19(a)に示した領域n3により構成される領域である。次いで、第2の画像の最大輝度値と平均輝度値との差分値x2=最大輝度値−平均輝度値が算出される(ステップS51)。   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 main subject portion of the second image is calculated (step S50). Here, the main subject portion is a region constituted by the region n3 shown in FIG. 19A, for example. 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)、主要被写体部における平均輝度値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 main subject portion 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が算出されると、ステップS44(図20参照)で、指標1、指標3、及び第2の画像の主要被写体部における肌色領域の平均輝度値に、撮影条件に応じて予め設定された重み係数を乗算することにより、指標5が算出される。   When the index 4 is calculated, in step S44 (see FIG. 20), the average brightness value of the skin color area in the main subject portion of the index 1, the index 3, and the second image is preset according to the shooting conditions. By multiplying the weighting factor, the index 5 is calculated.

さらにステップS45で、指標2、指標3、及び第2の画像の主要被写体部における肌色領域の平均輝度値に、撮影条件に応じて予め設定された重み係数を乗算することにより、指標6が算出され、本指標算出処理が終了する。   Further, in step S45, the index 6 is calculated by multiplying the average luminance value of the skin color area in the main subject portion of the index 2, the index 3, and the second image by a weighting factor set in advance according to the shooting conditions. Then, the present index calculation process ends.

以下、指標5及び指標6の算出方法について詳細に説明する。   Hereinafter, the calculation method of the index 5 and the index 6 will be described in detail.

第2の画像の主要被写体部における肌色領域の平均輝度値を指標7とする。ここでの主要被写体部とは、例えば、図19(a)の領域n2及び領域n3から構成される領域である。このとき、指標5は、指標1、指標3、指標7を用いて式(9)のように定義され、指標6は、指標2、指標3、指標7を用いて式(10)のように定義される。   The average luminance value of the skin color area in the main subject portion of the second image is taken as index 7. The main subject portion here is, for example, a region composed of the region n2 and the region n3 in FIG. At this time, the index 5 is defined as in Expression (9) using the index 1, index 3, and index 7, and the index 6 is defined as in Expression (10) using the index 2, index 3, and index 7. Defined.

指標5=0.54×指標1+0.50×指標3+0.01×指標7−0.65 (9)
指標6=0.83×指標2+0.23×指標3+0.01×指標7−1.17(10)
ここで式(9)及び式(10)において各指標に乗算される係数は、撮影条件に応じて予め設定されている。
Index 5 = 0.54 × Index 1 + 0.50 × Index 3 + 0.01 × Index 7−0.65 (9)
Index 6 = 0.83 × Index 2 + 0.23 × Index 3 + 0.01 × Index 7-1.17 (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.

なお、図24における平均輝度値(例えば、全体平均輝度値)の算出方法としては、撮像装置1の各受光部から得られた個別輝度データの単純な加算平均値を求めてもよいし、撮像装置1の測光方式としてよく用いられる中央重点平均測光に類似した、画面中心付近の受光部より得られた輝度データに重み付けを高く、画面の周辺付近の受光部より得られた輝度データに重み付けを低くして加算平均値を求める手法を用いてもよい。また、焦点検出領域に対応した受光部付近より得られた輝度データに重み付けを高くし、焦点検出位置から離れた受光部より得られた輝度データに重み付けを低くして加算平均値を求める手法等を用いてもよい。
<シーン判別>
図16に戻って、シーン判別を説明する。
Note that, as a method of calculating the average luminance value (for example, the overall average luminance value) in FIG. 24, a simple addition average value of individual luminance data obtained from each light receiving unit of the imaging device 1 may be obtained, or imaging may be performed. Similar to the center-weighted average metering that is often used as the metering method of the apparatus 1, the luminance data obtained from the light receiving unit near the center of the screen is highly weighted, and the luminance data obtained from the light receiving unit near the periphery of the screen is weighted. A method of obtaining the average value by lowering may be used. 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.
<Scene discrimination>
Returning to FIG. 16, scene discrimination will be described.

指標4〜6が算出されると、これらの指標の値に基づいて撮影シーンが判別される(ステップS23)。表6に、指標4、指標5及び指標6の値による撮影シーンの判別内容を示す。   When the indices 4 to 6 are calculated, 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.

Figure 2007201679
Figure 2007201679

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

(階調処理条件設定のフロー)
次に、図26のフローチャートを参照して、第1の画像のガンマ変換処理後の画像に対する階調処理条件設定(図15のステップS9)について説明する。
<階調調整方法選択>
まず、判別された撮影シーンに応じて、ステップS70で第1の画像データのガンマ変換処理後に対する階調調整の方法が決定され、ステップS71で階調調整パラメータが算出されると、ステップS73で階調処理条件(階調変換曲線)が決定される。なお、本実施形態では、ステップS70とステップS73とにおいて階調調整方法と階調調整量の双方を決定する場合を示すが、階調調整量のみを選択、あるいは決定してもよい。
(Flow of gradation processing condition setting)
Next, the gradation processing condition setting (step S9 in FIG. 15) for the first image after the gamma conversion processing will be described with reference to the flowchart in FIG.
<Tone adjustment method selection>
First, according to the determined shooting scene, a gradation adjustment method for the first image data after the gamma conversion process is determined in step S70, and when a gradation adjustment parameter is calculated in step S71, in step S73. 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 S70 and S73 is shown, but only the gradation adjustment amount may be selected or determined.

ステップS70で階調調整方法を決定する場合、図27に示すように、撮影シーンが順光である場合は階調調整方法A(図27(a))が選択され、逆光である場合は階調調整方法B(図27(b))が選択され、主要被写体がオーバーである場合は階調調整方法C(図27(c))が選択され、アンダーである場合は、階調調整方法B(図27(b))が選択される。   When determining the gradation adjustment method in step S70, as shown in FIG. 27, the gradation adjustment method A (FIG. 27 (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. 27B) is selected and the main subject is over, the tone adjustment method C (FIG. 27C) is selected, and when it is under, the tone adjustment method B is selected. (FIG. 27B) is selected.

なお本実施形態においては、第1の画像のガンマ変換後の画像へ適用する階調変換曲線を決定する方法を示したが、階調変換工程をガンマ変換の前に実施する場合には、図27の階調変換曲線に対して、ガンマ変換の逆変換を施した曲線で階調変換が行われる。
<階調調整パラメータ算出>
階調調整方法が決定されると、ステップS71では、指標算出処理で算出された各指標に基づいて、階調調整に必要なパラメータが算出される。すなわち、ステップS71は階調調整パラメータ算出工程として機能する。以下、階調調整パラメータの算出方法について説明する。なお、以下では、8bitの撮影画像データは16bitへと事前に変換されているものとし、撮影画像データの値の単位は16bitであるものとする。
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 with a curve obtained by performing inverse conversion of gamma conversion on the 27 gradation conversion curves.
<Calculation of gradation adjustment parameters>
When the gradation adjustment method is determined, in step S71, parameters necessary for gradation adjustment are calculated based on each index calculated in the index calculation process. That is, step S71 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
ここで、図28及び図29を参照して、パラメータP2(ブロック分割平均輝度)の算出方法について説明する。
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
Here, with reference to FIG. 28 and FIG. 29, a calculation method of the parameter P2 (block division average luminance) will be described.

まず、画像データを正規化するために、CDF(累積密度関数)を作成する。次いで、得られたCDFから最大値と最小値を決定する。この最大値と最小値は、RGB毎に求める。ここで、求められたRGB毎の最大値と最小値を、それぞれ、Rmax、Rmin、Gmax、Gmin、Bmax、Bminとする。   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).

Rpoint={(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を算出する。
Rpoint = {(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)
図28(a)は、正規化する前のRGB画素の輝度の度数分布(ヒストグラム)である。図28(a)において、横軸は輝度、縦軸は画素の頻度である。このヒストグラムは、RGB毎に作成する。輝度のヒストグラムが作成されると、式(11)〜式(13)により、画像データに対し、プレーン毎に正規化を行う。図28(b)は、式(14)により算出された輝度のヒストグラムを示す。撮影画像データが65535で正規化されているため、各画素は、最大値が65535で最小値が0の間で任意の値をとる。
Npoint = (Bpoint + Gpoint + Rpoint) / 3 (14)
FIG. 28A shows a frequency distribution (histogram) of luminance of RGB pixels before normalization. In FIG. 28A, 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. 28B shows a histogram of the brightness 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.

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

次いで、図28(c)に示された輝度ヒストグラムから、ハイライト、シャドー領域を削除する処理を行う。これは、白壁や雪上シーンでは、平均輝度が非常に高くなり、暗闇のシーンでは平均輝度は非常に低くなっているため、ハイライト、シャドー領域は、平均輝度制御に悪影響を与えてしまうことによる。そこで、図28(c)に示した輝度ヒストグラムのハイライト領域、シャドー領域を制限することによって、両領域の影響を減少させる。図29(a)(または図28(c))に示す輝度ヒストグラムにおいて、高輝度領域(ハイライト領域)及び低輝度領域(シャドー領域)を削除すると、図29(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 shadow area of the luminance histogram shown in FIG. 28C, 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. 29A (or FIG. 28C), the result is as shown in FIG.

次いで、図29(c)に示すように、輝度ヒストグラムにおいて、頻度が所定の閾値より大きい領域を削除する。これは、頻度が極端に多い部分が存在すると、この部分のデータが、撮影画像全体の平均輝度に強く影響を与えてしまうため、誤補正が生じやすいことによる。そこで、図29(c)に示すように、輝度ヒストグラムにおいて、閾値以上の画素数を制限する。図29(d)は、画素数の制限処理を行った後の輝度ヒストグラムである。   Next, as shown in FIG. 29 (c), an area having a frequency greater than a predetermined threshold is deleted from the luminance histogram. 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. 29C, the number of pixels equal to or greater than the threshold is limited in the luminance histogram. FIG. 29D is a luminance histogram after the pixel number limiting process is performed.

正規化された輝度ヒストグラムから、高輝度領域及び低輝度領域を削除し、さらに、累積画素数を制限することによって得られた輝度ヒストグラム(図29(d))の各ブロック番号と、それぞれの頻度に基づいて、輝度の平均値を算出したものがパラメータP2である。   Each block number of the luminance histogram (FIG. 29 (d)) obtained by deleting the high luminance region and the low luminance region from the normalized luminance histogram and limiting the cumulative number of 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 the parameter P7, the key correction value 2 of the parameter P7 ', and the luminance correction value 2 of the parameter P8 are defined as shown in Expression (15), Expression (16), and Expression (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)
<シーンごとの階調処理条件設定>
図26に戻り、階調調整パラメータが算出されると、ステップS73では、その算出された階調調整パラメータに基づいて、撮影画像データに対する階調変換曲線の決定、すなわち階調処理条件が設定される。
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)
<Setting gradation processing conditions for each scene>
Returning to FIG. 26, when the gradation adjustment parameter is calculated, in step S73, determination of a gradation conversion curve for the photographed image data, that is, gradation processing conditions are set based on the calculated gradation 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.

階調変換曲線が決定されると、階調処理条件設定は終了する。   When the gradation conversion curve is determined, the gradation processing condition setting ends.

以下、各撮影シーン(光源条件及び露出条件)ごとに、階調変換曲線の決定方法(ステップS73での階調処理条件の決定)について説明する。   Hereinafter, a method for determining a gradation conversion curve (determination of gradation processing conditions in step S73) 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)
従って、撮影シーンが順光の場合、図27(a)に示す複数の階調変換曲線の中から、式(18)に対応する階調変換曲線が選択される。または、式(18)に基づいて階調変換曲線を算出(決定)してもよい。
RGB value of output image = RGB value of input image + P6 (18)
Therefore, when the photographic scene is front 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).

〈逆光の場合〉
撮影シーンが逆光である場合、図27(b)に示す複数の階調変換曲線の中から、パラメータP7(キー補正値)に対応する階調変換曲線が選択される。図27(b)の階調変換曲線の具体例を図30に示す。パラメータ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. 30 shows a specific example of the gradation conversion curve of 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.

〈アンダーの場合〉
撮影シーンがアンダーである場合、図27(b)に示す複数の階調変換曲線の中から、パラメータP7’(キー補正値2)に対応する階調変換曲線が選択される。具体的には、撮影シーンが逆光の場合の階調変換曲線の選択方法と同様に、図30に示す階調変換曲線の中から、パラメータP7’の値に対応した階調変換曲線が選択される。なお、撮影シーンがアンダーである場合は、逆光の場合に示したような覆い焼き処理は行わない。
<In case of under>
When the shooting scene is under, a 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. 30 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)
従って、主要被写体がオーバーの場合、図27(c)に示す複数の階調変換曲線の中から、パラメータP9に対応する階調変換曲線が選択される。または、式(19)に基づいて階調変換曲線を算出(決定)してもよい。なお、式(19)のパラメータP9の値が、予め設定された所定値αを上回った場合、図12に示す曲線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 the parameter P9 in the 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 bear, 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.

以上のように、上記実施形態によれば、撮影時のAF制御で選定された合焦エリアの位置に基づいて画面内の主要被写体の位置を推定し、画像のシーン判別のための指標算出に利用することにより、画像データからより高精度に撮影シーンを判別することができ、また主要被写体のオーバー、アンダー露光、順光、逆光シーンなどのシーン判別結果に応じて、より適切な補正処理を達成し、より適切な補正画像を得ることができる。   As described above, according to the above-described embodiment, the position of the main subject in the screen is estimated based on the position of the focusing area selected by the AF control at the time of shooting, and an index for image scene determination is calculated. By using it, it is possible to discriminate shooting scenes from image data with higher accuracy, and more appropriate correction processing is performed according to the scene discrimination results such as overexposure, underexposure, front light, backlight scene etc. of the main subject. And 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.

本発明の実施形態に係る撮像装置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の内部構成を示すブロック図である。2 is a block diagram illustrating an internal configuration of an imaging 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. 多点AFセンサ(測距エリア)の配置を示す図(a)、及び合焦エリア位置に応じた分割画角で分割された領域n1〜n3を示す図(b)〜(e)である。FIG. 6A is a diagram showing the arrangement of multi-point AF sensors (ranging areas), and FIGS. 5B to 5E are diagrams showing regions n1 to n3 divided at a divided angle of view according to the focus area position. 多点AFセンサを用いた場合の、AF制御部での合焦エリアの選定動作、及び画像の焦点を合わせる制御を示すフローチャートである。It is a flowchart which shows the selection operation | movement of the focusing area in an AF control part at the time of using a multipoint AF sensor, and the control which adjusts the focus of an image. 画像処理部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において実行される処理の全体の流れを示すフローチャートである。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と明度からなる階級を示す図(b)である。It is the figure (a) which shows the area | regions n1-n3 determined according to a division | segmentation view angle, and the figure (b) which shows the class which consists of the area | regions n1-n3 and 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, over, backlight, under) and the parameter | index 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))である。It is a figure ((a) and (b)) explaining deletion of the low-intensity area | region and high-intensity area | region from a brightness | luminance histogram, and a figure ((c) and (d)) explaining the restriction | limiting of a luminance frequency. 撮影シーンが逆光またはアンダーである場合の階調処理条件を表す階調変換曲線を示す図である。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 撮像素子
34 多点AFセンサ
37 画像データ出力部
38 操作部
41 タイミングジェネレータ
42 シャッタユニット
43 絞りユニット
44 フォーカスユニット
51 AE制御部
52 AF制御部
53 画素補間部
54 AWB制御部
55 ガンマ補正部
101 第1画像取得部
102 第2画像取得部
103 占有率算出部
104 指標算出部
105 シーン判別部
107 階調処理条件設定部
108 階調変換処理部
DESCRIPTION OF SYMBOLS 1 Imaging device 10 Image processing part 20 Imaging processing part 21 Case 22 Four-way key 23 Shooting optical system 24 Flash 25 Finder 26 Power switch 27 Display part 28 Release button 31 Processor 32 Memory 33 Image sensor 34 Multipoint AF sensor 37 Image data output Unit 38 operation unit 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 occupation Rate calculation unit 104 Index calculation unit 105 Scene discrimination unit 107 Gradation processing condition setting unit 108 Gradation conversion processing unit

Claims (12)

撮影レンズを透過した光を受光した複数の検出エリアからの出力信号に基づいて、前記複数の検出エリアから合焦エリアを選定するAF制御手段と、
前記AF制御手段により選定された合焦エリアにおいてフォーカスされた画像を、撮影によって第1の画像として取得する第1の画像取得手段と、
前記第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得手段と、
前記第2の画像に基づき撮影シーンの判別処理を行うシーン判別処理手段と、
前記シーン判別処理手段によって得られたシーン判別結果に基づき、前記第1の画像に対する階調処理条件を設定する階調処理条件設定手段と、を有し、
前記シーン判別処理手段はさらに、
前記第1の画像の撮影時における、前記AF制御手段による合焦エリアの選定結果に基づいてシーンの判別処理を行う、
ことを特徴とする撮像装置。
AF control means for selecting an in-focus area from the plurality of detection areas based on output signals from the plurality of detection areas receiving light transmitted through the photographing lens;
First image acquisition means for acquiring an image focused in the in-focus area selected by the AF control means as a first image by photographing;
Second image acquisition means for acquiring a second image obtained by reducing the image size from the first image;
Scene discrimination processing means for performing processing for discriminating a shooting scene based on the second image;
Gradation processing condition setting means for setting gradation processing conditions for the first image based on a scene determination result obtained by the scene determination processing means,
The scene discrimination processing means further includes
A scene discrimination process is performed based on a focus area selection result by the AF control means at the time of shooting the first image.
An imaging apparatus characterized by that.
前記シーン判別処理手段は、
前記第2の画像の画像データについて色情報を取得し、
取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、
前記AF制御手段による合焦エリアの選定結果に基づいて、前記画像データの画面を分割する画角を決定する分割画角決定手段と、
前記取得された色情報に基づいて、前記画像データを前記分割画角決定手段により決定された画角と明度との組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、
前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、
少なくとも前記画像データの所定の部分における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出手段と、
前記指標1、前記指標2、前記指標3、及び前記指標4に基づいて、前記画像データのシーンを特定するシーン判別手段と、を有する、
ことを特徴とする請求項1に記載の撮像装置。
The scene discrimination processing means includes
Obtaining color information for the image data of the second image;
Based on the acquired color information, the image data is classified into a class composed of a combination of a predetermined brightness and hue, and a first occupancy ratio indicating a proportion of the entire image data for each classified class First occupancy rate calculating means for calculating
A divided field angle determination unit that determines a field angle to divide the screen of the image data based on a selection result of the focus area by the AF control unit;
Based on the acquired color information, the image data is classified into classes composed of combinations of field angles and lightness determined by the divided field angle determination means, and the entire image data is classified into the classified classes. A second occupancy rate calculating means for calculating a second occupancy rate indicating a ratio 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 a predetermined portion of the image data by a preset fourth coefficient;
Scene discrimination means for specifying a scene of the image data based on the index 1, the index 2, the index 3, and the index 4.
The imaging apparatus according to claim 1.
前記階調処理条件設定手段は、
前記第2の画像に基づき階調調整パラメータを算出する階調調整パラメータ算出手段を有し、
前記シーン判別処理手段によるシーン判別結果と前記階調調整パラメータ算出手段により算出された前記階調調整パラメータとに基づき、前記第1の画像に対する階調処理条件を設定する、
ことを特徴とする請求項1または2に記載の撮像装置。
The gradation processing condition setting means includes:
Gradation adjustment parameter calculation means for calculating a gradation adjustment parameter based on the second image;
Setting a gradation processing condition for the first image based on a scene determination result by the scene determination processing unit and the gradation adjustment parameter calculated by the gradation adjustment parameter calculating unit;
The imaging apparatus according to claim 1 or 2, wherein
前記階調処理条件設定手段により設定された階調処理条件に基づき、前記第1の画像に対する階調変換処理を行う階調変換処理手段を有する、
ことを特徴とする請求項1乃至3の何れか1項に記載の撮像装置。
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;
The image pickup apparatus according to claim 1, wherein the image pickup apparatus is an image pickup apparatus.
撮影レンズを透過した光を受光した複数の検出エリアからの出力信号に基づいて、前記複数の検出エリアから合焦エリアを選定するAF制御工程と、
前記AF制御工程で選定された合焦エリアにおいてフォーカスされた画像を、撮影によって第1の画像として取得する第1の画像取得工程と、
前記第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得工程と、
前記第2の画像に基づき撮影シーンの判別処理を行うシーン判別処理工程と、
前記シーン判別処理工程によって得られたシーン判別結果に基づき、前記第1の画像に対する階調処理条件を設定する階調処理条件設定工程と、を備え、
前記シーン判別処理工程ではさらに、
前記第1の画像の撮影時における、前記AF制御工程での合焦エリアの選定結果に基づいてシーンの判別処理を行う、
ことを特徴とする画像処理方法。
An AF control step of selecting an in-focus area from the plurality of detection areas based on output signals from the plurality of detection areas receiving light transmitted through the photographing lens;
A first image acquisition step of acquiring an image focused in the in-focus area selected in the AF control step as a first image by photographing;
A second image acquisition step of acquiring a second image obtained by reducing the image size from the first image;
A scene determination processing step of performing a shooting scene determination process based on the second image;
A gradation processing condition setting step for setting a gradation processing condition for the first image based on the scene determination result obtained by the scene determination processing step;
In the scene discrimination processing step,
A scene discrimination process is performed based on a focus area selection result in the AF control process at the time of shooting the first image.
An image processing method.
前記シーン判別処理工程は、
前記第2の画像の画像データについて色情報を取得し、
取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出工程と、
前記AF制御工程における合焦エリアの選定結果に基づいて、前記画像データの画面を分割する画角を決定する分割画角決定工程と、
前記取得された色情報に基づいて、前記画像データを前記分割画角決定工程において決定された画角と明度との組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出工程と、
前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出工程と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出工程と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出工程と、
少なくとも前記画像データの所定の部分における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出工程と、
前記指標1、前記指標2、前記指標3、及び前記指標4に基づいて、前記画像データのシーンを特定するシーン判別工程と、を備える、
ことを特徴とする請求項5に記載の画像処理方法。
The scene discrimination processing step includes
Obtaining color information for the image data of the second image;
Based on the acquired color information, the image data is classified into a class composed of a combination of a predetermined brightness and hue, and a first occupancy ratio indicating a proportion of the entire image data for each classified class A first occupancy ratio calculating step for calculating
A divided angle of view determination step for determining an angle of view for dividing the screen of the image data based on a selection result of the focus area in the AF control step;
Based on the acquired color information, the image data is classified into classes composed of combinations of field angles and brightness determined in the divided field angle determination step, and the entire image data is classified into the classified classes. A second occupancy ratio calculating step of calculating a second occupancy ratio indicating a ratio 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 calculation step of calculating index 4 by multiplying the average brightness of the skin color at least in a predetermined portion of the image data by a preset fourth coefficient;
A scene determination step for identifying a scene of the image data based on the index 1, the index 2, the index 3, and the index 4.
The image processing method according to claim 5.
前記階調処理条件設定工程は、
前記第2の画像に基づき階調調整パラメータを算出する階調調整パラメータ算出工程を備え、
前記シーン判別処理工程におけるシーン判別結果と前記階調調整パラメータ算出工程において算出された前記階調調整パラメータとに基づき、前記第1の画像に対する階調処理条件を設定する、
ことを特徴とする請求項5または6に記載の画像処理方法。
The gradation processing condition setting step includes
A gradation adjustment parameter calculating step of calculating a gradation adjustment parameter based on the second image;
Setting a gradation processing condition for the first image based on a scene determination result in the scene determination processing step and the gradation adjustment parameter calculated in the gradation adjustment parameter calculating step;
The image processing method according to claim 5, wherein the image processing method is an image processing method.
前記階調処理条件設定工程において設定された階調処理条件に基づき、前記第1の画像に対する階調変換処理を行う階調変換処理工程を備える、
ことを特徴とする請求項5乃至7の何れか1項に記載の画像処理方法。
A gradation conversion processing step of performing gradation conversion processing on the first image based on the gradation processing conditions set in the gradation processing condition setting step;
The image processing method according to claim 5, wherein:
コンピュータに画像処理を実行させるための画像処理プログラムであって、
撮影レンズを透過した光を受光した複数の検出エリアからの出力信号に基づいて、前記複数の検出エリアから合焦エリアを選定するAF制御機能と、
前記AF制御機能により選定された合焦エリアにおいてフォーカスされた画像を、撮影によって第1の画像として取得する第1の画像取得機能と、
前記第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得機能と、
前記第2の画像に基づき撮影シーンの判別処理を行うシーン判別処理機能と、
前記シーン判別処理機能によって得られたシーン判別結果に基づき、前記第1の画像に対する階調処理条件を設定する階調処理条件設定機能と、を有し、
前記シーン判別処理機能はさらに、
前記第1の画像の撮影時における、前記AF制御機能による合焦エリアの選定結果に基づいてシーンの判別処理を行う、
ことを特徴とする画像処理プログラム。
An image processing program for causing a computer to execute image processing,
An AF control function for selecting an in-focus area from the plurality of detection areas based on output signals from the plurality of detection areas receiving light transmitted through the photographing lens;
A first image acquisition function for acquiring an image focused in the in-focus area selected by the AF control function as a first image by photographing;
A second image acquisition function for acquiring a second image obtained by reducing the image size from the first image;
A scene determination processing function for performing a shooting scene determination process based on the second image;
A gradation processing condition setting function for setting a gradation processing condition for the first image based on a scene determination result obtained by the scene determination processing function;
The scene discrimination processing function further includes
A scene determination process is performed based on a focus area selection result by the AF control function at the time of shooting the first image.
An image processing program characterized by that.
前記シーン判別処理機能は、
前記第2の画像の画像データについて色情報を取得し、
取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出機能と、
前記AF制御機能による合焦エリアの選定結果に基づいて、前記画像データの画面を分割する画角を決定する分割画角決定機能と、
前記取得された色情報に基づいて、前記画像データを前記分割画角決定機能により決定された画角と明度との組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出機能と、
前記第1の占有率に予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出機能と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出機能と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出機能と、
少なくとも前記画像データの所定の部分における肌色の平均輝度に、予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出機能と、
前記指標1、前記指標2、前記指標3、及び前記指標4に基づいて、前記画像データのシーンを特定するシーン判別機能と、を有する、
ことを特徴とする請求項9に記載の画像処理プログラム。
The scene discrimination processing function is
Obtaining color information for the image data of the second image;
Based on the acquired color information, the image data is classified into a class composed of a combination of a predetermined brightness and hue, and a first occupancy ratio indicating a proportion of the entire image data for each classified class A first occupancy ratio calculating function for calculating
A divided angle-of-view determination function for determining an angle of view for dividing the screen of the image data, based on a focus area selection result by the AF control function;
Based on the acquired color information, the image data is classified into classes composed of combinations of field angles and brightness determined by the divided field angle determination function, and the entire image data is classified into the classified classes. A second occupancy ratio calculating function for calculating a second occupancy ratio indicating a 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 the average brightness of the skin color at least in a predetermined portion of the image data by a preset fourth coefficient;
A scene determination function for specifying a scene of the image data based on the index 1, the index 2, the index 3, and the index 4.
The image processing program according to claim 9.
前記階調処理条件設定機能は、
前記第2の画像に基づき階調調整パラメータを算出する階調調整パラメータ算出機能を有し、
前記シーン判別処理機能によるシーン判別結果と前記階調調整パラメータ算出機能により算出された前記階調調整パラメータとに基づき、前記第1の画像に対する階調処理条件を設定する、
ことを特徴とする請求項9または10に記載の画像処理プログラム。
The gradation processing condition setting function is
A gradation adjustment parameter calculation function for calculating a gradation adjustment parameter based on the second image;
Setting a gradation processing condition for the first image based on a scene determination result by the scene determination processing function and the gradation adjustment parameter calculated by the gradation adjustment parameter calculation function;
The image processing program according to claim 9 or 10, characterized in that
前記階調処理条件設定機能により設定された階調処理条件に基づき、前記第1の画像に対する階調変換処理を行う階調変換処理機能を有する、
ことを特徴とする請求項9乃至11の何れか1項に記載の画像処理プログラム。
Having a gradation conversion processing function for performing gradation conversion processing on the first image based on the gradation processing conditions set by the gradation processing condition setting function;
12. The image processing program according to claim 9, wherein the image processing program is any one of claims 9 to 11.
JP2006016133A 2006-01-25 2006-01-25 Imaging apparatus, image processing method, and image processing program Pending JP2007201679A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006016133A JP2007201679A (en) 2006-01-25 2006-01-25 Imaging apparatus, image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006016133A JP2007201679A (en) 2006-01-25 2006-01-25 Imaging apparatus, image processing method, and image processing program

Publications (1)

Publication Number Publication Date
JP2007201679A true JP2007201679A (en) 2007-08-09

Family

ID=38455827

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006016133A Pending JP2007201679A (en) 2006-01-25 2006-01-25 Imaging apparatus, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP2007201679A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9253336B2 (en) 2013-11-13 2016-02-02 Fuji Xerox Co., Ltd. Image reading apparatus, and image reading method
JP2020072391A (en) * 2018-10-31 2020-05-07 キヤノン株式会社 Imaging apparatus and control method of imaging apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9253336B2 (en) 2013-11-13 2016-02-02 Fuji Xerox Co., Ltd. Image reading apparatus, and image reading method
JP2020072391A (en) * 2018-10-31 2020-05-07 キヤノン株式会社 Imaging apparatus and control method of imaging apparatus
JP7242247B2 (en) 2018-10-31 2023-03-20 キヤノン株式会社 IMAGING DEVICE AND METHOD OF CONTROLLING IMAGING DEVICE

Similar Documents

Publication Publication Date Title
AU2016200002B2 (en) High dynamic range transition
JP4862930B2 (en) Image processing apparatus, image processing method, and program
US8797423B2 (en) System for and method of controlling a parameter used for detecting an objective body in an image and computer program
EP2608527B1 (en) Image pickup apparatus, control method for image pickup apparatus, and storage medium
JP2006352795A (en) Imaging apparatus and image processing method
JP2007184888A (en) Imaging apparatus, image processor, image processing method, and image processing program
JP2006333205A (en) Imaging apparatus, image processing method and image processing program
JP4349380B2 (en) IMAGING DEVICE, METHOD FOR OBTAINING IMAGE
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
JP2007288245A (en) Imaging apparatus, image processing method, and image processing program
JP2007312294A (en) Imaging apparatus, image processor, method for processing image, and image processing program
JP2007184887A (en) Image pickup device, image processor, image processing method and image processing program
JP2007201679A (en) Imaging apparatus, image processing method, and image processing program
JP2007243556A (en) Imaging apparatus, image processing method, and image processing program
JP2007195097A (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
JP2006190154A (en) Image processing method, image processor, image processing program and imaging device
JP2007300348A (en) Imaging apparatus, and image processing method, and image processing program
JP2007188464A (en) Imaging apparatus, image processor, image processing method, and image processing program
JP2007228132A (en) Imaging apparatus, image processing apparatus, 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