JP2001084362A - Method and device for estimating light source direction and three-dimensional shape and recording medium - Google Patents

Method and device for estimating light source direction and three-dimensional shape and recording medium

Info

Publication number
JP2001084362A
JP2001084362A JP2000157228A JP2000157228A JP2001084362A JP 2001084362 A JP2001084362 A JP 2001084362A JP 2000157228 A JP2000157228 A JP 2000157228A JP 2000157228 A JP2000157228 A JP 2000157228A JP 2001084362 A JP2001084362 A JP 2001084362A
Authority
JP
Japan
Prior art keywords
light source
dimensional shape
cosine
estimating
measurement point
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
JP2000157228A
Other languages
Japanese (ja)
Other versions
JP4213327B2 (en
Inventor
Satoru Osawa
哲 大沢
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.)
Fujifilm Holdings Corp
Original Assignee
Fuji Photo Film Co Ltd
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 Fuji Photo Film Co Ltd filed Critical Fuji Photo Film Co Ltd
Priority to JP2000157228A priority Critical patent/JP4213327B2/en
Publication of JP2001084362A publication Critical patent/JP2001084362A/en
Application granted granted Critical
Publication of JP4213327B2 publication Critical patent/JP4213327B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To estimate the direction of a light source and the three-dimensional shape of an object from an image obtained by photographing the object under a single light source. SOLUTION: In the image including the face of a human being, two-dimensional image data S0 for indicating the image of a face part and three-dimensional shape data S1 for indicating the three-dimensional shape of the face are positioned. After positioning, plural measurement points are set on the three-dimensional shape data S1. Plural virtual light sources are set, the cosine of a direction vector to the respective measurement points and a normal vector at the respective measurement points is obtained for the respective virtual light sources and the relation of it and the data value of the two-dimensional image data S0 at the respective measurement points is plotted. Then, the direction of the virtual light source for which the relation becomes a straight line is defined as a temporary light source direction at the time of photographing. The three-dimensional shape data S1 are corrected so as to position a plot on the straight line based on the temporary light source direction and the correction of the temporary light source direction and the three-dimensional shape data is repeated after the correction. Thus, the light source direction at the time of photographing and the three-dimensional shape of the object are estimated.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、単一の光源を用い
て物体を撮影を行うことにより得られた画像から、撮影
時の光源の方向と物体の3次元形状とを推定する推定方
法および装置並びに推定方法をコンピュータに実行させ
るためのプログラムを記録したコンピュータ読取り可能
な記録媒体に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an estimation method for estimating the direction of a light source at the time of photographing and the three-dimensional shape of the object from an image obtained by photographing the object using a single light source. The present invention relates to a computer-readable recording medium on which a program for causing a computer to execute an apparatus and an estimation method is recorded.

【0002】[0002]

【従来の技術】実画像とコンピュータグラフィックス
(CG)のような仮想画像とを違和感なく合成するため
の技術は複合現実感技術と称され、通信、交通、娯楽等
種々の分野において重要な役割を果たすものとして期待
されている。このように実画像と仮想画像とを違和感な
く合成するためには、幾何学的、光学的および時間的な
整合性を持ってこれらを合成する必要がある。特に光学
的整合性については、実画像における光源の方向および
強度と仮想画像における光源の方向および強度とを一致
させないと、合成画像が非常に違和感のあるものとなる
ため、極めて重要である。このため、画像中における光
源の強度分布を推定するための方法が提案されている
(佐藤ら、実物体のソフトシャドウに基づく実照明環境
の推定、コンピュータビジョンとイメージメディア、11
0-3,1998.3.19、PP17-24)。
2. Description of the Related Art A technique for synthesizing a real image with a virtual image such as computer graphics (CG) without discomfort is called mixed reality technology, and plays an important role in various fields such as communication, traffic, and entertainment. It is expected to fulfill. Thus, in order to combine the real image and the virtual image without discomfort, it is necessary to combine them with geometric, optical and temporal consistency. In particular, regarding the optical consistency, unless the direction and intensity of the light source in the real image and the direction and intensity of the light source in the virtual image are made to coincide with each other, the synthesized image will be very uncomfortable, so that it is extremely important. Therefore, a method for estimating the intensity distribution of a light source in an image has been proposed (Sato et al., Estimation of Real Illumination Environment Based on Soft Shadow of Real Object, Computer Vision and Image Media, 11
0-3, 1998.3.19, PP17-24).

【0003】この方法は、実物体のソフトシャドウに基
づいて、環境照明の強度分布を推定する方法であり、画
像中にある3次元形状が既知の物体の影を用いて、環境
照明の強度分布の推定を行っている。具体的には、仮想
的な光源の明るさと、物体上のある測定点におけるデー
タ値との関係を行列式にて表し、この行列式におけるマ
トリクスの逆行列を求めることにより、光源の強度分布
を推定するものである。そして、このような方法により
画像中の光源の強度分布を推定すれば、仮想画像におけ
る光源の強度分布を実画像における光源の強度分布と一
致させることができるため、実画像と仮想画像とを違和
感なく合成することができる。
[0003] This method is a method of estimating the intensity distribution of environmental illumination based on a soft shadow of a real object. The intensity distribution of environmental illumination is estimated by using the shadow of an object having a known three-dimensional shape in an image. Estimation. Specifically, the relationship between the brightness of the virtual light source and the data value at a certain measurement point on the object is represented by a determinant, and the intensity distribution of the light source is obtained by calculating the inverse matrix of the matrix in the determinant. It is an estimate. Then, by estimating the intensity distribution of the light source in the image by such a method, the intensity distribution of the light source in the virtual image can be matched with the intensity distribution of the light source in the real image. It can be synthesized without any.

【0004】また、イメージペースト的な手法により、
任意の光源方向から照明された物体画像を生成する方法
も提案されている(池内克史、仮想現実感モデルの自動
生成:光学的側面、信学技法、PRMU98-122(1998-11)、P
P75-82)。この方法は、光源を複数方向に変更して物体
を撮影した複数のサンプル画像の線形和として、任意の
光源方向から照明された画像を作成する方法である。
[0004] Further, by an image paste method,
A method for generating an object image illuminated from an arbitrary light source direction has also been proposed (Katsushi Ikeuchi, Automatic Generation of Virtual Reality Models: Optical Aspects, Faculty of Science, PRMU98-122 (1998-11), P
P75-82). This method is a method of creating an image illuminated from an arbitrary light source direction as a linear sum of a plurality of sample images obtained by photographing an object by changing a light source in a plurality of directions.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、上記佐
藤らの方法は、測定点の位置を逆行列を算出可能な、数
学的に1次独立となる位置に設定する必要があり、この
ような測定点の位置をマニュアル操作により求める必要
があることから、操作が非常に煩わしい。また、物体の
3次元形状が既知である必要もある。さらに、上記池内
の方法は、対象となる物体に対して予め80もの光源方
向から撮影された画像を作成する必要があるため、演算
に非常に長時間を要することから現実的な手法ではな
い。
However, according to the method of Sato et al., It is necessary to set the position of the measurement point to a position that can be calculated inversely and that is mathematically linearly independent. The operation is very troublesome because the position of the point needs to be determined manually. Also, the three-dimensional shape of the object needs to be known. Further, the method in the pond described above is not a practical method because it requires a very long time to perform an operation because an image of a target object taken in advance from as many as 80 light source directions must be created.

【0006】本発明は上記事情に鑑みなされたものであ
り、光源の方向および物体の3次元形状を簡易に推定す
ることができる推定方法および装置並びに推定方法をコ
ンピュータに実行させるためのプログラムを記録したコ
ンピュータ読取り可能な記録媒体を提供することを目的
とするものである。
The present invention has been made in view of the above circumstances, and has an estimation method and apparatus capable of easily estimating the direction of a light source and the three-dimensional shape of an object, and records a program for causing a computer to execute the estimation method. It is an object of the present invention to provide a computer-readable recording medium according to the present invention.

【0007】[0007]

【課題を解決するための手段】本発明による光源方向と
物体の3次元形状との推定方法は、表面反射率が略一定
である部分を含む3次元形状を有する物体を、実質的な
単一光源下において撮影することにより得られる画像に
基づいて、前記光源の方向と前記物体の3次元形状とを
推定する推定方法であって、前記画像上における前記物
体の画像を表す物体画像データのデータ値、および該物
体画像データと該物体の一般的な3次元形状を表す3次
元形状データとの位置合わせを行った後の前記3次元形
状データにより表される近似物体と、任意の複数方向に
設定した仮想光源との位置関係に基づいて、前記光源の
方向と前記物体の3次元形状とを推定することを特徴と
するものである。
SUMMARY OF THE INVENTION A method for estimating the direction of a light source and the three-dimensional shape of an object according to the present invention comprises: An estimation method for estimating a direction of the light source and a three-dimensional shape of the object based on an image obtained by capturing an image under a light source, the object image data representing an image of the object on the image. Values, and an approximate object represented by the three-dimensional shape data after the object image data is aligned with three-dimensional shape data representing a general three-dimensional shape of the object, and in an arbitrary plurality of directions. The direction of the light source and the three-dimensional shape of the object are estimated based on the set positional relationship with the virtual light source.

【0008】ここで、「実質的な単一光源において撮影
する」とは、晴天における太陽光の下で撮影を行った場
合のように、他の光源の存在を無視することができ、単
一の光源のみを用いたに略等しい状況で撮影を行うこと
をいう。
[0008] Here, "shooting with a substantially single light source" means that the presence of other light sources can be ignored, as in the case of shooting under sunlight in fine weather. This means that shooting is performed in a situation substantially equivalent to using only the light source.

【0009】また、例えば物体を人物の顔とした場合
に、顔の形状は人によって異なるが、どのような顔の形
状であっても概略一致するような形状が存在する。した
がって、ここでは、このような物体の形状と概略一致す
る3次元形状を表す3次元形状データを、「一般的な3
次元形状を表す3次元形状データ」とする。
Further, for example, when the object is a person's face, the shape of the face varies from person to person, but there is a shape that almost matches any shape of the face. Therefore, here, three-dimensional shape data representing a three-dimensional shape that roughly matches the shape of such an object is referred to as “general 3D shape data”.
Three-dimensional shape data representing a three-dimensional shape ".

【0010】なお、人物の顔の肌色は、表面反射率が略
一定であると見なせるものである。
The skin color of a person's face can be regarded as having a substantially constant surface reflectance.

【0011】また、物体画像データと3次元形状データ
との位置合わせは、画像中における物体の向きと物体の
3次元形状の向き、中心位置、2次元方向すなわち物体
画像データが存在する方向におけるサイズ等が一致する
ように、3次元形状データと物体画像データとをマッチ
ングさせることをいう。このようなマッチングにより、
3次元形状データは物体画像データと2次元方向におい
てのみ位置が合わせられており、本発明においては、こ
のように位置が合わせられた3次元形状データにより表
される物体の形状を近似物体とするものである。
The alignment between the object image data and the three-dimensional shape data is performed by adjusting the orientation of the object in the image, the orientation of the three-dimensional shape of the object, the center position, the two-dimensional direction, that is, the size in the direction in which the object image data exists. This means that the three-dimensional shape data and the object image data are matched so that the data and the like match. With such matching,
The position of the three-dimensional shape data is aligned only with the object image data in the two-dimensional direction. In the present invention, the shape of the object represented by the three-dimensional shape data aligned as described above is regarded as an approximate object. Things.

【0012】なお、本発明による推定方法においては、
前記近似物体上における前記物体の前記表面反射率が略
一定である部分に対応する部分に複数の測定点を設定
し、前記任意の複数方向に設定した仮想光源から前記複
数の測定点へ向かう方向ベクトルと、該複数の測定点に
おける法線ベクトルとのなす余弦を算出し、該余弦と、
前記複数の測定点に対応する前記物体画像データのデー
タ値との関係を前記複数の仮想光源の方向毎にプロット
し、前記プロットが略直線となる仮想光源の方向を仮の
光源方向と推定し、前記仮の光源方向を求めたプロット
が前記直線上に位置するように、該プロットにおける前
記余弦を修正し、前記測定点における前記方向ベクトル
と前記法線ベクトルとのなす余弦が、前記修正された余
弦に近づくように該測定点の位置を修正して修正測定点
を取得し、該修正測定点を新たな前記測定点とする前記
余弦の算出、前記プロット、前記仮の光源方向の推定、
前記余弦の修正および前記修正測定点の取得を所定回数
繰り返し、該繰り返し処理の結果得られる前記仮の光源
方向を前記光源の方向と推定し、該繰り返し処理の結果
得られる修正測定点の位置により定められる形状を、前
記物体の3次元形状と推定することが好ましい。
In the estimation method according to the present invention,
A plurality of measurement points are set at a portion corresponding to a portion where the surface reflectance of the object on the approximate object is substantially constant, and a direction from the virtual light source set in the arbitrary plurality of directions to the plurality of measurement points Calculating a cosine between the vector and the normal vector at the plurality of measurement points;
The relationship between the data values of the object image data corresponding to the plurality of measurement points is plotted for each direction of the plurality of virtual light sources, and the direction of the virtual light source in which the plot is substantially straight is estimated as a temporary light source direction. Correcting the cosine of the plot so that the plot obtained for the provisional light source direction is located on the straight line, and the cosine between the direction vector and the normal vector at the measurement point is corrected. Correcting the position of the measurement point so as to approach the cosine to obtain a corrected measurement point, calculating the cosine with the corrected measurement point as the new measurement point, the plot, estimating the temporary light source direction,
The correction of the cosine and the acquisition of the corrected measurement point are repeated a predetermined number of times, the temporary light source direction obtained as a result of the repetition processing is estimated as the direction of the light source, and the position of the correction measurement point obtained as a result of the repetition processing is determined. Preferably, the determined shape is estimated as a three-dimensional shape of the object.

【0013】ここで、「方向ベクトル」は、仮想光源の
座標位置および測定点の座標位置から算出することがで
き、「法線ベクトル」は位置合わせ後の3次元形状デー
タ上における測定点の座標位置のデータ値に基づいて求
めることができる。また、余弦は、方向ベクトルと法線
ベクトルとの内積から求めることができる。
Here, the "direction vector" can be calculated from the coordinate position of the virtual light source and the coordinate position of the measurement point, and the "normal vector" is the coordinate of the measurement point on the three-dimensional shape data after alignment. It can be obtained based on the data value of the position. The cosine can be obtained from the inner product of the direction vector and the normal vector.

【0014】また、「プロットが直線上に位置するよう
にプロットにおける余弦を修正する」とは、プロットし
た測定点における余弦の値を変更して、プロットが直線
上に位置するようにプロットを移動させることをいう。
"Modifying the cosine of a plot so that the plot is located on a straight line" means changing the value of the cosine at the plotted measurement point and moving the plot so that the plot is located on a straight line. It means to let.

【0015】また、「修正された余弦に近づくように測
定点の位置を修正する」とは、修正前の測定点における
方向ベクトルと法線ベクトルとのなす余弦を、修正され
た余弦と完全に一致させるのではなく、修正された余弦
の値を越えることなく、これに近い値となるように測定
点の位置を修正することにより、修正後の測定点におけ
る方向ベクトルと法線ベクトルのなす余弦が、上記修正
された余弦に近い値となるようにすることをいう。な
お、ここで、「測定点の位置を修正する」とは、3次元
形状データは物体画像データにおける2次元方向につい
て位置合わせされているため、この2次元方向について
は位置を修正せず、物体画像データに対する奥行き方向
について位置を修正することをいう。具体的には、物体
画像データが存在する平面をxy平面とすると、z方向
についてのみ測定点の位置を修正することをいう。
"Correcting the position of a measurement point so as to approach the corrected cosine" means that the cosine between the direction vector and the normal vector at the measurement point before correction is completely equal to the corrected cosine. Instead of matching, the position of the measurement point is corrected to be close to the corrected cosine value without exceeding the corrected cosine value, so that the cosine between the direction vector and the normal vector at the corrected measurement point is obtained. Is to be a value close to the corrected cosine. Here, "correcting the position of the measurement point" means that the three-dimensional shape data is aligned in the two-dimensional direction in the object image data, and thus the position is not corrected in the two-dimensional direction. This refers to correcting the position in the depth direction with respect to the image data. Specifically, assuming that the plane on which the object image data exists is an xy plane, the position of the measurement point is corrected only in the z direction.

【0016】なお、本発明においては、3次元形状が推
定されるのは、物体の表面反射率が略一定である部分の
みであるが、3次元形状を有する物体の全体の表面反射
率が略一定である場合には、物体の全体の3次元形状を
推定することができる。
In the present invention, the three-dimensional shape is estimated only at a portion where the surface reflectance of the object is substantially constant, but the entire surface reflectance of the object having the three-dimensional shape is substantially estimated. If it is constant, the entire three-dimensional shape of the object can be estimated.

【0017】また、本発明による推定方法においては、
前記複数の測定点における前記物体画像データのデータ
値に基づいて、前記複数の測定点に鏡面反射する鏡面反
射測定点が存在するか否かを判断し、前記鏡面反射測定
点が存在する場合には、該鏡面反射測定点に基づいて、
前記光源の方向である蓋然性が高い前記仮想光源の方向
を選択し、該選択された方向における仮想光源により、
前記余弦の算出を行うことが好ましい。
In the estimation method according to the present invention,
Based on the data values of the object image data at the plurality of measurement points, determine whether there is a specular reflection measurement point that is specularly reflected at the plurality of measurement points, when the specular reflection measurement point is present Is based on the specular reflection measurement point,
By selecting the direction of the virtual light source, which is likely to be the direction of the light source, by the virtual light source in the selected direction,
It is preferable to calculate the cosine.

【0018】さらに、本発明による推定方法において
は、前記光源の方向の推定を、最小二乗法を用いた評価
関数に基づいて、前記プロットが略直線となるか否かを
判断することにより行うことが好ましい。
Further, in the estimation method according to the present invention, the estimation of the direction of the light source is performed by judging whether or not the plot is substantially a straight line based on an evaluation function using a least square method. Is preferred.

【0019】この場合、前記所定回数としては、前記評
価関数が所定値以下となるまでの回数とすることが好ま
しい。
In this case, it is preferable that the predetermined number of times is a number of times until the evaluation function becomes equal to or less than a predetermined value.

【0020】また、本発明による推定方法においては、
前記光源の方向の推定に用いられたプロットにより設定
される直線の傾きに基づいて、前記光源の強度を推定す
ることが好ましい。
In the estimation method according to the present invention,
It is preferable to estimate the intensity of the light source based on the inclination of a straight line set by the plot used for estimating the direction of the light source.

【0021】さらに、本発明による推定方法において
は、前記物体が人物の顔であることが好ましい。
Further, in the estimation method according to the present invention, it is preferable that the object is a human face.

【0022】さらに、前記3次元形状データが前記物体
の3次元形状を表すポリゴンデータであることが好まし
い。
Further, it is preferable that the three-dimensional shape data is polygon data representing a three-dimensional shape of the object.

【0023】本発明による推定装置は、表面反射率が略
一定である部分を含む3次元形状を有する物体を、実質
的な単一光源下において撮影することにより得られる画
像に基づいて、前記光源の方向と前記物体の3次元形状
とを推定する推定装置であって、前記画像上における前
記物体の画像を表す物体画像データのデータ値、および
該物体画像データと該物体の一般的な3次元形状を表す
3次元形状データとの位置合わせを行った後の前記3次
元形状データにより表される近似物体と、任意の複数方
向に設定した仮想光源との位置関係に基づいて、前記光
源の方向と前記物体の3次元形状とを推定する手段を備
えたことを特徴とするものである。
The estimating apparatus according to the present invention is characterized in that the light source based on an image obtained by shooting an object having a three-dimensional shape including a portion having a substantially constant surface reflectance under a substantially single light source. An estimation device for estimating the direction of the object and the three-dimensional shape of the object, comprising: a data value of object image data representing an image of the object on the image; and a general three-dimensional image of the object image data and the object. The direction of the light source is determined based on the positional relationship between the approximate object represented by the three-dimensional shape data after the alignment with the three-dimensional shape data representing the shape and the virtual light source set in a plurality of arbitrary directions. And means for estimating the three-dimensional shape of the object.

【0024】なお、本発明による推定装置においては、
前記光源の方向と前記物体の3次元形状とを推定する手
段は、前記近似物体上における前記物体の前記表面反射
率が略一定である部分に対応する部分に複数の測定点を
設定する測定点設定手段と、前記任意の複数方向に設定
した仮想光源から前記複数の測定点へ向かう方向ベクト
ルと、該複数の測定点における法線ベクトルとのなす余
弦を算出する余弦算出手段と、該余弦と、前記複数の測
定点に対応する前記物体画像データのデータ値との関係
を前記複数の仮想光源の方向毎にプロットするプロット
手段と、前記プロットが略直線となる仮想光源の方向を
仮の光源方向と推定する仮の光源方向推定手段と、前記
仮の光源方向を求めたプロットが前記直線上に位置する
ように、該プロットにおける前記余弦を修正する余弦修
正手段と、前記測定点における前記方向ベクトルと前記
法線ベクトルとのなす余弦が、前記修正された余弦に近
づくように該測定点の位置を修正して修正測定点を取得
する測定点修正手段と、該修正測定点を新たな前記測定
点とする前記余弦の算出、前記プロット、前記仮の光源
方向の推定、前記余弦の修正および前記修正測定点の取
得を所定回数繰り返すよう、前記測定点設定手段、前記
余弦算出手段、前記プロット手段、前記仮の光源方向推
定手段、前記余弦修正手段および前記測定点修正手段を
制御する制御手段と、該繰り返し処理の結果得られる前
記仮の光源方向を前記光源の方向と推定し、該繰り返し
処理の結果得られる修正測定点の位置により定められる
形状を、前記物体の3次元形状と推定する推定手段とを
備えることが好ましい。
In the estimation device according to the present invention,
The means for estimating the direction of the light source and the three-dimensional shape of the object is a measurement point for setting a plurality of measurement points on a portion of the approximate object corresponding to the portion where the surface reflectance of the object is substantially constant. Setting means, a direction vector from the virtual light source set in any of the plurality of directions to the plurality of measurement points, and a cosine calculation means for calculating a cosine formed by a normal vector at the plurality of measurement points; and Plotting means for plotting the relationship between the data values of the object image data corresponding to the plurality of measurement points for each direction of the plurality of virtual light sources, and setting the direction of the virtual light source in which the plot is substantially straight as a temporary light source Temporary light source direction estimating means for estimating the direction, cosine correcting means for correcting the cosine in the plot so that the plot for which the temporary light source direction is obtained is located on the straight line, Measuring point correcting means for correcting a position of the measuring point so as to obtain a corrected measuring point so that a cosine between the direction vector and the normal vector at a point approaches the corrected cosine; and the corrected measuring point. Calculating the cosine, setting the plot, estimating the provisional light source direction, correcting the cosine, and obtaining the corrected measurement point a predetermined number of times as a new measurement point. Control means for controlling the plotting means, the temporary light source direction estimating means, the cosine correcting means and the measuring point correcting means, and estimating the temporary light source direction obtained as a result of the repetitive processing as the light source direction Further, it is preferable to include an estimating means for estimating a shape determined by the position of the corrected measurement point obtained as a result of the repetitive processing as a three-dimensional shape of the object.

【0025】また、本発明による推定装置においては、
前記複数の測定点における前記物体画像データのデータ
値に基づいて、前記複数の測定点に鏡面反射する鏡面反
射測定点が存在するか否かを判断し、該鏡面反射測定点
が存在する場合には、該鏡面反射測定点に基づいて、前
記光源の方向である蓋然性が高い前記仮想光源の方向を
選択する選択手段を備え、前記余弦算出手段は、該選択
された方向における仮想光源により、前記余弦を算出す
る手段であることが好ましい。
In the estimating apparatus according to the present invention,
Based on the data values of the object image data at the plurality of measurement points, determine whether there is a specular reflection measurement point for specular reflection at the plurality of measurement points, when the specular reflection measurement point is present Comprises, based on the specular reflection measurement point, selecting means for selecting the direction of the virtual light source having a high probability of being the direction of the light source, and the cosine calculating means, by the virtual light source in the selected direction, It is preferably a means for calculating a cosine.

【0026】さらに、本発明による推定装置において
は、前記仮の光源方向推定手段は、前記光源の方向の推
定を、最小二乗法を用いた評価関数に基づいて、前記プ
ロットが略直線となるか否かを判断することにより行う
判断手段を備えることが好ましい。
In the estimating apparatus according to the present invention, the provisional light source direction estimating means may determine whether the plot of the light source direction is substantially a straight line based on an evaluation function using a least squares method. It is preferable to provide a determination means for determining whether or not the determination is made.

【0027】また、本発明による推定装置においては、
前記推定手段は、前記光源の方向の推定に用いられたプ
ロットにより設定される直線の傾きに基づいて、前記光
源の強度を推定する手段であることが好ましい。
In the estimating apparatus according to the present invention,
It is preferable that the estimating means is means for estimating the intensity of the light source based on a slope of a straight line set by a plot used for estimating the direction of the light source.

【0028】また、本発明による推定装置においては、
前記物体が人物の顔であることが好ましい。
In the estimating device according to the present invention,
Preferably, the object is a human face.

【0029】さらに、前記3次元形状データが前記物体
の3次元形状を表すポリゴンデータであることが好まし
い。
Further, it is preferable that the three-dimensional shape data is polygon data representing a three-dimensional shape of the object.

【0030】なお、本発明による推定方法を、コンピュ
ータに実行させるためのプログラムとして、コンピュー
タ読取り可能な記録媒体に記録して提供してもよい。
The estimation method according to the present invention may be provided as a program for causing a computer to execute the program on a computer-readable recording medium.

【0031】[0031]

【発明の効果】本発明によれば、物体画像データのデー
タ値、および近似物体と任意の複数方向に設定した仮想
光源との位置関係のみが分かれば、光源の方向と物体の
3次元形状とを推定することができる。このため、上記
佐藤らの方法のように、逆行列を算出可能な測定点を求
める必要がなく、また行列演算を行う必要がないため、
比較的簡易な演算により撮影時の光源の方向を推定する
ことができ、さらには物体の3次元形状が未知であって
もこの3次元形状を推定することができる。さらに、上
記池内の方法のように、多数方向からの画像を撮影して
おく必要もないため、簡易に光源の方向および物体の3
次元形状を推定することができる。そしてこれにより、
実画像とCGのような仮想画像とを合成する場合に、実
画像において推定した光源の方向に基づいて、仮想画像
が適切な光源から照明がなされているように修正した後
に合成をすることができ、違和感のない合成画像を得る
ことができる。また、MPEG−4のように、オブジェ
クト毎に画像を転送して動画を見る段階において合成す
る符号化方式において、オブジェクトに実画像と仮想画
像が含まれている場合に、実画像の照明方向に応じて仮
想画像の照明方向を修正して合成することができ、これ
により違和感のない合成動画像を得ることができる。さ
らに、実画像に含まれる物体を適切な3次元画像として
表すことができるため、実画像から違和感のない3次元
画像を生成することができる。さらにまた、太陽光下に
おいて撮影を行うことにより得られた画像の場合、画像
中の太陽光の方向を推定することにより、画像に対する
逆光補正や濃度補正を容易に行うことができる。
According to the present invention, if only the data value of the object image data and the positional relationship between the approximate object and the virtual light source set in arbitrary plural directions are known, the direction of the light source and the three-dimensional shape of the object can be obtained. Can be estimated. Therefore, unlike the method of Sato et al., There is no need to find measurement points at which the inverse matrix can be calculated, and there is no need to perform a matrix operation.
The direction of the light source at the time of photographing can be estimated by relatively simple calculation, and even if the three-dimensional shape of the object is unknown, the three-dimensional shape can be estimated. Further, unlike the method in the above-mentioned pond, there is no need to capture images from many directions, so that the direction of the light source and the 3
A dimensional shape can be estimated. And this gives
When synthesizing a real image and a virtual image such as CG, it is possible to perform synthesis after correcting the virtual image so that it is illuminated from an appropriate light source based on the direction of the light source estimated in the real image. As a result, it is possible to obtain a composite image without a sense of discomfort. Further, in an encoding method such as MPEG-4 in which images are transferred for each object and synthesized at a stage of viewing a moving image, when an object includes a real image and a virtual image, the illumination direction of the real image is changed. Accordingly, the lighting direction of the virtual image can be corrected and synthesized, thereby obtaining a synthesized moving image without a sense of discomfort. Furthermore, since an object included in the real image can be represented as an appropriate three-dimensional image, a three-dimensional image without a sense of incongruity can be generated from the real image. Furthermore, in the case of an image obtained by performing shooting in sunlight, the backlight correction and the density correction can be easily performed on the image by estimating the direction of the sunlight in the image.

【0032】とくに、仮想光源の位置が物体撮影時の光
源位置と一致する場合には、光源から表面反射率が略一
定である物体上のある測定点へ向かう方向ベクトルとそ
の測定点における法線ベクトルとがなす余弦、およびそ
の測定点における反射光の強度値すなわち物体画像デー
タのデータ値の関係が直線上に位置するという特徴に基
づいて、撮影時の光源の方向を推定することが好まし
い。すなわち、物体画像データと3次元形状データとの
位置合わせを行った後に、3次元形状データにより規定
される近似物体上における物体の表面反射率が略一定で
ある部分に対応する部分に複数の測定点を設定し、この
測定点から仮想光源へ向かう方向ベクトルと、測定点に
おける法線ベクトルとの余弦を求める。そして、この余
弦と、測定点における物体画像データのデータ値との関
係を複数の仮想光源毎にプロットし、これらの関係が直
線上に位置する仮想光源の方向を撮影時における仮の光
源の方向とする。そして、この仮の光源方向のプロット
が直線上に位置するように、各プロットにおける余弦の
値を修正し、仮の光源方向のプロットを求めた測定点に
おける方向ベクトルと法線ベクトルとのなす余弦が、修
正された余弦と略一致するように測定点の位置を修正し
て修正測定点を得る。
In particular, when the position of the virtual light source coincides with the light source position at the time of photographing the object, the direction vector from the light source to a certain measurement point on the object having a substantially constant surface reflectance and the normal line at the measurement point It is preferable to estimate the direction of the light source at the time of shooting based on the characteristic that the relationship between the cosine formed by the vector and the intensity value of the reflected light at the measurement point, that is, the data value of the object image data is located on a straight line. That is, after performing the alignment between the object image data and the three-dimensional shape data, a plurality of measurements are performed on a portion corresponding to a portion where the surface reflectance of the object on the approximate object specified by the three-dimensional shape data is substantially constant. A point is set, and a cosine between a direction vector from the measurement point toward the virtual light source and a normal vector at the measurement point is obtained. Then, the relationship between the cosine and the data value of the object image data at the measurement point is plotted for each of the plurality of virtual light sources, and the direction of the virtual light source in which these relationships are located on a straight line is the direction of the temporary light source at the time of shooting And Then, the value of the cosine in each plot is corrected so that the plot in the provisional light source direction is located on a straight line, and the cosine between the direction vector and the normal vector at the measurement point at which the plot in the provisional light source direction is obtained. Modifies the position of the measurement point so that it substantially matches the corrected cosine to obtain a corrected measurement point.

【0033】この後、修正測定点を新たな測定点とする
余弦の算出、プロット、仮の光源方向の推定、余弦の修
正および修正測定点の取得を所定回数繰り返し、この結
果得られる仮の光源方向を撮影時の光源方向と推定し、
修正測定点の位置により定められる形状を物体の3次元
形状と推定することが好ましい。
Thereafter, the calculation, plotting, estimating the temporary light source direction, correcting the cosine, and acquiring the corrected measurement point using the corrected measurement point as a new measurement point are repeated a predetermined number of times. Estimate the direction as the light source direction at the time of shooting,
It is preferable to estimate the shape determined by the position of the corrected measurement point as the three-dimensional shape of the object.

【0034】なお、仮の光源方向を推定する前に、複数
の測定点に鏡面反射測定点が存在するか否かを判断し、
鏡面反射測定点が存在する場合には、この鏡面反射測定
点に基づいて撮影時の光源方向である蓋然性が高い仮想
光源の方向を選択することにより、光源方向の推定に使
用する仮想光源の数を少なくすることができるため、演
算時間を短縮することができる。すなわち、鏡面反射す
る測定点が存在するということは、実際の光源から測定
点に照射された光が正反射して物体を撮影した撮影手段
の方向に進んでいるということができる。したがって、
鏡面反射測定点における法線ベクトルは、光源から鏡面
反射測定点へ向かうベクトルと、鏡面反射測定点から撮
影手段へ向かうベクトルとがなす角度を2等分するもの
となる。よって、鏡面反射測定点が存在する場合には、
その測定点における法線ベクトルと、鏡面反射測定点か
ら撮影手段へ向かうベクトルとに基づいて、演算に使用
する仮想光源の方向を絞り込むことができるものであ
る。
Before estimating the temporary light source direction, it is determined whether or not there is a specular reflection measurement point at a plurality of measurement points.
When there is a specular reflection measurement point, the number of virtual light sources used for estimating the light source direction is selected by selecting the direction of the virtual light source that is likely to be the light source direction at the time of shooting based on the specular reflection measurement point. Can be reduced, so that the calculation time can be shortened. In other words, the existence of the measurement point that performs specular reflection means that the light emitted from the actual light source to the measurement point is specularly reflected, and is proceeding in the direction of the photographing unit that photographs the object. Therefore,
The normal vector at the specular reflection measurement point divides the angle between the vector from the light source to the specular reflection measurement point and the vector from the specular reflection measurement point to the imaging means into two equal parts. Therefore, if there is a specular reflection measurement point,
The direction of the virtual light source used for the calculation can be narrowed down based on the normal vector at the measurement point and the vector from the specular reflection measurement point to the photographing means.

【0035】また、光源の強度をも推定することによ
り、上述したように実画像と仮想画像とを合成する場合
に、実画像において推定した光源の強度にも基づいて仮
想画像が適切な強度により照明がなされているように修
正した後に合成をすることができ、これにより一層違和
感のない合成画像を得ることができる。
Also, by estimating the intensity of the light source, when the real image and the virtual image are combined as described above, the virtual image can be appropriately adjusted based on the intensity of the light source estimated in the real image. Combining can be performed after the lighting has been corrected so that a combined image with less discomfort can be obtained.

【0036】さらに、3次元形状データをポリゴンデー
タとすることにより、測定点が存在する平面を求めれ
ば、この平面を規定する式から測定点における法線ベク
トルを直ちに算出することができるため、光源の方向を
より簡易に推定することができる。
Further, if the plane on which the measurement point is located is determined by using the three-dimensional shape data as polygon data, the normal vector at the measurement point can be immediately calculated from the equation defining this plane. Can be more easily estimated.

【0037】[0037]

【発明の実施の形態】以下図面を参照して本発明の実施
形態について説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0038】図1は本発明の実施形態による光源方向お
よび物体の3次元形状を推定するための推定装置の構成
を示す概略ブロック図である。図1に示すように、本実
施形態による推定装置は、人物の顔を含む画像を表す2
次元画像データS0と、人物の顔の3次元形状を表す3
次元形状データS1との位置合わせを行って合成データ
S2を得る位置合わせ手段1と、3次元形状データS1
を記憶するメモリ2と、合成データS2に基づいて人物
を含む画像における光源の方向および顔の3次元形状を
推定する推定手段3とを備える。なお、本実施形態にお
いては光源は単一であり、人物の顔の肌色部分の表面反
射率は略一定であるものとする。
FIG. 1 is a schematic block diagram showing the configuration of an estimating device for estimating the three-dimensional shape of an object and the direction of a light source according to an embodiment of the present invention. As shown in FIG. 1, the estimation device according to the present embodiment is configured to represent an image including a face of a person.
Three-dimensional image data S0 and three-dimensional image data
Positioning means 1 for performing alignment with three-dimensional shape data S1 to obtain composite data S2, and three-dimensional shape data S1
And an estimating means 3 for estimating the direction of the light source and the three-dimensional shape of the face in the image including the person based on the combined data S2. In the present embodiment, it is assumed that there is a single light source and the surface reflectance of the flesh-colored portion of the face of the person is substantially constant.

【0039】位置合わせ手段1は、図2(a)に示す人
物の顔画像を表す2次元画像データS0と、図2(b)
に示す人物の顔の3次元形状を近似的に表す3次元形状
データS1との位置合わせを行うものである。3次元形
状データS1は、2次元画像データS0により表される
顔画像に応じてその向き、サイズおよび中心位置を変更
可能なものであり、複数の面により3次元形状を規定す
るポリゴンデータとなっている。この位置合わせは2次
元画像データS0および3次元形状データS1をモニタ
(不図示)に表示し、表示された画像を観察しながらマ
ニュアル操作により、3次元形状データS1により表さ
れる3次元形状の向き、大きさおよび中心位置を、2次
元画像データS0により表される顔画像と一致させるこ
とにより行う。このような位置合わせを行うことによ
り、図2(c)に示すような合成画像を表す合成データ
S2を得ることができる。ここで、合成データS2には
2次元画像データS0と位置合わせ後の3次元形状デー
タS1′とが含まれることとなる。なお、図2において
は、図面上左右方向をx方向、上下方向をy方向、紙面
に対して垂直な方向をz方向とする。また、位置合わせ
後の3次元形状データS1′により、人物の顔の3次元
形状が近似的に表されることとなる。
The positioning means 1 includes two-dimensional image data S0 representing a face image of a person shown in FIG.
The position is aligned with the three-dimensional shape data S1 approximately representing the three-dimensional shape of the person's face shown in FIG. The three-dimensional shape data S1 can change its direction, size, and center position in accordance with the face image represented by the two-dimensional image data S0, and is polygon data that defines a three-dimensional shape by a plurality of surfaces. ing. In this alignment, the two-dimensional image data S0 and the three-dimensional shape data S1 are displayed on a monitor (not shown), and the three-dimensional shape represented by the three-dimensional shape data S1 is manually operated while observing the displayed image. This is performed by matching the orientation, size, and center position with the face image represented by the two-dimensional image data S0. By performing such positioning, synthesized data S2 representing a synthesized image as shown in FIG. 2C can be obtained. Here, the composite data S2 includes the two-dimensional image data S0 and the three-dimensional shape data S1 'after the alignment. In FIG. 2, the horizontal direction is the x direction, the vertical direction is the y direction, and the direction perpendicular to the plane of the drawing is the z direction. In addition, the three-dimensional shape of the person's face is approximately represented by the three-dimensional shape data S1 'after the alignment.

【0040】ここで、人物画像を撮影したカメラの焦点
位置f、カメラから人物の顔までの距離z0が既知であ
るとすると、位置合わせ後の3次元形状データS1′に
より表される3次元形状上におけるある位置の座標(x
w,yw,zw)と、人物画像上でのこの位置に対応す
る位置における座標(xv,yv)とは、下記の透視変
換の式(1)、(2)により記述することができる。
Here, assuming that the focal position f of the camera that captured the human image and the distance z0 from the camera to the human face are known, the three-dimensional shape represented by the three-dimensional shape data S1 'after the alignment is obtained. The coordinates (x
w, yw, zw) and the coordinates (xv, yv) at the position corresponding to this position on the human image can be described by the following perspective transformation equations (1) and (2).

【0041】 xv=α・f・xw/(f+zw+z0) (1) yv=α・f・yw/(f+zw+z0) (2) 但し、α:スケール x,y方向:人物画像の平面上の方向 z方向:人物画像における奥行き方向 ここで、3次元形状データS1は奥行き方向(z方向)
にも値を有するため、式(1)、(2)の関係を用いる
ことにより、位置合わせ後の3次元形状データS1′上
における位置と、2次元画像データS0上における位置
とをより正確に対応付けることができる。
Xv = α · f · xw / (f + zw + z0) (1) yv = α · f · yw / (f + zw + z0) (2) where α: scale x, y direction: direction on the plane of the human image z direction : Depth direction in human image Here, the three-dimensional shape data S1 is the depth direction (z direction)
, The position on the three-dimensional shape data S1 ′ after the alignment and the position on the two-dimensional image data S0 can be more accurately determined by using the relations of Expressions (1) and (2). Can be assigned.

【0042】なお、カメラの焦点位置f等が未知である
場合には、上記式(1)、(2)により位置合わせ後の
3次元形状データS1′と2次元画像データS0との対
応付けを行うことができないが、人物の奥行き寸法はカ
メラから被写体である人物までの距離と比較して非常に
小さいため、このような場合にはz方向については無視
しても差し支えないものである。したがって、この場合
は、位置合わせ後の3次元形状データS1′における任
意の位置の座標が(x1,y1,z1)であったとする
と、この位置に対応する2次元画像データS0上の位置
における座標は(x1,y1)とすればよい。
If the focal position f of the camera or the like is unknown, the correspondence between the three-dimensional shape data S1 'after the alignment and the two-dimensional image data S0 is determined by the above equations (1) and (2). This cannot be done, but since the depth dimension of the person is very small compared to the distance from the camera to the person being the subject, the z-direction can be ignored in such a case. Therefore, in this case, assuming that the coordinates of an arbitrary position in the three-dimensional shape data S1 'after the positioning are (x1, y1, z1), the coordinates at the position on the two-dimensional image data S0 corresponding to this position. May be (x1, y1).

【0043】図3は推定手段3の構成を示す概略ブロッ
ク図である。図3に示すように推定手段3は、位置合わ
せ後の3次元形状データS1′により表される3次元形
状上に複数の測定点を設定する測定点設定手段11と、
任意の複数方向に設定した仮想光源から複数の測定点へ
向かう方向ベクトルと、複数の測定点における法線ベク
トルとのなす余弦を算出する余弦算出手段12と、算出
された余弦と、複数の測定点に対応する2次元画像デー
タS0のデータ値との関係を複数の仮想光源の方向毎に
プロットするプロット手段13と、プロットが略直線と
なる仮想光源の方向を仮の光源方向と推定する仮の光源
方向推定手段14と、仮の光源方向を求めたプロットが
直線上に位置するように、上記プロットにおける余弦を
修正する余弦修正手段15と、測定点における方向ベク
トルと法線ベクトルとのなす余弦が、修正された余弦に
近づくように測定点の位置を修正して修正測定点を取得
する測定点修正手段16と、修正測定点を新たな測定点
としての余弦の算出、プロット、仮の光源方向の推定、
余弦の修正および修正測定点の取得を所定回数繰り返す
よう、測定点設定手段11、余弦算出手段12、プロッ
ト手段13、仮の光源方向推定手段14、余弦修正手段
15および測定点修正手段16を制御する制御手段17
とを備え、繰り返し処理の結果得られる仮の光源方向を
光源の方向と推定し、繰り返し処理の結果得られる修正
測定点の位置により定められる形状を、顔の3次元形状
と推定するものである。
FIG. 3 is a schematic block diagram showing the configuration of the estimating means 3. As shown in FIG. 3, the estimating means 3 includes a measuring point setting means 11 for setting a plurality of measuring points on the three-dimensional shape represented by the three-dimensional shape data S1 'after the alignment,
Cosine calculating means 12 for calculating a cosine between a direction vector from a virtual light source set in arbitrary plural directions to a plurality of measurement points and a normal vector at the plurality of measurement points; a calculated cosine; Plotting means 13 for plotting the relationship between the data values of the two-dimensional image data S0 corresponding to the points for each direction of a plurality of virtual light sources, and provisional means for estimating the direction of the virtual light source whose plot is substantially straight as a temporary light source direction. Light source direction estimating means 14; cosine correcting means 15 for correcting the cosine of the plot so that the plot for which the temporary light source direction is determined is located on a straight line; and a cosine correction means for calculating the direction vector and the normal vector at the measurement point. Measuring point correcting means 16 for correcting the position of the measuring point to obtain a corrected measuring point so that the cosine approaches the corrected cosine; and calculating the cosine as a new measuring point using the corrected measuring point as a new measuring point. , Plot, estimation of the temporary light source direction,
The measuring point setting means 11, the cosine calculating means 12, the plotting means 13, the provisional light source direction estimating means 14, the cosine correcting means 15, and the measuring point correcting means 16 are controlled so as to repeat the correction of the cosine and the acquisition of the corrected measurement points a predetermined number of times. Control means 17
And a temporary light source direction obtained as a result of the repetitive processing is estimated as the direction of the light source, and a shape determined by the position of the corrected measurement point obtained as a result of the repeated processing is estimated as a three-dimensional shape of the face. .

【0044】推定手段3においては以下のようにして光
源方向および顔の3次元形状が推定される。まず、光源
方向の推定について説明する。図4および図5は光源方
向の推定を説明するための図である。なお、図4におい
ては、簡便のために位置合わせ後の3次元形状データS
1′により表される3次元形状のy軸に垂直な平面にお
ける断面図を用いて2次元的に説明する。まず、測定点
設定手段11において3次元形状データS1′により表
される3次元形状上に複数の測定点を設定する。なお、
図4,5においては簡便のため測定点を2点P1,P2
としているが、実際にはより複数の測定点が設定される
ものである。また、この測定点は、3次元形状データS
1′により表される3次元形状上における人物の顔の肌
色部分に対応する部分に設定される。そして、図4に示
すように、y軸周りに−90度〜+90度まで、45度
間隔に5つの仮想的な光源(仮想光源とする)L1〜L
5が存在するものとして、余弦算出手段12において、
図5に示すように上記複数の測定点P1,P2につい
て、各光源L1〜L5毎に光源から測定点P1,P2に
向かう方向ベクトルLiP1,LiP2(i=1〜5)
と、測定点P1,P2における法線ベクトルn1,n2
との余弦cosθ1,cosθ2を算出する。ここで、
仮想光源L1〜L5および測定点P1,P2の座標位置
は予め分かっているため、方向ベクトルLiP1,Li
P2は仮想光源L1〜L5および測定点P1,P2の座
標値から算出することができる。また、3次元形状デー
タS1′はポリゴンデータであることから、測定点P
1,P2が存在する面は容易に求めることができ、また
この面を規定する式ax+bx+cx+d=0から法線
ベクトルn1,n2は(a,b,c)として求めること
ができる。したがって、方向ベクトルLiP1,LiP
2と法線ベクトルn1,n2との内積から余弦cosθ
1、cosθ2を算出することができる。
The estimating means 3 estimates the direction of the light source and the three-dimensional shape of the face as follows. First, the estimation of the light source direction will be described. 4 and 5 are diagrams for explaining the estimation of the light source direction. In FIG. 4, for simplicity, the three-dimensional shape data S
The three-dimensional shape represented by 1 'will be described two-dimensionally with reference to a cross-sectional view taken on a plane perpendicular to the y-axis. First, the measurement point setting means 11 sets a plurality of measurement points on the three-dimensional shape represented by the three-dimensional shape data S1 '. In addition,
In FIGS. 4 and 5, two measurement points P1 and P2 are shown for simplicity.
However, actually, more measurement points are set. In addition, this measurement point is the three-dimensional shape data S
It is set to a portion corresponding to the skin color portion of the face of the person on the three-dimensional shape represented by 1 '. Then, as shown in FIG. 4, five virtual light sources (referred to as virtual light sources) L1 to L around the y-axis from −90 ° to + 90 ° at 45 ° intervals.
Assuming that 5 exists, in the cosine calculation means 12,
As shown in FIG. 5, for the plurality of measurement points P1 and P2, direction vectors LiP1 and LiP2 (i = 1 to 5) from the light sources to the measurement points P1 and P2 for each of the light sources L1 to L5.
And normal vectors n1, n2 at measurement points P1, P2
Cosine θ1 and cos θ2 are calculated. here,
Since the coordinate positions of the virtual light sources L1 to L5 and the measurement points P1 and P2 are known in advance, the direction vectors LiP1 and Li2
P2 can be calculated from the virtual light sources L1 to L5 and the coordinate values of the measurement points P1 and P2. Since the three-dimensional shape data S1 'is polygon data, the measurement point P
The plane in which 1, P2 exists can be easily obtained, and the normal vectors n1, n2 can be obtained as (a, b, c) from the equation ax + bx + cx + d = 0 that defines this plane. Therefore, the direction vectors LiP1, LiP
Cosine cos θ from the inner product of 2 and the normal vectors n1 and n2
1, cos θ2 can be calculated.

【0045】ここで、本実施形態においては測定点は拡
散反射する位置に設定されていることから、測定点にお
ける反射光の強度値、照明すなわち光源から発せられる
光の強度、表面反射率、遮断および上記余弦との間には
下記の式(3),(4)に示す関係が存在する。
In this embodiment, since the measuring point is set at the position where the light is diffusely reflected, the intensity value of the reflected light at the measuring point, the intensity of the light, ie, the light emitted from the light source, the surface reflectance, and the cutoff And the above cosine, there is a relationship shown in the following equations (3) and (4).

【0046】 I(P1)=k1・s1・cosθ1・Lc+Ie (3) I(P2)=k2・s2・cosθ2・Lc+Ie (4) 但し、I(P1),I(P2):測定点P1,P2での
反射光の強度値 k1,k2:表面反射率 s2,s2:遮断の値(0または1) Lc:照明の強度 Ie:環境光の強度 遮断とは例えば人物の顔において、光源の方向に応じて
生じる、鼻の影となってしまって光が届かない部分のこ
とをいう。このように光が届かない部分においては遮断
sの値は0となり、それ以外の部分においては光が届い
て反射されるために遮断sの値は1となる。したがっ
て、s=0となる測定点は反射光の強度値が0となるこ
とから、本実施形態においては光源方向推定の演算には
用いないものとする。この場合、演算に用いる測定点が
不足する場合があるため、s=0となる測定点が存在す
る場合にはs=1となる新たな測定点を設定することが
好ましい。
I (P1) = k1 · s1 · cos θ1 · Lc + Ie (3) I (P2) = k2 · s2 · cosθ2 · Lc + Ie (4) where I (P1) and I (P2): measurement points P1 and P2 K1, k2: surface reflectance s2, s2: block value (0 or 1) Lc: illumination intensity Ie: ambient light intensity Blocking is, for example, in the direction of the light source in the face of a person. This refers to the part of the nose that cannot be reached due to the shadow of the nose. As described above, the value of the cutoff s is 0 in a portion where light does not reach, and the value of the cutoff s is 1 in other portions because light reaches and is reflected. Therefore, since the intensity value of the reflected light is 0 at the measurement point where s = 0, it is not used in the calculation of the light source direction estimation in the present embodiment. In this case, since there may be a shortage of measurement points used for calculation, it is preferable to set a new measurement point where s = 1 when there is a measurement point where s = 0.

【0047】反射光の強度値I(P1),I(P2)は
測定点P1,P2における2次元画像データS0のデー
タ値となる。本実施形態においては位置合わせ手段1に
て、2次元画像データS0と3次元形状データS1との
位置合わせがなされているため、例えば上記式(1)、
(2)により位置合わせ後の3次元形状データS1′に
おける測定点P1,P2の座標値から2次元画像データ
S0上における測定点P1,P2に対応する座標値を求
める。そして、2次元画像データS0における測定点P
1,P2に対応する座標位置でのデータ値を、測定点P
1,P2における反射光の強度値I(P1),I(P
2)として求める。
The intensity values I (P1) and I (P2) of the reflected light are the data values of the two-dimensional image data S0 at the measurement points P1 and P2. In the present embodiment, since the two-dimensional image data S0 and the three-dimensional shape data S1 are aligned by the alignment means 1, for example, the above equation (1) is used.
According to (2), coordinate values corresponding to the measurement points P1 and P2 on the two-dimensional image data S0 are obtained from the coordinate values of the measurement points P1 and P2 in the three-dimensional shape data S1 'after the alignment. Then, the measurement point P in the two-dimensional image data S0
The data values at the coordinate positions corresponding to P1 and P2 are
1, P2, the intensity values of the reflected light I (P1), I (P
2).

【0048】なお、余弦cosθ1、cosθ2が負と
なると反射光の強度値が負となってしまうことから、本
実施形態においてはcosθ1,cosθ2>0となる
ような測定点のみを用いるものとする。この場合、演算
に用いる測定点が不足する場合があるため、cosθ
1,cosθ2≦0となる測定点が存在する場合にはc
osθ1,cosθ2>0となる新たな測定点を設定す
ることが好ましい。
Since the intensity of the reflected light becomes negative when the cosines cos θ1 and cos θ2 become negative, only the measurement points where cos θ1 and cos θ2> 0 are used in the present embodiment. In this case, since there may be a shortage of measurement points used for calculation, cos θ
When there is a measurement point satisfying 1, cos θ2 ≦ 0, c
It is preferable to set a new measurement point where osθ1 and cosθ2> 0.

【0049】本実施形態では、人物の顔において拡散反
射する点における表面反射率は略一定であることから、
上記式(3),(4)においてはk1=k2となる。ま
た、遮断s1,s2の値はともに1である。そして、上
記式(3)、(4)より、仮想光源の位置が正しい、す
なわち撮影時の光源位置と一致する場合には、下記の式
(5)に示すように、顔の表面における反射光の強度値
の比と余弦の比とが一致するという特徴がある。
In the present embodiment, since the surface reflectance at the point of diffuse reflection in the person's face is substantially constant,
In the above equations (3) and (4), k1 = k2. Further, the values of the cutoffs s1 and s2 are both 1. From the above equations (3) and (4), when the position of the virtual light source is correct, that is, when the position of the virtual light source coincides with the light source position at the time of shooting, the reflected light on the face of the face is expressed by the following equation (5). Is characterized in that the ratio of the intensity values and the ratio of the cosine coincide.

【0050】 Lc・k・s=(I(P1)-Ie)/cosθ1=(I(P2)-Ie)/cosθ2 (5) 但し、k:k1,k2 s:s1,s2 Lc・k・s=一定 したがって、プロット手段13においては、各仮想光源
L1〜L5毎に、複数の測定点P1,P2における反射
光の強度値と余弦cosθ1、cosθ2との関係を図
6に示すようにプロットする。なお、図6においては反
射光の強度値をその最大値が1.0となるように正規化
している。
Lc · k · s = (I (P1) −Ie) / cosθ1 = (I (P2) −Ie) / cosθ2 (5) where k: k1, k2 s: s1, s2 Lc · k · s Therefore, the plotting unit 13 plots the relationship between the intensity values of the reflected light and the cosines cos θ1 and cos θ2 at the plurality of measurement points P1 and P2 for each of the virtual light sources L1 to L5 as shown in FIG. In FIG. 6, the intensity value of the reflected light is normalized so that the maximum value is 1.0.

【0051】図6に示すように仮想光源L1〜L5にお
いてその位置が撮影時の光源の位置と一致する場合に
は、上記式(5)に示す関係から、反射光の強度値と余
弦とのプロットは略直線上に位置することとなる。した
がって、プロットが略直線上に位置する仮想光源の位置
を撮影時の光源の位置と見なすことができる。図6にお
いては−45度の方向からの光源すなわち仮想光源L2
を光源として用いた場合の反射光の強度値と余弦との関
係が略直線上に位置することから、仮の光源方向推定手
段14において、仮想光源L2の位置が撮影時の仮の光
源の位置として求められる。したがって、撮影時におい
ては人物の顔から見て図4における−45度の方向から
光が照射されていると見なすことができる。なお、この
直線と縦軸すなわち強度軸との交点の値が、環境光Ie
の強度となる。また、この直線の傾きは上記式(5)に
おけるLc・k・sであり、図6から傾きの大きさが分
かる。したがって、傾きをaとすると、Lc=a/k・
sとなって照明の強度Lcを求めることができる。
As shown in FIG. 6, when the positions of the virtual light sources L1 to L5 coincide with the positions of the light sources at the time of shooting, the relationship between the intensity value of the reflected light and the cosine is obtained from the relationship shown in the above equation (5). The plot will be located on a substantially straight line. Therefore, the position of the virtual light source where the plot is located on a substantially straight line can be regarded as the position of the light source at the time of shooting. In FIG. 6, the light source from the direction of −45 degrees, that is, the virtual light source L2
Since the relationship between the intensity value of the reflected light and the cosine when the light source is used is located on a substantially straight line, the position of the virtual light source L2 is determined by the temporary light source direction estimating means 14 to be the position of the temporary light source at the time of shooting. Is required. Therefore, at the time of photographing, it can be considered that light is emitted from the direction of -45 degrees in FIG. 4 when viewed from the face of the person. The value at the intersection of this straight line and the vertical axis, that is, the intensity axis, is the ambient light Ie
Of strength. Further, the slope of this straight line is Lc · k · s in the above equation (5), and the magnitude of the slope can be seen from FIG. Therefore, assuming that the inclination is a, Lc = a / k ·
As s, the illumination intensity Lc can be obtained.

【0052】ここで、プロットが直線上に位置するか否
かの判断は、例えば最小二乗法を用いた評価関数により
行う。すなわち、直線の式をy=ax+bとすると、
Here, whether or not the plot is located on a straight line is determined by, for example, an evaluation function using the least squares method. That is, if the equation of a straight line is y = ax + b,

【数1】 但し、N:プロット数 xn:余弦の値 yn:反射光の強度値 として、a,bの値を求めることができる。そしてこの
ようにして求められたa,bの値から、下記の式(7)
に示す評価関数cfを算出する。
(Equation 1) Here, N: the number of plots xn: cosine value yn: intensity value of reflected light a, b values can be obtained. Then, from the values of a and b obtained in this way, the following equation (7) is obtained.
Is calculated.

【0053】[0053]

【数2】 そしてこの評価関数cfの値が最も小さい値となった仮
想光源の方向を撮影時における仮の光源方向とすればよ
い。
(Equation 2) Then, the direction of the virtual light source in which the value of the evaluation function cf becomes the smallest value may be set as the temporary light source direction at the time of shooting.

【0054】次に、顔の3次元形状の推定について説明
する。図7は仮の光源方向を決定するために用いたプロ
ットおよびこのプロットから求められた直線Cを示す図
である。図7に示すように、位置合わせ後の3次元形状
データS1′は、顔の近似的な3次元形状を表すもので
あることから、実際の顔の形状は3次元形状データS
1′により表される形状とはずれているため、プロット
は完全に直線C上に位置するものではなく、直線Cから
隔たって存在するものである。ここで、本実施形態にお
いては、3次元形状データS1′はx,y方向について
は位置合わせがなされていることから、z軸方向の値が
実際の値からずれているためにこの隔たりが生じるもの
であると考えることができる。したがって、本実施形態
は、各プロットの直線Cからの隔たりを修正することに
より3次元形状データS1′のz軸方向のずれを修正し
て顔の3次元形状を推定するものである。
Next, the estimation of the three-dimensional shape of the face will be described. FIG. 7 is a diagram showing a plot used for determining a temporary light source direction and a straight line C obtained from the plot. As shown in FIG. 7, the three-dimensional shape data S1 ′ after the alignment represents an approximate three-dimensional shape of the face.
Since the shape is different from the shape represented by 1 ', the plot does not completely lie on the straight line C but exists apart from the straight line C. Here, in the present embodiment, since the three-dimensional shape data S1 'is aligned in the x and y directions, the gap occurs because the value in the z-axis direction deviates from the actual value. Can be thought of. Therefore, in the present embodiment, the distance of each plot from the straight line C is corrected to correct the displacement of the three-dimensional shape data S1 'in the z-axis direction, and the three-dimensional shape of the face is estimated.

【0055】まず、上述したように求めた仮の光源方向
を求めたプロットの直線Cからのずれは、そのプロット
に対応する測定点における法線ベクトルの傾きのずれか
ら生じるものであると考えることができる。例えば、図
7における測定点P3に対応するプロットの場合、プロ
ットが直線Cから左側にずれているため、測定点P3に
おける法線ベクトルの傾きがずれて余弦の値が実際の余
弦の値よりも小さくなっていると考えることができる。
ここで、実際の余弦の値とは、仮の光源から実際の顔の
3次元形状上に設定される測定点へ向かう方向ベクトル
と、この測定点における法線ベクトルとがなす余弦のこ
とである。そこで、余弦修正手段15において、測定点
P3における余弦の値が大きくなるように修正して法線
ベクトルの傾きを修正することにより、測定点P3にお
ける3次元形状データS1′のz値を修正してプロット
を直線Cに近づく方向に移動させる。すなわち、測定点
P3に対応する2次元画像データS0のデータ値をg
(P3)とすると、g(P3)=ax+bより、 x=cosθc=(g(P3)−b)/a (8) 但し、cosθc:測定点P3が直線C上に位置する場
合の余弦の値そこで、測定点P3におけるθの値、すな
わち方向ベクトルと法線ベクトルとがなす角度をθcの
値に近づけるように修正する。なお、余弦の値をYとし
た場合、θの値は、 θ=cos−1Y (9) により求めることができる。なお、図7における測定点
P4に対応するプロットのように、プロットが直線Cか
ら右側にずれている場合は、測定点P4における余弦の
値が小さくなるように測定点P4における法線ベクトル
の傾きを修正することにより、3次元形状データのz値
を修正してプロットを直線Cに近づく方向に移動させ
る。
First, it is assumed that the deviation of the plot of the temporary light source direction obtained as described above from the straight line C is caused by the deviation of the inclination of the normal vector at the measurement point corresponding to the plot. Can be. For example, in the case of the plot corresponding to the measurement point P3 in FIG. 7, since the plot is shifted to the left from the straight line C, the slope of the normal vector at the measurement point P3 is shifted and the value of the cosine is larger than the actual value of the cosine. It can be considered that it is getting smaller.
Here, the actual cosine value is a cosine between a direction vector from the temporary light source toward a measurement point set on the three-dimensional shape of the actual face and a normal vector at this measurement point. . Therefore, the cosine correction means 15 corrects the z-value of the three-dimensional shape data S1 'at the measurement point P3 by correcting the cosine value at the measurement point P3 so as to increase the cosine value and correcting the inclination of the normal vector. To move the plot in a direction approaching the straight line C. That is, the data value of the two-dimensional image data S0 corresponding to the measurement point P3 is g
Assuming that (P3), from g (P3) = ax + b, x = cos θc = (g (P3) −b) / a (8) where cos θc is a cosine value when the measurement point P3 is located on the straight line C. Therefore, the value of θ at the measurement point P3, that is, the angle between the direction vector and the normal vector is corrected so as to approach the value of θc. When the value of the cosine is Y, the value of θ can be obtained by θ = cos −1 Y (9). When the plot is shifted to the right from the straight line C as in the plot corresponding to the measurement point P4 in FIG. 7, the slope of the normal vector at the measurement point P4 is reduced so that the value of the cosine at the measurement point P4 becomes smaller. Is corrected, the z value of the three-dimensional shape data is corrected, and the plot is moved in a direction approaching the straight line C.

【0056】図8は、θの値の修正を説明するための図
である。図8において、θoldは修正前の測定点P3に
おける方向ベクトルPLと法線ベクトルnoldとがなす
角度、θnewは修正後の測定点P3における方向ベクト
ルPLと法線ベクトルnnewとがなす角度、θcは測定
点P3が直線C上に位置する場合の方向ベクトルPLと
法線ベクトルとがなす角度である。まず、ベクトルnne
wを下記の式(10)により算出する。
FIG. 8 is a diagram for explaining the correction of the value of θ. In FIG. 8, θold is the angle between the direction vector PL and the normal vector nold at the measurement point P3 before correction, θnew is the angle between the direction vector PL and the normal vector nnew at the measurement point P3 after correction, and θc is This is the angle between the direction vector PL and the normal vector when the measurement point P3 is located on the straight line C. First, the vector nne
w is calculated by the following equation (10).

【0057】 nnew=nold+α(θold−θc)・(PL−nold) (10) 但し、α:係数(0<α<1) ここで、αの値は1より小さい値を有するため、法線ベ
クトルnnewはαの値に応じて法線ベクトルnoldの終点
から光源Lへ向かうベクトル(PL−nold)上を移動
することとなる。ここで、αの値を1としないのは、直
線Cはあくまでも仮の光源方向を表すため、実際の光源
方向とは厳密には異なるものであり、このように実際の
光源方向とは異なる仮の光源方向に基づいて測定点を一
気に修正すると、顔の3次元形状を正確に求めることが
できなくなるからである。
Nnew = nold + α (θold−θc) · (PL−nold) (10) where α: coefficient (0 <α <1) Here, since the value of α has a value smaller than 1, the normal vector nnew moves on the vector (PL-nold) from the end point of the normal vector nold toward the light source L according to the value of α. Here, the reason why the value of α is not set to 1 is that the straight line C represents a temporary light source direction to the last, and therefore is strictly different from the actual light source direction. If the measurement points are corrected at once based on the light source direction, the three-dimensional shape of the face cannot be obtained accurately.

【0058】このようにして法線ベクトルnnewが算出
されると、この法線ベクトルnnewに基づいて、測定点
修正手段16において、測定点P3における3次元形状
データS1′のz値が修正される。具体的には測定点P
3が図9に示すような点A,B,Cを頂点とするポリゴ
ンに存在する場合に、点A,B,Cの頂点のzの値を修
正して、3次元形状データS1′のz値を修正する。こ
こで、法線ベクトルnnewを(a′,b′,c′)、測
定点P3の座標を(x1,y1,z1)とすると、測定
点P3を通り法線ベクトルがnnewである平面の方程式
が定まる。
When the normal vector nnew is calculated in this manner, the z value of the three-dimensional shape data S1 'at the measurement point P3 is corrected by the measurement point correction means 16 based on the normal vector nnew. . Specifically, the measurement point P
3 exists in a polygon having the vertices of points A, B, and C as shown in FIG. 9, the z value of the vertices of points A, B, and C is corrected and z of the three-dimensional shape data S1 'is changed. Modify the value. Here, assuming that the normal vector nnew is (a ′, b ′, c ′) and the coordinates of the measurement point P3 are (x1, y1, z1), the equation of a plane passing through the measurement point P3 and having the normal vector nnew is Is determined.

【0059】 a′x+b′y+c′z+d′=0 (11) d′=−(a′x1+b′y1+c′z1) (12) 点A,B,Cにおいてはx、yの値は変更されておら
ず、zの値のみが変更されるため、変更されたzの値を
znewとすると、 znew=−(a′x+b′y+d)/c′ (13) により求めることができる。これにより、修正後の点
A,B,Cの座標は、(x,y,znew)と表すことが
できる。
A′x + by ′ + c′z + d ′ = 0 (11) d ′ = − (a′x1 + b′y1 + c′z1) (12) At points A, B, and C, the values of x and y have been changed. However, since only the value of z is changed, if the changed value of z is znew, it can be obtained by the following equation: znew = − (a′x + by ′ + d) / c ′ (13) Thus, the coordinates of the corrected points A, B, and C can be expressed as (x, y, znew).

【0060】以上の処理を仮の光源方向を決定したプロ
ットに対応する全ての測定点について行い、新たな測定
点の座標値を得、これを修正3次元データScとする。
なお、修正3次元データSc上における測定点を修正測
定点とする。
The above processing is performed for all the measurement points corresponding to the plots for which the provisional light source directions have been determined, and the coordinate values of the new measurement points are obtained, which is used as corrected three-dimensional data Sc.
Note that a measurement point on the corrected three-dimensional data Sc is a corrected measurement point.

【0061】そして、修正測定点を新たな測定点とし、
新たな仮想光源を設定して、新たな仮想光源から修正測
定点へ向かう方向ベクトルおよび修正測定点の法線ベク
トルnnewがなす余弦cosθnewと、修正測定点におけ
る反射光の強度値との関係をプロットし、さらに上記式
(7)および(8)により新たな直線を求めて新たな仮
想光源の方向を決定するとともに、評価関数cfを算出
する。この際、新たな仮想光源は、仮の光源の近傍に設
定すればよい。そして、評価関数cfの値が予め定めら
れた所定値よりも大きいか否かが判断され、所定値を越
える場合には、上述したように測定点のz値を修正して
新たな修正測定点を求め、この新たな修正測定点につい
ての仮の光源方向および評価関数cfの値の算出を、評
価関数cfの値が上記所定値よりも小さい値となるまで
繰り返す。そして、評価関数cfが所定値以下となった
ときの仮想光源の方向を光源の方向と推定し、この際の
修正測定点により定められる3次元形状を顔の3次元形
状と推定するものである。なお、ここで、推定される顔
の3次元形状は顔の肌色部分の3次元形状となる。以上
の処理は、制御手段17により、測定点設定手段11、
余弦算出手段12、プロット手段13、仮の光源方向推
定手段14、余弦修正手段15、および測定点修正手段
16を制御することにより行われる。
Then, the corrected measurement point is set as a new measurement point,
Set a new virtual light source and plot the relationship between the cosine cosθnew formed by the direction vector from the new virtual light source to the corrected measurement point and the normal vector nnew of the corrected measurement point, and the intensity value of the reflected light at the corrected measurement point Then, a new straight line is determined by the above equations (7) and (8) to determine a new direction of the virtual light source, and the evaluation function cf is calculated. At this time, the new virtual light source may be set near the temporary light source. Then, it is determined whether or not the value of the evaluation function cf is larger than a predetermined value. If the value exceeds the predetermined value, the z value of the measurement point is corrected as described above to obtain a new corrected measurement point. Is calculated, and the calculation of the temporary light source direction and the value of the evaluation function cf for this new corrected measurement point is repeated until the value of the evaluation function cf becomes smaller than the predetermined value. Then, the direction of the virtual light source when the evaluation function cf becomes equal to or less than a predetermined value is estimated as the direction of the light source, and the three-dimensional shape defined by the corrected measurement point at this time is estimated as the three-dimensional shape of the face. . Here, the estimated three-dimensional shape of the face is the three-dimensional shape of the skin color portion of the face. The above processing is performed by the control unit 17 by the measurement point setting unit 11,
This is performed by controlling the cosine calculating means 12, the plotting means 13, the provisional light source direction estimating means 14, the cosine correcting means 15, and the measuring point correcting means 16.

【0062】次いで、本実施形態の動作について説明す
る。図10は、本実施形態の動作を示すフローチャート
である。まず、位置合わせ手段1において2次元画像デ
ータS0と3次元形状データS1との位置合わせが行わ
れる(ステップS1)。そして位置合わせされた合成デ
ータS2が推定手段3に入力される。推定手段3におい
ては、位置合わせ後の3次元形状データS1′により表
される3次元形状上に複数の測定点を設定するとともに
(ステップS2)、仮想光源L1〜L5から任意の仮想
光源を選択する(ステップS3)。本実施形態において
は、仮想光源L1から順に選択するものとする。そし
て、各測定点において、法線ベクトルと測定点および仮
想光源間の方向ベクトルとのなす余弦が算出され(ステ
ップS4)、各測定点における反射光の強度値と上述し
た余弦との関係が図6に示すようにプロットされる(ス
テップS5)。そして、反射光の強度値と余弦との関係
において、評価関数cfが予め定められた値以下となっ
たか否かを判断することにより、プロットが直線上に位
置するか否かが判断され(ステップS6)、ステップS
6が否定された場合にはステップS3に戻り、異なる仮
想光源を選択してステップS4からステップS6の処理
を繰り返す。ステップS6が肯定された場合には、この
仮想光源の方向を撮影時における仮の光源方向として決
定する(ステップS7)。
Next, the operation of this embodiment will be described. FIG. 10 is a flowchart showing the operation of the present embodiment. First, the positioning unit 1 performs positioning between the two-dimensional image data S0 and the three-dimensional shape data S1 (step S1). Then, the aligned combined data S2 is input to the estimating means 3. The estimating means 3 sets a plurality of measurement points on the three-dimensional shape represented by the three-dimensional shape data S1 'after the alignment (step S2), and selects an arbitrary virtual light source from the virtual light sources L1 to L5. (Step S3). In the present embodiment, it is assumed that the virtual light source L1 is selected in order. Then, at each measurement point, a cosine between the normal vector and the direction vector between the measurement point and the virtual light source is calculated (step S4). 6 is plotted (step S5). Then, it is determined whether or not the plot is located on a straight line by determining whether or not the evaluation function cf has become equal to or smaller than a predetermined value in the relationship between the intensity value of the reflected light and the cosine (step). S6), Step S
If the result in No. 6 is negative, the process returns to Step S3, and a different virtual light source is selected, and the processing from Step S4 to Step S6 is repeated. When step S6 is affirmed, the direction of this virtual light source is determined as a temporary light source direction at the time of shooting (step S7).

【0063】このように仮の光源方向が決定されると、
この仮の光源方向の直線を決定した際の評価関数cfが
所定値以下であるか否かが判断される(ステップS
8)。ステップS8が否定されると、上述したように測
定点の位置が修正され(ステップS9)、さらに仮の光
源方向の近傍に新たな仮想光源を設定して(ステップS
10)、ステップS3に戻り、以下ステップS3からス
テップS8までの処理を繰り返す。そして、ステップS
8が肯定されると、仮の光源方向を撮影時の光源の方向
として決定するとともに、修正された測定点の座標位置
から顔の3次元形状を決定し(ステップS11)、処理
を終了する。
When the temporary light source direction is determined as described above,
It is determined whether or not the evaluation function cf when the temporary light source direction straight line is determined is equal to or smaller than a predetermined value (step S).
8). If step S8 is negative, the position of the measurement point is corrected as described above (step S9), and a new virtual light source is set near the temporary light source direction (step S9).
10), the process returns to step S3, and thereafter, the processes from step S3 to step S8 are repeated. And step S
If affirmative, the tentative light source direction is determined as the direction of the light source at the time of shooting, and the three-dimensional shape of the face is determined from the corrected coordinate position of the measurement point (step S11), and the process ends.

【0064】このように、本実施形態においては、仮想
光源の位置が正しい、すなわち撮影時の光源位置と一致
する場合には、式(5)に示すように、顔の表面におけ
る反射光の強度値の比と上記余弦の比とが一致するとい
う特徴に基づいて、撮影時の光源の方向を推定するよう
にしたため、測定点の設定については遮断sの値が0で
ないという条件のみを満たせばよく、また比較的簡易な
演算により光源の方向を推定することができる。また、
物体の3次元形状が未知であっても、推定された光源の
方向に基づいて、上記池内の方法と比較して簡易に物体
の3次元形状をも推定することができる。そしてこれに
より、実画像とCGのような仮想画像とを合成する場合
に、実画像において推定した光源の方向に基づいて、仮
想画像が適切な光源から照明がなされているように修正
した後に合成をすることができ、違和感のない合成画像
を得ることができる。また、MPEG−4のように、オ
ブジェクト毎に画像を転送して動画を見る段階において
合成する符号化方式において、オブジェクトに実画像と
仮想画像が含まれている場合に、実画像の照明方向に応
じて仮想画像の照明方向を修正して合成することがで
き、これにより違和感のない合成動画像を得ることがで
きる。さらに、実画像に含まれる物体を適切な3次元画
像として表すことができるため、実画像から違和感のな
い3次元画像を生成することができる。さらにまた、太
陽光下において撮影を行うことにより得られた画像の場
合、画像中の太陽光の方向を推定することにより、画像
に対する逆光補正や濃度補正を容易に行うことができ
る。
As described above, in the present embodiment, when the position of the virtual light source is correct, that is, when the position of the virtual light source coincides with the position of the light source at the time of shooting, the intensity of the reflected light on the surface of the face is calculated as shown in Expression (5). Since the direction of the light source at the time of shooting is estimated based on the feature that the ratio of the values and the ratio of the cosine coincide with each other, only the condition that the value of the cutoff s is not 0 is satisfied for the setting of the measurement point. The direction of the light source can be estimated by a good and relatively simple calculation. Also,
Even if the three-dimensional shape of the object is unknown, the three-dimensional shape of the object can be easily estimated based on the estimated direction of the light source as compared with the above-described method in the pond. Thus, when combining the real image and the virtual image such as CG, the virtual image is corrected based on the direction of the light source estimated in the real image so as to be illuminated from an appropriate light source, and then combined. And a synthesized image without discomfort can be obtained. Further, in an encoding method such as MPEG-4 in which images are transferred for each object and synthesized at a stage of viewing a moving image, when an object includes a real image and a virtual image, the illumination direction of the real image is changed. Accordingly, the lighting direction of the virtual image can be corrected and synthesized, thereby obtaining a synthesized moving image without a sense of discomfort. Furthermore, since an object included in the real image can be represented as an appropriate three-dimensional image, a three-dimensional image without a sense of incongruity can be generated from the real image. Furthermore, in the case of an image obtained by performing shooting in sunlight, the backlight correction and the density correction can be easily performed on the image by estimating the direction of the sunlight in the image.

【0065】なお、上記実施形態においては、説明のた
めに2次元状に仮想光源L1〜L5を配置しているが、
実際には3次元形状データS1に対して3次元状に複数
の仮想光源を配置し、各測定点毎に反射光の強度と上記
余弦との関係をプロットして撮影時の光源方向および物
体の3次元形状を推定するものである。
In the above embodiment, the virtual light sources L1 to L5 are arranged two-dimensionally for explanation.
Actually, a plurality of virtual light sources are arranged three-dimensionally with respect to the three-dimensional shape data S1, and the relationship between the intensity of the reflected light and the above-mentioned cosine is plotted at each measurement point, and the light source direction and the object This is for estimating a three-dimensional shape.

【0066】また、上記実施形態においては、式(6)
および(7)に示すように、最小二乗法による評価関数
cfを用いて仮の光源方向を推定しているが、これに限
定されるものではなく、図6に示すプロットをモニタに
表示し、オペレータがこれを観察してプロットが直線上
に位置する仮想光源の方向を仮の光源の方向として求め
るようにしてもよい。
In the above embodiment, the expression (6)
As shown in (7) and (7), the temporary light source direction is estimated using the evaluation function cf by the least squares method. However, the present invention is not limited to this, and the plot shown in FIG. The operator may observe this and determine the direction of the virtual light source where the plot is located on a straight line as the direction of the temporary light source.

【0067】さらに、2次元画像データS0を取得する
際において使用するカメラは、入力する光と出力する画
像データとの関係が非線形となるものである。このた
め、予め使用するカメラによりグレーチャートを撮影し
て、カメラに対する入力と出力との関係を求めておき、
この関係が直線となるようにカメラの入出力特性を補正
しておくことが好ましい。
Further, the camera used when acquiring the two-dimensional image data S0 has a non-linear relationship between the input light and the output image data. For this reason, a gray chart is photographed by a camera to be used in advance, and a relationship between an input and an output to the camera is obtained.
It is preferable to correct the input / output characteristics of the camera so that this relationship becomes a straight line.

【0068】なお、実環境における物体表面の輝度は、
上述した拡散反射光および環境光に加えて鏡面反射光も
含まれ、これらの光の組み合わせによりモデル化するこ
とができるものである。すなわち、物体表面の輝度は下
記の式(14)により表すことができる。なお、ここで
は相互反射は拡散反射、鏡面反射および環境光と比べて
小さく、無視できるものとする。
The brightness of the object surface in the real environment is
Specular reflection light is also included in addition to the above-described diffuse reflection light and environmental light, and can be modeled by a combination of these lights. That is, the luminance of the object surface can be represented by the following equation (14). Here, the mutual reflection is smaller than the diffuse reflection, the specular reflection, and the ambient light, and can be ignored.

【0069】 I=Id+Is+Ie (14) 但し、I:物体表面の輝度 Id:拡散反射光 Is:鏡面反射光 Ie:環境光 ここで、上記実施形態と同様に光源が1つである場合を
想定し、3次元形状データS1′を用いて、顔画像から
鏡面反射位置を検出する場合について説明する。
I = Id + Is + Ie (14) where I: luminance of the object surface Id: diffuse reflection light Is: specular reflection light Ie: environmental light Here, it is assumed that there is one light source as in the above embodiment. The case where the specular reflection position is detected from the face image using the three-dimensional shape data S1 'will be described.

【0070】上記式(14)より、顔表面上の任意の2
点における強度値すなわちデータ値の差ΔIは、拡散反
射光Idおよび鏡面反射光Isに依存する。まず、拡散
反射光Idのみが存在すると仮定して考えると、表面反
射率が一定の箇所において上記図5に示すような2つの
測定点P1,P2における強度差ΔIは下記の式(1
5)に示すように、定式化することができる。
From the above equation (14), any 2 on the face surface
The difference ΔI between the intensity value at the point, that is, the data value, depends on the diffuse reflection light Id and the specular reflection light Is. First, assuming that only the diffuse reflection light Id exists, the intensity difference ΔI at the two measurement points P1 and P2 as shown in FIG.
It can be formulated as shown in 5).

【0071】 ΔI=k・s1・cosθ1・Lc-k・s2・cosθ2・Lc=k(s1・cos1-s2・cos2)Lc(15) 光源の位置および強度は変化しないと仮定できるため、
強度差ΔIは2点における余弦の差すなわち法線ベクト
ルの方向差および遮断のいずれかにより生じるものとな
る。ここで、基準となる測定点(例えばP1とする)が
拡散反射する位置に存在するものとすると、強度差ΔI
が遮断により生じる場合は、他方の測定点P2は影とな
っているため、2点の位置がわずかに違っていても強度
値は大きく低下するように変化する。一方、強度差ΔI
が余弦の差により生じる場合は、他方の測定点P2も拡
散反射する位置にあると強度差ΔIは略余弦の値に比例
するものとなるが、他方の測定点P2が鏡面反射する位
置にあると2点の位置がわずかに違っていても強度値は
大きく増加するように変化する。このように、位置合わ
せ後の3次元形状データS1′上の拡散反射する位置に
1つの測定点P1を設定し、この測定点P1のデータ値
とこれに近接する任意の測定点P2(拡散反射する位置
に限定されない)におけるデータ値との差を求め、2点
の位置の差がわずかであるにもかかわらず、データ値が
急激に大きくなる点を鏡面反射する位置として求めるこ
とができる。
ΔI = k · s1 · cosθ1 · Lc−k · s2 · cosθ2 · Lc = k (s1 · cos1-s2 · cos2) Lc (15) Since it can be assumed that the position and intensity of the light source do not change,
The intensity difference ΔI is caused by a difference in cosine between two points, that is, one of a direction difference of a normal vector and a cutoff. Here, assuming that a reference measurement point (for example, P1) exists at a position where diffuse reflection occurs, the intensity difference ΔI
Is caused by the interruption, the other measurement point P2 is shaded, so that the intensity value greatly changes even if the positions of the two points are slightly different. On the other hand, the intensity difference ΔI
Is caused by the difference in the cosine, the intensity difference ΔI is approximately proportional to the value of the cosine when the other measurement point P2 is also at the position where the diffuse reflection occurs, but the other measurement point P2 is at the position where the other surface is specularly reflected. Even if the positions of the two points are slightly different, the intensity value changes so as to greatly increase. As described above, one measurement point P1 is set at the position where diffuse reflection occurs on the three-dimensional shape data S1 'after alignment, and the data value of this measurement point P1 and an arbitrary measurement point P2 (diffuse reflection) adjacent thereto are set. (It is not limited to the position at which the data value changes.), And the point at which the data value sharply increases despite the slight difference between the two positions can be determined as the position for specular reflection.

【0072】一方、鏡面反射の式は下記の式(16)に
示すように定式化することができる。
On the other hand, the equation for specular reflection can be formulated as shown in the following equation (16).

【0073】 Is=k・s・cosα・Lc (16) すなわち、図11に示すような位置に光源があるとする
と、物体を撮影した撮影手段が矢印Rの位置、すなわち
光源Lから出射した光の点Pにおける正反射方向にある
場合に、点Pは鏡面反射することとなり、カメラの位置
がRから角度αずれた位置Vに移動するほど鏡面反射光
の強度は小さくなる。
Is = k · s · cos n α · Lc (16) That is, assuming that the light source is located at a position as shown in FIG. When the light is in the specular reflection direction at the point P, the point P is specularly reflected, and the intensity of the specularly reflected light becomes smaller as the position of the camera moves to the position V shifted from the R by an angle α.

【0074】したがって、図12に示すように、測定点
設定手段11において設定された複数の測定点に鏡面反
射する測定点が存在するか否かを判断し、存在する場合
に鏡面反射する測定点を選択する選択手段20を設け、
仮の光源の方向を推測する前(図10に示すフローチャ
ートのステップS3の前)に、複数の測定点に鏡面反射
する測定点が存在するか否かを判断し、鏡面反射する測
定点が存在する場合には、図11に示すように、その位
置(Pとする)における法線ベクトルが、方向ベクトル
PLと、方向ベクトルPRとがなす角度を2等分するも
のとなることから、光源が存在する方向をある程度推測
することができる。したがって、上記実施形態のように
あらゆる方向に仮想光源を設定しなくとも、光源が存在
しそうな方向にのみ仮想光源を設定すれば、仮の光源方
向を推定することができるため、演算量を低減して処理
を高速に行うことができる。
Therefore, as shown in FIG. 12, it is determined whether or not the plurality of measurement points set by the measurement point setting means 11 have measurement points that reflect specularly. And selecting means 20 for selecting
Before estimating the direction of the temporary light source (before step S3 in the flowchart shown in FIG. 10), it is determined whether or not a plurality of measurement points have specularly reflected measurement points. In this case, as shown in FIG. 11, the normal vector at the position (P) divides the angle between the direction vector PL and the direction vector PR into two equal parts. The existing direction can be estimated to some extent. Therefore, even if the virtual light source is not set in every direction as in the above embodiment, if the virtual light source is set only in the direction in which the light source is likely to exist, the temporary light source direction can be estimated, so that the amount of calculation is reduced. Processing can be performed at high speed.

【0075】なお、上記実施形態においては、人物の顔
の形状を推定しているが、これに限定されるものではな
く、種々の物体の3次元形状を推定することができるも
のである。
In the above embodiment, the shape of a person's face is estimated. However, the present invention is not limited to this, and three-dimensional shapes of various objects can be estimated.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の実施形態による推定装置の構成を示す
概略ブロック図
FIG. 1 is a schematic block diagram illustrating a configuration of an estimation device according to an embodiment of the present invention.

【図2】2次元画像データと3次元形状データとの位置
合わせを説明するための図
FIG. 2 is a diagram for explaining alignment between two-dimensional image data and three-dimensional shape data;

【図3】推定手段の構成を示す概略ブロック図FIG. 3 is a schematic block diagram illustrating a configuration of an estimation unit.

【図4】仮想光源の方向を説明するための図FIG. 4 is a diagram for explaining a direction of a virtual light source;

【図5】測定点における余弦の算出を説明するための図FIG. 5 is a diagram for explaining calculation of a cosine at a measurement point;

【図6】余弦と反射光の強度値との関係を示すグラフFIG. 6 is a graph showing a relationship between a cosine and an intensity value of reflected light.

【図7】仮の光源方向を決定するために用いるプロット
を示す図
FIG. 7 is a diagram showing a plot used to determine a temporary light source direction;

【図8】θの修正を説明するための図FIG. 8 is a diagram for explaining correction of θ.

【図9】z値の修正を説明するための図FIG. 9 is a diagram for explaining correction of a z value.

【図10】本実施形態の動作を示すフローチャートFIG. 10 is a flowchart showing the operation of the embodiment.

【図11】鏡面反射を説明するための図FIG. 11 is a diagram for explaining specular reflection;

【図12】選択手段を設けた実施形態の構成を示す概略
ブロック図
FIG. 12 is a schematic block diagram showing the configuration of an embodiment provided with a selection unit.

【符号の説明】[Explanation of symbols]

1 位置合わせ手段 2 メモリ 3 推定手段 11 測定点設定手段 12 余弦算出手段 13 プロット手段 14 仮の光源方向推定手段 15 余弦修正手段 16 測定点修正手段 17 制御手段 20 選択手段 DESCRIPTION OF SYMBOLS 1 Alignment means 2 Memory 3 Estimation means 11 Measurement point setting means 12 Cosine calculation means 13 Plotting means 14 Temporary light source direction estimation means 15 Cosine correction means 16 Measurement point correction means 17 Control means 20 Selection means

Claims (24)

【特許請求の範囲】[Claims] 【請求項1】 表面反射率が略一定である部分を含む
3次元形状を有する物体を、実質的な単一光源下におい
て撮影することにより得られる画像に基づいて、前記光
源の方向と前記物体の3次元形状とを推定する推定方法
であって、 前記画像上における前記物体の画像を表す物体画像デー
タのデータ値、および該物体画像データと該物体の一般
的な3次元形状を表す3次元形状データとの位置合わせ
を行った後の前記3次元形状データにより表される近似
物体と、任意の複数方向に設定した仮想光源との位置関
係に基づいて、前記光源の方向と前記物体の3次元形状
とを推定することを特徴とする推定方法。
An object having a three-dimensional shape including a portion having a substantially constant surface reflectivity is photographed under a substantially single light source, based on an image obtained by photographing the object, the direction of the light source and the object. A data value of object image data representing an image of the object on the image, and a three-dimensional data representing the object image data and a general three-dimensional shape of the object. Based on the positional relationship between the approximate object represented by the three-dimensional shape data after the alignment with the shape data and the virtual light source set in any of a plurality of directions, the direction of the light source and the three-dimensional shape of the object are determined. An estimation method characterized by estimating a three-dimensional shape.
【請求項2】 前記近似物体上における前記物体の前
記表面反射率が略一定である部分に対応する部分に複数
の測定点を設定し、 前記任意の複数方向に設定した仮想光源から前記複数の
測定点へ向かう方向ベクトルと、該複数の測定点におけ
る法線ベクトルとのなす余弦を算出し、 該余弦と、前記複数の測定点に対応する前記物体画像デ
ータのデータ値との関係を前記複数の仮想光源の方向毎
にプロットし、 前記プロットが略直線となる仮想光源の方向を仮の光源
方向と推定し、 前記仮の光源方向を求めたプロットが前記直線上に位置
するように、該プロットにおける前記余弦を修正し、 前記測定点における前記方向ベクトルと前記法線ベクト
ルとのなす余弦が、前記修正された余弦に近づくように
該測定点の位置を修正して修正測定点を取得し、 該修正測定点を新たな前記測定点とする前記余弦の算
出、前記プロット、前記仮の光源方向の推定、前記余弦
の修正および前記修正測定点の取得を所定回数繰り返
し、 該繰り返し処理の結果得られる前記仮の光源方向を前記
光源の方向と推定し、 該繰り返し処理の結果得られる修正測定点の位置により
定められる形状を、前記物体の3次元形状と推定するこ
とを特徴とする請求項1記載の推定方法。
2. A method according to claim 1, wherein a plurality of measurement points are set on a portion of the approximate object corresponding to a portion where the surface reflectance of the object is substantially constant, and Calculating a cosine between a direction vector toward the measurement point and a normal vector at the plurality of measurement points; and calculating a relationship between the cosine and a data value of the object image data corresponding to the plurality of measurement points. Plotting for each direction of the virtual light source, estimating the direction of the virtual light source in which the plot is substantially a straight line as a temporary light source direction, such that the plot obtained for the temporary light source direction is located on the straight line, Correcting the cosine in the plot, correcting the position of the measurement point so that the cosine between the direction vector and the normal vector at the measurement point approaches the corrected cosine, Calculating the cosine with the corrected measurement point as the new measurement point, repeating the plotting, estimating the temporary light source direction, correcting the cosine, and acquiring the corrected measurement point a predetermined number of times; And estimating the temporary light source direction obtained as a result of the processing as the direction of the light source, and estimating the shape determined by the position of the corrected measurement point obtained as a result of the iterative processing as the three-dimensional shape of the object. The estimation method according to claim 1.
【請求項3】 前記複数の測定点における前記物体画
像データのデータ値に基づいて、前記複数の測定点に鏡
面反射する鏡面反射測定点が存在するか否かを判断し、 前記鏡面反射測定点が存在する場合には、該鏡面反射測
定点に基づいて、前記光源の方向である蓋然性が高い前
記仮想光源の方向を選択し、 該選択された方向における仮想光源により、前記余弦の
算出を行うことを特徴とする請求項2記載の推定方法。
Determining whether or not there is a specular reflection measurement point for specular reflection at the plurality of measurement points based on a data value of the object image data at the plurality of measurement points; Is present, the direction of the virtual light source, which is likely to be the direction of the light source, is selected based on the specular reflection measurement point, and the cosine is calculated by the virtual light source in the selected direction. 3. The estimation method according to claim 2, wherein:
【請求項4】 前記仮の光源の方向の推定を、最小二
乗法を用いた評価関数に基づいて、前記プロットが略直
線となるか否かを判断することにより行うことを特徴と
する請求項2または3記載の推定方法。
4. The method according to claim 1, wherein the estimation of the direction of the temporary light source is performed by determining whether or not the plot is substantially a straight line, based on an evaluation function using a least squares method. 4. The estimation method according to 2 or 3.
【請求項5】 前記所定回数は、前記評価関数が所定
値以下となるまでの回数であることを特徴とする請求項
4記載の推定方法。
5. The estimation method according to claim 4, wherein the predetermined number is a number of times until the evaluation function becomes equal to or less than a predetermined value.
【請求項6】 前記光源の方向の推定に用いられたプ
ロットにより設定される直線の傾きに基づいて、前記光
源の強度を推定することを特徴とする請求項2から5の
いずれか1項記載の推定方法。
6. The light source according to claim 2, wherein the intensity of the light source is estimated based on a slope of a straight line set by a plot used for estimating the direction of the light source. Estimation method.
【請求項7】 前記物体が人物の顔であることを特徴
とする請求項1から6のいずれか1項記載の推定方法。
7. The estimation method according to claim 1, wherein the object is a human face.
【請求項8】 前記3次元形状データが前記物体の3
次元形状を表すポリゴンデータであることを特徴とする
請求項1から7のいずれか1項記載の推定方法。
8. The three-dimensional shape data of the object
The estimation method according to any one of claims 1 to 7, wherein the data is polygon data representing a dimensional shape.
【請求項9】 表面反射率が略一定である部分を含む
3次元形状を有する物体を、実質的な単一光源下におい
て撮影することにより得られる画像に基づいて、前記光
源の方向と前記物体の3次元形状とを推定する推定装置
であって、 前記画像上における前記物体の画像を表す物体画像デー
タのデータ値、および該物体画像データと該物体の一般
的な3次元形状を表す3次元形状データとの位置合わせ
を行った後の前記3次元形状データにより表される近似
物体と、任意の複数方向に設定した仮想光源との位置関
係に基づいて、前記光源の方向と前記物体の3次元形状
とを推定する手段を備えたことを特徴とする推定装置。
9. The direction of the light source and the object based on an image obtained by photographing an object having a three-dimensional shape including a portion having a substantially constant surface reflectivity under a substantially single light source. A data value of object image data representing an image of the object on the image, and a three-dimensional data representing the object image data and a general three-dimensional shape of the object. Based on the positional relationship between the approximate object represented by the three-dimensional shape data after the alignment with the shape data and the virtual light source set in any of a plurality of directions, the direction of the light source and the three-dimensional shape of the object are determined. An estimating device comprising means for estimating a dimensional shape.
【請求項10】 前記光源の方向と前記物体の3次元
形状とを推定する手段は、前記近似物体上における前記
物体の前記表面反射率が略一定である部分に対応する部
分に複数の測定点を設定する測定点設定手段と、 前記任意の複数方向に設定した仮想光源から前記複数の
測定点へ向かう方向ベクトルと、該複数の測定点におけ
る法線ベクトルとのなす余弦を算出する余弦算出手段
と、 該余弦と、前記複数の測定点に対応する前記物体画像デ
ータのデータ値との関係を前記複数の仮想光源の方向毎
にプロットするプロット手段と、 前記プロットが略直線となる仮想光源の方向を仮の光源
方向と推定する仮の光源方向推定手段と、 前記仮の光源方向を求めたプロットが前記直線上に位置
するように、該プロットにおける前記余弦を修正する余
弦修正手段と、 前記測定点における前記方向ベクトルと前記法線ベクト
ルとのなす余弦が、前記修正された余弦に近づくように
該測定点の位置を修正して修正測定点を取得する測定点
修正手段と、 該修正測定点を新たな前記測定点とする前記余弦の算
出、前記プロット、前記仮の光源方向の推定、前記余弦
の修正および前記修正測定点の取得を所定回数繰り返す
よう、前記測定点設定手段、前記余弦算出手段、前記プ
ロット手段、前記仮の光源方向推定手段、前記余弦修正
手段および前記測定点修正手段を制御する制御手段と、 該繰り返し処理の結果得られる前記仮の光源方向を前記
光源の方向と推定し、該繰り返し処理の結果得られる修
正測定点の位置により定められる形状を、前記物体の3
次元形状と推定する推定手段とを備えたことを特徴とす
る請求項9記載の推定装置。
10. A means for estimating the direction of the light source and the three-dimensional shape of the object, comprising: a plurality of measurement points on a portion of the approximate object corresponding to the portion where the surface reflectance of the object is substantially constant. Measurement point setting means for setting a direction vector from the virtual light source set in any of the plurality of directions to the plurality of measurement points, and a cosine calculation means for calculating a cosine between a normal vector at the plurality of measurement points. Plotting means for plotting the relationship between the cosine and the data values of the object image data corresponding to the plurality of measurement points for each direction of the plurality of virtual light sources; Temporary light source direction estimating means for estimating a direction as a temporary light source direction; and a cosine for correcting the cosine in the plot so that a plot for obtaining the temporary light source direction is located on the straight line. Corrective means, measuring point correcting means for obtaining a corrected measuring point by correcting the position of the measuring point so that the cosine between the direction vector and the normal vector at the measuring point approaches the corrected cosine. Calculating the cosine, setting the plot, estimating the temporary light source direction, correcting the cosine, and obtaining the corrected measurement point a predetermined number of times, using the corrected measurement point as the new measurement point. Setting means, the cosine calculating means, the plotting means, the temporary light source direction estimating means, control means for controlling the cosine correcting means and the measuring point correcting means, and the temporary light source direction obtained as a result of the repetitive processing. The shape determined by the position of the corrected measurement point obtained as a result of the iterative process is estimated as the direction of the light source.
The estimating apparatus according to claim 9, further comprising estimating means for estimating the dimensional shape.
【請求項11】 前記複数の測定点における前記物体
画像データのデータ値に基づいて、前記複数の測定点に
鏡面反射する鏡面反射測定点が存在するか否かを判断
し、該鏡面反射測定点が存在する場合には、該鏡面反射
測定点に基づいて、前記光源の方向である蓋然性が高い
前記仮想光源の方向を選択する選択手段を備え、 前記余弦算出手段は、該選択された方向における仮想光
源により、前記余弦を算出する手段であることを特徴と
する請求項10記載の推定装置。
11. A method for determining whether or not there is a specular reflection measurement point for specular reflection at said plurality of measurement points based on a data value of said object image data at said plurality of measurement points. If there is, based on the specular reflection measurement point, comprising a selection means for selecting the direction of the virtual light source that is likely to be the direction of the light source, the cosine calculation means, in the selected direction 11. The estimating apparatus according to claim 10, wherein said cosine is calculated by a virtual light source.
【請求項12】 前記仮の光源方向推定手段は、前記
仮の光源の方向の推定を、最小二乗法を用いた評価関数
に基づいて、前記プロットが略直線となるか否かを判断
することにより行う判断手段を備えたことを特徴とする
請求項10または11記載の推定装置。
12. The temporary light source direction estimating means determines whether or not the plot is a substantially straight line, based on an evaluation function using a least squares method. The estimating device according to claim 10, further comprising a determination unit configured to perform the determination according to:
【請求項13】 前記所定回数は、前記評価関数が所
定値以下となるまでの回数であることを特徴とする請求
項12記載の推定装置。
13. The estimating apparatus according to claim 12, wherein the predetermined number of times is a number of times until the evaluation function becomes equal to or less than a predetermined value.
【請求項14】 前記推定手段は、前記光源の方向の
推定に用いられたプロットにより設定される直線の傾き
に基づいて、前記光源の強度をも推定する手段であるこ
とを特徴とする請求項10から13のいずれか1項記載
の推定装置。
14. The apparatus according to claim 1, wherein said estimating means is means for estimating also the intensity of the light source based on a gradient of a straight line set by a plot used for estimating the direction of the light source. 14. The estimation device according to any one of 10 to 13.
【請求項15】 前記物体が人物の顔であることを特
徴とする請求項9から14のいずれか1項記載の推定装
置。
15. The estimating apparatus according to claim 9, wherein the object is a human face.
【請求項16】 前記3次元形状データが前記物体の
3次元形状を表すポリゴンデータであることを特徴とす
る請求項9から15のいずれか1項記載の推定装置。
16. The estimating apparatus according to claim 9, wherein the three-dimensional shape data is polygon data representing a three-dimensional shape of the object.
【請求項17】 表面反射率が略一定である部分を含
む3次元形状を有する物体を、実質的な単一光源下にお
いて撮影することにより得られる画像に基づいて、前記
光源の方向と前記物体の3次元形状とを推定する推定方
法をコンピュータに実行させるためのプログラムを記録
したコンピュータ読取り可能な記録媒体であって、 前記プログラムは、前記画像上における前記物体の画像
を表す物体画像データのデータ値、および該物体画像デ
ータと該物体の一般的な3次元形状を表す3次元形状デ
ータとの位置合わせを行った後の前記3次元形状データ
により表される近似物体と、任意の複数方向に設定した
仮想光源との位置関係に基づいて、前記光源の方向と前
記物体の3次元形状とを推定する手順を有することを特
徴とするコンピュータ読取り可能な記録媒体。
17. The direction of the light source and the object based on an image obtained by photographing an object having a three-dimensional shape including a portion having a substantially constant surface reflectivity under a substantially single light source. A computer-readable recording medium storing a program for causing a computer to execute an estimation method for estimating a three-dimensional shape of the object, wherein the program includes data of object image data representing an image of the object on the image. Values, and an approximate object represented by the three-dimensional shape data after the object image data is aligned with three-dimensional shape data representing a general three-dimensional shape of the object, and in an arbitrary plurality of directions. A computer-readable method for estimating a direction of the light source and a three-dimensional shape of the object based on a set positional relationship with the virtual light source. Ri capable of recording medium.
【請求項18】 前記前記光源の方向と前記物体の3
次元形状とを推定する手順は、前記近似物体上における
前記物体の前記表面反射率が略一定である部分に対応す
る部分に複数の測定点を設定する手順と、 前記任意の複数方向に設定した仮想光源から前記複数の
測定点へ向かう方向ベクトルと、該複数の測定点におけ
る法線ベクトルとのなす余弦を算出する手順と、 該余弦と、前記複数の測定点に対応する前記物体画像デ
ータのデータ値との関係を前記複数の仮想光源の方向毎
にプロットする手順と、 前記プロットが略直線となる仮想光源の方向を仮の光源
方向と推定する手順と、 前記仮の光源方向を求めたプロットが前記直線上に位置
するように、該プロットにおける前記余弦を修正する手
順と、 前記測定点における前記方向ベクトルと前記法線ベクト
ルとのなす余弦が、前記修正された余弦に近づくように
該測定点の位置を修正して修正測定点を取得する手順
と、 該修正測定点を新たな前記測定点とする前記余弦の算
出、前記プロット、前記仮の光源方向の推定、前記余弦
の修正および前記修正測定点の取得を所定回数繰り返す
手順と、 該繰り返し処理の結果得られる前記仮の光源方向を前記
光源の方向と推定し、該繰り返し処理の結果得られる修
正測定点の位置により定められる形状を、前記物体の3
次元形状と推定する手順とを有することを特徴とする請
求項17記載のコンピュータ読取り可能な記録媒体。
18. The direction of the light source and 3 of the object
The procedure of estimating the dimensional shape is a procedure of setting a plurality of measurement points on a portion corresponding to a portion where the surface reflectance of the object on the approximate object is substantially constant, and setting the measurement points in the arbitrary plural directions. A direction vector from the virtual light source toward the plurality of measurement points, and a procedure for calculating a cosine formed by a normal vector at the plurality of measurement points; and a method of calculating the cosine and the object image data corresponding to the plurality of measurement points. A procedure of plotting a relationship with a data value for each direction of the plurality of virtual light sources, a procedure of estimating a direction of the virtual light source in which the plot is substantially a straight line as a temporary light source direction, and obtaining the temporary light source direction. Correcting the cosine of the plot so that the plot is located on the straight line; and the cosine of the direction vector and the normal vector at the measurement point is corrected. Correcting the position of the measurement point so as to approach the cosine to obtain a corrected measurement point; calculating the cosine with the corrected measurement point as the new measurement point; the plotting; estimating the temporary light source direction A procedure of repeating the correction of the cosine and the acquisition of the corrected measurement point a predetermined number of times; and estimating the temporary light source direction obtained as a result of the repetition processing as the direction of the light source, and a corrected measurement point obtained as a result of the repetition processing. The shape determined by the position of
18. The computer-readable recording medium according to claim 17, further comprising a step of estimating a dimensional shape.
【請求項19】 前記複数の測定点における前記物体
画像データのデータ値に基づいて、前記複数の測定点に
鏡面反射する鏡面反射測定点が存在するか否かを判断す
る手順と、 前記鏡面反射測定点が存在する場合には、該鏡面反射測
定点に基づいて、前記光源の方向である蓋然性が高い前
記仮想光源の方向を選択する手順とをさらに有し、 前記余弦を算出する手順は、該選択された方向における
仮想光源により、前記余弦の算出を行う手順であること
を特徴とする請求項18記載のコンピュータ読取り可能
な記録媒体。
19. A step of judging whether or not there is a specular reflection measurement point for specular reflection at the plurality of measurement points based on a data value of the object image data at the plurality of measurement points; If there is a measurement point, the method further comprises: selecting a direction of the virtual light source having a high probability of being the direction of the light source, based on the specular reflection measurement point, and calculating the cosine. 19. The computer-readable recording medium according to claim 18, wherein the cosine is calculated using a virtual light source in the selected direction.
【請求項20】 前記仮の光源の方向を推定する手順
は、最小二乗法を用いた評価関数に基づいて、前記プロ
ットが略直線となるか否かを判断する手順を有すること
を特徴とする請求項18または19記載のコンピュータ
読取り可能な記録媒体。
20. The procedure for estimating the direction of the temporary light source includes a procedure for determining whether or not the plot is substantially a straight line based on an evaluation function using a least squares method. The computer-readable recording medium according to claim 18.
【請求項21】 前記所定回数は、前記評価関数が所
定値以下となるまでの回数であることを特徴とする請求
項20記載のコンピュータ読取り可能な記録媒体。
21. The computer-readable recording medium according to claim 20, wherein said predetermined number of times is a number of times until said evaluation function becomes equal to or less than a predetermined value.
【請求項22】 前記光源の方向の推定に用いられた
プロットにより設定される直線の傾きに基づいて、前記
光源の強度を推定する手順をさらに有することを特徴と
する請求項18から21のいずれか1項記載のコンピュ
ータ読取り可能な記録媒体。
22. The method according to claim 18, further comprising a step of estimating the intensity of the light source based on a slope of a straight line set by a plot used for estimating the direction of the light source. The computer-readable recording medium according to claim 1.
【請求項23】 前記物体が人物の顔であることを特
徴とする請求項17から22のいずれか1項記載のコン
ピュータ読取り可能な記録媒体。
23. The computer-readable recording medium according to claim 17, wherein the object is a human face.
【請求項24】 前記3次元形状データが前記物体の
3次元形状を表すポリゴンデータであることを特徴とす
る請求項17から23のいずれか1項記載のコンピュー
タ読取り可能な記録媒体。
24. The computer-readable recording medium according to claim 17, wherein said three-dimensional shape data is polygon data representing a three-dimensional shape of said object.
JP2000157228A 1999-07-12 2000-05-26 Method and apparatus for estimating light source direction and three-dimensional shape, and recording medium Expired - Fee Related JP4213327B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000157228A JP4213327B2 (en) 1999-07-12 2000-05-26 Method and apparatus for estimating light source direction and three-dimensional shape, and recording medium

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP11-196861 1999-07-12
JP19686199 1999-07-12
JP2000157228A JP4213327B2 (en) 1999-07-12 2000-05-26 Method and apparatus for estimating light source direction and three-dimensional shape, and recording medium

Publications (2)

Publication Number Publication Date
JP2001084362A true JP2001084362A (en) 2001-03-30
JP4213327B2 JP4213327B2 (en) 2009-01-21

Family

ID=26510025

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000157228A Expired - Fee Related JP4213327B2 (en) 1999-07-12 2000-05-26 Method and apparatus for estimating light source direction and three-dimensional shape, and recording medium

Country Status (1)

Country Link
JP (1) JP4213327B2 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006313549A (en) * 2005-05-03 2006-11-16 Seac02 Srl Augmented reality system for identifying real marker object
JP2008016054A (en) * 2004-11-04 2008-01-24 Nec Corp Three-dimensional shape-estimating system and image-generating system
US7860340B2 (en) 2004-11-04 2010-12-28 Nec Corporation Three-dimensional shape estimation system and image generation system
JP2015059849A (en) * 2013-09-19 2015-03-30 凸版印刷株式会社 Method and device for measuring color and three-dimensional shape
JP2015232487A (en) * 2014-06-09 2015-12-24 株式会社キーエンス Image inspection device, image inspection method, image inspection program and computer readable recording medium, and apparatus having image inspection program recorded therein
JP2018163692A (en) * 2014-05-13 2018-10-18 ナント・ホールデイングス・アイ・ピー・エル・エル・シー System and method for rendering augmented reality content by albedo model
CN109632088A (en) * 2019-01-17 2019-04-16 南京易纹兴智能科技有限公司 A kind of automatic control system of multiple light courcess luminance detection and correction

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102159994B1 (en) 2014-01-22 2020-09-25 삼성전자주식회사 Time of flight camera device and and driving method thereof

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008016054A (en) * 2004-11-04 2008-01-24 Nec Corp Three-dimensional shape-estimating system and image-generating system
US7860340B2 (en) 2004-11-04 2010-12-28 Nec Corporation Three-dimensional shape estimation system and image generation system
JP4623320B2 (en) * 2004-11-04 2011-02-02 日本電気株式会社 Three-dimensional shape estimation system and image generation system
JP2006313549A (en) * 2005-05-03 2006-11-16 Seac02 Srl Augmented reality system for identifying real marker object
JP2015059849A (en) * 2013-09-19 2015-03-30 凸版印刷株式会社 Method and device for measuring color and three-dimensional shape
JP2018163692A (en) * 2014-05-13 2018-10-18 ナント・ホールデイングス・アイ・ピー・エル・エル・シー System and method for rendering augmented reality content by albedo model
US10685498B2 (en) 2014-05-13 2020-06-16 Nant Holdings Ip, Llc Augmented reality content rendering via albedo models, systems and methods
US11176754B2 (en) 2014-05-13 2021-11-16 Nant Holdings Ip, Llc Augmented reality content rendering via albedo models, systems and methods
US11710282B2 (en) 2014-05-13 2023-07-25 Nant Holdings Ip, Llc Augmented reality content rendering via Albedo models, systems and methods
JP2015232487A (en) * 2014-06-09 2015-12-24 株式会社キーエンス Image inspection device, image inspection method, image inspection program and computer readable recording medium, and apparatus having image inspection program recorded therein
CN109632088A (en) * 2019-01-17 2019-04-16 南京易纹兴智能科技有限公司 A kind of automatic control system of multiple light courcess luminance detection and correction
CN109632088B (en) * 2019-01-17 2024-02-02 南京易纹兴智能科技有限公司 Automatic control system for detecting and correcting illuminance of multiple light sources

Also Published As

Publication number Publication date
JP4213327B2 (en) 2009-01-21

Similar Documents

Publication Publication Date Title
CN104335005B (en) 3D is scanned and alignment system
US9972120B2 (en) Systems and methods for geometrically mapping two-dimensional images to three-dimensional surfaces
JP3962588B2 (en) 3D image processing method, 3D image processing apparatus, 3D image processing system, and 3D image processing program
US7769205B2 (en) Fast three dimensional recovery method and apparatus
WO2021140886A1 (en) Three-dimensional model generation method, information processing device, and program
JP4284664B2 (en) Three-dimensional shape estimation system and image generation system
CN106705849B (en) Calibrating Technique For The Light-strip Sensors
WO2013008804A1 (en) Measurement device and information processing device
JP2001506384A (en) Apparatus and method for three-dimensional surface shape reconstruction
JP2003130621A (en) Method and system for measuring three-dimensional shape
EP3382645B1 (en) Method for generation of a 3d model based on structure from motion and photometric stereo of 2d sparse images
CN109242898B (en) Three-dimensional modeling method and system based on image sequence
US20020150288A1 (en) Method for processing image data and modeling device
WO2020075252A1 (en) Information processing device, program, and information processing method
JP4977436B2 (en) Light source position estimation device
JP4213327B2 (en) Method and apparatus for estimating light source direction and three-dimensional shape, and recording medium
JP6237032B2 (en) Color and three-dimensional shape measuring method and apparatus
D'Apuzzo Automated photogrammetric measurement of human faces
Fisher et al. A hand-held optical surface scanner for environmental modeling and virtual reality
KR20060065800A (en) Apparatus and method for 3d reconstruction of objects with depth discontinuities using helmholtz stereopsis
WO2018056802A1 (en) A method for estimating three-dimensional depth value from two-dimensional images
WO2013142819A1 (en) Systems and methods for geometrically mapping two-dimensional images to three-dimensional surfaces
JP2001084380A (en) Method and device for estimating light source direction and recording medium
CN114241059A (en) Synchronous calibration method for camera and light source in photometric stereo vision system
Shinozaki et al. Correction of color information of a 3D model using a range intensity image

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050912

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20061201

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080807

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080819

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080929

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20081030

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111107

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121107

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees