JP2021005418A - Image processing apparatus and control method for the same, and program - Google Patents

Image processing apparatus and control method for the same, and program Download PDF

Info

Publication number
JP2021005418A
JP2021005418A JP2020168657A JP2020168657A JP2021005418A JP 2021005418 A JP2021005418 A JP 2021005418A JP 2020168657 A JP2020168657 A JP 2020168657A JP 2020168657 A JP2020168657 A JP 2020168657A JP 2021005418 A JP2021005418 A JP 2021005418A
Authority
JP
Japan
Prior art keywords
subject
image
normal
virtual light
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
JP2020168657A
Other languages
Japanese (ja)
Other versions
JP7011694B2 (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 JP2020168657A priority Critical patent/JP7011694B2/en
Publication of JP2021005418A publication Critical patent/JP2021005418A/en
Application granted granted Critical
Publication of JP7011694B2 publication Critical patent/JP7011694B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

To provide an image processing apparatus that can create an image having a desired shading state according to the shape of an individual subject.SOLUTION: An image processing apparatus according to the present disclosure has first acquisition means that acquires an image including a subject, second acquisition means that acquires information on a normal line of a predetermined area on a surface of the subject, and processing means that provides an image with the effect of virtual light that is light which is virtual based on the normal line information. The processing means provides the effect of virtual light corresponding to a case where the normal line information acquired by the second acquisition means is changed, according to the direction or the attitude of the predetermined area.SELECTED DRAWING: Figure 3

Description

本発明は、画像処理装置およびその制御方法、プログラムに関する。 The present invention relates to an image processing device, a control method thereof, and a program.

従来、写真撮影では、撮影時に補助照明やレフ板を用いて被写体に生じる光と影の領域を調節することにより、被写体の印象を所望のものに変化させることができる。一方、撮影後に、画像処理によって被写体の顔領域に陰影成分を付加することにより、被写体に生じる光と影の領域を調節する技術が知られている(特許文献1)。この技術を用いれば、絵画的な印象深い画像や立体感を強調した画像を得ることができる。 Conventionally, in photography, the impression of a subject can be changed to a desired one by adjusting the areas of light and shadow generated in the subject by using auxiliary lighting or a reflector during photography. On the other hand, there is known a technique of adjusting the light and shadow regions generated in a subject by adding a shadow component to the face region of the subject by image processing after shooting (Patent Document 1). By using this technique, it is possible to obtain an image with an impressive pictorial impression or an image with an emphasized stereoscopic effect.

特開2012−105016号公報Japanese Unexamined Patent Publication No. 2012-105016

しかしながら、特許文献1で開示された技術は、所定の方向からの光によって顔領域に生じる2次元状の陰影パターンを予め保持し、選択された陰影パターンを、撮影画像内の人物の輪郭や目鼻の位置に合わせて当てはめるものである。したがって、陰影の状態が所定の方向からの陰影パターンに限られ、個々の被写体の形状に応じた自然な陰影状態を得ることは困難である。 However, the technique disclosed in Patent Document 1 holds in advance a two-dimensional shadow pattern generated in the face region by light from a predetermined direction, and uses the selected shadow pattern as the outline of a person in a captured image or the eyes and nose. It is applied according to the position of. Therefore, the shadow state is limited to the shadow pattern from a predetermined direction, and it is difficult to obtain a natural shadow state according to the shape of each subject.

本発明は、上述の従来技術の問題点に鑑みてなされたものであり、個々の被写体の形状に応じた、所望の陰影状態を有する画像を生成することが可能な画像処理装置およびその制御方法、プログラムを提供することを目的とする。 The present invention has been made in view of the above-mentioned problems of the prior art, and is an image processing device capable of generating an image having a desired shadow state according to the shape of an individual subject and a control method thereof. , The purpose is to provide the program.

この課題を解決するため、例えば本発明の画像処理装置は以下の構成を備える。すなわち、被写体を含んだ画像を取得する第1の取得手段と、前記被写体の表面の所定の領域の法線情報を取得する第2の取得手段と、前記法線情報に基づき、前記画像に仮想的な光である仮想光の効果を付与する処理手段と、を有し、前記処理手段は、前記所定の領域の向きまたは姿勢に応じて、前記第2の取得手段により取得された法線情報を変化させた場合に対応する前記仮想光の効果を付与する、ことを特徴とする。 In order to solve this problem, for example, the image processing apparatus of the present invention has the following configuration. That is, based on the first acquisition means for acquiring an image including the subject, the second acquisition means for acquiring the normal information of a predetermined region on the surface of the subject, and the normal information, the image is virtualized. It has a processing means for imparting the effect of virtual light which is a target light, and the processing means has normal information acquired by the second acquisition means according to the direction or orientation of the predetermined region. It is characterized in that the effect of the virtual light corresponding to the case where is changed is imparted.

本発明によれば、個々の被写体の形状に応じた、所望の陰影状態を有する画像を生成することが可能になる。 According to the present invention, it is possible to generate an image having a desired shadow state according to the shape of each subject.

本発明の実施形態に係る画像処理装置の一例としてのデジタルカメラの機能構成例を示すブロック図A block diagram showing a functional configuration example of a digital camera as an example of an image processing device according to an embodiment of the present invention. 実施形態1に係る画像処理部の機能構成例を示すブロック図Block diagram showing a functional configuration example of the image processing unit according to the first embodiment 実施形態1に係るリライティング処理部の機能構成例を示すブロック図Block diagram showing a functional configuration example of the rewriting processing unit according to the first embodiment 実施形態1に係るリライティングによる反射成分を説明する図The figure explaining the reflection component by rewriting which concerns on Embodiment 1. 実施形態1に係る照明モードを説明する図The figure explaining the lighting mode which concerns on Embodiment 1. 実施形態1のリライティングパラメータの決定処理に係る一連の動作を示すフローチャートA flowchart showing a series of operations related to the determination process of the rewriting parameter of the first embodiment. 実施形態1に係る法線の補正例を説明する図The figure explaining the correction example of the normal which concerns on Embodiment 1. 実施形態1に係る法線の補正特性を説明する図The figure explaining the correction characteristic of the normal which concerns on Embodiment 1. 実施形態1に係る、仮想光源の方向と法線の方向のなす角の補正特性、及び反射光量の補正特性を説明する図The figure explaining the correction characteristic of the angle formed by the direction of a virtual light source and the direction of a normal, and the correction characteristic of the amount of reflected light which concerns on Embodiment 1. 実施形態1に係る、仮想光源の方向と法線の方向のなす角のヒストグラムを説明する図The figure explaining the histogram of the angle formed by the direction of a virtual light source and the direction of a normal line which concerns on Embodiment 1.

(実施形態1)
以下、本発明の例示的な実施形態について、図面を参照して詳細に説明する。なお、以下では画像処理装置の一例として、画像を撮影して被写体の陰影状態を変更可能な任意のデジタルカメラに本発明を適用した例を説明する。しかし、本発明は、撮像が可能なデジタルカメラに限らず、撮影された画像を取得して被写体の陰影状態を変更可能な任意の機器にも適用可能である。これらの機器には、例えば携帯電話機、ゲーム機、タブレット端末、パーソナルコンピュータ、時計型や眼鏡型の情報端末、車載機器や監視システム、医療機器などが含まれてよい。
(Embodiment 1)
Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the drawings. In the following, as an example of the image processing device, an example in which the present invention is applied to an arbitrary digital camera capable of capturing an image and changing the shadow state of the subject will be described. However, the present invention is not limited to a digital camera capable of taking an image, and can be applied to any device capable of acquiring a captured image and changing the shadow state of a subject. These devices may include, for example, mobile phones, game consoles, tablet terminals, personal computers, clock-type and eyeglass-type information terminals, in-vehicle devices and surveillance systems, medical devices, and the like.

(デジタルカメラ100の構成)
図1は、本実施形態の画像処理装置の一例としてデジタルカメラ100の機能構成例を示すブロック図である。なお、図1に示す機能ブロックの1つ以上は、ASICやプログラマブルロジックアレイ(PLA)などのハードウェアによって実現されてもよいし、CPUやMPU等のプログラマブルプロセッサがソフトウェアを実行することによって実現されてもよい。また、ソフトウェアとハードウェアの組み合わせによって実現されてもよい。従って、以下の説明において、異なる機能ブロックが動作主体として記載されている場合であっても、同じハードウェアが主体として実現されうる。
(Configuration of Digital Camera 100)
FIG. 1 is a block diagram showing a functional configuration example of the digital camera 100 as an example of the image processing device of the present embodiment. One or more of the functional blocks shown in FIG. 1 may be realized by hardware such as an ASIC or a programmable logic array (PLA), or may be realized by a programmable processor such as a CPU or MPU executing software. You may. It may also be realized by a combination of software and hardware. Therefore, in the following description, the same hardware can be realized as the main body even if different functional blocks are described as the main body of operation.

撮影光学系101はズームレンズ、フォーカスレンズ等のレンズ群を含む。シャッター102は絞り機能を備え、所定の時間の間、撮像部103に含まれる撮像素子を露光する。撮像部103は、光電変換素子を有する画素が複数、2次元状に配列された撮像素子を有し、撮影光学系101により結像された被写体光学像を電気信号に変換して画像信号を出力する。撮像素子はCCDやCMOSイメージセンサ等であってよい。A/D変換部104は、アナログ信号をデジタル信号(画像データ)に変換する回路である。 The photographing optical system 101 includes a lens group such as a zoom lens and a focus lens. The shutter 102 has an aperture function and exposes the image sensor included in the image pickup unit 103 for a predetermined time. The image pickup unit 103 has an image pickup element in which a plurality of pixels having a photoelectric conversion element are arranged in a two-dimensional manner, converts a subject optical image imaged by the photographing optical system 101 into an electric signal, and outputs an image signal. To do. The image sensor may be a CCD, a CMOS image sensor, or the like. The A / D converter 104 is a circuit that converts an analog signal into a digital signal (image data).

画像処理部105は、A/D変換部104から出力される画像データに対し、所定の各種画像処理を行う。メモリ制御部107は、制御回路を含み、後述するリライティング処理部114や顔検出部113等からの画像メモリ106に対する入出力を制御する。 The image processing unit 105 performs various predetermined image processing on the image data output from the A / D conversion unit 104. The memory control unit 107 includes a control circuit and controls input / output to the image memory 106 from the rewriting processing unit 114, the face detection unit 113, and the like, which will be described later.

D/A変換部108は、メモリ制御部107から読み出されたデジタル信号をアナログ信号に変換する回路であり、変換したアナログ信号を表示部109に出力する。表示部109はLCD等の表示装置を含み、撮影された画像データやデジタルカメラ100を操作するためのGUIを表示する。コーデック部110は、処理回路又は処理モジュールを含み、画像データを圧縮符号化すると共に、圧縮された画像データを復号する。 The D / A conversion unit 108 is a circuit that converts a digital signal read from the memory control unit 107 into an analog signal, and outputs the converted analog signal to the display unit 109. The display unit 109 includes a display device such as an LCD, and displays captured image data and a GUI for operating the digital camera 100. The codec unit 110 includes a processing circuit or a processing module, compresses and encodes the image data, and decodes the compressed image data.

I/F111は、記録媒体112とのインタフェースを構成し、記録媒体との間の画像データの書き込みや読み込みを制御する。記録媒体112は、例えばメモリカードやハードディスク等の不揮発性の記録媒体を含み、撮影された画像データを記録する。 The I / F 111 constitutes an interface with the recording medium 112 and controls writing and reading of image data with and from the recording medium. The recording medium 112 includes a non-volatile recording medium such as a memory card or a hard disk, and records captured image data.

顔検出部113は、処理回路又は処理モジュールを含み、撮影された画像データを入力して画像内の人物の顔領域を検出する。リライティング処理部114は、撮影された画像データを入力して、後述するリライティング処理を行う。 The face detection unit 113 includes a processing circuit or a processing module, inputs captured image data, and detects a face region of a person in the image. The rewriting processing unit 114 inputs the captured image data and performs the rewriting processing described later.

システム制御部50は、例えば、CPU(又はMPU)を含み、不揮発性メモリ121に記憶されたプログラムをシステムメモリ122に展開、実行してデジタルカメラ100の各部を制御したり、各部の間で行われるデータ転送を制御したりする。また、システム制御部50は、ユーザからの操作を受け付ける操作部120からの操作信号に応じて、デジタルカメラ100の各部を制御する。 The system control unit 50, for example, includes a CPU (or MPU), expands and executes a program stored in the non-volatile memory 121 in the system memory 122 to control each part of the digital camera 100, or performs a line between each part. Controls the data transfer. Further, the system control unit 50 controls each unit of the digital camera 100 in response to an operation signal from the operation unit 120 that receives an operation from the user.

操作部120は、例えば、電源ボタン、静止画記録ボタン、動画記録開始、停止を指示するボタンなどの撮影に関連する各種操作を入力するスイッチ類を含む。また、操作部120は、メニュー表示ボタン、決定ボタン、その他カーソルキー、ポインティングデバイス、タッチパネル等を有し、ユーザによりこれらのキーやボタンが操作されるとシステム制御部50に操作信号を送信する。 The operation unit 120 includes switches for inputting various operations related to shooting, such as a power button, a still image recording button, and a button for instructing moving image recording start and stop. Further, the operation unit 120 has a menu display button, an enter button, other cursor keys, a pointing device, a touch panel, and the like, and when the user operates these keys and buttons, an operation signal is transmitted to the system control unit 50.

不揮発性メモリ121は、プログラムやパラメータなどを格納する、例えばEEPROMなどの不揮発性メモリである。システムメモリ122は、揮発性メモリを含み、システム制御部50の動作用の定数、変数、不揮発性メモリ121から読みだしたプログラム等を一時的に記憶する。光源装置123は、例えばストロボを含む光を発生させる光源装置である。測距センサ124は、被写体とデジタルカメラ100との距離を測定するセンサを含み、上述した撮像素子の各画素に対応する被写体距離情報を2次元の距離マップ画像を生成して出力する。 The non-volatile memory 121 is a non-volatile memory such as an EEPROM that stores programs, parameters, and the like. The system memory 122 includes a volatile memory, and temporarily stores constants, variables, a program read from the non-volatile memory 121, and the like for operation of the system control unit 50. The light source device 123 is, for example, a light source device that generates light including a strobe. The distance measuring sensor 124 includes a sensor that measures the distance between the subject and the digital camera 100, and generates and outputs a two-dimensional distance map image of the subject distance information corresponding to each pixel of the image sensor described above.

次に、デジタルカメラ100において被写体を撮影する際の、基本的な動作について説明する。まず、撮像部103は、撮影光学系101及びシャッター102を介して入射した光線を光電変換し、アナログ画像信号としてA/D変換部104へ出力する。A/D変換部104は、撮像部103から入力された画像信号をデジタル画像信号(画像データ)に変換して画像処理部105に出力する。 Next, a basic operation when shooting a subject with the digital camera 100 will be described. First, the image pickup unit 103 photoelectrically converts the light rays incident through the photographing optical system 101 and the shutter 102, and outputs the light rays as analog image signals to the A / D conversion unit 104. The A / D conversion unit 104 converts the image signal input from the image pickup unit 103 into a digital image signal (image data) and outputs the image signal to the image processing unit 105.

画像処理部105は、A/D変換部104から入力された画像データ、又は、メモリ制御部107から入力された画像データに対して、所定の画像処理、例えばホワイトバランスなどの色変換処理、ガンマ処理、輪郭強調処理などを行う。また、画像処理部105では、顔検出部113による顔検出処理の結果や撮像した画像データを用いて、所定の評価値を算出する。そして、システム制御部50は得られた評価値に基づいて露光制御や測距制御を行う。これにより、TTL(スルー・ザ・レンズ)方式のAF(オートフォーカス)処理、AE(自動露出)処理、AWB(オートホワイトバランス)処理などが実現される。 The image processing unit 105 performs predetermined image processing, for example, color conversion processing such as white balance, and gamma for the image data input from the A / D conversion unit 104 or the image data input from the memory control unit 107. Performs processing, contour enhancement processing, etc. In addition, the image processing unit 105 calculates a predetermined evaluation value using the result of the face detection processing by the face detection unit 113 and the captured image data. Then, the system control unit 50 performs exposure control and distance measurement control based on the obtained evaluation value. As a result, TTL (through-the-lens) AF (autofocus) processing, AE (autoexposure) processing, AWB (auto white balance) processing, and the like are realized.

画像処理部105から出力された画像データは、メモリ制御部107を介して画像メモリ106に格納される。画像メモリ106は、撮像部103から出力された画像データや、表示部109に表示するための画像データを記憶する。また、表示部109は、LCD等の表示装置に、D/A変換部108からの得られるアナログ信号に応じた表示を行う。コーデック部110は、画像メモリ106に記憶された画像データをJPEG、MPEGなどの規格に基づきそれぞれ圧縮符号化する。システム制御部50は符号化された画像データをI/F111を介して記録媒体112に記録する。 The image data output from the image processing unit 105 is stored in the image memory 106 via the memory control unit 107. The image memory 106 stores the image data output from the imaging unit 103 and the image data to be displayed on the display unit 109. Further, the display unit 109 displays on a display device such as an LCD according to the analog signal obtained from the D / A conversion unit 108. The codec unit 110 compresses and encodes the image data stored in the image memory 106 based on standards such as JPEG and MPEG. The system control unit 50 records the encoded image data on the recording medium 112 via the I / F 111.

(画像処理部105の構成)
次に、図2を参照して、画像処理部105の機能構成例について詳細に説明する。
(Structure of image processing unit 105)
Next, an example of the functional configuration of the image processing unit 105 will be described in detail with reference to FIG.

画像処理部105に入力された画像データは同時化処理部200に入力される。同時化処理部200は、入力されたベイヤーRGBの画像データに対して、同時化処理を行い、色信号R、G、Bをそれぞれ生成する。 The image data input to the image processing unit 105 is input to the simultaneous processing unit 200. The simultaneous processing unit 200 performs simultaneous processing on the input Bayer RGB image data to generate color signals R, G, and B, respectively.

WB増幅部201は、システム制御部50により算出されるホワイトバランスゲイン値に基づき、RGBの各色信号にゲインをかけ、ホワイトバランスを調整する。WB増幅部201が出力したRGB信号は、輝度色信号生成部202に入力される。輝度色信号生成部202は、RGB信号から輝度信号Yを生成し、生成した輝度信号Yを輪郭強調処理部203へ、色信号RGBを色変換処理部205へそれぞれ出力する。 The WB amplification unit 201 applies a gain to each of the RGB color signals based on the white balance gain value calculated by the system control unit 50, and adjusts the white balance. The RGB signal output by the WB amplification unit 201 is input to the luminance color signal generation unit 202. The luminance color signal generation unit 202 generates a luminance signal Y from the RGB signal, and outputs the generated luminance signal Y to the contour enhancement processing unit 203 and the color signal RGB to the color conversion processing unit 205.

輪郭強調処理部203は、輝度信号Yに対して輪郭強調処理を行って、輪郭(エッジともいう)の強調された画像データを輝度ガンマ処理部204へ出力する。輝度ガンマ処理部204は、輪郭の強調された輝度信号Yに対してガンマ補正を行って、輝度信号Yを例えば表示部109の表示特性に合わせて変換する。輝度ガンマ処理部204は、変換後の輝度信号Yを、画像処理部105の出力輝度信号として出力する。 The contour enhancement processing unit 203 performs contour enhancement processing on the luminance signal Y, and outputs image data with enhanced contours (also referred to as edges) to the luminance gamma processing unit 204. The luminance gamma processing unit 204 performs gamma correction on the luminance signal Y whose contour is emphasized, and converts the luminance signal Y according to, for example, the display characteristics of the display unit 109. The luminance gamma processing unit 204 outputs the converted luminance signal Y as the output luminance signal of the image processing unit 105.

色変換処理部205は、RGB信号に対するマトリクス演算などにより、所望のカラーバランスへ変換する。色ガンマ処理部206では、RGBの色信号に対してガンマ補正を行って、色信号を例えば表示部109の表示特性に合わせて変換する。色ガンマ処理部206は、変換後のRGBの色信号を色差信号生成部207に出力する。色差信号生成部207では、RGBの色信号から色差信号R−Y、B−Y信号を生成して、画像処理部105の出力色差信号として出力する。出力された画像信号Y、R−Y、B−Y信号は、画像メモリ106を介してコーデック部110に入力され、圧縮符号化されて記録媒体112に記録される。 The color conversion processing unit 205 converts the RGB signal into a desired color balance by matrix calculation or the like. The color gamma processing unit 206 performs gamma correction on the RGB color signal to convert the color signal according to, for example, the display characteristics of the display unit 109. The color gamma processing unit 206 outputs the converted RGB color signal to the color difference signal generation unit 207. The color difference signal generation unit 207 generates color difference signals RY and BY signals from RGB color signals and outputs them as output color difference signals of the image processing unit 105. The output image signals Y, RY, and BY signals are input to the codec unit 110 via the image memory 106, compressed and encoded, and recorded on the recording medium 112.

また、色変換処理部205から出力されたRGBの色信号は、評価値取得部208にも入力される。評価値取得部208は、環境光源によって被写体に生じた陰影の状態を解析するための情報を算出する。評価値取得部208は、例えば被写体の平均輝度情報および顔領域の輝度ヒストグラム情報を陰影情報として算出し、算出された評価値は画像処理部105から出力される。 Further, the RGB color signal output from the color conversion processing unit 205 is also input to the evaluation value acquisition unit 208. The evaluation value acquisition unit 208 calculates information for analyzing the state of shadows generated on the subject by the environmental light source. The evaluation value acquisition unit 208 calculates, for example, the average brightness information of the subject and the brightness histogram information of the face region as shadow information, and the calculated evaluation value is output from the image processing unit 105.

(リライティング処理部114の構成及び動作)
更に、図3を参照して、リライティング処理部114の構成及びその具体的な動作について説明する。なお、操作部120に対するユーザ操作によりリライティング処理が選択された場合、リライティング処理部114は、画像処理部105から出力された画像データに対して、後述する照明モードに応じた、仮想光源を用いたリライティング処理を行う。
(Configuration and operation of rewriting processing unit 114)
Further, with reference to FIG. 3, the configuration of the rewriting processing unit 114 and its specific operation will be described. When the rewriting process is selected by the user operation on the operation unit 120, the rewriting processing unit 114 uses a virtual light source corresponding to the lighting mode described later for the image data output from the image processing unit 105. Perform rewriting processing.

RGB信号変換部301は、画像メモリ106から読み出された輝度・色差信号(Y、B−Y、R−Y)をRGB信号に変換して、デガンマ処理部302へ出力する。デガンマ処理部302は、画像処理部105の輝度ガンマ処理部204及び色ガンマ処理部206により適用されたガンマ特性と逆の特性を適用した演算(デガンマ処理)を行ってリニア信号に変換する。デガンマ処理部302は、リニア信号に変換したRGB信号(Rt、Gt、Bt)を、反射成分算出部309およびゲイン処理部303に出力する。 The RGB signal conversion unit 301 converts the luminance / color difference signals (Y, BY, RY) read from the image memory 106 into RGB signals and outputs them to the degamma processing unit 302. The degamma processing unit 302 performs an operation (degamma processing) applying the characteristics opposite to the gamma characteristics applied by the luminance gamma processing unit 204 and the color gamma processing unit 206 of the image processing unit 105 to convert them into a linear signal. The degamma processing unit 302 outputs the RGB signals (Rt, Gt, Bt) converted into linear signals to the reflection component calculation unit 309 and the gain processing unit 303.

ゲイン処理部303は、入力したRGB信号(Rt、Gt、Bt)の各成分に式1に従うゲイン(1/S)を乗算したRGB信号(Rg、Gg、Bg)を出力する。 The gain processing unit 303 outputs an RGB signal (Rg, Gg, Bg) obtained by multiplying each component of the input RGB signal (Rt, Gt, Bt) by a gain (1 / S) according to Equation 1.

Rg = Rt / S
Gg = Gt / S (式1)
Bg = Bt / S
但し、SはS>1であり、1/Sは入力信号の明るさを低下させるゲインである。
Rg = Rt / S
Gg = Gt / S (expression 1)
Bg = Bt / S
However, S is S> 1, and 1 / S is a gain that reduces the brightness of the input signal.

法線算出部307は、測距センサ124から取得した被写体距離情報(すなわち撮影画像の画素単位で得られる2次元の距離情報)から法線マップを算出する。なお、本実施形態に係る法線マップの算出には公知の方法を用いることができるため算出方法についての詳細な説明は省略するが、本実施形態における法線マップの概略について図4を参照して説明する。 The normal calculation unit 307 calculates the normal map from the subject distance information (that is, the two-dimensional distance information obtained in pixel units of the captured image) acquired from the distance measuring sensor 124. Since a known method can be used for calculating the normal map according to the present embodiment, a detailed description of the calculation method will be omitted, but FIG. 4 will be referred to for the outline of the normal map in the present embodiment. I will explain.

図4は、撮影された画像上の水平座標と被写体の存在する3次元の座標との関係を示している。本実施形態では、被写体距離情報を用いることにより、画像上の水平方向の差分ΔHに対する、距離(奥行き)Dの差分ΔDが得られる。このため、法線算出部307は、この差分ΔHに対する距離の差分ΔDに基づいて、被写体401の表面形状の勾配を算出することができる。そして、算出した勾配に対する法線を求めることにより、被写体の表面形状における法線Nを算出することができる。法線算出部307は、同様の処理により撮影画像の各画素に対応する法線を算出し、算出した法線を法線マップとして法線補正部308へ出力する。 FIG. 4 shows the relationship between the horizontal coordinates on the captured image and the three-dimensional coordinates in which the subject exists. In the present embodiment, the difference ΔD of the distance (depth) D with respect to the difference ΔH in the horizontal direction on the image can be obtained by using the subject distance information. Therefore, the normal calculation unit 307 can calculate the gradient of the surface shape of the subject 401 based on the difference ΔD of the distance with respect to the difference ΔH. Then, by obtaining the normal with respect to the calculated gradient, the normal N in the surface shape of the subject can be calculated. The normal calculation unit 307 calculates the normal corresponding to each pixel of the captured image by the same processing, and outputs the calculated normal as a normal map to the normal correction unit 308.

法線補正部308は、後述する照明モードに応じた陰影状態に近づけるため、法線マップに含まれる法線Nを、システム制御部50から取得した法線補正特性に基づいて補正する(法線補正処理ともいう)。そして、補正した法線マップを反射成分算出部309へ出力する。なお、システム制御部50から取得する法線補正特性、及び法線補正処理については後述する。 The normal correction unit 308 corrects the normal N included in the normal map based on the normal correction characteristic acquired from the system control unit 50 in order to approach the shaded state according to the illumination mode described later (normal). Also called correction processing). Then, the corrected normal map is output to the reflection component calculation unit 309. The normal correction characteristic acquired from the system control unit 50 and the normal correction process will be described later.

反射成分算出部309は、仮想光源と被写体の距離K、法線N、仮想光源パラメータ(仮想光源の位置及び強度)に基づいて、仮想光源から出射した光線の、被写体表面における反射成分を算出する。この反射成分は、撮影画像における座標位置ごとに算出することができる。例えば、各座標位置における反射成分は、光源と被写体との距離Kの二乗に反比例し、被写体の法線ベクトルNと光源の方向ベクトルLの内積に比例するものとして算出される。 The reflection component calculation unit 309 calculates the reflection component of the light beam emitted from the virtual light source on the surface of the subject based on the distance K, normal N, and virtual light source parameter (position and intensity of the virtual light source) between the virtual light source and the subject. .. This reflection component can be calculated for each coordinate position in the captured image. For example, the reflection component at each coordinate position is calculated as being inversely proportional to the square of the distance K between the light source and the subject and proportional to the inner product of the normal vector N of the subject and the direction vector L of the light source.

再び図4を参照して、上述の光線の反射成分の算出例について説明する。図4に示す例では、仮想光源402が被写体401に対して距離K1だけ離れた位置に設定されている。また、方向L1で仮想光源402から出射された光線は、撮影画像の水平画素位置H1(垂直画素位置は説明の簡略化のため省略)の被写体表面で反射する。水平画素位置H1における光線の反射成分は、カメラ座標H1における法線N1と仮想光源の方向ベクトルL1の内積に比例し、仮想光源402と被写体位置の距離K1に反比例する値となる。すなわち、仮想光源による光線の反射成分(Ra、Ga、Ba)は式2のようになる。 An example of calculating the reflection component of the above-mentioned light beam will be described with reference to FIG. 4 again. In the example shown in FIG. 4, the virtual light source 402 is set at a position separated from the subject 401 by a distance K1. Further, the light beam emitted from the virtual light source 402 in the direction L1 is reflected on the subject surface at the horizontal pixel position H1 (the vertical pixel position is omitted for simplification of description) of the captured image. The reflection component of the light beam at the horizontal pixel position H1 is proportional to the inner product of the normal N1 at the camera coordinates H1 and the direction vector L1 of the virtual light source, and is inversely proportional to the distance K1 between the virtual light source 402 and the subject position. That is, the reflection components (Ra, Ga, Ba) of the light rays by the virtual light source are as shown in Equation 2.

Ra = α × (−L・N)/K^2 × Rw × Rt
Ga = α × (−L・N)/K^2 × 1 × Gt (式2)
Ba = α × (−L・N)/K^2 × Bw × Bt

ここで、αは仮想光源の強度、Lは仮想光源の3次元方向ベクトル、Nは被写体表面の3次元の法線ベクトル、Kは仮想光源と被写体の距離である。また、Rt、Gt、Btは、デガンマ処理部302から出力されたRGB信号であり、Rw、Bwは仮想光源の色を制御するパラメータである。
Ra = α × (−L ・ N) / K ^ 2 × Rw × Rt
Ga = α × (−L ・ N) / K ^ 2 × 1 × Gt (Equation 2)
Ba = α × (−L ・ N) / K ^ 2 × Bw × Bt

Here, α is the intensity of the virtual light source, L is the three-dimensional direction vector of the virtual light source, N is the three-dimensional normal vector of the surface of the subject, and K is the distance between the virtual light source and the subject. Further, Rt, Gt, and Bt are RGB signals output from the degamma processing unit 302, and Rw and Bw are parameters for controlling the color of the virtual light source.

反射成分算出部309は、式2に従って算出した仮想光源による光線の反射成分(Ra、Ga、Ba)を仮想光源付加処理部304へ出力する。そして、仮想光源付加処理部304は、ゲイン処理部303により出力されたRGB信号(Rg、Gg、Bg)に含まれる被写体領域に対して、式3に従って仮想光源による光線の反射成分(Ra、Ga、Ba)を付加する。 The reflection component calculation unit 309 outputs the reflection components (Ra, Ga, Ba) of the light rays by the virtual light source calculated according to Equation 2 to the virtual light source addition processing unit 304. Then, the virtual light source addition processing unit 304 has a light ray reflection component (Ra, Ga) by the virtual light source with respect to the subject area included in the RGB signals (Rg, Gg, Bg) output by the gain processing unit 303 according to the equation 3. , Ba) is added.

Rout = Rg + Ra
Gout = Gg + Ga (式3)
Bout = Bg + Ba
Rout = Rg + Ra
Gout = Gg + Ga (Equation 3)
Bout = Bg + Ba

仮想光源付加処理部304は、仮想光源による反射成分を付加した画像信号(Rout、Gout、Bout)をガンマ処理部305に出力する。ガンマ処理部305は、表示部109の出力特性と整合させるため、RGBの入力信号に対してガンマ補正を行う。輝度色差信号変換部306は、RGB信号から輝度・色差信号に変換して変換後の信号を出力する。 The virtual light source addition processing unit 304 outputs an image signal (Rout, Gout, Bout) to which a reflection component by the virtual light source is added to the gamma processing unit 305. The gamma processing unit 305 performs gamma correction on the RGB input signal in order to match the output characteristics of the display unit 109. The luminance color difference signal conversion unit 306 converts the RGB signal into a luminance / color difference signal and outputs the converted signal.

(リライティングパラメータの決定処理に係る一連の動作)
次に、図5及び図6を参照して、リライティングパラメータの決定処理に係る一連の動作を説明する。本実施形態におけるリライティングパラメータは、法線補正部308が用いる法線の補正特性と、反射成分算出部309が用いる仮想光源パラメータ(仮想光源の位置及び強度)とを表す。リライティングパラメータの決定処理は、リライティング処理部114によるリライティング処理に必要となるパラメータを決定し、リライティング処理部114に提供するための処理である。
(A series of operations related to the determination process of rewriting parameters)
Next, a series of operations related to the rewriting parameter determination process will be described with reference to FIGS. 5 and 6. The rewriting parameters in the present embodiment represent the normal correction characteristics used by the normal correction unit 308 and the virtual light source parameters (position and intensity of the virtual light source) used by the reflection component calculation unit 309. The rewriting parameter determination process is a process for determining the parameters required for the rewriting process by the rewriting processing unit 114 and providing them to the rewriting processing unit 114.

なお、システム制御部50は、本処理に先だって、ユーザによる処理対象の画像データの指定と照明モードの設定とを受け付ける。照明モードは、被写体に対する照明のあて方を選択可能であり、例えばユーザが操作部120に含まれるメニュー表示(不図示)において、予め定められた複数の照明モードからいずれかを選択することにより設定される。照明モードには、例えば、1)マニュアル照明モード、2)小顔照明モード、3)スプリット照明モード、4)レンブラント照明モードの4つのモードが含まれる。 Prior to this processing, the system control unit 50 accepts the user to specify the image data to be processed and to set the lighting mode. The lighting mode can be selected from how to illuminate the subject. For example, the user can select one of a plurality of predetermined lighting modes in the menu display (not shown) included in the operation unit 120. Will be done. The lighting mode includes, for example, four modes: 1) manual lighting mode, 2) small face lighting mode, 3) split lighting mode, and 4) Rembrandt lighting mode.

図5(B)〜(D)は、各照明モードによって生じる陰影状態の例を示しており、図5(A)は、他のモードの例との比較のためにリライティング処理を行っていない場合(すなわち処理対象の入力画像データ)の例を示している。図5(B)は、「小顔照明モード」に設定してリライティング処理を行った場合の画像例である。小顔照明モードでは、被写体の上側に仮想光源を設定して上側から被写体に光をあてて、顔の輪郭の周辺にやや強い陰影を付加するモードである。小顔照明モードでは、被写体の顔を小顔に見せる効果を与えることができる。 5 (B) to 5 (D) show an example of the shadow state caused by each lighting mode, and FIG. 5 (A) shows a case where the rewriting process is not performed for comparison with the example of other modes. (That is, the input image data to be processed) is shown as an example. FIG. 5B is an example of an image when the rewriting process is performed by setting the “small face illumination mode”. The small face illumination mode is a mode in which a virtual light source is set on the upper side of the subject and light is applied to the subject from the upper side to add a slightly strong shadow around the contour of the face. In the small face illumination mode, it is possible to give the effect of making the subject's face look like a small face.

図5(C)は、「スプリット照明モード」に設定してリライティング処理を行った場合の画像例である。スプリット照明モードは、被写体の真横に仮想光源を設定して横から被写体に光をあてるモードである。このモードでは、ダイナミックな陰影効果を与えることができる。 FIG. 5C is an example of an image when the rewriting process is performed by setting the “split illumination mode”. The split illumination mode is a mode in which a virtual light source is set right next to the subject and the subject is illuminated from the side. In this mode, you can give a dynamic shading effect.

図5(D)は、「レンブラント照明モード」に設定してリライティング処理を行った場合の画像例である。レンブラント照明モードは、被写体に対して斜め45度の位置に仮想光源を設定して斜め方向から被写体に光をあてるモードである。このモードでは、顔の立体感を強調した効果を与えることができる。 FIG. 5D is an example of an image when the rewriting process is performed by setting the “Rembrandt illumination mode”. The Rembrandt illumination mode is a mode in which a virtual light source is set at a position diagonally 45 degrees with respect to the subject and the subject is illuminated from an oblique direction. In this mode, it is possible to give an effect that emphasizes the three-dimensional effect of the face.

なお、上述したマニュアル照明モードは、他のモードによらずユーザが操作部120を介して仮想光源の位置を設定し、任意に照明を設定可能なモードである。 The manual lighting mode described above is a mode in which the user can set the position of the virtual light source via the operation unit 120 regardless of other modes and can arbitrarily set the lighting.

システム制御部50は、操作部120を介して上述した照明モードが設定されると、照明モードに応じた陰影状態を実現するために、図6に示すリライティングパラメータの決定処理を実行する。なお、本処理はシステム制御部50が不揮発性メモリ121に記憶されたプログラムをシステムメモリ122の作業用領域に展開し、実行することにより実現される。 When the above-mentioned illumination mode is set via the operation unit 120, the system control unit 50 executes the relighting parameter determination process shown in FIG. 6 in order to realize the shadow state according to the illumination mode. This process is realized by the system control unit 50 expanding the program stored in the non-volatile memory 121 into the working area of the system memory 122 and executing the program.

S601では、システム制御部50は、設定された照明モードがマニュアル照明モードであるか否かを判定する。システム制御部50は、操作部120から通知された照明モードに関する操作情報がマニュアル照明モードを示していない場合、設定された照明モードがマニュアル照明モードでないと判定する。この場合、システム制御部50は処理をS602に進める。一方、照明モードに関する操作情報がマニュアル照明モードを示す場合、設定された照明モードがマニュアル照明モードであると判定して、処理をS607に進める。 In S601, the system control unit 50 determines whether or not the set lighting mode is the manual lighting mode. If the operation information regarding the lighting mode notified from the operation unit 120 does not indicate the manual lighting mode, the system control unit 50 determines that the set lighting mode is not the manual lighting mode. In this case, the system control unit 50 advances the process to S602. On the other hand, when the operation information regarding the lighting mode indicates the manual lighting mode, it is determined that the set lighting mode is the manual lighting mode, and the process proceeds to S607.

S602では、システム制御部50は、顔検出部113を用いて顔検出処理を行い、検出した顔領域を取得する。顔検出部113は、処理対象の画像データに対して顔検出処理を実行して画像中の顔領域を特定する。なお、本実施形態に係る顔検出処理は、画像内の顔領域を特定できればどのようなものでもよく、公知の顔検出技術を用いることができるため詳細な説明は省略する。 In S602, the system control unit 50 performs face detection processing using the face detection unit 113 to acquire the detected face region. The face detection unit 113 executes face detection processing on the image data to be processed to specify a face region in the image. The face detection process according to the present embodiment may be any as long as the face region in the image can be specified, and a known face detection technique can be used, so detailed description thereof will be omitted.

S603では、システム制御部50は、画像処理部105から出力される評価値を用いて、画像データにおける環境光の状態を解析する。具体的に、システム制御部50は、まず、取得した顔領域に対応した画像の評価値(評価値取得部208により生成された微小ブロック単位の輝度平均値)を取得する。そして、取得した輝度の分布に基づいて所定の数で分割した顔領域のどの領域が明るいか(或いは左右どちらが明るいか)を判定することにより、顔領域の中心と顔領域の明るい領域との関係から環境光の方向を特定する。例えば顔領域を3×3の領域に分割した際に中心の右側の領域が明るいと判定した場合、環境光が右側からあたっているものとして特定する。 In S603, the system control unit 50 analyzes the state of ambient light in the image data using the evaluation value output from the image processing unit 105. Specifically, the system control unit 50 first acquires the evaluation value of the image corresponding to the acquired face region (the brightness average value of the minute block unit generated by the evaluation value acquisition unit 208). Then, the relationship between the center of the face region and the bright region of the face region is determined by determining which region of the face region divided by a predetermined number is bright (or which is brighter on the left or right) based on the acquired brightness distribution. Specify the direction of ambient light from. For example, when it is determined that the area on the right side of the center is bright when the face area is divided into 3 × 3 areas, it is specified that the ambient light is shining from the right side.

S604では、システム制御部50は、S603で得られた環境光の方向と照明モードとに応じて、リライティングに用いる仮想光源の位置を決定する。例えば、照明モードが「スプリット照明モード」や「レンブラント照明モード」である場合、システム制御部50は、環境光と同じ方向から仮想光源をあてるようにその方向を決定する。照明モードが「小顔照明モード」である場合、環境光の方向とは無関係に被写体の上側に仮想光源の方向を決定する。システム制御部50は、例えば、被写体距離情報から得られる被写体の3次元位置と、撮影モードごとに予め定めた仮想光源の距離と、上記仮想光源の方向とに基づいて、仮想光源の位置を決定する。 In S604, the system control unit 50 determines the position of the virtual light source used for rewriting according to the direction of the ambient light and the illumination mode obtained in S603. For example, when the illumination mode is "split illumination mode" or "Rembrandt illumination mode", the system control unit 50 determines the direction so that the virtual light source is applied from the same direction as the ambient light. When the illumination mode is the "small face illumination mode", the direction of the virtual light source is determined above the subject regardless of the direction of the ambient light. The system control unit 50 determines the position of the virtual light source based on, for example, the three-dimensional position of the subject obtained from the subject distance information, the distance of the virtual light source predetermined for each shooting mode, and the direction of the virtual light source. To do.

S605では、システム制御部50は、設定された照明モードに応じて法線補正特性を決定する。法線補正特性は、(法線補正処理において)法線補正部308がどのような法線をどれだけ補正するかを示す情報(すなわち所定の法線の成分に対する法線の補正量を示す情報)である。換言すれば、法線補正特性は、所定の被写体表面における、仮想光源による光線の反射成分の補正量を示す。 In S605, the system control unit 50 determines the normal correction characteristic according to the set illumination mode. The normal correction characteristic is information indicating how much what kind of normal the normal correction unit 308 corrects (in the normal correction process) (that is, information indicating the amount of correction of the normal with respect to a predetermined normal component). ). In other words, the normal correction characteristic indicates the amount of correction of the reflection component of the light beam by the virtual light source on the surface of a predetermined subject.

具体的な法線補正特性の例を説明する前に、法線補正処理の具体例について、図7を参照して説明する。図7は、被写体と仮想光源の位置関係を示しており、701は人物被写体、702はリライティングで用いる仮想光源を示している。また、L703は被写体から光源へのベクトル、N704は法線ベクトルを示している。仮想光源の光が反射する強度は、上述の通り光源ベクトルL703と法線ベクトルN704のなす角θによって決定される。光源ベクトルL703と法線ベクトルN704のなす角θが小さいほど、被写体で反射する光の強さが強くなり、θが大きいほど光の反射は弱くなる。 Before explaining a specific example of the normal correction characteristic, a specific example of the normal correction processing will be described with reference to FIG. 7. FIG. 7 shows the positional relationship between the subject and the virtual light source, where 701 is a human subject and 702 is a virtual light source used for rewriting. Further, L703 indicates a vector from the subject to the light source, and N704 indicates a normal vector. The intensity of light reflected by the virtual light source is determined by the angle θ formed by the light source vector L703 and the normal vector N704 as described above. The smaller the angle θ formed by the light source vector L703 and the normal vector N704, the stronger the intensity of the light reflected by the subject, and the larger the θ, the weaker the light reflection.

法線補正部308は、照明モードにより定義された所望の陰影状態となるように法線ベクトルN704(すなわち法線マップに含まれる法線)を補正する。例えば、照明モードが小顔照明モードである場合、図5(B)のように顔の輪郭に陰影を強く付けた陰影状態にするため、被写体の輪郭部の法線ベクトルを補正して輪郭部により強い陰影を付ける。 The normal correction unit 308 corrects the normal vector N704 (that is, the normal included in the normal map) so as to obtain a desired shadow state defined by the illumination mode. For example, when the lighting mode is the small face lighting mode, the normal vector of the contour portion of the subject is corrected to make the contour portion a shaded state in which the contour of the face is strongly shaded as shown in FIG. 5 (B). Gives a stronger shade.

図7の例では、法線補正処理により、法線ベクトルN704が補正法線ベクトルN705に補正される。すなわち、システム制御部50は、被写体701よりも小さい(小顔の)被写体706を仮定して、法線ベクトルN704を、小顔被写体706の法線ベクトル(つまり補正法線ベクトルN705)となるように補正する。これは、実際の被写体よりも小顔の被写体に生じる陰影を実際の被写体701に付けることを意味する。このように、法線補正処理では、光源ベクトルL703と補正法線ベクトルN705のなす角θを実際より変更して輪郭の陰影を変更することができる。 In the example of FIG. 7, the normal vector N704 is corrected to the correction normal vector N705 by the normal correction process. That is, the system control unit 50 assumes a subject 706 smaller (small face) than the subject 701, and makes the normal vector N704 a normal vector (that is, a correction normal vector N705) of the small face subject 706. Correct to. This means that the actual subject 701 is shaded by a subject having a smaller face than the actual subject. As described above, in the normal correction process, the shadow of the contour can be changed by changing the angle θ formed by the light source vector L703 and the correction normal vector N705.

法線補正部308は、上述した法線ベクトルの補正を法線補正特性に基づいて行う。本実施形態における法線補正特性は、例えば図8(A)〜(D)のようになる。図8の(A)は小顔照明モードの際の法線補正特性であり、横軸は入力画像の法線(入力)を、縦軸は補正後の法線(出力)をそれぞれ示している。小顔照明モードの場合は、顔の輪郭部分に陰影を付加するため、入力画像の法線ベクトル(x、y、z)のx軸成分に対して、所定の位置における補正後のx軸成分を相対的に大きく(x軸のマイナス側ではマイナス側に大きく)する。これにより図7の補正法線ベクトルN705に示すような補正効果を得ることができる。 The normal correction unit 308 corrects the above-mentioned normal vector based on the normal correction characteristic. The normal correction characteristics in this embodiment are as shown in FIGS. 8A to 8D, for example. FIG. 8A shows the normal correction characteristics in the small face illumination mode. The horizontal axis shows the normal (input) of the input image, and the vertical axis shows the corrected normal (output). .. In the small face illumination mode, in order to add a shadow to the contour part of the face, the x-axis component of the normal vector (x, y, z) of the input image is corrected at a predetermined position with respect to the x-axis component. Is relatively large (on the negative side of the x-axis, it is large on the negative side). As a result, the correction effect as shown in the correction normal vector N705 of FIG. 7 can be obtained.

図8(B)は被写体に向かって右横から照明をあてるスプリット照明モードの場合の補正特性を示している。光源が強くあたる被写体の右側(x軸のプラス側)では法線を補正しないが、被写体の左側(x軸のマイナス側)では陰影が強く生じるように法線を補正する。 FIG. 8B shows the correction characteristics in the split illumination mode in which the subject is illuminated from the right side. The normal is not corrected on the right side of the subject (plus side of the x-axis) where the light source is strongly exposed, but the normal is corrected so that the shadow is strongly generated on the left side of the subject (minus side of the x-axis).

また、図8(C)及び(D)は斜め45度から照明をあてるレンブラント照明モードの場合の補正特性を示している。(C)は法線のx軸成分を、(D)は法線のy軸成分の補正特性をそれぞれ示している。スプリット照明モードと同様に、光が強くあたるx軸のプラス側では法線を補正しないが、陰影が強く生じるx軸のマイナス側では法線を補正する。レンブラント照明モードの場合、斜めから照明をあてるため、x、yそれぞれの法線を補正し、より陰影が付きやすくする。 Further, FIGS. 8C and 8D show correction characteristics in the Rembrandt illumination mode in which illumination is applied from an angle of 45 degrees. (C) shows the x-axis component of the normal, and (D) shows the correction characteristic of the y-axis component of the normal. Similar to the split illumination mode, the normal is not corrected on the positive side of the x-axis where the light is strong, but the normal is corrected on the negative side of the x-axis where the shadow is strong. In the Rembrandt illumination mode, since the illumination is applied from an angle, the x and y normals are corrected to make it easier to shade.

一方、S607では、システム制御部50は、操作部120に対するユーザ操作により仮想光源位置や強さを決定する。 On the other hand, in S607, the system control unit 50 determines the position and intensity of the virtual light source by a user operation on the operation unit 120.

S606では、システム制御部50は、決定したリライティングパラメータをリライティング処理部114に設定する。より具体的に、システム制御部50は、S605で決定した法線補正特性をリライティング処理部114に出力して内部の法線補正部308に使用させる。また、システム制御部50は、S604で決定した仮想光源の位置と、例えば照明モードごとに予め定められた仮想光源の強度とを、リライティング処理部114に出力して内部の反射成分算出部309に使用させる。そして、リライティング処理部114へのリライティングパラメータの設定を終了すると、本処理に係る一連の動作を終了する。 In S606, the system control unit 50 sets the determined rewriting parameter in the rewriting processing unit 114. More specifically, the system control unit 50 outputs the normal correction characteristic determined in S605 to the rewriting processing unit 114 and causes the internal normal correction unit 308 to use it. Further, the system control unit 50 outputs the position of the virtual light source determined in S604 and, for example, the intensity of the virtual light source predetermined for each illumination mode to the rewriting processing unit 114 and outputs the position to the internal reflection component calculation unit 309. Let me use it. Then, when the setting of the rewriting parameter in the rewriting processing unit 114 is completed, a series of operations related to this processing is completed.

なお、本実施形態では、照明モードを設定し、照明モードごとに定義された陰影状態になるように被写体の法線を補正するようにした。しかし、照明モード以外によって陰影状態を設定するようにしてもよい。例えば、ユーザが所望とする陰影状態を直接入力するようにしてもよい。また、ユーザ操作によって「陰影の強度」が設定された場合、システム制御部50は、陰影の強度が高くなればなるほど法線の補正量を大きくするように法線補正特性を決定してもよい。 In the present embodiment, the illumination mode is set and the normal of the subject is corrected so as to obtain the shadow state defined for each illumination mode. However, the shadow state may be set by a mode other than the lighting mode. For example, the shadow state desired by the user may be directly input. Further, when the "shadow intensity" is set by the user operation, the system control unit 50 may determine the normal correction characteristic so that the normal correction amount increases as the shadow intensity increases. ..

さらに、照明モードでなく、ユーザ操作によって「被写体の形状」が指定された場合、指定された被写体の形状に基づき、陰影状態を定義するようにしてもよい。ここでの被写体の形状とは、実際の被写体の形状は変化させずに、陰影の付け方を変えることで被写体の形状が変わったように見せる見た目の形状を指している。前述の“小顔”も被写体の形状の1つである。つまり、ユーザによって被写体の形状が指定された場合、システム制御部50は、その形状に見えるような陰影状態を決定し、その陰影状態に近づくように法線補正特性を決定する。 Further, when the "subject shape" is specified by the user operation instead of the illumination mode, the shadow state may be defined based on the specified subject shape. The shape of the subject here refers to an appearance shape that makes the shape of the subject appear to have changed by changing the shading method without changing the actual shape of the subject. The above-mentioned "small face" is also one of the shapes of the subject. That is, when the shape of the subject is specified by the user, the system control unit 50 determines the shadow state that looks like the shape, and determines the normal correction characteristic so as to approach the shadow state.

さらに、上記実施形態に加えて、被写体の向きや姿勢によって、目標とする陰影状態を定義するようにしてもよい。例えば顔や体が斜めを向いている場合、より陰影感を出すために法線の補正量を上げるなどの構成をとることができる。 Further, in addition to the above embodiment, a target shadow state may be defined according to the orientation and posture of the subject. For example, when the face or body is facing diagonally, the normal correction amount can be increased in order to give a more shaded feeling.

また、本実施形態では、照明モードに応じて法線ベクトルを補正するようにしたが、法線ベクトルを直接補正する以外の構成にしてもよい。例えば、図7に示した法線ベクトルNと、光源ベクトルLのなす角θを、法線ベクトルの代わりに補正する方法を取ることも可能である。例えば、図9(A)は、当該なす角θの補正特性を示している。図9(A)では、なす角θがある閾値THを越えたあたりから、その変化率が大きくなるような補正特性である。このように、法線を直接補正するのではなく角度情報を補正することで、特性の制御がより容易となる場合がある。 Further, in the present embodiment, the normal vector is corrected according to the illumination mode, but a configuration other than directly correcting the normal vector may be used. For example, it is possible to take a method of correcting the angle θ formed by the normal vector N and the light source vector L shown in FIG. 7 instead of the normal vector. For example, FIG. 9A shows the correction characteristic of the formed angle θ. In FIG. 9A, the correction characteristic is such that the rate of change increases from the point where the formed angle θ exceeds a certain threshold value TH. In this way, by correcting the angle information instead of directly correcting the normal, it may be easier to control the characteristics.

さらに、法線ベクトルNと光源ベクトルLのなす角θを補正するのではなく、なす角θに対する反射光量の特性を変更してもよい。図9(B)は法線ベクトルNと光源ベクトルLのなす角θに対する、仮想光源の反射光量特性を示した図である。この反射光量特性を補正することによっても、陰影感を制御することが可能である。例えば、図9(B)に示す反射光量特性から、図9(C)に示す反射光量特性に補正する。これにより、法線ベクトルNと、光源ベクトルLのなす角θが小さい段階から光の反射光量が急激に低下するため、陰影感を強く付けることが可能である。また、図9(C)のようになす角θに対する反射特性を直接制御することで、例えば陰影の勾配や濃さの制御が容易となる。 Further, instead of correcting the angle θ formed by the normal vector N and the light source vector L, the characteristic of the amount of reflected light with respect to the formed angle θ may be changed. FIG. 9B is a diagram showing the reflected light amount characteristics of the virtual light source with respect to the angle θ formed by the normal vector N and the light source vector L. It is also possible to control the feeling of shadow by correcting this reflected light amount characteristic. For example, the reflected light amount characteristic shown in FIG. 9B is corrected to the reflected light amount characteristic shown in FIG. 9C. As a result, the amount of reflected light decreases sharply from the stage where the angle θ formed by the normal vector N and the light source vector L is small, so that it is possible to give a strong sense of shadow. Further, by directly controlling the reflection characteristic with respect to the angle θ formed as shown in FIG. 9C, for example, it becomes easy to control the gradient and the density of the shadow.

また、本実施形態では、1つの照明モードに対して1つの陰影状態が対応付けられており、常に法線補正特性(図8)を用いた法線補正処理を行う場合を例に説明した。しかし、照明モードに対して、適応的に法線補正処理を適用する構成をとってもよい。例えば、システム制御部50は、被写体の顔領域の法線Nと光源ベクトルLのなす角θのヒストグラムを取得し、この分布に応じて法線補正処理を制御してもよい。図10に法線Nと光源ベクトルLのなす角θのヒストグラム例を示す。図10(A)は、なす角θが高い値から低い値まで分布している被写体を示している。なす角θが高い値から低い値まで分布している場合、リライティングによって自然な陰影のグラデーションが付く。一方、図10(B)は、なす角θが低い値に度数が集中している被写体を示している。なす角θが低い値に度数が集中するケースには、被写体そのものがあまり凹凸の少ない顔立ちである場合や、法線の推定精度が荒く、なす角θが高くなるような急な角度の情報が取得しにくい場合がある。一般に、なす角θが図10(B)のように所定の範囲に分布する場合、目的とする照明モードの陰影感をつけることが困難である。そのため、システム制御部50は、(図10(B)のように)なす角θの分布が偏っているか否かを判定し、なす角θの分布が偏っている(B)の場合にのみ、前述した法線の補正を行う構成にしてもよい。これにより、法線の検出精度が低い場合や、顔の凹凸が少ない人物を被写体とする場合であってもメリハリのきいた陰影感のある画像を得ることが可能になる。 Further, in the present embodiment, a case where one shadow state is associated with one lighting mode and the normal correction process always using the normal correction characteristic (FIG. 8) is performed will be described as an example. However, a configuration may be adopted in which the normal correction process is adaptively applied to the illumination mode. For example, the system control unit 50 may acquire a histogram of the angle θ formed by the normal N of the face region of the subject and the light source vector L, and control the normal correction process according to this distribution. FIG. 10 shows an example of a histogram of the angle θ formed by the normal N and the light source vector L. FIG. 10A shows a subject in which the formed angle θ is distributed from a high value to a low value. When the angle θ is distributed from a high value to a low value, rewriting gives a natural gradation of shadows. On the other hand, FIG. 10B shows a subject in which the dioptric power is concentrated on a value having a low angle θ. In the case where the frequency is concentrated on a value with a low angle θ, there is information on a steep angle such that the subject itself has a face with very few irregularities, or the normal estimation accuracy is rough and the angle θ is high. It may be difficult to obtain. Generally, when the formed angle θ is distributed in a predetermined range as shown in FIG. 10 (B), it is difficult to give a shadow feeling of a target lighting mode. Therefore, the system control unit 50 determines whether or not the distribution of the formed angle θ is biased (as shown in FIG. 10B), and only when the distribution of the formed angle θ is biased (B). The configuration may be such that the above-mentioned normal correction is performed. This makes it possible to obtain a crisp and shaded image even when the detection accuracy of the normal line is low or when a person with few irregularities on the face is the subject.

さらに、照明モードに応じた法線補正特性に限らず、陰影感の決定に影響する情報であれば、どのような情報に基づいて法線を補正してもかまわない。例えば、ユーザが陰影を付ける領域、陰影の濃さ、陰影の勾配などにより所望の陰影感を予め指定し、その陰影感の画像が出力できるように法線を補正するようにしてもよい。 Further, the normal is not limited to the normal correction characteristic according to the illumination mode, and the normal may be corrected based on any information as long as the information affects the determination of the shadow feeling. For example, a desired shading feeling may be specified in advance by the user to add a shading area, a shading density, a shading gradient, or the like, and the normal may be corrected so that an image of the shading feeling can be output.

また、本実施形態では、主被写体が人物である場合を例に説明したが、主被写体を人物に限定するものではなく、動物などの他の被写体にも適用可能である。さらに、本実施形態では、陰影を付ける際に元の撮影画像を1/S倍してゲインを落としてから、リライティングによる反射成分を加算する例を説明した。画像信号と反射成分とを加算できればどのような構成であってもかまわない。例えば、仮想光源の反射量が少ない領域(陰影領域)に対して、輝度成分を減算するようにしてもよい。 Further, in the present embodiment, the case where the main subject is a person has been described as an example, but the main subject is not limited to a person, and can be applied to other subjects such as animals. Further, in the present embodiment, an example has been described in which the original captured image is multiplied by 1 / S to reduce the gain when shading, and then the reflection component due to rewriting is added. Any configuration may be used as long as the image signal and the reflection component can be added. For example, the luminance component may be subtracted from the region (shadow region) where the amount of reflection of the virtual light source is small.

以上説明したように、本実施形態では、予め定められた照明モードに応じて法線補正特性を決定すると共に、当該法線補正特性に基づいて被写体の表面形状における法線を補正して、当該表面形状における仮想光源の反射成分を求めるようにした。これにより、単に仮想光源の光線を被写体の表面形状にあてるリライティングを行う場合と比べて、所望の陰影状態を強調したリライティングが可能になる。換言すれば、個々の被写体の形状に応じた、所望の陰影状態を有する画像を生成することが可能になる。 As described above, in the present embodiment, the normal correction characteristic is determined according to the predetermined illumination mode, and the normal in the surface shape of the subject is corrected based on the normal correction characteristic. The reflection component of the virtual light source in the surface shape is calculated. As a result, it is possible to perform rewriting that emphasizes a desired shadow state, as compared with the case where the light beam of the virtual light source is simply applied to the surface shape of the subject. In other words, it is possible to generate an image having a desired shadow state according to the shape of each subject.

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

50…システム制御部、114…リライティング処理部、304…仮想光源付加処理部、307…法線算出部、308…法線補正部、309…反射成分算出部 50 ... System control unit, 114 ... Rewriting processing unit, 304 ... Virtual light source addition processing unit, 307 ... Normal calculation unit, 308 ... Normal correction unit, 309 ... Reflection component calculation unit

Claims (10)

被写体を含んだ画像を取得する第1の取得手段と、
前記被写体の表面の所定の領域の法線情報を取得する第2の取得手段と、
前記法線情報に基づき、前記画像に仮想的な光である仮想光の効果を付与する処理手段と、を有し、
前記処理手段は、前記所定の領域の向きまたは姿勢に応じて、前記第2の取得手段により取得された法線情報を変化させた場合に対応する前記仮想光の効果を付与することを特徴とする画像処理装置。
The first acquisition means for acquiring an image including the subject,
A second acquisition means for acquiring normal information of a predetermined region on the surface of the subject, and
It has a processing means for imparting an effect of virtual light, which is virtual light, to the image based on the normal information.
The processing means is characterized in that it imparts the effect of the virtual light corresponding to the case where the normal information acquired by the second acquisition means is changed according to the orientation or orientation of the predetermined region. Image processing device.
前記処理手段は、前記所定の領域の向きまたは姿勢に応じて、前記第2の取得手段により取得された法線情報を変化させた場合に対応する前記仮想光の効果として、より陰影を強める効果を付与することを特徴とする請求項1に記載の画像処理装置。 The processing means has an effect of further strengthening shadows as an effect of the virtual light corresponding to a case where the normal information acquired by the second acquisition means is changed according to the direction or orientation of the predetermined region. The image processing apparatus according to claim 1, wherein the image processing apparatus is provided. 前記所定の領域は、人物の顔または体であることを特徴とする請求項1または2に記載の画像処理装置。 The image processing apparatus according to claim 1 or 2, wherein the predetermined area is a face or body of a person. 前記処理手段は、前記所定の領域の向きまたは姿勢に応じて前記法線情報を補正することで、前記第2の取得手段により取得された法線情報を変化させた場合に対応する前記仮想光の効果を付与することを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。 The processing means corrects the normal information according to the orientation or orientation of the predetermined region, so that the virtual light corresponding to the case where the normal information acquired by the second acquisition means is changed. The image processing apparatus according to any one of claims 1 to 3, wherein the effect of the above is imparted. 前記処理手段は、前記仮想光の方向と前記法線情報が示す法線がなす角を補正することで、前記第2の取得手段により取得された法線情報を変化させた場合に対応する前記仮想光の効果を付与することを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。 The processing means corresponds to a case where the normal information acquired by the second acquisition means is changed by correcting the angle formed by the direction of the virtual light and the normal indicated by the normal information. The image processing apparatus according to any one of claims 1 to 3, wherein the effect of virtual light is imparted. 前記処理手段は、前記仮想光による前記被写体の反射光量の特性を変更することで、前記第2の取得手段により取得された法線情報を変化させた場合に対応する前記仮想光の効果を付与することを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。 The processing means imparts the effect of the virtual light corresponding to the case where the normal information acquired by the second acquisition means is changed by changing the characteristic of the amount of reflected light of the subject by the virtual light. The image processing apparatus according to any one of claims 1 to 3, wherein the image processing apparatus is used. 前記第1の取得手段は、撮像手段であることを特徴とする請求項1乃至6のいずれか1項に記載の画像処理装置。 The image processing apparatus according to any one of claims 1 to 6, wherein the first acquisition means is an image pickup means. 前記画像の被写体距離情報を取得する第3の取得手段をさらに有し、
前記第2の取得手段は、前記被写体距離情報に基づき前記法線情報を取得することを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。
Further having a third acquisition means for acquiring subject distance information of the image,
The image processing apparatus according to any one of claims 1 to 7, wherein the second acquisition means acquires the normal information based on the subject distance information.
被写体を含んだ画像を取得する第1の取得工程と、
前記被写体の表面の所定の領域の法線情報を取得する第2の取得工程と、
前記法線情報に基づき、前記画像に仮想的な光である仮想光の効果を付与する処理工程と、を有し、
前記処理工程では、前記所定の領域の向きまたは姿勢に応じて、前記第2の取得工程において取得された法線情報を変化させた場合に対応する前記仮想光の効果を付与することを特徴とする画像処理装置の制御方法。
The first acquisition process of acquiring an image including the subject, and
A second acquisition step of acquiring normal information of a predetermined region on the surface of the subject, and
It has a processing step of imparting an effect of virtual light, which is virtual light, to the image based on the normal information.
The processing step is characterized in that the effect of the virtual light corresponding to the case where the normal information acquired in the second acquisition step is changed according to the orientation or orientation of the predetermined region is imparted. Control method of the image processing device.
コンピュータを、請求項1乃至8のいずれか1項に記載の画像処理装置の各手段として機能させるプログラム。 A program that causes a computer to function as each means of the image processing apparatus according to any one of claims 1 to 8.
JP2020168657A 2020-10-05 2020-10-05 Image processing equipment and its control method, program Active JP7011694B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020168657A JP7011694B2 (en) 2020-10-05 2020-10-05 Image processing equipment and its control method, program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020168657A JP7011694B2 (en) 2020-10-05 2020-10-05 Image processing equipment and its control method, program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2016021234A Division JP2017138927A (en) 2016-02-05 2016-02-05 Image processing device, imaging apparatus, control method and program thereof

Publications (2)

Publication Number Publication Date
JP2021005418A true JP2021005418A (en) 2021-01-14
JP7011694B2 JP7011694B2 (en) 2022-01-27

Family

ID=74099409

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020168657A Active JP7011694B2 (en) 2020-10-05 2020-10-05 Image processing equipment and its control method, program

Country Status (1)

Country Link
JP (1) JP7011694B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006077710A1 (en) * 2005-01-19 2006-07-27 Matsushita Electric Industrial Co., Ltd. Image conversion method, texture mapping method, image conversion device, server client system, and image conversion program
JP2008004085A (en) * 2006-05-23 2008-01-10 Matsushita Electric Ind Co Ltd Image processing device, image processing method, program, recording medium and integrated circuit
JP2017138927A (en) * 2016-02-05 2017-08-10 キヤノン株式会社 Image processing device, imaging apparatus, control method and program thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006077710A1 (en) * 2005-01-19 2006-07-27 Matsushita Electric Industrial Co., Ltd. Image conversion method, texture mapping method, image conversion device, server client system, and image conversion program
JP2008004085A (en) * 2006-05-23 2008-01-10 Matsushita Electric Ind Co Ltd Image processing device, image processing method, program, recording medium and integrated circuit
JP2017138927A (en) * 2016-02-05 2017-08-10 キヤノン株式会社 Image processing device, imaging apparatus, control method and program thereof

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
小倉 洋平 YOHEI OGURA: "RGB−Dカメラから得られる法線マップを用いた照明推定とリライティング Illumination Estimation and", 電子情報通信学会技術研究報告 VOL.114 NO.410 IEICE TECHNICAL REPORT, vol. 第114巻, JPN6021036352, 15 January 2015 (2015-01-15), JP, pages 183 - 186, ISSN: 0004599379 *
牧 淳人 ATSUTO MAKI: "光源方向の推定とGeotensity拘束による3次元形状獲得 Estimation of Illuminant Direction and", 電子情報通信学会技術研究報告 VOL.98 NO.395 IEICE TECHNICAL REPORT, vol. 第98巻, JPN6021036357, 13 November 1998 (1998-11-13), JP, pages 71 - 78, ISSN: 0004664945 *

Also Published As

Publication number Publication date
JP7011694B2 (en) 2022-01-27

Similar Documents

Publication Publication Date Title
JP5108093B2 (en) Imaging apparatus and imaging method
JP6442209B2 (en) Image processing apparatus and control method thereof
JP6381404B2 (en) Image processing apparatus and method, and imaging apparatus
JP6412386B2 (en) Image processing apparatus, control method therefor, program, and recording medium
CN110324529B (en) Image processing apparatus and control method thereof
US10863103B2 (en) Setting apparatus, setting method, and storage medium
JP6718253B2 (en) Image processing apparatus and image processing method
JP2021044710A (en) Image processing apparatus, image processing method and program
JP6937603B2 (en) Image processing equipment and its control methods, programs, and storage media
JP2017147568A (en) Image processing apparatus, imaging apparatus, control method, and program
JP2019205055A (en) Image processing apparatus, image processing apparatus control method, and program
JP7277158B2 (en) Setting device and method, program, storage medium
JP7292905B2 (en) Image processing device, image processing method, and imaging device
JP6921606B2 (en) Image processing equipment, image processing methods and programs
JP2017138927A (en) Image processing device, imaging apparatus, control method and program thereof
JP7011694B2 (en) Image processing equipment and its control method, program
JP7398939B2 (en) Image processing device and its control method, imaging device, program, and storage medium
JP2018182700A (en) Image processing apparatus, control method of the same, program, and storage medium
JP2017153045A (en) Image processing apparatus, imaging apparatus, and control method and program for the same
JP7462464B2 (en) Image processing device and method, program, and storage medium
JP2020191546A (en) Image processing apparatus, image processing method, and program
JP7356255B2 (en) Image processing device and its processing method, imaging device, program, storage medium
JP7102192B2 (en) Image processing device, its control method, program
JP7446080B2 (en) Image processing device, imaging device, control method, program and imaging system
US20200051212A1 (en) Image processing apparatus, image processing method, and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201005

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

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210924

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20211122

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: 20211217

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220114