JP5590680B2 - Image composition apparatus, image composition method, and image composition program - Google Patents
Image composition apparatus, image composition method, and image composition program Download PDFInfo
- Publication number
- JP5590680B2 JP5590680B2 JP2011139350A JP2011139350A JP5590680B2 JP 5590680 B2 JP5590680 B2 JP 5590680B2 JP 2011139350 A JP2011139350 A JP 2011139350A JP 2011139350 A JP2011139350 A JP 2011139350A JP 5590680 B2 JP5590680 B2 JP 5590680B2
- Authority
- JP
- Japan
- Prior art keywords
- light source
- video
- spherical
- region
- subject
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Image Generation (AREA)
- Studio Devices (AREA)
Description
本発明は、光源環境の異なる被写体が撮像された複数の映像から光学的整合性のある映像を合成する技術に関する。 The present invention relates to a technique for synthesizing an optically consistent video from a plurality of videos taken of subjects with different light source environments.
陰影のある複数の3次元映像を1つの映像に合成する場合、被写体に対する光源位置が異なる映像をそのまま合成すれば、各被写体における光の当たり方に矛盾が生じ違和感のある映像となってしまう。そこで、光学的整合性のある映像を生成するために、映像における被写体に対する光源位置を算出し、複数の映像の光源位置が同一となるように補正してから合成することが望ましい。このために、映像における光源位置を算出することが必要である。
このような光源位置を算出する方法として、カメラに光源が映るように映像を撮像する方法と、直接には光源が映っていない映像から光源位置を推定する方法とが存在する。
前者の方法として、魚眼レンズや全方位カメラを用いることで、被写体と同様に光源を含めて撮像することによって相対的な光源位置を推定する方法(例えば、非特許文献1参照)がある。
後者の方法として、被写体と同じ空間に金属球をおき、その空間をカメラで撮像し、金属球に映った光源に基づいて光源位置を推定する方法(例えば、非特許文献2参照)がある。この方法は、球面における最も照度の高い領域が光源の方向を示すという特性を用いる方法(例えば、非特許文献3参照)である。例えば、図13(a)は、右上前面(破線矢印)方向から光源が照射している球が被写体として撮像された映像の例である。図13(b)は、図13(a)における線分AB上の輝度の分布を示す。線分ABの映像面上での位置は、選択した被写体領域の輪郭画素に対してクラスタリングを行い、推定する。このような分布において輝度が最も高い領域が、最も照度の高い領域であると考えられる。そこで、映像上の球において最も輝度が高い領域の方向(破線矢印方向)に基づいて、光源位置を算出することができる。
When synthesizing a plurality of shaded 3D images into one image, if images with different light source positions with respect to the subject are synthesized as they are, contradictions arise in the way the light strikes each subject, resulting in an uncomfortable image. Therefore, in order to generate an optically consistent video, it is desirable to calculate the light source position with respect to the subject in the video and correct the plurality of video so that the light source positions are the same before combining them. For this purpose, it is necessary to calculate the light source position in the video.
As a method of calculating such a light source position, there are a method of capturing an image so that the light source is reflected on the camera and a method of estimating the light source position from an image in which the light source is not directly reflected.
As the former method, there is a method of estimating a relative light source position by using a fisheye lens or an omnidirectional camera and capturing an image including a light source in the same manner as a subject (for example, see Non-Patent Document 1).
As the latter method, there is a method in which a metal sphere is placed in the same space as the subject, the space is imaged with a camera, and a light source position is estimated based on a light source reflected on the metal sphere (see Non-Patent Document 2, for example). This method is a method using a characteristic that the region with the highest illuminance on the spherical surface indicates the direction of the light source (for example, see Non-Patent Document 3). For example, FIG. 13A is an example of an image in which a sphere irradiated by a light source from the upper right front (broken arrow) direction is captured as a subject. FIG. 13B shows a luminance distribution on the line segment AB in FIG. The position of the line segment AB on the video plane is estimated by clustering the contour pixels of the selected subject area. In such a distribution, the region with the highest luminance is considered to be the region with the highest illuminance. Therefore, the light source position can be calculated based on the direction of the region with the highest luminance in the sphere on the video (the direction of the broken line arrow).
しかしながら、上述の非特許文献1、2に示す方法は、特殊な方法により撮像を行わなければならず、事前に複雑なキャリブレーションが必要となる。例えば、非特許文献1の方法では、魚眼カメラや全方位カメラ等のデバイスを利用することが前提となり、このようなカメラを用いて撮像した映像でなければ光源位置を推定することができない。非特許文献2の方法では、予め撮像空間中に金属球を含めて撮像しなければ、光源位置を推定することができない。すなわち、上述の方法では、このような条件を満たさずに撮像された映像に基づいて光源位置を推定することができない。そこで、このような特殊な条件を満たす場合でなくとも、映像における被写体に対する光源の位置を推定することが望ましい。 However, the methods described in Non-Patent Documents 1 and 2 described above must perform imaging by a special method, and require complicated calibration in advance. For example, in the method of Non-Patent Document 1, it is assumed that a device such as a fish-eye camera or an omnidirectional camera is used, and the light source position cannot be estimated unless the image is captured using such a camera. In the method of Non-Patent Document 2, the light source position cannot be estimated unless an image including a metal sphere is captured in advance in the imaging space. That is, in the above-described method, the light source position cannot be estimated based on an image captured without satisfying such a condition. Therefore, it is desirable to estimate the position of the light source with respect to the subject in the video image even if such special conditions are not satisfied.
本発明は、上述のような事情に鑑みてなされたもので、複雑なキャリブレーションや特殊なデバイスを必要とせず、光源が直接的に映っていない映像から光源方向を推定して映像を合成する映像合成装置、映像合成方法、および映像合成プログラムを提供する。 The present invention has been made in view of the circumstances as described above, and does not require complicated calibration or special devices, and synthesizes an image by estimating the light source direction from an image in which the light source is not directly reflected. A video composition device, a video composition method, and a video composition program are provided.
上述した課題を解決するために、本発明は、光源環境の異なる被写体が撮像された複数の映像から光学的整合性のある映像を合成する映像合成装置であって、光源位置が含まれる光源情報が予め対応付けられた被写体を含む既知映像が記憶されている既知映像記憶部と、既知映像と合成する入力映像が入力される映像入力部と、映像入力部に入力された入力映像に含まれる複数の被写体領域を選択する領域選択部と、領域選択部によって選択された被写体領域に含まれる被写体が、球面であるか否かを判定する球面領域判定部と、球面領域判定部によって被写体が球面であると判定された複数の被写体領域毎の光源方向を算出し、算出した複数の光源方向に基づいて被写体に対する光源位置を算出する光源位置算出部と、既知映像を、光源位置算出部によって算出された光源位置に基づいて補正する光源位置調整部と、光源位置調整部によって光源位置を補正した既知映像を、入力映像に合成する映像合成部とを備えたことを特徴とする。 In order to solve the above-described problems, the present invention is a video composition device that synthesizes an optically consistent video from a plurality of video images of subjects with different light source environments, and includes light source information including a light source position. Is included in a known video storage unit that stores a known video including a subject that is previously associated, a video input unit that receives an input video to be combined with the known video, and an input video that is input to the video input unit. A region selection unit that selects a plurality of subject regions, a spherical region determination unit that determines whether or not a subject included in the subject region selected by the region selection unit is a spherical surface, and a spherical surface determination unit that determines whether the subject is a spherical surface A light source position calculation unit that calculates a light source direction for each of a plurality of subject areas determined to be and calculates a light source position with respect to the subject based on the calculated plurality of light source directions; A light source position adjustment unit that corrects based on the light source position calculated by the calculation unit, and a video composition unit that synthesizes a known video whose light source position is corrected by the light source position adjustment unit with an input video. .
また、本発明は、光源位置算出部によって算出された光源位置に対して、映像上の近傍領域の特性を利用して推定結果の補正を行う光源位置補正部を備えたことを特徴とする。 In addition, the present invention is characterized by including a light source position correction unit that corrects an estimation result for the light source position calculated by the light source position calculation unit by using the characteristics of the neighboring region on the video.
また、本発明は、球面領域判定部によって得られた球面領域に対して、球面領域と同一の被写体領域を含む他の映像を用いて球面領域の再評価を行う球面領域再評価部
を備えたことを特徴とする。
The present invention further includes a spherical region reevaluation unit that performs reevaluation of the spherical region using another image including the same subject region as the spherical region with respect to the spherical region obtained by the spherical region determination unit. It is characterized by that.
また、本発明は、光源位置が含まれる光源情報が予め対応付けられた被写体を含む既知映像が記憶されている既知映像記憶部を備え、光源環境の異なる被写体が撮像された複数の映像から光学的整合性のある映像を合成する映像合成装置の映像合成方法であって、既知映像と合成する入力映像が入力される映像入力ステップと、入力された入力映像に含まれる複数の被写体領域を選択する領域選択ステップと、選択した被写体領域に含まれる被写体が、球面であるか否かを判定する球面領域判定ステップと、被写体が球面であると判定した複数の被写体領域毎の光源方向を算出し、算出した複数の光源方向に基づいて被写体に対する光源位置を算出する光源位置算出ステップと、既知映像を、光源位置算出ステップにおいて算出された光源位置に基づいて補正する光源位置調整ステップと、光源位置を補正した既知映像を、入力映像に合成する映像合成ステップと、を備えたことを特徴とする。 In addition, the present invention includes a known video storage unit that stores a known video including a subject in which light source information including a light source position is associated in advance, and optically captures a plurality of videos obtained by imaging subjects with different light source environments. Video synthesizing method of video synthesizing apparatus that synthesizes video with consistent consistency, video input step for inputting input video to be synthesized with known video, and selection of multiple subject areas included in input video A region selection step, a spherical region determination step for determining whether or not a subject included in the selected subject region is a spherical surface, and a light source direction for each of the plurality of subject regions determined to be spherical. A light source position calculating step for calculating a light source position with respect to the subject based on the calculated plurality of light source directions, and a known image by calculating the light source position calculated in the light source position calculating step. A light source position adjustment step of correcting, based on a known image obtained by correcting the light source position, characterized by comprising a video synthesizing step of synthesizing the input image.
また、本発明は、光源位置算出ステップと光源位置調整ステップとの間に、光源位置算出ステップにおいて算出された光源位置に対して、映像上の近傍領域の特性を利用して推定結果の補正を行う光源位置補正ステップを備えたことを特徴とする。 In addition, the present invention corrects the estimation result between the light source position calculating step and the light source position adjusting step by using the characteristics of the neighboring area on the video with respect to the light source position calculated in the light source position calculating step. A light source position correcting step is provided.
また、本発明は、球面領域判定ステップと光源位置算出ステップとの間に、球面領域判定ステップにおいて得られた球面領域に対して、球面領域と同一の被写体領域を含む他の映像を用いて球面領域の再評価を行う球面領域再評価ステップを備えたことを特徴とする。 Further, the present invention provides a spherical surface using another image including the same subject area as the spherical area with respect to the spherical area obtained in the spherical area determining step between the spherical area determining step and the light source position calculating step. A spherical region re-evaluation step for re-evaluating the region is provided.
また、本発明は、光源位置が予め対応付けられた既知映像が記憶されている既知映像記憶部を備え、光源環境の異なる被写体が撮像された複数の映像から光学的整合性のある映像を合成する映像合成装置のコンピュータに、上述の映像合成方法を実行させる映像合成プログラムである。 In addition, the present invention includes a known video storage unit that stores a known video in which a light source position is associated in advance, and synthesizes an optically consistent video from a plurality of videos obtained by imaging subjects with different light source environments. A video composition program for causing a computer of the video composition device to execute the above-described video composition method.
以上説明したように、本発明によれば、光源環境の異なる被写体が撮像された複数の映像から光学的整合性のある映像を合成する映像合成装置が、光源位置が予め対応付けられた既知映像を記憶し、入力された入力映像に含まれる複数の被写体領域を選択し、選択した被写体領域に含まれる被写体が、球面であるか否かを判定し、被写体が球面であると判定した複数の被写体領域毎に、被写体領域における被写体に対する光源位置を算出し、既知映像を、算出した光源位置に基づいて補正し、光源位置を補正した既知映像を、入力映像に合成するようにしたので、複雑なキャリブレーションや特殊なデバイスを必要とせず、光源が直接的に映っていない映像から光源方向を推定して映像を合成することができる。 As described above, according to the present invention, a video synthesizing apparatus that synthesizes an optically consistent video from a plurality of video images of subjects with different light source environments is a known video in which light source positions are associated in advance. Are selected, a plurality of subject areas included in the input video input are selected, a determination is made as to whether or not the subject included in the selected subject area is a spherical surface, and a plurality of determinations are made that the subject is a spherical surface. For each subject area, the light source position with respect to the subject in the subject area is calculated, the known video is corrected based on the calculated light source position, and the known video with the corrected light source position is combined with the input video. It is possible to synthesize an image by estimating the light source direction from an image in which the light source is not directly reflected without requiring a special calibration or a special device.
以下、本発明の一実施形態について、図面を参照して説明する。
<第1の実施形態>
図1は、本発明の第1の実施形態による映像合成装置20の構成を示すブロック図である。映像合成装置20は、光源環境の異なる被写体が撮像された複数の映像から光学的整合性のある映像を合成して合成映像を生成するコンピュータ装置である。映像合成装置20は、映像入力部1と、映像出力部2と、映像・データ蓄積部3と、領域選択部4と、球面領域判定部5と、光源情報推定部6と、光源情報調整部7と、映像合成部8とを備えている。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
<First Embodiment>
FIG. 1 is a block diagram showing a configuration of a
映像入力部1には、予め映像・データ蓄積部3に記憶されている既知映像と合成する入力映像が入力される。例えば、映像入力部1には、カメラ等の入力機器から、屋外、屋内等の様々な環境で撮像された映像が入力される。映像入力部1は、入力された入力映像を映像・データ蓄積部3に記憶させる。
映像出力部2は、映像合成装置20によって生成された合成画像を、ディスプレイ等の出力機器に出力し、画像を表示させる。
The video input unit 1 receives an input video to be synthesized with a known video stored in advance in the video / data storage unit 3. For example, an image captured in various environments such as outdoors and indoors is input to the image input unit 1 from an input device such as a camera. The video input unit 1 stores the inputted input video in the video / data storage unit 3.
The video output unit 2 outputs the composite image generated by the
映像・データ蓄積部3には、映像合成装置20における各処理に用いられる情報が記憶される。例えば、映像・データ蓄積部3には、映像入力部1に入力された入力映像と合成する既知映像が予め記憶されている。既知映像は、形状や光源位置が既知であり、これらが含まれる光源情報が予め対応付けられた被写体を含む情報である。既知映像は、例えば、CG(コンピュータグラフィックス)で作成した映像や、距離センサ等の手段によって入力機器の位置を基点とした距離情報が得られている映像である。また、映像・データ蓄積部3には、映像入力部1から入力された映像や、後述する領域選択部4、球面領域判定部5、光源情報推定部6、光源情報調整部7、映像合成部8等によって得られたデータや映像が記憶される。映像・データ蓄積部3は、例えば、映像合成装置20がパーソナルコンピュータであれば、いわゆるメモリやハードディスクである。
The video / data storage unit 3 stores information used for each process in the
領域選択部4は、映像入力部1に入力されて映像・データ蓄積部3に記憶された入力映像を読み出し、読み出した入力映像に含まれる複数の被写体領域を選択する。被写体領域の選択は、例えばマウスやデジタイザ等の外部入力機器を用いて被写体の輪郭部分を指定する入力を受け付けるようにしても良いし、事前に様々な被写体を学習データとして蓄積しておき、パターンマッチング等によって照合を行うことで被写体領域を選択するようにしても良い。領域選択部4は、このようにして、映像・データ蓄積部3に格納されている入力映像から被写体領域を複数種類、選択する。 The area selection unit 4 reads the input video input to the video input unit 1 and stored in the video / data storage unit 3, and selects a plurality of subject areas included in the read input video. For the selection of the subject area, for example, an input for specifying the contour portion of the subject using an external input device such as a mouse or a digitizer may be accepted, or various subjects may be accumulated in advance as learning data, The subject region may be selected by performing collation by matching or the like. In this way, the region selection unit 4 selects a plurality of types of subject regions from the input video stored in the video / data storage unit 3.
球面領域判定部5は、領域選択部4によって選択された被写体領域の照度分布を用いて、その領域に含まれる被写体が、球面であるか否かを判定する。例えば、球面領域判定部5は、図2(a)のように、映像上の光源方向に平行に照度値分布を求める。図2(b)に示す分布1と分布2は、図2(a)上の破線に相当する部分の照度値分布の例であり、被写体が、例えば、りんごの芯の領域のように窪み等がある場合には、分布1のように複数のピークになり、球面(凸)になっていれば分布2のように照度値分布には1つのみのピークをもつ。そこで、球面領域判定部5は、光源方向の照度値分布のピーク数が2つ以上ある場合には、その領域が球面でないと判定し、ピーク数が1つである場合には、その領域が球面であると判定する。
The spherical
すなわち、映像中から選択した領域が窪みの存在により完全な球でない場合、局所的に照度の高い領域が複数存在することになり、正確な光源位置を算出することが困難である。例えば被写体がリンゴであれば、リンゴの芯の周辺にある窪みによってピークの数が複数になる。このような場合も同様に処理すると、光源方向の推定精度が悪くなると考えられるため、球面ではないものとして処理から除外する。 That is, when the region selected from the video is not a perfect sphere due to the presence of the depression, there are a plurality of regions having high local illuminance, and it is difficult to calculate an accurate light source position. For example, if the subject is an apple, the number of peaks is plural due to the depression around the core of the apple. If the same processing is performed in such a case, it is considered that the estimation accuracy of the light source direction is deteriorated.
光源情報推定部6は、球面領域判定部5によって被写体が球面であると判定された複数の被写体領域毎に、その被写体領域における前記被写体に対する光源位置を算出する光源位置算出部である。まず、光源情報推定部6による光源方向の算出処理を説明する。光源方向とは、被写体に対する光源の法線方向である。図3は、映像中の被写体に3次元の座標系を重畳表示した例であり、x軸は映像面と垂直な方向、y軸は映像面上の水平方向、z軸は映像面上の垂直方向を表す。本実施形態で算出する光源方向は、映像面(yz平面)から手前側に該当し、x軸方向の回転の角度φと、z軸方向の回転の角度θとの組み合わせによって示される。
The light source
x軸方向の回転の角度φは、yz平面に射影した光源方向であり、z軸方向の回転の角度θは、映像面より手前側のxy平面に射影した光源方向である。具体的には、光源情報推定部6は、領域選択部4が選択した被写体領域の輪郭画素の輝度を基にクラスタリング(例えば、Fuzzy K−means)を行い、輝度のピークのある方向をyz面上の光源方向(角度φ)として算出する。図3に示す映像の場合、右上(破線の矢印)方向が光源方向である。
The rotation angle φ in the x-axis direction is the light source direction projected onto the yz plane, and the rotation angle θ in the z-axis direction is the light source direction projected onto the xy plane in front of the image plane. Specifically, the light source
また、光源情報推定部6は、図4に示すように、後述する球面領域判定部5によって球面であると判定された領域の映像面上における光源方向上の画素値分布のピーク位置に相当する角度θを、光源の方向として算出する。また、光源情報推定部6は、以下式(1)に示すような、光源強度と光源方向の関係に基づいて、光源強度を算出する。
Further, as shown in FIG. 4, the light source
式(1)において、Lは光源強度、Ωは映像上で被写体の存在する位置から光源に対する法線ベクトルnと光源方向ω、および被写体の反射率に関連した定数Cで決定される。ここでは、被写体の位置に対応する映像上の座標の画素値Pが既知であることから、光源強度Lを算出できる。 In Expression (1), L is determined by the light source intensity, Ω is determined by the normal vector n and the light source direction ω with respect to the light source and the constant C related to the reflectance of the object from the position where the object exists on the image. Here, since the pixel value P of the coordinates on the image corresponding to the position of the subject is known, the light source intensity L can be calculated.
光源情報推定部6は、このように算出した光源方向を示す角度φと、角度θと、光源強度Lとに基づいて、光源位置を算出する。図5(a)は被写体を上から見た図であり、図5(b)は正面からみた図(映像)であり、各矢印付き線分は各被写体から推定された光源方向である。光源情報推定部6は、光源方向を示す線分の交点を光源位置として算出する。図5(b)(正面図)においては、2つの被写体からの光源方向を示す線分は交わらないため、2種類の線分の距離が最も短い箇所の中点(黒丸で示す)を光源位置として算出する。このように、光源方向と光源位置を算出する。ここで、例えば実映像の場合には各被写体から推定された光源方向に誤差を含むために、光源方向の向き(正負)が逆になっている場合もありえる。このような場合には、光源方向の3成分のうち、1種類(例えば、最も精度が悪いz方向)ないしは複数種類の成分の平均を求めても良いし、複数の被写体から推定された光源方向のうち、他と大きく異なる推定値を除外して平均しても良い。
The light source
光源情報調整部7は、映像・データ蓄積部3に記憶されている既知映像の光源情報を、光源情報推定部6によって算出された光源方向、光源位置に基づいて補正する。
映像合成部8は、光源情報調整部7によって光源位置を補正した既知映像を、映像・データ蓄積部3に記憶された入力映像に合成する。
The light source
The
次に、本実施形態による映像合成装置20の動作例を説明する。図6は、映像合成装置20が備える各部の動作例を示すフローチャートである。
まず、映像入力部1は、映像を入力し、映像・データ蓄積部3に格納する(ステップS1)。そして、領域選択部4は、複数の被写体領域を選択する(ステップS2)。ステップS2において得られた個々の被写体領域に対して、光源情報推定部6が、映像面上の光源方向(角度φ)を推定する(ステップS3)。
Next, an operation example of the
First, the video input unit 1 inputs a video and stores it in the video / data storage unit 3 (step S1). Then, the area selection unit 4 selects a plurality of subject areas (step S2). For each subject area obtained in step S2, the light source
そして、球面領域判定部5が、被写体領域が球面であるか否かを判定する(ステップS4)。光源方向(角度φ)の照度値分布のピーク数が2つ以上ある場合には、その局所領域を球面外領域とし、本光源方向推定処理から除外する。ピーク数が1つである場合には、その局所領域を球面領域であると判定する。そして、光源情報推定部6が、球面領域であると判定された被写体領域に対して、光源情報を推定する(ステップS5)。ステップS5の処理の詳細を、図7のフローチャートを参照しながら説明する。
Then, the spherical
図7では、球面領域と判定された被写体領域に対して光源方向と光源の位置を推定するまでの流れを示す。光源情報推定部6は、z軸方向の回転角度θを、光源方向として算出する(ステップS51)。また、上述した式(1)により、光源強度Lを算出する(ステップS52)。そして、光源情報推定部6は、角度φと、角度θと、光源強度Lとに基づいて、光源位置を算出する(ステップS53)。
FIG. 7 shows a flow until the light source direction and the position of the light source are estimated for the subject area determined to be a spherical area. The light source
図6に戻り、光源情報調整部7は、合成対象の既知映像を映像・データ蓄積部3から読み出す(ステップS6)。既知映像は、各被写体の位置が既知もしくは距離センサ等のデバイスによって取得された距離データを有しているものとする。被写体の位置情報を有する既知映像に対して、光源情報調整部7は、光源情報推定部6で得られた光源情報にあわせるように光源情報を調整した映像を生成する(ステップS7)。ステップS6にて読み出した既知映像がCGである場合には、ステップS53で得られた光源位置に光源を配置し、レンダリングして映像を生成する。一方、ステップS6にて読み出した既知映像がCGでない場合には、ステップS52で得られた光源強度を0とおいた映像を生成した上で、ステップS53の結果である光源位置に光源をおいた場合の映像を生成する。映像合成部8は、光源情報を調整した既知映像を、入力映像に合成し(ステップS8)、映像・データ蓄積部3に記憶させる。映像出力部2は、映像・データ蓄積部3に記憶された合成映像を出力する。
Returning to FIG. 6, the light source
<第2の実施形態>
次に、本発明の第2の実施形態について、図面を参照して説明する。図8は、本実施形態の映像合成装置20構成を示すブロック図である。第2の実施形態による映像合成装置20は、第1の実施形態の映像合成装置20が備える各部に加えて、光源情報補正部9を備える。以下、光源情報補正部9を中心に説明する。本実施形態は、特に、実映像を用いる場合に生じる推定誤差を映像上のハイライト領域を手がかりとして補正するものである。光源情報補正部9は、光源情報推定部6において推定された光源の位置を映像中にあるハイライト領域を用いて補正を行う。
<Second Embodiment>
Next, a second embodiment of the present invention will be described with reference to the drawings. FIG. 8 is a block diagram showing the configuration of the
図9は、本実施形態による映像合成装置20の動作例を示すフローチャートである。ここでは、図6に示したフローに、光源情報の補正処理(ステップS9)が追加されている。ステップS1からS6、ステップS6からS8までの処理は第1の実施形態と同じであるため、説明を省略する。光源情報の補正ステップ(ステップS9)では、ステップS5における光源情報の推定の際に求めた照度値分布のピークの位置に対して、近傍にハイライト領域の有無を探索し、もし、ハイライト領域がある場合には、その領域の中で最も照度の高い点を画素値分布のピークに対応する映像上の位置とする。図10(a)は、球状の物体から得られた照度値のピークに該当する映像上の位置をXとする。まず、近傍に位置Xにおける照度よりも高い照度をもつハイライト領域が存在するか否かを探索する。この探索は、たとえば、近傍n画素平方の範囲の中に、位置Xの照度よりも高い照度があるかどうかを探索する。ここでnは3や5等の数値とする。近傍n画素平方の中に、位置Xの照度よりも高いものが存在した場合に、位置Xとして得られた画素値のピークの位置を近傍にあるハイライト領域中の最も照度の高い位置に置き換える(図10(b))。
FIG. 9 is a flowchart showing an operation example of the
<第3の実施形態>
次に、本発明の第3の実施形態について図11のブロック図および図12のフローチャートを参照しながら説明する。第3の実施形態と第1の実施形態との違いは、図11において球面領域再評価部10が追加された点のみであるため、以下、球面領域再評価部10を中心に説明する。第3の実施形態は、例えば、固定カメラによる屋外シーンの映像のように異なる光源位置での同一被写体の映像が複数存在する場合に、各映像フレームで得られた同一被写体領域に対する球面領域判定部の結果を統合することで、その被写体領域に対してより正確に球面領域か否かの判定を行う。
<Third Embodiment>
Next, a third embodiment of the present invention will be described with reference to the block diagram of FIG. 11 and the flowchart of FIG. Since the difference between the third embodiment and the first embodiment is only that the spherical
図12のフローチャートにおいては、第1の実施形態に対し、球面領域の判定(ステップS4)と光源情報の推定(ステップS5)との間に球面領域の再評価(ステップS10)の処理を行う。他の処理は第1の実施形態と同様である。ステップS10における具体的な処理を以下に説明する。フレームiの対象被写体領域において、ステップS4において球面領域と判定された画素(x、y)のマスク領域Mi(x、y)を以下式(2)のように設定する。 In the flowchart of FIG. 12, the spherical area reevaluation (step S10) is performed between the determination of the spherical area (step S4) and the estimation of the light source information (step S5) in the first embodiment. Other processes are the same as those in the first embodiment. Specific processing in step S10 will be described below. In the target subject area of the frame i, the mask area Mi (x, y) of the pixel (x, y) determined as the spherical area in step S4 is set as in the following expression (2).
すなわち、球面領域と判定された場合にはマスクに1を設定し、非球面領域と判定された場合にはマスクに0を設定し、以下式(3)に示すようにフレームの異なる同一被写体の同一画素におけるマスクの平均値が所定の閾値thを越える場合に、該当領域を球面領域として判定する。 That is, when it is determined to be a spherical area, 1 is set to the mask, and when it is determined to be an aspherical area, 0 is set to the mask. When the average value of the mask in the same pixel exceeds a predetermined threshold th, the corresponding area is determined as a spherical area.
ここで対象とするフレームは被写体が含まれる全てのフレームであっても構わないし、特定の間隔を置いても構わないことは自明である。この処理の結果に基づいて、次の光源情報の推定(ステップS5)の処理に進む。
なお、上述の球面領域の再評価ステップにおいては、カメラが固定で光源位置のみが移動する場合のシーンを対象に説明したが、カメラや被写体が動く場合であっても被写体の局所的な領域間で対応がつけば、複数フレームに含まれる同一被写体領域に対する球面領域の判定結果に基づいて式(2)、(3)による判定結果を得ることも可能である。
It is obvious that the target frame here may be all frames including the subject or may have a specific interval. Based on the result of this process, the process proceeds to the next light source information estimation (step S5).
In the above-described spherical region reevaluation step, the description has been given for a scene where the camera is fixed and only the light source position moves. However, even if the camera or the subject moves, the local region between the subjects If the correspondence is established, it is also possible to obtain the determination results by Expressions (2) and (3) based on the determination result of the spherical area for the same subject area included in a plurality of frames.
以上説明したように、本実施形態によれば、映像に含まれる複数の球面領域を検出し、その球面領域における画素の輝度の分布に応じて、輝度の高い領域の法線方向に光源があるとして光源方向を算出し、複数の球面領域毎に算出した複数の光源方向に基づいて、光源位置を算出するようにした。これにより、光源環境の異なる複数の映像から、光源方向および光源位置を推定し、映像中の被写体における光源方向や位置・光源強度を調整することで、光学的整合性を実現した映像を合成することができる。よって、複雑なキャリブレーションや特殊なデバイスを必要とせず、光源が直接的に映っていない映像から光源位置を算出することが可能となる。 As described above, according to the present embodiment, a plurality of spherical regions included in an image are detected, and the light source is in the normal direction of the high luminance region according to the distribution of the luminance of the pixels in the spherical region. The light source direction is calculated as follows, and the light source position is calculated based on the plurality of light source directions calculated for each of the plurality of spherical regions. This makes it possible to estimate the light source direction and light source position from multiple images with different light source environments and adjust the light source direction, position, and light source intensity of the subject in the image to synthesize an image that achieves optical consistency. be able to. Therefore, it is possible to calculate the light source position from an image in which the light source is not directly reflected without requiring complicated calibration or a special device.
また、例えば、屋外・屋内等様々な環境で撮像された入力映像に対し、各映像シーンにおける光源情報を推定・調整することで、陰影等に違和感のない、光学的整合性のある既知映像を合成することができる。 In addition, for example, by estimating and adjusting the light source information in each video scene for input video captured in various environments such as outdoors and indoors, it is possible to obtain a known video with optical consistency that has no sense of incongruity in shadows etc. Can be synthesized.
なお、本発明における処理部の機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することにより映像合成を行ってもよい。なお、ここでいう「コンピュータシステム」とは、OSや周辺機器等のハードウェアを含むものとする。また、「コンピュータシステム」は、ホームページ提供環境(あるいは表示環境)を備えたWWWシステムも含むものとする。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムが送信された場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリ(RAM)のように、一定時間プログラムを保持しているものも含むものとする。 Note that a program for realizing the function of the processing unit in the present invention is recorded on a computer-readable recording medium, and the program recorded on the recording medium is read into a computer system and executed to perform video composition. May be. Here, the “computer system” includes an OS and hardware such as peripheral devices. The “computer system” includes a WWW system having a homepage providing environment (or display environment). The “computer-readable recording medium” refers to a storage device such as a flexible medium, a magneto-optical disk, a portable medium such as a ROM and a CD-ROM, and a hard disk incorporated in a computer system. Further, the “computer-readable recording medium” refers to a volatile memory (RAM) in a computer system that becomes a server or a client when a program is transmitted via a network such as the Internet or a communication line such as a telephone line. In addition, those holding programs for a certain period of time are also included.
また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。また、上記プログラムは、前述した機能の一部を実現するためのものであっても良い。さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるもの、いわゆる差分ファイル(差分プログラム)であっても良い。 The program may be transmitted from a computer system storing the program in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium. Here, the “transmission medium” for transmitting the program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line. The program may be for realizing a part of the functions described above. Furthermore, what can implement | achieve the function mentioned above in combination with the program already recorded on the computer system, and what is called a difference file (difference program) may be sufficient.
1…映像入力部、2…映像出力部、3…映像・データ蓄積部、4…領域選択部、5…球面領域判定部、6…光源情報推定部、7…光源情報調整部、8…映像合成部、9…光源情報補正部、10…球面領域再評価部、20…映像合成装置 DESCRIPTION OF SYMBOLS 1 ... Video input part, 2 ... Video output part, 3 ... Video | data storage part, 4 ... Area | region selection part, 5 ... Spherical area | region determination part, 6 ... Light source information estimation part, 7 ... Light source information adjustment part, 8 ... Video | video Composition unit, 9 ... Light source information correction unit, 10 ... Spherical region reevaluation unit, 20 ... Video composition device
Claims (9)
光源位置が含まれる光源情報が予め対応付けられた被写体を含む既知映像が記憶されている既知映像記憶部と、
前記既知映像と合成する入力映像が入力される映像入力部と、
前記映像入力部に入力された前記入力映像に含まれる複数の被写体領域を選択する領域選択部と、
前記領域選択部によって選択された被写体領域に含まれる被写体が、球面であるか否かを判定する球面領域判定部と、
前記球面領域判定部によって前記被写体が球面であると判定された複数の被写体領域毎の光源方向を算出し、算出した複数の前記光源方向に基づいて前記被写体に対する光源位置を算出する光源位置算出部と、
前記既知映像を、前記光源位置算出部によって算出された光源位置に基づいて補正する光源位置調整部と、
前記光源位置調整部によって光源位置を補正した前記既知映像を、前記入力映像に合成する映像合成部と
を備え、
前記球面領域判定部は、映像上の光源方向に平行に被写体領域の照度値分布を求め、光源方向の照度値分布のピーク数が複数ある場合にはその領域が球面でないと判定し、光源方向の照度値分布のピーク数が1つである場合にはその領域が球面であると判定することを特徴とする映像合成装置。 A video composition device that synthesizes optically consistent video from a plurality of video images of subjects with different light source environments,
A known video storage unit that stores a known video including a subject associated with light source information including a light source position in advance;
A video input unit to which an input video to be combined with the known video is input;
An area selection unit for selecting a plurality of subject areas included in the input video input to the video input unit;
A spherical region determination unit that determines whether or not a subject included in the subject region selected by the region selection unit is a spherical surface;
A light source position calculation unit that calculates a light source direction for each of a plurality of subject regions determined by the spherical region determination unit to be a spherical surface, and calculates a light source position with respect to the subject based on the calculated plurality of light source directions When,
A light source position adjustment unit that corrects the known image based on the light source position calculated by the light source position calculation unit;
A video synthesizing unit that synthesizes the known video whose light source position is corrected by the light source position adjusting unit with the input video ,
The spherical area determination unit obtains the illuminance value distribution of the subject area parallel to the light source direction on the image, and determines that the area is not spherical when there are a plurality of peaks in the illuminance value distribution in the light source direction. If the number of peaks of the illuminance value distribution has only one image synthesis device that region and wherein should be characterized as a spherical surface.
を備えたことを特徴とする請求項1又は2に記載の映像合成装置。 To the light source position calculated by the light source position calculation section, to claim 1 or 2, further comprising a light source position correcting unit for correcting the estimation result by utilizing the characteristics of neighboring areas on the image The video composition apparatus described.
を備えたことを特徴とする請求項1から3のいずれか1項に記載の映像合成装置。 A spherical region reevaluation unit that performs reevaluation of a spherical region using another image including the same subject region as the spherical region with respect to the spherical region obtained by the spherical region determination unit, The video composition device according to any one of claims 1 to 3 .
前記既知映像と合成する入力映像が入力される映像入力ステップと、
入力された前記入力映像に含まれる複数の被写体領域を選択する領域選択ステップと、
選択した被写体領域に含まれる被写体が、球面であるか否かを判定する球面領域判定ステップと、
前記被写体が球面であると判定した複数の被写体領域毎の光源方向を算出し、算出した複数の前記光源方向に基づいて前記被写体に対する光源位置を算出する光源位置算出ステップと、
前記既知映像を、前記光源位置算出ステップにおいて算出された光源位置に基づいて補正する光源位置調整ステップと、
光源位置を補正した前記既知映像を、前記入力映像に合成する映像合成ステップと、
を備え、
前記球面領域判定ステップにおいて、映像上の光源方向に平行に被写体領域の照度値分布を求め、光源方向の照度値分布のピーク数が複数ある場合にはその領域が球面でないと判定し、光源方向の照度値分布のピーク数が1つである場合にはその領域が球面であると判定することを特徴とする映像合成方法。 A known video storage unit that stores a known video including a subject in which light source information including a light source position is associated in advance, and an optically consistent video from a plurality of videos obtained by imaging subjects with different light source environments A video composition method of a video composition device for synthesizing
A video input step in which an input video to be combined with the known video is input;
An area selection step for selecting a plurality of subject areas included in the input video,
A spherical region determination step for determining whether or not a subject included in the selected subject region is a spherical surface;
A light source position calculating step of calculating a light source direction for each of a plurality of subject areas determined to be spherical, and calculating a light source position for the subject based on the calculated plurality of light source directions;
A light source position adjusting step for correcting the known video based on the light source position calculated in the light source position calculating step;
A video synthesis step of synthesizing the known video with the corrected light source position with the input video;
Equipped with a,
In the spherical area determination step, the illuminance value distribution of the subject area is obtained in parallel with the light source direction on the image. If there are a plurality of peaks in the illuminance value distribution in the light source direction, it is determined that the area is not spherical, and the light source direction If the number of peaks of the illuminance value distribution has only one image synthesis method that region and wherein should be characterized as a spherical surface.
前記光源位置算出ステップにおいて算出された光源位置に対して、映像上の近傍領域の特性を利用して推定結果の補正を行う光源位置補正ステップ
を備えたことを特徴とする請求項5又は6に記載の映像合成方法。 Between the light source position calculating step and the light source position adjusting step,
To the light source position calculated at the light source position calculation step, to claim 5 or 6, further comprising a light source position correction step of using the characteristics of the neighboring region to correct the estimation results on video The video composition method described.
前記球面領域判定ステップにおいて得られた球面領域に対して、当該球面領域と同一の被写体領域を含む他の映像を用いて球面領域の再評価を行う球面領域再評価ステップ
を備えたことを特徴とする請求項5から7のいずれか1項に記載の映像合成方法。 Between the spherical area determination step and the light source position calculation step,
A spherical region re-evaluation step for re-evaluating the spherical region with respect to the spherical region obtained in the spherical region determining step using another image including the same subject region as the spherical region. The video composition method according to any one of claims 5 to 7 .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011139350A JP5590680B2 (en) | 2011-06-23 | 2011-06-23 | Image composition apparatus, image composition method, and image composition program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011139350A JP5590680B2 (en) | 2011-06-23 | 2011-06-23 | Image composition apparatus, image composition method, and image composition program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2013009082A JP2013009082A (en) | 2013-01-10 |
JP5590680B2 true JP5590680B2 (en) | 2014-09-17 |
Family
ID=47676091
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011139350A Expired - Fee Related JP5590680B2 (en) | 2011-06-23 | 2011-06-23 | Image composition apparatus, image composition method, and image composition program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5590680B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106256122B (en) | 2014-04-30 | 2019-09-24 | 索尼公司 | Image processing equipment and image processing method |
KR102062982B1 (en) * | 2018-05-14 | 2020-01-07 | 이정협 | Method for video synthesis |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4804256B2 (en) * | 2006-07-27 | 2011-11-02 | キヤノン株式会社 | Information processing method |
CN101960859B (en) * | 2008-07-08 | 2013-04-10 | 松下电器产业株式会社 | Image processing method, image processing device, image synthesis method, and image synthesis device |
-
2011
- 2011-06-23 JP JP2011139350A patent/JP5590680B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2013009082A (en) | 2013-01-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101956149B1 (en) | Efficient Determination of Optical Flow Between Images | |
US10559095B2 (en) | Image processing apparatus, image processing method, and medium | |
KR100793838B1 (en) | Appratus for findinng the motion of camera, system and method for supporting augmented reality in ocean scene using the appratus | |
US9600887B2 (en) | Techniques for disparity estimation using camera arrays for high dynamic range imaging | |
JP5820257B2 (en) | Image processing apparatus, imaging apparatus, image processing method, and program | |
JP6418449B2 (en) | Image processing apparatus, image processing method, and program | |
US20130335535A1 (en) | Digital 3d camera using periodic illumination | |
WO2012114639A1 (en) | Object display device, object display method, and object display program | |
JP5725953B2 (en) | Imaging apparatus, control method therefor, and information processing apparatus | |
US9619886B2 (en) | Image processing apparatus, imaging apparatus, image processing method and program | |
JP6061770B2 (en) | Camera posture estimation apparatus and program thereof | |
JP7378219B2 (en) | Imaging device, image processing device, control method, and program | |
KR20170141202A (en) | Image processing apparatus and image processing method | |
KR102650217B1 (en) | Method for providing image and electronic device for supporting the same | |
US20170289516A1 (en) | Depth map based perspective correction in digital photos | |
JP2013171522A (en) | System and method of computer graphics image processing using ar technology | |
JP5590680B2 (en) | Image composition apparatus, image composition method, and image composition program | |
US9270883B2 (en) | Image processing apparatus, image pickup apparatus, image pickup system, image processing method, and non-transitory computer-readable storage medium | |
JP2016114445A (en) | Three-dimensional position calculation device, program for the same, and cg composition apparatus | |
JP2020173726A (en) | Virtual viewpoint conversion device and program | |
US11847784B2 (en) | Image processing apparatus, head-mounted display, and method for acquiring space information | |
JP2020106502A (en) | Shape measuring device, control method, and program | |
WO2021149509A1 (en) | Imaging device, imaging method, and program | |
JP2011182084A (en) | Image processor and image processing program | |
GB2560301A (en) | Methods and apparatuses for determining positions of multi-directional image capture apparatuses |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20130606 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20130611 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A821 Effective date: 20130611 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20130801 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20130926 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A821 Effective date: 20130926 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20140410 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140507 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140701 |
|
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: 20140722 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20140725 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5590680 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313117 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |