JP2015015676A - Image processing device, and method and program of controlling the same - Google Patents

Image processing device, and method and program of controlling the same Download PDF

Info

Publication number
JP2015015676A
JP2015015676A JP2013142593A JP2013142593A JP2015015676A JP 2015015676 A JP2015015676 A JP 2015015676A JP 2013142593 A JP2013142593 A JP 2013142593A JP 2013142593 A JP2013142593 A JP 2013142593A JP 2015015676 A JP2015015676 A JP 2015015676A
Authority
JP
Japan
Prior art keywords
specular reflection
light source
area
image
light
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.)
Withdrawn
Application number
JP2013142593A
Other languages
Japanese (ja)
Inventor
宏史 鈴木
Hiroshi Suzuki
宏史 鈴木
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.)
Canon Inc
Original Assignee
Canon 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 Canon Inc filed Critical Canon Inc
Priority to JP2013142593A priority Critical patent/JP2015015676A/en
Publication of JP2015015676A publication Critical patent/JP2015015676A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To select a region where a mirror surface reflection component is extracted in an image, and to perform light source color estimation with accuracy.SOLUTION: When performing light source color estimation processing for estimating a light source color of a light source in an image obtained by photographing a subject in such a photographing environment that the light source is present, an image processing unit 105 detects a mirror surface reflection candidate region where mirror surface reflection by the light source may occur and a periphery region located at the periphery of the mirror surface reflection candidate region, in a first image obtained by photographing the subject while making auxiliary light be in a non-light-emission state, and extracts a reflection light component by the auxiliary light on the basis of the first image, and a second image obtained by photographing the subject while emitting the auxiliary light. The image processing unit compares the reflection light components in the mirror surface reflection candidate region and in the peripheral region with each other, and determines whether or not the mirror surface reflection candidate region is the mirror surface reflection region where mirror surface reflection by the light source occurs, and performs the light source color estimation processing by using the determined mirror surface reflection region.

Description

本発明は、画像処理装置、その制御方法、および制御プログラムに関し、特に、画像に存在する被写体(被写体像)を照明する光源の色を推定する光源色推定処理を行う画像処理装置に関する。   The present invention relates to an image processing apparatus, a control method therefor, and a control program, and more particularly to an image processing apparatus that performs light source color estimation processing for estimating the color of a light source that illuminates a subject (subject image) present in an image.

一般に、デジタルカメラなどの撮像装置において、2色性反射モデルに基づいて光源色の推定を行う画像処理装置を備えるものが知られている。2色性反射モデルは、物体からの反射光が鏡面反射成分と拡散反射成分とから成り立つとするモデルである。   In general, an imaging apparatus such as a digital camera is known that includes an image processing apparatus that estimates a light source color based on a dichroic reflection model. The dichroic reflection model is a model in which reflected light from an object is composed of a specular reflection component and a diffuse reflection component.

鏡面反射成分は、光源色に依存する特徴を有するので、反射光から鏡面反射成分を抽出することによって光源色の推定を行うことができる。   Since the specular reflection component has characteristics depending on the light source color, the light source color can be estimated by extracting the specular reflection component from the reflected light.

例えば、入力画像の近接する画素間において画像値の差分を求めて、当該差分から鏡面反射成分を抽出して光源色推定を行うようにした画像処理装置がある(特許文献1参照)。   For example, there is an image processing apparatus that obtains a difference in image values between adjacent pixels of an input image, extracts a specular reflection component from the difference, and performs light source color estimation (see Patent Document 1).

特開2007−13415号公報JP 2007-13415 A

ところで、特許文献1に記載の画像処理装置においては、画素間に輝度差分が存在する場合に鏡面反射が生じていると看做して光源色推定を行うようにしている。   By the way, in the image processing apparatus described in Patent Document 1, light source color estimation is performed assuming that specular reflection occurs when there is a luminance difference between pixels.

しかしながら、輝度差分は必ずしも鏡面反射成分に起因するとは限らず、例えば、赤色被写体と黒色被写体との境界付近における物体色の差に起因して輝度差分が存在することがある。   However, the luminance difference is not necessarily caused by the specular reflection component. For example, the luminance difference may exist due to the difference in the object color near the boundary between the red subject and the black subject.

このように、輝度差分が鏡面反射成分に依存しないと、輝度差分から鏡面反射成分を抽出することができず、結果的に精度よく光源色推定を行うことができないことになる。   Thus, if the luminance difference does not depend on the specular reflection component, the specular reflection component cannot be extracted from the luminance difference, and as a result, the light source color cannot be accurately estimated.

従って、本発明の目的は、画像において鏡面反射成分を抽出する領域を選定して、精度よく光源色推定を行うことができる画像処理装置、その制御方法、および制御プログラムを提供することにある。   Therefore, an object of the present invention is to provide an image processing apparatus, a control method thereof, and a control program that can select a region from which a specular reflection component is extracted in an image and accurately estimate a light source color.

上記の目的を達成するため、本発明による画像処理装置は、光源が存在する撮影環境で被写体を撮影して得られた画像において前記光源の光源色を推定する光源色推定処理を行う画像処理装置であって、予め定められた補助光を非発光として前記被写体を撮影して得られた第1の画像において前記光源による鏡面反射が生じている可能性がある鏡面反射候補領域と当該鏡面反射候補領域の周辺に位置する周辺領域とを検出する鏡面反射領域検出手段と、前記第1の画像と前記補助光を発光させて前記被写体を撮影して得られた第2の画像とに基づいて前記補助光による反射光成分を抽出する反射光抽出手段と、前記鏡面反射候補領域および前記周辺領域における前記反射光成分を比較して、当該比較結果に応じて前記鏡面反射候補領域が前記光源による鏡面反射が生じる鏡面反射領域であるか否かを特定する特定手段と、前記鏡面反射領域を用いて前記光源色推定処理を行う光源色推定手段と、を有することを特徴とする。   In order to achieve the above object, an image processing apparatus according to the present invention performs a light source color estimation process for estimating a light source color of a light source in an image obtained by photographing a subject in a photographing environment where the light source exists. In the first image obtained by photographing the subject without using predetermined auxiliary light, the specular reflection candidate region in which specular reflection by the light source may occur and the specular reflection candidate Based on a specular reflection region detecting means for detecting a peripheral region located around the region, the first image and a second image obtained by photographing the subject by emitting the auxiliary light. The reflected light extraction means for extracting the reflected light component by the auxiliary light is compared with the reflected light component in the specular reflection candidate area and the peripheral area, and the specular reflection candidate area is determined according to the comparison result. Specifying means for specifying whether the specular reflection area that specular reflection is caused by the source, and having a light source color estimation means for performing said light source color estimation processing using the specular reflection region.

本発明による制御方法は、光源が存在する撮影環境で被写体を撮影して得られた画像において前記光源の光源色を推定する光源色推定処理を行う画像処理装置の制御方法であって、予め定められた補助光を非発光として前記被写体を撮影して得られた第1の画像において前記光源による鏡面反射が生じている可能性がある鏡面反射候補領域と当該鏡面反射候補領域の周辺に位置する周辺領域とを検出する鏡面反射領域検出ステップと、前記第1の画像と前記補助光を発光させて前記被写体を撮影して得られた第2の画像とに基づいて前記補助光による反射光成分を抽出する反射光抽出ステップと、前記鏡面反射候補領域および前記周辺領域における前記反射光成分を比較して、当該比較結果に応じて前記鏡面反射候補領域が前記光源による鏡面反射が生じる鏡面反射領域であるか否かを特定する特定ステップと、前記鏡面反射領域を用いて前記光源色推定処理を行う光源色推定ステップと、を有することを特徴とする。   A control method according to the present invention is a control method for an image processing apparatus that performs light source color estimation processing for estimating a light source color of a light source in an image obtained by photographing a subject in a photographing environment where a light source exists, and is determined in advance. In the first image obtained by photographing the subject with the auxiliary light not emitted, the specular reflection candidate area where the specular reflection by the light source may occur is located around the specular reflection candidate area A reflected light component by the auxiliary light based on a specular reflection area detecting step for detecting a peripheral area, and a second image obtained by photographing the subject by emitting the first light and the auxiliary light. The reflected light extraction step of extracting the reflected light component in the specular reflection candidate area and the peripheral area is compared, and the specular reflection candidate area is determined by the light source according to the comparison result. A specifying step of specifying whether the specular reflection region where reflection occurs, and having a light source color estimation step of the light source color estimation processing using the specular reflection region.

本発明による制御プログラムは、光源が存在する撮影環境で被写体を撮影して得られた画像において前記光源の光源色を推定する光源色推定処理を行う画像処理装置で用いられる制御プログラムであって、前記画像処理装置が備えるコンピュータに、予め定められた補助光を非発光として前記被写体を撮影して得られた第1の画像において前記光源による鏡面反射が生じている可能性がある鏡面反射候補領域と当該鏡面反射候補領域の周辺に位置する周辺領域とを検出する鏡面反射領域検出ステップと、前記第1の画像と前記補助光を発光させて前記被写体を撮影して得られた第2の画像とに基づいて前記補助光による反射光成分を抽出する反射光抽出ステップと、前記鏡面反射候補領域および前記周辺領域における前記反射光成分を比較して、当該比較結果に応じて前記鏡面反射候補領域が前記光源による鏡面反射が生じる鏡面反射領域であるか否かを特定する特定ステップと、前記鏡面反射領域を用いて前記光源色推定処理を行う光源色推定ステップと、を実行させることを特徴とする。   A control program according to the present invention is a control program used in an image processing apparatus that performs a light source color estimation process for estimating a light source color of the light source in an image obtained by photographing a subject in a photographing environment where a light source exists. A specular reflection candidate area in which a specular reflection by the light source may occur in the first image obtained by photographing the subject without emitting predetermined auxiliary light to a computer provided in the image processing apparatus And a specular reflection region detecting step for detecting a peripheral region located around the specular reflection candidate region, and a second image obtained by photographing the subject by emitting the first image and the auxiliary light The reflected light extraction step for extracting the reflected light component by the auxiliary light based on the above and the reflected light component in the specular reflection candidate area and the peripheral area are compared. A step of specifying whether or not the specular reflection candidate region is a specular reflection region in which specular reflection by the light source occurs according to the comparison result, and a light source that performs the light source color estimation process using the specular reflection region And a color estimation step.

本発明によれば、第1の画像において鏡面反射候補領域とその周辺領域とを検出し、第1の画像と第2の画像とに基づいて補助光による反射光成分を抽出する。そして、鏡面反射候補領域および周辺領域における反射光成分を比較して、鏡面反射候補領域が光源による鏡面反射が生じる鏡面反射領域であるか否かを特定し、鏡面反射領域を用いて光源色推定処理を行うようにしたので、精度よく光源色推定を行うことができる。   According to the present invention, the specular reflection candidate region and its peripheral region are detected in the first image, and the reflected light component by the auxiliary light is extracted based on the first image and the second image. Then, the reflected light components in the specular reflection candidate area and the peripheral area are compared to determine whether the specular reflection candidate area is a specular reflection area where specular reflection is caused by the light source, and light source color estimation is performed using the specular reflection area Since the process is performed, the light source color can be estimated with high accuracy.

本発明の第1の実施形態による画像処理装置の一例である撮像装置の構成を説明するためのブロック図であり、(a)は撮像装置の構成を示すブロック図、(b)は(a)に示す画像処理部の構成を示すブロック図である。BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram for explaining a configuration of an imaging apparatus that is an example of an image processing apparatus according to a first embodiment of the present invention, where (a) is a block diagram showing the configuration of the imaging apparatus, and (b) is (a). It is a block diagram which shows the structure of the image process part shown in FIG. 図1に示すカメラによる被写体の撮影の一例を説明するための図である。It is a figure for demonstrating an example of imaging | photography of the to-be-photographed object by the camera shown in FIG. 図1に示すカメラで行われる光源色推定処理を説明するためのフローチャートである。It is a flowchart for demonstrating the light source color estimation process performed with the camera shown in FIG. 図3に示す鏡面反射候補領域および周辺領域検出処理を説明するためのフローチャートである。It is a flowchart for demonstrating a specular reflection candidate area | region and surrounding area detection process shown in FIG. 図3に示す反射光抽出処理を説明するためのフローチャートである。It is a flowchart for demonstrating the reflected light extraction process shown in FIG. 図1(a)に示すカメラに備えられた第1の差分および第2の差分を格納するための反射光データ格納領域の一例を示す図である。It is a figure which shows an example of the reflected light data storage area for storing the 1st difference and 2nd difference with which the camera shown to Fig.1 (a) was equipped. 図3に示す鏡面反射領域特定処理を説明するためのフローチャートである。It is a flowchart for demonstrating the specular reflection area | region specific process shown in FIG. 図3に示すホワイトバランスゲイン算出処理を説明するためのフローチャートである。4 is a flowchart for explaining white balance gain calculation processing shown in FIG. 3. 本発明の第2の実施形態によるカメラで行われる光源色推定処理を説明するためのフローチャートである。It is a flowchart for demonstrating the light source color estimation process performed with the camera by the 2nd Embodiment of this invention. 本発明の第2の実施形態によるカメラに備えられた画像処理部で行われる画像の分割を示す図である。It is a figure which shows the division | segmentation of the image performed by the image process part with which the camera by the 2nd Embodiment of this invention was equipped. 図9に示す鏡面反射候補領域および周辺領域検出処理を説明するためのフローチャートである。10 is a flowchart for explaining a specular reflection candidate area and peripheral area detection process shown in FIG. 9. 図11に示すグループ分割処理を説明するためのフローチャートである。12 is a flowchart for explaining the group division processing shown in FIG. 11. 本発明の第2の実施形態による画像処理部で行われる画素のグループ分類の結果を示す分類テーブル(データ構造)の一例を説明するための図である。It is a figure for demonstrating an example of the classification table (data structure) which shows the result of the group classification of the pixel performed in the image process part by the 2nd Embodiment of this invention. 図9に示す補助光の反射光抽出処理を説明するためのフローチャートである。10 is a flowchart for explaining reflected light extraction processing of auxiliary light shown in FIG. 9. 本発明の第2の実施形態によるカメラに備えられた反射光データ格納領域の一例を示す図である。It is a figure which shows an example of the reflected light data storage area with which the camera by the 2nd Embodiment of this invention was equipped. 図9に示す鏡面反射領域特定処理を説明するためのフローチャートである。It is a flowchart for demonstrating the specular reflection area | region specific process shown in FIG. 鏡面反射領域であると特定したブロックに対してフラグを格納するフラグ格納領域の一例を示す図である。It is a figure which shows an example of the flag storage area which stores a flag with respect to the block identified as a specular reflection area. 図9に示すホワイトバランスゲイン算出処理を説明するためのフローチャートである。10 is a flowchart for explaining white balance gain calculation processing shown in FIG. 9.

以下、本発明の実施の形態による画像処理装置の一例について図面を参照して説明する。なお、ここでは、画像処理装置の一つであるデジタルカメラなどの撮像装置を例に挙げて説明する。   Hereinafter, an example of an image processing apparatus according to an embodiment of the present invention will be described with reference to the drawings. Here, an imaging apparatus such as a digital camera which is one of the image processing apparatuses will be described as an example.

[第1の実施形態]
図1は、本発明の第1の実施形態による画像処理装置の一例である撮像装置の構成を説明するためのブロック図である。そして、図1(a)は撮像装置の構成を示すブロック図であり、図1(b)は図1(a)に示す画像処理部の構成を示すブロック図である。
[First Embodiment]
FIG. 1 is a block diagram for explaining a configuration of an imaging apparatus which is an example of an image processing apparatus according to the first embodiment of the present invention. FIG. 1A is a block diagram illustrating the configuration of the imaging apparatus, and FIG. 1B is a block diagram illustrating the configuration of the image processing unit illustrated in FIG.

図示の撮像装置は、例えば、デジタルカメラ(以下単にカメラと呼ぶ)100であり、撮影レンズユニット(以下単に撮影レンズと呼ぶ)101を備えている。撮影レンズ101の後段には、絞り機能を備えるシャッター102が配置されている。撮影レンズ101を介して入射した被写体像(光学像)は撮像部103に結像する。   The illustrated imaging apparatus is, for example, a digital camera (hereinafter simply referred to as a camera) 100 and includes a photographing lens unit (hereinafter simply referred to as a photographing lens) 101. A shutter 102 having an aperture function is disposed at the rear stage of the photographing lens 101. A subject image (optical image) incident through the photographing lens 101 is formed on the imaging unit 103.

撮像部103はCCD又はCMOS素子などの撮像素子を有しており、光学像に応じた電気信号(アナログ画像信号)を出力する。このアナログ画像信号はA/D変換器104によってデジタル画像信号に変換して、当該デジタル画像信号を画像処理部105に与える。   The imaging unit 103 has an imaging element such as a CCD or CMOS element, and outputs an electrical signal (analog image signal) corresponding to the optical image. The analog image signal is converted into a digital image signal by the A / D converter 104, and the digital image signal is given to the image processing unit 105.

画像処理部105は、デジタル画像信号に応じてTTL(スルー・ザ・レンズ)方式のAF(オートフォーカス)処理、AE(自動露出)処理、およびEF(フラッシュプリ発光)処理を行う。さらに、画像処理部105はデジタル画像信号に対してAWB(オートホワイトバランス)処理などを行って、画像データとして出力する。   The image processing unit 105 performs TTL (through-the-lens) AF (autofocus) processing, AE (automatic exposure) processing, and EF (flash pre-flash) processing according to the digital image signal. Further, the image processing unit 105 performs AWB (auto white balance) processing on the digital image signal and outputs the image data.

メモリ制御部107はシステム制御部110の制御下でメモリ106を制御して、画像処理部105で得られた画像データを所定の形式でメモリ106に書き込む。さらに、メモリ制御部107はA/D変換器104の出力であるデジタル画像信号を受けて、D/A変換器108を介して当該デジタル画像信号に応じた画像を表示部109に表示する。   The memory control unit 107 controls the memory 106 under the control of the system control unit 110 and writes the image data obtained by the image processing unit 105 into the memory 106 in a predetermined format. Further, the memory control unit 107 receives the digital image signal which is the output of the A / D converter 104 and displays an image corresponding to the digital image signal on the display unit 109 via the D / A converter 108.

また、メモリ制御部107はメモリ106に記録された画像データを読み込んで、D/A変換器108を介して当該画像データに応じた画像を表示部109に表示する。   The memory control unit 107 also reads the image data recorded in the memory 106 and displays an image corresponding to the image data on the display unit 109 via the D / A converter 108.

不揮発性メモリ124は、電気的に消去および記録可能なメモリであって、例えば、EEPROMが用いられる。そして、不揮発性メモリ124には、システム制御部110の動作用の定数およびプログラムなどが記憶される。ここで、プログラムとは、例えば、後述するフローチャートを実行するためのプログラムである。   The nonvolatile memory 124 is an electrically erasable and recordable memory. For example, an EEPROM is used. The nonvolatile memory 124 stores constants and programs for operating the system control unit 110. Here, the program is, for example, a program for executing a flowchart described later.

システム制御部110はカメラ100全体の制御を司る。システム制御部110は不揮発性メモリ124に記録されたプログラムを実行して、後述する各処理を行う。システムメモリ125には、例えば、RAMが用いられる。システムメモリ125には、システム制御部110の動作用の定数、変数、および不揮発性メモリ124から読み出されたプログラムなどを展開される。   The system control unit 110 controls the entire camera 100. The system control unit 110 executes a program recorded in the nonvolatile memory 124 and performs each process described later. For example, a RAM is used as the system memory 125. In the system memory 125, constants and variables for operation of the system control unit 110, a program read from the nonvolatile memory 124, and the like are expanded.

なお、システム制御部はメモリ107、D/A変換器108、および表示部109などを制御して表示制御を行う。   The system control unit performs display control by controlling the memory 107, the D / A converter 108, the display unit 109, and the like.

カメラ100にはインタフェース(I/F)111が備えられており、このI/F111には画像データを記録するための記録媒体112が接続される。さらに、システム制御部110には、操作部120、電源スイッチ121、および電源制御部122が接続され、電源制御部122には電源部(例えば、電池)123が接続されている。また、カメラ100には、補助光発光装置201が着脱可能に取り付けられており、システム制御部110は補助光発光装置201を発光制御する。   The camera 100 is provided with an interface (I / F) 111, and a recording medium 112 for recording image data is connected to the I / F 111. Furthermore, an operation unit 120, a power switch 121, and a power supply control unit 122 are connected to the system control unit 110, and a power supply unit (for example, a battery) 123 is connected to the power supply control unit 122. The auxiliary light emitting device 201 is detachably attached to the camera 100, and the system control unit 110 controls the light emission of the auxiliary light emitting device 201.

操作部120はユーザによって操作され、ユーザは操作部120を用いてカメラ100の動作を指示する。電源制御部122は電源部121からシステム制御部110に電力を供給するとともに、電源部121の装着の有無、電源部121の種類、および電池残量の検出を行う。   The operation unit 120 is operated by a user, and the user instructs the operation of the camera 100 using the operation unit 120. The power supply control unit 122 supplies power from the power supply unit 121 to the system control unit 110, and detects whether the power supply unit 121 is attached, the type of the power supply unit 121, and the remaining battery level.

図1(b)に示すように、画像処理部105は、鏡面反射候補領域検出部131、反射光検出部132、鏡面反射領域特定部133、およびホワイトバランス(WB)ゲイン算出部134を有している。なお、画像処理部105における光源色推定処理については後述する。   As shown in FIG. 1B, the image processing unit 105 includes a specular reflection candidate area detection unit 131, a reflected light detection unit 132, a specular reflection area specification unit 133, and a white balance (WB) gain calculation unit 134. ing. The light source color estimation process in the image processing unit 105 will be described later.

図2は、図1に示すカメラ100による被写体の撮影の一例を説明するための図である。   FIG. 2 is a diagram for explaining an example of photographing a subject by the camera 100 shown in FIG.

ここでは、カメラ100によって撮影対象の被写体202を撮影しようとする。図示の撮影環境では、色温度が不明である光源200が存在する。補助光発光装置201はカメラ100による撮影と同期して発光する。この補助光発光装置201による発光の色温度は既知である。   Here, an attempt is made to photograph the subject 202 to be photographed by the camera 100. In the illustrated shooting environment, there is a light source 200 whose color temperature is unknown. The auxiliary light emitting device 201 emits light in synchronization with photographing by the camera 100. The color temperature of light emitted by the auxiliary light emitting device 201 is known.

ここで、図1に示すカメラ100において被写体202を撮影する際の動作について概説する。   Here, an outline of the operation when photographing the subject 202 in the camera 100 shown in FIG. 1 will be described.

前述のように、撮像部103は、撮影レンズ101およびシャッター102を介して入射した光学像に応じたアナログ画像信号を出力する。そして、A/D変換器104は当該アナログ画像信号をデジタル画像信号に変換して、画像処理部105に出力する。   As described above, the imaging unit 103 outputs an analog image signal corresponding to an optical image incident through the photographing lens 101 and the shutter 102. The A / D converter 104 converts the analog image signal into a digital image signal and outputs the digital image signal to the image processing unit 105.

画像処理部105は、A/D変換器104の出力であるデジタル画像信号又はメモリ制御部107から送られる画像データに対して、ガンマ処理およびノイズリダクション処理などを行う。また、画像処理部105は後述する光源色推定処理を行って、AWB(オートホワイトバランス)処理を行う。   The image processing unit 105 performs gamma processing, noise reduction processing, and the like on the digital image signal output from the A / D converter 104 or the image data sent from the memory control unit 107. Further, the image processing unit 105 performs a light source color estimation process, which will be described later, and performs an AWB (auto white balance) process.

画像処理部105の出力である画像データは、システム制御部110の制御下でI/F111を介して記録媒体112に記録される。前述のように、補助光発光装置201はシステム制御部110によって制御され、撮影に同期して補助光を発光する。   Image data that is an output of the image processing unit 105 is recorded on the recording medium 112 via the I / F 111 under the control of the system control unit 110. As described above, the auxiliary light emitting device 201 is controlled by the system control unit 110 and emits auxiliary light in synchronization with photographing.

ここで、図1(b)を参照して、光源色推定処理について説明する。なお、図1(b)においては、光源色推定処理に必要なブロックのみが示されている。   Here, the light source color estimation process will be described with reference to FIG. In FIG. 1B, only blocks necessary for the light source color estimation process are shown.

鏡面反射候補領域検出部131は、メモリ制御部107から送られた画像データについて光源による鏡面反射が生じている可能性がある鏡面反射候補領域とその周辺領域とを検出して、鏡面反射候補領域検出結果としてメモリ106に格納する。   The specular reflection candidate area detecting unit 131 detects a specular reflection candidate area in which specular reflection by the light source may occur in the image data sent from the memory control unit 107 and its peripheral area, and the specular reflection candidate area The detection result is stored in the memory 106.

反射光抽出部132は、鏡面反射候補領域検出部131による鏡面反射候補領域検出結果および画像データに基づいて、補助光発光装置201から照射されて被写体202などで反射した光の反射光を抽出して、反射光抽出結果としてメモリ106に格納する。   The reflected light extraction unit 132 extracts reflected light of the light emitted from the auxiliary light emitting device 201 and reflected by the subject 202 or the like based on the specular reflection candidate region detection result and the image data by the specular reflection candidate region detection unit 131. And stored in the memory 106 as the reflected light extraction result.

鏡面反射領域特定部133は、反射光抽出部132で抽出された反射光抽出結果に基づいて、鏡面反射候補領域から鏡面反射領域を特定して、鏡面反射領域特定結果としてメモリ106に格納する。ホワイトバランスゲイン算出部134は鏡面反射領域特定部133で特定された鏡面反射領域特定結果に基づいてホワイトバランスゲインを算出する。   The specular reflection area specifying unit 133 specifies the specular reflection area from the specular reflection candidate area based on the reflected light extraction result extracted by the reflected light extraction unit 132 and stores the specular reflection area in the memory 106 as the specular reflection area specifying result. The white balance gain calculation unit 134 calculates a white balance gain based on the specular reflection region specification result specified by the specular reflection region specification unit 133.

このように、画像処理部105は鏡面反射候補領域を検出して、補助光による反射光を用いて、鏡面反射候補領域から鏡面反射領域を特定して光源色推定を行う。   As described above, the image processing unit 105 detects the specular reflection candidate region, specifies the specular reflection region from the specular reflection candidate region using the reflected light of the auxiliary light, and performs light source color estimation.

図3は、図1に示すカメラ100で行われる光源色推定処理を説明するためのフローチャートである。なお、図示のフローチャートに係る処理はシステム制御部110の制御下で行われる。   FIG. 3 is a flowchart for explaining a light source color estimation process performed by the camera 100 shown in FIG. Note that the processing according to the illustrated flowchart is performed under the control of the system control unit 110.

いま、ユーザによって操作部120に備えられたシャッターボタンが押されると、システム制御部110は補助光発光装置201による発光を停止した状態で、A/D変換器104からの出力であるデジタル画像信号を画像処理部105に送る。   Now, when the shutter button provided in the operation unit 120 is pressed by the user, the system control unit 110 stops the light emission by the auxiliary light emitting device 201 and outputs a digital image signal that is an output from the A / D converter 104. Is sent to the image processing unit 105.

なお、ここでは、補助光発光装置201の発光を停止した状態(非発光)で得られたデジタル画像信号を第1の画像と呼ぶ。   Here, a digital image signal obtained in a state where light emission of the auxiliary light emitting device 201 is stopped (non-light emission) is referred to as a first image.

続いて、システム制御部110は、第1の画像を取得した後、所定の時間内に補助光発光装置201を発光させて、A/D変換器104の出力であるデジタル画像信号を画像処理部105に送る。   Subsequently, after acquiring the first image, the system control unit 110 causes the auxiliary light emitting device 201 to emit light within a predetermined time, and outputs the digital image signal that is the output of the A / D converter 104 to the image processing unit. Sent to 105.

なお、ここでは、補助光発光装置201を発光させた状態で得られたデジタル画像信号を第2の画像と呼ぶ。但し、第1および第2の画像を撮影する際には、補助光発光装置201の発光および非発光以外の撮影条件は変更せず、第2の画像を撮影する際において飽和した領域は光源色推定処理に用いないものとする。   Here, a digital image signal obtained in a state where the auxiliary light emitting device 201 emits light is referred to as a second image. However, when shooting the first and second images, the shooting conditions other than the light emission and non-light emission of the auxiliary light emitting device 201 are not changed, and the saturated area when shooting the second image is the light source color. It shall not be used for estimation processing.

上述のようにして、システム制御部110は第1および第2の画像を撮影して(ステップS301)、これら第1および第2の画像を画像処理部105に送る。   As described above, the system control unit 110 captures the first and second images (step S301), and sends the first and second images to the image processing unit 105.

続いて、画像処理部105において、鏡面反射候補領域検出部131は、第1の画像から、被写体202を照らす光源200によって生じる鏡面反射の候補領域と周辺領域とを検出する(ステップS302)。なお、ステップS302による処理は後述する。   Subsequently, in the image processing unit 105, the specular reflection candidate area detection unit 131 detects a specular reflection candidate area and a peripheral area generated by the light source 200 that illuminates the subject 202 from the first image (step S302). The process in step S302 will be described later.

次に、反射光抽出部132は第1の画像および第2の画像からそれぞれ補助光の反射光を抽出する(ステップS303)。そして、鏡面反射領域特定部133はステップS303で抽出された補助光の反射光(つまり、鏡面反射候補領域における反射光成分と周辺領域における反射光成分との比較結果)に基づいて、第1および第2の画像における各画素が鏡面反射領域であるか否かを特定する(ステップS304)。   Next, the reflected light extraction unit 132 extracts the reflected light of the auxiliary light from the first image and the second image (step S303). Then, the specular reflection region specifying unit 133 performs the first and the second based on the reflected light of the auxiliary light extracted in step S303 (that is, the comparison result between the reflected light component in the specular reflection candidate region and the reflected light component in the peripheral region). It is specified whether or not each pixel in the second image is a specular reflection region (step S304).

続いて、ホワイトバランスゲイン算出部134は、ステップS304で鏡面反射領域であると特定された画素に応じてホワイトバランスゲインを算出して(ステップS305)、光源色推定処理を終了する。   Subsequently, the white balance gain calculation unit 134 calculates a white balance gain according to the pixel identified as the specular reflection region in step S304 (step S305), and ends the light source color estimation process.

図4は、図3に示す鏡面反射候補領域および周辺領域検出処理を説明するためのフローチャートである。   FIG. 4 is a flowchart for explaining the specular reflection candidate region and peripheral region detection processing shown in FIG.

領域検出処理を開始すると、鏡面反射候補領域検出部131は第1の画像において全画素について順次ループして(ステップS401)、ステップS402〜S403の処理を全画素について行う。鏡面反射候補領域検出部131は第1の画像において対象画素における画素値が当該対象画素の近傍画素の画素値よりも大きいか否かを判定する(ステップS402)。   When the area detection process is started, the specular reflection candidate area detection unit 131 sequentially loops for all pixels in the first image (step S401), and performs the processes of steps S402 to S403 for all pixels. The specular reflection candidate area detection unit 131 determines whether or not the pixel value of the target pixel in the first image is larger than the pixel value of the neighboring pixel of the target pixel (step S402).

ここでは、近傍画素として、対象画素を基準として左、右、上、および下のいずれか1方向に所定のd画素分離れた画素が近傍画素として選択される。なお、dは、例えば、10又は20が用いられるが、dの値は適宜変更してよい。   Here, as a neighboring pixel, a pixel separated by a predetermined d pixels in any one of left, right, top, and bottom with respect to the target pixel is selected as the neighboring pixel. For example, 10 or 20 is used as d, but the value of d may be changed as appropriate.

いま、対象画素の画素値をP(i,j)で表すと、対象画素から左にd画素離れた画素の画素値はP(i,j−d)と表すことができる。この両者の画素値の大きさを比較する際には、ノイズの影響を考慮して、所定の閾値T1(第1の閾値)を用いて次の式(1)を満たす場合には、つまり、差分が閾値T1よりも大きいと、鏡面反射候補領域検出部131は対象画素の画素値が近傍画素の画素値よりも大きいと判定する。   Now, if the pixel value of the target pixel is represented by P (i, j), the pixel value of the pixel that is d pixels away from the target pixel to the left can be represented as P (i, j-d). When comparing the magnitudes of the two pixel values, the following equation (1) is satisfied using a predetermined threshold T1 (first threshold) in consideration of the influence of noise, that is, When the difference is larger than the threshold value T1, the specular reflection candidate area detection unit 131 determines that the pixel value of the target pixel is larger than the pixel value of the neighboring pixel.

P(i,j)−P(i,j−d)>T1 (1)
画素値としてRGBを用いる際には、式(1)の代わりに次の式(2)〜式(4)を用いて、式(2)〜式(4)を満たす場合には、鏡面反射候補領域検出部131は対象画素の画素値が近傍画素の画素値よりも大きいと判定する。
P (i, j) -P (i, j-d)> T1 (1)
When RGB is used as the pixel value, the following formula (2) to formula (4) are used instead of formula (1), and when the formula (2) to formula (4) are satisfied, the specular reflection candidate The region detection unit 131 determines that the pixel value of the target pixel is larger than the pixel value of the neighboring pixels.

なお、画素値としてRGBを用いる場合、閾値T1のR成分をT1.Rとし、GおよびBについても同様に閾値をT1.GおよびT1.Bとする。   When RGB is used as the pixel value, the R component of the threshold T1 is set to T1. R and G and B are similarly set to threshold values T1. G and T1. B.

P(i,j).R−P(i,j−d).R>T1.R (2)
P(i,j).G−P(i,j−d).G>T1.G (3)
P(i,j).B−P(i,j−d).B>T1.B (4)
上述の例では、近傍画素として対象画素から左にd画素離れた画素を選択した場合について説明したが、近傍画素として対象画素から右、上、又は下にd画素離れた画素を選択した際においても同様にして比較が行われる。
P (i, j). RP (i, j-d). R> T1. R (2)
P (i, j). GP (i, j-d). G> T1. G (3)
P (i, j). BP (i, j-d). B> T1. B (4)
In the above-described example, the case where the pixel that is d pixels away from the target pixel is selected as the neighboring pixel has been described. However, when the pixel that is d pixels away from the target pixel right, up, or down is selected as the neighboring pixel. Are compared in the same way.

なお、画素値としてRGBを用いて比較を行う代わりに、RGBから輝度を算出して、当該輝度によって比較するようにしてもよい。   Instead of performing comparison using RGB as the pixel value, luminance may be calculated from RGB, and comparison may be performed based on the luminance.

対象画素の画素値が近傍画素の画素値以下であると(ステップS402において、NO)、つまり、差分が閾値以下であると、鏡面反射候補領域検出部131は次の画素を対象画素としてステップS402の処理を行う。   If the pixel value of the target pixel is equal to or smaller than the pixel value of the neighboring pixel (NO in step S402), that is, if the difference is equal to or smaller than the threshold value, the specular reflection candidate area detection unit 131 sets the next pixel as the target pixel in step S402. Perform the process.

一方、対象画素の画素値が近傍画素の画素値より大きいと(ステップS402において、YES)、つまり、近傍画素値と対象画素値との差分が閾値T1よりも大きいと、鏡面反射候補領域検出部131は当該対象画素を鏡面反射候補領域として、その近傍画素を周辺領域として検出する(ステップS403)。   On the other hand, if the pixel value of the target pixel is larger than the pixel value of the neighboring pixel (YES in step S402), that is, if the difference between the neighboring pixel value and the target pixel value is larger than the threshold value T1, the specular reflection candidate region detection unit 131 detects the target pixel as a specular reflection candidate area and its neighboring pixels as a peripheral area (step S403).

上述のようにして、全ての画素についてステップS402およびS403の処理を行うと、鏡面反射候補領域検出部131は全画素ループ端に達したとして(ステップS404)、鏡面反射候補領域および周辺領域検出処理を終了する。   As described above, when the processes of steps S402 and S403 are performed for all pixels, the specular reflection candidate area detection unit 131 reaches the end of all the pixel loops (step S404), and the specular reflection candidate area and peripheral area detection processing is performed. Exit.

図5は、図3に示す反射光抽出処理を説明するためのフローチャートである。   FIG. 5 is a flowchart for explaining the reflected light extraction processing shown in FIG.

反射光検出処理を開始すると、反射光抽出部132は第1および第2の画像の各々において全画素について順次ループして(ステップS501)、ステップS502〜S504の処理を全画素について行う。まず、反射光抽出部132は、図3に示すステップS302において対象画素が鏡面反射候補領域とされたか否かを判定する(ステップS502)。   When the reflected light detection process is started, the reflected light extraction unit 132 sequentially loops for all pixels in each of the first and second images (step S501), and performs the processing of steps S502 to S504 for all pixels. First, the reflected light extraction unit 132 determines whether or not the target pixel is a specular reflection candidate area in step S302 illustrated in FIG. 3 (step S502).

対象画素が鏡面反射候補領域でないと(ステップS502において、NO)、反射光抽出部132は次の画素を対象画素としてステップS502の処理を行う。   If the target pixel is not a specular reflection candidate region (NO in step S502), the reflected light extraction unit 132 performs the process of step S502 with the next pixel as the target pixel.

一方、対象画素が鏡面反射候補領域であると(ステップS502において、YES)、反射光抽出部132は第1および第2の画像において対応する対象画素の画素値の差分を求める(ステップS503)。ここでは、反射光抽出部132は対象画素について第2の画像の画素値から第1の画像の画素値を減算して差分D1(i,j)を求めて、当該差分(第1の差分)D1(i,j)を鏡面反射候補領域における補助光の反射光データ(反射光成分ともいう)とする。   On the other hand, if the target pixel is a specular reflection candidate area (YES in step S502), the reflected light extraction unit 132 obtains the difference between the pixel values of the corresponding target pixels in the first and second images (step S503). Here, the reflected light extraction unit 132 subtracts the pixel value of the first image from the pixel value of the second image for the target pixel to obtain the difference D1 (i, j), and the difference (first difference). Let D1 (i, j) be the reflected light data (also referred to as reflected light component) of the auxiliary light in the specular reflection candidate region.

なお、画素値はRGBで表されるので、差分を算出する際には、反射光抽出部132は次の式(5)〜式(7)を用いて差分を算出する。   Since the pixel value is expressed in RGB, when calculating the difference, the reflected light extraction unit 132 calculates the difference using the following equations (5) to (7).

D1(i,j).R=Q(i,j).R−P(i,j).R (5)
D1(i,j).G=Q(i,j).G−P(i,j).G (6)
D1(i,j).B=Q(i,j).B−P(i,j).B (7)
ここで、D1(i,j)は差分、P(i,j)は第1の画像の画素、Q(i,j)は第2の画像の画素を示す。
D1 (i, j). R = Q (i, j). RP (i, j). R (5)
D1 (i, j). G = Q (i, j). GP (i, j). G (6)
D1 (i, j). B = Q (i, j). BP (i, j). B (7)
Here, D1 (i, j) is a difference, P (i, j) is a pixel of the first image, and Q (i, j) is a pixel of the second image.

なお、ステップS503の処理で得られた差分D1(i,j)は、後述する対象画素の鏡面反射候補領域に格納される。   Note that the difference D1 (i, j) obtained by the processing in step S503 is stored in a specular reflection candidate area of the target pixel described later.

続いて、反射光抽出部132は対象画素に係る近傍画素について第2の画像の画素値から第1の画像の画素値を減算して差分D2(i,j)を求める。そして、反射光抽出部132は当該差分(第2の差分)D2(i,j)を周辺領域における補助光の反射光データとする。   Subsequently, the reflected light extraction unit 132 subtracts the pixel value of the first image from the pixel value of the second image for the neighboring pixels related to the target pixel to obtain a difference D2 (i, j). Then, the reflected light extraction unit 132 sets the difference (second difference) D2 (i, j) as reflected light data of auxiliary light in the peripheral region.

図6は、図1(a)に示すカメラ(ここでは、例えば、メモリ106)に備えられた第1の差分D1(i,j)および第2の差分D2(i,j)を格納するための反射光データ格納領域の一例を示す図である。   6 stores the first difference D1 (i, j) and the second difference D2 (i, j) provided in the camera (here, for example, the memory 106) shown in FIG. 1 (a). It is a figure which shows an example of the reflected light data storage area | region of.

図示の反射光データ格納領域は、鏡面反射候補領域欄および周辺領域欄を有しており、鏡面反射候補領域欄には第1の差分D1(i,j)が対象画素(画素No)毎に記録される。さらに、周辺領域欄には第2の差分D2(i,j)が対象画素毎に記録される。   The reflected light data storage area shown in the figure has a specular reflection candidate area column and a peripheral area column, and the first difference D1 (i, j) is included in the specular reflection candidate area column for each target pixel (pixel No). To be recorded. Further, the second difference D2 (i, j) is recorded for each target pixel in the peripheral area column.

なお、図6において、i=0〜L(Lは2以上の整数)であり、j=0〜N(Nは2以上の整数)である。   In FIG. 6, i = 0 to L (L is an integer of 2 or more), and j = 0 to N (N is an integer of 2 or more).

第2の差分D2(i,j)の算出手法については、第1の差分D1(i,j)の算出手法と同様であるため、ここでは説明を省略する。また、近傍画素を複数選択している場合には、近傍画素毎に算出した第2の差分D2(i,j)の平均値が対象画素の周辺領域に格納される。   Since the calculation method of the second difference D2 (i, j) is the same as the calculation method of the first difference D1 (i, j), description thereof is omitted here. When a plurality of neighboring pixels are selected, the average value of the second differences D2 (i, j) calculated for each neighboring pixel is stored in the peripheral area of the target pixel.

上述のようにして、全ての画素についてステップS502〜S504の処理を行うと、反射光抽出部132は全画素ループ端に達したとして(ステップS505)、反射光抽出処理を終了する。   As described above, when the processes of steps S502 to S504 are performed for all the pixels, the reflected light extraction unit 132 has reached the end of all the pixel loops (step S505), and the reflected light extraction process ends.

図7は、図3に示す鏡面反射領域特定処理を説明するためのフローチャートである。   FIG. 7 is a flowchart for explaining the specular reflection area specifying process shown in FIG.

鏡面反射領域特定処理を開始すると、鏡面反射領域特定部133は第1および第2の画像の各々において全画素について順次ループして(ステップS601)、ステップS602〜S604の処理を全画素について行う。   When the specular reflection area specifying process is started, the specular reflection area specifying unit 133 sequentially loops for all pixels in each of the first and second images (step S601), and performs the processing of steps S602 to S604 for all pixels.

まず、鏡面反射領域特定部133は、図3に示すステップS302において対象画素が鏡面反射候補領域とされたか否かを判定する(ステップS602)。対象画素が鏡面反射候補領域でないと(ステップS602において、NO)、鏡面反射領域特定部133は次の画素を対象画素としてステップS602の処理を行う。   First, the specular reflection area specifying unit 133 determines whether or not the target pixel is a specular reflection candidate area in step S302 illustrated in FIG. 3 (step S602). If the target pixel is not a specular reflection candidate area (NO in step S602), the specular reflection area specifying unit 133 performs the process of step S602 with the next pixel as the target pixel.

一方、対象画素が鏡面反射候補領域であると(ステップS602において、YES)、鏡面反射領域特定部133は対象画素とその近傍画素とにおいて補助光の反射光のレベルが近似するか否かを判定する(ステップS603)。   On the other hand, if the target pixel is a specular reflection candidate area (YES in step S602), the specular reflection area specifying unit 133 determines whether or not the level of the reflected light of the auxiliary light approximates the target pixel and its neighboring pixels. (Step S603).

ここでは、鏡面反射領域特定部133は所定の閾値T2(第2の閾値)と前述の反射光のデータ(つまり、第1および第2の差分)とを用いて、次の式(8)が満たされると、対象画素とその近傍画素とにおいて補助光の反射光のレベルが近似すると判定する。   Here, the specular reflection region specifying unit 133 uses the predetermined threshold value T2 (second threshold value) and the above-described reflected light data (that is, the first and second differences) to obtain the following equation (8). When satisfied, it is determined that the level of the reflected light of the auxiliary light is approximate between the target pixel and the neighboring pixels.

|D1(i,j)−D2(i,j)|<T2 (8)
なお、画素値がRGBで表される場合には、式(8)の代わりに、所定の閾値T2、T2、およびT2を用いて、鏡面反射領域特定部133は次の式(9)〜式(11)の全てが満たされると、対象画素とその近傍画素とにおいて補助光の反射光のレベルが近似すると判定する。
| D1 (i, j) -D2 (i, j) | <T2 (8)
When the pixel value is expressed in RGB, the specular reflection area specifying unit 133 uses the predetermined threshold values T2 R , T2 G , and T2 B instead of the formula (8), and the specular reflection area specifying unit 133 uses the following formula (9 If all of () to (11) are satisfied, it is determined that the level of the reflected light of the auxiliary light approximates the target pixel and its neighboring pixels.

|D1(i,j).R−D2(i,j).R|<T2 (9)
|D1(i,j).G−D2(i,j).G|<T2 (10)
|D1(i,j).B−D2(i,j).B|<T2 (11)
対象画素とその近傍画素とにおいて補助光の反射光のレベルが近似しないと(ステップS603において、NO)、鏡面反射領域特定部133はステップS602の処理に戻って、次の画素を対象画素としてステップS602の処理を行う。
| D1 (i, j). R-D2 (i, j). R | <T2 R (9)
| D1 (i, j). G-D2 (i, j). G | <T2 G (10)
| D1 (i, j). B-D2 (i, j). B | <T2 B (11)
If the level of the reflected light of the auxiliary light is not approximated in the target pixel and its neighboring pixels (NO in step S603), the specular reflection area specifying unit 133 returns to the process in step S602, and the next pixel is set as the target pixel. The process of S602 is performed.

一方、対象画素とその近傍画素とにおいて補助光の反射光のレベルが近似すると(ステップS603において、YES)、つまり、上記の式(8)が満たされると、鏡面反射領域特定部133は鏡面反射候補領域と周辺領域とは補助光の拡散反射率がほぼ等しく、同一被写体であると推定する。   On the other hand, when the level of the reflected light of the auxiliary light approximates the target pixel and its neighboring pixels (YES in step S603), that is, when the above formula (8) is satisfied, the specular reflection region specifying unit 133 performs specular reflection. It is estimated that the candidate area and the peripheral area have substantially the same diffuse reflectance of auxiliary light and are the same subject.

そして、鏡面反射領域特定部133は、鏡面反射領域が存在するため、鏡面反射候補領域における光源200の反射光と周辺領域における光源200の反射光とに差が生じるとして、鏡面反射候補領域は鏡面反射領域であると特定する(ステップS604)。   Then, since the specular reflection area exists, the specular reflection area specifying unit 133 assumes that there is a difference between the reflected light of the light source 200 in the specular reflection candidate area and the reflected light of the light source 200 in the peripheral area. The reflection area is identified (step S604).

なお、式(8)を満たさない場合には、鏡面反射領域特定部133は鏡面反射候補領域と周辺領域とは異なる被写体であるとして、鏡面反射候補領域は鏡面反射領域ではないとする。   When Expression (8) is not satisfied, the specular reflection area specifying unit 133 assumes that the specular reflection candidate area and the peripheral area are different subjects, and the specular reflection candidate area is not a specular reflection area.

上述のようにして、全ての画素についてステップS602〜S604の処理を行うと、鏡面反射領域特定部133は全画素ループ端に達したとして(ステップS605)、鏡面反射領域特定処理を終了する。   As described above, when the processes in steps S602 to S604 are performed for all the pixels, the specular reflection area specifying unit 133 reaches the end of all the pixel loops (step S605), and the specular reflection area specifying process ends.

図8は、図3に示すホワイトバランスゲイン算出処理を説明するためのフローチャートである。   FIG. 8 is a flowchart for explaining the white balance gain calculation processing shown in FIG.

ホワイトバランスゲイン算出処理を開始すると、WBゲイン算出部134は第1および第2の画像の各々において全画素について順次ループして(ステップS701)、ステップS702およびS703の処理を全画素について行う。   When the white balance gain calculation process is started, the WB gain calculation unit 134 sequentially loops for all pixels in each of the first and second images (step S701), and performs the processes of steps S702 and S703 for all pixels.

まず、WBゲイン算出部134は図3に示すステップS304において対象画素が鏡面反射領域と特定されたか否か否かを判定する(ステップS702)。対象画素が鏡面反射領域として特定されないと(ステップS702において、NO)、WBゲイン算出部134は次の画素を対象画素としてステップS702の処理を行う。   First, the WB gain calculation unit 134 determines whether or not the target pixel is specified as a specular reflection region in step S304 illustrated in FIG. 3 (step S702). If the target pixel is not specified as the specular reflection area (NO in step S702), the WB gain calculation unit 134 performs the process of step S702 with the next pixel as the target pixel.

一方、対象画素が鏡面反射領域として特定されると(ステップS702において、YES)、WBゲイン算出部134は第1の画像における対象画素の画素値RGBを用いて次の式(12)および式(13)に基づいて、当該対象画素に係るホワイトバランスゲインを算出する(ステップS703)。   On the other hand, when the target pixel is specified as the specular reflection area (YES in step S702), the WB gain calculation unit 134 uses the pixel value RGB of the target pixel in the first image to express the following formulas (12) and ( 13), the white balance gain relating to the target pixel is calculated (step S703).

GainR=G/R (12)
GainB=G/B (13)
そして、鏡面反射領域として特定された対象画素についてホワイトバランスゲインを次の式(14)および式(15)を用いて加算処理する。
GainR = G / R (12)
GainB = G / B (13)
Then, the white balance gain is added to the target pixel specified as the specular reflection region using the following equations (14) and (15).

SumGainR=ΣGainR (14)
SumGainB=ΣGainB (15)
ここでは、WBゲイン算出部134は加算処理を行う都度、加算画素数カウンタ(Count)を1ずつインクリメントする。
SumGainR = ΣGainR (14)
SumGainB = ΣGainB (15)
Here, each time the addition process is performed, the WB gain calculation unit 134 increments the addition pixel number counter (Count) by one.

上述のようにして、全ての画素についてステップS702およびS703の処理を行うと、WBゲイン算出部134は全画素ループ端に達したとして(ステップS704)、次の式(16)および式(17)に従って、画像全体におけるホワイトバランスゲインを算出する(ステップS705)。そして、WBゲイン算出部134はホワイトバランスゲイン算出処理を終了する。つまり、WBゲイン算出部134は光源色推定処理を終了する。   As described above, when the processing of steps S702 and S703 is performed for all the pixels, the WB gain calculation unit 134 has reached the end of all pixel loops (step S704), and the following equations (16) and (17) Accordingly, the white balance gain in the entire image is calculated (step S705). Then, the WB gain calculation unit 134 ends the white balance gain calculation process. That is, the WB gain calculation unit 134 ends the light source color estimation process.

TotalGainR=SumGainR/Count (16)
TotalGainB=SumGainB/Count (17)
このように、本発明の第1の実施形態では、補助光発光装置201で発光した際の反射光を用いて、被写体202を照らす光源200による鏡面反射領域を特定する。これによって、鏡面反射領域のみを用いてホワイトバランスゲインを算出することができる結果、画像におけるホワイトバランス補正の精度が向上する。
TotalGainR = SumGainR / Count (16)
TotalGainB = SumGainB / Count (17)
Thus, in the first embodiment of the present invention, the specular reflection region by the light source 200 that illuminates the subject 202 is specified using the reflected light when the auxiliary light emitting device 201 emits light. As a result, the white balance gain can be calculated using only the specular reflection region. As a result, the accuracy of white balance correction in the image is improved.

なお、第1の実施形態においては、第1および第2の画像の撮影は同一の画角で行われる。また、補助光の照射方向が光源の照射方向に重ならないように、補助光発光装置201の位置は適宜変更される。そして、補助光の照射方向と光源の照射方向とが異なる状態で撮影された画像が第2の画像とされる。   In the first embodiment, the first and second images are taken at the same angle of view. Further, the position of the auxiliary light emitting device 201 is appropriately changed so that the irradiation direction of the auxiliary light does not overlap the irradiation direction of the light source. And the image image | photographed in the state from which the irradiation direction of auxiliary light and the irradiation direction of a light source differ is made into a 2nd image.

鏡面反射候補領域における補助光の反射光と周辺領域における補助光の反射光との差分を算出して、この差分の色相が補助光と類似している場合には、補助光の鏡面反射光が強く含まれ、補助光の照射方向が光源の照射方向と重複するとされる。この際には、システム制御部110は補助光発光装置201の発光方向を調整する。   When the difference between the reflected light of the auxiliary light in the specular reflection candidate region and the reflected light of the auxiliary light in the peripheral region is calculated, and the hue of this difference is similar to the auxiliary light, the specular reflected light of the auxiliary light is It is strongly included, and the irradiation direction of the auxiliary light overlaps with the irradiation direction of the light source. At this time, the system control unit 110 adjusts the light emitting direction of the auxiliary light emitting device 201.

[第2の実施形態]
続いて、本発明の第2の実施形態による画像処理装置の一例である撮像装置について説明する。なお、第2の実施形態による撮像装置の構成は図1に示す撮像装置と同様である。
[Second Embodiment]
Next, an imaging apparatus which is an example of an image processing apparatus according to the second embodiment of the present invention will be described. The configuration of the imaging apparatus according to the second embodiment is the same as that of the imaging apparatus shown in FIG.

前述の第1の実施形態では、画素毎に鏡面反射領域であるか否かを判定して、当該判定結果に応じて光源色推定を行う例について説明した。第2の実施形態では、画像を所定のサイズのブロック(領域)に分割して、ブロック毎に鏡面反射領域が含まれるか否かを判定して、当該判定結果に応じて光源色推定を行う例について説明する。   In the first embodiment described above, an example has been described in which it is determined whether each pixel is a specular reflection region and light source color estimation is performed according to the determination result. In the second embodiment, an image is divided into blocks (regions) of a predetermined size, and it is determined whether or not a specular reflection region is included for each block, and light source color estimation is performed according to the determination result. An example will be described.

図9は、本発明の第2の実施形態によるカメラで行われる光源色推定処理を説明するためのフローチャートである。   FIG. 9 is a flowchart for explaining a light source color estimation process performed by the camera according to the second embodiment of the present invention.

なお、図示のフローチャートに係る処理はシステム制御部110の制御下で行われる。また、図9に示すフローチャートにおいて、図3に示すステップと同一のステップについて同一の参照符号を付して説明を省略する。   Note that the processing according to the illustrated flowchart is performed under the control of the system control unit 110. Further, in the flowchart shown in FIG. 9, the same steps as those shown in FIG.

図3に示すステップS301で説明したように、システム制御部110の制御下で画像処理部105は第1および第2の画像を得る。その後、画像処理部105において、鏡面反射候補領域検出部131は、第1および第2の画像の各々を所定の大きさのブロック(領域)に分割する(ステップS802)。   As described in step S <b> 301 shown in FIG. 3, the image processing unit 105 obtains the first and second images under the control of the system control unit 110. Thereafter, in the image processing unit 105, the specular reflection candidate area detection unit 131 divides each of the first and second images into blocks (areas) of a predetermined size (step S802).

図10は、本発明の第2の実施形態によるカメラに備えられた画像処理部で行われる画像の分割を示す図である。   FIG. 10 is a diagram showing image division performed by the image processing unit provided in the camera according to the second embodiment of the present invention.

図10に示す例では、第1の画像は縦方向に4分割、そして、横方向に5分割、合計20個のブロックに分割されている。同様にして、第2の画像についても、20個のブロックに分割される。   In the example shown in FIG. 10, the first image is divided into 20 blocks in total, which are divided into 4 parts in the vertical direction and 5 parts in the horizontal direction. Similarly, the second image is also divided into 20 blocks.

なお、図示の例では、第1および第2の画像の各々を4×5の計20個のブロックに分割しているが、ブロックのサイズ(大きさ)は任意であり、適宜最適な大きさに分割すればよい。但し、第1および第2の画像は同一の大きさのブロックに分割される。   In the example shown in the drawing, each of the first and second images is divided into a total of 20 blocks of 4 × 5. However, the size (size) of the block is arbitrary, and an optimal size is appropriately selected. What is necessary is just to divide into. However, the first and second images are divided into blocks of the same size.

再び、図9を参照して、上述のようにして第1および第2の画像の各々を複数のブロックに分割した後、画像処理部105は、後述するステップS803〜S806の処理を実行して、光源色推定処理を終了する。   Referring to FIG. 9 again, after each of the first and second images is divided into a plurality of blocks as described above, image processing unit 105 executes the processes of steps S803 to S806 described later. Then, the light source color estimation process is terminated.

なお、図9においては、後述するように、ブロック毎に鏡面反射領域が含まれるか否かを判定が判定される。   In FIG. 9, as described later, it is determined whether or not a specular reflection area is included for each block.

図11は、図9に示す鏡面反射候補領域および周辺領域検出処理を説明するためのフローチャートである。   FIG. 11 is a flowchart for explaining the specular reflection candidate area and peripheral area detection process shown in FIG. 9.

領域検出処理を開始すると、鏡面反射候補領域検出部131は、まず第1の画像について、ブロック毎に当該ブロックに含まれる画素値に基づいて画素を複数のグループに分けるグループ分割処理を行う(ステップS901)。   When the area detection process is started, the specular reflection candidate area detection unit 131 first performs a group division process for dividing the pixels into a plurality of groups for each block based on the pixel values included in the block for each first image (step S1). S901).

図12は、図11に示すグループ分割処理を説明するためのフローチャートである。   FIG. 12 is a flowchart for explaining the group division processing shown in FIG.

グループ分割処理を開始すると、鏡面反射候補領域検出部131は第1の画像において全ブロックについて順次ループして(ステップS1001)、続いて、グループ毎に全画素を順次ループし(ステップS1002)、ステップS1003〜S1005の処理を全画素について行う。   When the group division process is started, the specular reflection candidate area detection unit 131 sequentially loops all blocks in the first image (step S1001), and then sequentially loops all pixels for each group (step S1002). The processing of S1003 to S1005 is performed for all pixels.

鏡面反射候補領域検出部131はブロック毎に当該ブロックに含まれる画素毎の画素値Sを取得する(ステップS1003)。ここでは、画素値としてRGBを用いるものとする。続いて、鏡面反射候補領域検出部131は画素値(RGB)に応じて画素の輝度値Yを算出して、当該輝度値Yに応じて画素がいずれのグループに分類されるかを判定する(ステップS1004)。   The specular reflection candidate area detection unit 131 acquires a pixel value S for each pixel included in the block for each block (step S1003). Here, RGB is used as the pixel value. Subsequently, the specular reflection candidate area detection unit 131 calculates the luminance value Y of the pixel according to the pixel value (RGB), and determines which group the pixel is classified according to the luminance value Y ( Step S1004).

いま、輝度値Yが”0”〜”255”(なお、輝度値Yは”0”〜”255”の整数であるとする)の範囲で規定される場合、例えば、鏡面反射候補領域検出部131は輝度値Yが”0”以上”で15”以下であると、当該画素を第1のグループに分類する。同様にして、鏡面反射候補領域検出部131は輝度値Yが”16”以上で”31”以下であると、当該画素を第2のグループに分類する。このように、鏡面反射候補領域検出部131はブロックに拘わらず固定値を用いて画素のグループ分類を行う。   Now, when the luminance value Y is defined in the range of “0” to “255” (assuming that the luminance value Y is an integer from “0” to “255”), for example, a specular reflection candidate region detection unit If the luminance value Y is “0” or more and “15” or less, the pixel is classified into the first group. Similarly, when the luminance value Y is “16” or more and “31” or less, the specular reflection candidate region detection unit 131 classifies the pixel into the second group. As described above, the specular reflection candidate area detection unit 131 performs pixel group classification using a fixed value regardless of a block.

図13は、本発明の第2の実施形態による画像処理部で行われる画素のグループ分類の結果を示す分類テーブル(データ構造)の一例を説明するための図である。なお、図示の分類テーブルは、例えば、図1に示すメモリ106に格納される。   FIG. 13 is a diagram for explaining an example of a classification table (data structure) indicating a result of pixel group classification performed by the image processing unit according to the second embodiment of the present invention. The illustrated classification table is stored in, for example, the memory 106 shown in FIG.

図示の例では、補助光非発光時(つまり、第1の画像)に係る分類テーブル(以下第1の分類テーブルと呼ぶ)と補助光発光時(つまり、第2の画像)に係る分類テーブル(以下第2の分類テーブルと呼ぶ)がある。   In the illustrated example, a classification table (hereinafter referred to as a first classification table) related to non-assist light emission (that is, the first image) and a classification table (hereinafter referred to as the second image) related to auxiliary light emission (that is, the second image). Hereinafter referred to as a second classification table).

第1および第2の分類テーブルともにグループNo欄およびブロックNo欄を有し、これらグループNo欄およびブロックNo欄に対応付けてそれぞれ合計画素値(Sum)、合計画素数(Count)、および輝度平均値(Avg)が記録される。なお、図示の例では、グループは16のグループに分けられているが、適宜最適なグループ数とすればよい。   Both the first and second classification tables have a group No column and a block No column, and are associated with the group No column and the block No column, respectively, and the total pixel value (Sum), the total number of pixels (Count), and the luminance average The value (Avg) is recorded. In the example shown in the figure, the groups are divided into 16 groups, but the optimum number of groups may be appropriately set.

再び図12を参照して、鏡面反射候補領域検出部131は画素のグループ分類を行った後、補助光非発光時(第1の画像)についてグループの合計画素値Sumを更新するとともに、画素値を加算する都度、合計画素数Countをインクリメントする(ステップS1006)。   Referring again to FIG. 12, the specular reflection candidate area detection unit 131 performs group grouping of pixels, and then updates the total pixel value Sum of the group when auxiliary light is not emitted (first image), and the pixel value. Each time is added, the total number of pixels Count is incremented (step S1006).

なお、合計画素値は次の式(18)を用いて算出される。   The total pixel value is calculated using the following equation (18).

Sum=ΣS (18)
但し、Sは画素値である。
Sum = ΣS (18)
However, S is a pixel value.

また、画素値SとしてRGBを用いる場合には、式(18)の代わりに次の式(19)〜式(21)を用いて、RGBの各々について合計画素値が算出される。   When RGB is used as the pixel value S, the total pixel value is calculated for each of RGB using the following equations (19) to (21) instead of the equation (18).

Sum.R=ΣS.R (19)
Sum.G=ΣS.G (20)
Sum.B=ΣS.B (21)
上述のようにして、全ての画素についてステップS1003〜S1005の処理を行うと、鏡面反射候補領域検出部131は全画素ループ端に達したとして(ステップS1006)、分類グループ毎に次の式(22)によって平均画素値Avgを算出する(ステップS1007)。
Sum. R = ΣS. R (19)
Sum. G = ΣS. G (20)
Sum. B = ΣS. B (21)
As described above, when the processing of steps S1003 to S1005 is performed for all the pixels, the specular reflection candidate area detecting unit 131 reaches the end of all pixel loops (step S1006), and the following equation (22) is obtained for each classification group. ) To calculate the average pixel value Avg (step S1007).

Avg=Sum/Count (22)
なお、画素値としてRGBを用いる場合には、式(22)の代わりに式(23)〜式(25)を用いてRGBの各々について平均画素値が算出される。
Avg = Sum / Count (22)
In addition, when using RGB as a pixel value, an average pixel value is calculated about each of RGB using Formula (23)-Formula (25) instead of Formula (22).

Avg.R=Sum.R/Count (23)
Avg.G=Sum.G/Count (24)
Avg.B=Sum.B/Count (25)
前述したように、グループ毎の平均画素値は図13で説明した第1又は第2の分類テーブルに格納される。
Avg. R = Sum. R / Count (23)
Avg. G = Sum. G / Count (24)
Avg. B = Sum. B / Count (25)
As described above, the average pixel value for each group is stored in the first or second classification table described with reference to FIG.

続いて、鏡面反射候補領域検出部131は、図13に示す第1および第2の分類テーブルを参照して、ブロック毎に最も輝度値の高いグループと2番目に輝度値の高いグループを探索して、それぞれAグループ(第1のグループ)およびBグループ(第2のグループ)とする。   Subsequently, the specular reflection candidate area detection unit 131 refers to the first and second classification tables shown in FIG. 13 and searches for the group with the highest luminance value and the group with the second highest luminance value for each block. The A group (first group) and the B group (second group), respectively.

Aグループを探索する際には、鏡面反射候補領域検出部131は、輝度値Yの高いグループから順に、画素が含まれるグループを探索する。例えば、グループが16個に分類されている場合に(ここでは、第16番目から順に輝度値が低くなるものとする)、第16番目のグループから探索して、鏡面反射候補領域検出部131は第16番目のグループに画素が含まれるか否かを判定する。そして、第16番目のグループに画素が含まれると、鏡面反射候補領域検出部131は第16番目のグループをAグループとする。   When searching for the A group, the specular reflection candidate area detection unit 131 searches for groups including pixels in order from the group with the highest luminance value Y. For example, when the group is classified into 16 groups (in this case, the luminance value is assumed to decrease in order from the 16th), the specular reflection candidate area detection unit 131 searches from the 16th group, It is determined whether or not a pixel is included in the 16th group. When the pixel is included in the 16th group, the specular reflection candidate area detection unit 131 sets the 16th group as the A group.

第16番目のグループに画素が含まれないと、鏡面反射候補領域検出部131は第15番目のグループに画素が含まれるか否かを判定する。このようにして、輝度値の高いグループから順に探索を行って、画素が含まれるグループがあった場合に、そのグループをAグループとする。   If no pixel is included in the 16th group, the specular reflection candidate area detection unit 131 determines whether the 15th group includes a pixel. In this way, when a search is performed in order from the group with the highest luminance value, and there is a group including pixels, that group is set as the A group.

Aグループを探索した後、鏡面反射候補領域検出部131は次にBグループの探索を行う。ここでは、鏡面反射候補領域検出部131はAグループよりも1つ輝度値の低いグループから順に画素が含まれるグループを探索する。   After searching for the A group, the specular reflection candidate area detection unit 131 next searches for the B group. Here, the specular reflection candidate area detection unit 131 searches for a group including pixels in order from a group having a luminance value one lower than that of the A group.

例えば、Aグループが第12番目のグループであった場合には、鏡面反射候補領域検出部131は第11番目のグループに画素が含まれるか否かを判定する。そして、第11番目のグループに画素が含まれると、鏡面反射候補領域検出部131は第11番目のグループをBグループとする。   For example, when the A group is the twelfth group, the specular reflection candidate area detection unit 131 determines whether or not the pixel is included in the eleventh group. When the eleventh group includes a pixel, the specular reflection candidate area detection unit 131 sets the eleventh group as the B group.

一方、第11番目のグループに画素が含まれないと、鏡面反射候補領域検出部131は第10番目のグループに画素が含まれるか否かを判定する。このようにして、Aグループよりも輝度値の低いグループにおいて順にBグループの探索が行われることになる。   On the other hand, when the pixel is not included in the eleventh group, the specular reflection candidate area detection unit 131 determines whether the pixel is included in the tenth group. In this way, the search for the B group is sequentially performed in the group having the luminance value lower than that of the A group.

なお、ブロックにおける各画素の輝度値Yに差がほとんどなく、2つ以上のグループに分割できないブロックについては、鏡面反射候補領域検出部131は鏡面反射候補領域と周辺領域との少なくとも一方はないものと判定する。   Note that the specular reflection candidate area detecting unit 131 does not have at least one of the specular reflection candidate area and the peripheral area for blocks that have almost no difference in the luminance value Y of each pixel in the block and cannot be divided into two or more groups. Is determined.

AグループおよびBグループを探索した後、鏡面反射候補領域検出部131はAグループの平均画素値をA値、そして、Bグループの平均画素値をB値とする(ステップS1008)。そして、上述のようにして、全ての画素についてステップS1007およびS1008の処理を行うと、鏡面反射候補領域検出部131は全ブロックループ端に達したとして(ステップS1009)、グループ分割処理を終了する。   After searching for the A group and the B group, the specular reflection candidate area detecting unit 131 sets the average pixel value of the A group as the A value and the average pixel value of the B group as the B value (step S1008). As described above, when the processes of steps S1007 and S1008 are performed for all the pixels, the specular reflection candidate area detection unit 131 has reached the end of all the block loops (step S1009), and the group division process ends.

再び図11を参照して、上述のようにして、グループ分割処理が終了すると、鏡面反射候補領域検出部131は全ブロックについて順次ループして(ステップS902)、ステップS903およびS904の処理を全ブロックについて行う。   Referring to FIG. 11 again, when the group division process is completed as described above, the specular reflection candidate area detecting unit 131 sequentially loops for all blocks (step S902), and the processes of steps S903 and S904 are performed for all blocks. Do about.

まず、鏡面反射候補領域検出部131はグループ分割処理の結果に基づいて、ブロック毎に鏡面反射候補領域検出部131はAグループおよびBグループが存在するか(つまり、AおよびBブロックであるか)を判定する(ステップS903)。   First, based on the result of the group division process, the specular reflection candidate area detecting unit 131 has a group A and a B group for each block (that is, whether they are A and B blocks). Is determined (step S903).

AグループおよびBグループが存在しないと(ステップS903において、NO)、鏡面反射候補領域検出部131は次のブロックを対象ブロックとしてステップS902の処理を行う。   If the A group and the B group do not exist (NO in step S903), the specular reflection candidate area detection unit 131 performs the process of step S902 with the next block as the target block.

一方、AグループおよびBグループが存在すると(ステップS903において、YES)、鏡面反射候補領域検出部131はAグループを鏡面反射光成分が強く含まれる鏡面反射候補領域として検出するとともに、Bグループを鏡面反射光成分が余り含まれない周辺領域として検出する(ステップS904)。   On the other hand, when the A group and the B group exist (YES in step S903), the specular reflection candidate area detection unit 131 detects the A group as a specular reflection candidate area including a strong specular reflection component, and the B group is specular. It is detected as a peripheral region that does not contain much reflected light component (step S904).

第1の画像について、前述のように、A値およびB値を算出していたので、鏡面反射候補領域検出部131はA値を1A値、B値を1B値とする。そして、鏡面反射候補領域検出部131は1A値を鏡面反射の候補領域における光源200の反射光、そして、1B値を周辺領域における光源200の反射光として、後述する光源反射光テーブルの該当するブロック欄に格納する。   As described above, since the A value and the B value are calculated for the first image, the specular reflection candidate area detection unit 131 sets the A value as the 1A value and the B value as the 1B value. Then, the specular reflection candidate area detecting unit 131 uses the 1A value as the reflected light of the light source 200 in the specular reflection candidate area, and the 1B value as the reflected light of the light source 200 in the peripheral area, and the corresponding block of the light source reflected light table described later. Store in the column.

なお、AグループおよびBグループが存在しないブロックについては、鏡面反射候補領域検出部131は当該ブロックには鏡面反射領域は存在しないと判定する。   Note that for a block in which the A group and the B group do not exist, the specular reflection candidate area detection unit 131 determines that the specular reflection area does not exist in the block.

全てのブロックについてステップS903およびS904の処理が終了すると、鏡面反射候補領域検出部131は全画素ループ端に達したとして(ステップS905)、鏡面反射候補領域および周辺領域検出処理を終了する。   When the processes of steps S903 and S904 are completed for all blocks, the specular reflection candidate area detection unit 131 determines that the end of all pixel loops has been reached (step S905), and ends the specular reflection candidate area and peripheral area detection processing.

図14は、図9に示す補助光の反射光抽出処理を説明するためのフローチャートである。   FIG. 14 is a flowchart for explaining the reflected light extraction processing of auxiliary light shown in FIG.

補助光の反射光抽出処理を開始すると、反射光抽出部132は第2画像について画素値のグループ分割処理を行う(ステップS1101)。ここでは、第2の画像を入力画像(対象画像)として、反射光抽出部132はブロック毎に各画素を画素値に応じて複数のグループに分割する。ステップS1101におけるグループ分割処理は、ステップS901で説明したグループ分割処理と同様であるので、ここでは説明を省略する。   When the auxiliary light reflected light extraction processing is started, the reflected light extraction unit 132 performs pixel value group division processing on the second image (step S1101). Here, using the second image as an input image (target image), the reflected light extraction unit 132 divides each pixel into a plurality of groups according to pixel values for each block. Since the group division process in step S1101 is the same as the group division process described in step S901, the description thereof is omitted here.

続いて、反射光抽出部132は全ブロックについて順次ループして(ステップS1102)、ステップS1103およびS1104の処理を全ブロックについて行う。図11で説明した手法と同様にして、反射光抽出部132はグループ分割処理の結果に基づいて、第2の画像において、Aグループの平均画素値をA値、そして、Bグループの平均画素値をB値とする。そして、反射光抽出部132は第2画像のA値を2A値、B値を2B値とする。   Subsequently, the reflected light extraction unit 132 sequentially loops for all blocks (step S1102), and performs the processing of steps S1103 and S1104 for all blocks. Similar to the method described in FIG. 11, the reflected light extraction unit 132 sets the average pixel value of the A group to the A value and the average pixel value of the B group in the second image based on the result of the group division process. Is a B value. Then, the reflected light extraction unit 132 sets the A value of the second image as the 2A value and the B value as the 2B value.

反射光抽出部132は第1および第2の画像のブロック毎に2A値から1A値を減算した差分を鏡面反射候補領域における補助光の反射光データとして抽出する(ステップSD1103)。   The reflected light extraction unit 132 extracts the difference obtained by subtracting the 1A value from the 2A value for each block of the first and second images as reflected light data of auxiliary light in the specular reflection candidate area (step SD1103).

続いて、反射光抽出部132は2B値から1B値を減算した差分を周辺領域における補助光の反射光データとして抽出する(ステップS1104)。なお、ここでは、第1および第2の画像において対応するブロックには同一被写体が存在し、各画素における補助光の反射光による画素値の増加分はほぼ等しいものとする。図17で表わされるデータ構造の該当するブロックに格納する。   Subsequently, the reflected light extraction unit 132 extracts the difference obtained by subtracting the 1B value from the 2B value as reflected light data of the auxiliary light in the peripheral region (step S1104). Here, it is assumed that the same subject exists in the corresponding blocks in the first and second images, and the increase in pixel value due to the reflected light of the auxiliary light in each pixel is substantially equal. The data is stored in the corresponding block of the data structure shown in FIG.

図15は、本発明の第2の実施形態によるカメラに備えられた反射光データ格納領域(データ構造)の一例を示す図である。なお、図示の反射光データ格納領域は、例えば、図1に示すメモリ106に規定される。   FIG. 15 is a diagram illustrating an example of the reflected light data storage area (data structure) provided in the camera according to the second embodiment of the present invention. The reflected light data storage area shown in the figure is defined in the memory 106 shown in FIG. 1, for example.

図示の例では、光源反射光データを格納する光源反射光テーブルと補助光反射光データを格納する補助光反射光テーブルとを有しており、光源反射光テーブルおよび補助光反射光テーブルともにブロックNo欄、鏡面反射候補領域欄、および周辺領域欄を有している。   The illustrated example has a light source reflected light table for storing light source reflected light data and an auxiliary light reflected light table for storing auxiliary light reflected light data. Both the light source reflected light table and the auxiliary light reflected light table have block numbers. Column, specular reflection candidate region column, and peripheral region column.

光源反射光テーブルではこれらブロックNO欄、鏡面反射候補領域欄、および周辺領域欄に対応付けてそれぞれ1A値および1B値(つまり、光源反射光データ)が記録される。   In the light source reflected light table, 1A value and 1B value (that is, light source reflected light data) are recorded in association with these block NO column, specular reflection candidate region column, and peripheral region column, respectively.

同様に、反射光反射光テーブルではこれらブロックNO欄、鏡面反射候補領域欄、および周辺領域欄に対応付けてそれぞれ(2A値−1A値)および(2B値−1B値)が補助光反射光データとして記録される。   Similarly, in the reflected light reflected light table, (2A value-1A value) and (2B value-1B value) are associated with the block NO column, the specular reflection candidate region column, and the peripheral region column, respectively, and the auxiliary light reflected light data. As recorded.

全てのブロックについてステップS1103およびS1104の処理が終了すると、反射光抽出部132は全ブロックループ端に達したとして(ステップS1105)反射光抽出処理を終了する。   When the processing of steps S1103 and S1104 is completed for all blocks, the reflected light extraction unit 132 assumes that the end of all the block loops has been reached (step S1105), and ends the reflected light extraction processing.

図16は、図9に示す鏡面反射領域特定処理を説明するためのフローチャートである。   FIG. 16 is a flowchart for explaining the specular reflection area specifying process shown in FIG.

鏡面反射領域特定処理を開始すると、鏡面反射領域特定部133は全ブロックについて順次ループして(ステップS1201)、ステップS1202〜S1204の処理を全ブロックについて行う。   When the specular reflection area specifying process is started, the specular reflection area specifying unit 133 sequentially loops for all blocks (step S1201), and performs the processing of steps S1202 to S1204 for all blocks.

まず、鏡面反射領域特定部133は、鏡面反射候補領域および周辺領域検出処理の結果に基づいて、第1の画像の対象ブロックにおいて鏡面反射候補領域および周辺領域が検出されたか否かを判定する。つまり、鏡面反射領域特定部133は第1の画像の対象ブロックにAおよびBグループが存在するか否かを判定する(ステップS1202)。   First, the specular reflection region specifying unit 133 determines whether or not the specular reflection candidate region and the peripheral region are detected in the target block of the first image based on the result of the specular reflection candidate region and the peripheral region detection process. That is, the specular reflection area specifying unit 133 determines whether the A and B groups exist in the target block of the first image (step S1202).

第1の画像の対象ブロックにAおよびBグループが存在しないと(ステップS1202において、NO)、鏡面反射領域特定部133は次のブロックを対象ブロックとしてステップS1202の処理を行う。   If the A and B groups do not exist in the target block of the first image (NO in step S1202), the specular reflection area specifying unit 133 performs the process of step S1202 with the next block as the target block.

一方、対象ブロックにAおよびBグループが存在すると(ステップS1202において、YES)、鏡面反射領域特定部133は、鏡面反射候補領域と周辺領域とにおいて、補助光の反射光に係る画素値が近似するか否かを判定する(ステップS1203)。   On the other hand, when the A and B groups exist in the target block (YES in step S1202), the specular reflection area specifying unit 133 approximates the pixel values related to the reflected light of the auxiliary light in the specular reflection candidate area and the peripheral area. It is determined whether or not (step S1203).

なお、ここでは、所定の閾値T3と図15に示す補助光反射光データとを用いて、次の式(26)が満たされると、鏡面反射領域特定部133は補助光の反射光に係る画素値が近似すると判定する。   Here, when the following equation (26) is satisfied using the predetermined threshold value T3 and the auxiliary light reflected light data shown in FIG. 15, the specular reflection area specifying unit 133 determines the pixel related to the reflected light of the auxiliary light. It is determined that the values are approximate.

|(2A値−1A値)−(2B値−1B値)|<T3 (26)
画素値がRGBで表現される場合には、式(13)の代わりに、所定の閾値T3、T3、T3を用いて、次の式(27)〜式(29)の全てを満たす場合に、鏡面反射領域特定部133は補助光の反射光に係る画素値が近似すると判定する。
| (2A value-1A value)-(2B value-1B value) | <T3 (26)
When the pixel value is expressed in RGB, all of the following formulas (27) to (29) are satisfied using predetermined threshold values T3 R , T3 G , and T3 B instead of formula (13). In this case, the specular reflection region specifying unit 133 determines that the pixel value related to the reflected light of the auxiliary light is approximate.

|(2A値−1A値).R−(2B値−1B値).R|<T3 (27)
|(2A値−1A値).G−(2B値−1B値).G|<T3 (28)
|(2A値−1A値).B−(2B値−1B値).B|<T3 (29)
鏡面反射候補領域と周辺領域とにおいて補助光の反射光に係る画素値が近似しないと(ステップS1203において、NO)、鏡面反射領域特定部133はステップS1202の処理に戻って、次のブロックを対象ブロックとしてステップS1202の処理を行う。
| (2A value-1A value). R- (2B value-1B value). R | <T3 R (27)
| (2A value-1A value). G- (2B value-1B value). G | <T3 G (28)
| (2A value-1A value). B- (2B value-1B value). B | <T3 B (29)
If the pixel values related to the reflected light of the auxiliary light are not approximated in the specular reflection candidate area and the peripheral area (NO in step S1203), the specular reflection area specifying unit 133 returns to the process in step S1202 and targets the next block. The process of step S1202 is performed as a block.

一方、鏡面反射候補領域と周辺領域とにおいて補助光の反射光に係る画素値が近似すると(ステップS1203において、YES)、つまり、上記の式(26)が満たされると、鏡面反射領域特定部133は鏡面反射候補領域と周辺領域とは補助光の拡散反射率がほぼ等しく、同一被写体であると推定する。   On the other hand, when the pixel values related to the reflected light of the auxiliary light approximate in the specular reflection candidate area and the peripheral area (YES in step S1203), that is, when the above formula (26) is satisfied, the specular reflection area specifying unit 133 is satisfied. The specular reflection candidate area and the peripheral area are estimated to be the same subject because the diffuse reflectance of the auxiliary light is substantially equal.

そして、鏡面反射領域特定部133は、鏡面反射領域が存在するため、鏡面反射候補領域における光源200の反射光と周辺領域における光源200の反射光とに差が生じるとして、鏡面反射候補領域が鏡面反射領域であると特定する(ステップS1204)。   The specular reflection area specifying unit 133 determines that the specular reflection candidate area is a specular surface because there is a difference between the reflected light of the light source 200 in the specular reflection candidate area and the reflected light of the light source 200 in the peripheral area because the specular reflection area exists. The reflection area is identified (step S1204).

なお、式(26)を満たさない場合には、鏡面反射領域特定部133は鏡面反射候補領域と周辺領域とは異なる被写体であるとして、鏡面反射候補領域が鏡面反射領域ではないとする。   When Expression (26) is not satisfied, the specular reflection area specifying unit 133 assumes that the specular reflection candidate area and the peripheral area are different subjects, and the specular reflection candidate area is not a specular reflection area.

そして、鏡面反射領域特定部133は鏡面反射領域であると特定したブロックについて、後述するフラグ格納領域にフラグを格納する。   Then, the specular reflection area specifying unit 133 stores a flag in a flag storage area, which will be described later, for the block specified as the specular reflection area.

図17は、鏡面反射領域であると特定したブロックに対してフラグを格納するフラグ格納領域(テータ構造)の一例を示す図である。   FIG. 17 is a diagram illustrating an example of a flag storage area (data structure) for storing a flag for a block identified as a specular reflection area.

図示のフラグ格納領域は、例えば、図1(a)に示すメモリ106に規定されており、このフラグ格納領域にはフラグテーブルが記録される。フラグテーブルはブロックNo欄を有しており、鏡面反射領域であると特定したブロックに対応付けて、フラグ(flag)が記録される。   The illustrated flag storage area is defined, for example, in the memory 106 shown in FIG. 1A, and a flag table is recorded in this flag storage area. The flag table has a block number column, and a flag is recorded in association with the block identified as the specular reflection area.

上述のようにして、全てのブロックについてステップS1202〜S1204の処理を行うと、鏡面反射領域特定部133は全ブロックループ端に達したとして(ステップS1205)、鏡面反射領域特定処理を終了する。   As described above, when the processes of steps S1202 to S1204 are performed for all the blocks, the specular reflection area specifying unit 133 reaches the end of all the block loops (step S1205), and the specular reflection area specifying process ends.

図18は、図9に示すホワイトバランスゲイン算出処理を説明するためのフローチャートである。   FIG. 18 is a flowchart for explaining the white balance gain calculation processing shown in FIG.

ホワイトバランスゲイン算出処理を開始すると、WBゲイン算出部134は全ブロックについて順次ループして(ステップS1301)、ステップS1302およびS1303の処理を全ブロックについて行う。まず、WBゲイン算出部134は図17に示すフラグテーブルを参照して、対象ブロックに鏡面反射領域が存在すると特定されたか否かを判定する(ステップS1302)。   When the white balance gain calculation process is started, the WB gain calculation unit 134 sequentially loops for all blocks (step S1301), and performs the processes of steps S1302 and S1303 for all blocks. First, the WB gain calculation unit 134 refers to the flag table shown in FIG. 17 and determines whether or not it is specified that a specular reflection area exists in the target block (step S1302).

対象ブロックに鏡面反射領域が存在しないと(ステップS1202において、NO)、WBゲイン算出部134は次のブロックを対象ブロックとしてステップS1202の処理を行う。一方、対象ブロックに鏡面反射領域が存在すると(ステップS1202において、YES)、WBゲイン算出部134は図15に示す光源反射光データに基づいて、1A値から1B値を減算して差分Dを算出する。そして、WBゲイン算出部134は差分Dに応じてブロックWBゲイン値を算出する(ステップS1303)。   If the specular reflection area does not exist in the target block (NO in step S1202), the WB gain calculation unit 134 performs the processing in step S1202 with the next block as the target block. On the other hand, if the specular reflection area exists in the target block (YES in step S1202), the WB gain calculation unit 134 calculates the difference D by subtracting the 1B value from the 1A value based on the light source reflected light data shown in FIG. To do. Then, the WB gain calculation unit 134 calculates a block WB gain value according to the difference D (step S1303).

なお、画素値がRGBで表現される場合には、差分DはRGBで表現され、次の式(30)および式(31)を用いてブロックWBゲイン値が算出される。   When the pixel value is expressed in RGB, the difference D is expressed in RGB, and the block WB gain value is calculated using the following equations (30) and (31).

Gain.R=D.G/D.R (30)
Gain.B=D.G/D.B (31)
上述のようにして、全てのブロックについてステップS1202およびS1203の処理を行うと、WBゲイン算出部134は全ブロックループ端に達したとして(ステップS1204)、全ブロックのブロックWBバランスゲインの平均をホワイトWBゲインとして算出する(ステップS1205)。そして、WBゲイン算出部134はホワイトバランスゲイン算出処理を終了する。つまり、WBゲイン算出部134は光源色推定処理を終了する。
Gain. R = D. G / D. R (30)
Gain. B = D. G / D. B (31)
As described above, when the processing of steps S1202 and S1203 is performed for all blocks, the WB gain calculation unit 134 assumes that the end of all block loops has been reached (step S1204), and calculates the average of the block WB balance gains of all blocks as white. The WB gain is calculated (step S1205). Then, the WB gain calculation unit 134 ends the white balance gain calculation process. That is, the WB gain calculation unit 134 ends the light source color estimation process.

このように、本発明の第2の実施形態では、第1および第2の画像を複数のブロックに分割して、補助光発光装置201で発光した際の反射光を用いて、被写体202を照らす光源200による鏡面反射領域を特定する。これによって、鏡面反射領域のみを用いてホワイトバランスゲインを算出することができる結果、画像におけるホワイトバランス補正の精度が向上する。   As described above, in the second embodiment of the present invention, the first and second images are divided into a plurality of blocks, and the subject 202 is illuminated with the reflected light emitted from the auxiliary light emitting device 201. The specular reflection area by the light source 200 is specified. As a result, the white balance gain can be calculated using only the specular reflection region. As a result, the accuracy of white balance correction in the image is improved.

上述の説明から明らかなように、図1に示す例では、システム制御部110および鏡面反射領域候補検出部131が鏡面反射領域検出手段として機能し、システム制御部110および反射光抽出部132が反射光抽出手段として機能する。   As is clear from the above description, in the example shown in FIG. 1, the system control unit 110 and the specular reflection region candidate detection unit 131 function as specular reflection region detection means, and the system control unit 110 and the reflected light extraction unit 132 reflect. It functions as a light extraction means.

さらに、システム制御部110および鏡面反射領域特定部133が特定手段として機能し、システム制御部110およびホワイトバランスゲイン算出部134が光源色推定手段として機能する。また、システム制御部110は調整手段として機能する。   Further, the system control unit 110 and the specular reflection area specifying unit 133 function as specifying means, and the system control unit 110 and the white balance gain calculating unit 134 function as light source color estimating means. Further, the system control unit 110 functions as an adjustment unit.

以上、本発明について実施の形態に基づいて説明したが、本発明は、これらの実施の形態に限定されるものではなく、この発明の要旨を逸脱しない範囲の様々な形態も本発明に含まれる。   As mentioned above, although this invention was demonstrated based on embodiment, this invention is not limited to these embodiment, Various forms of the range which does not deviate from the summary of this invention are also contained in this invention. .

例えば、上記の実施の形態の機能を制御方法として、この制御方法を画像処理装置に実行させるようにすればよい。また、上述の実施の形態の機能を有するプログラムを制御プログラムとして、当該制御プログラムを画像処理装置が備えるコンピュータに実行させるようにしてもよい。なお、制御プログラムは、例えば、コンピュータに読み取り可能な記録媒体に記録される。   For example, the function of the above embodiment may be used as a control method, and this control method may be executed by the image processing apparatus. In addition, a program having the functions of the above-described embodiments may be used as a control program, and the control program may be executed by a computer included in the image processing apparatus. The control program is recorded on a computer-readable recording medium, for example.

上記の制御方法および制御プログラムの各々は、少なくとも鏡面反射領域検出ステップ、反射光抽出ステップ、特定ステップ、および光源色推定ステップを有している。   Each of the above control method and control program has at least a specular reflection region detection step, a reflected light extraction step, a specifying step, and a light source color estimation step.

また、本発明は、以下の処理を実行することによっても実現される。つまり、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種の記録媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPUなど)がプログラムを読み出して実行する処理である。   The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various recording media, and the computer (or CPU, MPU, etc.) of the system or apparatus reads the program. To be executed.

103 撮像部
105 画像処理部
106 メモリ
107 メモリ制御部
110 システム制御部
131 鏡面反射候補領域検出部
132 反射光抽出部
133 鏡面反射領域特定部
134 ホワイトバランスゲイン算出部
201 補助光発光装置
DESCRIPTION OF SYMBOLS 103 Image pick-up part 105 Image processing part 106 Memory 107 Memory control part 110 System control part 131 Specular reflection candidate area | region detection part 132 Reflection light extraction part 133 Specular reflection area specification part 134 White balance gain calculation part 201 Auxiliary light emission device

Claims (10)

光源が存在する撮影環境で被写体を撮影して得られた画像において前記光源の光源色を推定する光源色推定処理を行う画像処理装置であって、
予め定められた補助光を非発光として前記被写体を撮影して得られた第1の画像において前記光源による鏡面反射が生じている可能性がある鏡面反射候補領域と当該鏡面反射候補領域の周辺に位置する周辺領域とを検出する鏡面反射領域検出手段と、
前記第1の画像と前記補助光を発光させて前記被写体を撮影して得られた第2の画像とに基づいて前記補助光による反射光成分を抽出する反射光抽出手段と、
前記鏡面反射候補領域および前記周辺領域における前記反射光成分を比較して、当該比較結果に応じて前記鏡面反射候補領域が前記光源による鏡面反射が生じる鏡面反射領域であるか否かを特定する特定手段と、
前記鏡面反射領域を用いて前記光源色推定処理を行う光源色推定手段と、
を有することを特徴とする画像処理装置。
An image processing apparatus that performs a light source color estimation process for estimating a light source color of the light source in an image obtained by photographing a subject in a photographing environment where a light source exists,
In a first image obtained by photographing the subject with no predetermined auxiliary light emitted, a specular reflection candidate area in which specular reflection by the light source may occur and around the specular reflection candidate area Specular reflection area detecting means for detecting a peripheral area located;
Reflected light extraction means for extracting a reflected light component by the auxiliary light based on the first image and the second image obtained by photographing the subject by emitting the auxiliary light;
A specification for comparing the reflected light components in the specular reflection candidate area and the peripheral area and specifying whether the specular reflection candidate area is a specular reflection area where specular reflection by the light source occurs according to the comparison result Means,
Light source color estimation means for performing the light source color estimation processing using the specular reflection region;
An image processing apparatus comprising:
前記鏡面反射領域検出手段は、前記鏡面反射の候補領域から所定の範囲に位置する領域を前記周辺領域とすることを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the specular reflection area detection unit sets an area located within a predetermined range from the specular reflection candidate area as the peripheral area. 前記鏡面反射領域検出手段は、前記第1の画像における画素を順に対象画素として当該対象画素の画素値と予め定められた範囲にある他の画素の画素値との差分が所定の第1の閾値よりも大きいと、前記対象画素を前記鏡面反射候補領域とすることを特徴とする請求項1又は2に記載の画像処理装置。   The specular reflection area detecting means sets the pixels of the first image in order as the target pixels, and the difference between the pixel value of the target pixel and the pixel value of another pixel in a predetermined range is a predetermined first threshold value The image processing apparatus according to claim 1, wherein the target pixel is the specular reflection candidate area. 前記鏡面反射領域検出手段は、前記対象画素の画素値と前記他の画素の画素値との差分が所定の閾値以下であると、前記対象画素を前記周辺領域とすることを特徴とする請求項1〜3のいずれか1項に記載の画像処理装置。   The specular reflection region detection means sets the target pixel as the peripheral region when a difference between a pixel value of the target pixel and a pixel value of the other pixel is a predetermined threshold value or less. The image processing apparatus according to any one of 1 to 3. 前記特定手段は、前記鏡面反射候補領域における反射光成分と前記周辺領域における反射光成分との差分が所定の第2の閾値よりも小さいと、前記鏡面反射候補領域を前記鏡面反射領域と特定することを特徴とする請求項1〜4のいずれか1項に記載の画像処理装置。   The specifying unit specifies the specular reflection candidate area as the specular reflection area when a difference between a reflected light component in the specular reflection candidate area and a reflected light component in the peripheral area is smaller than a predetermined second threshold. The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus. 前記光源色推定手段は、前記光源色推定処理として前記鏡面反射領域における前記光源の反射光と前記周辺領域における前記光源の反射光の差分を算出して、当該差分に応じて光源色の推定を行うことを特徴とする請求項1〜5のいずれか1項に記載の画像処理装置。   The light source color estimation means calculates a difference between the reflected light of the light source in the specular reflection area and the reflected light of the light source in the peripheral area as the light source color estimation process, and estimates the light source color according to the difference. The image processing apparatus according to claim 1, wherein the image processing apparatus is performed. 前記光源による鏡面反射領域と前記補助光による鏡面反射領域が重複しないように前記補助光を発光する位置を調整する調整手段を有することを特徴とする請求項1〜6のいずれか1項に記載の画像処理装置。   7. The adjusting device according to claim 1, further comprising an adjusting unit that adjusts a position where the auxiliary light is emitted so that a specular reflection region by the light source and a specular reflection region by the auxiliary light do not overlap each other. Image processing apparatus. 前記調整手段は、前記鏡面反射候補領域における反射光成分と前記周辺領域における反射光成分との差分が前記補助光の色相と補助光との比較結果に応じて前記補助光の照射方向が光源の照射方向と重複するか否かを判定することを特徴とする請求項7に記載の画像処理装置。   The adjustment means is configured such that the difference between the reflected light component in the specular reflection candidate area and the reflected light component in the peripheral area is determined by the direction of irradiation of the auxiliary light according to the comparison result between the hue of the auxiliary light and the auxiliary light. The image processing apparatus according to claim 7, wherein it is determined whether or not the irradiation direction overlaps. 光源が存在する撮影環境で被写体を撮影して得られた画像において前記光源の光源色を推定する光源色推定処理を行う画像処理装置の制御方法であって、
予め定められた補助光を非発光として前記被写体を撮影して得られた第1の画像において前記光源による鏡面反射が生じている可能性がある鏡面反射候補領域と当該鏡面反射候補領域の周辺に位置する周辺領域とを検出する鏡面反射領域検出ステップと、
前記第1の画像と前記補助光を発光させて前記被写体を撮影して得られた第2の画像とに基づいて前記補助光による反射光成分を抽出する反射光抽出ステップと、
前記鏡面反射候補領域および前記周辺領域における前記反射光成分を比較して、当該比較結果に応じて前記鏡面反射候補領域が前記光源による鏡面反射が生じる鏡面反射領域であるか否かを特定する特定ステップと、
前記鏡面反射領域を用いて前記光源色推定処理を行う光源色推定ステップと、
を有することを特徴とする制御方法。
A control method for an image processing apparatus that performs a light source color estimation process for estimating a light source color of the light source in an image obtained by shooting a subject in a shooting environment where a light source exists,
In a first image obtained by photographing the subject with no predetermined auxiliary light emitted, a specular reflection candidate area in which specular reflection by the light source may occur and around the specular reflection candidate area A specular reflection region detecting step for detecting a peripheral region located;
A reflected light extraction step of extracting a reflected light component of the auxiliary light based on the first image and a second image obtained by photographing the subject by emitting the auxiliary light; and
A specification for comparing the reflected light components in the specular reflection candidate area and the peripheral area and specifying whether the specular reflection candidate area is a specular reflection area where specular reflection by the light source occurs according to the comparison result Steps,
A light source color estimation step for performing the light source color estimation process using the specular reflection region;
A control method characterized by comprising:
光源が存在する撮影環境で被写体を撮影して得られた画像において前記光源の光源色を推定する光源色推定処理を行う画像処理装置で用いられる制御プログラムであって、
前記画像処理装置が備えるコンピュータに、
予め定められた補助光を非発光として前記被写体を撮影して得られた第1の画像において前記光源による鏡面反射が生じている可能性がある鏡面反射候補領域と当該鏡面反射候補領域の周辺に位置する周辺領域とを検出する鏡面反射領域検出ステップと、
前記第1の画像と前記補助光を発光させて前記被写体を撮影して得られた第2の画像とに基づいて前記補助光による反射光成分を抽出する反射光抽出ステップと、
前記鏡面反射候補領域および前記周辺領域における前記反射光成分を比較して、当該比較結果に応じて前記鏡面反射候補領域が前記光源による鏡面反射が生じる鏡面反射領域であるか否かを特定する特定ステップと、
前記鏡面反射領域を用いて前記光源色推定処理を行う光源色推定ステップと、
を実行させることを特徴とする制御プログラム。
A control program used in an image processing apparatus for performing a light source color estimation process for estimating a light source color of the light source in an image obtained by photographing a subject in a photographing environment where a light source exists,
In the computer provided in the image processing apparatus,
In a first image obtained by photographing the subject with no predetermined auxiliary light emitted, a specular reflection candidate area in which specular reflection by the light source may occur and around the specular reflection candidate area A specular reflection region detecting step for detecting a peripheral region located;
A reflected light extraction step of extracting a reflected light component of the auxiliary light based on the first image and a second image obtained by photographing the subject by emitting the auxiliary light; and
A specification for comparing the reflected light components in the specular reflection candidate area and the peripheral area and specifying whether the specular reflection candidate area is a specular reflection area where specular reflection by the light source occurs according to the comparison result Steps,
A light source color estimation step for performing the light source color estimation process using the specular reflection region;
A control program characterized by causing
JP2013142593A 2013-07-08 2013-07-08 Image processing device, and method and program of controlling the same Withdrawn JP2015015676A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013142593A JP2015015676A (en) 2013-07-08 2013-07-08 Image processing device, and method and program of controlling the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013142593A JP2015015676A (en) 2013-07-08 2013-07-08 Image processing device, and method and program of controlling the same

Publications (1)

Publication Number Publication Date
JP2015015676A true JP2015015676A (en) 2015-01-22

Family

ID=52437095

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013142593A Withdrawn JP2015015676A (en) 2013-07-08 2013-07-08 Image processing device, and method and program of controlling the same

Country Status (1)

Country Link
JP (1) JP2015015676A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107251092A (en) * 2015-02-27 2017-10-13 日本电气株式会社 Comparison system, comparison means, comparative approach and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107251092A (en) * 2015-02-27 2017-10-13 日本电气株式会社 Comparison system, comparison means, comparative approach and program
CN107251092B (en) * 2015-02-27 2021-02-05 日本电气株式会社 Comparison system, comparison device, comparison method, and program

Similar Documents

Publication Publication Date Title
JP4983905B2 (en) Imaging apparatus, 3D modeling data generation method, and program
US9936141B2 (en) Image processing apparatus for performing correction processing for effecting virtual light source and method executed by image processing apparatus
JP2015115714A (en) Imaging apparatus, method of controlling imaging apparatus, and program
US20170195581A1 (en) Image processing apparatus, control method for the same and image capturing apparatus
JP2008278354A (en) Imaging device
US9113088B2 (en) Method and apparatus for photographing an image using light from multiple light sources
JP2019179463A (en) Image processing device, control method thereof, program, and recording medium
JP6370146B2 (en) Image processing apparatus and control method thereof
JP6808482B2 (en) Image processing equipment, image processing methods, and programs
JP2015015676A (en) Image processing device, and method and program of controlling the same
JP5359930B2 (en) Imaging apparatus, display method, and program
JP5430077B2 (en) Imaging apparatus, control method therefor, and program
JP2005250401A (en) Method for detecting focal distance and focusing device
US9992426B2 (en) Image capturing apparatus, method for controlling the same, and storage medium
JP6718256B2 (en) Image processing device, imaging device, control method thereof, and program
JP6335497B2 (en) Imaging device, control method thereof, and control program
JP2017130106A (en) Data processing apparatus, imaging apparatus and data processing method
JP2008219367A (en) Imaging apparatus and imaging method
JP2011253099A (en) Focus detector
US11265524B2 (en) Image processing apparatus, image processing method, and storage medium
JP2012134678A (en) Imaging apparatus and imaging method
JP6245802B2 (en) Image processing apparatus, control method thereof, and control program
JP6616674B2 (en) Image processing apparatus and method, and imaging apparatus
JP7242247B2 (en) IMAGING DEVICE AND METHOD OF CONTROLLING IMAGING DEVICE
JP2017192027A (en) Image processing apparatus, image processing method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160622

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20161121