JP5732799B2 - Image processing apparatus, imaging apparatus, and image processing program - Google Patents

Image processing apparatus, imaging apparatus, and image processing program Download PDF

Info

Publication number
JP5732799B2
JP5732799B2 JP2010218952A JP2010218952A JP5732799B2 JP 5732799 B2 JP5732799 B2 JP 5732799B2 JP 2010218952 A JP2010218952 A JP 2010218952A JP 2010218952 A JP2010218952 A JP 2010218952A JP 5732799 B2 JP5732799 B2 JP 5732799B2
Authority
JP
Japan
Prior art keywords
image
area
color
image processing
white balance
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.)
Expired - Fee Related
Application number
JP2010218952A
Other languages
Japanese (ja)
Other versions
JP2012074963A (en
Inventor
麻理 杉原
麻理 杉原
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.)
Nikon Corp
Original Assignee
Nikon Corp
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 Nikon Corp filed Critical Nikon Corp
Priority to JP2010218952A priority Critical patent/JP5732799B2/en
Publication of JP2012074963A publication Critical patent/JP2012074963A/en
Application granted granted Critical
Publication of JP5732799B2 publication Critical patent/JP5732799B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像処理装置、撮像装置、画像処理プログラムに関する。   The present invention relates to an image processing device, an imaging device, and an image processing program.

特許文献1に開示のホワイトバランス調整では、撮影画像から主要被写体領域を抽出し、その主要被写体領域から抽出された測色値の頻度を、他の領域から抽出された測色値の頻度よりも高めに見積もる(大きな重み係数を乗算する)ことで、主要被写体に対するホワイトバランス調整の精度向上を図っている。   In the white balance adjustment disclosed in Patent Document 1, a main subject region is extracted from a captured image, and the frequency of colorimetric values extracted from the main subject region is set to be higher than the frequency of colorimetric values extracted from other regions. By making a high estimate (multiplying by a large weighting factor), the accuracy of white balance adjustment for the main subject is improved.

特許文献2に開示のホワイトバランス調整では、主要被写体領域に対するホワイトバランス調整量を、他の領域に対するホワイトバランス調整量とは別に設定することにより、主要被写体に対するホワイトバランス調整の精度向上を図っている。   In the white balance adjustment disclosed in Patent Document 2, the white balance adjustment amount for the main subject region is set separately from the white balance adjustment amount for the other regions, thereby improving the accuracy of the white balance adjustment for the main subject. .

特開2006−211416号公報Japanese Patent Laid-Open No. 2006-2111416 特開2008−219414号公報JP 2008-219414 A

しかしながら何れの場合も、主要被写体領域の色から主要被写体の照明色を推定することが困難な場合(例えば、主要被写体の本来の色が何らかの光源の色と偶然似ていた場合など)には、主要被写体領域のホワイトバランス調整に失敗する(カラーフェリアを起こす)虞がある。   However, in any case, when it is difficult to estimate the illumination color of the main subject from the color of the main subject area (for example, when the original color of the main subject accidentally resembles the color of some light source) There is a risk that the white balance adjustment of the main subject area may fail (cause color failure).

本発明は、撮影画像中の特定領域に対するホワイトバランス調整のカラーフェリアを高確率で抑えることのできる画像処理装置、撮像装置、及び画像処理プログラムを提供することを目的とする。   It is an object of the present invention to provide an image processing apparatus, an imaging apparatus, and an image processing program that can suppress a white balance adjustment color failure for a specific area in a captured image with high probability.

本発明の画像処理装置は、カラーの撮影画像を入力する入力手段と、前記画像上の複数の領域の各々から、その領域の色が光源色を示している可能性の高さを示す評価値を抽出する抽出手段と、前記複数の領域の一部である特定領域に写っている被写体の照明方向を推測する推測手段と、抽出された複数の前記評価値の前記画像上の分布を、前記照明方向に応じた重み分布で重み付けする重み付け手段と、重み付け後に高い値を示した評価値の抽出元領域の色を前記被写体の照明色とみなして前記特定領域へ適用すべきホワイトバランス調整量を算出する算出手段とを備え、前記特定領域に写っている被写体が人物か否かに応じて、前記照明方向を推測する領域の選択基準が異なることを特徴とする。 The image processing apparatus according to the present invention includes an input unit that inputs a color photographed image, and an evaluation value that indicates a high possibility that the color of the area indicates the light source color from each of the plurality of areas on the image. Extraction means for extracting, estimation means for estimating the illumination direction of a subject reflected in a specific area that is a part of the plurality of areas, and distribution of the plurality of extracted evaluation values on the image, A weighting unit for weighting with a weight distribution according to the illumination direction, and a white balance adjustment amount to be applied to the specific region by regarding the color of the extraction source region of the evaluation value showing a high value after weighting as the illumination color of the subject comprising a calculation unit calculating for a said object is reflected in a particular region according to whether the person, the selection criteria of the areas to estimate the illumination direction you wherein different.

本発明の撮像装置は、カラーの撮影画像を取得する撮像手段と、前記撮像手段が取得した画像の特定領域へ適用すべきホワイトバランス調整量を算出する、本発明の画像処理装置とを備える。   The imaging apparatus of the present invention includes an imaging unit that acquires a color captured image, and an image processing apparatus of the present invention that calculates a white balance adjustment amount to be applied to a specific area of the image acquired by the imaging unit.

本発明の画像処理プログラムは、カラーの撮影画像を入力する入力手順と、前記画像上の複数の領域の各々から、その領域の色が光源色を示している可能性の高さを示す評価値を抽出する抽出手順と、前記複数の領域の一部である特定領域に写っている被写体の照明方向を推測する推測手順と、抽出された複数の前記評価値の前記画像上の分布を、前記照明方向に応じた重み分布で重み付けする重み付け手順と、重み付け後に高い値を示した評価値の抽出元領域の色を前記被写体の照明色とみなして前記特定領域へ適用すべきホワイトバランス調整量を算出する算出手順と、前記特定領域に写っている被写体が人物か否かに応じて、前記照明方向を推測する領域の選択基準を変える手順と、をコンピュータに実行させることを特徴とする。 The image processing program of the present invention includes an input procedure for inputting a color photographed image, and an evaluation value indicating a high possibility that the color of the area indicates the light source color from each of the plurality of areas on the image. An extraction procedure for extracting a plurality of evaluation values, an estimation procedure for estimating an illumination direction of a subject in a specific area that is a part of the plurality of areas, and a distribution of the extracted evaluation values on the image. A weighting procedure for weighting with a weight distribution according to the illumination direction, and a white balance adjustment amount to be applied to the specific area by regarding the color of the extraction source area of the evaluation value showing a high value after weighting as the illumination color of the subject The computer is caused to execute a calculation procedure for calculating and a procedure for changing a selection criterion of the region for estimating the illumination direction according to whether or not the subject in the specific region is a person .

本発明によれば、カラー画像中の特定領域に対するホワイトバランス調整のカラーフェリアを高確率で抑えることのできる画像処理装置、撮像装置、及び画像処理プログラムが実現する。   According to the present invention, an image processing apparatus, an imaging apparatus, and an image processing program that can suppress a white balance adjustment color failure for a specific region in a color image with high probability are realized.

電子カメラの構成図。The block diagram of an electronic camera. 撮影モードにおけるCPU21の動作フローチャート。The operation | movement flowchart of CPU21 in imaging | photography mode. ホワイトバランス調整回路15によるホワイトバランス調整処理の動作フローチャート。6 is an operation flowchart of white balance adjustment processing by the white balance adjustment circuit 15; 詳細画像の例(斜光撮影の場合)。Detailed image example (for oblique shooting). 詳細画像を分割してできた領域の模式図。The schematic diagram of the area | region which divided | segmented the detailed image. 光源らしさ度マップを説明する図。The figure explaining a light source likelihood degree map. 主要被写体領域(ここでは人物領域o)を説明する図。The figure explaining main subject field (here person field o). 参照領域(ここでは顔領域of)を説明する図。The figure explaining a reference field (here face field of). 二値化後の参照領域(ここでは顔領域of’)を説明する図。The figure explaining the reference area (here face area of ') after binarization. 分割曲線Csを説明する図。The figure explaining division | segmentation curve Cs. 明るさ重心gh、暗さ重心gsを説明する図。The figure explaining the brightness gravity center gh and the dark gravity center gs. 明暗ベクトルを説明する図。The figure explaining a light-dark vector. 階調変換特性を説明する図。6A and 6B illustrate gradation conversion characteristics. 階調変換特性の効果を説明する図。10A and 10B are diagrams illustrating an effect of gradation conversion characteristics. 重みマップを説明する図。The figure explaining a weight map. ステップS16−6〜S16−9を説明する図(斜光撮影の場合)。The figure explaining step S16-6 to S16-9 (in the case of oblique photographing). ステップS16−12〜S16−9を説明する図(順光撮影の場合)。The figure explaining step S16-12 to S16-9 (in the case of front light photography). ステップS16−15〜S16−9を説明する図(逆光撮影の場合)。The figure explaining step S16-15 to S16-9 (in the case of backlight photography).

以下、本発明の実施形態として電子カメラを説明する。   Hereinafter, an electronic camera will be described as an embodiment of the present invention.

図1は、電子カメラの構成図である。図1に示すとおり電子カメラ1には、撮像素子11、信号処理回路12、バッファメモリ13、画像処理回路14、ホワイトバランス調整回路15、表示制御回路16、内部モニタ17、圧縮・伸張回路18、カードインタフェース19、CPU21、撮像回路22、入力器23、外部接続端子24、ストロボ装置30などが備えられる。このうちバッファメモリ13、画像処理回路14、ホワイトバランス調整回路15、表示制御回路16、圧縮・伸張回路18、カードインタフェース19、CPU21は、共通のバスに接続されている。   FIG. 1 is a configuration diagram of an electronic camera. As shown in FIG. 1, the electronic camera 1 includes an image sensor 11, a signal processing circuit 12, a buffer memory 13, an image processing circuit 14, a white balance adjustment circuit 15, a display control circuit 16, an internal monitor 17, a compression / expansion circuit 18, A card interface 19, a CPU 21, an imaging circuit 22, an input device 23, an external connection terminal 24, a strobe device 30 and the like are provided. Among these, the buffer memory 13, the image processing circuit 14, the white balance adjustment circuit 15, the display control circuit 16, the compression / expansion circuit 18, the card interface 19, and the CPU 21 are connected to a common bus.

撮像素子11は、撮影レンズ2が形成した被写界像を撮像するカラー撮像素子(例えば単板式カラー撮像素子)である。   The image sensor 11 is a color image sensor (for example, a single plate type color image sensor) that captures an object scene image formed by the photographing lens 2.

信号処理回路12は、撮像素子11が撮像で取得したアナログ画像信号に対してアナログ信号処理及びA/D変換処理を順次に施し、ディジタル画像信号に変換する。   The signal processing circuit 12 sequentially performs analog signal processing and A / D conversion processing on the analog image signal acquired by the imaging device 11 through imaging, and converts the analog image signal into a digital image signal.

バッファメモリ13は、信号処理回路12から出力されるディジタル画像信号を順次に蓄積する。撮像素子11の1フレーム分の電荷読み出し期間に亘ってこの蓄積が行われると、バッファメモリ13には1フレーム分のディジタル画像データが蓄積されることになる。以下、1フレーム分のディジタル画像データを単に「画像」と称し、特に、撮像直後にバッファメモリ13に蓄積された画像(画像処理回路14による画像処理が施される前の画像)を「RAW画像」と称す。   The buffer memory 13 sequentially accumulates digital image signals output from the signal processing circuit 12. When this accumulation is performed over the charge reading period for one frame of the image sensor 11, digital image data for one frame is accumulated in the buffer memory 13. Hereinafter, digital image data for one frame is simply referred to as “image”, and in particular, an image stored in the buffer memory 13 immediately after imaging (an image before being subjected to image processing by the image processing circuit 14) is referred to as a “RAW image”. ".

ホワイトバランス調整回路15は、バッファメモリ13に格納されたRAW画像に対してホワイトバランス調整処理を施す。ホワイトバランス調整処理の詳細は後述する。   The white balance adjustment circuit 15 performs white balance adjustment processing on the RAW image stored in the buffer memory 13. Details of the white balance adjustment processing will be described later.

画像処理回路14は、ホワイトバランス調整後の画像に対して、デベイヤ処理(色補間処理)を含む所定の画像処理(色補間処理、階調変換処理、エッジ強調処理、コントラスト強調処理など)を施す。なお、画像処理回路14は、必要に応じて、バッファメモリ13上の画像に対して表示用の間引き処理(サイズ縮小処理)を施すこともできる。   The image processing circuit 14 performs predetermined image processing (color interpolation processing, gradation conversion processing, edge enhancement processing, contrast enhancement processing, etc.) including debayer processing (color interpolation processing) on the image after white balance adjustment. . Note that the image processing circuit 14 can also perform display thinning processing (size reduction processing) on the image on the buffer memory 13 as necessary.

表示制御回路16は、表示用メモリを有しており、その表示用メモリに書き込まれた画像を内部モニタ17へ送出することにより、その内部モニタ17上へ画像を表示する。なお、外部接続端子24に外部モニタが接続されている期間には、表示制御回路16による画像の送出先は、内部モニタ17ではなく外部モニタとなる。但し、以下では簡単のため、外部接続端子24に外部モニタは接続されていないものと仮定する。   The display control circuit 16 has a display memory, and displays an image on the internal monitor 17 by sending the image written in the display memory to the internal monitor 17. Note that during the period in which an external monitor is connected to the external connection terminal 24, the display destination of the image by the display control circuit 16 is not the internal monitor 17 but the external monitor. However, for simplicity, it is assumed that an external monitor is not connected to the external connection terminal 24.

内部モニタ17は、電子カメラ1の背面などに設けられ、電子カメラ1で取得された画像をユーザが確認する際などに使用されるモニタである。このモニタは、例えばLCDパネルなどで構成される。   The internal monitor 17 is a monitor that is provided on the back surface of the electronic camera 1 and used when a user confirms an image acquired by the electronic camera 1. This monitor is composed of, for example, an LCD panel.

外部接続端子24は、外部モニタへ表示制御回路16を接続するための端子である。外部接続端子24は、例えば、USBポートなどで構成される。   The external connection terminal 24 is a terminal for connecting the display control circuit 16 to an external monitor. The external connection terminal 24 is configured by, for example, a USB port.

圧縮・伸張回路18は、前述した所定の画像処理後の画像に対し、所定方式のデータ圧縮処理を施す。また、圧縮・伸張回路18は、データ圧縮済みの画像に対し、同じ方式のデータ伸張処理を施すこともできる。以下、圧縮/伸張方式として周知のJPEG方式が適用されるものと仮定する。   The compression / decompression circuit 18 performs data compression processing of a predetermined method on the image after the predetermined image processing described above. Further, the compression / decompression circuit 18 can also perform the same type of data expansion processing on the data-compressed image. Hereinafter, it is assumed that a well-known JPEG method is applied as the compression / decompression method.

カードインタフェース19は、データ圧縮済みの画像(JPEGファイル)又はデータ圧縮されていないRAW画像(RAW画像ファイル)を、電子カメラ1のカードスロットに装着中のカードメモリ20へ書き込んだり、そのカードメモリ20に書き込まれているJPEGファイル又はRAW画像ファイルを読み込んだりする。なお、カードメモリ20は、可搬の記憶媒体である。   The card interface 19 writes a data-compressed image (JPEG file) or a non-data-compressed RAW image (RAW image file) to the card memory 20 installed in the card slot of the electronic camera 1, or the card memory 20 Or a JPEG file or a RAW image file written in the. The card memory 20 is a portable storage medium.

撮像回路22は、撮影レンズ2に対して駆動信号を与えることにより、撮影レンズ2の焦点距離(ズーム位置)、撮影レンズ2の合焦距離、撮影レンズ2の絞り値などを調節する。また、撮像回路22は、撮像素子11及び信号処理回路12に対して駆動信号を与えることにより、両者の駆動タイミングを制御する。また、撮像回路22は、撮像素子11の1フレーム当たりの電荷蓄積時間を制御する。なお、電子カメラ1のシャッター速度は、撮像素子11の電荷蓄積時間と不図示のメカシャッタの開放期間との組み合わせによって設定できるが、ここでは簡単のため、撮像素子11の電荷蓄積時間のみによって設定されるものと仮定する。   The imaging circuit 22 adjusts the focal length (zoom position) of the photographic lens 2, the focusing distance of the photographic lens 2, the aperture value of the photographic lens 2, and the like by giving a drive signal to the photographic lens 2. Further, the imaging circuit 22 controls the drive timing of both by providing a drive signal to the image sensor 11 and the signal processing circuit 12. The imaging circuit 22 controls the charge accumulation time per frame of the imaging device 11. Note that the shutter speed of the electronic camera 1 can be set by a combination of the charge accumulation time of the image sensor 11 and the opening period of a mechanical shutter (not shown), but here it is set only by the charge accumulation time of the image sensor 11 for simplicity. Assume that

CPU21は、入力器23を介して入力されるユーザの指示と、CPU21の内部メモリ(ROM)に予め書き込まれたファームウエアとに従い、以上の各部を制御する。なお、CPU21のファームウエアは、電子カメラ1に搭載された不図示の通信回路(公知のネットワーク端子など)を介して適宜に更新される。   The CPU 21 controls each of the above units in accordance with a user instruction input via the input device 23 and firmware written in advance in the internal memory (ROM) of the CPU 21. The firmware of the CPU 21 is appropriately updated via a communication circuit (not shown) (known network terminal or the like) mounted on the electronic camera 1.

入力器23は、電子カメラ1の上部に設けられたレリーズボタンや、電子カメラ1の背面に設けられたマルチセレクターなどの操作部材である。例えばユーザは、この入力器23を介して電子カメラ1のモードを撮影モードと再生モードの間で切り替えることができる。また、ユーザは、入力器23を介して電子カメラ1のモードを閃光発光禁止モードに設定することもできる。   The input device 23 is an operation member such as a release button provided on the top of the electronic camera 1 or a multi-selector provided on the back of the electronic camera 1. For example, the user can switch the mode of the electronic camera 1 between the shooting mode and the playback mode via the input device 23. The user can also set the mode of the electronic camera 1 to the flash emission prohibition mode via the input device 23.

ストロボ装置30は、撮影レンズ2の被写界に向けて閃光を発光する装置である。ストロボ装置30による閃光の発光タイミングは、撮像素子11の駆動タイミングなどと共に撮像回路22によって制御される。また、ストロボ装置30による閃光発光の必要性は、撮影毎にCPU21によって判別される。   The strobe device 30 is a device that emits flash light toward the object field of the photographing lens 2. The flash emission timing of the strobe device 30 is controlled by the imaging circuit 22 together with the driving timing of the imaging element 11 and the like. Further, the necessity of flash emission by the flash device 30 is determined by the CPU 21 for each photographing.

図2は、撮影モードにおけるCPU21の動作フローチャートである。以下、図2の各ステップを順に説明する。なお、ここでは説明を簡単にするため、電子カメラ1のRAW記録機能(RAW画像ファイルをJPEGファイルと共に記録する機能)は、オフされているものと仮定する。   FIG. 2 is an operation flowchart of the CPU 21 in the photographing mode. Hereafter, each step of FIG. 2 is demonstrated in order. Here, for the sake of simplicity of explanation, it is assumed that the RAW recording function (function of recording a RAW image file together with a JPEG file) of the electronic camera 1 is turned off.

ステップS10:CPU21は、撮像回路22を介して撮像素子11をドラフトモードで連続駆動し始める。これによって撮像素子11は、スルー画像の取得を開始する。CPU21は、このときに信号処理回路12から出力されるスルー画像からAE評価値を抽出し、そのAE評価値が適正となるよう、撮像回路22を介して電子カメラ1のシャッター速度と撮影レンズ22の絞り値との組み合わせを制御する(AE制御)。それと並行して、CPU21は、信号処理回路12から出力されるスルー画像からAF評価値を抽出し、そのAF評価値が適正となるよう、撮像回路22を介して撮影レンズ22の合焦距離を制御する(AF制御)。なお、CPU21は、スルー画像の取得期間中に入力器23からズーム調整指示が入力されると、その指示に応じて撮影レンズ2のズーム位置を調整する。   Step S10: The CPU 21 starts to continuously drive the image pickup device 11 in the draft mode via the image pickup circuit 22. As a result, the image sensor 11 starts acquiring a through image. The CPU 21 extracts the AE evaluation value from the through image output from the signal processing circuit 12 at this time, and the shutter speed of the electronic camera 1 and the photographing lens 22 through the imaging circuit 22 so that the AE evaluation value becomes appropriate. The combination with the aperture value is controlled (AE control). In parallel with this, the CPU 21 extracts the AF evaluation value from the through image output from the signal processing circuit 12, and sets the in-focus distance of the photographic lens 22 via the imaging circuit 22 so that the AF evaluation value is appropriate. Control (AF control). Note that when a zoom adjustment instruction is input from the input device 23 during the through image acquisition period, the CPU 21 adjusts the zoom position of the photographing lens 2 in accordance with the instruction.

ステップS11:CPU21は、レリーズボタンが半押しされたか否かを判別し、半押しされた場合は、ステップS12へ移行する。   Step S11: The CPU 21 determines whether or not the release button has been half-pressed. If the release button has been half-pressed, the process proceeds to step S12.

ステップS12:CPU21は、現時点における絞り値及びシャッター速度を固定すると共に(AEロック)、現時点における合焦距離を固定し(AFロック)、現時点におけるズーム位置も固定する(ズームロック)。但し、CPU21は、電子カメラ1が閃光禁止モードに設定中でなかった場合には、この時点で露出不足となる可能性の有無を検知し、その可能性があった場合には、ストロボ装置30に対して発光の準備をさせると共に、絞り値及びシャッター速度を閃光撮影に適した値に調整する。その後、CPU21は、電子カメラ1に設定中の絞り値、シャッター速度、合焦距離、ズーム位置、閃光発光の準備の有無(閃光発光の有無)などのデータを、撮影条件データとして読み込む。   Step S12: The CPU 21 fixes the current aperture value and shutter speed (AE lock), fixes the current in-focus distance (AF lock), and also fixes the current zoom position (zoom lock). However, if the electronic camera 1 is not set to the flash prohibition mode, the CPU 21 detects whether or not there is a possibility of underexposure at this time, and if there is such a possibility, the strobe device 30 is detected. Are prepared for light emission, and the aperture value and shutter speed are adjusted to values suitable for flash photography. Thereafter, the CPU 21 reads data such as the aperture value, shutter speed, focusing distance, zoom position, presence / absence of flash light emission preparation (flash light emission presence / absence) set in the electronic camera 1 as shooting condition data.

ステップS13CPU21は、レリーズボタンが全押しされたか否かを判別し、全押しされていない場合はステップS14へ移行し、全押しされた場合はステップS15へ移行する。   Step S13: The CPU 21 determines whether or not the release button has been fully pressed. If the release button has not been fully pressed, the process proceeds to step S14. If the release button has been fully pressed, the process proceeds to step S15.

ステップS14:CPU21は、レリーズボタンの半押しが解除されたか否かを判別し、解除されていない場合はステップS13へ移行し、解除された場合は、AEロック、AFロック、ズームロック、閃光発光準備の各々を解除してからステップS11へ移行する。   Step S14: The CPU 21 determines whether or not the half-press of the release button has been released. If not released, the process proceeds to step S13. If released, the AE lock, AF lock, zoom lock, flash emission is performed. After canceling each of the preparations, the process proceeds to step S11.

ステップS15:CPU21は、撮像回路22を介して撮像素子11をフレームモードで1フレーム分駆動する。なお、先のステップで閃光発光の必要があると判断した場合、CPU21は、撮像回路22を介してストロボ装置30を駆動し、撮像素子11の駆動と共に閃光発光を行う。これによって保存用の詳細画像が取得される。この詳細画像は、信号処理回路12を介してバッファメモリ13へ蓄積される。   Step S15: The CPU 21 drives the image pickup device 11 for one frame in the frame mode via the image pickup circuit 22. If it is determined in the previous step that flash emission is necessary, the CPU 21 drives the strobe device 30 via the imaging circuit 22 and performs flash emission along with the driving of the image sensor 11. As a result, a detailed image for storage is acquired. This detailed image is stored in the buffer memory 13 via the signal processing circuit 12.

ステップS16:CPU21は、ステップS12で読み込んだ撮影条件データ(少なくとも閃光発光の有無を示すデータ)をホワイトバランス調整回路15へ与えると共に、詳細画像に対してホワイトバランス調整処理を施すようホワイトバランス調整回路15へ指示を与え、その後ホワイトバランス調整回路15から完了通知を受け取ると、CPU21は、ステップS17へ移行する。   Step S16: The CPU 21 gives the photographing condition data (at least data indicating the presence or absence of flash emission) read in Step S12 to the white balance adjustment circuit 15 and performs a white balance adjustment process on the detailed image. When the CPU 21 gives an instruction to 15 and then receives a completion notification from the white balance adjustment circuit 15, the CPU 21 proceeds to step S17.

ステップS17:CPU21は、ホワイトバランス調整後の詳細画像に対して画像処理回路14による所定の画像処理(色補間処理、階調変換処理、エッジ強調処理、コントラスト強調処理など)を施す。   Step S17: The CPU 21 performs predetermined image processing (color interpolation processing, gradation conversion processing, edge enhancement processing, contrast enhancement processing, etc.) by the image processing circuit 14 on the detailed image after white balance adjustment.

ステップS18:CPU21は、画像処理後の詳細画像に対して表示用の間引き処理(画像処理回路14によるサイズ縮小処理)を施してから、表示制御回路16の表示用メモリへ書き込み、内部モニタ17上に所定期間だけ確認表示する。これによってユーザは、撮影で取得された詳細画像を確認することができる。   Step S18: The CPU 21 performs thinning processing for display (size reduction processing by the image processing circuit 14) on the detailed image after the image processing, and then writes it in the display memory of the display control circuit 16, and then on the internal monitor 17. Is displayed for a predetermined period. As a result, the user can confirm the detailed image acquired by photographing.

また、本ステップのCPU21は、圧縮・伸張回路18によるデータ圧縮処理をホワイトバランス調整後の詳細画像(間引き処理前の詳細画像)へ施すことでJPEGファイルを作成し、ステップS12で読み込んだ撮影条件データをそのJPEGファイルに付与してから、カードインタフェース19を介してカードメモリ20へ書き込み、フローを終了する。これによって、詳細画像が保存されたことになる。   Further, the CPU 21 in this step creates a JPEG file by performing data compression processing by the compression / expansion circuit 18 on the detailed image after white balance adjustment (detailed image before thinning processing), and the shooting conditions read in step S12 After the data is attached to the JPEG file, the data is written to the card memory 20 via the card interface 19, and the flow is terminated. As a result, the detailed image is saved.

図3は、ホワイトバランス調整回路15によるホワイトバランス調整処理(図2のステップS16)の動作フローチャートである。以下、図3の各ステップを順に説明する。   FIG. 3 is an operation flowchart of white balance adjustment processing (step S16 in FIG. 2) by the white balance adjustment circuit 15. Hereafter, each step of FIG. 3 is demonstrated in order.

ステップS16−1:ホワイトバランス調整回路15は、バッファメモリ13上の詳細画像(画像処理前の詳細画像である。)を読み込む。   Step S16-1: The white balance adjustment circuit 15 reads a detailed image (a detailed image before image processing) on the buffer memory 13.

ステップS16−2:ホワイトバランス調整回路15は、読み込んだ詳細画像に対してパターン認識処理を施すことにより、その詳細画像中に存在する複数のオブジェクト領域を検出する。そして、ホワイトバランス調整回路15は、それらオブジェクト領域の輪郭により、詳細画像の全体を複数の領域に分割する。例えば、詳細画像中に、図4に示すとおり室内用の照明器具(シェード、ランプ、アーム)と、人物(髪、顔、体)と、山・太陽・空の見える窓と、壁と、床とが写っていたと仮定すると、詳細画像は、本ステップにおいて図5に示すような領域a、b、c、d、e、f、g、h、i、j、k、oに分割される。   Step S16-2: The white balance adjustment circuit 15 detects a plurality of object areas existing in the detailed image by performing pattern recognition processing on the read detailed image. Then, the white balance adjustment circuit 15 divides the entire detailed image into a plurality of regions based on the contours of the object regions. For example, in the detailed image, as shown in FIG. 4, indoor lighting fixtures (shades, lamps, arms), persons (hair, face, body), windows with mountains, sun and sky, walls, floors In this step, the detailed image is divided into regions a, b, c, d, e, f, g, h, i, j, k, and o as shown in FIG.

ステップS16−3:ホワイトバランス調整回路15は、詳細画像上の領域a、b、c、d、e、f、g、h、i、j、k、oの各々から、色評価値の一種である「光源らしさ度」を抽出する。   Step S16-3: The white balance adjustment circuit 15 is a kind of color evaluation value from each of the areas a, b, c, d, e, f, g, h, i, j, k, o on the detailed image. A certain “lightness likelihood” is extracted.

ここで、或る領域の光源らしさ度は、その領域の色が何らかの光源色を示している可能性の高さを示す評価値である。例えば、或る領域の輝度分布及び色度分布が蛍光灯のそれに類似していた場合には、その領域の光源らしさ度は高い値となる。また、別の或る領域の輝度分布及び色度分布が電球のそれに類似していた場合にも、その領域の光源らしさ度は高い値となる。また、別の或る領域の色度のみが電球の色度に近かった場合には、その領域の光源らしさ度は、中程度の値となる。また、別の或る領域の輝度分布及び色度分布の何れもが光源のそれに類似していなかった場合には、その領域の光源らしさ度は低い値となる。   Here, the lightness likelihood of a certain area is an evaluation value indicating the high possibility that the color of the area indicates a certain light source color. For example, when the luminance distribution and chromaticity distribution in a certain area are similar to those of a fluorescent lamp, the degree of light source in that area is a high value. In addition, when the luminance distribution and chromaticity distribution of another certain area are similar to those of a light bulb, the degree of lightness in that area is a high value. In addition, when only the chromaticity of another certain area is close to the chromaticity of the light bulb, the degree of light source in that area becomes a medium value. In addition, when neither the luminance distribution nor the chromaticity distribution in another certain area is similar to that of the light source, the degree of lightness in that area is a low value.

よって、図4の領域a、b、c、d、e、f、g、h、i、j、k、oの各々の光源らしさ度は、例えば図6に示すとおりとなる。図6に示す例では、ランプ領域fの光源らしさ度は+4、シェード領域gの光源らしさ度は+3、太陽領域aの光源らしさ度は+5となっており、それ以外の領域c、d、e、h、i、j、k、oの光源らしさ度は+1となっている。以下、図6に示すような光源らしさ度の詳細画像上の分布を、「光源らしさ度マップ」と称す。   Therefore, the degree of light source likelihood of each of the areas a, b, c, d, e, f, g, h, i, j, k, and o in FIG. 4 is as shown in FIG. 6, for example. In the example shown in FIG. 6, the lamp area f has a light source likelihood of +4, the shade area g has a light source likelihood of +3, and the solar area a has a light source likelihood of +5, and the other areas c, d, e , H, i, j, k, o have a light source likelihood of +1. Hereinafter, the distribution of the degree of light source likelihood on the detailed image as shown in FIG. 6 is referred to as a “light source degree of degree map”.

なお、光源らしさ度の算出は、各オブジェクト領域に対するオブジェクト認識結果、すなわち各オブジェクト領域が光源オブジェクト(例えば、照明、太陽、火など)であるか否かに基づき行われてもよい。或いは、メインの撮像素子11とは別に設けられたサブの撮像素子(測光センサ)に対する入力信号のパワー分布に基づき行われてもよい。或いは、オブジェクト認識結果とパワー分布との組み合わせに基づき行われてもよい。   The calculation of the light source likelihood may be performed based on the object recognition result for each object area, that is, whether each object area is a light source object (for example, illumination, sun, fire, etc.). Alternatively, it may be performed based on a power distribution of an input signal to a sub image sensor (photometric sensor) provided separately from the main image sensor 11. Alternatively, it may be performed based on a combination of the object recognition result and the power distribution.

続いて、ホワイトバランス調整回路15は、詳細画像上の領域a、b、c、d、e、f、g、h、i、j、k、oを、領域の絵柄及び面積によって互いに比較し、それら領域a、b、c、d、e、f、g、h、i、j、k、oの何れか1つを主要被写体領域に選出する。例えば、ホワイトバランス調整回路15は、領域a、b、c、d、e、f、g、h、i、j、k、oの中から面積が閾値未満であるものを排除し、残った複数の領域の中で最もコントラストの高かった領域を主要被写体領域とする。なお、主要被写体領域の選出は、前述したAF制御の情報(AF評価値の抽出元となったAFエリアの位置など)に基づき行われてもよい。   Subsequently, the white balance adjustment circuit 15 compares the regions a, b, c, d, e, f, g, h, i, j, k, o on the detailed image with each other according to the pattern and area of the region, Any one of these areas a, b, c, d, e, f, g, h, i, j, k, o is selected as the main subject area. For example, the white balance adjustment circuit 15 excludes the areas a, b, c, d, e, f, g, h, i, j, k, and o whose area is less than the threshold, and the remaining plural The region having the highest contrast among the regions is defined as the main subject region. The selection of the main subject area may be performed based on the above-described AF control information (such as the position of the AF area from which the AF evaluation value is extracted).

更に、ホワイトバランス調整回路15は、選出した主要被写体領域を、色度の異なる複数の小領域に分割し、それら小領域から面積が閾値未満であるものを排除し、残った領域の中で最もコントラストが高かった小領域を、参照領域に設定する。   Further, the white balance adjustment circuit 15 divides the selected main subject area into a plurality of small areas having different chromaticities, excludes those areas whose area is less than the threshold value, and most of the remaining areas. A small area with high contrast is set as a reference area.

但し、ホワイトバランス調整回路15は、選出した主要被写体領域が人物領域oであった場合には、面積及びコントラストに拘わらず、人物領域oの肌色領域(すなわち顔領域of)を参照領域に設定する(図7)。因みに、図7の符号ohは髪領域であり、符号obは身体領域である。以下、人物領域oが主要被写体領域に選出され、顔領域ofが参照領域に設定されたと仮定する。   However, when the selected main subject area is the person area o, the white balance adjustment circuit 15 sets the skin color area (that is, the face area of) of the person area o as the reference area regardless of the area and contrast. (FIG. 7). Incidentally, the symbol oh in FIG. 7 is a hair region, and the symbol ob is a body region. Hereinafter, it is assumed that the person area o is selected as the main subject area and the face area of is set as the reference area.

ステップS16−4: ホワイトバランス調整回路15は、詳細画像上の参照領域(ここでは顔領域of)から次の手順(a)〜(f)により明暗差及び明暗ベクトルを抽出する。   Step S16-4: The white balance adjustment circuit 15 extracts the light / dark difference and the light / dark vector from the reference area (here, the face area of) on the detailed image by the following procedures (a) to (f).

(a)詳細画像上の参照領域(ここでは顔領域of)(図8)を、所定の輝度閾値で二値化する。二値化後の参照領域(ここでは顔領域of’)の各画素は、黒画素と白画素との何れかとなる(図9)。   (A) The reference area (here, the face area of) (FIG. 8) on the detailed image is binarized with a predetermined luminance threshold. Each pixel in the binarized reference area (here, the face area of ') is either a black pixel or a white pixel (FIG. 9).

(b)二値化後の参照領域(ここでは顔領域of’)上で黒画素群と白画素群とを空間的に分離する所定次数の分離曲線Csを算出する。この分離曲線Csは、例えば、黒画素から分離曲線Csまでのユークリッド距離と、白画素から分離曲線Csまでのユークリッド距離とのトータルが最大となるような曲線である。このような分離曲線Csの算出には、例えば、サポートベクターマシンにおける分離超平面の算出と同様の方法が適用できる。なお、演算量を抑えるため、ここでは分離曲線Csの次数は、例えば2程度に設定されるものと仮定する。この場合、分離曲線Csの黒画素群側にも白画素(飛び地)が存在している可能性があり、分離曲線Csの白画素群側にも黒画素(飛び地)が存在している可能性がある。   (B) A separation curve Cs of a predetermined order that spatially separates the black pixel group and the white pixel group on the binarized reference area (here, the face area of ') is calculated. The separation curve Cs is, for example, a curve that maximizes the total of the Euclidean distance from the black pixel to the separation curve Cs and the Euclidean distance from the white pixel to the separation curve Cs. For the calculation of the separation curve Cs, for example, a method similar to the calculation of the separation hyperplane in the support vector machine can be applied. In order to reduce the amount of calculation, it is assumed here that the order of the separation curve Cs is set to about 2, for example. In this case, there is a possibility that a white pixel (enclave) exists also on the black pixel group side of the separation curve Cs, and a possibility that a black pixel (enclave) exists also on the white pixel group side of the separation curve Cs. There is.

(c)二値化前の参照領域(ここでは顔領域of)を分離曲線Csで分割する(図10)。これによって、参照領域(ここでは顔領域of)は、明るい画素を多く含む明部AHと、暗い画素を多く含む暗部ASとに分割される。なお、以下の計算では、明部AH及び暗部ASのうち、上述した飛び地に対応する各画素を、それぞれ無効画素(計算に使用されない画素)として扱う。   (C) The reference area before binarization (here, the face area of) is divided by the separation curve Cs (FIG. 10). As a result, the reference area (here, the face area of) is divided into a bright part AH containing many bright pixels and a dark part AS containing many dark pixels. In the following calculation, each pixel corresponding to the above-described enclave in the bright part AH and the dark part AS is treated as an invalid pixel (a pixel not used in the calculation).

(d)明部AHの平均輝度IHと、暗部ASの平均輝度ISとの差(IH−IS)を、参照領域(ここでは顔領域of)の明暗差として算出する。   (D) The difference (IH−IS) between the average brightness IH of the bright part AH and the average brightness IS of the dark part AS is calculated as the brightness difference of the reference area (here, the face area of).

(e)明部AHにおける明るさ重心ghと、暗部ASにおける暗さ重心gsとを算出する(図11)。なお、明るさ重心とは、輝度の高い画素ほど大きな重みが付される重み付け平均座標のことであり、暗さ重心とは、輝度の低い画素ほど大きな重みが付される重み付け平均座標のことである。   (E) The brightness centroid gh in the bright part AH and the dark centroid gs in the dark part AS are calculated (FIG. 11). The brightness centroid is a weighted average coordinate to which a higher weight is assigned to a pixel with higher luminance, and the dark centroid is a weighted average coordinate to be assigned a higher weight to a pixel with lower luminance. is there.

(f)明るさ重心ghから暗さ重心gsに向かう方向の単位ベクトルを、参照領域(ここでは顔領域of)の明暗ベクトルとして算出する(図12)。   (F) A unit vector in the direction from the brightness centroid gh to the dark centroid gs is calculated as the brightness vector of the reference area (here, the face area of) (FIG. 12).

ステップS16−5:ホワイトバランス調整回路15は、参照領域(ここでは顔領域of)の明暗差が所定の閾値を超過しているか否かを判別し、超過していた場合は、詳細画像の撮影が斜光撮影であったとみなしてステップS16−6へ移行し、超過していなかった場合は、詳細画像の撮影が順光撮影又は逆光撮影あったとみなしてステップS16−11へ移行する。   Step S16-5: The white balance adjustment circuit 15 determines whether or not the brightness difference of the reference area (here, the face area of) exceeds a predetermined threshold value. If it is not oblique shooting, the process proceeds to step S16-6. If not, the process proceeds to step S16-11 because it is assumed that the detailed image has been captured in backlight or backlight.

よって、例えば図4に示すとおり主要被写体(ここでは人物)がランプで主に斜め方向から照明されていた場合は、参照領域(ここでは顔領域of)の一部のみに影が発生するので明暗差は大きくなり、詳細画像の撮影は斜光撮影であったとみなされる。   Therefore, for example, as shown in FIG. 4, when the main subject (here, a person) is illuminated mainly from an oblique direction with a lamp, a shadow is generated only in a part of the reference area (here, the face area of). The difference becomes large, and it is considered that the detailed image was captured obliquely.

一方、例えば図17(A)(詳細は後述)に示すとおり主要被写体(ここでは人物)が閃光で主に正面から照明されていた場合は、参照領域(ここでは顔領域of)に影が発生しないので明暗差は小さくなり、詳細画像の撮影は順光撮影又は逆光撮影であったとみなされる。   On the other hand, for example, as shown in FIG. 17A (details will be described later), when the main subject (here, a person) is mainly illuminated from the front with flash light, a shadow is generated in the reference area (here, the face area of). Therefore, the difference in brightness is reduced, and it is considered that the detailed image has been captured in the backlight or backlight mode.

また、例えば図18(A)(後詳細は後述)に示すとおり主要被写体(ここでは人物)が自然光で主に背後から照明されていた場合は、参照領域(ここでは顔領域of)のほぼ全体が影となるので明暗差は小さくなり、詳細画像の撮影は順光撮影又は逆光撮影であったとみなされる。   Further, for example, as shown in FIG. 18A (details will be described later), when the main subject (here, a person) is mainly illuminated from behind with natural light, almost the entire reference area (here, the face area of). Since the shadow becomes a shadow, the difference in brightness becomes small, and it is considered that the detailed image was captured in the backlight or backlight mode.

ステップS16−6:ホワイトバランス調整回路15は、主要被写体領域(ここでは人物領域o)に存在する物体(ここでは人物)の照明方向を、参照領域(ここでは顔領域of)の明暗ベクトルの方向と同じとみなす。   Step S16-6: The white balance adjustment circuit 15 determines the illumination direction of the object (here, a person) existing in the main subject area (here, the person area o) and the direction of the brightness vector of the reference area (here, the face area of). Is considered the same.

ステップS16−7:ホワイトバランス調整回路15は、主要被写体領域(ここでは人物領域o)の明るさ調整に必要な情報をCPU21へ出力する。それを受けたCPU21は、その情報に基づき階調変換パラメータ(階調変換領域及び階調変換特性)を作成し、画像処理回路14の階調変換処理部へ設定する。なお、この階調変換特性は、例えば図13に示したような変換特性であって、主要被写体領域(ここでは人物領域o)のうち明るい輝度範囲に属する画素の輝度を維持したまま、主要被写体領域(ここでは人物領域o)のうち暗い輝度範囲に属する画素の輝度を明るい輝度範囲へと持ち上げるような特性である。   Step S16-7: The white balance adjustment circuit 15 outputs information necessary for adjusting the brightness of the main subject area (here, the person area o) to the CPU 21. Receiving it, the CPU 21 creates tone conversion parameters (tone conversion region and tone conversion characteristics) based on the information and sets them in the tone conversion processing unit of the image processing circuit 14. This gradation conversion characteristic is, for example, a conversion characteristic as shown in FIG. 13, and the main subject is maintained while maintaining the luminance of the pixels belonging to the bright luminance range in the main subject region (here, the human region o). The characteristic is that the luminance of the pixels belonging to the dark luminance range in the region (here, the human region o) is raised to the bright luminance range.

よって、詳細画像の撮影が遮光撮影であった場合は、後に実行される階調変換処理(ステップS17)により、主要被写体領域(ここでは人物領域o)のうち影となっていた部分が図14に示すとおり明るく補正される。なお、ここでは明るさ調整の対象を主要被写体領域(ここでは人物領域o)の全域としたが、参照領域(ここでは顔領域of)のみに制限してもよい。   Therefore, when the detailed image is captured by shading, the shadowed portion of the main subject region (here, the human region o) is shown in FIG. 14 by the gradation conversion processing (step S17) executed later. The brightness is corrected as shown in. Here, the brightness adjustment target is the entire main subject region (here, the human region o), but may be limited to only the reference region (here, the facial region of).

ステップS16−8:ホワイトバランス調整回路15は、以下の手順(g)〜(h)により斜光撮影用の重みマップ(図15)を作成する。なお、ここでいう重みマップ(図15)は、光源らしさ度マップ(図6)を重み付けするためのマップである。   Step S16-8: The white balance adjusting circuit 15 creates a weight map (FIG. 15) for oblique photographing by the following procedures (g) to (h). Here, the weight map (FIG. 15) is a map for weighting the light source likelihood map (FIG. 6).

(g)主要被写体領域(ここでは人物領域o)の中心点Poから放射状に延びる複数の分割線によりマップ全域を複数の扇状領域に分割する(図15参照)。但し、主要被写体領域(ここでは人物領域o)については、それらの分割線で分割せずに1領域のままとする。また、それら分割線の配置関係は、中心点Poに向かう明暗ベクトルBoに関して対称であり、また、それら分割線の全ては、その明暗ベクトルBo上に重ならないよう配置される。   (G) The entire map is divided into a plurality of fan-shaped areas by a plurality of dividing lines extending radially from the center point Po of the main subject area (here, the person area o) (see FIG. 15). However, the main subject area (here, the person area o) is not divided by those dividing lines, and remains as one area. Further, the arrangement relationship of the dividing lines is symmetric with respect to the light / dark vector Bo toward the center point Po, and all the dividing lines are arranged so as not to overlap the light / dark vector Bo.

(h)マップ上の複数の扇状領域及び主要被写体領域(ここでは人物領域o)の各々に対して重み値を割り当てる。この際、中心点Poから見て照明方向の上流側(図の左上半分)に位置する複数の扇状領域には、比較的大きな重み値(+0.3〜+1)が割り当てられ、中心点Poから見て照明方向の下流側(図の右下半分)に位置する複数の扇状領域には、比較的小さな重み値(0)が割り当てられる。また、特に、中心点Poから見て照明方向の直上流に位置する特定の扇状領域(左上の扇状領域)に対しては、最大の重み値(+1)が割り当てられ、特定の扇状領域(左上の扇状領域)の近くに位置する扇状領域(周方向の位置が近い扇状領域)ほど大きな重み値が割り当てられる。また、マップ上の主要被写体領域(ここでは人物領域o)には、最大の重み値(+1)が割り当てられる。   (H) A weight value is assigned to each of the plurality of fan-shaped areas and the main subject area (here, the person area o) on the map. At this time, a relatively large weight value (+0.3 to +1) is assigned to the plurality of fan-like regions located on the upstream side in the illumination direction (upper left half in the figure) when viewed from the center point Po, and from the center point Po. A relatively small weight value (0) is assigned to a plurality of fan-shaped regions located on the downstream side in the illumination direction as viewed (lower right half in the figure). In particular, the maximum weight value (+1) is assigned to a specific fan-shaped area (upper-left fan-shaped area) located immediately upstream in the illumination direction when viewed from the center point Po, and the specific fan-shaped area (upper left) A larger weight value is assigned to a fan-shaped area located near the fan-shaped area (a fan-shaped area closer to the circumferential direction). Further, the maximum weight value (+1) is assigned to the main subject area (here, the person area o) on the map.

なお、ここでは、中心点Poから見て照明方向の下流側(図の右下半分)に位置する5つの扇状領域に対して共通の重み値(0)を割り当てたが、個別の重み値を割り当ててもよい。その場合は、特定の扇状領域(左上の扇状領域)の近くに位置する扇状領域ほど大きな重み値が割り当てられる。   Here, although a common weight value (0) is assigned to the five fan-shaped regions located on the downstream side in the illumination direction (lower right half in the figure) when viewed from the center point Po, individual weight values are assigned. It may be assigned. In that case, a larger weight value is assigned to a fan-shaped area located near a specific fan-shaped area (upper-left fan-shaped area).

ステップS16−9:ホワイトバランス調整回路15は、光源らしさ度マップ(図6)を重みマップ(図15)により重み付けし、重み付け後の光源らしさ度マップを取得する。この際、光源らしさ度マップの各領域の光源らしさ度へ乗算される重み値は、例えば、重みマップ上でその領域の中心座標の属する領域(扇状領域又は主要被写体領域)に割り当てられた重み値と同じに設定される。   Step S16-9: The white balance adjustment circuit 15 weights the light source likelihood map (FIG. 6) with the weight map (FIG. 15), and obtains a weighted light source likelihood map. At this time, the weight value multiplied by the light source likelihood degree of each area of the light source likelihood degree map is, for example, the weight value assigned to the area (fan-shaped area or main subject area) to which the center coordinates of the area belong on the weight map. Is set the same as

なお、本ステップで使用される重みマップの働きを可視化したのが、図16(A)、(B)、(C)、(D)である。図16(A)が詳細画像(斜光撮影の場合)であり、図16(B)が重み付け前の光源らしさ度マップであり、図16(C)が重みマップであり、図16(D)が重み付け後の光源らしさ度マップである。   FIGS. 16A, 16B, 16C, and 16D visualize the function of the weight map used in this step. FIG. 16A is a detailed image (in the case of oblique shooting), FIG. 16B is a light source likelihood degree map before weighting, FIG. 16C is a weight map, and FIG. It is a lightness-likeness degree map after weighting.

すなわち、(詳細画像の撮影が斜光撮影であった場合に)本ステップで使用される重みマップ(図16(C))には、主要被写体領域(ここでは人物領域o)から見て照明方向の下流側(右下半分)に位置する領域(例えば太陽領域a)の光源らしさ度を抑え、かつ、主要被写体領域(ここでは人物領域o)から見て照明方向の上流側(左上半分)に位置する領域(例えばランプ領域g、シェード領域g)の光源らしさ度を相対的に向上させるような働きがある。   In other words, the weight map (FIG. 16C) used in this step (when the detailed image is captured obliquely) has the illumination direction as viewed from the main subject area (here, the person area o). Suppressing the likelihood of a light source in an area (for example, the sun area a) located on the downstream side (lower right half) and located on the upstream side (upper left half) in the illumination direction when viewed from the main subject area (here, the person area o) There is a function of relatively improving the light source likelihood of the area to be performed (for example, the lamp area g and the shade area g).

ステップS16−10:ホワイトバランス調整回路15は、重み付け後の光源らしさ度マップから、光源らしさ度が最高である1又は複数の領域を見出し、その領域を、主要被写体(ここでは人物)を照明した光源の存在領域と判断する(以下、この領域を「光源領域」と称す。)。続いてホワイトバランス調整回路15は、その光源領域の平均色度を無彩色に近づけるためのホワイトバランスゲイン(又は無彩色化するためのホワイトバランスゲイン)を、主要被写体領域(ここでは人物領域o)にとって最適なホワイトバランスゲインとして算出する。   Step S16-10: The white balance adjustment circuit 15 finds one or a plurality of areas having the highest light source likelihood from the weighted light source likelihood degree map, and illuminates the main subject (here, a person) in the area. It is determined that the light source exists (hereinafter, this region is referred to as a “light source region”). Subsequently, the white balance adjustment circuit 15 sets a white balance gain (or a white balance gain for achromatic color) for making the average chromaticity of the light source region close to an achromatic color, and a main subject region (here, a human region o). Is calculated as an optimal white balance gain.

なお、図16(A)、(B)、(C)、(D)に示す例(斜光撮影)では、重み付け後の光源らしさ度が最高値となるのはランプ領域fなので、ランプ領域fの平均色度を無彩色に近づけるためのホワイトバランスゲイン(又は無彩色化するためのホワイトバランスゲイン)が、主要被写体領域(ここでは人物領域o)にとって最適なホワイトバランスゲインとして算出される。   In the examples shown in FIGS. 16A, 16B, 16C, and 16D (oblique shooting), the light source likelihood after weighting has the highest value in the lamp region f. A white balance gain for bringing the average chromaticity closer to an achromatic color (or a white balance gain for achromatic color) is calculated as an optimum white balance gain for the main subject area (here, the person area o).

但し、ホワイトバランス調整回路15は、重み付け後の光源らしさ度の最高値が閾値未満(例えば+2未満)であった場合には、最高値の属する1又は複数の領域の中から、更に、特定色の物体(例えば無彩色物体や人物の顔)が存在していると推定される部分領域を抽出し、その部分領域の平均色度をその物体の本来の色に近づけるためのホワイトバランスゲイン(又は本来の色にするためのホワイトバランスゲイン)を、主要被写体領域(ここでは人物領域o)にとって最適なホワイトバランスゲインとして算出する。   However, when the maximum value of the light source likelihood after weighting is less than a threshold value (for example, less than +2), the white balance adjustment circuit 15 further selects a specific color from one or more regions to which the highest value belongs. A white balance gain (or a white balance gain) for extracting a partial area where an object (for example, an achromatic color object or a human face) is present and making the average chromaticity of the partial area close to the original color of the object The white balance gain for obtaining the original color is calculated as the optimum white balance gain for the main subject area (here, the person area o).

そして、ホワイトバランス制御回路15は、算出したホワイトバランスゲインを詳細画像の各画素へ乗算することにより、ホワイトバランス調整後の詳細画像を取得し、CPU21へ完了通知を与え、図3のフローを終了する(なお、詳細画像に対して画像処理が施されるのは、図3のフローの終了後である。)。   The white balance control circuit 15 multiplies each pixel of the detailed image by the calculated white balance gain to obtain a detailed image after white balance adjustment, gives a completion notification to the CPU 21, and ends the flow of FIG. (Note that the image processing is performed on the detailed image after the end of the flow of FIG. 3).

ステップS16−11:ホワイトバランス調整回路15は、CPU21から与えられた撮影条件データに基づき、詳細画像の撮影が閃光撮影であったか否かを判別し、閃光撮影であった場合には、詳細画像の撮影が順光撮影であったとみなしてステップS16−12へ移行し、閃光撮影でなかった場合には、詳細画像の撮影が逆光撮影であったとみなしてステップS16−14へ移行する。   Step S16-11: The white balance adjustment circuit 15 determines whether or not the detailed image has been shot with flash photography based on the shooting condition data given from the CPU 21. The process proceeds to step S16-12 on the assumption that the photographing is a continuous light photographing, and if it is not the flash photographing, the photographing of the detailed image is regarded as the backlight photographing, and the process proceeds to step S16-14.

よって、例えば図17(A)に示すとおり主要被写体(ここでは人物)が閃光で主に正面から照明されていた場合は、詳細画像の撮影は順光撮影であったとみなされ、例えば図18(A)に示すとおり主要被写体(ここでは人物)が自然光で主に背後から照明されていた場合は、詳細画像の撮影は逆光撮影であったとみなされる。   Therefore, for example, as shown in FIG. 17A, when the main subject (here, a person) is mainly illuminated from the front with flash light, it is considered that the detailed image has been captured in the front light. For example, FIG. As shown in A), when the main subject (here, a person) is illuminated mainly by natural light from behind, it is considered that the shooting of the detailed image is the backlight shooting.

ステップS16−12:ホワイトバランス調整回路15は、主要被写体領域(ここでは人物領域o)に存在する物体(ここでは人物)の照明方向を、参照領域(ここでは顔領域of)の明暗ベクトルに拘わらず、順方向(手前から奥へ向かう方向)とみなす。   Step S16-12: The white balance adjustment circuit 15 relates the illumination direction of the object (here, a person) existing in the main subject area (here, the person area o) to the brightness vector of the reference area (here, the face area of). It is regarded as the forward direction (the direction from the front to the back).

ステップS16−13:ホワイトバランス調整回路15は、以下の手順(g)〜(h)により順光撮影用の重みマップを作成し、ステップS16−9へ移行する。   Step S16-13: The white balance adjustment circuit 15 creates a weight map for follow light photography by the following procedures (g) to (h), and proceeds to step S16-9.

(g)マップ全域を、主要被写体領域(ここでは人物領域o)と、それ以外の背景領域とに分割する。   (G) The entire map is divided into a main subject area (here, a person area o) and a background area other than that.

(h)マップ上の主要被写体領域(ここでは人物領域o)に対して比較的高い重み値(+1)を割り当て、マップ上の背景領域に対して比較的低い重み値(0)を割り当てる。   (H) A relatively high weight value (+1) is assigned to the main subject area (here, the person area o) on the map, and a relatively low weight value (0) is assigned to the background area on the map.

なお、図17(A)、(B)、(C)、(D)には、本ステップで作成される重みマップの働きを示した。図17(A)が詳細画像(順光撮影の場合)であり、図17(B)が重み付け前の光源らしさ度マップであり、図17(C)が重みマップであり、図17(D)が重み付け後の光源らしさ度マップである。   Note that FIGS. 17A, 17B, 17C, and 17D show the function of the weight map created in this step. FIG. 17A is a detailed image (in the case of direct light imaging), FIG. 17B is a light source likelihood degree map before weighting, FIG. 17C is a weight map, and FIG. Is a weighted lightness likelihood degree map.

すなわち、本ステップで作成される重みマップ(図17(C))には、背景領域の光源らしさ度を抑え、主要被写体領域(ここでは人物領域o)の光源らしさ度を相対的に向上させるような働きがある。   That is, in the weight map created in this step (FIG. 17C), the degree of light source in the background area is suppressed, and the degree of light source in the main subject area (here, the person area o) is relatively improved. There is a good work.

ステップS16−14:ホワイトバランス調整回路15は、詳細画像の主要被写体領域(ここでは人物領域o)の絵柄又は参照領域(ここでは顔領域of)の絵柄が逆光撮影の特徴を有しているか否かを判別し、有していた場合には、詳細画像の撮影が逆光撮影であったとみなしてステップS16−15へ移行し、有していなかった場合には、詳細画像の撮影が順光撮影であったとみなして前述したステップS16−12へ移行する。   Step S16-14: The white balance adjustment circuit 15 determines whether or not the pattern of the main subject area (here, the person area o) or the reference area (here, the face area of) of the detailed image has a backlight photographing feature. If so, the process proceeds to step S16-15, and if not, the detailed image is captured in the following light. It moves to step S16-12 mentioned above.

ステップS16−15:ホワイトバランス調整回路15は、主要被写体領域(ここでは人物領域o)に存在する物体(ここでは人物)の照明方向を、参照領域(ここでは顔領域of)の明暗ベクトルに拘わらず、逆光方向(奧から手前へ向かう方向)とみなす。   Step S16-15: The white balance adjustment circuit 15 relates the illumination direction of the object (here, a person) existing in the main subject area (here, the person area o) to the brightness vector of the reference area (here, the face area of). It is regarded as the backlight direction (the direction from the heel to the front).

ステップS16−16:ホワイトバランス調整回路15は、主要被写体領域(ここでは人物領域o)の明るさ調整に必要な情報をCPU21へ出力する。それを受けたCPU21は、その情報に基づき階調変換パラメータ(階調変換領域及び階調変換特性)を作成し、画像処理回路14の階調変換処理部へ設定する。なお、この階調変換特性は、例えば図13に示した変換特性であって、主要被写体領域(ここでは人物領域o)のうち明るい輝度範囲に属する画素の輝度を維持したまま、主要被写体領域(ここでは人物領域o)のうち暗い輝度範囲に属する画素の輝度を明るい輝度範囲へと持ち上げるような特性である。   Step S16-16: The white balance adjustment circuit 15 outputs information necessary for adjusting the brightness of the main subject area (here, the person area o) to the CPU 21. Receiving it, the CPU 21 creates tone conversion parameters (tone conversion region and tone conversion characteristics) based on the information and sets them in the tone conversion processing unit of the image processing circuit 14. This gradation conversion characteristic is, for example, the conversion characteristic shown in FIG. 13, and maintains the luminance of the pixels belonging to the bright luminance range in the main subject region (here, the human region o) while maintaining the main subject region ( Here, the characteristic is such that the luminance of the pixels belonging to the dark luminance range in the human region o) is raised to the bright luminance range.

よって、詳細画像の撮影が逆光撮影であった場合は、後に実行される階調変換処理(ステップS17)により、主要被写体領域(ここでは人物領域o)のうち影となっていた部分(逆光撮影の場合は人物の大部分)が明るく補正される。なお、ここでは明るさ調整の対象を主要被写体領域(ここでは人物領域o)の全域としたが、参照領域(ここでは顔領域of)のみに制限してもよい。   Therefore, when the detailed image is captured by backlighting, the shadowed portion (backlighting) of the main subject region (here, the person region o) is obtained by a gradation conversion process (step S17) executed later. In the case of, most of the person) is corrected brightly. Here, the brightness adjustment target is the entire main subject region (here, the human region o), but may be limited to only the reference region (here, the facial region of).

ステップS16−17:ホワイトバランス調整回路15は、以下の手順(g)〜(h)により逆光撮影用の重みマップを作成し、ステップS16−9へ移行する。   Step S16-17: The white balance adjustment circuit 15 creates a weight map for backlight shooting according to the following procedures (g) to (h), and proceeds to step S16-9.

(g)マップ全体を、主要被写体領域(ここでは人物領域o)と、それ以外の背景領域とに分割する。   (G) The entire map is divided into a main subject area (here, a person area o) and other background areas.

(h)マップ上の主要被写体領域(ここでは人物領域o)に対して比較的低い重み値(0)を割り当て、マップ上の背景領域に対して比較的高い重み値(+1)を割り当てる。   (H) A relatively low weight value (0) is assigned to the main subject area (here, the person area o) on the map, and a relatively high weight value (+1) is assigned to the background area on the map.

なお、図18(A)、(B)、(C)、(D)には、本ステップで作成される重みマップの働きを示した。図18(A)が詳細画像(逆光撮影の場合)であり、図18(B)が重み付け前の光源らしさ度マップであり、図18(C)が重みマップであり、図18(D)が重み付け後の光源らしさ度マップである。     18A, 18B, 18C, and 18D show the function of the weight map created in this step. 18A is a detailed image (in the case of backlight photographing), FIG. 18B is a light source likelihood degree map before weighting, FIG. 18C is a weight map, and FIG. 18D is FIG. It is a lightness-likeness degree map after weighting.

すなわち、本ステップで作成される重みマップ(図18(C))には、主要被写体領域(ここでは人物領域o)の光源らしさ度を抑え、背景領域の光源らしさ度を相対的に向上させるような働きがある(以上、ステップS16−17の説明。)。   That is, the weight map (FIG. 18C) created in this step suppresses the light source likelihood of the main subject region (here, the human region o) and relatively improves the light source likelihood of the background region. (Therefore, description of step S16-17.)

以上、本実施形態のホワイトバランス調整回路15は、主要被写体(ここでは人物)の照明方向を反映した重みマップ(図16(C)、図17(C)、図18(C))により、光源らしさ度マップ(図16(B)、図17(B)、図18(B))を重み付けしてから、ホワイトバランスゲインを算出する。   As described above, the white balance adjustment circuit 15 of the present embodiment uses the weight map (FIGS. 16C, 17C, and 18C) reflecting the illumination direction of the main subject (here, a person) to generate a light source. After the weighting degree maps (FIG. 16B, FIG. 17B, and FIG. 18B) are weighted, the white balance gain is calculated.

これらの重みマップ(図16(C)、図17(C)、図18(C))は何れも、主要被写体領域(ここでは人物領域o)から見て照明方向の上流側に位置する領域の光源らしさ度を相対的に向上させ、下流側に位置する領域の光源らしさ度を相対的に抑える働きがある。   Each of these weight maps (FIG. 16C, FIG. 17C, and FIG. 18C) is an area located upstream of the illumination direction as viewed from the main subject area (here, the person area o). There is a function of relatively improving the light source likelihood and relatively suppressing the light source likelihood of the region located on the downstream side.

したがって、本実施形態のホワイトバランス調整回路15は、主要被写体(ここでは人物)を照明した光源が、主要被写体領域(ここでは人物領域o)から見て何れの方向に存在していたとしても、主要被写体領域(ここでは人物領域o)に最適なホワイトバランスゲインを確実に算出することができる。   Therefore, the white balance adjustment circuit 15 according to the present embodiment, regardless of the direction in which the light source that illuminates the main subject (here, a person) is seen from the main subject area (here, the person area o), It is possible to reliably calculate the optimum white balance gain for the main subject area (here, the person area o).

また、本実施形態のホワイトバランス調整回路15は、主要被写体(ここでは人物)の照明方向を推測する際に、詳細画像の撮影が斜光撮影、逆光撮影、順光撮影の何れであるかを考慮し、更に、詳細画像の撮影が斜光撮影であった場合には、主要被写体領域(ここでは人物領域o)の中の参照領域(ここでは顔領域of)の明暗ベクトルを考慮する。したがって、本実施形態のホワイトバランス調整回路15は、照明方向の異なる様々な撮影シーンに対応することができる。   In addition, the white balance adjustment circuit 15 of the present embodiment considers whether the detailed image shooting is oblique shooting, backlight shooting, or backlight shooting when estimating the illumination direction of the main subject (here, a person). In addition, when the detailed image is captured obliquely, the brightness vector of the reference area (here, the face area of) in the main subject area (here, the person area o) is considered. Therefore, the white balance adjustment circuit 15 of this embodiment can cope with various shooting scenes with different illumination directions.

なお、本実施形態のホワイトバランス調整回路15は、ステップS16−10で算出したホワイトバランスゲインの適用先を詳細画像の全域としたが、主要被写体領域(ここでは人物領域o)のみとしてもよい。但し、その場合は、背景領域に適用されるホワイトバランスゲインについては、別途算出する必要がある。なお、その場合は、背景領域に適用されるホワイトバランスゲインを、主要被写体領域(ここでは人物領域o)に適用されるホワイトバランスゲインと同様に算出してもよい。つまり、上述したホワイトバランスゲインの算出手順は、主要被写体領域以外の領域に対しても、適用可能である。   In the white balance adjustment circuit 15 of the present embodiment, the application destination of the white balance gain calculated in step S16-10 is the entire area of the detailed image, but it may be only the main subject area (here, the person area o). However, in that case, it is necessary to separately calculate the white balance gain applied to the background region. In this case, the white balance gain applied to the background area may be calculated in the same manner as the white balance gain applied to the main subject area (here, the person area o). That is, the above-described white balance gain calculation procedure can be applied to regions other than the main subject region.

また、上述した図15(重みマップ)では、周方向における分割線の配置ピッチを30°としたが、周方向における分割線の配置ピッチを30°以外の値に設定してもよい。例えば、演算を簡単にするため、90°、180°などと粗く設定してもよい。   Further, in FIG. 15 (weight map) described above, the arrangement pitch of the dividing lines in the circumferential direction is set to 30 °, but the arrangement pitch of the dividing lines in the circumferential direction may be set to a value other than 30 °. For example, in order to simplify the calculation, it may be set roughly as 90 °, 180 °, or the like.

また、上述した図15(斜光撮影用の重みマップ)では、周方向における分割線の配置ピッチを均等としたが、不均等でもよい。例えば、照明方向の上流側(図の左上半分)の配置ピッチを細かく設定し、照明方向の下流側(図の右下半分)の配置ピッチを粗く設定してもよい(因みに、図15の例では、配置ピッチは均等であったが、下流側の複数の扇状領域へ共通の重み値を割り当てたため、下流側の配置ピッチを粗くしたのと同じ効果が得られる。)。   Further, in FIG. 15 described above (weighted map for oblique shooting), the arrangement pitch of the dividing lines in the circumferential direction is made uniform, but it may be uneven. For example, the arrangement pitch on the upstream side in the illumination direction (upper left half in the figure) may be set finely, and the arrangement pitch on the downstream side in the illumination direction (lower right half in the figure) may be set coarsely (refer to the example in FIG. 15). The arrangement pitch is uniform, but since the common weight value is assigned to the plurality of downstream fan-shaped regions, the same effect as when the arrangement pitch on the downstream side is made coarse is obtained.

また、上述した図15(斜光撮影用の重みマップ)は、重み値を領域毎に割り当てているので、重み値の分布は階段状になるが、重み値を位置毎(例えば周位置毎)に割り当てることにより、重み値の分布を滑らかにしてもよい。但し、重み値を領域毎に割り当てた方が、重み付けに要する演算を簡略化することができるので、望ましい。   Further, in FIG. 15 described above (weight map for oblique photographing), the weight value is assigned to each region, so the distribution of the weight value is stepped, but the weight value is set for each position (for example, for each circumferential position). By assigning, the distribution of weight values may be smoothed. However, it is preferable to assign a weight value to each region because the calculation required for weighting can be simplified.

また、ステップS16−2におけるホワイトバランス調整回路15は、詳細画像を、サイズ及び形状が互いに異なる複数の領域に分割したが、詳細画像を、サイズ及び形状が共通の複数の領域(例えば複数の矩形領域)に分割してもよい。   In addition, the white balance adjustment circuit 15 in step S16-2 divides the detailed image into a plurality of regions having different sizes and shapes, but the detailed image is divided into a plurality of regions (for example, a plurality of rectangles having the same size and shape). It may be divided into (regions).

また、本実施形態のホワイトバランス調整回路15は、ホワイトバランスゲインの算出に使用する画像を、詳細画像それ自体としたが、算出に要する演算量を軽減するため、詳細画像の代わりに、詳細画像のサイズ縮小版としてもよい。また、メインの撮像素子11とは別に、被写界の色度分布(及び輝度分布)を監視するサブの撮像素子(測光センサ)が電子カメラ1に備えられていた場合には、ホワイトバランスゲインの算出に使用する画像を、サブの撮像素子が取得した画像としてもよい。   Further, the white balance adjustment circuit 15 of the present embodiment uses the detailed image itself as the image used for calculating the white balance gain. However, in order to reduce the amount of calculation required for the calculation, the detailed image is used instead of the detailed image. It is good also as a size reduction version. In addition, when the electronic camera 1 is provided with a sub image sensor (photometric sensor) that monitors the chromaticity distribution (and luminance distribution) of the object field separately from the main image sensor 11, the white balance gain The image used for the calculation may be an image acquired by the sub image sensor.

また、本実施形態の電子カメラ1は、ホワイトバランス調整を撮影時に行ったが、同様のホワイトバランス調整をRAW画像の再生時に(RAW画像の現像処理の1種として)行ってもよい。その場合、ステップS16−11における判別は、RAW画像ファイルに付加された撮影条件データに基づき行えばよい。   In the electronic camera 1 according to the present embodiment, the white balance adjustment is performed at the time of photographing. However, the same white balance adjustment may be performed at the time of reproducing the RAW image (as one type of RAW image development processing). In this case, the determination in step S16-11 may be performed based on the shooting condition data added to the RAW image file.

また、本実施形態は、電子カメラの実施形態であったが、ホワイトバランス調整に拘わる電子カメラの動作を、電子カメラとは別体で設けられた画像処理装置、例えば、電子フォトフレーム、プリンタ、コンピュータなどに実行させてもよい。また、その動作を汎用コンピュータに実行させる場合は、その動作のコンピュータプログラムが通信網又は記憶媒体を介してコンピュータへインストールされることになる。   In addition, the present embodiment is an embodiment of an electronic camera, but the operation of the electronic camera related to white balance adjustment is an image processing apparatus provided separately from the electronic camera, such as an electronic photo frame, a printer, It may be executed by a computer or the like. When the general-purpose computer executes the operation, the computer program for the operation is installed in the computer via a communication network or a storage medium.

11…撮像素子、12…信号処理回路、13…バッファメモリ、14…画像処理回路、15…ホワイトバランス調整回路、16…表示制御回路、17…内部モニタ、18…圧縮・伸張回路、19…カードインタフェース、21…CPU、22…撮像回路、23…入力器、24…外部接続端子、30…ストロボ装置 DESCRIPTION OF SYMBOLS 11 ... Image sensor, 12 ... Signal processing circuit, 13 ... Buffer memory, 14 ... Image processing circuit, 15 ... White balance adjustment circuit, 16 ... Display control circuit, 17 ... Internal monitor, 18 ... Compression / decompression circuit, 19 ... Card Interface, 21 ... CPU, 22 ... Imaging circuit, 23 ... Input device, 24 ... External connection terminal, 30 ... Strobe device

Claims (7)

カラーの撮影画像を入力する入力手段と、
前記画像上の複数の領域の各々から、その領域の色が光源色を示している可能性の高さを示す評価値を抽出する抽出手段と、
前記複数の領域の一部である特定領域に写っている被写体の照明方向を推測する推測手段と、
抽出された複数の前記評価値の前記画像上の分布を、前記照明方向に応じた重み分布で重み付けする重み付け手段と、
重み付け後に高い値を示した評価値の抽出元領域の色を前記被写体の照明色とみなして前記特定領域へ適用すべきホワイトバランス調整量を算出する算出手段と、
を備え
前記特定領域に写っている被写体が人物か否かに応じて、前記照明方向を推測する領域の選択基準が異なることを特徴とする画像処理装置。
An input means for inputting a color photographed image;
Extraction means for extracting an evaluation value indicating the high possibility that the color of the region indicates the light source color from each of the plurality of regions on the image;
A guessing means for guessing the illumination direction of a subject in a specific area that is a part of the plurality of areas;
Weighting means for weighting the distribution of the plurality of extracted evaluation values on the image with a weight distribution according to the illumination direction;
A calculating means for calculating a white balance adjustment amount to be applied to the specific area by regarding the color of the extraction source area of the evaluation value showing a high value after weighting as the illumination color of the subject;
Equipped with a,
2. An image processing apparatus according to claim 1, wherein a selection criterion for the area for estimating the illumination direction differs depending on whether or not the subject in the specific area is a person .
請求項1に記載の画像処理装置において、
前記推測手段は、
前記特定領域内の明部から暗部へ向かう明暗方向を前記照明方向とみなす
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
The inference means is
An image processing apparatus characterized in that a bright and dark direction from a bright part to a dark part in the specific region is regarded as the illumination direction.
請求項2に記載の画像処理装置において、
前記推測手段は、
前記照明方向に拘わらず、前記特定領域内の明部と暗部との明暗差が閾値未満の場合は、前記画像の手前から奥へ向かう順光方向を前記照明方向とみなす
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 2,
The inference means is
Regardless of the illumination direction, when the brightness difference between the bright part and the dark part in the specific area is less than a threshold value, the forward light direction from the front to the back of the image is regarded as the illumination direction. Processing equipment.
請求項3に記載の画像処理装置において、
前記推測手段は、
前記特定領域内の明部と暗部との明暗差が閾値未満であったとしても、前記画像の撮影が逆光撮影であった場合は、前記画像の奥から手前へ向かう逆光方向を前記照明方向とみなす
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 3.
The inference means is
Even if the brightness difference between the bright part and the dark part in the specific area is less than the threshold value, if the image is captured by backlighting, the backlight direction from the back to the front of the image is referred to as the illumination direction. An image processing apparatus characterized by being regarded.
請求項1〜請求項4の何れか一項に記載の画像処理装置において、
前記重み付け手段は、
前記照明方向の下流側の重みよりも前記照明方向の上流側の重みを高く設定する
ことを特徴とする画像処理装置。
In the image processing device according to any one of claims 1 to 4,
The weighting means is
An image processing apparatus, wherein a weight on the upstream side in the illumination direction is set higher than a weight on the downstream side in the illumination direction.
カラーの撮影画像を取得する撮像手段と、
前記撮像手段が取得した画像の特定領域へ適用すべきホワイトバランス調整量を算出する、請求項1〜請求項5の何れか一項に記載の画像処理装置と、
を備えたことを特徴とする撮像装置。
Imaging means for acquiring a color photographed image;
The image processing apparatus according to any one of claims 1 to 5, wherein a white balance adjustment amount to be applied to a specific area of an image acquired by the imaging unit is calculated;
An imaging apparatus comprising:
カラーの撮影画像を入力する入力手順と、
前記画像上の複数の領域の各々から、その領域の色が光源色を示している可能性の高さを示す評価値を抽出する抽出手順と、
前記複数の領域の一部である特定領域に写っている被写体の照明方向を推測する推測手順と、
抽出された複数の前記評価値の前記画像上の分布を、前記照明方向に応じた重み分布で重み付けする重み付け手順と、
重み付け後に高い値を示した評価値の抽出元領域の色を前記被写体の照明色とみなして前記特定領域へ適用すべきホワイトバランス調整量を算出する算出手順と、
前記特定領域に写っている被写体が人物か否かに応じて、前記照明方向を推測する領域の選択基準を変える手順と、
をコンピュータに実行させることを特徴とする画像処理プログラム。
Input procedure to input color shot image,
From each of the plurality of regions on the image, an extraction procedure for extracting an evaluation value indicating a high possibility that the color of the region indicates a light source color;
A guessing procedure for guessing the illumination direction of a subject in a specific area that is a part of the plurality of areas;
A weighting procedure for weighting a distribution on the image of the plurality of extracted evaluation values with a weight distribution according to the illumination direction;
A calculation procedure for calculating a white balance adjustment amount to be applied to the specific region by regarding the color of the extraction source region of the evaluation value indicating a high value after weighting as the illumination color of the subject;
A procedure for changing a selection criterion of an area for estimating the illumination direction according to whether or not a subject in the specific area is a person,
An image processing program for causing a computer to execute.
JP2010218952A 2010-09-29 2010-09-29 Image processing apparatus, imaging apparatus, and image processing program Expired - Fee Related JP5732799B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010218952A JP5732799B2 (en) 2010-09-29 2010-09-29 Image processing apparatus, imaging apparatus, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010218952A JP5732799B2 (en) 2010-09-29 2010-09-29 Image processing apparatus, imaging apparatus, and image processing program

Publications (2)

Publication Number Publication Date
JP2012074963A JP2012074963A (en) 2012-04-12
JP5732799B2 true JP5732799B2 (en) 2015-06-10

Family

ID=46170708

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010218952A Expired - Fee Related JP5732799B2 (en) 2010-09-29 2010-09-29 Image processing apparatus, imaging apparatus, and image processing program

Country Status (1)

Country Link
JP (1) JP5732799B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10055824B2 (en) 2014-03-28 2018-08-21 Nec Corporation Image correction device, image correction method and storage medium
JP6381404B2 (en) * 2014-10-23 2018-08-29 キヤノン株式会社 Image processing apparatus and method, and imaging apparatus

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4258824B2 (en) * 1998-05-20 2009-04-30 株式会社セガ Image processing apparatus, image processing method, and recording medium
US6417850B1 (en) * 1999-01-27 2002-07-09 Compaq Information Technologies Group, L.P. Depth painting for 3-D rendering applications
US7113633B2 (en) * 2001-07-02 2006-09-26 Photoinaphoto.Com, Inc. System and method for discovering and categorizing attributes of a digital image
JP2006148486A (en) * 2004-11-18 2006-06-08 Canon Inc Imaging apparatus and white balance control value calculation method
JP4284448B2 (en) * 2005-01-28 2009-06-24 富士フイルム株式会社 Image processing apparatus and method

Also Published As

Publication number Publication date
JP2012074963A (en) 2012-04-12

Similar Documents

Publication Publication Date Title
US10397486B2 (en) Image capture apparatus and method executed by image capture apparatus
JP5089405B2 (en) Image processing apparatus, image processing method, and imaging apparatus
CN106664364B (en) Image processing apparatus, control method therefor, and image capturing apparatus
CN110022469B (en) Image processing method, image processing device, storage medium and electronic equipment
JP2007201979A (en) Exposure control apparatus and imaging apparatus
US9591231B2 (en) Image processing apparatus capable of properly emphasizing differences in brightness between bright spots, image processing method, and storage medium
JP6381404B2 (en) Image processing apparatus and method, and imaging apparatus
JP2019106045A (en) Image processing device, method, and program
KR20120071192A (en) Digital photographing apparatus and control method thereof
JP5316070B2 (en) Imaging device
US11115637B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
JP2021128791A (en) Image processing apparatus, image processing method, and program
JP2010072619A (en) Exposure operation device and camera
JP2009065350A (en) Image processor, image processing method, and storage medium
JP4979090B2 (en) Image processing apparatus, image processing method, program, and recording medium
JP5732799B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP2010050651A (en) White balance controller and imaging device using the same, and white balance control method
JP5414216B2 (en) Imaging apparatus, control method thereof, and program
US11405562B2 (en) Image processing apparatus, method of controlling the same, image capturing apparatus, and storage medium
JP4885079B2 (en) Digital camera, photographing method and photographing program
JP5199908B2 (en) Imaging apparatus and control method thereof
JP2007288245A (en) Imaging apparatus, image processing method, and image processing program
JP5058903B2 (en) Image processing apparatus, image processing method, program, and recording medium
US11265524B2 (en) Image processing apparatus, image processing method, and storage medium
JP4461892B2 (en) Electronic camera having color cast adjustment function by special light source, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130926

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140716

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140729

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140929

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20150317

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150330

R150 Certificate of patent or registration of utility model

Ref document number: 5732799

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees