JP2011221932A - Depth estimation device, depth estimation method and depth estimation program - Google Patents

Depth estimation device, depth estimation method and depth estimation program Download PDF

Info

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
Application number
JP2010092826A
Other languages
Japanese (ja)
Inventor
Takanori Senoo
孝憲 妹尾
Kenji Yamamoto
健詞 山本
Ryutaro Oi
隆太朗 大井
Tomoyuki Mishina
智之 三科
Taiichiro Kurita
泰市郎 栗田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National Institute of Information and Communications Technology
Original Assignee
National Institute of Information and Communications Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National Institute of Information and Communications Technology filed Critical National Institute of Information and Communications Technology
Priority to JP2010092826A priority Critical patent/JP2011221932A/en
Publication of JP2011221932A publication Critical patent/JP2011221932A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a depth estimation device capable of preventing a depth value from being erroneously estimated when a plurality of correspondence points exist because a subject has a black background and even when a plurality of correspondence points exist at a uniform background part adjacent to a subject of a foreground.SOLUTION: The depth estimation device 1 includes: video inputting means 10; neighboring pixel value outputting means 15 for outputting the pixel value of a neighboring pixel; a neighboring depth value outputting means 25 for outputting the depth value of the neighboring pixel; corresponding pixel difference operating means 20 for operating a corresponding pixel difference value; a difference value determining means 30 for determining any of the minimum difference value, an average difference value and a value obtained by adding a penalty to the minimum difference value or the average difference value as a selection difference value; smoothing means 50 for performing smoothing; and depth value determining means 60 for making a temporary depth value at which a smoothing difference value is minimum to be the depth value of each pixel of reference video.

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に示すように、複数のカメラ(C,C,C)で撮影された視差方向に異なるカメラ映像を、時間方向に符号化する技術が開示されている。
この符号化の際に、特許文献1に記載されている発明は、複数のカメラ(C,C,C)で撮影されたカメラ映像(F,F,F)間で、映像内の被写体の奥行値を仮定し、基準となるカメラ(例えば、C)で撮影されたカメラ映像(F)内のブロックに含まれる画素値と、カメラの位置関係と奥行値とから定まる他のカメラ(例えば、C,C)で撮影されたカメラ映像(F,F)内の対応ブロックに含まれる画素値との差分絶対値が最小となる奥行値を求めている。
As shown in FIG. 17, this Patent Document 1 discloses a technique for encoding, in the time direction, camera images that differ in the parallax direction and are captured by a plurality of cameras (C 1 , C 2 , C 3 ). Yes.
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.

特開2007−36800号公報(段落〔0118〕〜〔0112〕)JP 2007-36800 A (paragraphs [0118] to [0112])

前記したように、複数のカメラ映像において、複数の仮定した奥行値に対応する画素値の差分絶対値が最小となる画素を探索し、当該画素の奥行値を推定する手法では、以下に示す問題がある。
例えば、被写体の重なりによって、複数のカメラ映像間で対応点が存在しない場合や、画素値の変化が少ない一様な被写体において、複数のカメラ映像間に、画素値が近似する複数の誤った対応点が存在する場合がある。これらの場合、従来の手法では、単に、画素値の差分絶対値が最小となる画素を探索するため、誤った対応点を探索(偽マッチング)してしまう場合がある。
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.

本発明の実施形態に係る奥行推定システムの構成を示すブロック図である。It is a block diagram which shows the structure of the depth estimation system which concerns on embodiment of this invention. 本発明の実施形態に係る奥行推定装置の構成を示すブロック図である。It is a block diagram which shows the structure of the depth estimation apparatus which concerns on embodiment of this invention. 本発明において、注目画素とその左右近傍の画素との関係を説明するための説明図である。In this invention, it is explanatory drawing for demonstrating the relationship between an attention pixel and the pixel of the left-right vicinity. 本発明において、注目画素の左右近傍の画素の奥行値を説明するための説明図である。In this invention, it is explanatory drawing for demonstrating the depth value of the pixel of the left-right vicinity of an attention pixel. 本発明において、オクルージョンが発生していない場合1において、注目画素と左右の対応画素との関係を説明するための説明図である。In the present invention, in the case where no occlusion occurs, it is an explanatory diagram for explaining a relationship between a target pixel and left and right corresponding pixels. 本発明において、オクルージョンが発生しているが仮定奥行値が正しい場合において、注目画素と左右の対応画素との関係を説明するための説明図である。FIG. 6 is an explanatory diagram for explaining a relationship between a target pixel and left and right corresponding pixels when occlusion occurs but an assumed depth value is correct in the present invention. 本発明において、オクルージョンが発生していない場合2において、注目画素と左右の対応画素との関係を説明するための説明図である。In the present invention, in the case where no occlusion occurs, it is an explanatory diagram for explaining the relationship between a target pixel and left and right corresponding pixels. 本発明において、仮定奥行値が正しくない場合1において、注目画素と左右の対応画素との関係を説明するための説明図である。In the present invention, in the case where the assumed depth value is not correct, it is an explanatory diagram for explaining a relationship between a target pixel and left and right corresponding pixels. 本発明において、仮定奥行値が正しくない場合2において、注目画素と左右の対応画素との関係を説明するための説明図である。In the present invention, in the case where the assumed depth value is not correct 2, it is an explanatory diagram for explaining the relationship between the pixel of interest and the left and right corresponding pixels. 本発明において、左右でオクルージョンが生じている場合において、注目画素と左右の対応画素との関係を説明するための説明図である。In the present invention, when occlusion occurs on the left and right, it is an explanatory diagram for explaining the relationship between the pixel of interest and the corresponding pixels on the left and right. 図2の奥行推定装置の全体動作を示すフローチャートである。It is a flowchart which shows the whole operation | movement of the depth estimation apparatus of FIG. 図2の奥行推定装置の対応画素差分演算動作を示すフローチャートである。It is a flowchart which shows the corresponding pixel difference calculation operation | movement of the depth estimation apparatus of FIG. 図2の奥行推定装置の差分値決定動作を示すフローチャーである。It is a flowchart which shows the difference value determination operation | movement of the depth estimation apparatus of FIG. 図2の奥行推定装置の差分値決定動作を示すフローチャーである。It is a flowchart which shows the difference value determination operation | movement of the depth estimation apparatus of FIG. 図2の奥行推定装置の平滑化動作を示すフローチャートである。It is a flowchart which shows the smoothing operation | movement of the depth estimation apparatus of FIG. 図2の奥行推定装置の奥行値決定動作を示すフローチャートである。It is a flowchart which shows the depth value determination operation | movement of the depth estimation apparatus of FIG. 従来の奥行推定手法を説明するための説明図である。It is explanatory drawing for demonstrating the conventional depth estimation method.

以下、本発明の実施形態について図面を参照して説明する。
〔奥行推定システムの全体構成〕
最初に、図1を参照して、本発明の実施形態に係る奥行推定装置1を含んだ奥行推定システムSの全体構成について説明する。奥行推定システムSは、複数配列したカメラCMで被写体Tを撮影した多視点映像から、被写体Tの奥行値Dを推定した奥行映像Fを生成するものである。図1に示した奥行推定システムSは、カメラCM(C,C,C)と、奥行推定装置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 depth estimation apparatus 1 which concerns on embodiment of this invention is demonstrated. Depth estimation system S from the multi-view images obtained by photographing the subject T in several sequences the camera CM, and generates a depth image F Z estimating the depth value D of the subject T. The depth estimation system S shown in FIG. 1 includes a camera CM (C L , C C , C R ) and a depth estimation device 1.

カメラCMは、被写体Tを撮影する一般的な撮影装置である。ここでは、水平方向の視差に応じて奥行値Dを生成することとし、視差の基準となるカメラ(基準カメラ)Cに対し、水平方向に予め定めた距離Lだけ等間隔に離間して、カメラ(隣接カメラ)C,Cを平行に配置している。このカメラCM(C,C,C)で撮影された映像(F,F,F)は、奥行推定装置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 depth estimation device 1.
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.

カメラCは、視差の基準となる映像(基準映像F)を撮影するものである。また、カメラC,Cは、それぞれカメラCの左右に配置されたカメラであって、基準映像Fとの視差を求めるための映像(隣接映像F,F)を撮影するものである。 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が撮影する映像(F,F,F)は、静止画であっても動画であっても構わない。動画である場合、カメラ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 depth estimation device 1. Alternatively, a time code may be added for each frame image, and the depth estimation apparatus 1 may be synchronized.

奥行推定装置1は、予め定めた位置に複数配列したカメラで同一の被写体を撮影した複数のカメラ映像から、被写体Tの奥行きを示す奥行値を推定するものである。ここでは、奥行推定装置1は、水平方向に配列したカメラCM(C,C,C)で被写体Tを撮影したカメラ映像(F,F,F)から、被写体Tの奥行きを示す奥行値Dを推定する。なお、ここでは、奥行推定装置1は、奥行値を、映像の各画素値に対応付けることで奥行映像Fを生成することとする。 The depth estimation apparatus 1 estimates a depth value indicating the depth of the subject T from a plurality of camera images obtained by photographing the same subject with a plurality of cameras arranged at predetermined positions. Here, the depth estimation apparatus 1 uses the camera video (F L , F C , F R ) taken by the camera CM (C L , C C , C R ) arranged in the horizontal direction to determine the depth of the subject T. Is estimated. Here, the depth estimation apparatus 1, the depth value, and generating a depth image F Z by associating to each pixel value of the image.

〔奥行推定装置の構成〕
次に、図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 depth estimation apparatus 1 includes a video input unit 10, a neighborhood pixel value output unit 15, a corresponding pixel difference calculation unit 20, a neighborhood depth value output unit 25, and a difference value determination unit 30. The storage means 40, the smoothing means 50, and the depth value determination means 60 are provided.

映像入力手段10は、カメラCMで撮影された複数のカメラ映像を入力するものである。ここでは、映像入力手段10は、予め定めた基準カメラCで撮影した基準映像Fと、基準カメラCに隣接する複数のカメラC,Cで撮影した隣接映像F,Fと、を入力する。
この映像入力手段10で入力した各映像(F,F,F)は、図示を省略したメモリに記憶され、後記する近傍画素値出力手段15および対応画素差分演算手段20によって参照されるものとする。
The video input means 10 inputs a plurality of camera videos taken by the camera CM. Here, the image input unit 10, predetermined the reference image F C taken by the base camera C C were, the base camera C adjacent to the C plurality of cameras C L, C R taken with neighboring image F L, F R And enter.
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から基準映像Fを入力し、注目画素Pの画素値P(x,y)と、注目画素Pから所定画素数sだけ左に離れた近傍画素PSLの画素値PSL(x−s,y)と、注目画素Pから所定の画素数sだけ右に離れた近傍画素PSRの画素値PSR(x+s,y)とを取得する。そして、近傍画素値出力手段15は、注目画素Pの画素値P(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 value output unit 15 receives the reference video F C from the image input unit 10, the pixel value P C (x, y) of the pixel of interest P C and, apart left from the pixel of interest P C by a predetermined number of pixels s pixel value P SL (x-s, y ) of the neighboring pixels P SL has a pixel value P SR (x + s, y ) of the neighboring pixels P SR away to the right from the pixel of interest P C by a predetermined number of pixels s and the get. Then, the neighboring pixel value output unit 15, the pixel of interest 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 The value P SR (x + s, y) is output to the corresponding pixel difference calculation means 20 and the difference value determination means 30.

この所定の画素数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).

なお、注目画素Pとは、基準映像Fにおいて奥行値Dを推定する対象となっている画素である。
また、近傍画素PSLおよび近傍画素PSRは、図3に示すように、注目画素Pを中心した半径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および注目画素Pごとに、基準映像Fの注目画素Pの画素値と、当該注目画素Pの仮定奥行値dの視差に対応する隣接映像F,Fの対応画素P,P(図5参照)の画素値との差分絶対値である隣接映像の対応画素差分値ECL,ECRを演算するものである。ここで、隣接映像の対応画素差分値ECLは、基準映像Fと隣接映像Fとの間で演算された差分絶対値であり、隣接映像の対応画素差分値ECRは、基準映像Fと隣接映像Fとの間で演算された差分絶対値である。
Hereinafter, returning to FIG. 2, the description of the configuration of the depth estimation device 1 will be continued.
Corresponding pixel difference calculating unit 20, for each hypothetical depth value d and the target pixel P C, the pixel value of the pixel of interest P C of the reference image F C, adjacent corresponding to parallax assumptions depth value d of the pixel of interest P C is intended for calculating the image F L, F R of the corresponding pixels P L, P R corresponding pixel difference value E CL, E CR of neighboring image which is a difference absolute value between the pixel value (see FIG. 5). Here, the corresponding pixel difference value E CL of neighboring image are calculated difference absolute value between the reference image F C and the neighboring image F L, the corresponding pixel difference value E CR of the neighboring image, the reference image F C to be the calculated difference absolute value between the neighboring image F R.

なお、画素値の差分絶対値は、カメラ映像(F,F,F)が、輝度(輝度値)と色差信号(色差値)との各要素で構成される場合、当該画素の輝度値の差分絶対値と、色差値の差分絶対値とを加算した値とする。このとき、色差値の差分絶対値に任意の係数を掛けて、色成分の重みを調整することとしてもよい。
また、画素値の差分絶対値は、カメラ映像(F,F,F)が、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は、基準映像Fの(x,y)座標(注目画素P)における画素値をP(x,y)、基準映像Fの(x,y)座標の仮定奥行値dに対応する隣接映像Fの(x+d,y)座標(対応画素P)の画素値をP(x+d,y)、隣接映像Fの(x−d,y)座標(対応画素P)の画素値をP(x−d,y)としたとき、以下の(1)式の演算により、対応画素差分値ECL(d,x,y),ECR(d,x,y)を算出する。なお、「||」は、絶対値を示す。
CL(d,x,y)=|P(x+d,y)−P(x,y)|
CR(d,x,y)=|P(x−d,y)−P(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から入力された注目画素Pの画素値P(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 difference calculating unit 20 outputs the pixel value P C (x, y) of the target pixel P C input from the neighboring pixel value output unit 15 and the pixel value P SL (x of the neighboring pixel P SL. -s determined, a y), the pixel value P SR (x + s neighboring pixels P SR, when all the y) is the threshold value (first threshold value) th smaller than the object T is a black background.

一方、対応画素差分演算手段20は、注目画素Pの画素値P(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に加える。
CL(d,x,y)=ECL(d,x,y)+h×d
CR(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 difference calculation unit 20 determines whether the black background flag input from the outside is on or off. Here, if the black background flag is on (the background is black), the corresponding pixel difference calculation means 20 uses a coefficient (first coefficient) for the assumed depth value d as shown in the following equation (1-1). ) A value (penalty) multiplied by h is added to the corresponding pixel difference values E CL and E CR .
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の奥行値D、および、近傍画素PSRの奥行値Dのうち、大きい方の近傍奥行値Dを求める。そして、対応画素差分演算手段20は、以下の(1−2)式のように、大きい方の近傍奥行値Dと仮定奥行値dとの差分絶対値に係数hを掛けた値(ペナルティ)を、対応画素差分値ECL,ECRに加える。
(x,y)=max(D(x−s,y),D(x+s,y))
CL(d,x,y)=ECL(d,x,y)+h×|D−d|
CR(d,x,y)=ECR(d,x,y)+h×|D−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は、演算対象となる注目画素Pの画素位置(x,y)および仮定奥行値dを順次更新して、対応画素差分値ECL,ECRを演算する。 Then, the corresponding pixel difference calculation unit 20 outputs the corresponding pixel difference values E CL and E CR for each assumed depth value d (“0” to the maximum parallax amount) to the difference value determination unit 30. The correspondence pixel difference calculating means 20, the pixel position of the pixel of interest P C to be calculated (x, y) and sequentially updating the assumed depth value d, the corresponding pixel difference value E CL, calculates the E CR.

以下、図4を参照して、近傍奥行値出力手段25について説明する。
近傍奥行値出力手段25は、後記する奥行値決定手段60から各画素の奥行値Dが入力され、近傍画素PSLの奥行値Dと、近傍画素PSRの奥行値Dとを対応画素差分演算手段20および差分値決定手段30に出力するものである。
ここで、1回目の奥行推定では、奥行値Dが求められないことになる。この場合、奥行推定装置1は、全ての画素の奥行値Dを初期値(例えば、0)に予め設定する。つまり、1回目の奥行推定を行う場合、近傍奥行値出力手段25は、この初期値を奥行値D,Dとして差分値決定手段30に出力する。一方、2回目以降の奥行推定では、近傍奥行値出力手段25は、前回の奥行推定で求めた各画素の奥行値Dが奥行値決定手段60から入力されるので、近傍画素PSLの奥行値Dと、近傍画素PSRの奥行値Dとを出力する。
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 depth determining means 60 to be described later is input, the corresponding pixel and depth values D L neighboring pixels P SL, and a depth value D R neighboring pixels P SR This is output to the difference calculation means 20 and the difference value determination means 30.
Here, the depth value D is not obtained in the first depth estimation. In this case, the depth estimation apparatus 1 presets the depth value D of all the pixels to an initial value (for example, 0). That is, when performing the first depth estimation, near the depth value output means 25 outputs the initial value depth value D L, the difference value determination unit 30 as D R. On the other hand, in the second and subsequent depth estimation, neighboring depth value output unit 25, since the depth value D of each pixel calculated in the previous depth estimation is inputted from the depth determining means 60, the depth value of neighboring pixels P SL and D L, and it outputs the depth value D R neighboring pixels P SR.

以下、図2に戻り、奥行推定装置1の構成について説明を続ける。
差分値決定手段30は、基準映像Fの注目画素Pおよび仮定奥行値dごとに、最小差分値Emと平均差分値Eaとを求めるものである。そして、差分値決定手段30は、求めた最小差分値Em、平均差分値Ea、最小差分値Emまたは平均差分値Eaに所定のペナルティ(加算値)を加えた値の何れかを、予め設定された条件により選択差分値として決定する。
Hereinafter, returning to FIG. 2, the description of the configuration of the depth estimation device 1 will be continued.
Difference value determining means 30, for each pixel of interest P C and assumptions depth value d of the reference image F C, and requests the minimum difference value Em and the average difference value Ea. Then, the difference value determining means 30 is preset with any one of the obtained minimum difference value Em, average difference value Ea, minimum difference value Em, or average difference value Ea plus a predetermined penalty (added value). The selected difference value is determined according to the conditions.

ここでは、差分値決定手段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は、基準映像Fの注目画素Pおよび仮定奥行値dごとに、対応画素差分演算手段20で演算された隣接映像の対応画素差分値ECL,ECRの平均値(平均差分値Ea)を演算するものである。
すなわち、平均差分値演算手段30aは、基準映像Fの(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 value calculation unit 30a calculates the average difference value Ea (d, x, y) corresponding to the assumed depth value d of the (x, y) coordinates of the reference image F C according to the following expression (2). Calculated by
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 value calculation unit 30a outputs the average difference value Ea for each assumed depth value d (“0” to the maximum parallax amount) obtained by the calculation to the difference value selection unit 30c.

最小差分値選択手段30bは、基準映像Fの注目画素Pおよび仮定奥行値dごとに、対応画素差分演算手段20で演算された隣接映像の対応画素差分値ECL,ECRのうちで、値が小さい方(最小差分値Em)を選択するものである。
すなわち、最小差分値選択手段30bは、基準映像Fの(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 value selecting unit 30b, 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, among the E CR The value with the smaller value (minimum difference value Em) is selected.
That is, the minimum difference value selecting unit 30b is the reference image F C (x, y) the corresponding pixel difference value E CL of the neighboring image that corresponds to the assumed depth value d of coordinates (d, x, y) and, of the neighboring image The corresponding pixel difference value E CR (d, x, y) is compared, and the smaller value is selected as the minimum difference value Em as shown in the following equation (3).
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 value selecting unit 30b outputs the minimum difference value Em for each selected assumed depth value d (“0” to the maximum parallax amount) to the difference value selecting unit 30c.

差分値選択手段30cは、基準映像Fの注目画素Pおよび仮定奥行値dごとに、近傍画素値出力手段15から入力された注目画素Pの画素値P(x,y)と、近傍画素PSLの画素値PSL(x−s,y)と、近傍画素PSRの画素値PSR(x+s,y)と、近傍奥行値出力手段25から入力された近傍画素PSLの奥行値Dと、近傍画素PSRの奥行値Dとに基づいて、最小差分値選択手段30bから入力された最小差分値Em、平均差分値演算手段30aから入力された平均差分値Ea、最小差分値Emまたは平均差分値Eaに所定のペナルティ(加算値)を加えた値の何れかを、選択差分値として決定するものである。 Difference value selection unit 30c, for each pixel of interest P C and assumptions depth value d of the reference image F C, the pixel value P C of the pixel of interest P C input from the neighboring pixel value output unit 15 (x, y), The pixel value P SL (x−s, y) of the neighboring pixel P SL , the pixel value P SR (x + s, y) of the neighboring pixel P SR , and the depth of the neighboring pixel P SL input from the neighboring depth value output means 25 the value D L, based on the depth value D R neighboring pixels P SR, the minimum difference value minimum difference value Em input from the selection unit 30b, the average difference value average difference value Ea input from operation means 30a, the minimum Either the difference value Em or the average difference value Ea plus a predetermined penalty (added value) is determined as the selected difference value.

ここで、図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において、基準映像Fの画素(注目画素P)と、隣接映像F,Fの画素(対応画素P,P)とが背景Aに対応している場合(オクルージョンが発生していない場合1)の処理について説明する(適宜図2〜図4参照)。
<First example: No occlusion 1>
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は、注目画素Pの近傍には前景Bと背景Aの境界の有無、つまり、オクルージョンが発生しているか否かを判定する。具体的には、差分値選択手段30cは、以下の(4)式に示すような近傍画素PSLの奥行値Dと近傍画素PSRの奥行値Dとの奥行差分値Dが、閾値(第2の閾値)th1より大きくなるという条件を、満たさないか否かを判定する。
(x,y)=|D(x−s,y)−D(x+s,y)|>th1 …(4)式
First, the difference value selecting unit 30c judges whether the boundary of the foreground B and background A in the vicinity of the target pixel P C, i.e., whether occlusion has occurred. Specifically, the difference value selecting unit 30c, the following (4) the depth difference value D D between the depth value D R of the depth values D L and the neighboring pixel P SR neighboring pixels P SL as shown in formula, It is determined whether or not the condition that the threshold value (second threshold value) th1 is exceeded is not satisfied.
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は、オクルージョンが発生していない場合、注目画素Pの画素値P(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より大きくなるという条件を、満たさないか否かを判定する。
PLR(x,y)=|PSL(x−s,y)−PSR(x+s,y)|>th2…(5)式
Furthermore, the difference value selecting unit 30c, when the occlusion has not occurred, the pixel value P C (x, y) of the pixel of interest P C and the pixel value P SL (x-s, y ) of the neighboring pixels P SL and Since the pixel value P SR (x + s, y) of the neighboring pixel P SR corresponds to the same subject (background A), it is determined whether or not they are similar values. Specifically, the difference value selecting unit 30c, the following (5) pixel values of the neighboring pixels P SL as shown in equation P SL (x-s, y ) and the pixel value P SR neighboring pixels P SR ( It is determined whether or not the condition that the pixel difference value D PLR with respect to x + s, y) is larger than a threshold value (third threshold value) th2 is not satisfied.
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 value selection unit 30c prevents erroneous estimation of the depth value D in the case where the color is different depending on the part of the subject T or the depth is different even if no occlusion occurs in the same subject T. Judgment is performed by combining the expressions (4) and (5). Then, the difference value selection means 30c determines that no occlusion has occurred when either of the expressions (4) and (5) is not established, and selects the average difference value Ea as the selected difference value.

<第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 value selection unit 30c determines whether or not the pixel values of the neighboring pixel PSL and the neighboring pixel PSR are different from each other. Specifically, the difference value selection unit 30c, as shown in the above equation (5), the pixel value P SL (x−s, y) of the neighboring pixel P SL and the pixel value P SR of the neighboring pixel P SR. It is determined whether or not the pixel difference value D PLR with (x + s, y) is greater than the threshold value th2.

そして、差分値選択手段30cは、前記した判定結果を確実なものとするため、前記した(4)式に示すように、近傍画素PSLの奥行値Dと近傍画素PSRの奥行値Dとの奥行差分値Dが、前記した閾値th1より大きくなるか否かを判定する。 Then, the difference value selecting unit 30c is order to ensure the determination result of the above, as shown in the above-mentioned (4), the depth value D of the depth values D L and the neighboring pixel P SR neighboring pixels P SL depth difference value D D with R determines whether greater than a threshold th1 described above.

このように、差分値選択手段30cは、(4)式および(5)式の両方が成立する場合(オクルージョンが発生していると判定した場合)、近傍画素PSLの奥行値Dと近傍画素PSRの奥行値Dとを比較し、大きい側(図4の例ではD側)に前景Bがあると判定する。なお、図4の例では、2回目の奥行推定の際、奥行値Dが奥行値Dより大きくなっている。 Thus, the difference value selecting unit 30c is (4) and (if occlusion is determined to have occurred) (5) if both expressions are satisfied, near the depth value D L neighboring pixels P SL It determines that compares the depth value D R of the pixel P SR, (in the example of FIG. 4 D R side) larger side is the foreground B to. In the example of FIG. 4, when the second depth estimation, the depth value D R is larger than the depth value D L.

次に、差分値選択手段30cは、注目画素Pが、前景Bの画素であるか否かを判定する。具体的には、差分値選択手段30cは、以下の(6)式〜(8)式に示すように、注目画素Pの画素値P(x,y)が、近傍画素PSLの画素値PSL(x−s,y)または近傍画素PSRの画素値PSR(x+s,y)のどちらに近いかを、注目画素Pと近傍画素PSL,PSRとの画素値の画素差分値DPL,DPRとから判定する。
PL(x,y)=|PSL(x−s,y)−P(x,y)| …(6)式
PR(x,y)=|PSR(x+s,y)−P(x,y)| …(7)式
PL(x,y)≧DPR(x,y) …(8)式
Then, the difference value selecting unit 30c is the pixel of interest P C is equal to or a pixel of the foreground B. Specifically, the difference value selecting unit 30c, as shown in the following (6) to (8), the pixel value P C (x, y) of the pixel of interest P C is, pixels near the pixel P SL the value P SL (x-s, y ) or the pixel value P SR (x + s, y ) of the neighboring pixels P SR similar to either of the target pixel P C and the neighboring pixels P SL, the pixel of the pixel values of the P SR It is determined from the difference values D PL and D PR .
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)式が成立しない場合(注目画素値Pが背景側に近い場合)、差分値選択手段30cは、この判定結果を確実なものとするため、以下の処理を行う。具体的には、差分値選択手段30cは、以下の(9)式に示すように、背景Aに近い近傍画素(図3の例ではPSL)の画素値と注目画素値Pとの画素値の画素差分値DPLが閾値(第4の閾値)th3より小さいか否かを判定する。これによって、差分値選択手段30cは、前記した(8)式が成立せずに注目画素Pが背景Aに近いという判定結果を確実なものとする。
PL(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 value selecting unit 30c, in order to make this determination result made reliable, the following process is performed. Specifically, the difference value selecting unit 30c, as shown in the following equation (9), the pixels of the pixel value and the target pixel value P C of (P SL in the example of FIG. 3) near the pixels close to the background A pixel difference value D PL threshold values determines (fourth threshold) th3 or smaller. Thus, the difference value selecting unit 30c is aforementioned equation (8) is the pixel of interest P C without established shall ensure a determination result that is close to the background A.
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)式が成立する(注目画素Pが背景Aにある)という判定結果を確実なものとする。
CR(x,y)>k×ECL(x,y) …(10)式
Then, the difference value selecting unit 30c, as shown in the following equation (10), the left of the corresponding pixel difference value E CL is whether sufficiently smaller than the right of the corresponding pixel difference value E CR, left the corresponding pixel It is multiplied by the difference value E CL coefficient (third coefficient) to k, according to whether or not the right of the corresponding pixel difference value E CR smaller. Thus, the difference value selecting unit 30c is aforementioned (9) is established (target pixel P C is in the background A) shall ensure results determination that.
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 value selecting unit 30c (if left corresponding pixel difference value E CL is sufficiently smaller than the right of the corresponding pixel difference value E CR) if (10) is established, the smaller the corresponding pixel difference value E CL = Select the minimum difference value Em as the selected difference value.

<第3例:オクルージョンが発生していない場合2>
以下、図7を参照して、ある仮定奥行値dにおいて、基準映像Fの画素(注目画素P)と、隣接映像F,Fの画素(対応画素P,P)とが前景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)式が成立する場合(注目画素値Pが前景側に近い場合)、差分値選択手段30cは、この判定結果を確実なものとするため、以下の処理を行う。具体的には、差分値選択手段30cは、以下の(11)式に示すように、近傍画素PSRと注目画素Pとの画素値の画素差分値DPRが、前記した閾値th3より小さいか否かを判定する。
PR(x,y)<th3 …(11)式
If above (8) is established (when the target pixel value P C is closer to the foreground side), the difference value selecting unit 30c, in order to make this determination result made reliable, the following process is performed. Specifically, the difference value selecting unit 30c, as shown in the following equation (11), a pixel difference value D PR of the pixel values between the target pixel P C and the neighboring pixels P SR is, the threshold value th3 smaller than the above It is determined whether or not.
D PR (x, y) <th3 (11)

そして、差分値選択手段30cは、前記した(11)式が成立し、注目画素Pが前景Bの画素であると判定した場合、以下の(12)式に示すように、仮定奥行値dが前景B側の近傍奥行値Dより大きいか否かを判定する。
d(x,y)>D(x+s,y) …(12)式
Then, the difference value selecting unit 30c is aforementioned equation (11) is satisfied, if the pixel of interest P C is determined to be the pixel of the foreground B, as shown in the following equation (12), assuming the depth value d It is equal to or larger than the proximity depth value D R of the foreground B side.
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 value selection unit 30c sets a penalty (addition value) p1 obtained by multiplying the average difference value Ea by the above-described coefficient h and the assumed depth value d. to add. Thereby, the difference value selection means 30c can prevent the depth value D that is too large from being erroneously estimated.

(12)式が成立しない場合(仮定奥行値dが大きくない場合)、差分値選択手段30cは、注目画素Pにオクルージョンが生じないので、平均差分値Eaを選択差分値として選択する。 (12) If the equation is not satisfied (if assumed depth value d is not greater), the difference value selecting unit 30c, since occlusion to the pixel of interest P C does not occur, to select the average difference value Ea as the selected difference value.

<第4例:仮定奥行値が正しくない場合1>
以下、図8を参照して、仮定奥行値dが正しくない場合1の処理について説明する(適宜図2〜図4参照)。ここで、図8に示すように、仮定奥行値dが大きすぎて、前景Bでない側の対応画素Pが前景B側に移動し、前景B側の対応画素Pが背景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を掛けたものより大きいか否かで判定する。
CL(x,y)>k×ECR(x,y) …(13)式
If the above equation (10) does not hold, the difference value selection unit 30c determines whether or not the assumed depth value d is incorrect. Greater Specifically, the difference value selecting unit 30c, as shown in the following equation (13), the left of the corresponding pixel difference value E CL is multiplied by coefficient k on the right side of the corresponding pixel difference value E CR Judge by whether or not.
E CL (x, y)> k × E CR (x, y) (13)

そして、差分値選択手段30cは、(13)式が成立する場合(仮定奥行値dが正しくない場合)、この大きな方の対応画素差分値ECLが含まれる平均差分値Eaを選択差分値として選択する。これによって、差分値選択手段30cは、誤った奥行値Dが推定されることを防止する。 Then, the difference value selecting unit 30c is (13) If the equation is satisfied (assuming the depth value d is incorrect), an average difference value Ea including the corresponding pixel difference value E CL of the larger as the selected difference value select. Thus, the difference value selection unit 30c prevents an erroneous depth value D from being estimated.

<第5例:仮定奥行値が正しくない場合2>
以下、図9を参照して、仮定奥行値dが正しくない場合2の処理について説明する(適宜図2〜図4参照)。ここで、図9に示すように、仮定奥行値dが大きすぎて前景Bの奥行値を示しているため、対応画素P、P、Pが全て背景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は、対応画素P、P、Pが全て背景Aにあり、仮定奥行値dが正しくないと判定する。このとき、平均差分値Eaおよび最小差分値Emの両方とも大きくならないので、差分値選択手段30cは、平均差分値Eaに所定のペナルティ(加算値)pを加えた値を算出し、平均差分値Eaにペナルティpを加えた値を選択差分値として選択する。 If the above-mentioned (10) and (13) is not satisfied, the difference value selecting unit 30c, the corresponding pixel P L, is in the P C, P R are all background A, determines that the assumed depth value d is not correct . At this time, since both the average difference value Ea and the minimum difference value Em do not increase, the difference value selection means 30c calculates a value obtained by adding a predetermined penalty (addition value) p to the average difference value Ea, and the average difference value A value obtained by adding a penalty p to Ea is selected as a selection difference value.

なお、ペナルティ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に示すように、対応画素P,P,Pが、前景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は、注目画素Pが、右側にある前景Bと左側にある中景Cとの間にある背景Aに対応すると判定する。このとき、左右どちらのカメラC,Cからも、正しい対応点が見えないので、正しい奥行値Dを推定できないことになる。このため、差分値選択手段30cは、奥行値Dをより正しい値に近づけるための処理を行う。すなわち、左側に中景Cがある場合には仮定奥行値dが小さくなり、仮定奥行値dが中景Cに近づくと、左側の対応画素Pは、背景Aを示すことになる。このとき、左側の対応画素差分値ECLは、右側の対応画素差分値ECRよりも小さくなる。 If above (9) or (11) is not satisfied, the difference value selecting unit 30c is the pixel of interest P C is corresponding to a background A lying between the Chukei C in foreground B and left to the right Judge that. At this time, the left or right camera C L, from C R, since the correct corresponding point is not visible, it will not be able to guess the correct depth value D. For this reason, the difference value selection means 30c performs a process for bringing the depth value D closer to the correct value. That is, assuming the depth value d becomes small when there is Chukei C to the left, when assuming the depth value d approaches middle ground C, the corresponding pixel P L on the left will show a background A. In this case, the corresponding pixel difference value E CL on the left is smaller than the right of the corresponding pixel difference value E CR.

具体的には、差分値選択手段30cは、前記した(10)式により、左側の対応画素差分値ECLが右側の対応画素差分値ECRよりも十分小さくなるか否かを判定する。ここで、(10)式が成立しない場合、差分値選択手段30cは、背景Aが左右どちらのカメラC,Cからも見えないと判定する。この場合、差分値選択手段30cは、その仮定奥行値dに前記した係数hを掛けた値をペナルティ(加算値)p1として算出する。その後、差分値選択手段30cは、平均差分値Eaにペナルティ(加算値)p1を加えた値を選択差分値として選択する。 Specifically, the difference value selecting unit 30c is checked by the above-mentioned (10), whether or not the left of the corresponding pixel difference value E CL becomes sufficiently smaller than the right of the corresponding pixel difference value E CR. Here, if the expression (10) is not satisfied, the difference value selecting unit 30c determines that the background A can not be seen from the left or right camera C L, C R. In this case, the difference value selection unit 30c calculates a value obtained by multiplying the assumed depth value d by the coefficient h described above as a penalty (added value) p1. Thereafter, the difference value selection means 30c selects a value obtained by adding a penalty (addition value) p1 to the average difference value Ea as a selection difference value.

一方、(10)式が成立する場合、差分値選択手段30cは、仮定奥行値dが小さく、カメラCから、前景Bと中景Cとの間を通して、背景Aの対応点でない点が見えていると判定する(擬似マッチングが生じている)。この場合、差分値選択手段30cは、次善の選択差分値として、その時の最小差分値Emにペナルティ(加算値)p1を加えた値を、選択差分値として選択する。 On the other hand, if (10) is established, the difference value selecting unit 30c is visible small assumed depth value d, from the camera C L, through between the foreground B and Chukei C, and a point not corresponding points of the background A (Pseudo matching has occurred). In this case, the difference value selection means 30c selects a value obtained by adding a penalty (addition value) p1 to the minimum difference value Em at that time as the next best selection difference value.

その後、差分値選択手段30cは、選択した選択差分値を、仮定奥行値dと基準映像Fの画素位置とに対応付けて記憶手段40に書き込む。また、差分値決定手段30は、基準映像Fの全ての画素位置において、仮定奥行値dごとの選択差分値を記憶手段40に書き込んだ後に、書き込み完了を平滑化手段50に通知する。 Then, the difference value selecting unit 30c is a selection difference values selected, written into the storage unit 40 in association with the pixel position of the hypothetical depth value d and the reference image F C. Also, the difference value determination means 30, at all pixel positions of the reference image F C, after writing selection difference values for each assumption depth value d to the storage unit 40, and notifies the completion of writing to the smoothing means 50.

以上説明したように、差分値決定手段30は、仮定した奥行値(仮定奥行値d)が正しく、左右のカメラC、Cから、正しい対応点が見えている場合、平均差分値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は、オクルージョンが発生していても、カメラC、Cの片方から正しい対応点が見える場合、対応点が見えている側の差分絶対値である、最小差分値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は、両方のカメラC、Cからも正しい対応点が見えない場合、注目画素Pが背景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 value determining unit 30 can be used as an index indicating that the assumed depth value d is correct.

なお、差分値選択手段30cは、1回目の奥行推定では、最小差分値Emを選択差分値として選択してもよい。これによって、オクルージョンが生じている画素でも、正しい奥行値Dが1回目で求まりやすくなる。また、オクルージョンが生じていない画素では、奥行値Dがやや不正確な値となる。このため、2回目以降の奥行推定で、差分値選択手段30cが前記した処理を行い、正しい奥行値Dを求めてもよい。   The difference value selection unit 30c may select the minimum difference value Em as the selection difference value in the first depth estimation. This makes it easier to obtain the correct depth value D at the first time even for pixels in which occlusion occurs. In addition, the depth value D is a little inaccurate for pixels where no occlusion has occurred. For this reason, in the depth estimation after the second time, the difference value selection means 30c may perform the above-described processing to obtain the correct depth value D.

図2に戻って、奥行推定装置1の構成について説明を続ける。
記憶手段40は、差分値決定手段30で決定された差分値を、仮定奥行値dと基準映像の画素位置とに対応付けて記憶するものである。例えば、記憶手段40は、磁気メモリや半導体メモリ等の一般的な記憶媒体である。
Returning to FIG. 2, the description of the configuration of the depth estimation device 1 will be continued.
The storage unit 40 stores the difference value determined by the difference value determination unit 30 in association with the assumed depth value d and the pixel position of the reference image. For example, the storage means 40 is a general storage medium such as a magnetic memory or a semiconductor memory.

平滑化手段50は、当該画素位置における差分値を平滑化するものである。まず、平滑化手段50は、基準映像の画素位置(x,y)およびその画素位置での仮定奥行値dごとに、以下の(14)式および(15)式に示すように、注目画素P(x,y)に隣接する画素位置(x+1,y)、(x,y+1)での選択差分値E(x+1,y)、E(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 unit 50 calculates the target pixel P for each pixel position (x, y) of the reference image and the assumed depth value d at the pixel position. The minimum value of the selection difference values E X (x + 1, y) and E Y (x, Y + 1) at pixel positions (x + 1, y) and (x, y + 1) adjacent to C (x, y) Explore. Then, the smoothing means 50 sets the assumed depth value d as depth value candidates D (x + 1, y) and D (x, y + 1) of adjacent pixels.
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 unit 50 calculates the selection difference value E (d) for each pixel position (x, y) of the reference image and the assumed depth value d at the pixel position. , X, y), the depth value candidates D (x + 1, y), D (x, y + 1) and the assumed depth value d (x, y) at the adjacent pixel position (x + 1, y), (x, y + 1). The difference absolute value is multiplied by the smoothing coefficient W and added.
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 unit 50 operates by receiving notification from the difference value determining unit 30 that the selected difference values of all the assumed depth values d have been written at all the pixel positions of the reference video (writing completion). Start.

このように、選択差分値に、隣接する画素の奥行値候補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 value determination unit 60 performs the smoothed selection difference value stored in the storage unit 40 in association with the assumed depth value d and the pixel position of the reference image. For each pixel position (x, y), an assumed depth value d (x, y) that minimizes the smoothed difference value Ev (x, y) is searched, and the depth value D (x, y) at the pixel position is To do.
D (x, y) = (x, y) coordinate smoothing difference value Ev (x, y) minimum depth value (17)

このように、奥行値決定手段60は、全ての画素位置において、平滑化差分値Evが最小となる仮定奥行値dを奥行値Dとして決定する。そして、奥行値決定手段60は、被写体Tの奥行値Dを推定した奥行映像Fを生成する。
なお、この奥行値決定手段60は、平滑化手段50から、選択差分値の平滑化が完了した旨(平滑化完了)を通知されることで動作を開始するものとする。
Thus, the depth value determining means 60 determines the assumed depth value d that minimizes the smoothing difference value Ev as the depth value D at all pixel positions. Then, the depth value determination unit 60 generates a depth image F Z estimating the depth value D of the subject T.
The depth value determining unit 60 starts the operation when notified from the smoothing unit 50 that the smoothing of the selected difference value has been completed (smoothing completion).

以上説明したように、奥行推定装置1は、選択差分値を指標として、被写体Tの奥行値Dを推定することができる。
なお、奥行推定装置1は、1回目の奥行推定で決定した奥行値Dを用いて、2回目以降の奥行推定を行ってもよい。そして、奥行推定装置1は、奥行推定をN回繰り返した後に得られた奥行値Dから奥行映像Fを生成してもよい。
As described above, the depth estimation apparatus 1 can estimate the depth value D of the subject T using the selection difference value as an index.
In addition, the depth estimation apparatus 1 may perform the depth estimation after the 2nd time using the depth value D determined by the depth estimation of the 1st time. The depth estimation apparatus 1 may generate a depth image F Z from the resultant depth value D after repeated depth estimation N times.

〔奥行推定装置の動作〕
以下、図11〜図16を参照して、図2の奥行推定装置1の動作について説明する(適宜図1,2参照)。ここでは、図11を参照して、奥行推定装置1の全体動作について説明し、詳細な説明については、図12〜図16を参照して説明を行うことにする。
なお、図11〜図16では、平均差分値Eaを平均値および最小差分値Emを最小値と略記している。
[Operation of depth estimation device]
Hereinafter, the operation of the depth estimation apparatus 1 in FIG. 2 will be described with reference to FIGS. 11 to 16 (see FIGS. 1 and 2 as appropriate). Here, the overall operation of the depth estimation apparatus 1 will be described with reference to FIG. 11, and the detailed description will be described with reference to FIGS.
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によって、一直線上に等間隔で水平に配置したカメラ(基準カメラC、隣接カメラC,C)より、同一の被写体Tを撮影したカメラ映像(基準映像F,隣接映像F,F)を入力する(ステップS1)。
(Overall operation)
Initially, with reference to FIG. 11, the whole operation | movement of the depth estimation apparatus 1 is demonstrated.
The depth estimation apparatus 1 performs initial setting with a counter n = 1 indicating the number of times of depth estimation and a depth value D = 0 of all pixels. Then, the depth estimation apparatus 1 uses the video input means 10 to capture the same subject T from the cameras (reference camera C C , adjacent cameras C L , C R ) that are horizontally arranged at equal intervals on a straight line. (reference image F C, the neighboring image F L, F R) to enter (step S1).

そして、奥行推定装置1は、近傍画素値出力手段15によって、注目画素Pの画素値P(x,y)と、注目画素Pから所定画素数sだけ左に離れた近傍画素PSLの画素値PSL(x-s,y)と、注目画素Pから所定の画素数sだけ右に離れた近傍画素PSRの画素値PSR(x+s,y)とを出力する(ステップS2;近傍画素値出力動作)。 The depth estimation apparatus 1, the neighboring pixel value output unit 15, the pixel of interest P C of the pixel value P C (x, y) and the pixel of interest P C from a predetermined number of pixels s neighboring pixels apart in the left P SL the pixel value P SL (x-s, y ) and the pixel value P SR (x + s, y ) of the neighboring pixels P SR apart to the right pixel of interest P C from the predetermined number of pixels s and outputs a (step S2 ; Neighboring pixel value output operation).

そして、奥行推定装置1は、対応画素差分演算手段20によって、仮定奥行値dおよび注目画素Pごとに、基準映像Fの注目画素Pの画素値と、当該注目画素Pの仮定奥行値dの視差に対応する隣接映像F,Fの対応画素の画素値との差分絶対値である隣接映像の対応画素差分値ECL,ECRを演算する(ステップS3;対応画素差分演算動作)。このステップS3の動作については、図12を参照して後で説明を行う。 The depth estimation apparatus 1 by the corresponding pixel difference calculating unit 20, for each hypothetical depth value d and the target pixel P C, the pixel value of the pixel of interest P C of the reference image F C, assuming the depth of the target pixel P C neighboring image F L corresponding to the disparity value d, F corresponding pixel difference values of adjacent image which is a difference absolute value between the pixel value of a corresponding pixel of R E CL, calculates the E CR (step S3; corresponding pixel difference calculation Operation). The operation of step S3 will be described later with reference to FIG.

そして、奥行推定装置1は、差分値決定手段30によって、仮定奥行値dおよび注目画素Pごとに、最小差分値Em、平均差分値Ea、最小差分値Emまたは平均差分値Eaに所定のペナルティ(加算値)を加えた値の何れかを、選択差分値として決定し、記憶手段40に記憶する(ステップS4;差分値決定動作)。このステップS4の動作については、図13,図14を参照して後で説明を行う。 The depth estimation apparatus 1, the difference value determination unit 30, for each hypothetical depth value d and the target pixel P C, the minimum difference value Em, the average differential value Ea, the minimum difference value Em or a predetermined penalty to the average differential value Ea Any value added with (added value) is determined as a selected difference value and stored in the storage means 40 (step S4; difference value determining operation). The operation of step S4 will be described later with reference to FIGS.

そして、奥行推定装置1は、平滑化手段50によって、基準映像Fの全ての(x,y)座標の全ての仮定奥行値dに対応して記憶された選択差分値を平滑化する(ステップS5;平滑化動作)。このステップS5の動作については、図15を参照して後で説明を行う。 Then, the depth estimation apparatus 1 uses the smoothing unit 50 to smooth the selected difference values stored corresponding to all the assumed depth values d of all the (x, y) coordinates of the reference image F C (step) S5: Smoothing operation). The operation of step S5 will be described later with reference to FIG.

そして、奥行推定装置1は、奥行値決定手段60によって、画素位置(x,y)ごとに、平滑化された差分値が最小となる奥行値候補Dを探索し、当該画素位置の奥行値Dを決定する(ステップS6;奥行値決定動作)。このステップS6の動作については、図16を参照して後で説明を行う。   Then, the depth estimation device 1 searches the depth value candidate D having the smallest smoothed difference value for each pixel position (x, y) by the depth value determination means 60, and the depth value D of the pixel position. Is determined (step S6; depth value determination operation). The operation in step S6 will be described later with reference to FIG.

そして、奥行推定装置1は、カウンタnが繰返回数Nと等しいか判定する(ステップS7)。カウンタnが繰返回数Nと等しくない場合(ステップS7でNo)、奥行推定装置1は、ステップS8の処理に進む。   Then, the depth estimation apparatus 1 determines whether the counter n is equal to the number of repetitions N (step S7). When the counter n is not equal to the number of repetitions N (No in step S7), the depth estimation apparatus 1 proceeds to the process of step S8.

そして、奥行推定装置1は、近傍奥行値出力手段25によって、近傍画素PSLの奥行値Dと、近傍画素PSRの奥行値Dとを差分値決定手段30に出力する(ステップS8;近傍奥行値出力動作)。
その後、奥行推定装置1は、カウンタnをインクリメントし(ステップS9)、ステップS1の処理に戻る。
The depth estimation apparatus 1, the near depth value output unit 25, and outputs the depth value D L neighboring pixels P SL, and a depth value D R neighboring pixels P SR to the difference value determination unit 30 (step S8; Neighborhood depth value output operation).
Thereafter, the depth estimation apparatus 1 increments the counter n (step S9), and returns to the process of step S1.

一方、カウンタ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 depth estimation apparatus 1 outputs the depth value D obtained after repeating N times by the depth value determination means 60 as a depth image.
With the above operation, the depth estimation device 1 estimates the depth value D indicating the depth of the subject T from a plurality of camera images.

(対応画素差分演算動作)
次に、図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、カメラ映像(基準映像F,隣接映像F,F)のx座標値およびy座標値を初期化(d=0、x=0、y=0)する(ステップS10)。 First, the depth estimation apparatus 1 initializes the assumed depth value d, the x-coordinate value and the y-coordinate value of the camera video (reference video F C , adjacent video F L , F R ) as variables (d = 0, x = 0, y = 0) (step S10).

そして、対応画素差分演算手段20は、基準映像Fの注目画素Pの画素値と、当該注目画素Pの仮定奥行値dの視差に対応する隣接映像F,Fの対応画素の画素値との差分絶対値である対応画素差分値ECL,ECRを前記した(1)式により演算する。 Then, the corresponding pixel difference calculating unit 20 adds the pixel value of the pixel of interest P C of the reference image F C, the neighboring image F L corresponding to the parallax assumptions depth value d of the pixel of interest P C, of the corresponding pixels of F R Corresponding pixel difference values E CL and E CR which are absolute differences from the pixel values are calculated by the above-described equation (1).

すなわち、対応画素差分演算手段20は、基準映像Fの中の注目画素値P(x,y)に対し、隣接映像Fの画素位置を右にd画素移動した位置の対応画素値P(x+d,y)との差分絶対値である対応画素差分値ECL(d,x,y)を演算する。
また、対応画素差分演算手段20は、基準映像Fの中の注目画素値P(x,y)に対し、隣接映像Fの画素位置をd画素左に移動した位置の対応画素値P(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において注目画素Pの近傍が黒い背景であるか否かを判定する。すなわち、対応画素差分演算手段20は、近傍画素値出力手段15から入力された注目画素Pの画素値P(x,y)と、近傍画素PSLの画素値PSL(x−s,y)と、近傍画素PSRの画素値PSR(x+s,y)との全てが閾値thより小さいか否かを判定する(ステップS12)。 Then, the corresponding pixel difference calculating unit 20 determines whether the vicinity of the target pixel P C in the subject T is a black background. That is, the corresponding pixel difference calculating means 20, the pixel value P C (x, y) of the pixel of interest P C input from the neighboring pixel value output unit 15 and the pixel values of the neighboring pixels P SL P SL (x-s , It is determined whether all of y) and the pixel value P SR (x + s, y) of the neighboring pixel P SR are smaller than the threshold th (step S12).

全ての値が閾値thより小さい場合(ステップS12でYes)、対応画素差分演算手段20は、黒背景フラグがオンまたはオフであるかを判定する(ステップS13)。   When all the values are smaller than the threshold th (Yes in Step S12), the corresponding pixel difference calculation unit 20 determines whether the black background flag is on or off (Step S13).

黒背景フラグがオンの場合(ステップS13でYes)、対応画素差分演算手段20は、前記した(1−1)式のように、仮定奥行値dに係数hを掛けた値(ペナルティ)を、対応画素差分値ECL,ECRに加算する(ステップS14)。 When the black background flag is on (Yes in step S13), the corresponding pixel difference calculation unit 20 calculates a value (penalty) obtained by multiplying the assumed depth value d by the coefficient h as in the above-described equation (1-1). corresponding pixel difference value E CL, is added to E CR (step S14).

黒背景フラグがオフの場合(ステップS13でNo)、対応画素差分演算手段20は、前記した(1−2)式のように、大きい方の近傍奥行値Dと仮定奥行値dとの差分絶対値に係数hを掛けた値(ペナルティ)を、対応画素差分値ECL,ECRに加算する(ステップS15)。 If Black Background flag is off (No in step S13), and the corresponding pixel difference calculating unit 20, the above-mentioned (1-2) as a formula, the larger the difference between the near depth value D M assumed depth value d of A value (penalty) obtained by multiplying the absolute value by the coefficient h is added to the corresponding pixel difference values E CL and E CR (step S15).

一方、全ての値が閾値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 difference calculation unit 20 proceeds to the process of step S16-1.

その後、奥行推定装置1は、変数である仮定奥行値d、カメラ映像のx座標値、y座標値を順次加算(インクリメント)し、仮定奥行値dについては最大視差量になるまで(ステップS16−1,16−2)、x座標値についてはカメラ映像の幅になるまで(ステップS17−1,S17−2)、y座標値についてはカメラ映像の高さになるまで(ステップS18−1,S18−2)、前記した動作を繰り返す。   Thereafter, the depth estimation apparatus 1 sequentially adds (increments) the assumed depth value d, which is a variable, the x-coordinate value of the camera image, and the y-coordinate value, until the assumed depth value d reaches the maximum amount of parallax (step S16— 1, 16-2) until the x-coordinate value reaches the camera image width (steps S17-1 and S17-2), and the y-coordinate value until the camera image height (steps S18-1 and S18). -2) Repeat the above operation.

(差分値決定動作)
以下、図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 depth estimation apparatus 1 initializes the assumed depth value d, the x-coordinate value of the camera image, and the y-coordinate value as variables (d = 0, x = 0, y = 0) (step S20).

平均差分値演算手段30aは、前記した(2)式により、隣接映像の対応画素差分値ECL,ECRの平均差分値Eaを演算する。
最小差分値選択手段30bは、前記した(3)式により、隣接映像の対応画素差分値ECLと隣接映像の対応画素差分値ECRとの最小値を最小差分値Emとして選択する。
差分値選択手段30cは、前記した(4)式〜(7)式により、奥行差分値D、画素差分値DPLR,DPL,DPRを演算する(ステップS21)。
The average difference value calculating means 30a calculates the average difference value Ea of the corresponding pixel difference values E CL and E CR of the adjacent video by the above-described equation (2).
Minimum difference value selecting unit 30b is the aforementioned (3), selects a minimum value of the corresponding pixel difference value E CL of the neighboring image and the corresponding pixel difference value E CR of neighboring image as the minimum difference value Em.
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 value selection unit 30c proceeds to the process of Step 32.
On the other hand, in the case of depth estimation for the second and subsequent times (No in step 22), the difference value selection unit 30c proceeds to the process of step 23.

以下、差分値選択手段30cは、ステップS23からステップS43までの処理によって、対応画素差分値ECL、ECRと、ステップS21で演算した奥行差分値D、画素差分値DPLR,DPL,DPRとに基づいて、選択差分値を選択する。 Hereinafter, the difference value selecting unit 30c is the processing from step S23 to step S43, the corresponding pixel difference value E CL, E CR and, depth difference value D D calculated in step S21, the pixel difference value D PLR, D PL, on the basis of the D PR, to select the selection difference value.

差分値選択手段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 value selection unit 30c selects the average difference value Ea as the selection difference value and stores it in the storage unit 40. Store (step S24).

(4)式および(5)式の両方を満たす場合(ステップS23でYes;被写体境界有)、差分値選択手段30cは、奥行値D,Dを大小比較し、大きい側に前景Bがあると判定する(ステップS25)。 (4) If both of the formulas and (5) (Yes in step S23; subject boundary Yes), the difference value selecting unit 30c is the depth value D L, the D R is the magnitude comparison, foreground B to larger side It is determined that there is (step S25).

右側に前景Bがある場合(ステップS25でYes)、差分値選択手段30cは、前記した(8)式により、注目画素Pが前景B上の画素であるか否かを判定する(ステップS26)。 If the right side has a foreground B (Yes in step S25), and the difference value selecting unit 30c is the aforementioned (8), the pixel of interest P C is determined whether the pixel on the foreground B (step S26 ).

注目画素Pが前景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 value selecting unit 30c determines whether the pixel difference value D PR threshold th3 smaller (step S27).

注目画素Pが前景B上の画素である場合(ステップS27でYes)、差分値選択手段30cは、(12)式により、仮定奥行値dが前景B側の近傍奥行値Dより大きいか否かを判定する(ステップS28)。 If the pixel of interest P C is a pixel on the foreground B (Yes in step S27), the difference value selecting unit 30c is (12) by equation or assumed depth value d is greater than the proximity depth value D R of the foreground B side It is determined whether or not (step S28).

仮定奥行値dが前景B側の近傍奥行値Dより大きい場合(ステップ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 value selecting unit 30c is a penalty p1 added to the average difference value Ea (step S29), stored in the memory means 40 (Step S24).

仮定奥行値dが前景B側の近傍奥行値Dより大きくない場合(ステップS28でNo)、差分値選択手段30cは、仮定奥行値dが正しく、注目画素Pにオクルージョンが発生していないので、平均差分値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 value selecting unit 30c is assumed depth value d is correct, occlusion has not occurred to the pixel of interest P C Therefore, the average difference value Ea is selected as the selected difference value and stored in the storage means 40 (step S24).

注目画素Pが背景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 value selecting unit 30c determines whether the pixel difference value D PL threshold th3 smaller (step S30).

注目画素Pが背景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 value selecting unit 30c, as shown in the above-mentioned (10), the left of the corresponding pixel difference value E CL is the right of the corresponding pixel whether sufficiently smaller than the difference value E CR, be multiplied by a coefficient k to the left of the corresponding pixel difference value E CL, according to whether or not the right of the corresponding pixel difference value E CR is smaller than (step S31).

左側の対応画素差分値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 value selecting unit 30c, the corresponding pixel difference value E CL = minimum difference value Em of the smaller Is selected as a selection difference value (step 32).

左側の対応画素差分値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 value selecting unit 30c determines that the assumed depth value d is not correct. In this case, the difference value selecting unit 30c is whether assumed depth value d is large, whether the left of the corresponding pixel difference value E CL is larger than that multiplied by a coefficient k to the right of the corresponding pixel difference value E CR (Step S33).

仮定奥行値dが大きい場合(ステップS33でYes)、差分値選択手段30cは、この大きな方の対応画素差分値ECLを含む平均差分値Eaを選択差分値として選択し、記憶手段40に記憶する(ステップS24)。 When assuming the depth value d is greater (Yes in step S33), the difference value selecting unit 30c selects the average difference value Ea containing the corresponding pixel difference value E CL of the larger as the selected difference value, stored in the memory means 40 (Step S24).

仮定奥行値dが大きくない場合(ステップS33でNo)、差分値選択手段30cは、対応画素P、P、Pが全て背景A上にあり、仮定奥行値dが正しくないと判定する。この場合、差分値選択手段30cは、平均差分値Eaも最小差分値Emも大きくならないので、平均差分値Eaにペナルティpを加えた値を選択差分値として選択し、記憶手段40に記憶する(ステップS34)。 When assuming the depth value d is not greater (No in step S33), the difference value selecting unit 30c, the corresponding pixel P L, P C, there P R are all on a background A, it determines that the assumed depth value d is not correct . In this case, the difference value selection means 30c selects the value obtained by adding the penalty p to the average difference value Ea and stores it in the storage means 40 because neither the average difference value Ea nor the minimum difference value Em increases. Step S34).

注目画素Pが前景B上の画素でない場合(ステップS27でNo)、または、注目画素Pが背景A上でない場合(ステップS30でNo)、差分値選択手段30cは、注目画素Pが右側にある前景Bと左側にある中景Cの中間にある背景Aに対応すると判定する。この場合、左右どちらのカメラC,Cからも、正しい対応点が見えないので、正しい奥行値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 value selecting unit 30c is the pixel of interest P C is It is determined that the background A is in the middle between the foreground B on the right side and the middle scene C on the left side. In this case, the left or right camera C L, from C R, since the correct corresponding point is not visible, it will not be able to guess the correct depth value D. Therefore, the difference value selecting unit 30c is the aforementioned (10), the left of the corresponding pixel difference value E CL determines whether made sufficiently smaller than the right side of the corresponding pixel difference value E CR (step S35) .

左側の対応画素差分値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 value selecting unit 30c is a value obtained by adding a penalty p1 to the minimum difference value Em at that time It is calculated (step S36) and stored in the storage means 40 as a selected difference value (step S32).

左側の対応画素差分値ECLが右側の対応画素差分値ECRよりも十分小さくない場合(ステップS35でNo)、差分値選択手段30cは、背景Aが左右どちらのカメラC,Cからも見えないと判定する。この場合、差分値選択手段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 value selecting unit 30c, the background A is either the left and right cameras C L, from C R Is determined to be invisible. In this case, the difference value selection means 30c calculates a value obtained by adding the penalty p1 to the average difference value Ea in order to bring the estimated depth value D closer to the correct value (step S29), and stores it in the storage means 40. (Step S24).

左側に前景Bがある場合(ステップS25でNo)、差分値選択手段30cは、注目画素Pが、前景の被写体上の画素であるか否かを、以下の(18)式により判定する(ステップS37)。
PL(x,y)≦DPR(x,y) …(18)式
If the left there is a foreground B (No in step S25), and the difference value selecting unit 30c determines the target pixel P C is, whether the pixel on the foreground object, the following equation (18) ( Step S37).
D PL (x, y) ≦ D PR (x, y) (18)

画素差分値DPLが画素差分値DPR以下の場合(ステップS37でYes、注目画素Pが前景側)、差分値選択手段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 value selecting unit 30c is whether a pixel difference value D PL threshold th3 smaller Determination is made (step S38).

注目画素Pが前景B上の画素にある場合(ステップS38でYes)、差分値選択手段30cは、以下の式(19)により、仮定奥行値dが前景B側の近傍奥行値Dより大きくないか否かを判定する(ステップS39)。
d(x,y)>D(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 value selecting unit 30c is the following equation (19), assuming the depth value d is from near the depth value D L foreground B side It is determined whether it is not large (step S39).
d (x, y)> D L (x−s, y) (19)

仮定奥行値dが前景B側の近傍奥行値Dより大きい場合(ステップ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 value selecting unit 30c calculates a value obtained by adding a penalty p1 to the average difference value Ea (step S29), It memorize | stores in the memory | storage means 40 (step S24).

仮定奥行値dが前景B側の近傍奥行値Dより大きくない場合(ステップS39でNo)、差分値選択手段30cは、仮定奥行値dが正しく、注目画素Pにオクルージョンが発生していないので、平均差分値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 value selecting unit 30c is assumed depth value d is correct, occlusion has not occurred to the pixel of interest P C Therefore, the average difference value Ea is selected as the selected difference value and stored in the storage means 40 (step S24).

画素差分値DPLが画素差分値DPR以下でない場合(ステップS37でNo、注目画素Pが背景側)、差分値選択手段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 value selecting unit 30c is whether a pixel difference value D PR threshold th3 smaller Determine (step S40).

画素差分値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 value selecting unit 30c is the right of the corresponding pixel difference value E CR is whether sufficiently smaller than the left side of the corresponding pixel difference value E CL , even multiplied by a coefficient k to the right of the corresponding pixel difference value E CR, determines depending on whether the left of the corresponding pixel difference value E or CL smaller (step S41).

右側の対応画素差分値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 value selecting unit 30c, the minimum difference value Em = corresponding pixel difference value E CR of the smaller Is selected as a selected difference value and stored in the storage means 40 (step S32).

右側の対応画素差分値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 value selecting unit 30c determines that the assumed depth value d is not correct. In this case, the difference value selecting unit 30c is not whether assumed depth value d is large, the right of the corresponding pixel difference value E CR, greater than or multiplied by coefficient k on the left side of the corresponding pixel difference value E CL (Step S42).

仮定奥行値dが大きい場合(ステップS42でYes)、差分値選択手段30cは、この大きな方の対応画素差分値ECRを含む平均差分値Eaを選択差分値として選択し、記憶手段40に記憶する(ステップS24)。 When assuming the depth value d is greater (Yes in step S42), the difference value selecting unit 30c selects the average difference value Ea containing the corresponding pixel difference value E CR of the larger as the selected difference value, stored in the memory means 40 (Step S24).

仮定奥行値dが大きくない場合(ステップS42でNo)、差分値選択手段30cは、対応画素P、P、Pが全て背景A上にあり、仮定奥行値dが正しくないと判定する。この場合、差分値選択手段30cは、平均差分値Eaも最小差分値Emも大きくならないので、平均差分値Eaにペナルティpを加えた値を算出し、記憶手段40に記憶する(ステップS34)。 When assuming the depth value d is not greater (No in step S42), the difference value selecting unit 30c, the corresponding pixel P L, P C, there P R are all on a background A, it determines that the assumed depth value d is not correct . In this case, since the average difference value Ea and the minimum difference value Em are not increased, the difference value selection means 30c calculates a value obtained by adding the penalty p to the average difference value Ea and stores it in the storage means 40 (step S34).

注目画素Pが前景B上の画素でない場合(ステップS38でNo)、または、注目画素Pが背景A上の画素でない場合(ステップS40でNo)、差分値選択手段30cは、注目画素Pが左側にある前景Bと右側にある中景Cとの中間にある背景Aに対応すると判定する。この場合、左右どちらのカメラC,Cからも、正しい対応点は見えないので、正しい奥行値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 value selecting unit 30c is the pixel of interest P It is determined that C corresponds to the background A that is intermediate between the foreground B on the left side and the middle scene C on the right side. In this case, since the correct corresponding point cannot be seen from the left and right cameras C L and C R , the correct depth value D cannot be estimated. Therefore, the difference value selecting unit 30c is the aforementioned (13), determines whether or not the right of the corresponding pixel difference value E CR is sufficiently smaller than the corresponding pixel difference value E CL of the left (step S43).

右側の対応画素差分値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 value selecting unit 30c is the right of the corresponding pixel difference value E is the minimum difference value Em at that time A value obtained by adding a penalty p1 to CR is calculated (step S36) and stored in the storage means 40 (step S32).

右側の対応画素差分値ECRが左側の対応画素差分値ECLより十分小さくない場合(ステップS43でNo)、差分値選択手段30cは、背景Aが左右どちらのカメラC,Cからも見えないと判定する。この場合、差分値選択手段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 value selecting unit 30c is either the background A left and right cameras C L, from C R Judge that it is not visible. In this case, the difference value selection unit 30c calculates a value obtained by adding the penalty p1 to the average difference value Ea (step S29), and stores it in the storage unit 40 (step S24).

その後、奥行推定装置1は、変数である仮定奥行値d、カメラ映像のx座標値、y座標値を順次加算(インクリメント)し、仮定奥行値dについては最大視差量になるまで(ステップS44,S45)、x座標値についてはカメラ映像の幅になるまで(ステップS46,S47)、y座標値についてはカメラ映像の高さになるまで(ステップS48,S49)、ステップS21からステップS43までの動作を繰り返す。
この差分値決定動作によって、記憶手段40には、基準映像の画素位置(x,y)ごとに、複数の仮定奥行値d(“0”〜最大視差量)に対応した差分値Eが記憶される。
Thereafter, the depth estimation apparatus 1 sequentially adds (increments) the assumed depth value d, which is a variable, the x-coordinate value of the camera image, and the y-coordinate value, until the assumed depth value d reaches the maximum amount of parallax (step S44, S45) The operation from step S21 to step S43 until the x-coordinate value becomes the width of the camera image (steps S46 and S47), and the y-coordinate value becomes the height of the camera image (steps S48 and S49). repeat.
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 value determining unit 30 writes the selected difference value for each assumed depth value d in the storage unit 40 at all pixel positions of the reference video, and then notifies the smoothing unit 50 of the completion of writing.

(平滑化動作)
以下、図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、カメラ映像(基準映像F,隣接映像F,F)のx座標値およびy座標値を初期化(d=0、x=0、y=0)する(ステップS60)。 First, the depth estimation apparatus 1 initializes the assumed depth value d, the x-coordinate value and the y-coordinate value of the camera video (reference video F C , adjacent video F L , F R ) as variables (d = 0, x = 0, y = 0) (step S60).

そして、平滑化手段50は、記憶手段40に記憶されている基準映像Fの(x,y)座標に隣接する座標において、仮定奥行値dの中で選択差分値が最小となる仮定奥行値dを隣接画素の奥行値候補Dとして探索する。 Then, the smoothing unit 50, the reference image F C in the storage means 40 is stored (x, y) in the coordinate adjacent to the coordinates, assumed depth value selected difference value in a hypothetical depth value d is minimum d is searched as a depth value candidate D of an adjacent pixel.

すなわち、平滑化手段50は、基準映像Fの(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に記憶されている基準映像Fの(x,y)座標の奥行値候補Dに対応する選択差分値E(d,x,y)に、注目画素Pの仮定奥行値dと隣接画素の奥行値候補D(x+1,y),D(x,y+1)との差を、注目画素Pの差分値に重み付け加算することで、平滑化した差分値Ev(d,x,y)を演算する(ステップS62)。 Then, the smoothing unit 50, as above-described (16), the reference image F C in the storage means 40 is stored (x, y) selected difference value E corresponding to the depth value candidate D coordinates ( d, x and y), assuming the depth value d and the adjacent pixel depth value candidate D of the pixel of interest P C (x + 1, y ), D (x, a difference in y + 1) and, to the difference value of the pixel of interest P C The smoothed difference value Ev (d, x, y) is calculated by weighted addition (step S62).

その後、奥行推定装置1は、変数である仮定奥行値d、カメラ映像のx座標値、y座標値を順次加算(インクリメント)し、仮定奥行値dについては最大視差量になるまで(ステップS63,S64)、x座標値についてはカメラ映像の幅になるまで(ステップS65,S66)、y座標値についてはカメラ映像の高さになるまで(ステップS67,S68)、ステップS61からステップS62までの動作を繰り返す。
この平滑化動作によって、記憶手段40には、基準映像の画素位置(x,y)ごとに、平滑化差分値Evが記憶される。
Thereafter, the depth estimation apparatus 1 sequentially adds (increments) the assumed depth value d, which is a variable, the x-coordinate value of the camera image, and the y-coordinate value, until the assumed depth value d reaches the maximum parallax amount (step S63, S64) The operation from step S61 to step S62 until the x coordinate value becomes the width of the camera image (steps S65 and S66), and the y coordinate value becomes the height of the camera image (steps S67 and S68). repeat.
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 depth estimation apparatus 1 initializes the x-coordinate value and the y-coordinate value of the camera video as variables (x = y = 0) (step S70).
Then, the depth value determination unit 60 calculates the assumed depth value d that minimizes the smoothed difference value Ev for each pixel position (x, y) for the smoothed difference value Ev stored in the storage unit 40. The searched hypothetical depth value d is determined (stored / output) as the depth value D (x, y) of the subject T at the pixel position (x, y) (step S71).

その後、奥行推定装置1は、変数であるカメラ映像のx座標値、y座標値を順次加算(インクリメント)し、x座標値についてはカメラ映像の幅になるまで(ステップS72,S73)、y座標値についてはカメラ映像の高さになるまで(ステップS74,S75)、ステップS71の動作を繰り返す。これによって、全ての画素位置(x,y)における被写体Tの奥行値Dが決定されることになる。   Thereafter, the depth estimation apparatus 1 sequentially adds (increments) the x-coordinate value and the y-coordinate value of the camera image, which are variables, until the x-coordinate value becomes the width of the camera image (steps S72 and S73). As for the value, the operation of step S71 is repeated until the height of the camera image is reached (steps S74 and S75). As a result, the depth value D of the subject T at all pixel positions (x, y) is determined.

なお、奥行推定装置1は、新たに決定された奥行値Dを用いて、ステップS2からS5の奥行推定動作を、N回(N≧2)繰り返し、最後に得られた奥行値Dを奥行映像Fとして出力する。その結果、奥行推定装置1は、より誤推定を減らした奥行値Dを得ることができる。 The depth estimation apparatus 1 repeats the depth estimation operation in steps S2 to S5 N times (N ≧ 2) using the newly determined depth value D, and uses the depth value D obtained last as the depth video. and outputs it as the F Z. As a result, the depth estimation apparatus 1 can obtain the depth value D with further reduced erroneous estimation.

以上、本発明の実施形態に係る奥行推定装置1の構成および動作について説明したが、本発明は、この実施形態に限定されるものではない。
以下、本発明の種々の変形例について説明する。
As mentioned above, although the structure and operation | movement of the depth estimation apparatus 1 which concern on embodiment of this invention were demonstrated, this invention is not limited to this embodiment.
Hereinafter, various modifications of the present invention will be described.

(変形例1:カメラ配置間隔の変形例)
本実施形態では、被写体を撮影するカメラの設置間隔を等間隔としたが、異なるカメラ間隔としてもよい。
この場合、対応画素差分演算手段20は、それぞれの隣接映像F,Fについて、基準カメラCからのカメラ間隔ごとに、基準映像Fの画素から、視差に対応する画素の位置をそれぞれ求め、当該画素の画素値と、基準映像Fの画素の画素値との差分絶対値を演算すればよい。例えば、本実施形態では、奥行値Dの単位と画素間の視差の単位とを同一とし、奥行値Dが“1”増加することで、1画素ずつ視差が増加することとしたが、この場合、図1に示したカメラC,C間の距離が、カメラC,C間の距離の2倍であったとすると、対応画素差分演算手段20は、前記(1)式の代わりに、以下の(18)式により差分絶対値を算出すればよい。
CL(d,x,y)=|P(x+d,y)−P(x,y)|
CR(d,x,y)=|P(x−2d,y)−P(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 difference calculating unit 20, instead of the (1) The difference absolute value may be calculated by the following equation (18).
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が、基準映像Fの各画素の画素値と、当該画素の仮定奥行値dの視差に対応する隣接映像F,Fの各画素の画素値との差分絶対値を演算することとしたが、この差分絶対値は、対応する画素のみでなく、対応画素を中心とするブロック内の画素値の差分絶対値の重み付け平均値を用いることとしてもよい。例えば、対応画素差分演算手段20は、前記(1)式の対応画素差分値ECL(d,x,y)を、以下の(19)式により算出する。
CL(d,x,y)=|P(x+d,y)−P(x,y)|×1/2
+|P(x+d+1,y)−P(x+1,y)|×1/8
+|P(x+d−1,y)−P(x−1,y)|×1/8
+|P(x+d,y+1)−P(x,y+1)|×1/8
+|P(x+d,y−1)−P(x,y−1)|×1/8
…(19)式
これによって、ノイズ等によって発生する差分絶対値の誤差を低減することができる。
(Modification 2: Modification of the corresponding pixel difference calculation means)
Further, in the present embodiment, the corresponding pixel difference calculation unit 20 calculates the pixel value of each pixel of the reference image F C and each pixel of the adjacent images F L and F R corresponding to the parallax of the assumed depth value d of the pixel. The absolute value of the difference from the pixel value is calculated, but this absolute difference value uses not only the corresponding pixel but also the weighted average value of the absolute difference value of the pixel values in the block centering on the corresponding pixel. It is good. For example, the corresponding pixel difference calculation means 20 calculates the corresponding pixel difference value E CL (d, x, y) of the above equation (1) by the following equation (19).
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)式に示すように、基準映像Fの(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 unit 50 selects the selection difference value E (d, x) corresponding to the assumed depth value d of the (x, y) coordinates of the reference image F C as shown in the equation (16). , Y) is weighted and added with the absolute difference value of the depth value D between two adjacent pixels. As shown in the following equation (20), the absolute difference value of the depth value D between four adjacent pixels is weighted. You may add.
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 depth estimation apparatus 1 according to the embodiment of the present invention has been described above. However, the modification of the depth estimation apparatus 1 can be operated by a depth estimation program that causes a general computer to function as each of the above-described units. The depth estimation program can also be distributed via a communication line, or can be recorded on a recording medium such as a CD-ROM for distribution.

以上説明したように、奥行推定装置1は、オクルージョンが生じていない場合であっても、オクルージョンが生じている場合であっても、複数の仮定奥行値dに対応する画素における差分絶対値の最小値と平均値との差から、画素の奥行値Dを推定する従来の手法に比べ、注目画素Pの画素値と、その近傍画素の画素値と、近傍画素の奥行値Dとによって、差分絶対値の平均値と、最小値と、それらに所定のペナルティを加えた値のいずれか最適な値を選択することで、隣接映像で偽マッチングが発生している場合、その奥行値Dを推定対象から除くことができ、また、オクルージョンが発生している場合、より正しい差分値から奥行値Dを推定することができ、精度よく奥行値Dを推定することができる。 As described above, the depth estimation apparatus 1 is the minimum difference absolute value in pixels corresponding to a plurality of assumed depth values d, regardless of whether occlusion has occurred or occlusion has occurred. from the difference between the value and the average value, compared with the conventional method of estimating a depth value D of the pixel, the pixel value of the pixel of interest P C, and the pixel values of the neighboring pixels, by a depth value D of the neighboring pixels, the difference The depth value D is estimated when false matching occurs in the adjacent video by selecting the optimal value of the average value of the absolute value, the minimum value, and a value obtained by adding a predetermined penalty to the average value. When occlusion occurs, the depth value D can be estimated from a more accurate difference value, and the depth value D can be estimated with high accuracy.

1 奥行推定装置
10 映像入力手段
15 近傍画素値出力手段
20 対応画素差分演算手段
25 近傍奥行値出力手段
30 差分値決定手段
30a 平均差分値演算手段
30b 最小差分値選択手段
30c 差分値選択手段
40 記憶手段
50 平滑化手段
60 奥行値決定手段
DESCRIPTION OF SYMBOLS 1 Depth estimation apparatus 10 Image | video input means 15 Neighborhood pixel value output means 20 Corresponding pixel difference calculation means 25 Neighborhood depth value output means 30 Difference value determination means 30a Average difference value calculation means 30b Minimum difference value selection means 30c Difference value selection means 40 Storage Means 50 Smoothing means 60 Depth value determining means

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.
前記差分値決定手段は、前記近傍画素どうしの奥行値の差が予め設定した第2の閾値より小さいか、または、前記近傍画素どうしの画素値の差が予め設定した第3の閾値より小さい場合、
前記平均差分値を前記選択差分値として決定することを特徴とする請求項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.
前記差分値決定手段は、前記近傍画素どうしの奥行値の差が前記第2の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、左右の前記近傍画素のうち小さい前記奥行値を有する方よりも大きい前記奥行値を有する方の画素値に前記注目画素の画素値が近い場合、
前記平均差分値を前記選択差分値として決定することを特徴とする請求項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.
前記差分値決定手段は、前記近傍画素どうしの奥行値の差が前記第2の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、左右の前記近傍画素のうち小さい前記奥行値を有する方よりも大きい前記奥行値を有する方の画素値に前記注目画素の画素値が近く、前記仮定奥行値が左右の前記近傍画素のうちの前記大きい奥行値より大きい場合、
前記仮定奥行値に前記第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.
前記差分値決定手段は、前記近傍画素どうしの奥行値の差が前記第2の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、左右の前記近傍画素のうち大きい前記奥行値を有する方よりも小さい前記奥行値を有する方の画素値に前記注目画素の画素値が近く、前記小さい奥行値を有する前記近傍画素の対応画素差分値に予め設定した第3の係数を掛けた値が前記大きい奥行値を有する前記近傍画素の対応画素差分値より小さい場合、
前記最小差分値を前記選択差分値として決定することを特徴とする請求項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の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、左右の前記近傍画素のうち大きい前記奥行値を有する方よりも小さい前記奥行値を有する方の画素値に前記注目画素の画素値が近く、前記小さい奥行値を有する前記近傍画素の対応画素差分値に前記第3の係数を掛けた値が前記大きい奥行値を有する前記近傍画素の対応画素差分値より大きい場合、
前記仮定奥行値に予め設定した第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.
前記差分値決定手段は、前記近傍画素どうしの奥行値の差が前記第2の閾値より大きく、前記近傍画素どうしの画素値の差が前記第3の閾値より大きく、前記注目画素の画素値と前記近傍画素の画素値との差が予め設定された第4の閾値より大きい場合、
前記小さい奥行値を有する前記近傍画素の対応画素差分値に前記第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
JP2010092826A 2010-04-14 2010-04-14 Depth estimation device, depth estimation method and depth estimation program Pending JP2011221932A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (2)

* Cited by examiner, † Cited by third party
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