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

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

Info

Publication number
JP2017134561A
JP2017134561A JP2016013011A JP2016013011A JP2017134561A JP 2017134561 A JP2017134561 A JP 2017134561A JP 2016013011 A JP2016013011 A JP 2016013011A JP 2016013011 A JP2016013011 A JP 2016013011A JP 2017134561 A JP2017134561 A JP 2017134561A
Authority
JP
Japan
Prior art keywords
model
reflection
image processing
light source
processing apparatus
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.)
Pending
Application number
JP2016013011A
Other languages
Japanese (ja)
Inventor
義明 井田
Yoshiaki Ida
義明 井田
智暁 井上
Tomoaki Inoue
智暁 井上
祐一 楠美
Yuichi Kusumi
祐一 楠美
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2016013011A priority Critical patent/JP2017134561A/en
Publication of JP2017134561A publication Critical patent/JP2017134561A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To robustly acquire surface normal information even though there are mirror reflection and diffuse reflection not based on the cosine rule of Lambert with respect to a subject with unknown reflection characteristic.SOLUTION: An image processing unit 104 acquires surface normal information of a subject by using a plurality of captured images generated by capturing the subject under four or more light source conditions with mutually-different light source positions. The image processing unit 104 includes: a memory 112 which stores a plurality of reflection characteristic models; a luminance information acquisition part 104e which acquires luminance information on the subject from the plurality of captured images; a selection part 104a which selects a specific model out of the plurality of reflection characteristic models on the basis of the luminance information; and a normal estimation part 104b which acquires normal information by using the change in the luminance information according to the light source conditions and the specific model.SELECTED DRAWING: Figure 2

Description

本発明は、撮像により得られた画像を用いて被写体の法線情報を取得する技術に関する。   The present invention relates to a technique for acquiring normal line information of a subject using an image obtained by imaging.

デジタルカメラ等の撮像装置で被写体を撮像して得られた画像から、被写体の形状情報として面法線の情報(以下、法線情報という)を取得する方法が知られている。面法線情報を取得する方法としては、レーザ光を用いた三角測量や2眼ステレオ法等の方法で取得した距離情報から求めた三次元形状を面法線情報に変換する方法や、非特許文献1にて開示された照度差ステレオ法や、偏光情報から法線情報を推定する方法がある。   There is known a method of acquiring surface normal information (hereinafter referred to as normal information) as shape information of a subject from an image obtained by imaging the subject with an imaging device such as a digital camera. As a method of acquiring surface normal information, a method of converting a three-dimensional shape obtained from distance information acquired by a method such as triangulation using a laser beam or a binocular stereo method into surface normal information, or non-patent There are a photometric stereo method disclosed in Document 1 and a method for estimating normal information from polarization information.

照度差ステレオ法は、被写体の面法線と光源方向に基づいた反射特性を仮定し、複数の光源位置での被写体の輝度情報と仮定した反射特性とから面法線を決定する方法である。被写体の反射特性としてはランバートの余弦則に従うランバート反射モデルが用いられることが多い。   The illuminance difference stereo method is a method for determining a surface normal from the luminance information of the subject at a plurality of light source positions and the assumed reflection characteristic, assuming a reflection characteristic based on the surface normal of the subject and the light source direction. A Lambertian reflection model that follows Lambert's cosine law is often used as the reflection characteristic of the subject.

一般に、物体での反射には、鏡面反射と拡散反射とがある。鏡面反射は、物体表面での正反射であり、物体表面(界面)においてフレネルの式に従うフレネル反射である。拡散反射は、被写体の表面を透過した後に物体内部で散乱されて光が返ってくる反射である。鏡面反射した光は上述のランバートの余弦則では表せず、撮像装置で観測される被写体からの反射光に鏡面反射光が含まれていると、照度差ステレオ法では面法線が正確に求まらない。光源からの光が当たらない陰影部においても仮定した反射モデルからのずれが生じ、被写体の面法線情報を正確に取得することができない。さらに、表面の粗い被写体などでは拡散反射成分もランバートの余弦則からずれを生じる。   In general, reflection by an object includes specular reflection and diffuse reflection. The specular reflection is regular reflection on the object surface and is Fresnel reflection according to the Fresnel equation on the object surface (interface). The diffuse reflection is a reflection in which light returns after being scattered inside the object after passing through the surface of the subject. The specularly reflected light is not expressed by the Lambert's cosine law described above. If the reflected light from the subject observed by the imaging device contains specularly reflected light, the surface normal can be accurately obtained by the illuminance difference stereo method. Not. Even in a shaded portion where light from the light source does not strike, a deviation from the assumed reflection model occurs, and the surface normal information of the subject cannot be acquired accurately. Further, in a subject having a rough surface, the diffuse reflection component also deviates from Lambert's cosine law.

例えば、特許文献1には、4つ以上の光源を使用して得られた複数の面法線候補から真の面法線を求める方法が開示されている。   For example, Patent Document 1 discloses a method for obtaining a true surface normal from a plurality of surface normal candidates obtained by using four or more light sources.

法線情報を偏光情報から推定する方法では、偏光情報として偏光度と偏光方位を用いる方法が知られている。特許文献2には、光源から放射される偏光または光源位置を変化させた場合の偏光状態から拡散反射領域を分割し、拡散反射領域に対して照度差ステレオ法を用いる方法が開示されている。特許文献3には反射特性モデルが既知である被写体に対して、拡散反射と鏡面反射が同時に存在していても面法線を求める方法が開示されている。   As a method for estimating normal line information from polarization information, a method using polarization degree and polarization direction as polarization information is known. Patent Document 2 discloses a method in which a diffuse reflection region is divided based on polarization emitted from a light source or a polarization state when the light source position is changed, and an illuminance difference stereo method is used for the diffuse reflection region. Patent Document 3 discloses a method for obtaining a surface normal for a subject whose reflection characteristic model is known even if diffuse reflection and specular reflection exist at the same time.

特開2010−122158号公報JP 2010-122158 A 特許第4435865号公報Japanese Patent No. 4435865 特開2004−279187号公報JP 2004-279187 A

松下康之、“照度差ステレオ”、情報処理学会研究報告、Vol.2011−CVIM−177、No.29、pp.1−12、2011Matsushita Yasuyuki, “Photometric Stereo”, Information Processing Society of Japan, Vol. 2011-CVIM-177, no. 29, pp. 1-12, 2011

しかしながら、特許文献1にて開示された方法では、拡散反射の少ない鏡面被写体に対して、被写体の面法線情報を取得できない。また、光源からの光が当たらない陰影部が生じる場合や鏡面反射が複数の光源条件で観測される場合に誤った面法線情報を取得してしまい、誤った面法線を取得してしまっていること自体も知りえない。さらに、鏡面反射成分を含む複数解がそれぞれ近いベクトルとなる理論的根拠はなく、実際にばらけることがある。よって、複数の面法線候補に正しい解が仮に含まれていても、最も乖離した候補を選ぶことで正しい解を得ることはできない。被写体の拡散反射成分がランバートの余弦則に従わない場合もあり、そのような場合には正しい面法線を推定できない。   However, the method disclosed in Patent Document 1 cannot acquire surface normal information of a subject with respect to a specular subject with little diffuse reflection. Also, if there is a shaded part that is not exposed to light from the light source or if specular reflection is observed under multiple light source conditions, incorrect surface normal information is acquired, and an incorrect surface normal is acquired. I do not know what it is. Furthermore, there is no theoretical basis for a plurality of solutions including specular reflection components being close vectors, and the solutions may actually vary. Therefore, even if the correct solution is included in the plurality of surface normal candidates, the correct solution cannot be obtained by selecting the most distant candidate. In some cases, the diffuse reflection component of the subject does not follow Lambert's cosine law. In such a case, the correct surface normal cannot be estimated.

また、特許文献2の方法では、拡散反射領域のみで照度差ステレオ法を適用するため、鏡面反射領域では面法線情報を取得できない。また、事前に拡散反射領域を決定する工程が必要となる。さらに、特許文献1と同様、被写体の拡散反射成分がランバートの余弦則に従わない場合に正しい面法線を推定できない。   Further, in the method of Patent Document 2, since the illuminance difference stereo method is applied only in the diffuse reflection region, the surface normal information cannot be acquired in the specular reflection region. Moreover, the process of determining a diffuse reflection area | region in advance is required. Further, as in Patent Document 1, a correct surface normal cannot be estimated when the diffuse reflection component of the subject does not follow Lambert's cosine law.

特許文献3の方法では、事前に被写体の反射特性モデルが既知である必要がある。また、鏡面反射成分が含まれるモデルを使用した場合は、鏡面反射成分が観測されない場合も常に鏡面反射成分が含まれるモデルで面法線を推定するために、推定処理を高速に行うことができない。   In the method of Patent Document 3, the reflection characteristic model of the subject needs to be known in advance. In addition, when a model that includes a specular reflection component is used, even if the specular reflection component is not observed, the surface normal is always estimated using the model that includes the specular reflection component, so the estimation process cannot be performed at high speed. .

本発明は、反射特性が未知の被写体に対して、鏡面反射やランバートの余弦則に従わない拡散反射があっても、ロバストに面法線情報を取得可能な画像処理装置等を提供する。   The present invention provides an image processing apparatus and the like that can robustly acquire surface normal information even when there is specular reflection or diffuse reflection that does not follow Lambert's cosine law for an object with unknown reflection characteristics.

本発明の一側面としての画像処理装置は、光源の位置が互いに異なる4つ以上の光源条件での被写体の撮像により生成された複数の撮影画像を用いて被写体の表面の法線情報を取得する。該装置は、複数の反射特性モデルを記憶した記憶手段と、複数の撮影画像から被写体の輝度情報を取得する輝度情報取得手段と、輝度情報に基づいて複数の反射特性モデルのうち特定モデルを選択する選択手段と、光源条件に応じた輝度情報の変化と特定モデルとを用いて法線情報を取得する法線情報取得手段とを有することを特徴とする。   An image processing apparatus according to an aspect of the present invention acquires normal information on a surface of a subject using a plurality of captured images generated by imaging the subject under four or more light source conditions with different light source positions. . The apparatus includes a storage unit that stores a plurality of reflection characteristic models, a luminance information acquisition unit that acquires luminance information of a subject from a plurality of captured images, and selects a specific model from the plurality of reflection characteristic models based on the luminance information And a normal information acquisition unit that acquires normal information using a change in luminance information according to a light source condition and a specific model.

なお、上記画像処理装置と撮影画像を得るための撮像を行う撮像手段とを有する撮像装置も、本発明の他の一側面を構成する。   Note that an imaging apparatus that includes the image processing apparatus and an imaging unit that performs imaging to obtain a captured image also constitutes another aspect of the present invention.

また、コンピュータに上記画像処理装置としての動作を行わせるコンピュータプログラムとしての画像処理プログラムも、本発明の他の一側面を構成する。   An image processing program as a computer program that causes a computer to perform the operation as the image processing apparatus constitutes another aspect of the present invention.

本発明によれば、反射特性が未知の被写体に対して、鏡面反射やランバートの余弦則に従わない拡散反射があっても、ロバストに面法線情報を取得することができる。   According to the present invention, surface normal information can be acquired robustly even if there is specular reflection or diffuse reflection that does not follow Lambert's cosine law for an object with unknown reflection characteristics.

本発明の実施例1における画像処理を示すフローチャート。3 is a flowchart showing image processing in Embodiment 1 of the present invention. 実施例1の撮像装置の構成を示す図。1 is a diagram illustrating a configuration of an imaging apparatus according to Embodiment 1. FIG. 本発明の実施例2における画像処理を示すフローチャート。9 is a flowchart showing image processing in Embodiment 2 of the present invention. 本発明の実施例3における画像処理を示すフローチャート。10 is a flowchart showing image processing in Embodiment 3 of the present invention. 反射特性モデルの模式図。(A)はランバート反射、(B)は鏡面反射+ランバート反射、(C)はランバート反射とは異なる拡散反射を示す。The schematic diagram of a reflection characteristic model. (A) shows Lambertian reflection, (B) shows specular reflection + Lambertian reflection, and (C) shows diffuse reflection different from Lambertian reflection. 簡略化されたTorrance-Sparrowモデルを示す図。The figure which shows the simplified Torrance-Sparrow model.

以下、本発明の実施例について図面を参照しながら説明する。
まず具体的な実施例の説明に先立って、各実施例に共通する事項について説明する。各実施例は、被写体の表面の面法線に関する情報である法線情報を取得するために用いられる撮像装置であり、一般の被写体に対してロバストに面法線情報を取得できる。
Embodiments of the present invention will be described below with reference to the drawings.
Prior to description of specific embodiments, items common to each embodiment will be described. Each embodiment is an imaging apparatus used to acquire normal information that is information related to a surface normal of a subject, and can acquire surface normal information robustly with respect to a general subject.

法線情報(面法線情報)とは、面法線の1自由度の候補を少なくとも1つ以上決定する情報、面法線の複数の解候補から真の解を選択するための情報および求めた面法線の妥当性に関する情報である。   Normal information (surface normal information) is information for determining at least one candidate for one degree of freedom of surface normal, information for obtaining a true solution from a plurality of solution candidates for surface normal, and a request This is information on the validity of the surface normal.

光源位置(光源条件)による輝度情報の変化に基づいて被写体の面法線情報を取得する方法としては照度差ステレオ法を用いるとよい。照度差ステレオ法は、被写体の面法線と光源方向に基づいた反射特性を仮定し、複数の光源位置での被写体の輝度情報と仮定した反射特性から面法線を決定する方法である。仮定する反射特性はある面法線と光源位置が与えられたときに反射率が一意に定まればよいが、被写体の反射特性が未知の場合はランバートの余弦則に従うランバート反射モデルで近似すればよい。また、鏡面反射成分は図6に示した光源ベクトルsと視線方向ベクトルvの2等分線と面法線nのなす角に反射率が依存する。したがって、前述した反射特性は視線方向にも基づく特性としてもよい。照度差ステレオ法に用いる輝度情報は、既知の光源が点灯している場合と消灯している場合のそれぞれの画像を撮像し、これらの差分をとることで環境光等、既知の光源以外の光源による影響を除いてもよい。以下では、ランバート反射モデルを仮定した場合を説明する。   An illuminance difference stereo method may be used as a method for acquiring surface normal information of a subject based on a change in luminance information depending on a light source position (light source condition). The illuminance-difference stereo method is a method for determining a surface normal from a reflection characteristic based on luminance information of a subject at a plurality of light source positions and a reflection characteristic based on the surface normal of the subject and a light source direction. Assuming that the reflectance is uniquely determined when a certain surface normal and light source position are given, if the subject's reflectance is unknown, it can be approximated by a Lambert reflection model that follows Lambert's cosine law. Good. Further, the reflectance of the specular reflection component depends on the angle formed by the bisector of the light source vector s and the line-of-sight direction vector v and the surface normal n shown in FIG. Therefore, the above-described reflection characteristics may be based on the line-of-sight direction. Luminance information used in the illuminance difference stereo method captures images when the known light source is turned on and off, and by taking the difference between them, light sources other than known light sources, such as ambient light You may exclude the influence by. Hereinafter, a case where a Lambertian reflection model is assumed will be described.

反射光の輝度をiとは、物体のランバート拡散反射率をρdとし、入射光の強さをEとし、物体から光源への方向を示す単位ベクトル(光源方向ベクトル)をsとし、物体の単位面法線ベクトルをnとする。このとき、ランバートの余弦則から、   The luminance of the reflected light is i, the Lambertian diffuse reflectance of the object is ρd, the intensity of the incident light is E, the unit vector (light source direction vector) indicating the direction from the object to the light source is s, and the unit of the object Let the surface normal vector be n. At this time, from Lambert's cosine law,

と表せる。ここで異なるM個(M≧3)の光源方向s1,s2,・・・,sMで得られた輝度値i1,i2,・・・iMとすると(1)式から以下のように表せる。 It can be expressed. If the luminance values i1, i2,..., IM obtained in different M (M ≧ 3) light source directions s1, s2,..., SM are expressed from the equation (1) as follows.

ここで左辺はM行1列の輝度ベクトルであり、右辺の[s1T,・・・,sMT]はM行3列の光源方向を示す入射光行列Sである。また、nは3行1列の単位面法線ベクトルである。M=3の場合は入射光行列Sの逆行列を左から乗じることで、Eρdnが下記のように求まる。 Here, the left side is a luminance vector of M rows and 1 column, and [s1T,..., SMT] on the right side is an incident light matrix S indicating the light source direction of M rows and 3 columns. N is a unit surface normal vector of 3 rows and 1 column. In the case of M = 3, Eρdn is obtained as follows by multiplying the inverse matrix of the incident light matrix S from the left.

左辺のベクトルのノルムがEとρdの積であり、正規化したベクトルが物体の面法線ベクトルとして求まる。ここから分かるように、Eとρdは積の形でのみ条件式に現れるので、Eρdで1つの変数として見ると、単位面法線ベクトルの2自由度と合わせて未知の3変数を決定する連立方程式とみなせる。よって、3つの光源条件で輝度情報を取得することで方程式が3つ得られ、解を決定することができる。なお、入射光行列Sが正則でない場合は逆行列が存在しないため、光源方向s1〜s3をSが正則となるように選択する必要がある。つまり、s3をs1とs2に対して線形独立に選ぶことが望ましい。   The norm of the vector on the left side is the product of E and ρd, and the normalized vector is obtained as the surface normal vector of the object. As can be seen from this, since E and ρd appear in the conditional expression only in the form of a product, when viewed as one variable in Eρd, the simultaneous three-variable that determines the unknown three variables together with the two degrees of freedom of the unit surface normal vector. It can be regarded as an equation. Therefore, by obtaining luminance information under three light source conditions, three equations can be obtained and a solution can be determined. When the incident light matrix S is not regular, there is no inverse matrix, so it is necessary to select the light source directions s1 to s3 so that S is regular. That is, it is desirable to select s3 linearly independent of s1 and s2.

一方、M>3の場合は求める未知変数より多い条件式が得られる。このときは任意に選択した3つの条件式から上記と同様の方法で面法線ベクトルを求めることができる。4つ以上の条件式を用いる場合は入射光行列Sが正方行列ではなくなるため、例えば、Moore-Penrose疑似逆行列を使って近似解を求めればよい。   On the other hand, when M> 3, more conditional expressions are obtained than the unknown variable to be obtained. In this case, the surface normal vector can be obtained from three arbitrarily selected conditional expressions by the same method as described above. When four or more conditional expressions are used, since the incident light matrix S is not a square matrix, for example, an approximate solution may be obtained using a Moore-Penrose pseudo inverse matrix.

また、行列計算を用いなくとも、既存のフィッティング手法や最適化手法によって解を求めてもよい。特に、被写体の反射特性をランバート反射モデル以外のモデルで仮定した場合は条件式が単位面法線ベクトルnの各成分や反射特性モデルの未知係数に対する線形方程式でなくなることがある。この場合は、行列計算ができず、既存のフィッティング手法や最適化手法によって解を求めることとなる。前述のように反射特性モデルfは、光源ベクトルs、視線方向ベクトルv、面法線nおよび未知係数Xに依存し、以下のように表される。   Further, the solution may be obtained by an existing fitting method or optimization method without using matrix calculation. In particular, when the reflection characteristic of the subject is assumed by a model other than the Lambertian reflection model, the conditional expression may not be a linear equation for each component of the unit surface normal vector n or an unknown coefficient of the reflection characteristic model. In this case, matrix calculation cannot be performed, and a solution is obtained by an existing fitting method or optimization method. As described above, the reflection characteristic model f depends on the light source vector s, the line-of-sight direction vector v, the surface normal n, and the unknown coefficient X, and is expressed as follows.

ここで、Xは反射特性モデルの係数ベクトルであり、係数の数と等しい次元を持つ。このうちm個の係数が未知であるとすると、(4)式は面法線ベクトルと合わせてm+2個の未知変数を含む。このとき、光源位置の条件数だけ方程式が得られ、既知のフィッティング手法や最適化手法を用いることができる。例えば、 Here, X is a coefficient vector of the reflection characteristic model, and has a dimension equal to the number of coefficients. If m coefficients are unknown, equation (4) includes m + 2 unknown variables together with the surface normal vector. At this time, equations are obtained as many as the condition number of the light source position, and a known fitting method or optimization method can be used. For example,

を最小化すればよい。
また、反射特性モデルfが視線方向ベクトルvに依存する場合は、視線方向を変化させることによっても方程式の数を増やすことができる。
Should be minimized.
When the reflection characteristic model f depends on the line-of-sight direction vector v, the number of equations can be increased also by changing the line-of-sight direction.

また、M−1以下の条件式から解を得られる場合は、条件式の組み合わせの数だけ解を得ることができ、複数の面法線候補を求めることもできる。この場合は、特許文献1の方法や後述の方法によって解を選択するとよい。   Moreover, when a solution can be obtained from conditional expressions of M-1 or less, it is possible to obtain solutions as many as the number of combinations of conditional expressions, and it is also possible to obtain a plurality of surface normal candidates. In this case, the solution may be selected by the method of Patent Document 1 or the method described later.

面法線ベクトルの解の候補が複数求まる場合、さらに別の条件から解を選択するとよい。例えば、面法線ベクトルの連続性を条件として用いることができる。面法線を撮像装置の1画素ごとに算出する場合、画素(x,y)での面法線n(x,y)として、n(x−1,y)が既知であれば評価関数である、   When a plurality of surface normal vector solution candidates are obtained, the solution may be selected from yet another condition. For example, continuity of surface normal vectors can be used as a condition. When calculating the surface normal for each pixel of the imaging device, if n (x-1, y) is known as the surface normal n (x, y) at the pixel (x, y), an evaluation function is used. is there,

が最小となる解を選択するとよい。n(x+1,y)やn(x,y±1)も既知であれば、 Choose a solution that minimizes. If n (x + 1, y) and n (x, y ± 1) are also known,

が最小となるような解を選択するとよい。既知の面法線がなく、全画素位置で面法線の不定性があるとすれば、全画素での総和である、 Choose a solution that minimizes. If there is no known surface normal and the surface normal is indefinite at all pixel positions, it is the sum of all pixels.

が最小となるように解を選択してもよい。 The solution may be selected so that is minimized.

上記は一例であり、注目画素の最近傍以外の画素での面法線情報を用いたり、注目画素の位置からの距離に応じて重みをつけた評価関数としたりしてもよい。   The above is an example, and surface normal information at a pixel other than the nearest pixel of the target pixel may be used, or an evaluation function weighted according to the distance from the position of the target pixel may be used.

複数候補から解を選択する場合には、奥行き情報を利用してもよい。奥行き情報は前述のレーザ光を用いた三角測量や2眼ステレオなどの方法で取得できる。奥行き情報から求めた三次元形状を面法線情報へ変換することで面法線ベクトルが算出できる。前述したように、この方法で求めた面法線ベクトルは精度が十分ではない。しかし、複数の面法線ベクトルの解候補が既に求まっている場合は、1つの解に決定するための参考情報とすることができる。すなわち、複数の面法線ベクトルの解候補のうち、奥行き情報により求めた面法線ベクトルに最も近い候補を選択するとよい。   When selecting a solution from a plurality of candidates, depth information may be used. Depth information can be acquired by a method such as triangulation using the laser beam described above or binocular stereo. A surface normal vector can be calculated by converting the three-dimensional shape obtained from the depth information into surface normal information. As described above, the surface normal vector obtained by this method is not accurate enough. However, when solution candidates for a plurality of surface normal vectors have already been obtained, it can be used as reference information for determining one solution. That is, it is preferable to select a candidate closest to the surface normal vector obtained from the depth information from among a plurality of surface normal vector solution candidates.

各実施例の画像処理装置は、光源位置が互いに異なる4つ以上の光源条件での被写体の撮像により生成された複数の撮影画像を用いて被写体の表面の法線情報を取得する。具体的には、複数の反射特性モデルを記憶した記憶部(記憶手段)と、複数の撮影画像から被写体の輝度情報を取得する輝度情報取得部(輝度情報取得手段)とを有する。さらに、輝度情報に基づいて上記複数の反射特性モデルのうち特定モデルを選択する選択部(選択手段)と、光源位置に応じた輝度情報の変化と特定モデルとを用いて法線情報を取得する法線情報取得部(法線情報取得手段)を有する。   The image processing apparatus according to each embodiment acquires normal information on the surface of the subject using a plurality of captured images generated by imaging the subject under four or more light source conditions having different light source positions. Specifically, a storage unit (storage unit) that stores a plurality of reflection characteristic models and a luminance information acquisition unit (luminance information acquisition unit) that acquires luminance information of the subject from a plurality of captured images. Further, normal information is acquired using a selection unit (selection unit) that selects a specific model from the plurality of reflection characteristic models based on the luminance information, a change in luminance information according to the light source position, and the specific model. It has a normal information acquisition unit (normal information acquisition means).

光源位置(光源条件)が異なる複数の画像を取得することで、照度差ステレオ法によって、光源位置に応じた輝度情報の変化から被写体の面法線情報を取得することができる。照度差ステレオ法では、光源位置に応じた輝度情報の変化に基づいて法線情報を推定する際に反射特性モデルを用いる。反射特性モデルとは、被写体の面法線と光源方向ベクトルの関係に対してある角度方向への反射率を一意に定めるものである。また、前述のように視線方向にも基づく特性としてもよい。反射特性モデルとしては、例えば被写体の反射率を被写体の面法線と光源方向ベクトルのなす角の関数として定めればよい。よく使われるモデルとしては、前述したランバート反射モデル以外に、Phongモデル、Torrance-Sparrowモデル、Cook-Torranceモデル、Oren-Nayerモデル等があり、モデルによって適合する被写体が限られる。   By acquiring a plurality of images with different light source positions (light source conditions), the surface normal information of the subject can be acquired from the change in luminance information according to the light source position by the illuminance difference stereo method. In the illuminance difference stereo method, a reflection characteristic model is used when estimating normal information based on a change in luminance information according to a light source position. The reflection characteristic model uniquely determines the reflectance in a certain angular direction with respect to the relationship between the surface normal of the subject and the light source direction vector. Moreover, it is good also as a characteristic based also on a gaze direction as mentioned above. As the reflection characteristic model, for example, the reflectance of the subject may be determined as a function of the angle formed by the surface normal of the subject and the light source direction vector. Commonly used models include the Phong model, the Torrance-Sparrow model, the Cook-Torrance model, the Oren-Nayer model, and the like in addition to the Lambertian reflection model described above.

既存の手法では、反射特性を事前に測定するか仮定した反射特性モデルを用いて法線情報を推定していた。しかし、一般の被写体で法線情報を推定しようとした場合、あらゆる物体の反射特性を事前に測定することは困難である。一方、仮定した反射特性モデルを用いると、被写体の反射特性がその仮定したモデルと異なる場合に誤った法線情報を推定してしまう。   In the existing method, normal information is estimated using a reflection characteristic model in which the reflection characteristic is preliminarily measured or assumed. However, when normal information is to be estimated for a general subject, it is difficult to measure the reflection characteristics of all objects in advance. On the other hand, when the assumed reflection characteristic model is used, incorrect normal information is estimated when the reflection characteristic of the subject is different from the assumed model.

そこで、反射特性モデルを予め複数記憶しておき、輝度情報に基づいて使用する反射特性モデル(特定モデル)を選択することで、より広範な未知の被写体に対して、法線情報を推定することができる。複数のモデルに対して精度良く法線情報を推定するためには、4つ以上の光源条件で輝度情報を取得する必要がある。また、予め必要十分に記録した反射特性モデルを用いることで、外部との通信により新たに反射特性モデルを取得する必要や被写体に合わせた反射特性モデルを作成する必要がなくなり、高速に法線情報を推定することができる。また、外部との通信の可否によらずに、未知の被写体に対して法線情報を推定することが可能となる。   Therefore, it is possible to estimate normal information for a wider range of unknown subjects by storing a plurality of reflection characteristic models in advance and selecting a reflection characteristic model (specific model) to be used based on luminance information. Can do. In order to accurately estimate normal information for a plurality of models, it is necessary to acquire luminance information under four or more light source conditions. In addition, by using a reflection characteristic model recorded in advance and sufficiently, there is no need to obtain a new reflection characteristic model by communication with the outside or to create a reflection characteristic model tailored to the subject. Can be estimated. In addition, normal information can be estimated for an unknown subject regardless of whether or not communication with the outside is possible.

各実施例の画像処理装置は、輝度情報と反射特性モデル(特定モデル)とのずれ量を算出するモデルずれ量算出部(モデルずれ量算出手段)と、ずれ量と所定値(閾値)との大小を判定するモデル判定部(モデル判定手段)とを有していてもよい。前述したように、被写体の反射特性が仮定したモデルと異なる場合には、誤った法線情報を推定してしまう。ずれ量を算出し、閾値との大小を判定することで、輝度情報に基づいて、各反射特性モデルが被写体に適合するか否かを知ることができる。すなわち、ずれ量が閾値より小さい場合は特定モデルを用いて法線情報を取得することを許容し、ずれ量が閾値より大きい場合は複数の反射特性モデルのうち特定モデルとは異なる反射特性モデルを選択部に選択させるようにすることが望ましい。   The image processing apparatus according to each embodiment includes a model deviation amount calculation unit (model deviation amount calculation unit) that calculates a deviation amount between the luminance information and the reflection characteristic model (specific model), and a deviation amount and a predetermined value (threshold value). You may have the model determination part (model determination means) which determines magnitude. As described above, if the reflection characteristic of the subject is different from the assumed model, incorrect normal information is estimated. By calculating the amount of deviation and determining the magnitude of the threshold, it is possible to know whether each reflection characteristic model is suitable for the subject based on the luminance information. That is, when the amount of deviation is smaller than the threshold, it is allowed to acquire normal information using a specific model, and when the amount of deviation is larger than the threshold, a reflection characteristic model different from the specific model is selected from a plurality of reflection characteristic models. It is desirable to let the selection unit select.

各実施例においては、上記ずれ量を輝度情報と反射特性モデル(特定モデル)に基づいて算出される輝度値との比較に基づいて算出してもよい。また、上記ずれ量を、輝度情報から算出した反射特性モデル(特定モデル)の係数値(パラメタ)に基づいて算出してもよい。また、上記ずれ量を輝度情報から求めた複数の面法線候補のばらつきを用いて算出してもよい。   In each embodiment, the deviation amount may be calculated based on a comparison between luminance information and a luminance value calculated based on a reflection characteristic model (specific model). The deviation amount may be calculated based on a coefficient value (parameter) of a reflection characteristic model (specific model) calculated from luminance information. Further, the deviation amount may be calculated using variations of a plurality of surface normal candidates obtained from the luminance information.

また、特定モデルとしての反射特性モデルのうち上記ずれ量が閾値より小さい領域で該反射特性モデルの使用を許容するようにしてもよい。ずれ量に対して閾値を設定することで、ずれ量が閾値より小さい領域では、ずれ量算出に用いた反射特性モデルが被写体に対して適合していると判定できる。このような領域では反射特性モデルに基づくことで精度良く法線情報の推定を行うことができる。また、上記ずれ量が閾値より大きい領域では、特定モデルとは異なる反射特性モデルを選択部に選択させるようにしてもよい。ずれ量が閾値より大きい領域ではずれ量算出に用いた反射特性モデルが被写体に対して適合していないと判定できる。このような領域では別の反射特性モデルを用いることでより広範な被写体に対応することができる。   Further, the reflection characteristic model may be allowed to be used in an area where the deviation amount is smaller than a threshold value in the reflection characteristic model as the specific model. By setting a threshold value for the deviation amount, it can be determined that the reflection characteristic model used for calculating the deviation amount is suitable for the subject in a region where the deviation amount is smaller than the threshold value. In such a region, normal information can be accurately estimated based on the reflection characteristic model. Further, in a region where the deviation amount is larger than the threshold value, the selection unit may select a reflection characteristic model different from the specific model. In a region where the deviation amount is larger than the threshold value, it can be determined that the reflection characteristic model used for calculating the deviation amount is not suitable for the subject. In such a region, it is possible to deal with a wider range of subjects by using another reflection characteristic model.

複数の反射特性モデルには、ランバート反射モデルを含んでもよい。拡散反射成分は、特に平滑面においてランバート反射モデルに従うことも多く、このような被写体は数多く存在する。このため、反射特性モデルにランバート反射モデルを用いることで鏡面反射の少ない被写体の一部では比較的精度良く法線情報を推定できる。また、輝度が面法線ベクトルと光源方向ベクトルの内積で決まるため、行列演算によって簡易な計算で高速に法線情報を推定することができる。   The plurality of reflection characteristic models may include a Lambertian reflection model. Diffuse reflection components often follow a Lambertian reflection model, especially on smooth surfaces, and there are many such objects. For this reason, normal information can be estimated with comparatively high accuracy in a part of a subject with little specular reflection by using a Lambertian reflection model as a reflection characteristic model. Further, since the luminance is determined by the inner product of the surface normal vector and the light source direction vector, normal information can be estimated at high speed by simple calculation by matrix calculation.

また、複数の反射特性モデルには、ランバート反射モデルとは異なる拡散反射モデルを含んでもよい。表面の粗い非平滑面においては、一般に、拡散反射成分はランバート反射モデルには適合しない。つまり、被写体の表面構造が取得した輝度情報の解像度より細かい場合は、被写体の拡散反射を観測できてもランバート反射モデルでは誤った法線情報を推定してしまう。そこで、粗面、すなわち輝度情報より細かいピッチのマイクロファセットを考慮した拡散反射モデルを反射特性モデルとして持つ必要がある。これは、被写体と撮像倍率などの撮像条件との相互関係に依存するため、このような反射特性モデルを持つことで、より広範な被写体や撮像条件に対応した法線情報の推定が行えるようになる。   Further, the plurality of reflection characteristic models may include a diffuse reflection model different from the Lambertian reflection model. In general, the diffuse reflection component does not fit the Lambertian reflection model on a rough, non-smooth surface. In other words, if the surface structure of the subject is finer than the resolution of the acquired luminance information, the Lambertian reflection model estimates incorrect normal information even if the subject's diffuse reflection can be observed. Therefore, it is necessary to have a diffuse reflection model considering a rough surface, that is, a micro facet with a finer pitch than luminance information, as a reflection characteristic model. Since this depends on the correlation between the subject and the imaging conditions such as the imaging magnification, having such a reflection characteristic model makes it possible to estimate normal information corresponding to a wider range of subjects and imaging conditions. Become.

また、複数の反射特性モデルには、鏡面反射モデルを含んでもよい。鏡面反射はほとんどの被写体で観測されるため、反射特性モデルに鏡面反射モデルを含むことで、広範な被写体に対応した法線情報の推定が実現できる。ここでいう鏡面反射モデルとは、拡散反射成分を含まない、鏡面反射のみに対応したモデルのことを指す。   Further, the plurality of reflection characteristic models may include a specular reflection model. Since specular reflection is observed in almost all subjects, normal information corresponding to a wide range of subjects can be estimated by including the specular reflection model in the reflection characteristic model. Here, the specular reflection model refers to a model that does not include a diffuse reflection component and supports only specular reflection.

また、複数の反射特性モデルに拡散反射成分と鏡面反射成分の和からなる反射特性モデル(拡散/鏡面反射モデル)を含んでもよい。これにより、さらに広範な被写体に対応した法線情報の推定が実現できる。   In addition, a plurality of reflection characteristic models may include a reflection characteristic model (diffusion / specular reflection model) composed of the sum of a diffuse reflection component and a specular reflection component. This makes it possible to estimate normal information corresponding to a wider range of subjects.

また、選択部は、法線情報の推定に用いる1番目の特定モデルとして、ランバート反射モデルを選択してもよい。前述したように、ランバート反射モデルは行列計算を適用できるために高速な法線情報の推定が実行できる。輝度情報のみから事前に被写体の反射特性モデルを決定できない場合にランバート反射モデルを1番目の特定モデルとして選択することで、高速に処理することができる。   In addition, the selection unit may select a Lambertian reflection model as the first specific model used for estimation of normal information. As described above, since the Lambertian reflection model can apply matrix calculation, high-speed normal information estimation can be performed. When the reflection characteristic model of the subject cannot be determined in advance from only the luminance information, the Lambertian reflection model is selected as the first specific model, so that high-speed processing can be performed.

また、選択部は、法線情報の推定に用いる2番目の特定モデルとして、ランバート反射モデルとは異なる拡散反射モデルを選択してもよい。鏡面反射成分は特定の光源条件でしか観測されないことが多く、発生頻度が少ない。2番目の特定モデルとしてランバート反射モデルとは異なる拡散反射モデルを選択することで、多くの画像領域において未知の被写体の法線情報を推定することができる。   The selection unit may select a diffuse reflection model different from the Lambertian reflection model as the second specific model used for estimating the normal information. The specular reflection component is often observed only under a specific light source condition, and the frequency of occurrence is low. By selecting a diffuse reflection model different from the Lambertian reflection model as the second specific model, it is possible to estimate normal information of an unknown subject in many image regions.

また、選択部は法線情報の推定に用いる2番目の特定モデルとして、上述した拡散/鏡面反射モデルを選択してもよい。拡散反射における粗さによる誤差を無視した精度での法線情報が必要な場合に拡散/鏡面反射モデルを選択することで、広範な未知の被写体で法線情報を推定することができる。   In addition, the selection unit may select the above-described diffusion / specular reflection model as the second specific model used for estimating the normal information. When normal information with accuracy that ignores errors due to roughness in diffuse reflection is required, normal information can be estimated from a wide range of unknown subjects by selecting a diffusion / specular reflection model.

また。選択部は3つ以上の光源条件において拡散反射が取得された場合に、特定モデルとして拡散反射モデルを選択してもよい。法線情報の推定を行う前に、推定に必要な条件数だけの拡散反射成分が観測されたことが予め判定できた場合は、拡散反射モデルを特定モデルとして選択することで、推定に誤った反射特性モデルを選択する無駄をなくし、高速に法線情報を推定できる。   Also. The selection unit may select the diffuse reflection model as the specific model when diffuse reflection is acquired under three or more light source conditions. If it is possible to determine in advance that diffuse reflection components for the number of conditions necessary for the estimation have been observed before estimating the normal line information, selecting the diffuse reflection model as a specific model will result in an incorrect estimation. Normal information can be estimated at high speed without wasteful selection of the reflection characteristic model.

また、選択部は、4つ以上の光源条件において鏡面反射が取得された場合に、鏡面反射モデルを特定モデルとして選択してもよい。法線情報の推定を行う前に、推定に必要な条件数だけの鏡面反射成分が観測されたことが予め判定できた場合は、鏡面反射モデルまたは鏡面反射成分を含む反射特性モデルを特定モデルとして選択してもよい。この場合、推定に誤った反射特性モデルを選択する無駄をなくし、高速に法線情報を推定できる。   The selection unit may select the specular reflection model as the specific model when specular reflection is acquired under four or more light source conditions. Before estimating normal information, if it can be determined in advance that only the number of specular reflection components necessary for estimation has been observed, the specular reflection model or the reflection characteristic model including the specular reflection component is used as the specific model. You may choose. In this case, it is possible to eliminate the waste of selecting an incorrect reflection characteristic model for estimation and to estimate normal information at high speed.

また、選択部は、上記ずれ量に基づいて特定モデルを選択してもよい。選択部は選択した特定モデルと輝度情報のずれ量を算出し、その結果に基づいて反射特性モデルを再度選択してもよい。これによって、輝度情報のみから反射特性モデルを推定するよりも精度良く反射特性が未知の被写体に適合する反射特性モデルを選択することができる。もちろん、再度同じ反射特性モデルを選択してもよい。   The selection unit may select a specific model based on the amount of deviation. The selection unit may calculate a deviation amount between the selected specific model and the luminance information, and select the reflection characteristic model again based on the result. Accordingly, it is possible to select a reflection characteristic model that matches a subject whose reflection characteristic is unknown with higher accuracy than estimating the reflection characteristic model only from luminance information. Of course, the same reflection characteristic model may be selected again.

また、輝度情報取得部は輝度情報を撮影画像から取得し、法線情報取得部は撮影画像の画素ごとに独立して法線情報を推定してもよい。輝度情報の中で同じ反射特性を持つ被写体領域を知ることで、より少ない光源条件で法線情報を推定することができる。一方で、そのような方法では同じ反射特性を持つ被写体領域を決定する工程が必要となる。このとき処理が複雑になり計算時間がかかる上に、この工程での誤差が法線情報の推定誤差の原因となる。輝度情報から画素ごとに独立した推定を行うことで、このような推定誤差を防ぐことができる。画素ごとに輝度情報からの正確な法線情報の推定を行うためには被写体に適合した反射特性モデルを持つしかないが、本構成により、未知の被写体に対する高精度な法線情報の推定が実現できる。   The luminance information acquisition unit may acquire luminance information from the captured image, and the normal information acquisition unit may estimate the normal information independently for each pixel of the captured image. By knowing subject areas having the same reflection characteristics in the luminance information, it is possible to estimate normal information with fewer light source conditions. On the other hand, such a method requires a step of determining a subject area having the same reflection characteristics. At this time, the processing becomes complicated and takes a calculation time, and an error in this process causes an estimation error of normal information. Such estimation errors can be prevented by performing independent estimation for each pixel from the luminance information. In order to accurately estimate normal information from luminance information for each pixel, there is no choice but to have a reflection characteristic model that is suitable for the subject, but this configuration enables high-precision normal information estimation for unknown subjects. it can.

図2には、本発明の実施例1である撮像装置の構成を示す。撮像光学系101は、不図示の被写体からの光(被写体像)を撮像素子102上に結像させる。撮像光学系101と撮像素子102とにより撮像部(撮像手段)が構成される。撮像光学系101は絞り101aを含む。撮像素子102は、CCDセンサやCMOSセンサ等の光電変換素子により構成され、被写体像を光電変換する。   FIG. 2 shows the configuration of the image pickup apparatus that is Embodiment 1 of the present invention. The imaging optical system 101 forms light (subject image) from a subject (not shown) on the imaging element 102. The imaging optical system 101 and the imaging element 102 constitute an imaging unit (imaging means). The imaging optical system 101 includes a stop 101a. The image sensor 102 is composed of a photoelectric conversion element such as a CCD sensor or a CMOS sensor, and photoelectrically converts a subject image.

撮像素子102での光電変換により生成されたアナログ電気信号はA/Dコンバータ103でデジタル信号に変換され、該デジタル信号は画像処理部104に入力される。画像処理部104は、デジタル信号に対して一般に行われる画像処理と併せて、被写体の法線情報を推定する処理を行う。撮像装置は、投光部(投光手段)111に設けられ1つの光源を移動させたり複数の光源を選択的に点灯させたりすることで、光源位置が互いに異なる4つ以上の光源条件での被写体の撮像により複数の撮影画像を取得する。   An analog electric signal generated by photoelectric conversion in the image sensor 102 is converted into a digital signal by the A / D converter 103, and the digital signal is input to the image processing unit 104. The image processing unit 104 performs processing for estimating the normal information of the subject together with image processing generally performed on the digital signal. The imaging apparatus is provided in the light projecting unit (light projecting unit) 111, and moves one light source or selectively turns on a plurality of light sources, so that the light source positions are different under four or more light source conditions. A plurality of captured images are acquired by imaging the subject.

メモリ(記憶手段)112には、複数の反射特性モデルが予め記憶されている。画像処理部104は、上記複数の撮影画像から被写体の輝度情報を取得する輝度情報取得部104eと、該輝度情報に基づいてメモリ112内の複数の反射特性モデルのうち使用する特定モデルを選択する選択部104aとを有する。また、画像処理部104は、特定モデルに基づいて法線情報を推定する法線推定部(法線情報取得部)104bと、特定モデルと輝度情報とのずれ量を算出するモデルずれ量算出部104cとを有する。さらに、画像処理部104は、上記ずれ量と所定値としての閾値との大小判定を行うモデル判定部104dを有する。画像処理部104とメモリ112とにより画像処理装置が構成される。   The memory (storage means) 112 stores a plurality of reflection characteristic models in advance. The image processing unit 104 selects a luminance information acquisition unit 104e that acquires luminance information of a subject from the plurality of captured images, and a specific model to be used among a plurality of reflection characteristic models in the memory 112 based on the luminance information. And a selection unit 104a. The image processing unit 104 includes a normal estimation unit (normal information acquisition unit) 104b that estimates normal information based on the specific model, and a model deviation amount calculation unit that calculates a deviation amount between the specific model and the luminance information. 104c. Furthermore, the image processing unit 104 includes a model determination unit 104d that determines the size of the deviation amount and a threshold value as a predetermined value. The image processing unit 104 and the memory 112 constitute an image processing apparatus.

画像処理部104で処理された出力画像は、半導体メモリや光ディスク等の画像記録媒体108に保存される。また、出力画像を、表示部105に表示してもよい。   The output image processed by the image processing unit 104 is stored in an image recording medium 108 such as a semiconductor memory or an optical disk. Further, the output image may be displayed on the display unit 105.

情報入力部108は、ユーザが所望の撮像条件、例えば焦点距離、絞り値および露出時間(撮像時間)を選択して入力した情報を検知してシステムコントローラ110にそのデータを供給する。撮像制御部106は、システムコントローラ110からの情報に基づいて、撮像光学系101内の不図示のフォーカスレンズを移動させ、投光部111の発光を制御し、また絞り値、露出時間、波長選択性撮像フィルタおよび撮像素子102を制御する。これにより、必要な撮影画像を取得する。   The information input unit 108 detects information input by the user selecting desired imaging conditions, for example, focal length, aperture value, and exposure time (imaging time), and supplies the data to the system controller 110. The imaging control unit 106 moves a focus lens (not shown) in the imaging optical system 101 based on information from the system controller 110, controls light emission of the light projecting unit 111, and selects an aperture value, an exposure time, and a wavelength. The image pickup filter and the image pickup element 102 are controlled. Thereby, a necessary captured image is acquired.

状態検知部107はシステムコントローラ110の制御指示に応じて現在の撮像条件の情報を取得する。なお、撮像光学系101は、撮像装置1と一体に設けられていてもよいし、一眼レフカメラのように撮像装置1に対して交換可能であってもよい。   The state detection unit 107 acquires information on the current imaging condition in accordance with a control instruction from the system controller 110. Note that the imaging optical system 101 may be provided integrally with the imaging device 1 or may be replaceable with respect to the imaging device 1 like a single-lens reflex camera.

図1のフローチャートには、上述した法線情報を推定する画像処理の流れを示している。この画像処理は、それぞれコンピュータであるシステムコントローラ110および画像処理部104が、コンピュータプログラムとしての画像処理プログラムに従って実行する。このことは、後述する他の実施例でも同じである。また、この画像処理を必ずしもソフトウェア上で行う必要はなく、ハードウェア回路によって行ってもよい。   The flowchart of FIG. 1 shows a flow of image processing for estimating the normal information described above. This image processing is executed by the system controller 110 and the image processing unit 104, each of which is a computer, according to an image processing program as a computer program. This is the same in other embodiments described later. The image processing is not necessarily performed on software, and may be performed by a hardware circuit.

ステップS101では、システムコントローラ110は、撮像光学系101および撮像素子102により構成される撮像部を制御して複数(4つ以上)の光源位置での被写体の撮像を行い、複数の撮影画像を取得する。このとき、システムコントローラ110は、撮像制御部106を通じて、投光部111を制御し、さらに光源の発光強度の制御や光源位置の設定を行う。光源位置の設定は、前述したように、1つの光源を移動させることで行ってもよいし、複数の光源を選択的に点灯させることで行ってもよい。そして、画像処理部104(輝度情報取得部104e)は、取得された複数の撮影画像から被写体の輝度情報を取得する。   In step S <b> 101, the system controller 110 controls the imaging unit including the imaging optical system 101 and the imaging element 102 to capture a subject at a plurality of (four or more) light source positions and acquire a plurality of captured images. To do. At this time, the system controller 110 controls the light projecting unit 111 through the imaging control unit 106, and further controls the light emission intensity of the light source and sets the light source position. As described above, the setting of the light source position may be performed by moving one light source, or may be performed by selectively lighting a plurality of light sources. Then, the image processing unit 104 (luminance information acquisition unit 104e) acquires the luminance information of the subject from the plurality of acquired captured images.

次にステップS102では、画像処理部104(選択部104a)は、ステップS101で得られた輝度情報に基づいて、メモリ112に記憶された複数の反射特性モデルから1番目の特定モデルとしての反射特性モデル1を選択する。   Next, in step S102, the image processing unit 104 (selection unit 104a), based on the luminance information obtained in step S101, reflects the reflection characteristic as the first specific model from the plurality of reflection characteristic models stored in the memory 112. Select model 1.

次にステップS103では、画像処理部104(法線推定部104b)に、ステップS101で取得された複数の撮影画像とステップS102で選択された反射特性モデル1とを用いて被写体の法線情報を推定する。法線情報の推定は、照度差ステレオ法を用いて、ステップS102で選択された反射特性モデル1と光源位置に応じた輝度情報の変化とに基づいて行う。   In step S103, the image processing unit 104 (normal estimation unit 104b) receives the normal information of the subject using the plurality of captured images acquired in step S101 and the reflection characteristic model 1 selected in step S102. presume. The normal line information is estimated based on the reflection characteristic model 1 selected in step S102 and the change in luminance information according to the light source position, using the illuminance difference stereo method.

次にステップS104では、画像処理部104(モデルずれ量算出部104c)は、ステップS103で推定された法線情報をもとに、輝度情報と反射特性モデル1とのずれ量を算出する。   Next, in step S104, the image processing unit 104 (model deviation amount calculation unit 104c) calculates a deviation amount between the luminance information and the reflection characteristic model 1 based on the normal line information estimated in step S103.

モデルずれ量算出部104cにおけるずれ量の算出について詳しく説明する。被写体の法線候補が推定されると、光源方向が既知であれば、法線方向と光源方向から反射特性モデルに基づく被写体の反射率を算出できる。そこで、各光源位置での輝度情報の関係が反射特性モデルより得られる。よって、輝度情報取得部104eによって得られた被写体の輝度情報(輝度値)と反射特性モデルにより得られた輝度値との差分を光源条件ごとに取得し、二乗平均平方根(RMS)を求めることで、実測された輝度情報と反射特性モデルとのずれ量を得ることができる。なお、被写体に当たる光源強度が分からない場合は、各光源位置での輝度情報の絶対値も分からないため、各光源位置での輝度値を撮像装置が検出できる最大輝度等の適当な値で規格化するとよい。ランバート反射モデルを用いる場合は、照度差ステレオ法で得られたEρdの値で規格化してもよい。この場合、光源方向ベクトルsと面法線nの内積であるs・nが規格化された輝度情報に相当する。これによれば、画素ごとの光源強度や反射率の違いがキャンセルされるため、求めたずれ量は各画素に共通の指標とすることができる。   The calculation of the deviation amount in the model deviation amount calculation unit 104c will be described in detail. When the normal candidate of the subject is estimated, if the light source direction is known, the reflectance of the subject based on the reflection characteristic model can be calculated from the normal direction and the light source direction. Therefore, the relationship of the luminance information at each light source position is obtained from the reflection characteristic model. Therefore, the difference between the luminance information (luminance value) of the subject obtained by the luminance information acquisition unit 104e and the luminance value obtained by the reflection characteristic model is obtained for each light source condition, and the root mean square (RMS) is obtained. The deviation amount between the actually measured luminance information and the reflection characteristic model can be obtained. If the intensity of the light source hitting the subject is not known, the absolute value of the luminance information at each light source position is also unknown, so the luminance value at each light source position is normalized with an appropriate value such as the maximum luminance that can be detected by the imaging device. Good. When using a Lambertian reflection model, normalization may be performed using the value of Eρd obtained by the illuminance difference stereo method. In this case, s · n, which is the inner product of the light source direction vector s and the surface normal n, corresponds to the normalized luminance information. According to this, since the difference in light source intensity and reflectance for each pixel is canceled, the obtained deviation amount can be used as an index common to each pixel.

また、ずれ量を、輝度情報から算出した反射特性モデル(特定モデル)の係数値(パラメタ)に基づいて算出してもよい。ランバート反射モデルを用いて法線推定を行った場合を例にすると、同じ材質の被写体に対しては光源強度とランバート反射率の積Eρdはほぼ一定になると考えられる。このため、同じ材質の複数の被写体上の点で算出されたEρdの平均値やメディアンからの当該画素における差分をずれ量として用いることができる。また、被写体に照射される光源強度が既知の場合は直接ρdを用いるとよい。この場合、場所によって照射される光源強度が異なることによる誤差を除くことができる。被写体上の同じ材質の領域を判定するには、Graph-Cutやwatershed法、mean-shift法等の既存の領域分割手法を用いればよい。また、単に近傍の画素を同じ材質と仮定してもよい。被写体の材質が既知であれば、既知のρdとの差分をとってもよい。   Further, the deviation amount may be calculated based on a coefficient value (parameter) of a reflection characteristic model (specific model) calculated from the luminance information. Taking the case of normal estimation using a Lambertian reflection model as an example, the product Eρd of the light source intensity and the Lambertian reflectance is considered to be substantially constant for subjects of the same material. For this reason, the average value of Eρd calculated at points on a plurality of subjects of the same material and the difference in the pixel from the median can be used as the shift amount. If the intensity of the light source irradiated to the subject is known, ρd may be used directly. In this case, it is possible to eliminate an error due to a difference in intensity of the light source irradiated depending on the place. In order to determine the region of the same material on the subject, an existing region dividing method such as Graph-Cut, watershed method, or mean-shift method may be used. Further, it is possible to simply assume that neighboring pixels are made of the same material. If the material of the subject is known, a difference from the known ρd may be taken.

ただし、同じ材質の被写体領域を判定する手法では領域判定に誤差が生じてしまうと、法線情報にも誤差が生じる。そこで、パラメタ自体の絶対値を基準にずれ量を算出してもよい。ρdは理論上1以下の値をとるため、閾値を1とし、ρdが閾値より大きいときにずれ量が値を持つようにずれ量を決めてもよい。また、被写体の反射率や吸収が既知の場合や色などの情報から最大の反射率が推定できる場合は、閾値は1でなくともよい。   However, in the method of determining the subject region of the same material, if an error occurs in the region determination, an error also occurs in the normal line information. Therefore, the deviation amount may be calculated based on the absolute value of the parameter itself. Since ρd theoretically takes a value of 1 or less, the threshold may be set to 1, and the amount of deviation may be determined so that the amount of deviation has a value when ρd is greater than the threshold. In addition, the threshold may not be 1 when the reflectance or absorption of the subject is known or when the maximum reflectance can be estimated from information such as color.

他の反射特性モデルで法線推定を行った場合も同様である。例えば簡略化されたTorrance-Sparrowモデルでは、反射係数K、射出角θr、表面粗さσ、光源方向sと視線方向vの2等分線方向と面法線方向nのなす角αを用いて、   The same applies when normal estimation is performed using another reflection characteristic model. For example, in the simplified Torrance-Sparrow model, the reflection coefficient K, the emission angle θr, the surface roughness σ, and the angle α formed by the bisector direction of the light source direction s and the line-of-sight direction v and the surface normal direction n are used. ,

と表される(図6)。この反射係数K、表面粗さσは被写体の材質で決まる量であり、同じ材質では一定の値を示すと考えられるから上記のρdの変わりにこれらを用いてずれ量を算出することもできる。 (FIG. 6). The reflection coefficient K and the surface roughness σ are amounts determined by the material of the subject, and it is considered that the same material shows a constant value. Therefore, the deviation amount can be calculated using these instead of ρd.

また、ずれ量は輝度情報から求めた複数の面法線候補のばらつきに基づいて算出してもよい。被写体の面法線の変化に対して十分細かいピッチで面法線を取得しているとすれば、画素ごとの面法線方向は近傍の画素間で近い値をとる。そこで、例えば隣接する画素との面法線方向の差からずれ量を定めることで、得られた面法線候補の推定精度を判定することができる。   Further, the deviation amount may be calculated based on variations of a plurality of surface normal candidates obtained from the luminance information. If surface normals are acquired at a sufficiently fine pitch with respect to changes in the surface normal of the subject, the surface normal direction for each pixel takes a close value between neighboring pixels. Therefore, for example, by determining the amount of deviation from the difference in the surface normal direction with the adjacent pixels, it is possible to determine the estimation accuracy of the obtained surface normal candidates.

以上のようにずれ量の算出としては様々な方法があり、上述の方法のいずれを用いてもよく、上述の方法に限定されない。   As described above, there are various methods for calculating the deviation amount, and any of the above methods may be used, and the method is not limited to the above method.

なお、ずれ量の算出は、取得した各光源位置の輝度情報の一部を用いて行ってもよい。一般にずれ量が大きくなる場合として、被写体の物理的な反射特性が用いた反射特性モデルに合わない場合がある。他にも、光源からの光が遮蔽されて当たらない陰影部や、拡散反射成分の観測を想定した反射特性モデルに対して鏡面反射成分や相互反射成分が観測されてしまう場合がある。このような場合、被写体の物理的な反射特性はモデルに合っていても、観測される輝度情報としてはモデルに合わないということになる。反射特性モデルからのずれ量が大きくなると照度差ステレオ法では正しい面法線が得られなくなるため、どちらの場合でも照度差ステレオ法で求めた法線情報の妥当性をずれ量に基づいて判定できる。   The shift amount may be calculated using a part of the acquired luminance information of each light source position. In general, as the amount of deviation increases, the physical reflection characteristic of the subject may not match the reflection characteristic model used. In addition, a specular reflection component or a mutual reflection component may be observed for a shadow portion where light from a light source is not shielded and a reflection characteristic model that is assumed to observe a diffuse reflection component. In such a case, even if the physical reflection characteristics of the subject match the model, the observed luminance information does not match the model. If the amount of deviation from the reflection characteristic model increases, the correct surface normal cannot be obtained with the illuminance difference stereo method, and in either case, the validity of the normal information obtained by the illuminance difference stereo method can be determined based on the amount of deviation. .

しかし、後者の場合は、陰影部や想定以外の反射成分が観測された光源位置の輝度情報を除外してずれ量を算出することで、モデルに合う場合がある。したがって、光源位置の輝度情報が法線推定に十分な数より多くある場合は、上述のような不適当な光源位置の輝度情報を除外してずれ量を算出するとよい。   However, in the latter case, there is a case where the model matches the model by calculating the shift amount by excluding the luminance information of the light source position where the shadow component or the reflection component other than the assumption is observed. Therefore, when the luminance information of the light source position is larger than a sufficient number for normal estimation, the deviation amount may be calculated by excluding the luminance information of the inappropriate light source position as described above.

ある輝度情報を取得した際の光源位置が不適当であるかは、既存の陰影部や鏡面反射部の抽出法を用いればよく、例えば輝度情報の閾値処理をすればよい。しかし、このような場合、法線推定に使用できる光源位置の輝度情報が少なくなり、推定精度が悪化し、推定に必要な数の輝度情報が得られなくなる場合もある。よって、被写体に適合する反射特性モデルを適用できる場合はそちらの方が好ましい。   Whether the position of the light source at the time of obtaining certain luminance information is inappropriate may be determined by using an existing method for extracting a shadow part or a specular reflection part. For example, threshold processing for luminance information may be performed. However, in such a case, the luminance information of the light source position that can be used for normal estimation decreases, the estimation accuracy deteriorates, and the number of luminance information necessary for estimation may not be obtained. Therefore, when a reflection characteristic model suitable for the subject can be applied, that is preferable.

次にステップS105では、画像処理部104(モデル判定部104d)は、ステップS104で算出されたずれ量と閾値との大小を判別する。ずれ量が閾値より大きい場合はステップS106に進み、ずれ量が閾値より小さい場合はステップS103で推定した法線情報を最終的な結果とし(つまりは選択した特定モデルの使用を許容し)、本処理を終了する。   In step S105, the image processing unit 104 (model determination unit 104d) determines whether the deviation amount calculated in step S104 and the threshold value are large or small. If the deviation amount is larger than the threshold value, the process proceeds to step S106. If the deviation amount is smaller than the threshold value, the normal information estimated in step S103 is used as a final result (that is, the use of the selected specific model is allowed). The process ends.

ステップS106では、画像処理部104(選択部104a)は、メモリ112に記録された複数の反射特性モデルから反射特性モデル1とは異なるモデル(反射特性モデル2)を選択する。   In step S106, the image processing unit 104 (selection unit 104a) selects a model (reflection characteristic model 2) different from the reflection characteristic model 1 from the plurality of reflection characteristic models recorded in the memory 112.

次にステップS107では、画像処理部104(法線推定部104b)は、ステップS103と同様に、ステップS101で取得された複数の撮影画像と反射特性モデル2とを用いて被写体の法線情報を推定する。そして、これを最終的な結果として処理を終了する。   Next, in step S107, the image processing unit 104 (normal estimation unit 104b) uses the plurality of captured images acquired in step S101 and the reflection characteristic model 2 to obtain the normal information of the subject, as in step S103. presume. And this is made into a final result, and a process is complete | finished.

選択部104aは、反射特性モデル1および反射特性モデル2として、予め決められたモデルを選択する。その際、反射特性モデル1にはより計算負荷の軽いモデルやパラメタの少ないモデル、反射特性モデル2にはより複雑なモデルや反射特性モデル1を含有するようなモデルをするとよい。例えば、反射特性モデル1は拡散反射成分のみのモデルとし、反射特性モデル2は拡散反射成分と鏡面反射成分を考慮したモデルとするのがよい。   The selection unit 104a selects predetermined models as the reflection characteristic model 1 and the reflection characteristic model 2. At this time, the reflection characteristic model 1 may be a model with a lighter calculation load or a model with fewer parameters, and the reflection characteristic model 2 may be a model that includes a more complicated model or the reflection characteristic model 1. For example, the reflection characteristic model 1 may be a model having only a diffuse reflection component, and the reflection characteristic model 2 may be a model considering a diffuse reflection component and a specular reflection component.

特許文献3にて開示されているように、被写体の反射特性が既知であっても、1画素のように被写体の小さい領域だけを観測する場合は鏡面反射成分が観測されない場合も多い。この場合、鏡面反射成分を除いたモデルで最適化した方が、計算負荷も計算結果の精度も向上できる。特に拡散反射成分のみのモデルをランバート反射モデルとすると、最適化によらず行列計算により法線を推定することができ、鏡面反射成分を持たない画素について高速に法線情報を推定することができる。   As disclosed in Patent Document 3, even when the reflection characteristics of a subject are known, when only a small area of the subject is observed like one pixel, a specular reflection component is often not observed. In this case, the calculation load and the accuracy of the calculation result can be improved by optimizing with the model excluding the specular reflection component. In particular, when a model having only a diffuse reflection component is a Lambertian reflection model, normals can be estimated by matrix calculation regardless of optimization, and normal information can be estimated at high speed for pixels having no specular reflection component. .

その上で、画像上では限定された領域にしか生じない鏡面反射部では鏡面反射成分を含んだモデルに基づいて法線情報を推定することで、無駄な計算付加を増やさずに、高速で精度よい推定ができる。また、反射特性モデル1はランバート反射モデルとし、反射特性モデル2はOren-Nayarモデル等のランバート反射モデルとは異なる拡散反射モデルとしてもよい。この場合、ランバート反射モデルとの乖離が小さい反射特性を持つ被写体に対しては、高速に法線情報を推定しつつ、ランバート反射モデルとは乖離が大きい反射特性を持つ被写体に対してのみ被写体表面の粗さ等を考慮したより正確なモデルを用いることができる。   In addition, the specular reflection unit that occurs only in a limited area on the image estimates the normal information based on a model that includes a specular reflection component, so that high-speed accuracy can be achieved without increasing unnecessary calculations. A good estimate can be made. The reflection characteristic model 1 may be a Lambertian reflection model, and the reflection characteristic model 2 may be a diffuse reflection model different from a Lambertian reflection model such as the Oren-Nayar model. In this case, for a subject having a reflection characteristic with a small deviation from the Lambertian reflection model, the normal surface information is estimated at a high speed, but only for a subject having a reflection characteristic with a large deviation from the Lambert reflection model. It is possible to use a more accurate model that takes into account roughness and the like.

もちろん反射特性モデル2についてもずれ量を算出してよい。この場合、ステップS105〜S107と同様に、ずれ量が大きければ新たに反射特性モデル3を選択してもよい。また、最もずれ量が小さかった反射特性モデルに基づく法線情報を真の法線情報とするとよい。   Of course, the deviation amount may be calculated for the reflection characteristic model 2 as well. In this case, similarly to steps S105 to S107, the reflection characteristic model 3 may be newly selected if the shift amount is large. Further, normal information based on the reflection characteristic model with the smallest deviation amount may be true normal information.

なお、ステップS102は法線情報の推定よりも前に行われればよく、本実施例の順に限定するものではない。   Note that step S102 only needs to be performed before the normal information is estimated, and is not limited to the order of this embodiment.

次に、図3を用いて本発明の実施例2について説明する。本実施例は、輝度情報に基づいて反射特性モデルを選択する点で実施例1と異なる。本実施例の撮像装置の構成は、実施例1の撮像装置の構成と共通であり、実施例1と共通する構成要素には実施例1と同符号を付す。   Next, Embodiment 2 of the present invention will be described with reference to FIG. The present embodiment is different from the first embodiment in that a reflection characteristic model is selected based on luminance information. The configuration of the image pickup apparatus according to the present embodiment is the same as that of the image pickup apparatus according to the first embodiment, and the same components as those in the first embodiment are denoted by the same reference numerals as those in the first embodiment.

ステップS201およびS204は、図1のステップS101およびS103と同じである。   Steps S201 and S204 are the same as steps S101 and S103 in FIG.

ステップS202では、画像処理部104(輝度情報取得部104e)は、ステップS201で取得した輝度情報を鏡面反射成分と拡散反射成分に分離する。ここで分離は既存の方法を用いて行えばよい。例えば、「L. B. Wolff,Constraining Object Features Using a Polarization Reflectance Model,IEEE Trans. Patt. Anal. Mach. Intell.,Vol.13,No.7,pp.635-657(1991)」、「G. J. Klinker,The Measurement of Highlights in Color Images,IJCV,Vol.2,No.1,pp.7-32(1988)」に記載された方法を用いればよい。また、単に輝度値が所定の閾値より大きい場合を鏡面反射とし、閾値より小さい場合を拡散反射としてもよい。   In step S202, the image processing unit 104 (luminance information acquisition unit 104e) separates the luminance information acquired in step S201 into a specular reflection component and a diffuse reflection component. Here, the separation may be performed using an existing method. For example, `` LB Wolff, Constraining Object Features Using a Polarization Reflectance Model, IEEE Trans. Patt. Anal. Mach. Intell., Vol. 13, No. 7, pp. 635-657 (1991) '', `` GJ Klinker, The method described in “Measurement of Highlights in Color Images, IJCV, Vol. 2, No. 1, pp. 7-32 (1988)” may be used. Alternatively, the case where the luminance value is simply larger than a predetermined threshold value may be specular reflection, and the case where the luminance value is smaller than the threshold value may be diffuse reflection.

次にステップS203では、画像処理部104(選択部104a)は、ステップS202の結果から、拡散反射が観測された光源条件数および鏡面反射が観測された光源条件数を求める。そして、選択部104aは、拡散反射が観測された光源条件数の方が多い場合は拡散反射モデルを選択し、鏡面反射が観測された光源条件数の方が多い場合は鏡面反射モデルまたは鏡面反射と拡散反射を考慮したモデルを選択する。拡散反射モデルを選択した場合は拡散反射の輝度情報のみを用いて、鏡面反射モデルを選択した場合は鏡面反射の輝度情報のみを用いて、拡散反射と鏡面反射を考慮したモデルを選択した場合は両方の輝度情報を用いて法線情報を推定する。これにより、鏡面反射が観測されない被写体に対して鏡面反射を含むモデルを適用する等、被写体の反射特性に適合しないモデルを用いて法線情報を推定することがなくなる。さらに、観測数のより多い反射成分のモデルを選択することができ、推定の精度が向上する。   In step S203, the image processing unit 104 (selection unit 104a) obtains the number of light source conditions in which diffuse reflection is observed and the number of light source conditions in which specular reflection is observed from the result of step S202. The selection unit 104a selects the diffuse reflection model when the number of light source conditions in which diffuse reflection is observed is larger, and selects the specular reflection model or specular reflection when the number of light source conditions in which specular reflection is observed is larger. And a model that takes diffuse reflection into account. When the diffuse reflection model is selected, only the diffuse reflection luminance information is used.When the specular reflection model is selected, only the specular reflection luminance information is used, and when the diffuse reflection and specular reflection model is selected. Normal information is estimated using both pieces of luminance information. As a result, normal information is not estimated using a model that does not match the reflection characteristics of the subject, such as applying a model that includes specular reflection to a subject for which specular reflection is not observed. Furthermore, a reflection component model having a larger number of observations can be selected, and the accuracy of estimation is improved.

また、選択部104aは、本実施例が有する拡散反射モデルの未知係数の数より多い光源条件数で拡散反射が観測されたら拡散反射モデルを選択するとしてもよい。これによれば、拡散反射モデルで精度よく法線情報が推定できる場合に、拡散反射モデルを適用することができる。鏡面反射モデル、拡散反射と鏡面反射をともに考慮するモデルでも同様に、モデルの未知係数の数より多い光源条件数で観測された場合に該当するモデルを選択するとしてもよい。   The selection unit 104a may select the diffuse reflection model when diffuse reflection is observed with a number of light source conditions larger than the number of unknown coefficients of the diffuse reflection model of the present embodiment. According to this, the diffuse reflection model can be applied when the normal line information can be accurately estimated with the diffuse reflection model. Similarly, the specular reflection model and the model that considers both diffuse reflection and specular reflection may be selected when the number of light source conditions is larger than the number of unknown coefficients of the model.

本実施例によれば、法線情報の推定に用いる反射特性モデルを直接輝度情報から求めることができ、初回の法線情報の推定から、被写体に適合する反射特性モデルに基づいた推定が行える。これにより、高速でありながらも、広範な未知の被写体に対応した法線情報の推定が行える。   According to the present embodiment, the reflection characteristic model used for the normal information estimation can be obtained directly from the luminance information, and the estimation based on the reflection characteristic model suitable for the subject can be performed from the initial normal information estimation. This makes it possible to estimate normal information corresponding to a wide range of unknown subjects while being fast.

次に図4を用いて本発明の実施例3について説明する。本実施例は、事前にある反射特性モデルについて算出したずれ量に基づいて反射特性モデルを選択する点で実施例2と異なる。本実施例の撮像装置の構成は、実施例1の撮像装置の構成と共通であり、実施例1と共通する構成要素には実施例1と同符号を付す。   Next, Embodiment 3 of the present invention will be described with reference to FIG. The present embodiment is different from the second embodiment in that the reflection characteristic model is selected based on the deviation amount calculated for the reflection characteristic model in advance. The configuration of the image pickup apparatus according to the present embodiment is the same as that of the image pickup apparatus according to the first embodiment, and the same components as those in the first embodiment are denoted by the same reference numerals as those in the first embodiment.

ステップS301、S303〜S305およびS307は、図1のステップS101、S103〜S105およびS107と同じである。   Steps S301, S303 to S305, and S307 are the same as steps S101, S103 to S105, and S107 of FIG.

ステップS302では、画像処理部104(選択部104a)は、法線情報の推定に用いる1番目の反射特性モデル(特定モデル)として、ランバート反射モデルを選択する。これにより、ステップS303での法線情報の推定を高速に行うことができる。   In step S302, the image processing unit 104 (selection unit 104a) selects a Lambertian reflection model as the first reflection characteristic model (specific model) used for the normal information estimation. As a result, normal information in step S303 can be estimated at high speed.

次にステップS306では、選択部104aは、ずれ量に基づいて、特定モデルとして反射特性モデル2を選択する。ここでは、ずれ量をランバート反射率ρdから算出するとよい。ρdは理論上1以下の値をとるため、閾値を1として、ρdの閾値との差に基づいてずれ量を決めればよい。また、被写体の反射率や吸収が既知の場合や色などの情報から最大の反射率が推定できる場合は、閾値は1でなくともよい。   In step S306, the selection unit 104a selects the reflection characteristic model 2 as the specific model based on the shift amount. Here, the shift amount may be calculated from the Lambertian reflectance ρd. Since ρd theoretically takes a value of 1 or less, the threshold value is set to 1, and the shift amount may be determined based on the difference from the threshold value of ρd. In addition, the threshold may not be 1 when the reflectance or absorption of the subject is known or when the maximum reflectance can be estimated from information such as color.

なお、ステップS305で用いるずれ量とステップS306で用いるずれ量は同じ基準で算出する必要はない。ステップS305で用いるずれ量は、例えば、輝度情報取得部104eによって得られた被写体の輝度情報(輝度値)と反射特性モデルにより得られた輝度値との差分を光源条件ごとに取得し、その二乗平均平方根(RMS)とすればよい。   Note that the deviation amount used in step S305 and the deviation amount used in step S306 need not be calculated on the same basis. For the deviation amount used in step S305, for example, the difference between the luminance information (luminance value) of the subject obtained by the luminance information acquisition unit 104e and the luminance value obtained by the reflection characteristic model is obtained for each light source condition, and the square thereof is obtained. The average square root (RMS) may be used.

被写体に鏡面反射や強い相互反射が観測される場合にρdは閾値を上回る。よって、ρdの閾値との差が大きい場合には、選択部104aはランバート反射に鏡面反射を加えた反射特性モデルを、反射特性モデル2として選択すればよい。また、一般に相互反射の方が鏡面反射より小さいため、ρdが理論値を上回りつつも閾値との差がそこまで大きくない場合、選択部104aは反射特性モデル2として相互反射の影響を考慮したモデルを選択してもよい。また、ステップS305でランバート反射モデルは適合しないと判定されながらもρdが閾値を下回る場合、鏡面反射はないものの拡散反射特性が異なっていると考えられる。この場合、選択部104aは反射特性モデル2として、ランバート反射とは異なる拡散反射モデルを選択してもよい。ここで、1番目の反射特性モデルをランバート反射モデルとしたのは、ステップS303の推定処理を高速に行うためであり、ランバート反射モデルでなくてもよい。   When specular reflection or strong mutual reflection is observed on the subject, ρd exceeds the threshold value. Therefore, when the difference from the threshold value of ρd is large, the selection unit 104a may select a reflection characteristic model obtained by adding specular reflection to Lambert reflection as the reflection characteristic model 2. Further, since the mutual reflection is generally smaller than the specular reflection, if the difference from the threshold is not so large even though ρd exceeds the theoretical value, the selection unit 104a is a model that considers the influence of the mutual reflection as the reflection characteristic model 2 May be selected. If it is determined in step S305 that the Lambertian reflection model is not suitable but ρd falls below the threshold value, it is considered that the diffuse reflection characteristics are different although there is no specular reflection. In this case, the selection unit 104a may select a diffuse reflection model different from the Lambertian reflection as the reflection characteristic model 2. Here, the reason why the first reflection characteristic model is the Lambertian reflection model is to perform the estimation process in step S303 at high speed, and may not be the Lambertian reflection model.

また、ステップS306で用いるずれ量として得られた輝度情報が特定の光源位置周りに集中しているかをみてもよい。図5に(A)ランバート反射モデル、(B)ランバート+鏡面反射モデル、(C)ランバート反射モデルとは異なる拡散反射モデルの模式図を示す。図5(C)は表面が粗い場合の拡散反射の一例を示している。横軸が光源位置の角度と面法線のなす角であり、縦軸が反射特性モデルの輝度値(反射率)を表す。図5(B)を見ると、図5(A)のランバート反射モデルに対し、特定の光源位置周りで高輝度であることがわかる。   Further, it may be seen whether the luminance information obtained as the shift amount used in step S306 is concentrated around a specific light source position. FIG. 5 shows a schematic diagram of a diffuse reflection model different from (A) Lambert reflection model, (B) Lambert + specular reflection model, and (C) Lambert reflection model. FIG. 5C shows an example of diffuse reflection when the surface is rough. The horizontal axis is the angle between the angle of the light source position and the surface normal, and the vertical axis represents the luminance value (reflectance) of the reflection characteristic model. FIG. 5B shows that the luminance is high around a specific light source position with respect to the Lambertian reflection model of FIG.

一方、図5(C)ではランバート反射モデルよりも広い光源位置で拡散反射の強度がゆるやかに変化することがわかる。このため、被写体に対して複数の光源位置で輝度情報を取得したときに、ランバート反射モデルよりも特定の光源位置周りで輝度が急激に大きな値をとる場合は、鏡面反射モデルを選択するとよい。また、ランバート反射モデルよりも光源位置に対してゆるやかな変化を示す場合は、ランバート反射モデルとは異なる拡散反射成分のモデルを選択するとよい。   On the other hand, in FIG. 5C, it can be seen that the intensity of diffuse reflection gradually changes at a light source position wider than that of the Lambertian reflection model. For this reason, when the luminance information is acquired at a plurality of light source positions with respect to the subject, the specular reflection model may be selected if the luminance takes a sharp value around a specific light source position than the Lambertian reflection model. In addition, in the case where the light source position changes more slowly than the Lambertian reflection model, it is preferable to select a diffuse reflection component model different from the Lambertian reflection model.

このように光源位置に対する反射率の変化を見るためのずれ量としては、例えば光源位置を変数にとったときの微分量を見たり、分散や4次のモーメントなどの統計量を見たりするとよい。   Thus, as the amount of deviation for viewing the change in reflectance with respect to the light source position, for example, the differential amount when the light source position is taken as a variable or the statistics such as dispersion and fourth-order moment may be viewed. .

上記各実施例では、画像処理装置としての画像処理部104が撮像装置に内蔵されている場合について説明したが、パーソナルコンピュータ等の撮像装置とは別装置としての画像処理装置でも各実施例で説明した画像処理を行うことができる。
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
In each of the above-described embodiments, the case where the image processing unit 104 as an image processing device is built in the imaging device has been described. However, an image processing device as a device other than the imaging device such as a personal computer is also described in each embodiment. Image processing can be performed.
(Other examples)
The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program This process can be realized. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

以上説明した各実施例は代表的な例にすぎず、本発明の実施に際しては、各実施例に対して種々の変形や変更が可能である。   Each embodiment described above is only a representative example, and various modifications and changes can be made to each embodiment in carrying out the present invention.

Claims (20)

光源の位置が互いに異なる4つ以上の光源条件での被写体の撮像により生成された複数の撮影画像を用いて前記被写体の表面の法線情報を取得する画像処理装置であって、
複数の反射特性モデルを記憶した記憶手段と、
前記複数の撮影画像から前記被写体の輝度情報を取得する輝度情報取得手段と、
前記輝度情報に基づいて前記複数の反射特性モデルのうち特定モデルを選択する選択手段と、
前記光源条件に応じた前記輝度情報の変化と前記特定モデルとを用いて前記法線情報を取得する法線情報取得手段とを有することを特徴とする画像処理装置。
An image processing apparatus that obtains normal information of the surface of the subject using a plurality of captured images generated by imaging the subject under four or more light source conditions with different light source positions,
Storage means for storing a plurality of reflection characteristic models;
Luminance information acquisition means for acquiring luminance information of the subject from the plurality of captured images;
Selection means for selecting a specific model from the plurality of reflection characteristic models based on the luminance information;
An image processing apparatus, comprising: normal line information acquisition means for acquiring the normal line information using the change of the luminance information according to the light source condition and the specific model.
前記輝度情報と前記特定モデルとのずれ量を算出するモデルずれ量算出手段と、
前記ずれ量と所定値との大小を判定するモデル判定手段とを有することを特徴とする請求項1に記載の画像処理装置。
Model deviation amount calculation means for calculating a deviation amount between the luminance information and the specific model;
The image processing apparatus according to claim 1, further comprising a model determination unit that determines the magnitude of the deviation amount and a predetermined value.
前記モデルずれ量算出手段は、前記ずれ量を、前記輝度情報と前記特定モデルに基づいて算出される輝度値との比較により算出することを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the model deviation amount calculation unit calculates the deviation amount by comparing the luminance information with a luminance value calculated based on the specific model. 前記モデルずれ量算出手段は、前記ずれ量を、前記輝度情報から算出した前記特定モデルのパラメタに基づいて算出することを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the model deviation amount calculation unit calculates the deviation amount based on a parameter of the specific model calculated from the luminance information. 前記モデルずれ量算出手段は、前記ずれ量を、前記輝度情報から求めた複数の面法線候補のばらつきに基づいて算出することを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the model deviation amount calculation unit calculates the deviation amount based on variations of a plurality of surface normal candidates obtained from the luminance information. 前記モデル判定手段は、前記特定モデルのうち前記ずれ量が前記所定値より小さい領域では該特定モデルの使用を許容し、前記ずれ量が前記所定値より大きい領域では前記特定モデルとは異なる前記反射特性モデルを選択させることを特徴とする請求項2から5のいずれか一項に記載の画像処理装置。   The model determination means allows the use of the specific model in an area where the deviation amount is smaller than the predetermined value in the specific model, and the reflection different from the specific model in an area where the deviation amount is larger than the predetermined value. 6. The image processing apparatus according to claim 2, wherein a characteristic model is selected. 前記複数の反射特性モデルは、ランバート反射モデルを含むことを特徴とする請求項1から6のいずれか一項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the plurality of reflection characteristic models include a Lambertian reflection model. 前記複数の反射特性モデルは、ランバート反射モデルとは異なる拡散反射モデルを含むことを特徴とする請求項1から7のいずれか一項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the plurality of reflection characteristic models include a diffuse reflection model different from a Lambertian reflection model. 前記複数の反射特性モデルは、鏡面反射モデルを含むことを特徴とする請求項1から8のいずれか一項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the plurality of reflection characteristic models include a specular reflection model. 前記複数の反射特性モデルは、拡散反射成分と鏡面反射成分の和からなる拡散/鏡面反射モデルを含むことを特徴とする請求項1から9のいずれか一項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the plurality of reflection characteristic models include a diffusion / specular reflection model including a sum of a diffuse reflection component and a specular reflection component. 前記選択手段は、前記複数の反射特性モデルのうちランバート反射モデルを1番目の前記特定モデルとして選択することを特徴とする請求項7に記載の画像処理装置。   The image processing apparatus according to claim 7, wherein the selection unit selects a Lambertian reflection model as the first specific model among the plurality of reflection characteristic models. 前記選択手段は、前記複数の反射特性モデルのうち前記ランバート反射モデルとは異なる前記拡散反射モデルを2番目の前記特定モデルとして選択することを特徴とする請求項8に記載の画像処理装置。   The image processing apparatus according to claim 8, wherein the selection unit selects the diffuse reflection model different from the Lambertian reflection model among the plurality of reflection characteristic models as the second specific model. 前記選択手段は、前記複数の反射特性モデルのうち前記拡散/鏡面反射モデルを2番目の前記特定モデルとして選択することを特徴とする請求項10に記載の画像処理装置。   The image processing apparatus according to claim 10, wherein the selection unit selects the diffusion / specular reflection model as the second specific model among the plurality of reflection characteristic models. 前記選択手段は、前記4つ以上の光源条件のうち3つ以上の光源条件において拡散反射が取得された場合に、前記ランバート反射モデルまたは該ランバート反射モデルとは異なる前記拡散反射モデルを前記特定モデルとして選択することを特徴とする請求項7、8、11または12に記載の画像処理装置。   When the diffuse reflection is acquired under three or more light source conditions among the four or more light source conditions, the selection unit selects the Lambertian reflection model or the diffuse reflection model different from the Lambertian reflection model from the specific model. The image processing apparatus according to claim 7, 8, 11, or 12. 前記選択手段は、前記4つ以上の光源条件のうち4つ以上の光源条件において鏡面反射が取得された場合に、前記鏡面反射モデルを前記特定モデルとして選択することを特徴とする請求項9に記載の画像処理装置。   The said selection means selects the said specular reflection model as the said specific model, when specular reflection is acquired on four or more light source conditions among the said four or more light source conditions. The image processing apparatus described. 前記選択手段は、前記ずれ量に応じて前記特定モデルを選択することを特徴とする請求項2から15のいずれか一項に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the selection unit selects the specific model according to the shift amount. 前記輝度情報取得手段は前記輝度情報を前記撮影画像から取得し、
前記法線情報取得手段は、前記撮影画像の画素ごとに独立して前記法線情報を取得することを特徴とする請求項1から16のいずれか一項に記載の画像処理装置。
The luminance information acquisition means acquires the luminance information from the captured image,
The image processing apparatus according to claim 1, wherein the normal line information acquisition unit acquires the normal line information independently for each pixel of the captured image.
請求項1から17のいずれか一項に記載の画像処理装置と、
前記撮影画像を生成するための撮像を行う撮像手段とを有することを特徴とする撮像装置。
An image processing apparatus according to any one of claims 1 to 17,
An imaging apparatus comprising: an imaging unit that performs imaging for generating the captured image.
少なくとも1つの光源と、該光源の位置を複数の位置に設定する投光手段とを有することを特徴とする請求項17に記載の撮像装置。   18. The imaging apparatus according to claim 17, further comprising at least one light source and a light projecting unit that sets the position of the light source to a plurality of positions. コンピュータに、光源の位置が互いに異なる4つ以上の光源条件での被写体の撮像により生成された複数の撮影画像を用いて前記被写体の表面の法線情報を取得する処理を実行させるコンピュータプログラムであって、
前記コンピュータに、
前記複数の撮影画像から前記被写体の輝度情報を取得させ、
前記輝度情報に基づいて、記憶された複数の反射特性モデルのうち1つを特定モデルとして選択させ、
前記光源条件に応じた前記輝度情報の変化と前記特定モデルとを用いて前記法線情報を取得させることを特徴とする画像処理プログラム。
A computer program that causes a computer to execute a process of acquiring normal information of a surface of a subject using a plurality of captured images generated by imaging a subject under four or more light source conditions with different light source positions. And
In the computer,
The luminance information of the subject is acquired from the plurality of captured images,
Based on the luminance information, one of the stored reflection characteristic models is selected as a specific model,
An image processing program for acquiring the normal line information using a change in the luminance information according to the light source condition and the specific model.
JP2016013011A 2016-01-27 2016-01-27 Image processing device, imaging apparatus and image processing program Pending JP2017134561A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016013011A JP2017134561A (en) 2016-01-27 2016-01-27 Image processing device, imaging apparatus and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016013011A JP2017134561A (en) 2016-01-27 2016-01-27 Image processing device, imaging apparatus and image processing program

Publications (1)

Publication Number Publication Date
JP2017134561A true JP2017134561A (en) 2017-08-03

Family

ID=59504889

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016013011A Pending JP2017134561A (en) 2016-01-27 2016-01-27 Image processing device, imaging apparatus and image processing program

Country Status (1)

Country Link
JP (1) JP2017134561A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019139694A (en) * 2018-02-15 2019-08-22 キヤノン株式会社 Image processing method, image processor, imaging apparatus, image processing program, and storage medium
JP2019168862A (en) * 2018-03-22 2019-10-03 キヤノン株式会社 Processing equipment, processing system, imaging device, processing method, program, and recording medium
US11496631B2 (en) 2020-10-19 2022-11-08 Fujifilm Business Innovation Corp. Measurement apparatus, information processing apparatus, and non-transitory computer readable medium storing program comprising a processor that controls the light irradiator that includes a first light source row and a second light source row having different positions and covering a majority of a reading unit, a third light source and a fourth light source having different positions in the intersecting direction
US11933603B2 (en) 2020-03-27 2024-03-19 Fujifilm Business Innovation Corp. Measurement apparatus, information processing apparatus, and non-transitory computer readable medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019139694A (en) * 2018-02-15 2019-08-22 キヤノン株式会社 Image processing method, image processor, imaging apparatus, image processing program, and storage medium
JP7286268B2 (en) 2018-02-15 2023-06-05 キヤノン株式会社 Image processing method, image processing device, imaging device, image processing program, and storage medium
JP2019168862A (en) * 2018-03-22 2019-10-03 キヤノン株式会社 Processing equipment, processing system, imaging device, processing method, program, and recording medium
JP7179472B2 (en) 2018-03-22 2022-11-29 キヤノン株式会社 Processing device, processing system, imaging device, processing method, program, and recording medium
US11933603B2 (en) 2020-03-27 2024-03-19 Fujifilm Business Innovation Corp. Measurement apparatus, information processing apparatus, and non-transitory computer readable medium
US11496631B2 (en) 2020-10-19 2022-11-08 Fujifilm Business Innovation Corp. Measurement apparatus, information processing apparatus, and non-transitory computer readable medium storing program comprising a processor that controls the light irradiator that includes a first light source row and a second light source row having different positions and covering a majority of a reading unit, a third light source and a fourth light source having different positions in the intersecting direction

Similar Documents

Publication Publication Date Title
JP6456156B2 (en) Normal line information generating apparatus, imaging apparatus, normal line information generating method, and normal line information generating program
JP6786225B2 (en) Image processing equipment, imaging equipment and image processing programs
US10547786B2 (en) Image processing for turbulence compensation
US9832432B2 (en) Control apparatus, image pickup apparatus, control method, and non-transitory computer-readable storage medium
KR101233013B1 (en) Image photographing device, distance computing method for the device, and focused image acquiring method
US10154216B2 (en) Image capturing apparatus, image capturing method, and storage medium using compressive sensing
US10356384B2 (en) Image processing apparatus, image capturing apparatus, and storage medium for storing image processing program
JP7378219B2 (en) Imaging device, image processing device, control method, and program
JP2017134561A (en) Image processing device, imaging apparatus and image processing program
JP6353233B2 (en) Image processing apparatus, imaging apparatus, and image processing method
US10902570B2 (en) Processing apparatus, processing system, imaging apparatus, processing method, and storage medium
JP2018054412A (en) Processing device, processing system, imaging device, processing method, program, and recording medium
US10339665B2 (en) Positional shift amount calculation apparatus and imaging apparatus
JP2009236696A (en) Three-dimensional image measurement method, measurement system, and measurement program for subject
JP6362070B2 (en) Image processing apparatus, imaging apparatus, image processing method, program, and storage medium
JP2017208642A (en) Imaging device using compression sensing, imaging method, and imaging program
JP2017135528A (en) Image processing device, imaging apparatus and image processing program
JP7213686B2 (en) Shape measuring device, control method and program
US11037316B2 (en) Parallax calculation apparatus, parallax calculation method, and control program of parallax calculation apparatus
WO2016194576A1 (en) Information processing device and method
WO2016042721A1 (en) Positional shift amount calculation apparatus and imaging apparatus
US20220392155A1 (en) Image processing device, imaging apparatus, image processing method, and recording medium
JP2021196656A (en) Processing device, processing system, photographing device, processing method, and program
JP2023001950A (en) Information processing apparatus, imaging apparatus, image processing method, and program
JP2020095454A (en) Processing device, imaging device, processing system, processing method, program, and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190121

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20191205

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20191217

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20200623