JP5565839B2 - Depth estimation apparatus, depth estimation method, and depth estimation program - Google Patents

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

Info

Publication number
JP5565839B2
JP5565839B2 JP2010218092A JP2010218092A JP5565839B2 JP 5565839 B2 JP5565839 B2 JP 5565839B2 JP 2010218092 A JP2010218092 A JP 2010218092A JP 2010218092 A JP2010218092 A JP 2010218092A JP 5565839 B2 JP5565839 B2 JP 5565839B2
Authority
JP
Japan
Prior art keywords
value
pixel
depth
difference
neighboring
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.)
Expired - Fee Related
Application number
JP2010218092A
Other languages
Japanese (ja)
Other versions
JP2012073813A (en
Inventor
孝憲 妹尾
健詞 山本
隆太朗 大井
保之 市橋
泰市郎 栗田
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 JP2010218092A priority Critical patent/JP5565839B2/en
Publication of JP2012073813A publication Critical patent/JP2012073813A/en
Application granted granted Critical
Publication of JP5565839B2 publication Critical patent/JP5565839B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Measurement Of Optical Distance (AREA)
  • Image Processing (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

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には、図20に示すように、複数のカメラ(C,C,C)で撮影された視差方向に異なるカメラ映像を、時間方向に符号化する技術が開示されている。
この符号化の際に、特許文献1に記載されている発明は、複数のカメラ(C,C,C)で撮影されたカメラ映像(F,F,F)間で、映像内の被写体の奥行値を仮定し、基準となるカメラ(例えば、C)で撮影されたカメラ映像(F)内のブロックに含まれる画素値と、カメラの位置関係と奥行値とから定まる他のカメラ(例えば、C,C)で撮影されたカメラ映像(F,F)内の対応ブロックに含まれる画素値との差分絶対値が最小となる奥行値を求めている。
As shown in FIG. 20, this Patent Document 1 discloses a technique for encoding, in the time direction, camera images that are captured in a plurality of cameras (C 1 , C 2 , C 3 ) and that have different parallax directions. 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). Furthermore, the conventional method may search for false corresponding points (false matching) when the texture of the subject is uniform, and erroneously determine the presence or absence of occlusion when the subject is partly different in color. There are things to do.

本発明は、このような問題点に鑑みてなされたものであり、複数のカメラ映像間で対応点が存在しない場合、一様な被写体で複数のカメラ映像間における対応点が複数存在する場合であっても、奥行値の誤推定を低減することが可能な奥行推定装置、奥行推定方法および奥行推定プログラムを提供することを課題とする。
さらに、本発明は、被写体のテクスチャが一様な場合や、一部の色が異なる被写体の場合であっても、奥行値の誤推定を低減することが可能な奥行推定装置、奥行推定方法および奥行推定プログラムを提供することを課題とする。
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 a depth estimation device, a depth estimation method, and a depth estimation device that can reduce erroneous estimation of a depth value even when the texture of the subject is uniform or when the subject has different colors. It is an object to provide a depth estimation program.

本発明は、前記課題を解決するために創案されたものであり、まず、本願第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 that estimates a depth value indicating the depth of a subject from an image, the image input means, a corresponding pixel difference calculation means, a neighboring pixel value output means, a neighboring depth corresponding pixel value output means, and a difference A value determining unit, a storage unit, a smoothing unit, a depth value determining unit, and a neighborhood depth value output unit are provided.

かかる構成において、奥行推定装置は、映像入力手段によって、前記複数配列した前記カメラの何れかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラ以外の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する。この隣接映像は、基準映像からの視差を計測するための映像であり、例えば、基準カメラに対して左右に位置する2台の隣接カメラで撮影された映像である。   In such a configuration, the depth estimation apparatus uses a video input unit to capture a reference image obtained by capturing the subject with a predetermined reference camera in any of the plurality of cameras arranged, and the subject with an adjacent camera other than the reference camera. Input a plurality of adjacent images taken of. This adjacent video is a video for measuring the parallax from the reference video, and is, for example, a video taken by two adjacent cameras positioned on the left and right with respect to the reference camera.

そして、奥行推定装置は、対応画素差分演算手段によって、前記奥行値を仮定した仮定奥行値および前記基準映像の注目画素ごとに、前記注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する。この仮定奥行値は、基準映像の画素に対応する被写体の奥行値を仮定した値であって、例えば、最小視差(“0”)から最大視差までの値とする。この対応画素差分演算手段によって、基準映像の注目画素の画素値と、隣接映像の仮定奥行値に対応した対応画素値との差分絶対値が算出される。なお、この差分絶対値(隣接映像の対応画素差分値)は、その値が小さい程、仮定奥行値が実際の被写体において同一の対応点を指し示している可能性が高いと言える。   Then, the depth estimation device uses the corresponding pixel difference calculation unit to calculate the pixel value of the pixel of interest and the assumed depth value of the pixel of interest for each pixel of interest of the assumed depth value assuming the depth value and the reference image. 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 includes a pixel value of the target pixel of the reference video and a predetermined number of neighboring pixels left and right from the target pixel in the reference image input to the video input unit by the neighboring pixel value output unit. A pixel value of a neighboring pixel at a distant pixel position is output. Furthermore, the depth estimation apparatus corresponds to the parallax of the depth value of the neighboring pixels from the neighboring video on the left and right with respect to the reference video for each of the assumed depth value and the target pixel by the neighboring depth corresponding pixel value output unit. The pixel value of the neighborhood depth corresponding pixel at the pixel position is output.

そして、奥行推定装置は、差分値決定手段によって、前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と前記近傍画素の画素値と前記近傍画素の奥行値と前記近傍奥行対応画素の画素値とに基づいて、前記最小差分値または前記平均差分値の何れかを、予め定めた条件により選択差分値として決定する。さらに、奥行推定装置は、記憶手段によって、前記差分値決定手段で決定した選択差分値を前記仮定奥行値と前記基準映像の画素位置とに対応付けて記憶する。   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, the depth value of the neighboring pixel, and the pixel value of the neighboring depth corresponding pixel, either the minimum difference value or the average difference value Is determined as a selection difference value according to a predetermined condition. Furthermore, the depth estimation apparatus stores the selection difference value determined by the difference value determination unit in association with the assumed depth value and the pixel position of the reference image by the storage unit.

なお、正しい奥行値に対する選択差分値であれば、その値は小さくなり、ノイズ等によって、ある隣接映像の対応画素差分値が誤った値をとった場合であっても、複数の対応画素差分値を平均化することで、全体として選択差分値が小さくなる。
また、奥行推定装置は、オクルージョンが有ることで、ある対応画素差分値が大きな値となった場合や、一様な被写体のために対応点が複数ある場合であっても、予め定めた条件により、平均差分値と最小差分値とから、最適な値を選択する。つまり、奥行推定装置は、最小差分値、すなわち、オクルージョンが無い側の差分値を、選択差分値として選択する。
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, the depth estimation device has occlusion, so that even when a corresponding pixel difference value becomes a large value or when there are a plurality of corresponding points for a uniform subject, the depth estimation device The optimum value is selected from the average difference value and the minimum difference value. That is, the depth estimation apparatus selects the minimum difference value, that is, the difference value on the side without occlusion as the selection difference value.

ここで、被写体のテクスチャが一様な場合や、一部の色が異なる被写体の場合、注目画素と同一の基準映像から取得した近傍画素の画素値や奥行値を利用するだけでは、奥行値の推定精度が低くなってしまう。このため、奥行推定装置は、隣接画像から取得した近傍奥行対応画素を利用する。   Here, if the texture of the subject is uniform, or if the subject is a part of a different color, the depth value can be calculated simply by using the pixel values and depth values of neighboring pixels acquired from the same reference image as the target pixel. The estimation accuracy is lowered. For this reason, the depth estimation apparatus uses the neighborhood depth corresponding pixel acquired from the adjacent image.

そして、奥行推定装置は、平滑化手段によって、前記注目画素ごとに、当該注目画素の選択差分値に、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の選択差分値が最小となる仮定奥行値との差分を重み付け加算することで、前記選択差分値を平滑化した平滑化差分値を演算すると共に、前記平滑化差分値の総和である平滑化評価値を演算する。
これによって、基準映像の全画素で平滑化手段が平滑化を施すため、奥行値が同じ被写体の中では滑らかに変化するようになり、奥行値の誤推定が低減される。
Then, the depth estimation apparatus uses the smoothing unit to calculate, for each target pixel, a hypothetical depth value that minimizes the selection difference value of the pixel adjacent to the target pixel and the target differential value of the target pixel. A smoothing evaluation value that is a sum of the smoothed difference values is calculated by calculating a smoothed difference value obtained by smoothing the selected difference value by weighting and adding a difference with an assumed depth value at which the selected difference value is minimized. Is calculated.
As a result, the smoothing means performs smoothing on all pixels of the reference video, so that the depth value changes smoothly in the same subject, and the erroneous estimation of the depth value is reduced.

そして、奥行推定装置は、奥行値決定手段によって、前記記憶手段に記憶された選択差分値に対応する仮定奥行値を当該仮定奥行値と異なる奥行値が仮定された第2仮定奥行値に代えることで前記平滑化評価値に相当する再計算評価値を演算し、当該再計算評価値が前記平滑化手段によって演算された平滑化評価値未満の場合、前記第2仮定奥行値を前記基準映像の各画素の奥行値として決定し、当該再計算評価値が前記平滑化評価値未満でない場合、前記記憶手段に記憶された選択差分値に対応する仮定奥行値を前記基準映像の各画素の奥行値として決定する。この第2仮定奥行値は、仮定奥行値と同様、基準映像の画素に対応する被写体の奥行値を仮定した値であって、例えば、最小視差量(“0”)から最大視差量までの値とする。
つまり、奥行値決定手段は、既に算出した仮定奥行値の他に、平滑化評価値が最小となる第2仮定奥行値が存在するかを再度演算し、この第2仮定奥行値が存在する場合には第2仮定奥行値を仮定奥行値として決定する。これによって、仮定奥行値がより正確になる。
Then, the depth estimation apparatus replaces the assumed depth value corresponding to the selection difference value stored in the storage means with a second assumed depth value in which a depth value different from the assumed depth value is assumed by the depth value determination means. When the recalculated evaluation value corresponding to the smoothed evaluation value is calculated and the recalculated evaluation value is less than the smoothed evaluation value calculated by the smoothing means, the second hypothetical depth value is calculated from the reference image. If the recalculated evaluation value is not less than the smoothed evaluation value, the assumed depth value corresponding to the selection difference value stored in the storage means is determined as the depth value of each pixel of the reference image. Determine as. This second hypothetical depth value is a value that assumes the depth value of the subject corresponding to the pixel of the reference image, as with the assumed depth value, and is, for example, a value from the minimum parallax amount (“0”) to the maximum parallax amount. And
That is, the depth value determining means calculates again whether or not there is a second assumed depth value at which the smoothed evaluation value is minimum in addition to the already calculated assumed depth value, and when this second assumed depth value exists. The second assumed depth value is determined as the assumed depth value. This makes the assumed depth value more accurate.

また、本願第2発明に係る奥行推定装置は、前記差分値決定手段が、前記近傍画素同士の奥行値の差分絶対値が予め定めた第1の閾値以下の場合、または、前記近傍画素同士の画素値の差分絶対値が予め定めた第2の閾値以下の場合、前記平均差分値を前記選択差分値として決定することを特徴とする。   Further, in the depth estimation device according to the second invention of the present application, the difference value determining means is configured such that the difference absolute value of the depth value between the neighboring pixels is equal to or less than a predetermined first threshold value, or between the neighboring pixels. When the difference absolute value of the pixel values is equal to or smaller than a predetermined second threshold, the average difference value is determined as the selection difference value.

かかる構成において、奥行推定装置は、差分値決定手段によって、近傍画素の画素値や奥行値の差が小さい場合、注目画素の近傍に前景と背景との境界がないと判定し、平均差分値を選択差分値として選択する。これによって、奥行推定装置は、より正しい選択差分値を選択することができる。   In such a configuration, when the difference between the pixel value and the depth value of the neighboring pixels is small by the difference value determination unit, the depth estimation device determines that there is no boundary between the foreground and the background in the vicinity of the target pixel, and calculates the average difference value. Select as the selected difference value. Thereby, the depth estimation apparatus can select a more correct selection difference value.

また、本願第3発明に係る奥行推定装置は、前記差分値決定手段が、前記近傍画素同士の奥行値の差分絶対値が予め定めた第1の閾値を超え、かつ、前記近傍画素同士の画素値の差分絶対値が予め定めた第2の閾値を越える場合、前記基準映像に対する左右の隣接映像のそれぞれから、前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値を演算すると共に、左右の前記近傍画素のうち小さい方の奥行値を有する側の前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値が、当該小さい方と反対側の前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値より小さい場合、前記最小差分値を前記選択差分値として決定することを特徴とする。   Further, in the depth estimation apparatus according to the third invention of the present application, the difference value determining means has a difference absolute value of a depth value between the neighboring pixels exceeding a predetermined first threshold, and the pixels between the neighboring pixels. If the difference absolute value of the values exceeds a predetermined second threshold, the difference absolute value between the pixel value of the neighboring depth corresponding pixel and the pixel value of the target pixel is calculated from each of the left and right adjacent images with respect to the reference image. And calculating the absolute value of the difference between the pixel value of the neighboring depth corresponding pixel on the side having the smaller depth value of the left and right neighboring pixels and the pixel value of the target pixel, on the opposite side to the smaller one The minimum difference value is determined as the selected difference value when the difference is smaller than the absolute value of the difference between the pixel value of the neighboring depth corresponding pixel and the pixel value of the target pixel.

かかる構成において、奥行推定装置は、差分値決定手段によって、注目画素の画素値が、反対側の近傍奥行対応画素の画素値より、背景がある側の近傍奥行対応画素の画素値に近い場合、オクルージョンが有ると判定し、最小差分値を選択差分値として選択する。これによって、奥行推定装置は、より正しい選択差分値を選択することができる。   In such a configuration, the depth estimation device, when the difference value determining unit causes the pixel value of the target pixel to be closer to the pixel value of the neighboring depth corresponding pixel on the side where the background is present than the pixel value of the neighboring depth corresponding pixel on the opposite side, It is determined that there is occlusion, and the minimum difference value is selected as the selected difference value. Thereby, the depth estimation apparatus can select a more correct selection difference value.

また、本願第4発明に係る奥行推定装置は、前記差分値決定手段が、前記近傍画素同士の奥行値の差分絶対値が予め定めた第1の閾値を超え、かつ、前記近傍画素同士の画素値の差分絶対値が予め定めた第2の閾値を越える場合、前記基準映像に対する左右の隣接映像のそれぞれから、前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値を演算すると共に、左右の前記近傍画素のうち小さい方の奥行値を有する側の前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値が、当該小さい方と反対側の前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値より小さくない場合、前記平均差分値を前記選択差分値として決定することを特徴とする。   Further, in the depth estimation apparatus according to the fourth invention of the present application, the difference value determining means has a difference absolute value of a depth value between the neighboring pixels exceeding a predetermined first threshold value, and a pixel between the neighboring pixels. If the difference absolute value of the values exceeds a predetermined second threshold, the difference absolute value between the pixel value of the neighboring depth corresponding pixel and the pixel value of the target pixel is calculated from each of the left and right adjacent images with respect to the reference image. And calculating the absolute value of the difference between the pixel value of the neighboring depth corresponding pixel on the side having the smaller depth value of the left and right neighboring pixels and the pixel value of the target pixel, on the opposite side to the smaller one The average difference value is determined as the selection difference value when it is not smaller than the absolute difference value between the pixel value of the neighboring depth corresponding pixel and the pixel value of the target pixel.

かかる構成において、奥行推定装置は、差分値決定手段によって、注目画素の画素値が、背景がある側の近傍奥行対応画素の画素値より、反対側の近傍奥行対応画素の画素値に近い場合、オクルージョンが無いと判定し、平均差分値を選択差分値として選択する。これによって、奥行推定装置は、より正しい選択差分値を選択することができる。   In such a configuration, the depth estimation device, when the difference value determining unit causes the pixel value of the target pixel to be closer to the pixel value of the neighboring depth corresponding pixel on the opposite side than the pixel value of the neighboring depth corresponding pixel on the side where the background exists, It is determined that there is no occlusion, and the average difference value is selected as the selected difference value. Thereby, the depth estimation apparatus can select a more correct selection difference value.

また、本願第5発明に係る奥行推定装置は、前記差分値決定手段が、前記奥行値の推定回数が1回目の場合、前記平均差分値を前記選択差分値として決定し、前記奥行値の推定回数が2回目以降の場合、前記予め定めた条件により前記選択差分値を決定することを特徴とする。   Further, in the depth estimation device according to the fifth invention of the present application, the difference value determination means determines the average difference value as the selected difference value when the depth value 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 according to the predetermined condition.

かかる構成において、奥行推定装置は、1回目の奥行推定では、平均差分値を選択差分値として決定することで、偽マッチングを防止して、テクスチャが一様の被写体であっても正しい奥行値を推定する。そして、奥行推定装置は、得られた奥行値を用いて2回目以降の奥行推定を行うことで、オクルージョンの有無を正確に判定することができる。   In such a configuration, the depth estimation apparatus determines the average difference value as the selection difference value in the first depth estimation, thereby preventing false matching and obtaining a correct depth value even for a subject with a uniform texture. presume. And the depth estimation apparatus can determine the presence or absence of occlusion correctly by performing the depth estimation after the 2nd time using the obtained depth value.

また、本願第6発明に係る奥行推定装置は、前記対応画素差分演算手段が、前記基準映像の左右に位置する隣接映像から前記対応画素が外れる場合、前記基準映像に対して、前記対応画素が外れる側の隣接画像に反対側の隣接映像と、当該反対側の隣接映像にさらに隣接する隣接映像とにおいて、前記対応画素の画素値の差分絶対値を前記対応画素差分値として演算することを特徴とする。   Further, in the depth estimation device according to the sixth invention of the present application, when the corresponding pixel difference calculation means deviates from the adjacent video located on the left and right of the reference video, the corresponding pixel is determined with respect to the reference video. The difference absolute value of the pixel value of the corresponding pixel is calculated as the corresponding pixel difference value between the adjacent image on the opposite side to the adjacent image on the detachment side and the adjacent video further adjacent to the adjacent image on the opposite side. And

かかる構成において、奥行推定装置は、対応画素差分演算手段によって、基準映像内の注目画素に対応する対応画素が映像内にある2つの隣接映像を用いて、対応画素差分値を演算する。これによって、奥行推定装置は、偽マッチングを防止することができる。   In such a configuration, the depth estimation apparatus calculates the corresponding pixel difference value by using the corresponding pixel difference calculation means, using two adjacent images in which the corresponding pixels corresponding to the target pixel in the reference image are in the image. Thereby, the depth estimation device can prevent false matching.

また、本願第7発明に係る奥行推定装置は、前記近傍奥行値出力手段が、前記近傍画素同士の奥行値の差分絶対値が予め定めた閾値(第1の閾値)以下の場合、前記近傍画素数を半分とし、前記注目画素から当該近傍画素数だけ左右に離れた画素位置の近傍画素の奥行値を出力することを特徴とする。   Further, in the depth estimation device according to the seventh invention of the present application, when the neighboring depth value output means has a difference absolute value of a depth value between the neighboring pixels equal to or smaller than a predetermined threshold (first threshold), the neighboring pixels The number is halved, and the depth value of a neighboring pixel at a pixel position that is separated from the pixel of interest by the number of neighboring pixels is output.

かかる構成において、奥行推定装置は、大きな視差量を持つために基準映像内では遠くに離れた被写体であっても、オクルージョンの有無を判定すると共に、オクルージョンが無いと判定された場合であっても、近傍画素までの距離を半分にして、隣接映像でのオクルージョンの有無を再度判定することになる。これによって、奥行推定装置は、左右の幅が狭い被写体(例えば、柱)であっても、隣接映像でのオクルージョンの有無を正しく判定することができる。   In such a configuration, the depth estimation device has a large amount of parallax, so even if it is a subject far away in the reference video, it determines whether or not there is occlusion and even if it is determined that there is no occlusion. Then, the distance to the neighboring pixels is halved, and the presence / absence of occlusion in the adjacent video is determined again. Accordingly, the depth estimation apparatus can correctly determine the presence or absence of occlusion in the adjacent video even for a subject (eg, a pillar) with a narrow left and right width.

また、本願第8発明に係る奥行推定方法は、予め定めた位置に複数配列したカメラで同一の被写体を撮影した複数のカメラ映像から、前記被写体の奥行きを示す奥行値を推定する奥行推定方法であって、映像入力ステップと、対応画素差分演算ステップと、差分値決定ステップと、平滑化ステップと、奥行値決定ステップとを備え、差分値決定ステップが、近傍画素値出力ステップと、近傍奥行値出力ステップと、近傍奥行対応画素値出力ステップとを備える手順とした。   The depth estimation method according to the eighth invention of the present application 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 video input step, a corresponding pixel difference calculation step, a difference value determination step, a smoothing step, and a depth value determination step, wherein the difference value determination step includes a neighboring pixel value output step, a neighboring depth value The procedure includes an output step and a neighborhood depth corresponding pixel value output step.

かかる手順において、奥行推定方法は、映像入力ステップにおいて、映像入力手段が、前記複数配列した前記カメラの何れかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラ以外の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する。そして、奥行推定方法は、対応画素差分演算ステップにおいて、対応画素差分演算手段が、前記奥行値を仮定した仮定奥行値および前記基準映像の注目画素ごとに、前記注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する。   In this procedure, the depth estimation method includes a reference image obtained by photographing the subject with a predetermined reference camera in any one of the plurality of cameras arranged in the image input step, and an image other than the reference camera. A plurality of adjacent images obtained by photographing the subject with an adjacent camera are input. Then, in the corresponding pixel difference calculating step, the corresponding pixel difference calculating means is configured such that the corresponding pixel difference calculating means determines the pixel value of the target pixel and the target pixel for each of the assumed depth value assuming the depth value and the target pixel of the reference image. A corresponding pixel difference value, which is an absolute difference value with respect to the pixel values of the corresponding pixels of the plurality of adjacent images at the pixel position corresponding to the parallax of the assumed depth value of the pixel, is calculated.

そして、奥行推定方法は、差分値決定ステップにおいて、差分値決定手段が、前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と、予め定めた近傍画素数だけ前記注目画素から左右に離れた画素位置にある近傍画素の画素値と前記近傍画素の奥行値と、前記近傍画素の奥行値の視差に対応する画素位置にある近傍奥行対応画素の画素値とに基づいて、前記最小差分値または前記平均差分値の何れかを、予め定めた条件により選択差分値として決定して、当該選択差分値を前記仮定奥行値と前記基準映像の画素位置とに対応付けて記憶手段に書き込む。 Then, in the depth estimation method, in the difference value determination step, the difference value determination means 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 the corresponding pixel difference value. determining the minimum difference value is a minimum value of the pixel value of the pixel of interest, and the pixel values of the neighboring pixels from only the target pixel number neighboring pixels to the pixel position apart horizontally a predetermined depth of the neighboring pixel The minimum difference value or the average difference value is selected according to a predetermined condition based on the value and the pixel value of the neighboring depth corresponding pixel at the pixel position corresponding to the parallax of the depth value of the neighboring pixel. The difference value is determined and the selected difference value is written in the storage means in association with the assumed depth value and the pixel position of the reference image.

そして、奥行推定方法は、平滑化ステップにおいて、平滑化手段が、前記注目画素ごとに、当該注目画素の選択差分値に、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の選択差分値が最小となる仮定奥行値との差分を重み付け加算することで、前記選択差分値を平滑化した平滑化差分値を演算すると共に、前記平滑化差分値の総和である平滑化評価値を演算する。   Then, in the depth estimation method, in the smoothing step, for each pixel of interest, the smoothing unit assumes an assumed depth value at which the selection difference value of the pixel adjacent to the pixel of interest is the smallest in the selection difference value of the pixel of interest. And calculating the smoothed difference value obtained by smoothing the selected difference value by weighting and adding the difference between the selected depth value and the assumed depth value at which the selected difference value of the target pixel is minimum. A certain smoothing evaluation value is calculated.

そして、奥行推定方法は、奥行値決定ステップにおいて、奥行値決定手段が、前記記憶手段に記憶された選択差分値に対応する仮定奥行値を当該仮定奥行値と異なる奥行値が仮定された第2仮定奥行値に代えることで前記平滑化評価値に相当する再計算評価値を演算し、当該再計算評価値が前記平滑化手段によって演算された平滑化評価値未満の場合、前記第2仮定奥行値を前記基準映像の各画素の奥行値として決定し、当該再計算評価値が前記平滑化評価値未満でない場合、前記記憶手段に記憶された選択差分値に対応する仮定奥行値を前記基準映像の各画素の奥行値として決定する。   In the depth estimation method, in the depth value determination step, the depth value determination means assumes that the assumed depth value corresponding to the selection difference value stored in the storage means is a depth value different from the assumed depth value. When the recalculated evaluation value corresponding to the smoothed evaluation value is calculated by replacing with the assumed depth value, and the recalculated evaluation value is less than the smoothed evaluation value calculated by the smoothing means, the second assumed depth A value is determined as the depth value of each pixel of the reference image, and if the recalculated evaluation value is not less than the smoothing evaluation value, an assumed depth value corresponding to the selection difference value stored in the storage means is determined as the reference image Is determined as the depth value of each pixel.

そして、奥行推定方法は、近傍奥行値出力ステップにおいて、近傍奥行値出力手段が、前記近傍画素の奥行値を出力する。さらに、奥行推定方法は、近傍画素値出力ステップにおいて、近傍画素値出力手段が、前記基準映像における前記基準映像の注目画素の画素値と、前記近傍画素の画素値とを出力する。 In the depth estimation method, in the neighborhood depth value output step, the neighborhood depth value output means outputs the depth value of the neighborhood pixel. Further, the depth estimation method, the neighboring pixel value output step, the neighboring pixel value output means, for outputting the pixel value of the target pixel of the reference image in the reference image and the pixel values of the neighboring pixels.

そして、奥行推定方法は、近傍奥行対応画素値出力ステップにおいて、近傍奥行対応画素値出力手段が、前記仮定奥行値および前記注目画素ごとに、前記基準映像に対して左右の隣接映像から、前記近傍奥行対応画素の画素値を出力する。 The depth estimation method, in the vicinity depth corresponding pixel value output step, the proximity depth corresponding pixel value output means, for each of the pixel of interest the assumption depth value and, from the left and right neighboring image with respect to the reference image, before Symbol and it outputs the pixel values of the near neighbor depth corresponding pixel.

また、本願第9発明に係る奥行推定プログラムは、予め定めた位置に複数配列したカメラで同一の被写体を撮影した複数のカメラ映像から、前記被写体の奥行きを示す奥行値を推定するために、コンピュータを、映像入力手段、対応画素差分演算手段、近傍画素値出力手段、近傍奥行対応画素値出力手段、差分値決定手段、平滑化手段、奥行値決定手段、近傍奥行値出力手段として機能させる構成とした。   The depth estimation program according to the ninth 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, corresponding pixel difference calculation means, neighborhood pixel value output means, neighborhood depth corresponding pixel value output means, difference value determination means, smoothing means, depth value determination means, and neighborhood depth value output means. did.

かかる構成において、奥行推定プログラムは、映像入力手段によって、前記複数配列した前記カメラの何れかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラ以外の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する。そして、奥行推定プログラムは、対応画素差分演算手段によって、前記奥行値を仮定した仮定奥行値および前記基準映像の注目画素ごとに、前記注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する。   In such a configuration, the depth estimation program uses the video input means to capture a reference image obtained by photographing the subject with a predetermined reference camera in any of the plurality of cameras arranged, and the subject with an adjacent camera other than the reference camera. Input a plurality of adjacent images taken of. Then, the depth estimation program calculates the pixel value of the pixel of interest and the assumed depth value of the pixel of interest for each pixel of interest of the assumed depth value and the reference image assuming the depth value by the corresponding pixel difference calculation means. 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 outputs the pixel value of the target pixel of the reference video and the predetermined number of neighboring pixels from the target pixel to the left and right in the reference video input to the video input unit by the neighboring pixel value output unit. A pixel value of a neighboring pixel at a distant pixel position is output. Further, the depth estimation program responds to the parallax of the depth value of the neighboring pixels from the adjacent images on the left and right with respect to the reference image for each of the assumed depth value and the target pixel by the neighboring depth corresponding pixel value output unit. The pixel value of the neighborhood depth corresponding pixel at the pixel position is output.

そして、奥行推定プログラムは、差分値決定手段によって、前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と前記近傍画素の画素値と前記近傍画素の奥行値と前記近傍奥行対応画素の画素値とに基づいて、前記最小差分値または前記平均差分値の何れかを、予め定めた条件により選択差分値として決定して、当該選択差分値を前記仮定奥行値と前記基準映像の画素位置とに対応付けて記憶手段に書き込む。   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, the depth value of the neighboring pixel, and the pixel value of the neighboring depth corresponding pixel, either the minimum difference value or the average difference value Is determined as a selected difference value according to a predetermined condition, and the selected difference value is written in the storage means in association with the assumed depth value and the pixel position of the reference image.

そして、奥行推定プログラムは、平滑化手段によって、前記注目画素ごとに、当該注目画素の選択差分値に、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の選択差分値が最小となる仮定奥行値との差分を重み付け加算することで、前記選択差分値を平滑化した平滑化差分値を演算すると共に、前記平滑化差分値の総和である平滑化評価値を演算して、当該平滑化差分値を前記仮定奥行値と前記基準映像の画素位置とに対応付けて記憶手段に書き込む。   Then, the depth estimation program causes the smoothing unit to calculate, for each target pixel, an assumed depth value that minimizes a selection difference value of a pixel adjacent to the target pixel and the target pixel's selection difference value. A smoothing evaluation value that is a sum of the smoothed difference values is calculated by calculating a smoothed difference value obtained by smoothing the selected difference value by weighting and adding a difference with an assumed depth value at which the selected difference value is minimized. And the smoothed difference value is written in the storage means in association with the assumed depth value and the pixel position of the reference image.

そして、奥行推定プログラムは、奥行値決定手段によって、前記記憶手段に記憶された選択差分値に対応する仮定奥行値を当該仮定奥行値と異なる奥行値が仮定された第2仮定奥行値に代えることで前記平滑化評価値に相当する再計算評価値を演算し、当該再計算評価値が前記平滑化手段によって演算された平滑化評価値未満の場合、前記第2仮定奥行値を前記基準映像の各画素の奥行値として決定し、当該再計算評価値が前記平滑化評価値未満でない場合、前記記憶手段に記憶された選択差分値に対応する仮定奥行値を前記基準映像の各画素の奥行値として決定する。さらに、奥行推定プログラムは、近傍奥行値出力手段によって、前記奥行値決定手段から基準映像の各画素の奥行値が入力されると共に、前記近傍画素の奥行値を前記近傍奥行対応画素値出力手段および前記差分値決定手段に出力する。   Then, the depth estimation program replaces the assumed depth value corresponding to the selection difference value stored in the storage means with the second assumed depth value in which a depth value different from the assumed depth value is assumed by the depth value determining means. When the recalculated evaluation value corresponding to the smoothed evaluation value is calculated and the recalculated evaluation value is less than the smoothed evaluation value calculated by the smoothing means, the second hypothetical depth value is calculated from the reference image. If the recalculated evaluation value is not less than the smoothed evaluation value, the assumed depth value corresponding to the selection difference value stored in the storage means is determined as the depth value of each pixel of the reference image. Determine as. 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 outputs the depth value of the neighboring pixels to the neighborhood depth corresponding pixel value output means and Output to the difference value determining means.

本発明は、以下に示す優れた効果を奏するものである。
本願第1,8,9発明によれば、一部の色が異なる被写体にオクルージョンが有る場合であっても、注目画素の画素値と近傍奥行対応画素の画素値との比較によって、被写体の色の違いにかかわらず、オクルージョンの有無を判定する。オクルージョンが有ると判定された場合、本願第1,8,9発明によれば、最小差分値、すなわち、オクルージョンが無い側の差分値を、選択差分値として正しく選択できる。
The present invention has the following excellent effects.
According to the first, eighth, and ninth inventions of the present application, even when some subjects with different colors have occlusion, the color of the subject is determined by comparing the pixel value of the target pixel with the pixel value of the neighboring depth corresponding pixel. Whether or not there is occlusion regardless of the difference. When it is determined that there is occlusion, according to the first, eighth, and ninth inventions of the present application, the minimum difference value, that is, the difference value on the side without occlusion can be correctly selected as the selection difference value.

また、本願第1,8,9発明によれば、テクスチャが一様な被写体のために偽マッチングが生じる場合であっても、注目画素の画素値と近傍奥行対応画素の画素値との比較によって、オクルージョンの有無を判定する。オクルージョンが無いと判定された場合、本願第1,8,9発明によれば、偽マッチングを防止するため、平均差分値を選択差分値として選択する。このように、正しい選択差分値を選択できるため、本願第1,8,9発明によれば、奥行値の誤推定を低減することができる。   Further, according to the first, eighth, and ninth inventions of the present application, even when false matching occurs due to a subject having a uniform texture, the pixel value of the target pixel is compared with the pixel value of the neighboring depth corresponding pixel. Determine if there is occlusion. When it is determined that there is no occlusion, according to the first, eighth, and ninth inventions, the average difference value is selected as the selected difference value in order to prevent false matching. Thus, since a correct selection difference value can be selected, according to the first, eighth, and ninth inventions of the present application, it is possible to reduce erroneous estimation of the depth value.

本願第2発明によれば、注目画素が被写体の境界付近になく、オクルージョンが無い場合、平均差分値を選択差分値として選択することにより、偽マッチングを防止する。これによって、本願第2発明によれば、より正しい選択差分値を選択し、奥行値の推定精度をより向上させることができる。   According to the second invention of this application, when the target pixel is not near the boundary of the subject and there is no occlusion, false matching is prevented by selecting the average difference value as the selection difference value. Thus, according to the second invention of the present application, a more correct selection difference value can be selected, and the depth value estimation accuracy can be further improved.

本願第3発明によれば、左右の対応画素でオクルージョンが有る場合、左右の差分絶対値のうち、オクルージョンが無い側の選択差分値を選択する。これによって、本願第3発明によれば、正しい選択差分値を選択し、奥行値の推定精度をより向上させることができる。   According to the third invention of this application, when there is occlusion in the left and right corresponding pixels, the selection difference value on the side without occlusion is selected from the left and right difference absolute values. Thus, according to the third invention of the present application, a correct selection difference value can be selected, and the depth value estimation accuracy can be further improved.

本願第4発明によれば、注目画素が被写体の境界付近にあっても、隣接映像でオクルージョンが無い場合、平均差分値を選択差分値として選択することにより、偽マッチングを防止する。これによって、本願第3発明によれば、正しい選択差分値を選択し、奥行値の推定精度をより向上させることができる。   According to the fourth aspect of the present invention, even if the target pixel is near the boundary of the subject, if there is no occlusion in the adjacent video, false matching is prevented by selecting the average difference value as the selection difference value. Thus, according to the third invention of the present application, a correct selection difference value can be selected, and the depth value estimation accuracy can be further improved.

本願第5発明によれば、1回目の奥行推定では、平均差分値を選択することで、偽マッチングを防止して、テクスチャが一様の被写体であっても正しい奥行値を推定できる。さらに、本願第5発明によれば、この推定した奥行値を用いて、2回目以降の奥行推定を行うことで、オクルージョンの有無を正確に判定することができ、奥行値の推定精度をより向上させることができる。   According to the fifth aspect of the present invention, in the first depth estimation, by selecting an average difference value, false matching can be prevented, and a correct depth value can be estimated even if the subject has a uniform texture. Furthermore, according to the fifth invention of the present application, by using the estimated depth value, the depth estimation is performed for the second and subsequent times, so that the presence or absence of occlusion can be accurately determined, and the estimation accuracy of the depth value is further improved. Can be made.

本願第6発明によれば、注目画素が基準映像の端に位置して、左右の隣接映像から対応画素が外れる場合であっても、対応画素が外れない別の隣接映像を用いて、対応画素の差分絶対値を演算する。これによって、本願第6発明によれば、偽マッチングを防止し、奥行値の推定精度をより向上させることができる。   According to the sixth aspect of the present invention, even when the target pixel is located at the end of the reference image and the corresponding pixel is deviated from the left and right adjacent images, another corresponding image in which the corresponding pixel is not deviated is used. The absolute difference value of is calculated. Thus, according to the sixth aspect of the present invention, false matching can be prevented, and the depth value estimation accuracy can be further improved.

本願第7発明によれば、非常に大きな視差を持つ被写体であっても、隣接映像でオクルージョンが有る可能性のある画素位置での近傍奥行対応画素の画素値を調べるので、オクルージョンの有無を正しく判定できる。また、本願第7発明によれば、幅の細い被写体であっても、隣接画素までの距離を変えてオクルージョンの有無を判定するので、この被写体を見逃すことが少ない。このように、本願第7発明によれば、オクルージョンの有無を正しく判定すると共に、非常に大きな視差を持つ被写体を見逃すことが少なく、奥行値の推定精度をより向上させることができる。   According to the seventh invention of the present application, even if the subject has a very large parallax, the pixel value of the neighboring depth corresponding pixel at the pixel position where there is a possibility of occlusion in the adjacent video is checked. Can be judged. Further, according to the seventh invention of the present application, even if the subject is narrow, the presence / absence of occlusion is determined by changing the distance to the adjacent pixel, so this subject is rarely missed. As described above, according to the seventh invention of the present application, it is possible to correctly determine the presence or absence of occlusion, to miss an object having a very large parallax, and to further improve the estimation accuracy of the depth value.

本発明の第1実施形態に係る奥行推定システムの構成を示すブロック図である。It is a block diagram which shows the structure of the depth estimation system which concerns on 1st Embodiment of this invention. 本発明の第1実施形態に係る奥行推定装置の構成を示すブロック図である。It is a block diagram which shows the structure of the depth estimation apparatus which concerns on 1st Embodiment of this invention. 本発明において、オクルージョンが有るが仮定奥行値が正しい場合において、注目画素と左右の対応画素との関係を説明するための説明図である。In the present invention, when there is occlusion but the assumed depth value is correct, it is an explanatory diagram for explaining the relationship between a pixel of interest and left and right corresponding pixels. 本発明において、対応画素が左右の隣接映像から外れる場合を説明するための説明図である。In this invention, it is explanatory drawing for demonstrating the case where a corresponding pixel remove | deviates from the left and right adjacent image | video. 本発明において、注目画素と近傍画素との関係を説明するための説明図である。In this invention, it is explanatory drawing for demonstrating the relationship between an attention pixel and a neighboring pixel. 本発明において、近傍画素の奥行値を説明するための説明図である。In this invention, it is explanatory drawing for demonstrating the depth value of a neighboring pixel. 本発明において、近傍画素の奥行値に対応する近傍奥行対応画素を説明するための説明図である。In this invention, it is explanatory drawing for demonstrating the neighborhood depth corresponding | compatible pixel corresponding to the depth value of a neighborhood pixel. 図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 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 neighborhood depth value output operation | movement of the depth estimation apparatus of FIG. 図2の奥行推定装置の差分値選択動作を示すフローチャーである。It is a flowchart which shows the difference value selection operation | movement of the depth estimation apparatus of FIG. 図2の奥行推定装置の近傍画素値出力動作を示すフローチャーである。It is a flowchart which shows the neighborhood pixel value output operation | movement of the depth estimation apparatus of FIG. 図2の奥行推定装置の近傍奥行対応画素値出力動作を示すフローチャーである。It is a flowchart which shows the neighborhood depth corresponding | compatible pixel value output 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. 本発明の第2実施形態に係る奥行推定システムの構成を示すブロック図である。It is a block diagram which shows the structure of the depth estimation system which concerns on 2nd Embodiment of this invention. 本発明の第2実施形態に係る奥行推定装置の構成を示すブロック図である。It is a block diagram which shows the structure of the depth estimation apparatus which concerns on 2nd Embodiment of this invention. 図18の奥行推定装置の対応画素差分演算動作を示すフローチャートである。FIG. 19 is a flowchart illustrating a corresponding pixel difference calculation operation of the depth estimation device in FIG. 18. FIG. 従来の奥行推定手法を説明するための説明図である。It is explanatory drawing for demonstrating the conventional depth estimation method.

以下、本発明の各実施形態について、適宜図面を参照しながら詳細に説明する。なお、各実施形態において、同一の機能を有する手段には同一の符号を付し、説明を省略した。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings as appropriate. In each embodiment, means having the same function are denoted by the same reference numerals and description thereof is omitted.

(第1実施形態)
[奥行推定システムの全体構成]
以下、本発明の第1実施形態について図面を参照して説明する。
図1を参照して、本発明の第1実施形態に係る奥行推定装置1を含んだ奥行推定システムSの全体構成について説明する。奥行推定システムSは、複数配列したカメラCMで被写体Tを撮影した多視点映像から、被写体Tの奥行値D(図2参照)を推定した奥行映像Fを生成するものである。図1に示した奥行推定システムSは、カメラCM(CLL,C,C,C,CRR)と、奥行推定装置1とを備えている。なお、複数のカメラCLL,C,C,C,CRRをまとめて、カメラCMと記載する。
(First embodiment)
[Overall configuration of depth estimation system]
Hereinafter, a first embodiment of the present invention will be described with reference to the drawings.
With reference to FIG. 1, the whole structure of the depth estimation system S containing the depth estimation apparatus 1 which concerns on 1st 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 subject T depth value D (see FIG. 2). The depth estimation system S shown in FIG. 1 includes a camera CM (C LL , C L , C C , C R , C RR ) and a depth estimation device 1. A plurality of cameras C LL , C L , C C , C R , and C RR are collectively referred to as a camera CM.

カメラCMは、被写体Tを撮影する一般的な撮影装置である。ここでは、水平方向の視差に応じて奥行値Dを生成することとし、視差の基準となるカメラ(基準カメラ)Cに対し、水平方向に予め定めた距離Lだけ互いに等間隔で離間して、カメラ(隣接カメラ)CLL,C,C,CRRを平行に配置している。このカメラCM(CLL,C,C,C,CRR)で撮影された映像(FLL,F,F,F,FRR)は、奥行推定装置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 spaced from each other at regular intervals by a distance L determined in advance in the horizontal direction The cameras (adjacent cameras) C LL , C L , C R , and C RR are arranged in parallel. Videos (F LL , F L , F C , F R , F RR ) captured by this camera CM (C LL , C L , C C , C R , C RR ) 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)を撮影するものである。さらに、カメラCRRは、カメラCの右に配置されたカメラであって、隣接映像Fに代わって対応画素を求めるための隣接映像FRRを撮影するものである。さらに、カメラCLLは、カメラCの左に配置されたカメラであって、隣接映像Fに代わって対応画素を求めるための隣接映像FLLを撮影するものである。 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. Further, the camera C RR is a camera C R right arranged camera is for capturing a neighboring image F RR to determine the corresponding pixels on behalf of the neighboring image F L. Further, the camera C LL is a camera arranged on the left of the camera C L, is intended to take a neighboring image F LL for determining the corresponding pixel in place of the neighboring image F R.

なお、垂直方向の視差に応じて奥行値Dを生成する場合であれば、カメラCMの配置は、垂直方向に離間させて配置すればよい。
また、カメラCMが撮影する映像(FLL,F,F,F,FRR)は、静止画であっても動画であっても構わない。動画である場合、カメラCMは、互いにフレーム同期を行うことで、順次、静止画のフレーム画像として奥行推定装置1に入力されることとする。あるいは、フレーム画像ごとにタイムコードを付加し、奥行推定装置1で同期をとることとしてもよい。
If the depth value D is generated according to the vertical parallax, the camera CMs may be arranged apart from each other in the vertical direction.
In addition, the video (F LL , F L , F C , F R , F RR ) captured by the camera CM may be a still image or a moving image. In the case of a moving image, the camera CM performs frame synchronization with each other, 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(CLL,C,C,C,CRR)で被写体Tを撮影したカメラ映像(FLL,F,F,F,FRR)から、被写体Tの奥行きを示す奥行値Dを推定する。なお、ここでは、奥行推定装置1は、奥行値Dを、映像の各画素値に対応付けることで奥行映像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 includes a camera CM arranged in the horizontal direction (C LL, C L, C C, C R, C RR) camera video (F LL obtained by photographing a subject T in, F L, F C, Depth value D indicating the depth of subject T is estimated from F R , F RR ). Here, the depth estimation apparatus 1, the depth value D, and the generating a depth image F Z by associating to each pixel value of the image.

[奥行推定装置の構成]
図2を参照して、本発明の第1実施形態に係る奥行推定装置1の構成について説明する(適宜図1参照)。図2に示すように、奥行推定装置1は、映像入力手段10と、対応画素差分演算手段20と、近傍画素値出力手段30と、近傍奥行値出力手段40と、近傍奥行対応画素値出力手段50と、差分値決定手段60と、記憶手段70と、平滑化手段80と、奥行値決定手段90とを備える。
[Configuration of depth estimation device]
With reference to FIG. 2, the structure of the depth estimation apparatus 1 which concerns on 1st Embodiment of this invention is demonstrated (refer FIG. 1 suitably). As shown in FIG. 2, the depth estimation apparatus 1 includes a video input unit 10, a corresponding pixel difference calculation unit 20, a neighboring pixel value output unit 30, a neighboring depth value output unit 40, and a neighboring depth corresponding pixel value output unit. 50, a difference value determining unit 60, a storage unit 70, a smoothing unit 80, and a depth value determining unit 90.

映像入力手段10は、カメラCMで撮影された複数のカメラ映像を入力するものである。ここでは、映像入力手段10は、予め定めた基準カメラCで撮影した基準映像Fと、隣接カメラCLL,C,C,CRRで撮影した隣接映像FLL,F,F,FRRとを入力する。
この映像入力手段10で入力した各映像(FLL,F,F,F,FRR)は、図示を省略したメモリに記憶され、後記する対応画素差分演算手段20、近傍画素値出力手段30、および、近傍奥行対応画素値出力手段50によって参照されるものとする。
The video input means 10 inputs a plurality of camera videos taken by the camera CM. Here, the image input means 10, the reference image F C taken by the base camera C C a predetermined, adjacent camera C LL, C L, C R , neighboring image F LL shot by C RR, F L, F Input R 1 and F RR .
Each video (F LL , F L , F C , F R , F RR ) input by this video input means 10 is stored in a memory not shown in the figure, and corresponding pixel difference calculation means 20, which will be described later, and neighboring pixel value output Reference is made to the means 30 and the neighborhood depth corresponding pixel value output means 50.

ここで、注目画素Pにオクルージョンが有る場合の基準映像Fと左右の隣接映像F,Fの見え方について説明を補足する。図3に示すように、注目画素Pが、右側の前景Bに接近した背景Aの上にある場合、基準映像Fと隣接映像Fでは注目点PCが見える。その一方、隣接映像Fでは,前景Bに隠れて注目点PCが見えず、代わりに前景B上の対応点PRが見えている。従って、左側の対応画素Pと注目画素Pとの対応画素差分値(マッチング誤差)を選択すれば、正しい対応画素差分値を取得できる。その一方、右側の対応画素Pの対応画素差分値を選択した場合、または、左右の対応画素差分値の平均値を選択した場合、誤った対応画素差分値を取得することになり、奥行値を誤推定してしまう。そこで、奥行推定装置1は、注目画素Pの左右近傍の奥行値と画素値とを調べ、注目画素Pにオクルージョンの有無を判定することにより、マッチング誤差を正しく選択する。 Here, the reference image F C and the left and right neighboring image F L when occlusion to the pixel of interest P C is present, the appearance of F R supplement the description. As shown in FIG. 3, the pixel of interest P C, who is on the background A close to the right side of the foreground B, the reference image F C and the neighboring image F L In point of interest PC is visible. Meanwhile, the neighboring image F R, the point of interest PC is not hidden in the foreground B, the corresponding point PR on the foreground B is visible instead. Thus, by selecting the left of the corresponding pixel corresponding pixel difference values between P L and the target pixel P C a (matching error), you can get the correct corresponding pixel difference values. Meanwhile, if you choose the corresponding pixel difference value of the right of the corresponding pixel P R, or, if you choose the average of the left and right of the corresponding pixel difference values, would get the wrong corresponding pixel difference value, the depth value Is erroneously estimated. Therefore, the depth estimation apparatus 1 examines the depth value and the pixel value of the right and left near the target pixel P C, by determining the presence or absence of occlusion to the pixel of interest P C, the correct choice of matching error.

以下、図2に戻り、奥行推定装置の構成の説明を続ける(適宜、図3参照)。
対応画素差分演算手段20は、仮定奥行値d(図3参照)および注目画素Pごとに、基準映像Fの注目画素Pの画素値と、当該注目画素Pの仮定奥行値dの視差に対応する隣接映像F,Fの対応画素P,P(図3参照)の画素値との差分絶対値である隣接映像の対応画素差分値ECL,ECRを演算するものである。ここで、隣接映像の対応画素差分値ECLは、基準映像Fと隣接映像Fとの間で演算された差分絶対値であり、隣接映像の対応画素差分値ECRは、基準映像Fと隣接映像Fとの間で演算された差分絶対値である。
Hereinafter, returning to FIG. 2, the description of the configuration of the depth estimation apparatus will be continued (see FIG. 3 as appropriate).
Corresponding pixel difference calculating unit 20, for each hypothetical depth value d (see FIG. 3) and the target pixel P C, the pixel value of the pixel of interest P C of the reference image F C, assumptions depth value d of the pixel of interest P C which arithmetic neighboring image F L corresponding to the parallax, the corresponding pixel P L of F R, P R corresponding pixel difference value E CL of neighboring image which is a difference absolute value between the pixel value (see FIG. 3), the E CR It is. 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 averaging the difference absolute value of the value and the difference absolute value of the color difference value is obtained. 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, which is an element of the color signal, and the G value. The difference absolute value of B and the difference absolute value of the B value are added and averaged.

また、仮定奥行値dは、被写体Tの奥行値Dを仮に設定する値であって、最小視差量から最大視差量Dに対応する奥行値Dまでの値をとる。例えば、奥行値Dを8ビットのデータで表す場合、仮定奥行値dは、“0”(最小視差量)〜“255”(最大視差量)の範囲の値をとる。また、ここでは、対応画素差分演算手段20は、最小視差量(例えば、“0”)から最大視差量(例えば、“255”)に対応する奥行値Dまで、順次、仮定奥行値dを設定し、当該仮定奥行値dの視差に対応する対応画素と間の画素値の差分を対応画素差分値として演算する。また、ここでは、奥行値Dの単位と画素間の視差の単位とを同一とし、奥行値Dが“1”増加することで、1画素ずつ視差が増加することとする。 Also, assuming the depth value d is a value for temporarily set the depth value D of the subject T, taking a value from the minimum amount of parallax to a depth value D corresponding to the maximum disparity amount D M. For example, when the depth value D is represented by 8-bit data, the assumed depth value d takes a value ranging from “0” (minimum parallax amount) to “255” (maximum parallax amount). Here, the corresponding pixel difference calculation means 20 sequentially sets the assumed depth value d from the minimum parallax amount (for example, “0”) to the depth value D corresponding to the maximum parallax amount (for example, “255”). Then, the difference between the pixel values corresponding to the corresponding pixels corresponding to the parallax of the assumed depth value d is calculated as the 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)式
Corresponding pixel difference calculating means 20, the reference image F C (x, y) coordinates (the pixel of interest P C) the pixel value at P C (x, y), the reference image F C (x, y) assumes the coordinates depth value (x + d, y) of the neighboring image F L corresponding to d coordinates (corresponding pixels P L) a pixel value of P L (x + d, y ), (x-d, y) of the neighboring image F R coordinate (corresponding When the pixel value of the pixel P R ) is P R (x−d, y), the corresponding pixel difference values E CL (d, x, y), E CR (d, x, y) are expressed by the following equation (1). 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)

ここで、図4を参照し、隣接映像Fから対応画素Pが外れる場合、対応画素差分値ECL,ECRの演算方法について説明する(適宜図2参照)。図4に示すように、隣接映像Fから対応画素Pが外れてしまうと、左側の対応画素差分値ECLが求まらず、右側の対応画素差分値ECRのみを用いて、奥行値を推定しなければならない。このとき,注目画素Pの近傍に存在する被写体Tが一様なテクスチャの場合、対応画素差分値ECRは、どの仮定奥行値dでも近似した値となってしまい、正しい奥行値を推定できない。この場合、基準映像Fに対して、対応画素Pが外れた側の隣接映像Fと反対側の右の隣接映像F,FRRでは、対応画素P,PRRが外れないと考えられる。そこで、対応画素差分演算手段20は、これら隣接映像F,FRRの対応画素P,PRRを用いて、対応画素差分値ECL,ECRを算出する。 Here, with reference to FIG. 4, if the corresponding pixels P L from neighboring image F L is out, the corresponding pixel difference value E CL, method of calculating E CR illustrating (appropriately with reference to Figure 2). As shown in FIG. 4, when the neighboring image F L corresponding pixel P L deviates not Motomara the left of the corresponding pixel difference value E CL, using only the right of the corresponding pixel difference value E CR, the depth The value must be estimated. At this time, when the object T present in the vicinity of the pixel of interest P C is uniform texture, the corresponding pixel difference value E CR is becomes a value approximating in any hypothetical depth value d, it can not estimate the correct depth value . In this case, with respect to the reference image F C , in the adjacent images F R and F RR on the right side opposite to the adjacent image F L on the side where the corresponding pixel P L is removed, the corresponding pixels P R and P RR must be removed. Conceivable. Therefore, the corresponding pixel difference calculation means 20 calculates the corresponding pixel difference values E CL and E CR using the corresponding pixels P R and P RR of the adjacent images F R and F RR .

まず、対応画素差分演算手段20は、隣接映像F,Fから対応画素P,Pが外れていないか否かを判定する。具体的には、対応画素差分演算手段20は、注目画素Pのx座標値を仮定奥行値dだけ左に移動させた対応画素Pの画素位置(x−d)が、0以上であるか否かを判定する。つまり、対応画素差分演算手段20は、以下の(2)式によって、対応画素Pが隣接映像Fから外れていないか否かを判定する。
x−d≧0 …(2)式
First, the corresponding pixel difference calculating unit 20 determines the neighboring image F L, F the corresponding pixel from the R P L, whether or not disconnected P R. Specifically, the corresponding pixel difference calculating means 20, the pixel positions of the corresponding pixels P R is moved to the left x-coordinate value of the pixel of interest P C by assuming the depth value d (x-d) is, is 0 or more It is determined whether or not. That is, the corresponding pixel difference calculating means 20, by the following equation (2), the corresponding pixel P R is determined whether not out from neighboring image F R.
x−d ≧ 0 (2) formula

また、対応画素差分演算手段20は、注目画素Pのx座標値を仮定奥行値dだけ右に移動させた対応画素Pの画素位置(x+d)が、予め設定した映像幅(例えば、1920ピクセル)未満であるか否かを判定する。つまり、対応画素差分演算手段20は、以下の(3)式によって、対応画素Pが隣接映像Fから外れていないか否かを判定する。
x+d<映像幅 …(3)式
Further, the corresponding pixel difference calculating means 20, the pixel position of the moved to the right x-coordinate value of the pixel of interest P C by assuming the depth value d corresponding pixel P L (x + d) is preset picture size (e.g., 1920 It is determined whether it is less than (pixel). That is, the corresponding pixel difference calculating means 20, by the following equation (3), the corresponding pixel P L is determined whether not out from neighboring image F L.
x + d <video width (3) formula

図4の例では、隣接映像Fから対応画素Pが外れているため、(3)式を満たさない。この場合、対応画素差分演算手段20は、以下の(4)式によって、対応画素差分値ECL,ECRを演算する。
CL(d,x,y)=|PRR(x−2d,y)−P(x,y)|
CR(d,x,y)=|P(x−d,y)−P(x,y)| …(4)式
In the example of FIG. 4, since the corresponding pixel P L from neighboring image F L is out, does not satisfy the equation (3). In this case, the corresponding pixel difference calculation means 20 calculates the corresponding pixel difference values E CL and E CR by the following equation (4).
E CL (d, x, y) = | P RR (x−2d, y) −P C (x, y) |
E CR (d, x, y) = | P R (x−d, y) −P C (x, y) | (4)

図示を省略したが、右隣接映像Fから対応画素Pが外れる場合、(2)式を満たさない。この場合、対応画素差分演算手段20は、以下の(5)式によって、対応画素差分値ECL,ECRを演算する。
CL(d,x,y)=|P(x+d,y)−P(x,y)|
CR(d,x,y)=|PLL(x+2d,y)−P(x,y)| …(5)式
Not shown, but if the right neighboring image F R corresponding pixel P R deviates not satisfy the equation (2). In this case, the corresponding pixel difference calculation means 20 calculates the corresponding pixel difference values E CL and E CR by the following equation (5).
E CL (d, x, y) = | P L (x + d, y) −P C (x, y) |
E CR (d, x, y) = | P LL (x + 2d, y) −P C (x, y) | (5)

また、対応画素差分演算手段20は、隣接映像F,Fから対応画素P,Pが外れていない場合、すなわち、(2)式および(3)式を両方満たす場合、(1)式によって対応画素差分値ECL,ECRを算出する。これによって、奥行推定装置1は、隣接映像F,Fから対応画素P,Pが外れる場合でも、反対側の2つの隣接映像F,FRR,F,FLLを用いて、対応画素差分値ECL,ECRを算出することができ、奥行値の誤推定を低減することができる。 Further, the corresponding pixel difference calculating unit 20, neighboring image F L, the corresponding pixel P L from F R, if not disconnected P R, i.e., if it meets both the (2) and (3), (1) Corresponding pixel difference values E CL and E CR are calculated by the equation. Thereby, the depth estimation apparatus 1, neighboring image F L, F R from the corresponding pixels P L, even if the P R is outside, two adjacent image F R on the opposite side, F RR, F L, with F LL , The corresponding pixel difference values E CL and E CR can be calculated, and erroneous estimation of the depth value can be reduced.

そして、対応画素差分演算手段20は、仮定奥行値d(最小視差量〜最大視差量)ごとの対応画素差分値ECL,ECRを差分値決定手段60に出力する。なお、対応画素差分演算手段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 (minimum parallax amount to maximum parallax amount) to the difference value determination unit 60. 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.

以下、図5を参照して、近傍画素値出力手段30を説明する(適宜図2参照)。
近傍画素値出力手段30は、映像入力手段10から基準映像Fを入力し、以下の(6)式によって、注目画素P(x,y)の画素値Pと、注目画素P(x,y)から近傍画素数sだけ左に離れた画素位置P(x−s,y)にある近傍画素の画素値PSLと、注目画素P(x,y)から近傍画素数sだけ右に離れた画素位置P(x+s,y)にある近傍画素の画素値PSRとを取得する。
=P(x,y)
SL=P(x−s,y)
SR=P(x+s,y) …(6)式
Hereinafter, the neighboring pixel value output means 30 will be described with reference to FIG. 5 (see FIG. 2 as appropriate).
Neighboring pixel value output unit 30 receives the reference video F C from the image input unit 10, by the following equation (6), the pixel value P C of the pixel of interest P C (x, y), the pixel of interest P C ( The pixel value P SL of the neighboring pixel located at the pixel position P C (x−s, y) left from the neighboring pixel number s from x, y) and the neighboring pixel number s from the target pixel P C (x, y) pixel position P C (x + s, y ) apart right by obtaining the pixel value P SR neighboring pixels in the.
P C = P C (x, y)
P SL = P C (x- s, y)
P SR = P C (x + s, y) ... (6) formula

そして、近傍画素値出力手段30は、注目画素P(x,y)の画素値Pと、画素位置P(x−s,y)にある近傍画素の画素値PSLと、画素位置P(x+s,y)にある近傍画素の画素値PSRとを、差分値決定手段60に出力する。 Then, the neighboring pixel value output means 30, the pixel value P C of the pixel of interest P C (x, y), the pixel value P SL neighboring pixels in the pixel position P C (x-s, y ), the pixel position P C (x + s, y ) and the pixel value P SR neighboring pixels in the outputs to the difference value determination means 60.

なお、注目画素Pとは、基準映像Fにおいて奥行値Dを推定する対象となっている画素である。
また、近傍画素PSLおよび近傍画素PSRは、図5に示すように、注目画素Pを中心として、半径が近傍画素数sの円周上に位置する画素である。この近傍画素数sは、例えば、正しくオクルージョンの有無が判定できるように、初期値として最大視差量Dに対応する画素数を設定する。なお、以後の各図では、左側の近傍画素を左近傍画素と図示し、右側の近傍画素を右近傍画素と図示することがある。
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. 5, around the pixel of interest P C, is a pixel radius positioned on the circumference of the neighboring pixel number s. The neighboring pixel number s is, for example, to correctly determine whether the occlusion is to set the number of pixels corresponding to the maximum disparity amount D M as the initial value. In the following drawings, the left neighboring pixel may be illustrated as the left neighboring pixel, and the right neighboring pixel may be illustrated as the right neighboring pixel.

以下、図6を参照して、近傍奥行値出力手段40を説明する。(適宜図2参照)。
近傍奥行値出力手段40は、後記する奥行値決定手段90から各画素の奥行値D(x,y)が入力され、以下の(7)式によって、注目画素Pから近傍画素数sだけ左に離れた近傍画素PSLの奥行値D=D(x−s,y)と、注目画素Pから近傍画素数sだけ右に離れた近傍画素PSRの奥行値D=D(x+s,y)とを取得するものである。なお、以後の各図では、近傍画素の奥行値を近傍奥行値と図示し、左側の近傍画素の奥行値を左近傍奥行値と図示し、右側の近傍画素の奥行値を右近傍奥行値と図示することがある。
=D(x−s,y)
=D(x+s,y) …(7)式
Hereinafter, the neighborhood depth value output means 40 will be described with reference to FIG. (See FIG. 2 as appropriate).
Near depth value output means 40, described later to the depth value determining means 90 from the respective pixel depth value D (x, y) is inputted, following the expression (7), by the number of neighboring pixels s from the target pixel P C Left depth value D of the neighboring pixels P SL of spaced L = D (x-s, y) and, the target pixel P C neighboring pixels P SR apart right by neighboring pixel number s from the depth value D = D R (x + s , Y). In the following figures, the depth value of the neighboring pixel is illustrated as the neighborhood depth value, the depth value of the left neighboring pixel is illustrated as the left neighborhood depth value, and the depth value of the right neighboring pixel is represented as the right neighborhood depth value. May be illustrated.
D L = D (x−s, y)
D R = D (x + s, y) (7)

また、近傍奥行値出力手段40は、以下の(8)式によって、左奥行値Dと右奥行値Dとの差分絶対値|D−D|が、所定の閾値th1を超えるか否かを判定する。なお、閾値th1は、最大視差量D(例えば、“255”)から最小視差量(例えば、“0”)を引いた値に所定の係数(例えば、“0.2”)を掛けた値として予め設定する。
|D−D|>th1 …(8)式
Also, near the depth value output means 40, by the following equation (8), a difference absolute value between the left depth value D L and the right depth value D R | or is greater than a predetermined threshold value th1 | D L -D R Determine whether or not. The threshold th1 is a value obtained by multiplying a value obtained by subtracting the minimum parallax amount (eg, “0”) from the maximum parallax amount D M (eg, “255”) by a predetermined coefficient (eg, “0.2”). Are set in advance.
| D L −D R |> th1 (8)

差分絶対値|D−D|が閾値th1を超えない場合、近傍奥行値出力手段40は、以下の(9)式のように近傍画素数sを半分にして、前記した(7)式より、近傍画素PSLの奥行値D=D(x−s,y)と、近傍画素PSRの奥行値D=D(x+s,y)とを再度取得する。なお、(9)式では、“=”は、右辺の値で左辺の値を置き換えることを意味する。
s=s/2 …(9)式
When the difference absolute value | D L −D R | does not exceed the threshold th1, the neighborhood depth value output means 40 divides the number of neighboring pixels s by half as in the following equation (9), and the above equation (7). Thus, the depth value D L = D (x−s, y) of the neighboring pixel P SL and the depth value D R = D (x + s, y) of the neighboring pixel P SR are acquired again. In equation (9), “=” means that the value on the left side is replaced with the value on the right side.
s = s / 2 (9) formula

そして、近傍奥行値出力手段40は、取得した近傍画素PSLの奥行値D=D(x−s,y)と、近傍画素PSRの奥行値D=D(x+s,y)とを、近傍奥行対応画素値出力手段50および差分値決定手段60に出力する。このように、最大視差量Dだけ離れた画素位置の奥行値を求めることで、奥行推定装置1は、隣接映像F,Fでオクルージョンが有る可能性がある前景Aを正しく判定することができる。つまり、差分値決定手段60は、最大視差量Dを近傍画素数sの初期値として用いるので、オクルージョンが有る可能性のある被写体Tを見逃すことがない。さらに、近傍画素数sを半分にして、奥行値を再度求めることで、奥行推定装置1は、判定が困難であった幅が狭い前景Aであっても、オクルージョンの有無を判定することができる。 Then, the neighborhood depth value output means 40 obtains the depth value D L = D (x−s, y) of the acquired neighborhood pixel P SL and the depth value D R = D (x + s, y) of the neighborhood pixel P SR. And output to the neighborhood depth corresponding pixel value output means 50 and the difference value determination means 60. Thus, by obtaining the depth value of the pixel position apart maximum disparity amount D M, the depth estimation apparatus 1, neighboring image F L, to correctly determine the foreground A that may occlusion is at a F R Can do. That is, the difference value determination means 60, since using the maximum parallax amount D M as the initial values of the neighboring pixel number s, never miss a subject T that may occlusion there. Furthermore, the depth estimation apparatus 1 can determine the presence or absence of occlusion even in the foreground A having a narrow width, which has been difficult to determine, by determining the depth value again by halving the number of neighboring pixels s. .

なお、1回目の奥行推定では、奥行値Dが求められないことになる。この場合、奥行推定装置1は、全ての画素の奥行値Dを初期値(例えば、“0”)に予め設定する。つまり、1回目の奥行推定を行う場合、近傍奥行値出力手段40は、この初期値を奥行値D,Dとして近傍奥行対応画素値出力手段50および差分値決定手段60に出力する。一方、2回目以降の奥行推定では、近傍奥行値出力手段40は、前回の奥行推定で求めた各画素の奥行値Dが奥行値決定手段90から入力されるので、正しい近傍画素PSLの奥行値Dと、正しい近傍画素PSRの奥行値Dとを出力できる。 Note that the depth value D cannot be obtained in the first depth estimation. In this case, the depth estimation apparatus 1 sets the depth value D of all the pixels in advance to an initial value (for example, “0”). That is, when performing the first depth estimation, near the depth value output means 40 outputs the initial value depth value D L, in the vicinity of the depth corresponding pixel value output unit 50 and difference value determination unit 60 as D R. On the other hand, in the second and subsequent depth estimation, the neighboring depth value output means 40 receives the depth value D of each pixel obtained in the previous depth estimation from the depth value determination means 90, so that the depth of the correct neighboring pixel PSL is correct. can output the value D L, the right neighboring pixels P SR and depth value D R.

以下、図7を参照して、近傍奥行対応画素値出力手段50について説明する(適宜図2参照)。なお、以後の各図では、左側の近傍奥行対応画素を左近傍奥行対応画素と図示し、右側の近傍奥行対応画素を右奥行対応画素と図示することがある。   Hereinafter, the neighborhood depth corresponding pixel value output means 50 will be described with reference to FIG. 7 (see FIG. 2 as appropriate). In the following drawings, the left neighboring depth corresponding pixel may be illustrated as the left neighboring depth corresponding pixel, and the right neighboring depth corresponding pixel may be illustrated as the right depth corresponding pixel.

近傍奥行対応画素値出力手段50は、映像入力手段10から基準映像Fおよび隣接映像F,Fが入力され、近傍奥行値出力手段40から近傍画素PSLの奥行値Dおよび近傍画素PSRの奥行値Dが入力される。そして、近傍奥行対応画素値出力手段50は、以下の(10)式によって、左右の隣接映像F,Fから、奥行値Dの視差に対応する画素位置にある近傍奥行対応画素P(x+D,y),P(x−D,y)の画素値PLDL,PRDLを算出する。また、近傍奥行対応画素値出力手段50は、(10)式によって、左右の隣接映像F,Fから、奥行値Dの視差に対応する画素位置にある近傍奥行対応画素P(x+D,y),P(x−D,y)の画素値PLDR,PRDRを算出する。
LDL=P(x+D,y)
LDR=P(x+D,y)
RDL=P(x−D,y)
RDR=P(x−D,y) …(10)式
Neighboring depth corresponding pixel value output unit 50, image input unit 10 from the reference image F C and the neighboring image F L, F R is input, the depth values D L and its neighboring pixels of neighboring pixels P SL from neighboring depth value output means 40 depth value D R of P SR is input. Then, the neighboring depth corresponding pixel value output means 50 calculates the neighboring depth corresponding pixel P L at the pixel position corresponding to the parallax of the depth value D L from the left and right adjacent images F L and F R by the following equation (10). Pixel values P LDL and P RDL of (x + D L , y) and P R (x−D L , y) are calculated. Also, near the depth corresponding pixel value output unit 50, by (10), left and right neighboring image F L, from F R, the depth value D near depth corresponding pixel is in the pixel position corresponding to parallax of R P L (x + D R, y), P R ( x-D R, y) pixel value P LDR of calculating the P RDR.
P LDL = P L (x + D L , y)
P LDR = P L (x + D R , y)
P RDL = P R (x−D L , y)
P RDR = P R (x−D R , y) (10)

そして、近傍奥行対応画素値出力手段50は、近傍奥行対応画素P(x+D,y),P(x−D,y)の画素値PLDL,PRDLと、近傍奥行対応画素P(x+D,y),P(x−D,y)の画素値PLDR,PRDRとを差分値決定手段60に出力する。 Then, the neighboring depth corresponding pixel value output means 50 includes the neighboring depth corresponding pixels P L (x + D L , y), P R (x−D L , y), and the neighboring depth corresponding pixels P LDL , P RDL. L (x + D R, y ), and outputs P R (x-D R, y) pixel value P LDR of the P RDR to the difference value determination means 60.

以下、図2に戻り、奥行推定装置1の構成について説明を続ける。
差分値決定手段60は、基準映像Fの注目画素Pおよび仮定奥行値dごとに、最小差分値Emと平均差分値Eaとを求めるものである。そして、差分値決定手段60は、求めた最小差分値Em、または平均差分値Eaの何れかを、予め設定された条件により選択差分値として決定する。
Hereinafter, returning to FIG. 2, the description of the configuration of the depth estimation device 1 will be continued.
Difference determining means 60, 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. And the difference value determination means 60 determines either the calculated | required minimum difference value Em or the average difference value Ea as a selection difference value by the preset conditions.

ここでは、差分値決定手段60は、平均差分値演算手段60aと、最小差分値選択手段60bと、差分値選択手段60cと、を備えている。   Here, the difference value determining means 60 includes an average difference value calculating means 60a, a minimum difference value selecting means 60b, and a difference value selecting means 60c.

平均差分値演算手段60aは、基準映像Fの注目画素Pおよび仮定奥行値dごとに、対応画素差分演算手段20から入力された対応画素差分値ECL,ECRの平均値(平均差分値Ea)を演算するものである。
すなわち、平均差分値演算手段60aは、以下の(11)によって、基準映像Fの(x,y)座標の仮定奥行値dに対応する平均差分値Ea(d,x,y)を算出する。
Ea(d,x,y)={ECL(d,x,y)+ECR(d,x,y)}/2
…(11)式
Average differential value calculating means 60a, 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 input from the corresponding pixel difference calculating unit 20, the average value of E CR (average difference The value Ea) is calculated.
That is, the average difference value calculating means 60a 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 (11). .
Ea (d, x, y) = {E CL (d, x, y) + E CR (d, x, y)} / 2
... (11) Formula

そして、平均差分値演算手段60aは、演算により求めた仮定奥行値d(“0”〜最大視差量)ごとの平均差分値Eaを、差分値選択手段60cに出力する。   Then, the average difference value calculation means 60a 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 means 60c.

最小差分値選択手段60bは、基準映像Fの注目画素Pおよび仮定奥行値dごとに、対応画素差分演算手段20から入力された対応画素差分値ECL,ECRのうちで、値が小さい方(最小差分値Em)を選択するものである。
すなわち、最小差分値選択手段60bは、以下の(12)式によって、基準映像Fの(x,y)座標の仮定奥行値dに対応する隣接映像の対応画素差分値ECL(d,x,y)と、隣接映像の対応画素差分値ECR(d,x,y)とを比較し、値が小さい方を最小差分値Emとして選択する。なお、式(12)において、minは、“{}”内に記述された対応画素差分値ECL,ECRのうち、値が小さい方を選択する関数である。
Em(d,x,y)=min{ECL(d,x,y),ECR(d,x,y)}
…(12)式
Minimum difference value selecting unit 60b, for each pixel of interest P C and assumptions depth value d of the reference image F C, corresponding pixel difference calculating unit 20 corresponding pixel difference value E CL input from, among the E CR, the value The smaller one (minimum difference value Em) is selected.
That is, the minimum difference value selection unit 60b uses the following equation (12) to calculate the corresponding pixel difference value E CL (d, x) of the adjacent image corresponding to the assumed depth value d of the (x, y) coordinates of the reference image F C. , Y) and the corresponding pixel difference value E CR (d, x, y) of the adjacent video are compared, and the smaller value is selected as the minimum difference value Em. In equation (12), min is a function that selects the smaller one of the corresponding pixel difference values E CL and E CR described in “{}”.
Em (d, x, y) = min {E CL (d, x, y), E CR (d, x, y)}
... (12) Formula

そして、最小差分値選択手段60bは、選択した仮定奥行値d(“0”〜最大視差量)ごとの最小差分値Emを、差分値選択手段60cに出力する。   Then, the minimum difference value selecting unit 60b 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 60c.

差分値選択手段60cは、基準映像Fの注目画素Pおよび仮定奥行値dごとに、近傍画素値出力手段30から入力された注目画素P(x,y)の画素値Pと、画素位置P(x−s,y)にある近傍画素の画素値PSLと、画素位置P(x+s,y)にある近傍画素の画素値PSRと、近傍奥行値出力手段40から入力された近傍画素PSLの奥行値Dと、近傍画素PSRの奥行値Dと,近傍奥行対応画素値出力手段50から入力された近傍奥行対応画素の画素値PLDL,PRDL,PLDR,PRDRとに基づいて、最小差分値選択手段60bから入力された最小差分値Em、または平均差分値演算手段60aから入力された平均差分値Eaの何れかを、選択差分値Eとして選択するものである。 Difference value selection unit 60c, 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 target pixel is input from the neighboring pixel value output means 30 P C (x, y), and the pixel value P SL neighboring pixels in the pixel position P C (x-s, y ) , the pixel value P SR neighboring pixels in the pixel position P C (x + s, y ), input from the vicinity depth value output means 40 a depth value D L neighboring pixels P SL that is, a depth value D R neighboring pixels P SR, the pixel value P LDL neighboring depth corresponding pixel that is input from the vicinity depth corresponding pixel value output unit 50, P RDL, P LDR, based on the P RDR selected minimum difference value Em inputted from the minimum difference value selecting means 60b or one of the average difference value Ea input from the average difference value calculation means 60a,, as the selected difference value E To do.

まず、差分値選択手段60cは、奥行値Dを推定した回数を示す奥行推定回数nが1回目であるか、2回目以降であるかを判定する。奥行推定回数nが1回目の場合(n=1)、差分値選択手段60cは、以下の(13)式によって、平均差分値Ea(d,x,y)を選択差分値E(d,x,y)として選択する。
E(d,x,y)=Ea(d,x,y) …(13)式
First, the difference value selection unit 60c determines whether the depth estimation number n indicating the number of times the depth value D is estimated is the first time or the second time or later. When the depth estimation number n is the first (n = 1), the difference value selection means 60c calculates the average difference value Ea (d, x, y) as the selected difference value E (d, x) by the following equation (13). , Y).
E (d, x, y) = Ea (d, x, y) (13)

奥行推定回数nが2回目以降の場合(n≧2)、差分値選択手段60cは、以下の(14)式によって、左右の近傍画素の奥行値D,Dの差分絶対値|D−D|が閾値th1を超え、かつ、左右の近傍画素PSL,PSRの画素値の差分絶対値ELRが閾値th2を超えるか否かを判定する。なお、閾値th2は、最大画素値(例えば、“255”)に所定の係数(例えば、“0.1”)を掛けた値として予め設定する。
|D−D|>th1 AND
LR=|PSL−PSR|>th2 …(14)式
If depth estimation the number n is the second and subsequent (n ≧ 2), the difference value selecting unit 60c, the following equation (14) by the depth value D L of the right and left neighboring pixels, the difference absolute value of D R | D L -D R | exceeds the threshold value th1, and the left and right neighboring pixels P SL, determines whether or not the difference absolute value E LR of the pixel values of P SR exceeds the threshold value th2. 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”).
| D L -D R |> th1 AND
E LR = | P SL −P SR |> th2 (14)

(14)式が成立しない場合、注目画素Pの左右近傍に被写体Tの境界(つまり、背景Aと前景Bとの境界がない可能性が高い。この場合、差分値選択手段60cは、前記した(13)式によって、平均差分値Em(d,x,y)を選択差分値E(d,x,y)として選択し、この選択差分値E(d,x,y)を記憶手段70に書き込む。 If (14) is not satisfied, the boundary of the object T to the right and left near the target pixel P C (i.e., it is most likely not a boundary between the background A foreground B. In this case, the difference value selecting unit 60c, the The average difference value Em (d, x, y) is selected as the selected difference value E (d, x, y) by the equation (13), and the selected difference value E (d, x, y) is stored in the storage means 70. Write to.

(14)式が成立する場合、注目画素Pの左右近傍に奥行値と画素値とが大きく異なる被写体Tが存在する可能性が高いため、オクルージョンの有無を調べる必要がある。この場合、差分値選択手段60cは、以下の(15)式によって、奥行値Dが奥行値D以上であるか否かを判定することにより、左右どちら側に奥行値が小さくなる背景Aがあるかを判定する。
≧D …(15)式
(14) If the equation is satisfied, it is highly likely that the depth value and the pixel value and differ object T on the left and right near the target pixel P C is present, it is necessary to check for occlusion. In this case, the difference value selecting unit 60c, the following by equation (15), the depth value D L is the depth value D by determining whether a R or a background A the depth value decreases in the left or right side Determine if there is any.
D L ≧ D R (15) formula

(15)式が成立する場合(奥行値Dが奥行値D以上の場合)、注目画素Pの左側に前景Bがあり、右側に背景Aがある可能性が高い。この場合、差分値選択手段60cは、注目画素Pが背景A上であるかまたは前景B上であるか判定する。ここで、注目画素Pが背景A上であれば、左側の隣接映像Fでオクルージョンが有り、対応画素Pの画素値と注目画素Pの画素値とが大きく異なる。その一方、右側の隣接映像Fではオクルージョンは無く、対応画素Pの画素値と注目画素Pの画素値とが近い値となる。そこで、差分値選択手段60cは、以下の(16)式によって、左右の隣接映像F,Fにおいて、注目画素Pを背景A側の奥行値Dに相当する画素数だけ左右に移動させた近傍奥行対応画素の画素値PLDR,PRDRと、注目画素の画素値Pとの差分絶対値ELDR,ERDRを算出する。
LDR=|PLDR−P
RDR=|PRDR−P| …(16)式
(15) If the equation is satisfied (if the depth value D L is greater than the depth value D R), there is a foreground B to the left of the pixel of interest P C, it is likely that there is a background A on the right. In this case, the difference value selecting unit 60c determines the pixel of interest P C Do is on or foreground B is the background A. Here, if the pixel of interest P C background A, there is occlusion in the left neighboring image F L, the pixel value of the pixel values between the target pixel P C of the corresponding pixel P L is greatly different. Meanwhile, occlusion in the right side of the neighboring image F R is not, the pixel value and the pixel value and is close to the value of the target pixel P C of the corresponding pixel P R. Therefore moving difference value selecting unit 60c is the following equation (16), left and right neighboring image F L, in F R, the left and right by the number of pixels corresponding to the pixel of interest P C to a depth value D R Background A side pixel value P LDR neighboring depth corresponding pixels is calculated and P RDR, differential absolute value E LDR between the pixel value P C of the pixel of interest, the E RDR.
E LDR = | P LDR -P C |
E RDR = | P RDR −P C | (16)

そして、差分値選択手段60cは、以下の(17)式によって、差分絶対値ELDRが差分絶対値ERDRを超えたか否かを判定する。
LDR>ERDR …(17)式
Then, the difference value selection means 60c determines whether or not the difference absolute value ERDR exceeds the difference absolute value ERDR by the following equation (17).
E LDR > E RDR (17) formula

(17)式が成立する場合(差分絶対値ELDRが差分絶対値ERDRを超える場合)、左側の隣接映像Fでオクルージョンが有ると言える。この場合、差分値選択手段60cは、以下の(18)式によって、最小差分値Em(d,x,y)を選択差分値E(d,x,y)として選択する。
E(d,x,y)=Em(d,x,y) …(18)式
If (17) is established (when the difference absolute value E LDR exceeds the difference absolute value E RDR), it can be said that occlusion is present in the left neighboring image F L. In this case, the difference value selection means 60c selects the minimum difference value Em (d, x, y) as the selected difference value E (d, x, y) by the following equation (18).
E (d, x, y) = Em (d, x, y) (18)

このように、注目画素Pが背景Aと同じ奥行にあると仮定して、左右の隣接映像F,Fで注目画素Pの見え方を調べることで、オクルージョンの有無を判定する。このとき、奥行推定装置1は、注目画素Pに対応する近傍奥行対応画素PLDR,PRDRを判定に用いるので、一部の色が異なる被写体Tの場合でも、正しくオクルージョンの有無を判定できる。また、奥行推定装置1は、仮定奥行値dに対応した対応画素P,Pを判定に用いないため、仮定奥行値dが正しくない場合でも、正しくオクルージョンの有無を判定できる。 Thus, the pixel of interest P C is assumed to be at the same depth as the background A, by examining the left and right neighboring image F L, the appearance of the pixel of interest P C in F R, determines the presence or absence of occlusion. At this time, the depth estimation apparatus 1, since used to determine the proximity depth corresponding pixel P LDR, P RDR corresponding to the pixel of interest P C, even if some of the colors are different subject T, it can be determined whether the correct occlusion . Further, the depth estimation apparatus 1, the corresponding pixel P L corresponding to the assumed depth value d, is not used to determine the P R, even when assuming the depth value d is not correct, it can be determined whether the correct occlusion.

(17)式が成立しない場合(差分絶対値ELDRが差分絶対値ERDRを超えない場合)、オクルージョンが無いと言える。この場合、差分値選択手段60cは、偽マッチングを防止するため、前記(13)式によって、平均差分値Ea(d,x,y)を選択差分値E(d,x,y)として選択する。 When the equation (17) is not satisfied (when the difference absolute value ERDR does not exceed the difference absolute value ERDR ), it can be said that there is no occlusion. In this case, the difference value selection means 60c selects the average difference value Ea (d, x, y) as the selected difference value E (d, x, y) according to the equation (13) in order to prevent false matching. .

(15)式が成立しない場合(奥行値Dが奥行値D以上でない場合)、注目画素Pの左側に背景Aがあり、右側に前景Bがあることになる。この場合、差分値選択手段60cは、以下の(19)式によって、左右の隣接映像F,Fにおいて、注目画素Pを背景A側の奥行値Dに相当する画素数だけ左右に移動させた近傍奥行対応画素の画素値PLDL,PRDLと、注目画素の画素値Pとの差分絶対値ELDL,ERDLを算出する。
LDL=|PLDL−P
RDL=|PRDL−P| …(19)式
If (15) is not satisfied (if the depth value D L is less than the depth value D R), there is a background A on the left side of the target pixel P C, there will be foreground B on the right. In this case, the difference value selecting unit 60c is the following equation (19), left and right neighboring image F L, in F R, the left and right by the number of pixels corresponding to the pixel of interest P C to a depth value D L background A side pixel value P LDL neighboring depth corresponding pixel that has moved, computes a P RDL, differential absolute value E LDL between the pixel value P C of the pixel of interest, the E RDL.
E LDL = | P LDL -P C |
E RDL = | P RDL -P C | ... (19) equation

そして、差分値選択手段60cは、以下の(20)式によって、差分絶対値ERDLが差分絶対値ELDLを超えたか否かを判定する。
LDL<ERDL …(20)式
Then, the difference value selection unit 60c determines whether or not the difference absolute value E RDL exceeds the difference absolute value E LDL by the following equation (20).
E LDL <E RDL (20) formula

(20)式が成立する場合(差分絶対値ERDLが差分絶対値ELDLを超える場合)、右側の隣接映像Fでオクルージョンが有ると言える。この場合、差分値選択手段60cは、前記した(18)式によって、最小差分値Em(d,x,y)を選択差分値E(d,x,y)として選択する。 (When the difference absolute value E RDL exceeds the difference absolute value E LDL) if (20) is established, it can be said that occlusion is present in the right neighboring image F R. In this case, the difference value selection means 60c selects the minimum difference value Em (d, x, y) as the selected difference value E (d, x, y) by the above-described equation (18).

(20)式が成立しない場合(差分絶対値ERDLが差分絶対値ELDLを超えない場合)、オクルージョンが無いと言える。この場合、差分値選択手段60cは、偽マッチングを防止するため、前記した(13)式によって、平均差分値Ea(d,x,y)を選択差分値E(d,x,y)として選択する。 When the equation (20) is not satisfied (when the difference absolute value E RDL does not exceed the difference absolute value E LDL ), it can be said that there is no occlusion. In this case, the difference value selection means 60c selects the average difference value Ea (d, x, y) as the selected difference value E (d, x, y) by the above-described equation (13) in order to prevent false matching. To do.

その後、差分値決定手段60は、選択した選択差分値E(d,x,y)を、仮定奥行値dと基準映像Fの画素位置(x,y)に対応付けて記憶手段70に書き込む。また、差分値決定手段60は、基準映像Fの全ての画素位置において、仮定奥行値dごとの選択差分値E(d,x,y)を記憶手段70に書き込んだ後に、書き込み完了を平滑化手段80に通知する。 Then, the difference value determination unit 60 writes in the storage means 70 elected difference value E (d, x, y) and the pixel position of the hypothetical depth value d and the reference image F C (x, y) in association with . Also, the difference value determination means 60, at all pixel positions of the reference image F C, selected difference value E for each hypothetical depth value d (d, x, y) after writing in the storage means 70, smoothing the write completion Notification to the generating means 80.

以上説明したように、差分値決定手段60は、1回目の奥行推定では、常に平均差分値Eaを選択差分値Eとして選択することで、仮定奥行値dが正しくない場合の偽マッチングを防ぐことができる。   As described above, the difference value determining means 60 prevents false matching when the assumed depth value d is incorrect by always selecting the average difference value Ea as the selected difference value E in the first depth estimation. Can do.

1回目の奥行推定では平均差分値Eaしか選択しないので、オクルージョンが有る部分において、差分値決定手段60が奥行値を誤推定している可能性がある。そこで、2回目以降の奥行推定では、差分値決定手段60は、オクルージョンが有る部分から離れた位置で推定された近傍画素PSL,PSRの奥行値D,Dを用いて、オクルージョンの有無を正しく判定する。さらに、差分値決定手段60は、オクルージョンが有る部分では、最小差分値Emを選択差分値Eとして選択することで、1回目の奥行値の誤推定を修正する。これによって、奥行推定装置1は、後記する奥行値決定手段90において、正しい奥行値Dが推定される確率を高くすることができる。 Since only the average difference value Ea is selected in the first depth estimation, there is a possibility that the difference value determining means 60 erroneously estimates the depth value in a portion where there is occlusion. Therefore, in the second and subsequent depth estimation, the difference value determination means 60, neighboring pixels are estimated at a position away from the portion where the occlusion is present P SL, using a depth value D L, D R of P SR, occlusion Determine the presence or absence correctly. Further, the difference value determination means 60 corrects the first estimation of the depth value by selecting the minimum difference value Em as the selection difference value E in a portion where there is occlusion. Thereby, the depth estimation apparatus 1 can increase the probability that the correct depth value D is estimated in the depth value determination means 90 described later.

さらに、差分値決定手段60は、注目画素Pが前景Bであるか背景Aであるかを、近傍画素PSL,PSRの画素値によって判定せずに、左右の隣接映像F,Fにおいて、近傍奥行対応画素PLDR,PRDR,PLDL,PRDLによって判定する。これによって、奥行推定装置1は、一部の色が異なる被写体Tの場合でも、注目画素Pが前景Bまたは背景Aのどちらであるかを判定できるので、正しい奥行値Dが推定される確率を高くすることができる。 Furthermore, the difference value determination means 60, whether the pixel of interest P C is either a background A is foreground B, neighboring pixel P SL, without determination by the pixel values of P SR, left and right neighboring image F L, F In R , determination is made based on neighboring depth corresponding pixels P LDR , P RDR , P LDL , and P RDL . Probability Thus, the depth estimation apparatus 1, even if a part of the color of different objects T, since the pixel of interest P C can determine whether it is foreground B or background A, the correct depth value D is estimated Can be high.

記憶手段70は、差分値決定手段60が選択した選択差分値E(d,x,y)を、仮定奥行値dと基準映像の画素位置(x,y)とに対応付けて記憶するものである。また、記憶手段70は、後記する平滑化手段80が平滑化した平滑化差分値Ev(d,x,y)を、仮定奥行値dと基準映像の画素位置(x,y)とに対応付けて記憶する。例えば、記憶手段70は、磁気メモリや半導体メモリ等の一般的な記憶媒体である。   The storage means 70 stores the selected difference value E (d, x, y) selected by the difference value determination means 60 in association with the assumed depth value d and the pixel position (x, y) of the reference image. is there. Further, the storage unit 70 associates the smoothed difference value Ev (d, x, y) smoothed by the smoothing unit 80 described later with the assumed depth value d and the pixel position (x, y) of the reference image. Remember. For example, the storage means 70 is a general storage medium such as a magnetic memory or a semiconductor memory.

平滑化手段80は、当該画素位置における選択差分値を平滑化するものである。まず、平滑化手段80は、基準映像Fの注目画素P(画素位置(x,y))ごとに、以下の(21)式によって、注目画素Pの選択差分値E(d,x,y)が最小となる仮定奥行値dを算出する。そして、平滑化手段80は、その仮定奥行値dを、その画素の奥行値Dx,yとする。
x,y=D(x,y)=min{E(d,x,y)} …(21)式
The smoothing means 80 smoothes the selection difference value at the pixel position. First, the smoothing unit 80, the pixel of interest P C (pixel position (x, y)) of the reference image F C per, by the following equation (21), the pixel of interest P C of the selected difference value E (d, x , Y) is calculated assumable depth value d that minimizes. Then, the smoothing unit 80 sets the assumed depth value d as the depth value D x, y of the pixel.
D x, y = D (x, y) = min {E (d, x, y)} (21)

なお、(21)式に示すように、選択差分値E(d,x,y)は、画素位置(x,y)および仮定奥行値dの関数である。従って、minは、画素位置(x,y)ごとに、選択差分値E(d,x,y)が最小となる仮定奥行値dを選択して返す関数である。そして、この関数minの戻り値D(x,y)をDx,yと簡易に記述する。 As shown in the equation (21), the selection difference value E (d, x, y) is a function of the pixel position (x, y) and the assumed depth value d. Therefore, min is a function that selects and returns an assumed depth value d that minimizes the selected difference value E (d, x, y) for each pixel position (x, y). The return value D (x, y) of this function min is simply described as D x, y .

次に、平滑化手段80は、前記した(21)式によって、注目画素Pと同様、注目画素Pに隣接する画素位置(x+1,y),(x,y+1)の隣接画素の選択差分値が最小となる仮定奥行値Dx+1,y、Dx,y+1を算出する。 Next, the smoothing unit 80, according to the above mentioned (21), similarly to the pixel of interest P C, pixel position adjacent to the pixel of interest P C (x + 1, y ), select the difference between adjacent pixels (x, y + 1) Assumed depth values D x + 1, y and D x, y + 1 having the smallest values are calculated.

そして、平滑化手段80は、(22)式によって、注目画素Pの選択差分値E(Dx,y,x,y)に、仮定奥行値Dx+1,y、Dx,y+1と奥行値Dx,yとの差分を重み付け加算することで、選択差分値E(Dx,y,x,y)を平滑化した平滑化差分値Ev(Dx,y,x,y)を算出する。
Ev(Dx,y,x,y)=E(Dx,y,x,y)
+W{|Dx+1,y−Dx,y|+|Dx,y+1−Dx,y|} …(22)式
Then, the smoothing unit 80, by (22), the pixel of interest P C of the selected difference value E (D x, y, x , y) , the assumption depth value D x + 1, y, D x, y + 1 and the depth value D x, by weighted addition of the difference between y, and calculates selected difference value E (D x, y, x , y) smoothing the smoothed difference value Ev (D x, y, x , y) and .
Ev (Dx , y , x, y) = E ( Dx, y , x, y)
+ W {| Dx + 1, y− Dx , y | + | Dx, y + 1− Dx , y |} (22)

なお、(22)式において、平滑化係数Wは、任意の値(例えば、“2”)に手動で設定する。このとき、平滑化係数Wの値を大きくする程、選択差分値Eが滑らかになるが、被写体Tの境界部分の奥行値を誤推定する可能性が高くなる。このため、平滑化係数Wは、適切な値に設定することが好ましい。さらに、図示を省略した入力手段を介して、外部から平滑化係数Wを入力してもよい。   In the equation (22), the smoothing coefficient W is manually set to an arbitrary value (for example, “2”). At this time, as the value of the smoothing coefficient W is increased, the selection difference value E becomes smoother, but the possibility of erroneously estimating the depth value of the boundary portion of the subject T increases. For this reason, it is preferable to set the smoothing coefficient W to an appropriate value. Furthermore, the smoothing coefficient W may be input from the outside via an input unit (not shown).

そして、平滑化手段80は、以下の(23)式によって、画素位置(x,y)ごとの平滑化差分値Ev(Dx,y,x,y)を基準映像Fの全画素で総和することで、平滑化評価値Evを算出する。
Ev=Σx,yEv(Dx,y,x,y) …(23)式
Then, the smoothing unit 80, by the following equation (23), the sum the pixel position (x, y) smoothed difference value Ev for each (D x, y, x, y) of all pixels of the reference image F C By doing so, the smoothing evaluation value Ev is calculated.
Ev = Σx , y Ev (Dx , y , x, y) (23)

その後、平滑化手段80は、平滑化した平滑化差分値Ev(Dx,y,x,y)を、仮定奥行値dと基準映像Fの画素位置(x,y)に対応付けて記憶手段70に書き込む。また、平滑化手段80は、基準映像Fの全ての画素位置において、仮定奥行値dごとの平滑化差分値Ev(Dx,y,x,y)を記憶手段70に書き込んだ後に、平滑化完了を奥行値決定手段90に通知する。 Thereafter, the smoothing unit 80 is smoothed smoothed difference value Ev (D x, y, x , y) and, in association with the pixel positions of the hypothetical depth value d and the reference image F C (x, y) stores Write to means 70. Further, the smoothing means 80 writes the smoothed difference value Ev (D x, y , x, y) for each assumed depth value d in the storage means 70 at all pixel positions of the reference image F C , The depth value determining means 90 is notified of completion of conversion.

以上のように、平滑化手段80は、当該画素位置(x,y)における選択差分値E(Dx,y,x,y)を平滑化して、平滑化差分値Ev(Dx,y,x,y)を算出できる。これによって、奥行推定装置1は、隣接する画素間において、選択差分値E(Dx,y,x,y)が最小となる奥行値Dx,yが、オクルージョンまたは偽マッチング等によって互いに異なる場合であっても、滑らかな奥行値を推定することができる。 As described above, the smoothing unit 80 smoothes the selection difference value E (D x, y , x, y) at the pixel position (x, y), and smoothes the difference value Ev (D x, y , x, y) can be calculated. As a result, the depth estimation apparatus 1 may have different depth values D x, y that minimize the selection difference value E (D x, y , x, y) between adjacent pixels due to occlusion or false matching. Even so, a smooth depth value can be estimated.

なお、平滑化手段80は、差分値決定手段60から、基準映像Fの全ての画素位置において、全ての仮定奥行値dの選択差分値を書き込んだ旨(書き込み完了)を通知されることで動作を開始する。 Note that the smoothing means 80, the difference value determination means 60, at all pixel positions of the reference image F C, by being notified of all assumed depth value indicating that writing the selected difference value d (write complete) Start operation.

奥行値決定手段90は、以下の(24)式および(25)式によって、第2仮定奥行値D’(以後、奥行値D’)を最小視差量から最大視差まで変えながら、基準映像Fの画素位置(u,v)ごとに、画素位置(u,v)に対応付けて記憶手段70に記憶されている選択差分値E(D’,u,v)について、再計算評価値Ev’を算出する。なお、この再計算評価値Ev’は、平滑化手段80が平滑化した奥行値Du,vを奥行値D’に代えた平滑化評価値Evに相当する。
Ev’(D’,u,v)=E(D’,u,v)+W{|Du+1,v−D’|
+|Du,v+1−D’|} …(24)式
Ev’=Σx,y,Du,v→D’Ev(Dx,y,x,y) …(25)式
Depth value determining means 90, by the following equation (24) and (25), the second assumption depth value D '(hereinafter, the depth value D') while changing the up parallax from the minimum amount of parallax reference picture F C The recalculated evaluation value Ev ′ for the selection difference value E (D ′, u, v) stored in the storage unit 70 in association with the pixel position (u, v) for each pixel position (u, v) of Is calculated. The recalculated evaluation value Ev ′ corresponds to a smoothing evaluation value Ev obtained by replacing the depth value Du, v smoothed by the smoothing means 80 with the depth value D ′.
Ev ′ (D ′, u, v) = E (D ′, u, v) + W {| Du + 1, v− D ′ |
+ | Du , v + 1− D ′ |} (24) Ev ′ = Σ x, y, Du, v → D ′ Ev (D x, y , x, y) (25)

すなわち、奥行値決定手段90は、前記した(24)式によって、奥行値D’および注目画素P(画素位置(u,v))ごとに、選択差分値E(D’,u,v)に、注目画素Pに隣接する隣接画素の奥行値Du+1,v,Du,v+1と、奥行値D’との差分を重み付け加算することで、再計算差分値Ev’(D’,u,v)を算出する。そして、奥行値決定手段90は、前記した(25)式によって、選択差分値E(Dx,y,x,y)の座標(u,v)での奥行値Dx,yを奥行値D’に置き換えたときの平滑化差分値Ev(Dx,y,x,y)を基準映像Fの全画素で総和することで、再計算評価値Ev’を算出する。 That is, the depth value determining unit 90 selects the selection difference value E (D ′, u, v) for each of the depth value D ′ and the target pixel P C (pixel position (u, v)) according to the above equation (24). to the pixel of interest P C to the adjacent pixel adjacent depth value D u + 1, v, D u, and v + 1, 'by weighted addition of the difference between the recalculated difference value Ev' depth value D (D ', u , V). Then, the depth value determining means 90 calculates the depth value D x, y at the coordinates (u, v) of the selected difference value E (D x, y , x, y) by the above-described equation (25). 'smoothed difference value Ev when replaced by (D x, y, x, y) to that summing all pixels in the reference image F C, recalculated evaluation value Ev' is calculated.

なお、奥行値Du,vから奥行値D’に代えると、座標(u,v)における平滑化差分値Ev(D’,u,v)の値が代わる他、隣接画素での平滑化評価値Evの平滑化項である奥行値の差も変わる。そこで、(24)式で算出した再計算差分値Ev’(D’,u,v)を総和するのでなく、平滑化差分値Ev(Dx,y,x,y)を総和する(25)式を採用し、計算式が複雑になり過ぎることを防止した。 When the depth value D u, v is changed to the depth value D ′, the value of the smoothing difference value Ev (D ′, u, v) at the coordinates (u, v) is changed, and the smoothing evaluation at adjacent pixels is performed. The difference in the depth value that is the smoothing term of the value Ev also changes. Therefore, the recalculated difference values Ev ′ (D ′, u, v) calculated by the equation (24) are not summed, but the smoothed difference values Ev (D x, y , x, y) are summed (25). The formula is used to prevent the calculation formula from becoming too complex.

そして、奥行値決定手段90は、以下の(26)式によって、再計算評価値Ev’が平滑化評価値Ev未満であるか否かを判定する。
Ev’<Ev …(26)式
Then, the depth value determining unit 90 determines whether or not the recalculated evaluation value Ev ′ is less than the smoothing evaluation value Ev by the following equation (26).
Ev ′ <Ev (26)

再計算評価値Ev’が平滑化評価値Ev未満の場合、奥行値決定手段90は、以下の(27)式によって、平滑化評価値Evの値を再計算評価値Ev’の値で置き換えると共に、画素位置(u,v)の奥行値Du,vの値を奥行値D’の値で置き換える。なお、(27)式では、“=”は、右辺の値で左辺の値を置き換えることを意味する。
Ev=Ev’
u,v=D’ …(27)式
When the recalculated evaluation value Ev ′ is less than the smoothed evaluation value Ev, the depth value determining means 90 replaces the value of the smoothed evaluation value Ev with the value of the recalculated evaluation value Ev ′ according to the following equation (27). The value of the depth value D u, v at the pixel position (u, v) is replaced with the value of the depth value D ′. In the equation (27), “=” means that the value on the left side is replaced with the value on the right side.
Ev = Ev ′
D u, v = D ′ (27)

一方、再計算評価値Ev’が平滑化評価値Ev未満でない場合、奥行値決定手段90は、(27)式による置き換えを行わない。なお、奥行値決定手段90は、平滑化手段80から、選択差分値の平滑化が完了した旨(平滑化完了)を通知されることで動作を開始するものとする。   On the other hand, when the recalculated evaluation value Ev ′ is not less than the smoothed evaluation value Ev, the depth value determining unit 90 does not perform replacement according to the equation (27). It is assumed that the depth value determination unit 90 starts the operation when notified from the smoothing unit 80 that the smoothing of the selected difference value has been completed (smoothing completion).

このように、奥行値決定手段90は、奥行値D’を0から最大視差まで順に変えながら、基準映像Fの全画素における平滑化評価値Evが小さくなるように、各画素位置(u,v)の奥行値Du,vを代えることで、最適な奥行値Du,vを得ることができる。そして、奥行値決定手段90は、画素位置(u,v)ごとの奥行値Du,vを示す奥行映像Fを出力する。また、奥行値決定手段90は、基準映像Fの画素位置(u,v)ごとの奥行値Du,vを、基準映像Fの各画素の奥行値Dとして近傍奥行値出力手段40に出力する。 Thus, depth value determining means 90, while changing the order of the depth values D 'from 0 to the maximum disparity, as smoothed evaluation value Ev in all the pixels of the reference image F C decreases, each pixel position (u, By replacing the depth value D u, v of v), the optimum depth value D u, v can be obtained. Then, the depth value determination unit 90 outputs the depth image F Z indicating the depth value D u, v for each pixel position (u, v). Further, the depth determining means 90, the pixel position of the reference image F C (u, v) for each depth value D u, the v, in the vicinity of the depth value output means 40 as a depth value D of each pixel of the reference image F C Output.

なお、奥行値D’は、仮定奥行値dと同様、被写体Tの奥行値Dを仮定する値であって、最小視差量から最大視差量までの値をとる。例えば、奥行値Dを8ビットのデータで表す場合、奥行値D’は、“0”〜“255”の範囲の値をとる。   Note that the depth value D ′ is a value that assumes the depth value D of the subject T, as with the assumed depth value d, and takes a value from the minimum parallax amount to the maximum parallax amount. For example, when the depth value D is represented by 8-bit data, the depth value D ′ takes a value in the range of “0” to “255”.

以上説明したように、奥行推定装置1は、選択差分値を指標として、被写体Tの奥行値Dを推定することができる。
なお、奥行推定装置1は、1回目の奥行推定で決定した奥行値Dを用いて、2回目以降の奥行推定を行う。そして、奥行推定装置1は、奥行推定を繰返上限回数N回だけ繰り返した後に得られた奥行値Dから奥行映像Fを生成してもよい。なお、繰返上限回数Nは、奥行推定回数nの上限を示しており、任意の値に手動で設定される。
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 performs 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 depth value D obtained after repeated depth estimation only repeat upper limit number N times. The repetition upper limit number N indicates the upper limit of the depth estimation number n, and is manually set to an arbitrary value.

[奥行推定装置の動作]
以下、図8〜図16を参照して、図2の奥行推定装置1の動作について説明する(適宜図2参照)。ここでは、図8を参照して、奥行推定装置1の全体動作について説明し、詳細な説明については、図9〜図16を参照して説明を行うことにする。
[Operation of depth estimation device]
Hereinafter, the operation of the depth estimation apparatus 1 in FIG. 2 will be described with reference to FIGS. 8 to 16 (see FIG. 2 as appropriate). Here, the overall operation of the depth estimation apparatus 1 will be described with reference to FIG. 8, and the detailed description will be described with reference to FIGS. 9 to 16.

<全体動作>
図8を参照して、奥行推定装置1の全体動作について説明する。
奥行推定装置1は、奥行推定回数n=1とし、全ての画素の奥行値D=0として、初期設定を行う。そして、奥行推定装置1は、映像入力手段10によって、一直線上に等間隔で水平に配置したカメラCM(基準カメラC、隣接カメラCLL,C,C,CRR)より、同一の被写体Tを撮影したカメラ映像(基準映像F,隣接映像FLL,F,F,FRR)を入力する(ステップS1)。
<Overall operation>
With reference to FIG. 8, the overall operation of the depth estimation apparatus 1 will be described.
The depth estimation apparatus 1 performs the initial setting with the depth estimation count n = 1 and the depth value D = 0 of all pixels. The depth estimation apparatus 1 is identical to the camera CM (reference camera C C , adjacent cameras C LL , C L , C R , and C RR ) that are horizontally arranged at equal intervals on a straight line by the video input unit 10. subject T the captured camera image (reference image F C, the neighboring image F LL, F L, F R , F RR) to enter (step S1).

奥行推定装置1は、注目画素Pのy座標値およびx座標値を0に初期化し(ステップS2,S3)、仮定奥行値dを0に初期化する(ステップS4)。 Depth estimation apparatus 1, the y-coordinate values and the x-coordinate value of the pixel of interest P C is initialized to 0 (step S2, S3), it is initialized to 0 assumptions depth value d (step S4).

奥行推定装置1は、対応画素差分演算手段20によって、基準映像Fの注目画素Pの画素値と、当該注目画素Pの仮定奥行値dの視差に対応する隣接映像F,Fの対応画素P,Pの画素値との差分絶対値である隣接映像の対応画素差分値ECL,ECRを演算する(ステップS5;対応画素差分演算動作)。このステップS5の動作については、説明を後記する。 Depth estimation apparatus 1 by the corresponding pixel difference calculating unit 20, 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, F R of the corresponding pixel P L, P corresponding pixel difference values of adjacent image which is a difference absolute value between the pixel value of R E CL, calculates the E CR (step S5; corresponding pixel difference calculating operation). The operation of step S5 will be described later.

奥行推定装置1は、差分値決定手段60によって、最小差分値Emまたは平均差分値Eaの何れかを選択差分値として決定する(ステップS6;差分値決定動作)。このステップS6の動作については、説明を後記する。   The depth estimation apparatus 1 determines either the minimum difference value Em or the average difference value Ea as a selected difference value by the difference value determination unit 60 (step S6; difference value determination operation). The operation of step S6 will be described later.

奥行推定装置1は、変数である仮定奥行値d、カメラ映像のx座標値、y座標値を順次加算(インクリメント)する。その後、奥行推定装置1は、仮定奥行値dについては最大視差量になるまでステップS5,S6の動作を繰り返し(ステップS7,S8)、x座標値については映像幅になるまでステップS4〜S6の動作を繰り返し(ステップS9,S10)、y座標値については映像高になるまでステップS3〜S6の動作を繰り返す(ステップS11,S12)。なお、映像高は、映像幅と同様、任意の値に手動で設定される(例えば、1080ピクセル)。   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. After that, the depth estimation apparatus 1 repeats the operations in steps S5 and S6 until the assumed depth value d reaches the maximum parallax amount (steps S7 and S8), and the x coordinate value in steps S4 to S6 until the video width is reached. The operation is repeated (steps S9 and S10), and the operation of steps S3 to S6 is repeated for the y coordinate value until the image height is reached (steps S11 and S12). Note that the video height is manually set to an arbitrary value (for example, 1080 pixels), like the video width.

奥行推定装置1は、平滑化手段80によって、基準映像Fの全ての画素位置(x,y)ごとに、仮定奥行値dに対応して記憶された選択差分値E(d,x,y)を隣接画素の奥行値で平滑化する(ステップS13;平滑化動作)。このステップS13の動作については、説明を後記する。 Depth estimation apparatus 1, the smoothing means 80, all pixel positions of the reference image F C (x, y) for each, assuming the depth value d to correspondingly stored selected difference value E (d, x, y ) Is smoothed with the depth value of the adjacent pixel (step S13; smoothing operation). The operation of step S13 will be described later.

奥行推定装置1は、奥行値決定手段90によって、基準映像F全体で、画素位置(x,y)ごとの平滑化差分値の和が最小となる奥行値D(x,y)の組を探索して、基準映像Fの全ての画素位置について奥行値Dを決定する(ステップS14;奥行値決定動作)。このステップS14の動作については、説明を後記する。 Depth estimation apparatus 1, the depth value determining means 90, the entire reference image F C, the pixel position (x, y) the sum of the smoothed difference value for each is the minimum depth value D (x, y) a set of search to, for all pixel positions of the reference image F C determines a depth value D (step S14; depth value determining operation). The operation of step S14 will be described later.

奥行推定装置1は、奥行推定回数nが繰返上限回数N未満であるか否かを判定する(ステップS15)。奥行推定回数nが繰返上限回数N未満の場合(ステップS15でYes)、奥行推定装置1は、ステップS16の処理に進む。この場合、奥行推定装置1は、奥行推定回数nをインクリメントし(ステップS16)、ステップS2の処理に戻る。   The depth estimation apparatus 1 determines whether the depth estimation number n is less than the repetition upper limit number N (step S15). When the depth estimation number n is less than the repetition upper limit number N (Yes in step S15), the depth estimation device 1 proceeds to the process of step S16. In this case, the depth estimation apparatus 1 increments the depth estimation number n (step S16), and returns to the process of step S2.

一方、奥行推定回数nが繰返上限回数N未満でない場合(ステップS15でNo)、奥行推定装置1は、奥行値決定手段90によって、画素位置ごとの奥行値Dを示す奥行映像Fを出力し(ステップS17)、動作を終了する。以上のように、奥行推定装置1は、ステップS1〜S17の処理によって、複数のカメラ映像から、被写体Tの奥行きを示す奥行値Dを推定することができる。 On the other hand, if the depth estimation number n is not less than the repetition upper limit number N (No in step S15), and the depth estimation apparatus 1, the depth value determination unit 90, outputs the depth image F Z indicating a depth value D for each pixel position (Step S17), and the operation ends. As described above, the depth estimation apparatus 1 can estimate the depth value D indicating the depth of the subject T from a plurality of camera images by the processes of steps S1 to S17.

<対応画素差分演算動作>
図9を参照して、対応画素差分演算動作(図8のステップS5)について詳細に説明する。
<Corresponding pixel difference calculation operation>
With reference to FIG. 9, the corresponding pixel difference calculation operation (step S5 in FIG. 8) will be described in detail.

対応画素差分演算手段20は、前記した(2)式によって、対応画素Pが隣接映像Fから外れていないか否かを判定する(ステップS50)。対応画素Pが隣接映像Fから外れていない場合(ステップS50でYes)、対応画素差分演算手段20は、ステップS51の処理に進む。一方、対応画素Pが隣接映像Fから外れている場合(ステップS50でNo)、対応画素差分演算手段20は、ステップS54の処理に進む。 Corresponding pixel difference calculating means 20 is checked by the aforementioned formula (2), whether the corresponding pixel P R is not deviated from neighboring image F R (step S50). If the corresponding pixel P R is not deviated from neighboring image F R (Yes in step S50), the corresponding pixel difference calculating unit 20, the process proceeds to step S51. On the other hand, if the corresponding pixel P R is out of the neighboring image F R (No at step S50), the corresponding pixel difference calculating unit 20, the processing proceeds to step S54.

対応画素差分演算手段20は、前記した(3)式によって、対応画素Pが隣接映像Fから外れていないか否かを判定する(ステップS51)。対応画素Pが隣接映像Fから外れていない場合(ステップS51でYes)、対応画素差分演算手段20は、ステップS52の処理に進む。一方、対応画素Pが隣接映像Fから外れている場合(ステップS51でNo)、対応画素差分演算手段20は、ステップS53の処理に進む。 Corresponding pixel difference calculating means 20 is checked by the aforementioned equation (3), whether or not the corresponding pixel P L does not deviate from neighboring image F L (step S51). If the corresponding pixel P L does not deviate from neighboring image F L (Yes in step S51), the corresponding pixel difference calculating unit 20, the process proceeds to step S52. On the other hand, if the corresponding pixels P L is out of the neighboring image F L (No in step S51), the corresponding pixel difference calculating unit 20, the process proceeds to step S53.

対応画素差分演算手段20は、前記した(1)式によって、左右の隣接映像F,Fで仮定奥行値dだけ右もしくは左に移動した対応画素P,Pの画素値P(x+d,y),P(x−d,y)と、注目画素Pの画素値P(x,y)との対応画素差分値ECL(d,x,y),ECR(d,x,y)を算出する(ステップS52)。 Corresponding pixel difference calculating means 20, according to the above mentioned (1), the left and right neighboring image F L, F R on the assumption depth value d by the corresponding pixel has been moved to the right or left P L, P R of the pixel value P L ( x + d, y), P R (x-d, and y), the pixel value P C (x of the pixel of interest P C, y) and the corresponding pixel difference value E CL (d, x, y ), E CR (d , X, y) is calculated (step S52).

対応画素差分演算手段20は、前記した(4)式によって、右側の隣接映像F,FRRで仮定奥行値dだけ左に移動した対応画素PRR,Pの画素値PRR(x−2d,y),P(x−d,y)との対応画素差分値ECL(d,x,y),ECR(d,x,y)を算出する(ステップS53)。 Corresponding pixel difference calculating means 20, according to the above mentioned (4), the right neighboring image F R, the corresponding pixel has moved to the left by assuming the depth value d in F RR P RR, P R of the pixel value P RR (x- 2d, y), P R (x−d, y) and corresponding pixel difference values E CL (d, x, y) and E CR (d, x, y) are calculated (step S53).

対応画素差分演算手段20は、前記した(5)式によって、左の隣接映像F,FLLで仮定奥行値dだけ右に移動した対応画素P,PLLの画素値P(x+d,y),PLL(x+2d,y)との対応画素差分値ECL(d,x,y),ECR(d,x,y)を算出する(ステップS54)。 The corresponding pixel difference calculation means 20 calculates the pixel value P L (x + d, x) of the corresponding pixels P L and P LL moved to the right by the assumed depth value d in the left adjacent images F L and F LL according to the above-described equation (5). y), pixel difference values E CL (d, x, y) and E CR (d, x, y) corresponding to P LL (x + 2d, y) are calculated (step S54).

すなわち、対応画素差分演算手段20は、対応画素P,Pが左右の隣接映像F,F内にある場合、左右の隣接映像F,Fを用いて、対応画素差分値ECL,ECRを算出する。また、隣接映像F,Fの一方から対応画素が外れる場合、対応画素差分演算手段20は、対応画素が外れた側の隣接画像と反対側の2つの隣接映像(右側の隣接映像F,FRRまたは左の隣接映像F,FLL)を用いて、対応画素差分値ECL,ECRを算出する。これによって、奥行推定装置1は、2つの対応画素差分値ECL,ECRから最適な選択差分値を決定することができ、正しい奥行値を推定することができる。 That is, the corresponding pixel difference calculating means 20, the corresponding pixel P L, P R is the left and right neighboring image F L, when within F R, the left and right neighboring image F L, with F R, the corresponding pixel difference value E CL and ECR are calculated. When the corresponding pixel is deviated from one of the adjacent images F L and F R , the corresponding pixel difference calculation means 20 uses the two adjacent images (right adjacent image F R on the right side) opposite to the adjacent image on the side from which the corresponding pixel is removed. , F RR or left adjacent video images F L , F LL ), corresponding pixel difference values E CL , E CR are calculated. Thus, the depth estimation apparatus 1 has two corresponding pixel difference value E CL, it is possible to determine the optimum choice difference value from E CR, it is possible to estimate the correct depth value.

<差分値決定動作>
図10を参照して、差分値決定動作(図8のステップS6)について詳細に説明する(適宜図2参照)。
<Differential value determination operation>
With reference to FIG. 10, the difference value determining operation (step S6 in FIG. 8) will be described in detail (see FIG. 2 as appropriate).

差分値決定手段60は、差分値選択手段60cによって、奥行推定回数nが1回目であるか、2回目以降であるかを判定する(ステップS60)。奥行推定回数nが1回目の場合(ステップS60でYes)、差分値決定手段60は、ステップS61の処理に進む。一方、奥行推定回数nが2回目以降の場合(ステップS60でNo)、差分値決定手段60は、ステップS62の処理に進む。   The difference value determination means 60 determines whether the depth estimation number n is the first time or the second time or later by the difference value selection means 60c (step S60). When the depth estimation number n is the first time (Yes in step S60), the difference value determination unit 60 proceeds to the process of step S61. On the other hand, when the depth estimation number n is the second time or later (No in step S60), the difference value determination unit 60 proceeds to the process of step S62.

差分値決定手段60は、平均差分値演算手段60aによって、前記した(11)式で平均差分値Ea(d,x,y)を算出する。そして、差分値決定手段60は、差分値選択手段60cによって、前記した(13)式のように、平均差分値Eaを選択差分値Eとして選択する(ステップS61)。   The difference value determining means 60 calculates the average difference value Ea (d, x, y) by the above-described equation (11) by the average difference value calculating means 60a. Then, the difference value determining means 60 selects the average difference value Ea as the selected difference value E by the difference value selecting means 60c as shown in the above-described equation (13) (step S61).

差分値決定手段60は、近傍奥行値出力手段40から、近傍画素PSL,PSRの奥行値D、Dを取得する(ステップS62;近傍奥行値出力動作)。このステップS62の動作については、説明を後記する。 Difference determining means 60 acquires from the vicinity depth value output unit 40, neighboring pixels P SL, the depth value D L of P SR, the D R (step S62; near depth value output operation). The operation of step S62 will be described later.

差分値決定手段60は、差分値選択手段60cによって、最小差分値Emまたは平均差分値Eaの何れかを、予め設定された条件に基づいて、選択差分値Eとして選択する(ステップS63;差分値選択動作)。このステップS63の動作については、説明を後記する。   The difference value determination unit 60 selects either the minimum difference value Em or the average difference value Ea as the selection difference value E based on a preset condition by the difference value selection unit 60c (step S63; difference value). Selection action). The operation of step S63 will be described later.

<近傍奥行値出力動作>
図11を参照して、近傍奥行値出力手動作(図10のステップS62)について詳細に説明する(適宜図2参照)。
<Near depth value output operation>
Referring to FIG. 11, the neighborhood depth value output manual operation (step S62 in FIG. 10) will be described in detail (see FIG. 2 as appropriate).

近傍奥行値出力手段40は、近傍画素数sを最大視差量Dに設定する(ステップS620)。そして、近傍奥行値出力手段40は、前記した(7)式によって、左右の近傍画素PSL,PSRの奥行値D,Dを取得する(ステップS621)。 Near depth value output section 40 sets the number of neighboring pixels s in maximum disparity amount D M (step S620). Then, near the depth value output means 40, according to the above mentioned (7), the left and right neighboring pixels P SL, the P SR depth value D L, obtains the D R (step S621).

近傍奥行値出力手段40は、前記した(8)式によって、左奥行値Dと右奥行値Dとの差分絶対値|D−D|が閾値th1を超えるか否かを判定する(ステップS622)。差分絶対値|D−D|が閾値th1を超える場合(ステップS622でYes)、近傍奥行値出力手段40は、処理を終了する。一方、差分絶対値|D−D|が閾値th1を超えない場合(ステップS622でNo)、近傍奥行値出力手段40は、ステップS623の処理に進む。 Near depth value output means 40, according to the above mentioned (8), a difference absolute value between the left depth value D L and the right depth value D R | determines whether exceeds the threshold value th1 | D L -D R (Step S622). If the difference absolute value | D L −D R | exceeds the threshold th1 (Yes in step S622), the neighborhood depth value output unit 40 ends the process. On the other hand, if the difference absolute value | D L −D R | does not exceed the threshold th1 (No in step S622), the neighborhood depth value output unit 40 proceeds to the process of step S623.

近傍奥行値出力手段40は、前記した(9)式によって、近傍画素数sを半分する(ステップS623)。そして、近傍奥行値出力手段40は、前記した(7)式によって、近傍画素数sが半分となった近傍画素PSL,PSRの奥行値D,Dを取得する(ステップS624)。 The neighborhood depth value output means 40 halves the number of neighboring pixels s by the above-described equation (9) (step S623). Then, near the depth value output unit 40, according to the above mentioned (7), the number of neighboring pixels s are neighboring pixels becomes half P SL, the P SR depth value D L, obtains the D R (step S624).

<差分値選択動作>
図12を参照して、差分値選択動作(図10のステップS63)について詳細に説明する(適宜図2参照)。なお、以後の各図では、近傍画素の画素値を近傍画素値と図示することがある。
<Differential value selection operation>
With reference to FIG. 12, the difference value selection operation (step S63 in FIG. 10) will be described in detail (see FIG. 2 as appropriate). In the subsequent drawings, the pixel values of neighboring pixels may be shown as neighboring pixel values.

差分値選択手段60cは、近傍画素値出力手段30から、注目画素Pの画素値と、近傍画素PSL,PSRの画素値とを取得する(ステップS630;近傍画素値出力動作)。このステップS630の動作については、説明を後記する。 Difference value selection unit 60c acquires from the neighboring pixel value output unit 30, the pixel value of the pixel of interest P C, neighboring pixel P SL, and a pixel value of P SR (step S630; neighboring pixel value output operation). The operation of step S630 will be described later.

差分値選択手段60cは、前記した(14)式によって、左右の近傍画素PSL,PSRの画素値の差分絶対値ELRを算出し(ステップS631)、差分絶対値|D−D|が閾値th1を超え、かつ、差分絶対値ELRが閾値th2を超えるか否かを判定する(ステップS632)。 The difference value selection means 60c calculates the absolute difference value E LR of the pixel values of the left and right neighboring pixels P SL and P SR by the above-described equation (14) (step S631), and the absolute difference value | D L −D R It is determined whether or not | exceeds the threshold th1 and the difference absolute value E LR exceeds the threshold th2 (step S632).

差分絶対値|D−D|が閾値th1を超え、かつ、差分絶対値ELRが閾値th2を超える場合(ステップS632でYes)、差分値選択手段60cは、ステップS633の処理に進む。一方、差分絶対値|D−D|が閾値th1を超えない場合、または、差分絶対値ELRが閾値th2を超えない場合(ステップS632でNo)、差分値選択手段60cは、ステップS639の処理に進む。 When the difference absolute value | D L −D R | exceeds the threshold th1 and the difference absolute value E LR exceeds the threshold th2 (Yes in step S632), the difference value selection unit 60c proceeds to the process of step S633. On the other hand, if the difference absolute value | D L −D R | does not exceed the threshold th1, or if the difference absolute value E LR does not exceed the threshold th2 (No in step S632), the difference value selection unit 60c performs step S639. Proceed to the process.

差分値選択手段60cは、近傍奥行対応画素値出力手段50から、奥行値Dの視差に対応する画素位置にある近傍奥行対応画素の画素値PLDL,PRDLと、奥行値Dの視差に対応する画素位置にある近傍奥行対応画素の画素値PLDR,PRDRとを取得する(ステップS633;近傍奥行対応画素値出力動作)。このステップS633の動作については、説明を後記する。 Difference value selection unit 60c from neighboring depth corresponding pixel value output unit 50, the pixel value P LDL neighboring depth corresponding pixel in the pixel position corresponding to parallax of the depth value D L, and P RDL, parallax depth value D R obtaining pixel values P LDR neighboring depth corresponding pixel, and a P RDR at the corresponding pixel position (step S633; near depth corresponding pixel value output operation). The operation of step S633 will be described later.

差分値選択手段60cは、前記した(16)式によって、左右の隣接映像F,Fにおいて、注目画素Pを背景A側の奥行値Dに相当する画素数だけ左右に移動させた近傍奥行対応画素の画素値PLDR,PRDRと、注目画素の画素値Pとの差分絶対値ELDR,ERDRを算出する。そして、差分値選択手段60cは、前記した(19)式によって、左右の隣接映像F,Fにおいて、注目画素Pを背景A側の奥行値Dに相当する画素数だけ左右に移動させた近傍奥行対応画素の画素値PLDL,PRDLと、注目画素Pとの画素値の差分絶対値ELDL,ERDLを算出する(ステップS634)。 Difference value selecting means 60c is the aforementioned (16), left and right neighboring image F L, in F R, is moved to the left and right by the number of pixels corresponding to the pixel of interest P C to a depth value D R Background A side calculating pixel value P LDR neighboring depth corresponding pixel, and P RDR, differential absolute value E LDR between the pixel value P C of the pixel of interest, the E RDR. The moving difference value selecting unit 60c is the aforementioned (19), left and right neighboring image F L, in F R, the left and right by the number of pixels corresponding to the pixel of interest P C to a depth value D L background A side pixel value P LDL neighboring depth corresponding pixels is calculated and P RDL, differential absolute value E LDL pixel values between the target pixel P C, the E RDL (step S634).

差分値選択手段60cは、前記した(15)式によって、奥行値Dが奥行値D以上であるか否かを判定することにより、左右どちら側に奥行値が小さくなる背景Aがあるかを判定する(ステップS635)。奥行値Dが奥行値D以上の場合(ステップS635でYes)、差分値選択手段60cは、ステップS636の処理に進む。一方、奥行値Dが奥行値D以上でない場合(ステップS635でNo)、差分値選択手段60cは、ステップS637の処理に進む。 Or the difference value selecting unit 60c is the aforementioned (15), by the depth value D L is determined to or greater than the depth value D R, there is a background A the depth value decreases in the left or right side Is determined (step S635). If the depth value D L is greater than the depth value D R (Yes in step S635), the difference value selecting unit 60c, the process proceeds to step S636. On the other hand, if the depth value D L is less than the depth value D R (No at step S635), the difference value selecting unit 60c, the process proceeds to step S637.

差分値選択手段60cは、前記した(17)式によって、差分絶対値ELDRが差分絶対値ERDRを超えたか否かを判定することにより、左側の隣接映像Fでオクルージョンの有無を判定する(ステップS636)。差分絶対値ELDRが差分絶対値ERDRを超える場合(ステップS636でYes)、差分値選択手段60cは、ステップS638の処理に進む。一方、差分絶対値ELDRが差分絶対値ERDRを超えない場合(ステップS636でNo)、差分値選択手段60cは、ステップS639の処理に進む。 Difference value selection unit 60c is checked by the aforementioned (17), by the difference absolute value E LDR to determine whether exceeds the difference absolute value E RDR, the existence of occlusions in the left neighboring image F L (Step S636). When the difference absolute value E LDR exceeds the difference absolute value E RDR (Yes in step S636), the difference value selecting unit 60c, the process proceeds to step S638. On the other hand, when the difference absolute value E LDR does not exceed the difference absolute value E RDR (No at step S636), the difference value selecting unit 60c, the process proceeds to step S639.

差分値選択手段60cは、前記した(20)式によって、差分絶対値ERDLが差分絶対値ELDLを超えたか否かを判定することにより、右側の隣接映像Fでオクルージョンの有無を判定する(ステップS637)。差分絶対値ERDLが差分絶対値ELDLを超える場合(ステップS637でYes)、差分値選択手段60cは、ステップS638の処理に進む。一方、差分絶対値ERDLが差分絶対値ELDLを超えない場合(ステップS637でNo)、差分値選択手段60cは、ステップS639の処理に進む。 Difference value selection unit 60c is checked by the aforementioned equation (20), by the difference absolute value E RDL to determine whether exceeds the difference absolute value E LDL, the presence of occlusion in the right neighboring image F R (Step S637). When the difference absolute value E RDL exceeds the difference absolute value E LDL (Yes in step S637), the difference value selection unit 60c proceeds to the process of step S638. On the other hand, if the difference absolute value E RDL does not exceed the difference absolute value E LDL (No in step S637), the difference value selection unit 60c proceeds to the process of step S639.

差分値選択手段60cは、前記した(12)式および(18)式によって、最小差分値選択手段60bが算出した最小差分値Em(d,x,y)を選択差分値E(d,x,y)として選択する(ステップ638)。   The difference value selection means 60c calculates the minimum difference value Em (d, x, y) calculated by the minimum difference value selection means 60b using the above-described expressions (12) and (18) as the selection difference value E (d, x, y). y) is selected (step 638).

差分値選択手段60cは、前記した(11)式および(13)式によって、平均差分値演算手段60aが算出した平均差分値Ea(d,x,y)を選択差分値E(d,x,y)として選択する(ステップ639)。   The difference value selection means 60c calculates the average difference value Ea (d, x, y) calculated by the average difference value calculation means 60a according to the above-described expressions (11) and (13) as the selection difference value E (d, x, y). y) is selected (step 639).

以上のように、差分値選択手段60cは、ステップS630〜S639の処理によって、基準映像の画素位置(x,y)ごとに、複数の仮定奥行値d(“0”〜最大視差量)に対応した選択差分値E(d,x,y)を選択することができる。   As described above, the difference value selection unit 60c corresponds to a plurality of assumed depth values d (“0” to the maximum parallax amount) for each pixel position (x, y) of the reference image by the processing in steps S630 to S639. The selected difference value E (d, x, y) can be selected.

<近傍画素値出力動作>
図13を参照して、近傍画素値出力手動作(図12のステップS630)について詳細に説明する(適宜図2参照)。
<Neighboring pixel value output operation>
Referring to FIG. 13, the neighboring pixel value output manual operation (step S630 in FIG. 12) will be described in detail (see FIG. 2 as appropriate).

近傍画素値出力手段30は、前記した(6)式によって、注目画素P(x,y)の画素値Pと、注目画素P(x,y)から近傍画素数sだけ左に離れた画素位置P(x−s,y)にある近傍画素の画素値PSLと、注目画素P(x,y)から近傍画素数sだけ右に離れた画素位置P(x+s,y)にある近傍画素の画素値PSRとを取得する(ステップS6300)。 Neighboring pixel value output unit 30, according to the above mentioned (6), the pixel value P C of the pixel of interest P C (x, y), the pixel of interest P C (x, y) spaced to the left only in the vicinity pixel number s from The pixel value P SL of the neighboring pixel at the pixel position P C (x−s, y) and the pixel position P C (x + s, y) separated from the target pixel P C (x, y) by the number of neighboring pixels s to the right. and acquires the pixel value P SR neighboring pixels in) (step S6300).

<近傍奥行対応画素値出力動作>
図14を参照して、近傍奥行対応画素値出力手動作(図12のステップS633)について詳細に説明する。
<Neighbor Depth-Compatible Pixel Value Output Operation>
With reference to FIG. 14, the neighborhood depth corresponding pixel value output manual operation (step S <b> 633 in FIG. 12) will be described in detail.

近傍奥行対応画素値出力手段50は、前記した(10)式によって、左右の隣接映像F,Fから、奥行値Dの視差に対応する画素位置にある近傍奥行対応画素P(x+D,y),P(x−D,y)の画素値PLDL,PRDLを算出する。そして、近傍奥行対応画素値出力手段50は、前記した(10)式によって、左右の隣接映像F,Fから、奥行値Dの視差に対応する画素位置にある近傍奥行対応画素P(x+D,y),P(x−D,y)の画素値PLDR,PRDRを算出する(ステップS6330)。 The neighborhood depth corresponding pixel value output means 50 calculates the neighborhood depth correspondence pixel P L (x + D) at the pixel position corresponding to the parallax of the depth value D L from the left and right adjacent images F L and F R according to the above-described equation (10). L, y), P R ( x-D L, y) of the pixel values P LDL, and calculates the P RDL. Then, near the depth corresponding pixel value output unit 50, according to the above mentioned (10), left and right neighboring image F L, from F R, the depth value D near depth corresponding pixel is in the pixel position corresponding to parallax of R P L Pixel values P LDR and P RDR of (x + D R , y) and P R (x−D R , y) are calculated (step S6330).

<平滑化動作>
図15を参照して、平滑化動作(図8のステップS13)の動作について詳細に説明する。
<Smoothing operation>
The smoothing operation (step S13 in FIG. 8) will be described in detail with reference to FIG.

平滑化手段80は、変数として、カメラ映像(基準映像F)のx座標値およびy座標値を初期化(x=0、y=0)する(ステップS130,S131)。 The smoothing means 80 initializes (x = 0, y = 0) the x coordinate value and the y coordinate value of the camera image (reference image F C ) as variables (steps S130 and S131).

平滑化手段80は、前記した(21)式によって、基準映像Fの注目画素P(画素位置(x,y))ごとに、注目画素Pの選択差分値E(d,x,y)が最小となる仮定奥行値dを算出する。そして、平滑化手段80は、その仮定奥行値dを,その画素の奥行値Dx,yとする(ステップS132)。 The smoothing unit 80 selects the difference value E (d, x, y) of the target pixel P C for each target pixel P C (pixel position (x, y)) of the reference image F C according to the above-described equation (21). ) Is calculated as the assumed depth value d. Then, the smoothing unit 80 sets the assumed depth value d as the depth value D x, y of the pixel (step S132).

平滑化手段80は、変数であるカメラ映像のx座標値、y座標値を順次加算(インクリメント)する。その後、平滑化手段80は、x座標値については映像幅になるまでステップS132の動作を繰り返し(ステップS133,S134)、y座標値については映像高になるまでステップS131,S132の動作を繰り返す(ステップS135,S136)。   The smoothing means 80 sequentially adds (increments) the x-coordinate value and the y-coordinate value of the camera image that are variables. After that, the smoothing means 80 repeats the operation of step S132 until the video width becomes the x coordinate value (steps S133 and S134), and repeats the operations of steps S131 and S132 until the video height is reached for the y coordinate value ( Steps S135 and S136).

平滑化手段80は、前記した(21)式によって、注目画素Pに隣接する画素位置(x+1,y),(x,y+1)の隣接画素の選択差分値が最小となる仮定奥行値Dx+1,y、Dx,y+1を算出する。そして、平滑化手段80は、(22)式によって、注目画素Pの選択差分値E(Dx,y,x,y)に、仮定奥行値Dx+1,y、Dx,y+1と奥行値Dx,yとの差分を重み付け加算することで、選択差分値E(Dx,y,x,y)を平滑化した平滑化差分値Ev(Dx,y,x,y)を算出する(ステップS137)。 Smoothing means 80, according to the above mentioned (21), a pixel position adjacent to the pixel of interest P C (x + 1, y ), (x, y + 1) selection difference values of adjacent pixels becomes the minimum assumed depth value D x + 1 , Y , D x, y + 1 are calculated. Then, the smoothing unit 80, by (22), the pixel of interest P C of the selected difference value E (D x, y, x , y) , the assumption depth value D x + 1, y, D x, y + 1 and the depth value D x, by weighted addition of the difference between y, and calculates selected difference value E (D x, y, x , y) smoothing the smoothed difference value Ev (D x, y, x , y) and (Step S137).

平滑化手段80は、前記した(23)式によって、画素位置(x,y)ごとの平滑化差分値Ev(Dx,y,x,y)を基準映像Fの全画素で総和することで、平滑化評価値Evを算出する(ステップS138)。 Smoothing means 80, according to the above mentioned (23), the summing pixel position (x, y) for each of the smoothed difference value Ev (D x, y, x , y) of all pixels of the reference image F C Thus, the smoothing evaluation value Ev is calculated (step S138).

<奥行値決定動作>
図16を参照して、奥行値決定動作(図8のステップS14)の動作について詳細に説明する。
<Depth value determination operation>
With reference to FIG. 16, the depth value determining operation (step S14 in FIG. 8) will be described in detail.

奥行値決定手段90は、全ての画素の奥行値(第2仮定奥行値)D’を初期化し(S140)、注目画素Pのv座標値およびu座標値を0に初期化する(ステップS141,S142)。 Depth value determining means 90, the depth value of all the pixels (the second assumed depth value) D 'initialized (S140), the v coordinate value and u coordinate value of the pixel of interest P C is initialized to 0 (step S141 , S142).

奥行値決定手段90は、前記した(24)式および(25)式によって、第2の仮定奥行値D’を最小視差量から最大視差量まで変えながら、基準映像Fの画素位置(u,v)ごとに、画素位置(u,v)に対応付けて記憶手段70に記憶されている選択差分値E(D’,u,v)について、平滑化手段80が平滑化した奥行値Du,vを奥行値D’に代えた再計算評価値Ev’を算出する(ステップS143)。 Depth value determining means 90, according to the above mentioned (24) and (25) below, while changing the second assumption depth value D 'to the maximum amount of parallax from the minimum amount of parallax pixel position of the reference image F C (u, For each v), the depth value D u smoothed by the smoothing means 80 for the selection difference value E (D ′, u, v) stored in the storage means 70 in association with the pixel position (u, v). , V is replaced with a depth value D ′, a recalculated evaluation value Ev ′ is calculated (step S143).

奥行値決定手段90は、前記した(26)式によって、再計算評価値Ev’が平滑化評価値Ev未満であるか否かを判定する(ステップS144)。再計算評価値Ev’が平滑化評価値Ev未満の場合(ステップS144でYes)、奥行値決定手段90は、ステップS145の処理に進む。一方、再計算評価値Ev’が平滑化評価値Ev未満でない場合(ステップS144でNo)、奥行値決定手段90は、ステップS146の処理に進む。   The depth value determining means 90 determines whether or not the recalculated evaluation value Ev ′ is less than the smoothing evaluation value Ev by the above-described equation (26) (step S144). When the recalculated evaluation value Ev ′ is less than the smoothed evaluation value Ev (Yes in step S144), the depth value determining unit 90 proceeds to the process of step S145. On the other hand, when the recalculated evaluation value Ev ′ is not less than the smoothed evaluation value Ev (No in step S144), the depth value determining unit 90 proceeds to the process of step S146.

奥行値決定手段90は、前記した(27)式によって、平滑化評価値Evの値を再計算評価値Ev’の値で置き換えると共に、画素位置(u,v)の奥行値Du,vの値を奥行値D’の値で置き換える(ステップS145)。 The depth value determining means 90 replaces the value of the smoothed evaluation value Ev with the value of the recalculated evaluation value Ev ′ according to the above-described equation (27), and the depth value D u, v of the pixel position (u, v). The value is replaced with the value of the depth value D ′ (step S145).

奥行値決定手段90は、変数である奥行値D’、u座標値、v座標値を順次加算(インクリメント)する。その後、奥行値決定手段90は、u座標値については映像幅になるまでステップS143〜S145の動作を繰り返し(ステップS146,S147)、v座標値については映像高になるまでステップS142〜S145の動作を繰り返し(ステップS148,S149)、奥行値D’については最大視差量になるまでステップS141〜S145の動作を繰り返す(ステップS150,S151)。   The depth value determination means 90 sequentially adds (increments) the depth value D ′, u coordinate value, and v coordinate value, which are variables. Thereafter, the depth value determining means 90 repeats the operations in steps S143 to S145 until the video width is obtained for the u coordinate value (steps S146 and S147), and the operations in steps S142 to S145 are performed until the video height is obtained for the v coordinate value. Are repeated (steps S148 and S149), and the operation of steps S141 to S145 is repeated until the depth value D ′ reaches the maximum amount of parallax (steps S150 and S151).

以上のように、奥行推定装置1は、オクルージョンの有無にかかわらず、注目画素の画素値と、近傍画素の画素値と、近傍画素の奥行値と、この近傍画素の奥行値に対応する近傍奥行対応画素の画素値とに基づいて、平均差分値または最小差分値の何れか最適な方を選択する。これによって、奥行推定装置1は、隣接映像で偽マッチングが発生している場合、平均差分値を選択することにより、より正しい選択差分値から奥行値Dを推定でき、オクルージョンが有る場合、そのときの奥行値Dを推定対象から除くことができる。すなわち、奥行推定装置1は、正確な奥行値Dを推定することができる。   As described above, the depth estimation device 1 performs the pixel value of the target pixel, the pixel value of the neighboring pixel, the depth value of the neighboring pixel, and the neighboring depth corresponding to the depth value of the neighboring pixel regardless of the presence or absence of occlusion. Based on the pixel value of the corresponding pixel, the optimum one of the average difference value and the minimum difference value is selected. Thereby, the depth estimation apparatus 1 can estimate the depth value D from the more correct selection difference value by selecting the average difference value when false matching occurs in the adjacent video, and if there is occlusion, then Can be excluded from the estimation target. That is, the depth estimation device 1 can estimate an accurate depth value D.

第1実施形態では、図1に示すように、5つの映像(FLL,F,F,F,FRR)が奥行推定装置1に入力されることとして説明したが、映像の数はこれに限定されない。以下、第2実施形態として、3つの映像(F,F,FRR)から被写体Tの奥行値Dを推定する奥行推定システムSBについて説明する。 In the first embodiment, as illustrated in FIG. 1, five videos (F LL , F L , F C , F R , F RR ) have been described as being input to the depth estimation device 1. Is not limited to this. Hereinafter, a depth estimation system SB that estimates the depth value D of the subject T from three images (F L , F C , F RR ) will be described as a second embodiment.

(第2実施形態)
[奥行推定システムの全体構成]
図17を参照して、本発明の第2実施形態に係る奥行推定装置1Bを含んだ奥行推定システムSBの全体構成について、第1実施形態と異なる点を説明する。
(Second Embodiment)
[Overall configuration of depth estimation system]
With reference to FIG. 17, the overall configuration of the depth estimation system SB including the depth estimation device 1B according to the second embodiment of the present invention will be described with respect to differences from the first embodiment.

図17に示すように、奥行推定システムSBは、カメラCM(C,C,C)と、奥行推定装置1Bとを備えている。すなわち、奥行推定システムSBでは、カメラC,Cが、カメラCを左右から挟むように配置されている。そして、カメラCM(C,C,C)で撮影した映像(F,F,FRR)が、奥行推定装置1Bに入力される。 As shown in FIG. 17, the depth estimation system SB includes a camera CM (C L , C C , C R ) and a depth estimation device 1B. That is, in the depth estimation system SB, camera C L, C R are arranged so as to sandwich the camera C C from left and right. Then, the images (F L , F C , F RR ) captured by the camera CM (C L , C C , C R ) are input to the depth estimation device 1B.

[奥行推定装置の構成]
図18を参照して、奥行推定装置1Bの構成について、第1実施形態と異なる点を説明する(適宜図17参照)。
[Configuration of depth estimation device]
With reference to FIG. 18, the difference of the configuration of the depth estimation device 1B from the first embodiment will be described (see FIG. 17 as appropriate).

奥行推定装置1Bは、水平方向に配列したカメラCM(C,C,C)で被写体Tを撮影したカメラ映像(F,F,F)から、被写体Tの奥行きを示す奥行値Dを推定する。このため、奥行推定装置1Bは、映像入力手段10Bと、対応画素差分演算手段20Bと、近傍画素値出力手段30と、近傍奥行値出力手段40と、近傍奥行対応画素値出力手段50と、差分値決定手段60と、記憶手段70と、平滑化手段80と、奥行値決定手段90とを備える。 The depth estimation apparatus 1B is a depth indicating the depth of the subject T from the camera video (F L , F C , F R ) obtained by photographing the subject T with the cameras CM (C L , C C , C R ) arranged in the horizontal direction. Estimate the value D. For this reason, the depth estimation apparatus 1B includes a difference between the video input unit 10B, the corresponding pixel difference calculation unit 20B, the neighboring pixel value output unit 30, the neighboring depth value output unit 40, and the neighboring depth corresponding pixel value output unit 50. Value determining means 60, storage means 70, smoothing means 80, and depth value determining means 90 are provided.

映像入力手段10Bは、カメラCMで撮影された複数のカメラ映像を入力するものである。ここでは、映像入力手段10Bは、基準カメラCで撮影した基準映像Fと、隣接カメラC,Cで撮影した隣接映像F,Fとを入力する。
この映像入力手段10Bで入力した各映像(F,F,F)は、図示を省略したメモリに記憶され、後記する対応画素差分演算手段20B、近傍画素値出力手段30、および、近傍奥行対応画素値出力手段50によって参照されるものとする。
The video input unit 10B inputs a plurality of camera videos taken by the camera CM. Here, the image input unit 10B is input and the reference image F C taken by the base camera C C, adjacent camera C L, neighboring image F L taken by C R, and F R.
Each video (F L , F C , F R ) input by this video input means 10B is stored in a memory (not shown), and corresponding pixel difference calculation means 20B, neighborhood pixel value output means 30, and neighborhood The depth corresponding pixel value output means 50 shall be referred to.

対応画素差分演算手段20Bは、前記した(2)式によって、対応画素Pが隣接映像Fから外れていないか否かを判定すると共に、前記した(3)式によって、対応画素Pが隣接映像Fから外れていないか否かを判定する。そして、対応画素差分演算手段20Bは、隣接映像F,Fから対応画素P,Pが外れていない場合、すなわち、(2)式および(3)式を両方満たす場合、前記した(1)式によって対応画素差分値ECL,ECRを算出する。 Corresponding pixel difference calculation unit 20B, depending aforementioned (2), with the corresponding pixel P R to determine whether or not deviate from neighboring image F R, according to the above mentioned (3), the corresponding pixel P L is It determines whether or not deviate from neighboring image F L. Then, the corresponding pixel difference calculation unit 20B, the neighboring image F L, the corresponding pixel P L from F R, if not disconnected P R, i.e., if it meets both the (2) and (3), and the ( Corresponding pixel difference values E CL and E CR are calculated by the equation 1).

右隣接映像Fから対応画素Pが外れる場合、すなわち、(2)式を満たさない場合、対応画素差分演算手段20Bは、以下の(28)式によって、対応画素差分ECRを最大視差量(例えば、“255”)として算出する。
CL(d,x,y)=|P(x+d,y)−P(x,y)|
CR(d,x,y)=255 …(28)式
If the right neighboring image F R corresponding pixel P R deviates, i.e., (2) is not satisfied equation corresponding pixel difference calculation unit 20B, the following expression (28) by the maximum amount of parallax corresponding pixel difference E CR (For example, “255”).
E CL (d, x, y) = | P L (x + d, y) −P C (x, y) |
E CR (d, x, y) = 255 (28)

隣接映像Fから対応画素Pが外れる場合、すなわち、(3)式を満たさない場合、対応画素差分演算手段20Bは、以下の(29)式によって、対応画素差分値ECLを最大視差量(例えば、“255”)として算出する。
CL(d,x,y)=255
CR(d,x,y)=|P(x−d,y)−P(x,y)| …(29)式
If the neighboring image F L corresponding pixel P L is disengaged, i.e., (3) is not satisfied equation corresponding pixel difference calculation unit 20B, the following expression (29) by the maximum amount of parallax corresponding pixel difference value E CL (For example, “255”).
E CL (d, x, y) = 255
E CR (d, x, y) = | P R (x−d, y) −P C (x, y) | (29)

[奥行推定装置の動作]
図19を参照して、奥行推定装置1Bの動作として、対応画素差分演算動作(図8のステップS5)を説明する(適宜図18参照)。なお、図19のステップS50〜S52の処理は、図9の各処理と同様のため、説明を省略する。
[Operation of depth estimation device]
With reference to FIG. 19, a corresponding pixel difference calculation operation (step S5 in FIG. 8) will be described as an operation of the depth estimation device 1B (see FIG. 18 as appropriate). Note that the processing in steps S50 to S52 in FIG. 19 is the same as each processing in FIG.

対応画素差分演算手段20Bは、対応画素Pが隣接映像Fから外れている場合(ステップS51でNo)、前記した(29)式によって、対応画素差分値ECLを最大視差量として算出する(ステップS53’)。 Corresponding pixel difference calculation unit 20B, when the corresponding pixel P L is out of the neighboring image F L (No in step S51), the aforementioned (29), calculates a corresponding pixel difference value E CL as the maximum amount of parallax (Step S53 ′).

対応画素差分演算手段20Bは、対応画素Pが隣接映像Fから外れている場合(ステップS50でNo)前記した(28)式によって、対応画素差分値ECRを最大視差量として算出する(ステップS54’)。 Corresponding pixel difference calculation unit 20B, the corresponding pixel P R is the previously described (28) (No in step S50) if deviates from neighboring image F R, and calculates the corresponding pixel difference value E CR as the maximum amount of parallax ( Step S54 ').

以上のように、本発明の第2実施形態に係る奥行推定装置1Bは、3つの映像(F,F,F)から、被写体Tの奥行値Dを推定することができる。従って、奥行推定装置1Bは、第1実施形態と同様、奥行値の誤推定を低減することができる。 As described above, the depth estimation apparatus 1B according to the second embodiment of the present invention can estimate the depth value D of the subject T from the three videos (F L , F C , F R ). Therefore, the depth estimation apparatus 1B can reduce the erroneous estimation of the depth value as in the first embodiment.

本発明の第2実施形態に係る奥行推定装置1Bの構成および動作について説明したが、本発明は、この実施形態に限定されるものではない。以下、本発明の種々の変形例について説明する。   Although the configuration and operation of the depth estimation device 1B according to the second embodiment of the present invention have been described, the present invention is not limited to this embodiment. Hereinafter, various modifications of the present invention will be described.

(変形例1:カメラ配置間隔の変形例)
第2実施形態では、被写体を撮影するカメラの設置間隔を等間隔としたが、異なるカメラ間隔としてもよい。
この場合、対応画素差分演算手段20Bは、それぞれの隣接映像F,Fについて、基準カメラCからのカメラ間隔ごとに、基準映像Fの画素から、視差に対応する画素の位置をそれぞれ求め、当該画素の画素値と、基準映像Fの画素の画素値との差分絶対値を演算すればよい。例えば、本実施形態では、奥行値Dの単位と画素間の視差の単位とを同一とし、奥行値Dが“1”増加することで、1画素ずつ視差が増加することとしたが、この場合、図17に示したカメラC,C間の距離が、カメラC,C間の距離の2倍であったとすると、対応画素差分演算手段20Bは、前記(1)式の代わりに、以下の(30)式により差分絶対値を算出すればよい。
CL(d,x,y)=|P(x+d,y)−P(x,y)|
CR(d,x,y)=|P(x−2d,y)−P(x,y)| …(30)式
これによって、奥行推定システム(図17)のカメラ配置の自由度を高めることができる。
(Modification 1: Modification of camera arrangement interval)
In the second 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 unit 20B, each 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. 17, the distance between C R, camera C C, when assumed to be twice the distance between C L, the corresponding pixel difference calculation unit 20B instead of the (1) The difference absolute value may be calculated by the following equation (30).
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) | (30) Thus, the degree of freedom of camera arrangement of the depth estimation system (FIG. 17). Can be increased.

(変形例2:対応画素差分演算手段の変形例)
また、第2実施形態では、対応画素差分演算手段20Bが、基準映像Fの各画素の画素値と、当該画素の仮定奥行値dの視差に対応する隣接映像F,Fの各画素の画素値との差分絶対値を演算することとしたが、この差分絶対値は、対応する画素のみでなく、対応画素を中心とするブロック内の画素値の差分絶対値の重み付け平均値を用いることとしてもよい。例えば、対応画素差分演算手段20Bは、前記(1)式の対応画素差分値ECL(d,x,y)を、以下の(31)式により算出する。
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
…(31)式
これによって、ノイズ等によって発生する差分絶対値の誤差を低減することができる。
(Modification 2: Modification of the corresponding pixel difference calculation means)
Further, in the second embodiment, the corresponding pixel difference calculation unit 20 </ b> B uses 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 difference absolute value with respect to the pixel value is calculated using the weighted average value of the difference absolute value of the pixel values in the block centered on the corresponding pixel as well as the corresponding pixel. It is good as well. For example, the corresponding pixel difference calculation unit 20B calculates the corresponding pixel difference value E CL (d, x, y) of the equation (1) according to the following equation (31).
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
... (31) Thereby, the difference | error of the absolute difference value generate | occur | produced by noise etc. can be reduced.

(変形例3:差分値選択手段の変形例)
また、各実施形態では、平均差分値演算手段60aが平均差分値Eaを算出し、最小差分値選択手段60bが最小差分値Emを算出することとして説明したが、本発明は、これに限定されない。例えば、本発明では、差分値選択手段60cが、平均差分値Eaおよび最小差分値Emを算出してもよい。
(Modification 3: Modification of difference value selection means)
In each embodiment, the average difference value calculation unit 60a calculates the average difference value Ea and the minimum difference value selection unit 60b calculates the minimum difference value Em. However, the present invention is not limited to this. . For example, in the present invention, the difference value selection unit 60c may calculate the average difference value Ea and the minimum difference value Em.

(変形例4:差分値選択手段の変形例)
また、各実施形態では、差分値選択手段60cが、前記した(17)式および(20)式を用いることとして説明したが、本発明は、これに限定されない。例えば、本発明では、差分値選択手段60cが、予め任意の値に設定した倍率kを用いてもよい。
(Modification 4: Modification of difference value selection means)
In each embodiment, the difference value selection unit 60c has been described as using the above-described equations (17) and (20), but the present invention is not limited to this. For example, in the present invention, the difference value selection means 60c may use a magnification k set to an arbitrary value in advance.

具体的には、差分値選択手段60cは、前記した(17)の右辺に倍率kを掛けてから、差分絶対値ELDRが差分絶対値ERDRを超えたか否かを判定する((32式)参照)。
LDR>k×ERDR …(32)式
Specifically, the difference value selection means 60c determines whether or not the difference absolute value ERDR exceeds the difference absolute value ERDR after multiplying the right side of the above (17) by the magnification k ((Expression 32) )reference).
E LDR > k × E RDR (32) formula

また、差分値選択手段60cは、前記した(20)式の左辺に倍率kを掛けてから、差分絶対値ERDLが差分絶対値ELDLを超えたか否かを判定する((33式)参照)。
LDL×k<ERDL …(33)式
これによって、差分値選択手段60cは、オクルージョンの有無をより正確に判定できる。
The difference value selection means 60c determines whether or not the difference absolute value E RDL exceeds the difference absolute value E LDL after multiplying the left side of the above expression (20) by the magnification k (see (33)). ).
E LDL × k <E RDL (33) Thereby, the difference value selection means 60c can more accurately determine the presence or absence of occlusion.

(変形例5:差分値選択動作の変形例)
また、各実施形態では、差分値選択動作(図12参照)において、差分絶対値ELDR,ERDR,ELDL,ERDLを算出してから(ステップS634)、ステップS635以後の処理を実行することとして説明したが、本発明は、これに限定されない。ここで、差分値選択手段60cが、差分値選択動作において、ステップS633までの処理を実行した場合を考える。
(Modification 5: Modification of Difference Value Selection Operation)
In each embodiment, in the difference value selection operation (see FIG. 12), the difference absolute values E LDR , E RDR , E LDL , and E RDL are calculated (step S634), and then the processing after step S635 is executed. However, the present invention is not limited to this. Here, a case is considered in which the difference value selection unit 60c executes the processing up to step S633 in the difference value selection operation.

この場合、差分値選択手段60cは、ステップS635の処理と同様、前記した(15)式によって、奥行値Dが奥行値D以上であるか否かを判定する。(15)式が成立する場合、差分値選択手段60cは、前記した(16)式によって、近傍奥行対応画素PLDR,PRDRの画素値と、注目画素Pの画素値の差分絶対値ELDR,ERDRを算出する。そして、差分値選択手段60cは、ステップS636以後の処理を実行する。 In this case, the difference value selecting unit 60c, similar to the processing in step S635, according to the above mentioned (15), determines whether a depth value D L is greater than or equal to the depth value D R. If (15) is established, the difference value selecting unit 60c is the aforementioned (16), near the depth corresponding pixel P LDR, a pixel value of P RDR, differential absolute value E of the pixel value of the pixel of interest P C LDR and ERDR are calculated. Then, the difference value selection unit 60c executes the processing after step S636.

一方、(15)式が成立しない場合、差分値選択手段60cは、前記した(19)式によって、近傍奥行対応画素PLDL,PRDLの画素値と、注目画素Pの画素値の差分絶対値ELDL,ERDLを算出する。 On the other hand, if (15) is not satisfied, the difference value selecting unit 60c is the aforementioned (19), near the depth corresponding pixel P LDL, and the pixel values of P RDL, the difference between the pixel value of the pixel of interest P C Absolute The values E LDL and E RDL are calculated.

このように、差分値選択手段60cは、奥行値D,Dの大小判定を行ってから、その判定結果に応じて、差分絶対値ELDR,ERDRまたは差分絶対値ELDL,ERDLを算出してもよい。 Thus, the difference value selecting unit 60c is the depth value D L, after performing a size determination of D R, according to the determination result, the difference absolute value E LDR, E RDR or absolute difference E LDL, E RDL May be calculated.

なお、各実施形態では、本発明に係る奥行推定装置を独立した装置として説明したが、これに限定されない。例えば、本発明では、一般的なコンピュータのハードウェア資源を、奥行推定装置の各手段として協調動作させる奥行推定プログラムによって実現することができる。また、この奥行推定プログラムは、通信回線を介して配布したり、CD−ROM等の記録媒体に記録して配布したりすることも可能である。   In each embodiment, the depth estimation apparatus according to the present invention has been described as an independent apparatus, but the present invention is not limited to this. For example, in the present invention, a general computer hardware resource can be realized by a depth estimation program that performs a cooperative operation as each unit of the depth estimation device. 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,1B 奥行推定装置
10,10B 映像入力手段
20,20B 対応画素差分演算手段
30 近傍画素値出力手段
40 近傍奥行値出力手段
50 近傍奥行対応画素値出力手段
60 差分値決定手段
60a 平均差分値演算手段
60b 最小差分値選択手段
60c 差分値選択手段
70 記憶手段
80 平滑化手段
90 奥行値決定手段
1, 1B Depth estimation device 10, 10B Video input means 20, 20B Corresponding pixel difference calculation means 30 Neighborhood pixel value output means 40 Neighborhood depth value output means 50 Neighborhood depth corresponding pixel value output means 60 Difference value determination means 60a Average difference value calculation Means 60b Minimum difference value selection means 60c Difference value selection means 70 Storage means 80 Smoothing means 90 Depth value determination means

Claims (9)

予め定めた位置に複数配列したカメラで同一の被写体を撮影した複数のカメラ映像から、前記被写体の奥行きを示す奥行値を推定する奥行推定装置であって、
前記複数配列した前記カメラの何れかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラ以外の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する映像入力手段と、
前記奥行値を仮定した仮定奥行値および前記基準映像の注目画素ごとに、前記注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する対応画素差分演算手段と、
前記映像入力手段に入力された基準映像において、前記基準映像の注目画素の画素値と、予め定めた近傍画素数だけ前記注目画素から左右に離れた画素位置にある近傍画素の画素値とを出力する近傍画素値出力手段と、
前記仮定奥行値および前記注目画素ごとに、前記基準映像に対して左右の隣接映像から、前記近傍画素の奥行値の視差に対応する画素位置にある近傍奥行対応画素の画素値を出力する近傍奥行対応画素値出力手段と、
前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と前記近傍画素の画素値と前記近傍画素の奥行値と前記近傍奥行対応画素の画素値とに基づいて、前記最小差分値または前記平均差分値の何れかを、予め定めた条件により選択差分値として決定する差分値決定手段と、
前記差分値決定手段で決定した選択差分値を前記仮定奥行値と前記基準映像の画素位置とに対応付けて記憶する記憶手段と、
前記注目画素ごとに、当該注目画素の選択差分値に、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の選択差分値が最小となる仮定奥行値との差分を重み付け加算することで、前記選択差分値を平滑化した平滑化差分値を演算すると共に、前記平滑化差分値の総和である平滑化評価値を演算する平滑化手段と、
前記記憶手段に記憶された選択差分値に対応する仮定奥行値を当該仮定奥行値と異なる奥行値が仮定された第2仮定奥行値に代えることで前記平滑化評価値に相当する再計算評価値を演算し、当該再計算評価値が前記平滑化手段によって演算された平滑化評価値未満の場合、前記第2仮定奥行値を前記基準映像の各画素の奥行値として決定し、当該再計算評価値が前記平滑化評価値未満でない場合、前記記憶手段に記憶された選択差分値に対応する仮定奥行値を前記基準映像の各画素の奥行値として決定する奥行値決定手段と、
前記奥行値決定手段から基準映像の各画素の奥行値が入力されると共に、前記近傍画素の奥行値を前記近傍奥行対応画素値出力手段および前記差分値決定手段に出力する近傍奥行値出力手段と、
を備えることを特徴とする奥行推定装置。
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,
Video input means for inputting 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 an adjacent camera other than the reference camera in any one of the plurality of cameras arranged in the plurality. When,
For each of the assumed depth value assuming the depth value and the target pixel of the reference image, the pixel value of the target pixel 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;
In the reference video input to the video input means, the pixel value of the target pixel of the reference video and the pixel value of the neighboring pixel at the pixel position separated from the target pixel to the left and right by the predetermined number of neighboring pixels are output. Neighboring pixel value output means for
For each of the assumed depth value and the target pixel, a neighboring depth that outputs a pixel value of a neighboring depth-corresponding pixel at a pixel position corresponding to a parallax of the neighboring pixel depth value from the adjacent images on the left and right with respect to the reference image. Corresponding pixel value output means;
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 a pixel value of a neighboring pixel, a depth value of the neighboring pixel, and a pixel value of the neighboring depth corresponding pixel, either the minimum difference value or the average difference value is determined as a selection difference value according to a predetermined condition. Difference value determining means to perform,
Storage means for storing the selection difference value determined by the difference value determination means in association with the assumed depth value and the pixel position of the reference image;
For each target pixel, the selection difference value of the target pixel includes an assumed depth value at which the selection difference value of a pixel adjacent to the target pixel is minimum and an assumed depth value at which the selection difference value of the target pixel is minimum. Smoothing means for calculating a smoothed evaluation value that is a sum of the smoothed difference values, while calculating a smoothed difference value obtained by smoothing the selected difference value by weighted addition of the differences;
A recalculated evaluation value corresponding to the smoothed evaluation value by replacing the assumed depth value corresponding to the selected difference value stored in the storage means with a second assumed depth value assuming a depth value different from the assumed depth value. When the recalculated evaluation value is less than the smoothed evaluation value calculated by the smoothing means, the second assumed depth value is determined as the depth value of each pixel of the reference image, and the recalculated evaluation If the value is not less than the smoothing evaluation value, a depth value determination unit that determines an assumed depth value corresponding to the selection difference value stored in the storage unit as a depth value of each pixel of the reference image;
A depth value of each pixel of the reference image is input from the depth value determining means, and a depth value output means for outputting the depth value of the neighboring pixels to the neighboring depth corresponding pixel value output means and the difference value determining means; ,
A depth estimation apparatus comprising:
前記差分値決定手段は、前記近傍画素同士の奥行値の差分絶対値が予め定めた第1の閾値以下の場合、または、前記近傍画素同士の画素値の差分絶対値が予め定めた第2の閾値以下の場合、前記平均差分値を前記選択差分値として決定することを特徴とする請求項1に記載の奥行推定装置。   The difference value determining means is configured such that the absolute difference value of the depth value between the neighboring pixels is equal to or smaller than a predetermined first threshold value, or the second absolute difference value of the pixel value between the neighboring pixels is predetermined. The depth estimation apparatus according to claim 1, wherein the average difference value is determined as the selection difference value when the threshold value is equal to or less than a threshold value. 前記差分値決定手段は、前記近傍画素同士の奥行値の差分絶対値が予め定めた第1の閾値を超え、かつ、前記近傍画素同士の画素値の差分絶対値が予め定めた第2の閾値を越える場合、前記基準映像に対する左右の隣接映像のそれぞれから、前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値を演算すると共に、
左右の前記近傍画素のうち小さい方の奥行値を有する側の前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値が、当該小さい方と反対側の前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値より小さい場合、前記最小差分値を前記選択差分値として決定することを特徴とする請求項1に記載の奥行推定装置。
The difference value determining means includes a second threshold value in which a difference absolute value of a depth value between the neighboring pixels exceeds a predetermined first threshold value, and a difference absolute value of a pixel value between the neighboring pixels is set in advance. When calculating the absolute value of the difference between the pixel value of the neighboring depth corresponding pixel and the pixel value of the target pixel, from each of the left and right adjacent video with respect to the reference video,
The difference absolute value between the pixel value of the neighboring depth corresponding pixel on the side having the smaller depth value of the left and right neighboring pixels and the pixel value of the target pixel is the neighboring depth corresponding pixel on the opposite side to the smaller one The depth estimation apparatus according to claim 1, wherein the minimum difference value is determined as the selection difference value when the difference is smaller than the absolute difference between the pixel value of the pixel of interest and the pixel value of the target pixel.
前記差分値決定手段は、前記近傍画素同士の奥行値の差分絶対値が予め定めた第1の閾値を超え、かつ、前記近傍画素同士の画素値の差分絶対値が予め定めた第2の閾値を越える場合、前記基準映像に対する左右の隣接映像のそれぞれから、前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値を演算すると共に、
左右の前記近傍画素のうち小さい方の奥行値を有する側の前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値が、当該小さい方と反対側の前記近傍奥行対応画素の画素値と前記注目画素の画素値との差分絶対値より小さくない場合、前記平均差分値を前記選択差分値として決定することを特徴とする請求項1に記載の奥行推定装置。
The difference value determining means includes a second threshold value in which a difference absolute value of a depth value between the neighboring pixels exceeds a predetermined first threshold value, and a difference absolute value of a pixel value between the neighboring pixels is set in advance. When calculating the absolute value of the difference between the pixel value of the neighboring depth corresponding pixel and the pixel value of the target pixel, from each of the left and right adjacent video with respect to the reference video,
The difference absolute value between the pixel value of the neighboring depth corresponding pixel on the side having the smaller depth value of the left and right neighboring pixels and the pixel value of the target pixel is the neighboring depth corresponding pixel on the opposite side to the smaller one The depth estimation device according to claim 1, wherein the average difference value is determined as the selection difference value when the difference value is not smaller than the absolute difference value between the pixel value of the target pixel and the pixel value of the target pixel.
前記差分値決定手段は、前記奥行値の推定回数が1回目の場合、前記平均差分値を前記選択差分値として決定し、
前記奥行値の推定回数が2回目以降の場合、前記予め定めた条件により前記選択差分値を決定することを特徴とする請求項1に記載の奥行推定装置。
The difference value determining means determines the average difference value as the selected difference value when the depth count is estimated for the first time,
The depth estimation apparatus according to claim 1, wherein when the depth value is estimated for the second time or later, the selection difference value is determined according to the predetermined condition.
前記対応画素差分演算手段は、前記基準映像の左右に位置する隣接映像から前記対応画素が外れる場合、前記基準映像に対して、前記対応画素が外れる側の隣接画像に反対側の隣接映像と、当該反対側の隣接映像にさらに隣接する隣接映像とにおいて、前記対応画素の画素値の差分絶対値を前記対応画素差分値として演算することを特徴とする請求項1から請求項5の何れか一項に記載の奥行推定装置。   The corresponding pixel difference calculation means, when the corresponding pixel is deviated from the adjacent video located on the left and right of the reference video, with respect to the reference video, the adjacent video on the opposite side to the adjacent image on the side where the corresponding pixel is removed, and The difference absolute value of the pixel value of the corresponding pixel is calculated as the corresponding pixel difference value in an adjacent video further adjacent to the adjacent video on the opposite side. The depth estimation apparatus according to the item. 前記近傍奥行値出力手段は、前記近傍画素同士の奥行値の差分絶対値が予め定めた閾値以下の場合、前記近傍画素数を半分とし、前記注目画素から当該近傍画素数だけ左右に離れた画素位置の近傍画素の奥行値を出力することを特徴とする請求項1から請求項6の何れか一項に記載の奥行推定装置。   The neighboring depth value output means divides the number of neighboring pixels by half when the difference absolute value of the depth value between neighboring pixels is equal to or smaller than a predetermined threshold, and is a pixel that is separated from the target pixel by the number of neighboring pixels to the left and right The depth estimation apparatus according to any one of claims 1 to 6, wherein a depth value of a pixel in the vicinity of the position is output. 予め定めた位置に複数配列したカメラで同一の被写体を撮影した複数のカメラ映像から、前記被写体の奥行きを示す奥行値を推定する奥行推定方法であって、
映像入力手段が、前記複数配列した前記カメラの何れかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラ以外の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する映像入力ステップと、
対応画素差分演算手段が、前記奥行値を仮定した仮定奥行値および前記基準映像の注目画素ごとに、前記注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する対応画素差分演算ステップと、
差分値決定手段が、前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と、予め定めた近傍画素数だけ前記注目画素から左右に離れた画素位置にある近傍画素の画素値と前記近傍画素の奥行値と、前記近傍画素の奥行値の視差に対応する画素位置にある近傍奥行対応画素の画素値とに基づいて、前記最小差分値または前記平均差分値の何れかを、予め定めた条件により選択差分値として決定して、当該選択差分値を前記仮定奥行値と前記基準映像の画素位置とに対応付けて記憶手段に書き込む差分値決定ステップと、
平滑化手段が、前記注目画素ごとに、当該注目画素の選択差分値に、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の選択差分値が最小となる仮定奥行値との差分を重み付け加算することで、前記選択差分値を平滑化した平滑化差分値を演算すると共に、前記平滑化差分値の総和である平滑化評価値を演算する平滑化ステップと、
奥行値決定手段が、前記記憶手段に記憶された選択差分値に対応する仮定奥行値を当該仮定奥行値と異なる奥行値が仮定された第2仮定奥行値に代えることで前記平滑化評価値に相当する再計算評価値を演算し、当該再計算評価値が前記平滑化手段によって演算された平滑化評価値未満の場合、前記第2仮定奥行値を前記基準映像の各画素の奥行値として決定し、当該再計算評価値が前記平滑化評価値未満でない場合、前記記憶手段に記憶された選択差分値に対応する仮定奥行値を前記基準映像の各画素の奥行値として決定する奥行値決定ステップと、を備え、
前記差分値決定ステップは、
近傍奥行値出力手段が、前記近傍画素の奥行値を出力する近傍奥行値出力ステップと、
近傍画素値出力手段が、前記基準映像において、前記基準映像の注目画素の画素値と、前記近傍画素の画素値とを出力する近傍画素値出力ステップと、
近傍奥行対応画素値出力手段が、前記仮定奥行値および前記注目画素ごとに、前記基準映像に対して左右の隣接映像から、前記近傍奥行対応画素の画素値を出力する近傍奥行対応画素値出力ステップと、
を備えることを特徴とする奥行推定方法。
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,
Video input means, in any one of the plurality of cameras arranged, a reference video obtained by photographing the subject with a predetermined reference camera and a plurality of adjacent videos obtained by photographing the subject with an adjacent camera other than the reference camera. Video input step to input,
Corresponding pixel difference calculation means, for each hypothetical depth value assuming the depth value and the target pixel of the reference image, at the pixel position corresponding to the pixel value of the target pixel and the parallax of the assumed depth value of the target pixel A corresponding pixel difference calculation step of calculating a corresponding pixel difference value that is a difference absolute value with a pixel value of a corresponding pixel of the plurality of adjacent videos
The difference value determining means obtains 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 for each of the assumed depth value and the target pixel, and the pixel value of the pixel, the pixel values of the neighboring pixels neighboring pixel number only to the pixel position away to the left and right from the pixel of interest a predetermined, and depth values of the neighboring pixels corresponding to the disparity of depth values of the neighboring pixels Based on the pixel value of the neighboring depth corresponding pixel at the pixel position to be determined, either the minimum difference value or the average difference value is determined as a selection difference value by a predetermined condition, the selection difference value A difference value determining step for writing to the storage means in association with the assumed depth value and the pixel position of the reference image;
For each target pixel, the smoothing unit minimizes the selection depth value of the target pixel, the assumed depth value at which the selection difference value of the pixel adjacent to the target pixel is minimum, and the selection difference value of the target pixel. A smoothing step of calculating a smoothed difference value obtained by smoothing the selected difference value by calculating a smoothed evaluation value that is a sum of the smoothed difference values by weighting and adding a difference with the assumed depth value. ,
The depth value determining means replaces the assumed depth value corresponding to the selected difference value stored in the storage means with a second assumed depth value in which a depth value different from the assumed depth value is assumed, thereby obtaining the smoothed evaluation value. The corresponding recalculated evaluation value is calculated, and when the recalculated evaluation value is less than the smoothed evaluation value calculated by the smoothing means, the second assumed depth value is determined as the depth value of each pixel of the reference video If the recalculated evaluation value is not less than the smoothed evaluation value, a depth value determination step of determining an assumed depth value corresponding to the selection difference value stored in the storage means as a depth value of each pixel of the reference image. And comprising
The difference value determining step includes:
A neighborhood depth value output means for outputting a depth value of the neighborhood pixel;
Neighboring pixel value output means, in the reference image, the pixel value of the target pixel of the reference image, and the neighboring pixel value output step of outputting the pixel values of the neighboring pixels,
Near depth corresponding pixel value output means, wherein each hypothetical depth value and the pixel of interest, from the left and right neighboring image with respect to the reference image, before KiKon near depth near depth corresponding pixel value output pixel value of the corresponding pixel An output step;
A depth estimation method comprising:
予め定めた位置に複数配列したカメラで同一の被写体を撮影した複数のカメラ映像から、前記被写体の奥行きを示す奥行値を推定するために、コンピュータを、
前記複数配列した前記カメラの何れかにおいて、予め定めた基準カメラで前記被写体を撮影した基準映像と、前記基準カメラ以外の隣接カメラで前記被写体を撮影した複数の隣接映像とを入力する映像入力手段、
前記奥行値を仮定した仮定奥行値および前記基準映像の注目画素ごとに、前記注目画素の画素値と、当該注目画素の前記仮定奥行値の視差に対応する画素位置にある前記複数の隣接映像の対応画素の画素値との差分絶対値である対応画素差分値を演算する対応画素差分演算手段、
前記映像入力手段に入力された基準映像において、前記基準映像の注目画素の画素値と、予め定めた近傍画素数だけ前記注目画素から左右に離れた画素位置にある近傍画素の画素値とを出力する近傍画素値出力手段、
前記仮定奥行値および前記注目画素ごとに、前記基準映像に対して左右の隣接映像から、前記近傍画素の奥行値の視差に対応する画素位置にある近傍奥行対応画素の画素値を出力する近傍奥行対応画素値出力手段、
前記仮定奥行値および前記注目画素ごとに、前記対応画素差分値の平均値である平均差分値と、前記対応画素差分値の最小値である最小差分値を求め、前記注目画素の画素値と前記近傍画素の画素値と前記近傍画素の奥行値と前記近傍奥行対応画素の画素値とに基づいて、前記最小差分値または前記平均差分値の何れかを、予め定めた条件により選択差分値として決定して、当該選択差分値を前記仮定奥行値と前記基準映像の画素位置とに対応付けて記憶手段に書き込む差分値決定手段、
前記注目画素ごとに、当該注目画素の選択差分値に、当該注目画素に隣接する画素の選択差分値が最小となる仮定奥行値と前記注目画素の選択差分値が最小となる仮定奥行値との差分を重み付け加算することで、前記選択差分値を平滑化した平滑化差分値を演算すると共に、前記平滑化差分値の総和である平滑化評価値を演算する平滑化手段、
前記記憶手段に記憶された選択差分値に対応する仮定奥行値を当該仮定奥行値と異なる奥行値が仮定された第2仮定奥行値に代えることで前記平滑化評価値に相当する再計算評価値を演算し、当該再計算評価値が前記平滑化手段によって演算された平滑化評価値未満の場合、前記第2仮定奥行値を前記基準映像の各画素の奥行値として決定し、当該再計算評価値が前記平滑化評価値未満でない場合、前記記憶手段に記憶された選択差分値に対応する仮定奥行値を前記基準映像の各画素の奥行値として決定する奥行値決定手段、
前記奥行値決定手段から基準映像の各画素の奥行値が入力されると共に、前記近傍画素の奥行値を前記近傍奥行対応画素値出力手段および前記差分値決定手段に出力する近傍奥行値出力手段、
として機能させるための奥行推定プログラム。
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.
Video input means for inputting 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 an adjacent camera other than the reference camera in any one of the plurality of cameras arranged in the plurality. ,
For each of the assumed depth value assuming the depth value and the target pixel of the reference image, the pixel value of the target pixel 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;
In the reference video input to the video input means, the pixel value of the target pixel of the reference video and the pixel value of the neighboring pixel at the pixel position separated from the target pixel to the left and right by the predetermined number of neighboring pixels are output. Neighboring pixel value output means for
For each of the assumed depth value and the target pixel, a neighboring depth that outputs a pixel value of a neighboring depth-corresponding pixel at a pixel position corresponding to a parallax of the neighboring pixel depth value from the adjacent images on the left and right with respect to the reference image. Corresponding pixel value output means,
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 a pixel value of a neighboring pixel, a depth value of the neighboring pixel, and a pixel value of the neighboring depth corresponding pixel, either the minimum difference value or the average difference value is determined as a selection difference value according to a predetermined condition. Then, a difference value determination unit that writes the selected difference value in the storage unit in association with the assumed depth value and the pixel position of the reference video,
For each target pixel, the selection difference value of the target pixel includes an assumed depth value at which the selection difference value of a pixel adjacent to the target pixel is minimum and an assumed depth value at which the selection difference value of the target pixel is minimum. Smoothing means for calculating a smoothed evaluation value which is a sum of the smoothed difference values, while calculating a smoothed difference value obtained by smoothing the selected difference value by weighted addition of the differences;
A recalculated evaluation value corresponding to the smoothed evaluation value by replacing the assumed depth value corresponding to the selected difference value stored in the storage means with a second assumed depth value assuming a depth value different from the assumed depth value. When the recalculated evaluation value is less than the smoothed evaluation value calculated by the smoothing means, the second assumed depth value is determined as the depth value of each pixel of the reference image, and the recalculated evaluation If the value is not less than the smoothing evaluation value, a depth value determination unit that determines an assumed depth value corresponding to the selection difference value stored in the storage unit as a depth value of each pixel of the reference image;
A depth value of 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 neighboring depth corresponding pixel value output means and the difference value determination means,
Depth estimation program to function as
JP2010218092A 2010-09-29 2010-09-29 Depth estimation apparatus, depth estimation method, and depth estimation program Expired - Fee Related JP5565839B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010218092A JP5565839B2 (en) 2010-09-29 2010-09-29 Depth estimation apparatus, depth estimation method, and depth estimation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010218092A JP5565839B2 (en) 2010-09-29 2010-09-29 Depth estimation apparatus, depth estimation method, and depth estimation program

Publications (2)

Publication Number Publication Date
JP2012073813A JP2012073813A (en) 2012-04-12
JP5565839B2 true JP5565839B2 (en) 2014-08-06

Family

ID=46169915

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010218092A Expired - Fee Related JP5565839B2 (en) 2010-09-29 2010-09-29 Depth estimation apparatus, depth estimation method, and depth estimation program

Country Status (1)

Country Link
JP (1) JP5565839B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016145753A (en) * 2015-02-09 2016-08-12 国立研究開発法人情報通信研究機構 Depth estimation device, depth estimation method, and depth estimation program
JP6646675B2 (en) 2015-09-07 2020-02-14 オリンパス株式会社 Image processing apparatus and image processing method
JP6898776B2 (en) * 2017-05-23 2021-07-07 公益財団法人かずさDna研究所 3D measuring device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2961272B1 (en) * 1998-09-09 1999-10-12 防衛庁技術研究本部長 Object recognition apparatus and method using feature vector
JP2003150940A (en) * 2001-11-16 2003-05-23 Komatsu Ltd Stereo image processor

Also Published As

Publication number Publication date
JP2012073813A (en) 2012-04-12

Similar Documents

Publication Publication Date Title
US9530192B2 (en) Method for determining stereo quality score and automatically improving the quality of stereo images
US8897545B2 (en) Apparatus and method for determining a confidence value of a disparity estimate
CN111066065A (en) System and method for hybrid depth regularization
US6856314B2 (en) Method and system for 3D reconstruction of multiple views with altering search path and occlusion modeling
US9300947B2 (en) Producing 3D images from captured 2D video
US8452081B2 (en) Forming 3D models using multiple images
US20140049612A1 (en) Image processing device, imaging device, and image processing method
US20120257016A1 (en) Three-dimensional modeling apparatus, three-dimensional modeling method and computer-readable recording medium storing three-dimensional modeling program
US20120177283A1 (en) Forming 3d models using two images
KR20100119559A (en) Method and system for converting 2d image data to stereoscopic image data
US9449389B2 (en) Image processing device, image processing method, and program
JP6173218B2 (en) Multi-view rendering apparatus and method using background pixel expansion and background-first patch matching
US20150206307A1 (en) Visual Perception Matching Cost On Binocular Stereo Images
JP5476264B2 (en) Camera tracking device and program thereof
JP2011141710A (en) Device, method and program for estimating depth
JP5565839B2 (en) Depth estimation apparatus, depth estimation method, and depth estimation program
JP2007053621A (en) Image generating apparatus
US8340399B2 (en) Method for determining a depth map from images, device for determining a depth map
CN117456114B (en) Multi-view-based three-dimensional image reconstruction method and system
JP2005250994A (en) Stereo image processor
JP5252642B2 (en) Depth estimation apparatus, depth estimation method, and depth estimation program
KR101435611B1 (en) Occlusion removal method for three dimensional integral image
EP4013049A1 (en) Apparatus and method for processing a depth map
JP2012173858A (en) Omnidirectional image generation method, image generation device and program
EP1082702B1 (en) Method of detecting displacement of a block of pixels from a first to a second image of a scene

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130808

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140220

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140304

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140325

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140603

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140611

R150 Certificate of patent or registration of utility model

Ref document number: 5565839

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees