JP7102192B2 - Image processing device, its control method, program - Google Patents

Image processing device, its control method, program Download PDF

Info

Publication number
JP7102192B2
JP7102192B2 JP2018069290A JP2018069290A JP7102192B2 JP 7102192 B2 JP7102192 B2 JP 7102192B2 JP 2018069290 A JP2018069290 A JP 2018069290A JP 2018069290 A JP2018069290 A JP 2018069290A JP 7102192 B2 JP7102192 B2 JP 7102192B2
Authority
JP
Japan
Prior art keywords
shape information
subject
image processing
light source
virtual light
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2018069290A
Other languages
Japanese (ja)
Other versions
JP2019179464A (en
Inventor
光太郎 北島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2018069290A priority Critical patent/JP7102192B2/en
Publication of JP2019179464A publication Critical patent/JP2019179464A/en
Application granted granted Critical
Publication of JP7102192B2 publication Critical patent/JP7102192B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像処理装置に関し、特に仮想光源を用いて画像に効果を付加する画像処理装置に関するものである。 The present invention relates to an image processing device, and more particularly to an image processing device that adds an effect to an image by using a virtual light source.

従来から写真撮影においては、補助照明やレフ板による光の調整によって、被写体に生じる光と影の領域の調整が行われている。これにより、被写体の印象をさまざまに変化させた写真撮影が可能となる。また、これらの光の調整を撮影後に行う技術として、被写体領域に対して、光の反射によるハイライトや陰影成分を加える方法がある。 Conventionally, in photography, the area of light and shadow generated in a subject is adjusted by adjusting the light by an auxiliary lighting or a reflector. This makes it possible to take photographs with various impressions of the subject. Further, as a technique for adjusting these lights after shooting, there is a method of adding highlights and shadow components due to light reflection to the subject area.

これにより、絵画的な印象深い画像にすることや、立体感を強調した画像にすることが可能となる。 This makes it possible to create an impressive pictorial image or an image that emphasizes the stereoscopic effect.

例えば、特許文献1では、被写体の顔領域に対して、予め用意した陰影パターンを当てはめることで、陰影を付与している。これにより、処理負荷を抑えつつ望ましい陰影を持つ被写体写真を得ることができる。 For example, in Patent Document 1, a shadow pattern is applied to a face region of a subject by applying a shadow pattern prepared in advance. As a result, it is possible to obtain a subject photograph having a desirable shadow while suppressing the processing load.

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

しかしながら、上記の特許文献1の方法では、予め用意された陰影パターンを当てはめており、個々の被写体に応じた陰影感の微妙な制御を行うことは難しい。特に予め用意した被写体の表情や形状が、撮影した被写体の表情と大きく異なる場合には、実際に生じるはずの陰影と大きく異なってしまい違和感が生じるという課題があった。 However, in the method of Patent Document 1 described above, a shadow pattern prepared in advance is applied, and it is difficult to delicately control the shadow feeling according to each subject. In particular, when the facial expression or shape of the subject prepared in advance is significantly different from the facial expression of the photographed subject, there is a problem that the shadow is significantly different from the shadow that should actually be generated, causing a sense of discomfort.

本発明に係る画像処理装置は、画像を入力する入力手段と、前記入力手段により入力された入力画像に対する仮想光源の特性を設定する設定手段と、前記入力画像中の被写体から特徴情報を抽出する抽出手段と、所定の被写体の形状情報を示す第1の形状情報と、前記第1の形状情報よりも前記所定の被写体のうち特定の領域における前記形状情報の精度が高い、前記特定の領域の形状情報を示す第2の形状情報とを取得する取得手段と、前記抽出手段により抽出された特徴情報と前記取得手段により取得された前記第2の形状情報とが類似していると判断した場合に、前記第1の形状情報と前記第2の形状情報とに基づき、前記入力画像中の被写体の形状情報として第3の形状情報を生成する生成手段と、前記仮想光源の特性と、前記生成手段により生成された前記形状情報とに基づき、前記入力画像中の被写体に仮想的な光の効果を付加する付加手段とを有することを特徴とする。 The image processing apparatus according to the present invention extracts feature information from an input means for inputting an image, a setting means for setting the characteristics of a virtual light source with respect to the input image input by the input means, and a subject in the input image. The extraction means, the first shape information indicating the shape information of the predetermined subject, and the specific region in which the accuracy of the shape information in the specific region of the predetermined subject is higher than that of the first shape information. When it is determined that the acquisition means for acquiring the second shape information indicating the shape information, the feature information extracted by the extraction means, and the second shape information acquired by the acquisition means are similar. In addition, a generation means for generating a third shape information as the shape information of the subject in the input image based on the first shape information and the second shape information, the characteristics of the virtual light source, and the generation. It is characterized by having an additional means for adding a virtual light effect to the subject in the input image based on the shape information generated by the means.

本発明により、仮想的な光源を被写体に当てる場合に、違和感の少ないハイライトや陰影を付けることが可能となる。 According to the present invention, when a virtual light source is applied to a subject, it is possible to add highlights and shadows with less discomfort.

本発明におけるデジタルカメラの構成を示すブロック図である。It is a block diagram which shows the structure of the digital camera in this invention. 本発明における画像処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the image processing part in this invention. 本発明におけるリライティング処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the rewriting processing part in this invention. 本発明の第1の実施例における法線生成のフローを示す図である。It is a figure which shows the flow of the normal generation in the 1st Example of this invention. 本発明における法線の例を示す図である。It is a figure which shows the example of the normal in this invention. 本発明におけるリライティングによる反射成分の演算を示す図である。It is a figure which shows the calculation of the reflection component by rewriting in this invention. 本発明におけるリライティングの結果を示す図ある。It is a figure which shows the result of rewriting in this invention. 本発明の第2の実施例における法線生成のフローを示す図である。It is a figure which shows the flow of the normal generation in the 2nd Example of this invention. 本発明の第2の実施例における被写体特徴点を説明する図である。It is a figure explaining the subject feature point in the 2nd Example of this invention.

以下に、本発明の好ましい実施の形態を、添付の図面に基づいて詳細に説明する。本実施例では、画像処理装置としてデジタルカメラに適用した例について説明する。 Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In this embodiment, an example applied to a digital camera as an image processing device will be described.

<第1の実施例>
以下、図1~図7を参照して、本発明の第1の実施例におけるデジタルカメラについて説明する。
<First Example>
Hereinafter, the digital camera according to the first embodiment of the present invention will be described with reference to FIGS. 1 to 7.

図1は、本発明の実施形態によるデジタルカメラの構成例を示すブロック図である。 FIG. 1 is a block diagram showing a configuration example of a digital camera according to an embodiment of the present invention.

図1において、100はデジタルカメラ全体、101はズームレンズ、フォーカスレンズを含むレンズ群、102は絞り機能を備えるシャッターである。103は光学像を電気信号に変換するCCDやCMOS素子等で構成される撮像部、104はアナログ信号をデジタル信号に変換するA/D変換器、105はA/D変換器104から出力される画像データに対し、ホワイトバランス処理や、γ処理、輪郭強調、色補正処理などの各種画像処理を行う画像処理部である。106は画像メモリ、107は画像メモリ106を制御するメモリ制御部、108は入力デジタル信号をアナログ信号に変換するD/A変換器、109はLCD等の表示器、110は画像データを圧縮符号化・復号化するコーデック部である。111は記録媒体112とのインタフェースI/F、112はメモリカードやハードディスク等の記録媒体、113は、撮影画像中から顔が映っている領域を検出する顔検出処理部、114は、撮影画像にリライティング処理を行うリライティング処理部、50はデジタルカメラ100のシステム全体を制御するシステム制御部である。121は、プログラムやパラメータなどを格納するEEPROMなどの不揮発性メモリであり、122はシステム制御部50の動作用の定数、変数、不揮発性メモリ124から読みだしたプログラム等を展開するシステムメモリである。123はストロボなどの物理的な光源装置である。なお、デジタルカメラの構成は図1に示した構成には限定されない。例えば1つのハードウェアが、実行するプログラムに応じて複数の処理部や制御部などとして機能してもよい。逆に、複数のハードウェアが協働して1つの処理部や制御部などとして機能してもよい。また、各種の処理はプログラムに従い実行されてもよいし、各種処理を行うための回路を設けてもよい。 In FIG. 1, 100 is the entire digital camera, 101 is a lens group including a zoom lens and a focus lens, and 102 is a shutter having an aperture function. 103 is an image pickup unit composed of a CCD or CMOS element that converts an optical image into an electric signal, 104 is an A / D converter that converts an analog signal into a digital signal, and 105 is output from the A / D converter 104. This is an image processing unit that performs various image processing such as white balance processing, γ processing, contour enhancement, and color correction processing on image data. 106 is an image memory, 107 is a memory control unit that controls the image memory 106, 108 is a D / A converter that converts an input digital signal into an analog signal, 109 is a display such as an LCD, and 110 is a compression codec for image data. -The codec part to be decrypted. 111 is an interface I / F with the recording medium 112, 112 is a recording medium such as a memory card or a hard disk, 113 is a face detection processing unit that detects an area in which a face is reflected in the captured image, and 114 is a captured image. The rewriting processing unit 50 that performs the rewriting processing is a system control unit that controls the entire system of the digital camera 100. 121 is a non-volatile memory such as EEPROM for storing programs and parameters, and 122 is a system memory for expanding constants and variables for operation of the system control unit 50, programs read from the non-volatile memory 124, and the like. .. Reference numeral 123 denotes a physical light source device such as a strobe. The configuration of the digital camera is not limited to the configuration shown in FIG. For example, one piece of hardware may function as a plurality of processing units or control units depending on the program to be executed. On the contrary, a plurality of hardware may cooperate to function as one processing unit, control unit, or the like. Further, various processes may be executed according to a program, or a circuit for performing various processes may be provided.

次に、上記のように構成されたデジタルカメラ100における被写体撮影時の基本動作について説明する。撮像部103は、レンズ101及びシャッター102を介して入射した光を光電変換し、入力画像信号としてA/D変換器104へ出力する。A/D変換器104は撮像部103から出力されるアナログ画像信号をデジタル画像信号に変換し画像処理部105に出力する。 Next, the basic operation at the time of shooting a subject in the digital camera 100 configured as described above will be described. The image pickup unit 103 photoelectrically converts the light incident through the lens 101 and the shutter 102, and outputs the light as an input image signal to the A / D converter 104. The A / D converter 104 converts the analog image signal output from the image pickup unit 103 into a digital image signal and outputs the analog 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 color conversion processing such as white balance, γ processing, contour enhancement processing, and the like on the image data from the A / D converter 104 or the image data from the memory control unit 107. Further, the image processing unit 105 performs a predetermined evaluation value calculation process using the face detection result of the face detection unit 113 and the captured image data, and the system control unit 50 controls the exposure based on the obtained evaluation value result. , Performs distance measurement control. As a result, TTL (through-the-lens) AF (autofocus) processing, AE (autoexposure) processing, AWB (auto white balance) processing, and the like are performed.

画像処理部105から出力された画像データは、メモリ制御部107を介して画像メモリ106に書き込まれる。画像メモリ106は、撮像部103から出力された画像データや、表示部109に表示するための画像データを格納する。 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 the image data output from the imaging unit 103 and the image data to be displayed on the display unit 109.

また、D/A変換器108は、画像メモリ106に格納されている画像表示用のデータをアナログ信号に変換して表示部109に供給する。表示部109は、LCD等の表示器上に、D/A変換器108からのアナログ信号に応じた表示を行う。 Further, the D / A converter 108 converts the image display data stored in the image memory 106 into an analog signal and supplies it to the display unit 109. The display unit 109 displays on a display such as an LCD according to the analog signal from the D / A converter 108.

コーデック部110は、画像メモリ106に記録された画像データをJPEG,MPEGなどの規格に基づきそれぞれ圧縮符号化する。システム制御部50は符号化した画像データを関連付けて、記録インタフェース111を介して記録媒体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 associates the encoded image data and stores it in the recording medium 112 via the recording interface 111.

以上、被写体撮影時の基本動作について説明した。 The basic operation when shooting a subject has been described above.

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

次に、画像処理部105の詳細について図2を用いて説明する。図2は画像処理部105の構成を示すブロック図である。なお、図2、図3に示す構成を実現するための具体的な構成は種々の形態が考えられる。例えば図2、図3に示す1つの部分ごとに1つのハードウェアを用意してもよいし、1つのハードウェアが複数の部分として機能してもよい。また、画像処理部105以外のハードウェアを含む複数のハードウェアが共同して図2、図3に示すいずれかの部分として機能してもよい。 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. In addition, various forms can be considered as a concrete configuration for realizing the configurations shown in FIGS. 2 and 3. For example, one piece of hardware may be prepared for each part shown in FIGS. 2 and 3, or one piece of hardware may function as a plurality of parts. Further, a plurality of hardware including hardware other than the image processing unit 105 may jointly function as any part shown in FIGS. 2 and 3.

図2において、200は同時化処理部、201はWB増幅部、202は輝度・色信号生成部、203は輪郭強調処理部、204は輝度ガンマ処理部、205は色変換処理部、206は色γ処理部、207は色差信号生成部、である。 In FIG. 2, 200 is a simultaneous processing unit, 201 is a WB amplification unit, 202 is a brightness / color signal generation unit, 203 is a contour enhancement processing unit, 204 is a brightness gamma processing unit, 205 is a color conversion processing unit, and 206 is a color. The γ processing unit and 207 are color difference signal generation units.

次に、画像処理部105における処理について説明する。図1のA/D変換部104から入力された画像信号が画像処理部105に入力される。 Next, the processing in the image processing unit 105 will be described. The image signal input from the A / D conversion unit 104 of FIG. 1 is input to the image processing unit 105.

画像処理部105に入力された画像信号は同時化処理部200に入力される。同時化処理部200は入力されたベイヤーRGBの画像データに対して、同時化処理を行い、色信号R,G,Bを生成する。WB増幅部201は、システム制御部50が算出するホワイトバランスゲイン値に基づき、RGBの色信号にゲインをかけ、ホワイトバランスを調整する。WB増幅部201が出力したRGB信号は輝度・色信号生成部202に入力される。輝度・色信号生成部202RGB信号から輝度信号Yを生成し、生成した輝度信号Yを輪郭強調処理部203、色信号RGBを色変換処理部205へ出力する。 The image signal 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. The WB amplification unit 201 applies a gain to the RGB color signal based on the white balance gain value calculated by the system control unit 50 to adjust the white balance. The RGB signal output by the WB amplification unit 201 is input to the luminance / color signal generation unit 202. Luminance / color signal generation unit 202 A luminance signal Y is generated from the RGB signal, the generated luminance signal Y is output to the contour enhancement processing unit 203, and the color signal RGB is output to the color conversion processing unit 205.

輪郭強調処理部203では、輝度信号に対して輪郭強調処理を行い、輝度ガンマ処理部204へ出力する。輝度ガンマ処理部204では輝度信号Yに対してガンマ補正を行い、輝度信号Yを画像メモリ106に出力する。 The contour enhancement processing unit 203 performs contour enhancement processing on the luminance signal and outputs it to the luminance gamma processing unit 204. The luminance gamma processing unit 204 performs gamma correction on the luminance signal Y and outputs the luminance signal Y to the image memory 106.

色変換処理部205は、RGB信号に対するマトリクス演算などにより、所望のカラーバランスへ変換する。色ガンマ処理部206では、RGBの色信号にガンマ補正を行う。色差信号生成部207では、RGB信号から色差信号R-Y、B-Y信号を生成する。 The color conversion processing unit 205 converts the RGB signal into a desired color balance by performing a matrix calculation or the like. The color gamma processing unit 206 performs gamma correction on the RGB color signal. The color difference signal generation unit 207 generates color difference signals RY and BY signals from RGB signals.

画像メモリ106に出力された画像信号Y,R-Y,B-Y信号は、コーデック部110によって圧縮符号化し、記録媒体200に記録する。 The image signals Y, RY, and BY signals output to the image memory 106 are compressed and encoded by the codec unit 110 and recorded on the recording medium 200.

次に、リライティング処理部114の構成および動作について図3を用いて説明する。リライティング処理とは、仮想的な光源を想定し、撮影により得られた画像に仮想光源により照らされた効果を付与する処理である。本実例におけるリライティング処理は、例えば撮影前にリライティング処理を行うかをユーザ操作などに基づき設定しておくことで、撮影時に実行される。もちろん、撮影のたびにリライティング処理を行うかをユーザに確認する構成にしてもよいし、撮影・記録済みの画像に対してユーザが任意のタイミングでリライティング処理を行うよう指示してもよい。 Next, the configuration and operation of the rewriting processing unit 114 will be described with reference to FIG. The rewriting process is a process of assuming a virtual light source and giving an effect illuminated by the virtual light source to the image obtained by shooting. The rewriting process in this example is executed at the time of shooting by setting, for example, whether to perform the rewriting process before shooting based on a user operation or the like. Of course, the configuration may be such that the user is asked whether to perform the rewriting process each time the image is taken, or the user may instruct the photographed / recorded image to perform the rewriting process at an arbitrary timing.

ユーザ操作によりリライティング処理を行うよう選択された場合は、画像処理部105から出力したデータをリライティング処理部114に入力し、仮想光源によるリライティング処理を行う。なお、リライティング処理の中でも、複数のモードを選択できるようにしてもよい。本実施例では、「陰影モード」と「キャッチライトモード」を選択可能とする。これらのモードについては後述する。 When the rewriting process is selected by the user operation, the data output from the image processing unit 105 is input to the rewriting processing unit 114, and the rewriting process is performed by the virtual light source. It should be noted that a plurality of modes may be selected in the rewriting process. In this embodiment, "shadow mode" and "catch light mode" can be selected. These modes will be described later.

図3はリライティング処理部114の構成を示すブロック図である。 FIG. 3 is a block diagram showing the configuration of the rewriting processing unit 114.

図3において、301は入力された輝度・色差信号(Y、B-Y、R-Y)をRGB信号に変換するRGB信号変換部、302はデガンマ処理を行うデガンマ処理部である。303は仮想光源によるリライティング信号を付加する仮想光源付加処理部である。また、304はRGB信号にガンマ特性をかけるガンマ処理部、305は、RGB信号を輝度・色差信号(Y、B-Y、R-Y)に変換する輝度・色差信号変換部である。また、306は被写体の(被写体面に対する)法線を生成する法線生成部、307は仮想光源が被写体に反射した成分を算出する仮想光源反射成分算出部である。 In FIG. 3, 301 is an RGB signal conversion unit that converts input luminance / color difference signals (Y, BY, RY) into RGB signals, and 302 is a degamma processing unit that performs degamma processing. Reference numeral 303 denotes a virtual light source addition processing unit that adds a rewriting signal by the virtual light source. Further, 304 is a gamma processing unit that applies a gamma characteristic to an RGB signal, and 305 is a luminance / color difference signal conversion unit that converts an RGB signal into a luminance / color difference signal (Y, BY, RY). Further, 306 is a normal generation unit that generates a normal line (with respect to the subject surface) of the subject, and 307 is a virtual light source reflection component calculation unit that calculates a component reflected by the virtual light source on the subject.

以下、上記の構成のリライティング処理部114の動作について説明する。リライティング処理部114は、画像メモリ106に記録された輝度・色差信号(Y、B-Y、R-Y)を読み出し、入力とする。 Hereinafter, the operation of the rewriting processing unit 114 having the above configuration will be described. The rewriting processing unit 114 reads out the luminance / color difference signals (Y, BY, RY) recorded in the image memory 106 and uses them as inputs.

RGB信号変換部301は、入力された輝度・色差信号(Y、B-Y、R-Y)をRGB信号に変換し、デガンマ処理部302へ出力する。 The RGB signal conversion unit 301 converts the input luminance / color difference signals (Y, BY, RY) into RGB signals and outputs them to the degamma processing unit 302.

デガンマ処理部302は、画像処理部105のガンマ処理部で掛けられたガンマ特性と逆の特性の演算を行いリニアデータに変換する。デガンマ処理部302は、リニア変換後のRGB信号(Rt、Gt、Bt)を、仮想光源反射成分算出部307および仮想光源付加処理部303に出力する。 The degamma processing unit 302 calculates the gamma characteristic multiplied by the gamma processing unit of the image processing unit 105 and converts it into linear data. The degamma processing unit 302 outputs the RGB signals (Rt, Gt, Bt) after linear conversion to the virtual light source reflection component calculation unit 307 and the virtual light source addition processing unit 303.

一方、法線生成部306は被写体に対応した法線を生成する。法線生成部306で行う法線生成のフローを図4に示す。 On the other hand, the normal generation unit 306 generates a normal corresponding to the subject. FIG. 4 shows a flow of normal generation performed by the normal generation unit 306.

図4において、被写体毎の一般的な法線特性を表すベース法線モデルを読み込む。ベース法線モデルとしては例えば被写体が人間である場合は人型の法線モデルを予め不揮発性メモリ121に記録しておき、被写体に応じたモデルを読み込む。ベースの法線モデルは、法線の解像度(密度)が低く、目や鼻、口などの細部の法線情報を省略したモデルとなっている。法線モデルの例を図5に示す。なお、法線モデルは顔の向きごとに複数記録しておいてもよく、その場合は撮影した被写体から推測した被写体の向きに基づく向きのモデルを読み込む。 In FIG. 4, a base normal model representing general normal characteristics for each subject is read. As the base normal model, for example, when the subject is a human, the human-shaped normal model is recorded in the non-volatile memory 121 in advance, and the model corresponding to the subject is read. The base normal model has a low normal resolution (density) and omits detailed normal information such as eyes, nose, and mouth. An example of the normal model is shown in FIG. A plurality of normal models may be recorded for each face orientation. In that case, a model with an orientation based on the orientation of the subject estimated from the photographed subject is read.

図5において図5(A)は撮影した被写体を示している。図5(B)は人物の顔に対応した法線モデルである。法線モデルは2次元の画像データとして保持しており、各座標位置に対する被写体表面に対する法線ベクトルのデータを持っている。501は法線ベクトルの一例を示している。本実施例のデジタルカメラは、501に示すような法線ベクトルを画素毎に持っているものとする。また、法線モデルには目や口などの特徴点の座標位置も含まれる。例えば502は、目の特徴点の位置を示している。 In FIG. 5, FIG. 5 (A) shows a photographed subject. FIG. 5B is a normal model corresponding to a person's face. The normal model is held as two-dimensional image data, and has normal vector data for the subject surface for each coordinate position. 501 shows an example of a normal vector. It is assumed that the digital camera of this embodiment has a normal vector as shown in 501 for each pixel. The normal model also includes the coordinate positions of feature points such as eyes and mouth. For example, 502 indicates the position of the feature point of the eye.

図4に戻り、ステップS402では主被写体の特徴点の位置情報を抽出し取得する。本実施例では主被写体が人物であるため、人物の特徴点、具体的には顔検出部113(図1)によって検出された顔および、目や口、鼻、輪郭などの顔の特徴点の位置を読み込む。 Returning to FIG. 4, in step S402, the position information of the feature points of the main subject is extracted and acquired. In this embodiment, since the main subject is a person, the feature points of the person, specifically the face detected by the face detection unit 113 (FIG. 1), and the feature points of the face such as eyes, mouth, nose, and contour. Read the position.

ステップS403では、図5(B)に示す法線モデルを、S402で取得した被写体の特徴点に基づきフィッティングさせる。本実施例のフィッティングでは、顔と法線モデルの特徴点の位置を極力一致させるよう、法線モデルを変化させる。具体的には顔の特徴点と法線モデルの特徴点の差が最小になるよう最適化を行い、各画素の変換特性を決定する。なお、撮影画像に形状情報をフィッティングする方法に関しては多数の技術が知られており、フィッティングができるのであれば、それらのどのような手法を用いてもかまわない。ここまでの処理で、被写体にフィッティングされたベース法線モデルが得られる。前述したように、ベース法線モデルは目や鼻、口などの細部の法線情報を省略した精度の低いモデルであるため、比較的被写体形状に近付けられる可能性が高い。しかし、細部についての法線情報は得られないため、以下の処理でこれらの細部の法線モデルを取得する処理を行う。 In step S403, the normal model shown in FIG. 5B is fitted based on the feature points of the subject acquired in S402. In the fitting of this embodiment, the normal model is changed so that the positions of the feature points of the face and the normal model are matched as much as possible. Specifically, optimization is performed so that the difference between the feature points of the face and the feature points of the normal model is minimized, and the conversion characteristics of each pixel are determined. Many techniques are known for fitting the shape information to the captured image, and any of these techniques may be used as long as the fitting can be performed. With the processing up to this point, a base normal model fitted to the subject can be obtained. As described above, since the base normal model is a low-precision model that omits detailed normal information such as eyes, nose, and mouth, it is highly possible that the model is relatively close to the subject shape. However, since the normal information about the details cannot be obtained, the process of acquiring the normal model of these details is performed by the following processing.

ステップS404では、現在のリライティングモードを取得する。リライティングモードとはリライティング処理の効果を決めるモードであり、ユーザ操作によって事前に選択されているものとする。前述したように本実施例では、リライティングモードとして「陰影モード」、「キャッチライトモード」の2つがあるものとする。 In step S404, the current rewriting mode is acquired. The rewriting mode is a mode for determining the effect of the rewriting process, and is assumed to be selected in advance by the user operation. As described above, in this embodiment, it is assumed that there are two rewriting modes, "shadow mode" and "catch light mode".

ステップS405では、リライティングモードに応じて、高解像度法線モデルを取得する。リライティングモードが、「陰影モード」の場合は、「鼻」の高解像度法線パーツを読み込む。高解像度法線パーツとは、より精度の高い高解像度法線モデルのうち、特定の領域(人物であれば特定の器官など)のみを示すモデルである。 In step S405, a high resolution normal model is acquired according to the rewriting mode. When the rewriting mode is "shadow mode", the high resolution normal parts of "nose" are read. The high-resolution normal vector part is a model that shows only a specific area (a specific organ in the case of a person, etc.) among the more accurate high-resolution normal models.

「鼻」の高解像度法線パーツの例を図5(C)に示す。 An example of a high-resolution normal vector part of the “nose” is shown in FIG. 5 (C).

一方で、リライティングモードが「キャッチライトモード」の場合、「眼球」の高解像度法線パーツを読み込む。「眼球」の高解像度法線パーツを図5(D)に示す。 On the other hand, when the rewriting mode is "catch light mode", the high resolution normal parts of the "eyeball" are read. The high-resolution normal vector parts of the "eyeball" are shown in FIG. 5 (D).

図4に戻り、ステップS406では、高解像度法線パーツを被写体にフィッティングし、高解像度法線パーツをベース法線モデルと合成する。本実施例の高解像度法線パーツは、ベース法線と同様にそれぞれ複数の特徴点を含み、この特徴点を対応する被写体の特徴点と一致するようにフィッティングを行う。高解像度法線パーツの特徴点の一例を503、504に示す。また、フィッティング後に高解像度法線パーツをフィッティング済みのベース法線モデルと合成する。ベース法線に「鼻」の高解像度法線パーツを合成した例を図5(E)、「眼球」の高解像度法線パーツを合成した例を図5(F)に示す。このようにすることで、被写体全体のうち、リライティングモードに応じて部分的に解像度の高い法線情報を生成することが可能となる。以上、法線生成部306による法線情報の生成フローについて説明した。 Returning to FIG. 4, in step S406, the high-resolution normal part is fitted to the subject, and the high-resolution normal part is combined with the base normal model. Like the base normal, the high-resolution normal parts of this embodiment each include a plurality of feature points, and fitting the feature points so as to match the feature points of the corresponding subject. Examples of the feature points of the high-resolution normal vector parts are shown in 503 and 504. Also, after fitting, the high resolution normal parts are combined with the fitted base normal model. An example of synthesizing the high-resolution normal parts of the "nose" with the base normal is shown in FIG. 5 (E), and an example of synthesizing the high-resolution normal parts of the "eyeball" is shown in FIG. 5 (F). By doing so, it is possible to partially generate high-resolution normal information according to the rewriting mode of the entire subject. The flow of generating normal information by the normal generator 306 has been described above.

図3の説明に戻る。仮想光源反射成分算出部307では、光源と被写体の距離K、法線情報N、仮想光源の鏡面反射方向S、仮想光源パラメータ、被写体の反射率に基づき、設置した仮想光源が被写体に反射する成分を算出する。なお、仮想光源パラメータおよび被写体の反射率は後述するフローにて決定する。 Returning to the description of FIG. In the virtual light source reflection component calculation unit 307, the component that the installed virtual light source reflects on the subject based on the distance K between the light source and the subject, the normal information N, the specular reflection direction S of the virtual light source, the virtual light source parameter, and the reflectance of the subject. Is calculated. The virtual light source parameter and the reflectance of the subject are determined by the flow described later.

反射光成分の算出方法の具体例を、図6を用いて説明する。図6において601が被写体、602は設定した仮想光源の位置を示している。本実施例では、仮想光源(点光源)の反射成分として拡散反射と鏡面反射を考慮してリライティング処理を行う。 A specific example of the method of calculating the reflected light component will be described with reference to FIG. In FIG. 6, 601 indicates the subject and 602 indicates the position of the set virtual light source. In this embodiment, the rewriting process is performed in consideration of diffuse reflection and specular reflection as the reflection component of the virtual light source (point light source).

カメラ100で撮影された撮影画像の水平画素位置H1(垂直画素位置は説明の簡略化のため省略)における拡散反射成分は、カメラ座標H1における法線N1と仮想光源の方向ベクトルL1の内積に比例し、仮想光源と被写体位置の距離K1の二乗に反比例する値となる。また、鏡面反射成分は、被写体に対する鏡面反射方向Sと被写体位置からカメラの方向V(視線の方向)の内積に比例する。 The diffuse reflection component at the horizontal pixel position H1 (vertical pixel position is omitted for simplification of explanation) of the captured image taken by the camera 100 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. However, the value is inversely proportional to the square of the distance K1 between the virtual light source and the subject position. Further, the specular reflection component is proportional to the inner product of the specular reflection direction S with respect to the subject and the direction V (direction of the line of sight) of the camera from the subject position.

この関係を数式で表現すると仮想光源による被写体反射成分(Ra、Ga、Ba)は下記の通りとなる。 Expressing this relationship with a mathematical formula, the subject reflection components (Ra, Ga, Ba) by the virtual light source are as follows.

Figure 0007102192000001
Figure 0007102192000001

ここで、αは仮想光源の強さ、Lは仮想光源の3次元方向ベクトル、Nは被写体の3次元法線ベクトル、Kは仮想光源と被写体の距離である。また、Sは仮想光源の鏡面反射ベクトル、Vはカメラから被写体位置への方向を示す視線方向ベクトル、kdは被写体の拡散反射率、ksは被写体の鏡面反射率である。また、βは反射した光の広がり具合を示す輝き係数であり、この値が大きくなると鏡面反射特性が急峻になる。Rt、Gt、Btはデガンマ処理部302から出力された撮影RGBデータである。また、Rw、Bwは仮想光源の色を制御するパラメータである。仮想光源は複数設定することも可能であり、仮想光源毎に拡散反射と鏡面反射のパラメータを制御することが可能である。 Here, α is the strength 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 subject, and K is the distance between the virtual light source and the subject. Further, S is the specular reflection vector of the virtual light source, V is the line-of-sight direction vector indicating the direction from the camera to the subject position, kd is the diffuse reflectance of the subject, and ks is the specular reflectance of the subject. Further, β is a brilliance coefficient indicating the degree of spread of the reflected light, and as this value increases, the specular reflection characteristic becomes steep. Rt, Gt, and Bt are captured RGB data output from the degamma processing unit 302. Further, Rw and Bw are parameters for controlling the color of the virtual light source. It is possible to set a plurality of virtual light sources, and it is possible to control the parameters of diffuse reflection and specular reflection for each virtual light source.

なお、仮想光源の強さ、仮想光源の位置、被写体の拡散反射率、被写体の鏡面反射率、輝き係数、仮想光源の色、仮想光の照射範囲の少なくとも1つは、事前にユーザ操作により設定されていてもよいし、デジタルカメラ100が自動的に設定してもよい。例えば、キャッチライトモードであれば被写体の正面に仮想光源の位置を設定し、鏡面反射率や輝き係数を大きく設定することが考えられる。 At least one of the intensity of the virtual light source, the position of the virtual light source, the diffuse reflectance of the subject, the mirror reflectance of the subject, the brilliance coefficient, the color of the virtual light source, and the irradiation range of the virtual light is set in advance by user operation. It may be set automatically by the digital camera 100. For example, in the catch light mode, it is conceivable to set the position of the virtual light source in front of the subject and set a large mirror reflectance and brilliance coefficient.

上記のように算出した仮想光源による反射成分(Ra、Ga、Ba)は仮想光源付加処理部304へ出力される。 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.

仮想光源付加処理部303では、被写体領域に対して、仮想光源成分(Ra、Ga、Ba)を付加する下記の処理を行う。
Rout = Rg + Ra
Gout = Gg + Ga
Bout = Bg + Ba
The virtual light source addition processing unit 303 performs the following processing for adding virtual light source components (Ra, Ga, Ba) to the subject area.
Rout = Rg + Ra
Gout = Gg + Ga
Bout = Bg + Ba

仮想光源付加処理部303から出力された画像信号(Rout、Gout、Bout)はガンマ処理部304に入力される。ガンマ処理部304では、RGBの入力信号にガンマ補正を行う。色差信号生成部305では、RGB信号から輝度Y、色差信号R-Y、B-Y信号を生成する。以上が、リライティング処理部114の動作である。 The image signals (Rout, Gout, Bout) output from the virtual light source addition processing unit 303 are input to the gamma processing unit 304. The gamma processing unit 304 performs gamma correction on the RGB input signal. The color difference signal generation unit 305 generates luminance Y, color difference signals RY, and BY signals from RGB signals. The above is the operation of the rewriting processing unit 114.

システム制御部50は、リライティング補正部114が出力した輝度・色差信号を、メモリ制御部107の制御によって、画像メモリ106に蓄積したのち、コーデック部110で圧縮符号化を行う。また、I/F111を介して記録媒体112に記録する。 The system control unit 50 stores the luminance / color difference signal output by the rewriting correction unit 114 in the image memory 106 under the control of the memory control unit 107, and then compresses and encodes it in the codec unit 110. Further, recording is performed on the recording medium 112 via the I / F 111.

リライティング処理後の結果画像を図7に示す。図7(A)は「陰影モード」で被写体に光を当てた場合の例である。鼻領域の法線の解像度を相対的に高くすることで、顔の陰影において重要な器官である鼻領域に起因する光と陰のコントラストを強くし、陰影を付ける効果を高めることが可能となる。逆に鼻領域以外の領域については法線の解像度を相対的に低くすることで、被写体の形状と法線の形状が異なる事により不自然な陰影やハイライトが付くなどの弊害を低減させることができるようになる。 The result image after the rewriting process is shown in FIG. FIG. 7A is an example in which the subject is illuminated with light in the “shadow mode”. By relatively increasing the resolution of the normal of the nasal region, it is possible to strengthen the contrast between light and shade caused by the nasal region, which is an important organ in the shadow of the face, and enhance the effect of shading. .. On the contrary, by lowering the resolution of the normal for areas other than the nose area, it is possible to reduce adverse effects such as unnatural shadows and highlights due to the difference between the shape of the subject and the shape of the normal. Will be able to.

一方、図7(B)は「キャッチライトモード」で被写体に光を当てた場合の例である。被写体全体を明るくしつつ、眼球の法線の解像度を相対的に高くすることで、701に示すような、はっきりしたキャッチライトを目に入れることが可能となる。逆に眼球領域以外の領域については法線の解像度を相対的に低くすることで、被写体の形状と法線の形状が異なる事により不自然な陰影やハイライトが付くなどの弊害を低減させることができるようになる。 On the other hand, FIG. 7B is an example in which the subject is illuminated with light in the “catch light mode”. By brightening the entire subject and relatively increasing the resolution of the normal of the eyeball, it is possible to see a clear catch light as shown in 701. On the contrary, by making the resolution of the normal line relatively low in the area other than the eyeball area, it is possible to reduce the harmful effects such as unnatural shadows and highlights due to the difference between the shape of the subject and the shape of the normal line. Will be able to.

以上で説明したように、本実施例では、リライティング処理のモードに応じて、部分的に高解像度の法線を生成する構成とした。これにより、実際の被写体と法線の差による弊害を減らしつつ、リライティングの目的にあった効果を得ることが可能となる。 As described above, in this embodiment, the normals having high resolution are partially generated according to the mode of the rewriting process. This makes it possible to obtain an effect suitable for the purpose of rewriting while reducing the harmful effects caused by the difference between the actual subject and the normal.

なお、本実施例はリライティングモードに応じて、部分的に高解像度の法線を生成する構成としたが、高解像度法線の生成を判断する情報をリライティングモード情報に限定するものではない。リライティングモードに限らず、反射光の特性(鏡面反射、拡散反射)、光の照射範囲、強度、光を当てる被写体の種類などリライティングの特性を決めるパラメータであればどのような情報を用いてもかまわない。例えば、リライティングにおいて、鏡面反射成分のゲインを拡散反射と比較して強くしている場合は、「鼻」や「頬」の高解像度法線を追加して、鏡面反射成分によるハイライトの効果を出すように制御することも可能である。また、目だけに光を当てている場合は、「眼球」の高解像度法線を追加してキャッチライトの効果がより強く出るように制御することも可能である。 In this embodiment, the high-resolution normals are partially generated according to the rewriting mode, but the information for determining the generation of the high-resolution normals is not limited to the rewriting mode information. Not limited to the rewriting mode, any information can be used as long as it is a parameter that determines the rewriting characteristics such as the characteristics of reflected light (specular reflection, diffuse reflection), the irradiation range of light, the intensity, and the type of subject to which the light is applied. do not have. For example, in rewriting, if the gain of the specular reflection component is stronger than that of diffuse reflection, add high-resolution normals of "nose" and "cheek" to enhance the highlight effect of the specular reflection component. It is also possible to control it so that it is output. In addition, when the light is applied only to the eyes, it is possible to add a high-resolution normal of the "eyeball" to control the effect of the catch light to be stronger.

また、鏡面反射成分のゲインがほぼ0で、拡散反射成分のゲインが大きい場合には、全体に光が回るように部分的な高解像度の法線付加は行わずベース法線のみで、反射光成分を生成するように制御することも可能である。解像度の低いベース法線を利用することで、陰影の少ない拡散した光を当てる効果を出すことが可能となる。 In addition, when the gain of the specular reflection component is almost 0 and the gain of the diffuse reflection component is large, the reflected light is only the base normal without adding a partial high-resolution normal so that the light can rotate as a whole. It is also possible to control to produce components. By using the base normal with low resolution, it is possible to produce the effect of shining diffused light with less shadow.

また、上記実施例では、リライティングモードが「陰影モード」と「キャッチライトモード」の2つがある場合について説明したが、リライティングモードをこれらに限定するものではない。リライティングモードに応じて、部分的に法線情報を加える(もしくは法線の解像度を高める)方法をとるのであれば、どのようなリライティングモードであってもかまわない。例えば、「唇のツヤを出すモード」を追加し、このモードの場合は、唇の形状の高解像度法線を追加することで、唇に鏡面反射成分を付け、ツヤ(光沢)を出すことが可能となる。 Further, in the above embodiment, the case where there are two rewriting modes, "shadow mode" and "catch light mode", has been described, but the rewriting mode is not limited to these. Any rewriting mode may be used as long as the method of partially adding normal information (or increasing the resolution of the normal) is adopted according to the rewriting mode. For example, by adding a "mode to make the lips glossy" and adding a high-resolution normal of the shape of the lips, it is possible to add a specular reflection component to the lips and make them glossy. It will be possible.

また、本実施例では低解像度の法線モデルに高解像度法線を合成する例を説明したが、高解像度の法線モデルに、鼻や眼球領域を除いた領域の低解像度の法線を合成してもよい。この場合は、被写体全体の法線モデルのうち、一部の法線の解像度を低下させる処理を行うことになる。 Further, in this embodiment, an example of synthesizing a high-resolution normal with a low-resolution normal model has been described, but a low-resolution normal of a region excluding the nose and eyeball regions is synthesized with a high-resolution normal model. You may. In this case, processing is performed to reduce the resolution of some normals in the normal model of the entire subject.

また、本実施例では法線モデルを被写体にフィッティングさせる例について説明したがモデルとして持っておく情報は被写体の形状特性を示すものであればどのような情報であってもかまわない。例えば、被写体の立体形状情報を示す3次元のワイヤーフレーム情報であってもかまわない。この場合、ワイヤーフレームが持つ特徴点の情報を基に被写体にフィッティングし、ワイヤーフレームの各点の角度情報から法線を算出する。 Further, in this embodiment, an example of fitting the normal model to the subject has been described, but the information held as the model may be any information as long as it indicates the shape characteristics of the subject. For example, it may be three-dimensional wire frame information indicating the three-dimensional shape information of the subject. In this case, the subject is fitted based on the information on the feature points of the wire frame, and the normal is calculated from the angle information of each point on the wire frame.

また、本実施例では、法線情報を画像データとして記録している場合について説明したが法線が生成できるのであればこの方法に限定するものではない。例えば、法線モデルの代わりに3次元の立体形状モデルをもっておき3次元の立体形状を被写体にフィッティングさせ、3次元立体形状モデルから法線情報を生成する構成をとってもかまわない。 Further, in this embodiment, the case where the normal vector information is recorded as image data has been described, but the method is not limited to this method as long as the normal vector can be generated. For example, a three-dimensional three-dimensional shape model may be held instead of the normal model, the three-dimensional three-dimensional shape may be fitted to the subject, and the normal information may be generated from the three-dimensional three-dimensional shape model.

<第2の実施例>
以下、図8~9を参照して、本発明の第2の実施例における、デジタルカメラについて説明する。
<Second Example>
Hereinafter, the digital camera according to the second embodiment of the present invention will be described with reference to FIGS. 8 to 9.

第1の実施例では、リライティングのパラメータに基づいて、付加する高解像度の法線情報を選択する例について説明したが、第2の実施例では、被写体と高解像度法線パーツの特徴点の一致度に基づいて、高解像度の法線情報を利用するか否かを決定する。つまり、被写体と高解像度法線パーツの特徴点がある程度類似していると判断すれば、高解像度の法線情報を利用することとする。 In the first embodiment, an example of selecting the high-resolution normal information to be added based on the rewriting parameters has been described, but in the second embodiment, the subject and the feature points of the high-resolution normal parts match. Determine whether to use high resolution normal information based on the degree. That is, if it is determined that the feature points of the subject and the high-resolution normal parts are similar to some extent, the high-resolution normal information is used.

第2の実施例における、デジタルカメラの全体構成は実施例1(図1~図3)で説明したものと同様であるため、説明は省略する。第2の実施例では、法線生成部(図3の306)が法線を生成するフローが実施例1と異なるため、図8を用いて、法制生成部306の動作フローについて詳細を説明する。 Since the overall configuration of the digital camera in the second embodiment is the same as that described in the first embodiment (FIGS. 1 to 3), the description thereof will be omitted. In the second embodiment, since the flow in which the normal generation unit (306 in FIG. 3) generates a normal is different from that in the first embodiment, the operation flow of the legal system generation unit 306 will be described in detail with reference to FIG. ..

図8において、S801~S803ではベース法線モデルを読み込み、ベース法線を被写体にフィッティングする。この処理は、図4のS401~403と同じであるため、説明は省略する。 In FIG. 8, in S801 to S803, the base normal model is read and the base normal is fitted to the subject. Since this process is the same as S401 to 403 in FIG. 4, the description thereof will be omitted.

ステップS804では、複数ある高解像度法線パーツの中から一つを読み込む。高解像度法線パーツとしては、「眼球」「鼻」「口」「頬」などを用意しておき順に読み込む。本実施例では、最初に「口」の法線を読み込む場合を例に説明する。 In step S804, one of a plurality of high-resolution normal vector parts is read. As high-resolution normal vector parts, prepare "eyeball", "nose", "mouth", "cheek", etc. and read them in order. In this embodiment, the case where the normal of the "mouth" is first read will be described as an example.

ステップS805では、被写体の特徴点と、法線パーツが持つ特徴点の位置関係の比較を行う。これについて図9に被写体および法線の例を用いて説明する。図9(A)(B)はそれぞれ撮影した被写体像を示している。図9において、白丸の901および902は「口」の特徴点の位置である。また、図9(B)はベース法線および高解像度の「口」の法線を示している。903は法線における「口」の特徴点の位置を示している。 In step S805, the positional relationship between the feature points of the subject and the feature points of the normal parts is compared. This will be described with reference to FIG. 9 using an example of a subject and a normal. 9 (A) and 9 (B) show photographed subject images, respectively. In FIG. 9, white circles 901 and 902 are the positions of the feature points of the "mouth". Also, FIG. 9B shows the base normal and the high resolution "mouth" normal. 903 indicates the position of the "mouth" feature point on the normal.

このとき、法線の特徴点と撮影した被写体の特徴点の形状の比較を行う。例えば図9の例の場合、撮影した被写体の口の特徴点901と法線の特徴点903とを比較する。比較の手法は口の両端の特徴点の距離でサイズを正規化した後に、撮影画像の特徴点901、902と法線の特徴点903の間の相対距離を算出する。全ての特徴点間の距離の総和が所定の閾値以下の場合は、撮影画像の特徴点の形状が法線と同じと判断する。閾値以上の場合は、撮影画像と法線の形状が異なると判断する。901、902の例の場合、法線の特徴点の形状は「口」が閉じている。そのため、同じように「口」が閉じている法線の特徴点903は法線と形状が同じと判断する。一方、「口」が開いている902の場合は被写体の特徴点902と法線の特徴点903は形状が異なると判断する。 At this time, the shapes of the feature points of the normal and the feature points of the photographed subject are compared. For example, in the case of the example of FIG. 9, the feature point 901 of the mouth of the photographed subject and the feature point 903 of the normal line are compared. The comparison method normalizes the size by the distance between the feature points at both ends of the mouth, and then calculates the relative distance between the feature points 901 and 902 of the captured image and the feature points 903 of the normal. When the sum of the distances between all the feature points is equal to or less than a predetermined threshold value, it is determined that the shape of the feature points in the captured image is the same as the normal. If it is equal to or more than the threshold value, it is judged that the shape of the photographed image and the normal line are different. In the case of the examples 901 and 902, the shape of the feature points of the normal is closed at the "mouth". Therefore, it is determined that the feature point 903 of the normal with the "mouth" closed in the same manner has the same shape as the normal. On the other hand, in the case of 902 with the "mouth" open, it is determined that the feature points 902 of the subject and the feature points 903 of the normal have different shapes.

ステップS806では、ステップS805で被写体と法線の特徴点の形状が同じと判断した場合は、ステップS807へ進み、被写体と法線の特徴点の形状が異なると判断した場合は、ステップS807をスキップしてステップS808へ進む。 In step S806, if it is determined in step S805 that the shapes of the feature points of the subject and the normal are the same, the process proceeds to step S807, and if it is determined that the shapes of the feature points of the subject and the normal are different, step S807 is skipped. Then, the process proceeds to step S808.

ステップS807では、高解像度の法線(例えば口の高解像度法線)を被写体にフィッティングし、ベース法線と合成する。この処理は図4の406の処理と同じである。 In step S807, a high-resolution normal (for example, a high-resolution normal of the mouth) is fitted to the subject and combined with the base normal. This process is the same as the process of 406 in FIG.

ステップS808では、全ての高解像度法線パーツを処理したかを判断する。上記は高解像度法線が「口」の場合を例に説明したが、高解像度法線パーツは「口」以外にも「眼球(目)」や「鼻」、など複数ある。これら、すべての高解像度法線パーツを同様に処理するまでステップS804に戻って繰り返す。 In step S808, it is determined whether all the high resolution normal vector parts have been processed. The above has been described by taking the case where the high-resolution normal vector is the "mouth" as an example, but there are multiple high-resolution normal vector parts such as "eyeball (eye)" and "nose" in addition to the "mouth". The process returns to step S804 and repeats until all these high-resolution normal vector parts are processed in the same manner.

以上説明した通り、本実施例ではリライティング処理を行う場合に、高解像度法線パーツと被写体の特徴点を比較し、特徴点の形状が近い高解像度法線パーツのみを利用する構成とした。これにより、被写体の形状と法線の形状が異なる事により不自然な陰影やハイライトが付くなどの弊害を低減させることができるようになる。 As described above, in this embodiment, when the rewriting process is performed, the high-resolution normal parts and the feature points of the subject are compared, and only the high-resolution normal parts having similar shapes of the feature points are used. As a result, it is possible to reduce adverse effects such as unnatural shadows and highlights due to the difference between the shape of the subject and the shape of the normal.

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

Claims (14)

画像を入力する入力手段と、
前記入力手段により入力された入力画像に対する仮想光源の特性を設定する設定手段と、
前記入力画像中の被写体から特徴情報を抽出する抽出手段と、
所定の被写体の形状情報を示す第1の形状情報と、前記第1の形状情報よりも前記所定の被写体のうち特定の領域における前記形状情報の精度が高い、前記特定の領域の形状情報を示す第2の形状情報とを取得する取得手段と、
前記抽出手段により抽出された特徴情報と前記取得手段により取得された前記第2の形状情報とが類似していると判断した場合に、前記第1の形状情報と前記第2の形状情報とに基づき、前記入力画像中の被写体の形状情報として第3の形状情報を生成する生成手段と、
前記仮想光源の特性と、前記生成手段により生成された前記形状情報とに基づき、前記入力画像中の被写体に仮想的な光の効果を付加する付加手段とを有することを特徴とする画像処理装置。
Input means for inputting images and
A setting means for setting the characteristics of the virtual light source with respect to the input image input by the input means, and
An extraction means for extracting feature information from a subject in the input image, and
The first shape information indicating the shape information of a predetermined subject and the shape information of the specific region in which the accuracy of the shape information in a specific region of the predetermined subject is higher than that of the first shape information are shown. An acquisition means for acquiring the second shape information,
When it is determined that the feature information extracted by the extraction means and the second shape information acquired by the acquisition means are similar, the first shape information and the second shape information are added. Based on this, a generation means for generating a third shape information as the shape information of the subject in the input image, and
An image processing apparatus comprising: an additional means for adding a virtual light effect to a subject in the input image based on the characteristics of the virtual light source and the shape information generated by the generation means. ..
前記形状情報は、被写体面に対する法線情報もしくは立体形状情報であることを特徴とする請求項1に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the shape information is normal information or three-dimensional shape information with respect to a subject surface. 前記生成手段は、被写体領域のうちいずれを特定の領域とするかを前記仮想光源の特性に基づいて判断することを特徴とする請求項1または2に記載の画像処理装置。 The image processing apparatus according to claim 1 or 2, wherein the generation means determines which of the subject areas is to be a specific area based on the characteristics of the virtual light source. 前記特定の領域は、人物の鼻を示す領域であることを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。 The image processing apparatus according to any one of claims 1 to 3, wherein the specific region is a region showing a person's nose. 前記特定の領域は、人物の眼を示す領域であることを特徴とする請求項1または3に記載の画像処理装置。 The image processing apparatus according to claim 1 or 3, wherein the specific region is a region showing a person's eyes. 前記特定の領域は、人物の唇を示す領域であることを特徴とする請求項1または3に記載の画像処理装置。 The image processing apparatus according to claim 1 or 3, wherein the specific region is a region showing the lips of a person. 前記仮想光源の特性とは、前記仮想的な光を照射することによる効果を示すモードであることを特徴とする請求項1に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the characteristic of the virtual light source is a mode showing an effect by irradiating the virtual light. 前記モードは、前記入力画像内の人物に陰影を付加する第1のモードを含み、
前記第1のモードにおいて、前記第2の形状情報は人物の鼻を示す領域の形状情報を示すことを特徴とする請求項7に記載の画像処理装置。
The mode includes a first mode of adding a shadow to a person in the input image.
The image processing apparatus according to claim 7, wherein in the first mode, the second shape information indicates the shape information of a region indicating a person's nose.
前記モードは、前記入力画像内の人物の眼にキャッチライトの効果を付加する第2のモードを含み、
前記第2のモードにおいて、前記第2の形状情報は人物の眼を示す領域の形状情報を示すことを特徴とする請求項8に記載の画像処理装置。
The mode includes a second mode that adds a catch light effect to the eyes of a person in the input image.
The image processing apparatus according to claim 8, wherein in the second mode, the second shape information indicates the shape information of a region showing a person's eyes.
前記モードは、前記入力画像内の人物の唇に光沢を付加する第3のモードを含み、
前記第3のモードにおいて、前記第2の形状情報は、人物の唇を示す領域の形状情報を示すことを特徴とする請求項9に記載の画像処理装置。
The mode includes a third mode of adding luster to the lips of a person in the input image.
The image processing apparatus according to claim 9, wherein in the third mode, the second shape information indicates the shape information of a region indicating a person's lips.
前記仮想光源の特性は、仮想光源の位置、強度、照射範囲、光源の色、被写体の反射特性いずれかを含む情報であることを特徴とする請求項1乃至10のいずれか1項に記載の画像処理装置。 The item according to any one of claims 1 to 10, wherein the characteristic of the virtual light source is information including any one of a position, an intensity, an irradiation range, a color of the light source, and a reflection characteristic of a subject of the virtual light source. Image processing device. 前記生成手段は、前記第2の形状情報と前記抽出手段により抽出された特徴情報とが類似していないと判断された場合、前記第2の形状情報を用いて前記入力画像中の被写体の形状情報を生成しないことを特徴とする請求項1乃至11のいずれか1項に記載の画像処理装置。 When the generation means determines that the second shape information and the feature information extracted by the extraction means are not similar, the shape of the subject in the input image is formed by using the second shape information. The image processing apparatus according to any one of claims 1 to 11, wherein no information is generated. 画像を入力する入力工程と、
前記入力工程で入力された入力画像に対する仮想光源の特性を設定する設定工程と、
前記入力画像中の被写体から特徴情報を抽出する抽出工程と、
所定の被写体の形状情報を示す第1の形状情報と、前記第1の形状情報よりも前記所定の被写体のうち特定の領域における前記形状情報の精度が高い、前記特定の領域の形状情報を示す第2の形状情報とを取得する取得工程と、
前記抽出工程で抽出された特徴情報と前記第2の形状情報が類似していると判断した場
合に、前記第1の形状情報と前記第2の形状情報とに基づき、前記入力画像中の被写体の形状情報として第3の形状情報を生成する生成工程と、
前記仮想光源の特性と、前記生成工程で生成された前記形状情報とに基づき、前記入力画像中の被写体に仮想的な光の効果を付加する付加工程とを有することを特徴とする画像処理装置の制御方法。
The input process for inputting images and
A setting process for setting the characteristics of the virtual light source with respect to the input image input in the input process, and a setting process.
An extraction process that extracts feature information from the subject in the input image,
The first shape information indicating the shape information of a predetermined subject and the shape information of the specific region in which the accuracy of the shape information in a specific region of the predetermined subject is higher than that of the first shape information are shown. The acquisition process for acquiring the second shape information and
When it is determined that the feature information extracted in the extraction step and the second shape information are similar, the subject in the input image is based on the first shape information and the second shape information. And a generation process that generates a third shape information as the shape information of
An image processing apparatus comprising: an additional step of adding a virtual light effect to a subject in the input image based on the characteristics of the virtual light source and the shape information generated in the generation step. Control method.
コンピュータを、請求項1乃至12のいずれか1項に記載の画像処理装置として機能させるコンピュータが実行可能な画像処理装置。 An image processing device that can be executed by a computer that causes the computer to function as the image processing device according to any one of claims 1 to 12.
JP2018069290A 2018-03-30 2018-03-30 Image processing device, its control method, program Active JP7102192B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018069290A JP7102192B2 (en) 2018-03-30 2018-03-30 Image processing device, its control method, program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018069290A JP7102192B2 (en) 2018-03-30 2018-03-30 Image processing device, its control method, program

Publications (2)

Publication Number Publication Date
JP2019179464A JP2019179464A (en) 2019-10-17
JP7102192B2 true JP7102192B2 (en) 2022-07-19

Family

ID=68278745

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018069290A Active JP7102192B2 (en) 2018-03-30 2018-03-30 Image processing device, its control method, program

Country Status (1)

Country Link
JP (1) JP7102192B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017147568A (en) 2016-02-16 2017-08-24 キヤノン株式会社 Image processing apparatus, imaging apparatus, control method, and program
JP2017204673A (en) 2016-05-09 2017-11-16 キヤノン株式会社 Image processing system, image processing method and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017147568A (en) 2016-02-16 2017-08-24 キヤノン株式会社 Image processing apparatus, imaging apparatus, control method, and program
JP2017204673A (en) 2016-05-09 2017-11-16 キヤノン株式会社 Image processing system, image processing method and program

Also Published As

Publication number Publication date
JP2019179464A (en) 2019-10-17

Similar Documents

Publication Publication Date Title
JP6700840B2 (en) Image processing device, imaging device, control method, and program
JP6442209B2 (en) Image processing apparatus and control method thereof
JP5743696B2 (en) Image processing apparatus, image processing method, and program
JP6193721B2 (en) Image processing apparatus, image processing method, program, and storage medium
JP6381404B2 (en) Image processing apparatus and method, and imaging apparatus
JP2016213718A (en) Image processing apparatus, image processing method, program, and storage medium
CN109639959B (en) Image processing apparatus, image processing method, and recording medium
JP2016208098A (en) Image processor, image processing method, and program
JP6412386B2 (en) Image processing apparatus, control method therefor, program, and recording medium
JP2018163648A (en) Image processor, method for image processing, and program
JP7301683B2 (en) Image processing device, image processing method, and program
JP7059076B2 (en) Image processing device, its control method, program, recording medium
JP7114335B2 (en) IMAGE PROCESSING DEVICE, CONTROL METHOD FOR IMAGE PROCESSING DEVICE, AND PROGRAM
JP7292905B2 (en) Image processing device, image processing method, and imaging device
JP7102192B2 (en) Image processing device, its control method, program
JP6896811B2 (en) Image processing equipment, image processing methods, and programs
CN111083345B (en) Apparatus and method for generating a unique illumination and non-volatile computer readable medium thereof
WO2020084894A1 (en) Multi-camera system, control value calculation method and control device
WO2018180860A1 (en) Image processing device, image processing method, and program
JP2017138927A (en) Image processing device, imaging apparatus, control method and program thereof
JP7462464B2 (en) Image processing device and method, program, and storage medium
JP7011694B2 (en) Image processing equipment and its control method, program
JP2019149719A (en) Image processing apparatus and method, and imaging apparatus
JP7169841B2 (en) IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM
US11842467B2 (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: 20210324

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20211129

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20211207

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220202

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220315

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220506

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220706

R151 Written notification of patent or utility model registration

Ref document number: 7102192

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151