JP2019083008A - Image processing apparatus, imaging device, image processing method, and program - Google Patents

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

Info

Publication number
JP2019083008A
JP2019083008A JP2018197847A JP2018197847A JP2019083008A JP 2019083008 A JP2019083008 A JP 2019083008A JP 2018197847 A JP2018197847 A JP 2018197847A JP 2018197847 A JP2018197847 A JP 2018197847A JP 2019083008 A JP2019083008 A JP 2019083008A
Authority
JP
Japan
Prior art keywords
reflection characteristic
reflection
image
light source
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2018197847A
Other languages
Japanese (ja)
Other versions
JP2019083008A5 (en
JP7169841B2 (en
Inventor
光太郎 北島
Kotaro Kitajima
光太郎 北島
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

Abstract

To provide a technology to reduce a processing load on relighting using a plurality of virtual light sources.SOLUTION: In an image processing unit of a digital camera, a relighting processing unit 202 comprises: a reflection characteristic map composition unit that performs composition processing of compositing first reflection characteristic data indicating the reflection characteristics of a first virtual light source in a predetermined subject, and second reflection characteristic data indicating the reflection characteristics of a second virtual light source in the predetermined subject; a virtual light source reflection component calculation unit that creates a reflection component in the subject included in an image on the basis of the reflection characteristics indicated by composition reflection characteristic data obtained through the composition processing; and a virtual light source addition processing unit that adds the reflection component to the image.SELECTED DRAWING: Figure 3

Description

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

従来から、写真撮影においては、補助照明やレフ板による光の調整によって、被写体に生じる光と影の領域の調整が行われている。これにより、被写体の印象をさまざまに変化させた写真撮影が可能となる。また、これらの光の調整を撮影後に行う技術として、被写体領域に対して、光の反射によるハイライトや陰影成分を加える技術(リライティング)がある。これにより、暗部を補正することや、立体感を強調した画像を生成することが可能となる。   2. Description of the Related Art Conventionally, in photographing, adjustment of light and shadow areas generated on a subject is performed by adjustment of light by auxiliary illumination and a reflex plate. As a result, it is possible to take photographs in which the impression of the subject is changed in various ways. Further, as a technique of performing adjustment of these lights after photographing, there is a technique (relighting) of adding a highlight or a shadow component by light reflection to a subject region. As a result, it becomes possible to correct the dark part and to generate an image in which the three-dimensional effect is emphasized.

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

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

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

本発明はこのような状況に鑑みてなされたものであり、複数の仮想光源を用いるリライティングの処理負荷を軽減する技術を提供することを目的とする。   The present invention has been made in view of such circumstances, and an object thereof is to provide a technology 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, according to the present invention, a first reflection characteristic data indicating a reflection characteristic of a first virtual light source of a predetermined subject and a reflection characteristic of a second virtual light source of the predetermined object are described. Combining means for performing combining processing for combining the two reflection characteristics data, and generating means for generating a reflection component of an object included in the image based on the reflection characteristics indicated by the combination reflection characteristics data obtained by the combination processing An image processing apparatus comprising: adding means for adding the reflection component to the image.

なお、その他の本発明の特徴は、添付図面及び以下の発明を実施するための形態における記載によって更に明らかになるものである。   Other features of the present invention will become more apparent from the description in the accompanying drawings and the following detailed description of the invention.

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

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

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

以下の各実施形態では、画像処理装置をデジタルカメラ(撮像装置)に適用した構成を例にして説明を行う。   In each of the following embodiments, the configuration in which the image processing apparatus is applied to a digital camera (imaging apparatus) 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, reference numeral 101 denotes a lens group including a zoom lens and a focus lens. A shutter 102 has an aperture function. An imaging unit 103 includes a CCD, a CMOS device, or the like that converts an optical image into an electrical signal. An A / D converter 104 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, contour emphasis processing, and color correction processing on the image data output from the A / D converter 104. Reference numeral 106 denotes an image memory. A memory control unit 107 controls the image memory 106. Reference numeral 108 denotes a D / A converter that converts an input digital signal into an analog signal. A display unit 109 includes an LCD or the like. Reference numeral 110 denotes a codec unit that compresses / encodes / decodes image data.

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

次に、上記のように構成されたデジタルカメラ100における被写体撮影時の基本動作について説明する。撮像部103は、レンズ101及びシャッター102を介して入射した光を光電変換し、入力画像信号としてA/D変換器104へ出力する。A/D変換器104は、撮像部103から出力されるアナログ画像信号をデジタル画像信号に変換して画像処理部105に出力する。なお、デジタル画像信号は、RAW画像データとして記録媒体112に記録されてもよい。   Next, the basic operation at the time of photographing an object in the digital camera 100 configured as described above will be described. The imaging unit 103 photoelectrically converts light incident through the lens 101 and the shutter 102, and outputs the light to the A / D converter 104 as an input image signal. The A / D converter 104 converts an 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. 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 subjects the image data from the A / D converter 104 or the image data from the memory control unit 107 to color conversion processing such as white balance, relighting processing, γ processing, edge enhancement processing, and the like. . Further, the image processing unit 105 performs predetermined evaluation value calculation processing using the face detection result of the face detection unit 113 and the imaged 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 (Auto Focus) 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からのアナログ信号に応じた表示を行う。   The image data output from the image processing unit 105 is written to 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 the 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 performs display according to the analog signal from the D / A converter 108 on a display device such as an LCD.

コーデック部110は、画像メモリ106に記録された画像データをJPEG、MPEGなどの規格に基づき圧縮符号化する。システム制御部50は、符号化した画像データを、I/F111を介して記録媒体112に格納する。   The 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 at the time of shooting a subject has been described above. In addition to the above-described basic operation, the system control unit 50 implements each process of the present embodiment described later by executing the program stored in the non-volatile memory 121 described above. The program referred to here is a program for executing various flowcharts to be described later in this embodiment. At this time, constants and variables for operation of the system control unit 50, programs read out from the non-volatile memory 121, and the like are expanded in the system memory 122.

次に、図2を参照して、画像処理部105の詳細について説明する。図2は、画像処理部105の構成を示すブロック図である。図2において、200は同時化処理部、201はWB増幅部、202はリライティング処理部、203は輝度・色信号生成部である。204は輪郭強調処理部、205は輝度ガンマ処理部、206は色変換処理部、207は色ガンマ処理部、208は色差信号生成部、209は評価値生成部である。   Next, the 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. Reference numeral 204 denotes an edge enhancement processing unit, 205 denotes a luminance gamma processing unit, 206 denotes a color conversion processing unit, 207 denotes a color gamma processing unit, 208 denotes a color difference signal generation unit, and 209 denotes an evaluation value generation unit.

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

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

リライティング処理部202は、入力されたRGB信号に対して後述するリライティング処理を施した後に、RGB信号を輝度・色信号生成部203に出力する。輝度・色信号生成部203は、RGB信号から輝度信号Yを生成し、生成した輝度信号Yを輪郭強調処理部204へ、色信号RGBを色変換処理部206へ、それぞれ出力する。また、輝度・色信号生成部203は、WB増幅部201から入力されたR’G’B’信号から輝度信号Y’を生成し、評価値生成部209に入力する。   The relighting processing unit 202 performs relighting processing to be described later on the input RGB signal, and then outputs the RGB signal to the luminance / color signal generation unit 203. 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 edge enhancement processing unit 204 and the color signal RGB to the color conversion processing unit 206. Further, the luminance / color 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. The luminance gamma processing unit 205 performs gamma correction on the luminance signal Y, and outputs the luminance signal Y to the image memory 106. The color conversion processing unit 206 performs desired color balance conversion by matrix operation or the like on the RGB signals. The color gamma processing unit 207 performs gamma correction on the RGB color signals. The color difference signal generation unit 208 generates color difference signals RY and BY from the RGB signals and outputs the generated signals to the image memory 106. The image signals (Y, RY, BY) output to the image memory 106 are compressed and encoded by the codec unit 110 and recorded in the recording medium 112.

評価値生成部209は、実際の環境光源の状態を推定するための評価値を生成する。本実施形態における環境光源の状態とは、被写体に対する環境光源の方向及び強度(輝度)である。従って、評価値生成部209は、環境光源の方向及び強度を推定するための評価値を生成して出力する。具体的には、評価値生成部209は、図5に示すように画像を複数のブロックに分割し、ブロック毎の平均輝度値を算出する。評価値生成部209は、算出した評価値をシステムメモリ122に記録する。   The evaluation value generation unit 209 generates an evaluation value for estimating the actual state of the environmental light source. The state of the environmental light source in the present embodiment is the direction and intensity (luminance) of the environmental light source with respect to the subject. Therefore, the evaluation value generation unit 209 generates and outputs an evaluation value for estimating the direction and the intensity of the environmental light source. Specifically, the evaluation value generation unit 209 divides the image into a plurality of blocks as shown in FIG. 5, and calculates an average luminance value for each block. The evaluation value generation unit 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 synthesis unit which reads and synthesizes a plurality of reflection characteristic maps indicating the characteristic (the reflection characteristic of the virtual light source of the object) of the virtual light source reflecting on the object. Reference numeral 302 denotes a fitting processing unit that matches the reflection characteristic map of the virtual light source with 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 synthesis unit 301 reads and synthesizes a plurality of reflection characteristic maps (details will be described later) of the virtual light source prepared in advance. In the synthesis processing of the plurality of reflection characteristic maps, the system control unit 50 determines which reflection characteristic map is to be read and the synthesis parameter.

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

S401で、システム制御部50は、撮影した被写体の特徴量を取得する。具体的には、システム制御部50は、評価値生成部209(図2)により生成された、画像の各ブロックの平均輝度値を取得する。ブロック分割の例を図5に示す。評価値生成部209は、図5に示すように分割したブロック毎に被写体の平均輝度値を算出し、システム制御部50は、算出された平均輝度値を取得する。   In step 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 luminance value of the subject for each of the divided blocks as shown in FIG. 5, and the system control unit 50 acquires the calculated average luminance value.

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

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 step S403, the system control unit 50 determines the relighting mode in accordance with the feature amount of the subject acquired in step S401. In this embodiment, an example will be described in which there are four types of 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 of the face area detected by the face detection unit 113 in the captured image. For example, the system control unit 50 acquires, from the face detection unit 113, information on the face area 501 (see FIGS. 5A to 5D). Next, the system control unit 50 acquires subject feature quantities of each block included in the face area 501 among the subject feature quantities of each block acquired in S401. The system control unit 50 analyzes the distribution of the subject feature amount (brightness) in the face area 501, and determines which one of FIGS. 5A to 5D the distribution corresponds to. As shown in FIG. 5A, when there is a contrast difference between the right and left 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 there is little difference in brightness in the face area 501 and the face area 501 is darker than the other areas, the system control unit 50 selects the backlight correction mode. As shown in FIG. 5D, when there is little difference in brightness in the face area 501 and the face area 501 is sufficiently bright, the system control unit 50 selects the flat correction mode. 5A shows that 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 (brightness) in the face area 501 does not correspond to any of the four relighting modes, the system control unit 50 determines that the image correction by the relighting is not performed.

S404で、システム制御部50は、S403で決定したリライティングモードに応じた反射特性マップ(反射特性データ)を選択し、選択した反射特性マップの合成特性を決定する。反射特性マップとは、平均的な顔形状モデルに対して、所定の光源位置からリライティングした結果の反射特性を示した画像である。反射特性マップの例を図6に示す。図6の上段は、光源の位置を左側90度(L90)から、右側90度(R90)まで変化させた反射特性マップを示している。図6の下段は、光源の位置を下側60度(Down60)及び上側60度(Up60)に設定した場合の反射特性マップを示している。このような反射特性マップは、平均的な顔形状モデルに基づき事前に生成しておき、不揮発性メモリ121(図1)に記録しておくものとする。   In step S404, the system control unit 50 selects a reflection characteristic map (reflection characteristic data) corresponding to the relighting mode determined in step S403, and determines a composite characteristic of the selected reflection characteristic map. The reflection characteristic map is an image showing reflection characteristics as a result of relighting from a predetermined light source position with respect to an average face shape model. An example of the 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 the left 90 degrees (L90) to the right 90 degrees (R90). The lower part of FIG. 6 shows a reflection characteristic map in the case where the position of the light source is set to the lower side 60 degrees (Down 60) and the upper side 60 degrees (Up 60). Such a reflection characteristic map is generated in advance based on an average face shape model, and is recorded in the non-volatile 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 “slant light correction mode”, the virtual light source is irradiated from an angle of 60 degrees with respect to the dark side by comparing the left and right of the subject. It also dims the light from an angle of 60 degrees to the bright side. In the example of FIG. 5A, the right side is dark and the left side is bright toward the subject. 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 synthesized according to the following equation (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 of 0 to 1. The system control unit 50 sets α larger as the dark part of the face is darker than 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 of β is negative, it indicates dimming. The reflection characteristic map after synthesis is shown in FIG. 8 (A). The reflection characteristic map after synthesis (synthesis reflection characteristic data) has a data format of an image (reflection characteristic image) representing the reflection characteristic at each position of the subject. In FIG. 8A, a portion brighter than the reference gradation (for example, 128 in the case of 8 bits) indicates added light, and when dark, it indicates subtractive 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 left side is dark and the right side is bright toward the subject, the left and right of the reflection characteristic map used in the equation (1) are inverted. 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 synthesized according to the following equation (2) .
M = α × (L60)-β × (R60) (2)

式(2)において、システム制御部50は、顔の所定の基準輝度に対して顔の暗部が暗いほどαを大きく設定し、基準輝度に対して顔の明部が明るいほどβを大きく設定する。   In Equation (2), the system control unit 50 sets α larger as the dark part of the face is darker than the predetermined reference luminance of the face, and sets β larger as the bright 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 vicinity of the head of the subject is bright, and the area below the mouth is dark. Therefore, light is reduced from the upper side of the subject, and the additional light is emitted from the lower side to balance the light striking the face. That is, the reflection characteristic map (Up60) when the virtual light source is irradiated from the upper 60 degrees and the reflection characteristic map (Down60) when the virtual light source is irradiated from the lower 60 degrees are synthesized according to the following equation (3) Do.
M = α × (Down 60)-β × (Up 60) (3)

この場合の合成後の反射特性マップを図8(B)に示す。なお、式(3)において、システム制御部50は、顔の所定の基準輝度に対して顔の暗部が暗いほどαを大きく設定し、基準輝度に対して顔の明部が明るいほどβを大きく設定する。   The reflection characteristic map after synthesis in this case is shown in FIG. 8 (B). In Equation (3), the system control unit 50 sets α larger as the dark part of the face is darker than the predetermined reference luminance of the face, and β increases as the bright 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”, since the face is generally dark, the virtual light source of the additional light is emitted from the front and the front lower side. That is, the reflection characteristic map (F0) when the virtual light source is irradiated from the front and the reflection characteristic map (Down 60) when the virtual light source is irradiated from the lower side 60 degrees are synthesized according to the following equation (4).
M = α × (F0) + β × (Down 60) (4)

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

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

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

リライティングモードが「フラット補正モード」であり、ストロボ発光がある場合、ストロボ光をキャンセルするため、正面からの光を減光し、仮想光源を正面上側から照射する。具体的には、正面から仮想光源を照射した場合の反射特性マップ(F0)と、上側60度から仮想光源を照射した場合の反射特性マップ(Up60)とを、下記の式(6)に従って合成する。
M = α×(Up60)−β×(F0) ・・・(6)
If the relighting mode is the "flat correction mode" and there is strobe light emission, the light from the front is reduced to cancel the strobe light, and the virtual light source is irradiated 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 the upper 60 degrees are synthesized according to the following equation (6) Do.
M = α × (Up 60)-β × (F 0) (6)

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

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

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

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

図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. In the reflection characteristic map, feature points 901 to 903 corresponding to the positions of the eyes and the mouth are set in advance. FIG. 9B shows a photographed image (Rin, Gin, Bin). First, the fitting processing unit 302 geometrically deforms (geometrically converts) the reflection characteristic map on the basis of the positions 904 to 906 of feature points (such as eyes and mouth) of a subject in a captured image. Specifically, the fitting processing unit 302 acquires, from the face detection unit 113 (FIG. 1), the coordinate position of the feature point (eye, mouth, etc.) of the subject of the captured image. Then, the fitting processing unit 302 performs enlargement, reduction, and rotation on the reflection characteristic map so that the positional relationship between the feature points 901 to 903 and the positions 904 to 906 matches. Thereby, it is 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 photographed 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. Thereby, it is possible to apply the smoothing process to the reflection characteristic map in a state where the edge of the reference image is stored. 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 application of the joint bilateral filter to the virtual light source reflection component calculation unit 303.

なお、リライティングモードが「フラット補正モード」であり、ストロボ発光がない場合のように、複数の反射特性マップを合成する合成処理が行われない場合がある。この場合、上記の式(5)に示すように、反射特性マップ合成部301は、選択された反射特性マップに対して係数を乗じることにより得られる反射特性マップを、フィッティング処理部302に出力する。そして、フィッティング処理部302は、合成処理が行われた場合と同様に、反射特性マップ合成部301から出力された反射特性マップに対して、上で説明したフィッティング処理を行う。   Note that, as in the case where the relighting mode is the “flat correction mode” and there is no stroboscopic light emission, there may be cases 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 synthesis unit 301 outputs the reflection characteristic map obtained by multiplying the selected reflection characteristic map by a coefficient to the fitting processing unit 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, as in the case where 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 photographed image (Rin, Gin, Bin) by the reflection characteristic map Mf after the fitting process according to Equation (7). Thereby, the reflection 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 × 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 the reflection components (Ra, Ga, Ba) of the virtual light source to the subject region according to the 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 the reflection component of the subject included in the image based on the reflection characteristics indicated by the reflection characteristic map after synthesis. Are generated, and the generated reflection component is added 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 digital camera 100 has the reflection characteristic map in five stages in the lateral direction and in two stages in the vertical direction as an example, but the way of holding the reflection characteristic map is not limited to this. . For example, the digital camera 100 may hold reflection characteristic maps of more patterns, such as 10 levels in top, bottom, left, and right. Also, for example, only one pair of reflection characteristic maps such as 60 ° left and 60 ° right is prepared, and the digital camera 100 reverses the reflection characteristic map according to the state of the subject. You may use it.

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

また、本実施形態では、リライティングモードとして「斜光補正モード」、「トップライト補正モード」、「逆光補正モード」、及び「フラット補正モード」の4つのモードがある場合について説明した。しかし、リライティングモードはこれら4つのモードに限定されない。リライティングモードに応じて反射特性マップの合成パラメータを決定する構成であれば、どのようなモードを用意してもよい。   Further, in the present embodiment, the case has been described in which there are four modes of the relighting mode: “oblique light correction mode”, “top light correction mode”, “backlight correction mode”, and “flat correction mode”. However, the relighting mode is 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.

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

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

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

図10は、第2の実施形態に係る、システム制御部50が反射特性マップ合成部301のために実行する合成パラメータ設定処理のフローチャートである。ユーザにより現像対象画像(リライティング対象の画像)が選択されると、本フローチャートの処理が開始する。   FIG. 10 is a flowchart of a synthesis parameter setting process performed 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 (image to be relighted), the processing of this flowchart starts.

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

図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, reference numeral 1101 denotes a camera housing, 1102 denotes an operation unit, and 1103 denotes a display unit. The operation unit 1102 is included in the operation unit 120 of FIG. The display unit 1103 is included in the display unit 109 of FIG. When the image to be rewritten is selected by the user, the system control unit 50 causes the display unit 1103 to display the selected image. Reference numerals 1104-1106 indicate the positions of the set virtual light sources. The digital camera 100 performs relighting processing based on the position and direction of the virtual light source. The position of the virtual light source is determined by the touch operation by the user. As shown in 1104-1106, the user can install a plurality of virtual light sources at arbitrary positions. When the position of the light source is determined, the system control unit 50 determines an irradiation angle so as to irradiate the virtual light source toward the center of the main subject from the set position of the virtual light source. A plurality of virtual light sources can be installed, and FIG. 11 shows the 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 a 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 step S1002, the system control unit 50 determines whether a reflection characteristic map corresponding to the irradiation angle is recorded in the non-volatile memory 121. In the present embodiment, as in the first embodiment, seven types of reflection characteristic maps shown in FIG. 6 are recorded in the non-volatile memory 121. 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 located 90 degrees to the left of the subject, and "L90" in FIG. 6 corresponds to the irradiation angle. In the example of the virtual light sources 1104 and 1106, since there is a corresponding reflection characteristic map, the processing proceeds to S1003. On the other hand, the virtual light source 1105 emits light from the left 75 degrees 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 closest to the irradiation angle of the virtual light source (one larger than the determined irradiation angle and one smaller than the determined irradiation angle). In the example of FIG. 11, since the virtual light source 1105 has an irradiation angle of 75 degrees on the left side, two reflection characteristic maps near 90 degrees on the left side (L90) and 60 degrees on the left side (L60) 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 combining ratio for combining the two selected reflection characteristic maps. In the case of the virtual light source 1105, since the left side 75 degrees is an intermediate angle between the left side 90 degrees and the left side 60 degrees, the left side 90 degree reflection characteristic map (L90) and the left side 60 degree reflection characteristic map (L60) are paired. Synthesize at a ratio of 1. That is, the reflection characteristic map irradiated approximately from the left 75 degrees can be generated by synthesizing the reflection characteristic map according to the equation (9).
M = 0.5 × (L90) + 0.5 × (L60) (9)

S1006で、システム制御部50は、合成パラメータ(反射特性マップ及び合成比率)を反射特性マップ合成部301に設定する。   In step S1006, the system control unit 50 sets the 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 step S1007, the system control unit 50 determines whether the processing of all virtual light sources is 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 advances to step S1008; otherwise, the process returns to step S1002.

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

以上、システム制御部50が反射特性マップ合成部301のために実行する合成パラメータ設定処理について説明した。その後、反射特性マップ合成部301は、設定された合成パラメータに基づいて反射特性マップの合成処理を行う。以後の処理は、第1の実施形態と同様である。   The synthesis parameter setting process performed by the system control unit 50 for the reflection characteristic map synthesis unit 301 has been described above. Thereafter, the reflection characteristic map synthesis unit 301 performs the synthesis processing of the reflection characteristic map based on the set synthesis parameter. The subsequent processing is the same as that of 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 operation when performing the relighting process. Then, the digital camera 100 generates a reflection characteristic map corresponding to the determined irradiation angle by combining the reflection characteristic map prepared in advance. This makes it possible to generate a reflection characteristic map of a desired irradiation angle with a relatively small processing load.

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

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

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

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

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

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

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

拡散反射マップDは、図13に示すように被写体中の着目画素Pにおける被写体の法線ベクトルをN、着目画素Pから仮想光源の方向ベクトルをL、仮想光源と被写体(着目画素)の距離をKとすると下記の式で計算される。ただし、ベクトルLおよびNは正規化されているものとする。
=(L・N)/K
In the diffuse reflection map D, as shown in FIG. 13, the normal vector of the subject at the target pixel P in the subject is N, the direction vector of the virtual light source from the target pixel P is L, and the distance between the virtual light source and the subject (target pixel) Assuming that K, it is calculated by the following equation. 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 for providing diffuse reflection can be installed, and Di indicates that it is a diffuse reflection characteristic map corresponding to the ith virtual light source. According to the calculation of the above equation, the diffuse reflection component becomes larger as the direction of the normal vector N and the direction of the direction vector L of the virtual light source are closer and the distance K between the object and the virtual light source is closer.

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

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

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

反射特性マップ生成部1202は、評価値生成部209(図2)で取得した被写体評価値に基づき、拡散反射および鏡面反射を付与する仮想光源を複数個設置する。例えば、図5Aに示すように被写体の左右の明るさが異なる斜光の場合は、被写体に対して左から光を照射する仮想光源と、右から照射する仮想光源を設置する。図5Bのように被写体の上下で明るさが異なる場合は、被写体に対して上から光を照射する仮想光源と、下から照射する仮想光源を設置する。   The reflection characteristic map generation unit 1202 installs a plurality of virtual light sources for providing diffuse reflection and specular reflection based on the subject evaluation value acquired by the evaluation value generation unit 209 (FIG. 2). For example, as shown in FIG. 5A, in the case of oblique light in which the brightness on the left and right of the subject is different, a virtual light source for emitting light to the subject from the left and a virtual light source for emitting light from the right are installed. When the brightness is different between the upper and lower sides of the subject as shown in FIG. 5B, a virtual light source for emitting light to the subject from above and a virtual light source for emitting light 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 virtual light sources at a plurality of installed positions, and outputs the diffuse reflection map D and the specular reflection map S to the reflection characteristic map synthesis unit 1203.

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

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

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

仮想光源反射成分算出部1204は、撮影画像(Rin、Gin、Bin)に対して、反射特性マップMを乗算する。これにより、仮想光源による被写体の反射色成分(Ra、Ga、Ba)を算出する。式では下記の通りとなる。
Ra = M × Rin
Ra = M × Gin
Ra = M × Bin
The virtual light source reflection component calculation unit 1204 multiplies the reflection characteristic map M by the photographed image (Rin, Gin, Bin). Thereby, the reflection color components (Ra, Ga, Ba) of the subject by the virtual light source are calculated. The formula is as follows.
Ra = M × Rin
Ra = M × Gin
Ra = M × 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. The processing of the virtual light source addition processing unit 304 is the same as that of the first embodiment, and thus the description thereof is omitted here.

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

なお、上の説明では、拡散反射マップDと鏡面反射マップSをすべて合成して最終的な反射特性マップMを計算するものとしたが、拡散反射マップ、鏡面反射マップそれぞれの合成マップを生成し、最終的な反射色成分を計算する構成をとることも可能である。   In the above description, although the diffuse reflection map D and the specular reflection map S are all combined to calculate the final reflection characteristic map M, a composite map of the diffuse reflection map and the specular reflection map is generated. It is also possible to adopt a configuration to calculate the final reflection 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 apparatus via a network or storage medium, and one or more processors in a computer of the system or apparatus read and execute the program. Can also be realized. It can also be implemented by a circuit (eg, an 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 combining unit, 302: fitting processing unit, 303: virtual light source reflection component calculation unit, 304: virtual light source Additional processing unit

Claims (13)

所定の被写体における第1の仮想光源の反射特性を示す第1の反射特性データと、前記所定の被写体における第2の仮想光源の反射特性を示す第2の反射特性データとを合成する合成処理を行う合成手段と、
前記合成処理により得られた合成反射特性データが示す反射特性に基づいて、画像に含まれる被写体における反射成分を生成する生成手段と、
前記画像に対して前記反射成分を付加する付加手段と、
を備えることを特徴とする画像処理装置。
Combining processing for combining the first reflection characteristic data indicating the reflection characteristic of the first virtual light source in a predetermined subject and the second reflection characteristic data indicating the reflection characteristic of the second virtual light source in the predetermined object Means of synthesis,
Generation means for generating a reflection component of an object included in the image based on the reflection characteristic indicated by the combination reflection characteristic data obtained by the combination processing;
Adding means for adding the reflection component to the image;
An image processing apparatus comprising:
前記合成手段は、複数の反射特性データの中から前記第1の反射特性データ及び前記第2の反射特性データを選択する
ことを特徴とする請求項1に記載の画像処理装置。
The image processing apparatus according to claim 1, wherein the combining unit selects the first reflection characteristic data and the second reflection characteristic data from among a plurality of reflection characteristic data.
補正モードを決定する決定手段を更に備え、
前記合成手段は、前記補正モードに基づいて前記第1の反射特性データ及び前記第2の反射特性データを選択する
ことを特徴とする請求項2に記載の画像処理装置。
Further comprising determining means for determining a correction mode;
The image processing apparatus according to claim 2, wherein the combining unit selects the first reflection characteristic data and the second reflection characteristic data based on the correction mode.
前記決定手段は、前記画像に含まれる前記被写体の輝度に基づいて前記補正モードを決定する
ことを特徴とする請求項3に記載の画像処理装置。
The image processing apparatus according to claim 3, wherein the determination unit determines the correction mode based on the luminance of the subject included in the image.
前記合成手段は、ユーザ指示に従って前記第1の反射特性データ及び前記第2の反射特性データを選択する
ことを特徴とする請求項2に記載の画像処理装置。
The image processing apparatus according to claim 2, wherein the combining unit selects the first reflection characteristic data and the second reflection characteristic data according to a user instruction.
前記合成手段は、前記合成処理において、前記第1の反射特性データに第1の係数を乗じ、前記第2の反射特性データに第2の係数を乗じる
ことを特徴とする請求項1乃至5のいずれか1項に記載の画像処理装置。
6. The apparatus according to claim 1, wherein the combining means multiplies the first reflection property data by a first coefficient and the second reflection property data by a second coefficient in the combining process. An image processing apparatus according to any one of the preceding claims.
前記合成手段は、前記画像に含まれる前記被写体の輝度に基づいて前記第1の係数及び前記第2の係数を決定する
ことを特徴とする請求項6に記載の画像処理装置。
The image processing apparatus according to claim 6, wherein the combining unit determines the first coefficient and the second coefficient based on the luminance of the subject included in the image.
前記所定の被写体と前記画像に含まれる前記被写体との形状の相違を補償するように前記合成反射特性データを補正する補正手段を更に備え、
前記生成手段は、前記補正がなされた前記合成反射特性データに基づいて前記反射成分を生成する
ことを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。
The image processing apparatus further comprises correction means for correcting the combined reflection characteristic data so as to compensate for the difference in shape between the predetermined subject and the subject included in the image.
The image processing apparatus according to any one of claims 1 to 7, wherein the generation unit generates the reflection component based on the combined reflection characteristic data that has been subjected to the correction.
前記合成反射特性データは、前記所定の被写体の各位置における反射特性を表現する反射特性画像を含み、
前記補正手段は、前記所定の被写体と前記画像に含まれる前記被写体との形状の相違を補償するように、前記反射特性画像を幾何学変換する
ことを特徴とする請求項8に記載の画像処理装置。
The combined reflection characteristic data includes a reflection characteristic image representing the reflection characteristic at each position of the predetermined subject,
The image processing according to claim 8, wherein the correction means geometrically transforms the reflection characteristic image so as to compensate for the difference in shape between the predetermined subject and the subject included in the image. apparatus.
前記補正手段は更に、前記画像に基づいて前記反射特性画像に対して平滑化処理を行う
ことを特徴とする請求項9に記載の画像処理装置。
The image processing apparatus according to claim 9, wherein the correction unit further performs a smoothing process on the reflection characteristic image based on the image.
請求項1乃至10のいずれか1項に記載の画像処理装置と、
前記画像を生成する撮像手段と、
を備えることを特徴とする撮像装置。
An image processing apparatus according to any one of claims 1 to 10.
Imaging means for generating the image;
An imaging apparatus comprising:
画像処理装置が実行する画像処理方法であって、
所定の被写体における第1の仮想光源の反射特性を示す第1の反射特性データと、前記所定の被写体における第2の仮想光源の反射特性を示す第2の反射特性データとを合成する合成処理を行う合成工程と、
前記合成処理により得られた合成反射特性データが示す反射特性に基づいて、画像に含まれる被写体における反射成分を生成する生成工程と、
前記画像に対して前記反射成分を付加する付加工程と、
を備えることを特徴とする画像処理方法。
An image processing method performed by an image processing apparatus, comprising:
Combining processing for combining the first reflection characteristic data indicating the reflection characteristic of the first virtual light source in a predetermined subject and the second reflection characteristic data indicating the reflection characteristic of the second virtual light source in the predetermined object The synthesis process to be performed,
A generation step of generating a reflection component of an object included in the image based on the reflection characteristic indicated by the combination reflection characteristic data obtained by the combination processing;
Adding the reflection component to the image;
An image processing method comprising:
コンピュータを、請求項1乃至10のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the image processing apparatus of any one of Claims 1-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 true JP2019083008A (en) 2019-05-30
JP2019083008A5 JP2019083008A5 (en) 2021-11-25
JP7169841B2 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, vol. 第99巻 第710号, JPN6022040889, 2000, JP, pages 81 - 88, ISSN: 0004884825 *
池田 拓也: "RGB−Dカメラを用いた動的光源環境へのリライティング Relighting with Dynamic Light Environments U", 電子情報通信学会技術研究報告 VOL.113 NO.403 IEICE TECHNICAL REPORT, vol. 第113巻 第403号, JPN6022040886, 2014, JP, pages 219 - 224, ISSN: 0004884826 *

Also Published As

Publication number Publication date
JP7169841B2 (en) 2022-11-11

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
JP5743696B2 (en) Image processing apparatus, image processing method, and program
JP5665436B2 (en) Image processing apparatus, image processing method, and program
JP6381404B2 (en) Image processing apparatus and method, and imaging apparatus
JP5804856B2 (en) Image processing apparatus, image processing method, and program
JP5804857B2 (en) Image processing apparatus, image processing method, and program
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
CN110324529B (en) Image processing apparatus and control method thereof
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
JP5854716B2 (en) Image processing apparatus, image processing method, and program
JP7277158B2 (en) Setting device and method, program, storage medium
JP2018050149A (en) Image processing apparatus
JP7169841B2 (en) IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM
JP7462464B2 (en) Image processing device and method, program, and storage medium
JP7356255B2 (en) Image processing device and its processing method, imaging device, program, storage medium
JP7102192B2 (en) Image processing device, its control method, program
JP7011694B2 (en) Image processing equipment and its control method, program
JP6675461B2 (en) Image processing apparatus, control method therefor, and program
JP2021087125A (en) Image processing device, control method thereof, and program
JP2020024581A (en) Image processing apparatus, image processing method, and program
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