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

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

Info

Publication number
JP2007300348A
JP2007300348A JP2006126118A JP2006126118A JP2007300348A JP 2007300348 A JP2007300348 A JP 2007300348A JP 2006126118 A JP2006126118 A JP 2006126118A JP 2006126118 A JP2006126118 A JP 2006126118A JP 2007300348 A JP2007300348 A JP 2007300348A
Authority
JP
Japan
Prior art keywords
image
index
image data
calculating
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
JP2006126118A
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 JP2006126118A priority Critical patent/JP2007300348A/en
Publication of JP2007300348A publication Critical patent/JP2007300348A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To obtain a more suitable image by automatically setting gray scale processing conditions by deciding a photographic scene and also making corrections based upon whether a vivid blue sky is included in an image. <P>SOLUTION: The photographic scene is decided on the basis of image data of an image obtained by photographing (step S6). Further, blue pixel information which is within a predetermined lightness value, on the upper part of a picture of the image data is acquired and skin color pixel information of the image data is acquired. On the basis of the blue pixel information, skin color pixel information, and absolute luminance information, an index 1 is calculated (step S9). Gray scale processing conditions for the image data are calculated on the basis of the decision result of the photographic scene, and the gray scale processing conditions are corrected on the basis of the index 1 (step S10). <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、カラー画像を取得する撮像装置、画像処理方法及び画像処理プログラムに関する。   The present invention relates to an imaging apparatus that acquires a color image, an image processing method, and an image processing program.

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

DSC等で撮影された画像を、種々の媒体を通じて画像として鑑賞する際には、撮影時の露出調整の不備等により、そのままでは鑑賞用画像として適切でない場合が多い。つまり、撮影時の露出の過不足を補うために、画像に対して適当な階調補正処理を行うことが望ましい。また、それ以外にも、例えば、逆光状態での撮影や、フラッシュを使用した近接撮影等、撮影時の光源状態の影響で、画像内で大きな輝度の偏りが生じている場合には、何らかの補正処理を行うことが望ましい。   When an image captured by DSC or the like is viewed as an image through various media, it is often not suitable as an image for viewing as it is due to inadequate exposure adjustment at the time of shooting. In other words, it is desirable to perform an appropriate gradation correction process on the image in order to compensate for overexposure or underexposure during shooting. In addition to this, for example, if there is a large luminance bias in the image due to the influence of the light source state at the time of shooting, such as shooting in a backlight state or close-up shooting using a flash, some correction It is desirable to perform processing.

このような問題点を解決するために、例えば、DSCで撮影された画像をプリンタで出力する際に、画像データの輝度ヒストグラムを解析することにより、画像のシーンを判別し、画像シーンに応じて画像処理を自動的に施す方法(特許文献1参照)や、DSCの撮影時に、分割測光結果から画面内コントラストの強弱や輝度分布状態等の被写体情報を得て、この被写体情報からDSC内で撮影画像データの階調を補正する方法(特許文献2参照)が提案されている。また、人物の肌の要素に着目し、デジタル画像中から肌色画素を検出し、肌色画素の統計量に基づいて算出された明度調整量をデジタル画像に適用することで、画像の明度を改善する方法が提案されている(特許文献3参照)。
特開2000−134467号公報 特開2001−54014号公報 特開2003−108988号公報
In order to solve such a problem, for example, when an image captured by DSC is output by a printer, an image scene is discriminated by analyzing a luminance histogram of image data, and according to the image scene. When performing image processing automatically (see Patent Document 1) or DSC image capturing, subject information such as contrast intensity in the screen and brightness distribution state is obtained from the divided photometry results, and the subject information is captured within the DSC. A method for correcting the gradation of image data (see Patent Document 2) has been proposed. In addition, paying attention to the elements of human skin, the skin color pixels are detected from the digital image, and the brightness adjustment amount calculated based on the statistics of the skin color pixels is applied to the digital image, thereby improving the brightness of the image. A method has been proposed (see Patent Document 3).
JP 2000-134467 A JP 2001-54014 A JP 2003-108988 A

しかしながら、上記従来技術においては、撮影シーンの状況によっては、補正により色鮮やかさが減少し、かえって好ましくない画像となってしまう場合があった。例えば、一般的な画像では、鑑賞時に最も注目されるのは人物の顔であり、人物の顔等の主要被写体の明るさと画像全体の明るさとのバランスが適正であることが重要である。しかし、画像中に色鮮やかな青空が写っている場合には、補正により青空の鮮やかさが減少してしまい、結果的に撮影者の意図を反映しない画像となってしまう場合があった。   However, in the above-described prior art, depending on the situation of the shooting scene, the vividness may be reduced by the correction, which may result in an undesirable image. For example, in a general image, a person's face is most noticed during viewing, and it is important that the balance between the brightness of the main subject such as the person's face and the brightness of the entire image is appropriate. However, when a colorful blue sky appears in the image, the vividness of the blue sky is reduced by the correction, resulting in an image that does not reflect the photographer's intention.

本発明は、上記の従来技術における問題に鑑みてなされたものであって、撮影された画像の撮影シーンを判別することによって、自動的に階調処理条件を設定するとともに、画像中に色鮮やかな青空が写っているか否かに基づく補正を加えることで、より適切な画像を得ることを課題とする。   The present invention has been made in view of the above-described problems in the prior art, and by automatically determining gradation processing conditions by determining the shooting scene of a shot image, the image is brightly colored. It is an object to obtain a more appropriate image by adding correction based on whether or not a clear blue sky is reflected.

上記課題を解決するために、請求項1に記載の撮像装置は、撮影により取得された画像の画像データに基づいて、撮影シーンを判別するシーン判別処理手段と、前記撮影シーンの判別結果に基づいて、前記画像データに対する階調処理条件を設定する階調処理条件設定手段と、前記画像の撮影時における撮像装置の傾斜の度合いを示す姿勢情報を取得し、前記姿勢情報に基づいて前記画像の上下を決定する画像上下決定手段と、前記画像データの画面上部に位置し、かつ所定の明度値内の青色画素情報を取得する青色画素情報取得手段と、少なくとも前記青色画素情報に予め設定された第1の係数を乗算することにより、第1の指標を算出する第1の指標算出手段と、を備え、前記階調処理条件設定手段は、前記第1の指標に基づいて、前記撮影シーンの判別結果に基づく階調処理条件を補正することを特徴とする。   In order to solve the above problem, an imaging apparatus according to claim 1 is based on a scene determination processing unit that determines a shooting scene based on image data of an image acquired by shooting, and a determination result of the shooting scene. A gradation processing condition setting means for setting a gradation processing condition for the image data, and posture information indicating a degree of inclination of the imaging device at the time of photographing the image, and acquiring the image information based on the posture information. Image up / down determining means for determining up and down, blue pixel information acquiring means for acquiring blue pixel information within the predetermined brightness value located at the upper part of the screen of the image data, and at least preset in the blue pixel information First gradation calculation means for calculating a first index by multiplying by a first coefficient, and the gradation processing condition setting means based on the first index, And correcting the gradation processing condition based on the shadow scene discrimination result.

請求項2に記載の発明は、請求項1に記載の撮像装置において、撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得手段を備え、前記シーン判別処理手段は、前記第2の画像の画像データに基づいて、撮影シーンを判別することを特徴とする。   Invention of Claim 2 is provided with the 2nd image acquisition means which acquires the 2nd image which reduced the image size from the 1st image acquired by photography in the imaging device of Claim 1, The scene discrimination processing means discriminates a photographic scene based on image data of the second image.

請求項3に記載の発明は、請求項2に記載の撮像装置において、前記青色画素情報取得手段は、前記第2の画像の画像データから前記青色画素情報を取得することを特徴とする。   According to a third aspect of the present invention, in the imaging apparatus according to the second aspect, the blue pixel information acquisition unit acquires the blue pixel information from image data of the second image.

請求項4に記載の発明は、請求項2又は3に記載の撮像装置において、前記シーン判別処理手段は、前記第2の画像の画像データから色情報を取得する色情報取得手段と、前記取得された色情報に基づいて、前記第2の画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記第2の画像の画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、前記取得された色情報に基づいて、前記第2の画像の画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記第2の画像の画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、前記第1の占有率に予め設定された第2の係数を乗算することにより、第2の指標を算出する第2の指標算出手段と、前記第1の占有率に予め設定された第3の係数を乗算することにより、第3の指標を算出する第3の指標算出手段と、前記第2の占有率に予め設定された第4の係数を乗算することにより、第4の指標を算出する第4の指標算出手段と、少なくとも前記第2の画像の画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、第5の指標を算出する第5の指標算出手段と、前記第2の指標、前記第3の指標及び前記第4の指標のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、第6の指標を算出する第6の指標算出手段と、前記第2の指標、前記第3の指標及び前記第4の指標のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、第7の指標を算出する第7の指標算出手段と、前記第5の指標、前記第6の指標及び前記第7の指標に基づいて、前記第1の画像の画像データの撮影シーンを特定するシーン判別手段と、を備えたことを特徴とする。   According to a fourth aspect of the present invention, in the imaging device according to the second or third aspect, the scene determination processing unit includes a color information acquisition unit that acquires color information from image data of the second image, and the acquisition Based on the obtained color information, the image data of the second image is classified into a class composed of a combination of predetermined brightness and hue, and occupies the entire image data of the second image for each classified class. First occupancy ratio calculating means for calculating a first occupancy ratio indicating a ratio, and based on the acquired color information, the image data of the second image is obtained from a combination of the distance from the outer edge of the screen and the brightness. A second occupancy ratio calculating means for calculating a second occupancy ratio indicating the ratio of the second image to the entire image data for each of the classified classes, and the first occupancy ratio Multiply the rate by a preset second factor A second index calculating means for calculating a second index, and a third index for calculating the third index by multiplying the first occupancy by a preset third coefficient. Index calculation means, fourth index calculation means for calculating a fourth index by multiplying the second occupancy by a preset fourth coefficient, and image data of at least the second image The fifth index calculating means for calculating the fifth index by multiplying the average brightness of the skin color in the center of the screen by a preset fifth coefficient, the second index, the third index Sixth index calculating means for calculating a sixth index by multiplying at least one of the index and the fourth index by a preset sixth coefficient; and the second index , At least of the third index and the fourth index Seventh index calculating means for calculating a seventh index by multiplying one or more indices by a preset seventh coefficient, the fifth index, the sixth index, and the seventh index Scene discriminating means for identifying a photographic scene of the image data of the first image based on the index.

請求項5に記載の発明は、請求項2〜4の何れか一項に記載の撮像装置において、前記第2の画像の画像データから肌色画素情報を取得する肌色画素情報取得手段を備え、前記第1の指標算出手段は、さらに、前記肌色画素情報に予め設定された第8の係数を乗算することにより、前記第1の指標を算出することを特徴とする。   Invention of Claim 5 is equipped with the skin color pixel information acquisition means which acquires skin color pixel information from the image data of a said 2nd image in the imaging device as described in any one of Claims 2-4, The first index calculating means further calculates the first index by multiplying the skin color pixel information by a preset eighth coefficient.

請求項6に記載の画像処理方法は、撮影により取得された画像の画像データに基づいて、撮影シーンを判別するシーン判別処理工程と、前記撮影シーンの判別結果に基づいて、前記画像データに対する階調処理条件を設定する階調処理条件設定工程と、前記画像の撮影時における撮像装置の傾斜の度合いを示す姿勢情報を取得し、前記姿勢情報に基づいて前記画像の上下を決定する画像上下決定工程と、前記画像データの画面上部に位置し、かつ所定の明度値内の青色画素情報を取得する青色画素情報取得工程と、少なくとも前記青色画素情報に予め設定された第1の係数を乗算することにより、第1の指標を算出する第1の指標算出工程と、を含み、前記階調処理条件設定工程では、前記第1の指標に基づいて、前記撮影シーンの判別結果に基づく階調処理条件を補正することを特徴とする。   The image processing method according to claim 6 is a scene determination processing step of determining a shooting scene based on image data of an image acquired by shooting, and a step for the image data based on the determination result of the shooting scene. Gradation processing condition setting step for setting a tone processing condition, and posture information indicating the degree of inclination of the imaging device at the time of shooting the image, and determining image up and down based on the posture information A blue pixel information acquisition step of acquiring blue pixel information located at the top of the screen of the image data and within a predetermined brightness value, and multiplying at least a first coefficient set in advance to the blue pixel information A first index calculation step of calculating a first index, and in the gradation processing condition setting step, the discrimination result of the shooting scene based on the first index And correcting the gradation processing condition based.

請求項7に記載の発明は、請求項6に記載の画像処理方法において、撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得工程を含み、前記シーン判別処理工程では、前記第2の画像の画像データに基づいて、撮影シーンを判別することを特徴とする。   The invention described in claim 7 includes a second image acquisition step of acquiring a second image obtained by reducing the image size from the first image acquired by photographing in the image processing method according to claim 6. The scene discrimination processing step discriminates a photographic scene based on image data of the second image.

請求項8に記載の発明は、請求項7に記載の画像処理方法において、前記青色画素情報取得工程では、前記第2の画像の画像データから前記青色画素情報を取得することを特徴とする。   The invention according to claim 8 is the image processing method according to claim 7, wherein in the blue pixel information acquisition step, the blue pixel information is acquired from image data of the second image.

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

請求項10に記載の発明は、請求項7〜9の何れか一項に記載の画像処理方法において、前記第2の画像の画像データから肌色画素情報を取得する肌色画素情報取得工程を含み、前記第1の指標算出工程では、さらに、前記肌色画素情報に予め設定された第8の係数を乗算することにより、前記第1の指標を算出することを特徴とする。   Invention of Claim 10 in the image processing method as described in any one of Claims 7-9 includes the skin color pixel information acquisition process which acquires skin color pixel information from the image data of a said 2nd image, In the first index calculation step, the first index is further calculated by multiplying the flesh color pixel information by a preset eighth coefficient.

請求項11に記載の発明は、コンピュータに、撮影により取得された画像の画像データに基づいて、撮影シーンを判別するシーン判別処理機能と、前記撮影シーンの判別結果に基づいて、前記画像データに対する階調処理条件を設定する階調処理条件設定機能と、前記画像の撮影時における撮像装置の傾斜の度合いを示す姿勢情報を取得し、前記姿勢情報に基づいて前記画像の上下を決定する画像上下決定機能と、前記画像データの画面上部に位置し、かつ所定の明度値内の青色画素情報を取得する青色画素情報取得機能と、少なくとも前記青色画素情報に予め設定された第1の係数を乗算することにより、第1の指標を算出する第1の指標算出機能と、を実現させるための画像処理プログラムであって、前記階調処理条件設定機能を実現させる際に、前記第1の指標に基づいて、前記撮影シーンの判別結果に基づく階調処理条件を補正させることを特徴とする画像処理プログラムである。   According to an eleventh aspect of the present invention, a scene discrimination processing function for discriminating a shooting scene based on image data of an image acquired by shooting on a computer, and the image data based on the discrimination result of the shooting scene. A gradation processing condition setting function for setting gradation processing conditions, and posture information indicating the degree of inclination of the imaging device at the time of capturing the image, and determining the upper and lower of the image based on the posture information Multiplying a determination function, a blue pixel information acquisition function that is located at the top of the screen of the image data and acquires blue pixel information within a predetermined brightness value, and at least a first coefficient set in advance to the blue pixel information By doing so, an image processing program for realizing a first index calculation function for calculating a first index, wherein the gradation processing condition setting function is realized. When that, based on the first index, which is an image processing program for causing a correction gradation processing condition based on the determination result of the photographic scene.

請求項12に記載の発明は、請求項11に記載の画像処理プログラムにおいて、前記コンピュータに、さらに、撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得機能を実現させ、前記シーン判別処理機能を実現させる際に、前記第2の画像の画像データに基づいて、撮影シーンを判別させることを特徴とする。   According to a twelfth aspect of the present invention, in the image processing program according to the eleventh aspect, the computer further acquires a second image obtained by reducing the image size from the first image acquired by photographing. When the image acquisition function is realized, and the scene determination processing function is realized, the photographic scene is determined based on the image data of the second image.

請求項13に記載の発明は、請求項12に記載の画像処理プログラムにおいて、前記青色画素情報取得機能を実現させる際に、前記第2の画像の画像データから前記青色画素情報を取得させることを特徴とする。   According to a thirteenth aspect of the present invention, in the image processing program according to the twelfth aspect, the blue pixel information is acquired from the image data of the second image when the blue pixel information acquisition function is realized. Features.

請求項14に記載の発明は、請求項12又は13に記載の画像処理プログラムにおいて、前記シーン判別処理機能は、前記第2の画像の画像データから色情報を取得する色情報取得機能と、前記取得された色情報に基づいて、前記第2の画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記第2の画像の画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出機能と、前記取得された色情報に基づいて、前記第2の画像の画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記第2の画像の画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出機能と、前記第1の占有率に予め設定された第2の係数を乗算することにより、第2の指標を算出する第2の指標算出機能と、前記第1の占有率に予め設定された第3の係数を乗算することにより、第3の指標を算出する第3の指標算出機能と、前記第2の占有率に予め設定された第4の係数を乗算することにより、第4の指標を算出する第4の指標算出機能と、少なくとも前記第2の画像の画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、第5の指標を算出する第5の指標算出機能と、前記第2の指標、前記第3の指標及び前記第4の指標のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、第6の指標を算出する第6の指標算出機能と、前記第2の指標、前記第3の指標及び前記第4の指標のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、第7の指標を算出する第7の指標算出機能と、前記第5の指標、前記第6の指標及び前記第7の指標に基づいて、前記第1の画像の画像データの撮影シーンを特定するシーン判別機能と、を含むことを特徴とする。   According to a fourteenth aspect of the present invention, in the image processing program according to the twelfth or thirteenth aspect, the scene determination processing function includes a color information acquisition function for acquiring color information from image data of the second image, Based on the acquired color information, the image data of the second image is classified into a class composed of a combination of a predetermined lightness and hue, and the entire image data of the second image is classified into the classified class. A first occupancy ratio calculating function for calculating a first occupancy ratio indicating a occupancy ratio, and a combination of the distance from the outer edge of the screen and the brightness of the image data of the second image based on the acquired color information A second occupancy ratio calculation function for calculating a second occupancy ratio indicating the ratio of the second image to the entire image data for each of the classified classes, and the first Pre-set to occupancy A second index calculation function for calculating a second index by multiplying by the second coefficient, and a third index by multiplying the first occupancy by a preset third coefficient. A third index calculation function for calculating the fourth index, a fourth index calculation function for calculating a fourth index by multiplying the second occupancy by a preset fourth coefficient, and at least the second A fifth index calculating function for calculating a fifth index by multiplying the average brightness of the skin color of the image data of the image of the second image by a preset fifth coefficient; A sixth index calculation function for calculating a sixth index by multiplying at least one of the index, the third index, and the fourth index by a preset sixth coefficient; , The second index, the third index, and the fourth index A seventh index calculating function for calculating a seventh index by multiplying at least one of the indices by a preset seventh coefficient; the fifth index; the sixth index; And a scene discrimination function for specifying a shooting scene of the image data of the first image based on a seventh index.

請求項15に記載の発明は、請求項12〜14の何れか一項に記載の画像処理プログラムにおいて、前記コンピュータに、さらに、前記第2の画像の画像データから肌色画素情報を取得する肌色画素情報取得機能を実現させ、前記第1の指標算出機能を実現させる際に、さらに、前記肌色画素情報に予め設定された第8の係数を乗算することにより、前記第1の指標を算出させることを特徴とする。   The invention according to claim 15 is the image processing program according to any one of claims 12 to 14, wherein the computer further acquires skin color pixel information from image data of the second image. When realizing the information acquisition function and realizing the first index calculation function, the first index is calculated by multiplying the skin color pixel information by a preset eighth coefficient. It is characterized by.

請求項1、6、11に記載の発明によれば、撮影された画像の撮影シーンを判別することによって、自動的に階調処理条件を設定するとともに、画像中に色鮮やかな青空が写っているか否かに基づく補正を加えることで、より適切な画像を得ることができる。   According to the first, sixth, and eleventh aspects, the gradation processing condition is automatically set by determining the photographing scene of the photographed image, and a colorful blue sky appears in the image. A more appropriate image can be obtained by applying correction based on whether or not there is.

請求項2、7、12に記載の発明によれば、画像サイズを縮小した画像の画像データに基づいて、撮影シーンを判別するので、処理の高速化を図ることができる。   According to the second, seventh, and twelfth aspects of the present invention, since the photographic scene is determined based on the image data of the image whose image size is reduced, the processing speed can be increased.

請求項3、8、13に記載の発明によれば、画像サイズを縮小した画像の画像データから青色画素情報を取得するので、処理の高速化を図ることができる。   According to the third, eighth, and thirteenth aspects of the present invention, the blue pixel information is acquired from the image data of an image with a reduced image size, so that the processing speed can be increased.

請求項4、9、14に記載の発明によれば、撮影シーンを正確に特定することができる。   According to the invention described in claims 4, 9, and 14, the photographing scene can be specified accurately.

請求項5、10、15に記載の発明によれば、階調処理条件に、肌色画素情報に基づく補正を加えることができる。   According to the fifth, tenth, and fifteenth aspects of the present invention, correction based on skin color pixel information can be added to the gradation processing conditions.

(撮像装置100の構成)
まず、本発明の実施の形態における撮像装置100の構成について説明する。
図1(a)は、撮像装置100の前面図であり、図1(b)は、撮像装置100の背面図である。撮像装置100は、例えば、デジタルカメラであり、金属又は合成樹脂等の材料で構成された筐体1の内部又は表面に、十字キー2、撮影光学系3、フラッシュ4、ファインダ5、電源スイッチ6、表示部7、レリーズボタン8が設けられている。
(Configuration of Imaging Device 100)
First, the configuration of the imaging apparatus 100 in the embodiment of the present invention will be described.
1A is a front view of the imaging apparatus 100, and FIG. 1B is a rear view of the imaging apparatus 100. The imaging apparatus 100 is, for example, a digital camera, and has a cross key 2, a photographing optical system 3, a flash 4, a finder 5, and a power switch 6 on or inside a housing 1 made of a material such as metal or synthetic resin. A display unit 7 and a release button 8 are provided.

図2に、撮像装置100の内部構成を示す。撮像装置100は、図2に示すように、プロセッサ31、メモリ32、CCD(Charge Coupled Device)等の撮像素子33、撮影光学系3、画像データ出力部34、操作部35、タイミングジェネレータ36、シャッタユニット37、絞りユニット38、フォーカスユニット39、姿勢情報検出部40、表示部7により構成される。プロセッサ31は、画像処理を行う画像処理部10と、撮影制御や撮影画像の処理を行う撮影処理部20とを含む。   FIG. 2 shows an internal configuration of the imaging apparatus 100. As shown in FIG. 2, the imaging apparatus 100 includes a processor 31, a memory 32, an imaging device 33 such as a CCD (Charge Coupled Device), a photographing optical system 3, an image data output unit 34, an operation unit 35, a timing generator 36, a shutter. The unit 37, the aperture unit 38, the focus unit 39, the posture information detection unit 40, and the display unit 7 are configured. The processor 31 includes an image processing unit 10 that performs image processing, and a photographing processing unit 20 that performs photographing control and processing of photographed images.

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

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

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

表示部7は、液晶パネルにより構成され、プロセッサ31から入力される表示制御信号に従って、撮像素子33に現在写っている画像、過去に撮影した画像、メニュー画面、設定画面等を表示する。   The display unit 7 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.

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

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

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

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

シャッタユニット37は、レリーズボタン8によって検出された状態(半押し状態又は全押し状態)に基づいて撮像素子33をリセットするタイミング及び電荷変換を行うタイミング等を制御する。タイミングの制御はタイミングジェネレータ36により行われる。   The shutter unit 37 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 8. Timing control is performed by the timing generator 36.

撮像素子33が受光する光量の調節は、絞りユニット38及び/又はシャッタユニット37によって行われる。フォーカスユニット39は、撮影光学系3を駆動させ撮影被写体に対して焦点を合わせる制御動作を実行する。   Adjustment of the amount of light received by the image sensor 33 is performed by the aperture unit 38 and / or the shutter unit 37. The focus unit 39 drives the photographic optical system 3 to execute a control operation for focusing on the photographic subject.

姿勢情報検出部40は、ジャイロ式水平センサ等の角度センサから構成され、レリーズボタン8の押下(全押し)に伴って撮影時における撮像装置100の傾斜角度を検出し、この傾斜の度合いを示す姿勢情報をプロセッサ31へ出力する。なお、本実施の形態では、姿勢情報として、撮影の基準となる正位置(図3(a)参照)を0度とし、この正位置から撮像装置の光軸を中心に時計回りに90度回転させた第1の縦位置(図3(b)参照)の場合には+90度、正位置から撮像装置の光軸を中心に反時計回りに90度回転させた第2の縦位置(図3(c)参照)の場合には−90度、正位置から撮像装置の光軸を中心に180度回転させた天地逆転位置(図3(d)参照)の場合には180度が取得されるものとする。具体的には、撮像装置100の傾斜角度が−45度から45度の場合に正位置(0度)、45度から135度の場合に第1の縦位置(+90度)、−45度から−135度の場合に第2の縦位置(−90度)、135度から225度の場合に天地逆転位置(180度)とする。   The posture information detection unit 40 is composed of an angle sensor such as a gyro-type horizontal sensor, detects the tilt angle of the imaging device 100 at the time of shooting when the release button 8 is pressed (full press), and indicates the degree of the tilt. Posture information is output to the processor 31. In the present embodiment, as the posture information, the normal position (see FIG. 3A) that is a reference for photographing is set to 0 degree, and the image is rotated 90 degrees clockwise from the normal position around the optical axis of the imaging apparatus. In the case of the first vertical position (see FIG. 3B), the second vertical position (FIG. 3) rotated by 90 degrees counterclockwise around the optical axis of the imaging device from +90 degrees. In the case of (c)), −90 degrees is obtained, and in the case of the upside down position (see FIG. 3D) rotated 180 degrees from the normal position around the optical axis of the imaging device, 180 degrees are obtained. Shall. Specifically, when the tilt angle of the imaging apparatus 100 is −45 degrees to 45 degrees, the normal position (0 degrees), and when 45 degrees to 135 degrees, the first vertical position (+90 degrees), from −45 degrees. When the angle is −135 degrees, the second vertical position (−90 degrees) is set, and when the angle is 135 degrees to 225 degrees, the upside down position (180 degrees) is set.

(撮影処理部20の内部構成)
図4に、撮影処理部20の内部構成を示す。撮影処理部20は、撮影時に撮影条件に関わる制御や、撮影された画像の処理を行う。
(Internal configuration of the imaging processing unit 20)
FIG. 4 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.

図4に示すように、撮影処理部20は、撮影条件に関わるAE制御部21、AF制御部22、画素補間部23、AWB制御部24、ガンマ補正部25等により構成される。   As shown in FIG. 4, the imaging processing unit 20 includes an AE control unit 21, an AF control unit 22, a pixel interpolation unit 23, an AWB control unit 24, a gamma correction unit 25, and the like related to imaging conditions.

AE制御部21は、画像撮影時にその露光量の自動制御を行う。通常、撮影待機時の露光量制御は、絞り開放でシャッタ速度を制御することによって行われ、撮影時の露光量は絞りとシャッタ速度とで制御される。   The AE control unit 21 automatically controls the exposure amount at the time of image capturing. 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.

図5(a)のフローチャートを参照して、AE制御部21における撮影待機時の露光量制御例を説明する。   With reference to the flowchart of FIG. 5A, an example of exposure amount control during shooting standby in the AE control unit 21 will be described.

まず、絞りユニット38により、絞りが開放固定絞りに設定される(ステップS111)。AE制御部21により、撮像素子33によって得られた画像データから所定の測光エリアのデータが読み出され(ステップS112)、輝度値に相当する情報が取得される(ステップS113)。この輝度値に相当する情報は、AE制御のための情報として用いられ、簡易的にRGB3色成分のうちのG値が用いられることが多い(以下、これを輝度情報Gという。)。この輝度情報Gに応じて撮像素子33の次のフレームにおける電荷蓄積時間が設定され(ステップS114)、タイミングジェネレータ36により、所定の輝度レベルとなるように、次のフレームにおける電荷蓄積時間が制御される(ステップS117)。これがシャッタ速度の制御であり、電荷が蓄積される様子を図6に示す。すなわち、取得した輝度レベルが大きい(明るい)ときは電荷蓄積時間が短くなり、輝度レベルが小さい(暗い)ときは電荷蓄積時間が長くなることで、露光量を安定させる。   First, the diaphragm unit 38 sets the diaphragm to an open fixed diaphragm (step S111). The AE control unit 21 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 this 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 36 so that the predetermined luminance level is obtained. (Step S117). This is control of the shutter speed, and FIG. 6 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.

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

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

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

AF制御部22は、画像撮影時に画像の焦点を合わせる自動制御を行う。この合焦点制御は、例えば、図7のフローチャートに示すように、撮影光学系3を駆動することで合焦点位置を検知し、その位置に合わせて停止させることで行われる。   The AF control unit 22 performs automatic control for focusing an image when taking an image. For example, as shown in the flowchart of FIG. 7, this in-focus control is performed by detecting the in-focus position by driving the photographing optical system 3 and stopping it according to the position.

撮影光学系3の駆動が開始されると(ステップS121)、その駆動に伴い逐次、AF制御部22により、撮像素子33によって得られた画像データから所定の測距エリアのデータが読み出され(ステップS122)、このデータに応じてコントラスト情報が取得される(ステップS123)。これは、合焦点位置に達したかどうかを検知するためであり、次のように判定される。すなわち、コントラスト情報は、測距エリアのデータの各隣接画素間の差を取ることにより、エッジ部のシャープさに依存するように設定、算出されるものであり、測距エリア全体での総和が最大に達した状態が合焦点と判断される(ステップS124、S125)。合焦点位置でないと判断された場合は(ステップS125;No)、撮影光学系3の駆動が継続される(ステップS126)。   When driving of the photographic optical system 3 is started (step S121), data of a predetermined distance measuring area is sequentially read from the image data obtained by the image sensor 33 by the AF control unit 22 along with the driving (step S121). In 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 (step S125; No), the driving of the photographing optical system 3 is continued (step S126).

撮影光学系3の移動に伴うコントラスト情報の変化と合焦点位置検出の様子を図8に示す。上記動作は、光学系を駆動しながら逐次コントラスト情報を取得して、合焦点位置を求めるという測距演算が行われたものであり、その焦点距離に合わせて撮影光学系3は停止される(ステップS127)。   FIG. 8 shows changes in contrast information accompanying the movement of the photographic optical system 3 and how the in-focus 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 position, and the photographing optical system 3 is stopped in accordance with the focal length ( Step S127).

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

画素補間部23は、撮像素子33におけるRGB各色成分を分散配置したCCD配列に対して、各色成分毎に画素間の補間を行い、同一画素位置で各色成分値が得られるように画像データを処理する。   The pixel interpolation unit 23 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. To do.

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

AWB制御部24は、撮影画像におけるホワイトバランスを自動的に調整する。撮影された画像は、その中にRGBのカラーバランスがとれている(総和すればホワイト)被写体領域があるものという想定で、その領域のホワイトバランスを達成するように、画像のRGBの各成分値に対するレベル調整を行う。このホワイトバランス処理は、例えば以下のように行われる。   The AWB control unit 24 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 as follows, for example.

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

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

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

ガンマ特性とは階調特性のことであり、入力階調に対してどのように出力階調を設定するかを補正値あるいは補正曲線等で示すものである。図11に、入力値に対して、補正した出力値を示す補正曲線の例を示す。ガンマ補正は、この補正値あるいは補正曲線等に従い、入力値に対する出力値への変換を行う変換処理である。出力機器によってこの階調特性は異なるため、その出力機器に適した階調とするために、このガンマ特性の補正を行う必要がある。これにより撮影されたリニア画像はノンリニア画像に変換されることになる。   The gamma characteristic is a gradation characteristic, and indicates how an output gradation is set with respect to an input gradation by a correction value or a correction curve. FIG. 11 shows an example of a correction curve indicating an output value corrected for an 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の内部構成)
図12に、画像処理部10の内部構成を示す。画像処理部10は、撮像装置100における撮影画像に対して、シーン判別に基づく階調の補正動作を制御するものであり、撮影処理部20での処理後に、あるいはその処理とは独立して、画像取得、シーン判別、階調処理条件設定等の一連の処理を実行する。
(Internal configuration of the image processing unit 10)
FIG. 12 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 100. 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.

図12に示すように、画像処理部10は、第1画像取得部11、第2画像取得部12、占有率算出部13、指標算出部14、シーン判別部15、画像上下決定部16a、青色画素情報取得部16b、肌色画素情報取得部16c、指標1算出部16d、階調処理条件設定部17、階調変換処理部18により構成される。   As shown in FIG. 12, the image processing unit 10 includes a first image acquisition unit 11, a second image acquisition unit 12, an occupation rate calculation unit 13, an index calculation unit 14, a scene determination unit 15, an image up / down determination unit 16a, a blue color The pixel information acquisition unit 16b, the skin color pixel information acquisition unit 16c, the index 1 calculation unit 16d, the gradation processing condition setting unit 17, and the gradation conversion processing unit 18 are configured.

第1画像取得部11は、レリーズボタン8が全押しされたタイミングで、撮像素子33に写った最新の画像の画像データを第1の画像として取得する。また、撮影時に撮像素子33の輝度情報Gから算出される絶対輝度情報BV(Brightness Value)も合わせて取得する。絶対輝度情報BVは、撮影時における測光値から算出され、Exif(Exchangeable Image File Format)データとして画像データに付加記録されるものである。取得した第1の画像の画像データ及び絶対輝度情報BVはメモリ32に保持される。   The first image acquisition unit 11 acquires the image data of the latest image captured on the image sensor 33 as the first image when the release button 8 is fully pressed. Further, absolute brightness information BV (Brightness Value) calculated from the brightness information G of the image sensor 33 at the time of shooting is also acquired. The absolute luminance information BV is calculated from a photometric value at the time of shooting, and is added and recorded in the image data as Exif (Exchangeable Image File Format) data. The acquired image data of the first image and absolute luminance information BV are held in the memory 32.

第2画像取得部12は、取得した第1の画像を、N×M個の矩形の領域(垂直方向にM個及び水平方向にN個に分割された領域)に分割する。図13(a)に、第1の画像の一例を示し、図13(b)に、当該第1の画像が22×14個の領域に分割された例を示す。なお、分割領域の数は特に限定されない。分割された各領域が第2の画像の画像データの1画素に相当する。すなわち、第2の画像は、実質的に画像サイズが縮小された画像となる。この縮小された画像が第2の画像であり、上記操作により第2の画像を取得することになる。   The second image acquisition unit 12 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. 13A shows an example of the first image, and FIG. 13B shows an example in which the first image is divided into 22 × 14 regions. The number of divided areas is not particularly limited. Each divided area corresponds to one pixel of image data of the second image. That is, the second image is an image in which the image size is substantially reduced. This reduced image is the second image, and the second image is acquired by the above operation.

占有率算出部13は、第2の画像の画像データ、すなわち画像を構成する各画素から色情報を取得する。取得された色情報に基づいて、画像の各画素を、明度と色相の組み合わせからなる所定の階級に分類し(図17参照)、分類された階級毎に、当該階級に属する画素が画像全体に占める割合を示す第1の占有率を算出する。   The occupation ratio calculation unit 13 acquires color information from the image data of the second image, 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 lightness and hue (see FIG. 17), and for each classified class, the pixels belonging to the class are included in the entire image. A first occupation ratio indicating the occupation ratio is calculated.

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

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

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

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

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

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

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

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

シーン判別部15は、指標算出部14で算出された各指標に基づいて、第1の画像の撮影シーンを特定する。ここで、撮影シーンとは、順光、逆光、近接フラッシュ等の被写体を撮影する時の光源条件を示しており、主要被写体(主に人物のことを指すが、これに限るものではない)のオーバー度、アンダー度等もこれに含まれる。撮影シーンの判別方法については、後に詳細に説明する。   The scene determination unit 15 identifies the shooting scene of the first image based on each index calculated by the index calculation unit 14. 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 the over and under degrees. The method for determining the shooting scene will be described in detail later.

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

画像上下決定部16aは、姿勢情報検出部40により取得された姿勢情報に基づいて第2の画像の上下を決定する。すなわち、姿勢情報検出部40及び画像上下決定部16aにより、画像上下決定手段が実現される。   The image up / down determination unit 16a determines the up / down direction of the second image based on the posture information acquired by the posture information detection unit 40. That is, the posture information detection unit 40 and the image up / down determination unit 16a realize an image up / down determination unit.

青色画素情報取得部16bは、第2の画像の画像データの画面上部に位置し、かつ所定の明度値内の青色画素情報を取得する。すなわち、青色画素情報取得部16bは、青色画素情報取得手段として機能する。   The blue pixel information acquisition unit 16b is located at the top of the screen of the image data of the second image and acquires blue pixel information within a predetermined brightness value. That is, the blue pixel information acquisition unit 16b functions as a blue pixel information acquisition unit.

肌色画素情報取得部16cは、第2の画像の画像データから肌色画素情報を取得する。すなわち、肌色画素情報取得部16cは、肌色画素情報取得手段として機能する。   The skin color pixel information acquisition unit 16c acquires skin color pixel information from the image data of the second image. That is, the skin color pixel information acquisition unit 16c functions as a skin color pixel information acquisition unit.

指標1算出部16dは、少なくとも、青色画素情報取得部16bにより取得された青色画素情報に予め設定された第1の係数を乗算し、肌色画素情報取得部16cにより取得された肌色画素情報に予め設定された第8の係数を乗算することにより、指標1を算出する。   The index 1 calculation unit 16d multiplies the skin color pixel information acquired by the skin color pixel information acquisition unit 16c in advance by multiplying at least the blue pixel information acquired by the blue pixel information acquisition unit 16b by a preset first coefficient. The index 1 is calculated by multiplying the set eighth coefficient.

階調処理条件設定部17は、シーン判別部15で判別された撮影シーンに基づいて、第1の画像に対する階調処理条件を設定する。その際に、階調処理条件設定部17は、指標1算出部16dにより算出された指標1に基づいて、撮影シーンの判別結果に基づく階調処理条件を補正する。   The gradation processing condition setting unit 17 sets gradation processing conditions for the first image based on the shooting scene determined by the scene determination unit 15. At that time, the gradation processing condition setting unit 17 corrects the gradation processing condition based on the determination result of the shooting scene based on the index 1 calculated by the index 1 calculation unit 16d.

階調処理条件設定部17は、まず、指標算出部14で算出された各指標に基づいて、第1の画像に対する階調調整のための階調調整パラメータを算出する。そして、階調調整パラメータ及び指標1に基づいて階調変換量を算出し、階調変換量に基づいて第1の画像に対する階調処理条件を設定する。階調処理条件の設定については、後に図27を参照して詳細に説明する。   The gradation processing condition setting unit 17 first calculates a gradation adjustment parameter for gradation adjustment for the first image based on each index calculated by the index calculation unit 14. Then, the gradation conversion amount is calculated based on the gradation adjustment parameter and the index 1, and the gradation processing condition for the first image is set based on the gradation conversion amount. The setting of the gradation processing conditions will be described in detail later with reference to FIG.

階調変換処理部18は、階調処理条件設定部17において設定された階調処理条件に基づいて、第1の画像に対して階調変換処理を行う。   The gradation conversion processing unit 18 performs gradation conversion processing on the first image based on the gradation processing conditions set by the gradation processing condition setting unit 17.

プロセッサ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, other image processing, image format conversion, image processing, and the like based on known techniques. It has a function of controlling processing operations such as data recording.

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

(撮像装置100の動作)
次に、本実施の形態における撮像装置100の動作について説明する。以下では、撮影対象物を「主要被写体」と呼ぶことにする。
(Operation of Imaging Device 100)
Next, the operation of the imaging device 100 in the present embodiment will be described. Hereinafter, the photographing object is referred to as “main subject”.

まず、図14のフローチャートを参照して、撮像装置100で実行される処理の全体の流れを説明する。   First, an overall flow of processing executed by the imaging apparatus 100 will be described with reference to a flowchart of FIG.

まず、電源スイッチ6がONに操作されると(電源が投入されると)、メモリ32のリセット等の前処理が行われる。ユーザは、主要被写体が撮像装置100の被写界に入るように撮像装置100をその主要被写体の方に向け、撮影のための操作を関始する。レリーズボタン8が押されて撮影が行われると(ステップS1)、撮像素子33に結像した画像は電気信号として取り込まれ、CCD配列に基づく補間処理が行われる(ステップS2)。そして、第1画像取得部11により、撮影画像として第1の画像が取得され、メモリ32に保持される(ステップS3)。第1の画像はリニア画像(RAW画像)である。   First, when the power switch 6 is turned on (when the power is turned on), preprocessing such as resetting of the memory 32 is performed. The user starts an operation for shooting by directing the imaging device 100 toward the main subject so that the main subject enters the field of the imaging device 100. When the release button 8 is pressed and shooting is performed (step S1), 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 S2). Then, the first image acquisition unit 11 acquires a first image as a captured image and holds it in the memory 32 (step S3). The first image is a linear image (RAW image).

撮影により取得された第1の画像には、AWB(自動ホワイトバランス)処理が施される(ステップS4)。AWB処理は、第2の画像の取得が行われてから、第1の画像と第2の画像とに対して別々に処理されてもよい。   AWB (automatic white balance) processing is performed on the first image acquired by shooting (step S4). The AWB process may be performed separately on the first image and the second image after the acquisition of the second image.

AWB処理の後、第2画像取得部12により、第1の画像の画像データの画像サイズが縮小され、第2の画像として取得される(ステップS5)。実際の画像データのサイズ縮小方法は、単純平均やバイリニア法やバイキュービック法等の公知の技術を用いることができる。   After the AWB process, the image size of the image data of the first image is reduced by the second image acquisition unit 12 and acquired as the second image (step S5). 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.

次いで、取得された第2の画像の画像データに基づいて、撮影シーンを判別するシーン判別処理が行われる(ステップS6)。シーン判別処理については、後に図15を参照して説明する。   Next, scene discrimination processing for discriminating a shooting scene is performed based on the acquired image data of the second image (step S6). The scene discrimination process will be described later with reference to FIG.

一方、撮影が行われると、第1画像取得部11により、絶対輝度情報BVが取得される(ステップS7)。取得された絶対輝度情報BVはメモリ32に保持される。   On the other hand, when shooting is performed, the absolute luminance information BV is acquired by the first image acquisition unit 11 (step S7). The acquired absolute luminance information BV is held in the memory 32.

また、撮影と同時に、姿勢情報検出部40により、撮像装置100の傾斜角度が検出され、姿勢情報が取得される(ステップS8)。   Simultaneously with the photographing, the posture information detection unit 40 detects the tilt angle of the imaging device 100 and acquires posture information (step S8).

第2の画像取得後、指標1算出処理が行われる(ステップS9)。この指標1算出処理については、後に図25を参照して説明する。   After the second image is acquired, the index 1 calculation process is performed (step S9). The index 1 calculation process will be described later with reference to FIG.

次いで、シーン判別処理で得られた各指標及び撮影シーンの判別結果、指標1算出処理で得られた指標1に基づいて、第1の画像の階調変換処理のために必要な条件を設定する階調処理条件設定が行われる(ステップS10)。階調処理条件設定については、後に図27を参照して説明する。   Next, conditions necessary for the tone conversion processing of the first image are set based on each index obtained by the scene discrimination process and the discrimination result of the shooting scene and the index 1 obtained by the index 1 calculation process. A gradation processing condition is set (step S10). The gradation processing condition setting will be described later with reference to FIG.

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

次いで、第2の画像に基づいて設定された階調処理条件に基づいて、撮影画像である第1の画像の画像データに対する階調変換処理が行われる(ステップS12)。ステップS11のガンマ変換処理は視覚に合わせてノンリニアの階調に変換するものであるが、ステップS12の階調変換処理は撮影シーンの光源条件等による階調への影響を補正するものである。   Next, gradation conversion processing is performed on the image data of the first image, which is a photographed image, based on the gradation processing conditions set based on the second image (step S12). The gamma conversion process in step S11 is to convert to a non-linear gradation in accordance with the vision, but the gradation conversion process in step S12 is to correct the influence on the gradation due to the light source condition of the shooting scene.

次いで、階調変換処理後の画像データに対して、その他の画像処理(ノイズ処理やシャープネス処理等)が行われる(ステップS13)。   Next, other image processing (noise processing, sharpness processing, etc.) is performed on the image data after the gradation conversion processing (step S13).

次いで、画像記録のため、JPEG形式、TIFF形式、BMP形式等の画像へと画像フォーマットの変換が行われる(ステップS14)。その後、画像フォーマット変換後の画像データが、保存用の記録媒体(SDメモリカード又はマルチメディアカード(MMC)等)に記録される(ステップS15)。次の撮影に移るか、あるいは電源スイッチ6がOFFに操作されると、撮像装置100における動作は終了する。   Next, the image format is converted into an image such as a JPEG format, a TIFF format, or a BMP format for image recording (step S14). Thereafter, the image data after the image format conversion 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 6 is turned off, the operation of the image pickup apparatus 100 ends.

(シーン判別処理)
次に、図15〜図24を参照して、撮像装置100でのシーン判別処理(図14のステップS6)について説明する。
(Scene discrimination processing)
Next, the scene discrimination process (step S6 in FIG. 14) in the imaging device 100 will be described with reference to FIGS.

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

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

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

また、本実施の形態において、「色相」は特に注釈を設けない限り一般に用いられる「色」の意味である。以下の記載において、HSV表色系のH(0〜360)を「色相」として用いるが、例えば赤色差値(Cr)や青色差値(Cb)によって表現される色を用いてもよい。その際、本実施の形態で記載する各種係数等の数値を、改めて算出し直すことは言うまでもない。ステップS20では、上記のようにして求められたH、S、Vの値が色情報として取得される。   In the present embodiment, “hue” means “color” 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. In that case, it goes without saying that numerical values such as various coefficients described in the present embodiment are recalculated. In step S20, the values of H, S, and V obtained as described above are acquired as color information.

<占有率算出処理>
次に、図16のフローチャートを参照して、占有率算出処理(図15のステップS21)について説明する。
<Occupancy rate calculation process>
Next, the occupation rate calculation process (step S21 in FIG. 15) will be described with reference to the flowchart in FIG.

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

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

色相Hは、色相値が0〜39、330〜359の肌色色相領域(H1及びH2)、色相値が40〜160の緑色色相領域(H3)、色相値が161〜250の青色色相領域(H4)、赤色色相領域(H5)の4つの領域に分割される。なお、赤色色相領域(H5)は、撮影シーンの判別への寄与が少ないとの知見から、以下の計算では用いていない。肌色色相領域は、さらに、肌色領域(H1)と、それ以外の領域(H2)に分割される。以下、肌色色相領域(H=0〜39、330〜359)のうち、下記の式(1)を満たす色相H’を肌色領域(H1)とし、式(1)を満たさない領域を(H2)とする。   Hue H includes 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 (H4) having a hue value of 161 to 250. ), And is divided into four regions of a red hue region (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 equation (1) is defined as the flesh-colored region (H1), and the region that does not satisfy the equation (1) is (H2). And

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)
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)

従って、第2の画像を明度と色相の組み合わせからなる階級に分類した場合の階級の数は4×7=28個となる。また、最大の明度値(255)の1割の値以内に、少なくとも3つの階級(v1、v2、v3)を有する。なお、式(A)及び式(1)において明度(V)を用いることも可能である。   Therefore, the number of classes when the second image is classified into classes composed of combinations of brightness and hue is 4 × 7 = 28. Moreover, it has at least three classes (v1, v2, v3) within 10% of the maximum brightness value (255). In addition, it is also possible to use lightness (V) in Formula (A) and Formula (1).

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

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

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

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

Figure 2007300348
Figure 2007300348

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

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

Figure 2007300348
Figure 2007300348

なお、各画素を画面の外縁からの距離、明度及び色相からなる階級に分類し、分類された階級毎に累積画素数を算出することによって3次元ヒストグラムを作成してもよい。以下では、2次元ヒストグラムを用いる方式を採用するものとする。   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.

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

まず、占有率算出処理において階級毎に算出された第1の占有率に、撮影条件に応じて予め設定された第2の係数を乗算して和をとることにより、撮影シーンを特定するための指標2が算出される(ステップS40)。指標2は、主要被写体のオーバー度を表す指標であり、「主要被写体がオーバー」と判別されるべき画像のみを他の撮影シーンから分離するためのものである。   First, the first occupancy calculated for each class in the occupancy calculation processing is multiplied by a second coefficient set in advance according to the shooting conditions to obtain a sum, thereby specifying a shooting scene. Index 2 is calculated (step S40). The index 2 is an index representing the degree of overshoot of the main subject, and is for separating only an image that should be determined as “main subject is over” from other shooting scenes.

次いで、同じく階級毎に算出された第1の占有率に、撮影条件に応じて予め設定された第3の係数(第2の係数とは異なる係数)を乗算して和をとることにより、撮影シーンを特定するための指標3が算出される(ステップS41)。指標3は、空色高明度、顔色低明度等の逆光撮影時の特徴を複合的に表す指標であり、「逆光」、「主要被写体がアンダー」と判別されるべき画像のみを他の撮影シーンから分離するためのものである。   Next, the first occupancy rate calculated for each class is multiplied by a third coefficient (a coefficient different from the second coefficient) set in advance according to the shooting conditions to obtain a sum, thereby taking a picture. An index 3 for specifying the scene is calculated (step S41). The index 3 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.

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

Figure 2007300348
Figure 2007300348

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

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

Figure 2007300348
Figure 2007300348

従って、H1〜H4領域の和は、下記の式(2−1)〜(2−4)のように表される。
H1領域の和=R11×0+R21×0+(中略)…+R71×(-8) (2−1)
H2領域の和=R12×(-2)+R22×(-1)+(中略)…+R72×(-10) (2−2)
H3領域の和=R13×5+R23×(-2)+(中略)…+R73×(-12) (2−3)
H4領域の和=R14×0+R24×(-1)+(中略)…+R74×(-12) (2−4)
Accordingly, the sum of the H1 to H4 regions is expressed by the following formulas (2-1) to (2-4).
Sum of H1 region = R11 × 0 + R21 × 0 + (omitted)… + R71 × (−8) (2-1)
Sum of H2 regions = R12 x (-2) + R22 x (-1) + (omitted) ... + R72 x (-10) (2-2)
Sum of H3 regions = R13 × 5 + R23 × (−2) + (omitted)… + R73 × (-12) (2-3)
Sum of H4 region = R14 × 0 + R24 × (−1) + (omitted)… + R74 × (-12) (2-4)

指標2は、式(2−1)〜(2−4)で示されたH1〜H4領域の和を用いて、式(3)のように定義される。
指標2=H1領域の和+H2領域の和+H3領域の和+H4領域の和+1.5
(3)
The index 2 is defined as in Expression (3) using the sum of the H1 to H4 regions shown in Expressions (2-1) to (2-4).
Index 2 = sum of H1 region + sum of H2 region + sum of H3 region + sum of H4 region + 1.5
(3)

表4に、指標3を算出するために必要な第3の係数を階級別に示す。表4に示された各階級の係数は、表1に示した各階級の第1の占有率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 first occupation ratio Rij of each class shown in Table 1 is multiplied, and is set in advance according to the shooting conditions.

Figure 2007300348
Figure 2007300348

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

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

Figure 2007300348
Figure 2007300348

従って、H1〜H4領域の和は、下記の式(4−1)〜(4−4)のように表される。
H1領域の和=R11×0+R21×0+(中略)…+R71×2 (4−1)
H2領域の和=R12×(-2)+R22×(-1)+(中略)…+R72×2 (4−2)
H3領域の和=R13×2+R23×1+(中略)…+R73×3 (4−3)
H4領域の和=R14×0+R24×(-1)+(中略)…+R74×3 (4−4)
Accordingly, the sum of the H1 to H4 regions is expressed by the following formulas (4-1) to (4-4).
Sum of H1 region = R11 × 0 + R21 × 0 + (omitted)… + R71 × 2 (4-1)
Sum of H2 regions = R12 x (-2) + R22 x (-1) + (omitted) ... + R72 x 2 (4-2)
Sum of H3 region = R13 × 2 + R23 × 1 + (omitted)… + R73 × 3 (4-3)
Sum of H4 region = R14 × 0 + R24 × (−1) + (omitted)… + R74 × 3 (4-4)

指標3は、式(4−1)〜(4−4)で示されたH1〜H4領域の和を用いて、式(5)のように定義される。
指標3=H1領域の和+H2領域の和+H3領域の和+H4領域の和+1.7
(5)
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).
Index 3 = sum of H1 region + sum of H2 region + sum of H3 region + sum of H4 region + 1.7
(5)

指標2及び指標3は、第2の画像の明度と色相の分布量に基づいて算出されるため、画像がカラー画像である場合の撮影シーンの判別に有効である。   Since the index 2 and the index 3 are calculated based on the brightness and hue distribution amount of the second image, the index 2 and the index 3 are effective in determining a shooting scene when the image is a color image.

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

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

Figure 2007300348
Figure 2007300348

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

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

Figure 2007300348
Figure 2007300348

従って、n1〜n3領域の和は、下記の式(6−1)〜(6−3)のように表される。
n1領域の和=Q11×12+Q21×10+(中略)…+Q71×0 (6−1)
n2領域の和=Q12×5+Q22×3+(中略)…+Q72×0 (6−2)
n3領域の和=Q13×(-1)+Q23×(-4)+(中略)…+Q73×(-8) (6−3)
Accordingly, the sum of the n1 to n3 regions is represented by the following formulas (6-1) to (6-3).
Sum of n1 region = Q11 × 12 + Q21 × 10 + (omitted) ... + Q71 × 0 (6-1)
Sum of n2 regions = Q12 × 5 + Q22 × 3 + (omitted) ... + Q72 × 0 (6-2)
Sum of n3 regions = Q13 × (-1) + Q23 × (-4) + (omitted) ... + Q73 × (-8) (6-3)

指標4は、式(6−1)〜(6−3)で示されたn1〜n3領域の和を用いて、式(7)のように定義される。
指標4=n1領域の和+n2領域の和+n3領域の和+0.7 (7)
The index 4 is defined as in Expression (7) using the sum of the n1 to n3 regions shown in Expressions (6-1) to (6-3).
Index 4 = sum of n1 region + sum of n2 region + sum of n3 region + 0.7 (7)

指標4は、第2の画像の明度の分布位置による構図的な特徴(全体画像の画面の外縁からの距離)に基づいて算出されるため、カラー画像だけでなくモノクロ画像の撮影シーンを判別するのにも有効である。   The index 4 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, and therefore, the photographing scene of the monochrome image as well as the color image is discriminated. It is also effective.

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

指標2〜4が算出されると、第2の画像の画面中央部における肌色領域の平均輝度値、第2の画像の最大輝度植と平均輝度値との差分値等に、撮影条件に応じて予め設定された第5の係数を乗算することにより、撮影シーンを特定するための指標5が算出される(ステップS43)。   When the indices 2 to 4 are calculated, the average brightness value of the skin color area in the center of the screen of the second image, the difference value between the maximum brightness plant and the average brightness value of the second image, etc., according to the shooting conditions By multiplying a preset fifth coefficient, an index 5 for specifying a shooting scene is calculated (step S43).

以下、図23のフローチャートを参照して、指標5算出処理について詳細に説明する。
まず、第2の画像のRGB(Red、Green、Blue)値から、式(A)を用いて輝度Yが算出される。次いで、第2の画像の画面中央部における肌色領域の平均輝度値x1が算出される(ステップS50)。ここで、画面中央部とは、例えば、図18(a)に示した領域n3により構成される領域である。次いで、第2の画像の最大輝度値と平均輝度値との差分値x2=最大輝度値−平均輝度値が算出される(ステップS51)。
Hereinafter, the index 5 calculation process will be described in detail with reference to the flowchart of FIG.
First, the luminance Y is calculated from the RGB (Red, Green, Blue) values of the second image using the equation (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 screen center portion is, for example, a region constituted by the region 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)のように表される。
x5=(Yskin_max−Yskin_min)/2−Yskin_ave (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)のように定義される。
指標5=0.05×x1+1.41×x2+(-0.01)×x3
+(-0.01)×x4+0.01×x5−5.34 (8−2)
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).
Index 5 = 0.05 × x1 + 1.41 × x2 + (− 0.01) × x3
+ (-0.01) × x4 + 0.01 × x5-5.34 (8-2)

この指標5は、第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.

図19に戻り、指標5が算出されると、指標2、指標4及び第2の画像の画面中央部における肌色領域の平均輝度値に、撮影条件に応じて予め設定された第6の係数を乗算することにより、指標6が算出される(ステップS44)。   Returning to FIG. 19, when the index 5 is calculated, a sixth coefficient that is set in advance according to the shooting condition is added to the average luminance value of the skin color area in the center of the screen of the index 2, the index 4, and the second image. By multiplying, the index 6 is calculated (step S44).

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

以下、指標6及び指標7の算出方法について詳細に説明する。
第2の画像の画面中央部における肌色領域の平均輝度値を指標9とする。ここでの画面中央部とは、例えば、図18(a)の領域n2及び領域n3から構成される領域である。このとき、指標6は、指標2、指標4、指標9を用いて式(9)のように定義され、指標7は、指標3、指標4、指標9を用いて式(10)のように定義される。
指標6=0.54×指標2+0.50×指標4+0.01×指標9−0.65 (9)
指標7=0.83×指標3+0.23×指標4+0.01×指標9−1.17 (10)
Hereinafter, the calculation method of the index 6 and the index 7 will be described in detail.
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 central portion of the screen is, for example, a region composed of the region n2 and the region n3 in FIG. At this time, the index 6 is defined as in Expression (9) using the indices 2, 4, and 9, and the index 7 is defined as in Expression (10) using the indices 3, 4, and 9. Defined.
Indicator 6 = 0.54 x Indicator 2 + 0.50 x Indicator 4 + 0.01 x Indicator 9-0.65 (9)
Indicator 7 = 0.83 x Indicator 3 + 0.23 x Indicator 4 + 0.01 x Indicator 9-1.17 (10)

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

<シーン判別>
図15に戻って、シーン判別(ステップS23)を説明する。
指標5〜7が算出されると、これらの指標の値に基づいて撮影シーンが判別される。表6に、指標5、指標6及び指標7の値による撮影シーンの判別内容を示す。
<Scene discrimination>
Returning to FIG. 15, the scene discrimination (step S23) will be described.
When the indices 5 to 7 are calculated, the shooting scene is determined based on the values of these indices. 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 2007300348
Figure 2007300348

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

(指標1算出処理)
次に、図25を参照して、指標1算出処理(図14のステップS9)を説明する。
まず、画像上下決定部16aにより、姿勢情報検出部40で取得された姿勢情報に基づいて第2の画像の上下が決定される(ステップS60)。
(Indicator 1 calculation process)
Next, the index 1 calculation process (step S9 in FIG. 14) will be described with reference to FIG.
First, the up / down direction of the second image is determined by the image up / down determination unit 16a based on the posture information acquired by the posture information detection unit 40 (step S60).

次に、青色画素情報取得部16bにより、第2の画像の画像データの画面上部に位置し、かつ所定の明度値内の青色画素情報が取得される(ステップS61)。ここで、青色とは、上述した青色色相領域(H4)の範囲とする。また、画面上部とは、ステップS60で決定された第2の画像の上下方向に従った画面における上側の部分をいう。図26(a)〜(d)に、姿勢情報検出部40で取得される姿勢情報(0度、+90度、−90度、180度)と、画面上部Fの位置関係を示す。図26(a)〜(d)では、各画面において、図18(a)に示した領域n3より上の部分を画面上部Fと設定している。また、青色画素情報の所定明度値の範囲は、青空に近い明るさの範囲を設定することが好ましいため、例えば、輝度Yが70〜225(8bitの0〜255の範囲で)の範囲とする。   Next, the blue pixel information acquisition unit 16b acquires blue pixel information located at the upper part of the screen of the image data of the second image and within a predetermined brightness value (step S61). Here, blue is the range of the blue hue region (H4) described above. The upper part of the screen refers to the upper part of the screen according to the vertical direction of the second image determined in step S60. 26A to 26D show the positional relationship between the posture information (0 degrees, +90 degrees, −90 degrees, 180 degrees) acquired by the posture information detection unit 40 and the upper portion F of the screen. In FIGS. 26A to 26D, a portion above the area n3 shown in FIG. In addition, the predetermined brightness value range of the blue pixel information is preferably set to a brightness range close to the blue sky. For example, the luminance Y is in the range of 70 to 225 (in the range of 0 to 255 of 8 bits). .

具体的には、青色画素情報として、青色画素率、青色高彩度画素率、青色平均彩度値が取得される。青色画素率、青色高彩度画素率は、それぞれ、下記式(11−1)、(11−2)により定義される。
青色画素率=画面上部の所定明度値内の青色画素数/画面上部の全画素数
(11−1)
青色高彩度画素率=画面上部の所定明度値内かつ所定彩度より高彩度(彩度S>75)の青色画素数/画面上部の全画素数 (11−2)
また、青色平均彩度値は、画面上部の所定明度値内の青色画素の彩度の平均値である。
Specifically, a blue pixel rate, a blue high saturation pixel rate, and a blue average saturation value are acquired as blue pixel information. The blue pixel ratio and the blue high saturation pixel ratio are defined by the following equations (11-1) and (11-2), respectively.
Blue pixel ratio = number of blue pixels within the specified brightness value at the top of the screen / total number of pixels at the top of the screen
(11-1)
Blue high saturation pixel ratio = the number of blue pixels within a predetermined lightness value at the top of the screen and higher than the predetermined saturation (saturation S> 75) / the total number of pixels at the top of the screen (11-2)
The blue average saturation value is an average value of the saturation of blue pixels within a predetermined brightness value at the top of the screen.

次に、肌色画素情報取得部16cにより、第2の画像の画像データから肌色画素情報が取得される(ステップS62)。ここで、肌色とは、式(1)を満たす色相H1の範囲とする。   Next, the skin color pixel information is acquired from the image data of the second image by the skin color pixel information acquisition unit 16c (step S62). Here, the skin color is a range of the hue H1 that satisfies the formula (1).

具体的には、肌色画素情報として、画面中央部肌色平均輝度値、全画素に対する低輝度肌色画素率、肌色画素に対する低輝度肌色画素率が取得される。画面中央部肌色平均輝度値は、図18(a)の領域n2及び領域n3から構成される領域の肌色画素の輝度Yの平均値である。全画素に対する低輝度肌色画素率、肌色画素に対する低輝度肌色画素率は、それぞれ、下記式(12−1)、(12−2)により定義される。
全画素に対する低輝度肌色画素率=(輝度Y≦84の肌色画素数)/全画素数
(12−1)
肌色画素に対する低輝度肌色画素率=(輝度Y≦84の肌色画素数)/全肌色画素数
(12−2)
Specifically, the skin color average luminance value, the low luminance skin color pixel rate for all the pixels, and the low luminance skin color pixel rate for the skin color pixels are acquired as the skin color pixel information. The average flesh color luminance value at the center of the screen is the average value of the luminance Y of the flesh color pixels in the area composed of the areas n2 and n3 in FIG. The low luminance skin color pixel rate for all pixels and the low luminance skin color pixel rate for skin color pixels are defined by the following equations (12-1) and (12-2), respectively.
Low luminance skin color pixel ratio for all pixels = (number of skin color pixels with luminance Y ≦ 84) / total number of pixels
(12-1)
Low luminance skin color pixel ratio to skin color pixels = (number of skin color pixels with luminance Y ≦ 84) / total number of skin color pixels
(12-2)

次に、指標1算出部16dにより、青色画素情報、肌色画素情報、絶対輝度情報BVに基づいて、指標1が算出される(ステップS63)。指標1は、下記式(13)で定義される。
指標1=青色画素率×a1
+青色高彩度画素率×a2
+青色平均彩度値×a3
+画面中央部肌色平均輝度値×b1
+全画素に対する低輝度肌色画素率×b2
+肌色画素に対する低輝度肌色画素率×b3
+絶対輝度情報BV×c
+d (13)
ここで、a1,a2,a3は予め設定された係数であり、特許請求の範囲に記載の第1の係数に相当する。また、b1,b2,b3は予め設定された係数であり、特許請求の範囲に記載の第8の係数に相当する。また、cは絶対輝度情報BVの寄与を示す予め設定された係数であり、dは予め設定された定数である。指標1は、青空らしさを示す指標である。
Next, the index 1 calculation unit 16d calculates the index 1 based on the blue pixel information, the skin color pixel information, and the absolute luminance information BV (step S63). The index 1 is defined by the following formula (13).
Index 1 = Blue pixel ratio × a1
+ Blue high saturation pixel rate xa2
+ Blue average saturation value xa3
+ Skin color average luminance value in the center of the screen × b1
+ Low luminance skin color pixel ratio for all pixels × b2
+ Low luminance skin color pixel ratio for skin color pixels × b3
+ Absolute luminance information BV x c
+ D (13)
Here, a1, a2, and a3 are preset coefficients and correspond to the first coefficient recited in the claims. In addition, b1, b2, and b3 are preset coefficients and correspond to the eighth coefficient described in the claims. Also, c is a preset coefficient indicating the contribution of the absolute luminance information BV, and d is a preset constant. The index 1 is an index indicating the likelihood of blue sky.

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

まず、判別された撮影シーンに応じて、第1の画像データのガンマ変換処理後に対する階調調整方法が決定され(ステップS70)、階調調整パラメータが算出される(ステップS71)。そして、階調調整パラメータ及び指標1に基づいて階調変換量が算出され(ステップS72)、階調変換量に基づいて階調処理条件(階調変換曲線)が設定される(ステップS73)。なお、本実施の形態では、階調調整方法と階調変換量の双方を決定する場合を示すが、階調変換量のみであってもよい。   First, a gradation adjustment method for the first image data after the gamma conversion process is determined according to the determined shooting scene (step S70), and a gradation adjustment parameter is calculated (step S71). Then, a gradation conversion amount is calculated based on the gradation adjustment parameter and index 1 (step S72), and a gradation processing condition (gradation conversion curve) is set based on the gradation conversion amount (step S73). In this embodiment, the case where both the gradation adjustment method and the gradation conversion amount are determined is shown, but only the gradation conversion amount may be used.

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

なお、本実施の形態においては、第1の画像のガンマ変換後の画像へ適用する階調変換曲線を決定する方法を示したが、階調変換処理をガンマ変換の前に実施する場合には、図28の階調変換曲線に対して、ガンマ変換の逆変換を施した曲線で階調変換が行われる。   In the present embodiment, the method of 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 processing is performed before the gamma conversion, 28, gradation conversion is performed using a curve obtained by performing inverse conversion of gamma conversion on the gradation conversion curve of FIG.

<階調調整パラメータ算出>
階調調整方法が決定されると、ステップS71では、指標算出処理で算出された各指標に基づいて、階調調整に必要なパラメータが算出される。以下、階調調整パラメータの算出方法について説明する。なお、以下では、8bitの撮影画像データは16bitへと事前に変換されているものとし、撮影画像データの値の単位は16bitであるものとする。
<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 8-bit captured image data is converted to 16 bits in advance, and the unit of the value of the captured image data is 16 bits.

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

ここで、図29及び図30を参照して、パラメータP2(ブロック分割平均輝度)の算出方法について説明する。
まず、画像データを正規化するために、CDF(累積密度関数)を作成する。次いで、得られたCDFから最大値と最小値を決定する。この最大値と最小値は、RGB毎に求める。ここで、求められたRGB毎の最大値と最小値を、それぞれ、Rmax、Rmin、Gmax、Gmin、Bmax、Bminとする。
Here, a method for calculating the parameter P2 (block division average luminance) will be described with reference to FIGS.
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は、それぞれ、式(14)〜式(16)のように表される。   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 respectively ) To Expression (16).

Rpoint={(Rx−Rmin)/(Rmax−Rmin)}×65535 (14);
Gpoint={(Gx−Gmin)/(Gmax−Gmin)}×65535 (15);
Bpoint={(Bx−Bmin)/(Bmax−Bmin)}×65535 (16).
Rpoint = {(Rx−Rmin) / (Rmax−Rmin)} × 65535 (14);
Gpoint = {(Gx−Gmin) / (Gmax−Gmin)} × 65535 (15);
Bpoint = {(Bx−Bmin) / (Bmax−Bmin)} × 65535 (16).

次いで、式(17)により画素(Rx、Gx、Bx)の輝度Npointを算出する。
Npoint=(Bpoint+Gpoint+Rpoint)/3 (17)
Next, the luminance Npoint of the pixel (Rx, Gx, Bx) is calculated by Expression (17).
Npoint = (Bpoint + Gpoint + Rpoint) / 3 (17)

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

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

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

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

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

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

P7(キー捕正値)={P3−((指標7/6)×18000+22000)}/24.78 (18)
P7’(キー補正値2)={P3−((指標5/6)×10000+30000)}/24.78
(19)
P8(輝度補正値2)=(指標6/6)×17500 (20)
P7 (key correction value) = {P3-((index 7/6) × 18000 + 22000)} / 24.78 (18)
P7 ′ (key correction value 2) = {P3-((index 5/6) × 10000 + 30000)} / 24.78
(19)
P8 (Luminance correction value 2) = (Index 6/6) × 17500 (20)

<階調変換量算出>
図27に戻り、階調調整パラメータが算出されると、ステップS72では、階調調整パラメータ及び指標1に基づいて、階調変換量が算出される。具体的には、既に判別された撮影シーンに応じて、階調調整パラメータから仮の階調変換量Xが選択され、指標1に基づいて仮の階調変換量Xが補正されて階調変換量Zが算出される。
<Calculation of gradation conversion amount>
Returning to FIG. 27, when the gradation adjustment parameter is calculated, the gradation conversion amount is calculated based on the gradation adjustment parameter and the index 1 in step S72. Specifically, the provisional gradation conversion amount X is selected from the gradation adjustment parameters according to the already determined shooting scene, and the provisional gradation conversion amount X is corrected based on the index 1 to convert the gradation. The quantity Z is calculated.

ここで、既に仮の階調変換量Xが選択されたものとして、指標1に基づく階調変換量Zの算出処理について説明する。撮影シーンに応じた階調調整パラメータからの仮の階調変換量Xの選択については、後で述べる。   Here, the calculation process of the gradation conversion amount Z based on the index 1 will be described assuming that the provisional gradation conversion amount X has already been selected. The selection of the provisional gradation conversion amount X from the gradation adjustment parameter corresponding to the shooting scene will be described later.

階調変換量Zは、指標1をW、予め定められた閾値をtとして、次の(21−1)〜(21−3)式によって算出される。
W(指標1)≦閾値tのとき
Z=X (21−1)
W(指標1)>閾値t、かつ、X>0のとき
Z=X−u×(W−t) (X−u×(W−t)>0の場合)
Z=0 (X−u×(W−t)≦0の場合) (21−2)
W(指標1)>閾値t、かつ、X<0のとき
Z=X+u×(W−t) (X+u×(W−t)<0の場合)
Z=0 (X+u×(W−t)≧0の場合) (21−3)
ここで、u(u>0)は、指標1を反映させる程度を表す係数であり、予め定められている。
The gradation conversion amount Z is calculated by the following equations (21-1) to (21-3), where W is an index 1 and t is a predetermined threshold value.
When W (index 1) ≦ threshold value t Z = X (21-1)
When W (index 1)> threshold value t and X> 0, Z = X−u × (W−t) (when X−u × (W−t)> 0)
Z = 0 (when X−u × (W−t) ≦ 0) (21-2)
When W (index 1)> threshold value t and X <0, Z = X + u × (W−t) (when X + u × (W−t) <0)
Z = 0 (when X + u × (W−t) ≧ 0) (21-3)
Here, u (u> 0) is a coefficient representing the degree to which the index 1 is reflected, and is predetermined.

例えば、仮の階調変換量X>0の場合、W(指標1)が閾値tを超えると、その程度に応じて、仮の階調変換量Xは、0に近づく方向に補正される(ただし、最小0)。また、仮の階調変換量X<0の場合、W(指標1)が閾値tを超えると、その程度に応じて、仮の階調変換量Xは、0に近づく方向に補正される(ただし、最大0)。すなわち、W(指標1)が閾値tより大きい場合、階調変換量Zは、仮の階調変換量Xを階調変換の効果を抑制するように補正した値となっている。
このように、仮の階調変換量Xから階調変換量Zを算出し、次の階調処理条件の設定に移る。
For example, in the case of the provisional gradation conversion amount X> 0, when W (index 1) exceeds the threshold value t, the provisional gradation conversion amount X is corrected in a direction approaching 0 according to the degree (W However, minimum 0). Further, in the case where the provisional gradation conversion amount X <0, when W (index 1) exceeds the threshold value t, the provisional gradation conversion amount X is corrected in a direction approaching 0 according to the degree (W However, maximum 0). That is, when W (index 1) is larger than the threshold value t, the gradation conversion amount Z is a value obtained by correcting the temporary gradation conversion amount X so as to suppress the effect of gradation conversion.
In this way, the gradation conversion amount Z is calculated from the provisional gradation conversion amount X, and the next gradation processing condition setting is started.

<シーン毎の階調処理条件設定>
ステップS73では、既に決定された階調調整方法に対応して予め設定された複数の階調変換曲線の中から、階調変換量Zに対応する階調変換曲線が選択(決定)される。あるいは、階調変換量Zに基づいて、階調変換曲線を算出するようにしてもよい。
以下、各撮影シーン(光源条件及び露出条件)毎に、階調変換曲線の決定方法について説明する。
<Setting gradation processing conditions for each scene>
In step S73, a gradation conversion curve corresponding to the gradation conversion amount Z is selected (determined) from a plurality of gradation conversion curves set in advance corresponding to the already determined gradation adjustment method. Alternatively, the gradation conversion curve may be calculated based on the gradation conversion amount Z.
Hereinafter, a method for determining a gradation conversion curve for each shooting scene (light source condition and exposure condition) will be described.

<<順光の場合>>
撮影シーンが順光である場合、パラメータP6を仮の階調変換量Xとして選択する。パラメータP6=P5−P1なので、仮の階調変換量X=P6とするということは、階調変換量Z=仮の階調変換量Xであれば、P1をP5と一致させるオフセット補正(8bit値の平行シフト)を下記の式(22)により行うことである。
出力画像のRGB値=入力画像のRGB値+Z (22)
ただし、W(指標1)>閾値tの場合には、補正量はZ=P6の場合よりも小さめとなる。
<< In the case of front light >>
If the photographic scene is front light, the parameter P6 is selected as the provisional gradation conversion amount X. Since the parameter P6 = P5-P1, the provisional gradation conversion amount X = P6 means that if the gradation conversion amount Z = the provisional gradation conversion amount X, offset correction (8 bits) is performed to match P1 with P5. (Parallel shift of values) is performed by the following equation (22).
RGB value of output image = RGB value of input image + Z (22)
However, when W (index 1)> threshold value t, the correction amount is smaller than when Z = P6.

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

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

−50<Z<+50 の場合→L3
+50≦Z<+150 の場合→L4
+150≦Z<+250 の場合→L5
−150<Z≦−50 の場合→L2
−250<Z≦−150 の場合→L1
When -50 <Z <+ 50 → L3
When + 50 ≦ Z <+150 → L4
When + 150 ≦ Z <+ 250 → L5
If -150 <Z ≤ -50 → L2
If -250 <Z ≤ -150 → L1

なお、撮影シーンが逆光の場合、この階調変換処理とともに、覆い焼き処理を併せて行うことが好ましい。この場合、逆光度を示す指標7に応じて覆い焼き処理の程度も調整されることが望ましい。   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 the dodging process according to the index 7 indicating the backlight intensity.

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

<<主要被写体がオーバーの場合>>
主要被写体がオーバーである場合、パラメータP9を仮の階調変換量Xとして選択する。従って、仮の階調変換量Xから算出した階調変換量Zに基づいて、オフセット補正(8bit値の平行シフト)を式(23)により行う。
出力画像のRGB値=入力画像のRGB値十Z (23)
<< When main subject is over >>
If the main subject is over, the parameter P9 is selected as the provisional gradation conversion amount X. Accordingly, based on the gradation conversion amount Z calculated from the provisional gradation conversion amount X, offset correction (parallel shift of 8-bit value) is performed by Expression (23).
RGB value of output image = RGB value of input image plus Z (23)

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

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

以上説明したように、撮像装置100によれば、撮影された画像の撮影シーンを判別することによって、自動的に階調処理条件を設定するとともに、画像中に色鮮やかな青空が写っているか否かに基づく補正、肌色画素情報に基づく補正を加えることで、より適切な画像を得ることができる。   As described above, according to the imaging apparatus 100, the gradation processing condition is automatically set by determining the photographing scene of the photographed image, and whether or not a colorful blue sky is reflected in the image. A more appropriate image can be obtained by adding correction based on the color correction and correction based on skin color pixel information.

また、画像サイズを縮小した画像の画像データに基づいて、撮影シーンの判別、青色画素情報及び肌色画素情報の取得を行うので、処理の高速化を図ることができる。   Further, since the shooting scene is discriminated and the blue pixel information and skin color pixel information are acquired based on the image data of the image with the reduced image size, the processing speed can be increased.

なお、上記実施の形態における記述は、本発明に係る撮像装置の例であり、これに限定されるものではない。撮像装置を構成する各部の細部構成及び細部動作に関しても本発明の趣旨を逸脱することのない範囲で適宜変更可能である。   Note that the description in the above embodiment is an example of the imaging apparatus according to the present invention, and the present invention is not limited to this. The detailed configuration and detailed operation of each part constituting the imaging apparatus can be changed as appropriate without departing from the spirit of the present invention.

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

符号の説明Explanation of symbols

100 撮像装置
1 筐体
2 十字キー
3 撮影光学系
4 フラッシュ
5 ファインダ
6 電源スイッチ
7 表示部
8 レリーズボタン
10 画像処理部
11 第1画像取得部
12 第2画像取得部
13 占有率算出部
14 指標算出部
15 シーン判別部
16a 画像上下決定部
16b 青色画素情報取得部
16c 肌色画素情報取得部
16d 指標1算出部
17 階調処理条件設定部
18 階調変換処理部
20 撮影処理部
21 AE制御部
22 AF制御部
23 画素補間部
24 AWB制御部
25 ガンマ補正部
31 プロセッサ
32 メモリ
33 撮像素子
34 画像データ出力部
35 操作部
36 タイミングジェネレータ
37 シャッタユニット
38 絞りユニット
39 フォーカスユニット
40 姿勢情報検出部
DESCRIPTION OF SYMBOLS 100 Imaging device 1 Housing | casing 2 Cross key 3 Shooting optical system 4 Flash 5 Finder 6 Power switch 7 Display part 8 Release button 10 Image processing part 11 1st image acquisition part 12 2nd image acquisition part 13 Occupancy rate calculation part 14 Index calculation Unit 15 scene determination unit 16a image up / down determination unit 16b blue pixel information acquisition unit 16c skin color pixel information acquisition unit 16d index 1 calculation unit 17 gradation processing condition setting unit 18 gradation conversion processing unit 20 shooting processing unit 21 AE control unit 22 AF Control unit 23 Pixel interpolation unit 24 AWB control unit 25 Gamma correction unit 31 Processor 32 Memory 33 Image sensor 34 Image data output unit 35 Operation unit 36 Timing generator 37 Shutter unit 38 Aperture unit 39 Focus unit 40 Attitude information detection unit

Claims (15)

撮影により取得された画像の画像データに基づいて、撮影シーンを判別するシーン判別処理手段と、
前記撮影シーンの判別結果に基づいて、前記画像データに対する階調処理条件を設定する階調処理条件設定手段と、
前記画像の撮影時における撮像装置の傾斜の度合いを示す姿勢情報を取得し、前記姿勢情報に基づいて前記画像の上下を決定する画像上下決定手段と、
前記画像データの画面上部に位置し、かつ所定の明度値内の青色画素情報を取得する青色画素情報取得手段と、
少なくとも前記青色画素情報に予め設定された第1の係数を乗算することにより、第1の指標を算出する第1の指標算出手段と、
を備え、
前記階調処理条件設定手段は、前記第1の指標に基づいて、前記撮影シーンの判別結果に基づく階調処理条件を補正することを特徴とする撮像装置。
Scene discrimination processing means for discriminating a shooting scene based on image data of an image acquired by shooting;
A gradation processing condition setting means for setting a gradation processing condition for the image data based on the determination result of the shooting scene;
Image up-and-down determining means for acquiring posture information indicating a degree of inclination of the imaging device at the time of photographing the image and determining up and down of the image based on the posture information;
Blue pixel information acquisition means for acquiring blue pixel information located at the top of the screen of the image data and within a predetermined brightness value;
A first index calculating means for calculating a first index by multiplying at least the blue pixel information by a preset first coefficient;
With
The gradation processing condition setting unit corrects a gradation processing condition based on a result of discrimination of the shooting scene based on the first index.
撮影により取得された第1の画像から画像サイズを縮小した第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 imaging apparatus according to claim 1, wherein the scene determination processing unit determines a shooting scene based on image data of the second image.
前記青色画素情報取得手段は、前記第2の画像の画像データから前記青色画素情報を取得することを特徴とする請求項2に記載の撮像装置。   The imaging apparatus according to claim 2, wherein the blue pixel information acquisition unit acquires the blue pixel information from image data of the second image. 前記シーン判別処理手段は、
前記第2の画像の画像データから色情報を取得する色情報取得手段と、
前記取得された色情報に基づいて、前記第2の画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記第2の画像の画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、
前記取得された色情報に基づいて、前記第2の画像の画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記第2の画像の画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、第2の指標を算出する第2の指標算出手段と、
前記第1の占有率に予め設定された第3の係数を乗算することにより、第3の指標を算出する第3の指標算出手段と、
前記第2の占有率に予め設定された第4の係数を乗算することにより、第4の指標を算出する第4の指標算出手段と、
少なくとも前記第2の画像の画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、第5の指標を算出する第5の指標算出手段と、
前記第2の指標、前記第3の指標及び前記第4の指標のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、第6の指標を算出する第6の指標算出手段と、
前記第2の指標、前記第3の指標及び前記第4の指標のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、第7の指標を算出する第7の指標算出手段と、
前記第5の指標、前記第6の指標及び前記第7の指標に基づいて、前記第1の画像の画像データの撮影シーンを特定するシーン判別手段と、
を備えたことを特徴とする請求項2又は3に記載の撮像装置。
The scene discrimination processing means includes
Color information acquisition means for acquiring color information from the image data of the second image;
Based on the acquired color information, the image data of the second image is classified into a class composed of a combination of a predetermined brightness and hue, and the entire image data of the second image is classified for each classified class. First occupancy ratio calculating means for calculating a first occupancy ratio indicating a ratio of
Based on the acquired color information, the image data of the second image is classified into a class composed of a combination of the distance from the outer edge of the screen and the brightness, and for each classified class, the image data of the second image is classified. Second occupancy ratio calculating means for calculating a second occupancy ratio indicating the ratio of the entire image data;
A second index calculating means for calculating a second index by multiplying the first occupancy by a preset second coefficient;
A third index calculating means for calculating a third index by multiplying the first occupancy by a preset third coefficient;
A fourth index calculating means for calculating a fourth index by multiplying the second occupancy by a preset fourth coefficient;
A fifth index calculating means for calculating a fifth index by multiplying an average brightness of the skin color at least in the center of the screen of the image data of the second image by a preset fifth coefficient;
A sixth index is calculated by multiplying at least one of the second index, the third index, and the fourth index by a preset sixth coefficient. Index calculation means;
A seventh index is calculated by multiplying at least one of the second index, the third index, and the fourth index by a preset seventh coefficient. Index calculation means;
Scene discriminating means for specifying a shooting scene of the image data of the first image based on the fifth index, the sixth index, and the seventh index;
The imaging apparatus according to claim 2, further comprising:
前記第2の画像の画像データから肌色画素情報を取得する肌色画素情報取得手段を備え、
前記第1の指標算出手段は、さらに、前記肌色画素情報に予め設定された第8の係数を乗算することにより、前記第1の指標を算出することを特徴とする請求項2〜4の何れか一項に記載の撮像装置。
Skin color pixel information acquisition means for acquiring skin color pixel information from the image data of the second image,
The first index calculation means further calculates the first index by multiplying the flesh color pixel information by an eighth coefficient set in advance. The imaging device according to claim 1.
撮影により取得された画像の画像データに基づいて、撮影シーンを判別するシーン判別処理工程と、
前記撮影シーンの判別結果に基づいて、前記画像データに対する階調処理条件を設定する階調処理条件設定工程と、
前記画像の撮影時における撮像装置の傾斜の度合いを示す姿勢情報を取得し、前記姿勢情報に基づいて前記画像の上下を決定する画像上下決定工程と、
前記画像データの画面上部に位置し、かつ所定の明度値内の青色画素情報を取得する青色画素情報取得工程と、
少なくとも前記青色画素情報に予め設定された第1の係数を乗算することにより、第1の指標を算出する第1の指標算出工程と、
を含み、
前記階調処理条件設定工程では、前記第1の指標に基づいて、前記撮影シーンの判別結果に基づく階調処理条件を補正することを特徴とする画像処理方法。
A scene determination processing step for determining a shooting scene based on image data of an image acquired by shooting;
A gradation processing condition setting step for setting a gradation processing condition for the image data based on the determination result of the shooting scene;
An image up / down determination step of obtaining posture information indicating a degree of inclination of the imaging device at the time of capturing the image, and determining up / down of the image based on the posture information;
A blue pixel information acquisition step for acquiring blue pixel information located at the top of the screen of the image data and within a predetermined brightness value;
A first index calculation step of calculating a first index by multiplying at least the blue pixel information by a preset first coefficient;
Including
In the gradation processing condition setting step, the gradation processing condition based on the shooting scene discrimination result is corrected based on the first index.
撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得工程を含み、
前記シーン判別処理工程では、前記第2の画像の画像データに基づいて、撮影シーンを判別することを特徴とする請求項6に記載の画像処理方法。
Including a second image acquisition step of acquiring a second image obtained by reducing the image size from the first image acquired by photographing,
The image processing method according to claim 6, wherein in the scene determination processing step, a shooting scene is determined based on image data of the second image.
前記青色画素情報取得工程では、前記第2の画像の画像データから前記青色画素情報を取得することを特徴とする請求項7に記載の画像処理方法。   The image processing method according to claim 7, wherein in the blue pixel information acquisition step, the blue pixel information is acquired from image data of the second image. 前記シーン判別処理工程は、
前記第2の画像の画像データから色情報を取得する色情報取得工程と、
前記取得された色情報に基づいて、前記第2の画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記第2の画像の画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出工程と、
前記取得された色情報に基づいて、前記第2の画像の画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記第2の画像の画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出工程と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、第2の指標を算出する第2の指標算出工程と、
前記第1の占有率に予め設定された第3の係数を乗算することにより、第3の指標を算出する第3の指標算出工程と、
前記第2の占有率に予め設定された第4の係数を乗算することにより、第4の指標を算出する第4の指標算出工程と、
少なくとも前記第2の画像の画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、第5の指標を算出する第5の指標算出工程と、
前記第2の指標、前記第3の指標及び前記第4の指標のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、第6の指標を算出する第6の指標算出工程と、
前記第2の指標、前記第3の指標及び前記第4の指標のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、第7の指標を算出する第7の指標算出工程と、
前記第5の指標、前記第6の指標及び前記第7の指標に基づいて、前記第1の画像の画像データの撮影シーンを特定するシーン判別工程と、
を含むことを特徴とする請求項7又は8に記載の画像処理方法。
The scene discrimination processing step includes
A color information acquisition step of acquiring color information from the image data of the second image;
Based on the acquired color information, the image data of the second image is classified into a class composed of a combination of a predetermined brightness and hue, and the entire image data of the second image is classified for each classified class. A first occupancy ratio calculating step of calculating a first occupancy ratio indicating a ratio of
Based on the acquired color information, the image data of the second image is classified into a class composed of a combination of the distance from the outer edge of the screen and the brightness, and for each classified class, the image data of the second image is classified. A second occupancy ratio calculating step of calculating a second occupancy ratio indicating the ratio of the entire image data;
A second index calculating step of calculating a second index by multiplying the first occupancy by a preset second coefficient;
A third index calculating step of calculating a third index by multiplying the first occupancy by a preset third coefficient;
A fourth index calculating step of calculating a fourth index by multiplying the second occupancy by a preset fourth coefficient;
A fifth index calculating step of calculating a fifth index by multiplying an average brightness of the skin color at least in the center of the screen of the image data of the second image by a preset fifth coefficient;
A sixth index is calculated by multiplying at least one of the second index, the third index, and the fourth index by a preset sixth coefficient. An index calculation process;
A seventh index is calculated by multiplying at least one of the second index, the third index, and the fourth index by a preset seventh coefficient. An index calculation process;
A scene determination step for specifying a shooting scene of the image data of the first image based on the fifth index, the sixth index, and the seventh index;
The image processing method according to claim 7 or 8, comprising:
前記第2の画像の画像データから肌色画素情報を取得する肌色画素情報取得工程を含み、
前記第1の指標算出工程では、さらに、前記肌色画素情報に予め設定された第8の係数を乗算することにより、前記第1の指標を算出することを特徴とする請求項7〜9の何れか一項に記載の画像処理方法。
Including a skin color pixel information acquisition step of acquiring skin color pixel information from the image data of the second image,
The said 1st parameter | index calculation process WHEREIN: Furthermore, the said 1st parameter | index is calculated by multiplying the 8th coefficient preset to the said skin color pixel information, The any one of Claim 7-9 characterized by the above-mentioned. An image processing method according to claim 1.
コンピュータに、
撮影により取得された画像の画像データに基づいて、撮影シーンを判別するシーン判別処理機能と、
前記撮影シーンの判別結果に基づいて、前記画像データに対する階調処理条件を設定する階調処理条件設定機能と、
前記画像の撮影時における撮像装置の傾斜の度合いを示す姿勢情報を取得し、前記姿勢情報に基づいて前記画像の上下を決定する画像上下決定機能と、
前記画像データの画面上部に位置し、かつ所定の明度値内の青色画素情報を取得する青色画素情報取得機能と、
少なくとも前記青色画素情報に予め設定された第1の係数を乗算することにより、第1の指標を算出する第1の指標算出機能と、
を実現させるための画像処理プログラムであって、
前記階調処理条件設定機能を実現させる際に、前記第1の指標に基づいて、前記撮影シーンの判別結果に基づく階調処理条件を補正させることを特徴とする画像処理プログラム。
On the computer,
A scene discrimination processing function for discriminating a shooting scene based on image data of an image acquired by shooting;
A gradation processing condition setting function for setting a gradation processing condition for the image data, based on the determination result of the shooting scene;
An image up / down determination function that acquires posture information indicating a degree of inclination of the imaging device at the time of capturing the image, and determines the up / down of the image based on the posture information;
A blue pixel information acquisition function for acquiring blue pixel information located at the top of the screen of the image data and within a predetermined brightness value;
A first index calculation function for calculating a first index by multiplying at least the blue pixel information by a preset first coefficient;
An image processing program for realizing
An image processing program that, when realizing the gradation processing condition setting function, corrects a gradation processing condition based on a determination result of the shooting scene based on the first index.
前記コンピュータに、さらに、
撮影により取得された第1の画像から画像サイズを縮小した第2の画像を取得する第2の画像取得機能を実現させ、
前記シーン判別処理機能を実現させる際に、前記第2の画像の画像データに基づいて、撮影シーンを判別させることを特徴とする請求項11に記載の画像処理プログラム。
In addition to the computer,
Realizing a second image acquisition function for acquiring a second image obtained by reducing the image size from the first image acquired by photographing;
12. The image processing program according to claim 11, wherein when the scene discrimination processing function is realized, a shooting scene is discriminated based on image data of the second image.
前記青色画素情報取得機能を実現させる際に、前記第2の画像の画像データから前記青色画素情報を取得させることを特徴とする請求項12に記載の画像処理プログラム。   13. The image processing program according to claim 12, wherein the blue pixel information is acquired from the image data of the second image when the blue pixel information acquisition function is realized. 前記シーン判別処理機能は、
前記第2の画像の画像データから色情報を取得する色情報取得機能と、
前記取得された色情報に基づいて、前記第2の画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記第2の画像の画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出機能と、
前記取得された色情報に基づいて、前記第2の画像の画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記第2の画像の画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出機能と、
前記第1の占有率に予め設定された第2の係数を乗算することにより、第2の指標を算出する第2の指標算出機能と、
前記第1の占有率に予め設定された第3の係数を乗算することにより、第3の指標を算出する第3の指標算出機能と、
前記第2の占有率に予め設定された第4の係数を乗算することにより、第4の指標を算出する第4の指標算出機能と、
少なくとも前記第2の画像の画像データの画面中央部における肌色の平均輝度に、予め設定された第5の係数を乗算することにより、第5の指標を算出する第5の指標算出機能と、
前記第2の指標、前記第3の指標及び前記第4の指標のうち少なくとも一つ以上の指標に予め設定された第6の係数を乗算することにより、第6の指標を算出する第6の指標算出機能と、
前記第2の指標、前記第3の指標及び前記第4の指標のうち少なくとも一つ以上の指標に予め設定された第7の係数を乗算することにより、第7の指標を算出する第7の指標算出機能と、
前記第5の指標、前記第6の指標及び前記第7の指標に基づいて、前記第1の画像の画像データの撮影シーンを特定するシーン判別機能と、
を含むことを特徴とする請求項12又は13に記載の画像処理プログラム。
The scene discrimination processing function is
A color information acquisition function for acquiring color information from the image data of the second image;
Based on the acquired color information, the image data of the second image is classified into a class composed of a combination of a predetermined brightness and hue, and the entire image data of the second image is classified for each classified class. A first occupancy ratio calculating function for calculating a first occupancy ratio indicating a proportion of
Based on the acquired color information, the image data of the second image is classified into a class composed of a combination of the distance from the outer edge of the screen and the brightness, and for each classified class, the image data of the second image is classified. A second occupancy ratio calculation function for calculating a second occupancy ratio indicating a ratio of the entire image data;
A second index calculating function for calculating a second index by multiplying the first occupancy by a preset second coefficient;
A third index calculation function for calculating a third index by multiplying the first occupancy by a preset third coefficient;
A fourth index calculating function for calculating a fourth index by multiplying the second occupancy by a preset fourth coefficient;
A fifth index calculation function for calculating a fifth index by multiplying the average brightness of the skin color at the center of the screen of the image data of at least the second image by a preset fifth coefficient;
A sixth index is calculated by multiplying at least one of the second index, the third index, and the fourth index by a preset sixth coefficient. An index calculation function,
A seventh index is calculated by multiplying at least one of the second index, the third index, and the fourth index by a preset seventh coefficient. An index calculation function,
A scene determination function for specifying a shooting scene of image data of the first image based on the fifth index, the sixth index, and the seventh index;
The image processing program according to claim 12 or 13, characterized by comprising:
前記コンピュータに、さらに、
前記第2の画像の画像データから肌色画素情報を取得する肌色画素情報取得機能を実現させ、
前記第1の指標算出機能を実現させる際に、さらに、前記肌色画素情報に予め設定された第8の係数を乗算することにより、前記第1の指標を算出させることを特徴とする請求項12〜14の何れか一項に記載の画像処理プログラム。
In addition to the computer,
Realizing a skin color pixel information acquisition function for acquiring skin color pixel information from the image data of the second image;
13. When realizing the first index calculation function, the first index is calculated by multiplying the flesh color pixel information by a preset eighth coefficient. The image processing program as described in any one of -14.
JP2006126118A 2006-04-28 2006-04-28 Imaging apparatus, and image processing method, and image processing program Pending JP2007300348A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006126118A JP2007300348A (en) 2006-04-28 2006-04-28 Imaging apparatus, and image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006126118A JP2007300348A (en) 2006-04-28 2006-04-28 Imaging apparatus, and image processing method, and image processing program

Publications (1)

Publication Number Publication Date
JP2007300348A true JP2007300348A (en) 2007-11-15

Family

ID=38769480

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006126118A Pending JP2007300348A (en) 2006-04-28 2006-04-28 Imaging apparatus, and image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP2007300348A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101656831A (en) * 2008-08-22 2010-02-24 三洋电机株式会社 Electronic camera

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101656831A (en) * 2008-08-22 2010-02-24 三洋电机株式会社 Electronic camera
US8284300B2 (en) 2008-08-22 2012-10-09 Sanyo Electric Co., Ltd. Electronic camera

Similar Documents

Publication Publication Date Title
US10142536B2 (en) Camera using preview image to select exposure
US8305487B2 (en) Method and apparatus for controlling multiple exposures
EP2608527B1 (en) Image pickup apparatus, control method for image pickup apparatus, and storage medium
US9025050B2 (en) Digital photographing apparatus and control method thereof
JP2006325015A (en) Image processing method, image processing apparatus, imaging apparatus, and image processing program
JP2007184888A (en) Imaging apparatus, image processor, image processing method, and image processing program
JP2006333205A (en) Imaging apparatus, image processing method and image processing program
CN111434104B (en) Image processing apparatus, image capturing apparatus, image processing method, and recording medium
JP2007228221A (en) Imaging apparatus, image processing apparatus, image processing method and image processing program
JP2007311895A (en) Imaging apparatus, image processor, image processing method and image processing program
JP2007243542A (en) Imaging apparatus, image processing apparatus, image processing method, and image processing program
JP2007288245A (en) Imaging apparatus, image processing method, and image processing program
JP2007293686A (en) Imaging apparatus, image processing apparatus, image processing method and image processing program
JP2007221678A (en) Imaging apparatus, image processor, image processing method and image processing program
JP2007312294A (en) Imaging apparatus, image processor, method for processing image, and image processing program
JP2007184887A (en) Image pickup device, image processor, image processing method and image processing program
JP2007243556A (en) Imaging apparatus, image processing method, and image processing program
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
JP2007235369A (en) Imaging apparatus, and unit, method, and program for processing image
JP2007300348A (en) Imaging apparatus, and image processing method, and image processing program
JP2007235365A (en) Imaging apparatus, and method and program for processing image
JP2006190154A (en) Image processing method, image processor, image processing program and imaging device
JP2007228132A (en) Imaging apparatus, image processing apparatus, image processing method and image processing program
JP2007195097A (en) Imaging 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

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20080221