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

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

Info

Publication number
JP2007228132A
JP2007228132A JP2006045082A JP2006045082A JP2007228132A JP 2007228132 A JP2007228132 A JP 2007228132A JP 2006045082 A JP2006045082 A JP 2006045082A JP 2006045082 A JP2006045082 A JP 2006045082A JP 2007228132 A JP2007228132 A JP 2007228132A
Authority
JP
Japan
Prior art keywords
index
image
calculating
occupancy
coefficient
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
JP2006045082A
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 JP2006045082A priority Critical patent/JP2007228132A/en
Publication of JP2007228132A publication Critical patent/JP2007228132A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an imaging apparatus capable of automatically setting correction processing conditions by discriminating picked-up images per scene, and applying more properly corrected images by applying correction considering the condition where halation occurs, and to provide an image processing apparatus, an image processing method and an image processing program. <P>SOLUTION: An index for predicting the condition where the halation occurs in correction processing, on the basis of distribution of a high-intensity portion in positions in a screen, and the set correction processing conditions are re-corrected, depending on the index. In this way, even in a situation where halation may occur, correction can be added in the direction of suppressing the halation, thereby acquiring a more properly corrected image. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

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

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

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

またそれ以外にも、例えば、逆光状態での撮影や、フラッシュを使用した近接撮影など、撮影時の光源状態の影響で、画像内で大きな輝度の偏りが生じている場合には、そのままでは鑑賞目的として適切な画像とはいえず、何らかの補正処理を行うことが望ましい。   In addition, if there is a large luminance 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.

このような問題点を解決するために、従来より階調変換処理などの補正処理が行われており、その補正処理を決める方法については種々の提案がなされている(例えば、特許文献1、及び2参照)。   In order to solve such problems, correction processing such as gradation conversion processing has been performed conventionally, and various proposals have been made regarding methods for determining the correction processing (for example, Patent Document 1 and 2).

例えば特許文献1には、プリンターでのDSC撮影画像出力の際、画像データを解析することにより画像のシーンを判別し、画像シーンに応じて最適な画像処理を自動的に施す方法が記載されている。   For example, Patent Document 1 describes a method of discriminating an image scene by analyzing image data when a DSC photographed image is output by a printer, and automatically performing optimum image processing according to the image scene. Yes.

また特許文献2には、DSC撮影時に分割測光結果から画面内コントラストの強弱や輝度分布状態などの被写体情報を得て、この被写体情報に応じてDSC内での撮影画像データの階調補正を決める方法が記載されている。   Further, Patent Document 2 obtains subject information such as in-screen contrast strength and luminance distribution state from the divided photometry result at the time of DSC photographing, and determines gradation correction of photographed image data in the DSC according to the subject information. A method is described.

また特許文献3には、デジタル画像中から肌色画素を検出し、肌色画素の統計量に基づいて算出された階調変換量を画像に適用し、画像の明度を改善する方法が記載されている。
特開2000−134467号公報 特開2001−54014号公報 特開2003−108988号公報
Japanese Patent Application Laid-Open No. 2005-228561 describes a method for improving the brightness of an image by detecting skin color pixels from a digital image and applying a gradation conversion amount calculated based on the statistics of the skin color pixels to the image. .
JP 2000-134467 A JP 2001-54014 A JP 2003-108988 A

特許文献1、及び特許文献2記載の方法は、撮影された画像の輝度とその分布からシーン判別する、あるいは直接補正方法を求めるなどの処理を行うことで、自動的に撮影画像の補正を行うことができる。また特許文献3に記載の方法は、被写体としての人物と肌の要素に着目し、その明るさを改善しようとしている。しかしながらいずれの場合も、撮影シーンの状況によっては、補正によりかえって画像中の明るさのバランスを損なったりする場合もある。   The methods described in Patent Literature 1 and Patent Literature 2 automatically correct a captured image by performing processing such as scene discrimination from the brightness and distribution of the captured image or obtaining a direct correction method. be able to. Further, the method described in Patent Document 3 focuses on the person and skin elements as subjects and attempts to improve the brightness. However, in either case, depending on the situation of the photographic scene, the brightness balance in the image may be lost due to the correction.

例えば、一般的な画像では、鑑賞時に最も注目されるのは人物の顔であり、人物の顔などの主要被写体の明るさと画像全体の明るさが適正にバランスされていることが重要である。   For example, in a general image, a person's face is most noticed during viewing, and it is important that the brightness of the main subject such as the person's face and the brightness of the entire image are properly balanced.

しかしながら上記のような方法のみでは、補正した画像において画像中の白飛びしている面積が大きくなったり、白飛びが主要被写体部で起こってしまったりすることがあり、結果的に撮影者の意図を反映した画像を得ることができず、かえって好ましくない画像になってしまう場合がある。   However, with only the method described above, the area of whiteout in the corrected image may become large, or whiteout may occur in the main subject portion, resulting in the intention of the photographer. In some cases, an image reflecting the above cannot be obtained, and an unfavorable image may be obtained.

本発明の目的は、撮影された画像の撮影シーンを判別することによって、自動的に補正処理条件を設定するとともに、さらに画像データに基づいて白飛びの発生状況を考慮した補正を加えることで、より適切な補正画像を得ることのできる撮像装置、画像処理装置、画像処理方法、及び画像処理プログラムを提供することである。   An object of the present invention is to automatically set a correction processing condition by determining a photographing scene of a photographed image, and to add correction considering the occurrence of overexposure based on image data, To provide an imaging apparatus, an image processing apparatus, an image processing method, and an image processing program capable of obtaining a more appropriate corrected image.

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

1. 撮影により取得された画像の画像データに基づき撮影シーンの判別処理を行うシーン判別処理手段と、前記シーン判別処理手段によって得られたシーン判別結果に基づき、前記画像に対する階調処理条件を設定する階調処理条件設定手段と、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、前記第1の占有率算出手段により算出された第1の占有率のうち、少なくとも画面中央部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、を有し、前記階調処理条件設定手段は、前記シーン判別結果に基づく階調処理条件の設定を、前記第1の指標算出手段により算出された指標1に基づき補正する、ことを特徴とする撮像装置。   1. A scene discrimination processing unit that performs a scene determination process based on image data of an image obtained by shooting, and a gradation setting condition for the image based on the scene determination result obtained by the scene determination processing unit. A first occupancy ratio that classifies the image data into a class composed of a combination of a distance from the outer edge of the screen and a brightness, and indicates a ratio of the entire image data for each classified class Of the first occupancy ratio calculated by the first occupancy ratio calculation means and the first occupancy ratio calculation means, the occupancy ratio for the class consisting of a combination of at least the center portion of the screen and high brightness, A first index calculation unit that calculates index 1 by multiplying a preset first coefficient, wherein the gradation processing condition setting unit is configured to perform the scene determination. The setting of the gradation processing condition based on results, corrected based on the indices 1 calculated by the first index calculating means, the image pickup apparatus, characterized in that.

2. 撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得手段を有し、前記シーン判別処理手段は、前記第2の画像取得手段により取得された前記第2の画像の画像データに基づき、撮影シーンの判別処理を行う、ことを特徴とする1に記載の撮像装置。   2. A second image acquisition unit configured to acquire a second image obtained by reducing the image size from the first image acquired by photographing, wherein the scene determination processing unit is acquired by the second image acquisition unit; 2. The imaging apparatus according to 1, wherein a shooting scene discrimination process is performed based on the image data of the second image.

3. 前記第1の占有率算出手段は、前記第2の画像取得手段により取得された第2の画像の画像データから前記第1の占有率を算出する、ことを特徴とする2に記載の撮像装置。   3. The imaging apparatus according to 2, wherein the first occupancy rate calculating unit calculates the first occupancy rate from image data of the second image acquired by the second image acquisition unit. .

4. 前記シーン判別処理手段は、前記第2の画像の画像データについて色情報を取得し、取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、前記第1の占有率算出手段により算出された第1の占有率に、予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、前記第2の占有率に予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出手段と、少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、指標5を算出する第5の指標算出手段と、前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、指標6を算出する第6の指標算出手段と、前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、指標7を算出する第7の指標算出手段と、前記指標5、前記指標6、及び前記指標7に基づき、前記画像データのシーンを特定するシーン判別手段と、を有する、ことを特徴とする2または3に記載の撮像装置。   4). 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 classified class, a second occupancy ratio calculating unit that calculates a second occupancy ratio indicating a ratio of the entire image data, and a first occupancy ratio calculated by the first occupancy ratio calculator By multiplying the rate by a second coefficient set in advance, second index calculation means for calculating index 2 and by multiplying the second occupancy by a preset third coefficient A third index calculating means for calculating the index 3, a fourth index calculating means for calculating the index 4 by multiplying the second occupancy by a preset fourth coefficient, and at least the In the center of the image data screen A fifth index calculating means for calculating the index 5 by multiplying the average luminance of the skin color by a fifth coefficient set in advance, and at least one of the index 2, the index 3, and the index 4 Sixth index calculation means for calculating index 6 by multiplying one or more indices by a preset sixth coefficient, and at least one or more of index 2, index 3, and index 4 A seventh index calculating means for calculating the index 7 by multiplying the index of the index by a preset seventh coefficient, and the scene of the image data based on the index 5, the index 6 and the index 7 The imaging apparatus according to 2 or 3, further comprising: a scene determination unit that identifies

5. 前記第1の指標算出手段は、前記第1の占有率算出手段により算出された第1の占有率のうち、さらに画面外縁部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第8の係数を乗算することにより指標1を算出する、ことを特徴とする1乃至4の何れか1項に記載の撮像装置。   5. The first index calculation means is set in advance to an occupancy ratio for a class composed of a combination of a screen outer edge portion and high brightness among the first occupancy ratio calculated by the first occupancy ratio calculation means. The imaging apparatus according to any one of 1 to 4, wherein the index 1 is calculated by multiplying the eighth coefficient.

6. 撮影された画像の画像データに基づき撮影シーンの判別処理を行うシーン判別処理手段と、前記シーン判別処理手段によって得られたシーン判別結果に基づき、前記画像に対する階調処理条件を設定する階調処理条件設定手段と、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、前記第1の占有率算出手段により算出された第1の占有率のうち、少なくとも画面中央部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、を有し、前記階調処理条件設定手段は、前記シーン判別結果に基づく階調処理条件の設定を、前記第1の指標算出手段により算出された指標1に基づき補正する、ことを特徴とする画像処理装置。   6). A scene discrimination processing unit that performs a scene determination process based on image data of a photographed image, and a gradation process that sets a gradation processing condition for the image based on a scene discrimination result obtained by the scene discrimination processing unit The condition setting means and the image data are classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness, and a first occupancy ratio indicating a ratio of the entire image data is calculated for each classified class. The first occupancy ratio calculating means and the first occupancy ratio calculated by the first occupancy ratio calculating means are set in advance to an occupancy ratio for at least a class consisting of a combination of the screen center and high brightness. A first index calculation means for calculating index 1 by multiplying the first coefficient, and the gradation processing condition setting means is based on the scene discrimination result. The setting of the gradation processing condition is corrected based on the calculated index 1 by the first index calculating means, that the image processing apparatus according to claim.

7. 撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得手段を有し、前記シーン判別処理手段は、前記第2の画像取得手段により取得された前記第2の画像の画像データに基づき、撮影シーンの判別処理を行う、ことを特徴とする6に記載の画像処理装置。   7). A second image acquisition unit configured to acquire a second image obtained by reducing the image size from the first image acquired by photographing, wherein the scene determination processing unit is acquired by the second image acquisition unit; 7. The image processing apparatus according to 6, wherein a scene determination process is performed based on the image data of the second image.

8. 前記第1の占有率算出手段は、前記第2の画像取得手段により取得された第2の画像の画像データから前記第1の占有率を算出する、ことを特徴とする7に記載の画像処理装置。   8). 8. The image processing according to claim 7, wherein the first occupancy rate calculating unit calculates the first occupancy rate from image data of the second image acquired by the second image acquisition unit. apparatus.

9. 前記シーン判別処理手段は、前記第2の画像の画像データについて色情報を取得し、取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、前記第1の占有率算出手段により算出された第1の占有率に、予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、前記第2の占有率に予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出手段と、少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、指標5を算出する第5の指標算出手段と、前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、指標6を算出する第6の指標算出手段と、前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、指標7を算出する第7の指標算出手段と、前記指標5、前記指標6、及び前記指標7に基づき、前記画像データのシーンを特定するシーン判別手段と、を有する、ことを特徴とする7または8に記載の画像処理装置。   9. 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 classified class, a second occupancy ratio calculating unit that calculates a second occupancy ratio indicating a ratio of the entire image data, and a first occupancy ratio calculated by the first occupancy ratio calculator By multiplying the rate by a second coefficient set in advance, second index calculation means for calculating index 2 and by multiplying the second occupancy by a preset third coefficient A third index calculating means for calculating the index 3, a fourth index calculating means for calculating the index 4 by multiplying the second occupancy by a preset fourth coefficient, and at least the In the center of the image data screen A fifth index calculating means for calculating the index 5 by multiplying the average luminance of the skin color by a fifth coefficient set in advance, and at least one of the index 2, the index 3, and the index 4 Sixth index calculation means for calculating index 6 by multiplying one or more indices by a preset sixth coefficient, and at least one or more of index 2, index 3, and index 4 A seventh index calculating means for calculating the index 7 by multiplying the index of the index by a preset seventh coefficient, and the scene of the image data based on the index 5, the index 6 and the index 7 The image processing apparatus according to 7 or 8, further comprising: a scene determination unit that identifies

10. 前記第1の指標算出手段は、前記第1の占有率算出手段により算出された第1の占有率のうち、さらに画面外縁部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第8の係数を乗算することにより指標1を算出する、ことを特徴とする6乃至9の何れか1項に記載の画像処理装置。   10. The first index calculation means is set in advance to an occupancy ratio for a class composed of a combination of a screen outer edge portion and high brightness among the first occupancy ratio calculated by the first occupancy ratio calculation means. The image processing apparatus according to any one of 6 to 9, wherein the index 1 is calculated by multiplying the eighth coefficient.

11. 撮影された画像の画像データに基づき撮影シーンの判別処理を行うシーン判別処理工程と、前記シーン判別処理工程によって得られたシーン判別結果に基づき、前記画像に対する階調処理条件を設定する階調処理条件設定工程と、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出工程と、前記第1の占有率算出手段において算出された第1の占有率のうち、少なくとも画面中央部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出工程と、を備え、前記階調処理条件設定工程では、前記シーン判別結果に基づく階調処理条件の設定を、前記第1の指標算出工程において算出された指標1に基づき補正する、ことを特徴とする画像処理方法。   11. A scene determination processing step for performing a shooting scene determination process based on image data of a photographed image, and a gradation process for setting a gradation processing condition for the image based on a scene determination result obtained by the scene determination processing step The condition setting step and the image data are classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness, and a first occupancy ratio indicating a ratio of the entire image data is calculated for each classified class. Among the first occupancy ratios calculated by the first occupancy ratio calculating step and the first occupancy ratio calculating means, the occupancy ratio is set in advance for an occupancy ratio for a class composed of a combination of at least the screen center and high brightness. A first index calculation step of calculating the index 1 by multiplying the first coefficient that has been performed, and in the gradation processing condition setting step, the scene determination result The setting of the brute gradation processing condition is corrected based on the indices 1 calculated in the first index calculating step, an image processing method, characterized in that.

12. 撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得工程を備え、前記シーン判別処理工程は、前記第2の画像取得工程において取得された前記第2の画像の画像データに基づき、撮影シーンの判別処理を行う、ことを特徴とする11に記載の画像処理方法。   12 A second image acquisition step of acquiring a second image obtained by reducing the image size from the first image acquired by photographing, wherein the scene discrimination processing step is acquired in the second image acquisition step; 12. The image processing method according to 11, wherein a photographic scene discrimination process is performed based on the image data of the second image.

13. 前記第1の占有率算出工程では、前記第2の画像取得工程において取得された第2の画像の画像データから前記第1の占有率を算出する、ことを特徴とする12に記載の画像処理方法。   13. 13. The image processing according to 12, wherein the first occupancy ratio calculating step calculates the first occupancy ratio from image data of the second image acquired in the second image acquisition step. Method.

14. 前記シーン判別処理工程は、前記第2の画像の画像データについて色情報を取得し、取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出工程と、前記第1の占有率算出工程において算出された第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出工程と、前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出工程と、前記第2の占有率に予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出工程と、少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、指標5を算出する第5の指標算出工程と、前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、指標6を算出する第6の指標算出工程と、前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、指標7を算出する第7の指標算出工程と、前記指標5、前記指標6、及び前記指標7に基づき、前記画像データのシーンを特定するシーン判別工程と、を備える、ことを特徴とする12または13に記載の画像処理方法。   14 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 classified class, a second occupancy ratio calculating step for calculating a second occupancy ratio indicating a ratio of the entire image data, and a first occupancy calculated in the first occupancy ratio calculation step By multiplying the rate by a second coefficient set in advance, a second index calculation step for calculating index 2 and multiplying the second occupancy by a preset third coefficient, A third index calculating step for calculating the index 3, a fourth index calculating step for calculating the index 4 by multiplying the second occupancy by a preset fourth coefficient, and at least the image In the center of the data screen A fifth index calculation step of calculating the index 5 by multiplying the average brightness of the skin color by a fifth coefficient set in advance, and at least one of the index 2, the index 3, and the index 4 A sixth index calculating step of calculating index 6 by multiplying at least one index by a preset sixth coefficient, and at least one of index 2, index 3, and index 4 A seventh index calculating step of calculating the index 7 by multiplying the index of the index by a preset seventh coefficient, and the scene of the image data based on the index 5, the index 6 and the index 7 The image processing method according to 12 or 13, further comprising: a scene determination step for specifying

15. 前記第1の指標算出工程は、前記第1の占有率算出工程において算出された第1の占有率のうち、さらに画面外縁部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第8の係数を乗算することにより指標1を算出する、ことを特徴とする11乃至14の何れか1項に記載の画像処理方法。   15. The first index calculation step is preset to an occupancy rate for a class composed of a combination of the outer edge of the screen and high brightness among the first occupancy rates calculated in the first occupancy rate calculation step. 15. The image processing method according to any one of 11 to 14, wherein the index 1 is calculated by multiplying the eighth coefficient.

16. コンピュータに画像処理を実行させるための画像処理プログラムであって、撮影された画像の画像データに基づき撮影シーンの判別処理を行うシーン判別処理機能と、前記シーン判別処理機能によって得られたシーン判別結果に基づき、前記画像に対する階調処理条件を設定する階調処理条件設定機能と、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出機能と、前記第1の占有率算出機能により算出された第1の占有率のうち、少なくとも画面中央部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出機能と、を有し、前記階調処理条件設定機能は、前記シーン判別結果に基づく階調処理条件の設定を、前記第1の指標算出機能により算出された指標1に基づき補正する、ことを特徴とする画像処理プログラム。   16. An image processing program for causing a computer to execute image processing, a scene determination processing function for performing a scene determination processing process based on image data of a captured image, and a scene determination result obtained by the scene determination processing function And a gradation processing condition setting function for setting gradation processing conditions for the image, and classifying the image data into a class composed of a combination of a distance from the outer edge of the screen and brightness, and for each of the classified classes, Of the first occupancy ratio calculating function for calculating a first occupancy ratio indicating the ratio of the entire image data, and the first occupancy ratio calculated by the first occupancy ratio calculation function, at least the center portion of the screen The first index calculation for calculating index 1 by multiplying the occupancy ratio for the class consisting of the combination of the brightness and the high brightness by a preset first coefficient The gradation processing condition setting function corrects the setting of the gradation processing condition based on the scene discrimination result based on the index 1 calculated by the first index calculation function. A characteristic image processing program.

17. 撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得機能を有し、前記シーン判別処理機能は、前記第2の画像取得機能により取得された前記第2の画像の画像データに基づき、撮影シーンの判別処理を行う、ことを特徴とする16に記載の画像処理プログラム。   17. A second image acquisition function for acquiring a second image obtained by reducing the image size from the first image acquired by shooting, wherein the scene determination processing function is acquired by the second image acquisition function; 17. The image processing program according to 16, wherein a shooting scene discrimination process is performed based on the image data of the second image.

18. 前記第1の占有率算出機能は、前記第2の画像取得機能により取得された第2の画像の画像データから前記第1の占有率を算出する、ことを特徴とする17に記載の画像処理プログラム。   18. 18. The image processing according to 17, wherein the first occupancy rate calculating function calculates the first occupancy rate from image data of the second image acquired by the second image acquisition function. program.

19. 前記シーン判別処理機能は、前記第2の画像の画像データについて色情報を取得し、取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出機能と、前記第1の占有率算出機能により算出された第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出機能と、前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出機能と、前記第2の占有率に予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出機能と、少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、指標5を算出する第5の指標算出機能と、前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、指標6を算出する第6の指標算出機能と、前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、指標7を算出する第7の指標算出機能と、前記指標5、前記指標6、及び前記指標7に基づき、前記画像データのシーンを特定するシーン判別機能と、を有する、ことを特徴とする17または18に記載の画像処理プログラム。   19. 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, a second occupancy ratio calculation function for calculating a second occupancy ratio indicating a ratio of the entire image data, and a first occupancy ratio calculated by the first occupancy ratio calculation function By multiplying the rate by a second coefficient preset, a second index calculation function for calculating index 2 and by multiplying the second occupancy by a preset third coefficient, A third index calculation function for calculating the index 3, a fourth index calculation function for calculating the index 4 by multiplying the second occupancy by a preset fourth coefficient, and at least the image In the center of the data screen At least one of the fifth index calculation function for calculating the index 5 by multiplying the average brightness of the skin color by a fifth coefficient set in advance, the index 2, the index 3, and the index 4 A sixth index calculation function for calculating index 6 by multiplying the above index by a preset sixth coefficient, and at least one of index 2, index 3, and index 4 Based on the seventh index calculation function for calculating the index 7 by multiplying the index by a preset seventh coefficient, the index 5, the index 6, and the index 7, the scene of the image data is calculated. The image processing program according to 17 or 18, further comprising a scene discrimination function to be specified.

20. 前記第1の指標算出機能は、前記第1の占有率算出機能により算出された第1の占有率のうち、さらに画面外縁部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第8の係数を乗算することにより指標1を算出する、ことを特徴とする16乃至19の何れか1項に記載の画像処理プログラム。   20. The first index calculation function is set in advance to an occupancy ratio for a class including a combination of a screen outer edge portion and high brightness among the first occupancy ratios calculated by the first occupancy ratio calculation function. The image processing program according to any one of 16 to 19, wherein the index 1 is calculated by multiplying the eighth coefficient.

本発明によれば、撮影された画像の撮影シーンを判別することによって、自動的に補正処理条件を設定するに当たり、画像補正時の白飛び発生状況を予測する要素として、画面内の位置における高明度部の分布に基づき、白飛び発生の状況を示す指標を算出し、設定した補正処理条件をその指標に応じて補正し直すことにより、白飛びの発生しそうな場合もそれを抑制する方向に補正を加えることができ、より適切な補正画像を得ることのできる撮像装置、画像処理装置、画像処理方法、及び画像処理プログラムが提供できる。   According to the present invention, when automatically setting correction processing conditions by determining a shooting scene of a shot image, high brightness at a position in the screen is used as an element for predicting the occurrence of whiteout at the time of image correction. Based on the distribution of the degree part, an index that indicates the occurrence of whiteout is calculated, and the correction processing conditions that have been set are corrected in accordance with the index, so that even if whiteout is likely to occur, it will be suppressed. An imaging apparatus, an image processing apparatus, an image processing method, and an image processing program that can add correction and obtain a more appropriate corrected image can be provided.

以下、図面を参照して、本発明の実施形態を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

(第1の実施形態)
まず、本発明に係る第1の実施形態(撮像装置)における構成について説明する。
(First embodiment)
First, the configuration of the first embodiment (imaging device) according to the present invention 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、撮影光学系23、タイミングジェネレータ41、シャッタユニット42、絞りユニット43、フォーカスユニット44、表示部27、操作部38、画像データ出力部37により構成される。またプロセッサ31には、撮影制御や撮影画像の処理を行う撮影処理部20と画像処理を行う画像処理部10がある。   FIG. 2 shows an internal configuration of the imaging apparatus 1. As shown in FIG. 2, the image pickup apparatus 1 includes a processor 31, a memory 32, an image pickup device 33 such as a CCD (Charge Coupled Device), a shooting optical system 23, a timing generator 41, a shutter unit 42, a diaphragm unit 43, and a focus unit 44. , A display unit 27, an operation unit 38, and an image data output unit 37. The processor 31 includes a photographing processing unit 20 that performs photographing control and 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に結像させる。フラッシュ24は、被写体輝度が低い時に、プロセッサ31からの制御信号により補助光を照射する。   The photographing optical system 23 includes a plurality of lenses, a lens barrel, and the like, and has a zoom function. The photographing optical system 23 causes the light received by the lens to form an image on the image sensor 33. The flash 24 emits auxiliary light by a control signal from the processor 31 when the subject brightness is low.

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

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

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

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

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

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

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

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

(撮影処理部20の内部構成)
図3に、撮影処理部20の内部構成を示す。撮影処理部20は、撮影時に撮影条件に関わる制御や、撮影された画像の処理を行う。図3を用いて、撮影処理部20の内部構成を説明する。
(Internal configuration of the imaging processing unit 20)
FIG. 3 shows an internal configuration of the imaging processing unit 20. The shooting processing unit 20 performs control related to shooting conditions during shooting and processing of shot images. 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).

このように撮影時に露光量制御が行われることで、撮影者は任意の、あるいは既定の、絞り値とシャッタ速度の組み合わせで、撮影画像に対する露光量設定を自動的に行うことができる。また被写体輝度が低く、既定の絞り値とシャッタ速度の組み合わせで所定の露光量が得られない場合は、フラッシュモードに応じて、フラッシュ24は、プロセッサ31からの制御信号により補助光を照射する。   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. If the subject brightness is low and a predetermined exposure value cannot be obtained with a combination of a predetermined aperture value and shutter speed, the flash 24 emits auxiliary light according to a control signal from the processor 31 according to the flash mode.

AF制御部52は、画像撮影時に画像の焦点を合わせる自動制御を行う。この合焦点制御は、例えば以下のように撮影光学系を駆動することで合焦点位置を検知し、その位置に合わせて停止させることで行われる(図6のフローチャート参照)。   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 as described below to detect the in-focus position and stopping it according to the position (see the flowchart in FIG. 6).

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

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

画素補間部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.

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

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

第1画像取得部101は、レリーズボタン28が全押しされたタイミングで、撮像素子33に写った最新の画像の画像データを第1の画像として取得する。取得した第1の画像の画像データはメモリ32に保持される。   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. The acquired image data of the first image is held in the memory 32.

第2画像取得部102は、取得した第1の画像を、N×M個の矩形の領域(垂直方向にM個及び水平方向にN個に分割された領域)に分割する。図12(a)に、第1の画像の一例を示し、図12(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. 12A shows an example of the first image, and FIG. 12B 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.

第1占有率算出部103aは、画像データ、すなわち画像を構成する各画素に対して、色情報を取得する。取得された色情報に基づいて、画像の各画素を、画面の外縁からの距離と明度の組み合わせからなる所定の階級に分類し(図16参照)、分類された階級毎に、当該階級に属する画素が画像全体に占める割合を示す第1の占有率を算出する。すなわち、第1占有率算出部103aは第1の占有率算出手段として機能する。   The first occupancy rate calculation unit 103a acquires color information for each piece of image data, that is, 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 the distance from the outer edge of the screen and the brightness (see FIG. 16), and each classified class belongs to the class. A first occupation ratio indicating a ratio of pixels to the entire image is calculated. That is, the first occupancy rate calculation unit 103a functions as a first occupancy rate calculation unit.

また、第2占有率算出部103bは、各画素を、明度と色相の組み合わせからなる所定の階級に分類し(図17参照)、分類された階級毎に、当該階級に属する画素が画像全体に占める割合を示す第2の占有率を算出する。すなわち、第2占有率算出部103bは第2の占有率算出手段として機能する。   In addition, the second occupancy rate calculation unit 103b classifies each pixel into a predetermined class composed of a combination of brightness and hue (see FIG. 17), and for each classified class, the pixels belonging to the class are included in the entire image. A second occupation ratio indicating the occupation ratio is calculated. That is, the second occupancy rate calculation unit 103b functions as a second occupancy rate calculation unit.

第1占有率算出部103a及び第2占有率算出部103bにおいて実行される占有率算出処理については、後に図15を参照して詳細に説明する。   The occupation rate calculation processing executed in the first occupation rate calculation unit 103a and the second occupation rate calculation unit 103b will be described in detail later with reference to FIG.

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

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

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

また、指標算出部104は、画像の画面中央部における肌色領域の平均輝度値(指標9とする)と、指標2及び指標3に、それぞれ、撮影条件に応じて予め設定された係数を乗算して和をとることにより、新たな指標6を算出する。すなわち、指標算出部104は第6の指標算出手段として機能する。   In addition, the index calculation unit 104 multiplies the average luminance value of the skin color area (referred to as index 9) in the center of the screen of the image, and the index 2 and the index 3, respectively, by coefficients set in advance according to the shooting conditions. The new index 6 is calculated by taking the sum. That is, the index calculation unit 104 functions as a sixth index calculation unit.

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

指標算出部104において実行される指標算出処理については、後に図18を参照して詳細に説明する。   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.

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

第1指標算出部106は、第1占有率算出部103aで算出された第1の占有率に、撮影条件に応じて予め設定された係数を乗算することにより、階調処理条件を補正するための指標1を算出する。すなわち、第1指標算出部106は第1の指標算出手段として機能する。第1の指標算出処理については、後に図24(a)を参照して説明する。   The first index calculator 106 corrects the gradation processing condition by multiplying the first occupancy calculated by the first occupancy calculator 103a by a coefficient set in advance according to the shooting condition. The index 1 is calculated. That is, the first index calculation unit 106 functions as a first index calculation unit. The first index calculation process will be described later with reference to FIG.

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

また、階調処理条件設定部107は、指標算出部104で算出された各指標に基づいて、第1の画像に対する階調調整のための階調調整パラメータを算出し、さらに階調変換量を決定する。階調処理条件の設定については、後に図24(b)を参照して詳細に説明する。   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, and further calculates a gradation conversion amount. decide. 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 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 photographing object is referred to as “main subject”.

まず、図13のフローチャートを参照して、撮像装置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.

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

AWB処理の後、第1の画像の画像データは、一方で複数の分割領域からなる分割画像、すなわち第2の画像として取得される(ステップS7)。分割画像の各分割領域は第2の画像の画素であり、第2の画像は第1の画像のサイズを縮小した画像となる。図12(a)に、第1の画像の一例を示し、図12(b)に、当該第1の画像が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. 12A shows an example of the first image, and FIG. 12B 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.

第1の占有率算出工程であるステップS8では、第2の画像に対して第1の占有率が算出される。但し、画像データは必ずしも第2の画像である必要はない。撮影により取得された第1の画像の画像データを用いてもかまわない。第1の占有率算出処理については、後で図15を参照して説明する。   In step S8, which is the first occupancy rate calculation step, the first occupancy rate is calculated for the second image. However, the image data does not necessarily have to be the second image. You may use the image data of the 1st image acquired by imaging | photography. The first occupation rate calculation process will be described later with reference to FIG.

ステップS10では、ステップS8で算出された第1の占有率に基づいて、指標1が算出される。すなわち、ステップS10は第1の指標算出工程として機能する。指標1は後で、シーン判別結果により設定された階調処理条件を補正するのに用いられる。指標1の算出方法は、後で図24(a)を参照して説明する。   In step S10, index 1 is calculated based on the first occupation ratio calculated in step S8. That is, step S10 functions as a first index calculation step. The index 1 is used later to correct the gradation processing condition set by the scene discrimination result. A method for calculating the index 1 will be described later with reference to FIG.

次いで、シーン判別処理工程であるステップS9では、取得された第2の画像の画像データに基づいて、撮影シーンを判別するシーン判別処理が行われる。ステップS9における撮影シーン判別処理については、後に図14を参照して説明する。   Next, in step S9, which is a scene determination process 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 S9 will be described later with reference to FIG.

次いで、階調処理条件設定工程であるステップS11では、ステップS9のシーン判別処理で得られた各指標及び撮影シーンの判別結果に基づいて、第1の画像の階調変換処理のために必要な条件を設定する処理が行われる。またここで第1の指標算出工程で算出した指標1による階調変換量の調整が行われる。ステップS7の階調処理条件設定処理については、後に図24(b)を参照して説明する。   Next, in step S11 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 S9 and the determination result of the shooting scene. Processing for setting conditions is performed. Further, the gradation conversion amount is adjusted by the index 1 calculated in the first index calculation step. The gradation processing condition setting process in step S7 will be described later with reference to FIG.

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

ステップS13では、ステップS11で設定された階調処理条件に基づいて、撮影画像である第1の画像の画像データに対する階調変換処理が行われる。ガンマ変換はノンリニアの階調に変換したが、ステップS13の階調変換は撮影シーンの光源条件などによる階調への影響を補正するものであり、ステップS9でのシーン判別結果によりステップS11で設定した処理条件に基づき階調変換処理を行う。   In step S13, 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 in step S11. The gamma conversion is converted into a non-linear gradation, but the gradation conversion in step S13 is to correct the influence on the gradation due to the light source condition of the shooting scene, and is set in step S11 based on the scene discrimination result in step S9. A gradation conversion process is performed based on the processed conditions.

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

(シーン判別処理1のフロー)
次に、図14のフローチャート及び図15〜図23を参照して、撮像装置1での第1の占有率算出処理(図13のステップS8)及びシーン判別処理1(図13のステップS9)について説明する。以下の説明では、第1の占有率算出処理も含めてシーン判別処理という。
(Scene discrimination process 1 flow)
Next, referring to the flowchart of FIG. 14 and FIGS. 15 to 23, the first occupancy rate calculation process (step S8 in FIG. 13) and the scene determination process 1 (step S9 in FIG. 13) in the imaging apparatus 1 will be described. explain. In the following description, the scene determination process including the first occupancy rate calculation process will be referred to.

シーン判別処理は、図14に示すように、第1の占有率算出処理(ステップS20)、第2の占有率算出処理(ステップS21)、指標算出処理(ステップS22)、シーン判別(ステップS23)の各処理により構成される。以下、図15〜図23を参照して、図14に示す各処理について詳細に説明する。
<第1の占有率算出処理1>
まず、ステップS20では、第1の占有率算出処理が行われる。図15(a)のフローチャートを参照して、第1の占有率算出処理について説明する。
As shown in FIG. 14, the scene determination process includes a first occupancy ratio calculation process (step S20), a second occupancy ratio calculation process (step S21), an index calculation process (step S22), and a scene determination (step S23). It consists of each process. Hereinafter, with reference to FIGS. 15 to 23, each process illustrated in FIG. 14 will be described in detail.
<First Occupancy Calculation Processing 1>
First, in step S20, a first occupancy rate calculation process is performed. The first occupancy rate calculation process will be described with reference to the flowchart in FIG.

図15(a)のステップS30において、まず色空間変換処理が行われる。   In step S30 of FIG. 15A, color space conversion processing is first 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と定義している。   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)によって表現される色を用いてもよい。その際、本実施形態で記載する各種係数等の数値を、改めて算出し直すことは言うまでもない。ステップS30では、上記のようにして求められた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 S30, the values of H, S, and V obtained as described above are acquired as color information.

ステップS31では、まず、色空問変換処理で算出されたHSV値に基づいて、第2の画像の各画素が、画面の外縁からの距離と明度の組み合わせからなる所定の階級に分類され、分類された階級毎に累積画素数を算出することによって2次元ヒストグラムが作成される。   In step S31, first, each pixel of the second image is classified into a predetermined class composed of a combination of the distance from the outer edge of the screen and the brightness based on the HSV value calculated in the color sky conversion process. A two-dimensional histogram is created by calculating the cumulative number of pixels for each class.

図16(a)に、ステップS31において、第2の画像の画面の外縁からの距離に応じて分割された3つの領域n1〜n3を示す。領域n1が外枠であり、領域n2が外枠の内側の領域であり.領域n3が第2の画像の中央部の領域である。ここでn1〜n3は略同等の画素数となるように分割することが好ましい。また本実施形態においては3つの分割としたがこれに限定されるものではない。また、ステップS31において、明度(V)は、明度値が0〜5(v1)、6〜12(v2)、13〜24(v3)、25〜76(v4)、77〜109(v5)、110〜149(v6)、150〜255(v7)の7つの階級に分割される。図16に示すように、最も低明度の階級における明度の範囲よりも、最も高明度の階級における明度の範囲の方が広い。   FIG. 16A shows three regions n1 to n3 divided in accordance with the distance from the outer edge of the screen of the second image in step S31. 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, it is preferable that n1 to n3 are divided so as to have substantially the same number of pixels. In the present embodiment, three divisions are used, but the present invention is not limited to this. In step S31, the brightness (V) is 0 to 5 (v1), 6 to 12 (v2), 13 to 24 (v3), 25 to 76 (v4), 77 to 109 (v5), It is divided into seven classes of 110 to 149 (v6) and 150 to 255 (v7). As shown in FIG. 16, the brightness range in the highest brightness class is wider than the brightness range in the lowest brightness class.

図16(b)に、3つの領域n1〜n3と明度の組み合わせからなる階級を示す。図16(b)に示すように、第2の画像を画面の外縁からの距離と明度の組み合わせからなる階級に分類した場合の階級の数は3×7=21個となる。   FIG. 16B shows a class composed of combinations of three regions n1 to n3 and brightness. As shown in FIG. 16B, the number of classes when the second image is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness is 3 × 7 = 21.

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

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

Figure 2007228132
Figure 2007228132

<第2の占有率算出処理1>
次に、図14のステップS21では、第2の占有率算出処理が行われる。図15(b)のフローチャートを参照して、第2の占有率算出処理について説明する。
<Second Occupancy Calculation Processing 1>
Next, in step S21 of FIG. 14, a second occupancy rate calculation process is performed. The second occupancy rate calculation process will be described with reference to the flowchart in FIG.

図15(b)のステップS35において、第2の画像の各画素が、色相と明度の組み合わせからなる所定の階級に分類され、分類された階級毎に累積画素数を算出することによって2次元ヒストグラムが作成される。   In step S35 of FIG. 15B, each pixel of the second image is classified into a predetermined class composed of a combination of hue and brightness, and a cumulative pixel count is calculated for each classified class, thereby obtaining a two-dimensional histogram. Is created.

図17に、明度と色相の組み合わせからなる階級を示す。ステップS35では、明度は、上述のようにv1〜v7の7つの領域に分割するものとする。図17に示すように、最も低明度の階級における明度の範囲よりも、最も高明度の階級における明度の範囲の方が広い。   FIG. 17 shows a class composed of a combination of brightness and hue. In step S35, the lightness is divided into seven regions v1 to v7 as described above. As shown in FIG. 17, the brightness range in the highest brightness class is wider than the brightness range in the lowest brightness class.

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

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

ステップS35において2次元ヒストグラムが作成されると、明度と色相の組み合わせからなる所定の階級毎に算出された累積画素数の全画素数(N×M個)に占める割合を示す第1の占有率が算出され(ステップS36)、第2の占有率算出処理が終了する。すなわちステップS35とステップS36は第2の占有率算出工程として機能する。   When a two-dimensional histogram is created in step S35, the first occupancy ratio indicating the 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 S36), and the second occupancy rate calculation process ends. That is, step S35 and step S36 function as a second occupation rate calculation step.

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

Figure 2007228132
Figure 2007228132

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

まず、第2の指標算出工程であるステップS40では、占有率算出処理において階級毎に算出された第1の占有率に、撮影条件に応じて予め設定された係数(第2の係数)を乗算して和をとることにより、撮影シーンを特定するための指標2が算出される。指標2は、主要被写体がアンダーな逆光と主要被写体がオーバーな画像間における、画像データの画面の中心と外側の明暗関係の差異を示すものである。   First, in step S40, which is the second index calculation step, the first occupancy calculated for each class in the occupancy calculation processing is multiplied by a coefficient (second coefficient) set in advance according to the shooting conditions. Then, by taking the sum, the index 2 for specifying the shooting scene is calculated. The index 2 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.

以下、指標2の算出方法について説明する。   Hereinafter, a method for calculating the index 2 will be described.

表3に、指標2を算出するために必要な第2の係数を階級別に示す。表3に示された各階級の係数は、表1に示した各階級の第1の占有率Qijに乗算する重み係数であり、撮影条件に応じて予め設定されている。   Table 3 shows the second coefficient necessary for calculating the index 2 by class. The coefficient of each class shown in Table 3 is a weighting coefficient that is multiplied by the first occupation ratio Qij of each class shown in Table 1, and is set in advance according to the shooting conditions.

Figure 2007228132
Figure 2007228132

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

明度領域vi、画面領域njにおける第2の係数をEijとすると、指標2を算出するためのnk領域(画面領域nk)の和は、式(2)のように定義される。   If the second 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 2 is defined as shown in Expression (2).

Figure 2007228132
Figure 2007228132

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

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

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

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

指標2が算出されると、第3の指標算出工程であるステップS41で、占有率算出処理において階級毎に算出された第2の占有率に、撮影条件に応じて予め設定された第3の係数(第2の係数とは異なる係数)を乗算して和をとることにより、撮影シーンを特定するための指標3が算出される。指標3は、主要被写体のオーバー度を表す指標であり、「主要被写体がオーバー」と判別されるべき画像のみを他の撮影シーンから分離するためのものである。   When the index 2 is calculated, the third occupancy calculated in step S41, which is the third index calculation step, is set to the second occupancy calculated for each class in the occupancy ratio calculation process according to the shooting conditions. By multiplying the coefficient (coefficient different from the second coefficient) and taking the sum, the index 3 for specifying the shooting scene is calculated. The index 3 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.

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

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

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

Figure 2007228132
Figure 2007228132

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

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

Figure 2007228132
Figure 2007228132

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

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

Figure 2007228132
Figure 2007228132

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

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

Figure 2007228132
Figure 2007228132

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

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

指標4=H1領域の和+H2領域の和+H3領域の和+H4領域の和+1.7 (7)
指標3及び指標4は、第2の画像の明度と色相の分布量に基づいて算出されるため、画像がカラー画像である場合の撮影シーンの判別に有効である。
Index 4 = sum of H1 region + sum of H2 region + sum of H3 region + sum of H4 region + 1.7 (7)
Since the index 3 and the index 4 are calculated on the basis of 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.

指標2〜4が算出されると、第5の指標算出工程であるステップS43で、第2の画像の画面中央部における肌色の平均輝度値と、第2の画像の最大輝度値と平均輝度値との差分値のそれぞれに、撮影条件に応じて予め設定された係数を乗算することにより、撮影シーンを特定するための指標5が算出される。   When the indices 2 to 4 are calculated, the average brightness value of the skin color at the screen center 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 fifth index calculation step. The index 5 for specifying the shooting scene is calculated by multiplying each of the difference values by a coefficient preset in accordance with the shooting conditions.

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

まず、第2の画像のRGB(Red、Green、Blue)値から、式(A)を用いて輝度Yが算出される。次いで、第2の画像の画面中央部における肌色領域の平均輝度値x1が算出される(ステップS50)。ここで、画面中央部とは、例えば図16(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 at the center of the screen of the second image is calculated (step S50). Here, the center of the screen is an area constituted by, for example, the area n3 shown in FIG. 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 at the center of the screen 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の値の各々に、撮影条件に応じて予め設定された第5の係数を乗算して和をとることにより、指標5が算出され(ステップS55)、指標5算出処理が終了する。指標5は、下記の式(8−2)のように定義される。
x5 = (Yskin_max−Yskin_min) / 2−Yskin_ave
(8-1)
Next, the index 5 is calculated by multiplying each of the values x1 to x5 calculated in steps S50 to S54 by a fifth coefficient set in advance according to the shooting conditions to obtain a sum (step 5). S55), the index 5 calculation process ends. The index 5 is defined as the following formula (8-2).

指標5=0.05×x1+1.41×x2+(−0.01)×x3+(−0.01)
×x4+0.01×x5−5.34 (8−2)
この指標5は、第2の画像の画面の構図的な特徴だけでなく、輝度ヒストグラム分布情報を持ち合わせており、特に、主要被写体がオーバーである撮影シーンとアンダー撮影シーンの判別に有効である。
Index 5 = 0.05 × x1 + 1.41 × x2 + (− 0.01) × x3 + (− 0.01)
× x4 + 0.01 × x5−5.34 (8-2)
This index 5 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 a shooting scene from which the main subject is over and an under shooting scene.

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

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

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

第2の画像の画面中央部における肌色領域の平均輝度値を指標9とする。ここでの画面中央部とは、例えば、図16(a)の領域n2及び領域n3から構成される領域である。このとき、指標6は、指標3、指標2、指標9を用いて式(9)のように定義され、指標7は、指標4、指標2、指標9を用いて式(10)のように定義される。   The average luminance value of the skin color area in the center of the screen of the second image is set as an index 9. Here, the center of the screen is, for example, an area composed of the areas n2 and n3 in FIG. At this time, the index 6 is defined as in Expression (9) using the index 3, index 2, and index 9, and the index 7 is defined as in Expression (10) using the index 4, index 2, and index 9. Defined.

指標6=0.54×指標3+0.50×指標2+0.01×指標9−0.65 (9)
指標7=0.83×指標4+0.23×指標2+0.01×指標9−1.17(10)
なお、図22における平均輝度値(例えば、全体平均輝度値)の算出方法としては、撮像装置1の各受光部から得られた個別輝度データの単純な加算平均値を求めてもよいし、撮像装置1の測光方式としてよく用いられる中央重点平均測光に類似した、画面中心付近の受光部より得られた輝度データに重み付けを高く、画面の周辺付近の受光部より得られた輝度データに重み付けを低くして加算平均値を求める手法を用いてもよい。また、焦点検出領域に対応した受光部付近より得られた輝度データに重み付けを高くし、焦点検出位置から離れた受光部より得られた輝度データに重み付けを低くして加算平均値を求める手法等を用いてもよい。
<シーン判別1>
図14に戻って、シーン判別を説明する。
Index 6 = 0.54 × Index 3 + 0.50 × Index 2 + 0.01 × Index 9−0.65 (9)
Index 7 = 0.83 × Index 4 + 0.23 × Index 2 + 0.01 × Index 9-1.17 (10)
Note that, as a method of calculating the average luminance value (for example, the overall average luminance value) in FIG. 22, a simple addition average value of the individual luminance data obtained from each light receiving unit of the imaging device 1 may be obtained, or imaging is 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 1>
Returning to FIG. 14, the scene discrimination will be described.

指標5〜7が算出されると、これらの指標の値に基づいて撮影シーンが判別される(ステップS23)。表6に、指標5、指標6及び指標7の値による撮影シーンの判別内容を示す。   When the indices 5 to 7 are calculated, the shooting scene is determined based on the values of these indices (step S23). Table 6 shows the contents of the shooting scene discrimination according to the values of the index 5, the index 6, and the index 7.

Figure 2007228132
Figure 2007228132

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

(第1の指標算出処理のフロー)
次に、図24(a)のフローチャートを参照して、撮像装置1での第1の指標算出処理(図13のステップS10)について説明する。
(First index calculation process flow)
Next, the first index calculation process (step S10 in FIG. 13) in the imaging apparatus 1 will be described with reference to the flowchart in FIG.

第1の指標算出処理は、図13に示すように、第1の占有率算出処理(図13のステップS8)に引き続いて行われる。すなわち、第1の占有率に基づいて指標1を算出する。   As shown in FIG. 13, the first index calculation process is performed following the first occupancy ratio calculation process (step S8 in FIG. 13). That is, index 1 is calculated based on the first occupancy rate.

第1の占有率算出工程では、シーン判別処理の説明で述べたように、まず各画素が、画面の外縁からの距離と明度の組み合わせからなる所定の階級に分類され、分類された階級毎に累積画素数を算出することによって2次元ヒストグラムが作成される。   In the first occupancy ratio calculating step, as described in the description of the scene discrimination process, each pixel is first classified into a predetermined class consisting of a combination of the distance from the outer edge of the screen and the brightness, and for each classified class. A two-dimensional histogram is created by calculating the cumulative number of pixels.

図16(a)に、画像の画面の外縁からの距離に応じて分割された3つの領域n1〜n3を示した。領域n1が外枠であり、領域n2が外枠の内側の領域であり.領域n3が第2の画像の中央部の領域である。ここでn1〜n3は略同等の画素数となるように分割することが好ましい。また本実施形態においては3つの分割としたがこれに限定されるものではない。また、明度(V)は、明度値が0〜5(v1)、6〜12(v2)、13〜24(v3)、25〜76(v4)、77〜109(v5)、110〜149(v6)、150〜255(v7)の7つの階級に分割される。図16に示すように、最も低明度の階級における明度の範囲よりも、最も高明度の階級における明度の範囲の方が広い。   FIG. 16A shows three regions n1 to n3 divided according to the distance from the outer edge of the image screen. 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, it is preferable that n1 to n3 are divided so as to have substantially the same number of pixels. In the present embodiment, three divisions are used, but the present invention is not limited to this. In addition, the lightness (V) is 0-5 (v1), 6-12 (v2), 13-24 (v3), 25-76 (v4), 77-109 (v5), 110-149 ( v6), and is divided into seven classes of 150 to 255 (v7). As shown in FIG. 16, the brightness range in the highest brightness class is wider than the brightness range in the lowest brightness class.

図16(b)に、3つの領域n1〜n3と明度の組み合わせからなる階級を示す。図16(b)に示すように、第2の画像を画面の外縁からの距離と明度の組み合わせからなる階級に分類した場合の階級の数は3×7=21個となる。   FIG. 16B shows a class composed of combinations of three regions n1 to n3 and brightness. As shown in FIG. 16B, the number of classes when the second image is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness is 3 × 7 = 21.

上述のように、2次元ヒストグラムが作成されると、画面の外縁からの距離と明度の組み合わせからなる所定の階級毎に算出された累積画素数の全画素数に占める割合を示す第1の占有率が算出される。   As described above, when the two-dimensional histogram is created, the first occupation indicating the ratio of the cumulative number of pixels calculated for each predetermined class composed of the combination of the distance from the outer edge of the screen and the brightness to the total number of pixels. A rate is calculated.

そこで図24(a)に戻り、引き続く第1の指標算出工程(図13のステップS10)の説明をする。   Therefore, returning to FIG. 24A, the subsequent first index calculation step (step S10 in FIG. 13) will be described.

まず、図16(b)において、画面中央部をn3とn2の領域とし、高明度部をv7の領域とする。そうすると、v7でn2、またはv7でn3の組み合わせを合わせた階級は、画面中央部と高明度との組み合わせからなる階級であり、その階級についての第1の占有率を図に示したようにZ1とし、Z1を取得する(ステップS60)。   First, in FIG. 16B, the central portion of the screen is set as n3 and n2, and the high brightness portion is set as v7. Then, the class combining the combination of n2 in v7 or n3 in v7 is a class composed of a combination of the center of the screen and high brightness, and the first occupancy ratio for the class is Z1 as shown in the figure. And Z1 is acquired (step S60).

また図16(b)において、画面外縁部をn1の領域とし、高明度部をv7の領域とする。そうすると、v7でn1の組み合わせからなる階級は、画面外縁部と高明度との組み合わせからなる階級であり、その階級についての第1の占有率を図に示したようにZ2とし、Z2を取得する(ステップS61)。   In FIG. 16B, the outer edge of the screen is the n1 region, and the high brightness portion is the v7 region. Then, the class consisting of the combination of n1 in v7 is a class consisting of a combination of the outer edge of the screen and high brightness, and the first occupancy for that class is set to Z2 as shown in the figure, and Z2 is acquired. (Step S61).

Z1及びZ2は、Z1が大きく、Z2が小さいほど、画面全体に対して、画面中央部に高明度部が多い(すなわち、白飛びが起こりやすい)ことを表す因子となる。Z1のみで指標1を算出してもよいが、この二つの因子を元にして指標1を算出することで白飛び発生の予測精度を上げることができる。また、さらに次のようなZ3、Z4の因子を取得することが望ましい。   Z1 and Z2 are factors that indicate that as Z1 is larger and Z2 is smaller, there are more high-lightness portions in the center of the screen (that is, whiteout tends to occur) with respect to the entire screen. The index 1 may be calculated using only Z1, but by calculating the index 1 based on these two factors, it is possible to increase the prediction accuracy of occurrence of whiteout. Further, it is desirable to obtain the following factors of Z3 and Z4.

画面中央部(n3とn2)の肌色画素の最大明度をZ3とし、Z3を取得する(ステップS62)。また、画面中央部かつ高明度の組み合わせからなる階級(第1占有率がZ1で示される)での肌色画素占有率をZ4とし、Z4を取得する(ステップS63)。肌色の色情報としては、シーン判別処理のフローの占有率算出処理の説明で用いた肌色条件、すなわち式(A)及び式(1)を満たすものをここでも肌色と見なす。説明は省略する。   Z3 is acquired by setting the maximum brightness of the flesh color pixels at the center (n3 and n2) of the screen as Z3 (step S62). Further, Z4 is acquired by setting the skin color pixel occupancy rate in the center of the screen and the class (the first occupancy rate is indicated by Z1) consisting of a combination of high brightness as Z4 (step S63). As the skin color information, the skin color condition used in the description of the occupation rate calculation processing of the flow of the scene discrimination processing, that is, the one satisfying the formulas (A) and (1) is also regarded as the skin color here. Description is omitted.

Z4は、画面中央部に人物(特に顔)がある可能性の大きさを示し、Z3はその人物の顔がどのくらい明るいか(すなわち、白飛びが起こりやすいか)を示している。   Z4 indicates the size of the possibility that there is a person (particularly a face) in the center of the screen, and Z3 indicates how bright the face of the person is (that is, whether whiteout is likely to occur).

最後に、ステップS64において、ステップS60からS63で取得したZ1、Z2、Z3、Z4の各因子に基づいて、白飛び度(指標1)が算出される。このように、ステップS60からS64は第1の指標算出工程として機能する。   Finally, in step S64, the whiteout degree (index 1) is calculated based on the factors of Z1, Z2, Z3, and Z4 acquired in steps S60 to S63. Thus, steps S60 to S64 function as a first index calculation process.

白飛び度は、撮影シーンにより階調補正処理を行った場合に、画面中で白飛びする面積が大きくなったり、人物の顔などの主要被写体部で白飛びが起こったりすることを予測して、階調処理を抑制するための指標であり、後で述べる階調処理条件の設定を補正するために用いる。これにより、シーン判別処理工程による判別結果だけで階調処理条件設定するのに対して、特に人物の顔などの白飛びの発生を防止して、階調処理の設定をより適切な方向に補正することができる。   The degree of overexposure predicts that when the gradation correction processing is performed depending on the shooting scene, the overexposure area on the screen will increase, or overexposure will occur in the main subject area such as a human face. , Which is an index for suppressing gradation processing, and is used to correct the setting of gradation processing conditions described later. As a result, the gradation processing conditions are set based only on the discrimination result of the scene discrimination processing step, and in particular, the occurrence of overexposure such as a human face is prevented and the gradation processing setting is corrected in a more appropriate direction. can do.

指標1、すなわち白飛び度(W)は、上記で取得した因子、すなわち画面中央部かつ高明度の階級での第1の占有率Z1、画面外縁部かつ高明度の階級での第1の占有率Z2、画面中央部の階級での肌色画素の最大明度Z3、Z1占有率の中での肌色画素占有率Z4を用いて、各因子の一次結合で数値化する。例えば次の式のように構成する。   The index 1, that is, the whiteness (W) is the factor obtained above, that is, the first occupancy Z1 in the center of the screen and the high brightness class, the first occupancy in the outer edge of the screen and the high brightness class. Using the rate Z2, the maximum brightness Z3 of the flesh color pixel in the class at the center of the screen, and the flesh color pixel occupancy rate Z4 in the Z1 occupancy rate, numerical values are obtained by linear combination of each factor. For example, the following formula is used.

白飛び度(W)=Z1×a+Z2×b+Z3×c+Z4×d+定数×e
a、b、c、d、e、fは、所定の係数であり、各因子の数値化に応じて、予め実験的に定めておけばよい。但し、第1の係数であるaと第8の係数である係数bは、逆符号である。これは、Z1及びZ2が、Z1が大きく、Z2が小さいほど、画面全体に対して、画面中央部に高明度部が多い(すなわち、白飛びが起こりやすい)ことを表す因子であることによる。
Whiteness (W) = Z1 × a + Z2 × b + Z3 × c + Z4 × d + constant × e
“a”, “b”, “c”, “d”, “e”, and “f” are predetermined coefficients and may be experimentally determined in advance according to the numerical value of each factor. However, the first coefficient “a” and the eighth coefficient “b” have opposite signs. This is because Z1 and Z2 are factors that indicate that as Z1 is larger and Z2 is smaller, there are more high brightness portions in the center of the screen (that is, whiteout tends to occur) with respect to the entire screen.

こうして求めた指標1(白飛び度(W))を用いた階調処理条件の補正については、以下の階調処理条件設定のフローにおいて説明する。   The correction of the gradation processing condition using the index 1 (the degree of whiteout (W)) thus obtained will be described in the following gradation processing condition setting flow.

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

まず、シーン判別処理工程において判別された撮影シーンに応じて、ステップS70で第1の画像データのガンマ変換処理後に対する階調調整の方法が決定され、ステップS71で階調調整パラメータが算出されると、ステップS72でそれらのパラメータに応じて補正された階調変換量が算出され、ステップS73で階調処理条件(階調変換曲線)が決定される。なお、本実施形態では、ステップS70とステップS73とにおいて階調調整方法と階調変換量の双方を決定する場合を示すが、階調変換量のみであってもよい。
<階調調整方法選択>
ステップS70で階調調整方法を決定する場合、図25に示すように、撮影シーンが順光である場合は階調調整方法A(図25(a))が選択され、逆光である場合は階調調整方法B(図25(b))が選択され、主要被写体がオーバーである場合は階調調整方法C(図25(c))が選択され、アンダーである場合は、階調調整方法B(図25(b))が選択される。
First, in accordance with the shooting scene determined in the scene determination processing step, a gradation adjustment method for the first image data after the gamma conversion process is determined in step S70, and a gradation adjustment parameter is calculated in step S71. In step S72, the gradation conversion amount corrected in accordance with these parameters is calculated. In step S73, the gradation processing condition (gradation conversion curve) is determined. In this embodiment, the case where both the gradation adjustment method and the gradation conversion amount are determined in steps S70 and S73 is shown, but only the gradation conversion amount may be used.
<Tone adjustment method selection>
When determining the gradation adjustment method in step S70, as shown in FIG. 25, the gradation adjustment method A (FIG. 25 (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. 25B) is selected and the main subject is over, the tone adjustment method C (FIG. 25C) is selected, and when it is under, the tone adjustment method B is selected. (FIG. 25B) is selected.

なお本実施形態においては、第1の画像のガンマ変換後の画像へ適用する階調変換曲線を決定する方法を示したが、階調変換工程をガンマ変換の前に実施する場合には、図25の階調変換曲線に対して、ガンマ変換の逆変換を施した曲線で階調変換が行われる。
<階調調整パラメータ算出>
階調調整方法が決定されると、ステップ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 on a curve obtained by performing inverse conversion of gamma conversion on the 25 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. 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
ここで、図26及び図27を参照して、パラメータ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, a method for calculating the parameter P2 (block division average luminance) will be described with reference to FIGS.

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

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

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

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

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

パラメータP1は、画像データ全体の輝度の平均値であり、パラメータP3は、画像データのうち肌色領域(H1)の輝度の平均値である。パラメータP7のキー補正値、パラメータP7’のキー補正値2、パラメータP8の輝度補正値2は、それぞれ、式(15)、式(16)、式(17)のように定義される。   The parameter P1 is an average value of luminance of the entire image data, and the parameter P3 is an average value of luminance of the skin color area (H1) in the image data. The key correction value of 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−((指標7/6)×18000+22000)}
/24.78 (15)
P7’(キー補正値2)={P3−((指標5/6)×10000+30000)}
/24.78 (16)
P8(輝度補正値2)=(指標6/6)×17500 (17)
<階調変換量算出>
図24(b)に戻り、階調調整パラメータが算出されると、ステップS73では、その算出された階調調整パラメータに基づいて、撮影画像データに対する階調変換曲線の決定、すなわち階調処理条件が設定される。しかしながらステップS73で階調変換曲線を決定する前に、ステップS72で指標1に基づく階調変換量を算出し、階調調整の補正を行う。
P7 (key correction value) = {P3-((index 7/6) × 18000 + 22000)}
/24.78 (15)
P7 ′ (key correction value 2) = {P3-((index 5/6) × 10000 + 30000)}
/24.78 (16)
P8 (Luminance correction value 2) = (Index 6/6) × 17500 (17)
<Calculation of gradation conversion amount>
Returning to FIG. 24B, when the gradation adjustment parameter is calculated, in step S73, determination of the gradation conversion curve for the photographed image data based on the calculated gradation adjustment parameter, that is, gradation processing conditions. Is set. However, before determining the gradation conversion curve in step S73, the gradation conversion amount based on the index 1 is calculated in step S72, and the gradation adjustment is corrected.

具体的には、既に判別されたシーンに応じて、階調調整パラメータから第1階調変換量Xが選択され、指標1に基づき第2階調変換量Yが算出される(ステップS72)。指標1に基づく第2階調変換量Yの算出については、後述する。   Specifically, the first gradation conversion amount X is selected from the gradation adjustment parameters according to the already determined scene, and the second gradation conversion amount Y is calculated based on the index 1 (step S72). The calculation of the second gradation conversion amount Y based on the index 1 will be described later.

次いで、既に決定された階調調整方法に対応して予め設定された複数の階調変換曲線の中から、算出された第2階調変換量Yに対応する階調変換曲線が選択(決定)される(ステップS73)。あるいは、第2階調変換量Yに基づいて、階調変換曲線を算出するようにしてもよい。   Next, a gradation conversion curve corresponding to the calculated second gradation conversion amount Y is selected (determined) from a plurality of gradation conversion curves set in advance corresponding to the already determined gradation adjustment method. (Step S73). Alternatively, the gradation conversion curve may be calculated based on the second gradation conversion amount Y.

階調変換曲線が決定されると、階調処理条件設定は終了する。
<指標1に基づく階調変換量算出方法>
次に指標1に応じた階調変換量の補正処理(ステップS72での階調変換量の算出)について説明する。撮影シーンに応じた階調調整パラメータからの第1の階調変換量Xの選択については、後で述べる。ここでは既に第1の階調変換量Xが選択されたものとして説明する。
When the gradation conversion curve is determined, the gradation processing condition setting ends.
<Tone conversion amount calculation method based on index 1>
Next, the gradation conversion amount correction processing corresponding to the index 1 (calculation of the gradation conversion amount in step S72) will be described. The selection of the first gradation conversion amount X from the gradation adjustment parameter corresponding to the shooting scene will be described later. Here, it is assumed that the first gradation conversion amount X has already been selected.

補正のための指標としては、既に第1の指標算出工程で指標1(白飛び度(W))が算出されている。シーン判別処理工程での画像のシーン判別処理結果のみに基づいて階調変換処理が決定されると、ユーザの意図に沿わない画像が得られる恐れがある。   As an index for correction, index 1 (out-of-whiteness (W)) has already been calculated in the first index calculation step. If the gradation conversion process is determined based only on the scene discrimination process result of the image in the scene discrimination process, an image that does not conform to the user's intention may be obtained.

例えば、一般的な画像の鑑賞において、最も注目される部位は人物の顔であり、鑑賞に適切な画像品質を得るためには人物の顔を適正な明るさにすることが必要である。従って、人物がアンダーに撮影された画像などは、明るく補正する必要がある。しかし、撮影シーンの状況によっては、上記のような補正のみでは、補正した画像において画像中の白飛びしている面積が大きくなったり、顔などの主要被写体部で白飛びが起こってしまったりすることがあり、かえって画像中の明るさのバランスを損なったりする場合もある。   For example, in general image appreciation, the most noticeable part is a person's face, and it is necessary to make the person's face appropriate brightness in order to obtain image quality appropriate for appreciation. Therefore, it is necessary to correct brightly an image in which a person is photographed under. However, depending on the situation of the shooting scene, only the correction as described above may increase the area of the image that is whitened in the corrected image, or whiteout may occur in the main subject such as the face. In some cases, the brightness balance in the image may be lost.

そのような場合など、白飛びの発生状況を予測して自動的な階調の補正は控えめにした方がよい。   In such a case, it is better to conceal the automatic gradation correction by predicting the occurrence of whiteout.

具体的な階調変換処理の補正方法としては、選択された第1の階調変換量Xに対して、第2の階調変換量Yを次の(18)式によって算出する。   As a specific gradation conversion correction method, the second gradation conversion amount Y is calculated by the following equation (18) with respect to the selected first gradation conversion amount X.

階調変換量Xが明るく補正する方向であり、かつW(指標1)>定数g(所定の閾値)であるとき、hを所定の定数として、
Y=X−h×(W−g) (X−h×(W−g)>0の場合)
Y=0 (X−h×(W−g)≦0の場合) (18)
gはW(指標1)の閾値、hはW(指標1)を反映させる程度を表す係数であり、いずれも予め定められた定数である。
When the gradation conversion amount X is in the direction of correcting brightly and W (index 1)> constant g (predetermined threshold), h is defined as a predetermined constant.
Y = Xh * (Wg) (when Xh * (Wg)> 0)
Y = 0 (when Xh × (Wg) ≦ 0) (18)
g is a threshold value of W (index 1), h is a coefficient representing the degree of reflecting W (index 1), and each is a predetermined constant.

gとhの値を適切に定めておくことにより、階調変換処理の抑制の程度を制御することができる。すなわち、階調変換量Yを小さくするほど補正量が小さくなり、ゼロで補正なしとなる。   By appropriately determining the values of g and h, the degree of suppression of gradation conversion processing can be controlled. That is, the smaller the gradation conversion amount Y, the smaller the correction amount, and zero means no correction.

例えば、階調変換量Xが暗く補正する方向であれば、白飛びは起こらない方向なので、階調変換量Xの補正は行わず、Y=Xとなる。またW(指標1)が閾値を超えない((W−g)<0)場合も、補正の抑制は行わない。   For example, if the gradation conversion amount X is a direction to be corrected dark, the whiteout does not occur, so the gradation conversion amount X is not corrected and Y = X. Further, even when W (index 1) does not exceed the threshold ((W−g) <0), correction is not suppressed.

また、階調変換量Xが明るく補正する方向であり、かつW>gの場合においても、Y≦0の場合はすべてY=0とする、すなわち階調処理を行わない状態にとどめる。   Further, even when the gradation conversion amount X is in the direction of correcting brightly and W> g, all Y = 0 are set to Y = 0, that is, the gradation process is not performed.

実際の白飛び発生シーンの発生した場合や、発生しない場合に応じて、適切な補正量となるように上の(18)式のg、hの値を設定するとよい。   The values of g and h in the above equation (18) may be set so that an appropriate correction amount is obtained depending on when an actual whiteout occurrence scene occurs or does not occur.

このように、各条件に基づいて、選択された第1の階調変換量Xから抑制された第2の階調変換量Yを算出し、次の階調処理条件の決定に移る。
<シーンごとの階調処理条件設定>
以下、シーン判別処理結果による各撮影シーン(光源条件及び露出条件)ごとに、階調変換曲線の決定方法(ステップS73での階調処理条件の決定)について説明する。
As described above, the second gradation conversion amount Y suppressed from the selected first gradation conversion amount X is calculated based on each condition, and the next gradation processing condition is determined.
<Setting gradation processing conditions for each scene>
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) based on the scene determination processing result will be described.

<順光の場合>
撮影シーンが順光である場合、パラメータP6を第1の階調変換量Xとして選択する。パラメータP6=P1−P5なので、X=P6とするということは、第2の階調変換量Y=Xであれば、P1をP5と一致させるオフセット補正(8bit値の平行シフト)を下記の式(19)により行うことである。
<For direct light>
If the photographic scene is front light, the parameter P6 is selected as the first gradation conversion amount X. Since the parameter P6 = P1-P5, X = P6 means that if the second gradation conversion amount Y = X, offset correction (parallel shift of 8-bit value) for matching P1 with P5 is performed as follows: (19).

出力画像のRGB値=入力画像のRGB値+Y (19)
但し、撮影条件によりYがXでなく抑制されている場合であれば、補正量はY=P6の場合よりも小さめとなる。
RGB value of output image = RGB value of input image + Y (19)
However, if Y is not X but is controlled by the shooting conditions, the correction amount is smaller than that when Y = P6.

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

〈逆光の場合〉
撮影シーンが逆光である場合、パラメータP7(キー補正値)を第1の階調変換量Xとして選択する。従ってXから算出した第2の階調変換量Yに基づいて、図25(b)に示す複数の階調変換曲線の中から、式(18)に示すYに対応する階調変換曲線が選択される。図25(b)の階調変換曲線の具体例を図28に示す。Yの値と、選択される階調変換曲線の対応関係を以下に示す。
<Backlight>
When the shooting scene is backlit, the parameter P7 (key correction value) is selected as the first gradation conversion amount X. Therefore, based on the second gradation conversion amount Y calculated from X, the gradation conversion curve corresponding to Y shown in Expression (18) is selected from the plurality of gradation conversion curves shown in FIG. Is done. A specific example of the gradation conversion curve in FIG. 25B is shown in FIG. The correspondence between the Y value and the selected gradation conversion curve is shown below.

−50<Y<+50 の場合→L3
+50≦Y<+150 の場合→L4
+150≦Y<+250 の場合→L5
−150<Y≦−50 の場合→L2
−250<Y≦−150 の場合→L1
なお、撮影シーンが逆光の場合、この階調変換処理とともに、覆い焼き処理を併せて行うことが好ましい。この場合、逆光度を示す指標6に応じて覆い焼き処理の程度も調整されることが望ましい。
When −50 <Y <+ 50 → L3
When + 50 ≦ Y <+ 150 → L4
When + 150 ≦ Y <+ 250 → L5
When −150 <Y ≦ −50 → L2
When −250 <Y ≦ −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.

〈アンダーの場合〉
撮影シーンがアンダーである場合、パラメータP7’(キー補正値2)を第1の階調変換量Xとして選択する。従ってXから算出した第2の階調変換量Yに基づいて、図25(b)に示す複数の階調変換曲線の中から、式(18)に示すYに対応する階調変換曲線が選択される。具体的には、撮影シーンが逆光の場合の階調変換曲線の選択方法と同様に、図28に示す階調変換曲線の中から、Yの値に対応した階調変換曲線が選択される。なお、撮影シーンがアンダーである場合は、逆光の場合に示したような覆い焼き処理は行わない。
<In case of under>
When the shooting scene is under, the parameter P7 ′ (key correction value 2) is selected as the first gradation conversion amount X. Therefore, based on the second gradation conversion amount Y calculated from X, the gradation conversion curve corresponding to Y shown in Expression (18) is selected from the plurality of gradation conversion curves shown in FIG. Is done. Specifically, the gradation conversion curve corresponding to the Y value is selected from the gradation conversion curves shown in FIG. 28 in the same manner as the method for selecting the gradation conversion curve when the shooting scene is backlit. When the shooting scene is under, the dodging process as shown in the case of backlight is not performed.

〈主要被写体がオーバーの場合〉
主要被写体がオーバーである場合、パラメータP9を第1の階調変換量Xとして選択する。従ってXから算出した第2の階調変換量Yに基づいて、オフセット補正(8bit値の平行シフト)を式(20)により行う。
<When the main subject is over>
If the main subject is over, the parameter P9 is selected as the first gradation conversion amount X. Therefore, based on the second gradation conversion amount Y calculated from X, offset correction (parallel shift of 8-bit value) is performed by Expression (20).

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

なお、本実施形熊では、実際に撮影画像データに対して階調変換処理を施す場合、上述の階調変換処理条件を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.

(第2の実施形態)
次に、本発明に係る第2の実施形態(画像処理装置)における構成について説明する。
(Second Embodiment)
Next, the configuration of the second embodiment (image processing apparatus) according to the present invention will be described.

図29には、本実施形態に係る画像処理装置2の外観構成の一例を示す。また図30には、画像処理装置2の概略構成をブロック図で示す。   FIG. 29 shows an example of the external configuration of the image processing apparatus 2 according to the present embodiment. FIG. 30 is a block diagram illustrating a schematic configuration of the image processing apparatus 2.

(画像処理装置2の外観構成)
図29において、画像処理装置2は、筐体11の一側面に感光材料を装填する装填部13を備えている。筐体11の内部には、感光材料に露光する露光処理部86と、露光された感光材料を現像処理してプリントを作成するプリント作成部16を備えている。筐体11の他側面には、プリント作成部16で作成されたプリントを排出するトレー17を備えている。
(External configuration of image processing apparatus 2)
In FIG. 29, the image processing apparatus 2 includes a loading unit 13 that loads a photosensitive material on one side surface of the housing 11. The housing 11 includes an exposure processing unit 86 that exposes the photosensitive material and a print creation unit 16 that develops the exposed photosensitive material to create a print. On the other side surface of the housing 11, a tray 17 for discharging the print created by the print creation unit 16 is provided.

筐体11の上部には、表示装置としてのCRT(CathodeRayTube)85、透過原稿を読み込む装置であるフィルムスキャナ部81、反射原稿入力装置82、操作部71を備えている。さらに筐体11には、各種デジタル記録媒体に記録された画像情報を読み取り可能な画像読み込み部14、各種デジタル記録媒体に画像信号を書き込み可能な画像書き込み部15を備え、また筐体11の内部には、これらの各部を制御する制御部72を備えている。画像読み込み部14は後述の画像転送手段83を含み、画像書き込み部15は後述の画像搬送部88を含んでいる。   At the top of the housing 11, a CRT (Cathode Ray Tube) 85 as a display device, a film scanner unit 81 that is a device for reading a transparent document, a reflective document input device 82, and an operation unit 71 are provided. The housing 11 further includes an image reading unit 14 that can read image information recorded on various digital recording media, and an image writing unit 15 that can write image signals on various digital recording media. Includes a control unit 72 for controlling these units. The image reading unit 14 includes an image transfer unit 83 described later, and the image writing unit 15 includes an image transfer unit 88 described later.

これらの各構成要素はすべてが必要なわけではなく、また一体的に備えられた構造になっている必要もない。何れか一つ以上を画像処理装置2と別体として切り離す、あるいは外部装置として接続するようにしてもよい。   Not all of these components are required, and it is not necessary to have an integrally provided structure. Any one or more may be separated from the image processing apparatus 2 or connected as an external apparatus.

(画像処理装置2の構成)
図30には、本発明の実施形態に係る画像処理装置2の概略構成を示す。画像処理装置2は、図30に示すように、操作部71、制御部72、画像処理部10、フィルムスキャンデータ処理部73、反射原稿スキャンデータ処理部74、画像データ書式解読処理部75、CRT固有処理部76、プリンタ固有処理部A77、プリンタ固有処理部B78、画像データ書式作成処理部79により構成される。
(Configuration of the image processing apparatus 2)
FIG. 30 shows a schematic configuration of the image processing apparatus 2 according to the embodiment of the present invention. As shown in FIG. 30, the image processing apparatus 2 includes an operation unit 71, a control unit 72, an image processing unit 10, a film scan data processing unit 73, a reflection original scan data processing unit 74, an image data format decoding processing unit 75, a CRT. The unique processing unit 76, the printer specific processing unit A 77, the printer specific processing unit B 78, and the image data format creation processing unit 79 are configured.

フィルムスキャンデータ処理部73は、フィルムスキャナ部81から入力された画像データに対し、フィルムスキャナ部81固有の校正操作、ネガポジ反転(ネガ原稿の場合)、ゴミキズ除去、コントラスト調整、粒状ノイズ除去、鮮鋭化強調等の処理を施し、処理済の画像データを画像処理部10に出力する。また、フィルムサイズ、ネガポジ種別、フィルムに光学的あるいは磁気的に記録された主要被写体に関わる情報、撮影条件に関する情報(例えば、APSの記載情報内容)等も併せて画像処理部10に出力する。   The film scan data processing unit 73 performs a calibration operation specific to the film scanner unit 81, negative / positive reversal (in the case of a negative document), dust scratch removal, contrast adjustment, granular noise removal, and sharpness for the image data input from the film scanner unit 81. Processing such as conversion enhancement is performed, and processed image data is output to the image processing unit 10. Further, the film size, the negative / positive type, the information relating to the main subject optically or magnetically recorded on the film, the information relating to the photographing conditions (for example, the description information content of APS) and the like are also output to the image processing unit 10.

反射原稿スキャンデータ処理部74は、反射原稿入力装置82から入力された画像データに対し、反射原稿入力装置82固有の校正操作、ネガポジ反転(ネガ原稿の場合)、ゴミキズ除去、コントラスト調整、ノイズ除去、鮮鋭化強調等の処理を施し、処理済の画像データを画像処理部10に出力する。   The reflection document scan data processing unit 74 performs a calibration operation unique to the reflection document input device 82, negative / positive reversal (in the case of a negative document), dust flaw removal, contrast adjustment, and noise removal for the image data input from the reflection document input device 82. Then, processing such as sharpening enhancement is performed, and processed image data is output to the image processing unit 10.

画像データ書式解読処理部75は、画像転送手段83及び/または通信手段(入力)84から入力された画像データに対し、その画像データのデータ書式に従って、必要に応じて圧縮符号の復元、色データの表現方法の変換等の処理を施し、画像処理部10内の演算に適したデータ形式に変換し、画像処理部10に出力する。   The image data format decoding processing unit 75 restores the compression code as necessary according to the data format of the image data input from the image transfer means 83 and / or the communication means (input) 84, and the color data. Are converted into a data format suitable for computation in the image processing unit 10 and output to the image processing unit 10.

また、画像データ書式解読処理部75は、操作部71、通信手段(入力)84、画像転送手段83の何れかから出力画像の条件が指定された場合、その指定された情報を検出し、画像処理部10に出力する。なお、画像転送手段83により指定される出力画像の条件についての情報は、画像転送手段83が取得した画像データのヘッダ情報、タグ情報に埋め込まれている。   In addition, when an output image condition is specified from any of the operation unit 71, the communication unit (input) 84, and the image transfer unit 83, the image data format decoding processing unit 75 detects the specified information, and Output to the processing unit 10. Information about the conditions of the output image specified by the image transfer unit 83 is embedded in the header information and tag information of the image data acquired by the image transfer unit 83.

画像処理部10は、操作部71または制御部72の指令に基づいて、フィルムスキャナ部81、反射原稿入力装置82、画像転送手段83、通信手段(入力)84の何れかから受け取った画像データに対し、後述の画像処理(図14、図15、図18及び図24参照)を施して、出力媒体上での鑑賞に最適化された画像形成用のデジタル画像データを生成し、CRT固有処理部76、プリンタ固有処理部A77、プリンタ固有処理部B78、画像データ書式作成処理部79の何れかに出力する。   Based on an instruction from the operation unit 71 or the control unit 72, the image processing unit 10 applies image data received from any one of the film scanner unit 81, the reflection original input device 82, the image transfer unit 83, and the communication unit (input) 84. On the other hand, image processing described later (see FIGS. 14, 15, 18 and 24) is performed to generate digital image data for image formation optimized for viewing on the output medium, and a CRT specific processing unit 76, output to any one of the printer specific processing unit A77, the printer specific processing unit B78, and the image data format creation processing unit 79.

画像処理部10の内部構成については、後で図11を用いて説明する。   The internal configuration of the image processing unit 10 will be described later with reference to FIG.

CRT固有処理部76は、画像処理部10から入力された画像データに対して、必要に応じて画素数変更やカラーマッチング等の処理を施し、制御情報等表示が必要な情報と合成した表示用の画像データをCRT85に出力する。   The CRT specific processing unit 76 performs processing such as changing the number of pixels and color matching on the image data input from the image processing unit 10 as necessary, and combines it with information that needs to be displayed, such as control information. Are output to the CRT 85.

プリンタ固有処理部A77は、必要に応じてプリンタ固有の校正処理、カラーマッチング、画素数変更等の処理を行い、処理済の画像データを露光処理部86に出力する。   The printer-specific processing unit A77 performs printer-specific calibration processing, color matching, and pixel number change processing as necessary, and outputs processed image data to the exposure processing unit 86.

本発明の画像処理装置2に、外部プリンタ87が接続可能な場合には、接続するプリンタ装置毎にプリンタ固有処理部B78が備えられている。このプリンタ固有処理部B78は、プリンタ固有の校正処理、カラーマッチング、画素数変更等の処理を施し、処理済の画像データを外部プリンタ87に出力する。   When an external printer 87 can be connected to the image processing apparatus 2 of the present invention, a printer specific processing unit B78 is provided for each printer apparatus to be connected. The printer-specific processing unit B78 performs printer-specific calibration processing, color matching, pixel number change, and the like, and outputs processed image data to the external printer 87.

画像データ書式作成処理部79は、画像処理部10から入力された画像データに対して、必要に応じてJPEG、TIFF、ビットマップ等に代表される各種の汎用画像フォーマットへの変換を施し、処理済の画像データを画像搬送部88や通信手段(出力)89に出力する。   The image data format creation processing unit 79 converts the image data input from the image processing unit 10 into various general-purpose image formats typified by JPEG, TIFF, bitmap, and the like as necessary. The completed image data is output to the image transport unit 88 and the communication means (output) 89.

なお、図30に示したフィルムスキャンデータ処理部73、反射原稿スキャンデータ処理部74、画像データ書式解読処理部75、画像処理部10、CRT固有処理部76、プリンタ固有処理部A77、プリンタ固有処理部B78、画像データ書式作成処理部79、という区分は、画像処理装置2の機能の理解を助けるために設けた区分であり、必ずしも物理的に独立したデバイスとして実現される必要はなく、例えば、単一のCPUによるソフトウエア処理の種類の区分として実現されてもよい。   Note that the film scan data processing unit 73, the reflection original scan data processing unit 74, the image data format decoding processing unit 75, the image processing unit 10, the CRT specific processing unit 76, the printer specific processing unit A77, and the printer specific processing shown in FIG. The section B78 and the image data format creation processing section 79 are sections provided to assist understanding of the function of the image processing apparatus 2, and are not necessarily realized as physically independent devices. It may be realized as a type of software processing performed by a single CPU.

(画像処理部10の内部構成)
図11に、画像処理部10の内部構成を示す。画像処理部10は、画像処理装置2の入力画像に対して、シーン判別に基づく階調の補正動作を制御するものであり、画像取得、シーン判別、階調処理条件設定などの一連の処理を実行する。本実施形態では入力画像が撮影画像データであるとし、図11を用いて、画像処理部10の内部構成を説明する。
(Internal configuration of the image processing unit 10)
FIG. 11 shows an internal configuration of the image processing unit 10. The image processing unit 10 controls the gradation correction operation based on scene discrimination for the input image of the image processing apparatus 2, and performs a series of processes such as image acquisition, scene discrimination, and gradation processing condition setting. Execute. In this embodiment, the input image is taken image data, and the internal configuration of the image processing unit 10 will be described with reference to FIG.

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

第1画像取得部101は、各入力データ処理部からの入力画像データを取得する。入力画像は撮影画像データであるので、例えば画像転送手段83あるいは通信手段84を経て画像データ書式解読処理部75に入力された撮影画像データが、その画像データのデータ書式に従って、必要に応じて圧縮符号の復元、データの表現方法の変換等の処理が施され、画像処理部10によって第1の画像として取得される。撮影画像データは通常撮影時にJPEG画像形式などのノンリニア画像に変換され、記録されている。ここではノンリニア画像に変換後の画像を第1の画像として取得したものとする。もちろん、撮影時のリニア画像(RAW画像)を取得してもかまわない。   The first image acquisition unit 101 acquires input image data from each input data processing unit. Since the input image is photographed image data, for example, the photographed image data input to the image data format decoding processing unit 75 via the image transfer means 83 or the communication means 84 is compressed as necessary according to the data format of the image data. Processing such as code restoration and conversion of the data representation method is performed, and the image processing unit 10 acquires the first image. The photographed image data is converted into a non-linear image such as a JPEG image format and recorded during normal photographing. Here, it is assumed that the image converted into the non-linear image is acquired as the first image. Of course, a linear image (RAW image) at the time of shooting may be acquired.

また第1画像取得部101は、入力画像から、例えば撮影時に記録されるExif情報などを読み出し、撮影時における撮影条件も合わせて取得する。取得した第1の画像の画像データ、及び撮影条件は画像処理部10内のメモリ(不図示)に保持される。   Further, the first image acquisition unit 101 reads, for example, Exif information recorded at the time of shooting from the input image, and also acquires the shooting conditions at the time of shooting. The acquired image data of the first image and shooting conditions are held in a memory (not shown) in the image processing unit 10.

第2画像取得部102は、第1の実施形態の場合と同様に第2の画像取得手段として機能する。取得した第1の画像から、実質的に縮小された第2の画像を取得することになるのも同様であり、説明は省略する。   The second image acquisition unit 102 functions as a second image acquisition unit as in the case of the first embodiment. The same applies to acquiring a substantially reduced second image from the acquired first image, and a description thereof will be omitted.

以下、第1の実施形態(撮像装置の場合)と同様の機能を有する構成要素については、説明を簡略にする。   Hereinafter, description of the components having the same functions as those of the first embodiment (in the case of the imaging apparatus) will be simplified.

第1占有率算出部103aは、第1の占有率算出手段として機能し、画像データに対して取得した色情報に基づいて、画像を画面の外縁からの距離と明度の組み合わせからなる所定の階級に分類し、分類された階級毎に各階級に属する画素が画像全体に占める割合を示す第1の占有率を算出する。   The first occupancy rate calculation unit 103a functions as a first occupancy rate calculation unit, and based on the color information acquired for the image data, the image is a predetermined class comprising a combination of the distance from the outer edge of the screen and the brightness. And a first occupation ratio indicating a ratio of pixels belonging to each class to the entire image is calculated for each classified class.

また、第2占有率算出部103bは、第2の占有率算出手段として機能し、同じく画像を明度と色相の組み合わせからなる所定の階級に分類し、各階級毎に第2の占有率を算出する。   The second occupancy rate calculation unit 103b functions as a second occupancy rate calculation unit, similarly classifies images into a predetermined class composed of combinations of brightness and hue, and calculates a second occupancy ratio for each class. To do.

第1占有率算出部103a及び第2占有率算出部103bにおいて実行される占有率算出処理について、第1の実施形態と異なるところは、後に図15を参照して説明する。   The occupancy rate calculation processing executed in the first occupancy rate calculation unit 103a and the second occupancy rate calculation unit 103b will be described later with reference to FIG.

指標算出部104は、第2の指標算出手段として機能する。すなわち、算出された第1の占有率から指標2を算出する。   The index calculation unit 104 functions as a second index calculation unit. That is, the index 2 is calculated from the calculated first occupation rate.

また、指標算出部104は、第3の指標算出手段、及び第4の指標算出手段としても機能する。すなわち、算出された第2の占有率から指標3、及び指標4を算出する。   The index calculation unit 104 also functions as a third index calculation unit and a fourth index calculation unit. That is, index 3 and index 4 are calculated from the calculated second occupancy rate.

さらに、指標算出部104は、第5の指標算出手段としても機能する。第2の画像の画面中央部における平均輝度値と、最大輝度値と平均輝度値との差分値から指標5を算出する。   Furthermore, the index calculation unit 104 also functions as a fifth index calculation unit. The index 5 is calculated from the average luminance value at the center of the screen of the second image and the difference value between the maximum luminance value and the average luminance value.

また、指標算出部104は、第6の指標算出手段として機能する。すなわち、第2の画像の画面中央部における肌色領域の平均輝度値(指標9)と、指標2及び指標3から新たな指標6を算出する。   In addition, the index calculation unit 104 functions as a sixth index calculation unit. That is, a new index 6 is calculated from the average luminance value (index 9) of the skin color area in the center of the screen of the second image and the indices 2 and 3.

また、指標算出部104は、第7の指標算出手段として機能する。当該平均輝度値と、指標2及び指標4から新たな指標7を算出する。   The index calculation unit 104 functions as a seventh index calculation unit. A new index 7 is calculated from the average luminance value and the indices 2 and 4.

指標算出部104において実行される指標算出処理について第1の実施形態の場合と異なるところは、後に図18を参照して詳細に説明する。   The difference between the index calculation process executed in the index calculation unit 104 and the case of the first embodiment will be described in detail later with reference to FIG.

シーン判別部105は、指標算出部104で算出された各指標に基づいて、第1の画像の撮影シーンを判別する。すなわち、シーン判別手段として機能する。ここで、撮影シーンとは、順光、逆光、近接フラッシュ等の被写体を撮影する時の光源条件を示しており、主要被写体(主に人物のことを指すが、これに限るものではない)のオーバー度、アンダー度などもこれに含まれる。   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, it functions as a scene discrimination means. 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.

以上のように、第2占有率算出部、指標算出部、そしてシーン判別部がシーン判別処理手段として機能するのも、第1の実施形態の場合と同じである。   As described above, the second occupancy ratio calculation unit, the index calculation unit, and the scene determination unit function as the scene determination processing unit as in the case of the first embodiment.

第1指標算出部106は、第1の指標算出手段として機能する。第1占有率算出部103aで算出された第1の占有率に、予め設定された係数を乗算することにより、指標1を算出するのも、第1の実施形態の場合と同じである。   The first index calculation unit 106 functions as a first index calculation unit. The index 1 is calculated by multiplying the first occupancy calculated by the first occupancy calculator 103a by a preset coefficient as in the case of the first embodiment.

階調処理条件設定部107は、階調処理条件設定手段として機能する。シーン判別部105で判別された撮影シーンに基づいて階調処理条件の設定を行う。その設定方法は、第1の実施形態の場合と同様である。   The gradation processing condition setting unit 107 functions as a gradation processing condition setting unit. The gradation processing conditions are set based on the shooting scene determined by the scene determination unit 105. The setting method is the same as in the case of the first embodiment.

階調変換処理部108は、上記階調処理条件設定部107において設定された階調処理条件に従い、第1の画像に対する階調変換処理を実行する。   The gradation conversion processing unit 108 executes gradation conversion processing for the first image in accordance with the gradation processing conditions set in the gradation processing condition setting unit 107.

(画像処理装置2の動作フロー)
次に、本実施形態における画像処理装置2の動作について説明する。
(Operation flow of the image processing apparatus 2)
Next, the operation of the image processing apparatus 2 in the present embodiment will be described.

以下では、撮影画像を対象とし、その撮影対象物を「主要被写体」と呼ぶことにする。   Hereinafter, a captured image is targeted, and the captured object is referred to as a “main subject”.

まず、図31のフローチャートを参照して、画像処理装置2で実行される処理の全体の流れを説明する。なお、これらの処理はプログラムを用いてコンピュータに実行させることができる。以下で説明する各工程は、画像処理プログラムの各機能としても同様の説明ができる。   First, the overall flow of processing executed by the image processing apparatus 2 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.

まず、画像処理装置2への入力操作が行われると、各入力処理部73〜75の何れかで入力処理が行われる(ステップS90)。撮影画像に対しては、画像データ書式解読処理部75での処理を経て、画像処理部10に送られる。ステップS91では、画像処理部10において、撮影画像として第1の画像が取得される。第1の画像はノンリニア画像であり、JPEG画像であるとする。   First, when an input operation to the image processing apparatus 2 is performed, input processing is performed in any of the input processing units 73 to 75 (step S90). The captured image is sent to the image processing unit 10 through the processing in the image data format decoding processing unit 75. In step S91, the image processing unit 10 acquires a first image as a captured image. It is assumed that the first image is a non-linear image and is a JPEG image.

また、取得した第1の画像に付加されたExif情報が読み出され、撮影条件の取り込みが行われる。取得した撮影条件はメモリに保持される。   Also, the Exif information added to the acquired first image is read, and the shooting conditions are captured. The acquired shooting conditions are held in the memory.

その後、第1の画像の画像データは、一方で複数の分割領域からなる分割画像、すなわち第2の画像として取得される(ステップS92)。第2の画像が第1の画像のサイズを縮小した画像となるのは第1の実施形態の場合と同様であり、ステップS92は第2の画像取得工程として機能する。   Thereafter, 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 S92). The second image is an image obtained by reducing the size of the first image as in the first embodiment, and step S92 functions as a second image acquisition step.

第1の占有率算出工程であるステップS93では、第2の画像に対して第1の占有率が算出される。但し、画像データは必ずしも第2の画像である必要はない。撮影により取得された第1の画像の画像データを用いてもかまわないのは、第1の実施形態の場合と同様である。   In step S93, which is the first occupancy rate calculation step, the first occupancy rate is calculated for the second image. However, the image data does not necessarily have to be the second image. The image data of the first image acquired by shooting may be used as in the case of the first embodiment.

ステップS95では、ステップS93で算出された第1の占有率に基づいて、指標1が算出されるのも第1の実施形態の場合と同様である。すなわち、ステップS95は第1の指標算出工程として機能する。指標1は後で、シーン判別結果により設定された階調処理条件を補正するのに用いられる。第1の指標算出処理については、既に図24(a)を参照して第1の実施形態で説明した。   In step S95, the index 1 is calculated based on the first occupation ratio calculated in step S93 as in the case of the first embodiment. That is, step S95 functions as a first index calculation step. The index 1 is used later to correct the gradation processing condition set by the scene discrimination result. The first index calculation process has already been described in the first embodiment with reference to FIG.

次いで、シーン判別処理工程であるステップS94では、取得された第2の画像の画像データに基づいて、撮影シーンを判別するシーン判別処理が行われる。ステップS94におけるシーン判別処理については、後に図14を参照して、第1の実施形態の場合と異なるところを説明する。   Next, in step S94, 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 scene discrimination process in step S94 will be described later with reference to FIG. 14 where it differs from the case of the first embodiment.

次いで、階調処理条件設定工程であるステップS96では、ステップS94の撮影シーン判別処理で得られた各指標及び撮影シーンの判別結果に基づいて、第1の画像の階調変換処理のために必要な条件を設定する階調処理条件設定処理が行われる。またここで第1の指標算出工程で算出した指標1による階調変換量の調整が行われるのも、第1の実施形態の場合と同様である。   Next, in step S96 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 photographing scene discrimination processing in step S94 and the judgment result of the photographing scene. A gradation processing condition setting process for setting various conditions is performed. Further, the adjustment of the gradation conversion amount by the index 1 calculated in the first index calculation step is performed here as in the case of the first embodiment.

ステップS97では、ステップS96で設定された階調処理条件に基づいて、撮影画像である第1の画像の画像データに対する階調変換処理が行われる。ステップS97の階調変換は撮影シーンの光源条件などによる階調への影響を補正するものであり、ステップS94でのシーン判別結果によりステップS96で設定した条件に基づき階調変換処理を行う。   In step S97, 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 in step S96. The gradation conversion in step S97 corrects the influence on the gradation due to the light source condition of the photographic scene, and the gradation conversion processing is performed based on the condition set in step S96 based on the scene discrimination result in step S94.

次いで、その他の画像処理(ノイズ処理やシャープネス処理など)が適宜行われる(ステップS98)。その後画像データは、各出力処理部76〜79で処理され、出力される。あるいは、保存用の記録媒体(SDメモリカードまたはマルチメディアカード(MMC)等)に記録される(ステップS99)。出力、あるいは記録が終わると、画像処理装置2における動作は終了する。   Next, other image processing (noise processing, sharpness processing, etc.) is appropriately performed (step S98). Thereafter, the image data is processed and output by the output processing units 76 to 79. Alternatively, it is recorded on a storage medium for storage (such as an SD memory card or a multimedia card (MMC)) (step S99). When the output or recording ends, the operation in the image processing apparatus 2 ends.

(シーン判別処理2のフロー)
次に、図14のフローチャート及び図15、18、22及び32〜35を参照して、画像処理装置2での第1の占有率算出処理(図31のステップS93)及びシーン判別処理2(図31のステップS94)について説明する。以下の説明では、第1の占有率算出処理も含めてシーン判別処理という。また、第1の実施形態(撮像装置1)と異なるところを説明し、同じところは適宜省略する。
(Flow of scene discrimination process 2)
Next, referring to the flowchart in FIG. 14 and FIGS. 15, 18, 22, and 32 to 35, the first occupancy rate calculation process (step S93 in FIG. 31) and the scene determination process 2 (in FIG. 31) in the image processing apparatus 2. The 31 step S94) will be described. In the following description, the scene determination process including the first occupancy rate calculation process will be referred to. Further, differences from the first embodiment (imaging device 1) will be described, and the same portions will be omitted as appropriate.

シーン判別処理は、第1の実施形態と同様、図14に示すように、第1の占有率算出処理(ステップS20)、第2の占有率算出処理(ステップS21)、指標算出処理(ステップS22)、シーン判別(ステップS23)の各処理により構成される。以下、適宜上記図面を参照して、図14に示す各処理について説明する。   As in the first embodiment, the scene determination process includes a first occupancy rate calculation process (step S20), a second occupancy rate calculation process (step S21), and an index calculation process (step S22), as shown in FIG. ) And scene discrimination (step S23). Each process shown in FIG. 14 will be described below with reference to the above drawings as appropriate.

<第1の占有率算出処理2>
まず、ステップS20では、第1の占有率算出処理が行われる。図15(a)のフローチャートを参照して、第1の占有率算出処理について説明する。
<First occupation rate calculation process 2>
First, in step S20, a first occupancy rate calculation process is performed. The first occupancy rate calculation process will be described with reference to the flowchart in FIG.

まず、図15(a)のステップS30において、色空間変換処理が行われる。処理内容は第1の実施形態の場合と同様であり、説明は省略する。   First, in step S30 in FIG. 15A, color space conversion processing is performed. The processing contents are the same as those in the first embodiment, and a description thereof will be omitted.

ステップS31の2次元ヒストグラム作成も第1の実施形態の場合と同様である。但し、外縁からの距離に応じた分割が3つの領域ではなく、4つの領域となっている。   The two-dimensional histogram creation in step S31 is the same as in the first embodiment. However, the division according to the distance from the outer edge is not three areas but four areas.

図32(a)に、第2の画像の画面の外縁からの距離に応じて分割された4つの領域n1〜n4を示す。領域n1が外枠であり、領域n2が外枠の内側の領域であり.領域n3が領域n2のさらに内側の領域であり、領域n4が第2の画像の中央部の領域である。また、ステップS31において、明度は、上述のようにv1〜v7の7つの領域に分割するものとする。従って、第2の画像を画面の外縁からの距離と明度の組み合わせからなる階級に分類した場合の階級の数は4×7=28個となる。   FIG. 32A shows four regions n1 to n4 divided according to the distance from the outer edge of the screen of the second image. Region n1 is the outer frame, region n2 is the inner region of the outer frame,. The region n3 is a region further inside the region n2, and the region n4 is a central region of the second image. In step S31, the brightness is divided into seven areas v1 to v7 as described above. Therefore, the number of classes when the second image is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness is 4 × 7 = 28.

ステップS32が、ステップS31とともに、第1の占有率算出工程として機能し、第1の占有率が算出されるのも第1の実施形態の場合と同様である。   Step S32, together with step S31, functions as a first occupancy rate calculation step, and the first occupancy rate is calculated as in the case of the first embodiment.

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

Figure 2007228132
Figure 2007228132

<第2の占有率算出処理2>
次に、図14のステップS21では、第2の占有率算出処理が行われる。図15(b)のフローチャートを参照して、第2の占有率算出処理について説明する。
<Second Occupancy Calculation Processing 2>
Next, in step S21 of FIG. 14, a second occupancy rate calculation process is performed. The second occupancy rate calculation process will be described with reference to the flowchart in FIG.

図15(b)のステップS35において、第2の画像の各画素が、色相と明度の組み合わせからなる所定の階級に分類され、分類された階級毎に累積画素数を算出することによって2次元ヒストグラムが作成される。   In step S35 of FIG. 15B, each pixel of the second image is classified into a predetermined class composed of a combination of hue and brightness, and a cumulative pixel count is calculated for each classified class, thereby obtaining a two-dimensional histogram. Is created.

明度の分割については、第1の実施形態の場合と異なる。これはリニア画像とノンリニア画像との違いによるものである。ステップS35では、明度(V)は、明度値が0〜25(v1)、26〜50(v2)、51〜84(v3)、85〜169(v4)、170〜199(v5)、200〜224(v6)、225〜255(v7)の7つの階級に分割される。   The lightness division is different from that in the first embodiment. This is due to the difference between a linear image and a non-linear image. In step S35, the lightness (V) is 0-25 (v1), 26-50 (v2), 51-84 (v3), 85-169 (v4), 170-199 (v5), 200- It is divided into seven classes of 224 (v6) and 225 to 255 (v7).

色相(H)は、色相値が0〜39、330〜359の肌色色相領域(H1及びH2)、色相値が40〜160の緑色色相領域(H3)、色相値が161〜250の青色色相領域(H4)、赤色色相領域(H5)の4つの領域に分割される。これらは第1の実施形態の場合と同様である。また、肌色色相領域が、さらに、肌色領域(H1)と、それ以外の領域(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). These are the same as in the case of the first embodiment. Similarly, the skin color hue region is further divided into a skin color region (H1) and another region (H2).

ステップS36が、ステップS35とともに、第2の占有率算出工程として機能し、第2の占有率が算出されるのは第1の実施形態の場合と同様である。   Step S36, together with step S35, functions as a second occupancy rate calculation step, and the second occupancy rate is calculated as in the case of the first embodiment.

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

Figure 2007228132
Figure 2007228132

<指標算出処理2>
次に、図18のフローチャートを参照して、指標算出処理(図14のステップS22)について説明する。
<Indicator calculation process 2>
Next, the index calculation process (step S22 in FIG. 14) will be described with reference to the flowchart in FIG.

まず、第2の指標算出工程であるステップS40では、第1の占有率に、予め設定された係数(第2の係数)を乗算して和をとることにより、指標2が算出される。指標2は、主要被写体がアンダーな逆光と主要被写体がオーバーな画像間における、画像データの画面の中心と外側の明暗関係の差異を示すものである。   First, in step S40, which is the second index calculation step, index 2 is calculated by multiplying the first occupancy by a preset coefficient (second coefficient) and taking the sum. The index 2 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.

以下、指標2の算出方法について説明する。   Hereinafter, a method for calculating the index 2 will be described.

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

Figure 2007228132
Figure 2007228132

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

明度領域vi、画面領域njにおける第2の係数をEijとすると、指標2を算出するためのnk領域(画面領域nk)の和は、式(2)のように定義される。   If the second 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 2 is defined as shown in Expression (2).

Figure 2007228132
Figure 2007228132

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

n1領域の和=Q11×40.1+Q21×37+(中略)…+Q71×22
(2−5)
n2領域の和=Q12×(−14.8)+Q22×(−10.5)+(中略)
…+Q72×0 (2−6)
n3領域の和=Q13×24.6+Q23×12.1+(中略)…+Q73×10.1
(2−7)
n4領域の和=Q14×1.55+Q24×(−32.9)+(中略)
…+Q74×(−52.2) (2−8)
指標2は、式(2−5)〜(2−8)で示されたn1〜n4領域の和を用いて、式(21)のように定義される。
Sum of n1 region = Q11 × 40.1 + Q21 × 37 + (omitted)... + Q71 × 22
(2-5)
Sum of n2 regions = Q12 × (−14.8) + Q22 × (−10.5) + (omitted)
... + Q72 × 0 (2-6)
Sum of n3 regions = Q13 × 24.6 + Q23 × 12.1 + (omitted) ... + Q73 × 10.1
(2-7)
Sum of n4 regions = Q14 × 1.55 + Q24 × (−32.9) + (omitted)
... + Q74 × (−52.2) (2-8)
The index 2 is defined as in Expression (21) using the sum of the n1 to n4 regions shown in Expressions (2-5) to (2-8).

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

指標2が算出されると、第3の指標算出工程であるステップS41で、第2の占有率に予め設定された第3の係数を乗算して和をとることにより、指標3が算出され、次いで、第4の指標算出工程であるステップS42では、同じく第2の占有率に予め設定された第4の係数を乗算して和をとることにより、指標4が算出されるのは、第1の実施形態の場合と同様である。   When the index 2 is calculated, the index 3 is calculated by multiplying the second occupancy by a preset third coefficient in step S41, which is the third index calculating step, and taking the sum. Next, in step S42, which is a fourth index calculating step, the index 4 is calculated by multiplying the second occupancy by a preset fourth coefficient to obtain the sum. This is the same as the case of the embodiment.

指標3は、主要被写体のオーバー度を表す指標であり、「主要被写体がオーバー」と判別されるべき画像のみを他の撮影シーンから分離するためのものである。指標4は、空色高明度、顔色低明度等の逆光撮影時の特徴を複合的に表す指標であり、「逆光」、「主要被写体がアンダー」と判別されるべき画像のみを他の撮影シーンから分離するためのものである。   The index 3 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. The index 4 is an index that collectively represents the characteristics at the time of backlight shooting such as sky blue high brightness and low face color brightness. Only images that should be determined as “backlight” and “main subject is under” are taken from other shooting scenes. It is for separation.

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

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

Figure 2007228132
Figure 2007228132

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

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

Figure 2007228132
Figure 2007228132

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

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

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

Figure 2007228132
Figure 2007228132

表11によると、肌色色相領域(H1)の中間明度に分布する領域(v4)から算出される占有率には負(−)の係数が用いられ、肌色色相嶺域(H1)の低明度(シャドー)領域(v2、v3)から算出される占有率には正(+)の係数が用いられる。図35は、肌色領域(H1)における第4の係数を、明度全体にわたって連続的に変化する曲線(係数曲線)として示したものである。表11及び図35によると、肌色色相領域の、明度値が26〜84の低明度(シャドー)領域の第4の係数の符号は正(+)であり、明度値が85〜169の中間明度領域及びその他の領域の第4の係数の符号は負(−)であり、両領域での係数の符号が異なっていることがわかる。   According to Table 11, a negative (−) coefficient is used for the occupation ratio calculated from the region (v4) distributed in the intermediate brightness of the flesh color hue region (H1), and the low lightness of the flesh color hue range (H1) ( A positive (+) coefficient is used for the occupation ratio calculated from the shadow area (v2, v3). FIG. 35 shows the fourth coefficient in the skin color region (H1) as a curve (coefficient curve) that continuously changes over the entire brightness. According to Table 11 and FIG. 35, the sign of the fourth coefficient of the low brightness (shadow) area of the flesh color hue area having a brightness value of 26 to 84 is positive (+), and the intermediate brightness of the brightness value of 85 to 169 is shown. It can be seen that the sign of the fourth coefficient in the area and the other areas is negative (−), and the sign of the coefficient in both areas is different.

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

Figure 2007228132
Figure 2007228132

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

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

指標4=H1領域の和+H2領域の和+H3領域の和+H4領域の和+1.554
(23)
指標3及び指標4は、第2の画像の明度と色相の分布量に基づいて算出されるため、画像がカラー画像である場合の撮影シーンの判別に有効である。
Index 4 = sum of H1 region + sum of H2 region + sum of H3 region + sum of H4 region + 1.554
(23)
Since the index 3 and the index 4 are calculated on the basis of 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.

指標3〜4が算出されると、第5の指標算出工程であるステップS43で、第2の画像の画面中央部における肌色の平均輝度値と、最大輝度値と平均輝度値との差分値のそれぞれに、予め設定された係数を乗算することにより、指標5が算出される。   When the indices 3 to 4 are calculated, in step S43, which is a fifth index calculating step, the average luminance value of the skin color at the screen center portion of the second image and the difference value between the maximum luminance value and the average luminance value are calculated. The index 5 is calculated by multiplying each by a preset coefficient.

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

まず、ステップS50からステップS54に至る、第2の画像の画面中央部における肌色領域の平均輝度値x1、第2の画像の最大輝度値と平均輝度値との差分値x2=最大輝度値−平均輝度値、第2の画像の輝度の標準偏差x3、画面中央部における平均輝度値x4、そして第2の画像における肌色領域の最大輝度値Yskin_maxと最小輝度値Yskin_minの差分値と、肌色領域の平均輝度値Yskin_aveとの比較値x5を算出する処理については、第1の実施形態の場合と同様であり、説明を省略する。   First, from step S50 to step S54, the average luminance value x1 of the skin color region in the center of the screen of the second image, the difference value x2 between the maximum luminance value and the average luminance value of the second image = maximum luminance value-average The luminance value, the standard deviation x3 of the luminance of the second image, the average luminance value x4 in the center of the screen, the difference value between the maximum luminance value Yskin_max and the minimum luminance value Yskin_min of the skin color region in the second image, and the average of the skin color region The process of calculating the comparison value x5 with the luminance value Yskin_ave is the same as in the case of the first embodiment, and a description thereof will be omitted.

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

指標5=0.06×x1+1.13×x2+0.02×x3+(−0.01)
×x4+0.03×x5−6.50 (8−3)
この指標5は、第2の画像の画面の構図的な特徴だけでなく、輝度ヒストグラム分布情報を持ち合わせており、特に、主要被写体がオーバーである撮影シーンとアンダー撮影シーンの判別に有効である。
Index 5 = 0.06 × x1 + 1.13 × x2 + 0.02 × x3 + (− 0.01)
* X4 + 0.03 * x5-6.50 (8-3)
This index 5 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 a shooting scene in which the main subject is over and an under shooting scene.

指標5が算出されると、第6の指標算出工程であるステップS44で、指標2、3及び第2の画像の画面中央部における肌色領域の平均輝度値に、撮影条件に応じて予め設定された重み係数を乗算することにより、指標6が算出される。   When the index 5 is calculated, in step S44, which is the sixth index calculation step, the average brightness value of the skin color area in the center of the screen of the indexes 2, 3 and the second image is preset according to the shooting conditions. The index 6 is calculated by multiplying the weighting factors.

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

以下、指標6及び指標7の算出方法について説明する。   Hereinafter, a method for calculating the index 6 and the index 7 will be described.

第2の画像の画面中央部における肌色領域の平均輝度値を指標9とする。ここでの画面中央部とは、例えば、図32(a)の領域n2、領域n3及び領域n4から構成される領域である。このとき、指標6は、指標3、指標2、指標9を用いて式(24)のように定義され、指標7は、指標4、指標2、指標9を用いて式(25)のように定義される。   The average luminance value of the skin color area in the center of the screen of the second image is set as an index 9. The center portion of the screen here is, for example, a region composed of the region n2, the region n3, and the region n4 in FIG. At this time, the index 6 is defined as in Expression (24) using the index 3, index 2, and index 9, and the index 7 is defined as in Expression (25) using the index 4, index 2, and index 9. Defined.

指標6=0.46×指標3+0.61×指標2+0.01×指標9−0.79(24)
指標7=0.58×指標4+0.18×指標2+(−0.03)×指標9+3.34
(25)
<シーン判別2>
図14のステップS23(シーン判別)に戻る。
Index 6 = 0.46 × index 3 + 0.61 × index 2 + 0.01 × index 9−0.79 (24)
Index 7 = 0.58 × Index 4 + 0.18 × Index 2 + (− 0.03) × Index 9 + 3.34
(25)
<Scene discrimination 2>
Returning to step S23 (scene discrimination) in FIG.

指標5〜7が算出されると、これらの指標の値に基づいて撮影シーンが判別されるが、シーン判別方法は第1の実施形態の場合と同様であり、説明は省略する。   When the indices 5 to 7 are calculated, the photographic scene is determined based on the values of these indices. The scene determination method is the same as in the first embodiment, and the description thereof is omitted.

(第1の指標算出処理のフロー)
次に、図24(a)のフローチャートを参照して、画像処理装置2での第1の指標算出処理(図31のステップS95)について説明する。
(First index calculation process flow)
Next, the first index calculation process (step S95 in FIG. 31) in the image processing apparatus 2 will be described with reference to the flowchart in FIG.

第1の指標算出処理は、図31に示すように、第1の占有率算出処理(図31のステップS93)に引き続いて行われる。すなわち、第1の占有率に基づいて指標1を算出する。第1の占有率算出工程の説明は、前述したので省略する。第1の占有率算出において、画面外縁からの距離による分割が3つではなく4つの領域であることも前述したとおりである。   As shown in FIG. 31, the first index calculation process is performed subsequent to the first occupancy ratio calculation process (step S93 in FIG. 31). That is, index 1 is calculated based on the first occupancy rate. Since the description of the first occupancy rate calculation step has been described above, it will be omitted. As described above, in the first occupancy ratio calculation, the division based on the distance from the outer edge of the screen is not four areas but four areas.

図24(a)のフローチャートで、引き続く第1の指標算出工程(図31のステップS95)の説明をする。   A subsequent first index calculation step (step S95 in FIG. 31) will be described with reference to the flowchart in FIG.

図32(b)に、4つの領域n1〜n4と明度の組み合わせからなる階級を示す。まず、図32(b)において、画面中央部をn4、n3、n2の領域とし、高明度部をv7の領域とする。そうすると、v7でn2、またはv7でn3、またはv7でn4の組み合わせを合わせた階級は、画面中央部と高明度との組み合わせからなる階級であり、第1の実施形態と同様に、その階級についての第1の占有率を図に示したようにZ1とし、Z1を取得する(ステップS60)。   FIG. 32B shows a class composed of combinations of four regions n1 to n4 and brightness. First, in FIG. 32 (b), the central portion of the screen is the n4, n3, and n2 regions, and the high brightness portion is the v7 region. Then, the class combining the combination of n2 in v7, n3 in v7, or n4 in v7 is a class composed of a combination of the center of the screen and high brightness, and the class is the same as in the first embodiment. The first occupancy ratio is set to Z1 as shown in the figure, and Z1 is acquired (step S60).

また図32(b)において、画面外縁部をn1の領域とし、高明度部をv7の領域とする。そうすると、v7でn1の組み合わせからなる階級は、画面外縁部と高明度との組み合わせからなる階級であり、第1の実施形態と同様に、その階級についての第1の占有率を図に示したようにZ2とし、Z2を取得する(ステップS61)。   In FIG. 32B, the outer edge of the screen is the n1 region, and the high brightness portion is the v7 region. Then, the class consisting of the combination of n1 in v7 is a class consisting of a combination of the outer edge of the screen and high brightness, and the first occupancy rate for the class is shown in the figure as in the first embodiment. Z2 is acquired as described above (step S61).

Z1及びZ2は、Z1が大きく、Z2が小さいほど、画面全体に対して、画面中央部に高明度部が多い(すなわち、白飛びが起こりやすい)ことを表す因子であるのも、また、さらに次のようなZ3、Z4の因子を取得することが望ましいのも、第1の実施形態の場合と同様である。   Z1 and Z2 are factors that indicate that, as Z1 is larger and Z2 is smaller, there are more high brightness portions in the center of the screen (that is, whiteout is likely to occur) with respect to the entire screen. It is desirable to acquire the following factors of Z3 and Z4 as in the case of the first embodiment.

画面中央部(n4、n3とn2)の肌色画素の最大明度をZ3とし、Z3を取得する(ステップS62)。また、画面中央部かつ高明度の組み合わせからなる階級(第1占有率がZ1で示される)での肌色画素占有率をZ4とし、Z4を取得する(ステップS63)。   Z3 is obtained by setting the maximum brightness of the flesh color pixels in the center (n4, n3 and n2) of the screen as Z3 (step S62). Further, Z4 is acquired by setting the skin color pixel occupancy rate in the center of the screen and the class (the first occupancy rate is indicated by Z1) consisting of a combination of high brightness as Z4 (step S63).

最後に、ステップS64において、ステップS60からS63で取得したZ1、Z2、Z3、Z4の各因子に基づいて、白飛び度(指標1)が算出される。このように、ステップS60からS64は第1の指標算出工程として機能する。   Finally, in step S64, the whiteout degree (index 1) is calculated based on the factors of Z1, Z2, Z3, and Z4 acquired in steps S60 to S63. Thus, steps S60 to S64 function as a first index calculation process.

白飛び度は、撮影シーンにより階調補正処理を行った場合に、画面中で白飛びする面積が大きくなったり、人物の顔などの主要被写体部で白飛びが起こったりすることを予測して、階調処理を抑制するための指標であり、後で述べる階調処理条件の設定を補正するために用いるのも、第1の実施形態の場合と同様である。   The degree of overexposure predicts that when the gradation correction processing is performed depending on the shooting scene, the overexposure area on the screen will increase, or overexposure will occur in the main subject area such as a human face. This is an index for suppressing gradation processing, and is used to correct the setting of gradation processing conditions described later, as in the case of the first embodiment.

指標1、すなわち白飛び度(W)は、上記で取得した因子を用いて、例えば次の式のように構成する。   The index 1, that is, the whiteout degree (W), is configured as shown in the following equation, for example, using the factors acquired above.

白飛び度(W)=Z1×a+Z2×b+Z3×c+Z4×d+定数×e
a、b、c、d、e、fは、所定の係数であり、各因子の数値化に応じて、予め実験的に定めておけばよい。但し、第1の係数であるaと第8の係数である係数bは、逆符号である。
Whiteness (W) = Z1 × a + Z2 × b + Z3 × c + Z4 × d + constant × e
“a”, “b”, “c”, “d”, “e”, and “f” are predetermined coefficients and may be experimentally determined in advance according to the numerical value of each factor. However, the first coefficient “a” and the eighth coefficient “b” have opposite signs.

こうして求めた指標1(白飛び度(W))を用いた階調処理条件の補正については、以下の階調処理条件設定のフローにおいて説明する。   The correction of the gradation processing condition using the index 1 (the degree of whiteout (W)) thus obtained will be described in the following gradation processing condition setting flow.

(階調処理条件設定のフロー)
次に、第1の画像に対する階調処理条件設定(図31のステップS96)は、第1の実施形態の場合と同様であり、図24(b)のフローチャートを用いて説明したとおりである。よって説明は省略する。
(Flow of gradation processing condition setting)
Next, the gradation processing condition setting for the first image (step S96 in FIG. 31) is the same as that in the first embodiment, and is as described with reference to the flowchart in FIG. Therefore, explanation is omitted.

以上のように、上記第1の実施形態、第2の実施形態によれば、撮影された画像の撮影シーンを判別することによって、自動的に補正処理条件を設定するに当たり、画像補正時の白飛び発生状況を予測する要素として、画面内の位置における高明度部の分布に基づき、白飛び発生の状況を示す指標を算出し、設定した補正処理条件をその指標に応じて補正し直すことにより、白飛びの発生しそうな場合もそれを抑制する方向に補正を加えることができ、より適切な補正画像を得ることのできる撮像装置、画像処理装置、画像処理方法、及び画像処理プログラムが提供できる。   As described above, according to the first embodiment and the second embodiment, when automatically setting the correction processing condition by determining the shooting scene of the shot image, the white at the time of image correction is set. As an element that predicts the occurrence of skipping, by calculating an index that indicates the occurrence of whiteout based on the distribution of the high brightness part at a position in the screen, and correcting the set correction processing conditions according to that index Further, it is possible to provide an imaging apparatus, an image processing apparatus, an image processing method, and an image processing program that can correct a direction in which whiteout is likely to occur, and that can obtain a more appropriate corrected image. .

なお本発明の実施形態は、上記の実施形態に限定されるものではなく、本発明の趣旨に則る限り、様々な変更された形態もその範囲に含まれるものである。   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 flow church which shows exposure amount control in an AE control part. シャッタ速度の制御において撮像素子に電荷が蓄積する様子を示す図である。It is a figure which shows a mode that an electric charge accumulate | stores in an image pick-up element in control of shutter speed. AF制御部での画像の焦点を合わせる制御を示すフローチャートである。It is a flowchart which shows the control which adjusts the focus of the image in AF control part. 撮影光学系の移動に伴うコントラスト情報の変化と合焦点位置検出の様子を示す図である。It is a figure which shows the change of the contrast information accompanying the movement of an imaging optical system, and the mode of a focal point position detection. 画素補間部での、RGB各色成分ごとに画素間の補間を行う画像データの処理を示すフローチャートである。It is a flowchart which shows the process of the image data which performs the interpolation between pixels for every RGB color component in a pixel interpolation part. AWB制御部での、撮影画像におけるホワイトバランスを自動的に調整する処理を示すフローチャートである。It is a flowchart which shows the process which automatically adjusts the white balance in a picked-up image in an AWB control part. ガンマ補正曲線の例を示す図である。It is a figure which shows the example of a gamma correction curve. 画像処理部10の内部構成を示すブロック図である。2 is a block diagram showing an internal configuration of an image processing unit 10. FIG. 撮影された第1の画像の一例を示す図(a)と、第1の画像を分割し、M×N画素の縮小画像とした第2の画像の一例を示す図(b)である。FIG. 4A is a diagram illustrating an example of a captured first image, and FIG. 4B is a diagram illustrating an example of a second image obtained by dividing the first image into a reduced image of M × N pixels. 撮像装置1において実行される処理の全体の流れを示すフローチャートである。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. 画面の外縁からの距離に応じて決定される領域n1〜n3を示す図(a)と、領域n1〜n3と明度からなる階級を示す図(b)である。It is the figure (a) which shows the area | regions n1-n3 determined according to the distance from the outer edge of a screen, and the figure (b) which shows the class which consists of the area | regions n1-n3 and brightness. 明度と色相からなる階級を示す図である。It is a figure which shows the class which consists of brightness and hue. 指標算出処理を示すフローチャートである。It is a flowchart which shows an index calculation process. 指標2を算出するための、第1の占有率に乗算する第2の係数を表す曲線を領域別(n1〜n3)に示す図である。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 for every area | region (n1-n3). 指標3を算出するための、第2の占有率に乗算する第3の係数を表す曲線を示す図である。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. 指標4を算出するための、第2の占有率に乗算する第4の係数を表す曲線を示す図である。It is a figure which shows the curve showing the 4th coefficient by which the 2nd occupation rate for calculating the parameter | index 4 is multiplied. 指標5算出処理を示すフローチャートである。It is a flowchart which shows the parameter | index 5 calculation process. 撮影シーン(順光、ストロボ、逆光、アンダー)と指標5〜7の関係を示すプロット図である。It is a plot figure which shows the relationship between an imaging | photography scene (forward light, strobe, backlight, under) and the indexes 5-7. (a)は第1の指標算出処理を示すフローチャートである。(b)は階調処理条件設定を示すフローチャートである。(A) is a flowchart which shows a 1st parameter | index calculation process. (B) is a flowchart showing 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. 本発明の実施形態に係る画像処理装置2の外観構成例を示す図である。It is a figure which shows the example of an external appearance structure of the image processing apparatus 2 which concerns on embodiment of this invention. 画像処理装置2の構成例を示すブロック図である。3 is a block diagram illustrating a configuration example of an image processing device 2. FIG. 画像処理装置2において実行される処理の全体の流れを示すフローチャートである。3 is a flowchart showing an overall flow of processing executed in the image processing apparatus 2. 画面の外縁からの距離に応じて決定される領域n1〜n4を示す図(a)と、領域n1〜n4と明度からなる階級を示す図(b)である。It is the figure (a) which shows the area | region n1-n4 determined according to the distance from the outer edge of a screen, and the figure (b) which shows the class which consists of area | region n1-n4 and a brightness. 指標2を算出するための、第1の占有率に乗算する第2の係数を表す曲線を領域別(n1〜n4)に示す図である。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 for every area | region (n1-n4). 指標3を算出するための、第2の占有率に乗算する第3の係数を表す曲線を示す図である。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. 指標4を算出するための、第2の占有率に乗算する第4の係数を表す曲線を示す図である。It is a figure which shows the curve showing the 4th coefficient by which the 2nd occupation rate for calculating the parameter | index 4 is multiplied.

符号の説明Explanation of symbols

1 撮像装置
2 画像処理装置
10 画像処理部
11 筐体
13 装填部
14 画像読み込み部
15 画像書き込み部
16 プリント作成部
17 トレー
20 撮像処理部
21 筐体
22 十字キー
23 撮影光学系
24 フラッシュ
25 ファインダ
26 電源スイッチ
27 表示部
28 レリーズボタン
31 プロセッサ
32 メモリ
33 撮像素子
37 画像データ出力部
38 操作部
41 タイミングジェネレータ
42 シャッタユニット
43 絞りユニット
44 フォーカスユニット
51 AE制御部
52 AF制御部
53 画素補間部
54 AWB制御部
55 ガンマ補正部
71 操作部
72 制御部
73 フィルムスキャンデータ処理部
74 反射原稿スキャンデータ処理部
75 画像データ書式解読処理部
76 CRT固有処理部
77 プリンタ固有処理部A
78 プリンタ固有処理部B
79 画像データ書式作成処理部
81 フィルムスキャナ部
82 反射原稿入力装置
83 画像転送手段
84 通信手段(入力)
85 CRT
86 露光処理部
87 外部プリンタ
88 画像搬送部
89 通信手段(出力)
101 第1画像取得部
102 第2画像取得部
103a 第1占有率算出部
103b 第2占有率算出部
104 指標算出部
105 シーン判別部
106 第1指標算出部
107 階調処理条件設定部
108 階調変換処理部
DESCRIPTION OF SYMBOLS 1 Imaging apparatus 2 Image processing apparatus 10 Image processing part 11 Case 13 Loading part 14 Image reading part 15 Image writing part 16 Print creation part 17 Tray 20 Imaging processing part 21 Case 22 Cross key 23 Shooting optical system 24 Flash 25 Finder 26 Power switch 27 Display unit 28 Release button 31 Processor 32 Memory 33 Image 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 55 Gamma Correction Unit 71 Operation Unit 72 Control Unit 73 Film Scan Data Processing Unit 74 Reflected Original Scan Data Processing Unit 75 Image Data Format Decoding Processing Unit 76 CRT Specific Processing Unit 77 Printer Specific Processing Part A
78 Printer Specific Processing Unit B
79 Image data format creation processing section 81 Film scanner section 82 Reflected document input device 83 Image transfer means 84 Communication means (input)
85 CRT
86 Exposure processing unit 87 External printer 88 Image transport unit 89 Communication means (output)
DESCRIPTION OF SYMBOLS 101 1st image acquisition part 102 2nd image acquisition part 103a 1st occupation rate calculation part 103b 2nd occupation rate calculation part 104 Index calculation part 105 Scene discrimination | determination part 106 1st index calculation part 107 Gradation processing condition setting part 108 Gradation Conversion processing section

Claims (20)

撮影により取得された画像の画像データに基づき撮影シーンの判別処理を行うシーン判別処理手段と、
前記シーン判別処理手段によって得られたシーン判別結果に基づき、前記画像に対する階調処理条件を設定する階調処理条件設定手段と、
前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、
前記第1の占有率算出手段により算出された第1の占有率のうち、少なくとも画面中央部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、を有し、
前記階調処理条件設定手段は、
前記シーン判別結果に基づく階調処理条件の設定を、前記第1の指標算出手段により算出された指標1に基づき補正する、
ことを特徴とする撮像装置。
Scene discrimination processing means for performing discrimination processing of a shooting scene based on image data of an image acquired by shooting;
Gradation processing condition setting means for setting gradation processing conditions for the image based on the scene determination result obtained by the scene determination processing means;
A first occupation for classifying the image data into a class composed of a combination of a distance from the outer edge of the screen and a brightness, and calculating a first occupation ratio indicating a ratio of the entire image data for each classified class Rate calculation means;
Of the first occupancy ratios calculated by the first occupancy ratio calculating means, multiplying the occupancy ratio for the class composed of at least the center portion of the screen and high brightness by a preset first coefficient. And a first index calculating means for calculating index 1;
The gradation processing condition setting means includes:
Correcting the setting of the gradation processing condition based on the scene discrimination result based on the index 1 calculated by the first index calculating means;
An imaging apparatus characterized by that.
撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得手段を有し、
前記シーン判別処理手段は、前記第2の画像取得手段により取得された前記第2の画像の画像データに基づき、撮影シーンの判別処理を行う、
ことを特徴とする請求項1に記載の撮像装置。
A second image acquisition means for acquiring a second image obtained by reducing the image size from the first image acquired by photographing;
The scene determination processing unit performs a shooting scene determination process based on the image data of the second image acquired by the second image acquisition unit.
The imaging apparatus according to claim 1.
前記第1の占有率算出手段は、前記第2の画像取得手段により取得された第2の画像の画像データから前記第1の占有率を算出する、
ことを特徴とする請求項2に記載の撮像装置。
The first occupancy ratio calculating means calculates the first occupancy ratio from the image data of the second image acquired by the second image acquisition means;
The imaging apparatus according to claim 2.
前記シーン判別処理手段は、
前記第2の画像の画像データについて色情報を取得し、
取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、
前記第1の占有率算出手段により算出された第1の占有率に、予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、
前記第2の占有率に予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出手段と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、指標5を算出する第5の指標算出手段と、
前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、指標6を算出する第6の指標算出手段と、
前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、指標7を算出する第7の指標算出手段と、
前記指標5、前記指標6、及び前記指標7に基づき、前記画像データのシーンを特定するシーン判別手段と、を有する、
ことを特徴とする請求項2または3に記載の撮像装置。
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 predetermined brightness and hue, and a second occupancy ratio indicating a proportion of the entire image data for each classified class Second occupancy rate calculating means for calculating
A second index calculating means for calculating index 2 by multiplying the first occupancy calculated by the first occupancy calculating means 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 the index 4 by multiplying the second occupancy by a preset fourth coefficient;
A fifth index calculating means for calculating index 5 by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a preset fifth coefficient;
A sixth index calculating means for calculating the index 6 by multiplying at least one of the index 2, the index 3 and the index 4 by a preset sixth coefficient;
A seventh index calculating means for calculating the index 7 by multiplying at least one of the index 2, the index 3 and the index 4 by a preset seventh coefficient;
Scene discriminating means for identifying the scene of the image data based on the index 5, the index 6 and the index 7.
The imaging apparatus according to claim 2 or 3, wherein
前記第1の指標算出手段は、
前記第1の占有率算出手段により算出された第1の占有率のうち、さらに画面外縁部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第8の係数を乗算することにより指標1を算出する、
ことを特徴とする請求項1乃至4の何れか1項に記載の撮像装置。
The first index calculation means includes:
Of the first occupancy ratio calculated by the first occupancy ratio calculating means, the occupancy ratio for the class composed of a combination of the outer edge of the screen and high brightness is multiplied by a preset eighth coefficient. To calculate index 1
The image pickup apparatus according to claim 1, wherein the image pickup apparatus is an image pickup apparatus.
撮影された画像の画像データに基づき撮影シーンの判別処理を行うシーン判別処理手段と、
前記シーン判別処理手段によって得られたシーン判別結果に基づき、前記画像に対する階調処理条件を設定する階調処理条件設定手段と、
前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、
前記第1の占有率算出手段により算出された第1の占有率のうち、少なくとも画面中央部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、を有し、
前記階調処理条件設定手段は、
前記シーン判別結果に基づく階調処理条件の設定を、前記第1の指標算出手段により算出された指標1に基づき補正する、
ことを特徴とする画像処理装置。
Scene discrimination processing means for performing discrimination processing of a shooting scene based on image data of a shot image;
Gradation processing condition setting means for setting gradation processing conditions for the image based on the scene determination result obtained by the scene determination processing means;
A first occupation for classifying the image data into a class composed of a combination of a distance from the outer edge of the screen and a brightness, and calculating a first occupation ratio indicating a ratio of the entire image data for each classified class Rate calculation means;
Of the first occupancy ratios calculated by the first occupancy ratio calculating means, multiplying the occupancy ratio for the class composed of at least the center portion of the screen and high brightness by a preset first coefficient. And a first index calculating means for calculating index 1;
The gradation processing condition setting means includes:
Correcting the setting of the gradation processing condition based on the scene discrimination result based on the index 1 calculated by the first index calculating means;
An image processing apparatus.
撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得手段を有し、
前記シーン判別処理手段は、前記第2の画像取得手段により取得された前記第2の画像の画像データに基づき、撮影シーンの判別処理を行う、
ことを特徴とする請求項6に記載の画像処理装置。
A second image acquisition means for acquiring a second image obtained by reducing the image size from the first image acquired by photographing;
The scene determination processing unit performs a shooting scene determination process based on the image data of the second image acquired by the second image acquisition unit.
The image processing apparatus according to claim 6.
前記第1の占有率算出手段は、前記第2の画像取得手段により取得された第2の画像の画像データから前記第1の占有率を算出する、
ことを特徴とする請求項7に記載の画像処理装置。
The first occupancy ratio calculating means calculates the first occupancy ratio from the image data of the second image acquired by the second image acquisition means;
The image processing apparatus according to claim 7.
前記シーン判別処理手段は、
前記第2の画像の画像データについて色情報を取得し、
取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、
前記第1の占有率算出手段により算出された第1の占有率に、予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、
前記第2の占有率に予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出手段と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、指標5を算出する第5の指標算出手段と、
前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、指標6を算出する第6の指標算出手段と、
前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、指標7を算出する第7の指標算出手段と、
前記指標5、前記指標6、及び前記指標7に基づき、前記画像データのシーンを特定するシーン判別手段と、を有する、
ことを特徴とする請求項7または8に記載の画像処理装置。
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 predetermined brightness and hue, and a second occupancy ratio indicating a proportion of the entire image data for each classified class Second occupancy rate calculating means for calculating
A second index calculating means for calculating index 2 by multiplying the first occupancy calculated by the first occupancy calculating means 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 the index 4 by multiplying the second occupancy by a preset fourth coefficient;
A fifth index calculating means for calculating index 5 by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a preset fifth coefficient;
A sixth index calculating means for calculating the index 6 by multiplying at least one of the index 2, the index 3 and the index 4 by a preset sixth coefficient;
A seventh index calculating means for calculating the index 7 by multiplying at least one of the index 2, the index 3 and the index 4 by a preset seventh coefficient;
Scene discriminating means for identifying the scene of the image data based on the index 5, the index 6 and the index 7.
The image processing apparatus according to claim 7, wherein the image processing apparatus is an image processing apparatus.
前記第1の指標算出手段は、
前記第1の占有率算出手段により算出された第1の占有率のうち、さらに画面外縁部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第8の係数を乗算することにより指標1を算出する、
ことを特徴とする請求項6乃至9の何れか1項に記載の画像処理装置。
The first index calculation means includes:
Of the first occupancy ratio calculated by the first occupancy ratio calculating means, the occupancy ratio for the class composed of a combination of the outer edge of the screen and high brightness is multiplied by a preset eighth coefficient. To calculate index 1
The image processing apparatus according to claim 6, wherein the image processing apparatus is an image processing apparatus.
撮影された画像の画像データに基づき撮影シーンの判別処理を行うシーン判別処理工程と、
前記シーン判別処理工程によって得られたシーン判別結果に基づき、前記画像に対する階調処理条件を設定する階調処理条件設定工程と、
前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出工程と、
前記第1の占有率算出手段において算出された第1の占有率のうち、少なくとも画面中央部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出工程と、を備え、
前記階調処理条件設定工程では、
前記シーン判別結果に基づく階調処理条件の設定を、前記第1の指標算出工程において算出された指標1に基づき補正する、
ことを特徴とする画像処理方法。
A scene discrimination processing step for performing a discrimination process of a shooting scene based on the image data of the shot image;
A gradation processing condition setting step for setting gradation processing conditions for the image based on the scene determination result obtained by the scene determination processing step;
A first occupation for classifying the image data into a class composed of a combination of a distance from the outer edge of the screen and a brightness, and calculating a first occupation ratio indicating a ratio of the entire image data for each classified class Rate calculation process;
Of the first occupancy ratios calculated by the first occupancy ratio calculating means, multiplying the occupancy ratio for the class composed of at least the center of the screen and high brightness by a preset first coefficient. A first index calculation step of calculating index 1 by
In the gradation processing condition setting step,
Correcting the setting of the gradation processing condition based on the scene discrimination result based on the index 1 calculated in the first index calculation step;
An image processing method.
撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得工程を備え、
前記シーン判別処理工程は、前記第2の画像取得工程において取得された前記第2の画像の画像データに基づき、撮影シーンの判別処理を行う、
ことを特徴とする請求項11に記載の画像処理方法。
A second image acquisition step of acquiring a second image obtained by reducing the image size from the first image acquired by photographing;
The scene determination processing step performs a shooting scene determination process based on the image data of the second image acquired in the second image acquisition step.
The image processing method according to claim 11.
前記第1の占有率算出工程では、前記第2の画像取得工程において取得された第2の画像の画像データから前記第1の占有率を算出する、
ことを特徴とする請求項12に記載の画像処理方法。
In the first occupancy ratio calculating step, the first occupancy ratio is calculated from image data of the second image acquired in the second image acquisition step.
The image processing method according to claim 12.
前記シーン判別処理工程は、
前記第2の画像の画像データについて色情報を取得し、
取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出工程と、
前記第1の占有率算出工程において算出された第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出工程と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出工程と、
前記第2の占有率に予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出工程と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、指標5を算出する第5の指標算出工程と、
前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、指標6を算出する第6の指標算出工程と、
前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、指標7を算出する第7の指標算出工程と、
前記指標5、前記指標6、及び前記指標7に基づき、前記画像データのシーンを特定するシーン判別工程と、を備える、
ことを特徴とする請求項12または13に記載の画像処理方法。
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 predetermined brightness and hue, and a second occupancy ratio indicating a proportion of the entire image data for each classified class A second occupancy ratio calculating step for calculating
A second index calculating step for calculating index 2 by multiplying the first occupancy calculated in the first occupancy calculating step by a preset second coefficient;
A third index calculating step of calculating index 3 by multiplying the second occupancy by a preset third coefficient;
A fourth index calculating step of calculating index 4 by multiplying the second occupancy by a preset fourth coefficient;
A fifth index calculation step of calculating index 5 by multiplying the average brightness of the skin color at least in the center of the screen of the image data by a preset fifth coefficient;
A sixth index calculating step of calculating index 6 by multiplying at least one of the index 2, index 3 and index 4 by a preset sixth coefficient;
A seventh index calculation step of calculating the index 7 by multiplying at least one of the index 2, the index 3 and the index 4 by a preset seventh coefficient;
A scene determination step for identifying a scene of the image data based on the index 5, the index 6, and the index 7.
The image processing method according to claim 12 or 13,
前記第1の指標算出工程は、
前記第1の占有率算出工程において算出された第1の占有率のうち、さらに画面外縁部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第8の係数を乗算することにより指標1を算出する、
ことを特徴とする請求項11乃至14の何れか1項に記載の画像処理方法。
The first index calculation step includes
Of the first occupancy ratio calculated in the first occupancy ratio calculation step, an occupancy ratio for a class composed of a combination of the outer edge of the screen and high brightness is multiplied by a preset eighth coefficient. To calculate index 1
The image processing method according to claim 11, wherein:
コンピュータに画像処理を実行させるための画像処理プログラムであって、
撮影された画像の画像データに基づき撮影シーンの判別処理を行うシーン判別処理機能と、
前記シーン判別処理機能によって得られたシーン判別結果に基づき、前記画像に対する階調処理条件を設定する階調処理条件設定機能と、
前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出機能と、
前記第1の占有率算出機能により算出された第1の占有率のうち、少なくとも画面中央部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出機能と、を有し、
前記階調処理条件設定機能は、
前記シーン判別結果に基づく階調処理条件の設定を、前記第1の指標算出機能により算出された指標1に基づき補正する、
ことを特徴とする画像処理プログラム。
An image processing program for causing a computer to execute image processing,
A scene discrimination processing function for performing a scene discrimination process based on image data of a shot image;
A gradation processing condition setting function for setting gradation processing conditions for the image based on a scene determination result obtained by the scene determination processing function;
A first occupation for classifying the image data into a class composed of a combination of a distance from the outer edge of the screen and a brightness, and calculating a first occupation ratio indicating a ratio of the entire image data for each classified class Rate calculation function,
Of the first occupancy ratio calculated by the first occupancy ratio calculation function, multiplying the occupancy ratio for the class composed of at least the center portion of the screen and high brightness by a preset first coefficient. And a first index calculation function for calculating index 1;
The gradation processing condition setting function is
Correcting the setting of the gradation processing condition based on the scene discrimination result based on the index 1 calculated by the first index calculation function;
An image processing program characterized by that.
撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得機能を有し、
前記シーン判別処理機能は、前記第2の画像取得機能により取得された前記第2の画像の画像データに基づき、撮影シーンの判別処理を行う、
ことを特徴とする請求項16に記載の画像処理プログラム。
A second image acquisition function for acquiring a second image obtained by reducing the image size from the first image acquired by photographing;
The scene discrimination processing function performs a shooting scene discrimination process based on the image data of the second image acquired by the second image acquisition function.
The image processing program according to claim 16.
前記第1の占有率算出機能は、前記第2の画像取得機能により取得された第2の画像の画像データから前記第1の占有率を算出する、
ことを特徴とする請求項17に記載の画像処理プログラム。
The first occupancy rate calculation function calculates the first occupancy rate from image data of the second image acquired by the second image acquisition function.
The image processing program according to claim 17.
前記シーン判別処理機能は、
前記第2の画像の画像データについて色情報を取得し、
取得された前記色情報に基づいて、前記画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級ごとに、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出機能と、
前記第1の占有率算出機能により算出された第1の占有率に予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出機能と、
前記第2の占有率に予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出機能と、
前記第2の占有率に予め設定された第4の係数を乗算することにより、指標4を算出する第4の指標算出機能と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、指標5を算出する第5の指標算出機能と、
前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、指標6を算出する第6の指標算出機能と、
前記指標2、前記指標3、及び前記指標4のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、指標7を算出する第7の指標算出機能と、
前記指標5、前記指標6、及び前記指標7に基づき、前記画像データのシーンを特定するシーン判別機能と、を有する、
ことを特徴とする請求項17または18に記載の画像処理プログラム。
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 predetermined brightness and hue, and a second occupancy ratio indicating a proportion of the entire image data for each classified class A second occupancy ratio calculating function for calculating
A second index calculating function for calculating index 2 by multiplying the first occupancy calculated by the first occupancy calculating function 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 second occupancy by a preset fourth coefficient;
A fifth index calculation function for calculating index 5 by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a fifth coefficient set in advance;
A sixth index calculation function for calculating the index 6 by multiplying at least one of the index 2, the index 3 and the index 4 by a preset sixth coefficient;
A seventh index calculation function for calculating the index 7 by multiplying at least one of the index 2, the index 3 and the index 4 by a preset seventh coefficient;
A scene discrimination function for specifying a scene of the image data based on the index 5, the index 6, and the index 7.
The image processing program according to claim 17 or 18, characterized in that:
前記第1の指標算出機能は、
前記第1の占有率算出機能により算出された第1の占有率のうち、さらに画面外縁部と高明度との組み合わせからなる階級に対する占有率に、予め設定された第8の係数を乗算することにより指標1を算出する、
ことを特徴とする請求項16乃至19の何れか1項に記載の画像処理プログラム。
The first index calculation function is:
Of the first occupancy ratio calculated by the first occupancy ratio calculation function, the occupancy ratio for the class composed of a combination of the outer edge of the screen and high brightness is multiplied by a preset eighth coefficient. To calculate index 1
20. The image processing program according to claim 16, wherein the image processing program is any one of claims 16 to 19.
JP2006045082A 2006-02-22 2006-02-22 Imaging apparatus, image processing apparatus, image processing method and image processing program Pending JP2007228132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006045082A JP2007228132A (en) 2006-02-22 2006-02-22 Imaging apparatus, image processing apparatus, image processing method and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006045082A JP2007228132A (en) 2006-02-22 2006-02-22 Imaging apparatus, image processing apparatus, image processing method and image processing program

Publications (1)

Publication Number Publication Date
JP2007228132A true JP2007228132A (en) 2007-09-06

Family

ID=38549518

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006045082A Pending JP2007228132A (en) 2006-02-22 2006-02-22 Imaging apparatus, image processing apparatus, image processing method and image processing program

Country Status (1)

Country Link
JP (1) JP2007228132A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014176062A (en) * 2013-03-13 2014-09-22 Seiko Epson Corp Camera and image processing method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014176062A (en) * 2013-03-13 2014-09-22 Seiko Epson Corp Camera and image processing method

Similar Documents

Publication Publication Date Title
US10412296B2 (en) Camera using preview image to select exposure
US6825884B1 (en) Imaging processing apparatus for generating a wide dynamic range image
JP5089405B2 (en) Image processing apparatus, image processing method, and imaging apparatus
EP2608527B1 (en) Image pickup apparatus, control method for image pickup apparatus, and storage medium
JP2007184888A (en) Imaging apparatus, image processor, image processing method, and image processing program
JP2006325015A (en) Image processing method, image processing apparatus, imaging apparatus, and image processing program
JP2006333205A (en) Imaging apparatus, image processing method and image processing program
JP2007228221A (en) Imaging apparatus, image processing apparatus, image processing method and image processing program
JP2007243542A (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
JP2007184887A (en) Image pickup device, image processor, image processing method and image processing program
JP2007293686A (en) Imaging apparatus, image processing apparatus, image processing method and image processing program
JP2007221678A (en) Imaging apparatus, image processor, image processing method and image processing program
JP2007312294A (en) Imaging apparatus, image processor, method for processing image, and image processing program
JP2007288245A (en) Imaging apparatus, image processing method, and image processing program
JP2007235369A (en) Imaging apparatus, and unit, method, and program for processing image
JP2007243556A (en) Imaging apparatus, image processing method, and image processing program
JP2006197460A (en) Image processing method, image processor, image processing program and image pickup device
JP2007201679A (en) Imaging apparatus, image processing method, and image processing program
JP2007228132A (en) Imaging apparatus, image processing apparatus, image processing method and image processing program
JP2007188464A (en) Imaging apparatus, image processor, image processing method, and image processing program
JP2007293528A (en) Imaging device, image processing device, image processing method and image processing program
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
JP2007235204A (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