JP7489253B2 - Depth map generating device and program thereof, and depth map generating system - Google Patents
Depth map generating device and program thereof, and depth map generating system Download PDFInfo
- Publication number
- JP7489253B2 JP7489253B2 JP2020127411A JP2020127411A JP7489253B2 JP 7489253 B2 JP7489253 B2 JP 7489253B2 JP 2020127411 A JP2020127411 A JP 2020127411A JP 2020127411 A JP2020127411 A JP 2020127411A JP 7489253 B2 JP7489253 B2 JP 7489253B2
- Authority
- JP
- Japan
- Prior art keywords
- depth
- camera
- depth map
- image
- cost
- 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.)
- Active
Links
- 238000006243 chemical reaction Methods 0.000 claims description 54
- 238000000034 method Methods 0.000 claims description 50
- 238000004364 calculation method Methods 0.000 claims description 44
- 238000012937 correction Methods 0.000 claims description 39
- 230000008569 process Effects 0.000 claims description 29
- 238000012545 processing Methods 0.000 claims description 23
- 230000003287 optical effect Effects 0.000 claims description 13
- 238000009499 grossing Methods 0.000 claims description 12
- 238000005315 distribution function Methods 0.000 claims description 9
- 238000005457 optimization Methods 0.000 claims description 8
- 238000003384 imaging method Methods 0.000 claims description 7
- 230000009466 transformation Effects 0.000 claims description 6
- 230000006870 function Effects 0.000 description 45
- 238000010586 diagram Methods 0.000 description 11
- 238000001914 filtration Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 238000010408 sweeping Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000001678 irradiating effect Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
- 238000012890 quintic function Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Images
Landscapes
- Studio Devices (AREA)
- Image Analysis (AREA)
Description
本発明は、デプスマップを生成するデプスマップ生成装置及びそのプログラム、並びに、デプスマップ生成システムに関する。 The present invention relates to a depth map generating device and a program for generating a depth map, and a depth map generating system.
近年、空間中に存在する被写体の三次元形状(デプスマップ)を取得する技術が盛んに研究されている。この技術は、三次元映像制作、AR(Augmented Reality)、VR(Virtual Reality)、ロボティクスなど様々な分野への適用が期待されている。被写体の三次元形状を取得するアプローチとしては、能動的な手法と受動的な手法に大別される(非特許文献1)。 In recent years, there has been active research into technology for acquiring the three-dimensional shape (depth map) of a subject existing in space. This technology is expected to be applied to a variety of fields, including three-dimensional video production, augmented reality (AR), virtual reality (VR), and robotics. Approaches for acquiring the three-dimensional shape of a subject can be broadly divided into active and passive methods (Non-Patent Document 1).
能動的な手法は、計測装置が光源を有し、被写体からの反射光を利用して奥行き(デプス)を計測するものである。具体的な手法としては、パターン光投影、光飛行時間法(ToF:Time of Flight)、照度差ステレオ法がある。これらの中で近年注目されているのが、ToFカメラを用いた手法である。ToFカメラは、光源から照射した光が被写体で反射して戻るまでの時間を計測することで、ToFカメラから被写体までの距離を求める。能動的な手法のメリットは、高度な計算処理を行うことなくリアルタイムで高精度な距離が得られることである。一方、能動的な手法のデメリットは、外乱光に弱い、被写体の反射率や距離によっては測定誤差が生じる、スケールの校正が必要な場合があることである。 In active methods, the measuring device has a light source and uses reflected light from the subject to measure depth. Specific methods include pattern light projection, time of flight (ToF), and photometric stereo. Of these, the method using a ToF camera has been attracting attention in recent years. A ToF camera determines the distance from the subject to the ToF camera by measuring the time it takes for light emitted from a light source to be reflected by the subject and return. The advantage of active methods is that they can obtain highly accurate distances in real time without the need for advanced calculation processing. On the other hand, the disadvantages of active methods are that they are vulnerable to external light, measurement errors can occur depending on the reflectance and distance of the subject, and scale calibration may be required.
受動的な手法は、複数台のカラーカメラ(以降、「RGBカメラ」)、又は1台のRGBカメラを移動させて、その視差から奥行き距離を計測するものである。具体的な手法としては、ステレオ法(多眼ステレオ)、モーションステレオがある。これらの原理はステレオ法であり、2台以上のカメラの視差からデプスを計算する。受動的な手法のメリットは、被写体に特殊な光を照射する必要がない、外乱光の影響を受けない、一般的なカラーカメラとコンピュータだけで実現できることである。一方、受動的な手法のデメリットは、得られるデプスに曖昧さが残る(テクスチャレス、オクルージョン領域)、計算コストが高くなることである。 Passive methods involve moving multiple color cameras (hereafter referred to as "RGB cameras") or a single RGB camera and measuring the depth distance from the parallax. Specific methods include the stereo method (multiple-eye stereo) and motion stereo. These methods are based on the same principle as stereo methods, which calculate depth from the parallax of two or more cameras. The advantages of passive methods are that they do not require special light to be shone on the subject, they are not affected by external light, and they can be achieved with just a general color camera and a computer. On the other hand, the disadvantages of passive methods are that the obtained depth can be ambiguous (texture-less, occlusion areas), and the calculation costs are high.
その他、RGBカメラとデプスカメラを同一光軸上に配置し、レンズアレイを用いて、複数視点分のRGB画像及びデプス画像を取得できるRGB-Dカメラが知られている(特許文献1)。この手法では、カメラレンズから入射した光線をミラー(例えば、ハーフミラーやダイクロイックミラー)で分光し、RGBカメラとデプスカメラで受光する。 Another known camera is an RGB-D camera that can acquire RGB images and depth images from multiple viewpoints by arranging an RGB camera and a depth camera on the same optical axis and using a lens array (Patent Document 1). In this method, the light entering through the camera lens is split by a mirror (e.g., a half mirror or a dichroic mirror) and received by the RGB camera and the depth camera.
前記したように、三次元形状の取得は、その応用できる分野が広いため、様々な手法が提案されているが、未だ確立されていない。汎用的な目的を考えると、1視点のカラー画像(以降、RGB画像)とデプスマップのみでなく、様々な視点のRGB画像とデプスマップがあると使い勝手がよい。つまり、複数視点のRGB画像及びデプスマップのセットがあると、汎用性が向上する。 As mentioned above, since obtaining three-dimensional shapes can be applied in a wide range of fields, various methods have been proposed, but none have yet been established. For general-purpose purposes, it is more convenient to have RGB images and depth maps from various viewpoints, rather than just a color image (hereafter referred to as an RGB image) and depth map from one viewpoint. In other words, having a set of RGB images and depth maps from multiple viewpoints improves versatility.
また、デプスマップの精度も重要である。RGB-Dカメラで得られるデプス画像は、画素値(輝度値)で表されているため、この画素値を実スケールのデプスマップに変換する必要がある。しかし、実スケールへの変換関数が、デプスマップの精度に大きな影響を与える。さらに、デプスマップの精度は、撮影環境や被写体の種類によっても影響される。なお、実スケールとは、実空間上の距離(奥行き)のことである。 The accuracy of the depth map is also important. Depth images obtained with RGB-D cameras are represented by pixel values (brightness values), so these pixel values must be converted into a real-scale depth map. However, the conversion function to real scale has a significant impact on the accuracy of the depth map. Furthermore, the accuracy of the depth map is also affected by the shooting environment and the type of subject. Note that real scale refers to the distance (depth) in real space.
本発明は、前記した問題を解決し、複数視点の撮影画像及び高精度なデプスマップを容易に取得できるデプスマップ生成装置及びそのプログラム、並びに、デプスマップ生成システムを提供することを課題とする。 The present invention aims to solve the above problems and provide a depth map generation device and program thereof, as well as a depth map generation system, that can easily obtain images captured from multiple viewpoints and highly accurate depth maps.
前記課題を解決するため、本発明に係るデプスマップ生成装置は、同一光軸の撮影カメラ及びデプスカメラと光学素子アレイとで構成された撮影装置が各視点で被写体を撮影した撮影画像及びデプス画像を用いて、各視点の撮影画像に対応したデプスマップを生成するデプスマップ生成装置であって、コストボリューム生成手段と、奥行き変換手段と、コストウェイト算出手段と、ビジビリティウェイト算出手段と、ウェイト適用手段と、最終デプスマップ生成手段と、を備える構成とした。 To solve the above problem, the depth map generating device according to the present invention is a depth map generating device that generates a depth map corresponding to the captured images at each viewpoint using captured images and depth images captured by an imaging device consisting of a imaging camera and a depth camera with the same optical axis and an optical element array, and is configured to include a cost volume generating means, a depth conversion means, a cost weight calculation means, a visibility weight calculation means, a weight application means, and a final depth map generating means.
かかる構成によれば、コストボリューム生成手段は、奥行き方向で所定間隔の奥行きレイヤ及び撮影画像の画素位置毎に、奥行きレイヤに投影された撮影画像間の類似度を表すコストを算出し、コストを奥行きレイヤ及び画素位置で三次元配列したコストボリュームを生成する。
奥行き変換手段は、デプス画像の各画素の画素値を奥行きに変換する奥行き変換関数により、デプス画像を中間デプスマップに変換する。
コストウェイト算出手段は、中間デプスマップの重みを正規分布関数で表したコストウェイトを算出する。
According to this configuration, the cost volume generation means calculates a cost representing the similarity between the captured images projected onto the depth layer for each pixel position of the captured image and the depth layer at a predetermined interval in the depth direction, and generates a cost volume in which the costs are arranged three-dimensionally by depth layer and pixel position.
The depth conversion means converts the depth image into an intermediate depth map by a depth conversion function that converts the pixel value of each pixel of the depth image into a depth.
The cost weight calculation means calculates a cost weight that represents the weight of the intermediate depth map using a normal distribution function.
また、ビジビリティウェイト算出手段は、中間デプスマップから、オクルージョン発生時にコストを低下させるビジビリティウェイトを算出する。
ウェイト適用手段は、コストボリュームにコストウェイト及びビジビリティウェイトを適用する。
最終デプスマップ生成手段は、ウェイト適用後のコストボリュームで同一画素位置のコスト列において、コストが最小となる奥行きレイヤのデプスを示す最終デプスマップを生成する。
Also, the visibility weight calculation means calculates, from the intermediate depth map, a visibility weight that reduces the cost when occlusion occurs.
The weight application means applies a cost weight and a visibility weight to the cost volume.
The final depth map generating means generates a final depth map indicating the depth of the depth layer having the smallest cost in a cost sequence at the same pixel position in the cost volume after the weights are applied.
すなわち、デプスマップ生成装置は、デプス画像から生成したデプスマップに基づいて、撮影画像から生成したコストボリュームを2つのウェイトで制約するリファインメント処理を行う。このリファインメント処理によって、デプスマップ生成装置は、各視点の撮影画像に対応した高精度なデプスマップを生成できる。 In other words, the depth map generating device performs a refinement process that constrains the cost volume generated from the captured image with two weights based on the depth map generated from the depth image. This refinement process enables the depth map generating device to generate a highly accurate depth map that corresponds to the captured image from each viewpoint.
なお、本発明は、コンピュータを、前記したデプスマップ生成装置として機能させるためのプログラムで実現することができる。 The present invention can be realized by a program that causes a computer to function as the depth map generating device described above.
また、本発明は、同一光軸の撮影カメラ及びデプスカメラと光学素子アレイとで構成された撮影装置と、前記したデプスマップ生成装置と、を備えることを特徴とするデプスマップ生成システムで実現することもできる。 The present invention can also be realized in a depth map generation system that includes an imaging device that is composed of a imaging camera and a depth camera with the same optical axis and an optical element array, and the depth map generation device described above.
本発明によれば、複数視点の撮影画像及び高精度なデプスマップを容易に取得できる。 The present invention makes it easy to obtain images captured from multiple viewpoints and highly accurate depth maps.
以下、本発明の実施形態について図面を参照して説明する。但し、以下に説明する実施形態は、本発明の技術思想を具体化するためのものであって、特定的な記載がない限り、本発明を以下のものに限定しない。 The following describes an embodiment of the present invention with reference to the drawings. However, the embodiment described below is intended to embody the technical concept of the present invention, and unless otherwise specified, the present invention is not limited to the following.
[三次元形状取得システムの概要]
図1を参照し、実施形態に係る三次元形状取得システム(デプスマップ生成システム)1の概要について説明する。
三次元形状取得システム1は、被写体9について、複数視点のRGB画像(撮影画像)及びデプスマップと、仮想カメラCのカメラパラメータとを取得するものである。図1に示すように、三次元形状取得システム1は、RGB-Dカメラ(撮影装置)2と、三次元形状取得装置(デプスマップ生成装置)3とを備える。
[Overview of 3D shape acquisition system]
An overview of a three-dimensional shape acquisition system (depth map generation system) 1 according to an embodiment will be described with reference to FIG.
The three-dimensional
複数視点で撮影するために多数のRGBカメラ及びデプスカメラを配置した場合、システムが大規模となり、コストが高くなる。そこで、三次元形状取得システム1では、後記する1台のRGB-Dカメラ(撮影装置)2により、多数のRGBカメラ及びデプスカメラを配置したのと同等の構成を実現し、システム構成を簡略化できる。
When multiple RGB cameras and depth cameras are arranged to capture images from multiple viewpoints, the system becomes large-scale and expensive. Therefore, the 3D
三次元映像制作などの分野では、仮想カメラCのカメラパラメータが必要となる。さらに、デプス画像は画素値(輝度値)で表されているため、この画素値を実スケールのデプスマップに変換するスケール変換関数も必要となる。そこで、三次元形状取得システム1では、三次元形状取得装置3によって、校正パターンを用いたカメラ校正処理を行って、仮想カメラCのカメラパラメータとスケール変換関数を算出する。
In fields such as three-dimensional video production, the camera parameters of the virtual camera C are required. Furthermore, because a depth image is represented by pixel values (brightness values), a scale conversion function is also required to convert these pixel values into a real-scale depth map. Therefore, in the three-dimensional
デプスマップの精度も重要である。前記したように、スケール変換関数が、デプスマップの精度に大きな影響を与えてしまう。さらに、デプスマップの精度は、撮影環境や被写体の種類によって大きく低下する。そこで、三次元形状取得システム1では、後記する三次元形状取得装置3によって、複数視点のRGB画像及びデプス画像を用いて、デプスマップの精度を改善する(リファインメント処理)。このとき、三次元形状取得装置3では、1台のRGB-Dカメラ2で撮影した1枚のRGB画像を視点毎に分割してマッチングするため、複数台のRGBカメラで撮影した画像をマッチングする場合に比べ、色の差に起因するエラーを抑制できる。
The accuracy of the depth map is also important. As mentioned above, the scale conversion function has a large effect on the accuracy of the depth map. Furthermore, the accuracy of the depth map is greatly reduced depending on the shooting environment and the type of subject. Therefore, in the three-dimensional
最初に、RGB-Dカメラ2の構成について説明する。次に、三次元形状取得装置3によるカメラ校正処理について説明する。このカメラ校正処理は、各仮想カメラCのカメラパラメータ、及び、スケール変換関数を算出する処理である。最後に、三次元形状取得装置3による、デプスマップの精度を改善するリファインメント処理について説明する。
First, the configuration of the RGB-
[RGB-Dカメラの構成]
図1に示すように、RGB-Dカメラ2は、カメラ本体20と、レンズ系21とを備える撮像装置である。本実施形態では、カメラ本体20は、図示を省略したRGBカメラ及びデプスカメラを同一光軸上に配置したものである。また、カメラ本体20は、被写体9からの光線を分光素子(不図示)で分光し、分光した光線をRGBカメラ及びデプスカメラでそれぞれ受光する。例えば、RGBカメラとしては、一般的なカラーカメラがあげられる。また、分光素子としては、ハーフミラー又はダイクロイックミラーがあげられる。
[RGB-D Camera Configuration]
As shown in FIG. 1, the RGB-
本実施形態では、デプスカメラとして、ToFカメラを用いる。このToFカメラは、距離計測時、被写体9に赤外線を照射するための赤外線LEDアレイ25を備える。ToFカメラが撮影した赤外線画像のフレーム間差分を求めることにより、デプス画像を取得できる。
In this embodiment, a ToF camera is used as the depth camera. This ToF camera is equipped with an
レンズ系21は、フレネルレンズ22と、レンズアレイ(光学素子アレイ)23とを備える。レンズアレイ23は、NX×NY個の要素レンズ24を2次元状に配列したものである。RGB-Dカメラ2は、このレンズアレイ23を介することで、NX×NY視点分のRGB画像及びデプス画像を取得できる。すなわち、RGB-Dカメラ2は、NX×NY個の仮想カメラCを配置したのと同等の構成を実現している。本実施形態では、2×2個の要素レンズ24に対応した4視点(4台の仮想カメラC)であることとする。
The
なお、カメラ本体20とレンズ系21との位置関係を調整すると、仮想カメラCの画角を調整できる。また、図1では、4台の仮想カメラCのうち、2台の仮想カメラCのみを図示した。
The angle of view of the virtual camera C can be adjusted by adjusting the positional relationship between the
[三次元形状取得装置の構成]
図2を参照し、三次元形状取得装置3の構成について説明する。
三次元形状取得装置3は、RGB-Dカメラ2が各視点で被写体9を撮影したRGB画像及びデプス画像を用いて、各視点のRGB画像に対応したデプスマップを生成するものである。図2に示すように、三次元形状取得装置3は、カメラ校正処理を行うカメラ校正手段4と、リファインメント処理を行うリファインメント手段5とを備える。
[Configuration of the three-dimensional shape acquisition device]
The configuration of the three-dimensional shape acquisition device 3 will be described with reference to FIG.
The three-dimensional shape acquisition device 3 generates a depth map corresponding to the RGB images of each viewpoint by using RGB images and depth images of the subject 9 captured at each viewpoint by the RGB-
<カメラ校正手段>
カメラ校正手段4は、2種類のパラメータを推定する。一つ目は、仮想カメラCのカメラパラメータである。仮想カメラCのカメラパラメータは、レンズの焦点距離、レンズ歪み、仮想カメラCの位置や姿勢など表す。二つ目は、各仮想カメラCのスケール変換関数である。さらに、カメラ校正手段4は、必要に応じて、RGB画像及びデプス画像の画角補正を行う。なお、カメラ校正手段4は、撮影の都度、カメラ校正処理を行う必要がなく、RGB-Dカメラ2の焦点距離やRGB-Dカメラ2とフレネルレンズ22とレンズアレイ23との位置・姿勢の関係が変化したときにカメラ校正処理を行えばよい。
<Camera calibration method>
The camera calibration means 4 estimates two types of parameters. The first is the camera parameters of the virtual camera C. The camera parameters of the virtual camera C represent the focal length of the lens, the lens distortion, the position and the orientation of the virtual camera C, and the like. The second is a scale conversion function of each virtual camera C. Furthermore, the camera calibration means 4 corrects the angle of view of the RGB image and the depth image as necessary. Note that the camera calibration means 4 does not need to perform camera calibration processing every time shooting is performed, and it is sufficient to perform camera calibration processing when the focal length of the RGB-
図3(a)に示すように、カメラ校正手段4には、RGB-Dカメラ2で校正パターン90を撮影したRGB画像及びデプス画像が入力される。校正パターン90は、平面状で特徴点の配置が既知のパターンである(例えば、チェスボードパターン)。このとき、RGB-Dカメラ2は、校正パターン90の姿勢を2回以上変更して撮影する(破線で図示)。なお、RGB-Dカメラ2は、内部パラメータのスキューを0以外とする場合、校正パターン90の姿勢を3回以上変更して撮影する。図3(a)に示すように、レンズ系21を配置して撮影したRGB画像及びデプス画像を校正データAと呼ぶ。前記した画角補正を行う場合、図3(b)に示すように、レンズ系21を外して校正パターン90を撮影する。このように、レンズ系21を外して撮影したRGB画像及びデプス画像を校正データBと呼ぶ。
As shown in FIG. 3(a), the camera calibration means 4 receives an RGB image and a depth image captured by the RGB-
図2に示すように、カメラ校正手段4は、画角補正手段40と、画像分割手段41と、初期カメラパラメータ算出手段42と、カメラパラメータ最適化手段43と、スケール変換関数算出手段(奥行き変換関数算出手段)44とを備える。 As shown in FIG. 2, the camera calibration means 4 includes an angle of view correction means 40, an image division means 41, an initial camera parameter calculation means 42, a camera parameter optimization means 43, and a scale conversion function calculation means (depth conversion function calculation means) 44.
画角補正手段40は、RGB-Dカメラ2から入力されたデプス画像の画角がRGB画像の画角に一致するように、デプス画像を射影変換するものである。RGB-Dカメラ2の取り付け精度に起因して、RGBカメラで撮影したRGB画像とデプスカメラで撮影したデプス画像との画角が微妙にずれることがある。このため、画角補正手段40は、校正データBを用いて、この微妙な画角のずれを補正する。具体的には、画角補正手段40は、RGB画像及びデプス画像の間で4点以上の対応点(校正パターン90の特徴点)を基準として、ホモグラフィ行列を算出する(参考文献1)。そして、画角補正手段40は、このホモグラフィ行列によりデプス画像を射影変換することで、デプス画像の画角をRGB画像の画角に一致させる。
なお、画角補正手段40は、RGBカメラ及びデプスカメラの画角が一致している場合、前記した画角補正処理を行う必要がない。
The angle of view correction means 40 performs projective transformation on the depth image so that the angle of view of the depth image input from the RGB-
It should be noted that, when the angles of view of the RGB camera and the depth camera are the same, the angle-of-view correction means 40 does not need to perform the angle-of-view correction process described above.
参考文献1:“OpenCV”,[online]、[令和2年6月24日検索]、インターネット〈URL:https://opencv.org/〉 Reference 1: "OpenCV", [online], [searched June 24, 2020], Internet <URL: https://opencv.org/>
また、画角補正手段40は、校正データBを用いて、レンズ歪みを除去できる。例えば、画角補正手段40は、Zhangの手法により、RGB-Dカメラ2のレンズ歪み係数を算出し、RGB画像及びデプス画像からレンズ歪みを除去する(参考文献2)。
The angle-of-view correction means 40 can also remove lens distortion using the calibration data B. For example, the angle-of-view correction means 40 calculates the lens distortion coefficient of the RGB-
参考文献2:Z. Zhang, “A flexible new technique for camera calibration”, IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 22, No. 11, pp. 1330-1334 (2000) Reference 2: Z. Zhang, “A flexible new technique for camera calibration”, IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 22, No. 11, pp. 1330-1334 (2000)
画像分割手段41は、画角補正手段40から入力されたRGB画像及びデプス画像を視点(要素レンズ24)毎に分割するものである。つまり、画像分割手段41は、RGB画像及びデプス画像を仮想カメラC毎に分割することで、仮想カメラCで仮想的に撮影したRGB画像及びデプス画像を生成する。本実施形態では、画像分割手段41は、図4(a)及び(b)に示すように、RGB画像PC及びデプス画像PDを4分割する。 The image division means 41 divides the RGB image and the depth image input from the angle of view correction means 40 for each viewpoint (element lens 24). That is, the image division means 41 divides the RGB image and the depth image for each virtual camera C to generate an RGB image and a depth image virtually captured by the virtual camera C. In this embodiment, the image division means 41 divides the RGB image P C and the depth image P D into four, as shown in Figures 4(a) and 4(b).
なお、RGB画像PC及びデプス画像PDを分割する領域αは、手動で設定する。このとき、分割後のRGB画像PC及びデプス画像PDでは、レンズアレイ23の外側や要素レンズ24同士の隙間が不要なので、これら不要領域を分割せずともよい。以後の説明を簡易にするため、分割後のRGB画像PC及びデプス画像PDは、同一の画像サイズであることとする。
The region α into which the RGB image P C and the depth image P D are divided is set manually. In this case, since the outside of the
初期カメラパラメータ算出手段42は、画像分割手段41から入力された各視点のRGB画像PCにカメラ校正処理を施すことで、各視点に対応した仮想カメラCの初期カメラパラメータを算出するものである。例えば、初期カメラパラメータ算出手段42は、各視点のRGB画像PCにZhangの手法を適用し、各仮想カメラCのカメラパラメータ及び各校正パターン90の位置・姿勢が含まれる初期カメラパラメータを算出する。
The initial camera parameter calculation means 42 calculates initial camera parameters of the virtual camera C corresponding to each viewpoint by performing camera calibration processing on the RGB image P C of each viewpoint input from the image division means 41. For example, the initial camera parameter calculation means 42 applies Zhang's method to the RGB image P C of each viewpoint to calculate initial camera parameters including the camera parameters of each virtual camera C and the position and orientation of each
カメラパラメータ最適化手段43は、初期カメラパラメータ算出手段42から入力された初期カメラパラメータを初期値としたカメラ校正処理により、各仮想カメラCの間でカメラパラメータを最適化するものである。前記した初期カメラパラメータ算出手段42では、各仮想カメラCのカメラパラメータを個別に算出していたが、全ての仮想カメラCの間でカメラパラメータを最適化することで、カメラパラメータの精度が向上する。 The camera parameter optimization means 43 optimizes the camera parameters between each virtual camera C through a camera calibration process using the initial camera parameters input from the initial camera parameter calculation means 42 as initial values. The initial camera parameter calculation means 42 described above calculates the camera parameters of each virtual camera C individually, but optimizing the camera parameters between all virtual cameras C improves the accuracy of the camera parameters.
ここで、校正パターン90の位置・姿勢を共通のパラメータとする。最適化するカメラパラメータは、各仮想カメラCのカメラパラメータと、共通化した校正パターン90の位置・姿勢が含まれる。具体的には、カメラパラメータ最適化手段43は、各仮想カメラCのカメラパラメータ及び校正パターン90の位置・姿勢の平均値を初期値として、初期カメラパラメータに含まれる仮想カメラCの位置・姿勢を使用する。そして、カメラパラメータ最適化手段43は、これら初期値をバンドル調整することでカメラパラメータを最適化する。
Here, the position and orientation of the
スケール変換関数算出手段44は、カメラパラメータ最適化手段43より入力されたカメラパラメータが示す仮想カメラCの位置から校正パターン90までの距離をデプス画像PDの各画素の画素値に対応させることで、スケール変換関数を算出するものである。すなわち、スケール変換関数算出手段44は、デプス画像PDを実スケールのデプスマップに変換するためのスケール変換関数を算出する。前記したように、カメラパラメータにおいて、仮想カメラCの位置・姿勢と校正パターン90の位置・姿勢とが既知のため、仮想カメラCから校正パターン90までの距離rが実スケールで算出できる。
The scale conversion function calculation means 44 calculates a scale conversion function by associating the distance from the position of the virtual camera C indicated by the camera parameters input from the camera parameter optimization means 43 to the
具体的には、スケール変換関数算出手段44は、図5(a)に示すように、仮想カメラCから校正パターン90までの距離rと、デプス画像PDの各画素の輝度値q(画素値)とを対応づける。このとき、デプス画像PDに含まれる校正パターン90では、黒色模様の部分で反射率が低下するため、正確な対応付けが困難である。このため、スケール変換関数算出手段44は、デプス画像PDに含まれる校正パターン90の白色部分のみで対応付けを行うことが好ましい。ここで、スケール変換関数算出手段44は、校正パターン90を撮影した全てのデプス画像PDで対応付けを行うことで、図5(b)に示すようにグラフが得られる。そして、スケール変換関数算出手段44は、このグラフを関数(例えば、5次関数)で近似することで、スケール変換関数h(q)を算出できる。なお、スケール変換関数算出手段44は、このグラフをスケール変換関数で近似せず、ルックアップデーブルとしてもよい。
Specifically, as shown in FIG. 5A, the scale conversion function calculation means 44 associates the distance r from the virtual camera C to the
その後、カメラ校正手段4は、算出したスケール変換関数をスケール変換手段54に出力し、仮想カメラCのカメラパラメータをコストボリューム生成手段51及びウェイト適用手段59に出力する。 Then, the camera calibration means 4 outputs the calculated scale conversion function to the scale conversion means 54, and outputs the camera parameters of the virtual camera C to the cost volume generation means 51 and the weight application means 59.
<リファインメント手段>
リファインメント手段5は、RGB-Dカメラ2で被写体9を撮影したRGB画像PC及びデプス画像PDが入力される。そして、リファインメント手段5は、デプス画像PDから生成したデプスマップに基づいて、RGB画像PCから生成したコストボリュームを2つのウェイトで制約することで、デプスマップの精度を向上させる。なお、リファインメント手段5は、撮影の都度、リファインメント処理を行う。
<Refinement Means>
The refinement means 5 receives an RGB image P C and a depth image P D captured by the RGB-
図2に示すように、リファインメント手段5は、画像分割手段50と、コストボリューム生成手段51と、初期デプスマップ生成手段52と、平滑化手段53と、スケール変換手段(奥行き変換手段)54と、レイヤ化処理手段55と、スケール補正手段(中間デプスマップ補正手段)56と、コストウェイト算出手段57と、ビジビリティウェイト算出手段58と、ウェイト適用手段59と、最終デプスマップ生成手段60とを備える。 As shown in FIG. 2, the refinement means 5 includes an image division means 50, a cost volume generation means 51, an initial depth map generation means 52, a smoothing means 53, a scale conversion means (depth conversion means) 54, a layering processing means 55, a scale correction means (intermediate depth map correction means) 56, a cost weight calculation means 57, a visibility weight calculation means 58, a weight application means 59, and a final depth map generation means 60.
画像分割手段50は、RGB-Dカメラ2から入力されたRGB画像PC及びデプス画像PDを視点毎に分割するものである。図6(a)及び(b)に示すように、画像分割手段50は、画像分割手段41と同様、被写体9が撮影されたRGB画像PC及びデプス画像PDを分割する。
The image division means 50 divides the RGB image P C and the depth image P D input from the RGB-
なお、図6では、レンズ系21を介しているため、RGB画像PC及びデプス画像PDで被写体9が逆立像になっている。この場合、被写体9が正立像となるようにRGB画像PC及びデプス画像PDに反転処理を施してもよい。
6, the
コストボリューム生成手段51は、後記する奥行きレイヤ及びRGB画像PCの画素位置毎にコストを算出し、コストを奥行きレイヤ及び画素位置で三次元配列したコストボリュームを生成するものである。本実施形態では、コストボリューム生成手段51は、コストボリュームを推定する手法の一つであるプレーンスイープ法を用いることとする(参考文献3)。 The cost volume generating means 51 calculates a cost for each pixel position of a depth layer and an RGB image PC described below, and generates a cost volume in which the costs are arranged three-dimensionally by the depth layer and the pixel position. In this embodiment, the cost volume generating means 51 uses a plane sweep method, which is one of the methods for estimating a cost volume (Reference 3).
参考文献3:David Gallup, et al. , "Real-time plane-sweeping stereo with multiple sweeping directions", IEEE Conference on Computer Vision and Pattern Recognition, pp. 1-8 (2007) Reference 3: David Gallup, et al., "Real-time plane-sweeping stereo with multiple sweeping directions", IEEE Conference on Computer Vision and Pattern Recognition, pp. 1-8 (2007)
まず、コストボリューム生成手段51は、図7に示すように、被写体9が配置された空間中に、奥行き方向で所定間隔の奥行きレイヤNDを複数設定する。図7の例では、5つの奥行きレイヤNDが設定されている(D=1,…,5)。なお、図7では、x軸が水平方向、y軸が垂直方向、z軸が奥行方向を示す。次に、コストボリューム生成手段51は、全ての仮想カメラCのうち何れか1台をリファレンスカメラとして、このリファレンスカメラと、別のもう1台の仮想カメラCとでカメラペアを設定する。そして、コストボリューム生成手段51は、カメラペアを構成する各仮想カメラCのRGB画像PCを射影変換により奥行きレイヤNDに投影する。さらに、コストボリューム生成手段51は、奥行きレイヤNDに投影した2つのRGB画像PCの各画素の画素値の差分(例えば、SAD:Sum of Absolute Difference)を求めることで、コストを算出する。このコストは、その奥行きレイヤNDに投影された2つのRGB画像PCの類似度を表し、その値が小さくなる程、その奥行きレイヤNDに被写体9の奥行きが存在する可能性が高いことを表す。
First, as shown in FIG. 7, the cost volume generating means 51 sets a plurality of depth layers N D at a predetermined interval in the depth direction in the space in which the
コストボリューム生成手段51は、前記した処理を全ての奥行きレイヤNDで行うことで、コストボリュームを生成できる。図8に示すように、RGB画像PCのサイズをU×V画素とすると、コストボリューム91は、U×V×NDのコストの3次元配列となる。また、コストボリューム91では、同一画素位置で奥行方向に配列されたコストをコスト列92とする。つまり、コスト列92は、1×1×NDのコストの3次元配列となる。そして、コストボリューム生成手段51は、リファレンスカメラのRGB画像PCをガイドとして、ガイデッドフィルタをコストボリューム91に適用する(参考文献4)。これにより、エッジを保持したままコストボリューム91を平滑化できるため、コストボリューム91のノイズを低減できる。
The cost volume generating means 51 can generate a cost volume by performing the above-mentioned process for all depth layers N D. As shown in FIG. 8, if the size of the RGB image P C is U×V pixels, the
参考文献4:Kaiming He, Sun Jian, and Tang Xiaoou, "Guided image filtering", European conference on computer vision. Springer, pp. 1-10, (2010) Reference 4: Kaiming He, Sun Jian, and Tang Xiaoou, "Guided image filtering", European conference on computer vision. Springer, pp. 1-10, (2010)
リファレンスカメラの周辺にある仮想カメラCの集合をSとすると、集合の要素数|S|だけカメラペアを設定できる。このとき、コストボリューム91もカメラペアと同数できる。例えば、仮想カメラCが4台の場合、1台のリファレンスカメラに対して、カメラペアが3つとなり、コストボリューム91も3つとなる。例えば、仮想カメラC1がリファレンスカメラの場合、カメラペアが(C1,C2)、(C1,C3)、(C1,C4)となる。
If a set of virtual cameras C around a reference camera is S, then the number of camera pairs that can be set is the number of elements in the set |S|. In this case, the number of
初期デプスマップ生成手段52は、コストボリューム生成手段51から入力されたコストボリューム91で同一画素位置のコスト列92において、コストが最小となる奥行きレイヤNDのデプスを示す初期デプスマップを生成するものである。
The initial depth map generating means 52 generates an initial depth map indicating the depth of the depth layer ND having the smallest cost in the
ここで、初期デプスマップ生成手段52は、1台のリファレンスカメラに対して複数のコストボリューム91が存在するため、各コストボリューム91の総和をリファレンスカメラの最終的なコストボリューム91として求める。そして、初期デプスマップ生成手段52は、各コスト列92で最小のコストを有する奥行きレイヤNDを正しいデプスとして求め、リファレンスカメラの初期デプスマップDCを生成する。
Here, since there are
その後、初期デプスマップ生成手段52は、初期デプスマップDCをスケール補正手段56に出力し、最終的なコストボリューム91をウェイト適用手段59に出力する。
The initial
平滑化手段53は、画像分割手段50から入力したデプス画像PDを平滑化するものである。ここで、平滑化手段53は、デプスカメラのショットノイズなどのノイズがデプス画像PDに含まれるため、このデプス画像PDをフィルタ処理により平滑化する。例えば、フィルタ処理として、ガイデッドフィルタがあげられる。このガイデッドフィルタは、平滑化フィルタの一種であり、ガイド画像を用いて対象の画像を平滑化する。ここでは、ガイド画像として、RGB画像PCを用いる。 The smoothing means 53 smoothes the depth image PD input from the image dividing means 50. Here, since the depth image PD contains noise such as shot noise of the depth camera, the smoothing means 53 smoothes the depth image PD by filtering. For example, a guided filter is used as the filtering process. This guided filter is a type of smoothing filter, and smoothes the target image using a guide image. Here, an RGB image PC is used as the guide image.
なお、フィルタ処理によりノイズを除去できる一方、過度な平滑化によりデプス画像PDの精度が低下する可能性がある。このため、平滑化手段53は、必要に応じでフィルタ処理を実行すればよい。 Although noise can be removed by filtering, excessive smoothing may reduce the accuracy of the depth image PD . For this reason, the smoothing means 53 may perform filtering only as necessary.
スケール変換手段54は、デプス画像PDの各画素の画素値を実スケールのデプスに変換するスケール変換関数により、デプス画像PDを中間デプスマップに変換するものである。本実施形態では、スケール変換手段54は、スケール変換関数算出手段44から入力されたスケール変換関数により、平滑化手段53から入力されたデプス画像PDを実スケールのデプスマップへと変換する。なお、スケール変換手段54は、RGB-Dカメラ2のメーカからスケール変換関数が提供される場合、これを使用してもよい。
The scale conversion means 54 converts the depth image P D into an intermediate depth map by a scale conversion function that converts the pixel value of each pixel of the depth image P D into a real-scale depth. In this embodiment, the scale conversion means 54 converts the depth image P D input from the smoothing means 53 into a real-scale depth map by the scale conversion function input from the scale conversion function calculation means 44. Note that, when a scale conversion function is provided by the manufacturer of the RGB-
レイヤ化処理手段55は、スケール変換手段54から入力された中間デプスマップのデプスを最も近い奥行きレイヤNDのデプスに置き換えるレイヤ化処理を施すものである。具体的には、レイヤ化処理手段55は、カメラパラメータが既知のため、実スケールの中間デプスマップを3次元点群化できる。ここで、レイヤ化処理手段55は、中間デプスマップがカメラ座標系における光軸方向(一般的にはz方向)の距離ではなく、光学中心からの距離を表している場合、その距離を考慮して3次元点群化する。そして、レイヤ化処理手段55は、各点のデプスを最も近い奥行きレイヤNDの所属とすることで、中間デプスマップを奥行きレイヤNDで表現する。以後、レイヤ化処理を施した中間デプスマップをDDとする。 The layering processing means 55 performs layering processing to replace the depth of the intermediate depth map input from the scale conversion means 54 with the depth of the closest depth layer N D. Specifically, since the camera parameters are known, the layering processing means 55 can convert the intermediate depth map of real scale into a three-dimensional point cloud. Here, when the intermediate depth map represents a distance from the optical center, rather than a distance in the optical axis direction (generally the z direction) in the camera coordinate system, the layering processing means 55 converts the intermediate depth map into a three-dimensional point cloud taking into account the distance. Then, the layering processing means 55 represents the intermediate depth map in the depth layer N D by making the depth of each point belong to the closest depth layer N D. Hereinafter, the intermediate depth map subjected to layering processing is referred to as D D.
スケール補正手段56は、初期デプスマップDCと中間デプスマップDDとのデプス差が閾値以下の画素について、各奥行きレイヤNDでデプス差の平均を補正値として求め、中間デプスマップDDのデプスを補正値で補正するものである。つまり、スケール補正手段56は、スケール変換関数の精度が低い場合、デプス画像PDから生成した中間デプスマップDDをRGB画像PCから生成した初期デプスマップDCに合わせるように補正する。 The scale correction means 56 calculates an average of the depth differences in each depth layer N D as a correction value for pixels where the depth difference between the initial depth map D C and the intermediate depth map D D is equal to or less than a threshold, and corrects the depth of the intermediate depth map D D with the correction value. In other words, when the accuracy of the scale conversion function is low, the scale correction means 56 corrects the intermediate depth map D D generated from the depth image P D to match it with the initial depth map D C generated from the RGB image P C.
具体的には、スケール補正手段56は、初期デプスマップDCと中間デプスマップDDとの各画素のデプス差DSub=DC-DDを算出する。次に、スケール補正手段56は、|DSub|≦thresoldを満たす画素のみを対象として、初期デプスマップDCの各デプスd(d=1,2,・・・,ND)でデプス差DSubの平均を算出し、補正値とする。なお、閾値thresoldは手動で設定する。そして、スケール補正手段56は、DD
New=DD
Old+DCorのように、補正前の中間デプスマップDD
Oldに補正デプス値DCorを適用し、補正後の中間デプスマップDD
Newを求める(以後、中間デプスマップDD)。
なお、スケール補正手段56は、スケール変換関数の精度が高い場合、処理を行わなくともよい。
Specifically, the scale correction means 56 calculates the depth difference D Sub = D C - D D for each pixel between the initial depth map D C and the intermediate depth map D D. Next, the scale correction means 56 calculates the average of the depth differences D Sub at each depth d (d = 1, 2, ..., N D ) of the initial depth map D C for only pixels that satisfy | D Sub | ≤ threshold, and sets the average as a correction value. Note that the threshold value threshold is set manually. Then, the scale correction means 56 applies the correction depth value D Cor to the intermediate depth map D D Old before correction, such as D D New = D D Old + D Cor , to obtain the intermediate depth map D D New after correction (hereinafter, intermediate depth map D D ).
It should be noted that the scale correction means 56 does not need to perform the process if the scale conversion function has high accuracy.
コストウェイト算出手段57は、スケール補正手段56から入力された中間デプスマップDDの重みを正規分布関数で表したコストウェイトWCを算出するものである。前記したように、コストボリューム91は、RGB画像PCのみから生成されており、デプスマップを考慮していない。そこで、中間デプスマップDDから算出したコストウェイトWCをコストボリューム91に適用することで、RGB画像PCとデプスマップとの両方が考慮されたコストボリューム91となる。
The cost weight calculation means 57 calculates a cost weight W C which represents the weight of the intermediate depth map D D input from the scale correction means 56 by a normal distribution function. As described above, the
コストウェイトWCは、中間デプスマップDDが正しいデプス値を有する可能性が高いとして、そのデプスのウェイトを最小値とした正規分布で表す。図9に示すように、正規分布の最大値を1とし、奥行きレイヤdの正規分布関数g(d)を以下の式(1)で定義する。 The cost weight W C is expressed as a normal distribution with the weight of the intermediate depth map D D as the minimum value, assuming that the intermediate depth map D D has a high possibility of having a correct depth value. As shown in Fig. 9, the maximum value of the normal distribution is 1, and the normal distribution function g(d) of the depth layer d is defined by the following formula (1).
ここで、μは平均、σ2は分散、σは標準偏差を表す。この正規分布関数g(d)を用いてコストウェイト関数fC(d)を以下の式(2)で定義する。なお、acは、コストウェイトWCを決めるパラメータである。また、図10(a)に示すように、式(2)の正規分布関数g(d)において、平均μが中間デプスマップDDの画素(u,v)のデプス値DD(u,v)の平均を表し、分散σ2がコストウェイト関数fC(d)の設計方針に応じて予め設定される(例えば、σ2=ND/3)。 Here, μ represents the mean, σ2 represents the variance, and σ represents the standard deviation. Using this normal distribution function g(d), a cost weight function f C (d) is defined by the following formula (2). Note that a c is a parameter that determines the cost weight W C. Also, as shown in FIG. 10(a), in the normal distribution function g(d) of formula (2), the mean μ represents the mean of the depth values D D (u, v) of the pixels (u, v) of the intermediate depth map D D , and the variance σ 2 is set in advance according to the design policy of the cost weight function f C (d) (for example, σ 2 = N D /3).
コストウェイトWCは、コストボリューム91と同一サイズの3次元配列となる。そして、コストウェイトWCの各要素には、以下の式(3)に示すように、コストウェイト関数fC(d)の値が入る。以上より、コストウェイト算出手段57は、式(3)を用いて、コストウェイトWCを算出する。
The cost weight W C is a three-dimensional array of the same size as the
ビジビリティウェイト算出手段58は、コストウェイト算出手段57から入力された中間デプスマップDDから、オクルージョン発生時にコストを低下させるビジビリティウェイトWVを算出するものである。 The visibility weight calculation means 58 calculates a visibility weight WV that reduces the cost when occlusion occurs, from the intermediate depth map D D input from the cost weight calculation means 57 .
ここで、コストボリューム91を生成したときにオクルージョンが考慮されておらず、オクルージョンが発生した部分のコストがノイズとなり、前記したレイヤ化処理でもエラーが発生している。複数のカメラペアでコストボリューム91の総和を求めた場合でも、このエラーは同様に発生する。なお、オクルージョンとは、一方の仮想カメラCで見え、かつ、他方の仮想カメラCで見えない領域が発生することである。
Here, occlusion was not taken into consideration when the
その一方、中間デプスマップDDは、1台のデプスカメラから生成されているため、オクルージョンの影響を受けない。そこで、ビジビリティウェイト算出手段58は、オクルージョンの影響を緩和する(オクルージョンが発生した部分のコストを低下させる)ため、中間デプスマップDDからビジビリティウェイトWVを算出する。
On the other hand, the intermediate
図10(b)に示すように、ビジビリティウェイト関数fV(d)を以下の式(4)で定義する。なお、aVは、ビジビリティウェイトWVを決めるパラメータである。式(4)の正規分布関数g(d)において、平均μは、デプス値DD(u,v)の平均に定数shiftを加えた値DD(u,v)+shiftを表す(但し、shift≧0)。また、分散σ2は、ビジビリティウェイト関数fV(d)の設計方針に応じて予め設定される(例えば、σ2=ND/10)。定数shiftの値を大きくすることで、中間デプスマップDDに誤差が存在しても許容される一方、ビジビリティウェイトWVの効果が小さくなる。 As shown in FIG. 10B, the visibility weight function f V (d) is defined by the following formula (4). Note that a V is a parameter that determines the visibility weight W V. In the normal distribution function g(d) of formula (4), the mean μ represents a value D D (u, v)+shift obtained by adding a constant shift to the average of the depth values D D (u, v) (where shift ≧0). In addition, the variance σ 2 is set in advance according to the design policy of the visibility weight function f V (d) (for example, σ 2 = N D /10). By increasing the value of the constant shift, the presence of an error in the intermediate depth map D D is tolerated, but the effect of the visibility weight W V is reduced.
ビジビリティウェイトWVは、コストボリューム91と同一サイズの3次元配列となる。そして、ビジビリティウェイトWVの各要素には、以下の式(5)に示すように、ビジビリティウェイト関数fV(d)の値が入る。以上より、ビジビリティウェイト算出手段58は、式(5)のビジビリティウェイトWVを算出する。
The visibility weight WV is a three-dimensional array of the same size as the
ウェイト適用手段59は、初期デプスマップ生成手段52から入力されたコストボリューム91にコストウェイトWC及びビジビリティウェイトWVを適用するものである。ここで、最終的なコストボリュームESは、リファレンスカメラCとして、全てのカメラペアで統合したコストボリューム91である。つまり、ウェイト適用手段59は、以下の式(6)に示すように、リファレンスカメラのコストウェイトWC(x,y,z)、コストボリュームEj、ビジビリティウェイトWVにより、最終的なコストボリュームESを算出する。
The weight application means 59 applies the cost weight W C and the visibility weight W V to the
なお、コストボリュームEjは、リファレンスカメラCと周囲のカメラ集合Sに含まれる仮想カメラCj(j∈S)とのコストボリューム91である。また、warpは、仮想カメラCjからリファレンスカメラCへの各奥行きレイヤNDを平面とした射影変換を表す。
The cost volume Ej is a
最終デプスマップ生成手段60は、ウェイト適用手段59から入力されたコストボリューム91で同一画素位置のコスト列92において、コストが最小となる奥行きレイヤNDのデプスを示す最終デプスマップを生成するものである。つまり、最終デプスマップ生成手段60は、各コスト列92で最小のコストを有する奥行きレイヤNDを正しいデプスとして求め、最終的なデプスマップを生成する。
なお、最終デプスマップ生成手段60は、初期デプスマップ生成手段52と同様の手法で最終的なデプスマップを生成するため、これ以上の説明を省略する。
The final depth map generating means 60 generates a final depth map indicating the depth of the depth layer N D having the smallest cost in the
It should be noted that the final depth map generating means 60 generates the final depth map in a similar manner to that of the initial depth map generating means 52, and therefore further explanation thereof will be omitted.
その後、リファインメント手段5は、各視点のRGB画像PC及び最終的なデプスマップと、カメラ校正手段4から入力された仮想カメラCのカメラパラメータとをセットで出力する。 Thereafter, the refinement means 5 outputs a set of the RGB images P C for each viewpoint, the final depth map, and the camera parameters of the virtual camera C input from the camera calibration means 4 .
[カメラ校正処理]
図11を参照し、カメラ校正処理について説明する。
図11に示すように、ステップS1において、画角補正手段40は、RGB-Dカメラ2から入力されたデプス画像PDの画角がRGB画像PCの画角に一致するように、デプス画像PDを射影変換する。なお、ステップS1の処理は、必須でないため破線で図示した。
[Camera calibration process]
The camera calibration process will be described with reference to FIG.
11, in step S1, the angle-of-view correction means 40 performs projective transformation on the depth image P D input from the RGB-
ステップS2において、画像分割手段41は、RGB画像PC及びデプス画像PDを視点毎に分割する。
ステップS3において、初期カメラパラメータ算出手段42は、各視点のRGB画像PCにカメラ校正処理を施すことで、各視点に対応した仮想カメラCの初期カメラパラメータを算出する。
ステップS4において、カメラパラメータ最適化手段43は、初期カメラパラメータを初期値としたカメラ校正処理により、各仮想カメラCの間でカメラパラメータを最適化する。
ステップS5において、スケール変換関数算出手段44は、カメラパラメータが示す仮想カメラCの位置から校正パターンまでの距離をデプス画像PDの各画素の画素値に対応させることで、スケール変換関数を算出する。
In step S2, the image dividing means 41 divides the RGB image PC and the depth image P D for each viewpoint.
In step S3, the initial camera parameter calculation means 42 performs camera calibration processing on the RGB image PC of each viewpoint to calculate initial camera parameters of the virtual camera C corresponding to each viewpoint.
In step S4, the camera parameter optimization means 43 optimizes the camera parameters between the virtual cameras C by a camera calibration process using the initial camera parameters as initial values.
In step S5, the scale conversion function calculation means 44 calculates a scale conversion function by associating the distance from the position of the virtual camera C indicated by the camera parameters to the calibration pattern with the pixel value of each pixel of the depth image PD .
[リファインメント処理]
図12を参照し、リファインメント処理について説明する。
図12に示すように、ステップS10において、画像分割手段50は、RGB画像PC及びデプス画像PDを仮想カメラC毎に分割する。
ステップS11において、コストボリューム生成手段51は、奥行きレイヤ及びRGB画像PCの画素毎にコストを算出し、コストの三次元配列であるコストボリューム91を生成する。
[Refinement Processing]
The refinement process will now be described with reference to FIG.
As shown in FIG. 12, in step S10, the image dividing means 50 divides the RGB image P 1 C and the depth image P 1 D for each virtual camera C.
In step S11, the cost volume generating means 51 calculates the cost for each pixel of the depth layer and the RGB image PC , and generates a
ステップS12において、初期デプスマップ生成手段52は、コストボリューム91で同一画素位置のコスト列92において、コストが最小となる奥行きレイヤのデプスを示す初期デプスマップを生成する。
なお、ステップS11,S12の処理と、後記するステップS13~S18の処理は、並列で実行できる。
In step S<b>12 , the initial depth map generating means 52 generates an initial depth map indicating the depth of the depth layer with the smallest cost in the
The processes in steps S11 and S12 and the processes in steps S13 to S18 described below can be executed in parallel.
ステップS13において、平滑化手段53は、デプス画像PDを平滑化する。
ステップS14において、スケール変換手段54は、デプス画像PDの各画素の画素値を実スケールのデプスに変換するスケール変換関数により、デプス画像PDを中間デプスマップに変換する。
ステップS15において、レイヤ化処理手段55は、中間デプスマップのデプスを最も近い奥行きレイヤのデプスに置き換えるレイヤ化処理を施す。
In step S13, the smoothing means 53 smoothes the depth image PD .
In step S14, the scale conversion means 54 converts the depth image PD into an intermediate depth map using a scale conversion function that converts the pixel value of each pixel of the depth image PD into a real-scale depth.
In step S15, the layering processing means 55 performs layering processing to replace the depth of the intermediate depth map with the depth of the closest depth layer.
ステップS16において、スケール補正手段56は、初期デプスマップDCと中間デプスマップDDとのデプス差が閾値以下の画素について、各奥行きレイヤNDでデプス差の平均を補正値として求め、中間デプスマップDDのデプスを補正値で補正する。なお、ステップS16の処理は、必須でないため破線で図示した。
ステップS17において、コストウェイト算出手段57は、中間デプスマップDDの重みを正規分布関数で表したコストウェイトWCを算出する。
ステップS18において、ビジビリティウェイト算出手段58は、中間デプスマップDDから、オクルージョン発生時にコストを低下させるビジビリティウェイトWVを算出する。
In step S16, the scale correction means 56 calculates an average of the depth differences in each depth layer N D as a correction value for pixels where the depth difference between the initial depth map D C and the intermediate depth map D D is equal to or less than a threshold value, and corrects the depth of the intermediate depth map D D with the correction value. Note that the process of step S16 is not essential and is therefore illustrated by a dashed line.
In step S17, the cost weight calculation means 57 calculates a cost weight W C which represents the weight of the intermediate depth map D D by a normal distribution function.
In step S18, the visibility weight calculation means 58 calculates, from the intermediate depth map D1D , a visibility weight W1V that reduces the cost when occlusion occurs.
ステップS19において、ウェイト適用手段59は、コストウェイトWC及びビジビリティウェイトWVをコストボリューム91に適用する。
ステップS20において、最終デプスマップ生成手段60は、コストボリューム91で同一画素位置のコスト列92において、コストが最小となる奥行きレイヤNDのデプスを示す最終デプスマップを生成する。
In step S 19 , the weight application means 59 applies the cost weight W_C and the visibility weight W_V to the
In step S20, the final depth map generating means 60 generates a final depth map indicating the depth of the depth layer ND that has the smallest cost in the
[作用・効果]
以上のように、三次元形状取得システム1は、複数視点のRGB画像PC及び高精度なデプスマップと、仮想カメラCのカメラパラメータとを容易に取得できる。すなわち、三次元形状取得システム1は、簡易なシステム構成を実現し、複数視点分のRGB画像PC及び高精度なデプスマップと、仮想カメラCのカメラパラメータとを提供できる。これらデータは、様々なアプリケーションで利用可能である。例えば、三次元画像を生成する場合、密な多視点RGB画像が必要になる。三次元形状取得システム1が提供するデータは、仮想カメラCのカメラパラメータや高精度なデプスマップを含んでいるため、簡単な処理で三次元画像を生成できる。
[Action and Effects]
As described above, the three-dimensional
以上、本発明の実施形態を詳述してきたが、本発明はこれに限られるものではなく、本発明の要旨を逸脱しない範囲の設計変更等も含まれる。 Although the embodiment of the present invention has been described in detail above, the present invention is not limited to this, and includes design modifications and the like that do not deviate from the gist of the present invention.
前記した実施形態では、デプスカメラがToFカメラであることとして説明したが、これに限定されない。例えば、デプスカメラがステレオカメラであってもよい。 In the above embodiment, the depth camera is described as a ToF camera, but this is not limited to this. For example, the depth camera may be a stereo camera.
本発明は、コンピュータが備えるCPU、メモリ、ハードディスク等のハードウェア資源を、前記した三次元形状取得装置として動作させるプログラムで実現することもできる。これらのプログラムは、通信回線を介して配布してもよく、CD-ROMやフラッシュメモリ等の記録媒体に書き込んで配布してもよい。 The present invention can also be realized by a program that causes hardware resources such as a CPU, memory, and hard disk of a computer to operate as the above-mentioned three-dimensional shape acquisition device. These programs may be distributed via a communication line, or written onto a recording medium such as a CD-ROM or flash memory and distributed.
1 三次元形状取得システム(デプスマップ生成システム)
2 RGB-Dカメラ(撮影装置)
20 カメラ本体
21 レンズ系
22 フレネルレンズ
23 レンズアレイ
24 要素レンズ
25 赤外線LEDアレイ
3 三次元形状取得装置(デプスマップ生成装置)
4 カメラ校正手段
40 画角補正手段
41 画像分割手段
42 初期カメラパラメータ算出手段
43 カメラパラメータ最適化手段
44 スケール変換関数算出手段(奥行き変換関数算出手段)
5 リファインメント手段
50 画像分割手段
51 コストボリューム生成手段
52 初期デプスマップ生成手段
53 平滑化手段
54 スケール変換手段(奥行き変換手段)
55 レイヤ化処理手段
56 スケール補正手段(中間デプスマップ補正手段)
57 コストウェイト算出手段
58 ビジビリティウェイト算出手段
59 ウェイト適用手段
60 最終デプスマップ生成手段
9 被写体
90 校正パターン
91 コストボリューム
92 コスト列
C 仮想カメラ
DC 初期デプスマップ
DD 中間デプスマップ
ND 奥行きレイヤ
1. 3D shape acquisition system (depth map generation system)
2 RGB-D camera (photography device)
20
4 Camera calibration means 40 View angle correction means 41 Image division means 42 Initial camera parameter calculation means 43 Camera parameter optimization means 44 Scale conversion function calculation means (depth conversion function calculation means)
5 Refinement means 50 Image division means 51 Cost volume generation means 52 Initial depth map generation means 53 Smoothing means 54 Scale conversion means (depth conversion means)
55 Layering processing means 56 Scale correction means (intermediate depth map correction means)
57 Cost weight calculation means 58 Visibility weight calculation means 59 Weight application means 60 Final depth map generation means 9
Claims (8)
奥行き方向で所定間隔の奥行きレイヤ及び前記撮影画像の画素位置毎に、前記奥行きレイヤに投影された前記撮影画像間の類似度を表すコストを算出し、当該コストを前記奥行きレイヤ及び前記画素位置で三次元配列したコストボリュームを生成するコストボリューム生成手段と、
前記デプス画像の各画素の画素値を奥行きに変換する奥行き変換関数により、前記デプス画像を中間デプスマップに変換する奥行き変換手段と、
前記中間デプスマップの重みを正規分布関数で表したコストウェイトを算出するコストウェイト算出手段と、
前記中間デプスマップから、オクルージョン発生時に前記コストを低下させるビジビリティウェイトを算出するビジビリティウェイト算出手段と、
前記コストボリュームに前記コストウェイト及び前記ビジビリティウェイトを適用するウェイト適用手段と、
ウェイト適用後の前記コストボリュームで同一画素位置のコスト列において、前記コストが最小となる前記奥行きレイヤのデプスを示す最終デプスマップを生成する最終デプスマップ生成手段と、
を備えることを特徴とするデプスマップ生成装置。 A depth map generating device that generates a depth map corresponding to the captured images at each viewpoint using captured images and depth images captured by an imaging device including a imaging camera and a depth camera on the same optical axis and an optical element array, the device comprising:
a cost volume generating means for calculating a cost representing a similarity between the captured images projected onto the depth layer for each pixel position of the depth layer and the captured images at a predetermined interval in the depth direction, and generating a cost volume in which the costs are three-dimensionally arranged in the depth layer and the pixel positions;
a depth conversion means for converting the depth image into an intermediate depth map using a depth conversion function that converts a pixel value of each pixel of the depth image into a depth;
a cost weight calculation means for calculating a cost weight obtained by expressing the weight of the intermediate depth map as a normal distribution function;
a visibility weight calculation means for calculating a visibility weight that reduces the cost when an occlusion occurs from the intermediate depth map;
weight application means for applying the cost weight and the visibility weight to the cost volume;
a final depth map generating means for generating a final depth map indicating a depth of the depth layer in which the cost is minimum in a cost sequence at the same pixel position in the cost volume after applying a weight;
A depth map generating device comprising:
前記奥行き変換手段は、前記奥行き変換関数により、前記平滑化手段が平滑化したデプス画像を前記中間デプスマップに変換することを特徴とする請求項1に記載のデプスマップ生成装置。 A smoothing means for smoothing the depth image is further provided,
2. The depth map generating device according to claim 1, wherein the depth conversion means converts the depth image smoothed by the smoothing means into the intermediate depth map using the depth conversion function.
前記初期デプスマップと前記中間デプスマップとのデプス差が閾値以下の画素について、前記奥行きレイヤ間でデプス差の平均を補正値として求め、前記中間デプスマップのデプスを前記補正値で補正する中間デプスマップ補正手段と、
をさらに備えることを特徴とする請求項1又は請求項2に記載のデプスマップ生成装置。 an initial depth map generating means for generating an initial depth map indicating a depth of the depth layer in which the cost is minimum in a cost sequence at the same pixel position in the cost volume generated by the cost volume generating means;
an intermediate depth map correction means for calculating an average of depth differences between the depth layers as a correction value for pixels in which a depth difference between the initial depth map and the intermediate depth map is equal to or smaller than a threshold, and correcting the depth of the intermediate depth map with the correction value;
The depth map generating device according to claim 1 or 2, further comprising:
前記中間デプスマップ補正手段は、前記レイヤ化処理手段がレイヤ化処理を施した中間デプスマップのデプスを前記補正値で補正することを特徴とする請求項3に記載のデプスマップ生成装置。 A layering processing means for performing a layering process of replacing a depth of the intermediate depth map with a depth of the closest depth layer,
4. The depth map generating device according to claim 3, wherein the intermediate depth map correcting means corrects the depth of the intermediate depth map, which has been subjected to layering processing by the layering processing means, with the correction value.
前記初期カメラパラメータを初期値とした前記カメラ校正処理により、各仮想カメラの間でカメラパラメータを最適化するカメラパラメータ最適化手段と、
最適化した前記カメラパラメータが示す仮想カメラの位置から前記校正パターンまでの距離を前記デプス画像の各画素の画素値に対応させることで、前記奥行き変換関数を算出する奥行き変換関数算出手段と、
をさらに備えることを特徴とする請求項1から請求項4の何れか一項に記載のデプスマップ生成装置。 an initial camera parameter calculation means for calculating initial camera parameters of a virtual camera corresponding to each viewpoint by performing a camera calibration process on a captured image of a calibration pattern captured by the image capture device from each viewpoint;
a camera parameter optimization means for optimizing camera parameters between the virtual cameras through the camera calibration process using the initial camera parameters as initial values;
a depth conversion function calculation means for calculating the depth conversion function by making the distance from the position of the virtual camera indicated by the optimized camera parameters to the calibration pattern correspond to the pixel value of each pixel of the depth image;
The depth map generating device according to claim 1 , further comprising:
前記奥行き変換関数算出手段は、前記仮想カメラの位置から前記校正パターンまでの奥行きを、前記画角補正手段が射影変換した前記デプス画像の各画素の画素値に対応させることで、前記奥行き変換関数を算出することを特徴とする請求項5に記載のデプスマップ生成装置。 and a field-of-view correction unit that performs projective transformation on the depth image so that the field of view of the depth image, which is obtained by photographing the calibration pattern from each viewpoint by the photographing device, coincides with the field of view of the photographed image,
The depth map generating device according to claim 5, characterized in that the depth conversion function calculation means calculates the depth conversion function by making the depth from the position of the virtual camera to the calibration pattern correspond to the pixel values of each pixel of the depth image projected by the angle of view correction means.
請求項1から請求項6の何れか一項に記載のデプスマップ生成装置と、
を備えることを特徴とするデプスマップ生成システム。 A photographing device including a photographing camera and a depth camera on the same optical axis and an optical element array;
A depth map generating device according to any one of claims 1 to 6,
A depth map generating system comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020127411A JP7489253B2 (en) | 2020-07-28 | 2020-07-28 | Depth map generating device and program thereof, and depth map generating system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020127411A JP7489253B2 (en) | 2020-07-28 | 2020-07-28 | Depth map generating device and program thereof, and depth map generating system |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2022024688A JP2022024688A (en) | 2022-02-09 |
JP7489253B2 true JP7489253B2 (en) | 2024-05-23 |
Family
ID=80265542
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2020127411A Active JP7489253B2 (en) | 2020-07-28 | 2020-07-28 | Depth map generating device and program thereof, and depth map generating system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7489253B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024057904A1 (en) * | 2022-09-13 | 2024-03-21 | ソニーセミコンダクタソリューションズ株式会社 | Information processing device, information processing method, and program |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009300268A (en) | 2008-06-13 | 2009-12-24 | Nippon Hoso Kyokai <Nhk> | Three-dimensional information detection device |
JP2019184308A (en) | 2018-04-04 | 2019-10-24 | 日本放送協会 | Depth estimation device and program, as well as virtual viewpoint video generator and its program |
JP2020028114A (en) | 2018-08-10 | 2020-02-20 | 日本放送協会 | Stereoscopic image generation device and program thereof |
-
2020
- 2020-07-28 JP JP2020127411A patent/JP7489253B2/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009300268A (en) | 2008-06-13 | 2009-12-24 | Nippon Hoso Kyokai <Nhk> | Three-dimensional information detection device |
JP2019184308A (en) | 2018-04-04 | 2019-10-24 | 日本放送協会 | Depth estimation device and program, as well as virtual viewpoint video generator and its program |
JP2020028114A (en) | 2018-08-10 | 2020-02-20 | 日本放送協会 | Stereoscopic image generation device and program thereof |
Also Published As
Publication number | Publication date |
---|---|
JP2022024688A (en) | 2022-02-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6722323B2 (en) | System and method for imaging device modeling and calibration | |
CN106875339B (en) | Fisheye image splicing method based on strip-shaped calibration plate | |
TWI555379B (en) | An image calibrating, composing and depth rebuilding method of a panoramic fish-eye camera and a system thereof | |
WO2019100933A1 (en) | Method, device and system for three-dimensional measurement | |
US8836766B1 (en) | Method and system for alignment of a pattern on a spatial coded slide image | |
JP5997645B2 (en) | Image processing apparatus and method, and imaging apparatus | |
JP6570327B2 (en) | Control device, imaging device, control method, program, and storage medium | |
CN109003311B (en) | Calibration method of fisheye lens | |
CN109919911B (en) | Mobile three-dimensional reconstruction method based on multi-view photometric stereo | |
CN106875435B (en) | Method and system for obtaining depth image | |
CN108629756B (en) | Kinectv2 depth image invalid point repairing method | |
US9025862B2 (en) | Range image pixel matching method | |
JPWO2018235163A1 (en) | Calibration apparatus, calibration chart, chart pattern generation apparatus, and calibration method | |
KR20150120066A (en) | System for distortion correction and calibration using pattern projection, and method using the same | |
CN107808398B (en) | Camera parameter calculation device, calculation method, program, and recording medium | |
JP7378219B2 (en) | Imaging device, image processing device, control method, and program | |
WO2018001252A1 (en) | Projection unit and photographing apparatus comprising same projection unit, processor, and imaging device | |
JP2016024052A (en) | Three-dimensional measurement system, three-dimensional measurement method and program | |
CN114359406A (en) | Calibration of auto-focusing binocular camera, 3D vision and depth point cloud calculation method | |
US11348271B2 (en) | Image processing device and three-dimensional measuring system | |
JP7489253B2 (en) | Depth map generating device and program thereof, and depth map generating system | |
CN111757086A (en) | Active binocular camera, RGB-D image determination method and device | |
CN110708532A (en) | Universal light field unit image generation method and system | |
JP2014178124A (en) | Three-dimensional measurement system, program and method | |
JP5925109B2 (en) | Image processing apparatus, control method thereof, and control program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20230605 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20240311 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20240416 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20240513 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7489253 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |