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

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

Info

Publication number
JP2007293686A
JP2007293686A JP2006122213A JP2006122213A JP2007293686A JP 2007293686 A JP2007293686 A JP 2007293686A JP 2006122213 A JP2006122213 A JP 2006122213A JP 2006122213 A JP2006122213 A JP 2006122213A JP 2007293686 A JP2007293686 A JP 2007293686A
Authority
JP
Japan
Prior art keywords
index
image
gradation
linear image
processing
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
JP2006122213A
Other languages
Japanese (ja)
Inventor
Hiroaki Takano
博明 高野
Jo Nakajima
丈 中嶋
Daisuke Sato
大輔 佐藤
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 JP2006122213A priority Critical patent/JP2007293686A/en
Publication of JP2007293686A publication Critical patent/JP2007293686A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To optimize brightness of a main photographic subject (for example, a person's face region) without varying an operating-point for existing automatic focus control and imaging element and without varying gradation processing condition from a linear image to a non-linear image. <P>SOLUTION: An imaging apparatus 1 acquires the linear image formed by photographing (S5, S7) and carries out discriminating process for a photographing scene based on the linear image (S8). Then, based on the discriminated result by the scene discriminating process, the gradation processing condition for the linear image is set (S9) and gradation converting process (brightness compensation process and flare compensation process) for the linear image is carried out (S10 and S11) based on the set gradation processing condition. Then, the gradation converting process (a gamma converting process) is carried out (S12) converting the linear image to which the gradation converting process is applied to the non-linear image. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

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

デジタルカメラで取得された撮影画像データからプリントを作成する際、主要被写体(例えば、人物顔領域)の明るさが適正に仕上がるように、撮影画像データの明るさを調整することが行われている。このような明るさ調整方法において、撮影画像データの主要被写体を解析して得られた情報に基づいて、その撮影画像データの明るさを自動的に最適化するための補正量及び階調変換LUTの設定方法が知られている(例えば、特許文献1参照)。
特開2002−247393号公報
When creating a print from photographed image data acquired by a digital camera, the brightness of the photographed image data is adjusted so that the brightness of the main subject (for example, a human face area) is properly finished. . In such a brightness adjustment method, a correction amount and tone conversion LUT for automatically optimizing the brightness of the photographed image data based on information obtained by analyzing the main subject of the photographed image data Is known (see, for example, Patent Document 1).
JP 2002-247393 A

しかしながら、通常のデジタルカメラで取得されるJPEG等の撮影画像データは、被写体の輝度値を記録した画像データ(以下、「リニア画像」と称す)から、モニタなどの表示媒体上での鑑賞に最適となる画像データ(以下、「ノンリニア画像」と称す)へと階調変換処理が施されたものであるため、撮影直後の「リニア画像」に比べ、情報量(S/N)がかなり低下した状態にある。このため、逆光やオーバー撮影シーンのような輝度範囲の大きいシーンでは、補正量を大きくする程、情報量(S/N)の低下、明部、暗部および高彩度部の飽和などの画質劣化が深刻化するため、補正量を大幅に制限せざるを得ないという問題があった。   However, captured image data such as JPEG acquired with a normal digital camera is optimal for viewing on a display medium such as a monitor from image data (hereinafter referred to as “linear image”) in which the luminance value of the subject is recorded. The amount of information (S / N) is considerably lower than the “linear image” immediately after shooting because the image data (hereinafter referred to as “non-linear image”) has undergone gradation conversion processing. Is in a state. For this reason, in scenes with a large luminance range, such as backlighting and overshooting scenes, the larger the correction amount, the more serious the image quality degradation, such as a decrease in the amount of information (S / N) and saturation of bright, dark, and high-saturation parts. Therefore, there has been a problem that the correction amount has to be greatly limited.

この問題を解決するために、撮像素子のダイナミックレンジの範囲内に納まる被写体の輝度範囲を規定する、撮像素子の動作点を変更するようにしたデジタルカメラが知られている。具体的には、デジタルカメラの露出をアンダー側にずらす、即ち露出制御の基礎となる撮像素子の設定感度を高くすることにより、標準輝度部分に対する撮像素子の出力値を低下させ、撮影可能範囲を拡大させるというものである。このアンダー撮影した「リニア画像」から、適正露出の「ノンリニア画像」へと階調変換処理を施す手法によって、輝度範囲の大きいシーンに対して高い補正量を適用したときに生じる「白とび」などの問題が、ある程度緩和される改善効果が得られている。   In order to solve this problem, a digital camera is known in which the operating point of the image sensor that defines the luminance range of the subject that falls within the dynamic range of the image sensor is changed. Specifically, by shifting the exposure of the digital camera to the under side, that is, by increasing the setting sensitivity of the image sensor that is the basis for exposure control, the output value of the image sensor for the standard luminance part is reduced, and the shootable range is increased. It is to expand. “Whiteout” that occurs when a high correction amount is applied to a scene with a large luminance range by applying a tone conversion process from this underlined “linear image” to a properly exposed “nonlinear image” This problem has been improved to some extent.

一方、通常のデジタルカメラでは、搭載可能なCPU(Central Processing Unit)性能、高速処理、操作性などに対する要求から、自動露出制御アルゴリズムや、記憶媒体へ記録する前の画像処理をより複雑なものとすることができず、この対策として、「リニア画像」を、所謂「Rawデータ」として記録し、所謂「現像ソフト」を用いて「Rawデータ」から「ノンリニア画像」へと変換する、ユーザ自身による作業を前提とした手段を提供している。しかしながら、「現像ソフト」の利用及び画像データの管理にはかなり煩雑な操作を伴うため、誰もが簡単に利用できるものであるとは言い難く、デジタルカメラの更なる性能向上が望まれている。   On the other hand, with ordinary digital cameras, the demands for CPU (Central Processing Unit) performance, high-speed processing, operability, etc., make automatic exposure control algorithms and image processing before recording to storage media more complicated. As a countermeasure against this, “linear image” is recorded as so-called “Raw data” and converted from “Raw data” to “non-linear image” using so-called “development software” by the user himself Provides means based on work. However, the use of "development software" and the management of image data involve a rather complicated operation, so it is not easy for anyone to use, and further improvement of the performance of digital cameras is desired. .

本発明の課題は、既存の自動露出制御、撮像素子の動作点変更、リニア画像からノンリニア画像への階調処理条件の変更を行うことなく、主要被写体(例えば、人物顔領域)の明るさを最適化することである。   An object of the present invention is to control the brightness of a main subject (for example, a human face area) without changing the existing automatic exposure control, the operating point of the image sensor, or changing the gradation processing condition from a linear image to a non-linear image. Is to optimize.

上記課題を解決するため、請求項1に記載の撮像装置は、
被写体を撮影する撮影手段と、
前記撮影手段による撮影によって形成されたリニア画像を取得する画像取得手段と、
前記リニア画像に基づいて撮影シーンの判別処理を行うシーン判別処理手段と、
前記シーン判別処理手段による判別結果に基づいて、前記リニア画像の明るさを調整するための第1の階調処理条件と、硬さを調整するための第2の階調処理条件とを設定する階調処理条件設定手段と、
前記階調処理条件設定手段により設定された第1の階調処理条件に基づいて、前記リニア画像に対する第1の階調変換処理を行う第1の階調変換処理手段と、
前記階調処理条件設定手段により設定された第2の階調処理条件に基づいて、前記第1の階調変換処理が適用されたリニア画像に対する第2の階調変換処理を行う第2の階調変換処理手段と、
前記第2の階調変換処理が適用されたリニア画像をノンリニア画像に変換する第3の階調変換処理を行う第3の階調変換処理手段と、を備えることを特徴としている。
In order to solve the above problem, an imaging apparatus according to claim 1 is provided.
Photographing means for photographing the subject;
Image obtaining means for obtaining a linear image formed by photographing by the photographing means;
Scene discrimination processing means for performing a discrimination process of a photographic scene based on the linear image;
Based on the determination result by the scene determination processing means, a first gradation processing condition for adjusting the brightness of the linear image and a second gradation processing condition for adjusting the hardness are set. Gradation processing condition setting means;
First gradation conversion processing means for performing a first gradation conversion process on the linear image based on a first gradation processing condition set by the gradation processing condition setting means;
Based on the second gradation processing condition set by the gradation processing condition setting means, a second floor that performs a second gradation conversion process on the linear image to which the first gradation conversion process is applied. Key conversion processing means;
And a third gradation conversion processing means for performing a third gradation conversion process for converting the linear image to which the second gradation conversion process is applied into a non-linear image.

請求項2に記載の発明は、請求項1に記載の撮像装置において、前記画像取得手段は、前記リニア画像から、画像サイズを縮小したリニア画像を取得し、
前記シーン判別処理手段は、前記画像サイズを縮小したリニア画像を用いて撮影シーンの判別処理を行うことを特徴としている。
According to a second aspect of the present invention, in the imaging apparatus according to the first aspect, the image acquisition means acquires a linear image with a reduced image size from the linear image,
The scene discrimination processing means performs a shooting scene discrimination process using a linear image with the image size reduced.

請求項3に記載の発明は、請求項1又は2に記載の撮像装置において、前記リニア画像の撮影時に算出される輝度情報を取得する輝度情報取得手段を備え、
前記シーン判別処理手段は、前記輝度情報取得手段により取得された輝度情報に基づいて撮影シーンの判別処理を行い、前記階調処理条件設定手段は、前記輝度情報取得手段により取得された輝度情報に基づいて第1及び第2の階調処理条件を設定することを特徴としている。
Invention of Claim 3 is provided with the luminance information acquisition means which acquires the luminance information computed at the time of photography of the linear image in the imaging device of Claim 1 or 2,
The scene determination processing unit performs a shooting scene determination process based on the luminance information acquired by the luminance information acquisition unit, and the gradation processing condition setting unit adds the luminance information acquired by the luminance information acquisition unit. Based on this, the first and second gradation processing conditions are set.

請求項4に記載の発明は、請求項1〜3の何れか一項に記載の撮像装置において、前記シーン判別処理手段は、前記リニア画像の自然光による屋外撮影度を表す自然光指標と、ダイナミックレンジの大きさを表す輝度比指標と、撮影時の露出設定に起因する露出撮影度指標とを算出し、前記算出された各指標に基づいて撮影シーンを判別することを特徴としている。   According to a fourth aspect of the present invention, in the imaging apparatus according to any one of the first to third aspects, the scene discrimination processing unit includes a natural light index that represents an outdoor photographing degree of the linear image by natural light, a dynamic range, A luminance ratio index representing the size of the image and an exposure shooting degree index resulting from the exposure setting at the time of shooting are calculated, and a shooting scene is determined based on each of the calculated indexes.

請求項5に記載の発明は、請求項4に記載の撮像装置において、前記シーン判別処理手段は、前記リニア画像について色情報を取得し、当該取得された色情報に基づいて、前記リニア画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、
前記第1の占有率に、撮影条件に応じて予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、
前記第1の占有率に、撮影条件に応じて予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、
前記第2の占有率に、撮影条件に応じて予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、撮影条件に応じて予め設定された第4の係数を乗算することにより、前記露出撮影度を算出する第4の指標算出手段と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第5の係数を乗算することにより、前記自然光指標を算出する第5の指標算出手段と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第6の係数を乗算することにより、前記輝度比指標を算出する第6の指標算出手段と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記画像データの撮影シーンを判別するシーン判別手段と、を備えることを特徴としている。
According to a fifth aspect of the present invention, in the imaging device according to the fourth aspect, the scene determination processing unit acquires color information about the linear image, and based on the acquired color information, the linear image of the linear image is acquired. First occupancy rate calculating means for classifying image data into a class composed of a combination of predetermined brightness and hue, and calculating a first occupancy ratio indicating the ratio of the entire image data for each of the classified classes; ,
Based on the acquired color information, the image data is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the proportion of the entire image data for each classified class Second occupancy rate calculating means for calculating the occupancy rate of
A first index calculating means for calculating index 1 by multiplying the first occupancy by a first coefficient set in advance according to the photographing condition;
A second index calculating means for calculating index 2 by multiplying the first occupancy by a second coefficient set in advance according to the shooting conditions;
A third index calculating means for calculating the index 3 by multiplying the second occupancy by a third coefficient set in advance according to the shooting conditions;
A fourth index calculating means for calculating the exposure photographing degree by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a fourth coefficient set in advance according to photographing conditions;
The natural light index is calculated by multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a fifth coefficient that is set in advance according to shooting conditions. A fifth index calculating means for
By multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a sixth coefficient that is set in advance according to shooting conditions, the luminance ratio index is obtained. Sixth index calculating means for calculating;
Scene discrimination means for discriminating a shooting scene of the image data based on the exposure shooting degree, the natural light index, and the luminance ratio index.

請求項6に記載の発明は、請求項4又は5に記載の撮像装置において、前記階調処理条件設定手段は、前記リニア画像の明るさ解析値と、明るさの再現目標値と、前記輝度比指標及び前記露出撮影度に基づいて、当該リニア画像に対する複数の第1仮補正量を設定する第1仮補正量設定手段と、
前記自然光指標に基づいて、前記複数の第1仮補正量の各々に乗算する重み係数としての第1混合係数を設定する第1混合係数設定手段と、
前記第1混合係数設定手段により設定された第1混合係数と、前記複数の第1仮補正量に基づいて、前記リニア画像に対する第2仮補正量を設定する第2仮補正量設定手段と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記複数の第1仮補正量のうち少なくとも1つと、前記第2仮補正量に乗算する重み係数としての第2混合係数を設定する第2混合係数設定手段と、
前記第2混合係数により設定された第2混合係数と、前記少なくとも1つの第1仮補正量と、前記第2仮補正量に基づいて、階調調整パラメータを算出する階調調整パラメータ算出手段と、を備え、
前記シーン判別処理手段による判別結果と、前記階調調整パラメータ算出手段により算出された階調調整パラメータとに基づいて、前記リニア画像に対する第1の階調処理条件を設定することを特徴としている。
According to a sixth aspect of the present invention, in the imaging apparatus according to the fourth or fifth aspect, the gradation processing condition setting unit includes a brightness analysis value of the linear image, a brightness reproduction target value, and the luminance. First temporary correction amount setting means for setting a plurality of first temporary correction amounts for the linear image based on the ratio index and the exposure photographing degree;
First mixing coefficient setting means for setting a first mixing coefficient as a weighting coefficient for multiplying each of the plurality of first temporary correction amounts based on the natural light index;
Second temporary correction amount setting means for setting a second temporary correction amount for the linear image based on the first mixing coefficient set by the first mixing coefficient setting means and the plurality of first temporary correction amounts;
Based on the exposure photographing degree, the natural light index, and the luminance ratio index, at least one of the plurality of first temporary correction amounts and a second mixing coefficient as a weighting coefficient for multiplying the second temporary correction amount are set. Second mixing coefficient setting means for
Gradation adjustment parameter calculation means for calculating a gradation adjustment parameter based on the second mixing coefficient set by the second mixing coefficient, the at least one first temporary correction amount, and the second temporary correction amount; With
A first gradation processing condition for the linear image is set based on a determination result by the scene determination processing unit and a gradation adjustment parameter calculated by the gradation adjustment parameter calculation unit.

請求項7に記載の画像処理装置は、
撮影によって形成されたリニア画像を取得する画像取得手段と、
前記リニア画像に基づいて撮影シーンの判別処理を行うシーン判別処理手段と、
前記シーン判別処理手段による判別結果に基づいて、前記リニア画像の明るさを調整するための第1の階調処理条件と、硬さを調整するための第2の階調処理条件とを設定する階調処理条件設定手段と、
前記階調処理条件設定手段により設定された第1の階調処理条件に基づいて、前記リニア画像に対する第1の階調変換処理を行う第1の階調変換処理手段と、
前記階調処理条件設定手段により設定された第2の階調処理条件に基づいて、前記第1の階調変換処理が適用されたリニア画像に対する第2の階調変換処理を行う第2の階調変換処理手段と、
前記第2の階調変換処理が適用されたリニア画像をノンリニア画像に変換する階調変換処理を行う第3の階調変換処理手段と、を備えることを特徴としている。
An image processing apparatus according to claim 7 is provided.
Image acquisition means for acquiring a linear image formed by photographing;
Scene discrimination processing means for performing a discrimination process of a photographic scene based on the linear image;
Based on the determination result by the scene determination processing means, a first gradation processing condition for adjusting the brightness of the linear image and a second gradation processing condition for adjusting the hardness are set. Gradation processing condition setting means;
First gradation conversion processing means for performing a first gradation conversion process on the linear image based on a first gradation processing condition set by the gradation processing condition setting means;
Based on the second gradation processing condition set by the gradation processing condition setting means, a second floor that performs a second gradation conversion process on the linear image to which the first gradation conversion process is applied. Key conversion processing means;
And third gradation conversion processing means for performing gradation conversion processing for converting the linear image to which the second gradation conversion processing is applied into a non-linear image.

請求項8に記載の発明は、請求項7に記載の画像処理装置において、前記画像取得手段は、前記リニア画像から、画像サイズを縮小したリニア画像を取得し、
前記シーン判別処理手段は、前記画像サイズを縮小したリニア画像を用いて撮影シーンの判別処理を行うことを特徴としている。
The invention according to claim 8 is the image processing apparatus according to claim 7, wherein the image acquisition means acquires a linear image with a reduced image size from the linear image,
The scene discrimination processing means performs a shooting scene discrimination process using a linear image with the image size reduced.

請求項9に記載の発明は、請求項7又は8に記載の画像処理装置において、前記リニア画像の撮影時に算出される輝度情報を取得する輝度情報取得手段を備え、
前記シーン判別処理手段は、前記輝度情報取得手段により取得された輝度情報に基づいて撮影シーンの判別処理を行い、
前記階調処理条件設定手段は、前記輝度情報取得手段により取得された輝度情報に基づいて第1及び第2の階調処理条件を設定することを特徴としている。
The invention according to claim 9 is the image processing apparatus according to claim 7 or 8, further comprising luminance information acquisition means for acquiring luminance information calculated at the time of photographing the linear image,
The scene determination processing unit performs a shooting scene determination process based on the luminance information acquired by the luminance information acquisition unit,
The gradation processing condition setting means sets the first and second gradation processing conditions based on the luminance information acquired by the luminance information acquisition means.

請求項10に記載の発明は、請求項7〜9の何れか一項に記載の画像処理装置において、前記シーン判別処理手段は、前記リニア画像の自然光による屋外撮影度を表す自然光指標と、ダイナミックレンジの大きさを表す輝度比指標と、撮影時の露出設定に起因する露出撮影度指標とを算出し、
前記算出された各指標に基づいて撮影シーンを判別することを特徴としている。
According to a tenth aspect of the present invention, in the image processing device according to any one of the seventh to ninth aspects, the scene determination processing unit includes a natural light index that represents an outdoor photographing degree of the linear image by natural light, and a dynamic light. Calculate the brightness ratio index that represents the size of the range and the exposure shooting index that is attributed to the exposure setting at the time of shooting.
A shooting scene is discriminated based on each of the calculated indexes.

請求項11に記載の発明は、請求項10に記載の画像処理装置において、前記シーン判別処理手段は、
前記リニア画像について色情報を取得し、当該取得された色情報に基づいて、前記リニア画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、
前記第1の占有率に、撮影条件に応じて予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、
前記第1の占有率に、撮影条件に応じて予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、
前記第2の占有率に、撮影条件に応じて予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、撮影条件に応じて予め設定された第4の係数を乗算することにより、前記露出撮影度を算出する第4の指標算出手段と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第5の係数を乗算することにより、前記自然光指標を算出する第5の指標算出手段と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第6の係数を乗算することにより、前記輝度比指標を算出する第6の指標算出手段と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記画像データの撮影シーンを判別するシーン判別手段と、を備えることを特徴としている。
According to an eleventh aspect of the present invention, in the image processing apparatus according to the tenth aspect, the scene discrimination processing means includes:
Color information is acquired for the linear image, and based on the acquired color information, the image data of the linear image is classified into a class composed of a combination of predetermined brightness and hue, and for each of the classified classes, First occupancy ratio calculating means for calculating a first occupancy ratio indicating a ratio of the entire image data;
Based on the acquired color information, the image data is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the proportion of the entire image data for each classified class Second occupancy rate calculating means for calculating the occupancy rate of
A first index calculating means for calculating index 1 by multiplying the first occupancy by a first coefficient set in advance according to the photographing condition;
A second index calculating means for calculating index 2 by multiplying the first occupancy by a second coefficient set in advance according to the shooting conditions;
A third index calculating means for calculating the index 3 by multiplying the second occupancy by a third coefficient set in advance according to the shooting conditions;
A fourth index calculating means for calculating the exposure photographing degree by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a fourth coefficient set in advance according to photographing conditions;
The natural light index is calculated by multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a fifth coefficient that is set in advance according to shooting conditions. A fifth index calculating means for
By multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a sixth coefficient that is set in advance according to shooting conditions, the luminance ratio index is obtained. Sixth index calculating means for calculating;
Scene discrimination means for discriminating a shooting scene of the image data based on the exposure shooting degree, the natural light index, and the luminance ratio index.

請求項12に記載の発明は、請求項10又は11に記載の画像処理装置において、前記階調処理条件設定手段は、
前記リニア画像の明るさ解析値と、明るさの再現目標値と、前記輝度比指標及び前記露出撮影度に基づいて、当該リニア画像に対する複数の第1仮補正量を設定する第1仮補正量設定手段と、
前記自然光指標に基づいて、前記複数の第1仮補正量の各々に乗算する重み係数としての第1混合係数を設定する第1混合係数設定手段と、
前記第1混合係数設定手段により設定された第1混合係数と、前記複数の第1仮補正量に基づいて、前記リニア画像に対する第2仮補正量を設定する第2仮補正量設定手段と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記複数の第1仮補正量のうち少なくとも1つと、前記第2仮補正量に乗算する重み係数としての第2混合係数を設定する第2混合係数設定手段と、
前記第2混合係数により設定された第2混合係数と、前記少なくとも1つの第1仮補正量と、前記第2仮補正量に基づいて、階調調整パラメータを算出する階調調整パラメータ算出手段と、を備え、
前記シーン判別処理手段による判別結果と、前記階調調整パラメータ算出手段により算出された階調調整パラメータとに基づいて、前記リニア画像に対する第1の階調処理条件を設定することを特徴としている。
The invention according to claim 12 is the image processing apparatus according to claim 10 or 11, wherein the gradation processing condition setting means includes:
A first temporary correction amount for setting a plurality of first temporary correction amounts for the linear image based on a brightness analysis value of the linear image, a brightness reproduction target value, the luminance ratio index, and the exposure photographing degree. Setting means;
First mixing coefficient setting means for setting a first mixing coefficient as a weighting coefficient for multiplying each of the plurality of first temporary correction amounts based on the natural light index;
Second temporary correction amount setting means for setting a second temporary correction amount for the linear image based on the first mixing coefficient set by the first mixing coefficient setting means and the plurality of first temporary correction amounts;
Based on the exposure photographing degree, the natural light index, and the luminance ratio index, at least one of the plurality of first temporary correction amounts and a second mixing coefficient as a weighting coefficient for multiplying the second temporary correction amount are set. Second mixing coefficient setting means for
Gradation adjustment parameter calculation means for calculating a gradation adjustment parameter based on the second mixing coefficient set by the second mixing coefficient, the at least one first temporary correction amount, and the second temporary correction amount; With
A first gradation processing condition for the linear image is set based on a determination result by the scene determination processing unit and a gradation adjustment parameter calculated by the gradation adjustment parameter calculation unit.

請求項13に記載の画像処理方法は、
撮影によって形成されたリニア画像を取得する画像取得工程と、
前記リニア画像に基づいて撮影シーンの判別処理を行うシーン判別処理工程と、
前記シーン判別処理工程による判別結果に基づいて、前記リニア画像の明るさを調整するための第1の階調処理条件と、硬さを調整するための第2の階調処理条件と、を設定する階調処理条件設定工程と、
前記階調処理条件設定工程により設定された第1の階調処理条件に基づいて、前記リニア画像に対する第1の階調変換処理を行う第1の階調変換処理工程と、
前記階調処理条件設定工程により設定された第2の階調処理条件に基づいて、前記第1の階調変換処理が適用されたリニア画像に対する第2の階調変換処理を行う第2の階調変換処理工程と、
前記第2の階調変換処理が適用されたリニア画像をノンリニア画像に変換する第3の階調変換処理を行う第2の階調変換処理工程と、を含むことを特徴としている。
An image processing method according to claim 13 is provided.
An image acquisition step of acquiring a linear image formed by photographing;
A scene determination processing step for performing a determination process of a photographic scene based on the linear image;
Based on the determination result of the scene determination processing step, a first gradation processing condition for adjusting the brightness of the linear image and a second gradation processing condition for adjusting the hardness are set. Gradation processing condition setting step to perform,
A first gradation conversion processing step for performing a first gradation conversion process on the linear image based on the first gradation processing condition set by the gradation processing condition setting step;
Based on the second gradation processing condition set in the gradation processing condition setting step, a second floor that performs a second gradation conversion process on the linear image to which the first gradation conversion process is applied. Key conversion process,
And a second gradation conversion process step of performing a third gradation conversion process for converting the linear image to which the second gradation conversion process is applied into a non-linear image.

請求項14に記載の発明は、請求項13に記載の画像処理方法において、前記画像取得工程では、前記リニア画像から、画像サイズを縮小したリニア画像を取得し、
前記シーン判別処理工程では、前記画像サイズを縮小したリニア画像を用いて撮影シーンの判別処理を行うことを特徴としている。
The invention according to claim 14 is the image processing method according to claim 13, wherein in the image acquisition step, a linear image with a reduced image size is acquired from the linear image,
In the scene discrimination processing step, a shooting scene discrimination process is performed using a linear image with a reduced image size.

請求項15に記載の発明は、請求項13又は14に記載の画像処理方法において、前記リニア画像の撮影時に算出される輝度情報を取得する輝度情報取得工程を含み、
前記シーン判別処理工程では、前記輝度情報取得工程により取得された輝度情報に基づいて撮影シーンの判別処理を行い、
前記階調処理条件設定工程では、前記輝度情報取得工程により取得された輝度情報に基づいて第1及び第2の階調処理条件を設定することを特徴としている。
The invention according to claim 15 includes a luminance information acquisition step of acquiring luminance information calculated at the time of photographing the linear image in the image processing method according to claim 13 or 14,
In the scene determination process step, a shooting scene determination process is performed based on the luminance information acquired in the luminance information acquisition step,
In the gradation processing condition setting step, the first and second gradation processing conditions are set based on the luminance information acquired by the luminance information acquisition step.

請求項16に記載の発明は、請求項13〜15の何れか一項に記載の画像処理方法において、前記シーン判別処理工程では、
前記リニア画像の自然光による屋外撮影度を表す自然光指標と、ダイナミックレンジの大きさを表す輝度比指標と、撮影時の露出設定に起因する露出撮影度指標とを算出し、
前記算出された各指標に基づいて撮影シーンを判別することを特徴としている。
The invention according to claim 16 is the image processing method according to any one of claims 13 to 15, wherein in the scene determination processing step,
Calculating a natural light index representing the degree of outdoor photographing with natural light of the linear image, a luminance ratio index representing the size of the dynamic range, and an exposure photographing degree index resulting from the exposure setting at the time of photographing;
A shooting scene is discriminated based on each of the calculated indexes.

請求項17に記載の発明は、請求項16に記載の画像処理方法において、前記シーン判別処理工程は、
前記リニア画像について色情報を取得し、当該取得された色情報に基づいて、前記リニア画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出工程と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出工程と、
前記第1の占有率に、撮影条件に応じて予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出工程と、
前記第1の占有率に、撮影条件に応じて予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出工程と、
前記第2の占有率に、撮影条件に応じて予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出工程と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、撮影条件に応じて予め設定された第4の係数を乗算することにより、前記露出撮影度を算出する第4の指標算出工程と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第5の係数を乗算することにより、前記自然光指標を算出する第5の指標算出工程と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第6の係数を乗算することにより、前記輝度比指標を算出する第6の指標算出工程と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記画像データの撮影シーンを判別するシーン判別工程と、を含むことを特徴としている。
The invention according to claim 17 is the image processing method according to claim 16, wherein the scene discrimination processing step includes:
Color information is acquired for the linear image, and based on the acquired color information, the image data of the linear image is classified into a class composed of a combination of predetermined brightness and hue, and for each of the classified classes, A first occupancy ratio calculating step of calculating a first occupancy ratio indicating a ratio of the entire image data;
Based on the acquired color information, the image data is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the proportion of the entire image data for each classified class A second occupancy rate calculating step for calculating the occupancy rate of
A first index calculation step of calculating index 1 by multiplying the first occupancy by a first coefficient set in advance according to the imaging condition;
A second index calculating step of calculating index 2 by multiplying the first occupancy by a second coefficient set in advance according to shooting conditions;
A third index calculating step of calculating index 3 by multiplying the second occupancy by a third coefficient set in advance according to the shooting conditions;
A fourth index calculating step of calculating the exposure shooting degree by multiplying the average brightness of the skin color at least in the center of the screen of the image data by a fourth coefficient set in advance according to shooting conditions;
The natural light index is calculated by multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a fifth coefficient that is set in advance according to shooting conditions. And a fifth index calculating step
By multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a sixth coefficient that is set in advance according to shooting conditions, the luminance ratio index is obtained. A sixth index calculating step for calculating;
A scene determination step of determining a shooting scene of the image data based on the exposure shooting degree, the natural light index, and the luminance ratio index.

請求項18に記載の発明は、請求項16又は17に記載の画像処理方法において、前記階調処理条件設定工程は、
前記リニア画像の明るさ解析値と、明るさの再現目標値と、前記輝度比指標及び前記露出撮影度に基づいて、当該リニア画像に対する複数の第1仮補正量を設定する第1仮補正量設定工程と、
前記自然光指標に基づいて、前記複数の第1仮補正量の各々に乗算する重み係数としての第1混合係数を設定する第1混合係数設定工程と、
前記第1混合係数設定工程により設定された第1混合係数と、前記複数の第1仮補正量に基づいて、前記リニア画像に対する第2仮補正量を設定する第2仮補正量設定工程と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記複数の第1仮補正量のうち少なくとも1つと、前記第2仮補正量に乗算する重み係数としての第2混合係数を設定する第2混合係数設定工程と、
前記第2混合係数により設定された第2混合係数と、前記少なくとも1つの第1仮補正量と、前記第2仮補正量に基づいて、階調調整パラメータを算出する階調調整パラメータ算出工程と、を含み、
前記シーン判別処理工程による判別結果と、前記階調調整パラメータ算出工程により算出された階調調整パラメータとに基づいて、前記リニア画像に対する第1の階調処理条件を設定することを特徴としている。
The invention according to claim 18 is the image processing method according to claim 16 or 17, wherein the gradation processing condition setting step includes:
A first temporary correction amount for setting a plurality of first temporary correction amounts for the linear image based on a brightness analysis value of the linear image, a brightness reproduction target value, the luminance ratio index, and the exposure photographing degree. A setting process;
A first mixing coefficient setting step of setting a first mixing coefficient as a weighting coefficient for multiplying each of the plurality of first temporary correction amounts based on the natural light index;
A second temporary correction amount setting step for setting a second temporary correction amount for the linear image based on the first mixing coefficient set by the first mixing coefficient setting step and the plurality of first temporary correction amounts;
Based on the exposure photographing degree, the natural light index, and the luminance ratio index, at least one of the plurality of first temporary correction amounts and a second mixing coefficient as a weighting coefficient for multiplying the second temporary correction amount are set. A second mixing coefficient setting step,
A gradation adjustment parameter calculating step of calculating a gradation adjustment parameter based on the second mixing coefficient set by the second mixing coefficient, the at least one first temporary correction amount, and the second temporary correction amount; Including,
A first gradation processing condition for the linear image is set based on a determination result in the scene determination processing step and a gradation adjustment parameter calculated in the gradation adjustment parameter calculation step.

請求項19に記載の画像処理プログラムは、
画像処理を制御するコンピュータを、
撮影によって形成されたリニア画像を取得する画像取得手段、
前記リニア画像に基づいて撮影シーンの判別処理を行うシーン判別処理手段、
前記シーン判別処理手段による判別結果に基づいて、前記リニア画像の明るさを調整するための第1の階調処理条件と、硬さを調整するための第2の階調処理条件とを設定する階調処理条件設定手段、
前記階調処理条件設定手段により設定された第1の階調処理条件に基づいて、前記リニア画像に対する第1の階調変換処理を行う第1の階調変換処理手段、
前記階調処理条件設定手段により設定された第2の階調処理条件に基づいて、前記第1の階調変換処理が適用されたリニア画像に対する第2の階調変換処理を行う第2の階調変換処理手段、
前記第2の階調変換処理が適用されたリニア画像をノンリニア画像に変換する階調変換処理を行う第3の階調変換処理手段、として機能させる。
An image processing program according to claim 19 is provided.
A computer that controls image processing
Image acquisition means for acquiring a linear image formed by photographing;
Scene discrimination processing means for performing discrimination processing of a photographic scene based on the linear image;
Based on the determination result by the scene determination processing means, a first gradation processing condition for adjusting the brightness of the linear image and a second gradation processing condition for adjusting the hardness are set. Gradation processing condition setting means,
First gradation conversion processing means for performing a first gradation conversion process on the linear image based on a first gradation processing condition set by the gradation processing condition setting means;
Based on the second gradation processing condition set by the gradation processing condition setting means, a second floor that performs a second gradation conversion process on the linear image to which the first gradation conversion process is applied. Key conversion processing means,
It is made to function as a 3rd gradation conversion process means which performs the gradation conversion process which converts the linear image to which the said 2nd gradation conversion process was applied into a non-linear image.

請求項20に記載の発明は、請求項19に記載の画像処理プログラムにおいて、前記画像取得手段は、
前記リニア画像から、画像サイズを縮小したリニア画像を取得し、
前記シーン判別処理手段は、
前記画像サイズを縮小したリニア画像を用いて撮影シーンの判別処理を行うことを特徴としている。
The invention according to claim 20 is the image processing program according to claim 19, wherein the image acquisition means includes:
From the linear image, obtain a linear image reduced in image size,
The scene discrimination processing means includes
It is characterized in that a photographic scene discrimination process is performed using a linear image with a reduced image size.

請求項21に記載の発明は、請求項19又は20に記載の画像処理プログラムにおいて、前記コンピュータを、
前記リニア画像の撮影時に算出される輝度情報を取得する輝度情報取得手段として機能させ、
前記シーン判別処理手段は、前記輝度情報取得手段により取得された輝度情報に基づいて撮影シーンの判別処理を行い、
前記階調処理条件設定手段は、前記輝度情報取得手段により取得された輝度情報に基づいて第1及び第2の階調処理条件を設定することを特徴としている。
The invention according to claim 21 is the image processing program according to claim 19 or 20, wherein the computer is
Function as luminance information acquisition means for acquiring luminance information calculated at the time of photographing the linear image;
The scene determination processing unit performs a shooting scene determination process based on the luminance information acquired by the luminance information acquisition unit,
The gradation processing condition setting means sets the first and second gradation processing conditions based on the luminance information acquired by the luminance information acquisition means.

請求項22に記載の発明は、請求項19〜21の何れか一項に記載の画像処理プログラムにおいて、前記シーン判別処理手段は、
前記リニア画像の自然光による屋外撮影度を表す自然光指標と、ダイナミックレンジの大きさを表す輝度比指標と、撮影時の露出設定に起因する露出撮影度指標とを算出し、 前記算出された各指標に基づいて撮影シーンを判別することを特徴としている。
The invention according to claim 22 is the image processing program according to any one of claims 19 to 21, wherein the scene determination processing means includes:
Calculating a natural light index representing an outdoor photographing degree by natural light of the linear image, a luminance ratio index representing a size of a dynamic range, and an exposure photographing degree index resulting from an exposure setting at the time of photographing; It is characterized in that a photographing scene is discriminated based on the above.

請求項23に記載の発明は、請求項22に記載の画像処理プログラムにおいて、前記シーン判別処理手段は、
前記リニア画像について色情報を取得し、当該取得された色情報に基づいて、前記リニア画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出し、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出し、
前記第1の占有率に、撮影条件に応じて予め設定された第1の係数を乗算することにより、指標1を算出し、
前記第1の占有率に、撮影条件に応じて予め設定された第2の係数を乗算することにより、指標2を算出し、
前記第2の占有率に、撮影条件に応じて予め設定された第3の係数を乗算することにより、指標3を算出し、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、撮影条件に応じて予め設定された第4の係数を乗算することにより、前記露出撮影度を算出し、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第5の係数を乗算することにより、前記自然光指標を算出し、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第6の係数を乗算することにより、前記輝度比指標を算出し、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記画像データの撮影シーンを判別することを特徴としている。
The invention according to claim 23 is the image processing program according to claim 22, wherein the scene discrimination processing means includes:
Color information is acquired for the linear image, and based on the acquired color information, the image data of the linear image is classified into a class composed of a combination of predetermined brightness and hue, and for each of the classified classes, Calculating a first occupancy ratio indicating the ratio of the entire image data;
Based on the acquired color information, the image data is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the proportion of the entire image data for each classified class Calculate the share of
By multiplying the first occupancy by a first coefficient set in advance according to the shooting conditions, the index 1 is calculated,
The index 2 is calculated by multiplying the first occupancy by a second coefficient set in advance according to the shooting conditions,
The index 3 is calculated by multiplying the second occupation ratio by a third coefficient set in advance according to the shooting conditions,
The exposure photographing degree is calculated by multiplying the average brightness of the skin color at least in the center of the screen of the image data by a fourth coefficient set in advance according to the photographing condition,
The natural light index is calculated by multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a fifth coefficient that is set in advance according to shooting conditions. And
By multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a sixth coefficient that is set in advance according to shooting conditions, the luminance ratio index is obtained. Calculate
The photographing scene of the image data is determined based on the exposure photographing degree, the natural light index, and the luminance ratio index.

請求項24に記載の発明は、請求項22又は23に記載の画像処理プログラムにおいて、前記階調処理条件設定手段は、
前記リニア画像の明るさ解析値と、明るさの再現目標値と、前記輝度比指標及び前記露出撮影度に基づいて、当該リニア画像に対する複数の第1仮補正量を設定し、
前記自然光指標に基づいて、前記複数の第1仮補正量の各々に乗算する重み係数としての第1混合係数を設定し、
前記第1混合係数と、前記複数の第1仮補正量に基づいて、前記リニア画像に対する第2仮補正量を設定し、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記複数の第1仮補正量のうち少なくとも1つと、前記第2仮補正量に乗算する重み係数としての第2混合係数を設定し、
前記第2混合係数と、前記少なくとも1つの第1仮補正量と、前記第2仮補正量に基づいて、階調調整パラメータを算出し、
前記シーン判別処理手段による判別結果と、前記算出された階調調整パラメータとに基づいて、前記リニア画像に対する第1の階調処理条件を設定することを特徴としている。
The invention according to claim 24 is the image processing program according to claim 22 or 23, wherein the gradation processing condition setting means is:
Based on the brightness analysis value of the linear image, the brightness reproduction target value, the brightness ratio index, and the exposure shooting degree, a plurality of first temporary correction amounts for the linear image are set,
Based on the natural light index, set a first mixing coefficient as a weighting coefficient to be multiplied to each of the plurality of first temporary correction amount,
Based on the first mixing coefficient and the plurality of first temporary correction amounts, a second temporary correction amount for the linear image is set,
Based on the exposure photographing degree, the natural light index, and the luminance ratio index, at least one of the plurality of first temporary correction amounts and a second mixing coefficient as a weighting coefficient for multiplying the second temporary correction amount are set. And
Calculating a gradation adjustment parameter based on the second mixing coefficient, the at least one first temporary correction amount, and the second temporary correction amount;
A first gradation processing condition for the linear image is set based on the determination result by the scene determination processing means and the calculated gradation adjustment parameter.

以下、本発明で使用される用語について説明する。   Hereinafter, terms used in the present invention will be described.

まず、「リニア画像」、「ノンリニア画像」について詳述する。
一般撮影シーンは照明のムラが多く、輝度比が1000倍を超える事も稀ではない(例えば、日本色彩学会編 色彩科学ハンドブック第2版, 東京大学出版会, p925-926 (1998)を参照)。これに対して、各種メディアが表示できる輝度比は100倍オーダーである。必然的に写真階調はシーン階調と異なる事になり、100倍オーダーの輝度比のメディア上で、1000倍オーダーの輝度比シーンの印象をいかに適切に演出するかが写真設計の基本である。
First, “linear image” and “nonlinear image” will be described in detail.
In general shooting scenes, there are many uneven illuminations, and it is not uncommon for the luminance ratio to exceed 1000 times (for example, see Color Science Handbook 2nd Edition, The University of Tokyo Press, p925-926 (1998)). . On the other hand, the luminance ratio that can be displayed on various media is on the order of 100 times. The photographic gradation will inevitably be different from the scene gradation, and the basics of photographic design are how to properly produce the impression of a scene with a luminance ratio of the order of 1000 times on media with a luminance ratio of the order of 100 times. .

このシーン階調から写真階調への変換は、シーンの状態(構図内の輝度比・主要被写体の輝度等)により適切なマッピング条件が異なり、一律に決定する事ができない。そこで銀塩写真の場合には下記のアーキテクチャが採用されている。
[設計1] ネガフィルムは、数千倍オーダーの輝度比に応じてリニアに濃度が変化する軟調設計にする。これにより、シーンの輝度情報は漏れなくネガフィルムに記録される。
[設計2] 上記の軟調なネガフィルム画像を、硬調な印画紙に焼き付ける事で、鑑賞に適した階調とする。焼き付け露光量を調節することで、幅広いシーン輝度のどこを中心に写真階調を再現するかを選択する。
The conversion from the scene gradation to the photographic gradation cannot be determined uniformly because appropriate mapping conditions differ depending on the scene state (luminance ratio in composition, luminance of main subject, etc.). Therefore, in the case of silver halide photography, the following architecture is adopted.
[Design 1] The negative film has a soft design in which the density changes linearly according to the luminance ratio of the order of several thousand times. Thereby, the luminance information of the scene is recorded on the negative film without omission.
[Design 2] The above-mentioned soft negative film image is printed on a high-quality photographic paper to obtain a gradation suitable for viewing. By adjusting the amount of exposure for printing, it is possible to select where in a wide range of scene brightness the photographic gradation is reproduced.

上記設計2では、ネガフィルム画像をプリンタが自動解析することで適切な条件を算出している。この算出結果が撮影意図と合致しなかった場合、ユーザがその旨を指摘して「焼き直し」をすれば、適切な写真を作成する事ができる。たとえば、風景描写を優先したプリントに対して、日陰の人物を重視したいと指摘する等の例が挙げられる。   In the above design 2, an appropriate condition is calculated by the printer automatically analyzing the negative film image. If the calculation result does not match the intention of photographing, an appropriate photograph can be created if the user indicates that fact and performs “reprinting”. For example, there is an example in which it is pointed out that a shaded person should be emphasized for a print that prioritizes landscape depiction.

一方でリバーサルフィルムの場合は、フィルム現像で直接鑑賞用画像を生成する為、上記設計1のような軟調設計ができない。ゆえにリバーサルフィルムは記録できる輝度比の幅が狭く、適正な画像を撮影するためには、撮影時に撮影条件(照明・絞り・シャッター)を慎重に設定する必要があり、もちろん撮影後に「焼き直し」等で修正する事はできない。このため、リバーサルフィルムはプロ・ハイエンドアマチュア専用の商品として販売されている。   On the other hand, in the case of a reversal film, since an image for viewing is directly generated by film development, the soft design as in the above design 1 cannot be performed. Therefore, the reversal film has a narrow range of brightness ratios that can be recorded, and in order to capture appropriate images, it is necessary to carefully set the shooting conditions (lighting, aperture, shutter) at the time of shooting. It cannot be corrected by etc. For this reason, reversal films are sold as products exclusively for professional and high-end amateurs.

このように、銀塩写真におけるネガフィルムとポジフィルムは、ネガ・ポジの階調差以外に、画像の性格が異なるということを指摘することができる。   In this way, it can be pointed out that the negative film and the positive film in silver halide photography have different image characteristics in addition to the negative / positive gradation difference.

上記の観点でDSC(Digital Still Camera)と銀塩写真のアーキテクチャを比較すると、一般用の(sRGBの可視画像ファイルを生成する)DSCの機構は、リバーサルフィルムの機構に相当する。即ち、幅広いシーン輝度のどこを中心に写真階調を再現するかは露出制御プログラムの精度に依存しており、撮影後に修正する事はできない。一方プロユーザはRawデータ(CCDが受光した生データ)を記録するDSCを利用し、撮影後に現像ソフトでシーン輝度のどこを中心に写真階調を再現するかを指定している。この方法はネガフィルムの機構に相当する。ここでも一般用DSCが生成するsRGB画像とRawデータでは、画像データの性格が異なるということを指摘することができる。   Comparing the architecture of DSC (Digital Still Camera) and silver halide photography from the above viewpoint, the general DSC mechanism (which generates an sRGB visible image file) corresponds to the reversal film mechanism. In other words, where to reproduce the photographic gradation centering on a wide range of scene brightness depends on the accuracy of the exposure control program and cannot be corrected after shooting. On the other hand, a professional user uses a DSC that records raw data (raw data received by the CCD) and designates where in the scene luminance the photographic gradation is reproduced with development software after shooting. This method corresponds to a negative film mechanism. Again, it can be pointed out that the characteristics of the image data are different between the sRGB image generated by the general DSC and the Raw data.

このような画像の性格の差は、画像データのレンダリング状態の差異に起因するものであり、この「画像データのレンダリング状態」を示す概念として「Image State」という
用語が用いられている。(Image State の詳細な定義は、例えば下記の文献に示されている。“Requirements for Unambiguous Specification of a Color Encoding ISO 22028-1”, Kevin Spaulding, in Proc. Tenth Color Imaging Conference: Color Science and Engineering Systems, Technologies, Applications, IS&T, Springfield, VA, p.106-111 (2002)).
Such a difference in image characteristics is caused by a difference in rendering state of image data, and the term “Image State” is used as a concept indicating the “rendering state of image data”. (Detailed definition of Image State is shown in the following document, for example: “Requirements for Unambiguous Specification of a Color Encoding ISO 22028-1”, Kevin Spaulding, in Proc. Tenth Color Imaging Conference: Color Science and Engineering Systems , Technologies, Applications, IS & T, Springfield, VA, p.106-111 (2002)).

Image Stateの種類を示す用語として、scene-referred及び output-referredがある。scene-referredとは、風景シーンの色度評価値を表現した状態を意味する。例えばDSCのRawデータに分光感度等の校正のみを施し、意図的な強調を加えていない画像の状態が相当する。「リニア画像」は、シーンの色度評価値を相対的に表現したものであるが、付加的なスケール情報をも参照することで絶対的な色度評価値に換算する事も可能である。スケール情報としては、OECF(光電変換特性, ISO14524で定義)・絞りのFナンバー・露光時間が挙げられる。   There are scene-referred and output-referred as terms indicating the type of Image State. “Scene-referred” means a state expressing a chromaticity evaluation value of a landscape scene. For example, this corresponds to the state of an image in which only DSC raw data is subjected to calibration such as spectral sensitivity and is not intentionally enhanced. The “linear image” is a relatively expressed chromaticity evaluation value of a scene, but can be converted into an absolute chromaticity evaluation value by referring to additional scale information. Examples of scale information include OECF (photoelectric conversion characteristics, defined by ISO14524), aperture F-number, and exposure time.

output-referredとは、特定の出力機器・観察条件に対して適切な表現にレンダリング
された状態を意味する。例えば、一般的なDSCが生成するJPEG画像はディスプレイ表示に最適化されているので「ノンリニア画像」に該当する。
The output-referred means a state rendered to an appropriate expression for a specific output device / observation condition. For example, a JPEG image generated by a general DSC is optimized for display display, and thus corresponds to a “nonlinear image”.

本発明における「リニア画像」とは、上記のscene-referredのimage stateに属する画像データの一種であり、特に記録された画素の輝度値とシーン輝度の関係が実質的に一次直線の関係にあるものを意味している。また、本発明における「ノンリニア画像」とは、上記のoutput-referredのimage stateに属する画像データを意味している。   The “linear image” in the present invention is a kind of image data belonging to the above-mentioned scene-referred image state, and the relationship between the recorded pixel luminance value and the scene luminance is substantially a linear relationship. Means things. The “non-linear image” in the present invention means image data belonging to the output-referred image state.

即ち、「リニア画像」とは、少なくとも撮像素子自体の分光感度に基づく各色チャンネルの信号強度をRIMM RGB、ERIMM RGB、scRGBなどの色空間(後述の「輝度拡張色空間」)にマッピング済みであり、特定の出力機器・観察条件での画像鑑賞時の効果を向上する為に、データ内容を改変する階調変換・鮮鋭性強調・彩度強調などが省略された状態の画像データを意味する。またリニア画像は、撮像装置の光電変換特性(ISO1452が定義するopto-electronic conversion function, 例えば、コロナ社「ファインイメージングとディジタル写真」(社)日本写真学会出版委員会編、479頁参照)の補正を行ったものであることが好ましい。標準化されたリニア画像の情報量(例えば階調数)は、A/D変換器の性能に準じ、後述の「ノンリニア画像」で必要とされる情報量(例えば階調数)と同等以上であることが好ましい。例えばノンリニア画像の階調数が1チャンネルあたり8bitである場合、リニア画像の階調数は12bit以上が好ましく、14bit以上がより好ましく、また16bit以上がさらに好ましい。   In other words, the “linear image” has already mapped the signal intensity of each color channel based on at least the spectral sensitivity of the image sensor itself to a color space such as RIMM RGB, ERIMM RGB, or scRGB (“brightness extended color space” described later). This means image data in a state in which tone conversion, sharpness enhancement, saturation enhancement, etc. for modifying data contents are omitted in order to improve the effect at the time of image viewing under a specific output device / observation condition. Linear images are also corrected for the photoelectric conversion characteristics of the imaging device (opto-electronic conversion function defined by ISO1452, for example, Corona “Fine Imaging and Digital Photography” (published by the Japan Photographic Society Publishing Committee, page 479). It is preferable to have performed. The information amount (for example, the number of gradations) of the standardized linear image is equal to or greater than the information amount (for example, the number of gradations) required for the “non-linear image” described later, according to the performance of the A / D converter. It is preferable. For example, when the number of gradations of the non-linear image is 8 bits per channel, the number of gradations of the linear image is preferably 12 bits or more, more preferably 14 bits or more, and further preferably 16 bits or more.

「リニア画像をノンリニア画像に変換する階調変換処理」とは、CRT(Cathode Ray Tube)、液晶ディスプレイ、プラズマディスプレイ等の表示デバイスや、銀塩印画紙、インクジェットペーパー、サーマルプリンタ用紙等の出力媒体上において、最適な画像を得るための「ガンマ補正」処理であり、例えばsRGB規格に準拠したCRTディスプレイモニタに表示することを前提とした場合、sRGB規格の色域内で最適な色再現が得られるように処理される。このときの処理設定は、「ガンマ特性」と称される。   “Gradation conversion processing to convert linear image to non-linear image” means display devices such as CRT (Cathode Ray Tube), liquid crystal display, plasma display, and output media such as silver salt photographic paper, inkjet paper, thermal printer paper, etc. In the above, “Gamma correction” processing for obtaining an optimal image. For example, when it is assumed that the image is displayed on a CRT display monitor compliant with the sRGB standard, an optimal color reproduction can be obtained within the color gamut of the sRGB standard. Is processed as follows. The processing setting at this time is referred to as “gamma characteristic”.

銀塩印画紙への出力を前提とした場合、銀塩印画紙の色域内で最適な色再現が得られるように処理される。また前記色域の圧縮の以外にも、16bitから8bitへの階調圧縮、出力画素数の低減、及び出力デバイスの出力特性(LUT)への対応処理等も含まれる。さらにノイズ抑制、鮮鋭化、グレーバランス調整、彩度調整或いは覆い焼き処理等の階調圧縮処理が行われることは言うまでもない。   If output to silver salt photographic paper is assumed, processing is performed so that optimum color reproduction is obtained within the color gamut of silver salt photographic paper. In addition to the compression of the color gamut, gradation processing from 16 bits to 8 bits, reduction of the number of output pixels, processing corresponding to output characteristics (LUT) of the output device, and the like are also included. It goes without saying that tone compression processing such as noise suppression, sharpening, gray balance adjustment, saturation adjustment, or dodging processing is performed.

「ノンリニア画像」とはCRT、液晶ディスプレイ、プラズマディスプレイ、或いは銀塩印画紙、インクジェットペーパー、サーマルプリンタ用紙等の「出力媒体」上のハードコピー画像生成に用いるデジタル画像データを意味する。CRT、液晶、プラズマディスプレイ等の表示デバイスや、銀塩印画紙、インクジェットペーパー、サーマルプリンタ用紙等の出力媒体上において、最適な画像が得られるよう処理が施されている。撮影により形成された画像データが、「リニア画像」であるとき、「出力媒体上での鑑賞に最適化された画像データ」が「ノンリニア画像」に相当する。前記「Rawデータ」、又は「リニア画
像」から、「ノンリニア画像」を生成することを、「電子現像処理」(又は単に「現像処理」)と称し、このような処理機能を備えたアプリケーションソフトウェアを「電子現像ソフト」(又は単に「現像ソフト」)と称される。
“Non-linear image” means digital image data used to generate a hard copy image on an “output medium” such as a CRT, liquid crystal display, plasma display, or silver salt photographic paper, inkjet paper, thermal printer paper or the like. Processing is performed so as to obtain an optimum image on a display device such as a CRT, a liquid crystal display, a plasma display, or an output medium such as a silver salt photographic paper, an inkjet paper, or a thermal printer paper. When the image data formed by photographing is a “linear image”, “image data optimized for viewing on an output medium” corresponds to a “nonlinear image”. Generating a “non-linear image” from the “Raw data” or “linear image” is called “electronic development processing” (or simply “development processing”), and application software having such a processing function is used. It is called “electronic development software” (or simply “development software”).

「リニア画像に対する階調変換処理」とは、前記Rawデータ(CCDが受光した生データ)を記録するDSCを利用し、撮影後に現像ソフトでシーン輝度のどこを中心に写真階調を再現するかをユーザ自身が撮影駒毎に指定する煩雑な操作に相当する。本階調変換処理は、露出制御プログラムの作用と同等であるので、処理後の画像データは、特定の出力機器・観察条件に対して適切な表現にレンダリングされた状態ではなく、シーンの色度評価値を相対的に表現された状態であるので、上記のscene-referredのimage stateに属する「リニア画像」と定義することができる。   “Gradation conversion processing for linear image” uses DSC that records the Raw data (raw data received by the CCD), and where to reproduce the photographic gradation around the scene brightness with development software after shooting This corresponds to a complicated operation in which the user himself designates for each photographing frame. Since this gradation conversion process is equivalent to the action of the exposure control program, the processed image data is not in a state rendered to an appropriate representation for a specific output device / observation condition, but the chromaticity of the scene. Since the evaluation value is in a relatively expressed state, it can be defined as a “linear image” belonging to the scene-referred image state.

「自然光」とは、人工的な光源である定常光や閃光(「フラッシュ」、「スピードライト」などと称される。)ではなく、太陽を光源とする光のことである。日中光とも言う。デーライトは、日中光に近い色温度(約5500K)の人工的な光源を示す用語であるため、
「自然光」とは異なる。
“Natural light” refers to light that uses the sun as a light source, not stationary light or flash light (referred to as “flash” or “speed light”), which is an artificial light source. Also called daylight. Daylight is a term that refers to an artificial light source with a color temperature close to daylight (approximately 5500K)
Different from “natural light”.

「屋外撮影度」(「自然光指標」ともいう。)とは、撮影画像データが「自然光」を用いて撮影されたものであるかどうかを推定し、その結果を定量的に示した数値である。「自然光」を用いて撮影され、明るさ補正を要するシーンには逆光シーンが多く、画面上部に高輝度領域或いは高彩度の空色領域、画面下部に、低輝度領域或いは肌色や緑色が分布する確率が高い。一方、「自然光」を用いないで撮影された屋内撮影或いはオーバー撮影シーンには、画面中央に高輝度領域或いは低彩度の肌色領域、画面周辺には低輝度領域或いは低輝度の肌色や高彩度の肌色が分布する傾向にある。このような経験側を基に、「自然光」を用いて撮影されかどうかを、「屋外撮影度」として定量的に示すことが可能である。画面上部の輝度や空色色相の画素数、画面下部の輝度や肌色色相の画素数など、多くの変量から1つの傾向を導き出す統計処理手法としては、多変量解析を用いることが望ましい。   “Outdoor shooting degree” (also referred to as “natural light index”) is a numerical value that estimates whether or not the shot image data was taken using “natural light” and quantitatively shows the result. . Scenes that are shot using “natural light” and require brightness correction are often backlit scenes, and there is a probability that a high-luminance area or high-saturation sky blue area is distributed at the top of the screen, and a low-luminance area or skin color or green color is distributed at the bottom of the screen. high. On the other hand, for indoor shooting or overshooting scenes shot without using “natural light”, a high-brightness area or low-saturation skin color area in the center of the screen, and a low-brightness area or low-brightness skin color or high saturation around the screen. Skin color tends to be distributed. Based on such experience, it is possible to quantitatively indicate whether or not the image is taken using “natural light” as “outdoor shooting degree”. It is desirable to use multivariate analysis as a statistical processing method for deriving one tendency from many variables such as the luminance at the top of the screen and the number of pixels of sky blue hue, the luminance at the bottom of the screen and the number of pixels of skin color hue.

「ダイナミックレンジの大きさを表す輝度比指標」とは、逆光シーンやオーバー撮影シーンのような、撮影時の光源条件に起因して、主要被写体領域と背景領域の明るさが異なる程度を定量的に示す値のことである。例えば、逆光シーンでは、撮影者がカメラを太陽の方角に向け、人物を撮影することに起因して、人物顔領域が暗く、背景領域である空が明るい画像となっている。即ち、人物顔領域と背景領域との明るさの差分値が得られれば、差分値を指標の1つとすることができる。一般的には、画差撮影画像データのヒストグラムを作図することにより差分値を得ることが知られている。   The “brightness ratio index that indicates the size of the dynamic range” is a quantitative measure of the difference in brightness between the main subject area and the background area due to the light source conditions at the time of shooting, such as a backlight scene or overshooting scene. It is the value shown in. For example, in a backlight scene, the photographer points the camera in the direction of the sun and photographs a person, so that the person face area is dark and the background area is a bright image. That is, if a difference value of brightness between the human face area and the background area is obtained, the difference value can be used as one of the indices. In general, it is known to obtain a difference value by drawing a histogram of image difference image data.

リニア画像の「明るさ解析値」とは、画素値の分布状態を調べることで得られる、画像の平均的な明るさを示す数値である。「明るさ解析値」は、撮影画像データで最も重要な被写体(主要被写体)の明るさであることが望ましい。人物顔領域の探索は、色相・彩度・明度を用いた表色系における照合により行う。より高い精度を得るためには、目・鼻・口・顔の輪郭など、顔を構成するパーツを照合する所謂「顔検出」を用いることが好ましい。また、撮影時の露出設定に起因する露出撮影度(アンダー撮影、オーバー撮影)を表す露出撮影度指標を算出し、この露出撮影度指標を明るさ解析値として用いてもよい。更に、明るさ解析値の解析方法は、リニア画像の解析に限定するものではなく、例えば、撮像装置の自動露出情報や自動露出情報の記録された付加情報を解析して得られた明るさであってもよい。   The “brightness analysis value” of a linear image is a numerical value indicating the average brightness of an image obtained by examining the distribution state of pixel values. The “brightness analysis value” is desirably the brightness of the most important subject (main subject) in the captured image data. The search for the human face area is performed by collation in the color system using hue, saturation, and brightness. In order to obtain higher accuracy, it is preferable to use so-called “face detection” in which parts constituting the face, such as the eyes, nose, mouth, and face contour, are collated. Further, an exposure shooting index indicating the exposure shooting degree (under shooting or over shooting) resulting from the exposure setting at the time of shooting may be calculated, and this exposure shooting index may be used as the brightness analysis value. Further, the analysis method of the brightness analysis value is not limited to the analysis of the linear image. For example, the brightness obtained by analyzing the automatic exposure information of the imaging apparatus and the additional information recorded in the automatic exposure information is used. There may be.

「再現目標値」とは、例えば、リニア画像の主要被写体である人物顔領域が、撮影画像データを出力する出力デバイスにおいて最適に再現されるために必要な明るさを示す数値である。即ち、リニア画像の「明るさ解析値」が「再現目標値」に近似した値であれば、出力デバイスにおいて最適に再現される確率が高いことを意味する。   The “reproduction target value” is, for example, a numerical value indicating the brightness necessary for the human face region, which is the main subject of the linear image, to be optimally reproduced by the output device that outputs the captured image data. That is, if the “brightness analysis value” of the linear image is a value that approximates the “reproduction target value”, it means that there is a high probability of optimal reproduction in the output device.

「第1仮補正量」とは、「明るさ解析値」を「再現目標値」へと近似させるために必要な補正量を、一時的なものとして示した数値である。「第1仮補正量を設定する」とは、予め「明るさ解析値」と「第1仮補正量」、との関係を定義した1次元LUT(Look Up Table)などを作成しておき、この1次元LUTと「明るさ解析値」に基づき、「第1仮補正量」を決定することを意味する。更に、「複数の第1仮補正量を設定する」とは、「明るさ解析値」を条件違いで算出する方法、異なる「再現目標値」を設定する方法(複数の1次元LUTを定義しておくことと同一)の一方又は双方により、少なくとも2つの「第1仮補正量」を一時的に得ることである。   The “first provisional correction amount” is a numerical value that temporarily indicates the correction amount necessary to approximate the “brightness analysis value” to the “reproduction target value”. “Set the first temporary correction amount” is to create a one-dimensional LUT (Look Up Table) in which the relationship between the “brightness analysis value” and the “first temporary correction amount” is defined in advance. This means that the “first provisional correction amount” is determined based on the one-dimensional LUT and the “brightness analysis value”. Furthermore, “setting a plurality of first provisional correction amounts” means “calculating brightness analysis values” under different conditions, or setting different “reproduction target values” (defining a plurality of one-dimensional LUTs. Or at least two “first provisional correction amounts” temporarily.

本発明では、逆光シーンと、主要被写体がオーバーであるオーバー撮影シーンの場合の人物顔領域の明るさ補正を想定した、それぞれ2つの「第1仮補正量」設定用の1次元LUTを定義する。また、逆光シーンとオーバー撮影シーンの中間的なシーンでは、アンダーとオーバー撮影シーンにおける画像全体の明るさ補正を想定した、少なくとも1つの「第1仮補正量」設定用の1次元LUTを定義することが望ましい。   In the present invention, two one-dimensional LUTs for setting “first provisional correction amount” are defined, assuming brightness correction of a human face area in a backlight scene and an over-shooting scene in which the main subject is over. . In addition, in the intermediate scene between the backlight scene and the over shooting scene, at least one one-dimensional LUT for setting the “first provisional correction amount” is defined assuming brightness correction of the entire image in the under and over shooting scenes. It is desirable.

本発明の効果を十分に発揮させるために、「第1仮補正量」設定用の1次元LUTの作成に際しては、明部及び暗部がつぶれたり、高彩度の色が飽和してつぶれたり、色相が変わるなどの現象が実際に発生する逆光シーンやオーバー撮影シーンを予め「学習用画像(「教師データ」とも云う)」として多数用意し、人物顔領域の明るさと、これらの現象の発生を観察しながら行うことが望ましい。   In order to sufficiently exhibit the effects of the present invention, when creating a one-dimensional LUT for setting the “first provisional correction amount”, bright and dark portions are crushed, high-saturated colors are saturated and hushed, Prepare a number of backlight scenes and overshooting scenes that actually cause phenomena such as changes as “learning images” (also called “teacher data”), and observe the brightness of the human face area and the occurrence of these phenomena. It is desirable to do it.

「明るさの再現目標値」と「輝度比指標」に基づいて、「第1仮補正量を設定する」とは、撮影画像データのダイナミックレンジが、撮影画像データを出力する出力デバイスのダイナミックレンジ内に適切に収まるように、主要被写体の明るさに基づいて設定された明るさ補正量を弱め、輝度比指標に基づいて明るさ補正量を設定することを意味する。   Based on “brightness reproduction target value” and “brightness ratio index”, “setting the first temporary correction amount” means that the dynamic range of the captured image data is the dynamic range of the output device that outputs the captured image data. This means that the brightness correction amount set based on the brightness of the main subject is weakened and the brightness correction amount is set based on the luminance ratio index so as to be appropriately within the range.

自然光指標に基づいて「第1混合係数を設定する」とは、予め「自然光指標」と、各第1仮補正量に乗算する「第1混合係数」との関係を定義した1次元LUTなどを、第1仮補正量の数だけ作成しておき、この1次元LUTと「自然光指標」に基づき、各第1仮補正量に乗算する「第1混合係数」を決定することを意味する。なお、輝度比指標に基づいて、第1混合係数を調整するようにしてもよい。   “Set the first mixing coefficient” based on the natural light index is a one-dimensional LUT that defines the relationship between the “natural light index” and the “first mixing coefficient” by which each first temporary correction amount is multiplied in advance. This means that the number of first temporary correction amounts is created, and the “first mixing coefficient” to be multiplied by each first temporary correction amount is determined based on the one-dimensional LUT and the “natural light index”. Note that the first mixing coefficient may be adjusted based on the luminance ratio index.

例えば、自然光指標が、高い屋外撮影度の数値を示した場合、逆光シーンにおける人物顔領域の明るさ補正を想定した、「第1仮補正量」設定用の1次元LUT(入力:肌色平均輝度、出力:第1仮補正量)の「第1混合係数」が高くなるように、1次元LUTを定義する。   For example, when the natural light index shows a high outdoor photographing value, a one-dimensional LUT (input: flesh color average luminance) for setting the “first provisional correction amount” assuming brightness correction of a human face area in a backlight scene The one-dimensional LUT is defined so that the “first mixing coefficient” of (output: first provisional correction amount) becomes high.

一方、自然光指標が、低い屋外撮影度の数値を示した場合、オーバー撮影シーンにおける人物顔領域の明るさ補正を想定した、「第1仮補正量」設定用の1次元LUT(入力:肌色平均輝度、出力:第1仮補正量)の「第1混合係数」が高くなるように、1次元LUTを定義する。   On the other hand, when the natural light index indicates a numerical value of a low outdoor photographing degree, a one-dimensional LUT (input: skin color average) for setting the “first provisional correction amount” assuming brightness correction of a human face area in an over photographing scene The one-dimensional LUT is defined such that the “first mixing coefficient” of luminance and output: first provisional correction amount is high.

また、自然光指標が、曖昧な屋外撮影度の数値を示した場合、アンダー撮影シーンとオーバー撮影シーンにおける画像全体の明るさ補正を想定した、「第1仮補正量」設定用の1次元LUT(入力:全体平均輝度又はアンダー・オーバー撮影指標、出力:第1仮補正量)の「第1混合係数」が高くなるように1次元LUTを定義する。   Further, when the natural light index indicates an ambiguous outdoor shooting degree value, a “first provisional correction amount” setting one-dimensional LUT (assuming brightness correction of the entire image in an under shooting scene and an over shooting scene) The one-dimensional LUT is defined so that the “first mixing coefficient” of input: overall average luminance or under-over shooting index, output: first temporary correction amount) becomes high.

撮影画像データが予め逆光画像とわかっている場合には、「輝度比指標」に基づき、明るさ補正量と階調変換曲線を修正することができ、撮影画像データの明部及び暗部がつぶれたり、高彩度の色が飽和してつぶれたり、色相が変化することが抑制される。しかしながら、逆光シーンとオーバー撮影シーンとでは、ダイナミックレンジの大きさが同程度であっても、明るさ補正の方向が全く逆であるため、人物顔領域を適正な明るさに補正する処理を自動化するには、逆光シーンかオーバー撮影シーンあるか否かを定量的に示した予測数値(自然光指標)に応じて、ダイナミックレンジの大きさを表す輝度比指標に基づく第1仮補正量の適用量を定義しなくてはならない。そこで、逆光シーンにおける人物顔領域の明るさ補正を想定した、「第1仮補正量」設定用の1次元LUT(入力:輝度比指標、出力:第1仮補正量)の「第1混合係数」が高くなるように、「自然光指標」と「第1混合係数」との関係を定義した1次元LUTを定義する。   When the captured image data is known as a backlight image in advance, the brightness correction amount and the gradation conversion curve can be corrected based on the “brightness ratio index”, and the bright and dark portions of the captured image data may be crushed. Saturation of high-saturation colors is crushed and hue is prevented from changing. However, even if the backlit scene and overshoot scene have the same dynamic range, the direction of brightness correction is completely opposite, so the process of correcting the human face area to the appropriate brightness is automated. To apply the first provisional correction amount based on the luminance ratio index indicating the size of the dynamic range in accordance with a predicted numerical value (natural light index) that quantitatively indicates whether there is a backlight scene or an overshoot scene Must be defined. Therefore, a “first mixture coefficient” of a one-dimensional LUT (input: luminance ratio index, output: first temporary correction amount) for setting “first temporary correction amount”, assuming brightness correction of a human face area in a backlight scene. ”Is defined so as to define a one-dimensional LUT that defines the relationship between the“ natural light index ”and the“ first mixing coefficient ”.

「第2仮補正量」は、第1仮補正量と第1混合係数に基づいて算出されるもので、式(1)のように定義される。式(1)において、第1仮補正量設定手段により設定される複数の第1仮補正量のうち、m個の第1仮補正量を計算対象とし、i番目の第1仮補正量をkey_auto[i]、第1仮補正量key_auto[i]に乗算する第1混合係数をwgt[i]としている。

Figure 2007293686
The “second provisional correction amount” is calculated based on the first provisional correction amount and the first mixing coefficient, and is defined as Expression (1). In Expression (1), among the plurality of first temporary correction amounts set by the first temporary correction amount setting means, m first temporary correction amounts are set as calculation targets, and the i-th first temporary correction amount is set as key_auto. [i], the first mixing coefficient to be multiplied by the first temporary correction amount key_auto [i] is wgt [i].
Figure 2007293686

本発明によれば、既存の自動露出制御、動作点変更、リニア画像からノンリニア画像への階調処理条件の変更を行うことなく、主要被写体(例えば、人物顔領域)の明るさを最適化することが可能となる。   According to the present invention, the brightness of the main subject (for example, a human face region) is optimized without changing the existing automatic exposure control, the operating point change, and the gradation processing condition from the linear image to the non-linear image. It becomes possible.

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

(第1の実施形態)
まず、本発明に係る第1の実施形態(撮像装置)における構成について説明する。
(First embodiment)
First, the configuration of the first embodiment (imaging device) according to the present invention will be described.

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

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

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

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

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

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

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

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

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

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

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

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

(撮影処理部20の内部構成)
図3に、撮影処理部20の内部構成を示す。撮影処理部20は、撮影時に撮影条件に関わる制御や、撮影された画像の処理を行う。撮影処理部20は、図3に示すように、撮影条件に関わるAE制御部51、AF制御部52、そして撮影された画像に対して画像処理を行う画素補間部53、AWB制御部54、ガンマ補正部55などにより構成される。
(Internal configuration of the imaging processing unit 20)
FIG. 3 shows an internal configuration of the imaging processing unit 20. The shooting processing unit 20 performs control related to shooting conditions during shooting and processing of shot images. As shown in FIG. 3, the imaging processing unit 20 includes an AE control unit 51 and an AF control unit 52 related to imaging conditions, a pixel interpolation unit 53 that performs image processing on the captured image, an AWB control unit 54, and a gamma. It is comprised by the correction | amendment part 55 grade | etc.,.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

本実施形態において、ガンマ補正部55は、画像処理部10内の階調変換処理部108で階調変換処理が施されたリニア画像をノンリニア画像に変換する処理を行う。従って、ガンマ補正部55は、第3の階調変換処理手段として機能する。   In the present embodiment, the gamma correction unit 55 performs processing for converting the linear image that has been subjected to the tone conversion processing by the tone conversion processing unit 108 in the image processing unit 10 into a non-linear image. Accordingly, the gamma correction unit 55 functions as a third gradation conversion processing unit.

なお、リニア画像に適用されるガンマ特性の一例を図10に示したが、特定の出力機器・観察条件に応じてガンマ特性を予め複数設定しておき、その複数のガンマ特性の中から選択するようにすることが好ましい。   An example of the gamma characteristic applied to the linear image is shown in FIG. 10, but a plurality of gamma characteristics are set in advance according to a specific output device and observation condition, and selected from the plurality of gamma characteristics. It is preferable to do so.

(画像処理部10の内部構成)
図11に、画像処理部10の内部構成を示す。画像処理部10は、撮像装置1での撮影画像に対して、シーン判別に基づく階調の補正動作を制御するものであり、撮影処理部20での処理後に、或いはその処理とは独立して、画像取得、シーン判別、階調処理条件設定などの一連の処理を実行する。
(Internal configuration of the image processing unit 10)
FIG. 11 shows an internal configuration of the image processing unit 10. The image processing unit 10 controls a gradation correction operation based on scene discrimination for a captured image by the imaging apparatus 1, and after the processing by the shooting 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.

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

第1画像取得部101は、レリーズボタン28が全押しされたタイミングで、撮像素子33に写った最新の画像の画像データを第1の画像として取得する。ここで、第1の画像は、本発明のリニア画像に対応する。また、第1画像取得部101は、撮影時に算出される輝度情報も合わせて取得する。即ち、第1画像取得部101は、輝度情報取得手段として機能する。本実施形態で取得する輝度情報は輝度値(Brightness_Value、以後BVと称する。)であり、撮影時における測光値から算出され、Exif(Exchangeable_Image_File_Format)データとして画像データに付加記録されるものである。取得した第1の画像の画像データ及び輝度情報BVはメモリ32に保持される。   The first image acquisition unit 101 acquires the image data of the latest image captured on the image sensor 33 as the first image when the release button 28 is fully pressed. Here, the first image corresponds to the linear image of the present invention. The first image acquisition unit 101 also acquires luminance information calculated at the time of shooting. That is, the first image acquisition unit 101 functions as a luminance information acquisition unit. The luminance information acquired in the present embodiment is a luminance value (Brightness_Value, hereinafter referred to as BV), which is calculated from a photometric value at the time of photographing and is additionally recorded in the image data as Exif (Exchangeable_Image_File_Format) data. The acquired image data and luminance information BV of the first image are held in the memory 32.

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

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

また、占有率算出部103は、各画素を、第2の画像の画面の外縁からの距離と明度の組み合わせからなる所定の階級に分類し(図31参照)、分類された階級毎に、当該階級に属する画素が画像全体に占める割合を示す第2の占有率を算出する。即ち、占有率算出部103は、第2の占有率算出手段としても機能する。   Further, the occupancy rate calculation unit 103 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. 31), and for each classified class, A second occupation ratio indicating a ratio of pixels belonging to the class to the entire image is calculated. That is, the occupation ratio calculation unit 103 also functions as a second occupation ratio calculation unit.

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

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

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

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

また、指標算出部104は、第2の画像の画面中央部における肌色領域の平均輝度値(指標7とする)と、指標1及び指標3と、前述の撮影時の輝度情報BVとに、それぞれ、撮影条件に応じて予め設定された係数を乗算して和をとることにより、新たな自然光指標を算出する。即ち、指標算出部104は、第5の指標算出手段としても機能する。   In addition, the index calculation unit 104 includes an average brightness value (referred to as index 7) of the skin color area in the center of the screen of the second image, index 1 and index 3, and the above-described brightness information BV at the time of shooting, respectively. Then, a new natural light index is calculated by multiplying a coefficient set in advance according to the photographing condition to obtain a sum. That is, the index calculation unit 104 also functions as a fifth index calculation unit.

また、指標算出部104は、前記平均輝度値と、指標2及び指標3と、前述の撮影時の輝度情報BVとに、それぞれ、撮影条件に応じて予め設定された係数を乗算して和をとることにより、新たな輝度比指標を算出する。即ち、指標算出部104は第6の指標算出手段としても機能する。   In addition, the index calculation unit 104 multiplies the average brightness value, the index 2 and the index 3, and the above-described brightness information BV at the time of shooting by a coefficient set in advance according to the shooting conditions. Thus, a new luminance ratio index is calculated. That is, the index calculation unit 104 also functions as a sixth index calculation unit.

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

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

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

階調処理条件設定部107は、シーン判別部105で判別された撮影シーンに基づいて、第1の画像に対する階調処理条件を設定する。即ち、階調処理条件設定部107は、階調処理条件設定手段として機能する。階調処理条件の設定処理については、後に図37を参照して詳細に説明する。   The gradation processing condition setting unit 107 sets gradation processing conditions for the first image based on the shooting scene determined by the scene determination unit 105. That is, the gradation processing condition setting unit 107 functions as a gradation processing condition setting unit. The gradation processing condition setting process will be described in detail later with reference to FIG.

階調変換処理部108は、階調処理条件設定部107において設定された階調処理条件に従い、第1の画像(リニア画像)に対する階調変換処理を実行する。従って、階調変換処理部108は、第1及び第2の階調変換処理手段として機能する。   The gradation conversion processing unit 108 executes gradation conversion processing for the first image (linear image) according to the gradation processing conditions set by the gradation processing condition setting unit 107. Therefore, the gradation conversion processing unit 108 functions as first and second gradation conversion processing means.

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

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

図13に、階調処理条件設定部107の内部構成を示す。階調処理条件設定部107は、明るさ補正条件設定部107A、フレア補正条件設定部107Bにより構成される。明るさ補正条件設定部107Aは、第1仮補正量設定部201、第1混合係数設定部202、第2仮補正量演算部203、第2混合係数設定部204、明るさ補正量演算部205により構成される。フレア補正条件設定部107Bは、遷移係数設定部206、重み係数設定部207、フレア補正量演算部208により構成される。   FIG. 13 shows an internal configuration of the gradation processing condition setting unit 107. The gradation processing condition setting unit 107 includes a brightness correction condition setting unit 107A and a flare correction condition setting unit 107B. The brightness correction condition setting unit 107A includes a first temporary correction amount setting unit 201, a first mixing coefficient setting unit 202, a second temporary correction amount calculation unit 203, a second mixing coefficient setting unit 204, and a brightness correction amount calculation unit 205. Consists of. The flare correction condition setting unit 107B includes a transition coefficient setting unit 206, a weighting coefficient setting unit 207, and a flare correction amount calculation unit 208.

明るさ補正条件設定部107Aは、リニア画像の明るさを補正するための明るさ補正量を階調処理条件として設定する。即ち、明るさ補正条件設定部107Aは、第1の階調処理条件を設定する階調処理条件設定手段として機能する。   The brightness correction condition setting unit 107A sets a brightness correction amount for correcting the brightness of the linear image as a gradation processing condition. That is, the brightness correction condition setting unit 107A functions as a gradation processing condition setting unit that sets the first gradation processing condition.

第1仮補正量設定部201は、リニア画像の明るさ解析値と、明るさの再現目標値と、指標算出部104で算出された輝度比指標及び露出撮影度指標に基づいて、当該リニア画像に対する第1仮補正量を設定する。n個の明るさ解析値が入力された場合、第1仮補正量設定部201は、各明るさ解析値を再現目標値へと近似するために必要な補正量としての第1仮補正量をn+4個設定する。即ち、第1仮補正量設定部201は、第1仮補正量設定手段として機能する。   The first temporary correction amount setting unit 201 uses the linear image brightness analysis value, the brightness reproduction target value, the luminance ratio index calculated by the index calculation unit 104, and the exposure shooting degree index, to determine the linear image. A first temporary correction amount for is set. When n brightness analysis values are input, the first temporary correction amount setting unit 201 sets the first temporary correction amount as a correction amount necessary to approximate each brightness analysis value to the reproduction target value. Set n + 4. That is, the first temporary correction amount setting unit 201 functions as first temporary correction amount setting means.

図14に、輝度比指標と第1仮補正量key_auto[0]との関係を定義した1次元LUT(Look Up Table)を示し、図15に、露出撮影度指標と第1仮補正量key_auto[1]との関係を定義した1次元LUTを示し、図16に、肌色平均輝度と第1仮補正量key_auto[2]との関係を定義した1次元LUTを示し、図17に、肌色平均輝度又は全体平均輝度と第1仮補正量key_auto[3]との関係を定義した1次元LUTを示し、図18に、輝度比指標と第1仮補正量key_auto[4]との関係を定義した1次元LUTを示し、図19に、露出撮影度指標と第1仮補正量key_auto[5]との関係を定義した1次元LUTを示す。   FIG. 14 shows a one-dimensional LUT (Look Up Table) that defines the relationship between the luminance ratio index and the first temporary correction amount key_auto [0], and FIG. 15 shows the exposure shooting degree index and the first temporary correction amount key_auto [0]. 1] shows a one-dimensional LUT that defines the relationship with 1], FIG. 16 shows a one-dimensional LUT that defines the relationship between the skin color average luminance and the first temporary correction amount key_auto [2], and FIG. 17 shows the skin color average luminance. Alternatively, a one-dimensional LUT that defines the relationship between the overall average luminance and the first temporary correction amount key_auto [3] is shown, and FIG. 18 illustrates the relationship between the luminance ratio index and the first temporary correction amount key_auto [4]. FIG. 19 shows a one-dimensional LUT that defines the relationship between the exposure shooting index and the first temporary correction amount key_auto [5].

本実施形態では、階調処理条件設定部107に入力される明るさ解析値は、肌色平均輝度及び全体平均輝度(即ち、n=2)とする。この場合、第1仮補正量設定部201では、図14〜図19に示した1次元LUTを用いて、第1仮補正量として6個の仮補正量(key_auto[0]〜[5])が設定される。   In the present embodiment, the brightness analysis value input to the gradation processing condition setting unit 107 is the skin color average brightness and the overall average brightness (that is, n = 2). In this case, the first temporary correction amount setting unit 201 uses the one-dimensional LUT shown in FIGS. 14 to 19 as six temporary correction amounts (key_auto [0] to [5]) as the first temporary correction amounts. Is set.

第1混合係数設定部202は、指標算出部104で算出された自然光指標に基づいて、第1仮補正量設定部201で設定されたn+4個の第1仮補正量のうちのn+2個(key_auto[0]〜[3])に乗算する重み係数としての第1混合係数をn+2個設定する。即ち、第1混合係数設定部202は、第1混合係数設定手段として機能する。図20〜図23に、自然光指標と第1混合係数wgt[0]〜wgt[3]との関係を定義した1次元LUTを示す。   Based on the natural light index calculated by the index calculation unit 104, the first mixing coefficient setting unit 202 sets n + 2 (key_auto) of the n + 4 first temporary correction amounts set by the first temporary correction amount setting unit 201. N + 2 first mixing coefficients are set as weighting coefficients for multiplying [0] to [3]). That is, the first mixing coefficient setting unit 202 functions as a first mixing coefficient setting unit. 20 to 23 show one-dimensional LUTs that define the relationship between the natural light index and the first mixing coefficients wgt [0] to wgt [3].

なお、図14〜図19の1次元LUTと、図20〜図23の1次元LUTは、メモリ32に格納されている。   Note that the one-dimensional LUTs of FIGS. 14 to 19 and the one-dimensional LUTs of FIGS. 20 to 23 are stored in the memory 32.

第2仮補正量演算部203は、n+2個の第1仮補正量(key_auto[0]〜[3])と、第1混合係数設定部202で設定されたn+2個の第1混合係数wgt[0]〜wgt[3]に基づいて、リニア画像に対する第2仮補正量を設定する。即ち、第2仮補正量演算部203は、第2仮補正量設定手段として機能する。式(2)に、第2仮補正量の算出式を示す。
第2仮補正量=key_auto[0]×wgt[0]+key_auto[1]×wgt[1]+key_auto[2]×wgt[2]+key_auto[3]×wgt[3] …(2)
以後、式(2)の第2仮補正量をkey_auto[6]と表記する。
The second temporary correction amount calculation unit 203 includes n + 2 first temporary correction amounts (key_auto [0] to [3]) and n + 2 first mixing coefficients wgt [set by the first mixing coefficient setting unit 202. Based on 0] to wgt [3], the second temporary correction amount for the linear image is set. That is, the second temporary correction amount calculation unit 203 functions as a second temporary correction amount setting unit. Formula (2) shows the formula for calculating the second temporary correction amount.
Second temporary correction amount = key_auto [0] × wgt [0] + key_auto [1] × wgt [1] + key_auto [2] × wgt [2] + key_auto [3] × wgt [3] (2)
Henceforth, the 2nd temporary correction amount of Formula (2) is described with key_auto [6].

第2混合係数設定部204は、指標算出部104で算出された自然光指標、輝度比指標、露出撮影度指標の値と、撮影シーンを判別するための判別マップに基づいて、2個の第1仮補正量key_auto[4]、key_auto[5]と、第2仮補正量key_auto[6]の各々に乗算する重み係数として3個の第2混合係数wgt[4]〜[6]を設定する。即ち、第2混合係数設定部204は、第2混合係数設定手段として機能する。   The second mixing coefficient setting unit 204 is based on the values of the natural light index, the luminance ratio index, the exposure shooting degree index calculated by the index calculation unit 104, and the discrimination map for discriminating the shooting scene. Three second mixing coefficients wgt [4] to [6] are set as weight coefficients to be multiplied to the temporary correction amounts key_auto [4] and key_auto [5] and the second temporary correction amount key_auto [6]. That is, the second mixing coefficient setting unit 204 functions as a second mixing coefficient setting unit.

図24(a)に、自然光指標及び輝度比指標に基づいてリニア画像の撮影シーン(順光、逆光、主要被写体がオーバー、アンダー、低確度領域)を判別するための判別マップを示し、図24(b)に自然光指標及び露出撮影度指標に基づいてリニア画像の撮影シーン(順光、逆光、主要被写体がオーバー、アンダー、低確度領域)を判別するための判別マップを示す。図24において、低確度領域とは、順光、逆光、主要被写体がオーバー、アンダーと判別される確度が(所定値より)低い領域を表している。   FIG. 24A shows a discrimination map for discriminating a linear image shooting scene (forward light, backlight, main subject is over, under, low accuracy region) based on the natural light index and the luminance ratio index. FIG. 5B shows a discrimination map for discriminating a linear image shooting scene (forward light, backlight, main subject is over, under, low accuracy region) based on the natural light index and the exposure shooting index. In FIG. 24, the low accuracy region represents a region where the accuracy with which forward light, backlight, main subject is determined to be over or under is low (lower than a predetermined value).

図25は、撮影シーン別に第2混合係数wgt[4]〜[6]の値を表す係数算出テーブルを示している。この係数算出テーブルは、メモリ32に格納されている。図25において、撮影シーン項目に示された各数字は、図24の各撮影シーンに付与された数字である。例えば、図25において、撮影シーン項目の“3”は、図24(a)の低確度領域(3)を表す。   FIG. 25 shows a coefficient calculation table representing the values of the second mixing coefficients wgt [4] to [6] for each shooting scene. This coefficient calculation table is stored in the memory 32. In FIG. 25, each number shown in the shooting scene item is a number given to each shooting scene in FIG. For example, in FIG. 25, “3” of the shooting scene item represents the low accuracy region (3) of FIG.

明るさ補正量演算部205は、2個の第1仮補正量key_auto[4]、key_auto[5]と、第2仮補正量key_auto[6]と、第2混合係数設定部204で設定された3個の第2混合係数wgt[4]〜[6]から、式(3A)に示すように、階調調整パラメータとしての明るさ補正量を算出する。
明るさ補正量
=key_auto[4]×wgt[4]+key_auto[5]×wgt[5]+key_auto[6]×wgt[6] …(3A)
即ち、明るさ補正量演算部205は、階調調整パラメータ算出手段として機能する。
The brightness correction amount calculation unit 205 is set by the two first temporary correction amounts key_auto [4] and key_auto [5], the second temporary correction amount key_auto [6], and the second mixing coefficient setting unit 204. From the three second mixing coefficients wgt [4] to [6], a brightness correction amount as a gradation adjustment parameter is calculated as shown in Expression (3A).
Brightness correction amount = key_auto [4] × wgt [4] + key_auto [5] × wgt [5] + key_auto [6] × wgt [6] (3A)
That is, the brightness correction amount calculation unit 205 functions as a gradation adjustment parameter calculation unit.

フレア補正条件設定部107Bは、リニア画像の硬度を調整するためのフレア補正量を階調条件として設定する。即ち、フレア補正条件設定部107Bは、第2の階調処理条件を設定する階調処理条件設定手段として機能する。   The flare correction condition setting unit 107B sets a flare correction amount for adjusting the hardness of the linear image as a gradation condition. That is, the flare correction condition setting unit 107B functions as a gradation processing condition setting unit that sets the second gradation processing condition.

明るさ補正条件設定部107Aにより算出された明るさ補正量によりリニア画像を明るさ補正した場合に、このリニア画像が逆光シーンであると、逆光シーンのシャドー部に潜在的に存在するオフセット領域が、画像を明るくする補正により顕在化され、フレア画像となるケースがある。このようなフレア画像の発生を防ぐためのフレア補正を行うために、フレア補正条件設定部107Bでフレア補正量が算出される。   When the brightness of a linear image is corrected by the brightness correction amount calculated by the brightness correction condition setting unit 107A, if this linear image is a backlight scene, an offset region that is potentially present in the shadow portion of the backlight scene is present. In some cases, the image becomes obvious by correction for brightening the image and becomes a flare image. In order to perform flare correction for preventing the occurrence of such a flare image, the flare correction amount setting unit 107B calculates the flare correction amount.

遷移係数設定部206は、指標算出部104で算出された自然光指標及び輝度比指標に基づいて遷移係数wを算出して設定する。重み係数設定部207は、指標算出部104で算出された輝度比指標に基づいて、輝度比指標依存重み割付係数としての重み係数fwを算出して設定する。   The transition coefficient setting unit 206 calculates and sets the transition coefficient w based on the natural light index and the luminance ratio index calculated by the index calculation unit 104. The weighting factor setting unit 207 calculates and sets a weighting factor fw as a luminance ratio index-dependent weight allocation coefficient based on the luminance ratio index calculated by the index calculation unit 104.

フレア補正量演算部208は、遷移係数設定部206により設定された遷移係数wと、重み係数設定部207により設定された重み係数fwと、予め設定されたフレア補正基準値fcとに基づいて、次式(3B)を用いて、フレア補正量flareCorrを算出して階調変換処理部108へ出力する。
flareCorr=fc×fw×w …(3B)
フレア補正基準値fcは、例えば、32で固定の値とし、予め設定されてメモリ32に記憶されているものとする。
The flare correction amount calculation unit 208 is based on the transition coefficient w set by the transition coefficient setting unit 206, the weighting factor fw set by the weighting factor setting unit 207, and the preset flare correction reference value fc. Using the following equation (3B), the flare correction amount flareCorr is calculated and output to the gradation conversion processing unit 108.
flareCorr = fc × fw × w (3B)
For example, the flare correction reference value fc is a fixed value of 32, and is set in advance and stored in the memory 32.

ここで、図26を参照して、遷移係数w及び重み係数fwの一例を説明する。図26(a)に、シーン判別マップに対応する遷移係数w及び重み係数fwの一例を示す。図26(b)に、重み係数fwの別の一例を示す。フレア補正は、リニア画像中の図26(a)における逆光領域(2)及び低確度領域(3)、(4)に対して施される。   Here, an example of the transition coefficient w and the weighting coefficient fw will be described with reference to FIG. FIG. 26A shows an example of the transition coefficient w and the weight coefficient fw corresponding to the scene discrimination map. FIG. 26B shows another example of the weighting factor fw. The flare correction is performed on the backlight region (2) and the low accuracy regions (3) and (4) in FIG.

図26(a)に示すように、遷移係数wは、逆光領域(2)で1をとり、低確度領域(3)のうち自然光指標が−1.5以下の領域で、0から1まで正規化された遷移係数w1の値をとり、低確度領域(4)のうち輝度比指標が1.5以上の領域では、0から1まで正規化された遷移係数w2の値をとる。また、遷移係数wは、低確度領域(3)(4)のうち自然光指標が−1.5から0.5までで且つ輝度比指標が−0.5から1.5までの領域では、遷移係数w1,w2のうち大きい値が採用される。   As shown in FIG. 26 (a), the transition coefficient w is 1 in the backlight region (2), and is a normal value from 0 to 1 in the low accuracy region (3) where the natural light index is −1.5 or less. The normalized transition coefficient w1 is taken, and the normalized transition coefficient w2 from 0 to 1 is taken in the area where the luminance ratio index is 1.5 or more in the low accuracy area (4). The transition coefficient w is a transition in the low accuracy region (3) (4) in the region where the natural light index is from −1.5 to 0.5 and the luminance ratio index is from −0.5 to 1.5. A larger value is adopted among the coefficients w1 and w2.

また、重み係数fwは、図26(a)に示すように、輝度比指標が1.5以上の領域で1をとり、輝度比指標が−0.5から1.5までの領域で、0から1まで正規化された値をとる。重み係数fwは、図26(a)の例に限定されるものではなく、例えば、図26(b)に示すように、輝度比指標が−0.5以上の領域で、0から1まで正規化された値をとることとしてもよい。   Further, as shown in FIG. 26A, the weighting factor fw is 1 when the luminance ratio index is 1.5 or more, and is 0 when the luminance ratio index is −0.5 to 1.5. Takes a normalized value from 1 to 1. The weighting factor fw is not limited to the example of FIG. 26A. For example, as shown in FIG. 26B, the weighting factor fw is normal from 0 to 1 in the region where the luminance ratio index is −0.5 or more. It is also possible to take a normalized value.

(撮像装置1の動作フロー)
次に、本実施形態における撮像装置1の動作について説明する。
(Operation Flow of Imaging Device 1)
Next, the operation of the imaging device 1 in the present embodiment will be described.

以下では、撮影対象物を「主要被写体」と呼ぶことにする。   Hereinafter, the photographing object is referred to as “main subject”.

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

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

一方、撮影が行われると、輝度情報取得工程であるステップS3では、輝度情報BVの取り込みが行われる。ステップS3で取得される輝度情報BVは、撮影時に測光値から算出され、後で撮影画像がExif形式で記録される際に、合わせて記録されるものである。取得された輝度情報BVはメモリ32に保持される。   On the other hand, when photographing is performed, the luminance information BV is captured in step S3, which is a luminance information acquisition step. The luminance information BV acquired in step S3 is calculated from the photometric value at the time of photographing, and is recorded together when the photographed image is recorded in the Exif format later. The acquired luminance information BV is held in the memory 32.

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

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

次いで、シーン判別処理工程であるステップS8では、ステップS7で取得された第2の画像の画像データに基づいて、撮影シーンを判別するシーン判別処理が行われる。ステップS8におけるシーン判別処理については、後に図28を参照して詳細に説明する。   Next, in step S8, which is a scene determination process step, a scene determination process for determining a shooting scene is performed based on the image data of the second image acquired in step S7. The scene determination process in step S8 will be described in detail later with reference to FIG.

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

第1の階調変換処理工程であるステップS10では、第2の画像に基づいて設定された階調処理条件(明るさ補正量)に基づいて、撮影画像である第1の画像の画像データに対する階調変換処理が行われる。ステップS10の階調変換処理は、シーン輝度のどこを中心に写真階調を再現するか、或いは撮影シーンの光源条件などによる階調への影響を補正するものであり、ステップS8でのシーン判別結果によりステップS9で設定された階調処理条件(明るさ補正量)に基づいて行われるものである。   In step S10, which is the first gradation conversion processing step, the image data of the first image that is the photographed image is processed based on the gradation processing condition (brightness correction amount) set based on the second image. A gradation conversion process is performed. The gradation conversion processing in step S10 is to correct the influence on the gradation due to where the photographic gradation is reproduced with respect to the scene luminance or the light source condition of the shooting scene, and the scene determination in step S8. The result is based on the gradation processing condition (brightness correction amount) set in step S9.

第2の階調変換処理工程であるステップS11では、第2の画像に基づいて設定された階調処理条件(フレア補正量)に基づいて、ステップS10で階調変換処理が行われた第1の画像の画像データに対するフレア補正処理が行われる。ステップS11のフレア補正処理は、逆光シーンのシャドー部における潜在的なオフセット領域を補正してフレア画像を防ぐものであり、ステップS8でのシーン判別結果によりステップS9で設定された階調処理条件(フレア補正量)に基づいて行われるものである。   In step S11, which is the second gradation conversion process step, the first gradation conversion process is performed in step S10 based on the gradation processing condition (flare correction amount) set based on the second image. The flare correction process is performed on the image data of the first image. The flare correction process in step S11 is to prevent a flare image by correcting a potential offset region in the shadow part of the backlight scene. The gradation processing condition (set in step S9 based on the scene determination result in step S8 ( (Flare correction amount).

第3の階調変換処理工程であるステップS12では、AWB処理、階調変換処理後の第1の画像(リニア画像)に対しガンマ変換処理を施すことによって、当該リニア画像がノンリニア画像に変換される。   In step S12, which is the third gradation conversion process, the linear image is converted into a non-linear image by performing a gamma conversion process on the first image (linear image) after the AWB process and the gradation conversion process. The

なお、本実施形態では、ステップS9で階調処理条件を設定し、ステップS10で階調変換処理を行う形態としているが、第1の画像に対する画像処理以外に、例えばその撮影シーンに対する最適な画像を取得するための露出条件をリアルタイムに算出し、撮影操作に反映するといった処理などを行うようにしてもよい。   In this embodiment, gradation processing conditions are set in step S9 and gradation conversion processing is performed in step S10. In addition to image processing for the first image, for example, an optimal image for the shooting scene is used. It is also possible to perform processing such as calculating an exposure condition for acquiring the image in real time and reflecting it in the photographing operation.

次いで、ガンマ変換処理後の画像データに対し、その他の画像処理(ノイズ処理、シャープネス処理、コントラスト補正処理、覆い焼き処理等)が適宜行われる(ステップS13)。その後、画像記録のため、画像フォーマットの変換が行われる(ステップS14)。一般的にはJPEG形式の画像に変換処理される。その後、JPEG形式の画像データが、保存用の記録媒体(SDメモリカード又はマルチメディアカード(MMC)等)に記録される(ステップS15)。Exif形式の画像記録においては、輝度情報BVもExifデータとして付加的に記録される。次の撮影に移るか、或いは電源スイッチ26がOFFに操作されると、撮像装置1における動作は終了する。   Next, other image processing (noise processing, sharpness processing, contrast correction processing, dodging processing, etc.) is appropriately performed on the image data after the gamma conversion processing (step S13). Thereafter, the image format is converted for image recording (step S14). Generally, it is converted into an image in JPEG format. Thereafter, the image data in JPEG format is recorded on a storage medium for storage (such as an SD memory card or a multimedia card (MMC)) (step S15). In the image recording in the Exif format, the luminance information BV is additionally recorded as Exif data. When the next shooting is started or the power switch 26 is turned off, the operation of the image pickup apparatus 1 ends.

なお、階調変換処理後のリニア画像をRawデータとして保存し、現像ソフトウェアを用いてノンリニア画像に変換するようにしてもよい。   Note that the linear image after gradation conversion processing may be stored as Raw data and converted to a non-linear image using development software.

(シーン判別処理1のフロー)
次に、図28のフローチャートを参照して、画像処理部10において実行されるシーン判別処理(図27のステップS8)について説明する。
(Scene discrimination process 1 flow)
Next, with reference to the flowchart in FIG. 28, the scene determination process (step S8 in FIG. 27) executed in the image processing unit 10 will be described.

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

ステップ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と定義している。   In the color space conversion process in step S20, first, information indicating the RGB value, the luminance value, and the white balance of each pixel of the second image obtained from the captured 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” which is generally used unless otherwise noted. In the following description, V (0 to 255) of the HSV color system is used as “brightness”, but a unit system representing the brightness of any other color system may be used. At that time, it goes without saying that numerical values such as various coefficients described in the present embodiment are recalculated.

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

図30に、明度と色相の組み合わせからなる階級を示す。ステップS30では、明度(V)は、明度値が0〜5(v1)、6〜12(v2)、13〜24(v3)、25〜76(v4)、77〜109(v5)、110〜149(v6)、150〜255(v7)の7つの階級に分割される。図30に示すように、最も低明度の階級における明度の範囲よりも、最も高明度の階級における明度の範囲の方が広い。   FIG. 30 shows a class composed of combinations of brightness and hue. In step S30, the lightness (V) is 0-5 (v1), 6-12 (v2), 13-24 (v3), 25-76 (v4), 77-109 (v5), 110-110. It is divided into seven classes of 149 (v6) and 150 to 255 (v7). As shown in FIG. 30, 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)のうち、下記の式(5)を満たす色相’(H)を肌色領域(H1)とし、式(5)を満たさない領域を(H2)とする。   Hue (H) is a flesh color hue region (H1 and H2) having a hue value of 0 to 39 and 330 to 359, a green hue region (H3) having a hue value of 40 to 160, and a blue hue region having a hue value of 161 to 250. It is divided into four areas (H4) and a red hue area (H5). Note that the red hue region (H5) is not used in the following calculation because it is known that the contribution to the determination of the shooting scene is small. The skin color hue region is further divided into a skin color region (H1) and another region (H2). Hereinafter, among the flesh-color hue regions (H = 0 to 39, 330 to 359), the hue ′ (H) that satisfies the following equation (5) is defined as the flesh-color region (H1), and the region that does not satisfy the equation (5) is ( H2).

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

ステップ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).

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

明度領域vi、色相領域Hjの組み合わせからなる階級において算出された第1の占有率をRijとすると、各階級における第1の占有率は表1のように表される。

Figure 2007293686
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 2007293686

ステップ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 the second occupancy rate calculating step.

明度領域vi、画面領域njの組み合わせからなる各階級において算出された第2の占有率をQijとすると、各階級における第2の占有率は表2のように表される。

Figure 2007293686
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 2007293686

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

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

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

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

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

Figure 2007293686
Table 3 shows the first coefficient necessary for calculating the index 1 by class. The coefficient of each class shown in Table 3 is a weighting coefficient by which the first occupation ratio Rij of each class shown in Table 1 is multiplied, and is set in advance according to the shooting conditions.
Figure 2007293686

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

明度領域vi、色相領域Hjにおける第1の係数をCijとすると、指標1を算出するためのHk領域の和は、式(6)のように定義される。

Figure 2007293686
When the first coefficient in the lightness region vi and the hue region Hj is Cij, the sum of the Hk regions for calculating the index 1 is defined as in Expression (6).
Figure 2007293686

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

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

表4に、指標2を算出するために必要な第2の係数を階級別に示す。表4に示された各階級の係数は、表1に示した各階級の第1の占有率Rijに乗算する重み係数であり、撮影条件に応じて予め設定されている。

Figure 2007293686
Table 4 shows the second coefficient necessary for calculating the index 2 by class. The coefficient of each class shown in Table 4 is a weighting coefficient by which the first occupancy rate Rij of each class shown in Table 1 is multiplied, and is set in advance according to the shooting conditions.
Figure 2007293686

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

明度領域vi、色相領域Hjにおける第2の係数をDijとすると、指標2を算出するためのHk領域の和は、式(8)のように定義される。

Figure 2007293686
When the second coefficient in the lightness region vi and the hue region Hj is Dij, the sum of the Hk regions for calculating the index 2 is defined as in Expression (8).
Figure 2007293686

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

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

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

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

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

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

Figure 2007293686
Table 5 shows the third coefficient necessary for calculating the index 3 by class. The coefficient of each class shown in Table 5 is a weighting coefficient by which the second occupancy Qij of each class shown in Table 2 is multiplied, and is set in advance according to the shooting conditions.
Figure 2007293686

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

明度領域vi、画面領域njにおける第3の係数をEijとすると、指標3を算出するためのnk領域(画面領域nk)の和は、式(10)のように定義される。

Figure 2007293686
If the third coefficient in the brightness area vi and the screen area nj is Eij, the sum of the nk area (screen area nk) for calculating the index 3 is defined as in Expression (10).
Figure 2007293686

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

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

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

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

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

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

まず、第2の画像のRGB(Red、Green、Blue)値から、式(4)を用いて輝度Yが算出される。次いで、第2の画像の画面中央部における肌色領域の平均輝度値x1が算出される(ステップS50)。ここで、画面中央部とは、例えば、図31(a)に示した領域n3により構成される領域である。次いで、第2の画像の最大輝度値と平均輝度値との差分値x2=最大輝度値−平均輝度値が算出される(ステップS51)。   First, the luminance Y is calculated from the RGB (Red, Green, Blue) values of the second image using Equation (4). 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は、下記の式(12−1)のように表される。
x5=(Yskin_max−Yskin_min)/2−Yskin_ave …(12−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 represented as the following formula (12-1).
x5 = (Yskin_max−Yskin_min) / 2−Yskin_ave (12-1)

次いで、ステップS50〜S54で算出された値x1〜x5の値の各々に、撮影条件に応じて予め設定された第4の係数を乗算して和をとることにより、露出撮影度指標が算出され(ステップS55)、露出撮影度指標算出処理が終了する。露出撮影度指標は、下記の式(12−2)のように定義される。
露出撮影度指標=0.05×x1+1.41×x2+(−0.01)×x3+(−0.01)×x4+0.01×x5−5.34 …(12−2)
この露出撮影度指標は、第2の画像の画面の構図的な特徴だけでなく、輝度ヒストグラム分布情報を持ち合わせており、特に、主要被写体がオーバーである撮影シーンとアンダー撮影シーンの判別に有効である。
Next, an exposure shooting index is calculated by multiplying each of the values x1 to x5 calculated in steps S50 to S54 by a fourth coefficient set in advance according to shooting conditions to obtain a sum. (Step S55), the exposure shooting index calculation processing is completed. The exposure shooting index is defined as the following formula (12-2).
Exposure shooting index = 0.05 × x1 + 1.41 × x2 + (− 0.01) × x3 + (− 0.01) × x4 + 0.01 × x5−5.34 (12-2)
This exposure shooting index includes not only the compositional characteristics of the screen of the second image but also the luminance histogram distribution information, and is particularly effective for distinguishing between a shooting scene in which the main subject is over and an under shooting scene. is there.

図32に戻る。露出撮影度指標が算出されると、第5の指標算出工程であるステップS44において、指標1、指標3、輝度情報BV及び第2の画像の画面中央部における肌色領域の平均輝度値に、撮影条件に応じて予め設定された重み係数(第5の係数)を乗算することにより、自然光指標が算出される。   Returning to FIG. When the exposure shooting degree index is calculated, in step S44, which is a fifth index calculation step, the index 1, the index 3, the luminance information BV, and the average luminance value of the skin color area at the center of the screen of the second image are captured. A natural light index is calculated by multiplying a preset weighting factor (fifth factor) according to the condition.

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

以下、自然光指標及び輝度比指標の算出方法について詳細に説明する。   Hereinafter, the calculation method of the natural light index and the luminance ratio index will be described in detail.

第2の画像の画面中央部における肌色領域の平均輝度値を指標7とする。ここでの画面中央部とは、例えば、図31(a)の領域n2及び領域n3から構成される領域である。このとき、自然光指標は、指標1、指標3、指標7、及び輝度情報BVを用いて式(13)のように定義され、輝度比指標は、指標2、指標3、指標7、及び輝度情報BVを用いて式(14)のように定義される。
自然光指標
=0.45×指標1+0.16×指標3+0.003×指標7−0.64×BV+4.00 …(13)
輝度比指標
=0.74×指標2+0.08×指標3+0.011×指標7−0.01×BV+1.35 …(14)
ここで式(13)及び式(14)において各指標に乗算される係数は、撮影条件に応じて予め設定されている。
The average luminance value of the skin color area at the center of the screen of the second image is taken as index 7. The center portion of the screen here is, for example, a region composed of the region n2 and the region n3 in FIG. At this time, the natural light index is defined as Expression (13) using the index 1, the index 3, the index 7, and the luminance information BV, and the luminance ratio index is the index 2, the index 3, the index 7, and the luminance information. It is defined as in equation (14) using BV.
Natural light index = 0.45 × index 1 + 0.16 × index 3 + 0.003 × index 7−0.64 × BV + 4.00 (13)
Luminance ratio index = 0.74 × index 2 + 0.08 × index 3 + 0.011 × index 7−0.01 × BV + 1.35 (14)
Here, the coefficients to be multiplied by the respective indexes in the equations (13) and (14) are set in advance according to the photographing conditions.

また輝度情報BVに基づいて、自然光指標、輝度比指標を算出する代わりに、指標1、指標2、指標3を算出するのに輝度情報BVを用いてもよい。その場合、自然光指標、輝度比指標を算出するのに輝度情報BVを用いる必要はない。   Further, instead of calculating the natural light index and the luminance ratio index based on the luminance information BV, the luminance information BV may be used to calculate the index 1, the index 2, and the index 3. In that case, it is not necessary to use the luminance information BV to calculate the natural light index and the luminance ratio index.

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

露出撮影度指標、自然光指標、輝度比指標が算出されると、これらの指標の値に基づいて撮影シーンが判別される(ステップS23)。表6に、露出撮影度指標、自然光指標及び輝度比指標の値による撮影シーンの判別内容を示す。撮影時の輝度情報BVに基づき自然光指標及び輝度比指標は算出されており、輝度情報BVは撮影シーンの判別に間接的に寄与している。   When the exposure shooting degree index, the natural light index, and the luminance ratio index are calculated, the shooting scene is determined based on the values of these indexes (step S23). Table 6 shows the details of the shooting scene discrimination based on the values of the exposure shooting index, the natural light index, and the luminance ratio index. The natural light index and the luminance ratio index are calculated based on the luminance information BV at the time of shooting, and the luminance information BV indirectly contributes to the determination of the shooting scene.

Figure 2007293686
表6に示した判別内容を、自然光指標、輝度比指標及び露出撮影度指標の座標系を用いて表したものが、図24の判別マップである。なお、表6では、図24に示した低確度領域については省略している。
Figure 2007293686
The discrimination map shown in FIG. 24 represents the discrimination contents shown in Table 6 using the coordinate system of the natural light index, the luminance ratio index, and the exposure shooting index. In Table 6, the low accuracy region shown in FIG. 24 is omitted.

次に、図37のフローチャートを参照して、階調処理条件設定部107において実行される階調処理条件設定処理について説明する。   Next, the gradation processing condition setting process executed in the gradation processing condition setting unit 107 will be described with reference to the flowchart of FIG.

まず、図14〜図19の1次元LUTから、リニア画像の明るさ解析値(n個:ここでは、肌色平均輝度、全体平均輝度の2個)と、図32の指標算出処理で算出された自然光指標、輝度比指標、露出撮影度指標に対応する値を抽出することにより、n+4個(6個)の第1仮補正量key_auto[0]〜[5]が設定される(ステップS61)。   First, from the one-dimensional LUT of FIGS. 14 to 19, the brightness analysis value of the linear image (n: here, two of skin color average luminance and overall average luminance) and the index calculation processing of FIG. 32 were used. By extracting values corresponding to the natural light index, the luminance ratio index, and the exposure shooting index, n + 4 (six) first temporary correction amounts key_auto [0] to [5] are set (step S61).

次いで、図20〜図23の1次元LUTから、自然光指標に対応する値を抽出することにより、n+2個(4個)の第1混合係数wgt[0]〜[3]が設定される(ステップS62)。次いで、4個の第1仮補正量key_auto[0]〜[3]と、4個の第1混合係数wgt[0]〜[3]を用いて、式(2)より第2仮補正量key_auto[6]が算出される(ステップS63)。   Next, n + 2 (four) first mixing coefficients wgt [0] to [3] are set by extracting a value corresponding to the natural light index from the one-dimensional LUT of FIGS. S62). Next, using the four first temporary correction amounts key_auto [0] to [3] and the four first mixing coefficients wgt [0] to [3], the second temporary correction amount key_auto is obtained from Equation (2). [6] is calculated (step S63).

次いで、係数算出テーブル(図25)から、判別マップ(図24)を用いて判別された撮影シーンに対応する3個の第2混合係数wgt[4]〜[6]が抽出され、設定される(ステップS64)。次いで、2個の第1仮補正量key_auto[4]、key_auto[5]と、第2仮補正量key_auto[6]と、3個の第2混合係数wgt[4]〜[6]を用いて、式(3A)により、階調調整パラメータとしての明るさ補正量が算出される(ステップS65)。   Next, from the coefficient calculation table (FIG. 25), three second mixing coefficients wgt [4] to [6] corresponding to the photographic scene determined using the determination map (FIG. 24) are extracted and set. (Step S64). Next, using the two first temporary correction amounts key_auto [4] and key_auto [5], the second temporary correction amount key_auto [6], and the three second mixing coefficients wgt [4] to [6] Then, the brightness correction amount as the tone adjustment parameter is calculated by the equation (3A) (step S65).

次いで、フレア補正条件設定部107Bにより、図32の指標算出処理で算出された自然光指標、輝度比指標を用いて、式(3B)により、フレア補正量(flareCorr)が算出される(ステップS66)。   Next, the flare correction condition setting unit 107B calculates the flare correction amount (flareCorr) by the equation (3B) using the natural light index and the luminance ratio index calculated in the index calculation process of FIG. 32 (step S66). .

次いで、ステップS65で算出された明るさ補正量と、シーン判別処理によって判別された撮影シーンと、ステップS66で算出されたフレア補正量とから、リニア画像に対する階調処理条件が設定され(ステップS67)、本階調処理条件設定処理が終了する。   Next, gradation processing conditions for the linear image are set from the brightness correction amount calculated in step S65, the photographic scene determined by the scene determination processing, and the flare correction amount calculated in step S66 (step S67). ), The gradation processing condition setting process ends.

図38(a)に、撮影シーンが順光である場合の明るさ補正の階調変換曲線を階調調整パラメータ別に示し、図38(b)に、撮影シーンが逆光である場合の明るさ補正の階調変換曲線を階調調整パラメータ別に示す。図39に、フレア補正の階調変換曲線を示す。ステップS67では、ステップS65で算出された階調調整パラメータ(明るさ補正量)に対応する階調変換曲線と、ステップS66で算出されたフレア補正量に対応する階調変換曲線とが、階調処理条件として設定される。   FIG. 38 (a) shows a gradation conversion curve for brightness correction when the shooting scene is in direct light, and FIG. 38 (b) shows brightness correction when the shooting scene is backlight. Are shown for each gradation adjustment parameter. FIG. 39 shows a gradation conversion curve for flare correction. In step S67, the gradation conversion curve corresponding to the gradation adjustment parameter (brightness correction amount) calculated in step S65 and the gradation conversion curve corresponding to the flare correction amount calculated in step S66 are the gradations. Set as processing conditions.

図37におけるステップS61〜S65の各ステップは、それぞれ、本発明における第1仮補正量設定工程、第1混合係数設定工程、第2仮補正量設定工程、第2混合係数設定工程、階調調整パラメータ算出工程に対応する。   Each of steps S61 to S65 in FIG. 37 includes a first temporary correction amount setting step, a first mixing coefficient setting step, a second temporary correction amount setting step, a second mixing coefficient setting step, and gradation adjustment in the present invention, respectively. This corresponds to the parameter calculation process.

以上のように、第1の実施形態の撮像装置1によれば、リニア画像を用いて撮影シーンを判別し、当該撮影シーンの判別結果に基づく明るさ及び硬さ調整用の階調処理条件を、リニア画像取得時の露出補正と等価となるように定義したことにより、既存の自動露出制御、撮像素子の動作点変更、リニア画像からノンリニア画像への階調処理条件の変更を行うことなく、主要被写体(例えば、人物顔領域)の明るさを最適化することが可能となる。   As described above, according to the imaging apparatus 1 of the first embodiment, a shooting scene is determined using a linear image, and gradation processing conditions for brightness and hardness adjustment based on the determination result of the shooting scene are set. By defining it to be equivalent to exposure correction at the time of linear image acquisition, without changing the existing automatic exposure control, the operating point of the image sensor, the change of the gradation processing condition from the linear image to the non-linear image, It becomes possible to optimize the brightness of the main subject (for example, the human face area).

(第2の実施形態)
次に、本発明の第2の実施形態について説明する。
まず、第2の実施形態(画像処理装置)における構成について説明する。以下では、第1の実施形態と同様の機能を有する構成要素には同一の符号を付すものとする。
(Second Embodiment)
Next, a second embodiment of the present invention will be described.
First, the configuration of the second embodiment (image processing apparatus) will be described. In the following, components having the same functions as those in the first embodiment are denoted by the same reference numerals.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

また、第1画像取得部101は、例えば撮影時にリニア画像のタグ領域に記録された付加情報などを読み出し、撮影時に算出される輝度情報も合わせて取得する。即ち、第1画像取得部101は輝度情報取得手段としても機能する。本実施形態で取得する輝度情報BVは輝度値であり、撮影時における測光値から算出され、メタデータとして画像データのタグ領域に付加記録されたものである。取得した第1の画像の画像データ及び輝度情報BVは、画像処理部10内のメモリ(不図示)に保持される。   In addition, the first image acquisition unit 101 reads, for example, additional information recorded in the tag area of the linear image at the time of shooting, and also acquires luminance information calculated at the time of shooting. That is, the first image acquisition unit 101 also functions as a luminance information acquisition unit. The luminance information BV acquired in the present embodiment is a luminance value, which is calculated from a photometric value at the time of shooting and is additionally recorded in the tag area of the image data as metadata. The acquired image data and luminance information BV of the first image are held in a memory (not shown) in the image processing unit 10.

第2画像取得部102は、第1の実施形態の場合と同様に、第1の画像から、実質的に縮小された第2の画像を取得する。
第1画像取得部101及び第2画像取得部102は、第1の実施形態と同様に、画像取得手段として機能する。
Similar to the case of the first embodiment, the second image acquisition unit 102 acquires a substantially reduced second image from the first image.
Similar to the first embodiment, the first image acquisition unit 101 and the second image acquisition unit 102 function as an image acquisition unit.

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

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

また、占有率算出部103は、第2の占有率算出手段としても機能し、同じく画像を画面の外縁からの距離と明度の組み合わせからなる所定の階級に分類し、各階級毎に第2の占有率を算出する。   The occupancy rate calculation unit 103 also functions as a second occupancy rate calculation unit, and similarly classifies images into a predetermined class composed of a combination of the distance from the outer edge of the screen and the brightness, and a second class is determined for each class. Calculate the occupation rate.

占有率算出部103において実行される占有率算出処理において、第1の実施形態と異なる点については、後に図29を参照して説明する。   In the occupancy rate calculation process executed in the occupancy rate calculation unit 103, differences from the first embodiment will be described later with reference to FIG.

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

また、指標算出部104は、占有率算出部103で算出された第2の占有率から指標3を算出する。即ち、指標算出部104は、第3の指標算出手段としても機能する。   In addition, the index calculation unit 104 calculates the index 3 from the second occupancy rate calculated by the occupancy rate calculation unit 103. That is, the index calculation unit 104 also functions as a third index calculation unit.

更に、指標算出部104は、第2の画像の画面中央部における平均輝度値と、最大輝度値と平均輝度値との差分値から露出撮影度指標を算出する。即ち、指標算出部104は、第4の指標算出手段としても機能する。   Further, the index calculation unit 104 calculates an exposure shooting degree index from the average luminance value in the center of the screen of the second image and the difference value between the maximum luminance value and the average luminance value. That is, the index calculation unit 104 also functions as a fourth index calculation unit.

また、指標算出部104は、第2の画像の画面中央部における肌色領域の平均輝度値(指標7)と、指標1及び指標3と、前述の撮影時の輝度情報BVとから、新たな自然光指標を算出する。即ち、指標算出部104は、第5の指標算出手段としても機能する。   In addition, the index calculation unit 104 generates new natural light from the average luminance value (index 7) of the skin color area in the center of the screen of the second image, the index 1 and the index 3, and the luminance information BV at the time of shooting. Calculate the indicator. That is, the index calculation unit 104 also functions as a fifth index calculation unit.

また、指標算出部104は、前記平均輝度値と、指標2及び指標3と、前述の撮影時の輝度情報BVとから、新たな輝度比指標を算出する。即ち、指標算出部104は、第6の指標算出手段としても機能する。   In addition, the index calculation unit 104 calculates a new brightness ratio index from the average brightness value, the indices 2 and 3, and the above-described brightness information BV at the time of shooting. That is, the index calculation unit 104 also functions as a sixth index calculation unit.

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

シーン判別部105は、指標算出部104で算出された各指標に基づいて、第1の画像の撮影シーンを判別する。即ち、シーン判別部105は、シーン判別手段として機能する。ここで、撮影シーンとは、順光、逆光、近接フラッシュ等の被写体を撮影する時の光源条件を示しており、主要被写体(主に人物のことを指すが、これに限るものではない)のオーバー度、アンダー度などもこれに含まれる。   The scene determination unit 105 determines the shooting scene of the first image based on each index calculated by the index calculation unit 104. That is, the scene determination unit 105 functions as a scene determination unit. Here, the shooting scene indicates a light source condition when shooting a subject such as a front light, a backlight, a proximity flash, etc., and is a main subject (mainly a person, but is not limited to this). This includes over and under degrees.

以上のように、占有率算出部103、指標算出部104及びシーン判別部105は、第1の実施形態と同様に、シーン判別処理手段として機能する。   As described above, the occupation rate calculation unit 103, the index calculation unit 104, and the scene determination unit 105 function as a scene determination processing unit, as in the first embodiment.

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

階調変換処理部108は、階調処理条件設定部107で設定された階調処理条件に従って、第1の画像に対する階調変換処理を実行する。また、階調変換処理部108は、撮像装置1のガンマ補正部55と同様に、当該階調変換処理が施された第1の画像(リニア画像)をノンリニア画像に変換する処理を行う。従って、階調変換処理部108は、第1、第2及び第3の階調変換処理手段として機能する。   The gradation conversion processing unit 108 executes gradation conversion processing on the first image in accordance with the gradation processing conditions set by the gradation processing condition setting unit 107. In addition, the gradation conversion processing unit 108 performs processing for converting the first image (linear image) subjected to the gradation conversion processing into a non-linear image, like the gamma correction unit 55 of the imaging device 1. Therefore, the gradation conversion processing unit 108 functions as first, second, and third gradation conversion processing means.

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

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

まず、図42のフローチャートを参照して、画像処理装置2において実行される処理の全体の流れを説明する。   First, the overall flow of processing executed in the image processing apparatus 2 will be described with reference to the flowchart of FIG.

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

一方、輝度情報取得工程であるステップS72では、取得した第1の画像に付加されたExif情報が読み出され、輝度情報BVの取り込みが行われる。取得される輝度情報BVは、撮影時に測光値から算出され、撮影画像がExif形式で記録される際に、合わせて記録されたものである。取得した輝度情報BVはメモリに保持される。   On the other hand, in step S72 which is a luminance information acquisition step, the Exif information added to the acquired first image is read and the luminance information BV is captured. The acquired luminance information BV is calculated from the photometric value at the time of photographing, and is recorded together when the photographed image is recorded in the Exif format. The acquired luminance information BV is held in the memory.

その後、第1の画像の画像データは、一方で複数の分割領域からなる分割画像、即ち第2の画像(縮小リニア画像)として取得される(ステップS73)。第2の画像が第1の画像のサイズを縮小した画像となるのは第1の実施形態の場合と同様である。ステップS71及びステップS73は、本発明の画像取得工程に対応する。   Thereafter, the image data of the first image is acquired as a divided image composed of a plurality of divided regions, that is, a second image (reduced linear image) (step S73). The second image is an image obtained by reducing the size of the first image, as in the case of the first embodiment. Steps S71 and S73 correspond to the image acquisition process of the present invention.

次いで、シーン判別処理工程であるステップS74では、取得された第2の画像の画像データに基づいて、撮影シーンを判別するシーン判別処理が行われる。ステップS74におけるシーン判別処理については、後に図28を参照して、第1の実施形態の場合と異なる点を説明する。   Next, in step S74, which is a scene determination processing step, a scene determination process for determining a shooting scene is performed based on the acquired image data of the second image. Regarding the scene determination processing in step S74, differences from the case of the first embodiment will be described later with reference to FIG.

次いで、階調処理条件設定工程であるステップS75では、第1の実施形態の場合と同様に、ステップS74のシーン判別処理で得られた各指標及び撮影シーンの判別結果に基づいて、第1の画像の階調変換処理のために必要な条件を設定する階調処理条件設定処理が行われる。   Next, in step S75, which is a gradation processing condition setting step, as in the case of the first embodiment, based on each index obtained in the scene determination process in step S74 and the shooting scene determination result, the first A gradation processing condition setting process for setting conditions necessary for the gradation conversion process of the image is performed.

第1の階調変換処理工程であるステップS76では、第2の画像に基づいて設定された階調処理条件(明るさ補正量)に基づいて、撮影画像である第1の画像の画像データに対する階調変換処理が行われる。ステップS76の階調変換処理は、シーン輝度のどこを中心に写真階調を再現するか、或いは撮影シーンの光源条件などによる階調への影響を補正するものであり、ステップS74でのシーン判別結果によりステップS75で設定された階調処理条件(明るさ補正量)に基づいて行われるものである。   In step S76, which is the first gradation conversion processing step, the image data of the first image that is the photographed image is processed based on the gradation processing condition (brightness correction amount) set based on the second image. A gradation conversion process is performed. The gradation conversion process in step S76 is to correct the influence on the gradation due to where the photographic gradation is reproduced centered on the scene brightness or the light source condition of the shooting scene, and the scene discrimination in step S74. The result is based on the gradation processing condition (brightness correction amount) set in step S75.

第2の階調変換処理工程であるステップS77では、第2の画像に基づいて設定された階調処理条件(フレア補正量)に基づいて、ステップS76で階調変換処理が行われた第1の画像の画像データに対するフレア補正処理が行われる。ステップS77のフレア補正処理は、逆光シーンのシャドー部における潜在的なオフセット領域を補正してフレア画像を防ぐものであり、ステップS74でのシーン判別結果によりステップS75で設定された階調処理条件(フレア補正量)に基づいて行われるものである。   In step S77, which is the second gradation conversion process step, the first gradation conversion process is performed in step S76 based on the gradation processing condition (flare correction amount) set based on the second image. The flare correction process is performed on the image data of the first image. The flare correction process in step S77 corrects a potential offset area in the shadow portion of the backlight scene to prevent a flare image. The gradation processing condition (set in step S75 based on the scene discrimination result in step S74) ( (Flare correction amount).

第3の階調変換処理工程であるステップS78では、AWB処理、階調変換処理後の第1の画像(リニア画像)に対しガンマ変換処理を施すことによって、当該リニア画像がノンリニア画像に変換される。   In step S78, which is the third gradation conversion processing step, the linear image is converted into a non-linear image by performing gamma conversion processing on the first image (linear image) after the AWB processing and gradation conversion processing. The

なお本実施形態では、ステップS75で階調処理条件を設定し、ステップS76で階調変換処理を行う形態としているが、撮影シーンに基づいて上記階調処理以外に他の画像特性、例えば色調整の最適化処理などを行うようにしてもよい。   In the present embodiment, gradation processing conditions are set in step S75, and gradation conversion processing is performed in step S76. However, other image characteristics such as color adjustment other than the above gradation processing based on the shooting scene are used. The optimization process may be performed.

次いで、ガンマ変換処理後の画像データに対し、その他の画像処理(ノイズ処理、シャープネス処理、コントラスト補正処理、覆い焼き処理等)が適宜行われる(ステップS79)。その後、画像データは、各出力処理部76〜79で処理され、出力される。或いは、保存用の記録媒体(SDメモリカード又はマルチメディアカード(MMC)等)に記録される(ステップS80)。出力又は記録が終わると、画像処理装置2における動作は終了する。   Next, other image processing (noise processing, sharpness processing, contrast correction processing, dodging processing, etc.) is appropriately performed on the image data after the gamma conversion processing (step S79). Thereafter, the image data is processed and output by the output processing units 76 to 79. Alternatively, it is recorded on a storage medium for storage (such as an SD memory card or a multimedia card (MMC)) (step S80). When the output or recording ends, the operation in the image processing apparatus 2 ends.

なお、階調変換処理後のリニア画像をRawデータとして保存し、現像ソフトウェアを用いてノンリニア画像に変換するようにしてもよい。   Note that the linear image after gradation conversion processing may be stored as Raw data and converted to a non-linear image using development software.

(シーン判別処理2のフロー)
次に、図28のフローチャートを参照して、画像処理装置2におけるシーン判別処理2(図42のステップS74)について説明する。以下では、第1の実施形態(撮像装置1)と異なる点を説明し、同一内容の部分は適宜省略する。
(Flow of scene discrimination process 2)
Next, the scene determination process 2 (step S74 in FIG. 42) in the image processing apparatus 2 will be described with reference to the flowchart in FIG. Below, a different point from 1st Embodiment (imaging device 1) is demonstrated, and the part of the same content is abbreviate | omitted suitably.

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

まず、図28のステップS20において、色空間変換処理が行われる。処理内容は第1の実施形態の場合と同様であるため、ここでの説明は省略する。   First, in step S20 of FIG. 28, color space conversion processing is performed. Since the processing contents are the same as in the case of the first embodiment, a description thereof is omitted here.

<占有率算出処理2>
次に、図29のフローチャートを参照して、ステップS21の占有率算出処理について説明する。
<Occupancy rate calculation process 2>
Next, the occupation rate calculation process in step S21 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).

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

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

ステップS31の2次元ヒストグラム作成も第1の実施形態の場合と同様である。   The two-dimensional histogram creation in step S31 is the same as in the first embodiment.

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

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

明度領域vi、色相領域Hjの組み合わせからなる階級において算出された第1の占有率をRijとすると、各階級における第1の占有率は表7のように表される。   If 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 7.

Figure 2007293686
Figure 2007293686

ステップS33が、ステップS31とともに、第2の占有率算出工程に対応し、第2の占有率が算出されるのも第1の実施形態の場合と同様である。   Step S33 corresponds to the second occupancy ratio calculation step together with step S31, and the second occupancy ratio is calculated as in the case of the first embodiment.

明度領域vi、画面領域njの組み合わせからなる各階級において算出された第2の占有率をQijとすると、各階級における第2の占有率は表8のように表される。   If 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 8.

Figure 2007293686
Figure 2007293686

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

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

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

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

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

Figure 2007293686
Figure 2007293686

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

明度領域vi、色相領域Hjにおける第1の係数をCijとすると、指標1を算出するためのHk領域の和は、式(6)のように定義される。

Figure 2007293686
When the first coefficient in the lightness region vi and the hue region Hj is Cij, the sum of the Hk regions for calculating the index 1 is defined as in Expression (6).
Figure 2007293686

従って、H1〜H4領域の和は、下記の式(6−5)〜(6−8)のように表される。
H1領域の和
=R11×(−44)+R21×(−16)+(中略)…+R71×(−11.3) …(6−5)
H2領域の和=R12×0+R22×8.6+(中略)…+R72×(−11.1) …(6−6)
H3領域の和
=R13×0+R23×(−6.3)+(中略)…+R73×(−10) …(6−7)
H4領域の和
=R14×0+R24×(−1.8)+(中略)…+R74×(−14.6) …(6−8)
Accordingly, the sum of the H1 to H4 regions is represented by the following formulas (6-5) to (6-8).
H1 region sum = R11 × (−44) + R21 × (−16) + (omitted)… + R71 × (−11.3) (6-5)
Sum of H2 regions = R12 × 0 + R22 × 8.6 + (omitted)… + R72 × (−11.1) (6-6)
Sum of H3 regions = R13 × 0 + R23 × (−6.3) + (omitted)… + R73 × (−10) (6-7)
Sum of H4 region = R14 × 0 + R24 × (−1.8) + (omitted)… + R74 × (−14.6) (6-8)

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

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

Figure 2007293686
Figure 2007293686

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

明度領域vi、色相領域Hjにおける第2の係数をDijとすると、指標2を算出するためのHk領域の和は、式(8)のように定義される。

Figure 2007293686
When the second coefficient in the lightness region vi and the hue region Hj is Dij, the sum of the Hk regions for calculating the index 2 is defined as in Expression (8).
Figure 2007293686

従って、H1〜H4領域の和は、下記の式(8−5)〜(8−8)のように表される。
H1領域の和
=R11×(−27)+R21×4.5+(中略)…+R71×(−24) …(8−5)
H2領域の和=R12×0+R22×4.7+(中略)…+R72×(−8.5) …(8−6)
H3領域の和=R13×0+R23×0+(中略)…+R73×0 …(8−7)
H4領域の和=R14×0+R24×(−5.1)+(中略)…+R74×7.2 …(8−8)
Accordingly, the sum of the H1 to H4 regions is represented by the following formulas (8-5) to (8-8).
Sum of H1 region = R11 × (−27) + R21 × 4.5 + (omitted)… + R71 × (−24) (8-5)
Sum of H2 regions = R12 × 0 + R22 × 4.7 + (omitted)… + R72 × (−8.5) (8-6)
Sum of H3 regions = R13 × 0 + R23 × 0 + (omitted) ... + R73 × 0 (8-7)
Sum of H4 region = R14 × 0 + R24 × (−5.1) + (omitted)… + R74 × 7.2 (8-8)

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

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

指標1及び指標2が算出されると、第3の指標算出工程であるステップS42で、第2の占有率に、予め設定された第3の係数を乗算して和をとることにより、指標3が算出される。指標3は、主要被写体がアンダーな逆光と主要被写体がオーバーな画像間における、画像データの画面の中心と外側の明暗関係の差異を示すものである。   When the index 1 and the index 2 are calculated, the index 3 is obtained by multiplying the second occupancy by a preset third coefficient in step S42, which is a third index calculating step, to obtain a sum. Is calculated. The index 3 indicates a difference in contrast between the center and the outside of the screen of the image data between the backlight with the main subject under and the image with the main subject over.

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

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

Figure 2007293686
Figure 2007293686

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

明度領域vi、画面領域njにおける第3の係数をEijとすると、指標3を算出するためのnk領域(画面領域nk)の和は、式(10)のように定義される。

Figure 2007293686
If the third coefficient in the brightness area vi and the screen area nj is Eij, the sum of the nk area (screen area nk) for calculating the index 3 is defined as in Expression (10).
Figure 2007293686

従って、n1〜n4領域の和は、下記の式(10−5)〜(10−8)のように表される。
n1領域の和=Q11×40.1+Q21×37+(中略)…+Q71×22 …(10−5)
n2領域の和
=Q12×(−14.8)+Q22×(−10.5)+(中略)…+Q72×0 …(10−6)
n3領域の和=Q13×24.6+Q23×12.1+(中略)…+Q73×10.1 …(10−7)
n4領域の和
=Q14×1.5+Q24×(−32.9)+(中略)…+Q74×(−52.2) …(10−8)
Accordingly, the sum of the n1 to n4 regions is represented by the following formulas (10-5) to (10-8).
Sum of n1 region = Q11 × 40.1 + Q21 × 37 + (omitted)… + Q71 × 22 (10−5)
Sum of n2 regions = Q12 × (−14.8) + Q22 × (−10.5) + (omitted)… + Q72 × 0 (10−6)
Sum of n3 regions = Q13 × 24.6 + Q23 × 12.1 + (omitted)… + Q73 × 10.1 (10−7)
Sum of n4 regions = Q14 × 1.5 + Q24 × (−32.9) + (omitted)… + Q74 × (−52.2) (10−8)

指標3は、式(10−5)〜(10−8)で示されたn1〜n4領域の和を用いて、式(23)のように定義される。
指標3
=n1領域の和+n2領域の和+n3領域の和+n4領域の和+12.6201 …(23)
The index 3 is defined as in Expression (23) using the sum of the n1 to n4 regions shown in Expressions (10-5) to (10-8).
Indicator 3
= Sum of n1 region + sum of n2 region + sum of n3 region + sum of n4 region + 12.6201 (23)

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

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

以下、図36のフローチャートを参照して、露出撮影度指標の算出処理について説明する。   Hereinafter, with reference to the flowchart of FIG. 36, the processing for calculating the exposure shooting degree index will be described.

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

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

露出撮影度指標=0.06×x1+1.13×x2+0.02×x3+(−0.01)×x4+0.03×x5−6.50 …(12−3)
この露出撮影度指標は、第2の画像の画面の構図的な特徴だけでなく、輝度ヒストグラム分布情報を持ち合わせており、特に、主要被写体がオーバーである撮影シーンとアンダー撮影シーンの判別に有効である。
Exposure shooting index = 0.06 × x1 + 1.13 × x2 + 0.02 × x3 + (− 0.01) × x4 + 0.03 × x5-6.50 (12-3)
This exposure shooting index includes not only the compositional characteristics of the screen of the second image but also the luminance histogram distribution information, and is particularly effective for distinguishing between a shooting scene in which the main subject is over and an under shooting scene. is there.

露出撮影度指標が算出されると、第5の指標算出工程であるステップS44において、指標1、指標3、輝度情報BV、及び第2の画像の画面中央部における肌色領域の平均輝度値に、撮影条件に応じて予め設定された重み係数(第5の係数)を乗算することにより、自然光指標が算出される。   When the exposure shooting degree index is calculated, in step S44 which is a fifth index calculation step, the index 1, the index 3, the luminance information BV, and the average luminance value of the skin color region in the center of the screen of the second image, A natural light index is calculated by multiplying a weighting coefficient (fifth coefficient) set in advance according to the photographing condition.

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

以下、自然光指標及び輝度比指標の算出方法について説明する。   Hereinafter, a method for calculating the natural light index and the luminance ratio index will be described.

第2の画像の画面中央部における肌色領域の平均輝度値を指標7とする。ここでの画面中央部とは、例えば、図43の領域n2、領域n3及び領域n4から構成される領域である。このとき、自然光指標は、指標1、指標3、指標7、及び輝度情報BVを用いて式(24)のように定義され、輝度比指標は、指標2、指標3、指標7、及び輝度情報BVを用いて式(25)のように定義される。
自然光指標
=0.18×指標1+0.19×指標3+0.004×指標7−0.68×BV+4.39 …(24)
輝度比指標
=0.24×指標2+0.16×指標3+0.034×指標7−0.05×BV+4.61 …(25)
ここで式(24)及び式(25)において各指標に乗算される係数は、撮影条件に応じて予め設定されている。
The average luminance value of the skin color area at the center of the screen of the second image is taken as index 7. Here, the center of the screen is, for example, an area composed of the area n2, the area n3, and the area n4 in FIG. At this time, the natural light index is defined as Expression (24) using the index 1, the index 3, the index 7, and the luminance information BV, and the luminance ratio index is the index 2, the index 3, the index 7, and the luminance information. It is defined as in equation (25) using BV.
Natural light index = 0.18 × index 1 + 0.19 × index 3 + 0.004 × index 7−0.68 × BV + 4.39 (24)
Luminance ratio index = 0.24 × index2 + 0.16 × index 3 + 0.034 × index 7−0.05 × BV + 4.61 (25)
Here, the coefficients to be multiplied by the respective indices in the expressions (24) and (25) are set in advance according to the photographing conditions.

また輝度情報BVに基づいて、自然光指標、輝度比指標を算出する代わりに、指標1、指標2、指標3を算出するのに輝度情報BVを用いてもよい。その場合、自然光指標、輝度比指標を算出するのに輝度情報BVを用いる必要はない。
<シーン判別2>
図28のステップS23(シーン判別)に戻る。
Further, instead of calculating the natural light index and the luminance ratio index based on the luminance information BV, the luminance information BV may be used to calculate the index 1, the index 2, and the index 3. In that case, it is not necessary to use the luminance information BV to calculate the natural light index and the luminance ratio index.
<Scene discrimination 2>
Returning to step S23 (scene discrimination) in FIG.

露出撮影度指標、自然光指標、輝度比指標が算出されると、これらの指標の値に基づいて撮影シーンが判別されるが、シーン判別方法は第1の実施形態の場合と同様であるため、ここでの説明は省略する。   When the exposure shooting degree index, the natural light index, and the luminance ratio index are calculated, the shooting scene is determined based on the values of these indexes, but the scene determination method is the same as in the first embodiment. The description here is omitted.

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

以上のように、第2の実施形態の画像処理装置2によれば、上述の第1の実施形態と同様に、主要被写体(例えば、人物顔領域)の明るさを最適化することが可能となる。   As described above, according to the image processing apparatus 2 of the second embodiment, it is possible to optimize the brightness of the main subject (for example, a human face area) as in the first embodiment. Become.

なお、上記各実施形態における記述内容は、本発明の趣旨を逸脱しない範囲で適宜変更可能である。   In addition, the description content in each said embodiment can be suitably changed in the range which does not deviate from the meaning of this invention.

本発明の実施形態に係る撮像装置の外観構成例を示す図である。It is a figure showing an example of appearance composition of an imaging device concerning an embodiment of the present invention. 撮像装置の内部構成を示すブロック図である。It is a block diagram which shows the internal structure of an imaging device. 撮影処理部の内部構成を示すブロック図である。It is a block diagram which shows the internal structure of an imaging | photography process part. AE制御部での露光量制御を示すフローチャートである。It is a flowchart which shows exposure amount control in an AE control part. シャッタ速度の制御において撮像素子に電荷が蓄積する様子を示す図である。It is a figure which shows a mode that an electric charge accumulate | stores in an image pick-up element in control of shutter speed. AF制御部での画像の焦点を合わせる制御を示すフローチャートである。It is a flowchart which shows the control which adjusts the focus of the image in AF control part. 撮影光学系の移動に伴うコントラスト情報の変化と合焦点位置検出の様子を示す図である。It is a figure which shows the change of the contrast information accompanying the movement of an imaging optical system, and the mode of a focal point position detection. 画素補間部での、RGB各色成分ごとに画素間の補間を行う画像データの処理を示すフローチャートである。It is a flowchart which shows the process of the image data which performs the interpolation between pixels for every RGB color component in a pixel interpolation part. AWB制御部での、撮影画像におけるホワイトバランスを自動的に調整する処理を示すフローチャートである。It is a flowchart which shows the process which automatically adjusts the white balance in a picked-up image in an AWB control part. ガンマ補正曲線の一例を示す図である。It is a figure which shows an example of a gamma correction curve. 画像処理部の内部構成を示すブロック図である。It is a block diagram which shows the internal structure of an image process part. 撮影された第1の画像の一例を示す図(a)と、第1の画像を分割し、M×N画素の縮小画像とした第2の画像の一例を示す図(b)である。FIG. 4A is a diagram illustrating an example of a captured first image, and FIG. 4B is a diagram illustrating an example of a second image obtained by dividing the first image into a reduced image of M × N pixels. 階調処理条件設定部の内部構成を示すブロック図である。It is a block diagram which shows the internal structure of a gradation process condition setting part. 輝度比指標と仮補正量key_auto[0]との関係を示すLUTである。It is an LUT showing the relationship between the luminance ratio index and the provisional correction amount key_auto [0]. 露出撮影度指標と仮補正量key_auto[1]との関係を示すLUTである。It is a LUT showing the relationship between the exposure shooting index and the temporary correction amount key_auto [1]. 肌色平均輝度と仮補正量key_auto[2]との関係を示すLUTである。It is an LUT showing the relationship between the flesh color average luminance and the provisional correction amount key_auto [2]. 肌色平均輝度又は全体平均輝度と仮補正量key_auto[3]との関係を示すLUTである。It is an LUT indicating the relationship between the skin color average luminance or the overall average luminance and the temporary correction amount key_auto [3]. 輝度比指標と仮補正量key_auto[4]との関係を示すLUTである。It is a LUT showing the relationship between the luminance ratio index and the provisional correction amount key_auto [4]. 露出撮影度指標と仮補正量key_auto[5]との関係を示すLUTである。It is an LUT showing the relationship between the exposure shooting index and the temporary correction amount key_auto [5]. 自然光指標と混合係数wgt[0]との関係を示すLUTである。It is a LUT showing the relationship between the natural light index and the mixing coefficient wgt [0]. 自然光指標と混合係数wgt[1]との関係を示すLUTである。It is a LUT showing the relationship between the natural light index and the mixing coefficient wgt [1]. 自然光指標と混合係数wgt[2]との関係を示すLUTである。It is a LUT showing the relationship between the natural light index and the mixing coefficient wgt [2]. 自然光指標と混合係数wgt[3]との関係を示すLUTである。It is a LUT showing the relationship between the natural light index and the mixing coefficient wgt [3]. 自然光指標、輝度比指標、露出撮影度指標から撮影シーンを判別するための判別マップを示す図である。It is a figure which shows the discrimination | determination map for discriminating a photography scene from a natural light parameter | index, a luminance ratio parameter | index, and an exposure photography degree parameter | index. 撮影シーン別に混合係数wgt[4]〜[6]の値を表す係数算出テーブルを示す図である。It is a figure which shows the coefficient calculation table showing the value of mixing coefficient wgt [4]-[6] for every imaging | photography scene. (a)は、シーン判別マップに対応する遷移係数w及び重み係数fwの一例を示す図である。(b)は、重み係数fwの別の一例を示す図である。(A) is a figure which shows an example of the transition coefficient w and the weighting coefficient fw corresponding to a scene discrimination | determination map. (B) is a figure which shows another example of the weighting coefficient fw. 撮像装置1において実行される処理の全体の流れを示すフローチャートである。3 is a flowchart showing an overall flow of processing executed in the imaging apparatus 1. 画像処理部において実行されるシーン判別処理を示すフローチャートである。It is a flowchart which shows the scene discrimination | determination process performed in an image process part. 占有率算出処理を示すフローチャートである。It is a flowchart which shows an occupation rate calculation process. 明度と色相からなる階級を示す図である。It is a figure which shows the class which consists of brightness and hue. 画面の外縁からの距離に応じて決定される領域n1〜n3を示す図(a)と、領域n1〜n3と明度からなる階級を示す図(b)である。It is the figure (a) which shows the area | regions n1-n3 determined according to the distance from the outer edge of a screen, and the figure (b) which shows the class which consists of the area | regions n1-n3 and brightness. 指標算出処理を示すフローチャートである。It is a flowchart which shows an index calculation process. 指標1を算出するための、第1の占有率に乗算する第1の係数を表す曲線を示す図である。It is a figure which shows the curve showing the 1st coefficient by which the 1st occupation rate for calculating the parameter | index 1 is multiplied. 指標2を算出するための、第1の占有率に乗算する第2の係数を表す曲線を示す図である。It is a figure which shows the curve showing the 2nd coefficient by which the 1st occupation rate for calculating the parameter | index 2 is multiplied. 指標3を算出するための、第2の占有率に乗算する第3の係数を表す曲線を領域別(n1〜n3)に示す図である。It is a figure which shows the curve showing the 3rd coefficient by which the 2nd occupation rate for calculating the parameter | index 3 is multiplied for every area | region (n1-n3). 露出撮影度指標算出処理を示すフローチャートである。It is a flowchart which shows exposure photography degree parameter | index calculation processing. 階調処理条件設定部において実行される階調処理条件設定処理を示すフローチャートである。It is a flowchart which shows the gradation process condition setting process performed in a gradation process condition setting part. 撮影シーンが順光である場合の明るさ補正の階調変換曲線(a)と、撮影シーンが逆光である場合の明るさ補正の階調変換曲線(b)を示す図である。It is a figure which shows the gradation conversion curve (a) of the brightness correction | amendment when a picked-up scene is a follow light, and the gradation conversion curve (b) of the brightness correction | amendment when a picked-up scene is a backlight. フレア補正の階調変換曲線を示す図である。It is a figure which shows the gradation conversion curve of flare correction. 本発明の第2の実施形態に係る画像処理装置の外観構成例を示す図である。It is a figure which shows the example of an external appearance structure of the image processing apparatus which concerns on the 2nd Embodiment of this invention. 画像処理装置の内部構成を示すブロック図である。It is a block diagram which shows the internal structure of an image processing apparatus. 画像処理装置において実行される処理の全体の流れを示すフローチャートである。It is a flowchart which shows the flow of the whole process performed in an image processing apparatus. 画面の外縁からの距離に応じて決定される領域n1〜n4を示す図である。It is a figure which shows the area | regions n1-n4 determined according to the distance from the outer edge of a screen. 指標1を算出するための、第1の占有率に乗算する第1の係数を表す曲線を示す図である。It is a figure which shows the curve showing the 1st coefficient by which the 1st occupation rate for calculating the parameter | index 1 is multiplied. 指標2を算出するための、第1の占有率に乗算する第2の係数を表す曲線を示す図である。It is a figure which shows the curve showing the 2nd coefficient by which the 1st occupation rate for calculating the parameter | index 2 is multiplied. 指標3を算出するための、第2の占有率に乗算する第3の係数を表す曲線を領域別(n1〜n4)に示す図である。It is a figure which shows the curve showing the 3rd coefficient by which the 2nd occupation rate for calculating the parameter | index 3 is multiplied for every area | region (n1-n4).

符号の説明Explanation of symbols

1 撮像装置
2 画像処理装置
10 画像処理部
11 筐体
13 装填部
14 画像読み込み部
15 画像書き込み部
16 プリント作成部
17 トレー
20 撮影処理部
21 筐体
22 十字キー
23 撮影光学系
24 フラッシュ
25 ファインダ
26 電源スイッチ
27 表示部
28 レリーズボタン
31 プロセッサ
32 メモリ
33 撮像素子
37 画像データ出力部
38 操作部
41 タイミングジェネレータ
42 シャッタユニット
43 絞りユニット
44 フォーカスユニット
51 AE制御部
52 AF制御部
53 画素補間部
54 AWB制御部
55 ガンマ補正部
71 操作部
72 制御部
73 フィルムスキャンデータ処理部
74 反射原稿スキャンデータ処理部
75 画像データ書式解読処理部
76 CRT固有処理部
77 プリンタ固有処理部A
78 プリンタ固有処理部B
79 画像データ書式作成処理部
81 フィルムスキャナ部
82 反射原稿入力装置
83 画像転送手段
84 通信手段(入力)
85 CRT
86 露光処理部
87 外部プリンタ
88 画像搬送部
89 通信手段(出力)
101 第1画像取得部
102 第2画像取得部
103 占有率算出部
104 指標算出部
105 シーン判別部
107 階調処理条件設定部
107A 明るさ補正条件設定部
108 階調変換処理部
201 第1仮補正量設定部
202 第1混合係数設定部
203 第2仮補正量演算部
204 第2混合係数設定部
205 明るさ補正量演算部
107B フレア補正条件設定部
206 遷移係数設定部
207 重み係数設定部
208 フレア補正量演算部
DESCRIPTION OF SYMBOLS 1 Imaging device 2 Image processing apparatus 10 Image processing part 11 Housing | casing 13 Loading part 14 Image reading part 15 Image writing part 16 Print preparation part 17 Tray 20 Shooting process part 21 Case 22 Cross key 23 Shooting optical system 24 Flash 25 Finder 26 Power switch 27 Display unit 28 Release button 31 Processor 32 Memory 33 Image sensor 37 Image data output unit 38 Operation unit 41 Timing generator 42 Shutter unit 43 Aperture unit 44 Focus unit 51 AE control unit 52 AF control unit 53 Pixel interpolation unit 54 AWB control 55 Gamma correction unit 71 Operation unit 72 Control unit 73 Film scan data processing unit 74 Reflected original scan data processing unit 75 Image data format decoding processing unit 76 CRT specific processing unit 77 Printer specific processing unit A
78 Printer Specific Processing Unit B
79 Image data format creation processing section 81 Film scanner section 82 Reflected document input device 83 Image transfer means 84 Communication means (input)
85 CRT
86 Exposure processing unit 87 External printer 88 Image transport unit 89 Communication means (output)
101 First image acquisition unit 102 Second image acquisition unit 103 Occupancy rate calculation unit 104 Index calculation unit 105 Scene determination unit 107 Tone processing condition setting unit 107A Brightness correction condition setting unit 108 Tone conversion processing unit 201 First temporary correction Amount setting unit 202 first mixing coefficient setting unit 203 second temporary correction amount calculating unit 204 second mixing coefficient setting unit 205 brightness correction amount calculating unit 107B flare correction condition setting unit 206 transition coefficient setting unit 207 weight coefficient setting unit 208 flare Correction amount calculator

Claims (24)

被写体を撮影する撮影手段と、
前記撮影手段による撮影によって形成されたリニア画像を取得する画像取得手段と、
前記リニア画像に基づいて撮影シーンの判別処理を行うシーン判別処理手段と、
前記シーン判別処理手段による判別結果に基づいて、前記リニア画像の明るさを調整するための第1の階調処理条件と、硬さを調整するための第2の階調処理条件とを設定する階調処理条件設定手段と、
前記階調処理条件設定手段により設定された第1の階調処理条件に基づいて、前記リニア画像に対する第1の階調変換処理を行う第1の階調変換処理手段と、
前記階調処理条件設定手段により設定された第2の階調処理条件に基づいて、前記第1の階調変換処理が適用されたリニア画像に対する第2の階調変換処理を行う第2の階調変換処理手段と、
前記第2の階調変換処理が適用されたリニア画像をノンリニア画像に変換する第3の階調変換処理を行う第3の階調変換処理手段と、
を備えることを特徴とする撮像装置。
Photographing means for photographing the subject;
Image obtaining means for obtaining a linear image formed by photographing by the photographing means;
Scene discrimination processing means for performing a discrimination process of a photographic scene based on the linear image;
Based on the determination result by the scene determination processing means, a first gradation processing condition for adjusting the brightness of the linear image and a second gradation processing condition for adjusting the hardness are set. Gradation processing condition setting means;
First gradation conversion processing means for performing a first gradation conversion process on the linear image based on a first gradation processing condition set by the gradation processing condition setting means;
Based on the second gradation processing condition set by the gradation processing condition setting means, a second floor that performs a second gradation conversion process on the linear image to which the first gradation conversion process is applied. Key conversion processing means;
Third gradation conversion processing means for performing third gradation conversion processing for converting a linear image to which the second gradation conversion processing is applied into a non-linear image;
An imaging apparatus comprising:
前記画像取得手段は、
前記リニア画像から、画像サイズを縮小したリニア画像を取得し、
前記シーン判別処理手段は、
前記画像サイズを縮小したリニア画像を用いて撮影シーンの判別処理を行うことを特徴とする請求項1に記載の撮像装置。
The image acquisition means includes
From the linear image, obtain a linear image reduced in image size,
The scene discrimination processing means includes
The imaging apparatus according to claim 1, wherein a shooting scene discrimination process is performed using a linear image with a reduced image size.
前記リニア画像の撮影時に算出される輝度情報を取得する輝度情報取得手段を備え、
前記シーン判別処理手段は、
前記輝度情報取得手段により取得された輝度情報に基づいて撮影シーンの判別処理を行い、
前記階調処理条件設定手段は、
前記輝度情報取得手段により取得された輝度情報に基づいて第1及び第2の階調処理条件を設定することを特徴とする請求項1又は2に記載の撮像装置。
Luminance information acquisition means for acquiring luminance information calculated at the time of photographing the linear image,
The scene discrimination processing means includes
Based on the luminance information acquired by the luminance information acquisition means, to determine the shooting scene,
The gradation processing condition setting means includes:
The imaging apparatus according to claim 1, wherein the first and second gradation processing conditions are set based on the luminance information acquired by the luminance information acquisition unit.
前記シーン判別処理手段は、
前記リニア画像の自然光による屋外撮影度を表す自然光指標と、ダイナミックレンジの大きさを表す輝度比指標と、撮影時の露出設定に起因する露出撮影度指標とを算出し、
前記算出された各指標に基づいて撮影シーンを判別することを特徴とする請求項1〜3の何れか一項に記載の撮像装置。
The scene discrimination processing means includes
Calculating a natural light index representing the degree of outdoor photographing with natural light of the linear image, a luminance ratio index representing the size of the dynamic range, and an exposure photographing degree index resulting from the exposure setting at the time of photographing;
The imaging apparatus according to claim 1, wherein a shooting scene is determined based on each of the calculated indexes.
前記シーン判別処理手段は、
前記リニア画像について色情報を取得し、当該取得された色情報に基づいて、前記リニア画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、
前記第1の占有率に、撮影条件に応じて予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、
前記第1の占有率に、撮影条件に応じて予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、
前記第2の占有率に、撮影条件に応じて予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、撮影条件に応じて予め設定された第4の係数を乗算することにより、前記露出撮影度を算出する第4の指標算出手段と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第5の係数を乗算することにより、前記自然光指標を算出する第5の指標算出手段と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第6の係数を乗算することにより、前記輝度比指標を算出する第6の指標算出手段と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記画像データの撮影シーンを判別するシーン判別手段と、
を備えることを特徴とする請求項4に記載の撮像装置。
The scene discrimination processing means includes
Color information is acquired for the linear image, and based on the acquired color information, the image data of the linear image is classified into a class composed of a combination of predetermined brightness and hue, and for each of the classified classes, First occupancy ratio calculating means for calculating a first occupancy ratio indicating a ratio of the entire image data;
Based on the acquired color information, the image data is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the proportion of the entire image data for each classified class Second occupancy rate calculating means for calculating the occupancy rate of
A first index calculating means for calculating index 1 by multiplying the first occupancy by a first coefficient set in advance according to the photographing condition;
A second index calculating means for calculating index 2 by multiplying the first occupancy by a second coefficient set in advance according to the shooting conditions;
A third index calculating means for calculating the index 3 by multiplying the second occupancy by a third coefficient set in advance according to the shooting conditions;
A fourth index calculating means for calculating the exposure photographing degree by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a fourth coefficient set in advance according to photographing conditions;
The natural light index is calculated by multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a fifth coefficient that is set in advance according to shooting conditions. A fifth index calculating means for
By multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a sixth coefficient that is set in advance according to shooting conditions, the luminance ratio index is obtained. Sixth index calculating means for calculating;
Scene discriminating means for discriminating a shooting scene of the image data based on the exposure shooting degree, the natural light index and the luminance ratio index;
The imaging apparatus according to claim 4, further comprising:
前記階調処理条件設定手段は、
前記リニア画像の明るさ解析値と、明るさの再現目標値と、前記輝度比指標及び前記露出撮影度に基づいて、当該リニア画像に対する複数の第1仮補正量を設定する第1仮補正量設定手段と、
前記自然光指標に基づいて、前記複数の第1仮補正量の各々に乗算する重み係数としての第1混合係数を設定する第1混合係数設定手段と、
前記第1混合係数設定手段により設定された第1混合係数と、前記複数の第1仮補正量に基づいて、前記リニア画像に対する第2仮補正量を設定する第2仮補正量設定手段と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記複数の第1仮補正量のうち少なくとも1つと、前記第2仮補正量に乗算する重み係数としての第2混合係数を設定する第2混合係数設定手段と、
前記第2混合係数により設定された第2混合係数と、前記少なくとも1つの第1仮補正量と、前記第2仮補正量に基づいて、階調調整パラメータを算出する階調調整パラメータ算出手段と、を備え、
前記シーン判別処理手段による判別結果と、前記階調調整パラメータ算出手段により算出された階調調整パラメータとに基づいて、前記リニア画像に対する第1の階調処理条件を設定することを特徴とする請求項4又は5に記載の撮像装置。
The gradation processing condition setting means includes:
A first temporary correction amount for setting a plurality of first temporary correction amounts for the linear image based on a brightness analysis value of the linear image, a brightness reproduction target value, the luminance ratio index, and the exposure photographing degree. Setting means;
First mixing coefficient setting means for setting a first mixing coefficient as a weighting coefficient for multiplying each of the plurality of first temporary correction amounts based on the natural light index;
Second temporary correction amount setting means for setting a second temporary correction amount for the linear image based on the first mixing coefficient set by the first mixing coefficient setting means and the plurality of first temporary correction amounts;
Based on the exposure photographing degree, the natural light index, and the luminance ratio index, at least one of the plurality of first temporary correction amounts and a second mixing coefficient as a weighting coefficient for multiplying the second temporary correction amount are set. Second mixing coefficient setting means for
Gradation adjustment parameter calculation means for calculating a gradation adjustment parameter based on the second mixing coefficient set by the second mixing coefficient, the at least one first temporary correction amount, and the second temporary correction amount; With
The first gradation processing condition for the linear image is set based on a determination result by the scene determination processing unit and a gradation adjustment parameter calculated by the gradation adjustment parameter calculation unit. Item 6. The imaging device according to Item 4 or 5.
撮影によって形成されたリニア画像を取得する画像取得手段と、
前記リニア画像に基づいて撮影シーンの判別処理を行うシーン判別処理手段と、
前記シーン判別処理手段による判別結果に基づいて、前記リニア画像の明るさを調整するための第1の階調処理条件と、硬さを調整するための第2の階調処理条件とを設定する階調処理条件設定手段と、
前記階調処理条件設定手段により設定された第1の階調処理条件に基づいて、前記リニア画像に対する第1の階調変換処理を行う第1の階調変換処理手段と、
前記階調処理条件設定手段により設定された第2の階調処理条件に基づいて、前記第1の階調変換処理が適用されたリニア画像に対する第2の階調変換処理を行う第2の階調変換処理手段と、
前記第2の階調変換処理が適用されたリニア画像をノンリニア画像に変換する階調変換処理を行う第3の階調変換処理手段と、
を備えることを特徴とする画像処理装置。
Image acquisition means for acquiring a linear image formed by photographing;
Scene discrimination processing means for performing a discrimination process of a photographic scene based on the linear image;
Based on the determination result by the scene determination processing means, a first gradation processing condition for adjusting the brightness of the linear image and a second gradation processing condition for adjusting the hardness are set. Gradation processing condition setting means;
First gradation conversion processing means for performing a first gradation conversion process on the linear image based on a first gradation processing condition set by the gradation processing condition setting means;
Based on the second gradation processing condition set by the gradation processing condition setting means, a second floor that performs a second gradation conversion process on the linear image to which the first gradation conversion process is applied. Key conversion processing means;
Third gradation conversion processing means for performing gradation conversion processing for converting the linear image to which the second gradation conversion processing is applied into a non-linear image;
An image processing apparatus comprising:
前記画像取得手段は、
前記リニア画像から、画像サイズを縮小したリニア画像を取得し、
前記シーン判別処理手段は、
前記画像サイズを縮小したリニア画像を用いて撮影シーンの判別処理を行うことを特徴とする請求項7に記載の画像処理装置。
The image acquisition means includes
From the linear image, obtain a linear image reduced in image size,
The scene discrimination processing means includes
The image processing apparatus according to claim 7, wherein a shooting scene determination process is performed using a linear image with the image size reduced.
前記リニア画像の撮影時に算出される輝度情報を取得する輝度情報取得手段を備え、
前記シーン判別処理手段は、
前記輝度情報取得手段により取得された輝度情報に基づいて撮影シーンの判別処理を行い、
前記階調処理条件設定手段は、
前記輝度情報取得手段により取得された輝度情報に基づいて第1及び第2の階調処理条件を設定することを特徴とする請求項7又は8に記載の画像処理装置。
Luminance information acquisition means for acquiring luminance information calculated at the time of photographing the linear image,
The scene discrimination processing means includes
Based on the luminance information acquired by the luminance information acquisition means, to determine the shooting scene,
The gradation processing condition setting means includes:
9. The image processing apparatus according to claim 7, wherein the first and second gradation processing conditions are set based on the luminance information acquired by the luminance information acquisition unit.
前記シーン判別処理手段は、
前記リニア画像の自然光による屋外撮影度を表す自然光指標と、ダイナミックレンジの大きさを表す輝度比指標と、撮影時の露出設定に起因する露出撮影度指標とを算出し、
前記算出された各指標に基づいて撮影シーンを判別することを特徴とする請求項7〜9の何れか一項に記載の画像処理装置。
The scene discrimination processing means includes
Calculating a natural light index representing the degree of outdoor photographing with natural light of the linear image, a luminance ratio index representing the size of the dynamic range, and an exposure photographing degree index resulting from the exposure setting at the time of photographing;
The image processing apparatus according to claim 7, wherein a shooting scene is determined based on each of the calculated indexes.
前記シーン判別処理手段は、
前記リニア画像について色情報を取得し、当該取得された色情報に基づいて、前記リニア画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出手段と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出手段と、
前記第1の占有率に、撮影条件に応じて予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出手段と、
前記第1の占有率に、撮影条件に応じて予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出手段と、
前記第2の占有率に、撮影条件に応じて予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出手段と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、撮影条件に応じて予め設定された第4の係数を乗算することにより、前記露出撮影度を算出する第4の指標算出手段と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第5の係数を乗算することにより、前記自然光指標を算出する第5の指標算出手段と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第6の係数を乗算することにより、前記輝度比指標を算出する第6の指標算出手段と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記画像データの撮影シーンを判別するシーン判別手段と、
を備えることを特徴とする請求項10に記載の画像処理装置。
The scene discrimination processing means includes
Color information is acquired for the linear image, and based on the acquired color information, the image data of the linear image is classified into a class composed of a combination of predetermined brightness and hue, and for each of the classified classes, First occupancy ratio calculating means for calculating a first occupancy ratio indicating a ratio of the entire image data;
Based on the acquired color information, the image data is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the proportion of the entire image data for each classified class Second occupancy rate calculating means for calculating the occupancy rate of
A first index calculating means for calculating index 1 by multiplying the first occupancy by a first coefficient set in advance according to the photographing condition;
A second index calculating means for calculating index 2 by multiplying the first occupancy by a second coefficient set in advance according to the shooting conditions;
A third index calculating means for calculating the index 3 by multiplying the second occupancy by a third coefficient set in advance according to the shooting conditions;
A fourth index calculating means for calculating the exposure photographing degree by multiplying an average brightness of the skin color at least in the center of the screen of the image data by a fourth coefficient set in advance according to photographing conditions;
The natural light index is calculated by multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a fifth coefficient that is set in advance according to shooting conditions. A fifth index calculating means for
By multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a sixth coefficient that is set in advance according to shooting conditions, the luminance ratio index is obtained. Sixth index calculating means for calculating;
Scene discriminating means for discriminating a shooting scene of the image data based on the exposure shooting degree, the natural light index and the luminance ratio index;
The image processing apparatus according to claim 10, further comprising:
前記階調処理条件設定手段は、
前記リニア画像の明るさ解析値と、明るさの再現目標値と、前記輝度比指標及び前記露出撮影度に基づいて、当該リニア画像に対する複数の第1仮補正量を設定する第1仮補正量設定手段と、
前記自然光指標に基づいて、前記複数の第1仮補正量の各々に乗算する重み係数としての第1混合係数を設定する第1混合係数設定手段と、
前記第1混合係数設定手段により設定された第1混合係数と、前記複数の第1仮補正量に基づいて、前記リニア画像に対する第2仮補正量を設定する第2仮補正量設定手段と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記複数の第1仮補正量のうち少なくとも1つと、前記第2仮補正量に乗算する重み係数としての第2混合係数を設定する第2混合係数設定手段と、
前記第2混合係数により設定された第2混合係数と、前記少なくとも1つの第1仮補正量と、前記第2仮補正量に基づいて、階調調整パラメータを算出する階調調整パラメータ算出手段と、を備え、
前記シーン判別処理手段による判別結果と、前記階調調整パラメータ算出手段により算
出された階調調整パラメータとに基づいて、前記リニア画像に対する第1の階調処理条件を設定することを特徴とする請求項10又は11に記載の画像処理装置。
The gradation processing condition setting means includes:
A first temporary correction amount for setting a plurality of first temporary correction amounts for the linear image based on a brightness analysis value of the linear image, a brightness reproduction target value, the luminance ratio index, and the exposure photographing degree. Setting means;
First mixing coefficient setting means for setting a first mixing coefficient as a weighting coefficient for multiplying each of the plurality of first temporary correction amounts based on the natural light index;
Second temporary correction amount setting means for setting a second temporary correction amount for the linear image based on the first mixing coefficient set by the first mixing coefficient setting means and the plurality of first temporary correction amounts;
Based on the exposure photographing degree, the natural light index, and the luminance ratio index, at least one of the plurality of first temporary correction amounts and a second mixing coefficient as a weighting coefficient for multiplying the second temporary correction amount are set. Second mixing coefficient setting means for
Gradation adjustment parameter calculation means for calculating a gradation adjustment parameter based on the second mixing coefficient set by the second mixing coefficient, the at least one first temporary correction amount, and the second temporary correction amount; With
The first gradation processing condition for the linear image is set based on a determination result by the scene determination processing unit and a gradation adjustment parameter calculated by the gradation adjustment parameter calculation unit. Item 12. The image processing apparatus according to Item 10 or 11.
撮影によって形成されたリニア画像を取得する画像取得工程と、
前記リニア画像に基づいて撮影シーンの判別処理を行うシーン判別処理工程と、
前記シーン判別処理工程による判別結果に基づいて、前記リニア画像の明るさを調整するための第1の階調処理条件と、硬さを調整するための第2の階調処理条件とを設定する階調処理条件設定工程と、
前記階調処理条件設定工程により設定された第1の階調処理条件に基づいて、前記リニア画像に対する第1の階調変換処理を行う第1の階調変換処理工程と、
前記階調処理条件設定工程により設定された第2の階調処理条件に基づいて、前記第1の階調変換処理が適用されたリニア画像に対する第2の階調変換処理を行う第2の階調変換処理工程と、
前記第2の階調変換処理が適用されたリニア画像をノンリニア画像に変換する第3の階調変換処理を行う第2の階調変換処理工程と、
を含むことを特徴とする画像処理方法。
An image acquisition step of acquiring a linear image formed by photographing;
A scene determination processing step for performing a determination process of a photographic scene based on the linear image;
Based on the determination result of the scene determination processing step, a first gradation processing condition for adjusting the brightness of the linear image and a second gradation processing condition for adjusting the hardness are set. A gradation processing condition setting step;
A first gradation conversion processing step for performing a first gradation conversion process on the linear image based on the first gradation processing condition set by the gradation processing condition setting step;
Based on the second gradation processing condition set in the gradation processing condition setting step, a second floor that performs a second gradation conversion process on the linear image to which the first gradation conversion process is applied. Key conversion process,
A second gradation conversion process step of performing a third gradation conversion process for converting the linear image to which the second gradation conversion process is applied into a non-linear image;
An image processing method comprising:
前記画像取得工程では、
前記リニア画像から、画像サイズを縮小したリニア画像を取得し、
前記シーン判別処理工程では、
前記画像サイズを縮小したリニア画像を用いて撮影シーンの判別処理を行うことを特徴とする請求項13に記載の画像処理方法。
In the image acquisition step,
From the linear image, obtain a linear image reduced in image size,
In the scene discrimination processing step,
14. The image processing method according to claim 13, wherein a scene determination process is performed using a linear image with a reduced image size.
前記リニア画像の撮影時に算出される輝度情報を取得する輝度情報取得工程を含み、
前記シーン判別処理工程では、
前記輝度情報取得工程により取得された輝度情報に基づいて撮影シーンの判別処理を行い、
前記階調処理条件設定工程では、
前記輝度情報取得工程により取得された輝度情報に基づいて第1及び第2の階調処理条件を設定することを特徴とする請求項13又は14に記載の画像処理方法。
Including a luminance information acquisition step of acquiring luminance information calculated at the time of capturing the linear image;
In the scene discrimination processing step,
Based on the luminance information acquired by the luminance information acquisition step, to determine the shooting scene,
In the gradation processing condition setting step,
15. The image processing method according to claim 13, wherein the first and second gradation processing conditions are set based on the luminance information acquired by the luminance information acquisition step.
前記シーン判別処理工程では、
前記リニア画像の自然光による屋外撮影度を表す自然光指標と、ダイナミックレンジの大きさを表す輝度比指標と、撮影時の露出設定に起因する露出撮影度指標とを算出し、
前記算出された各指標に基づいて撮影シーンを判別することを特徴とする請求項13〜15の何れか一項に記載の画像処理方法。
In the scene discrimination processing step,
Calculating a natural light index representing the degree of outdoor photographing with natural light of the linear image, a luminance ratio index representing the size of the dynamic range, and an exposure photographing degree index resulting from the exposure setting at the time of photographing;
The image processing method according to any one of claims 13 to 15, wherein a shooting scene is determined based on each of the calculated indexes.
前記シーン判別処理工程は、
前記リニア画像について色情報を取得し、当該取得された色情報に基づいて、前記リニア画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出する第1の占有率算出工程と、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出する第2の占有率算出工程と、
前記第1の占有率に、撮影条件に応じて予め設定された第1の係数を乗算することにより、指標1を算出する第1の指標算出工程と、
前記第1の占有率に、撮影条件に応じて予め設定された第2の係数を乗算することにより、指標2を算出する第2の指標算出工程と、
前記第2の占有率に、撮影条件に応じて予め設定された第3の係数を乗算することにより、指標3を算出する第3の指標算出工程と、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、撮影条件に応じて予め設定された第4の係数を乗算することにより、前記露出撮影度を算出する第4の指標算出工程と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第5の係数を乗算することにより、前記自然光指標を算出する第5の指標算出工程と、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第6の係数を乗算することにより、前記輝度比指標を算出する第6の指標算出工程と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記画像データの撮影シーンを判別するシーン判別工程と、
を含むことを特徴とする請求項16に記載の画像処理方法。
The scene discrimination processing step includes
Color information is acquired for the linear image, and based on the acquired color information, the image data of the linear image is classified into a class composed of a combination of predetermined brightness and hue, and for each of the classified classes, A first occupancy ratio calculating step of calculating a first occupancy ratio indicating a ratio of the entire image data;
Based on the acquired color information, the image data is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the proportion of the entire image data for each classified class A second occupancy rate calculating step for calculating the occupancy rate of
A first index calculation step of calculating index 1 by multiplying the first occupancy by a first coefficient set in advance according to the imaging condition;
A second index calculating step of calculating index 2 by multiplying the first occupancy by a second coefficient set in advance according to shooting conditions;
A third index calculating step of calculating index 3 by multiplying the second occupancy by a third coefficient set in advance according to the shooting conditions;
A fourth index calculating step of calculating the exposure shooting degree by multiplying the average brightness of the skin color at least in the center of the screen of the image data by a fourth coefficient set in advance according to shooting conditions;
The natural light index is calculated by multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a fifth coefficient that is set in advance according to shooting conditions. And a fifth index calculating step
By multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a sixth coefficient that is set in advance according to shooting conditions, the luminance ratio index is obtained. A sixth index calculating step for calculating;
A scene determination step of determining a shooting scene of the image data based on the exposure shooting degree, the natural light index, and the luminance ratio index;
The image processing method according to claim 16, further comprising:
前記階調処理条件設定工程は、
前記リニア画像の明るさ解析値と、明るさの再現目標値と、前記輝度比指標及び前記露出撮影度に基づいて、当該リニア画像に対する複数の第1仮補正量を設定する第1仮補正量設定工程と、
前記自然光指標に基づいて、前記複数の第1仮補正量の各々に乗算する重み係数としての第1混合係数を設定する第1混合係数設定工程と、
前記第1混合係数設定工程により設定された第1混合係数と、前記複数の第1仮補正量に基づいて、前記リニア画像に対する第2仮補正量を設定する第2仮補正量設定工程と、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記複数の第1仮補正量のうち少なくとも1つと、前記第2仮補正量に乗算する重み係数としての第2混合係数を設定する第2混合係数設定工程と、
前記第2混合係数により設定された第2混合係数と、前記少なくとも1つの第1仮補正量と、前記第2仮補正量に基づいて、階調調整パラメータを算出する階調調整パラメータ算出工程と、を含み、
前記シーン判別処理工程による判別結果と、前記階調調整パラメータ算出工程により算出された階調調整パラメータとに基づいて、前記リニア画像に対する第1の階調処理条件を設定することを特徴とする請求項16又は17に記載の画像処理方法。
The gradation processing condition setting step includes
A first temporary correction amount for setting a plurality of first temporary correction amounts for the linear image based on a brightness analysis value of the linear image, a brightness reproduction target value, the luminance ratio index, and the exposure photographing degree. A setting process;
A first mixing coefficient setting step of setting a first mixing coefficient as a weighting coefficient for multiplying each of the plurality of first temporary correction amounts based on the natural light index;
A second temporary correction amount setting step for setting a second temporary correction amount for the linear image based on the first mixing coefficient set by the first mixing coefficient setting step and the plurality of first temporary correction amounts;
Based on the exposure photographing degree, the natural light index, and the luminance ratio index, at least one of the plurality of first temporary correction amounts and a second mixing coefficient as a weighting coefficient for multiplying the second temporary correction amount are set. A second mixing coefficient setting step,
A gradation adjustment parameter calculating step of calculating a gradation adjustment parameter based on the second mixing coefficient set by the second mixing coefficient, the at least one first temporary correction amount, and the second temporary correction amount; Including,
The first gradation processing condition for the linear image is set based on a determination result obtained by the scene determination processing step and a gradation adjustment parameter calculated by the gradation adjustment parameter calculation step. Item 18. The image processing method according to Item 16 or 17.
画像処理を制御するコンピュータを、
撮影によって形成されたリニア画像を取得する画像取得手段、
前記リニア画像に基づいて撮影シーンの判別処理を行うシーン判別処理手段、
前記シーン判別処理手段による判別結果に基づいて、前記リニア画像の明るさを調整するための第1の階調処理条件と、硬さを調整するための第2の階調処理条件とを設定する階調処理条件設定手段、
前記階調処理条件設定手段により設定された第1の階調処理条件に基づいて、前記リニア画像に対する第1の階調変換処理を行う第1の階調変換処理手段、
前記階調処理条件設定手段により設定された第2の階調処理条件に基づいて、前記第1の階調変換処理が適用されたリニア画像に対する第2の階調変換処理を行う第2の階調変換処理手段、
前記第2の階調変換処理が適用されたリニア画像をノンリニア画像に変換する階調変換処理を行う第3の階調変換処理手段、
として機能させるための画像処理プログラム。
A computer that controls image processing
Image acquisition means for acquiring a linear image formed by photographing;
Scene discrimination processing means for performing discrimination processing of a photographic scene based on the linear image;
Based on the determination result by the scene determination processing means, a first gradation processing condition for adjusting the brightness of the linear image and a second gradation processing condition for adjusting the hardness are set. Gradation processing condition setting means,
First gradation conversion processing means for performing a first gradation conversion process on the linear image based on a first gradation processing condition set by the gradation processing condition setting means;
Based on the second gradation processing condition set by the gradation processing condition setting means, a second floor that performs a second gradation conversion process on the linear image to which the first gradation conversion process is applied. Key conversion processing means,
Third gradation conversion processing means for performing gradation conversion processing for converting a linear image to which the second gradation conversion processing is applied into a non-linear image;
Image processing program to function as
前記画像取得手段は、
前記リニア画像から、画像サイズを縮小したリニア画像を取得し、
前記シーン判別処理手段は、
前記画像サイズを縮小したリニア画像を用いて撮影シーンの判別処理を行うことを特徴とする請求項19に記載の画像処理プログラム。
The image acquisition means includes
From the linear image, obtain a linear image reduced in image size,
The scene discrimination processing means includes
The image processing program according to claim 19, wherein a scene determination process is performed using a linear image with a reduced image size.
前記コンピュータを、
前記リニア画像の撮影時に算出される輝度情報を取得する輝度情報取得手段として機能させ、
前記シーン判別処理手段は、
前記輝度情報取得手段により取得された輝度情報に基づいて撮影シーンの判別処理を行い、
前記階調処理条件設定手段は、
前記輝度情報取得手段により取得された輝度情報に基づいて第1及び第2の階調処理条件を設定することを特徴とする請求項19又は20に記載の画像処理プログラム。
The computer,
Function as luminance information acquisition means for acquiring luminance information calculated at the time of photographing the linear image;
The scene discrimination processing means includes
Based on the luminance information acquired by the luminance information acquisition means, to determine the shooting scene,
The gradation processing condition setting means includes:
The image processing program according to claim 19 or 20, wherein the first and second gradation processing conditions are set based on the luminance information acquired by the luminance information acquisition means.
前記シーン判別処理手段は、
前記リニア画像の自然光による屋外撮影度を表す自然光指標と、ダイナミックレンジの大きさを表す輝度比指標と、撮影時の露出設定に起因する露出撮影度指標とを算出し、
前記算出された各指標に基づいて撮影シーンを判別することを特徴とする請求項19〜21の何れか一項に記載の画像処理プログラム。
The scene discrimination processing means includes
Calculating a natural light index representing the degree of outdoor photographing with natural light of the linear image, a luminance ratio index representing the size of the dynamic range, and an exposure photographing degree index resulting from the exposure setting at the time of photographing;
The image processing program according to any one of claims 19 to 21, wherein a shooting scene is determined based on each of the calculated indices.
前記シーン判別処理手段は、
前記リニア画像について色情報を取得し、当該取得された色情報に基づいて、前記リニア画像の画像データを所定の明度と色相の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第1の占有率を算出し、
前記取得された色情報に基づいて、前記画像データを画面の外縁からの距離と明度の組み合わせからなる階級に分類し、当該分類された階級毎に、前記画像データ全体に占める割合を示す第2の占有率を算出し、
前記第1の占有率に、撮影条件に応じて予め設定された第1の係数を乗算することにより、指標1を算出し、
前記第1の占有率に、撮影条件に応じて予め設定された第2の係数を乗算することにより、指標2を算出し、
前記第2の占有率に、撮影条件に応じて予め設定された第3の係数を乗算することにより、指標3を算出し、
少なくとも前記画像データの画面中央部における肌色の平均輝度に、撮影条件に応じて予め設定された第4の係数を乗算することにより、前記露出撮影度を算出し、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第5の係数を乗算することにより、前記自然光指標を算出し、
前記指標1、前記指標2、前記指標3のうち少なくとも一つ以上の指標と、前記輝度情報に、撮影条件に応じて予め設定された第6の係数を乗算することにより、前記輝度比指標を算出し、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記画像データの撮影シーンを判別することを特徴とする請求項22に記載の画像処理プログラム。
The scene discrimination processing means includes
Color information is acquired for the linear image, and based on the acquired color information, the image data of the linear image is classified into a class composed of a combination of predetermined brightness and hue, and for each of the classified classes, Calculating a first occupancy ratio indicating the ratio of the entire image data;
Based on the acquired color information, the image data is classified into classes composed of combinations of the distance from the outer edge of the screen and the brightness, and a second ratio indicating the proportion of the entire image data for each classified class Calculate the share of
By multiplying the first occupancy by a first coefficient set in advance according to the shooting conditions, the index 1 is calculated,
The index 2 is calculated by multiplying the first occupancy by a second coefficient set in advance according to the shooting conditions,
The index 3 is calculated by multiplying the second occupation ratio by a third coefficient set in advance according to the shooting conditions,
The exposure photographing degree is calculated by multiplying the average brightness of the skin color at least in the center of the screen of the image data by a fourth coefficient set in advance according to the photographing condition,
The natural light index is calculated by multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a fifth coefficient that is set in advance according to shooting conditions. And
By multiplying at least one of the index 1, the index 2, and the index 3 and the luminance information by a sixth coefficient that is set in advance according to shooting conditions, the luminance ratio index is obtained. Calculate
23. The image processing program according to claim 22, wherein a shooting scene of the image data is determined based on the exposure shooting degree, the natural light index, and the luminance ratio index.
前記階調処理条件設定手段は、
前記リニア画像の明るさ解析値と、明るさの再現目標値と、前記輝度比指標及び前記露出撮影度に基づいて、当該リニア画像に対する複数の第1仮補正量を設定し、
前記自然光指標に基づいて、前記複数の第1仮補正量の各々に乗算する重み係数としての第1混合係数を設定し、
前記第1混合係数と、前記複数の第1仮補正量に基づいて、前記リニア画像に対する第2仮補正量を設定し、
前記露出撮影度、前記自然光指標及び前記輝度比指標に基づいて、前記複数の第1仮補正量のうち少なくとも1つと、前記第2仮補正量に乗算する重み係数としての第2混合係数を設定し、
前記第2混合係数と、前記少なくとも1つの第1仮補正量と、前記第2仮補正量に基づいて、階調調整パラメータを算出し、
前記シーン判別処理手段による判別結果と、前記算出された階調調整パラメータとに基づいて、前記リニア画像に対する第1の階調処理条件を設定することを特徴とする請求項22又は23に記載の画像処理プログラム。
The gradation processing condition setting means includes:
Based on the brightness analysis value of the linear image, the brightness reproduction target value, the brightness ratio index, and the exposure shooting degree, a plurality of first temporary correction amounts for the linear image are set,
Based on the natural light index, set a first mixing coefficient as a weighting coefficient to be multiplied to each of the plurality of first temporary correction amount,
Based on the first mixing coefficient and the plurality of first temporary correction amounts, a second temporary correction amount for the linear image is set,
Based on the exposure photographing degree, the natural light index, and the luminance ratio index, at least one of the plurality of first temporary correction amounts and a second mixing coefficient as a weighting coefficient for multiplying the second temporary correction amount are set. And
Calculating a gradation adjustment parameter based on the second mixing coefficient, the at least one first temporary correction amount, and the second temporary correction amount;
24. The first gradation processing condition for the linear image is set based on a determination result by the scene determination processing unit and the calculated gradation adjustment parameter. Image processing program.
JP2006122213A 2006-04-26 2006-04-26 Imaging apparatus, image processing apparatus, image processing method and image processing program Pending JP2007293686A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006122213A JP2007293686A (en) 2006-04-26 2006-04-26 Imaging apparatus, image processing apparatus, image processing method and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006122213A JP2007293686A (en) 2006-04-26 2006-04-26 Imaging apparatus, image processing apparatus, image processing method and image processing program

Publications (1)

Publication Number Publication Date
JP2007293686A true JP2007293686A (en) 2007-11-08

Family

ID=38764253

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006122213A Pending JP2007293686A (en) 2006-04-26 2006-04-26 Imaging apparatus, image processing apparatus, image processing method and image processing program

Country Status (1)

Country Link
JP (1) JP2007293686A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101262567B (en) * 2008-04-07 2010-12-08 北京中星微电子有限公司 Automatic exposure method and device
JP2012133462A (en) * 2010-12-20 2012-07-12 Nikon Corp Image processing method, image processing program, image processing apparatus and imaging apparatus
CN114757946A (en) * 2022-06-13 2022-07-15 武汉精立电子技术有限公司 Method and system for detecting linearity of camera
CN114878583A (en) * 2022-07-08 2022-08-09 四川大学 Image processing method and system for dark field imaging of distorted spot lighting defects

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101262567B (en) * 2008-04-07 2010-12-08 北京中星微电子有限公司 Automatic exposure method and device
JP2012133462A (en) * 2010-12-20 2012-07-12 Nikon Corp Image processing method, image processing program, image processing apparatus and imaging apparatus
CN114757946A (en) * 2022-06-13 2022-07-15 武汉精立电子技术有限公司 Method and system for detecting linearity of camera
CN114878583A (en) * 2022-07-08 2022-08-09 四川大学 Image processing method and system for dark field imaging of distorted spot lighting defects
CN114878583B (en) * 2022-07-08 2022-09-20 四川大学 Image processing method and system for dark field imaging of distorted spot lighting defects

Similar Documents

Publication Publication Date Title
US9819852B2 (en) Camera using preview image to select exposure
JP2005190435A (en) Image processing method, image processing apparatus and image recording apparatus
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
JP2007311895A (en) Imaging apparatus, image processor, image processing method and image processing program
JP2006333205A (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
JP2005192162A (en) Image processing method, image processing apparatus, and image recording apparatus
JP2007228221A (en) Imaging apparatus, image processing apparatus, image processing method and image processing program
JP2007312294A (en) Imaging apparatus, image processor, method for processing image, and image processing program
WO2006033235A1 (en) Image processing method, image processing device, imaging device, and image processing program
JP2007243542A (en) Imaging apparatus, image processing apparatus, image processing method, and image processing program
JP2009070099A (en) Image-processing device, image-processing method, program and recording medium
JP2007235204A (en) Imaging apparatus, image processing apparatus, image processing method and image processing program
JP2005192158A (en) Image processing method, image processing apparatus, and image recording apparatus
JP2007081550A (en) Imaging apparatus, and image processing unit, method, and program
JP2007184887A (en) Image pickup device, image processor, image processing method and image processing program
JP2007288245A (en) Imaging apparatus, image processing method, and image processing program
JP2007258890A (en) Imaging apparatus, image processor, and image processing method and program
JP2007318320A (en) Image processor, imaging device, image processing method, and image processing program
JP2006203573A (en) Imaging apparatus, image processor, and image recording apparatus
JP2007243556A (en) Imaging apparatus, image processing method, and image processing program
JP2006203571A (en) Imaging apparatus, image processing apparatus, and image recording apparatus
JP2007201679A (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