JP2023066705A - Image processing device, image processing method, and program - Google Patents

Image processing device, image processing method, and program Download PDF

Info

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
Application number
JP2021177459A
Other languages
Japanese (ja)
Inventor
正明 松岡
Masaaki Matsuoka
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 JP2021177459A priority Critical patent/JP2023066705A/en
Publication of JP2023066705A publication Critical patent/JP2023066705A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

To provide an image processing device capable of performing high-speed volume rendering.SOLUTION: An image processing device (100) includes acquisition means (105) for acquiring a teacher image and a camera position corresponding to the teacher image, ray-of-light calculation means (106) for calculating a ray of light corresponding to each pixel of the teacher image using the camera position, and learning parameter calculation means (107) for performing machine learning by sampling points on the ray of light and using the teacher image to calculate learning parameters. The sampling density of the ray of light within the depth of field of the teacher image is higher than the sampling density outside the depth of field.SELECTED DRAWING: Figure 1

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.

特開2018-205863号公報JP 2018-205863 A 特開2008-15754号公報JP 2008-15754 A

Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik, Jonathan T. Barron, Ravi Ramamoorthi, and Ren Ng, “NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis”, In ECCV, 2020.Ben Mildenhall, Pratul P.; Srinivasan, Matthew Tancik, Jonathan T.; Barron, Ravi Ramamoorthi, and Ren Ng, "NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis", In ECCV, 2020. TIANYE LI, MIRA SLAVCHEVA, MICHAEL ZOLLHOEFER, SIMON GREEN, CHRISTOPH LASSNER, CHANGIL KIM, TANNER SCHMIDT, STEVEN LOVEGROVE, MICHAEL GOESELE, ZHAOYANG LV, “Neural 3D Video Synthesis”, arXiv:2103.02597, 2021TIANYE LI, MIRA SLAVCHEVA, MICHAEL ZOLLHOEFER, SIMON GREEN, CHRISTOPH LASNER, CHANGIL KIM, TANNER SCHMIDT, STEVEN LOVEGROVE, MICHAEL GOSELLE, ZHAOYANG LV, "Neural 3D Video Synthesis", arXiv:2103.02597, 2021

しかしながら、非特許文献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.

第1の実施形態におけるパーソナルコンピュータのブロック図である。1 is a block diagram of a personal computer according to a first embodiment; FIG. 第1の実施形態における3Dモデル学習のフローチャートである。4 is a flowchart of 3D model learning in the first embodiment; 第1の実施形態における教師画像の撮影の説明図である。FIG. 4 is an explanatory diagram of capturing a teacher image in the first embodiment; 第1の実施形態における教師画像とピントマップの説明図である。4A and 4B are explanatory diagrams of a teacher image and a focus map in the first embodiment; FIG. 第1の実施形態における自由視点画像レンダリングのフローチャートである。4 is a flowchart of free-viewpoint image rendering in the first embodiment; 第1の実施形態における自由視点カメラの説明図である。FIG. 2 is an explanatory diagram of a free viewpoint camera in the first embodiment; FIG. 第1の実施形態における教師画像とピントマップの説明図である。4A and 4B are explanatory diagrams of a teacher image and a focus map in the first embodiment; FIG. 第1の実施形態における被写体奥行き算出の説明図である。FIG. 4 is an explanatory diagram of subject depth calculation in the first embodiment; 第1の実施形態における三次元点の座標算出の説明図である。FIG. 4 is an explanatory diagram of coordinate calculation of a three-dimensional point in the first embodiment; 第1の実施形態における教師画像と低解像度ピントマップの説明図である。FIG. 4 is an explanatory diagram of a teacher image and a low-resolution focus map in the first embodiment; FIG. 第2の実施形態における教師画像の撮影および自由視点カメラの説明図である。FIG. 10 is an explanatory diagram of a teacher image taken and a free-viewpoint camera according to the second embodiment; 第2の実施形態における周辺教師画像とピントマップの説明図である。FIG. 11 is an explanatory diagram of a surrounding teacher image and a focus map in the second embodiment; 第2の実施形態における教師画像とピントマップの説明図である。FIG. 10 is an explanatory diagram of a teacher image and a focus map in the second embodiment; 第3の実施形態におけるパーソナルコンピュータのブロック図である。FIG. 11 is a block diagram of a personal computer in a third embodiment; FIG. 第3の実施形態におけるダイナミック3Dモデル学習のフローチャートである。10 is a flow chart of dynamic 3D model learning in the third embodiment; 第3の実施形態における教師画像の撮影の説明図である。FIG. 11 is an explanatory diagram of capturing a teacher image in the third embodiment; 第3の実施形態における教師画像の撮影の説明図である。FIG. 11 is an explanatory diagram of capturing a teacher image in the third embodiment; 第3の実施形態における教師画像とピントマップの説明図である。FIG. 11 is an explanatory diagram of a teacher image and a focus map in the third embodiment; 第3の実施形態における教師画像とピントマップの説明図である。FIG. 11 is an explanatory diagram of a teacher image and a focus map in the third embodiment; 第3の実施形態における自由視点動画レンダリングのフローチャートである。10 is a flow chart of free-viewpoint video rendering in the third embodiment;

以下、本発明の実施形態について、図面を参照しながら詳細に説明する。 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 control unit 101 is, for example, a CPU, and controls the operation of each block of the personal computer 100 by reading an operation program of each block of the personal computer 100 from the ROM 102, developing it in the RAM 103, and executing it. The ROM 102 is a rewritable non-volatile memory such as an SSD, and stores an operation program for each block included in the personal computer 100 as well as parameters required for operation of each block. A RAM 103 is a rewritable volatile memory such as a DRAM, and is used as a temporary storage area for data output during the operation of each block of the personal computer 100 . The data storage unit 104 is a recording medium such as a hard disk that reads and writes image data necessary for machine learning, metadata for each image, and the like.

撮影カメラ位置姿勢推定部105は、画像データ群から公知のSfM(Structure from Motion)等の技術を用いて、画像ごとに撮影カメラの位置姿勢を推定する。すなわち撮影カメラ位置姿勢推定部105は、教師画像と、教師画像に対応するカメラの位置を取得する取得手段である。 A photographing camera position and orientation estimation unit 105 estimates the position and orientation of the photographing camera for each image from the image data group using a known technique such as SfM (Structure from Motion). That is, the photographing camera position/orientation estimation unit 105 is acquisition means for acquiring a teacher image and the position of the camera corresponding to the teacher image.

光線算出部106は、ボリュームレンダリングする際の光線を、例えば非特許文献1に開示されているような手法で算出する。非特許文献1において、ボリュームレンダリングする光線はr(t)=o+tdのように定義される。ここで、oは世界座標系におけるカメラの主点、dは世界座標系で表現される光線の方向ベクトル、tはカメラ主点から光線上のサンプリング点までの距離である。光線方向ベクトルdは、カメラの主点から像面上の各画素へ向かう三次元ベクトルを計算することで求められる。また、カメラ主点oおよび光線方向ベクトルdは、カメラ位置姿勢パラメータによりカメラ座標系から世界座標系に座標変換される。すなわち光線算出部106は、学習時においてカメラの位置を用いて教師画像の各画素に対応する光線を算出し、推論時においてカメラ位置姿勢を用いて任意視点カメラの各画素に対応する光線を算出する光線算出手段である。 The light ray calculator 106 calculates light rays for volume rendering, for example, by a method disclosed in Non-Patent Document 1. In Non-Patent Document 1, a ray for volume rendering is defined as r(t)=o+td. Here, o is the principal point of the camera in the world coordinate system, d is the direction vector of the ray expressed in the world coordinate system, and t is the distance from the camera principal point to the sampling point on the ray. The ray direction vector d is obtained by calculating a three-dimensional vector from the principal point of the camera to each pixel on the image plane. Also, the camera principal point o and the ray direction vector d are coordinate-transformed from the camera coordinate system to the world coordinate system by the camera position and orientation parameters. That is, the ray calculation unit 106 calculates a ray corresponding to each pixel of the teacher image using the camera position during learning, and calculates a ray corresponding to each pixel of the arbitrary viewpoint camera using the camera position and orientation during inference. It is a light ray calculation means for calculating.

ニューラルネットワーク部107は、光線ごとに光線上の点をサンプリングし、対応する点の色と密度をニューラルネットワークにより演算し、対象空間にわたってボリュームレンダリングすることで各光線に対応する画素の色を決定する。学習及び推論は、非特許文献1で開示されているような手法を用いればよい。学習時は、ボリュームレンダリングで算出された色と撮影画像の色とのL2損失を損失関数として誤差逆伝搬法により学習重みを収束させる。すなわちニューラルネットワーク部107は、学習時において、光線における点をサンプリングして教師画像を用いることで機械学習を行い、学習パラメータを算出する学習パラメータ算出手段である。推論時は、自由カメラ位置姿勢における各光線上をボリュームレンダリンすることで自由視点画像をレンダリングする。すなわちニューラルネットワーク部107は、推論時において、学習パラメータ算出手段により光線における点をサンプリングして事前学習された学習パラメータを用いて、機械学習によりカメラの画像をレンダリングするレンダリング手段である。 The neural network unit 107 samples points on the ray for each ray, calculates the color and density of the corresponding points by the neural network, and performs volume rendering over the target space to determine the color of the pixel corresponding to each ray. . For learning and inference, the method disclosed in Non-Patent Document 1 may be used. At the time of learning, the L2 loss between the color calculated by volume rendering and the color of the captured image is used as a loss function, and the learning weight is converged by the error back propagation method. That is, the neural network unit 107 is a learning parameter calculation unit that performs machine learning by sampling points on a ray and using a teacher image during learning to calculate a learning parameter. During inference, the free viewpoint image is rendered by volume rendering on each ray in the free camera position and orientation. That is, the neural network unit 107 is a rendering unit that renders a camera image by machine learning using learning parameters pre-learned by sampling points on a ray by a learning parameter calculation unit during inference.

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/orientation acquisition unit 108 is acquisition means for acquiring the camera position/orientation (the position of the arbitrary viewpoint camera) for the free viewpoint image. A camera position/orientation parameter calculated in advance by an external device may be obtained, or a camera position/orientation designated by a user via an operation member such as a joystick may be obtained.

次に、図2を参照して、制御部101による3Dモデル学習について説明する。図2は、3Dモデル学習のフローチャートである。まずステップS201において、撮影カメラ位置姿勢推定部105は、学習に使用する各画像に対応するカメラ位置姿勢を推定する。学習は、イタレーション処理により学習重みを更新させることで、目標の学習重みに収束させる。続いてステップS202において、制御部101は、イタレーション処理が完了したか否かを判定する。イタレーション処理が完了した場合、本フローを終了する。一方、イタレーション処理が完了していない場合、ステップS203に進む。 Next, 3D model learning by the control unit 101 will be described with reference to FIG. FIG. 2 is a flow chart of 3D model learning. First, in step S201, the photographing camera position/orientation estimation unit 105 estimates the camera position/orientation corresponding to each image used for learning. Learning converges to target learning weights by updating the learning weights through iteration processing. Subsequently, in step S202, the control unit 101 determines whether or not the iteration process has been completed. When the iteration process is completed, this flow ends. On the other hand, if the iteration process has not been completed, the process proceeds to step S203.

ステップS203において、制御部101は、各イタレーションにおいて、まずバッチサイズ分の光線をランダムに選択する。バッチサイズは、例えば非特許文献1に示されている光線数4096のように設定すればよい。また本実施形態において、このとき、3Dモデリングに適さない光線を除外して光線を選択することで、効率的に演算コストを低減させることができる。その動作について、図3および図4を参照して説明する。 In step S203, the control unit 101 randomly selects light beams corresponding to the batch size in each iteration. The batch size may be set, for example, to the number of rays of 4096 shown in Non-Patent Document 1. Further, in this embodiment, at this time, by excluding light rays that are not suitable for 3D modeling and selecting light rays, it is possible to efficiently reduce the calculation cost. The operation will be described with reference to FIGS. 3 and 4. FIG.

図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. Reference numeral 301 denotes a photographing camera (imaging device); 302, a 3D modeling target photographing space range; 303, a main subject; and 304, a background subject. The camera 301 is focused on the main subject 303 and is focused within the angle of view and depth of field indicated by hatching 305 . A plurality of imaging cameras 301 are arranged to photograph an object within the imaging space range 302 from various directions, but only the imaging cameras 301 are shown in FIG. 3 for the sake of simplicity.

図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 image 401 acquired by a photographing camera 301 and a focus map 402 that is accompanying metadata. In FIG. 4, the degree of focus on the imaging plane is shown in the form of a grayscale map, with white in the front, black in the back, and 50% gray indicating focus. The focus map 402 is configured to obtain a defocus map on the imaging plane as a focus map from a phase difference image obtained from an imaging sensor in which all pixels are composed of phase difference pixels, as disclosed in Patent Document 2, for example. Just do it.

図3中の光線306、307は、ボリュームレンダリング対象の光線であるが、光線306上には被写界深度の範囲内にある被写体が存在しないため、除外する。不要な光線であるか否かの判定は、図4のピントマップ402に基づいて判定することが可能である。光線307に対応する画素404が50%グレーの合焦画素であるのに対して、光線306に対応する画素403は、被写界深度の範囲外の濃いグレーであることから、除外対象の光線であると判定する。このように、不要な光線を除外することで、ボリュームレンダリング処理を高速化することができる。本実施形態において、取得手段は、教師画像に対応する距離分布情報(ピントマップ)を取得し、光線算出手段は、距離分布情報に基づいて、光線が教師画像の被写界深度の範囲内にあるか否かを判定する。 Rays 306 and 307 in FIG. 3 are volume rendering target rays, but since there is no object within the depth of field on the ray 306, they are excluded. Determination as to whether or not it is an unnecessary ray can be made based on the focus map 402 in FIG. The pixel 404 corresponding to ray 307 is a 50% gray in-focus pixel, whereas the pixel 403 corresponding to ray 306 is a dark gray outside the depth of field. It is determined that By excluding unnecessary rays in this way, volume rendering processing can be speeded up. In this embodiment, the acquisition means acquires distance distribution information (focus map) corresponding to the teacher image, and the ray calculation means determines whether the light rays are within the range of depth of field of the teacher image based on the distance distribution information. Determine whether or not there is

なお本実施形態において、被写界深度の範囲外の光線は除外するが、これに限定されるものではない。光線算出部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 ray calculation unit 106 changes the density of light rays inside and outside the depth of field to efficiently select light rays (the light ray calculation means preferentially selects light rays within the depth of field of the teacher image). do). For example, for rays within the depth of field, all rays may be selected, and for rays outside the depth of field, no more than 10% of the total rays of the target camera may be selected.

図2のステップS203にてバッチサイズ分の光線が選択された後、ステップS204において、光線算出部106は光線を算出する。ボリュームレンダリングする光線は、前述の通り、r(t)=o+tdのように定義される。ここで、oは世界座標系におけるカメラの主点、dは世界座標系で表現される光線の方向ベクトル、tはカメラ主点から光線上のサンプリング点までの距離である。 After batch-size rays are selected in step S203 of FIG. 2, the ray calculator 106 calculates rays in step S204. A ray for volume rendering is defined as r(t)=o+td, as described above. Here, o is the principal point of the camera in the world coordinate system, d is the direction vector of the ray expressed in the world coordinate system, and t is the distance from the camera principal point to the sampling point on the ray.

ボリュームレンダリングのためにサンプリングされる距離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 portion 305 is represented by Z−Df to Z+Db using the front depth of field Df, the rear depth of field Db, and the in-focus object distance Z. FIG. Df = (r · Av · Z ^ 2) / (f ^ 2 + r · Av · Z), Db = (r · Av · Z ^ 2) / (f ^ 2 - r · Av · Z) be. Here, r is the permissible circle of confusion diameter, Av is the aperture value, and f is the focal length. The permissible circle of confusion radius r is set to twice the pixel pitch. In this way, by limiting the range of distance t sampled for volume rendering to within the range of depth of field, volume rendering processing can be speeded up.

なお本実施形態において、許容錯乱円径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 ray 307 in FIG. 3, 32 points are first sampled from the entire area covered by the 3D modeling target area 302, and an additional 128 points are sampled for the area covered by the hatched portion 305. FIG. In this way, the sampling points may be densely arranged only within the depth of field.

図2のステップS204にて光線が算出した後、ステップS205において、ニューラルネットワーク部107は、学習重みを更新する。制御部101は、ステップS202~S205を学習重みが収束するまで繰り返すことで、学習重みを決定する。なお、ステップS202のイタレーション完了の判定については、例えば非特許文献1に開示されているように、100-300Kイタレーションの回数に達したか否かで判定するようにすればよい。 After the ray is calculated in step S204 of FIG. 2, the neural network unit 107 updates the learning weights in step S205. The control unit 101 determines the learning weights by repeating steps S202 to S205 until the learning weights converge. It should be noted that determination of completion of iteration in step S202 may be made by determining whether or not the number of iterations of 100 to 300K has been reached, as disclosed in Non-Patent Document 1, for example.

次に、図5を参照して、制御部101による自由視点画像レンダリングについて説明する。図5は、自由視点画像レンダリングのフローチャートである。まずステップS501において、自由カメラ位置姿勢取得部108は、レンダリングする自由視点のカメラ位置姿勢を取得する。続いてステップS502において、制御部101は、ボリュームレンダリングによる画素値(RGB値)の算出がレンダリング画像の全画素に関して完了したか否かを判定する。全画素に対して画素値の算出が完了した場合、本フローを終了する。一方、全画素に対して画素値の算出が完了していない場合、ステップS503に進む。 Next, free-viewpoint image rendering by the control unit 101 will be described with reference to FIG. FIG. 5 is a flowchart of free-viewpoint image rendering. First, in step S501, the free camera position/orientation acquisition unit 108 acquires the camera position/orientation of the free viewpoint to be rendered. Subsequently, in step S502, the control unit 101 determines whether or not calculation of pixel values (RGB values) by volume rendering has been completed for all pixels of the rendered image. When the calculation of pixel values for all pixels is completed, this flow ends. On the other hand, if calculation of pixel values has not been completed for all pixels, the process proceeds to step S503.

ステップS503において、制御部101は、画素ごとに対応する三次元点が学習画像の被写界深度内にあるか否か、すなわち光線が被写界深度内の光線か否かを判定する。三次元点が被写界深度内ではない場合、ステップS502へ戻る。一方、三次元点が被写界深度内である場合、ステップS503に進み、ボリュームレンダリングを実行する。なお、被写界深度外の光線に対応する画素には、例えば黒など固定の画素値を割り当てる。 In step S503, the control unit 101 determines whether the three-dimensional point corresponding to each pixel is within the depth of field of the learning image, that is, whether the ray is within the depth of field. If the 3D point is not within the depth of field, return to step S502. On the other hand, if the 3D point is within the depth of field, the process proceeds to step S503 to perform volume rendering. A fixed pixel value such as black is assigned to a pixel corresponding to a light ray outside the depth of field.

図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 image 701 acquired by a photographing camera 601 and a focus map 702 that is attached metadata. 603 in FIG. 6 is a rendering free-viewpoint camera, and 301 and 601 are shooting cameras adjacent to the free-viewpoint camera 603 .

図4中の画素404および図7中の画素704は、同じ3次元点である図6中の607を表している。また、自由視点カメラ603の光線605と、撮影カメラ301の光線307は、同じ3次元点である図6の607を表している。三次元点607の三次元座標が事前にわかっていれば、光線605が光線307に対応していることを確認することができ、図4のピントマップ402から求めることができる。 Pixel 404 in FIG. 4 and pixel 704 in FIG. 7 represent the same three-dimensional point 607 in FIG. A light ray 605 of the free viewpoint camera 603 and a light ray 307 of the imaging camera 301 represent the same three-dimensional point 607 in FIG. If the 3D coordinates of the 3D point 607 are known in advance, it can be confirmed that the ray 605 corresponds to the ray 307 and can be obtained from the focus map 402 in FIG.

図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-dimensional point 607 can be obtained.

上記から光線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 ray 605 corresponds to the ray 307, and since it is known that the ray 307 at the time of learning is within the depth of field, the ray 605 is targeted for volume rendering. . On the other hand, pixel 403 in FIG. 4 and pixel 703 in FIG. 7 represent the same three-dimensional point 606 in FIG. 6, corresponding to rays 306 and 604 in FIG. 6, respectively. However, since the ray 306 at the time of learning is known to be outside the depth of field and the imaging camera 601 does not capture the corresponding three-dimensional point 606, the ray 604 is excluded from volume rendering. . In this way, by excluding light rays corresponding to unlearned three-dimensional points from volume rendering, it is possible to speed up the volume rendering processing of free viewpoint images.

図5のステップS503にて被写界深度内と判定された光線に関して、ステップS504において、光線算出部106は光線を算出する。ボリュームレンダリングする光線は、前述の通り、r(t)=o+tdのように定義される。ここで、oは世界座標系におけるカメラの主点、dは世界座標系で表現される光線の方向ベクトル、tはカメラ主点から光線上のサンプリング点までの距離である。ボリュームレンダリングのためにサンプリングされる距離tの範囲は、図6のハッチング部305およびハッチング部602で示される隣接する撮影カメラ301、601の被写界深度内に制限される。このように、ボリュームレンダリングのためにサンプリングされる距離tの範囲を隣接する撮影カメラの被写界深度内に制限することで、自由視点画像のボリュームレンダリング処理を高速化することができる。 In step S504, the light ray calculator 106 calculates the light ray determined to be within the depth of field in step S503 of FIG. A ray for volume rendering is defined as r(t)=o+td, as described above. Here, o is the principal point of the camera in the world coordinate system, d is the direction vector of the ray expressed in the world coordinate system, and t is the distance from the camera principal point to the sampling point on the ray. The range of distances t sampled for volume rendering is limited to within the depth of field of adjacent filming cameras 301, 601 indicated by hatching 305 and hatching 602 in FIG. In this way, by limiting the range of the distance t sampled for volume rendering to within the depth of field of the adjacent imaging camera, it is possible to speed up the volume rendering processing of the free viewpoint image.

図5のステップS504にて光線が算出した後、ステップS505において、ニューラルネットワーク部107は、ボリュームレンダリング処理を実行し、対応する画素値(RGB値)を算出する。 After the rays are calculated in step S504 of FIG. 5, the neural network unit 107 executes volume rendering processing in step S505 to calculate corresponding pixel values (RGB values).

なお本実施形態において、撮影カメラの画像(教師画像)とピントマップ(距離分布情報)の解像度は同じであるが、これに限定されるものではなく、異なる解像度であってもよい。例えば、距離分布情報プを教師画像よりも解像度を低くしてもよい。ピントマップのように視差マップを元に生成されるマップは、ステレオ対応点探索のために所定サイズのテンプレートマッチングが行われるため、通常テンプレートサイズ分だけマップサイズは小さくなる。例えばテンプレートサイズが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 image 401 acquired by a photographing camera 301 and a focus map 1001 that is attached metadata. The focus map 1001 has a lower resolution than the template size (16×16 pixels) for template matching, and one pixel of the focus map corresponds to a 16×16 pixel region of the image. As described with reference to FIG. 3, 303 is the main subject and 304 is the background subject.

画像401上の画素1003は、ピントマップ1001上の画素1002に対応している。画素1003は、主被写体303を示しているが、テンプレートの16×16画素の範囲に主被写体303と背景である地面の両方が含まれる。このため、画素1002のピントマップ画素値(デフォーカス値)は主被写体303と地面のデフォーカス値の間の値になる場合がある。そこで、画素1003のような被写体輪郭領域に関しては、広めに光線を選択するとともに、ボリュームレンダリングのサンプリング範囲も制限しないようにする。すなわち光線算出手段は、距離分布情報に基づいて被写体輪郭領域を特定し、被写体輪郭領域に対して、光線を選択しやすくし、サンプリング範囲を広範囲に設定する。 A pixel 1003 on the image 401 corresponds to a pixel 1002 on the focus map 1001 . A pixel 1003 shows the main subject 303, but the 16×16 pixel range of the template includes both the main subject 303 and the background ground. Therefore, the focus map pixel value (defocus value) of the pixel 1002 may be between the defocus values of the main subject 303 and the ground. Therefore, with respect to the subject contour area such as the pixel 1003, the light rays are selected widely, and the sampling range for volume rendering is not limited. That is, the light ray calculating means identifies the subject outline area based on the distance distribution information, makes it easier to select light rays for the subject outline area, and sets a wide sampling range.

本実施形態において、撮影カメラのレンズによる歪曲はごくわずかとし、学習画像に歪曲補正を行わないが、これに限定されるものではなく、歪曲がある学習画像を利用するようにしてもよい。その場合、正しい光線が算出できるように、学習画像には歪曲補正を行う。さらに、画像とペアで参照されるピントマップに対しても歪曲補正を行うことで、正しく光線選択ができるようにする。すなわち取得手段は、カメラの光学系の歪曲成分に基づいて、教師画像および距離分布情報に対する処理を行ってもよい。 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 data storage unit 104 are defocus values, but are not limited to this, and may be parallax values or distance values. Also, any format may be used as long as it can be converted into a distance value when determining the range of volume rendering. Further, when storing the defocus values, the defocus values are recorded as a focus map after correcting the defocus value due to the eccentricity of the lens and the tilt of the image pickup device in advance by the imaging camera, and stored in the data storage unit 104 . good too. That is, the distance distribution information may include at least one of a map based on the amount of shift representing parallax (parallax map), a map based on the amount of defocus (defocus map), or a map based on distance (distance map). .

本実施形態において、例えば図3に示されるように、ボリュームレンダリングの範囲は、前方被写界深度と後方被写界深度とで定義されるハッチング部305であるが、これに限定されるものではない。例えば、ピントマップから被写体表面が被写体の前方または後方のいずれにあるかを判定し、さらにボリュームレンダリングの範囲を制限するようにしてもよい。すなわち、距離分布情報(ピントマップの符号)に基づいて、被写体表面が被写体合焦距離よりも手前(前方)にあるか奥(後方)にあるかを判定し、その判定結果に基づいて、サンプリング密度を変化させてもよい。例えば、図3の被写体303に関して、ピントマップから被写体表面は前方に存在することが分かるため、ボリュームレンダリングの範囲を前方被写界深度の範囲のみに限定してもよい。 In this embodiment, for example, as shown in FIG. 3, the range of volume rendering is a hatched portion 305 defined by the front depth of field and the rear depth of field, but is not limited to this. do not have. For example, it may be determined from the focus map whether the surface of the object is in front of or behind the object, and further the range of volume rendering may be limited. That is, based on the distance distribution information (the sign of the focus map), it is determined whether the surface of the subject is in front of (front) or behind (back) the focusing distance of the subject. Density may vary. For example, with respect to the object 303 in FIG. 3, the focus map shows that the surface of the object exists in front, so the range of volume rendering may be limited only to the front depth of field.

また本実施形態において、ボリュームレンダリング範囲は、ピント被写体距離を基準として決定されるが、これに限定されるものではない。例えば、被写体表面位置を基準として所定範囲をボリュームレンダリング範囲とするようにしてもよい。すなわち、距離分布情報に基づいて被写体表面までの距離を決定し、被写体表面までの距離を基準としてサンプリング密度を決定してもよい。被写体表面の奥行位置については、図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 personal computer 100 described in the first embodiment with reference to FIG. The flowchart for explaining the 3D model learning operation shown in FIG. 2 and the free viewpoint image rendering operation shown in FIG. 5 executed by the control unit 101 in FIG. 1 is also the same as in the first embodiment.

図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. Reference numerals 1101 and 1105 denote shooting cameras, 1103 a free-viewpoint camera, 302 a shooting space range for 3D modeling, 303 a main subject, and 304 a background subject. The imaging camera 1101 has a wide-angle focal length, is focused on the background subject 304, and is focused within the angle of view and depth of field indicated by hatching 1102 . The imaging camera 1105 has a focal length of a standard angle of view, is focused on the main subject 303, and is focused within the angle of view and depth of field indicated by hatching 1106. FIG.

本実施形態において、撮影空間範囲302内の被写体を様々な方向から撮影するため、撮影カメラ1101、1105以外にも複数の撮影カメラが配置される。具体的には、主被写体303を撮影するため撮影カメラ1105と同程度の焦点距離および撮影距離(フォーカス位置)を有する撮影カメラを複数配置する。また、主被写体303以外の被写体を撮影するため撮影カメラ1101と同程度の焦点距離および撮影距離(フォーカス位置)を有する撮影カメラを複数配置する。図11では、簡単のために、撮影カメラ1101、1105のみを図示している。 In this embodiment, in order to photograph the subject within the imaging space range 302 from various directions, a plurality of imaging cameras are arranged in addition to the imaging cameras 1101 and 1105 . Specifically, in order to photograph the main subject 303, a plurality of imaging cameras having focal lengths and imaging distances (focus positions) similar to those of the imaging cameras 1105 are arranged. Also, in order to photograph subjects other than the main subject 303, a plurality of imaging cameras having focal lengths and imaging distances (focus positions) similar to those of the imaging camera 1101 are arranged. In FIG. 11, only the imaging cameras 1101 and 1105 are shown for simplicity.

図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 images 1201 and 1301 acquired by imaging cameras 1101 and 1105, and focus maps 1202 and 1302, which are accompanying metadata. shows a diagram of A focus map is calculated by a known technique as in the first embodiment.

撮影カメラ1101は、広角な焦点距離で背景被写体304に合焦させているため、画像1201に示されるように複数被写体が広範囲に撮影され、ピントマップ1202に示されるように背景被写体304が合焦の50%グレーを示している。一方、撮影カメラ1105は、標準画角の焦点距離で主被写体303に合焦させているため、画像1301に示されるように主となる被写体がメインで撮影され、ピントマップ1302に示されるように主被写体303が合焦の50%グレーを示している。 Since the imaging camera 1101 is focused on the background subject 304 with a wide-angle focal length, multiple subjects are photographed in a wide range as shown in the image 1201, and the background subject 304 is in focus as shown in the focus map 1202. 50% gray. On the other hand, since the camera 1105 is focused on the main subject 303 at the focal length of the standard angle of view, the main subject is mainly photographed as shown in the image 1301, and as shown in the focus map 1302. Main subject 303 shows in-focus 50% gray.

上述のように構成することで、図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. Rays 1111 corresponding to are not selected outside the depth of field. On the other hand, the light ray 1103 of the wide-angle imaging camera 1101 is selected as the target light ray because the three-dimensional point 606 on the background subject 304 is within the depth of field, and the background subject 304 as well as the main subject 303 is selected as a 3D model. can be included in

また、図5のステップS503の判定の際に、図11の自由視点カメラ1108の光線1110は対応する三次元点607が隣接する撮影カメラ1105の光線1107で被写界深度内に捉えられていることが分かるため、対象の光線として選択される。また、図11の自由視点カメラ1108の光線1109は、対応する三次元点606が隣接する撮影カメラ1101の光線1103で被写界深度内に捉えられていることが分かるため、対象の光線として選択される。このように、主被写体303だけではなく背景被写体304についても自由視点画像をレンダリングすることができる。 5, the light ray 1110 of the free viewpoint camera 1108 of FIG. 11 is captured within the depth of field by the light ray 1107 of the imaging camera 1105 adjacent to the corresponding three-dimensional point 607. is selected as the ray of interest. In addition, the light ray 1109 of the free-viewpoint camera 1108 in FIG. 11 is selected as the target light ray because it can be seen that the corresponding three-dimensional point 606 is captured within the depth of field by the light ray 1103 of the imaging camera 1101 adjacent thereto. be done. In this way, free-viewpoint images can be rendered not only for the main subject 303 but also for the background subject 304 .

本実施形態において、撮影カメラ1101、1105で焦点距離と撮影距離の両方を異ならせることで主被写体と背景被写体の双方をボリュームレンダリングできるように構成するが、これに限定されるものではなく、撮影距離だけ異ならせるようにしてもよい。背景被写体用の撮影カメラ1101の焦点距離を長くすると画角が狭められるため、配置する撮影カメラ数が増加する可能性がある。また、主被写体用の撮影カメラ1105の焦点距離を短くすると画角が広がるため、カメラが被写体に寄る必要が発生し、撮影カメラ1101に撮影カメラ1105が映り込んでしまう可能性がある。一方、焦点距離を合わせておけば、撮影準備やカメラキャリブレーションにおいてメリットがあるため、簡易な撮影に向いている。 In this embodiment, the imaging cameras 1101 and 1105 have different focal lengths and imaging distances so that both the main subject and the background subject can be rendered in volume. Only the distance may be varied. If the focal length of the imaging camera 1101 for the background subject is lengthened, the angle of view is narrowed, so there is a possibility that the number of imaging cameras to be arranged will increase. Also, if the focal length of the imaging camera 1105 for the main subject is shortened, the angle of view widens. On the other hand, if the focal length is adjusted, there are merits in shooting preparation and camera calibration, so it is suitable for simple shooting.

本実施形態において、撮影カメラ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 imaging cameras 1101 and 1105 different. The aperture value may be made different. That is, the camera 1105 for the main subject is set to a bright aperture value close to open, while the camera 1101 for the background subject is stopped down to set the aperture value so that the entire shooting space range 302 is within the depth of field. do. As a result, the camera 1105 for the main subject can select a dark shutter speed to capture a sharp image even when the main subject is moving, but the camera 1101 for the background is weak against a moving subject and the sensitivity is low. raises the concern of increasing noise. On the other hand, in a case where a plurality of background subjects are scattered within the imaging space range 302, there is an advantage that a 3D model can be generated without missing any shots. In this way, the peripheral teacher image may be an image that differs from the teacher image in at least one of the focus position (shooting distance), focal length, and aperture value.

本実施形態において、自由視点画像をレンダリングする際もピントマップを利用してボリュームレンダリングを高速化するが、これに限定されるものではない。例えば、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 personal computer 1400 of this embodiment differs from the personal computer 100 having the neural network section 107 described in the first embodiment in that it has a neural network section 1401 . Since other configurations of the personal computer 1400 are the same as those of the personal computer 100, description thereof will be omitted.

ニューラルネットワーク部1401は、被写体に動きがあるダイナミックシーン(動画)に対応可能である。このようなダイナミックシーンにおいて、光線ごとに光線上の点をサンプリングし対応する点の色と密度をニューラルネットワークにより演算し、対象空間にわたってボリュームレンダリングすることで各光線に対応する画素の色を決定する。学習および推論は、例えば非特許文献2に開示されている技術を用いることができる。学習時は、ボリュームレンダリングで算出された色と撮影画像の色とのL2損失を損失関数として誤差逆伝搬法により学習重みを収束させ、推論時は自由カメラ位置姿勢における各光線上をボリュームレンダリンすることで自由視点画像をレンダリングする。 The neural network unit 1401 can handle dynamic scenes (moving images) in which the subject moves. In such a dynamic scene, the color of the pixel corresponding to each ray is determined by sampling the points on the ray for each ray, computing the color and density of the corresponding points with a neural network, and performing volume rendering over the target space. . For learning and inference, the technology disclosed in Non-Patent Document 2, for example, can be used. During learning, the L2 loss between the color calculated by volume rendering and the color of the captured image is used as a loss function, and the learning weight is converged by the error backpropagation method. to render a free-viewpoint image.

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 neural network unit 107 of the first embodiment expresses only a single 3D model. On the other hand, the neural network unit 1401 of this embodiment can express a scene in which the 3D shape dynamically changes for each frame by changing the latent code zt for each frame.

次に、図15を参照して、制御部101によるダイナミック3Dモデル学習について説明する。図15は、ダイナミック3Dモデル学習のフローチャートである。まずステップS201において、撮影カメラ位置姿勢推定部105は、学習に使用する各画像に対応するカメラ位置姿勢を推定する。撮影カメラの位置は固定されているため、最初のフレームで取得された画像を用いてカメラ位置姿勢を推定する。 Next, dynamic 3D model learning by the control unit 101 will be described with reference to FIG. 15 . FIG. 15 is a flow chart of dynamic 3D model learning. First, in step S201, the photographing camera position/orientation estimation unit 105 estimates the camera position/orientation corresponding to each image used for learning. Since the position of the imaging camera is fixed, the camera position and orientation are estimated using the image acquired in the first frame.

続いてステップS1501において、制御部101は全フレームに対する処理が完了したか否かを判定する。全フレームに対する処理が完了した場合、本フローを終了する。一方、全フレームに対する処理が完了していない場合、ステップS1502に進む。ステップS1502において、制御部101は、各フレームに対応する潜在コードを生成する。 Subsequently, in step S1501, the control unit 101 determines whether processing for all frames has been completed. When the processing for all frames is completed, this flow ends. On the other hand, if processing for all frames has not been completed, the process advances to step S1502. In step S1502, the control unit 101 generates a latent code corresponding to each frame.

続いてステップS1503において、制御部101は、イタレーション処理が完了したか否かを判定する。各フレームの学習は、イタレーション処理により学習重みを更新させることで、目標の学習重みに収束させる。イタレーション処理が完了した場合、ステップS1501へ戻る。一方、イタレーション処理が完了していない場合、ステップS1504に進む。 Subsequently, in step S1503, the control unit 101 determines whether or not the iteration process has been completed. The learning of each frame converges to the target learning weight by updating the learning weight through iteration processing. If the iteration process is completed, the process returns to step S1501. On the other hand, if the iteration process has not been completed, the process advances to step S1504.

ステップS1504において、制御部101は、各イタレーションにおいて、まずバッチサイズ分の光線をランダムに選択する。非特許文献2には、入力ビデオの時間変動に基づいて学習のための次の光線を選択するレイ・インポータンス・サンプリングを行うことで、効率的に演算コストを低減させる技術が開示されている。本実施形態において、レイ・インポータンス・サンプリングを入力ビデオの被写界深度も考慮して行うことで、更なる演算効率化を図る。以下、図16乃至図19を参照して、その動作について説明する。 In step S1504, the control unit 101 randomly selects light beams corresponding to the batch size in each iteration. Non-Patent Document 2 discloses a technique for efficiently reducing computational costs by performing ray importance sampling that selects the next ray for learning based on temporal fluctuations of the input video. In this embodiment, the ray importance sampling is performed in consideration of the depth of field of the input video, thereby further improving computational efficiency. The operation will be described below with reference to FIGS. 16 to 19. FIG.

図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. Reference numeral 1601 denotes a camera, 302 a range of a 3D modeling target shooting space, 303 a main subject, and 304 a background subject. The camera 1601 is focused on the main subject 303, and the entire shooting space range 302 is in focus within a wide angle of view and a pan-focused depth of field indicated by hatching 1605. A plurality of imaging cameras 1601 are arranged to photograph an object within the imaging space range 302 from various directions, but FIG. 16 shows only the imaging cameras 1601 for the sake of simplicity.

撮影カメラ1601は、この後のフレームにおいて、焦点距離を標準画角に変化させ、絞りを開放寄りの明るい絞り値(F値)に変化させることで、主被写体303をより高精細に撮影できるようにカメラパラメータを変化させる。図17は、教師画像の撮影の説明図であり、カメラパラメータ変化後の、被写体、撮影空間および撮影カメラの関係を説明する鳥観図を示す。撮影カメラ1601のピントは主被写体303に合焦されており、ハッチング部1705で示される標準画角および浅い被写界深度内で撮影空間範囲302が部分的に合焦されている。 In subsequent frames, the imaging camera 1601 changes the focal length to the standard angle of view and changes the aperture to a brighter aperture value (F number) closer to the open, so that the main subject 303 can be captured with higher definition. change the camera parameters to FIG. 17 is an explanatory diagram of photographing of the teacher image, and shows a bird's-eye view explaining the relationship among the subject, the photographing space, and the photographing camera after the camera parameters are changed. The camera 1601 is focused on the main subject 303 , and the photographic space range 302 is partially focused within the standard angle of view and shallow depth of field indicated by hatching 1705 .

図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 image 1801 captured by a camera 1601 in the beginning frame of an input video and a focus map 1802 as attached metadata. FIG. 18 shows the degree of focus on the imaging plane in the form of a gray scale map, where the front is white, the back is black, and 50% gray indicates focus. FIG. 19 is an explanatory diagram of a teacher image and a focus map, showing an image 1901 acquired by a photographing camera 1601 after camera parameters are changed and a focus map 1902 that is attached metadata.

入力ビデオの冒頭フレームにおける、図16の光線1606および光線1607はボリュームレンダリン対象の光線で、かつ対応する三次元点が被写界深度内にあるため、2光線とも選択される。一方、カメラパラメータ変化後の、図17の光線1706および光線1707もボリュームレンダリン対象の光線であるが、光線1706上には被写界深度範囲にある被写体が存在しないため、除外する。不要な光線であるか否かの判定は、図19のピントマップ1902により判定することが可能である。光線1707に対応する画素1904が50%グレーの合焦画素であるのに対して、光線1706に対応する画素1903は被写界深度外の濃いグレーであることから、除外対象の光線であると判定する。 Rays 1606 and 1607 in FIG. 16 in the first frame of the input video are volume rendering target rays, and the corresponding three-dimensional points are within the depth of field, so both rays are selected. On the other hand, the light rays 1706 and 1707 in FIG. 17 after the camera parameter change are also the light rays for volume rendering, but since there is no object within the depth of field range on the light ray 1706, they are excluded. It is possible to determine whether or not the light beam is an unnecessary ray by using the focus map 1902 in FIG. 19 . Pixel 1904 corresponding to ray 1707 is a 50% gray in-focus pixel, whereas pixel 1903 corresponding to ray 1706 is a dark gray outside the depth of field and is thus considered an excluded ray. judge.

図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 ray calculator 106 calculates rays in step S1505. A ray for volume rendering is defined as r(t)=o+td, as described above. Here, o is the principal point of the camera in the world coordinate system, d is the direction vector of the ray expressed in the world coordinate system, and t is the distance from the camera principal point to the sampling point on the ray. The range of distances t sampled for volume rendering is limited within the depth of field indicated by hatching 1605 in FIG. 16 and hatching 1705 in FIG. In this way, the ray importance sampling is performed in consideration of the depth of field, thereby speeding up the volume rendering process.

また本実施形態において、被写界深度が深い図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 neural network unit 1401 updates the learning weights in step S1506. The learning weight is determined by repeating the operations of steps S1503 to S1506 until the learning weight converges. When the processing of all frames of the input video is completed, this flow ends (step S1501).

本実施形態において、被写界深度に基づいてレイ・インポータンス・サンプリングを行うが、これに限定されるものではなく、入力ビデオの時間変動と被写界深度の両方に基づいてレイ・インポータンス・サンプリングを行うようにしてもよい。多くの場合、入力ビデオのほうがピントマップより解像度が高い。このため、入力ビデオの時間変動を観測することで、より解像度高く不要な光線を除外したうえで、サンプリング範囲をピントマップに基づいて制限することができるため、更なる演算効率化が期待できる。 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 control unit 101 will be described. FIG. 20 is a flowchart of free-viewpoint image rendering in this embodiment. First, in step S501, the free camera position/orientation acquisition unit 108 acquires the camera position/orientation of the free viewpoint to be rendered.

続いてステップS2001において、制御部101は全フレームに対する処理が完了したか否かを判定する。全フレームに対する処理が完了した場合、本フローを終了する。一方、全フレームに対する処理が完了していない場合、ステップS2002に進み、各フレームの潜在コードZtを更新しつつ、レンダリング画像の全画素に亘って、ボリュームレンダリングにより画素値(RGB値)を算出する。すなわちステップS2002において、制御部101は、各フレームに対応する潜在コードを生成する。続いてステップS2003において、制御部101は、ボリュームレンダリングによる画素値(RGB値)の算出がレンダリング画像の全画素に関して完了したか否かを判定する。全画素に対して画素値の算出が完了した場合、ステップS2001に戻る。一方、全画素に対して画素値の算出が完了していない場合、ステップS2004に進む。 Subsequently, in step S2001, the control unit 101 determines whether or not processing for all frames has been completed. When the processing for all frames is completed, this flow ends. On the other hand, if processing for all frames has not been completed, the process advances to step S2002 to calculate pixel values (RGB values) by volume rendering over all pixels of the rendered image while updating the latent code Zt of each frame. . That is, in step S2002, control section 101 generates a latent code corresponding to each frame. Subsequently, in step S2003, the control unit 101 determines whether calculation of pixel values (RGB values) by volume rendering has been completed for all pixels of the rendered image. When pixel value calculation is completed for all pixels, the process returns to step S2001. On the other hand, if calculation of pixel values has not been completed for all pixels, the process advances to step S2004.

ステップS2004において、光線算出部106は、各画素に対応する光線を算出する(S2004)。ボリュームレンダリングする光線は、前述の通り、r(t)=o+tdのように定義される。ここで、oは世界座標系におけるカメラの主点、dは世界座標系で表現される光線の方向ベクトル、tはカメラ主点から光線上のサンプリング点までの距離である。ステップS2004にて光線が算出した後、ステップS2005において、ニューラルネットワーク部107は、ボリュームレンダリング処理を実行し、対応する画素値(RGB値)を算出する。 In step S2004, the ray calculator 106 calculates a ray corresponding to each pixel (S2004). A ray for volume rendering is defined as r(t)=o+td, as described above. Here, o is the principal point of the camera in the world coordinate system, d is the direction vector of the ray expressed in the world coordinate system, and t is the distance from the camera principal point to the sampling point on the ray. After the rays are calculated in step S2004, the neural network unit 107 executes volume rendering processing in step S2005 to calculate corresponding pixel values (RGB values).

本実施形態において、入力ビデオの冒頭とそれ以降で焦点距離および被写界深度を変更するが、これに限定されるものではなく、例えば標準画角かつ浅い被写界深度で撮影している途中で複数回広角かつパンフォーカスな撮影を挟むようにしてもよい。これにより、入力ビデオの尺が長い場合に、途中で日差しなどの周辺環境が徐々に変化しても対応することができる。 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.
前記距離分布情報は、前記教師画像よりも解像度が低いことを特徴とする請求項3乃至5のいずれか一項に記載の画像処理装置。 6. The image processing apparatus according to claim 3, wherein said distance distribution information has a resolution lower than that of said teacher image. 前記光線算出手段は、前記距離分布情報に基づいて被写体輪郭領域を特定し、前記被写体輪郭領域に対して、光線を選択しやすくし、サンプリング範囲を広範囲に設定することを特徴とする請求項3乃至8のいずれか一項に記載の画像処理装置。 3. The light ray calculating means specifies a subject outline area based on the distance distribution information, makes it easier to select light rays for the subject outline area, and sets a wide sampling range. 9. The image processing apparatus according to any one of items 1 to 8. 前記光線算出手段は、前記距離分布情報に基づいて信頼性が低いと判定した領域に対して、全ての光線を選択し、サンプリング範囲を広範囲に設定することを特徴とする請求項3乃至7のいずれか一項に記載の画像処理装置。 8. The light ray calculating means selects all light rays for a region determined to have low reliability based on the distance distribution information, and sets a wide sampling range. The image processing device according to any one of the items. 前記取得手段は、前記カメラの光学系の歪曲成分に基づいて、前記教師画像および前記距離分布情報に対する処理を行うことを特徴とする請求項3乃至8のいずれか一項に記載の画像処理装置。 9. The image processing apparatus according to any one of claims 3 to 8, wherein the acquisition means processes the teacher image and the distance distribution information based on a distortion component of an optical system of the camera. . 前記距離分布情報は、視差を表すシフト量に基づくマップ、デフォーカス量に基づくマップ、または距離に基づくマップの少なくとも一つを含むことを特徴とする請求項3乃至9のいずれか一項に記載の画像処理装置。 10. The distance distribution information according to any one of claims 3 to 9, wherein the distance distribution information includes at least one of a map based on a shift amount representing parallax, a map based on a defocus amount, or a map based on a distance. image processing device. 前記取得手段は、更に周辺空間の周辺教師画像を取得し、
前記学習パラメータ算出手段は、前記教師画像と前記周辺教師画像とを用いることで前記機械学習を行い、前記学習パラメータを算出することを特徴とする請求項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.
前記周辺教師画像は、少なくともフォーカス位置、焦点距離、または絞り値のうち少なくとも一つにおいて、前記教師画像と異なる画像であることを特徴とする請求項11に記載の画像処理装置。 12. The image processing apparatus according to claim 11, wherein the peripheral teacher image is an image different from the teacher image in at least one of focus position, focal length, and aperture value. 前記学習パラメータ算出手段は、前記教師画像と前記周辺教師画像とで異なる機械学習モデルを学習することを特徴とする請求項11または12に記載の画像処理装置。 13. The image processing apparatus according to claim 11, wherein the learning parameter calculating means learns different machine learning models for the teacher image and the surrounding teacher images. 前記教師画像は、所定のフレームレートで取得された動画であり、
前記学習パラメータ算出手段は、
前記動画のフレームごとに該フレームの特徴を示すコード特徴量を算出し、
前記動画のフレームごとに前記コード特徴量と前記教師画像とを用いることで機械学習を行い、前記学習パラメータを算出することを特徴とする請求項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.
前記教師画像は、フォーカス位置、焦点距離、または絞り値のうち少なくとも一つが異なるフレームを含むように取得された動画であることを特徴とする請求項14または15に記載の画像処理装置。 16. The image processing apparatus according to claim 14, wherein the teacher image is a moving image acquired so as to include frames in which at least one of focus position, focal length, or aperture value is different. 前記被写界深度を決定するための許容錯乱円径は、前記学習パラメータを用いたレンダリングの際の解像度に基づいて決定されることを特徴とする請求項1乃至16のいずれか一項に記載の画像処理装置。 17. The method according to any one of claims 1 to 16, wherein the permissible circle of confusion diameter for determining the depth of field is determined based on the resolution at the time of rendering using the learning parameters. image processing device. 教師画像と、前記教師画像に対応するカメラの位置を取得するステップと、
前記カメラの前記位置を用いて前記教師画像の各画素に対応する光線を算出するステップと、
前記光線における点をサンプリングして前記教師画像を用いることで機械学習を行い、学習パラメータを算出するステップとを有し、
前記教師画像の被写界深度の範囲内における前記光線のサンプリング密度は、前記被写界深度の範囲外の前記サンプリング密度よりも高いことを特徴とする画像処理方法。
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.
請求項18または19に記載の画像処理方法をコンピュータに実行させることを特徴とするプログラム。 A program for causing a computer to execute the image processing method according to claim 18 or 19.
JP2021177459A 2021-10-29 2021-10-29 Image processing device, image processing method, and program Pending JP2023066705A (en)

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)

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