JP2023066705A - Image processing device, image processing method, and program - Google Patents
Image processing device, image processing method, and program Download PDFInfo
- Publication number
- JP2023066705A JP2023066705A JP2021177459A JP2021177459A JP2023066705A JP 2023066705 A JP2023066705 A JP 2023066705A JP 2021177459 A JP2021177459 A JP 2021177459A JP 2021177459 A JP2021177459 A JP 2021177459A JP 2023066705 A JP2023066705 A JP 2023066705A
- Authority
- JP
- Japan
- Prior art keywords
- image
- camera
- image processing
- teacher
- depth
- 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
Links
Images
Landscapes
- Image Processing (AREA)
- Studio Devices (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、機械学習により三次元モデリングを行う画像処理装置に関する。 The present invention relates to an image processing apparatus that performs three-dimensional modeling by machine learning.
従来、物体を様々な角度から撮影した画像を用いて、三次元モデリングを行う技術が知られている。特許文献1には、物体を撮影時とは別の角度から見たときの画像を、少ない演算量で生成する技術が開示されている。しかし、本来、物体から反射された光は見る角度によって見える色が変化するため、特許文献1に開示された技術では、画像を再構成する角度を変化させたときに違和感が生じる場合がある。 2. Description of the Related Art Conventionally, a technique of performing three-dimensional modeling using images of an object photographed from various angles is known. Japanese Patent Application Laid-Open No. 2002-200002 discloses a technique for generating an image of an object viewed from an angle different from that at the time of photographing with a small amount of calculation. However, since the color of light reflected from an object changes depending on the angle at which it is viewed, the technique disclosed in Patent Document 1 may cause a sense of discomfort when the angle for reconstructing an image is changed.
非特許文献1には、空間上の三次元位置に加えて光線の方向を考慮し、光線上の点をサンプリングしてボリュームレンダリングすることで、実写のような違和感のない画像を再構成する技術が開示されている。 Non-Patent Document 1 describes a technique for reconstructing an image that does not feel strange like a real shot by taking into account the direction of light rays in addition to the three-dimensional position in space, sampling points on the light rays, and performing volume rendering. is disclosed.
しかしながら、非特許文献1に開示された技術では、対象空間の端から端まで光線上の点をサンプリングしてボリュームレンダリングする必要があり、演算量が増えて多大な処理時間を要する。 However, with the technique disclosed in Non-Patent Document 1, it is necessary to perform volume rendering by sampling points on rays from end to end of the target space, which increases the amount of computation and requires a great deal of processing time.
そこで本発明は、高速にボリュームレンダリングを行うことが可能な画像処理装置、画像処理方法、およびプログラムを提供することを目的とする。 SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide an image processing apparatus, an image processing method, and a program capable of performing volume rendering at high speed.
本発明の一側面としての画像処理装置は、教師画像と、前記教師画像に対応するカメラの位置を取得する取得手段と、前記カメラの前記位置を用いて前記教師画像の各画素に対応する光線を算出する光線算出手段と、前記光線における点をサンプリングして前記教師画像を用いることで機械学習を行い、学習パラメータを算出する学習パラメータ算出手段とを有し、前記教師画像の被写界深度の範囲内における前記光線のサンプリング密度は、前記被写界深度の範囲外の前記サンプリング密度よりも高い。 An image processing apparatus as one aspect of the present invention comprises a teacher image, an acquisition unit for acquiring a position of a camera corresponding to the teacher image, and light rays corresponding to each pixel of the teacher image using the position of the camera. and a learning parameter calculation means for calculating a learning parameter by performing machine learning by sampling points on the light ray and using the teacher image, wherein the depth of field of the teacher image is higher than the sampling density outside the depth of field.
本発明の他の目的及び特徴は、以下の実施形態において説明される。 Other objects and features of the invention are described in the following embodiments.
本発明によれば、高速にボリュームレンダリングを行うことが可能な画像処理装置、画像処理方法、およびプログラムを提供することができる。 According to the present invention, it is possible to provide an image processing apparatus, an image processing method, and a program capable of performing volume rendering at high speed.
以下、本発明の実施形態について、図面を参照しながら詳細に説明する。 BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
(第1の実施形態)
まず、図1を参照して、本発明の第1の実施形態におけるパーソナルコンピュータ(画像処理装置)について説明する。図1は、パーソナルコンピュータ(画像処理装置)100のブロック図である。なお本実施形態は、画像処理装置の例としてパーソナルコンピュータを説明するが、これに限定されるものではなく、パーソナルコンピュータ以外の画像処理装置にも適用可能である。
(First embodiment)
First, a personal computer (image processing apparatus) according to the first embodiment of the present invention will be described with reference to FIG. FIG. 1 is a block diagram of a personal computer (image processing apparatus) 100. As shown in FIG. In this embodiment, a personal computer will be described as an example of the image processing apparatus, but the present invention is not limited to this, and can be applied to image processing apparatuses other than personal computers.
制御部101は、例えばCPUであり、パーソナルコンピュータ100が備える各ブロックの動作プログラムをROM102より読み出し、RAM103に展開して実行することによりパーソナルコンピュータ100が備える各ブロックの動作を制御する。ROM102は、SSD等の書き換え可能な不揮発性メモリであり、パーソナルコンピュータ100が備える各ブロックの動作プログラムに加え、各ブロックの動作に必要なパラメータ等を記憶する。RAM103は、DRAM等の書き換え可能な揮発性メモリであり、パーソナルコンピュータ100が備える各ブロックの動作において出力されたデータの一時的な記憶領域として用いられる。データストレージ部104は、機械学習のために必要な画像データや画像ごとのメタデータ等を読み書きする、ハードディスク等で構成された記録媒体である。
The
撮影カメラ位置姿勢推定部105は、画像データ群から公知のSfM(Structure from Motion)等の技術を用いて、画像ごとに撮影カメラの位置姿勢を推定する。すなわち撮影カメラ位置姿勢推定部105は、教師画像と、教師画像に対応するカメラの位置を取得する取得手段である。
A photographing camera position and
光線算出部106は、ボリュームレンダリングする際の光線を、例えば非特許文献1に開示されているような手法で算出する。非特許文献1において、ボリュームレンダリングする光線はr(t)=o+tdのように定義される。ここで、oは世界座標系におけるカメラの主点、dは世界座標系で表現される光線の方向ベクトル、tはカメラ主点から光線上のサンプリング点までの距離である。光線方向ベクトルdは、カメラの主点から像面上の各画素へ向かう三次元ベクトルを計算することで求められる。また、カメラ主点oおよび光線方向ベクトルdは、カメラ位置姿勢パラメータによりカメラ座標系から世界座標系に座標変換される。すなわち光線算出部106は、学習時においてカメラの位置を用いて教師画像の各画素に対応する光線を算出し、推論時においてカメラ位置姿勢を用いて任意視点カメラの各画素に対応する光線を算出する光線算出手段である。
The
ニューラルネットワーク部107は、光線ごとに光線上の点をサンプリングし、対応する点の色と密度をニューラルネットワークにより演算し、対象空間にわたってボリュームレンダリングすることで各光線に対応する画素の色を決定する。学習及び推論は、非特許文献1で開示されているような手法を用いればよい。学習時は、ボリュームレンダリングで算出された色と撮影画像の色とのL2損失を損失関数として誤差逆伝搬法により学習重みを収束させる。すなわちニューラルネットワーク部107は、学習時において、光線における点をサンプリングして教師画像を用いることで機械学習を行い、学習パラメータを算出する学習パラメータ算出手段である。推論時は、自由カメラ位置姿勢における各光線上をボリュームレンダリンすることで自由視点画像をレンダリングする。すなわちニューラルネットワーク部107は、推論時において、学習パラメータ算出手段により光線における点をサンプリングして事前学習された学習パラメータを用いて、機械学習によりカメラの画像をレンダリングするレンダリング手段である。
The
FΘ:(x,d)→(c,σ) ・・・(1)
式(1)において、FΘはマルチ・レイヤー・パーセプトロンからなるニューラルネットワークであり、サンプリングされる光線上の点の三次元座標x、光線方向ベクトルdを入力とする。FΘは各サンプリング点に対して、RGBの色cと密度σを出力する。光線rに対するボリュームレンダリングはCvr(r)=ΣTi(1-exp(-σi・δi))ci,i=1~Nで表される。ここで、Nはサンプリング数、iはサンプリング点毎のインデックス番号、ciおよびσiはインデックスiに対応する色および密度、δi=t(i+1)-t(i)、t(i)はインデックスiに対応するカメラ主点から光線上のサンプリング点までの距離である。また、Ti=exp(-Σσj・δj)、j=1~i-1であり、これによりオクルージョンで遮蔽されたオブジェクト色の影響を除外している。
FΘ: (x, d) → (c, σ) (1)
In equation (1), FΘ is a neural network consisting of multi-layer perceptrons, and inputs are the three-dimensional coordinate x of a point on the sampled ray and the ray direction vector d. FΘ outputs RGB color c and density σ for each sampling point. Volume rendering for ray r is represented by Cvr(r)=ΣTi(1−exp(−σi·δi))ci, i=1˜N. where N is the number of samples, i is the index number for each sampling point, ci and σi are the color and density corresponding to index i, δi=t(i+1)−t(i), t(i) is index i It is the distance from the corresponding camera principal point to the sampling point on the ray. Also, Ti=exp(-Σσj·δj) and j=1 to i−1, thereby excluding the influence of object colors blocked by occlusion.
自由カメラ位置姿勢取得部108は、自由視点画像のためのカメラ位置姿勢(任意視点カメラの位置)を取得する取得手段である。予め外部装置で算出されたカメラ位置姿勢パラメータを取得してもよく、または、ジョイスティック等の操作部材を介してユーザが指示したカメラ位置姿勢を取得してもよい。
The free camera position/
次に、図2を参照して、制御部101による3Dモデル学習について説明する。図2は、3Dモデル学習のフローチャートである。まずステップS201において、撮影カメラ位置姿勢推定部105は、学習に使用する各画像に対応するカメラ位置姿勢を推定する。学習は、イタレーション処理により学習重みを更新させることで、目標の学習重みに収束させる。続いてステップS202において、制御部101は、イタレーション処理が完了したか否かを判定する。イタレーション処理が完了した場合、本フローを終了する。一方、イタレーション処理が完了していない場合、ステップS203に進む。
Next, 3D model learning by the
ステップS203において、制御部101は、各イタレーションにおいて、まずバッチサイズ分の光線をランダムに選択する。バッチサイズは、例えば非特許文献1に示されている光線数4096のように設定すればよい。また本実施形態において、このとき、3Dモデリングに適さない光線を除外して光線を選択することで、効率的に演算コストを低減させることができる。その動作について、図3および図4を参照して説明する。
In step S203, the
図3は、教師画像の撮影の説明図であり、被写体、撮影空間、および撮影カメラの関係を説明するための鳥観図を示す。301は撮影カメラ(撮像装置)、302は3Dモデリング対象の撮影空間の範囲、303は主被写体、304は背景被写体である。撮影カメラ301のピントは主被写体303に合焦されており、ハッチング部305で示される画角および被写界深度内で合焦されている。撮影カメラ301は、撮影空間範囲302内の被写体を様々な方向から撮影するために複数配置されるが、図3では簡単のために撮影カメラ301のみを示している。
FIG. 3 is an explanatory diagram of photographing of the teacher image, and shows a bird's-eye view for explaining the relationship among the subject, the photographing space, and the photographing camera.
図4は、教師画像とピントマップ(距離分布情報)の説明図であり、撮影カメラ301で取得された画像401および付帯するメタデータであるピントマップ402を説明する図を示す。図4において、撮像面の合焦度合いをグレースケールマップの形式で示しており、手前が白、奥が黒、50%グレーが合焦を示している。ピントマップ402は、例えば特許文献2に開示されているように、全画素が位相差画素からなる撮像センサから得られる位相差画像から撮像面におけるデフォーカスマップをピントマップとして取得するように構成すればよい。
FIG. 4 is an explanatory diagram of a teacher image and a focus map (distance distribution information), and illustrates an
図3中の光線306、307は、ボリュームレンダリング対象の光線であるが、光線306上には被写界深度の範囲内にある被写体が存在しないため、除外する。不要な光線であるか否かの判定は、図4のピントマップ402に基づいて判定することが可能である。光線307に対応する画素404が50%グレーの合焦画素であるのに対して、光線306に対応する画素403は、被写界深度の範囲外の濃いグレーであることから、除外対象の光線であると判定する。このように、不要な光線を除外することで、ボリュームレンダリング処理を高速化することができる。本実施形態において、取得手段は、教師画像に対応する距離分布情報(ピントマップ)を取得し、光線算出手段は、距離分布情報に基づいて、光線が教師画像の被写界深度の範囲内にあるか否かを判定する。
なお本実施形態において、被写界深度の範囲外の光線は除外するが、これに限定されるものではない。光線算出部106が被写界深度の内側と外側で光線の粗密を変えることで、効率的に光線を選択する(光線算出手段が教師画像の被写界深度内にある光線を重点的に選択する)ようにしてもよい。例えば、被写界深度の範囲内の光線に関しては全ての光線を選択し、被写界深度の範囲外の光線に関しては対象カメラの全光線の10%以下の光線を選択することができる。
In this embodiment, light rays outside the range of the depth of field are excluded, but the invention is not limited to this. The light
図2のステップS203にてバッチサイズ分の光線が選択された後、ステップS204において、光線算出部106は光線を算出する。ボリュームレンダリングする光線は、前述の通り、r(t)=o+tdのように定義される。ここで、oは世界座標系におけるカメラの主点、dは世界座標系で表現される光線の方向ベクトル、tはカメラ主点から光線上のサンプリング点までの距離である。
After batch-size rays are selected in step S203 of FIG. 2, the
ボリュームレンダリングのためにサンプリングされる距離tの範囲は、図3中のハッチング部305で示される被写界深度の範囲内に制限される。ハッチング部305の奥行き範囲は、前方被写界深度Df、後方被写界深度Db、および合焦被写体距離Zを用いて、Z-Df~Z+Dbで表される。また、Df=(r・Av・Z^2)/(f^2+r・Av・Z)、Db=(r・Av・Z^2)/(f^2-r・Av・Z)で表される。ここで、rは許容錯乱円径、Avは絞り値、fは焦点距離である。また許容錯乱円径rは、画素ピッチの2倍とする。このように、ボリュームレンダリングのためにサンプリングされる距離tの範囲を被写界深度の範囲内に制限することで、ボリュームレンダリング処理を高速化することができる。
The range of distance t sampled for volume rendering is limited to the range of depth of field indicated by hatching 305 in FIG. The depth range of the hatched
なお本実施形態において、許容錯乱円径rを画素ピッチの2倍としているが、これに限定されるものではなく、例えば自由視点画像をレンダリングする際の解像度に応じてこれより粗くすること、または細かくしてもよい。すなわち、被写界深度を決定するための許容錯乱円径は、学習パラメータを用いたレンダリングの際の解像度(レンダリング解像度)に基づいて決定されてもよい。 In the present embodiment, the permissible circle of confusion diameter r is set to twice the pixel pitch, but it is not limited to this. You can make it finer. That is, the permissible circle of confusion diameter for determining the depth of field may be determined based on the resolution (rendering resolution) during rendering using the learning parameters.
また本実施形態において、被写界深度内をZ-Df~Z+Dbとしているが、これに限定されるものではなく、カメラから取得可能な焦点距離fや絞り値Avの誤差を考慮して、Z-2・Df~Z+2・Dbのように、幅に余裕を持った範囲にしてもよい。また本実施形態において、ボリュームレンダリングする光線範囲を被写界深度の範囲内に制限しているが、これに限定されるものではない。被写界深度の範囲内と範囲外とでサンプリングの粗密(サンプリング密度)を変えることで、効率的にサンプリングするようにしてもよい。すなわち、教師画像の被写界深度の範囲内における光線のサンプリング密度を、被写界深度の範囲外のサンプリング密度よりも高くすればよい。例えば、図3中の光線307において、3Dモデリング対象範囲302でカバーされる全範囲から32点をまずサンプリングし、ハッチング部305でカバーされる範囲に対しては追加で128点をサンプリングする。このように、被写界深度内だけサンプリング点を密に配置するようにしてもよい。
In the present embodiment, the depth of field is Z−Df to Z+Db, but the depth of field is not limited to this, and Z It may be set to a range with some margin, such as from -2·Df to Z+2·Db. Also, in the present embodiment, the light ray range for volume rendering is limited to within the range of the depth of field, but it is not limited to this. Efficient sampling may be performed by changing the sampling density (sampling density) between within and outside the range of the depth of field. That is, the sampling density of rays within the depth of field range of the teacher image should be higher than the sampling density outside the depth of field range. For example, for the
図2のステップS204にて光線が算出した後、ステップS205において、ニューラルネットワーク部107は、学習重みを更新する。制御部101は、ステップS202~S205を学習重みが収束するまで繰り返すことで、学習重みを決定する。なお、ステップS202のイタレーション完了の判定については、例えば非特許文献1に開示されているように、100-300Kイタレーションの回数に達したか否かで判定するようにすればよい。
After the ray is calculated in step S204 of FIG. 2, the
次に、図5を参照して、制御部101による自由視点画像レンダリングについて説明する。図5は、自由視点画像レンダリングのフローチャートである。まずステップS501において、自由カメラ位置姿勢取得部108は、レンダリングする自由視点のカメラ位置姿勢を取得する。続いてステップS502において、制御部101は、ボリュームレンダリングによる画素値(RGB値)の算出がレンダリング画像の全画素に関して完了したか否かを判定する。全画素に対して画素値の算出が完了した場合、本フローを終了する。一方、全画素に対して画素値の算出が完了していない場合、ステップS503に進む。
Next, free-viewpoint image rendering by the
ステップS503において、制御部101は、画素ごとに対応する三次元点が学習画像の被写界深度内にあるか否か、すなわち光線が被写界深度内の光線か否かを判定する。三次元点が被写界深度内ではない場合、ステップS502へ戻る。一方、三次元点が被写界深度内である場合、ステップS503に進み、ボリュームレンダリングを実行する。なお、被写界深度外の光線に対応する画素には、例えば黒など固定の画素値を割り当てる。
In step S503, the
図6は、自由視点カメラの説明図であり、被写体、撮影空間および各カメラの関係を説明する鳥観図を示す。図7は、教師画像とピントマップの説明図であり、撮影カメラ601で取得された画像701および付帯するメタデータであるピントマップ702を説明する図を示す。図6中の603は、レンダリングする自由視点カメラ、301、601は自由視点カメラ603に隣接する撮影カメラである。
FIG. 6 is an explanatory diagram of the free-viewpoint camera, showing a bird's-eye view explaining the relationship between the subject, the shooting space, and each camera. FIG. 7 is an explanatory diagram of a teacher image and a focus map, showing an
図4中の画素404および図7中の画素704は、同じ3次元点である図6中の607を表している。また、自由視点カメラ603の光線605と、撮影カメラ301の光線307は、同じ3次元点である図6の607を表している。三次元点607の三次元座標が事前にわかっていれば、光線605が光線307に対応していることを確認することができ、図4のピントマップ402から求めることができる。
図8は、被写体奥行き算出の説明図であり、ピントマップが示す画素位置毎のデフォーカス値defから、被写体の奥行Z+ΔZを算出する手順を説明する図を示す。801は結像光学系、802は撮像面位置、803はピント被写体距離位置、804はデフォーカス結像位置、805は被写体距離位置である。レンズの公式から、1/Z+1/Z‘=1/fおよび1/(Z+ΔZ)+1/(Z‘+def)=1/fが成立するため、これらから被写体の奥行Z+ΔZを算出することができる(f:焦点距離)。 FIG. 8 is an explanatory diagram of object depth calculation, showing a procedure for calculating the object depth Z+ΔZ from the defocus value def for each pixel position indicated by the focus map. 801 is an imaging optical system, 802 is an imaging plane position, 803 is a focus object distance position, 804 is a defocus image formation position, and 805 is an object distance position. From the lens formula, 1/Z+1/Z'=1/f and 1/(Z+ΔZ)+1/(Z'+def)=1/f hold, so the depth of the subject Z+ΔZ can be calculated from these ( f: focal length).
被写体の奥行Z+ΔZが分かれば、三次元点の座標算出の説明図である図9に示される三角形の等比関係から、x/f=X/(Z+ΔZ)およびy/f=Y/(Z+ΔZ)が成立する。これらから、三次元点607のX座標、Y座標およびZ座標(Z+ΔZ)を求めることができる。
If the depth Z+ΔZ of the subject is known, x/f=X/(Z+ΔZ) and y/f=Y/(Z+ΔZ) from the triangular geometric relationship shown in FIG. holds. From these, the X coordinate, Y coordinate and Z coordinate (Z+ΔZ) of the three-
上記から光線605が光線307に対応していることを確認することができ、学習時の光線307は被写界深度内にあることが分かっているので、光線605は、ボリュームレンダリングの対象とする。一方、図4の画素403および図7の画素703は、同じ3次元点である図6の606を表しており、それぞれ図6の光線306と光線604が対応している。しかし、学習時の光線306は被写界深度外であることが分かっているうえに、撮影カメラ601は対応する三次元点606をとらえていないため、光線604はボリュームレンダリンの対象からは除外する。このように、学習されていない3次元点に対応する光線をボリュームレンダリングの対象外とすることで、自由視点画像のボリュームレンダリング処理を高速化することができる。
From the above, it can be confirmed that the
図5のステップS503にて被写界深度内と判定された光線に関して、ステップS504において、光線算出部106は光線を算出する。ボリュームレンダリングする光線は、前述の通り、r(t)=o+tdのように定義される。ここで、oは世界座標系におけるカメラの主点、dは世界座標系で表現される光線の方向ベクトル、tはカメラ主点から光線上のサンプリング点までの距離である。ボリュームレンダリングのためにサンプリングされる距離tの範囲は、図6のハッチング部305およびハッチング部602で示される隣接する撮影カメラ301、601の被写界深度内に制限される。このように、ボリュームレンダリングのためにサンプリングされる距離tの範囲を隣接する撮影カメラの被写界深度内に制限することで、自由視点画像のボリュームレンダリング処理を高速化することができる。
In step S504, the
図5のステップS504にて光線が算出した後、ステップS505において、ニューラルネットワーク部107は、ボリュームレンダリング処理を実行し、対応する画素値(RGB値)を算出する。
After the rays are calculated in step S504 of FIG. 5, the
なお本実施形態において、撮影カメラの画像(教師画像)とピントマップ(距離分布情報)の解像度は同じであるが、これに限定されるものではなく、異なる解像度であってもよい。例えば、距離分布情報プを教師画像よりも解像度を低くしてもよい。ピントマップのように視差マップを元に生成されるマップは、ステレオ対応点探索のために所定サイズのテンプレートマッチングが行われるため、通常テンプレートサイズ分だけマップサイズは小さくなる。例えばテンプレートサイズが16×16画素であれば、通常マップサイズは縦横共に1/16となる。なお、自由視点画像をレンダリングする際もピントマップが必要であるが、このとき保持しておくピントマップを縦横共に1/16した縮小版のピントマップで保持しておけば、レンダリングに必要なデータ容量を削減することができる。 Note that in the present embodiment, the image (teacher image) of the photographing camera and the focus map (distance distribution information) have the same resolution, but are not limited to this, and may have different resolutions. For example, the distance distribution information may have a lower resolution than the teacher image. A map generated based on a parallax map, such as a focus map, is usually reduced in size by the size of the template because template matching of a predetermined size is performed for searching for stereo corresponding points. For example, if the template size is 16×16 pixels, the normal map size is 1/16 both vertically and horizontally. Note that a focus map is also necessary when rendering a free-viewpoint image. Capacity can be reduced.
図10は、教師画像と低解像度ピントマップの説明図であり、撮影カメラ301で取得された画像401および付帯するメタデータであるピントマップ1001を説明する図を示す。ピントマップ1001は、テンプレートマッチングのテンプレートサイズ分(16×16画素)だけ解像度が低く、ピントマップの1画素が画像の16×16画素の領域に対応している。また、図3を参照して説明した通り、303は主被写体、304は背景被写体である。
FIG. 10 is an explanatory diagram of a teacher image and a low-resolution focus map, and shows an
画像401上の画素1003は、ピントマップ1001上の画素1002に対応している。画素1003は、主被写体303を示しているが、テンプレートの16×16画素の範囲に主被写体303と背景である地面の両方が含まれる。このため、画素1002のピントマップ画素値(デフォーカス値)は主被写体303と地面のデフォーカス値の間の値になる場合がある。そこで、画素1003のような被写体輪郭領域に関しては、広めに光線を選択するとともに、ボリュームレンダリングのサンプリング範囲も制限しないようにする。すなわち光線算出手段は、距離分布情報に基づいて被写体輪郭領域を特定し、被写体輪郭領域に対して、光線を選択しやすくし、サンプリング範囲を広範囲に設定する。
A
本実施形態において、撮影カメラのレンズによる歪曲はごくわずかとし、学習画像に歪曲補正を行わないが、これに限定されるものではなく、歪曲がある学習画像を利用するようにしてもよい。その場合、正しい光線が算出できるように、学習画像には歪曲補正を行う。さらに、画像とペアで参照されるピントマップに対しても歪曲補正を行うことで、正しく光線選択ができるようにする。すなわち取得手段は、カメラの光学系の歪曲成分に基づいて、教師画像および距離分布情報に対する処理を行ってもよい。 In the present embodiment, the distortion due to the lens of the photographing camera is very slight and the learning image is not subjected to distortion correction. In that case, distortion correction is performed on the learning image so that the correct ray can be calculated. Furthermore, correct ray selection is made possible by performing distortion correction on the focus map that is referenced in pairs with the image. That is, the acquiring means may process the teacher image and the distance distribution information based on the distortion component of the optical system of the camera.
本実施形態において、データストレージ部104に保持するピントマップの画素値はデフォーカス値であるが、これに限定されるものではなく、視差値や距離値でもよい。また、いずれの形式であってもボリュームレンダリングの範囲を決定する際に距離値に変換できればよい。また、デフォーカス値で保持する際には、レンズの偏心や撮像素子の傾きによるピントずれを予め撮像カメラで補正したうえでデフォーカス値をピントマップとして記録し、データストレージ部104に保持してもよい。すなわち距離分布情報は、視差を表すシフト量に基づくマップ(視差マップ)、デフォーカス量に基づくマップ(デフォーカスマップ)、または距離に基づくマップ(距離マップ)の少なくとも一つを含んでいればよい。
In this embodiment, the pixel values of the focus map held in the
本実施形態において、例えば図3に示されるように、ボリュームレンダリングの範囲は、前方被写界深度と後方被写界深度とで定義されるハッチング部305であるが、これに限定されるものではない。例えば、ピントマップから被写体表面が被写体の前方または後方のいずれにあるかを判定し、さらにボリュームレンダリングの範囲を制限するようにしてもよい。すなわち、距離分布情報(ピントマップの符号)に基づいて、被写体表面が被写体合焦距離よりも手前(前方)にあるか奥(後方)にあるかを判定し、その判定結果に基づいて、サンプリング密度を変化させてもよい。例えば、図3の被写体303に関して、ピントマップから被写体表面は前方に存在することが分かるため、ボリュームレンダリングの範囲を前方被写界深度の範囲のみに限定してもよい。
In this embodiment, for example, as shown in FIG. 3, the range of volume rendering is a hatched
また本実施形態において、ボリュームレンダリング範囲は、ピント被写体距離を基準として決定されるが、これに限定されるものではない。例えば、被写体表面位置を基準として所定範囲をボリュームレンダリング範囲とするようにしてもよい。すなわち、距離分布情報に基づいて被写体表面までの距離を決定し、被写体表面までの距離を基準としてサンプリング密度を決定してもよい。被写体表面の奥行位置については、図8を参照して説明した手法で決定すればよい。 Also, in the present embodiment, the volume rendering range is determined based on the in-focus subject distance, but it is not limited to this. For example, a predetermined range may be set as the volume rendering range based on the object surface position. That is, the distance to the surface of the subject may be determined based on the distance distribution information, and the sampling density may be determined based on the distance to the surface of the subject. The depth position of the object surface may be determined by the method described with reference to FIG.
本実施形態において、自由視点画像レンダリング時に被写界深度内の光線のみを用いて(ステップS503)ボリュームレンダリングするため、被写界深度外の光線に対応する画素には例えば黒など固定の画素値を割り当てるが、これに限定されるものではない。背景など被写界深度外の画素だけ別の方法でレンダリングするようにしてもよい。例えば、背景に全天球の環境テクスチャを張り付けてもよく、または、背景は全く別の背景3Dモデルからレンダリングしてもよい。 In the present embodiment, since volume rendering is performed using only light rays within the depth of field during free-viewpoint image rendering (step S503), pixels corresponding to light rays outside the depth of field have fixed pixel values such as black , but is not limited to this. Only pixels outside the depth of field, such as the background, may be rendered differently. For example, the background may be pasted with a spherical environment texture, or the background may be rendered from an entirely separate background 3D model.
本実施形態において、画面全面に亘りピントマップが評価できるが、これに限定されるものではなく、ピントマップが演算できない低信頼領域を定義し、後処理で不具合が起きないようにしてもよい。そのような場合、低信頼領域については、全ての対象光線を選択するようにすればよい。すなわち光線算出手段は、距離分布情報に基づいて信頼性が低いと判定した領域(低信頼領域)に対して、全ての光線を選択し、サンプリング範囲を広範囲に設定することができる。 In this embodiment, the focus map can be evaluated over the entire screen, but the present invention is not limited to this, and a low-reliability region in which the focus map cannot be calculated may be defined to prevent problems from occurring in post-processing. In such a case, all target rays should be selected for the low-confidence region. That is, the light ray calculating means can select all light rays for a region (low-reliability region) determined to have low reliability based on the distance distribution information, and set a wide sampling range.
本実施形態によれば、ボリュームレンダリングする光線およびサンプリング範囲を適切に制限することができ、ボリュームレンダリング処理を高速化することができる。 According to this embodiment, it is possible to appropriately limit the rays for volume rendering and the sampling range, thereby speeding up the volume rendering process.
(第2の実施形態)
次に、本発明の第2の実施形態における画像処理装置について説明する。本実施形態において、取得手段は、更に周辺空間(背景被写体を含む空間)の周辺教師画像を取得し、学習パラメータ算出手段は、教師画像と周辺教師画像とを用いることで機械学習を行い、学習パラメータを算出する。なお、本実施形態における画像処理装置の構成は、図1を参照して第1の実施形態にて説明したパーソナルコンピュータ100の構成と同様である。また、図1の制御部101が実行する図2に示される3Dモデル学習の動作および図5の自由視点画像レンダリングの動作を説明するためのフローチャートも第1の実施形態と同様である。
(Second embodiment)
Next, an image processing apparatus according to a second embodiment of the invention will be described. In the present embodiment, the acquisition means further acquires a peripheral teacher image of the surrounding space (a space including the background subject), and the learning parameter calculation means performs machine learning by using the teacher image and the peripheral teacher image, and learns Calculate parameters. The configuration of the image processing apparatus according to this embodiment is the same as the configuration of the
図11は、教師画像の撮影および自由視点カメラの説明図であり、被写体、撮影空間、撮影カメラおよび自由視点カメラの関係を説明する鳥観図を示す。1101、1105は撮影カメラ、1103は自由視点カメラ、302は3Dモデリング対象の撮影空間の範囲、303は主被写体、304は背景被写体である。撮影カメラ1101は、広角の焦点距離を有し、ピントは背景被写体304に合焦されており、ハッチング部1102で示される画角および被写界深度内で合焦されている。また撮影カメラ1105は、標準画角の焦点距離を有し、ピントは主被写体303に合焦されており、ハッチング部1106で示される画角および被写界深度内で合焦されている。
FIG. 11 is an explanatory diagram of the shooting of the teacher image and the free-viewpoint camera, showing a bird's-eye view for explaining the relationship between the subject, the shooting space, the shooting camera, and the free-viewpoint camera.
本実施形態において、撮影空間範囲302内の被写体を様々な方向から撮影するため、撮影カメラ1101、1105以外にも複数の撮影カメラが配置される。具体的には、主被写体303を撮影するため撮影カメラ1105と同程度の焦点距離および撮影距離(フォーカス位置)を有する撮影カメラを複数配置する。また、主被写体303以外の被写体を撮影するため撮影カメラ1101と同程度の焦点距離および撮影距離(フォーカス位置)を有する撮影カメラを複数配置する。図11では、簡単のために、撮影カメラ1101、1105のみを図示している。
In this embodiment, in order to photograph the subject within the
図12および図13は、周辺教師画像または教師画像とピントマップの説明図であり、撮影カメラ1101、1105で取得された画像1201、1301、および付帯するメタデータであるピントマップ1202、1302を説明する図を示す。ピントマップは、第1の実施形態と同様に、公知の技術で算出される。
12 and 13 are explanatory diagrams of surrounding teacher images or teacher images and focus maps, and illustrate
撮影カメラ1101は、広角な焦点距離で背景被写体304に合焦させているため、画像1201に示されるように複数被写体が広範囲に撮影され、ピントマップ1202に示されるように背景被写体304が合焦の50%グレーを示している。一方、撮影カメラ1105は、標準画角の焦点距離で主被写体303に合焦させているため、画像1301に示されるように主となる被写体がメインで撮影され、ピントマップ1302に示されるように主被写体303が合焦の50%グレーを示している。
Since the
上述のように構成することで、図2の3Dモデル学習においてバッチサイズ分の光線を選択する(S204)際に、図11の標準画角の撮影カメラ1105において背景被写体304上の三次元点606に対応する光線1111が被写界深度外で選択されない。一方、広角の撮影カメラ1101の光線1103は、背景被写体304上の三次元点606を被写界深度内であるため、対象光線として選択され、主被写体303だけではなく背景被写体304についても3Dモデルに含めることができる。
With the configuration as described above, when selecting a batch size of light rays (S204) in the 3D model learning of FIG.
また、図5のステップS503の判定の際に、図11の自由視点カメラ1108の光線1110は対応する三次元点607が隣接する撮影カメラ1105の光線1107で被写界深度内に捉えられていることが分かるため、対象の光線として選択される。また、図11の自由視点カメラ1108の光線1109は、対応する三次元点606が隣接する撮影カメラ1101の光線1103で被写界深度内に捉えられていることが分かるため、対象の光線として選択される。このように、主被写体303だけではなく背景被写体304についても自由視点画像をレンダリングすることができる。
5, the
本実施形態において、撮影カメラ1101、1105で焦点距離と撮影距離の両方を異ならせることで主被写体と背景被写体の双方をボリュームレンダリングできるように構成するが、これに限定されるものではなく、撮影距離だけ異ならせるようにしてもよい。背景被写体用の撮影カメラ1101の焦点距離を長くすると画角が狭められるため、配置する撮影カメラ数が増加する可能性がある。また、主被写体用の撮影カメラ1105の焦点距離を短くすると画角が広がるため、カメラが被写体に寄る必要が発生し、撮影カメラ1101に撮影カメラ1105が映り込んでしまう可能性がある。一方、焦点距離を合わせておけば、撮影準備やカメラキャリブレーションにおいてメリットがあるため、簡易な撮影に向いている。
In this embodiment, the
本実施形態において、撮影カメラ1101、1105で焦点距離と撮影距離の両方を異ならせることで主被写体と背景被写体の双方をボリュームレンダリング可能に構成するが、これに限定されるものではなく、代わりに絞り値を異ならせるようにしてもよい。すなわち、主被写体用の撮影カメラ1105は開放付近の明るい絞り値に設定する一方、背景被写体用の撮影カメラ1101は絞り込んで撮影空間範囲302全体が被写界深度内に入るように絞り値を設定する。これにより、主被写体用の撮影カメラ1105は暗いシャッター秒時を選択し主被写体に動きがある場合でもシャープに撮影できるが、背景用の撮影カメラ1101は動きがある被写体に弱くなることや撮影感度が上がってノイズを増やす懸念が生じる。一方、背景被写体が撮影空間範囲302内に複数散在しているようなケースでは、撮り漏らしなく3Dモデルが生成できるメリットがある。このように周辺教師画像は、少なくともフォーカス位置(撮影距離)、焦点距離、または絞り値のうち少なくとも一つにおいて、教師画像と異なる画像でればよい。
In this embodiment, both the main subject and the background subject can be rendered in volume by making both the focal length and the shooting distance of the
本実施形態において、自由視点画像をレンダリングする際もピントマップを利用してボリュームレンダリングを高速化するが、これに限定されるものではない。例えば、3Dモデルの学習にはピントマップを利用して高速化する一方、自由視点画像レンダリングは従来技術通り撮影空間範囲にわたって空間サンプリングするようにしてもよい。これにより、自由視点画像レンダリング時にピントマップが不要になる。このため、従来技術によるレンダラーでも自由視点画像をレンダリングすることができるようになり、レンダラーの汎用性を高めることができる。 In this embodiment, the focus map is used to speed up the volume rendering when rendering the free viewpoint image, but the present invention is not limited to this. For example, the 3D model training may utilize a focus map to speed up, while the free-viewpoint image rendering may be spatially sampled over the imaging space range as in the prior art. This eliminates the need for a focus map during free-viewpoint image rendering. Therefore, even a conventional renderer can render a free-viewpoint image, and the versatility of the renderer can be enhanced.
本実施形態において、主被写体も背景被写体も同じニューラルネットワークで3Dモデリングするが、これに限定されるものではなく、主被写体と背景被写体で別々のニューラルネットワークを構成してもよい。すなわち学習パラメータ算出手段は、教師画像と周辺教師画像とで異なる機械学習モデルを学習してもよい。これにより、学習効率を向上させることや、背景被写体の細部の再現性を向上させたりすることが期待できる。 In this embodiment, the main subject and the background subject are 3D modeled by the same neural network, but the present invention is not limited to this, and separate neural networks may be configured for the main subject and the background subject. That is, the learning parameter calculation means may learn different machine learning models for the teacher image and the surrounding teacher images. This can be expected to improve the learning efficiency and improve the reproducibility of the details of the background subject.
本実施形態によれば、主被写体と背景被写体とでボリュームレンダリングに最適な光線を選択することができ、主被写体だけでなく背景被写体も含めて高速に3Dモデルを生成し自由視点画像を高速にレンダリングすることができる。 According to this embodiment, it is possible to select the optimum light rays for volume rendering for the main subject and the background subject, and generate a 3D model of not only the main subject but also the background subject at high speed, thereby speeding up the free-viewpoint image. can be rendered.
(第3の実施形態)
次に、本発明の第3の実施形態における画像処理装置について説明する。図14は、パーソナルコンピュータ(画像処理装置)1400のブロック図である。本実施形態のパーソナルコンピュータ1400は、ニューラルネットワーク部1401を有する点で、第1の実施形態にて説明したニューラルネットワーク部107を有するパーソナルコンピュータ100と異なる。なお、パーソナルコンピュータ1400の他の構成は、パーソナルコンピュータ100と同様であるため、それらの説明は省略する。
(Third Embodiment)
Next, an image processing apparatus according to a third embodiment of the invention will be described. FIG. 14 is a block diagram of a personal computer (image processing apparatus) 1400. As shown in FIG. A
ニューラルネットワーク部1401は、被写体に動きがあるダイナミックシーン(動画)に対応可能である。このようなダイナミックシーンにおいて、光線ごとに光線上の点をサンプリングし対応する点の色と密度をニューラルネットワークにより演算し、対象空間にわたってボリュームレンダリングすることで各光線に対応する画素の色を決定する。学習および推論は、例えば非特許文献2に開示されている技術を用いることができる。学習時は、ボリュームレンダリングで算出された色と撮影画像の色とのL2損失を損失関数として誤差逆伝搬法により学習重みを収束させ、推論時は自由カメラ位置姿勢における各光線上をボリュームレンダリンすることで自由視点画像をレンダリングする。
The
FΘ:(x,d,zt)→(c,σ) ・・・(2)
式(2)において、FΘはマルチ・レイヤー・パーセプトロンからなるニューラルネットワークであり、サンプリングされる光線上の点の三次元座標x、光線方向ベクトルdに加え、時刻tのフレームにおける潜在コードztを入力とする。FΘは各サンプリング点に対して、RGBの色cと密度σを出力する。
FΘ: (x, d, zt) → (c, σ) (2)
In equation (2), FΘ is a neural network consisting of a multi-layer perceptron, and inputs the three-dimensional coordinate x of the point on the sampled ray, the ray direction vector d, and the latent code zt in the frame at time t. and FΘ outputs RGB color c and density σ for each sampling point.
第1の実施形態のニューラルネットワーク部107は、単一の3Dモデルのみを表現する。一方、本実施形態のニューラルネットワーク部1401は、フレームごとに潜在コードztを変化させることで、フレームごとに3D形状がダイナミックに変化するシーンを表現することが可能である。
The
次に、図15を参照して、制御部101によるダイナミック3Dモデル学習について説明する。図15は、ダイナミック3Dモデル学習のフローチャートである。まずステップS201において、撮影カメラ位置姿勢推定部105は、学習に使用する各画像に対応するカメラ位置姿勢を推定する。撮影カメラの位置は固定されているため、最初のフレームで取得された画像を用いてカメラ位置姿勢を推定する。
Next, dynamic 3D model learning by the
続いてステップS1501において、制御部101は全フレームに対する処理が完了したか否かを判定する。全フレームに対する処理が完了した場合、本フローを終了する。一方、全フレームに対する処理が完了していない場合、ステップS1502に進む。ステップS1502において、制御部101は、各フレームに対応する潜在コードを生成する。
Subsequently, in step S1501, the
続いてステップS1503において、制御部101は、イタレーション処理が完了したか否かを判定する。各フレームの学習は、イタレーション処理により学習重みを更新させることで、目標の学習重みに収束させる。イタレーション処理が完了した場合、ステップS1501へ戻る。一方、イタレーション処理が完了していない場合、ステップS1504に進む。
Subsequently, in step S1503, the
ステップS1504において、制御部101は、各イタレーションにおいて、まずバッチサイズ分の光線をランダムに選択する。非特許文献2には、入力ビデオの時間変動に基づいて学習のための次の光線を選択するレイ・インポータンス・サンプリングを行うことで、効率的に演算コストを低減させる技術が開示されている。本実施形態において、レイ・インポータンス・サンプリングを入力ビデオの被写界深度も考慮して行うことで、更なる演算効率化を図る。以下、図16乃至図19を参照して、その動作について説明する。
In step S1504, the
図16は、教師画像の撮影の説明図であり、入力ビデオの冒頭フレームにおける、被写体、撮影空間および撮影カメラの関係を説明する鳥観図を示す。1601は撮影カメラ、302は3Dモデリング対象の撮影空間の範囲、303は主被写体、304は背景被写体である。撮影カメラ1601のピントは主被写体303に合焦されており、ハッチング部1605で示される広角な画角及びパンフォーカスな被写界深度内で撮影空間範囲302が全体的に合焦されている。撮影カメラ1601は、撮影空間範囲302内の被写体を様々な方向から撮影するために複数配置されるが、図16では簡単のために撮影カメラ1601のみを示している。
FIG. 16 is an explanatory diagram of shooting a teacher image, and shows a bird's-eye view for explaining the relationship among the subject, shooting space, and shooting camera in the beginning frame of the input video.
撮影カメラ1601は、この後のフレームにおいて、焦点距離を標準画角に変化させ、絞りを開放寄りの明るい絞り値(F値)に変化させることで、主被写体303をより高精細に撮影できるようにカメラパラメータを変化させる。図17は、教師画像の撮影の説明図であり、カメラパラメータ変化後の、被写体、撮影空間および撮影カメラの関係を説明する鳥観図を示す。撮影カメラ1601のピントは主被写体303に合焦されており、ハッチング部1705で示される標準画角および浅い被写界深度内で撮影空間範囲302が部分的に合焦されている。
In subsequent frames, the
図18は、教師画像とピントマップの説明図であり、入力ビデオの冒頭フレームにおける撮影カメラ1601で取得された画像1801および付帯するメタデータであるピントマップ1802を説明する図を示す。図18では、撮像面の合焦度合いをグレースケールマップの形式で示しており、手前が白、奥が黒、50%グレーが合焦を示す。図19は、教師画像とピントマップの説明図であり、カメラパラメータ変化後の撮影カメラ1601で取得された画像1901および付帯するメタデータであるピントマップ1902を説明する図を示す。
FIG. 18 is an explanatory diagram of a teacher image and a focus map, showing an
入力ビデオの冒頭フレームにおける、図16の光線1606および光線1607はボリュームレンダリン対象の光線で、かつ対応する三次元点が被写界深度内にあるため、2光線とも選択される。一方、カメラパラメータ変化後の、図17の光線1706および光線1707もボリュームレンダリン対象の光線であるが、光線1706上には被写界深度範囲にある被写体が存在しないため、除外する。不要な光線であるか否かの判定は、図19のピントマップ1902により判定することが可能である。光線1707に対応する画素1904が50%グレーの合焦画素であるのに対して、光線1706に対応する画素1903は被写界深度外の濃いグレーであることから、除外対象の光線であると判定する。
図15のステップS1504にてバッチサイズ分の光線を選択した後、ステップS1505において、光線算出部106は光線を算出する。ボリュームレンダリングする光線は、前述の通り、r(t)=o+tdのように定義される。ここで、oは世界座標系におけるカメラの主点、dは世界座標系で表現される光線の方向ベクトル、tはカメラ主点から光線上のサンプリング点までの距離である。ボリュームレンダリングのためにサンプリングされる距離tの範囲は、図16のハッチング部1605、および図17のハッチング部1705で示される被写界深度内に制限される。このように、レイ・インポータンス・サンプリングを、被写界深度を考慮して行うことで、ボリュームレンダリング処理を高速化することができる。
After selecting rays for the batch size in step S1504 of FIG. 15, the
また本実施形態において、被写界深度が深い図16の場合でも被写界深度に応じたサンプリング範囲tを制限しているが、これに限定されるものではない。このような場合には、サンプリング範囲を制限する効果も低いことから、サンプリング範囲を固定化するために十分広い固定範囲を設定するようにしてもよい。 Also, in the present embodiment, even in the case of FIG. 16 where the depth of field is deep, the sampling range t is limited according to the depth of field, but the present invention is not limited to this. In such a case, since the effect of limiting the sampling range is low, a sufficiently wide fixed range may be set to fix the sampling range.
図15のステップS1505にて光線が算出した後、ステップS1506において、ニューラルネットワーク部1401は、学習重みを更新する。ステップS1503~S1506の動作を学習重みが収束するまで繰り返すことで、学習重みを決定する。入力ビデオの全フレームの処理が完了した場合、本フローを終了する(ステップS1501)。
After the ray is calculated in step S1505 of FIG. 15, the
本実施形態において、被写界深度に基づいてレイ・インポータンス・サンプリングを行うが、これに限定されるものではなく、入力ビデオの時間変動と被写界深度の両方に基づいてレイ・インポータンス・サンプリングを行うようにしてもよい。多くの場合、入力ビデオのほうがピントマップより解像度が高い。このため、入力ビデオの時間変動を観測することで、より解像度高く不要な光線を除外したうえで、サンプリング範囲をピントマップに基づいて制限することができるため、更なる演算効率化が期待できる。 In the present embodiment, ray importance sampling is based on depth of field, but is not limited to, ray importance sampling based on both time variation of input video and depth of field. may be performed. The input video is often higher resolution than the focus map. Therefore, by observing temporal fluctuations in the input video, it is possible to exclude unnecessary light rays with higher resolution and limit the sampling range based on the focus map, which is expected to further improve computational efficiency.
次に、図20を参照して、制御部101による自由視点画像レンダリングについて説明する。図20は、本実施形態における自由視点画像レンダリングのフローチャートである。まずステップS501において、自由カメラ位置姿勢取得部108は、レンダリングする自由視点のカメラ位置姿勢を取得する。
Next, referring to FIG. 20, free-viewpoint image rendering by the
続いてステップS2001において、制御部101は全フレームに対する処理が完了したか否かを判定する。全フレームに対する処理が完了した場合、本フローを終了する。一方、全フレームに対する処理が完了していない場合、ステップS2002に進み、各フレームの潜在コードZtを更新しつつ、レンダリング画像の全画素に亘って、ボリュームレンダリングにより画素値(RGB値)を算出する。すなわちステップS2002において、制御部101は、各フレームに対応する潜在コードを生成する。続いてステップS2003において、制御部101は、ボリュームレンダリングによる画素値(RGB値)の算出がレンダリング画像の全画素に関して完了したか否かを判定する。全画素に対して画素値の算出が完了した場合、ステップS2001に戻る。一方、全画素に対して画素値の算出が完了していない場合、ステップS2004に進む。
Subsequently, in step S2001, the
ステップS2004において、光線算出部106は、各画素に対応する光線を算出する(S2004)。ボリュームレンダリングする光線は、前述の通り、r(t)=o+tdのように定義される。ここで、oは世界座標系におけるカメラの主点、dは世界座標系で表現される光線の方向ベクトル、tはカメラ主点から光線上のサンプリング点までの距離である。ステップS2004にて光線が算出した後、ステップS2005において、ニューラルネットワーク部107は、ボリュームレンダリング処理を実行し、対応する画素値(RGB値)を算出する。
In step S2004, the
本実施形態において、入力ビデオの冒頭とそれ以降で焦点距離および被写界深度を変更するが、これに限定されるものではなく、例えば標準画角かつ浅い被写界深度で撮影している途中で複数回広角かつパンフォーカスな撮影を挟むようにしてもよい。これにより、入力ビデオの尺が長い場合に、途中で日差しなどの周辺環境が徐々に変化しても対応することができる。 In this embodiment, the focal length and depth of field are changed at the beginning and after the input video, but the present invention is not limited to this. A plurality of wide-angle and pan-focus shots may be sandwiched between . As a result, when the length of the input video is long, even if the ambient environment such as sunlight changes gradually during the input video, it can be handled.
本実施形態において、入力ビデオの冒頭とそれ以降で焦点距離および被写界深度を変更するが、これに限定されるものではなく、絞りだけ制御して被写界深度のみを変更するようにしてもよい。これにより、ズーム機構が無い単焦点レンズでも撮影が可能になる。もしくは、広角な単焦点カメラと標準画角の単焦点カメラを複数配置するようにしてもよい。また、ズームレンズであれば、絞り開放のまま標準画角から広角に焦点距離を変化させても被写界深度は深くなるため、それで十分な場合は焦点距離だけ制御するようにしてもよい。 In this embodiment, the focal length and depth of field are changed at the beginning and the end of the input video, but the present invention is not limited to this, and only the aperture is controlled to change only the depth of field. good too. This makes it possible to shoot even with a single focal length lens that does not have a zoom mechanism. Alternatively, a plurality of wide-angle single-focus cameras and standard-angle single-focus cameras may be arranged. In the case of a zoom lens, even if the focal length is changed from a standard angle of view to a wide angle with the aperture open, the depth of field is increased, so if that is sufficient, only the focal length may be controlled.
本実施形態において、入力ビデオの冒頭とそれ以降で焦点距離および被写界深度を変更するが、これに限定されるものではなく、フォーカスを徐々に背景から主被写体に変更するようにしてもよい。これにより、主被写体だけではなくそれ以外の被写体も高精細に撮影することができる。フォーカスを変化させると像倍率が変化するので、さらに像倍率変化を補正することでより高精度に3Dモデルを学習させることができる。 In this embodiment, the focal length and depth of field are changed at the beginning of the input video and thereafter, but the invention is not limited to this, and the focus may be gradually changed from the background to the main subject. . As a result, not only the main subject but also other subjects can be photographed with high definition. Since the image magnification changes when the focus is changed, the 3D model can be learned with higher accuracy by further correcting the change in the image magnification.
このように本実施形態において、教師画像は、所定のフレームレートで取得された動画である。学習パラメータ算出手段は、動画のフレームごとに該フレームの特徴を示すコード特徴量(潜在コード)を算出し、動画のフレームごとにコード特徴量と教師画像とを用いることで機械学習を行い、学習パラメータを算出する。本実施形態において、取得手段は、教師画像において時間的に変化する領域(時間的な外観変化が顕著な領域)を取得し、光線算出手段は、取得手段により取得された領域の光線を重点的に選択して、対応する光線を出力してもよい。また本実施形態において、教師画像は、フォーカス位置、焦点距離、または絞り値のうち少なくとも一つが異なるフレームを含むように取得された動画である。 As described above, in this embodiment, the teacher image is a moving image acquired at a predetermined frame rate. The learning parameter calculation means calculates a code feature amount (latent code) indicating the feature of each frame of the moving image, and performs machine learning by using the code feature amount and the teacher image for each frame of the moving image. Calculate parameters. In the present embodiment, the acquisition means acquires a temporally changing region (a region in which the appearance changes significantly over time) in the teacher image, and the ray calculation means focuses the rays in the region acquired by the acquisition means. to output the corresponding rays. Also, in this embodiment, the teacher image is a moving image acquired so as to include frames in which at least one of the focus position, focal length, or aperture value is different.
本実施形態によれば、被写体に動きがあるダイナミックシーンにおいても効率的にボリュームレンダリングを行うことで、高速に3Dモデルを生成することができる。 According to this embodiment, it is possible to generate a 3D model at high speed by efficiently performing volume rendering even in a dynamic scene in which an object moves.
(その他の実施形態)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other embodiments)
The present invention supplies a program that implements 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 the computer of the system or apparatus reads and executes the program. It can also be realized by processing to It can also be implemented by a circuit (for example, ASIC) that implements one or more functions.
各実施形態によれば、ボリュームレンダリングする光線とサンプリング範囲を適切に制限することで、高速に物体の緻密な形状を計測し、実写のような画像を再構成することができる。このため各実施形態によれば、高速にボリュームレンダリングを行うことが可能な画像処理装置、画像処理方法、およびプログラムを提供することができる。 According to each embodiment, by appropriately limiting the light rays for volume rendering and the sampling range, it is possible to measure the precise shape of an object at high speed and reconstruct an image that looks like an actual photograph. Therefore, according to each embodiment, it is possible to provide an image processing apparatus, an image processing method, and a program capable of performing volume rendering at high speed.
以上、本発明の好ましい実施形態について説明したが、本発明はこれらの実施形態に限定されず、その要旨の範囲内で種々の変形及び変更が可能である。 Although preferred embodiments of the present invention have been described above, the present invention is not limited to these embodiments, and various modifications and changes are possible within the scope of the gist.
100 パーソナルコンピュータ(画像処理装置)
105 撮影カメラ位置姿勢推定部(取得手段)
106 光線算出部(光線算出手段)
107 ニューラルネットワーク部(学習パラメータ算出手段、レンダリング手段)
108 自由カメラ位置姿勢取得部(取得手段)
100 personal computer (image processing device)
105 Photographing camera position/orientation estimation unit (acquisition unit)
106 ray calculator (ray calculator)
107 neural network unit (learning parameter calculation means, rendering means)
108 Free camera position and orientation acquisition unit (acquisition means)
Claims (20)
前記カメラの前記位置を用いて前記教師画像の各画素に対応する光線を算出する光線算出手段と、
前記光線における点をサンプリングして前記教師画像を用いることで機械学習を行い、学習パラメータを算出する学習パラメータ算出手段とを有し、
前記教師画像の被写界深度の範囲内における前記光線のサンプリング密度は、前記被写界深度の範囲外の前記サンプリング密度よりも高いことを特徴とする画像処理装置。 a teacher image; an acquisition means for acquiring a position of a camera corresponding to the teacher image;
light ray calculation means for calculating a light ray corresponding to each pixel of the teacher image using the position of the camera;
learning parameter calculation means for performing machine learning by sampling points on the light beam and using the teacher image to calculate learning parameters;
The image processing apparatus according to claim 1, wherein the sampling density of the rays within the range of the depth of field of the teacher image is higher than the sampling density outside the range of the depth of field.
前記カメラの前記位置を用いて前記カメラの各画素に対応する光線を算出する光線算出手段と、
学習パラメータ算出手段により前記光線における点をサンプリングして事前学習された学習パラメータを用いて、機械学習により前記カメラの画像をレンダリングするレンダリング手段とを有し、
前記事前学習で用いられた教師画像の被写界深度の範囲内における前記光線のサンプリング密度は、前記被写界深度の範囲外の前記サンプリング密度よりも高いことを特徴とする画像処理装置。 Acquisition means for acquiring the position of the camera;
light ray calculation means for calculating a light ray corresponding to each pixel of the camera using the position of the camera;
rendering means for rendering an image of the camera by machine learning using learning parameters pre-learned by sampling points on the light rays by the learning parameter calculation means;
The image processing apparatus according to claim 1, wherein the sampling density of the rays within the depth of field range of the teacher image used in the pre-learning is higher than the sampling density outside the depth of field range.
前記光線算出手段は、前記距離分布情報に基づいて、前記光線が前記教師画像の前記被写界深度の範囲内にあるか否かを判定することを特徴とする請求項1または2に記載の画像処理装置。 The acquisition means further acquires distance distribution information corresponding to the teacher image,
3. The light ray calculator according to claim 1, wherein the light ray calculator determines whether or not the light ray is within the depth of field of the teacher image based on the distance distribution information. Image processing device.
前記被写体表面が前記被写体合焦距離よりも手前にあるか奥にあるかに関する判定結果に基づいて、前記サンプリング密度が変化することを特徴とする請求項3に記載の画像処理装置。 Based on the distance distribution information, it is determined whether the object surface is in front of or behind the object focusing distance,
4. The image processing apparatus according to claim 3, wherein the sampling density is changed based on a determination result regarding whether the surface of the object is in front of or behind the focusing distance of the object.
前記被写体表面までの前記距離を基準として、前記サンプリング密度が決定されることを特徴とする請求項3または4に記載の画像処理装置。 Based on the distance distribution information, the distance to the object surface is determined,
5. The image processing apparatus according to claim 3, wherein said sampling density is determined based on said distance to said object surface.
前記学習パラメータ算出手段は、前記教師画像と前記周辺教師画像とを用いることで前記機械学習を行い、前記学習パラメータを算出することを特徴とする請求項1乃至10のいずれか一項に記載の画像処理装置。 The acquisition means further acquires a surrounding teacher image of the surrounding space,
11. The learning parameter calculation unit according to any one of claims 1 to 10, wherein the learning parameter calculation means performs the machine learning by using the teacher image and the surrounding teacher images to calculate the learning parameter. Image processing device.
前記学習パラメータ算出手段は、
前記動画のフレームごとに該フレームの特徴を示すコード特徴量を算出し、
前記動画のフレームごとに前記コード特徴量と前記教師画像とを用いることで機械学習を行い、前記学習パラメータを算出することを特徴とする請求項1乃至13のいずれか一項に記載の画像処理装置。 The teacher image is a moving image acquired at a predetermined frame rate,
The learning parameter calculation means is
calculating a code feature amount representing a feature of each frame of the moving image;
14. The image processing according to any one of claims 1 to 13, wherein machine learning is performed by using the code feature amount and the teacher image for each frame of the moving image to calculate the learning parameter. Device.
前記光線算出手段は、前記取得手段により取得された前記領域の光線を重点的に選択して、対応する光線を出力することを特徴とする請求項14に記載の画像処理装置。 The acquiring means acquires a temporally changing region in the teacher image,
15. The image processing apparatus according to claim 14, wherein the light ray calculating means selectively selects the light ray in the area acquired by the acquiring means, and outputs the corresponding light ray.
前記カメラの前記位置を用いて前記教師画像の各画素に対応する光線を算出するステップと、
前記光線における点をサンプリングして前記教師画像を用いることで機械学習を行い、学習パラメータを算出するステップとを有し、
前記教師画像の被写界深度の範囲内における前記光線のサンプリング密度は、前記被写界深度の範囲外の前記サンプリング密度よりも高いことを特徴とする画像処理方法。 obtaining a teacher image and a camera position corresponding to the teacher image;
calculating a ray corresponding to each pixel of the teacher image using the position of the camera;
performing machine learning by sampling points on the light beam and using the teacher image to calculate a learning parameter;
The image processing method, wherein the sampling density of the rays within the range of the depth of field of the teacher image is higher than the sampling density outside the range of the depth of field.
前記カメラの前記位置を用いて前記カメラの各画素に対応する光線を算出するステップと、
学習パラメータ算出手段により前記光線における点をサンプリングして事前学習された学習パラメータを用いて、機械学習により前記カメラの画像をレンダリングするステップとを有し、
前記事前学習で用いられた教師画像の被写界深度の範囲内における前記光線のサンプリング密度は、前記被写界深度の範囲外の前記サンプリング密度よりも高いことを特徴とする画像処理方法。 obtaining a camera position;
calculating a ray corresponding to each pixel of the camera using the position of the camera;
rendering an image of the camera by machine learning using learning parameters pre-learned by sampling points in the light rays by a learning parameter calculation means;
The image processing method, wherein the sampling density of the rays within the depth of field range of the teacher image used in the pre-learning is higher than the sampling density outside the depth of field range.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021177459A JP2023066705A (en) | 2021-10-29 | 2021-10-29 | Image processing device, image processing method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021177459A JP2023066705A (en) | 2021-10-29 | 2021-10-29 | Image processing device, image processing method, and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2023066705A true JP2023066705A (en) | 2023-05-16 |
Family
ID=86325919
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2021177459A Pending JP2023066705A (en) | 2021-10-29 | 2021-10-29 | Image processing device, image processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2023066705A (en) |
-
2021
- 2021-10-29 JP JP2021177459A patent/JP2023066705A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101643607B1 (en) | Method and apparatus for generating of image data | |
US10334168B2 (en) | Threshold determination in a RANSAC algorithm | |
CN103945118B (en) | Image weakening method, device and electronic equipment | |
US7577309B2 (en) | Direct vision sensor for 3D computer vision, digital imaging, and digital video | |
US9208396B2 (en) | Image processing method and device, and program | |
US9412151B2 (en) | Image processing apparatus and image processing method | |
KR101233013B1 (en) | Image photographing device, distance computing method for the device, and focused image acquiring method | |
US8305485B2 (en) | Digital camera with coded aperture rangefinder | |
Zhuang et al. | Learning structure-and-motion-aware rolling shutter correction | |
Zheng et al. | Optical flow in the dark | |
CN108432230B (en) | Imaging device and method for displaying an image of a scene | |
CN108337434B (en) | Out-of-focus virtual refocusing method for light field array camera | |
JP2013531268A (en) | Measuring distance using coded aperture | |
JP2008294741A (en) | Imaging system | |
Takeda et al. | Fusing depth from defocus and stereo with coded apertures | |
JP7378219B2 (en) | Imaging device, image processing device, control method, and program | |
CN112333379A (en) | Image focusing method and device and image acquisition equipment | |
WO2021003807A1 (en) | Image depth estimation method and device, electronic apparatus, and storage medium | |
JP6418770B2 (en) | Image processing apparatus, imaging apparatus, image processing method, program, and storage medium | |
JP6544978B2 (en) | Image output apparatus, control method therefor, imaging apparatus, program | |
Li et al. | Real-world deep local motion deblurring | |
Sharif et al. | DarkDeblur: Learning single-shot image deblurring in low-light condition | |
KR20170101532A (en) | Method for image fusion, Computer program for the same, and Recording medium storing computer program for the same | |
JP6702755B2 (en) | Image processing device, imaging device, image processing method, and program | |
CN117058183A (en) | Image processing method and device based on double cameras, electronic equipment and storage medium |