JP2011221932A - Depth estimation device, depth estimation method and depth estimation program - Google Patents
Depth estimation device, depth estimation method and depth estimation program Download PDFInfo
- Publication number
- JP2011221932A JP2011221932A JP2010092826A JP2010092826A JP2011221932A JP 2011221932 A JP2011221932 A JP 2011221932A JP 2010092826 A JP2010092826 A JP 2010092826A JP 2010092826 A JP2010092826 A JP 2010092826A JP 2011221932 A JP2011221932 A JP 2011221932A
- Authority
- JP
- Japan
- Prior art keywords
- value
- pixel
- difference
- depth
- difference value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、複数のカメラで被写体を撮影した映像から、多視点映像用の被写体の奥行値を推定する奥行推定装置、奥行推定方法および奥行推定プログラムに関する。 The present invention relates to a depth estimation device, a depth estimation method, and a depth estimation program for estimating a depth value of a subject for a multi-view video from videos obtained by photographing the subject with a plurality of cameras.
近年、複数のカメラで同一の被写体を撮影した複数の映像(多視点映像)を用いて、立体映像や自由視点映像を生成、符号化する研究が進められている。これらの立体映像や自由視点映像を生成、符号化する技術では、基本的に、複数のカメラで被写体を撮影したカメラ映像の視差量を利用することで、被写体までの奥行値を求めている(特許文献1等参照)。 In recent years, research on generating and encoding stereoscopic video and free-viewpoint video using a plurality of videos (multi-view videos) obtained by shooting the same subject with a plurality of cameras is underway. In the technology for generating and encoding these stereoscopic video and free viewpoint video, the depth value to the subject is basically obtained by using the parallax amount of the camera video obtained by photographing the subject with a plurality of cameras ( (See Patent Document 1).
この特許文献1には、図17に示すように、複数のカメラ(C1,C2,C3)で撮影された視差方向に異なるカメラ映像を、時間方向に符号化する技術が開示されている。
この符号化の際に、特許文献1に記載されている発明は、複数のカメラ(C1,C2,C3)で撮影されたカメラ映像(F1,F2,F3)間で、映像内の被写体の奥行値を仮定し、基準となるカメラ(例えば、C2)で撮影されたカメラ映像(F2)内のブロックに含まれる画素値と、カメラの位置関係と奥行値とから定まる他のカメラ(例えば、C1,C3)で撮影されたカメラ映像(F1,F3)内の対応ブロックに含まれる画素値との差分絶対値が最小となる奥行値を求めている。
As shown in FIG. 17, this
At the time of this encoding, the invention described in Japanese Patent Application Laid-Open No. H10-228867 is between camera images (F 1 , F 2 , F 3 ) taken by a plurality of cameras (C 1 , C 2 , C 3 ). Assuming the depth value of the subject in the video, the pixel value included in the block in the camera video (F 2 ) captured by the reference camera (eg, C 2 ), the positional relationship of the camera, and the depth value A depth value that minimizes the absolute value of the difference from the pixel value included in the corresponding block in the camera image (F 1 , F 3 ) captured by another fixed camera (eg, C 1 , C 3 ) is obtained. .
このように、従来の手法は、複数のカメラ映像において、複数の仮定した奥行値に対応する画素値の差分絶対値が最小となる画素が、それぞれのカメラ映像の対応する画素であり、また、そのときの仮定した奥行値が当該画素の奥行値であると推定していた。 As described above, in the conventional technique, in a plurality of camera images, a pixel having a minimum difference absolute value of pixel values corresponding to a plurality of assumed depth values is a corresponding pixel of each camera image, and The assumed depth value at that time was estimated to be the depth value of the pixel.
前記したように、複数のカメラ映像において、複数の仮定した奥行値に対応する画素値の差分絶対値が最小となる画素を探索し、当該画素の奥行値を推定する手法では、以下に示す問題がある。
例えば、被写体の重なりによって、複数のカメラ映像間で対応点が存在しない場合や、画素値の変化が少ない一様な被写体において、複数のカメラ映像間に、画素値が近似する複数の誤った対応点が存在する場合がある。これらの場合、従来の手法では、単に、画素値の差分絶対値が最小となる画素を探索するため、誤った対応点を探索(偽マッチング)してしまう場合がある。
As described above, in the method of searching for a pixel having the smallest difference absolute value of pixel values corresponding to a plurality of assumed depth values in a plurality of camera images and estimating the depth value of the pixel, the following problems are encountered. There is.
For example, if there is no corresponding point between multiple camera images due to overlapping of the subjects, or multiple uniform responses with pixel values approximated between multiple camera images in a uniform subject with little change in pixel values There may be points. In these cases, the conventional method simply searches for a pixel with the smallest difference absolute value of the pixel value, and thus may find an incorrect corresponding point (false matching).
さらに、従来の手法では、以下に示す問題もある。
例えば、黒い背景を持つ被写体の場合、差分絶対値がどの仮定奥行値でも小さくなり、誤った奥行値を推定してしまう場合がある。また、例えば、画素値の変化が少ない一様な被写体が前景の被写体に接近した部分では、奥行値が正しくなくても差分絶対値が大きくならず、誤った奥行値を推定してしまう場合がある。すなわち、従来の手法では、誤った対応点を探索した結果、誤った奥行値が推定されてしまうという問題がある。
Further, the conventional method has the following problems.
For example, in the case of a subject with a black background, the difference absolute value may be small for any assumed depth value, and an incorrect depth value may be estimated. Also, for example, in a portion where a uniform subject with little change in pixel value approaches the foreground subject, the absolute value of the difference does not increase even if the depth value is incorrect, and an incorrect depth value may be estimated. is there. That is, the conventional method has a problem that an incorrect depth value is estimated as a result of searching for an incorrect corresponding point.
本発明は、このような問題点に鑑みてなされたものであり、複数のカメラ映像間で対応点が存在しない場合、一様な被写体で複数のカメラ映像間における対応点が複数存在する場合であっても、奥行値の誤推定を低減することが可能な奥行推定装置、奥行推定方法および奥行推定プログラムを提供することを課題とする。
さらに、本発明は、背景が黒いために誤った対応点が多数存在する場合や、一様な被写体のために対応点の画素の差分絶対値が大きくならない場合であっても、奥行値の誤推定を低減することが可能な奥行推定装置、奥行推定方法および奥行推定プログラムを提供することを課題とする。
The present invention has been made in view of such a problem. In the case where there are no corresponding points between a plurality of camera images, there is a case where there are a plurality of corresponding points between a plurality of camera images in a uniform subject. It is an object of the present invention to provide a depth estimation device, a depth estimation method, and a depth estimation program that can reduce erroneous estimation of depth values.
Furthermore, the present invention provides an error in the depth value even when there are many erroneous corresponding points due to the black background, or even when the difference absolute value of the corresponding point pixels does not increase due to a uniform subject. It is an object to provide a depth estimation device, a depth estimation method, and a depth estimation program capable of reducing estimation.
本発明は、前記課題を解決するために創案されたものであり、まず、本願第1発明に係る奥行推定装置は、予め定めた位置に複数配列したカメラで同一の被写体を撮影した複数のカメラ映像から、前記被写体の奥行きを示す奥行値を推定する奥行推定装置であって、映像入力手段と、近傍画素値出力手段と、対応画素差分演算手段と、差分値決定手段と、平滑化手段と、奥行値決定手段と、近傍奥行値出力手段と、を備える構成とした。 The present invention has been made to solve the above-mentioned problems. First, the depth estimation device according to the first invention of the present application is a plurality of cameras that photograph the same subject with a plurality of cameras arranged in a predetermined position. A depth estimation device for estimating a depth value indicating the depth of a subject from an image, the image input means, a neighboring pixel value output means, a corresponding pixel difference calculation means, a difference value determination means, a smoothing means, The depth value determining means and the neighborhood depth value output means are provided.
かかる構成において、奥行推定装置は、映像入力手段によって、前記複数配列した前記カメラのいずれかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラに隣接する複数の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する。この隣接映像は、基準映像からの視差を計測するための映像である。 In such a configuration, the depth estimation apparatus includes a reference image obtained by photographing the subject with a predetermined reference camera and a plurality of adjacent cameras adjacent to the reference camera in any of the plurality of cameras arranged by the image input unit. To input a plurality of adjacent video images of the subject. This adjacent video is a video for measuring the parallax from the reference video.
そして、奥行推定装置は、近傍画素値出力手段によって、前記映像入力手段に入力された基準映像において、当該基準映像の注目画素の画素値と、前記注目画素に対して左右近傍に位置する近傍画素の画素値とを出力する。さらに、奥行推定装置は、対応画素差分演算手段によって、前記奥行値を仮定した仮定奥行値および前記注目画素ごとに、前記基準映像の注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する。この仮定奥行値は、基準映像の画素に対応する被写体の奥行値を仮定した値であって、例えば、最小視差(“0”)から最大視差までの値とする。この対応画素差分演算手段によって、基準映像の注目画素の画素値と、隣接映像の仮定奥行値に対応した対応画素値との差分絶対値が算出される。なお、この差分絶対値(隣接映像の対応画素差分値)は、その値が小さい程、仮定奥行値が実際の被写体において同一の対応点を指し示している可能性が高いといえる。 Then, the depth estimation device includes a pixel value of a target pixel of the reference image and a neighboring pixel located in the vicinity of the left and right of the target pixel in the reference video input to the video input unit by the neighboring pixel value output unit. Are output. Further, the depth estimation device uses the corresponding pixel difference calculation unit to calculate the pixel value of the target pixel of the reference image and the assumed depth value of the target pixel for each of the assumed depth value and the target pixel assuming the depth value. A corresponding pixel difference value that is an absolute difference value with respect to the pixel values of the corresponding pixels of the plurality of adjacent videos at the pixel position corresponding to the parallax is calculated. The assumed depth value is a value that assumes the depth value of the subject corresponding to the pixel of the reference image, and is, for example, a value from the minimum parallax (“0”) to the maximum parallax. By this corresponding pixel difference calculation means, an absolute difference value between the pixel value of the target pixel of the reference image and the corresponding pixel value corresponding to the assumed depth value of the adjacent image is calculated. It can be said that the smaller the value of the difference absolute value (corresponding pixel difference value of the adjacent video), the higher the possibility that the assumed depth value points to the same corresponding point in the actual subject.
そして、奥行推定装置は、差分値決定手段によって、前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と前記近傍画素の画素値と前記近傍画素の奥行値とに基づいて、前記最小差分値、前記平均差分値、前記最小差分値または前記平均差分値に所定の加算値を加えた値の何れかを、予め設定した条件により選択差分値として決定する。 Then, the depth estimation device uses the difference value determination unit to calculate an average difference value that is an average value of the corresponding pixel difference values and a minimum value that is a minimum value of the corresponding pixel difference values for each of the assumed depth value and the target pixel. A difference value is obtained, and based on the pixel value of the target pixel, the pixel value of the neighboring pixel, and the depth value of the neighboring pixel, the minimum difference value, the average difference value, the minimum difference value, or the average difference value Any value obtained by adding a predetermined addition value is determined as a selection difference value according to a preset condition.
なお、正しい奥行値に対する選択差分値であれば、その値は小さくなり、ノイズ等によって、ある隣接映像の対応画素差分値が誤った値をとった場合であっても、複数の対応画素差分値を平均化することで、全体として選択差分値が小さくなる。
また、オクルージョンが発生することで、ある対応画素差分値が大きな値となった場合や、一様な被写体のために対応点が複数ある場合であっても、基準映像の注目画素の左右近傍の画素値と、該左右近傍の画素で推定された奥行値により、平均差分値と最小差分値と、平均差分値および最小差分値に所定の加算値が加算された値とから、最適な値が選択される。つまり、選択差分値が正しい値で選択されることになる。
これによって、選択差分値は、仮定奥行値の中で正しい奥行値を判定するための指標となる。
Note that if the selected difference value is the correct depth value, the value becomes small, and even if the corresponding pixel difference value of a certain adjacent video takes an incorrect value due to noise or the like, a plurality of corresponding pixel difference values are obtained. As a result, the selection difference value becomes smaller as a whole.
In addition, even when a certain corresponding pixel difference value becomes a large value due to occurrence of occlusion or when there are a plurality of corresponding points for a uniform subject, Based on the pixel value, the depth value estimated at the pixels near the left and right, and the average difference value, the minimum difference value, and a value obtained by adding a predetermined addition value to the average difference value and the minimum difference value, an optimal value is obtained. Selected. That is, the selection difference value is selected with a correct value.
Thus, the selection difference value becomes an index for determining a correct depth value among the assumed depth values.
そして、奥行推定装置は、平滑化手段によって、前記仮定奥行値および前記注目画素ごとに、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の仮定奥行値との差に、予め設定された平滑化係数を掛けた値を前記選択差分値に加えることで、前記選択差分値を平滑化する。
これによって、平滑化された差分値が最小となる奥行値は、同じ被写体の中では滑らかに変化するようになり、奥行値の誤推定が低減される。
Then, the depth estimation device uses a smoothing unit to calculate, for each of the assumed depth value and the target pixel, an assumed depth value at which a selection difference value of a pixel adjacent to the target pixel is minimum and an assumed depth value of the target pixel. By adding a value obtained by multiplying the difference by a preset smoothing coefficient to the selected difference value, the selected difference value is smoothed.
As a result, the depth value at which the smoothed difference value is minimized changes smoothly within the same subject, and erroneous estimation of the depth value is reduced.
そして、奥行推定装置は、奥行値決定手段によって、前記平滑化手段が平滑化した選択差分値が最小となる前記仮定奥行値を、前記基準映像の各画素の奥行値とする。さらに、奥行推定装置は、近傍奥行値出力手段によって、前記奥行値決定手段から基準映像の各画素の奥行値が入力されると共に、前記近傍画素の奥行値を前記対応画素差分演算手段および前記差分値決定手段に出力する。 Then, the depth estimation apparatus sets the assumed depth value at which the selection difference value smoothed by the smoothing means is minimized by the depth value determination means as the depth value of each pixel of the reference image. Further, in the depth estimation device, the depth value of each pixel of the reference image is input from the depth value determination unit by the neighboring depth value output unit, and the depth value of the neighboring pixel is calculated from the corresponding pixel difference calculation unit and the difference. Output to value determining means.
また、本願第2発明に係る奥行推定装置は、前記対応画素差分演算手段が、背景が黒色であるか否かを設定した黒背景フラグが入力され、当該黒背景フラグにおいて前記背景が黒色に設定されているか否かを判定し、前記黒背景フラグにおいて前記背景が黒色に設定されている場合、前記注目画素の画素値と前記近傍画素の画素値との全てが予め設定した第1の閾値より小さい場合、前記対応画素差分値に、前記仮定奥行値に予め設定した第1の係数を掛けた値を加えることを特徴とする。 Further, in the depth estimation apparatus according to the second invention of the present application, the corresponding pixel difference calculation means receives a black background flag set as to whether or not the background is black, and sets the background to black in the black background flag. When the background is set to black in the black background flag, all of the pixel value of the pixel of interest and the pixel value of the neighboring pixels are more than a preset first threshold value. When the value is smaller, a value obtained by multiplying the assumed depth value by a preset first coefficient is added to the corresponding pixel difference value.
かかる構成において、奥行推定装置は、対応画素差分演算手段によって、黒い背景を持つ被写体で、より小さい奥行値で差分絶対値がより小さくなるようにして、差分絶対値が最小となる奥行値が多数発生し、奥行値を推定できないことを防止する。さらに、奥行推定装置は、対応画素差分演算手段によって、通常の映像では発生しないような非常に暗い黒色の画素値を第1の閾値とすることで、通常の黒い被写体の奥行値の誤推定を防止する。 In such a configuration, the depth estimation apparatus uses the corresponding pixel difference calculation means to reduce the absolute value of the difference with a smaller depth value for a subject with a black background, and to obtain a large number of depth values that minimize the absolute difference value. To prevent the depth value from being estimated. Furthermore, the depth estimation device uses the corresponding pixel difference calculation means to set a very dark black pixel value that does not occur in a normal image as the first threshold value, thereby erroneously estimating a normal black object depth value. To prevent.
また、本願第3発明に係る奥行推定装置は、前記対応画素差分演算手段が、前記黒背景フラグにおいて前記背景が黒色に設定されていない場合、前記注目画素の画素値と前記近傍画素の画素値との全てが予め設定した第1の閾値より小さい場合、前記対応画素差分値に、左右の前記近傍画素の奥行値のうち大きい方と前記仮定奥行値との差分絶対値に前記第1の係数を掛けた値を加えることを特徴とする。 Further, in the depth estimation device according to the third invention of the present application, when the corresponding pixel difference calculation means does not set the background to black in the black background flag, the pixel value of the target pixel and the pixel value of the neighboring pixels Are smaller than a preset first threshold value, the first coefficient is calculated as the difference absolute value between the larger one of the depth values of the neighboring pixels on the left and right and the assumed depth value. The value multiplied by is added.
かかる構成において、奥行推定装置は、対応画素差分演算手段によって、黒い被写体がある場合、黒い被写体のエッジで推定された奥行値に近い仮定奥行値で、差分絶対値がより小さくなるようにして、黒い被写体内部で差分絶対値が最小となる奥行値が多数発生し、奥行値を推定できないことを防止する。この場合は、通常の映像で発生する黒色を閾値とすることで、通常の黒い被写体の奥行値の誤推定を防止する。 In such a configuration, when there is a black subject by the corresponding pixel difference calculation means, the depth estimation device makes the difference absolute value smaller with an assumed depth value close to the depth value estimated at the edge of the black subject, This prevents the depth value from being estimated due to the occurrence of a large number of depth values having the smallest difference in the black subject. In this case, the black value generated in a normal video is used as a threshold value, thereby preventing an erroneous estimation of the depth value of a normal black subject.
また、本願第4発明に係る奥行推定装置は、前記差分値決定手段が、前記近傍画素どうしの奥行値の差が予め設定した第2の閾値より小さいか、または、前記近傍画素どうしの画素値の差が予め設定した第3の閾値より小さい場合、前記平均差分値を前記選択差分値として決定することを特徴とする。 Further, in the depth estimation device according to the fourth invention of the present application, the difference value determining means determines whether the difference between the depth values of the neighboring pixels is smaller than a preset second threshold value, or the pixel values of the neighboring pixels. When the difference is smaller than a preset third threshold value, the average difference value is determined as the selection difference value.
かかる構成において、奥行推定装置は、差分値決定手段によって、注目画素の近傍に、前景と背景の境界がないと判定した場合、平均差分値を選択差分値として選択することにより、より正しい選択差分値を選択可能とする。 In such a configuration, when the depth estimation apparatus determines that there is no boundary between the foreground and the background in the vicinity of the target pixel by the difference value determination unit, the depth estimation device selects the average difference value as the selection difference value, thereby enabling a more correct selection difference. Make the value selectable.
また、本願第5発明に係る奥行推定装置は、前記差分値決定手段が、前記近傍画素どうしの奥行値の差が前記第2の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、左右の前記近傍画素のうち小さい前記奥行値を有する方よりも大きい前記奥行値を有する方の画素値に前記注目画素の画素値が近い場合、前記平均差分値を前記選択差分値として決定することを特徴とする。 Further, in the depth estimation apparatus according to the fifth invention of the present application, the difference value determining means is configured such that a difference in depth value between the neighboring pixels is larger than the second threshold value, and a difference in pixel value between the neighboring pixels is the first difference. If the pixel value of the pixel of interest is closer to the pixel value having the depth value larger than the one having the depth value smaller than the left and right neighboring pixels, the average difference value is selected. It is determined as a difference value.
かかる構成において、奥行推定装置は、差分値決定手段によって、注目画素が前景に含まれると判定した場合、平均差分値を選択差分値として選択することにより、より正しい選択差分値を選択可能とする。 In such a configuration, when the depth estimation device determines that the target pixel is included in the foreground by the difference value determination unit, the depth estimation device can select a more correct selection difference value by selecting the average difference value as the selection difference value. .
また、本願第6発明に係る奥行推定装置は、前記差分値決定手段が、前記差分値決定手段は、前記近傍画素どうしの奥行値の差が前記第2の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、左右の前記近傍画素のうち小さい前記奥行値を有する方よりも大きい前記奥行値を有する方の画素値に前記注目画素の画素値が近く、前記仮定奥行値が左右の前記近傍画素のうちの前記大きい奥行値より大きい場合、前記仮定奥行値に前記第1の係数を掛けた値を前記加算値として算出して、前記平均差分値に前記加算値を加えた値を前記選択差分値として決定することを特徴とする。 Further, in the depth estimation device according to the sixth invention of the present application, the difference value determination unit is configured such that the difference value determination unit has a difference in depth value between the neighboring pixels larger than the second threshold value, and the difference between the neighboring pixels. The pixel value of the pixel of interest is closer to the pixel value having the greater depth value than the one having the smaller depth value among the neighboring pixels on the left and right, the pixel value difference being greater than the third threshold, When the assumed depth value is larger than the large depth value of the left and right neighboring pixels, a value obtained by multiplying the assumed depth value by the first coefficient is calculated as the addition value, and the average difference value is added to the average difference value. A value obtained by adding a value is determined as the selection difference value.
かかる構成において、奥行推定装置は、差分値決定手段によって、注目画素が前景に含まれると判定した場合、仮定奥行値が前景の奥行値より大きくなれば、その仮定奥行値に係数を掛けたペナルティ(加算値)を平均差分値に加えることにより、より正しい選択差分値を選択可能とする。 In such a configuration, when the depth estimation device determines that the target pixel is included in the foreground by the difference value determination unit, if the assumed depth value is larger than the depth value of the foreground, a penalty obtained by multiplying the assumed depth value by a coefficient. By adding (added value) to the average difference value, a more correct selection difference value can be selected.
また、本願第7発明に係る奥行推定装置は、前記差分値決定手段が、前記近傍画素どうしの奥行値の差が前記第2の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、左右の前記近傍画素のうち大きい前記奥行値を有する方よりも小さい前記奥行値を有する方の画素値に前記注目画素の画素値が近く、前記小さい奥行値を有する前記近傍画素の対応画素差分値に予め設定した第3の係数を掛けた値が前記大きい奥行値を有する前記近傍画素の対応画素差分値より小さい場合、前記最小差分値を前記選択差分値として決定することを特徴とする。 Further, in the depth estimation apparatus according to the seventh invention of the present application, the difference value determining means is configured such that a difference in depth value between the neighboring pixels is larger than the second threshold value, and a difference in pixel value between the neighboring pixels is the first difference. The neighborhood of which the pixel value of the pixel of interest is close to the pixel value having the depth value smaller than the one having the depth value larger than the threshold value of 3 and the left and right neighboring pixels, and having the small depth value When the value obtained by multiplying the corresponding pixel difference value of the pixel by a preset third coefficient is smaller than the corresponding pixel difference value of the neighboring pixel having the large depth value, the minimum difference value is determined as the selected difference value. It is characterized by.
かかる構成において、奥行推定装置は、差分値決定手段によって、注目画素が背景に含まれると判定した場合、差分絶対値が小さくなる、背景のある側の最小差分値を選択差分値として選択することにより、より正しい選択差分値を選択可能とする。 In such a configuration, when the depth estimation device determines that the pixel of interest is included in the background by the difference value determination unit, the depth estimation device selects the minimum difference value on the side with the background as the selected difference value, in which the difference absolute value decreases. Thus, a more correct selection difference value can be selected.
また、本願第8発明に係る奥行推定装置は、前記差分値決定手段が、前記近傍画素どうしの奥行値の差が前記第2の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、左右の前記近傍画素のうち大きい前記奥行値を有する方よりも小さい前記奥行値を有する方の画素値に前記注目画素の画素値が近く、前記小さい奥行値を有する前記近傍画素の対応画素差分値に前記第3の係数を掛けた値が前記大きい奥行値を有する前記近傍画素の対応画素差分値より大きい場合、前記仮定奥行値に予め設定した第2の係数を掛けた値または予め設定された固定値の何れかを前記加算値として算出して、前記平均差分値に前記加算値を加えた値を前記選択差分値として決定することを特徴とする。 Further, in the depth estimation device according to the eighth invention of the present application, the difference value determining means is configured such that the difference between the depth values of the neighboring pixels is larger than the second threshold value, and the difference between the pixel values of the neighboring pixels is the first value. The neighborhood of which the pixel value of the pixel of interest is close to the pixel value having the depth value smaller than the one having the depth value larger than the threshold value of 3 and the left and right neighboring pixels, and having the small depth value When the value obtained by multiplying the corresponding pixel difference value of the pixel by the third coefficient is larger than the corresponding pixel difference value of the neighboring pixel having the large depth value, the presumed depth value is multiplied by a preset second coefficient. Either a value or a preset fixed value is calculated as the added value, and a value obtained by adding the added value to the average difference value is determined as the selected difference value.
かかる構成において、奥行推定装置は、差分値決定手段によって、注目画素が背景の被写体に含まれると判定した場合、差分絶対値が小さくなるはずの、背景のある側の差分絶対値が小さくならないとき、偽マッチングが生じていると判定する。この場合、奥行推定装置は、差分値決定手段によって、平均差分値にペナルティ(加算値)を加えて、誤った仮定奥行値のために小さくなった平均差分値がそのまま選択差分値として選択されないようにすることにより、奥行値の誤推定を防止する。 In such a configuration, when the depth estimation device determines that the target pixel is included in the background subject by the difference value determination unit, the difference absolute value on the side with the background should not decrease when the difference absolute value should decrease. It is determined that false matching has occurred. In this case, the depth estimation device adds a penalty (added value) to the average difference value by the difference value determination unit so that the average difference value that has become smaller due to the erroneous assumed depth value is not selected as the selected difference value. By doing so, erroneous estimation of the depth value is prevented.
また、本願第9発明に係る奥行推定装置は、前記差分値決定手段が、前記近傍画素どうしの奥行値の差が前記第2の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、前記注目画素の画素値と前記近傍画素の画素値との差が予め設定された第4の閾値より大きい場合、前記小さい奥行値を有する前記近傍画素の対応画素差分値に前記第3の係数を掛けた値が前記大きい奥行値を有する前記近傍画素の対応画素差分値より大きいときに、前記仮定奥行値に前記第1の係数を掛けた値を前記加算値として算出して、前記平均差分値に前記加算値を加えた値を前記選択差分値として決定し、前記小さい奥行値を有する前記近傍画素の対応画素差分値に前記第3の係数を掛けた値が前記大きい奥行値を有する前記近傍画素の対応画素差分値より小さいときに、前記仮定奥行値に前記第1の係数を掛けた値を前記加算値として算出して、前記最小差分値に前記加算値を加えた値を前記選択差分値として決定することを特徴とする。 Further, in the depth estimation apparatus according to the ninth invention of the present application, the difference value determining means has a difference in depth value between the neighboring pixels larger than the second threshold value, and a difference in pixel value between the neighboring pixels is the first difference. When the difference between the pixel value of the target pixel and the pixel value of the neighboring pixel is larger than a threshold value of 3, and the pixel value of the neighboring pixel is larger than a preset fourth threshold value, the corresponding pixel difference value of the neighboring pixel having the small depth value is set. When the value obtained by multiplying the third coefficient is greater than the corresponding pixel difference value of the neighboring pixels having the large depth value, a value obtained by multiplying the assumed depth value by the first coefficient is calculated as the addition value. Then, a value obtained by adding the addition value to the average difference value is determined as the selection difference value, and a value obtained by multiplying the corresponding pixel difference value of the neighboring pixels having the small depth value by the third coefficient is the large value. The neighborhood image having a depth value A value obtained by multiplying the assumed depth value by the first coefficient as the added value, and a value obtained by adding the added value to the minimum difference value. It is determined as follows.
かかる構成において、奥行推定装置は、差分値決定手段によって、注目画素が前景と背景のいずれにも含まれない、第3の背景(中景)に含まれると判定した場合、背景のある側の差分絶対値が小さくなれば、最小差分値にペナルティ(加算値)を加えて、この最小差分値を選択差分値として選択する。一方、奥行推定装置は、差分値決定手段によって、背景のある側の差分絶対値が小さくならなければ、平均差分値にペナルティ(加算値)を加えて、誤った仮定奥行値のために小さくなった平均差分値がそのまま選択差分値として選択されないようにすることにより、奥行値の誤推定を防止する。 In such a configuration, when the depth estimation device determines that the target pixel is included in the third background (middle background) that is not included in either the foreground or the background by the difference value determination unit, the depth estimation device If the difference absolute value becomes smaller, a penalty (added value) is added to the minimum difference value, and this minimum difference value is selected as the selected difference value. On the other hand, the depth estimation apparatus adds a penalty (addition value) to the average difference value unless the difference absolute value on the side with the background is reduced by the difference value determination means, and becomes smaller due to an erroneous assumed depth value. By preventing the average difference value from being selected as the selection difference value as it is, erroneous estimation of the depth value is prevented.
また、本願第9発明において、前記差分値決定手段は、前記近傍画素どうしの奥行値の差が前記第2の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、前記注目画素の画素値と前記近傍画素の画素値との差が予め設定された第4の閾値より大きい場合、前記小さい奥行値を有する前記近傍画素の対応画素差分値に前記第3の係数を掛けた値が前記大きい奥行値を有する前記近傍画素の対応画素差分値より大きいときに、前記仮定奥行値に前記第1の係数を掛けた値を前記加算値として算出して、前記平均差分値に前記加算値を加えた値を前記選択差分値として決定することが好ましい。 In the ninth invention of the present application, the difference value determining means is configured such that a difference in depth value between neighboring pixels is greater than the second threshold value, and a difference in pixel value between neighboring pixels is greater than the third threshold value. When the difference between the pixel value of the target pixel and the pixel value of the neighboring pixel is larger than a preset fourth threshold value, the third coefficient is added to the corresponding pixel difference value of the neighboring pixel having the small depth value. When the value multiplied by is larger than the corresponding pixel difference value of the neighboring pixels having the large depth value, a value obtained by multiplying the assumed depth value by the first coefficient is calculated as the addition value, and the average difference is calculated. It is preferable to determine a value obtained by adding the addition value to the value as the selection difference value.
また、本願第9発明において、前記差分値決定手段は、前記近傍画素どうしの奥行値の差が前記第2の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、前記注目画素の画素値と前記近傍画素の画素値との差が予め設定された第4の閾値より大きい場合、前記小さい奥行値を有する前記近傍画素の対応画素差分値に前記第3の係数を掛けた値が前記大きい奥行値を有する前記近傍画素の対応画素差分値より小さいときに、前記仮定奥行値に前記第1の係数を掛けた値を前記加算値として算出して、前記最小差分値に前記加算値を加えた値を前記選択差分値として決定することが好ましい。 In the ninth invention of the present application, the difference value determining means is configured such that a difference in depth value between neighboring pixels is greater than the second threshold value, and a difference in pixel value between neighboring pixels is greater than the third threshold value. When the difference between the pixel value of the target pixel and the pixel value of the neighboring pixel is larger than a preset fourth threshold value, the third coefficient is added to the corresponding pixel difference value of the neighboring pixel having the small depth value. When the value multiplied by is smaller than the corresponding pixel difference value of the neighboring pixels having the large depth value, a value obtained by multiplying the assumed depth value by the first coefficient is calculated as the addition value, and the minimum difference is calculated. It is preferable to determine a value obtained by adding the addition value to the value as the selection difference value.
また、本願第10発明に係る奥行推定装置は、前記差分値決定手段が、前記奥行値の推定回数が1回目の場合、前記最小差分値を前記選択差分値として決定し、前記奥行値の推定回数が2回目以降の場合、前記奥行値決定手段から入力された近傍画素の奥行値を用いて前記選択差分値を決定することを特徴とする。 Further, in the depth estimation device according to the tenth invention of the present application, the difference value determination means determines the minimum difference value as the selected difference value when the depth count is estimated for the first time, and estimates the depth value. When the number of times is the second or later, the selection difference value is determined using a depth value of a neighboring pixel input from the depth value determination means.
かかる構成において、奥行推定装置は、1回目の奥行推定では、最小差分値を選択差分値とすることにより、偽マッチングの生じる可能性のある被写体部分を除いて、奥行値を正確に推定する。そして、奥行推定装置は、得られた奥行値を用いて2回目以降の奥行推定を行うことで、奥行値の誤推定を防止する。 In this configuration, in the first depth estimation, the depth value is accurately estimated by excluding the subject portion where false matching may occur by setting the minimum difference value as the selection difference value. Then, the depth estimation apparatus prevents the depth value from being erroneously estimated by performing depth estimation for the second time and thereafter using the obtained depth value.
また、本願第11発明に係る奥行推定方法は、予め定めた位置に複数配列したカメラで同一の被写体を撮影した複数のカメラ映像から、前記被写体の奥行きを示す奥行値を推定する奥行推定方法であって、映像入力ステップと、近傍画素値出力ステップと、対応画素差分演算ステップと、差分値決定ステップと、平滑化ステップと、奥行値決定ステップと、近傍奥行値出力ステップと、を備える手順とした。 The depth estimation method according to the eleventh aspect of the present invention is a depth estimation method for estimating a depth value indicating the depth of a subject from a plurality of camera images obtained by photographing the same subject with a plurality of cameras arranged in a predetermined position. A procedure comprising: a video input step, a neighborhood pixel value output step, a corresponding pixel difference calculation step, a difference value determination step, a smoothing step, a depth value determination step, and a neighborhood depth value output step; did.
かかる手順において、奥行推定方法は、映像入力ステップにおいて、前記複数配列した前記カメラのいずれかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラに隣接する複数の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する。 In this procedure, the depth estimation method includes a reference image obtained by photographing the subject with a predetermined reference camera and a plurality of adjacent cameras adjacent to the reference camera in any of the plurality of cameras arranged in the image input step. To input a plurality of adjacent video images of the subject.
そして、奥行推定方法は、近傍画素値出力ステップによって、前記映像入力ステップで入力された基準映像において、当該基準映像の注目画素の画素値と、前記注目画素に対して左右近傍に位置する近傍画素の画素値とを出力する。 Then, in the reference image input in the image input step by the neighborhood pixel value output step, the depth estimation method includes the pixel value of the pixel of interest of the reference image and the neighborhood pixel located in the left and right neighborhood of the pixel of interest. Are output.
そして、奥行推定方法は、対応画素差分演算ステップによって、前記奥行値を仮定した仮定奥行値および前記注目画素ごとに、前記基準映像の注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する。 Then, in the depth estimation method, the pixel value of the target pixel of the reference image and the assumed depth value of the target pixel are calculated for each of the assumed depth value and the target pixel assuming the depth value by the corresponding pixel difference calculation step. A corresponding pixel difference value that is an absolute difference value with respect to the pixel values of the corresponding pixels of the plurality of adjacent videos at the pixel position corresponding to the parallax is calculated.
そして、奥行推定方法は、差分値決定ステップによって、前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と前記近傍画素の画素値と前記近傍画素の奥行値とに基づいて、前記最小差分値、前記平均差分値、前記最小差分値または前記平均差分値に所定の加算値を加えた値の何れかを、予め設定した条件により選択差分値として決定する。 In the depth estimation method, the difference value determination step includes, for each of the assumed depth value and the target pixel, an average difference value that is an average value of the corresponding pixel difference values and a minimum that is a minimum value of the corresponding pixel difference values. A difference value is obtained, and based on the pixel value of the target pixel, the pixel value of the neighboring pixel, and the depth value of the neighboring pixel, the minimum difference value, the average difference value, the minimum difference value, or the average difference value Any value obtained by adding a predetermined addition value is determined as a selection difference value according to a preset condition.
そして、奥行推定方法は、平滑化ステップによって、前記仮定奥行値および前記注目画素ごとに、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の仮定奥行値との差に、予め設定された平滑化係数を掛けた値を前記選択差分値に加えることで、前記選択差分値を平滑化する。 Then, in the depth estimation method, for each of the assumed depth value and the target pixel, an assumed depth value at which a selection difference value of a pixel adjacent to the target pixel is minimized and an assumed depth value of the target pixel are determined by a smoothing step. By adding a value obtained by multiplying the difference by a preset smoothing coefficient to the selected difference value, the selected difference value is smoothed.
そして、奥行推定方法は、奥行値決定ステップによって、前記平滑化ステップで平滑化した選択差分値が最小となる前記仮定奥行値を、前記基準映像の各画素の奥行値とする。さらに、奥行推定方法は、近傍奥行値出力ステップによって、前記基準映像の各画素の奥行値が入力されると共に、前記近傍画素の奥行値を出力する。 Then, in the depth estimation method, the assumed depth value at which the selection difference value smoothed in the smoothing step is minimized by the depth value determination step is set as the depth value of each pixel of the reference image. Further, in the depth estimation method, the depth value of each pixel of the reference image is input and the depth value of the neighboring pixel is output in the vicinity depth value output step.
また、本願第12発明に係る奥行推定プログラムは、予め定めた位置に複数配列したカメラで同一の被写体を撮影した複数のカメラ映像から、前記被写体の奥行きを示す奥行値を推定するために、コンピュータを、映像入力手段、近傍画素値出力手段、対応画素差分演算手段、差分値決定手段、平滑化手段、奥行値決定手段、近傍奥行値出力手段、として機能させる構成とした。 The depth estimation program according to the twelfth aspect of the present invention is a computer for estimating a depth value indicating the depth of a subject from a plurality of camera images obtained by photographing the same subject with a plurality of cameras arranged in a predetermined position. Are configured to function as video input means, neighborhood pixel value output means, corresponding pixel difference calculation means, difference value determination means, smoothing means, depth value determination means, and neighborhood depth value output means.
かかる構成において、奥行推定プログラムは、映像入力手段によって、前記複数配列した前記カメラのいずれかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラに隣接する複数の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する。 In this configuration, the depth estimation program uses a video input unit to capture a reference image obtained by photographing the subject with a predetermined reference camera in any of the plurality of cameras arranged, and a plurality of adjacent cameras adjacent to the reference camera. To input a plurality of adjacent video images of the subject.
そして、奥行推定プログラムは、近傍画素値出力手段によって、前記映像入力手段に入力された基準映像において、当該基準映像の注目画素の画素値と、前記注目画素に対して左右近傍に位置する近傍画素の画素値とを出力する。 The depth estimation program includes a pixel value of a target pixel of the reference image and a neighboring pixel located in the vicinity of the target pixel in the reference video input to the video input unit by the neighboring pixel value output unit. Are output.
そして、奥行推定プログラムは、対応画素差分演算手段によって、前記奥行値を仮定した仮定奥行値および前記注目画素ごとに、前記基準映像の注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する。 Then, the depth estimation program uses the corresponding pixel difference calculation means to calculate the pixel value of the target pixel of the reference image and the assumed depth value of the target pixel for each of the assumed depth value assuming the depth value and the target pixel. A corresponding pixel difference value that is an absolute difference value with respect to the pixel values of the corresponding pixels of the plurality of adjacent videos at the pixel position corresponding to the parallax is calculated.
そして、奥行推定プログラムは、差分値決定手段によって、前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と前記近傍画素の画素値と前記近傍画素の奥行値とに基づいて、前記最小差分値、前記平均差分値、前記最小差分値または前記平均差分値に所定の加算値を加えた値の何れかを、予め設定した条件により選択差分値として決定する。 Then, the depth estimation program uses the difference value determination means to calculate an average difference value that is an average value of the corresponding pixel difference values and a minimum value that is a minimum value of the corresponding pixel difference values for each of the assumed depth value and the target pixel. A difference value is obtained, and based on the pixel value of the target pixel, the pixel value of the neighboring pixel, and the depth value of the neighboring pixel, the minimum difference value, the average difference value, the minimum difference value, or the average difference value Any value obtained by adding a predetermined addition value is determined as a selection difference value according to a preset condition.
そして、奥行推定プログラムは、平滑化手段によって、前記仮定奥行値および前記注目画素ごとに、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の仮定奥行値との差に、予め設定された平滑化係数を掛けた値を前記選択差分値に加えることで、前記選択差分値を平滑化する。 Then, the depth estimation program causes the smoothing unit to calculate, for each of the assumed depth value and the target pixel, an assumed depth value at which a selection difference value of a pixel adjacent to the target pixel is minimum, and an assumed depth value of the target pixel. By adding a value obtained by multiplying the difference by a preset smoothing coefficient to the selected difference value, the selected difference value is smoothed.
そして、奥行推定プログラムは、奥行値決定手段によって、前記平滑化手段が平滑化した選択差分値が最小となる前記仮定奥行値を、前記基準映像の各画素の奥行値とする。さらに、奥行推定プログラムは、近傍奥行値出力手段によって、前記奥行値決定手段から基準映像の各画素の奥行値が入力されると共に、前記近傍画素の奥行値を前記対応画素差分演算手段および前記差分値決定手段に出力する。 Then, the depth estimation program sets the assumed depth value at which the selection difference value smoothed by the smoothing means by the depth value determination means is the minimum as the depth value of each pixel of the reference image. Further, the depth estimation program receives the depth value of each pixel of the reference image from the depth value determination means by the neighborhood depth value output means, and calculates the depth value of the neighboring pixels as the corresponding pixel difference calculation means and the difference. Output to value determining means.
本発明は、以下に示す優れた効果を奏するものである。
本願第1,11,12発明によれば、被写体の一部が手前の被写体の陰に隠れて対応点がないオクルージョンが発生した場合であっても、閾値に応じて、最小の差分値、すなわち、より正しい差分値が選択されるため、誤った奥行値を推定することを低減することができる。また、本発明によれば、一様な被写体で対応点を誤る偽マッチングが生じている場合であっても、閾値に応じて、差分値の平均値を選択するため、正しい差分値のように小さな値とはならず、正しい差分値として選択される度合いを低くすることができ、誤った奥行値を推定することを低減することができる。
さらに、本願第1,11,12発明によれば、前景と背景の被写体が接近した部分でオクルージョンが生じる場合であっても、注目画素を含む近傍の画素値と、その画素で推定された奥行値に応じて、より正しい選択差分値を選択するため、誤った奥行値を推定することを低減することができる。
The present invention has the following excellent effects.
According to the first, eleventh, and twelfth inventions of the present application, even when an occlusion where a part of the subject is hidden behind the subject in front and there is no corresponding point occurs, Since a more correct difference value is selected, estimation of an incorrect depth value can be reduced. In addition, according to the present invention, even if false matching that causes a corresponding point to be mistaken in a uniform subject occurs, the average value of the difference values is selected according to the threshold value, so that the correct difference value is It is not a small value, but the degree of selection as a correct difference value can be reduced, and estimation of an erroneous depth value can be reduced.
Further, according to the first, eleventh, and twelfth inventions of the present application, even when occlusion occurs in a portion where the foreground and background subjects are close to each other, the neighboring pixel values including the target pixel and the depth estimated by the pixel Since a more correct selection difference value is selected according to the value, it is possible to reduce estimation of an incorrect depth value.
本願第2発明によれば、非常に暗い黒い背景を持つ被写体であっても、背景部分の奥行値が小さい程、対応画素での選択差分値を小さくするので、正しい奥行値を推定することができる。 According to the second invention of this application, even if the subject has a very dark black background, the smaller the depth value of the background portion is, the smaller the selection difference value at the corresponding pixel is, so that the correct depth value can be estimated. it can.
本願第3発明によれば、黒い被写体であっても、被写体のエッジ部分で正しく推定された奥行値からはずれる程、対応画素での選択差分値を大きくするので、正しい奥行値を推定することができる。 According to the third invention of the present application, even if the subject is a black subject, the selection difference value at the corresponding pixel is increased as the deviation from the depth value correctly estimated at the edge portion of the subject increases, so that the correct depth value can be estimated. it can.
本願第4発明によれば、前景と背景の境界部分以外では、平均差分値を選択差分値として選択することで、より正しい選択差分値を選択可能として、奥行値の誤推定を防止することができる。 According to the fourth invention of the present application, by selecting the average difference value as the selection difference value except for the boundary portion between the foreground and the background, it is possible to select a more correct selection difference value and prevent erroneous estimation of the depth value. it can.
本願第5発明によれば、前景の境界部分であって、オクルージョンが生じていない場合には、平均差分値を選択差分値として選択することにより、より正しい選択差分値を選択可能として、奥行値の誤推定を防止することができる。 According to the fifth invention of the present application, when the boundary portion of the foreground and no occlusion occurs, the depth difference value can be selected by selecting the average difference value as the selection difference value, thereby selecting a more correct selection difference value. Can be prevented.
本願第6発明によれば、前景の境界部分であって、オクルージョンが生じていないと判定した場合であっても、仮定奥行値が前景の奥行値より大きくなれば、仮定奥行値に所定係数を掛けた値をペナルティとして、平均差分値に加えることにより、過大な仮定奥行値のために小さくなった平均差分値がそのまま選択されないようにして、奥行値の誤推定を防止することができる。 According to the sixth aspect of the present invention, even if it is determined that the boundary portion of the foreground and no occlusion has occurred, if the assumed depth value is larger than the depth value of the foreground, a predetermined coefficient is added to the assumed depth value. By adding the multiplied value to the average difference value as a penalty, the average difference value that has become smaller due to the excessive assumed depth value is not selected as it is, and erroneous estimation of the depth value can be prevented.
本願第7発明によれば、オクルージョンが生じている場合であっても、左右差分絶対値のうち、オクルージョンの生じていない側の差分絶対値を選択することにより、より正しい選択差分値を選択して、奥行値の誤推定を防止することができる。 According to the seventh invention of the present application, even when occlusion occurs, by selecting the absolute difference value on the side where no occlusion occurs among the right and left absolute difference values, a more correct selection difference value is selected. Thus, erroneous estimation of the depth value can be prevented.
本願第8発明によれば、左右いずれかの隣接映像でオクルージョンが生じていて、かつ、オクルージョンの生じていない側で、偽マッチングが生じている場合であっても、平均差分値に加算値を加えて、誤った仮定奥行値のために小さくなった平均差分値がそのまま選択差分値として選択されないようにすることにより、奥行値の誤推定を防止することができる。 According to the eighth aspect of the present invention, even if occlusion occurs in the adjacent video image on either the left and right sides and false matching occurs on the side where no occlusion occurs, the added value is added to the average difference value. In addition, an erroneous estimation of the depth value can be prevented by preventing the average difference value that has become smaller due to the erroneous assumed depth value from being selected as the selected difference value.
本願第9発明によれば、前景と中景により左右両方でオクルージョンが生じている場合であっても、中景がある側の差分絶対値が十分小さくなれば、最小差分値にペナルティ(加算値)を加えた値を選択差分値として選択することで、奥行値の誤推定を防止することができる。また、本願第9発明によれば、中景側の差分絶対値が十分小さくならなければ、平均差分値にペナルティ(加算値)を加えた値を選択差分値として選択することで、奥行値の誤推定を防止することができる。 According to the ninth aspect of the present invention, even when occlusion occurs in both the left and right sides of the foreground and the foreground, if the difference absolute value on the side where the foreground is present becomes sufficiently small, a penalty (addition value) ) Is selected as the selection difference value, so that it is possible to prevent erroneous estimation of the depth value. Further, according to the ninth invention of the present application, if the difference absolute value on the middle scene side is not sufficiently small, by selecting a value obtained by adding a penalty (addition value) to the average difference value as the selection difference value, False estimation can be prevented.
本願第10発明によれば、奥行推定を多く繰り返す程、正しい奥行値を推定することができる。 According to the tenth aspect of the present application, the correct depth value can be estimated as the depth estimation is repeated.
以下、本発明の実施形態について図面を参照して説明する。
〔奥行推定システムの全体構成〕
最初に、図1を参照して、本発明の実施形態に係る奥行推定装置1を含んだ奥行推定システムSの全体構成について説明する。奥行推定システムSは、複数配列したカメラCMで被写体Tを撮影した多視点映像から、被写体Tの奥行値Dを推定した奥行映像FZを生成するものである。図1に示した奥行推定システムSは、カメラCM(CL,CC,CR)と、奥行推定装置1とを備えている。
Embodiments of the present invention will be described below with reference to the drawings.
[Overall configuration of depth estimation system]
Initially, with reference to FIG. 1, the whole structure of the depth estimation system S containing the
カメラCMは、被写体Tを撮影する一般的な撮影装置である。ここでは、水平方向の視差に応じて奥行値Dを生成することとし、視差の基準となるカメラ(基準カメラ)CCに対し、水平方向に予め定めた距離Lだけ等間隔に離間して、カメラ(隣接カメラ)CL,CRを平行に配置している。このカメラCM(CL,CC,CR)で撮影された映像(FL,FC,FR)は、奥行推定装置1に入力される。
なお、この距離Lは、奥行値Dと視差量とが対応可能な範囲であれば、その距離は任意である。また、被写体Tは、例えば、背景Aおよび前景Bを含んでいる。
The camera CM is a general photographing device that photographs the subject T. Here, it is possible to generate a depth value D in accordance with the horizontal parallax with respect to serving as a reference camera (reference camera) C C parallax, and equally spaced by a distance L determined in advance in the horizontal direction, camera (adjacent cameras) C L, are arranged parallel to the C R. Videos (F L , F C , F R ) photographed by the camera CM (C L , C C , C R ) are input to the
The distance L is arbitrary as long as the depth value D and the amount of parallax can be accommodated. The subject T includes a background A and a foreground B, for example.
カメラCCは、視差の基準となる映像(基準映像FC)を撮影するものである。また、カメラCL,CRは、それぞれカメラCCの左右に配置されたカメラであって、基準映像FCとの視差を求めるための映像(隣接映像FL,FR)を撮影するものである。 The camera C C is for shooting the image (reference image F C) as a reference of parallax. The cameras C L and C R are cameras arranged on the left and right sides of the camera C C , respectively, and shoot images (adjacent images F L and F R ) for obtaining parallax with the reference image F C. It is.
なお、垂直方向の視差に応じて奥行値Dを生成する場合であれば、カメラCの配置は、垂直方向に離間させて配置すればよい。
また、カメラCMが撮影する映像(FL,FC,FR)は、静止画であっても動画であっても構わない。動画である場合、カメラCMはそれぞれフレーム同期を行うことで、順次、静止画のフレーム画像として奥行推定装置1に入力されることとする。あるいは、フレーム画像ごとにタイムコードを付加し、奥行推定装置1で同期をとることとしてもよい。
Note that if the depth value D is generated according to the vertical parallax, the camera C may be arranged separately in the vertical direction.
In addition, the video (F L , F C , F R ) captured by the camera CM may be a still image or a moving image. In the case of a moving image, the camera CM sequentially performs frame synchronization, and sequentially inputs the frame image of the still image to the
奥行推定装置1は、予め定めた位置に複数配列したカメラで同一の被写体を撮影した複数のカメラ映像から、被写体Tの奥行きを示す奥行値を推定するものである。ここでは、奥行推定装置1は、水平方向に配列したカメラCM(CL,CC,CR)で被写体Tを撮影したカメラ映像(FL,FC,FR)から、被写体Tの奥行きを示す奥行値Dを推定する。なお、ここでは、奥行推定装置1は、奥行値を、映像の各画素値に対応付けることで奥行映像FZを生成することとする。
The
〔奥行推定装置の構成〕
次に、図2を参照(適宜図1参照)して、本発明の実施形態に係る奥行推定装置の構成について説明する。図2に示すように、奥行推定装置1は、映像入力手段10と、近傍画素値出力手段15と、対応画素差分演算手段20と、近傍奥行値出力手段25と、差分値決定手段30と、記憶手段40と、平滑化手段50と、奥行値決定手段60と、を備えている。
[Configuration of depth estimation device]
Next, referring to FIG. 2 (refer to FIG. 1 as appropriate), the configuration of the depth estimation apparatus according to the embodiment of the present invention will be described. As shown in FIG. 2, the
映像入力手段10は、カメラCMで撮影された複数のカメラ映像を入力するものである。ここでは、映像入力手段10は、予め定めた基準カメラCCで撮影した基準映像FCと、基準カメラCCに隣接する複数のカメラCL,CRで撮影した隣接映像FL,FRと、を入力する。
この映像入力手段10で入力した各映像(FL,FC,FR)は、図示を省略したメモリに記憶され、後記する近傍画素値出力手段15および対応画素差分演算手段20によって参照されるものとする。
The video input means 10 inputs a plurality of camera videos taken by the camera CM. Here, the
Each video (F L , F C , F R ) input by the video input means 10 is stored in a memory (not shown), and is referred to by the neighboring pixel value output means 15 and the corresponding pixel difference calculation means 20 described later. Shall.
以下、図3を参照して、近傍画素値出力手段15を説明する(適宜図2参照)。
近傍画素値出力手段15は、映像入力手段10から基準映像FCを入力し、注目画素PCの画素値PC(x,y)と、注目画素PCから所定画素数sだけ左に離れた近傍画素PSLの画素値PSL(x−s,y)と、注目画素PCから所定の画素数sだけ右に離れた近傍画素PSRの画素値PSR(x+s,y)とを取得する。そして、近傍画素値出力手段15は、注目画素PCの画素値PC(x,y)と、近傍画素PSLの画素値PSL(x−s,y)と、近傍画素PSRの画素値PSR(x+s,y)とを、対応画素差分演算手段20および差分値決定手段30に出力する。
Hereinafter, the neighboring pixel value output means 15 will be described with reference to FIG. 3 (see FIG. 2 as appropriate).
Neighboring pixel
この所定の画素数sは、正しい奥行値Dを推定できるように、平滑化による前景Bの奥行値が広がる範囲以上に予め設定する。具体的には、所定の画素数sは、シーンの中の被写体Tの最大視差量と最小視差量とを予め調べておき、最大視差量と最小視差量との差に所定の値(例えば、0.2)を掛けた値とする。 The predetermined number of pixels s is set in advance so that the depth value of the foreground B by smoothing is widened so that the correct depth value D can be estimated. Specifically, the predetermined number of pixels s is obtained by examining the maximum parallax amount and the minimum parallax amount of the subject T in the scene in advance, and a predetermined value (for example, the difference between the maximum parallax amount and the minimum parallax amount) 0.2).
なお、注目画素PCとは、基準映像FCにおいて奥行値Dを推定する対象となっている画素である。
また、近傍画素PSLおよび近傍画素PSRは、図3に示すように、注目画素PCを中心した半径sの画素の円周上に位置する画素である。なお、図3では、近傍画素PSLを左近傍画素PSLと図示し、近傍画素PSRを右近傍画素PSRと図示した。
Note that the pixel of interest P C, which is a pixel of interest to estimate the depth value D in the reference image F C.
Further, the neighboring pixel P SL and its neighboring pixels P SR, as shown in FIG. 3, a pixel located on the circumference of the pixel of radius s that centered on the pixel of interest P C. In FIG. 3, illustrate neighboring pixel P SL and left neighboring pixel P SL, illustrating the vicinity of pixel P SR and right neighboring pixel P SR.
以下、図2に戻り、奥行推定装置1の構成について説明を続ける。
対応画素差分演算手段20は、仮定奥行値dおよび注目画素PCごとに、基準映像FCの注目画素PCの画素値と、当該注目画素PCの仮定奥行値dの視差に対応する隣接映像FL,FRの対応画素PL,PR(図5参照)の画素値との差分絶対値である隣接映像の対応画素差分値ECL,ECRを演算するものである。ここで、隣接映像の対応画素差分値ECLは、基準映像FCと隣接映像FLとの間で演算された差分絶対値であり、隣接映像の対応画素差分値ECRは、基準映像FCと隣接映像FRとの間で演算された差分絶対値である。
Hereinafter, returning to FIG. 2, the description of the configuration of the
Corresponding pixel
なお、画素値の差分絶対値は、カメラ映像(FL,FC,FR)が、輝度(輝度値)と色差信号(色差値)との各要素で構成される場合、当該画素の輝度値の差分絶対値と、色差値の差分絶対値とを加算した値とする。このとき、色差値の差分絶対値に任意の係数を掛けて、色成分の重みを調整することとしてもよい。
また、画素値の差分絶対値は、カメラ映像(FL,FC,FR)が、RGBのカラー信号で構成される場合、カラー信号の要素であるR値の差分絶対値と、G値の差分絶対値と、B値の差分絶対値とを加算した値とする。
Note that the absolute difference value of the pixel value is the luminance of the pixel when the camera image (F L , F C , F R ) is composed of each element of luminance (luminance value) and color difference signal (color difference value). A value obtained by adding the difference absolute value of the value and the difference absolute value of the color difference value. At this time, the color component weight may be adjusted by multiplying the absolute difference value of the color difference value by an arbitrary coefficient.
In addition, when the camera image (F L , F C , F R ) is composed of RGB color signals, the absolute difference value of the pixel value is the difference absolute value of the R value that is an element of the color signal, and the G value. And the difference absolute value of the B value are added to each other.
また、仮定奥行値dは、被写体Tの奥行値Dを仮に設定する値であって、“0”から予め定めた最大視差量に対応する奥行値Dまでの値をとる。例えば、奥行値Dを8ビットのデータで表す場合、仮定奥行値dは、“0”〜“255”の範囲の値をとる。また、ここでは、対応画素差分演算手段20は、“0”から最大視差量に対応する奥行値D(例えば、“255”)まで、順次、仮定奥行値dを設定し、当該仮定奥行値dの視差に対応する画素間の画素値の差分を対応画素差分値として演算する。また、ここでは、奥行値Dの単位と画素間の視差の単位とを同一とし、奥行値Dが“1”増加することで、1画素ずつ視差が増加することとする。 The assumed depth value d is a value for temporarily setting the depth value D of the subject T, and takes a value from “0” to the depth value D corresponding to a predetermined maximum parallax amount. For example, when the depth value D is represented by 8-bit data, the assumed depth value d takes a value in the range of “0” to “255”. Further, here, the corresponding pixel difference calculation means 20 sequentially sets the assumed depth value d from “0” to the depth value D (for example, “255”) corresponding to the maximum parallax amount, and the assumed depth value d The pixel value difference between pixels corresponding to the parallax is calculated as a corresponding pixel difference value. Here, the unit of the depth value D and the unit of the parallax between the pixels are the same, and when the depth value D increases by “1”, the parallax increases by one pixel.
ここでは、対応画素差分演算手段20は、基準映像FCの(x,y)座標(注目画素PC)における画素値をPC(x,y)、基準映像FCの(x,y)座標の仮定奥行値dに対応する隣接映像FLの(x+d,y)座標(対応画素PL)の画素値をPL(x+d,y)、隣接映像FRの(x−d,y)座標(対応画素PR)の画素値をPR(x−d,y)としたとき、以下の(1)式の演算により、対応画素差分値ECL(d,x,y),ECR(d,x,y)を算出する。なお、「||」は、絶対値を示す。
ECL(d,x,y)=|PL(x+d,y)−PC(x,y)|
ECR(d,x,y)=|PR(x−d,y)−PC(x,y)| …(1)式
Here, the corresponding pixel difference calculating means 20, the reference image F C (x, y) coordinate the pixel value at (pixel of interest P C) P C (x, y), the reference image F C (x, y) of neighboring image F L corresponding to assume depth value d of the coordinates (x + d, y) coordinate pixel values (corresponding pixels P L) P L (x + d, y), of the neighboring image F R (x-d, y ) When the pixel value of the coordinates (corresponding pixel P R ) is P R (x−d, y), the corresponding pixel difference value E CL (d, x, y), E CR is calculated by the following equation (1). (D, x, y) is calculated. “||” indicates an absolute value.
E CL (d, x, y) = | P L (x + d, y) −P C (x, y) |
E CR (d, x, y) = | P R (x−d, y) −P C (x, y) | (1)
次に、対応画素差分演算手段20は、被写体Tが黒い背景であるか否かを判定する。具体的には、対応画素差分演算手段20は、近傍画素値出力手段15から入力された注目画素PCの画素値PC(x,y)と、近傍画素PSLの画素値PSL(x−s,y)と、近傍画素PSRの画素値PSR(x+s,y)との全てが閾値(第1の閾値)thより小さい場合、被写体Tが黒い背景であると判定する。
Next, the corresponding pixel difference calculation means 20 determines whether or not the subject T has a black background. Specifically, the corresponding pixel
一方、対応画素差分演算手段20は、注目画素PCの画素値PC(x,y)と、近傍画素PSLの画素値PSL(x−s,y)と、近傍画素PSRの画素値PSR(x+s,y)との何れか一つでも閾値th以上となる場合、被写体Tが黒い背景でないと判定する。 On the other hand, the corresponding pixel difference calculating means 20, the target pixel P C of the pixel value P C (x, y) and the pixel value P SL (x-s, y ) of the neighboring pixels P SL and the pixel of the neighboring pixels P SR If any one of the values P SR (x + s, y) is greater than or equal to the threshold th, it is determined that the subject T is not a black background.
なお、閾値thは、通常の黒では表れない非常に暗い黒色の画素値(例えば、Y信号値で、15または30)に予め設定される。また、色信号をRGBコンポーネントで表す場合、Y信号値を、Y=0.299R+0.587G+0.114Bから求めても良い。 The threshold th is set in advance to a very dark black pixel value (for example, Y or 15 or 30) that does not appear in normal black. Further, when the color signal is represented by RGB components, the Y signal value may be obtained from Y = 0.299R + 0.587G + 0.114B.
さらに、被写体Tが黒い背景である場合、対応画素差分演算手段20は、外部から入力される黒背景フラグがオンまたはオフであるか判定する。ここで、対応画素差分演算手段20は、黒背景フラグがオン(背景が黒である)であれば、以下の(1−1)式のように、仮定奥行値dに係数(第1の係数)hを掛けた値(ペナルティ)を、対応画素差分値ECL,ECRに加える。
ECL(d,x,y)=ECL(d,x,y)+h×d
ECR(d,x,y)=ECR(d,x,y)+h×d …(1−1)式
なお、係数hは、予め設定される係数であり、背景Aではない被写体Tに大きなペナルティが誤って加算されるのを防ぐため、小さな値とする(例えば、0.25)。
Furthermore, when the subject T has a black background, the corresponding pixel
E CL (d, x, y) = E CL (d, x, y) + h × d
E CR (d, x, y) = E CR (d, x, y) + h × d (1-1) The coefficient h is a coefficient set in advance, and is applied to the subject T that is not the background A. A small value is set (for example, 0.25) to prevent a large penalty from being added by mistake.
被写体Tが黒い背景の場合、全ての仮定奥行値dで、対応画素差分値ECL,ECRが小さな値となり、正しい奥行値Dを推定できない場合がある。しかし、以上の処理によって、対応画素差分演算手段20は、被写体Tが黒い背景であっても、対応画素差分値ECL,ECRを正しい値に近づけることができる。 When the subject T has a black background, the corresponding pixel difference values E CL and E CR are small for all assumed depth values d, and the correct depth value D may not be estimated. However, with the above processing, the corresponding pixel difference calculation means 20 can bring the corresponding pixel difference values E CL and E CR closer to the correct values even when the subject T has a black background.
また、対応画素差分演算手段20は、黒背景フラグがオフ(背景が黒でない)であれば、近傍奥行値出力手段25から入力された近傍画素PSLの奥行値DL、および、近傍画素PSRの奥行値DRのうち、大きい方の近傍奥行値DMを求める。そして、対応画素差分演算手段20は、以下の(1−2)式のように、大きい方の近傍奥行値DMと仮定奥行値dとの差分絶対値に係数hを掛けた値(ペナルティ)を、対応画素差分値ECL,ECRに加える。
DM(x,y)=max(DL(x−s,y),DR(x+s,y))
ECL(d,x,y)=ECL(d,x,y)+h×|DM−d|
ECR(d,x,y)=ECR(d,x,y)+h×|DM−d| …(1−2)式
Further, the corresponding pixel difference calculation means 20, if the black background flag is off (the background is not black), the depth value D L of the neighboring pixel P SL input from the neighboring depth value output means 25, and the neighboring pixel P of SR depth value D R, obtaining the near depth value D M larger. Then, the corresponding pixel difference calculating means 20, the following (1-2) equation as the larger value obtained by multiplying the coefficient h to the difference absolute value between neighboring depth value D M assumed depth value d of (penalty) Is added to the corresponding pixel difference values E CL and E CR .
D M (x, y) = max (D L (x−s, y), D R (x + s, y))
E CL (d, x, y) = E CL (d, x, y) + h × | D M −d |
E CR (d, x, y) = E CR (d, x, y) + h × | D M −d | (1-2)
すなわち、被写体Tが黒い場合、全ての仮定奥行値dで、対応画素の差分絶対値(対応画素差分値ECL,ECR)が小さな値となり、正しい奥行値Dを推定できなくなる。しかし、被写体Tのエッジ部分では、正しい奥行値Dを推定できる。従って、対応画素差分演算手段20は、仮定奥行値dとこの正しい奥行値Dとの差分に係数hを掛けた値を、対応画素差分値ECL,ECRに加えることにより、正しくない奥行値Dで対応画素差分値ECL,ECRが小さくなることを防止する。これによって、対応画素差分演算手段20は、通常の黒い被写体Tにおいて、対応画素差分値ECL,ECRが正しく計算されないことを防止できる。 That is, when the subject T is black, the absolute value of the difference between the corresponding pixels (corresponding pixel difference values E CL and E CR ) is small for all assumed depth values d, and the correct depth value D cannot be estimated. However, the correct depth value D can be estimated at the edge portion of the subject T. Therefore, the corresponding pixel difference calculation means 20 adds a value obtained by multiplying the difference between the assumed depth value d and the correct depth value D by the coefficient h to the corresponding pixel difference values E CL and E CR , thereby obtaining an incorrect depth value. The corresponding pixel difference values E CL and E CR are prevented from being reduced by D. Thereby, the corresponding pixel difference calculation means 20 can prevent the corresponding pixel difference values E CL and E CR from being calculated correctly in the normal black subject T.
そして、対応画素差分演算手段20は、仮定奥行値d(“0”〜最大視差量)ごとの対応画素差分値ECL,ECRを差分値決定手段30に出力する。なお、対応画素差分演算手段20は、演算対象となる注目画素PCの画素位置(x,y)および仮定奥行値dを順次更新して、対応画素差分値ECL,ECRを演算する。
Then, the corresponding pixel
以下、図4を参照して、近傍奥行値出力手段25について説明する。
近傍奥行値出力手段25は、後記する奥行値決定手段60から各画素の奥行値Dが入力され、近傍画素PSLの奥行値DLと、近傍画素PSRの奥行値DRとを対応画素差分演算手段20および差分値決定手段30に出力するものである。
ここで、1回目の奥行推定では、奥行値Dが求められないことになる。この場合、奥行推定装置1は、全ての画素の奥行値Dを初期値(例えば、0)に予め設定する。つまり、1回目の奥行推定を行う場合、近傍奥行値出力手段25は、この初期値を奥行値DL,DRとして差分値決定手段30に出力する。一方、2回目以降の奥行推定では、近傍奥行値出力手段25は、前回の奥行推定で求めた各画素の奥行値Dが奥行値決定手段60から入力されるので、近傍画素PSLの奥行値DLと、近傍画素PSRの奥行値DRとを出力する。
Hereinafter, the neighborhood depth value output means 25 will be described with reference to FIG.
Near depth value output means 25, the depth value D of each pixel from the
Here, the depth value D is not obtained in the first depth estimation. In this case, the
以下、図2に戻り、奥行推定装置1の構成について説明を続ける。
差分値決定手段30は、基準映像FCの注目画素PCおよび仮定奥行値dごとに、最小差分値Emと平均差分値Eaとを求めるものである。そして、差分値決定手段30は、求めた最小差分値Em、平均差分値Ea、最小差分値Emまたは平均差分値Eaに所定のペナルティ(加算値)を加えた値の何れかを、予め設定された条件により選択差分値として決定する。
Hereinafter, returning to FIG. 2, the description of the configuration of the
Difference
ここでは、差分値決定手段30は、平均差分値演算手段30aと、最小差分値選択手段30bと、差分値選択手段30cと、を備えている。 Here, the difference value determination means 30 includes an average difference value calculation means 30a, a minimum difference value selection means 30b, and a difference value selection means 30c.
平均差分値演算手段30aは、基準映像FCの注目画素PCおよび仮定奥行値dごとに、対応画素差分演算手段20で演算された隣接映像の対応画素差分値ECL,ECRの平均値(平均差分値Ea)を演算するものである。
すなわち、平均差分値演算手段30aは、基準映像FCの(x,y)座標の仮定奥行値dに対応する平均差分値Ea(d,x,y)を、以下の(2)式の演算により算出する。
Ea(d,x,y)={ECL(d,x,y)+ECR(d,x,y)}/2
…(2)式
Average differential value calculating means 30a, for each pixel of interest P C and assumptions depth value d of the reference image F C, the corresponding pixel difference value E CL of the computed neighboring image at the corresponding pixel difference calculating unit 20, the average value of E CR (Average difference value Ea) is calculated.
That is, the average difference
Ea (d, x, y) = {E CL (d, x, y) + E CR (d, x, y)} / 2
... (2) formula
そして、平均差分値演算手段30aは、演算により求めた仮定奥行値d(“0”〜最大視差量)ごとの平均差分値Eaを、差分値選択手段30cに出力する。
Then, the average difference
最小差分値選択手段30bは、基準映像FCの注目画素PCおよび仮定奥行値dごとに、対応画素差分演算手段20で演算された隣接映像の対応画素差分値ECL,ECRのうちで、値が小さい方(最小差分値Em)を選択するものである。
すなわち、最小差分値選択手段30bは、基準映像FCの(x,y)座標の仮定奥行値dに対応する隣接映像の対応画素差分値ECL(d,x,y)と、隣接映像の対応画素差分値ECR(d,x,y)とを比較し、以下の(3)式に示すように、値が小さい方を最小差分値Emとして選択する。
Em(d,x,y)=min{ECL(d,x,y),ECR(d,x,y)}
…(3)式
Minimum difference
That is, the minimum difference
Em (d, x, y) = min {E CL (d, x, y), E CR (d, x, y)}
... (3) formula
そして、最小差分値選択手段30bは、選択した仮定奥行値d(“0”〜最大視差量)ごとの最小差分値Emを、差分値選択手段30cに出力する。
Then, the minimum difference
差分値選択手段30cは、基準映像FCの注目画素PCおよび仮定奥行値dごとに、近傍画素値出力手段15から入力された注目画素PCの画素値PC(x,y)と、近傍画素PSLの画素値PSL(x−s,y)と、近傍画素PSRの画素値PSR(x+s,y)と、近傍奥行値出力手段25から入力された近傍画素PSLの奥行値DLと、近傍画素PSRの奥行値DRとに基づいて、最小差分値選択手段30bから入力された最小差分値Em、平均差分値演算手段30aから入力された平均差分値Ea、最小差分値Emまたは平均差分値Eaに所定のペナルティ(加算値)を加えた値の何れかを、選択差分値として決定するものである。
Difference
ここで、図5〜図10を参照して、差分値選択手段30cの処理内容およびその作用として、第1例〜第6例を説明する。 Here, with reference to FIGS. 5-10, the 1st example-a 6th example are demonstrated as the processing content of the difference value selection means 30c, and its effect | action.
<第1例:オクルージョンが発生していない場合1>
以下、図5を参照して、ある仮定奥行値dにおいて、基準映像FCの画素(注目画素PC)と、隣接映像FL,FRの画素(対応画素PL,PR)とが背景Aに対応している場合(オクルージョンが発生していない場合1)の処理について説明する(適宜図2〜図4参照)。
<First example: No
Hereinafter, with reference to FIG. 5, at a certain assumed depth value d, the pixel of the reference image F C (target pixel P C ) and the pixels of the adjacent images F L and F R (corresponding pixels P L and P R ) A process when the background A is supported (when no occlusion occurs 1) will be described (see FIGS. 2 to 4 as appropriate).
まず、差分値選択手段30cは、注目画素PCの近傍には前景Bと背景Aの境界の有無、つまり、オクルージョンが発生しているか否かを判定する。具体的には、差分値選択手段30cは、以下の(4)式に示すような近傍画素PSLの奥行値DLと近傍画素PSRの奥行値DRとの奥行差分値DDが、閾値(第2の閾値)th1より大きくなるという条件を、満たさないか否かを判定する。
DD(x,y)=|DL(x−s,y)−DR(x+s,y)|>th1 …(4)式
First, the difference
D D (x, y) = | D L (x−s, y) −D R (x + s, y) |> th1 (4)
なお、閾値th1は、最大視差量(例えば、255)から最小視差量(例えば、1)を引いた値に所定の係数(例えば、0.2)を掛けた値として予め設定する。 The threshold th1 is set in advance as a value obtained by multiplying a value obtained by subtracting the minimum parallax amount (for example, 1) from the maximum parallax amount (for example, 255) by a predetermined coefficient (for example, 0.2).
さらに、差分値選択手段30cは、オクルージョンが発生していない場合、注目画素PCの画素値PC(x,y)と、近傍画素PSLの画素値PSL(x−s,y)と、近傍画素PSRの画素値PSR(x+s,y)とが、同じ被写体(背景A)に対応するため、似通った値となるか否かを判定する。具体的には、差分値選択手段30cは、以下の(5)式に示すような近傍画素PSLの画素値PSL(x−s,y)と、近傍画素PSRの画素値PSR(x+s,y)との画素差分値DPLRが閾値(第3の閾値)th2より大きくなるという条件を、満たさないか否かを判定する。
DPLR(x,y)=|PSL(x−s,y)−PSR(x+s,y)|>th2…(5)式
Furthermore, the difference
D PLR (x, y) = | P SL (x−s, y) −P SR (x + s, y) |> th2 (5)
なお、閾値th2は、最大画素値(例えば、255)に所定の係数(例えば、0.1)を掛けた値として予め設定する。 The threshold th2 is set in advance as a value obtained by multiplying the maximum pixel value (for example, 255) by a predetermined coefficient (for example, 0.1).
ここで、差分値選択手段30cは、同じ被写体Tでオクルージョンが生じていなくても、被写体Tの部位によって色が異なる場合や奥行きが異なる場合において、奥行値Dの誤推定を防止するために、(4)式と(5)式の組合せた判定を行う。そして、差分値選択手段30cは、(4)式または(5)式の何れか一方が成立しない場合、オクルージョンが生じていないと判定し、平均差分値Eaを選択差分値として選択する。
Here, the difference
<第2例:オクルージョンが発生している場合>
以下、図6を参照し、オクルージョンが発生しているが仮定奥行値dが正しい場合について説明する(適宜図2〜図4参照)。
<Second example: When occlusion occurs>
Hereinafter, a case where occlusion has occurred but the assumed depth value d is correct will be described with reference to FIG. 6 (see FIGS. 2 to 4 as appropriate).
この場合、差分値選択手段30cは、近傍画素PSLおよび近傍画素PSRの画素値が、互いに異なるか否かを判定する。具体的には、差分値選択手段30cは、前記した(5)式に示すように、近傍画素PSLの画素値PSL(x−s,y)と、近傍画素PSRの画素値PSR(x+s,y)との画素差分値DPLRが前記した閾値th2より大きくなるか否かを判定する。
In this case, the difference
そして、差分値選択手段30cは、前記した判定結果を確実なものとするため、前記した(4)式に示すように、近傍画素PSLの奥行値DLと近傍画素PSRの奥行値DRとの奥行差分値DDが、前記した閾値th1より大きくなるか否かを判定する。
Then, the difference
このように、差分値選択手段30cは、(4)式および(5)式の両方が成立する場合(オクルージョンが発生していると判定した場合)、近傍画素PSLの奥行値DLと近傍画素PSRの奥行値DRとを比較し、大きい側(図4の例ではDR側)に前景Bがあると判定する。なお、図4の例では、2回目の奥行推定の際、奥行値DRが奥行値DLより大きくなっている。
Thus, the difference
次に、差分値選択手段30cは、注目画素PCが、前景Bの画素であるか否かを判定する。具体的には、差分値選択手段30cは、以下の(6)式〜(8)式に示すように、注目画素PCの画素値PC(x,y)が、近傍画素PSLの画素値PSL(x−s,y)または近傍画素PSRの画素値PSR(x+s,y)のどちらに近いかを、注目画素PCと近傍画素PSL,PSRとの画素値の画素差分値DPL,DPRとから判定する。
DPL(x,y)=|PSL(x−s,y)−PC(x,y)| …(6)式
DPR(x,y)=|PSR(x+s,y)−PC(x,y)| …(7)式
DPL(x,y)≧DPR(x,y) …(8)式
Then, the difference
D PL (x, y) = | P SL (x−s, y) −P C (x, y) | (6) Expression D PR (x, y) = | P SR (x + s, y) −P C (x, y) | (7) Formula D PL (x, y) ≧ D PR (x, y) (8) Formula
前記した(8)式が成立しない場合(注目画素値PCが背景側に近い場合)、差分値選択手段30cは、この判定結果を確実なものとするため、以下の処理を行う。具体的には、差分値選択手段30cは、以下の(9)式に示すように、背景Aに近い近傍画素(図3の例ではPSL)の画素値と注目画素値PCとの画素値の画素差分値DPLが閾値(第4の閾値)th3より小さいか否かを判定する。これによって、差分値選択手段30cは、前記した(8)式が成立せずに注目画素PCが背景Aに近いという判定結果を確実なものとする。
DPL(x,y)<th3 …(9)式
なお、閾値th3は、最大画素値(例えば、255)に所定の係数(例えば0.1)を掛けた値(例えば、25)で予め設定する。
If above (8) is not satisfied (if the target pixel value P C is close to the background side), the difference
D PL (x, y) <th3 (9) Note that the threshold th3 is preset by a value (for example, 25) obtained by multiplying the maximum pixel value (for example, 255) by a predetermined coefficient (for example, 0.1). To do.
そして、差分値選択手段30cは、以下の(10)式に示すように、左側の対応画素差分値ECLが、右側の対応画素差分値ECRより十分小さいか否かを、左側の対応画素差分値ECLに係数(第3の係数)kを掛けても、右側の対応画素差分値ECRより小さいか否かによって判定する。これによって、差分値選択手段30cは、前記した(9)式が成立する(注目画素PCが背景Aにある)という判定結果を確実なものとする。
ECR(x,y)>k×ECL(x,y) …(10)式
Then, the difference
E CR (x, y)> k × E CL (x, y) (10)
なお、同じ被写体点同士での対応画素差分値は、その値が、カメラCMの感度ばらつき程度(例えば、1桁の値)になる。一方、異なる被写体での対応画素差分値は、非常に大きな値(例えば、100オーダー)になる。以上のように、対応画素差分値の差が10倍以上あると思われるので、係数kは、例えば、少し低めに8という値で予め設定する。 Note that the corresponding pixel difference value between the same subject points is about the sensitivity variation of the camera CM (for example, a one-digit value). On the other hand, the corresponding pixel difference value in a different subject is a very large value (for example, 100 order). As described above, since the difference between the corresponding pixel difference values seems to be 10 times or more, the coefficient k is set in advance at a value of 8, for example, slightly lower.
そして、差分値選択手段30cは、(10)式が成立する場合(左側の対応画素差分値ECLが右側の対応画素差分値ECRより十分小さい場合)、この小さい方の対応画素差分値ECL=最小差分値Emを選択差分値として選択する。
Then, the difference
<第3例:オクルージョンが発生していない場合2>
以下、図7を参照して、ある仮定奥行値dにおいて、基準映像FCの画素(注目画素PC)と、隣接映像FL,FRの画素(対応画素PL,PR)とが前景Bに対応している場合(オクルージョンが発生していない場合2)の処理について説明する(適宜図2〜図4参照)。
<Third example: No occlusion 2>
Hereinafter, with reference to FIG. 7, at a certain assumed depth value d, the pixel of the reference image F C (the target pixel P C ) and the pixels of the adjacent images F L and F R (corresponding pixels P L and P R ) A process when the foreground B is supported (when no occlusion occurs 2) will be described (see FIGS. 2 to 4 as appropriate).
前記した(8)式が成立する場合(注目画素値PCが前景側に近い場合)、差分値選択手段30cは、この判定結果を確実なものとするため、以下の処理を行う。具体的には、差分値選択手段30cは、以下の(11)式に示すように、近傍画素PSRと注目画素PCとの画素値の画素差分値DPRが、前記した閾値th3より小さいか否かを判定する。
DPR(x,y)<th3 …(11)式
If above (8) is established (when the target pixel value P C is closer to the foreground side), the difference
D PR (x, y) <th3 (11)
そして、差分値選択手段30cは、前記した(11)式が成立し、注目画素PCが前景Bの画素であると判定した場合、以下の(12)式に示すように、仮定奥行値dが前景B側の近傍奥行値DRより大きいか否かを判定する。
d(x,y)>DR(x+s,y) …(12)式
Then, the difference
d (x, y)> D R (x + s, y) (12)
(12)式が成立する場合(仮定奥行値dが大きい場合)、差分値選択手段30cは、平均差分値Eaに、前記した係数hを仮定奥行値dに掛けたペナルティ(加算値)p1を加算する。これによって、差分値選択手段30cは、大きすぎる奥行値Dが誤推定されることを防止できる。
When the equation (12) is satisfied (when the assumed depth value d is large), the difference
(12)式が成立しない場合(仮定奥行値dが大きくない場合)、差分値選択手段30cは、注目画素PCにオクルージョンが生じないので、平均差分値Eaを選択差分値として選択する。
(12) If the equation is not satisfied (if assumed depth value d is not greater), the difference
<第4例:仮定奥行値が正しくない場合1>
以下、図8を参照して、仮定奥行値dが正しくない場合1の処理について説明する(適宜図2〜図4参照)。ここで、図8に示すように、仮定奥行値dが大きすぎて、前景Bでない側の対応画素PLが前景B側に移動し、前景B側の対応画素PRが背景A側に移動している。
<Fourth example: When the assumed depth value is not correct 1>
Hereinafter, with reference to FIG. 8, the processing in the case where the assumed depth value d is not correct will be described (see FIGS. 2 to 4 as appropriate). Here, as shown in FIG. 8 moves, too large is assumed depth value d, the corresponding pixel P L Not foreground B side moves to the foreground B side, the corresponding pixel P R of the foreground B side in the background A side is doing.
前記した(10)式が成立しない場合、差分値選択手段30cは、仮定奥行値dが正しくないか否かを判定する。具体的には、差分値選択手段30cは、以下の(13)式に示すように、左側の対応画素差分値ECLが、右側の対応画素差分値ECRに係数kを掛けたものより大きいか否かで判定する。
ECL(x,y)>k×ECR(x,y) …(13)式
If the above equation (10) does not hold, the difference
E CL (x, y)> k × E CR (x, y) (13)
そして、差分値選択手段30cは、(13)式が成立する場合(仮定奥行値dが正しくない場合)、この大きな方の対応画素差分値ECLが含まれる平均差分値Eaを選択差分値として選択する。これによって、差分値選択手段30cは、誤った奥行値Dが推定されることを防止する。
Then, the difference
<第5例:仮定奥行値が正しくない場合2>
以下、図9を参照して、仮定奥行値dが正しくない場合2の処理について説明する(適宜図2〜図4参照)。ここで、図9に示すように、仮定奥行値dが大きすぎて前景Bの奥行値を示しているため、対応画素PL、PC、PRが全て背景Aにある。
<Fifth example: When the assumed depth value is not correct 2>
In the following, with reference to FIG. 9, the processing in the case where the assumed depth value d is not correct will be described (see FIGS. 2 to 4 as appropriate). Here, as shown in FIG. 9, there because it shows the depth value of the foreground B hypothetical depth value d is too large, the corresponding pixel P L, the P C, P R are all background A.
前記した(10)式および(13)式が成立しない場合、差分値選択手段30cは、対応画素PL、PC、PRが全て背景Aにあり、仮定奥行値dが正しくないと判定する。このとき、平均差分値Eaおよび最小差分値Emの両方とも大きくならないので、差分値選択手段30cは、平均差分値Eaに所定のペナルティ(加算値)pを加えた値を算出し、平均差分値Eaにペナルティpを加えた値を選択差分値として選択する。
If the above-mentioned (10) and (13) is not satisfied, the difference
なお、ペナルティpは、十分大きな固定値(例えば、100)で予め設定する。また、ペナルティpは、仮定奥行値dに係数(第2の係数)lを掛けた値としてもよい。さらに、係数lは、例えば、0.5または2という値で予め設定する。 The penalty p is set in advance with a sufficiently large fixed value (for example, 100). The penalty p may be a value obtained by multiplying the assumed depth value d by a coefficient (second coefficient) l. Furthermore, the coefficient l is preset with a value of 0.5 or 2, for example.
<第6例:左右でオクルージョンが発生している場合>
図10を参照して、左右でオクルージョンが発生している場合の処理について説明する(適宜図2〜図4参照)。ここで、図10に示すように、対応画素PL,PC,PRが、前景B、背景Aおよび中景Cにそれぞれ対応している。
<Sixth example: When occlusion occurs on the left and right>
With reference to FIG. 10, processing when occlusion occurs on the left and right will be described (see FIGS. 2 to 4 as appropriate). Here, as shown in FIG. 10, the corresponding pixel P L, P C, is P R, the foreground B, and correspond to the background A and Chukei C.
前記した(9)式または(11)式が成立しない場合、差分値選択手段30cは、注目画素PCが、右側にある前景Bと左側にある中景Cとの間にある背景Aに対応すると判定する。このとき、左右どちらのカメラCL,CRからも、正しい対応点が見えないので、正しい奥行値Dを推定できないことになる。このため、差分値選択手段30cは、奥行値Dをより正しい値に近づけるための処理を行う。すなわち、左側に中景Cがある場合には仮定奥行値dが小さくなり、仮定奥行値dが中景Cに近づくと、左側の対応画素PLは、背景Aを示すことになる。このとき、左側の対応画素差分値ECLは、右側の対応画素差分値ECRよりも小さくなる。
If above (9) or (11) is not satisfied, the difference
具体的には、差分値選択手段30cは、前記した(10)式により、左側の対応画素差分値ECLが右側の対応画素差分値ECRよりも十分小さくなるか否かを判定する。ここで、(10)式が成立しない場合、差分値選択手段30cは、背景Aが左右どちらのカメラCL,CRからも見えないと判定する。この場合、差分値選択手段30cは、その仮定奥行値dに前記した係数hを掛けた値をペナルティ(加算値)p1として算出する。その後、差分値選択手段30cは、平均差分値Eaにペナルティ(加算値)p1を加えた値を選択差分値として選択する。
Specifically, the difference
一方、(10)式が成立する場合、差分値選択手段30cは、仮定奥行値dが小さく、カメラCLから、前景Bと中景Cとの間を通して、背景Aの対応点でない点が見えていると判定する(擬似マッチングが生じている)。この場合、差分値選択手段30cは、次善の選択差分値として、その時の最小差分値Emにペナルティ(加算値)p1を加えた値を、選択差分値として選択する。
On the other hand, if (10) is established, the difference
その後、差分値選択手段30cは、選択した選択差分値を、仮定奥行値dと基準映像FCの画素位置とに対応付けて記憶手段40に書き込む。また、差分値決定手段30は、基準映像FCの全ての画素位置において、仮定奥行値dごとの選択差分値を記憶手段40に書き込んだ後に、書き込み完了を平滑化手段50に通知する。
Then, the difference
以上説明したように、差分値決定手段30は、仮定した奥行値(仮定奥行値d)が正しく、左右のカメラCL、CRから、正しい対応点が見えている場合、平均差分値Eaを選択する。これによって、後記する奥行値決定手段60において、正しい奥行値Dが推定される確率を高くすることができる。さらに、差分値決定手段30は、仮定奥行値dが正しくない場合の偽マッチングを防止することができる。 As described above, the difference value determination means 30, assumed depth value (assuming the depth value d) is correct, the left and right cameras C L, if the C R, the correct corresponding points are visible, the average differential value Ea select. Thereby, in the depth value determining means 60 described later, the probability that the correct depth value D is estimated can be increased. Furthermore, the difference value determining means 30 can prevent false matching when the assumed depth value d is not correct.
また、差分値決定手段30は、オクルージョンが発生していても、カメラCL、CRの片方から正しい対応点が見える場合、対応点が見えている側の差分絶対値である、最小差分値Emを選択することにより、正しい奥行値Dが推定される確率を高くすることができる。 Also, the difference value determination means 30, even if occlusion has occurred, when the camera C L, the correct corresponding points are visible from one C R, which is a difference absolute value of the side where the corresponding point is visible, the minimum difference value By selecting Em, the probability that the correct depth value D is estimated can be increased.
さらに、差分値決定手段30は、両方のカメラCL、CRからも正しい対応点が見えない場合、注目画素PCが背景A側にあると判定して、ペナルティp1を加算することで、正しい奥行値Dが推定される確率を高くすることができる。 Furthermore, the difference value determination means 30, both cameras C L, if the correct corresponding points from C R is not visible, the pixel of interest P C is determined to be in the background A side, by adding a penalty p1, The probability that the correct depth value D is estimated can be increased.
さらに、差分値決定手段30は、オクルージョンと偽マッチングとが同時に発生している場合、ペナルティp,p1を加えることで、正しい奥行値Dが推定される確率を高くすることができる。このように、差分値決定手段30が選択した選択差分値は、仮定奥行値dが正しいことを示す指標として用いることができる。
Furthermore, when the occlusion and the false matching occur at the same time, the difference value determining means 30 can increase the probability that the correct depth value D is estimated by adding the penalties p and p1. As described above, the selected difference value selected by the difference
なお、差分値選択手段30cは、1回目の奥行推定では、最小差分値Emを選択差分値として選択してもよい。これによって、オクルージョンが生じている画素でも、正しい奥行値Dが1回目で求まりやすくなる。また、オクルージョンが生じていない画素では、奥行値Dがやや不正確な値となる。このため、2回目以降の奥行推定で、差分値選択手段30cが前記した処理を行い、正しい奥行値Dを求めてもよい。
The difference
図2に戻って、奥行推定装置1の構成について説明を続ける。
記憶手段40は、差分値決定手段30で決定された差分値を、仮定奥行値dと基準映像の画素位置とに対応付けて記憶するものである。例えば、記憶手段40は、磁気メモリや半導体メモリ等の一般的な記憶媒体である。
Returning to FIG. 2, the description of the configuration of the
The storage unit 40 stores the difference value determined by the difference
平滑化手段50は、当該画素位置における差分値を平滑化するものである。まず、平滑化手段50は、基準映像の画素位置(x,y)およびその画素位置での仮定奥行値dごとに、以下の(14)式および(15)式に示すように、注目画素PC(x,y)に隣接する画素位置(x+1,y)、(x,y+1)での選択差分値EX(x+1,y)、EY(x,Y+1)の最小値を探索する。そして、平滑化手段50は、その仮定奥行値dを隣接画素の奥行値候補D(x+1,y)、D(x,y+1)とする。
D(x+1,y)=(x+1,y)座標の差分値最小の仮定奥行値 …(14)式
D(x,y+1)=(x,y+1)座標の差分値最小の仮定奥行値 …(15)式
The smoothing means 50 smoothes the difference value at the pixel position. First, as shown in the following formulas (14) and (15), the smoothing
D (x + 1, y) = (x + 1, y) coordinate difference value minimum assumed depth value (14) Expression D (x, y + 1) = (x, y + 1) coordinate difference value minimum assumed depth value (15) )formula
次に、平滑化手段50は、以下の(16)式に示すように、基準映像の画素位置(x,y)およびその画素位置での仮定奥行値dごとに、その選択差分値E(d,x,y)に、隣接画素位置(x+1,y)、(x,y+1)における奥行値候補D(x+1,y)、D(x,y+1)と仮定奥行値d(x,y)との差分絶対値に平滑化係数Wを掛けて加算する。
Ev(d,x,y)=E(d,x,y)+W{|D(x+1,y)−d(x,y)|
+|D(x,y+1)−d(x,y)|} …(16)式
Next, as shown in the following equation (16), the smoothing
Ev (d, x, y) = E (d, x, y) + W {| D (x + 1, y) -d (x, y) |
+ | D (x, y + 1) -d (x, y) |} (16) Formula
なお、平滑化係数Wは、任意の値(例えば、2)で予め設定する。このとき、平滑化係数Wの値を大きくする程、選択差分値が滑らかになるが、被写体Tの境界部分の奥行値を誤推定する可能性が高くなる。このため、平滑化係数Wは、適切な値に設定することが好ましい。
また、図示を省略した入力手段を介して、外部から平滑化係数Wを入力してもよい。
The smoothing coefficient W is set in advance with an arbitrary value (for example, 2). At this time, the larger the value of the smoothing coefficient W, the smoother the selected difference value, but the higher the possibility of erroneously estimating the depth value of the boundary portion of the subject T. For this reason, it is preferable to set the smoothing coefficient W to an appropriate value.
Further, the smoothing coefficient W may be input from the outside via an input unit (not shown).
平滑化手段50は、当該画素位置における選択差分値を平滑化し、平滑化された平滑化差分値Ev(d,x,y)を得ることができる。このように、一様な被写体Tの画素位置で奥行値Dが隣接画素間で大きく異なる場合、大きなペナルティが選択差分値に加算されるので、平滑化差分値Evは、もとの選択差分値が小さく、かつ、隣接画素との奥行値Dの差が小さい選択差分値が最小となるため、推定した奥行値Dが滑らかに連続するようになる。
なお、平滑化手段50は、差分値決定手段30から、基準映像の全ての画素位置において、全ての仮定奥行値dの選択差分値を書き込んだ旨(書き込み完了)を通知されることで動作を開始する。
The smoothing means 50 can smooth the selected difference value at the pixel position and obtain a smoothed smoothed difference value Ev (d, x, y). In this way, when the depth value D is greatly different between adjacent pixels at the pixel position of the uniform subject T, a large penalty is added to the selection difference value, so that the smoothing difference value Ev is the original selection difference value. Since the selection difference value having a small difference between the adjacent pixels and the depth value D is minimum, the estimated depth value D is smoothly continuous.
The smoothing
このように、選択差分値に、隣接する画素の奥行値候補Dとの差分を重み付け加算することで、隣接する各画素の奥行値Dが平滑化されることになる。これによって、隣接画素間において、選択差分値が最小となる奥行値Dが、オクルージョンや偽マッチング等で互いに異なる場合であっても、滑らかな奥行値Dを得ることができる。 Thus, the depth value D of each adjacent pixel is smoothed by weighting and adding the difference from the depth value candidate D of the adjacent pixel to the selected difference value. As a result, a smooth depth value D can be obtained even when the depth values D at which the selection difference value is minimum between adjacent pixels are different from each other due to occlusion or false matching.
この平滑化手段50は、平滑化差分値Evが最小となる奥行値候補Dを、記憶手段40に書き込む。その後、平滑化手段50は、奥行値決定手段60に平滑化完了を通知する。 The smoothing means 50 writes the depth value candidate D that minimizes the smoothing difference value Ev in the storage means 40. Thereafter, the smoothing means 50 notifies the depth value determining means 60 of the completion of smoothing.
奥行値決定手段60は、以下の(17)式に示すように、仮定奥行値dと基準映像の画素位置とに対応付けて記憶手段40に記憶されている平滑化された選択差分値について、画素位置(x,y)ごとに、平滑化差分値Ev(x,y)が最小となる仮定奥行値d(x,y)を探索し、当該画素位置における奥行値D(x,y)とする。
D(x,y)=(x,y)座標の平滑化差分値Ev(x,y)最小の奥行値
…(17)式
As shown in the following equation (17), the depth
D (x, y) = (x, y) coordinate smoothing difference value Ev (x, y) minimum depth value (17)
このように、奥行値決定手段60は、全ての画素位置において、平滑化差分値Evが最小となる仮定奥行値dを奥行値Dとして決定する。そして、奥行値決定手段60は、被写体Tの奥行値Dを推定した奥行映像FZを生成する。
なお、この奥行値決定手段60は、平滑化手段50から、選択差分値の平滑化が完了した旨(平滑化完了)を通知されることで動作を開始するものとする。
Thus, the depth
The depth
以上説明したように、奥行推定装置1は、選択差分値を指標として、被写体Tの奥行値Dを推定することができる。
なお、奥行推定装置1は、1回目の奥行推定で決定した奥行値Dを用いて、2回目以降の奥行推定を行ってもよい。そして、奥行推定装置1は、奥行推定をN回繰り返した後に得られた奥行値Dから奥行映像FZを生成してもよい。
As described above, the
In addition, the
〔奥行推定装置の動作〕
以下、図11〜図16を参照して、図2の奥行推定装置1の動作について説明する(適宜図1,2参照)。ここでは、図11を参照して、奥行推定装置1の全体動作について説明し、詳細な説明については、図12〜図16を参照して説明を行うことにする。
なお、図11〜図16では、平均差分値Eaを平均値および最小差分値Emを最小値と略記している。
[Operation of depth estimation device]
Hereinafter, the operation of the
11 to 16, the average difference value Ea is abbreviated as an average value and the minimum difference value Em is abbreviated as a minimum value.
(全体動作)
最初に、図11を参照して、奥行推定装置1の全体動作について説明する。
奥行推定装置1は、奥行推定回数を示すカウンタn=1とし、全ての画素の奥行値D=0として、初期設定を行う。そして、奥行推定装置1は、映像入力手段10によって、一直線上に等間隔で水平に配置したカメラ(基準カメラCC、隣接カメラCL,CR)より、同一の被写体Tを撮影したカメラ映像(基準映像FC,隣接映像FL,FR)を入力する(ステップS1)。
(Overall operation)
Initially, with reference to FIG. 11, the whole operation | movement of the
The
そして、奥行推定装置1は、近傍画素値出力手段15によって、注目画素PCの画素値PC(x,y)と、注目画素PCから所定画素数sだけ左に離れた近傍画素PSLの画素値PSL(x-s,y)と、注目画素PCから所定の画素数sだけ右に離れた近傍画素PSRの画素値PSR(x+s,y)とを出力する(ステップS2;近傍画素値出力動作)。
The
そして、奥行推定装置1は、対応画素差分演算手段20によって、仮定奥行値dおよび注目画素PCごとに、基準映像FCの注目画素PCの画素値と、当該注目画素PCの仮定奥行値dの視差に対応する隣接映像FL,FRの対応画素の画素値との差分絶対値である隣接映像の対応画素差分値ECL,ECRを演算する(ステップS3;対応画素差分演算動作)。このステップS3の動作については、図12を参照して後で説明を行う。
The
そして、奥行推定装置1は、差分値決定手段30によって、仮定奥行値dおよび注目画素PCごとに、最小差分値Em、平均差分値Ea、最小差分値Emまたは平均差分値Eaに所定のペナルティ(加算値)を加えた値の何れかを、選択差分値として決定し、記憶手段40に記憶する(ステップS4;差分値決定動作)。このステップS4の動作については、図13,図14を参照して後で説明を行う。
The
そして、奥行推定装置1は、平滑化手段50によって、基準映像FCの全ての(x,y)座標の全ての仮定奥行値dに対応して記憶された選択差分値を平滑化する(ステップS5;平滑化動作)。このステップS5の動作については、図15を参照して後で説明を行う。
Then, the
そして、奥行推定装置1は、奥行値決定手段60によって、画素位置(x,y)ごとに、平滑化された差分値が最小となる奥行値候補Dを探索し、当該画素位置の奥行値Dを決定する(ステップS6;奥行値決定動作)。このステップS6の動作については、図16を参照して後で説明を行う。
Then, the
そして、奥行推定装置1は、カウンタnが繰返回数Nと等しいか判定する(ステップS7)。カウンタnが繰返回数Nと等しくない場合(ステップS7でNo)、奥行推定装置1は、ステップS8の処理に進む。
Then, the
そして、奥行推定装置1は、近傍奥行値出力手段25によって、近傍画素PSLの奥行値DLと、近傍画素PSRの奥行値DRとを差分値決定手段30に出力する(ステップS8;近傍奥行値出力動作)。
その後、奥行推定装置1は、カウンタnをインクリメントし(ステップS9)、ステップS1の処理に戻る。
The
Thereafter, the
一方、カウンタnが繰り返し回数Nと等しい場合(ステップS7でYes)、奥行推定装置1は、奥行値決定手段60によって、N回繰り返した後に得られた奥行値Dを、奥行き映像として出力する。
以上の動作によって、奥行推定装置1は、複数のカメラ映像から、被写体Tの奥行きを示す奥行値Dを推定する。
On the other hand, if the counter n is equal to the number of repetitions N (Yes in step S7), the
With the above operation, the
(対応画素差分演算動作)
次に、図12を参照して、対応画素差分演算動作(図11のステップS3)について詳細に説明する。
(Corresponding pixel difference calculation operation)
Next, the corresponding pixel difference calculation operation (step S3 in FIG. 11) will be described in detail with reference to FIG.
まず、奥行推定装置1は、変数として、仮定奥行値d、カメラ映像(基準映像FC,隣接映像FL,FR)のx座標値およびy座標値を初期化(d=0、x=0、y=0)する(ステップS10)。
First, the
そして、対応画素差分演算手段20は、基準映像FCの注目画素PCの画素値と、当該注目画素PCの仮定奥行値dの視差に対応する隣接映像FL,FRの対応画素の画素値との差分絶対値である対応画素差分値ECL,ECRを前記した(1)式により演算する。
Then, the corresponding pixel
すなわち、対応画素差分演算手段20は、基準映像FCの中の注目画素値PC(x,y)に対し、隣接映像FLの画素位置を右にd画素移動した位置の対応画素値PL(x+d,y)との差分絶対値である対応画素差分値ECL(d,x,y)を演算する。
また、対応画素差分演算手段20は、基準映像FCの中の注目画素値PC(x,y)に対し、隣接映像FRの画素位置をd画素左に移動した位置の対応画素値PR(x−d,y)との差分絶対値である対応画素差分値ECR(d,x,y)を演算する(ステップS11)。
That is, the corresponding pixel difference calculating means 20, the reference image F target pixel value P C (x, y) in the C to the corresponding pixel value P of the moving d pixel pixel positions to the right of the neighboring image F L position A corresponding pixel difference value E CL (d, x, y), which is an absolute difference value from L (x + d, y), is calculated.
Further, the corresponding pixel difference calculating means 20, the target pixel value P C (x, y) in the reference image F C to the adjacent image F corresponding pixel value of the position of the pixel position moves to the left d pixels R P A corresponding pixel difference value E CR (d, x, y), which is an absolute difference value from R (x−d, y), is calculated (step S11).
そして、対応画素差分演算手段20は、被写体Tにおいて注目画素PCの近傍が黒い背景であるか否かを判定する。すなわち、対応画素差分演算手段20は、近傍画素値出力手段15から入力された注目画素PCの画素値PC(x,y)と、近傍画素PSLの画素値PSL(x−s,y)と、近傍画素PSRの画素値PSR(x+s,y)との全てが閾値thより小さいか否かを判定する(ステップS12)。
Then, the corresponding pixel
全ての値が閾値thより小さい場合(ステップS12でYes)、対応画素差分演算手段20は、黒背景フラグがオンまたはオフであるかを判定する(ステップS13)。
When all the values are smaller than the threshold th (Yes in Step S12), the corresponding pixel
黒背景フラグがオンの場合(ステップS13でYes)、対応画素差分演算手段20は、前記した(1−1)式のように、仮定奥行値dに係数hを掛けた値(ペナルティ)を、対応画素差分値ECL,ECRに加算する(ステップS14)。
When the black background flag is on (Yes in step S13), the corresponding pixel
黒背景フラグがオフの場合(ステップS13でNo)、対応画素差分演算手段20は、前記した(1−2)式のように、大きい方の近傍奥行値DMと仮定奥行値dとの差分絶対値に係数hを掛けた値(ペナルティ)を、対応画素差分値ECL,ECRに加算する(ステップS15)。
If Black Background flag is off (No in step S13), and the corresponding pixel
一方、全ての値が閾値thより小さくならない場合(ステップS12でNo)、対応画素差分演算手段20は、ステップS16−1の処理に進む。
On the other hand, when all the values are not smaller than the threshold th (No in step S12), the corresponding pixel
その後、奥行推定装置1は、変数である仮定奥行値d、カメラ映像のx座標値、y座標値を順次加算(インクリメント)し、仮定奥行値dについては最大視差量になるまで(ステップS16−1,16−2)、x座標値についてはカメラ映像の幅になるまで(ステップS17−1,S17−2)、y座標値についてはカメラ映像の高さになるまで(ステップS18−1,S18−2)、前記した動作を繰り返す。
Thereafter, the
(差分値決定動作)
以下、図13,図14を参照して、差分値決定動作(図11のステップS4)について詳細に説明する(適宜図2,図5〜図10参照)。
まず、奥行推定装置1は、変数として、仮定奥行値d、カメラ映像のx座標値およびy座標値をそれぞれ初期化(d=0、x=0、y=0)する(ステップS20)。
(Differential value determination operation)
Hereinafter, the difference value determining operation (step S4 in FIG. 11) will be described in detail with reference to FIGS. 13 and 14 (see FIGS. 2 and 5 to 10 as appropriate).
First, the
平均差分値演算手段30aは、前記した(2)式により、隣接映像の対応画素差分値ECL,ECRの平均差分値Eaを演算する。
最小差分値選択手段30bは、前記した(3)式により、隣接映像の対応画素差分値ECLと隣接映像の対応画素差分値ECRとの最小値を最小差分値Emとして選択する。
差分値選択手段30cは、前記した(4)式〜(7)式により、奥行差分値DD、画素差分値DPLR,DPL,DPRを演算する(ステップS21)。
The average difference
Minimum difference
The difference value selection means 30c calculates the depth difference value D D and the pixel difference values D PLR , D PL , D PR by the above-described equations (4) to (7) (step S21).
差分値選択手段30cは、カウンタn=1であるか否か、つまり、1回目の奥行推定であるか否かを判定する(ステップ22)。
1回目の奥行推定の場合(ステップ22でYes)、差分値選択手段30cは、ステップ32の処理に進む。
一方、2回目以降の奥行推定の場合(ステップ22でNo)、差分値選択手段30cは、ステップ23の処理に進む。
The difference value selection means 30c determines whether or not the counter n = 1, that is, whether or not it is the first depth estimation (step 22).
In the case of the first depth estimation (Yes in Step 22), the difference
On the other hand, in the case of depth estimation for the second and subsequent times (No in step 22), the difference
以下、差分値選択手段30cは、ステップS23からステップS43までの処理によって、対応画素差分値ECL、ECRと、ステップS21で演算した奥行差分値DD、画素差分値DPLR,DPL,DPRとに基づいて、選択差分値を選択する。
Hereinafter, the difference
差分値選択手段30cは、前記した(4)式および(5)式により、オクルージョンが発生しているか否かを判定する(ステップS23)。
(4)式または(5)式の何れかを満たさない場合(ステップS23でNo;被写体境界無)、差分値選択手段30cは、平均差分値Eaを選択差分値として選択し、記憶手段40に記憶する(ステップS24)。
The difference value selection means 30c determines whether or not occlusion has occurred according to the above equations (4) and (5) (step S23).
When either of the formulas (4) and (5) is not satisfied (No in step S23; no subject boundary), the difference
(4)式および(5)式の両方を満たす場合(ステップS23でYes;被写体境界有)、差分値選択手段30cは、奥行値DL,DRを大小比較し、大きい側に前景Bがあると判定する(ステップS25)。
(4) If both of the formulas and (5) (Yes in step S23; subject boundary Yes), the difference
右側に前景Bがある場合(ステップS25でYes)、差分値選択手段30cは、前記した(8)式により、注目画素PCが前景B上の画素であるか否かを判定する(ステップS26)。
If the right side has a foreground B (Yes in step S25), and the difference
注目画素PCが前景B上の画素である場合(ステップS26でYes)、差分値選択手段30cは、画素差分値DPRが閾値th3より小さいか否かを判定する(ステップS27)。
If the pixel of interest P C is a pixel on the foreground B (Yes in step S26), the difference
注目画素PCが前景B上の画素である場合(ステップS27でYes)、差分値選択手段30cは、(12)式により、仮定奥行値dが前景B側の近傍奥行値DRより大きいか否かを判定する(ステップS28)。
If the pixel of interest P C is a pixel on the foreground B (Yes in step S27), the difference
仮定奥行値dが前景B側の近傍奥行値DRより大きい場合(ステップS28でYes)、差分値選択手段30cは、平均差分値Eaにペナルティp1を加え(ステップS29)、記憶手段40に記憶する(ステップS24)。
When assuming the depth value d is greater than the proximity depth value D R of the foreground B side (Yes in step S28), the difference
仮定奥行値dが前景B側の近傍奥行値DRより大きくない場合(ステップS28でNo)、差分値選択手段30cは、仮定奥行値dが正しく、注目画素PCにオクルージョンが発生していないので、平均差分値Eaを選択差分値として選択し、記憶手段40に記憶する(ステップS24)。
When assuming the depth value d is not greater than the proximity depth value D R of the foreground B side (No in step S28), the difference
注目画素PCが背景A上の画素である場合(ステップS26でNo)、差分値選択手段30cは、画素差分値DPLが閾値th3より小さいか否かを判定する(ステップS30)。
If the pixel of interest P C is a pixel on the background A (No in step S26), the difference
注目画素PCが背景A上にある場合(ステップS30でYes)、差分値選択手段30cは、前記した(10)式に示すように、左側の対応画素差分値ECLが、右側の対応画素差分値ECRより十分小さいか否かを、左側の対応画素差分値ECLに係数kを掛けても、右側の対応画素差分値ECRより小さいか否かによって判定する(ステップS31)。
If the pixel of interest P C is on the background A (Yes in step S30), the difference
左側の対応画素差分値ECLが右側の対応画素差分値ECRより十分小さい場合(ステップS31でYes)、差分値選択手段30cは、この小さい方の対応画素差分値ECL=最小差分値Emを選択差分値として選択する(ステップ32)。
If left corresponding pixel difference value E CL is sufficiently smaller than the right of the corresponding pixel difference value E CR (Yes in step S31), the difference
左側の対応画素差分値ECLが右側の対応画素差分値ECRより十分小さくない場合(ステップS31でNo)、差分値選択手段30cは、仮定奥行値dが正しくないと判定する。この場合、差分値選択手段30cは、仮定奥行値dが大きいか否かを、左側の対応画素差分値ECLが右側の対応画素差分値ECRに係数kを掛けたものより大きいか否かで判定する(ステップS33)。
If left corresponding pixel difference value E CL is not sufficiently smaller than the right side of the corresponding pixel difference value E CR (No in step S31), the difference
仮定奥行値dが大きい場合(ステップS33でYes)、差分値選択手段30cは、この大きな方の対応画素差分値ECLを含む平均差分値Eaを選択差分値として選択し、記憶手段40に記憶する(ステップS24)。
When assuming the depth value d is greater (Yes in step S33), the difference
仮定奥行値dが大きくない場合(ステップS33でNo)、差分値選択手段30cは、対応画素PL、PC、PRが全て背景A上にあり、仮定奥行値dが正しくないと判定する。この場合、差分値選択手段30cは、平均差分値Eaも最小差分値Emも大きくならないので、平均差分値Eaにペナルティpを加えた値を選択差分値として選択し、記憶手段40に記憶する(ステップS34)。
When assuming the depth value d is not greater (No in step S33), the difference
注目画素PCが前景B上の画素でない場合(ステップS27でNo)、または、注目画素PCが背景A上でない場合(ステップS30でNo)、差分値選択手段30cは、注目画素PCが右側にある前景Bと左側にある中景Cの中間にある背景Aに対応すると判定する。この場合、左右どちらのカメラCL,CRからも、正しい対応点が見えないので、正しい奥行値Dを推定できないことになる。このため、差分値選択手段30cは、前記した(10)式により、左側の対応画素差分値ECLが右側の対応画素差分値ECRよりも十分小さくなるか否かを判定する(ステップS35)。
If the pixel of interest P C is not a pixel on the foreground B (No in step S27), or, when the target pixel P C is not on the background A (No in step S30), the difference
左側の対応画素差分値ECLが右側の対応画素差分値ECRよりも十分小さい場合(ステップS35でYes)、差分値選択手段30cは、その時の最小差分値Emにペナルティp1を加えた値を算出し(ステップS36)、選択差分値として記憶手段40に記憶する(ステップS32)。
If left corresponding pixel difference value E CL is sufficiently smaller than the right of the corresponding pixel difference value E CR (Yes in step S35), the difference
左側の対応画素差分値ECLが右側の対応画素差分値ECRよりも十分小さくない場合(ステップS35でNo)、差分値選択手段30cは、背景Aが左右どちらのカメラCL,CRからも見えないと判定する。この場合、差分値選択手段30cは、推定される奥行値Dをより正しい値に近づけるために、平均差分値Eaにペナルティp1を加えた値を算出し(ステップS29)、記憶手段40に記憶する(ステップS24)。
If left corresponding pixel difference value E CL is not sufficiently smaller than the right of the corresponding pixel difference value E CR (No in step S35), the difference
左側に前景Bがある場合(ステップS25でNo)、差分値選択手段30cは、注目画素PCが、前景の被写体上の画素であるか否かを、以下の(18)式により判定する(ステップS37)。
DPL(x,y)≦DPR(x,y) …(18)式
If the left there is a foreground B (No in step S25), and the difference
D PL (x, y) ≦ D PR (x, y) (18)
画素差分値DPLが画素差分値DPR以下の場合(ステップS37でYes、注目画素PCが前景側)、差分値選択手段30cは、画素差分値DPLが閾値th3より小さいか否かを判定する(ステップS38)。
If the pixel difference value D PL is less than the pixel difference value D PR (at step S37 Yes, the pixel of interest P C is the foreground side), the difference
注目画素PCが前景B上の画素にある場合(ステップS38でYes)、差分値選択手段30cは、以下の式(19)により、仮定奥行値dが前景B側の近傍奥行値DLより大きくないか否かを判定する(ステップS39)。
d(x,y)>DL(x−s,y) …(19)式
If the pixel of interest P C is in the pixels on the foreground B (Yes in step S38), the difference
d (x, y)> D L (x−s, y) (19)
仮定奥行値dが前景B側の近傍奥行値DLより大きい場合(ステップS39でYes)、差分値選択手段30cは、平均差分値Eaにペナルティp1を加えた値を算出し(ステップS29)、記憶手段40に記憶する(ステップS24)。
When assuming the depth value d is greater than the proximity depth value D L foreground B side (Yes in step S39), the difference
仮定奥行値dが前景B側の近傍奥行値DLより大きくない場合(ステップS39でNo)、差分値選択手段30cは、仮定奥行値dが正しく、注目画素PCにオクルージョンが発生していないので、平均差分値Eaを選択差分値として選択し、記憶手段40に記憶する(ステップS24)。
When assuming the depth value d is not greater than the proximity depth value D L foreground B side (No in step S39), the difference
画素差分値DPLが画素差分値DPR以下でない場合(ステップS37でNo、注目画素PCが背景側)、差分値選択手段30cは、画素差分値DPRが閾値th3より小さいか否かを判定する(ステップS40)。
If the pixel difference value D PL is not less than the pixel difference value D PR (No in step S37, the pixel of interest P C background side), the difference
画素差分値DPRが閾値th3より小さい場合(ステップS40でYes)、差分値選択手段30cは、右側の対応画素差分値ECRが、左側の対応画素差分値ECLより十分小さいか否かを、右側の対応画素差分値ECRに係数kを掛けても、左側の対応画素差分値ECLより小さいか否かによって判定する(ステップS41)。
If the pixel difference value D PR threshold th3 less (Yes in step S40), the difference
右側の対応画素差分値ECRが左側の対応画素差分値ECLより十分小さい場合(ステップS41でYes)、差分値選択手段30cは、この小さい方の最小差分値Em=対応画素差分値ECRを選択差分値として選択し、記憶手段40に記憶する(ステップS32)。
If the right of the corresponding pixel difference value E CR is sufficiently smaller than the corresponding pixel difference value E CL of the left (Yes in step S41), the difference
右側の対応画素差分値ECRが左側の対応画素差分値ECLより十分小さくない場合(ステップS41でNo)、差分値選択手段30cは、仮定奥行値dが正しくないと判定する。この場合、差分値選択手段30cは、仮定奥行値dが大きいか否かを、右側の対応画素差分値ECRが、左側の対応画素差分値ECLに係数kを掛けたものより大きいか否かによって判定する(ステップS42)。
If the right of the corresponding pixel difference value E CR is not sufficiently smaller than the corresponding pixel difference value E CL of the left (No at step S41), the difference
仮定奥行値dが大きい場合(ステップS42でYes)、差分値選択手段30cは、この大きな方の対応画素差分値ECRを含む平均差分値Eaを選択差分値として選択し、記憶手段40に記憶する(ステップS24)。
When assuming the depth value d is greater (Yes in step S42), the difference
仮定奥行値dが大きくない場合(ステップS42でNo)、差分値選択手段30cは、対応画素PL、PC、PRが全て背景A上にあり、仮定奥行値dが正しくないと判定する。この場合、差分値選択手段30cは、平均差分値Eaも最小差分値Emも大きくならないので、平均差分値Eaにペナルティpを加えた値を算出し、記憶手段40に記憶する(ステップS34)。
When assuming the depth value d is not greater (No in step S42), the difference
注目画素PCが前景B上の画素でない場合(ステップS38でNo)、または、注目画素PCが背景A上の画素でない場合(ステップS40でNo)、差分値選択手段30cは、注目画素PCが左側にある前景Bと右側にある中景Cとの中間にある背景Aに対応すると判定する。この場合、左右どちらのカメラCL,CRからも、正しい対応点は見えないので、正しい奥行値Dを推定できないことになる。このため、差分値選択手段30cは、前記した(13)式により、右側の対応画素差分値ECRが左側の対応画素差分値ECLより十分小さくなるか否かを判定する(ステップS43)。
If the pixel of interest P C is not a pixel on the foreground B (No in step S38), or, when the target pixel P C is not a pixel on the background A (No in step S40), the difference
右側の対応画素差分値ECRが左側の対応画素差分値ECLより十分小さい場合(ステップS43でYes)、差分値選択手段30cは、その時の最小差分値Emである右側の対応画素差分値ECRにペナルティp1を加えた値を算出し(ステップS36)、記憶手段40に記憶する(ステップS32)。
If the right of the corresponding pixel difference value E CR is sufficiently smaller than the corresponding pixel difference value E CL of the left (Yes in step S43), the difference
右側の対応画素差分値ECRが左側の対応画素差分値ECLより十分小さくない場合(ステップS43でNo)、差分値選択手段30cは、背景Aが左右どちらのカメラCL,CRからも見えないと判定する。この場合、差分値選択手段30cは、平均差分値Eaにペナルティp1を加えた値を算出し(ステップS29)、記憶手段40に記憶する(ステップS24)。
If the right of the corresponding pixel difference value E CR is not sufficiently smaller than the corresponding pixel difference value E CL of the left (No at step S43), the difference
その後、奥行推定装置1は、変数である仮定奥行値d、カメラ映像のx座標値、y座標値を順次加算(インクリメント)し、仮定奥行値dについては最大視差量になるまで(ステップS44,S45)、x座標値についてはカメラ映像の幅になるまで(ステップS46,S47)、y座標値についてはカメラ映像の高さになるまで(ステップS48,S49)、ステップS21からステップS43までの動作を繰り返す。
この差分値決定動作によって、記憶手段40には、基準映像の画素位置(x,y)ごとに、複数の仮定奥行値d(“0”〜最大視差量)に対応した差分値Eが記憶される。
Thereafter, the
By this difference value determination operation, the storage means 40 stores difference values E corresponding to a plurality of assumed depth values d (“0” to the maximum parallax amount) for each pixel position (x, y) of the reference image. The
なお、差分値決定手段30は、基準映像の全ての画素位置において、仮定奥行値dごとの選択差分値を記憶手段40に書き込んだ後に、書き込み完了を平滑化手段50に通知する。
The difference
(平滑化動作)
以下、図15を参照して、平滑化動作(図11のステップS5)の動作について詳細に説明する。
(Smoothing operation)
Hereinafter, the smoothing operation (step S5 in FIG. 11) will be described in detail with reference to FIG.
まず、奥行推定装置1は、変数として、仮定奥行値d、カメラ映像(基準映像FC,隣接映像FL,FR)のx座標値およびy座標値を初期化(d=0、x=0、y=0)する(ステップS60)。
First, the
そして、平滑化手段50は、記憶手段40に記憶されている基準映像FCの(x,y)座標に隣接する座標において、仮定奥行値dの中で選択差分値が最小となる仮定奥行値dを隣接画素の奥行値候補Dとして探索する。
Then, the smoothing
すなわち、平滑化手段50は、基準映像FCの(x,y)座標に隣接する、(x+1,y)座標の差分値が最小となる仮定奥行値d(x+1,y)と、(x,y+1)座標の差分値が最小となる仮定奥行値d(x,y+1)を探索し、隣接画素の奥行値候補D(x+1,y)、D(x,y+1)とする(ステップS61)。 In other words, the smoothing means 50 has an assumed depth value d (x + 1, y) adjacent to the (x, y) coordinate of the reference image F C and having a minimum difference value of (x + 1, y) coordinates, and (x, y). A hypothetical depth value d (x, y + 1) that minimizes the difference value of the (y + 1) coordinate is searched for as depth value candidates D (x + 1, y) and D (x, y + 1) of adjacent pixels (step S61).
そして、平滑化手段50は、前記した(16)式のように、記憶手段40に記憶されている基準映像FCの(x,y)座標の奥行値候補Dに対応する選択差分値E(d,x,y)に、注目画素PCの仮定奥行値dと隣接画素の奥行値候補D(x+1,y),D(x,y+1)との差を、注目画素PCの差分値に重み付け加算することで、平滑化した差分値Ev(d,x,y)を演算する(ステップS62)。
Then, the smoothing
その後、奥行推定装置1は、変数である仮定奥行値d、カメラ映像のx座標値、y座標値を順次加算(インクリメント)し、仮定奥行値dについては最大視差量になるまで(ステップS63,S64)、x座標値についてはカメラ映像の幅になるまで(ステップS65,S66)、y座標値についてはカメラ映像の高さになるまで(ステップS67,S68)、ステップS61からステップS62までの動作を繰り返す。
この平滑化動作によって、記憶手段40には、基準映像の画素位置(x,y)ごとに、平滑化差分値Evが記憶される。
Thereafter, the
By this smoothing operation, the smoothing difference value Ev is stored in the storage unit 40 for each pixel position (x, y) of the reference image.
(奥行値決定動作)
以下、図16を参照して、奥行値決定動作(図11のステップS6)の動作について詳細に説明する。
(Depth value determination operation)
Hereinafter, the depth value determining operation (step S6 in FIG. 11) will be described in detail with reference to FIG.
まず、奥行推定装置1は、変数として、カメラ映像のx座標値、y座標値をそれぞれ初期化(x=y=0)する(ステップS70)。
そして、奥行値決定手段60は、記憶手段40に記憶されている平滑化差分値Evについて、画素位置(x,y)ごとに、平滑化された差分値Evが最小となる仮定奥行値dを探索し、探索された仮定奥行値dが、画素位置(x,y)における被写体Tの奥行値D(x,y)として決定(記憶・出力)する(ステップS71)。
First, the
Then, the depth
その後、奥行推定装置1は、変数であるカメラ映像のx座標値、y座標値を順次加算(インクリメント)し、x座標値についてはカメラ映像の幅になるまで(ステップS72,S73)、y座標値についてはカメラ映像の高さになるまで(ステップS74,S75)、ステップS71の動作を繰り返す。これによって、全ての画素位置(x,y)における被写体Tの奥行値Dが決定されることになる。
Thereafter, the
なお、奥行推定装置1は、新たに決定された奥行値Dを用いて、ステップS2からS5の奥行推定動作を、N回(N≧2)繰り返し、最後に得られた奥行値Dを奥行映像FZとして出力する。その結果、奥行推定装置1は、より誤推定を減らした奥行値Dを得ることができる。
The
以上、本発明の実施形態に係る奥行推定装置1の構成および動作について説明したが、本発明は、この実施形態に限定されるものではない。
以下、本発明の種々の変形例について説明する。
As mentioned above, although the structure and operation | movement of the
Hereinafter, various modifications of the present invention will be described.
(変形例1:カメラ配置間隔の変形例)
本実施形態では、被写体を撮影するカメラの設置間隔を等間隔としたが、異なるカメラ間隔としてもよい。
この場合、対応画素差分演算手段20は、それぞれの隣接映像FL,FRについて、基準カメラCCからのカメラ間隔ごとに、基準映像FCの画素から、視差に対応する画素の位置をそれぞれ求め、当該画素の画素値と、基準映像FCの画素の画素値との差分絶対値を演算すればよい。例えば、本実施形態では、奥行値Dの単位と画素間の視差の単位とを同一とし、奥行値Dが“1”増加することで、1画素ずつ視差が増加することとしたが、この場合、図1に示したカメラCC,CR間の距離が、カメラCC,CL間の距離の2倍であったとすると、対応画素差分演算手段20は、前記(1)式の代わりに、以下の(18)式により差分絶対値を算出すればよい。
ECL(d,x,y)=|PL(x+d,y)−PC(x,y)|
ECR(d,x,y)=|PR(x−2d,y)−PC(x,y)| …(18)式
これによって、奥行推定システム(図1)のカメラ配置の自由度を高めることができる。
(Modification 1: Modification of camera arrangement interval)
In the present embodiment, the installation intervals of the cameras that photograph the subject are set to be equal intervals, but different camera intervals may be used.
In this case, the corresponding pixel difference calculating means 20, each of the neighboring image F L, the F R, for each camera distance from the base camera C C, from the pixels of the reference image F C, the positions of the pixels corresponding to the parallax, respectively determined, it may be operational and the pixel value of the pixel, a difference absolute value between the pixel value of the pixel of the reference image F C. For example, in this embodiment, the unit of the depth value D and the unit of parallax between the pixels are the same, and when the depth value D increases by “1”, the parallax increases by one pixel. the camera C C shown in FIG. 1, the distance between C R, camera C C, when assumed to be twice the distance between C L, corresponding pixel
E CL (d, x, y) = | P L (x + d, y) −P C (x, y) |
E CR (d, x, y) = | P R (x−2d, y) −P C (x, y) | (18) Thereby, the degree of freedom of camera arrangement of the depth estimation system (FIG. 1). Can be increased.
(変形例2:対応画素差分演算手段の変形例)
また、本実施形態では、対応画素差分演算手段20が、基準映像FCの各画素の画素値と、当該画素の仮定奥行値dの視差に対応する隣接映像FL,FRの各画素の画素値との差分絶対値を演算することとしたが、この差分絶対値は、対応する画素のみでなく、対応画素を中心とするブロック内の画素値の差分絶対値の重み付け平均値を用いることとしてもよい。例えば、対応画素差分演算手段20は、前記(1)式の対応画素差分値ECL(d,x,y)を、以下の(19)式により算出する。
ECL(d,x,y)=|PL(x+d,y)−PC(x,y)|×1/2
+|PL(x+d+1,y)−PC(x+1,y)|×1/8
+|PL(x+d−1,y)−PC(x−1,y)|×1/8
+|PL(x+d,y+1)−PC(x,y+1)|×1/8
+|PL(x+d,y−1)−PC(x,y−1)|×1/8
…(19)式
これによって、ノイズ等によって発生する差分絶対値の誤差を低減することができる。
(Modification 2: Modification of the corresponding pixel difference calculation means)
Further, in the present embodiment, the corresponding pixel
E CL (d, x, y) = | P L (x + d, y) −P C (x, y) | × 1/2
+ | P L (x + d + 1, y) −P C (x + 1, y) | × 1/8
+ | P L (x + d-1, y) -P C (x-1, y) | × 1/8
+ | P L (x + d, y + 1) −P C (x, y + 1) | × 1/8
+ | P L (x + d, y−1) −P C (x, y−1) | × 1/8
... (19) Thereby, the difference | error of the absolute value of a difference generate | occur | produced by noise etc. can be reduced.
(変形例3:平滑化手段の変形例)
また、本実施形態では、平滑化手段50が、前記(16)式に示すように、基準映像FCの(x,y)座標の仮定奥行値dに対応する選択差分値E(d,x,y)に、隣接する2画素間の奥行値Dの差分絶対値を重み付け加算したが、以下の(20)式に示すように、隣接する4画素間の奥行値Dの差分絶対値を重み付け加算してもよい。
Ev(d,x,y)=E(d,x,y)
+W{|D(x+1,y)−d(x,y)|+|D(x,y+1)−d(x,y)|
+|D(x−1,y)−d(x,y)|+|D(x,y−1)−d(x,y)|}
…(20)式
(Modification 3: Modification of smoothing means)
In the present embodiment, the smoothing
Ev (d, x, y) = E (d, x, y)
+ W {| D (x + 1, y) -d (x, y) | + | D (x, y + 1) -d (x, y) |
+ | D (x-1, y) -d (x, y) | + | D (x, y-1) -d (x, y) |}
... (20) Formula
以上、本発明の実施形態である奥行推定装置1について説明したが、奥行推定装置1の変形例は、一般的なコンピュータを、前記した各手段として機能させる奥行推定プログラムによって動作させることができる。また、この奥行推定プログラムは、通信回線を介して配布したり、CD−ROM等の記録媒体に記録して配布したりすることも可能である。
The
以上説明したように、奥行推定装置1は、オクルージョンが生じていない場合であっても、オクルージョンが生じている場合であっても、複数の仮定奥行値dに対応する画素における差分絶対値の最小値と平均値との差から、画素の奥行値Dを推定する従来の手法に比べ、注目画素PCの画素値と、その近傍画素の画素値と、近傍画素の奥行値Dとによって、差分絶対値の平均値と、最小値と、それらに所定のペナルティを加えた値のいずれか最適な値を選択することで、隣接映像で偽マッチングが発生している場合、その奥行値Dを推定対象から除くことができ、また、オクルージョンが発生している場合、より正しい差分値から奥行値Dを推定することができ、精度よく奥行値Dを推定することができる。
As described above, the
1 奥行推定装置
10 映像入力手段
15 近傍画素値出力手段
20 対応画素差分演算手段
25 近傍奥行値出力手段
30 差分値決定手段
30a 平均差分値演算手段
30b 最小差分値選択手段
30c 差分値選択手段
40 記憶手段
50 平滑化手段
60 奥行値決定手段
DESCRIPTION OF
Claims (12)
前記複数配列した前記カメラのいずれかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラに隣接する複数の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する映像入力手段と、
前記映像入力手段に入力された基準映像において、当該基準映像の注目画素の画素値と、前記注目画素に対して左右近傍に位置する近傍画素の画素値とを出力する近傍画素値出力手段と、
前記奥行値を仮定した仮定奥行値および前記注目画素ごとに、前記基準映像の注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する対応画素差分演算手段と、
前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と前記近傍画素の画素値と前記近傍画素の奥行値とに基づいて、前記最小差分値、前記平均差分値、前記最小差分値または前記平均差分値に所定の加算値を加えた値の何れかを、予め設定した条件により選択差分値として決定する差分値決定手段と、
前記仮定奥行値および前記注目画素ごとに、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の仮定奥行値との差に、予め設定された平滑化係数を掛けた値を前記選択差分値に加えることで、前記選択差分値を平滑化する平滑化手段と、
前記平滑化手段が平滑化した選択差分値が最小となる前記仮定奥行値を、前記基準映像の各画素の奥行値とする奥行値決定手段と、
前記奥行値決定手段から基準映像の各画素の奥行値が入力されると共に、前記近傍画素の奥行値を前記対応画素差分演算手段および前記差分値決定手段に出力する近傍奥行値出力手段と、
を備えることを特徴とする誤推定を防止した奥行推定装置。 A depth estimation device that estimates a depth value indicating the depth of the subject from a plurality of camera images obtained by photographing the same subject with a plurality of cameras arranged in a predetermined position,
In any of the plurality of cameras arranged in the plurality, a reference image obtained by photographing the subject with a predetermined reference camera and a plurality of adjacent images obtained by photographing the subject with a plurality of adjacent cameras adjacent to the reference camera are input. Video input means;
In the reference video input to the video input means, a neighboring pixel value output means for outputting a pixel value of a target pixel of the reference video and a pixel value of a neighboring pixel located near the right and left with respect to the target pixel;
For each of the assumed depth value assuming the depth value and the target pixel, the pixel value of the target pixel of the reference image and the plurality of adjacent images at pixel positions corresponding to the parallax of the assumed depth value of the target pixel. A corresponding pixel difference calculating means for calculating a corresponding pixel difference value which is an absolute difference between the corresponding pixel value and the pixel value;
For each of the assumed depth value and the target pixel, an average difference value that is an average value of the corresponding pixel difference values and a minimum difference value that is a minimum value of the corresponding pixel difference values are obtained, and the pixel value of the target pixel and the Based on the pixel value of the neighboring pixel and the depth value of the neighboring pixel, any one of the minimum difference value, the average difference value, the minimum difference value, or a value obtained by adding a predetermined addition value to the average difference value, A difference value determining means for determining a selected difference value according to a preset condition;
For each of the assumed depth value and the target pixel, a smoothing coefficient set in advance is set as the difference between the assumed depth value at which the selection difference value of the pixel adjacent to the target pixel is minimum and the assumed depth value of the target pixel. Smoothing means for smoothing the selection difference value by adding a multiplied value to the selection difference value;
Depth value determination means for setting the assumed depth value at which the selection difference value smoothed by the smoothing means is minimized to the depth value of each pixel of the reference image;
A depth value for each pixel of the reference image is input from the depth value determination means, and a depth value output means for outputting the depth value of the neighboring pixels to the corresponding pixel difference calculation means and the difference value determination means;
A depth estimation apparatus that prevents erroneous estimation, comprising:
背景が黒色であるか否かを設定した黒背景フラグが入力され、当該黒背景フラグにおいて前記背景が黒色に設定されているか否かを判定し、
前記黒背景フラグにおいて前記背景が黒色に設定されている場合、前記注目画素の画素値と前記近傍画素の画素値との全てが予め設定した第1の閾値より小さいときに、前記対応画素差分値に、前記仮定奥行値に予め設定した第1の係数を掛けた値を加えることを特徴とする請求項1に記載の奥行推定装置。 The corresponding pixel difference calculation means includes:
A black background flag that sets whether or not the background is black is input, it is determined whether or not the background is set to black in the black background flag,
When the background is set to black in the black background flag, when the pixel value of the target pixel and the pixel values of the neighboring pixels are all smaller than a preset first threshold value, the corresponding pixel difference value The depth estimation apparatus according to claim 1, wherein a value obtained by multiplying the assumed depth value by a first coefficient set in advance is added.
前記黒背景フラグにおいて前記背景が黒色に設定されていない場合、
前記注目画素の画素値と前記近傍画素の画素値との全てが予め設定した第1の閾値より小さいときに、前記対応画素差分値に、左右の前記近傍画素の奥行値のうち大きい方と前記仮定奥行値との差分絶対値に前記第1の係数を掛けた値を加えることを特徴とする請求項1に記載の奥行推定装置。 The corresponding pixel difference calculation means includes:
When the background is not set to black in the black background flag,
When the pixel value of the pixel of interest and the pixel value of the neighboring pixel are all smaller than a preset first threshold value, the larger one of the depth values of the neighboring pixels on the left and right sides is selected as the corresponding pixel difference value The depth estimation apparatus according to claim 1, wherein a value obtained by multiplying the difference absolute value from the assumed depth value by the first coefficient is added.
前記平均差分値を前記選択差分値として決定することを特徴とする請求項1に記載の奥行推定装置。 The difference value determining unit is configured such that the difference between the depth values of the neighboring pixels is smaller than a preset second threshold value, or the difference between the pixel values of the neighboring pixels is smaller than a preset third threshold value. ,
The depth estimation apparatus according to claim 1, wherein the average difference value is determined as the selection difference value.
前記平均差分値を前記選択差分値として決定することを特徴とする請求項1に記載の奥行推定装置。 The difference value determining means has a difference in depth value between the neighboring pixels larger than the second threshold, a difference in pixel value between the neighboring pixels is larger than the third threshold, and the left and right neighboring pixels When the pixel value of the target pixel is closer to the pixel value having the depth value larger than the one having the smaller depth value,
The depth estimation apparatus according to claim 1, wherein the average difference value is determined as the selection difference value.
前記仮定奥行値に前記第1の係数を掛けた値を前記加算値として算出して、前記平均差分値に前記加算値を加えた値を前記選択差分値として決定することを特徴とする請求項1に記載の奥行推定装置。 The difference value determining means has a difference in depth value between the neighboring pixels larger than the second threshold, a difference in pixel value between the neighboring pixels is larger than the third threshold, and the left and right neighboring pixels When the pixel value of the pixel of interest is close to the pixel value having the depth value larger than the one having the small depth value, and the assumed depth value is larger than the large depth value of the left and right neighboring pixels,
The value obtained by multiplying the assumed depth value by the first coefficient is calculated as the added value, and a value obtained by adding the added value to the average difference value is determined as the selected difference value. The depth estimation apparatus according to 1.
前記最小差分値を前記選択差分値として決定することを特徴とする請求項1に記載の奥行推定装置。 The difference value determining means has a difference in depth value between the neighboring pixels larger than the second threshold, a difference in pixel value between the neighboring pixels is larger than the third threshold, and the left and right neighboring pixels The pixel value of the pixel of interest is close to the pixel value having the smaller depth value than the one having the larger depth value, and is set in advance to the corresponding pixel difference value of the neighboring pixel having the smaller depth value. If the value multiplied by a coefficient is less than the corresponding pixel difference value of the neighboring pixels having the large depth value,
The depth estimation apparatus according to claim 1, wherein the minimum difference value is determined as the selection difference value.
前記仮定奥行値に予め設定した第2の係数を掛けた値または予め設定された固定値の何れかを前記加算値として算出して、前記平均差分値に前記加算値を加えた値を前記選択差分値として決定することを特徴とする請求項1に記載の奥行推定装置。 The difference value determining means has a difference in depth value between the neighboring pixels larger than the second threshold, a difference in pixel value between the neighboring pixels is larger than the third threshold, and the left and right neighboring pixels The pixel value of the pixel of interest is close to the pixel value having the smaller depth value than the one having the larger depth value, and the third coefficient is set to the corresponding pixel difference value of the neighboring pixel having the smaller depth value. If the multiplied value is greater than the corresponding pixel difference value of the neighboring pixels having the large depth value,
Either a value obtained by multiplying the assumed depth value by a preset second coefficient or a preset fixed value is calculated as the added value, and a value obtained by adding the added value to the average difference value is selected. The depth estimation apparatus according to claim 1, wherein the depth estimation apparatus is determined as a difference value.
前記小さい奥行値を有する前記近傍画素の対応画素差分値に前記第3の係数を掛けた値が前記大きい奥行値を有する前記近傍画素の対応画素差分値より大きいときに、前記仮定奥行値に前記第1の係数を掛けた値を前記加算値として算出して、前記平均差分値に前記加算値を加えた値を前記選択差分値として決定し、
前記小さい奥行値を有する前記近傍画素の対応画素差分値に前記第3の係数を掛けた値が前記大きい奥行値を有する前記近傍画素の対応画素差分値より小さいときに、前記仮定奥行値に前記第1の係数を掛けた値を前記加算値として算出して、前記最小差分値に前記加算値を加えた値を前記選択差分値として決定することを特徴とする請求項1に記載の奥行推定装置。 The difference value determining means has a depth value difference between the neighboring pixels larger than the second threshold value, a pixel value difference between the neighboring pixels is larger than the third threshold value, and the pixel value of the target pixel When the difference between the pixel value of the neighboring pixels is larger than a preset fourth threshold value,
When the value obtained by multiplying the corresponding pixel difference value of the neighboring pixel having the small depth value by the third coefficient is larger than the corresponding pixel difference value of the neighboring pixel having the large depth value, the assumed depth value is set to the assumed depth value. A value obtained by multiplying the first coefficient is calculated as the added value, and a value obtained by adding the added value to the average difference value is determined as the selected difference value.
When the value obtained by multiplying the corresponding pixel difference value of the neighboring pixel having the small depth value by the third coefficient is smaller than the corresponding pixel difference value of the neighboring pixel having the large depth value, the assumed depth value is The depth estimation according to claim 1, wherein a value obtained by multiplying a first coefficient is calculated as the addition value, and a value obtained by adding the addition value to the minimum difference value is determined as the selection difference value. apparatus.
前記奥行値の推定回数が1回目の場合、前記最小差分値を前記選択差分値として決定し、
前記奥行値の推定回数が2回目以降の場合、前記奥行値決定手段から入力された近傍画素の奥行値を用いて前記選択差分値を決定することを特徴とする請求項1から請求項9のいずれか一項に記載の奥行推定装置。 The difference value determining means includes
When the estimated number of depth values is the first time, the minimum difference value is determined as the selected difference value,
10. The selection difference value is determined using a depth value of a neighboring pixel input from the depth value determination unit when the depth value is estimated for the second time or later. The depth estimation apparatus according to any one of the above.
前記複数配列した前記カメラのいずれかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラに隣接する複数の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する映像入力ステップと、
前記映像入力ステップで入力された基準映像において、当該基準映像の注目画素の画素値と、前記注目画素に対して左右近傍に位置する近傍画素の画素値とを出力する近傍画素値出力ステップと、
前記奥行値を仮定した仮定奥行値および前記注目画素ごとに、前記基準映像の注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する対応画素差分演算ステップと、
前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と前記近傍画素の画素値と前記近傍画素の奥行値とに基づいて、前記最小差分値、前記平均差分値、前記最小差分値または前記平均差分値に所定の加算値を加えた値の何れかを、予め設定した条件により選択差分値として決定する差分値決定ステップと、
前記仮定奥行値および前記注目画素ごとに、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の仮定奥行値との差に、予め設定された平滑化係数を掛けた値を前記選択差分値に加えることで、前記選択差分値を平滑化する平滑化ステップと、
前記平滑化ステップで平滑化した選択差分値が最小となる前記仮定奥行値を、前記基準映像の各画素の奥行値とする奥行値決定ステップと、
前記基準映像の各画素の奥行値が入力されると共に、前記近傍画素の奥行値を出力する近傍奥行値出力ステップと、
を備えることを特徴とする奥行推定方法。 A depth estimation method for estimating a depth value indicating the depth of a subject from a plurality of camera images obtained by photographing the same subject with a plurality of cameras arranged in a predetermined position,
In any of the plurality of cameras arranged in the plurality, a reference image obtained by photographing the subject with a predetermined reference camera and a plurality of adjacent images obtained by photographing the subject with a plurality of adjacent cameras adjacent to the reference camera are input. Video input step,
In the reference video input in the video input step, a neighboring pixel value output step for outputting a pixel value of a target pixel of the reference video and a pixel value of a neighboring pixel located in the vicinity of the right and left with respect to the target pixel;
For each of the assumed depth value assuming the depth value and the target pixel, the pixel value of the target pixel of the reference image and the plurality of adjacent images at pixel positions corresponding to the parallax of the assumed depth value of the target pixel. A corresponding pixel difference calculation step of calculating a corresponding pixel difference value which is an absolute difference between the corresponding pixel value and the pixel value;
For each of the assumed depth value and the target pixel, an average difference value that is an average value of the corresponding pixel difference values and a minimum difference value that is a minimum value of the corresponding pixel difference values are obtained, and the pixel value of the target pixel and the Based on the pixel value of the neighboring pixel and the depth value of the neighboring pixel, any one of the minimum difference value, the average difference value, the minimum difference value, or a value obtained by adding a predetermined addition value to the average difference value, A difference value determining step for determining a selected difference value according to a preset condition;
For each of the assumed depth value and the target pixel, a smoothing coefficient set in advance is set as the difference between the assumed depth value at which the selection difference value of the pixel adjacent to the target pixel is minimum and the assumed depth value of the target pixel. A smoothing step of smoothing the selection difference value by adding a multiplied value to the selection difference value;
A depth value determining step in which the assumed depth value at which the selection difference value smoothed in the smoothing step is minimized is a depth value of each pixel of the reference image;
A depth value output step of outputting a depth value of each pixel of the reference image and outputting a depth value of the neighboring pixel;
A depth estimation method comprising:
前記複数配列した前記カメラのいずれかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラに隣接する複数の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する映像入力手段、
前記映像入力手段に入力された基準映像において、当該基準映像の注目画素の画素値と、前記注目画素に対して左右近傍に位置する近傍画素の画素値とを出力する近傍画素値出力手段、
前記奥行値を仮定した仮定奥行値および前記注目画素ごとに、前記基準映像の注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する対応画素差分演算手段、
前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と前記近傍画素の画素値と前記近傍画素の奥行値とに基づいて、前記最小差分値、前記平均差分値、前記最小差分値または前記平均差分値に所定の加算値を加えた値の何れかを、予め設定した条件により選択差分値として決定する差分値決定手段、
前記仮定奥行値および前記注目画素ごとに、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の仮定奥行値との差に、予め設定された平滑化係数を掛けた値を前記選択差分値に加えることで、前記選択差分値を平滑化する平滑化手段、
前記平滑化手段が平滑化した選択差分値が最小となる前記仮定奥行値を、前記基準映像の各画素の奥行値とする奥行値決定手段、
前記奥行値決定手段から基準映像の各画素の奥行値が入力されると共に、前記近傍画素の奥行値を前記対応画素差分演算手段および前記差分値決定手段に出力する近傍奥行値出力手段、
として機能させることを特徴とする奥行推定プログラム。 In order to estimate a depth value indicating the depth of the subject from a plurality of camera images obtained by photographing the same subject with a plurality of cameras arranged at predetermined positions, a computer is provided.
In any of the plurality of cameras arranged in the plurality, a reference image obtained by photographing the subject with a predetermined reference camera and a plurality of adjacent images obtained by photographing the subject with a plurality of adjacent cameras adjacent to the reference camera are input. Video input means,
In a reference video input to the video input means, a neighboring pixel value output means for outputting a pixel value of a target pixel of the reference video and a pixel value of a neighboring pixel located near the right and left with respect to the target pixel;
For each of the assumed depth value assuming the depth value and the target pixel, the pixel value of the target pixel of the reference image and the plurality of adjacent images at pixel positions corresponding to the parallax of the assumed depth value of the target pixel. Corresponding pixel difference calculation means for calculating a corresponding pixel difference value that is an absolute difference value with respect to the pixel value of the corresponding pixel;
For each of the assumed depth value and the target pixel, an average difference value that is an average value of the corresponding pixel difference values and a minimum difference value that is a minimum value of the corresponding pixel difference values are obtained, and the pixel value of the target pixel and the Based on the pixel value of the neighboring pixel and the depth value of the neighboring pixel, any one of the minimum difference value, the average difference value, the minimum difference value, or a value obtained by adding a predetermined addition value to the average difference value, A difference value determining means for determining a selected difference value according to a preset condition;
For each of the assumed depth value and the target pixel, a smoothing coefficient set in advance is set as the difference between the assumed depth value at which the selection difference value of the pixel adjacent to the target pixel is minimum and the assumed depth value of the target pixel. Smoothing means for smoothing the selection difference value by adding a multiplied value to the selection difference value;
A depth value determining unit that sets the assumed depth value at which the selection difference value smoothed by the smoothing unit is minimized to a depth value of each pixel of the reference image;
The depth value of each pixel of the reference image is input from the depth value determining means, and the depth value of the neighboring pixels is output to the corresponding pixel difference calculating means and the difference value determining means,
Depth estimation program characterized by functioning as
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010092826A JP2011221932A (en) | 2010-04-14 | 2010-04-14 | Depth estimation device, depth estimation method and depth estimation program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010092826A JP2011221932A (en) | 2010-04-14 | 2010-04-14 | Depth estimation device, depth estimation method and depth estimation program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011221932A true JP2011221932A (en) | 2011-11-04 |
Family
ID=45038818
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010092826A Pending JP2011221932A (en) | 2010-04-14 | 2010-04-14 | Depth estimation device, depth estimation method and depth estimation program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011221932A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2019184308A (en) * | 2018-04-04 | 2019-10-24 | 日本放送協会 | Depth estimation device and program, as well as virtual viewpoint video generator and its program |
-
2010
- 2010-04-14 JP JP2010092826A patent/JP2011221932A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2019184308A (en) * | 2018-04-04 | 2019-10-24 | 日本放送協会 | Depth estimation device and program, as well as virtual viewpoint video generator and its program |
JP7233150B2 (en) | 2018-04-04 | 2023-03-06 | 日本放送協会 | Depth estimation device and its program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101822067B (en) | Method and apparatus for depth-related information propagation | |
US8897545B2 (en) | Apparatus and method for determining a confidence value of a disparity estimate | |
US9374571B2 (en) | Image processing device, imaging device, and image processing method | |
JP5153940B2 (en) | System and method for image depth extraction using motion compensation | |
US9445071B2 (en) | Method and apparatus generating multi-view images for three-dimensional display | |
US20100142828A1 (en) | Image matching apparatus and method | |
TWI493505B (en) | Image processing method and image processing apparatus thereof | |
US20140098089A1 (en) | Image processing device, image processing method, and program | |
KR100888081B1 (en) | Apparatus and method for converting 2D image signals into 3D image signals | |
JP2011141710A (en) | Device, method and program for estimating depth | |
TW201242335A (en) | Image processing device, image processing method, and program | |
JP5533529B2 (en) | Image processing apparatus and image processing system | |
JP2009146034A (en) | Multi-view image depth value extraction device, its method and its program | |
CN104331890B (en) | A kind of global disparity method of estimation and system | |
US20130083993A1 (en) | Image processing device, image processing method, and program | |
JP3990271B2 (en) | Simple stereo image input device, method, program, and recording medium | |
JP5318168B2 (en) | Stereoscopic image processing apparatus, stereoscopic image processing method, and program | |
WO2013054632A1 (en) | Image processing device, image processing unit, and program | |
JP2019184308A (en) | Depth estimation device and program, as well as virtual viewpoint video generator and its program | |
JP5252642B2 (en) | Depth estimation apparatus, depth estimation method, and depth estimation program | |
JP2011180675A (en) | Parallax estimation apparatus and program therefor | |
JP5565839B2 (en) | Depth estimation apparatus, depth estimation method, and depth estimation program | |
JP2011221932A (en) | Depth estimation device, depth estimation method and depth estimation program | |
JP2017515372A (en) | Motion field estimation | |
KR20150130078A (en) | Method and apparatus for generating spanning tree, method and apparatus for stereo matching, method and apparatus for up-sampling, and method and apparatus for generating reference pixel |