JP7169841B2 - IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM - Google Patents

IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM Download PDF

Info

Publication number
JP7169841B2
JP7169841B2 JP2018197847A JP2018197847A JP7169841B2 JP 7169841 B2 JP7169841 B2 JP 7169841B2 JP 2018197847 A JP2018197847 A JP 2018197847A JP 2018197847 A JP2018197847 A JP 2018197847A JP 7169841 B2 JP7169841 B2 JP 7169841B2
Authority
JP
Japan
Prior art keywords
reflection characteristic
reflection
light source
image
characteristic data
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.)
Active
Application number
JP2018197847A
Other languages
Japanese (ja)
Other versions
JP2019083008A (en
JP2019083008A5 (en
Inventor
光太郎 北島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 US16/170,203 priority Critical patent/US11037279B2/en
Publication of JP2019083008A publication Critical patent/JP2019083008A/en
Publication of JP2019083008A5 publication Critical patent/JP2019083008A5/ja
Application granted granted Critical
Publication of JP7169841B2 publication Critical patent/JP7169841B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

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

従来から、写真撮影においては、補助照明やレフ板による光の調整によって、被写体に生じる光と影の領域の調整が行われている。これにより、被写体の印象をさまざまに変化させた写真撮影が可能となる。また、これらの光の調整を撮影後に行う技術として、被写体領域に対して、光の反射によるハイライトや陰影成分を加える技術(リライティング)がある。これにより、暗部を補正することや、立体感を強調した画像を生成することが可能となる。 2. Description of the Related Art Conventionally, in photography, areas of light and shadow that appear on a subject are adjusted by adjusting light using auxiliary lighting or a reflector. This makes it possible to take photographs with various impressions of the subject. In addition, as a technique for performing these light adjustments after photographing, there is a technique (relighting) for adding highlight and shadow components by reflecting light to the subject area. As a result, it is possible to correct dark areas and generate an image with an emphasized stereoscopic effect.

特許文献1は、被写体の距離情報を取得し、距離情報に基づいて被写体の形状情報を求め、形状情報、距離情報、及び仮想光源の位置に基づいて撮影画像を処理して、被写体に対して仮想光源からの光を照射した画像を生成する技術を開示している。 Patent Document 1 acquires distance information of a subject, obtains shape information of the subject based on the distance information, processes a photographed image based on the shape information, the distance information, and the position of a virtual light source, A technique for generating an image irradiated with light from a virtual light source is disclosed.

特開2016-86246号公報JP 2016-86246 A

特許文献1では、被写体の距離情報から法線を算出し、法線、被写体距離、仮想光源の位置と方向、強度に基づき、仮想光源による反射特性を求めてリライティング制御を行っている。この方法では、被写体距離、法線、仮想光源による反射特性を算出する演算量が多く、処理に時間がかかる。特に、仮想光源の数を増やして多灯での照射を行う場合には、仮想光源の数だけ演算を繰り返す必要があるため、処理に要する時間が増大する。 In Patent Document 1, a normal line is calculated from distance information of a subject, and relighting control is performed by obtaining reflection characteristics of a virtual light source based on the normal line, the subject distance, and the position, direction, and intensity of the virtual light source. This method requires a large amount of computation for calculating the object distance, the normal line, and the reflection characteristics based on the virtual light source, and the processing takes a long time. In particular, when the number of virtual light sources is increased and multi-light irradiation is performed, it is necessary to repeat the calculation for the number of virtual light sources, which increases the time required for processing.

本発明はこのような状況に鑑みてなされたものであり、複数の仮想光源を用いるリライティングの処理負荷を軽減する技術を提供することを目的とする。 SUMMARY OF THE INVENTION It is an object of the present invention to provide a technique for reducing the processing load of relighting using a plurality of virtual light sources.

上記課題を解決するために、本発明は、入力画像に仮想光源の効果を付加する前に、前記入力画像に含まれる所定の被写体における第1の仮想光源の反射特性を示す第1の反射特性データと、前記所定の被写体における第2の仮想光源の反射特性を示す第2の反射特性データとを合成する合成処理を行うことにより、合成反射特性データを取得する合成手段と、前記合成処理により得られた前記合成反射特性データが示す反射特性に基づいて、前記入力画像に含まれる被写体における反射成分を生成する生成手段と、前記入力画像に対して、前記生成手段により生成された前記反射成分を付加する付加手段と、を備えることを特徴とする画像処理装置を提供する。 In order to solve the above problems, the present invention provides a first reflection characteristic indicating a reflection characteristic of a first virtual light source in a predetermined subject included in the input image before adding the effect of the virtual light source to the input image. a synthesizing unit for acquiring synthetic reflection characteristic data by performing synthesis processing for synthesizing the data and second reflection characteristic data indicating the reflection characteristics of the second virtual light source in the predetermined subject; and generating means for generating a reflection component of a subject included in the input image based on the reflection characteristic indicated by the obtained synthetic reflection characteristic data; and the reflection component generated by the generating means for the input image. and adding means for adding the image processing apparatus.

なお、その他の本発明の特徴は、添付図面及び以下の発明を実施するための形態における記載によって更に明らかになるものである。 In addition, other features of the present invention will be further clarified by the description in the attached drawings and the following detailed description.

本発明によれば、複数の仮想光源を用いるリライティングの処理負荷を軽減することが可能となる。 According to the present invention, it is possible to reduce the processing load of relighting using a plurality of virtual light sources.

デジタルカメラ100の構成を示すブロック図。2 is a block diagram showing the configuration of the digital camera 100. FIG. 画像処理部105の構成を示すブロック図。FIG. 2 is a block diagram showing the configuration of an image processing unit 105; リライティング処理部202の構成を示すブロック図。FIG. 3 is a block diagram showing the configuration of a relighting processing unit 202; 第1の実施形態に係る、システム制御部50が反射特性マップ合成部301のために実行する合成パラメータ設定処理のフローチャート。4 is a flowchart of synthetic parameter setting processing executed by the system control unit 50 for the reflection characteristic map synthesizing unit 301 according to the first embodiment; 被写体の輝度に応じたリライティングモードを示す図。FIG. 4 is a diagram showing a relighting mode according to the luminance of a subject; 反射特性マップを示す図。The figure which shows a reflection characteristic map. リライティングモードと使用する反射特性マップとの関係について説明する図。FIG. 5 is a diagram for explaining the relationship between relighting modes and reflection characteristic maps to be used; 合成後の反射特性マップを示す図。The figure which shows the reflection characteristic map after composition. フィッティング処理について説明する図。The figure explaining a fitting process. 第2の実施形態に係る、システム制御部50が反射特性マップ合成部301のために実行する合成パラメータ設定処理のフローチャート。9 is a flowchart of synthetic parameter setting processing executed by the system control unit 50 for the reflection characteristic map synthesizing unit 301 according to the second embodiment. 仮想光源を設置するユーザ操作のためのユーザインタフェースを示す図。FIG. 10 is a diagram showing a user interface for user operation to install a virtual light source; 第3の実施形態に係るリライティング処理部202の構成を示すブロック図。FIG. 12 is a block diagram showing the configuration of a relighting processing unit 202 according to the third embodiment; FIG. 拡散反射マップD及び鏡面反射マップSの生成処理を説明する図。4A and 4B are diagrams for explaining a process of generating a diffuse reflection map D and a specular reflection map S; FIG.

以下、添付図面を参照して、本発明の実施形態を説明する。なお、本発明の技術的範囲は、特許請求の範囲によって確定されるのであって、以下の個別の実施形態によって限定されるわけではない。また、実施形態の中で説明されている特徴の組み合わせすべてが、本発明に必須とは限らない。また、別々の実施形態の中で説明されている特徴を適宜組み合せることも可能である。 Embodiments of the present invention will be described below with reference to the accompanying drawings. It should be noted that the technical scope of the present invention is determined by the claims and is not limited by the following individual embodiments. Also, not all combinations of features described in the embodiments are essential to the present invention. It is also possible to combine features described in separate embodiments as appropriate.

以下の各実施形態では、画像処理装置をデジタルカメラ(撮像装置)に適用した構成を例にして説明を行う。 In each of the following embodiments, a configuration in which an image processing device is applied to a digital camera (imaging device) will be described as an example.

[第1の実施形態]
図1は、デジタルカメラ100の構成を示すブロック図である。図1において、101は、ズームレンズ及びフォーカスレンズを含むレンズ群である。102は、絞り機能を備えるシャッターである。103は、光学像を電気信号に変換するCCDやCMOS素子等で構成される撮像部である。104は、アナログ信号をデジタル信号に変換するA/D変換器である。105は、A/D変換器104から出力される画像データに対し、ホワイトバランス処理や、リライティング処理、γ処理、輪郭強調処理、色補正処理などの各種画像処理を行う画像処理部である。106は、画像メモリである。107は、画像メモリ106を制御するメモリ制御部である。108は、入力デジタル信号をアナログ信号に変換するD/A変換器である。109は、LCD等を含む表示部である。110は、画像データを圧縮符号化・復号化するコーデック部である。
[First Embodiment]
FIG. 1 is a block diagram showing the configuration of the digital camera 100. As shown in FIG. In FIG. 1, 101 is a lens group including a zoom lens and a focus lens. A shutter 102 has an aperture function. An imaging unit 103 is composed of a CCD, a CMOS element, or the like that converts an optical image into an electric signal. 104 is an A/D converter that converts an analog signal into a digital signal. An image processing unit 105 performs various image processing such as white balance processing, relighting processing, γ processing, edge enhancement processing, and color correction processing on image data output from the A/D converter 104 . 106 is an image memory. A memory control unit 107 controls the image memory 106 . A D/A converter 108 converts an input digital signal into an analog signal. A display unit 109 includes an LCD and the like. A codec unit 110 compresses, encodes, and decodes image data.

111は、記録媒体112とのインタフェース(I/F)である。112は、メモリカードやハードディスク等の記録媒体である。113は、撮影画像中から顔が映っている領域を検出する顔検出部である。50は、デジタルカメラ100のシステム全体を制御するシステム制御部である。121は、プログラムやパラメータなどを格納するEEPROMなどの不揮発性メモリである。122は、システム制御部50の動作用の定数、変数、不揮発性メモリ121から読みだしたプログラム等を展開するシステムメモリである。123は、ストロボ(光源装置)である。124は、被写体との距離を測定する測距センサである。 111 is an interface (I/F) with the recording medium 112 . 112 is a recording medium such as a memory card or a hard disk. A face detection unit 113 detects an area in which a face appears in the captured image. A system control unit 50 controls the entire system of the digital camera 100 . 121 is a non-volatile memory such as an EEPROM that stores programs, parameters, and the like. A system memory 122 develops constants and variables for operation of the system control unit 50, programs read from the nonvolatile memory 121, and the like. 123 is a strobe (light source device). A distance measuring sensor 124 measures the distance to a subject.

次に、上記のように構成されたデジタルカメラ100における被写体撮影時の基本動作について説明する。撮像部103は、レンズ101及びシャッター102を介して入射した光を光電変換し、入力画像信号としてA/D変換器104へ出力する。A/D変換器104は、撮像部103から出力されるアナログ画像信号をデジタル画像信号に変換して画像処理部105に出力する。なお、デジタル画像信号は、RAW画像データとして記録媒体112に記録されてもよい。 Next, the basic operation of the digital camera 100 configured as described above when photographing a subject will be described. The imaging unit 103 photoelectrically converts light incident through the lens 101 and the shutter 102 and outputs the converted image signal to the A/D converter 104 as an input image signal. The A/D converter 104 converts the analog image signal output from the imaging unit 103 into a digital image signal and outputs the digital image signal to the image processing unit 105 . Note that the digital image signal may be recorded on the recording medium 112 as RAW image data.

画像処理部105は、A/D変換器104からの画像データ、又は、メモリ制御部107からの画像データに対し、ホワイトバランスなどの色変換処理、リライティング処理、γ処理、輪郭強調処理などを行う。また、画像処理部105は、顔検出部113の顔検出結果や撮像した画像データを用いて所定の評価値算出処理を行う。システム制御部50は、得られた評価値に基づいて露光制御及び測距制御を行う。これにより、TTL(スルー・ザ・レンズ)方式のAF(オートフォーカス)処理、AE(自動露出)処理、AWB(オートホワイトバランス)処理などを行うことができる。 The image processing unit 105 performs color conversion processing such as white balance, relighting processing, γ processing, edge enhancement processing, etc. on the image data from the A/D converter 104 or the image data from the memory control unit 107. . Further, the image processing unit 105 performs predetermined evaluation value calculation processing using the face detection result of the face detection unit 113 and captured image data. The system control unit 50 performs exposure control and ranging control based on the obtained evaluation value. As a result, TTL (through-the-lens) AF (autofocus) processing, AE (auto exposure) processing, AWB (auto white balance) processing, and the like can be performed.

画像処理部105から出力された画像データは、メモリ制御部107を介して画像メモリ106に書き込まれる。画像メモリ106は、撮像部103から出力された画像データや、表示部109に表示するための画像データを格納する。D/A変換器108は、画像メモリ106に格納されている画像表示用のデータをアナログ信号に変換して表示部109に供給する。表示部109は、LCD等の表示デバイス上に、D/A変換器108からのアナログ信号に応じた表示を行う。 Image data output from the image processing unit 105 is written into the image memory 106 via the memory control unit 107 . The image memory 106 stores image data output from the imaging unit 103 and image data to be displayed on the display unit 109 . The D/A converter 108 converts image display data stored in the image memory 106 into an analog signal and supplies the analog signal to the display unit 109 . The display unit 109 displays on a display device such as an LCD according to the analog signal from the D/A converter 108 .

コーデック部110は、画像メモリ106に記録された画像データをJPEG、MPEGなどの規格に基づき圧縮符号化する。システム制御部50は、符号化した画像データを、I/F111を介して記録媒体112に格納する。 A codec unit 110 compresses and encodes the image data recorded in the image memory 106 based on standards such as JPEG and MPEG. The system control unit 50 stores the encoded image data in the recording medium 112 via the I/F 111 .

以上、被写体撮影時の基本動作について説明した。上記の基本動作以外に、システム制御部50は、前述した不揮発性メモリ121に記録されたプログラムを実行することで、後述する本実施形態の各処理を実現する。ここでいうプログラムとは、本実施形態にて後述する各種フローチャートを実行するためのプログラムのことである。この際、システム制御部50の動作用の定数、変数、不揮発性メモリ121から読み出したプログラム等は、システムメモリ122に展開される。 The basic operation of photographing a subject has been described above. In addition to the basic operations described above, the system control unit 50 executes the programs recorded in the non-volatile memory 121 described above to realize each process of the present embodiment described later. The program here is a program for executing various flowcharts described later in this embodiment. At this time, constants and variables for the operation of the system control unit 50, programs read from the nonvolatile memory 121, and the like are developed in the system memory 122. FIG.

次に、図2を参照して、画像処理部105の詳細について説明する。図2は、画像処理部105の構成を示すブロック図である。図2において、200は同時化処理部、201はWB増幅部、202はリライティング処理部、203は輝度・色信号生成部である。204は輪郭強調処理部、205は輝度ガンマ処理部、206は色変換処理部、207は色ガンマ処理部、208は色差信号生成部、209は評価値生成部である。 Next, details of the image processing unit 105 will be described with reference to FIG. FIG. 2 is a block diagram showing the configuration of the image processing unit 105. As shown in FIG. In FIG. 2, 200 is a synchronization processing unit, 201 is a WB amplification unit, 202 is a relighting processing unit, and 203 is a luminance/color signal generation unit. 204 is an edge enhancement processor, 205 is a brightness gamma processor, 206 is a color conversion processor, 207 is a color gamma processor, 208 is a color difference signal generator, and 209 is an evaluation value generator.

画像処理部105における動作について説明する。図1のA/D変換器104から出力された画像信号が、画像処理部105に入力される。画像処理部105に入力された画像信号は、同時化処理部200に入力される。同時化処理部200は、入力されたベイヤーRGBの形式の画像データに対して同時化処理を行い、色信号R,G,Bを生成する。 The operation of the image processing unit 105 will be described. An image signal output from the A/D converter 104 in FIG. 1 is input to the image processing unit 105 . An image signal input to the image processing unit 105 is input to the synchronization processing unit 200 . The synchronization processing unit 200 performs synchronization processing on the input image data in Bayer RGB format to generate R, G, and B color signals.

WB増幅部201は、システム制御部50が算出するホワイトバランスゲイン値に基づき、RGBの色信号にゲインをかけ、ホワイトバランスを調整する。WB増幅部201は、ホワイトバランスが調整されたRGB信号を、リライティング処理部202に入力する。また、WB増幅部201は、ホワイトバランスが調整されたRGB信号を、後述する評価値の生成に用いる輝度信号Y’の生成に用いるR’G’B’信号として、輝度・色信号生成部203に入力する。 Based on the white balance gain value calculated by the system control unit 50, the WB amplification unit 201 applies a gain to the RGB color signals to adjust the white balance. The WB amplification unit 201 inputs the RGB signals whose white balance has been adjusted to the relighting processing unit 202 . Further, the WB amplification unit 201 converts the RGB signals whose white balance has been adjusted into the luminance/color signal generation unit 203 as R′G′B′ signals used to generate a luminance signal Y′ used to generate an evaluation value to be described later. to enter.

リライティング処理部202は、入力されたRGB信号に対して後述するリライティング処理を施した後に、RGB信号を輝度・色信号生成部203に出力する。輝度・色信号生成部203は、RGB信号から輝度信号Yを生成し、生成した輝度信号Yを輪郭強調処理部204へ、色信号RGBを色変換処理部206へ、それぞれ出力する。また、輝度・色信号生成部203は、WB増幅部201から入力されたR’G’B’信号から輝度信号Y’を生成し、評価値生成部209に入力する。 The relighting processing unit 202 outputs the RGB signals to the luminance/color signal generation unit 203 after performing relighting processing, which will be described later, on the input RGB signals. The luminance/color signal generation unit 203 generates a luminance signal Y from the RGB signals, and outputs the generated luminance signal Y to the contour enhancement processing unit 204 and the color signals RGB to the color conversion processing unit 206, respectively. Also, the luminance/chrominance signal generation unit 203 generates a luminance signal Y′ from the R′G′B′ signal input from the WB amplification unit 201 and inputs the luminance signal Y′ to the evaluation value generation unit 209 .

輪郭強調処理部204は、輝度信号Yに対して輪郭強調処理を行い、輝度ガンマ処理部205へ出力する。輝度ガンマ処理部205は、輝度信号Yに対してガンマ補正を行い、輝度信号Yを画像メモリ106に出力する。色変換処理部206は、RGB信号に対するマトリクス演算などにより、所望のカラーバランス変換を行う。色ガンマ処理部207は、RGBの色信号にガンマ補正を行う。色差信号生成部208は、RGB信号から色差信号R-Y、B-Yを生成し、画像メモリ106に出力する。画像メモリ106に出力された画像信号(Y、R-Y、B-Y)は、コーデック部110によって圧縮符号化され、記録媒体112に記録される。 The edge enhancement processing unit 204 performs edge enhancement processing on the luminance signal Y and outputs the result to the luminance gamma processing unit 205 . A luminance gamma processing unit 205 performs gamma correction on the luminance signal Y and outputs the luminance signal Y to the image memory 106 . A color conversion processing unit 206 performs desired color balance conversion by performing matrix calculations on RGB signals. A color gamma processing unit 207 performs gamma correction on the RGB color signals. A color difference signal generator 208 generates color difference signals RY and BY from the RGB signals and outputs them to the image memory 106 . The image signals (Y, RY, BY) output to the image memory 106 are compression-encoded by the codec section 110 and recorded on the recording medium 112 .

評価値生成部209は、実際の環境光源の状態を推定するための評価値を生成する。本実施形態における環境光源の状態とは、被写体に対する環境光源の方向及び強度(輝度)である。従って、評価値生成部209は、環境光源の方向及び強度を推定するための評価値を生成して出力する。具体的には、評価値生成部209は、図5に示すように画像を複数のブロックに分割し、ブロック毎の平均輝度値を算出する。評価値生成部209は、算出した評価値をシステムメモリ122に記録する。 The evaluation value generator 209 generates an evaluation value for estimating the actual state of the environment light source. The state of the environment light source in this embodiment is the direction and intensity (brightness) of the environment light source with respect to the object. Therefore, the evaluation value generator 209 generates and outputs an evaluation value for estimating the direction and intensity of the ambient light source. Specifically, the evaluation value generator 209 divides the image into a plurality of blocks as shown in FIG. 5, and calculates the average luminance value for each block. The evaluation value generator 209 records the calculated evaluation value in the system memory 122 .

次に、図3を参照して、リライティング処理部202の構成及び動作について説明する。図3は、リライティング処理部202の構成を示すブロック図である。図3において、301は、仮想光源が被写体に反射した特性(被写体における仮想光源の反射特性)を示す反射特性マップを複数読み込み合成する反射特性マップ合成部である。302は、仮想光源の反射特性マップを被写体に合わせてなじませるフィッティング処理部である。303は、反射特性マップに基づいて被写体に反射した色成分(仮想光源反射成分)を算出する仮想光源反射成分算出部である。304は、入力画像に対して仮想光源反射成分を加算する仮想光源付加処理部である。以下、リライティング処理部202の各部の動作について詳細に説明する。 Next, the configuration and operation of the relighting processing unit 202 will be described with reference to FIG. FIG. 3 is a block diagram showing the configuration of the relighting processing unit 202. As shown in FIG. In FIG. 3, reference numeral 301 denotes a reflection characteristic map synthesizing unit that reads and synthesizes a plurality of reflection characteristic maps indicating the characteristics of the reflection of the virtual light source on the subject (reflection characteristics of the virtual light source on the subject). Reference numeral 302 denotes a fitting processing unit that adapts the reflection characteristic map of the virtual light source to the subject. A virtual light source reflection component calculation unit 303 calculates a color component (virtual light source reflection component) reflected by the subject based on the reflection characteristic map. A virtual light source addition processing unit 304 adds a virtual light source reflection component to the input image. The operation of each unit of the relighting processing unit 202 will be described in detail below.

反射特性マップ合成部301は、事前に用意した仮想光源の反射特性マップ(詳細は後述)を複数読み込み合成する。この複数の反射特性マップの合成処理において、システム制御部50は、どの反射特性マップを読み込むのかの決定、及び合成パラメータの決定を行う。 The reflection characteristic map synthesizing unit 301 reads and synthesizes a plurality of reflection characteristic maps (details will be described later) of virtual light sources prepared in advance. In the process of synthesizing a plurality of reflection characteristic maps, the system control unit 50 determines which reflection characteristic map to read, and determines synthesis parameters.

図4を参照して、システム制御部50が反射特性マップ合成部301のために実行する合成パラメータ設定処理について説明する。被写体の撮影が行われると、図4のフローチャートの処理が開始する。 Synthesis parameter setting processing executed by the system control unit 50 for the reflection characteristic map synthesizing unit 301 will be described with reference to FIG. When the subject is photographed, the processing of the flowchart of FIG. 4 is started.

S401で、システム制御部50は、撮影した被写体の特徴量を取得する。具体的には、システム制御部50は、評価値生成部209(図2)により生成された、画像の各ブロックの平均輝度値を取得する。ブロック分割の例を図5に示す。評価値生成部209は、図5に示すように分割したブロック毎に被写体の平均輝度値を算出し、システム制御部50は、算出された平均輝度値を取得する。 In S401, the system control unit 50 acquires the feature amount of the photographed subject. Specifically, the system control unit 50 acquires the average luminance value of each block of the image generated by the evaluation value generation unit 209 (FIG. 2). An example of block division is shown in FIG. The evaluation value generation unit 209 calculates the average brightness value of the subject for each divided block as shown in FIG. 5, and the system control unit 50 acquires the calculated average brightness value.

S402で、システム制御部50は、撮影時のストロボ照射情報を取得する。ストロボ照射情報とは、撮影時にストロボ123を発光したか否かを示す情報である。 In S402, the system control unit 50 acquires strobe irradiation information at the time of photographing. The strobe irradiation information is information indicating whether or not the strobe 123 has emitted light at the time of photographing.

S403で、システム制御部50は、S401で取得した被写体の特徴量に応じて、リライティングモードを決定する。本実施形態では、リライティングモードとして、(1)斜光補正モード、(2)トップライト補正モード、(3)逆光補正モード、(4)フラット補正モード、の4種類がある場合の例について説明する。最初に、システム制御部50は、撮影された画像において顔検出部113が検出した顔領域の情報を取得する。例えば、システム制御部50は、顔検出部113から、顔領域501(図5(A)~(D)参照)の情報を取得する。次に、システム制御部50は、S401で取得した各ブロックの被写体特徴量のうち、顔領域501に含まれる各ブロックの被写体特徴量を取得する。システム制御部50は、顔領域501における被写体特徴量(輝度)の分布を解析し、分布が図5(A)~(D)のいずれに該当するかを判定する。図5(A)に示すように顔領域501の左右で明暗差がある場合、システム制御部50は斜光補正モードを選択する。図5(B)に示すように顔領域501の上下で明暗差があり、かつ上側が明るい場合、システム制御部50はトップライト補正モードを選択する。図5(C)に示すように顔領域501の中で明暗差が少なく、かつ顔領域501が他の領域よりも暗い場合、システム制御部50は逆光補正モードを選択する。図5(D)に示すように顔領域501の中で明暗差が少なく、かつ顔領域501が十分明るい場合、システム制御部50はフラット補正モードを選択する。なお、図5(A)には顔領域501の左側が明るく右側が暗い状態が示されているが、顔領域501の左側が暗く右側が明るい場合も斜光補正モードが選択される。顔領域501における被写体特徴量(輝度)の分布が上記4つのリライティングモードのいずれにも対応しない場合、システム制御部50は、リライティングによる画像補正を行わないと判定する。 In S403, the system control unit 50 determines a relighting mode according to the feature amount of the subject acquired in S401. In this embodiment, there are four relighting modes: (1) oblique light correction mode, (2) top light correction mode, (3) backlight correction mode, and (4) flat correction mode. First, the system control unit 50 acquires information on the face area detected by the face detection unit 113 in the captured image. For example, the system control unit 50 acquires information on the face area 501 (see FIGS. 5A to 5D) from the face detection unit 113. FIG. Next, the system control unit 50 acquires the subject feature amount of each block included in the face area 501 among the subject feature amounts of each block acquired in S401. The system control unit 50 analyzes the distribution of subject feature amounts (brightness) in the face area 501 and determines to which of FIGS. 5A to 5D the distribution corresponds. As shown in FIG. 5A, when there is a difference in brightness between the left and right sides of the face area 501, the system control unit 50 selects the oblique light correction mode. As shown in FIG. 5B, when there is a difference in brightness between the upper and lower sides of the face area 501 and the upper side is bright, the system control unit 50 selects the top light correction mode. As shown in FIG. 5C, when the difference in brightness in the face area 501 is small and the face area 501 is darker than other areas, the system control unit 50 selects the backlight correction mode. As shown in FIG. 5D, when the difference in brightness is small in the face area 501 and the face area 501 is sufficiently bright, the system control unit 50 selects the flat correction mode. Although FIG. 5A shows a state in which the left side of the face area 501 is bright and the right side is dark, the oblique light correction mode is also selected when the left side of the face area 501 is dark and the right side is bright. If the distribution of subject feature amounts (luminance) in the face area 501 does not correspond to any of the above four relighting modes, the system control unit 50 determines not to perform image correction by relighting.

S404で、システム制御部50は、S403で決定したリライティングモードに応じた反射特性マップ(反射特性データ)を選択し、選択した反射特性マップの合成特性を決定する。反射特性マップとは、平均的な顔形状モデルに対して、所定の光源位置からリライティングした結果の反射特性を示した画像である。反射特性マップの例を図6に示す。図6の上段は、光源の位置を左側90度(L90)から、右側90度(R90)まで変化させた反射特性マップを示している。図6の下段は、光源の位置を下側60度(Down60)及び上側60度(Up60)に設定した場合の反射特性マップを示している。このような反射特性マップは、平均的な顔形状モデルに基づき事前に生成しておき、不揮発性メモリ121(図1)に記録しておくものとする。 In S404, the system control unit 50 selects a reflection characteristic map (reflection characteristic data) corresponding to the relighting mode determined in S403, and determines the composite characteristic of the selected reflection characteristic map. A reflection characteristic map is an image showing the reflection characteristic of an average face shape model as a result of relighting from a predetermined light source position. An example of a reflection characteristic map is shown in FIG. The upper part of FIG. 6 shows a reflection characteristic map in which the position of the light source is changed from 90 degrees to the left (L90) to 90 degrees to the right (R90). The lower part of FIG. 6 shows reflection characteristic maps when the position of the light source is set to 60 degrees downward (Down60) and 60 degrees upward (Up60). It is assumed that such a reflection characteristic map is generated in advance based on an average face shape model and recorded in the nonvolatile memory 121 (FIG. 1).

図7を参照して、リライティングモードと使用する反射特性マップとの関係について説明する。図7の例において、リライティングモードが「斜光補正モード」の場合、被写体の左右を比較して暗い側に対して60度の角度から仮想光源を照射する。また、明るい側に対して60度の角度から光を減光する。図5(A)の例の場合、被写体に向かって右側が暗く、左側が明るい。そのため、右側60度から仮想光源を照射した場合の反射特性マップ(R60)と、左側60度から仮想光源を照射した場合の反射特性マップ(L60)とを、下記の式(1)に従って合成する。
M = α×(R60)-β×(L60) ・・・(1)
ここで、Mは合成後の反射特性マップであり、α及びβは合成の際の係数(合成特性)であって0~1の値を取る。システム制御部50は、顔の所定の基準輝度に対して顔の暗部が暗いほどαを大きく設定し、基準輝度に対して顔の明部が明るいほどβを大きく設定する。βの項はマイナスになっているため減光を示している。合成後の反射特性マップを図8(A)に示す。合成後の反射特性マップ(合成反射特性データ)は、被写体の各位置における反射特性を表現する画像(反射特性画像)のデータ形式を持つ。図8(A)において、基準階調(例えば8ビットの場合は128)よりも明るい部分は加算光、暗い場合は減算光を示している(図8(B)~(D)においても同様)。
The relationship between the relighting mode and the reflection characteristic map to be used will be described with reference to FIG. In the example of FIG. 7, when the relighting mode is the "oblique light correction mode", the left and right sides of the subject are compared, and the dark side is irradiated with the virtual light source at an angle of 60 degrees. It also dims light from an angle of 60 degrees to the bright side. In the example of FIG. 5A, the subject is dark on the right side and bright on the left side. Therefore, the reflection characteristic map (R60) when the virtual light source is irradiated from the right 60 degrees and the reflection characteristic map (L60) when the virtual light source is irradiated from the left 60 degrees are combined according to the following formula (1). .
M = α × (R60) - β × (L60) (1)
Here, M is a reflection characteristic map after synthesis, and α and β are coefficients (synthesis characteristics) at the time of synthesis and take values from 0 to 1. FIG. The system control unit 50 sets α larger as the dark part of the face is darker with respect to the predetermined reference luminance of the face, and sets β larger as the bright part of the face is brighter than the reference luminance. Since the β term is negative, it indicates extinction. FIG. 8A shows the reflection characteristic map after synthesis. The synthesized reflection characteristic map (synthetic reflection characteristic data) has a data format of an image (reflection characteristic image) expressing the reflection characteristic at each position of the subject. In FIG. 8A, parts brighter than the reference gradation (for example, 128 in the case of 8 bits) indicate addition light, and darker parts indicate subtraction light (the same applies to FIGS. 8B to 8D). .

図5(A)とは逆に、被写体に向かって左側が暗く、右側が明るい場合は、式(1)において使用する反射特性マップの左右を反転する。即ち、左側60度から仮想光源を照射した場合の反射特性マップ(L60)と、右側60度から仮想光源を照射した場合の反射特性マップ(R60)とを、下記の式(2)に従って合成する。
M = α×(L60)-β×(R60) ・・・(2)
Contrary to FIG. 5A, when the subject is dark on the left side and bright on the right side, the reflection characteristic map used in equation (1) is left-right reversed. That is, the reflection characteristic map (L60) when the virtual light source is irradiated from the left 60 degrees and the reflection characteristic map (R60) when the virtual light source is irradiated from the right 60 degrees are combined according to the following formula (2). .
M = α × (L60) - β × (R60) (2)

式(2)において、システム制御部50は、顔の所定の基準輝度に対して顔の暗部が暗いほどαを大きく設定し、基準輝度に対して顔の明部が明るいほどβを大きく設定する。 In equation (2), the system control unit 50 sets α larger as the darker part of the face is darker with respect to the predetermined reference luminance of the face, and sets β larger as the brighter part of the face is brighter than the reference luminance. .

次に、リライティングモードが「トップライト補正モード」の場合について説明する。この場合、図5(B)に示すように、被写体の頭部付近が明るく、口から下が暗くなっている。そのため、被写体の上側から減光し、下側から加算光を照射することで顔に当たる光のバランスをとる。即ち、上側60度から仮想光源を照射した場合の反射特性マップ(Up60)と、下側60度から仮想光源を照射した場合の反射特性マップ(Down60)とを、下記の式(3)に従って合成する。
M = α×(Down60)-β×(Up60) ・・・(3)
Next, the case where the relighting mode is the "top light correction mode" will be described. In this case, as shown in FIG. 5B, the area around the subject's head is bright and the area below the mouth is dark. Therefore, by reducing the light from the upper side of the subject and irradiating the additional light from the lower side, the light striking the face is balanced. That is, the reflection characteristic map (Up60) when the virtual light source is irradiated from above 60 degrees and the reflection characteristic map (Down60) when the virtual light source is irradiated from below 60 degrees are synthesized according to the following formula (3). do.
M = α × (Down60) - β × (Up60) (3)

この場合の合成後の反射特性マップを図8(B)に示す。なお、式(3)において、システム制御部50は、顔の所定の基準輝度に対して顔の暗部が暗いほどαを大きく設定し、基準輝度に対して顔の明部が明るいほどβを大きく設定する。 FIG. 8B shows a reflection characteristic map after synthesis in this case. In equation (3), the system control unit 50 sets α larger as the darker part of the face is darker with respect to the predetermined reference luminance of the face, and increases β as the brighter part of the face is brighter than the reference luminance. set.

リライティングモードが「逆光補正モード」の場合、顔が全体的に暗いため、正面と、正面下方それぞれから加算光の仮想光源を照射する。即ち、正面から仮想光源を照射した場合の反射特性マップ(F0)と、下側60度から仮想光源を照射した場合の反射特性マップ(Down60)とを、下記の式(4)に従って合成する。
M = α×(F0)+β×(Down60) ・・・(4)
When the relighting mode is the "backlight correction mode", the face is dark as a whole, so virtual light sources of added light are emitted from the front and from below the front. That is, the reflection characteristic map (F0) when the virtual light source is irradiated from the front and the reflection characteristic map (Down60) when the virtual light source is irradiated from below 60 degrees are combined according to the following formula (4).
M=α×(F0)+β×(Down60) (4)

この場合の合成後の反射特性マップを図8(C)に示す。なお、式(4)において、システム制御部50は、顔の所定の基準輝度に対して顔領域501が暗いほどα及びβを大きく設定する。 FIG. 8C shows a reflection characteristic map after synthesis in this case. In equation (4), the system control unit 50 sets α and β to be larger as the face region 501 is darker with respect to the predetermined reference luminance of the face.

リライティングモードが「フラット補正モード」であり、ストロボ発光がない場合、仮想光源を左右どちらか斜め60度から照射する。この場合、反射特性マップの合成は行われず、式(5)に示すようにゲインの調整だけが行われる。
M = α×(L60又はR60) ・・・(5)
When the relighting mode is the "flat correction mode" and there is no strobe light emission, the virtual light source is emitted from either the left or the right at an angle of 60 degrees. In this case, reflection characteristic maps are not synthesized, and only gain adjustment is performed as shown in equation (5).
M=α×(L60 or R60) (5)

なお、式(5)において、システム制御部50は、顔の所定の基準輝度に対して顔領域501が暗いほどαを大きく設定する。 In equation (5), the system control unit 50 sets α larger as the face region 501 is darker with respect to the predetermined reference luminance of the face.

リライティングモードが「フラット補正モード」であり、ストロボ発光がある場合、ストロボ光をキャンセルするため、正面からの光を減光し、仮想光源を正面上側から照射する。具体的には、正面から仮想光源を照射した場合の反射特性マップ(F0)と、上側60度から仮想光源を照射した場合の反射特性マップ(Up60)とを、下記の式(6)に従って合成する。
M = α×(Up60)-β×(F0) ・・・(6)
When the relighting mode is the “flat correction mode” and strobe light is emitted, the light from the front is reduced to cancel the strobe light, and the virtual light source is illuminated from the front upper side. Specifically, the reflection characteristic map (F0) when the virtual light source is irradiated from the front and the reflection characteristic map (Up60) when the virtual light source is irradiated from above 60 degrees are combined according to the following formula (6). do.
M = α × (Up60) - β × (F0) (6)

この場合の合成後の反射特性マップを図8(D)に示す。なお、式(6)において、システム制御部50は、顔の所定の基準輝度に対して顔領域501が暗いほどαを大きく設定し、基準輝度に対して顔の明部が明るいほどβを大きく設定する。 FIG. 8D shows a reflection characteristic map after synthesis in this case. In equation (6), the system control unit 50 sets α larger as the face region 501 is darker with respect to the predetermined reference luminance of the face, and sets β larger as the bright part of the face is brighter than the reference luminance. set.

以上、リライティングモードに応じた反射特性マップの選択と合成特性(係数α及びβの値及び符号)の決定について説明した。 The selection of the reflection characteristic map and the determination of the composite characteristic (the values and signs of the coefficients α and β) according to the relighting mode have been described above.

S405で、システム制御部50は、S404で決定した合成パラメータ(反射特性マップ及び合成特性)を反射特性マップ合成部301に設定する。 In S<b>405 , the system control unit 50 sets the synthesis parameters (reflection characteristic map and synthesis characteristics) determined in S<b>404 in the reflection characteristic map synthesis unit 301 .

以上、システム制御部50が反射特性マップ合成部301のために実行する合成パラメータ設定処理について説明した。その後、反射特性マップ合成部301は、設定された合成パラメータに基づいて反射特性マップの合成処理を行う。反射特性マップ合成部301は、合成後の反射特性マップを、フィッティング処理部302に出力する。フィッティング処理部302は、撮影画像(Rin、Gin、Bin)を参照して、合成後の反射特性マップに対してフィッティング処理を行う。 The synthesizing parameter setting processing executed by the system control unit 50 for the reflection characteristic map synthesizing unit 301 has been described above. After that, the reflection characteristic map synthesizing unit 301 performs synthesis processing of the reflection characteristic maps based on the set synthesis parameters. The reflection characteristic map synthesizing section 301 outputs the synthesized reflection characteristic map to the fitting processing section 302 . The fitting processing unit 302 refers to the captured images (Rin, Gin, Bin) and performs fitting processing on the synthesized reflection characteristic map.

図9を参照して、フィッティング処理について説明する。図9(A)は、合成後の反射特性マップを示す。反射特性マップには、目や口の位置に対応した特徴点901~903が予め設定されている。図9(B)は、撮影画像(Rin、Gin、Bin)を示す。まず、フィッティング処理部302は、撮影画像の被写体の特徴点(目や口など)の位置904~906を基準に、反射特性マップを幾何変形(幾何学変換)する。具体的には、フィッティング処理部302は、顔検出部113(図1)から、撮影画像の被写体の特徴点(目や口など)の座標位置を取得する。そして、フィッティング処理部302は、特徴点901~903と位置904~906との位置関係が整合するように、反射特性マップに対して拡大、縮小、及び回転を行う。これにより、反射特性マップの平均的な顔形状モデル(所定の被写体)と撮影画像に含まれる被写体との形状の相違を補償することができる。 The fitting process will be described with reference to FIG. FIG. 9A shows a reflection characteristic map after synthesis. Feature points 901 to 903 corresponding to the positions of the eyes and mouth are preset in the reflection characteristic map. FIG. 9B shows captured images (Rin, Gin, Bin). First, the fitting processing unit 302 geometrically deforms (geometrically transforms) the reflection characteristic map based on the positions 904 to 906 of the feature points (eyes, mouth, etc.) of the photographed image. Specifically, the fitting processing unit 302 acquires the coordinate positions of the feature points (eyes, mouth, etc.) of the subject in the captured image from the face detection unit 113 (FIG. 1). Then, the fitting processing unit 302 enlarges, reduces, and rotates the reflection characteristic map so that the positional relationships between the feature points 901 to 903 and the positions 904 to 906 match. This makes it possible to compensate for the difference in shape between the average face shape model (predetermined subject) of the reflection characteristic map and the subject included in the captured image.

次に、フィッティング処理部302は、撮影画像を参照画像として用いて、反射特性マップに対してジョイントバイラテラルフィルタを適用する。これにより、参照画像のエッジを保存した状態で反射特性マップに平滑化処理を適用することが可能である。ジョイントバイラテラルフィルタを適用した結果を図9(C)に示す。フィッティング処理部302は、ジョイントバイラテラルフィルタの適用により得られた反射特性マップMfを、仮想光源反射成分算出部303に出力する。 Next, the fitting processing unit 302 applies a joint bilateral filter to the reflection characteristic map using the captured image as a reference image. This makes it possible to apply the smoothing process to the reflection property map while preserving the edges of the reference image. The result of applying the joint bilateral filter is shown in FIG. 9(C). The fitting processing unit 302 outputs the reflection characteristic map Mf obtained by applying the joint bilateral filter to the virtual light source reflection component calculation unit 303 .

なお、リライティングモードが「フラット補正モード」であり、ストロボ発光がない場合のように、複数の反射特性マップを合成する合成処理が行われない場合がある。この場合、上記の式(5)に示すように、反射特性マップ合成部301は、選択された反射特性マップに対して係数を乗じることにより得られる反射特性マップを、フィッティング処理部302に出力する。そして、フィッティング処理部302は、合成処理が行われた場合と同様に、反射特性マップ合成部301から出力された反射特性マップに対して、上で説明したフィッティング処理を行う。 As in the case where the relighting mode is the "flat correction mode" and there is no strobe light emission, there is a case where the synthesis processing for synthesizing a plurality of reflection characteristic maps is not performed. In this case, as shown in the above equation (5), the reflection characteristic map synthesizing section 301 outputs the reflection characteristic map obtained by multiplying the selected reflection characteristic map by a coefficient to the fitting processing section 302. . Then, the fitting processing unit 302 performs the above-described fitting process on the reflection characteristic map output from the reflection characteristic map combining unit 301 in the same manner as when the combining process is performed.

仮想光源反射成分算出部303は、式(7)に従い、撮影画像(Rin、Gin、Bin)に対してフィッティング処理後の反射特性マップMfを乗算する。これにより、仮想光源による被写体の反射色成分(Ra、Ga、Ba)が算出される。
Ra = Mf×Rin
Ga = Mf×Gin ・・・(7)
Ba = Mf×Bin
The virtual light source reflection component calculation unit 303 multiplies the captured image (Rin, Gin, Bin) by the reflection characteristic map Mf after the fitting process according to Equation (7). Thereby, the reflected color components (Ra, Ga, Ba) of the subject by the virtual light source are calculated.
Ra = Mf x Rin
Ga=Mf×Gin (7)
Ba = Mf x Bin

仮想光源反射成分算出部303は、算出した仮想光源による被写体の反射成分(Ra、Ga、Ba)を仮想光源付加処理部304へ出力する。 The virtual light source reflection component calculation unit 303 outputs the calculated reflection components (Ra, Ga, Ba) of the subject due to the virtual light source to the virtual light source addition processing unit 304 .

仮想光源付加処理部304は、式(8)に従い、被写体領域に対して仮想光源の反射成分(Ra、Ga、Ba)を付加する。
Rout = Rin+Ra
Gout = Gin+Ga ・・・(8)
Bout = Bin+Ba
The virtual light source addition processing unit 304 adds reflection components (Ra, Ga, Ba) of the virtual light source to the subject area according to Equation (8).
Rout = Rin + Ra
Gout=Gin+Ga (8)
Bout = Bin + Ba

以上説明したように、第1の実施形態によれば、デジタルカメラ100は、複数の反射特性マップを合成し、合成後の反射特性マップが示す反射特性に基づいて画像に含まれる被写体の反射成分を生成し、生成した反射成分を画像に対して付加する。これにより、複数の仮想光源を用いるリライティングの処理負荷を軽減することが可能となる。 As described above, according to the first embodiment, the digital camera 100 synthesizes a plurality of reflection characteristic maps, and calculates the reflection component of the subject included in the image based on the reflection characteristics indicated by the synthesized reflection characteristic map. and add the generated reflection component to the image. This makes it possible to reduce the processing load of relighting using a plurality of virtual light sources.

なお、本実施形態では、デジタルカメラ100が反射特性マップを左右方向で5段階、上下方向で2段階持っている場合を例に説明を行ったが、反射特性マップの持ち方はこれに限定されない。例えば、デジタルカメラ100は、上下左右それぞれ10段階など、より多くのパターンの反射特性マップを保持していてもよい。また、例えば左側60度と右側60度のように左右対称の反射特性マップのペアについては、いずれか一方のみを用意しておき、デジタルカメラ100が被写体の状態に応じて反射特性マップを左右反転して利用してもよい。 In the present embodiment, the case where the digital camera 100 has five levels of reflection characteristic maps in the horizontal direction and two levels in the vertical direction has been described as an example, but the way of holding the reflection characteristic maps is not limited to this. . For example, the digital camera 100 may hold more patterns of reflection characteristic maps, such as 10 levels for each of the top, bottom, left, and right. For a pair of symmetrical reflection characteristic maps, for example, 60 degrees to the left and 60 degrees to the right, only one of them is prepared, and the digital camera 100 flips the reflection characteristic map horizontally according to the state of the subject. You can use it by

また、本実施形態では、反射特性マップの合成演算として、加算及び減算の例について説明したが、反射特性マップを合成する際の演算は、加算及び減算に限定されない。例えば、合成演算は、乗算又は除算を含んでもよいし、RGB色成分の割合を変化させて合成するような色変換処理を含んでもよい。 Further, in the present embodiment, examples of addition and subtraction have been described as reflection characteristic map synthesizing operations, but operations for synthesizing reflection characteristic maps are not limited to addition and subtraction. For example, the compositing operation may include multiplication or division, or may include color conversion processing such as compositing by changing the ratio of RGB color components.

また、本実施形態では、リライティングモードとして「斜光補正モード」、「トップライト補正モード」、「逆光補正モード」、及び「フラット補正モード」の4つのモードがある場合について説明した。しかし、リライティングモードはこれら4つのモードに限定されない。リライティングモードに応じて反射特性マップの合成パラメータを決定する構成であれば、どのようなモードを用意してもよい。 Also, in the present embodiment, a case where there are four relighting modes, namely, the "oblique light correction mode", the "top light correction mode", the "backlight correction mode", and the "flat correction mode", has been described. However, relighting modes are not limited to these four modes. Any mode may be prepared as long as the composition parameter of the reflection characteristic map is determined according to the relighting mode.

また、本実施形態では、被写体の輝度分布に応じてリライティングモードを決定する構成について説明したが、リライティングモードの決定はこれ以外の方法で行ってもよい。例えば、ユーザ指示に従ってリライティングモードを決定(選択)する構成を取ることも可能である。 Also, in this embodiment, the configuration for determining the relighting mode according to the luminance distribution of the subject has been described, but the relighting mode may be determined by other methods. For example, it is possible to adopt a configuration in which a relighting mode is determined (selected) according to a user instruction.

また、本実施形態では、2つの反射特性マップを合成する場合を例に説明したが、複数の反射特性マップを合成する構成であれば、いくつの反射特性マップを合成しても構わない。例えば、3灯照明を再現するために3つの反射特性マップを合成するなどの構成を取ることも可能である。 Further, in the present embodiment, the case of synthesizing two reflection characteristic maps has been described as an example, but any number of reflection characteristic maps may be synthesized as long as they are configured to synthesize a plurality of reflection characteristic maps. For example, it is possible to synthesize three reflection characteristic maps in order to reproduce three-lamp illumination.

[第2の実施形態]
第1の実施形態では、撮影時に被写体の状況に応じてリライティングモードを選択し、リライティングモードに応じて反射特性マップの合成パラメータを制御する構成について説明した。第2の実施形態では、記録媒体112に一度記録したRAW画像を現像する際に、ユーザ指示に応じた仮想光源によるリライティングを行う構成について説明する。第2の実施形態において、デジタルカメラ100の基本的な構成は第1の実施形態と同様である(図1乃至図3参照)。以下、主に第1の実施形態と異なる点について説明する。
[Second embodiment]
In the first embodiment, a configuration has been described in which the relighting mode is selected according to the condition of the subject during shooting, and the composition parameter of the reflection characteristic map is controlled according to the relighting mode. In the second embodiment, a configuration will be described in which relighting is performed using a virtual light source according to a user instruction when developing a RAW image once recorded on the recording medium 112 . In the second embodiment, the basic configuration of the digital camera 100 is the same as in the first embodiment (see FIGS. 1 to 3). Differences from the first embodiment will be mainly described below.

デジタルカメラ100は、撮像部103で撮影した撮影画像をすぐに画像処理部105で現像処理するのではなく、記録媒体112にRAW画像を一旦記録する。その後、ユーザの操作によって画像が選択されると、デジタルカメラ100は記録媒体112からRAW画像を読み出し、画像処理部105により画像処理を行う。 The digital camera 100 does not immediately develop the captured image captured by the imaging unit 103 by the image processing unit 105 , but temporarily records the RAW image on the recording medium 112 . After that, when an image is selected by the user's operation, the digital camera 100 reads the RAW image from the recording medium 112 and the image processing unit 105 performs image processing.

本実施形態では、図3の反射特性マップ合成部301に設定する反射特性マップの合成パラメータの決定方法が第1の実施形態と異なる。図10を参照して、合成パラメータの決定方法について説明する。 This embodiment differs from the first embodiment in the method of determining synthesis parameters for reflection characteristic maps set in the reflection characteristic map synthesis unit 301 of FIG. A method for determining synthesis parameters will be described with reference to FIG.

図10は、第2の実施形態に係る、システム制御部50が反射特性マップ合成部301のために実行する合成パラメータ設定処理のフローチャートである。ユーザにより現像対象画像(リライティング対象の画像)が選択されると、本フローチャートの処理が開始する。 FIG. 10 is a flowchart of synthesis parameter setting processing executed by the system control unit 50 for the reflection characteristic map synthesis unit 301 according to the second embodiment. When the user selects an image to be developed (an image to be relighted), the processing of this flowchart starts.

S1001で、システム制御部50は、リライティングする仮想光源の照射角度を決定する。照射角度はユーザ操作に従って決定される。仮想光源を設置するユーザ操作のためのユーザインタフェースの例を図11に示す。 In S1001, the system control unit 50 determines the irradiation angle of the virtual light source for relighting. The irradiation angle is determined according to user's operation. FIG. 11 shows an example of a user interface for user operation to install a virtual light source.

図11において、1101はカメラ筐体、1102は操作部、1103は表示部を示している。操作部1102は、図1の操作部120に含まれる。表示部1103は、図1の表示部109に含まれる。リライティング対象の画像がユーザによって選択されると、システム制御部50は、表示部1103に選択された画像を表示する。1104~1106は、設定された仮想光源の位置を示している。デジタルカメラ100は、この仮想光源の位置と方向に基づいてリライティング処理を行う。仮想光源の位置は、ユーザによるタッチ操作によって決定される。1104~1106に示すように、ユーザは任意の位置に複数の仮想光源を設置することが可能である。光源の位置が決定されると、システム制御部50は、設定された仮想光源の位置から主被写体の中心方向に仮想光源を照射するように照射角度を決定する。仮想光源は複数設置可能であり、図11では3灯の仮想光源1104、1105、1106が設置された場合を示している。システム制御部50は、仮想光源の照射角度を決定した後、設置した複数の仮想光源毎に、S1002~S1007の処理を実行する。 In FIG. 11, 1101 denotes a camera casing, 1102 denotes an operation section, and 1103 denotes a display section. An operation unit 1102 is included in the operation unit 120 in FIG. A display unit 1103 is included in the display unit 109 in FIG. When the user selects an image to be relighted, the system control unit 50 displays the selected image on the display unit 1103 . 1104 to 1106 indicate the positions of the set virtual light sources. The digital camera 100 performs relighting processing based on the position and direction of this virtual light source. The position of the virtual light source is determined by a user's touch operation. As shown at 1104-1106, the user can place multiple virtual light sources at arbitrary positions. When the position of the light source is determined, the system control unit 50 determines the irradiation angle so that the virtual light source is projected from the set position of the virtual light source toward the center of the main subject. A plurality of virtual light sources can be installed, and FIG. 11 shows a case where three virtual light sources 1104, 1105, and 1106 are installed. After determining the irradiation angle of the virtual light source, the system control unit 50 executes the processing of S1002 to S1007 for each of the plurality of installed virtual light sources.

S1002で、システム制御部50は、照射角度に対応する反射特性マップが不揮発性メモリ121に記録されているか否かを判定する。本実施形態では、第1の実施形態と同様に、図6に示す7種類の反射特性マップが不揮発性メモリ121に記録されているものとする。図11の例では、仮想光源1104は被写体の正面にあり、図6の「F0」が照射角度に対応する。仮想光源1106は被写体の左側90度の位置にあり、図6の「L90」が照射角度に対応する。仮想光源1104、1106の例では、対応する反射特性マップが存在するので、処理はS1003に進む。一方、仮想光源1105は、被写体の左側75度から照射している。この照射角度に対応する反射特性マップは存在しないため、処理はS1004に進む。 In S<b>1002 , the system control unit 50 determines whether or not the reflection characteristic map corresponding to the irradiation angle is recorded in the nonvolatile memory 121 . In this embodiment, as in the first embodiment, seven types of reflection characteristic maps shown in FIG. 6 are recorded in the nonvolatile memory 121. FIG. In the example of FIG. 11, the virtual light source 1104 is in front of the subject, and "F0" in FIG. 6 corresponds to the irradiation angle. The virtual light source 1106 is positioned 90 degrees to the left of the object, and "L90" in FIG. 6 corresponds to the irradiation angle. In the example of virtual light sources 1104 and 1106, there is a corresponding reflection property map, so processing proceeds to S1003. On the other hand, the virtual light source 1105 illuminates from 75 degrees to the left of the subject. Since there is no reflection characteristic map corresponding to this irradiation angle, the process proceeds to S1004.

S1003で、システム制御部50は、仮想光源の照射角度に対応する反射特性マップを選択する。図11の例では、仮想光源1104に対しては図6の「F0」、仮想光源1106に対しては図6の「L90」が選択される。 In S1003, the system control unit 50 selects a reflection characteristic map corresponding to the irradiation angle of the virtual light source. In the example of FIG. 11 , “F0” in FIG. 6 is selected for the virtual light source 1104 and “L90” in FIG. 6 is selected for the virtual light source 1106 .

S1004で、システム制御部50は、仮想光源の照射角度に最も近い反射特性マップを2つ(決定した照射角度よりも大きいものと小さいもの)選択する。図11の例では、仮想光源1105は、左側75度の照射角度を持つため、左側75度に近い、左側90度(L90)と左側60度(L60)の2つの反射特性マップが選択される。 In S1004, the system control unit 50 selects two reflection characteristic maps (one larger than the determined irradiation angle and one smaller than the determined irradiation angle) that are closest to the irradiation angle of the virtual light source. In the example of FIG. 11, the virtual light source 1105 has an irradiation angle of 75 degrees to the left, so two reflection characteristic maps of 90 degrees to the left (L90) and 60 degrees to the left (L60), which are close to 75 degrees to the left, are selected. .

S1005で、システム制御部50は、選択した2つの反射特性マップを合成する合成比率を決定する。仮想光源1105の場合、左側75度は左側90度と左側60度の中間の角度であるため、左側90度の反射特性マップ(L90)と左側60度の反射特性マップ(L60)とを1対1の比率で合成する。即ち、式(9)に従って反射特性マップの合成処理を行うことにより、近似的に左側75度から照射した反射特性マップを生成することができる。
M = 0.5×(L90)+0.5×(L60) ・・・(9)
In S1005, the system control unit 50 determines a synthesis ratio for synthesizing the two selected reflection characteristic maps. In the case of the virtual light source 1105, 75 degrees on the left side is an intermediate angle between 90 degrees on the left side and 60 degrees on the left side. Synthesize at a ratio of 1. That is, by synthesizing the reflection characteristic maps according to Equation (9), it is possible to approximately generate a reflection characteristic map irradiated from the left 75 degrees.
M = 0.5 x (L90) + 0.5 x (L60) (9)

S1006で、システム制御部50は、合成パラメータ(反射特性マップ及び合成比率)を反射特性マップ合成部301に設定する。 In S<b>1006 , the system control unit 50 sets synthesis parameters (reflection characteristic map and synthesis ratio) in the reflection characteristic map synthesis unit 301 .

S1007で、システム制御部50は、全ての仮想光源の処理が完了したか否かを判定する。図11の例では仮想光源を3つ設定しているため、システム制御部50は、3つの仮想光源に関してS1002~S1006の処理が完了したか否かを判定する。全ての仮想光源の処理が完了した場合、処理はS1008に進み、そうでない場合、処理はS1002に戻る。 In S1007, the system control unit 50 determines whether processing of all virtual light sources has been completed. Since three virtual light sources are set in the example of FIG. 11, the system control unit 50 determines whether or not the processing of S1002 to S1006 has been completed for the three virtual light sources. If all virtual light sources have been processed, the process proceeds to S1008; otherwise, the process returns to S1002.

S1008で、システム制御部50は、選択又は生成した全ての仮想光源の反射特性マップを加算合成するように反射特性マップ合成部301を設定する。図11の例では、システム制御部50は、仮想光源1104~1106に対応する3つの反射特性マップを合成し、1つの合成反射特性マップを生成するように、反射特性マップ合成部301を設定する。 In S1008, the system control unit 50 sets the reflection property map synthesizing unit 301 to add and synthesize the reflection property maps of all the selected or generated virtual light sources. In the example of FIG. 11, the system control unit 50 sets the reflection property map synthesizing unit 301 so as to synthesize three reflection property maps corresponding to the virtual light sources 1104 to 1106 and generate one synthetic reflection property map. .

以上、システム制御部50が反射特性マップ合成部301のために実行する合成パラメータ設定処理について説明した。その後、反射特性マップ合成部301は、設定された合成パラメータに基づいて反射特性マップの合成処理を行う。以後の処理は、第1の実施形態と同様である。 The synthesizing parameter setting processing executed by the system control unit 50 for the reflection characteristic map synthesizing unit 301 has been described above. After that, the reflection characteristic map synthesizing unit 301 performs synthesis processing of the reflection characteristic maps based on the set synthesis parameters. Subsequent processing is the same as in the first embodiment.

以上説明したように、第2の実施形態によれば、デジタルカメラ100は、リライティング処理を行う際に、ユーザ操作に従って仮想光源の照射角度を決定する。そして、デジタルカメラ100は、予め用意した反射特性マップを合成することにより、決定した照射角度に対応する反射特性マップを生成する。これにより、比較的少ない処理負荷で所望の照射角度の反射特性マップを生成することが可能となる。 As described above, according to the second embodiment, the digital camera 100 determines the irradiation angle of the virtual light source according to the user's operation when performing the relighting process. Then, the digital camera 100 generates a reflection characteristic map corresponding to the determined irradiation angle by synthesizing reflection characteristic maps prepared in advance. This makes it possible to generate a reflection characteristic map for a desired irradiation angle with a relatively small processing load.

なお、本実施形態では、予め保持していた反射特性マップを合成することで最終的な反射特性マップを生成した。しかし、予め保持していた反射特性マップ以外に、撮影時に取得した被写体の形状から算出した反射特性マップを併せて利用する構成を取ることも可能である。この場合、デジタルカメラ100は、被写体の形状を取得し、形状に基づき反射特性マップを生成する。また、デジタルカメラ100は、予め保持していた反射特性マップと、被写体の形状に基づく反射特性マップとを選択的に利用するように構成されていてもよい。具体的には、デジタルカメラ100は、測距センサ124から取得した距離情報から法線を算出し、法線と仮想光源の位置・方向・反射率などに基づき反射特性マップを生成する。測距センサ124を用いて生成された反射特性マップは、精度は高くなるが、生成するための時間はかかってしまう。そこで、プレビューなど速度を重視する場合は事前に用意していた反射特性マップを合成して利用し、最終的な画像など精度を重視する場合は測距センサ124を用いて生成した反射特性マップを利用する方法を取ることも可能である。 Note that in the present embodiment, the final reflection characteristic map is generated by synthesizing reflection characteristic maps stored in advance. However, it is also possible to employ a configuration in which a reflection characteristic map calculated from the shape of the subject acquired at the time of photographing is also used in addition to the previously stored reflection characteristic map. In this case, the digital camera 100 acquires the shape of the subject and generates a reflection characteristic map based on the shape. Further, the digital camera 100 may be configured to selectively use a previously stored reflection characteristic map and a reflection characteristic map based on the shape of the subject. Specifically, the digital camera 100 calculates a normal line from the distance information acquired from the ranging sensor 124, and generates a reflection characteristic map based on the normal line and the position, direction, reflectance, etc. of the virtual light source. The reflection characteristic map generated using the distance measuring sensor 124 has high accuracy, but it takes time to generate. Therefore, when the speed is important, such as a preview, the reflection characteristic maps prepared in advance are synthesized and used, and when the accuracy is important, such as the final image, the reflection characteristic map generated using the distance measuring sensor 124 is used. It is also possible to take the method of using.

また、被写体距離が離れすぎて距離情報を取得できない場合や、顔が小さい、暗すぎる、明るすぎるなどの理由により法線の精度が悪化するような条件の場合がある。このような場合、精度を優先する場合であっても、事前に用意していた反射特性マップに切り替えて利用する構成を取ることも可能である。 In addition, there are cases where the distance information cannot be obtained because the subject is too far away, or where the accuracy of the normal line deteriorates due to reasons such as the face being too small, too dark, or too bright. In such a case, even if the accuracy is given priority, it is possible to switch to a previously prepared reflection characteristic map and use it.

[第3の実施形態]
以下、図12及び図13を参照して、第3の実施形態について説明する。本実施形態では、被写体に応じてカメラ内で複数の反射特性マップを生成し、合成する例について説明する。さらに本実施形態では、拡散反射特性マップと鏡面反射特性マップという、異なる性格を有する2つのマップを生成し合成する。
[Third Embodiment]
The third embodiment will be described below with reference to FIGS. 12 and 13. FIG. In this embodiment, an example will be described in which a plurality of reflection characteristic maps are generated in the camera according to the subject and synthesized. Furthermore, in this embodiment, two maps having different characteristics, a diffuse reflection characteristic map and a specular reflection characteristic map, are generated and synthesized.

本実施形態における、デジタルカメラ100の全体構成は第1の実施形態(図1~図2)で説明したものと同様であるため、説明は省略する。本実施形態では、リライティング処理部202の構成が第1及び第2の実施形態と異なる。以下、主に第1及び第2の実施形態と異なる点について説明する。 Since the overall configuration of the digital camera 100 in this embodiment is the same as that described in the first embodiment (FIGS. 1 and 2), description thereof will be omitted. This embodiment differs from the first and second embodiments in the configuration of the relighting processing unit 202 . Differences from the first and second embodiments will mainly be described below.

本実施形態におけるリライティング処理部202の構成を図12に示す。図12において、1201は法線を算出する法線算出部、1202は、法線情報と仮想光源の方向情報に基づき、仮想光源の反射特性マップを生成する反射特性マップ生成部である。1203は複数の反射特性マップを合成する反射特性マップ合成部、1204は合成した反射特性マップに基づき仮想光源の反射成分を算出する仮想光源反射成分算出部である。 FIG. 12 shows the configuration of the relighting processing unit 202 in this embodiment. In FIG. 12, reference numeral 1201 denotes a normal line calculation unit that calculates a normal line, and 1202 denotes a reflection characteristic map generation unit that generates a reflection characteristic map of a virtual light source based on normal line information and direction information of the virtual light source. Reference numeral 1203 denotes a reflection characteristic map synthesizing unit that synthesizes a plurality of reflection characteristic maps, and 1204 denotes a virtual light source reflection component calculation unit that calculates the reflection component of the virtual light source based on the synthesized reflection characteristic map.

上記の構成のリライティング処理部202の動作について説明する。法線算出部1201は、測距センサ124(図1)から取得した被写体距離情報から法線マップを算出する。被写体距離情報とは、撮影画像の画素単位で得られる2次元の距離情報のことである。被写体距離情報から法線マップを生成する方法に関しては、公知のどのような技術を用いてもよいものとする。 The operation of the rewriting processing unit 202 having the above configuration will be described. A normal line calculation unit 1201 calculates a normal line map from subject distance information acquired from the distance measuring sensor 124 (FIG. 1). The object distance information is two-dimensional distance information obtained for each pixel of the captured image. Any known technique may be used for the method of generating the normal map from the subject distance information.

反射特性マップ生成部1202は、被写体に対して仮想光源を設置し、法線と仮想光源の向きの関係から被写体の拡散反射特性マップDおよび、鏡面反射マップSを算出する。 The reflection characteristic map generating unit 1202 sets a virtual light source for the subject, and calculates a diffuse reflection characteristic map D and a specular reflection map S of the subject from the relationship between the direction of the normal and the virtual light source.

拡散反射マップDは、図13に示すように被写体中の着目画素Pにおける被写体の法線ベクトルをN、着目画素Pから仮想光源の方向ベクトルをL、仮想光源と被写体(着目画素)の距離をKとすると下記の式で計算される。ただし、ベクトルLおよびNは正規化されているものとする。
=(L・N)/K
The diffuse reflection map D, as shown in FIG. 13, has N as the normal vector of the subject at the pixel of interest P in the subject, L as the directional vector of the virtual light source from the pixel of interest P, and the distance between the virtual light source and the subject (pixel of interest) as K is calculated by the following formula. However, vectors L and N are assumed to be normalized.
D i =(L·N)/K 2

拡散反射を付与する仮想光源は複数個設置することができ、Diはi番目の仮想光源に対応した拡散反射特性マップであることを示す。上記の式の演算により、法線ベクトルNの方向と仮想光源の方向ベクトルLの方向が近く、被写体と仮想光源の距離Kが近いほど、拡散反射成分は大きくなる。 A plurality of virtual light sources that impart diffuse reflection can be installed, and Di indicates a diffuse reflection characteristic map corresponding to the i-th virtual light source. According to the calculation of the above formula, the closer the direction of the normal vector N and the direction of the virtual light source direction vector L is, and the closer the distance K between the subject and the virtual light source is, the larger the diffuse reflection component is.

また、鏡面反射マップSは、図13に示すように鏡面反射の方向ベクトルをR、被写体位置(着目画素P)からカメラの方向ベクトル(視線の方向)をVとすると、下記の式で計算される。すなわち、鏡面反射成分は、カメラの方向が鏡面反射の方向と近いほど大きくなる。
=(R・V)
As shown in FIG. 13, the specular reflection map S is calculated by the following formula, where R is the direction vector of the specular reflection, and V is the direction vector (direction of line of sight) from the subject position (pixel of interest P) to the camera. be. That is, the specular reflection component increases as the direction of the camera approaches the direction of the specular reflection.
S j = (R·V) m

鏡面反射の方向ベクトルRの算出には、提案されている既知のどのような算出方法を用いても良い。ここでは、仮想光源の位置から被写体位置(着目画素P)のベクトルを入射角とした場合に、反射面に対して入射角と同じ角度で反射した場合のベクトルを鏡面反射の方向ベクトルRとする。また、mは、鏡面反射した光の広がり具合を示す輝き係数であり、この値が大きくなると鏡面反射が急峻になる。 Any known proposed calculation method may be used to calculate the direction vector R of the specular reflection. Here, when the angle of incidence is a vector from the position of the virtual light source to the position of the object (pixel of interest P), the direction vector R of the specular reflection is the vector when the light is reflected on the reflecting surface at the same angle as the angle of incidence. . Also, m is a brilliance coefficient that indicates the degree of spread of specularly reflected light, and the larger this value, the sharper the specular reflection.

鏡面反射を付与する仮想光源は複数個設置することができ、Siはj番目の仮想光源に対応した鏡面反射特性マップであることを示す。 A plurality of virtual light sources that impart specular reflection can be installed, and Si indicates a specular reflection characteristic map corresponding to the j-th virtual light source.

反射特性マップ生成部1202は、評価値生成部209(図2)で取得した被写体評価値に基づき、拡散反射および鏡面反射を付与する仮想光源を複数個設置する。例えば、図5Aに示すように被写体の左右の明るさが異なる斜光の場合は、被写体に対して左から光を照射する仮想光源と、右から照射する仮想光源を設置する。図5Bのように被写体の上下で明るさが異なる場合は、被写体に対して上から光を照射する仮想光源と、下から照射する仮想光源を設置する。 Reflection characteristic map generation unit 1202 installs a plurality of virtual light sources that impart diffuse reflection and specular reflection based on subject evaluation values acquired by evaluation value generation unit 209 (FIG. 2). For example, as shown in FIG. 5A, in the case of oblique light with different brightnesses on the left and right sides of the subject, a virtual light source that irradiates the subject with light from the left and a virtual light source that irradiates the subject with light from the right are installed. When the subject has different brightnesses above and below as shown in FIG. 5B, a virtual light source that illuminates the subject from above and a virtual light source that illuminates the subject from below are installed.

上記のように、反射特性マップ生成部1202は、設置した複数の位置の仮想光源に対する拡散反射マップDと鏡面反射マップSを算出し、反射特性マップ合成部1203に出力する。 As described above, the reflection characteristic map generation unit 1202 calculates the diffuse reflection map D and the specular reflection map S for the virtual light sources at a plurality of installed positions, and outputs them to the reflection characteristic map synthesizing unit 1203 .

反射特性マップ合成部1203は、下記の式に基づき、入力された複数の拡散反射マップDと鏡面反射マップSについて被写体の陰影状態に応じた比率で加減算を行い、最終的な反射特性マップMを生成する。
M=Σ(α×D)+Σ(β×S
Reflection characteristic map synthesizing unit 1203 performs addition/subtraction on a plurality of input diffuse reflection maps D and specular reflection maps S at a ratio corresponding to the shading state of the subject, based on the following formula, to obtain a final reflection characteristic map M: Generate.
M=Σ ii ×D i )+Σ jj ×S j )

ここで、αおよびβは、加減算の重みであり負の値も取ることが可能である。αもしくはβを負値に設定することで、特定の仮想光源を減算光にすることが可能である。 Here, α and β are weights for addition and subtraction and can take negative values. By setting α or β to a negative value, it is possible to make a particular virtual light source the subtractive light.

例えば、図5Aに示す被写体のように被写体に向かって左側が明るく、右側が暗い斜光シーンの場合、左側から被写体に向かって照射する仮想光源のαもしくはβ値を負の値にして減光にする。また右側から照射する仮想光源のα値を大きくして暗部に対して強い拡散光を当てるようにする。このように複数の拡散反射マップおよび鏡面反射マップの合成比率を制御することで、被写体の状態に応じた反射特性マップMが生成される。生成された反射特性マップMは、仮想光源反射成分算出部1204に出力される。 For example, in the case of an oblique light scene where the subject is bright on the left side and dark on the right side, such as the subject shown in FIG. do. Also, the α value of the virtual light source that illuminates from the right side is increased to illuminate the dark area with strong diffused light. By controlling the composition ratio of a plurality of diffuse reflection maps and specular reflection maps in this way, a reflection characteristic map M corresponding to the state of the subject is generated. The generated reflection characteristic map M is output to the virtual light source reflection component calculator 1204 .

仮想光源反射成分算出部1204は、撮影画像(Rin、Gin、Bin)に対して、反射特性マップMを乗算する。これにより、仮想光源による被写体の反射色成分(Ra、Ga、Ba)を算出する。式では下記の通りとなる。
Ra = M × Rin
Ra = M × Gin
Ra = M × Bin
The virtual light source reflection component calculator 1204 multiplies the captured image (Rin, Gin, Bin) by the reflection characteristic map M. FIG. Thereby, the reflected color components (Ra, Ga, Ba) of the subject by the virtual light source are calculated. The formula is as follows.
Ra = M x Rin
Ra = M x Gin
Ra = M x Bin

上記のように算出した仮想光源による反射成分(Ra、Ga、Ba)は仮想光源付加処理部304へ出力される。仮想光源付加処理部304の処理は第1の実施形態と同様であるためここでの説明は省略する。 The reflection components (Ra, Ga, Ba) by the virtual light source calculated as described above are output to the virtual light source addition processing unit 304 . Since the processing of the virtual light source addition processing unit 304 is the same as that of the first embodiment, the description is omitted here.

以上説明した通り、第3の実施形態によれば、デジタルカメラ100は、リライティング処理を行う場合に、設定した複数の光源に対応する反射特性マップ生成する。そして、デジタルカメラ100は、生成した複数の反射特性マップを重み付きで合成することで、所望の反射特性マップを得る。これにより、複数の仮想光源個々に対応した反射色成分の演算を行うことなく高速な処理が可能となる。 As described above, according to the third embodiment, the digital camera 100 generates reflection characteristic maps corresponding to a plurality of set light sources when performing relighting processing. Then, the digital camera 100 obtains a desired reflection characteristic map by weighting and synthesizing the plurality of generated reflection characteristic maps. As a result, high-speed processing becomes possible without calculating reflected color components corresponding to each of a plurality of virtual light sources.

なお、上の説明では、拡散反射マップDと鏡面反射マップSをすべて合成して最終的な反射特性マップMを計算するものとしたが、拡散反射マップ、鏡面反射マップそれぞれの合成マップを生成し、最終的な反射色成分を計算する構成をとることも可能である。 In the above description, the diffuse reflection map D and the specular reflection map S are combined to calculate the final reflection characteristic map M. , to calculate the final reflected color component.

[その他の実施形態]
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
[Other embodiments]
The present invention supplies a program that implements one or more functions of the above-described embodiments to a system or device via a network or a storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by processing to It can also be implemented by a circuit (for example, ASIC) that implements one or more functions.

50…システム制御部、100…デジタルカメラ、105…画像処理部、202…リライティング処理部、301…反射特性マップ合成部、302…フィッティング処理部、303…仮想光源反射成分算出部、304…仮想光源付加処理部 50 System control unit 100 Digital camera 105 Image processing unit 202 Relighting processing unit 301 Reflection characteristic map synthesis unit 302 Fitting processing unit 303 Virtual light source reflection component calculation unit 304 Virtual light source Additional processing part

Claims (13)

入力画像に仮想光源の効果を付加する前に、前記入力画像に含まれる所定の被写体における第1の仮想光源の反射特性を示す第1の反射特性データと、前記所定の被写体における第2の仮想光源の反射特性を示す第2の反射特性データとを合成する合成処理を行うことにより、合成反射特性データを取得する合成手段と、
前記合成処理により得られた前記合成反射特性データが示す反射特性に基づいて、前記入力画像に含まれる被写体における反射成分を生成する生成手段と、
前記入力画像に対して、前記生成手段により生成された前記反射成分を付加する付加手段と、
を備えることを特徴とする画像処理装置。
Before adding the effect of the virtual light source to the input image, first reflection characteristic data indicating the reflection characteristic of a first virtual light source in a predetermined subject included in the input image, and a second virtual light source in the predetermined subject. Synthesizing means for acquiring synthetic reflection characteristic data by performing synthesis processing for synthesizing second reflection characteristic data indicating reflection characteristics of a light source;
generating means for generating a reflection component of a subject included in the input image based on the reflection characteristic indicated by the synthetic reflection characteristic data obtained by the synthesis processing;
adding means for adding the reflection component generated by the generating means to the input image;
An image processing device comprising:
前記合成手段は、複数の反射特性データの中から前記第1の反射特性データ及び前記第2の反射特性データを選択する
ことを特徴とする請求項1に記載の画像処理装置。
2. The image processing apparatus according to claim 1, wherein said synthesizing means selects said first reflection characteristic data and said second reflection characteristic data from a plurality of reflection characteristic data.
補正モードを決定する決定手段を更に備え、
前記合成手段は、前記補正モードに基づいて前記第1の反射特性データ及び前記第2の反射特性データを選択する
ことを特徴とする請求項2に記載の画像処理装置。
Further comprising determining means for determining the correction mode,
3. The image processing apparatus according to claim 2, wherein said synthesizing means selects said first reflection characteristic data and said second reflection characteristic data based on said correction mode.
前記決定手段は、前記入力画像に含まれる前記被写体の輝度に基づいて前記補正モードを決定する
ことを特徴とする請求項3に記載の画像処理装置。
4. The image processing apparatus according to claim 3, wherein said determining means determines said correction mode based on the luminance of said subject included in said input image.
前記合成手段は、ユーザ指示に従って前記第1の反射特性データ及び前記第2の反射特性データを選択する
ことを特徴とする請求項2に記載の画像処理装置。
3. The image processing apparatus according to claim 2, wherein said synthesizing means selects said first reflection characteristic data and said second reflection characteristic data according to a user instruction.
前記合成手段は、前記合成処理において、前記第1の反射特性データに第1の係数を乗じ、前記第2の反射特性データに第2の係数を乗じる
ことを特徴とする請求項1乃至5のいずれか1項に記載の画像処理装置。
6. The method according to any one of claims 1 to 5, wherein said synthesizing means multiplies said first reflection characteristic data by a first coefficient and multiplies said second reflection characteristic data by a second coefficient in said synthesizing process. The image processing device according to any one of items 1 and 2.
前記合成手段は、前記入力画像に含まれる前記被写体の輝度に基づいて前記第1の係数及び前記第2の係数を決定する
ことを特徴とする請求項6に記載の画像処理装置。
7. The image processing apparatus according to claim 6, wherein said synthesizing means determines said first coefficient and said second coefficient based on luminance of said subject included in said input image.
前記所定の被写体と前記入力画像に含まれる前記被写体との形状の相違を補償するように前記合成反射特性データを補正する補正手段を更に備え、
前記生成手段は、前記補正がなされた前記合成反射特性データに基づいて前記反射成分を生成する
ことを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。
further comprising correction means for correcting the synthetic reflection characteristic data so as to compensate for a difference in shape between the predetermined subject and the subject included in the input image;
The image processing apparatus according to any one of claims 1 to 7, wherein the generating means generates the reflection component based on the corrected combined reflection characteristic data.
前記合成反射特性データは、前記所定の被写体の各位置における反射特性を表現する反射特性画像を含み、
前記補正手段は、前記所定の被写体と前記入力画像に含まれる前記被写体との形状の相違を補償するように、前記反射特性画像を幾何学変換する
ことを特徴とする請求項8に記載の画像処理装置。
The synthetic reflection characteristic data includes a reflection characteristic image representing the reflection characteristic at each position of the predetermined subject,
9. The image according to claim 8, wherein said correction means geometrically transforms said reflection characteristic image so as to compensate for a difference in shape between said predetermined subject and said subject included in said input image. processing equipment.
前記補正手段は更に、前記入力画像に基づいて前記反射特性画像に対して平滑化処理を行う
ことを特徴とする請求項9に記載の画像処理装置。
10. The image processing apparatus according to claim 9, wherein said correction means further performs smoothing processing on said reflection characteristic image based on said input image.
請求項1乃至10のいずれか1項に記載の画像処理装置と、
前記入力画像を生成する撮像手段と、
を備えることを特徴とする撮像装置。
an image processing apparatus according to any one of claims 1 to 10;
imaging means for generating the input image;
An imaging device comprising:
画像処理装置が実行する画像処理方法であって、
入力画像に仮想光源の効果を付加する前に、前記入力画像に含まれる所定の被写体における第1の仮想光源の反射特性を示す第1の反射特性データと、前記所定の被写体における第2の仮想光源の反射特性を示す第2の反射特性データとを合成する合成処理を行うことにより、合成反射特性データを取得する合成工程と、
前記合成処理により得られた前記合成反射特性データが示す反射特性に基づいて、前記入力画像に含まれる被写体における反射成分を生成する生成工程と、
前記入力画像に対して、前記生成工程により生成された前記反射成分を付加する付加工程と、
を備えることを特徴とする画像処理方法。
An image processing method executed by an image processing device,
Before adding the effect of the virtual light source to the input image, first reflection characteristic data indicating the reflection characteristic of a first virtual light source in a predetermined subject included in the input image, and a second virtual light source in the predetermined subject. a synthesizing step of acquiring synthetic reflection characteristic data by performing a synthesis process of synthesizing second reflection characteristic data indicating reflection characteristics of a light source;
a generation step of generating reflection components of a subject included in the input image based on the reflection characteristics indicated by the synthetic reflection characteristic data obtained by the synthesis process;
an adding step of adding the reflection component generated by the generating step to the input image;
An image processing method comprising:
コンピュータを、請求項1乃至10のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。 A program for causing a computer to function as each means of the image processing apparatus according to any one of claims 1 to 10.
JP2018197847A 2017-10-31 2018-10-19 IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM Active JP7169841B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/170,203 US11037279B2 (en) 2017-10-31 2018-10-25 Image processing apparatus, image capturing apparatus, image processing method, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2017211209 2017-10-31
JP2017211209 2017-10-31

Publications (3)

Publication Number Publication Date
JP2019083008A JP2019083008A (en) 2019-05-30
JP2019083008A5 JP2019083008A5 (en) 2021-11-25
JP7169841B2 true JP7169841B2 (en) 2022-11-11

Family

ID=66670459

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018197847A Active JP7169841B2 (en) 2017-10-31 2018-10-19 IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM

Country Status (1)

Country Link
JP (1) JP7169841B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015166684A1 (en) 2014-04-30 2015-11-05 ソニー株式会社 Image processing apparatus and image processing method
JP2016213718A (en) 2015-05-11 2016-12-15 キヤノン株式会社 Image processing apparatus, image processing method, program, and storage medium
JP2017147658A (en) 2016-02-18 2017-08-24 キヤノン株式会社 Image processing apparatus, imaging apparatus, control method, and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015166684A1 (en) 2014-04-30 2015-11-05 ソニー株式会社 Image processing apparatus and image processing method
JP2016213718A (en) 2015-05-11 2016-12-15 キヤノン株式会社 Image processing apparatus, image processing method, program, and storage medium
JP2017147658A (en) 2016-02-18 2017-08-24 キヤノン株式会社 Image processing apparatus, imaging apparatus, control method, and program

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
宮木 一,Phtometric Image-Based Renderingにおける拡散反射と鏡面反射の生成,電子情報通信学会技術研究報告 Vol.99 No.710 IEICE Technical Report,第99巻 第710号,日本,社団法人電子情報通信学会,2000年,81~88
池田 拓也,RGB-Dカメラを用いた動的光源環境へのリライティング Relighting with Dynamic Light Environments Using an RGB-D Camera,電子情報通信学会技術研究報告 Vol.113 No.403 IEICE Technical Report,第113巻 第403号,日本,一般社団法人電子情報通信学会,2014年,219~224

Also Published As

Publication number Publication date
JP2019083008A (en) 2019-05-30

Similar Documents

Publication Publication Date Title
US11503219B2 (en) Image processing apparatus, image capture apparatus, and control method for adding an effect of a virtual light source to a subject
RU2528590C2 (en) Image capturing device, method of controlling same and storage medium
JP5761946B2 (en) Image processing apparatus, image processing method, and storage medium
JP5665436B2 (en) Image processing apparatus, image processing method, and program
JP5743696B2 (en) Image processing apparatus, image processing method, and program
JP6381404B2 (en) Image processing apparatus and method, and imaging apparatus
JP2016213718A (en) Image processing apparatus, image processing method, program, and storage medium
US11115637B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
JP6425571B2 (en) IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND PROGRAM
JP7114335B2 (en) IMAGE PROCESSING DEVICE, CONTROL METHOD FOR IMAGE PROCESSING DEVICE, AND PROGRAM
JP7059076B2 (en) Image processing device, its control method, program, recording medium
US11037279B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
JP2017147568A (en) Image processing apparatus, imaging apparatus, control method, and program
JP2017152866A (en) Image processing system and image processing method
JP7277158B2 (en) Setting device and method, program, storage medium
JP7199849B2 (en) Image processing device, image processing method, and program
JP7169841B2 (en) IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM
JP5854716B2 (en) Image processing apparatus, image processing method, and program
JP2019004290A (en) Image processing apparatus, imaging apparatus, image processing method and program
JP7462464B2 (en) Image processing device and method, program, and storage medium
JP7102192B2 (en) Image processing device, its control method, program
JP7356255B2 (en) Image processing device and its processing method, imaging device, program, storage medium
JP2020024581A (en) Image processing apparatus, image processing method, and program
JP2021175036A (en) Image processing apparatus and method, program, and storage medium
JP6021885B2 (en) Image processing apparatus, image processing method, and program

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20210103

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210113

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20211015

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20211015

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220922

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20220930

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20221031

R151 Written notification of patent or utility model registration

Ref document number: 7169841

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151