JP6459482B2 - Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program - Google Patents

Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program Download PDF

Info

Publication number
JP6459482B2
JP6459482B2 JP2014256658A JP2014256658A JP6459482B2 JP 6459482 B2 JP6459482 B2 JP 6459482B2 JP 2014256658 A JP2014256658 A JP 2014256658A JP 2014256658 A JP2014256658 A JP 2014256658A JP 6459482 B2 JP6459482 B2 JP 6459482B2
Authority
JP
Japan
Prior art keywords
value
parallax value
image
parallax
pixel
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
JP2014256658A
Other languages
Japanese (ja)
Other versions
JP2016118830A (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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2014256658A priority Critical patent/JP6459482B2/en
Publication of JP2016118830A publication Critical patent/JP2016118830A/en
Application granted granted Critical
Publication of JP6459482B2 publication Critical patent/JP6459482B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Measurement Of Optical Distance (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Description

本発明は、視差値導出装置、機器制御システム、移動体、ロボット、視差値導出方法、およびプログラムに関する。   The present invention relates to a parallax value derivation device, a device control system, a moving body, a robot, a parallax value derivation method, and a program.

近年、自動車間の距離、または自動車と障害物との間の距離を測定することにより自動車の衝突防止を図る車載システムが一般的に利用されてきている。そのような距離を測定する方法として、2つのカメラを有するステレオカメラを用い、三角測量の原理を用いたステレオマッチング処理による方法がある。   In recent years, in-vehicle systems that prevent collision of automobiles by measuring the distance between automobiles or the distance between automobiles and obstacles have been generally used. As a method of measuring such a distance, there is a method using a stereo matching process using a triangulation principle using a stereo camera having two cameras.

ステレオマッチング処理とは、一方のカメラで撮像された基準画像と、他方のカメラで撮像された比較画像との間で対応する画素をマッチングすることにより視差を求め、視差からステレオカメラと、画像に含まれる物体との距離を算出する処理である。このようなステレオカメラを用いたステレオマッチング処理による物体との距離の算出により、各種認識処理、ならびに衝突防止のためのブレーキ制御および操舵制御が可能となる。   Stereo matching processing is to obtain the parallax by matching the corresponding pixels between the reference image captured by one camera and the comparison image captured by the other camera. This is a process of calculating the distance to the contained object. By calculating the distance to the object by the stereo matching process using such a stereo camera, various recognition processes and brake control and steering control for collision prevention can be performed.

上述のようなステレオマッチング処理として、画像間の類似性を評価するために、比較する画像から領域を切り出し、その領域に対する輝度差の総和(SAD:Sum of Absolute Difference)、輝度差の2乗和(SSD:Sum of Squared Difference)、および正規化相互相関(ZNCC:Zero−mean Normalized Cross−Correlation)等を求めるブロックマッチング法がある。このようなブロックマッチング法によるステレオマッチング処理を利用した技術として、1つのペアのステレオカメラだけで、広い視野角と視野内の特定領域では高い測距精度を両立するという技術が提案されている(特許文献1)。   In the stereo matching process as described above, in order to evaluate the similarity between images, a region is cut out from the images to be compared, and the sum of luminance differences (SAD: Sum of Absolute Difference) and the square sum of the luminance differences are compared. There are block matching methods for obtaining (SSD: Sum of Squared Difference), normalized cross-correlation (ZNCC), and the like. As a technique using stereo matching processing by such a block matching method, a technique has been proposed in which only one pair of stereo cameras achieves both a wide viewing angle and high ranging accuracy in a specific region within the field of view ( Patent Document 1).

しかし、特許文献1に記載された技術は、基準画像の基準領域と、比較画像の候補領域とのマッチング処理で、基準領域と候補領域とのシフト量の大きさに関わらず、同じ大きさのブロック(領域)でマッチング処理を行うものである。したがって、基準画像(または比較画像)において、近い被写体および遠い被写体に対しても、同じブロックによるマッチング処理を行うので、視差値の精度が低下する可能性がある。   However, the technique described in Patent Document 1 is a matching process between the reference region of the reference image and the candidate region of the comparison image, and the same size regardless of the amount of shift between the reference region and the candidate region. Matching processing is performed in blocks (areas). Therefore, in the reference image (or comparative image), the matching process is performed on the close subject and the distant subject using the same block, so that the accuracy of the parallax value may be reduced.

本発明は、上記に鑑みてなされたものであって、近い被写体および遠い被写体のいずれでもあっても精度の高い視差値を導出することができる視差値導出装置、機器制御システム、移動体、ロボット、視差値導出方法、およびプログラムを提供することを目的とする。   The present invention has been made in view of the above, and can provide a parallax value deriving device, a device control system, a moving body, and a robot that can derive a parallax value with high accuracy regardless of whether the subject is a near subject or a far subject. An object is to provide a parallax value derivation method and a program.

上述した課題を解決し、目的を達成するために、本発明は、第1撮像手段が被写体を撮像することにより得られた基準画像、および前記第1撮像手段の位置とは異なる位置の第2撮像手段が前記被写体を撮像することにより得られた比較画像に基づいて、前記被写体に対する視差を示す視差値を導出する視差値導出装置であって、前記基準画像の第1基準領域と、前記比較画像における前記第1基準領域に相当する領域から所定のシフト量でシフトすることにより特定される、前記第1基準領域に対応する前記比較画像での対応領域の候補となる複数の候補領域と、に対して前記シフト量に応じたサイズのローパスフィルタによるフィルタ処理を行うフィルタリング手段と、前記フィルタリング手段により前記フィルタ処理が行われた前記第1基準領域と、該フィルタ処理が行われた前記複数の候補領域それぞれとの一致度を算出する算出手段と、前記一致度に基づいて、前記第1基準領域と前記対応領域との前記視差値を導出する導出手段と、を備えたことを特徴とする。   In order to solve the above-described problems and achieve the object, the present invention provides a reference image obtained by the first image pickup unit picking up an image of a subject, and a second position different from the position of the first image pickup unit. A parallax value deriving device that derives a parallax value indicating parallax with respect to the subject based on a comparison image obtained by imaging the subject by the imaging unit, the first reference region of the reference image, and the comparison A plurality of candidate areas that are identified by shifting by a predetermined shift amount from an area corresponding to the first reference area in the image and that are candidates for the corresponding area in the comparison image corresponding to the first reference area; Filtering means for performing a filtering process with a low-pass filter having a size corresponding to the shift amount, and the filtering process performed by the filtering means. The calculation means for calculating the degree of coincidence between the reference area and each of the plurality of candidate areas subjected to the filter processing, and the parallax value between the first reference area and the corresponding area based on the degree of coincidence. And a derivation means for deriving.

本発明によれば、近い被写体および遠い被写体のいずれでもあっても精度の高い視差値を導出することができる。   According to the present invention, it is possible to derive a highly accurate parallax value regardless of whether the subject is a near subject or a far subject.

図1は、撮像装置から物体までの距離を導き出す原理を説明する図である。FIG. 1 is a diagram for explaining the principle of deriving the distance from an imaging device to an object. 図2は、基準画像、高密度視差画像およびエッジ視差画像を示す概念図である。FIG. 2 is a conceptual diagram illustrating a reference image, a high-density parallax image, and an edge parallax image. 図3は、基準画像における基準画素に対応する比較画像における対応画素を求める場合の説明図である。FIG. 3 is an explanatory diagram for obtaining a corresponding pixel in a comparison image corresponding to a reference pixel in the reference image. 図4は、シフト量とコスト値との関係の一例を示すグラフである。FIG. 4 is a graph showing an example of the relationship between the shift amount and the cost value. 図5は、合成コストを導出するための概念図である。FIG. 5 is a conceptual diagram for deriving the synthesis cost. 図6は、シフト量と合成コスト値との関係の一例を示すグラフである。FIG. 6 is a graph showing an example of the relationship between the shift amount and the synthesis cost value. 図7は、本実施の形態に係る機器制御システムを車両に搭載した例を示す図である。FIG. 7 is a diagram illustrating an example in which the device control system according to the present embodiment is mounted on a vehicle. 図8は、本実施の形態に係る視差値導出装置の外観の一例を示す図である。FIG. 8 is a diagram illustrating an example of the appearance of the parallax value deriving device according to the present embodiment. 図9は、本実施の形態に係る視差値導出装置のハードウェア構成の一例を示す図である。FIG. 9 is a diagram illustrating an example of a hardware configuration of the disparity value deriving device according to the present embodiment. 図10は、本実施の形態に係る視差値導出装置のブロック構成の一例を示す図である。FIG. 10 is a diagram illustrating an example of a block configuration of the disparity value deriving device according to the present embodiment. 図11は、基準画像の基準画素に対応する比較画像の対応画素を求める場合にローパスフィルタを切り替える動作を説明する図である。FIG. 11 is a diagram for explaining the operation of switching the low-pass filter when obtaining the corresponding pixel of the comparison image corresponding to the reference pixel of the reference image. 図12は、本実施の形態におけるシフト量と合成コスト値との関係の一例を示すグラフである。FIG. 12 is a graph showing an example of the relationship between the shift amount and the combined cost value in the present embodiment. 図13は、パラボラフィッティングによるサブピクセル推定を説明する図である。FIG. 13 is a diagram for explaining subpixel estimation by parabolic fitting. 図14は、最小二乗法によるサブピクセル推定を説明する図である。FIG. 14 is a diagram for explaining subpixel estimation by the method of least squares. 図15は、本実施の形態のステレオマッチング処理によって求められる高密度視差画像の一例を示す概念図である。FIG. 15 is a conceptual diagram illustrating an example of a high-density parallax image obtained by the stereo matching process of the present embodiment. 図16は、本実施の形態に係る視差値導出装置のステレオマッチング処理の動作の一例を示すフローチャートである。FIG. 16 is a flowchart illustrating an example of the stereo matching processing operation of the disparity value deriving device according to the present embodiment.

[SGM法を用いた測距方法の概略]
まず、図1〜6を用いて、SGM(Semi−Global Matching)法を用いた測距方法の概略について説明する。
[Outline of Ranging Method Using SGM Method]
First, an outline of a distance measuring method using an SGM (Semi-Global Matching) method will be described with reference to FIGS.

(測距の原理)
図1は、撮像装置から物体までの距離を導き出す原理を説明する図である。図1を参照しながら、ステレオマッチング処理により、ステレオカメラから物体に対する視差を導出し、この視差を示す視差値によって、ステレオカメラから物体までの距離を測定する原理について説明する。なお、以下では、説明を簡略化するため、複数の画素からなる所定領域のマッチングではなく、画素単位のマッチングの例について説明する。
(Principles of ranging)
FIG. 1 is a diagram for explaining the principle of deriving the distance from an imaging device to an object. With reference to FIG. 1, the principle of deriving a parallax with respect to an object from the stereo camera by stereo matching processing and measuring the distance from the stereo camera to the object with the parallax value indicating the parallax will be described. In the following, in order to simplify the description, an example of matching in units of pixels will be described instead of matching a predetermined region composed of a plurality of pixels.

図1に示す撮像システムは、平行等位に配置された撮像装置510aと撮像装置510bとを有するものとする。撮像装置510a、510bは、それぞれ、入射する光を屈折させて物体の像を固体撮像素子である画像センサに結像させる撮像レンズ511a、511bを有する。撮像装置510aおよび撮像装置510bによって撮像された各画像を、それぞれ比較画像Iaおよび基準画像Ibとする。図1において、3次元空間内の物体E上の点Sは、比較画像Iaおよび基準画像Ibそれぞれにおいて、撮像レンズ511aと撮像レンズ511bとを結ぶ直線と平行な直線上の位置に写像される。ここで、各画像に写像された点Sを、比較画像Iaにおいて点Sa(x,y)とし、基準画像Ibにおいて点Sb(X,y)とする。このとき、視差値dpは、比較画像Ia上の座標におけるSa(x,y)と基準画像Ib上の座標における点Sb(X,y)とを用いて、以下の(式1)のように表される。   The imaging system shown in FIG. 1 has an imaging device 510a and an imaging device 510b arranged in parallel equiposition. The imaging devices 510a and 510b respectively include imaging lenses 511a and 511b that refract incident light and form an image of an object on an image sensor that is a solid-state imaging device. The images captured by the imaging device 510a and the imaging device 510b are referred to as a comparison image Ia and a reference image Ib, respectively. In FIG. 1, the point S on the object E in the three-dimensional space is mapped to a position on a straight line parallel to a straight line connecting the imaging lens 511a and the imaging lens 511b in each of the comparison image Ia and the reference image Ib. Here, the point S mapped to each image is a point Sa (x, y) in the comparative image Ia and a point Sb (X, y) in the reference image Ib. At this time, the parallax value dp is expressed by the following (Equation 1) using Sa (x, y) at the coordinates on the comparison image Ia and the point Sb (X, y) at the coordinates on the reference image Ib. expressed.

dp=X−x (式1)   dp = X−x (Formula 1)

また、図1において、比較画像Iaにおける点Sa(x,y)と撮像レンズ511aから撮像面上におろした垂線の交点との距離をΔaとし、基準画像Ibにおける点Sb(X,y)と撮像レンズ511bから撮像面上におろした垂線の交点との距離をΔbにすると、視差値dpは、dp=Δa+Δbと表すこともできる。   In FIG. 1, the distance between the point Sa (x, y) in the comparative image Ia and the intersection of the perpendicular line taken from the imaging lens 511a on the imaging surface is Δa, and the point Sb (X, y) in the reference image Ib is If the distance from the intersection of the perpendicular line taken from the imaging lens 511b on the imaging surface is Δb, the parallax value dp can also be expressed as dp = Δa + Δb.

次に、視差値dpを用いることにより、撮像装置510a、510bと物体Eとの間の距離Zを導出する。ここで、距離Zは、撮像レンズ511aの焦点位置と撮像レンズ511bの焦点位置とを結ぶ直線から物体E上の点Sまでの距離である。図1に示すように、撮像レンズ511aおよび撮像レンズ511bの焦点距離f、撮像レンズ511aと撮像レンズ511bとの間の長さである基線長B、および視差値dpを用いて、下記の(式2)により、距離Zを算出することができる。   Next, a distance Z between the imaging devices 510a and 510b and the object E is derived by using the parallax value dp. Here, the distance Z is a distance from a straight line connecting the focal position of the imaging lens 511a and the focal position of the imaging lens 511b to the point S on the object E. As shown in FIG. 1, using the focal length f of the imaging lens 511a and the imaging lens 511b, the baseline length B that is the length between the imaging lens 511a and the imaging lens 511b, and the parallax value dp, According to 2), the distance Z can be calculated.

Z=(B×f)/dp (式2)   Z = (B × f) / dp (Formula 2)

この(式2)により、視差値dpが大きいほど距離Zは小さく、視差値dpが小さいほど距離Zは大きくなることがわかる。   From this (Equation 2), it can be seen that the larger the parallax value dp, the smaller the distance Z, and the smaller the parallax value dp, the larger the distance Z.

(SGM法)
次に、図2〜6を用いて、SGM法を用いた測距方法について説明する。
(SGM method)
Next, a distance measuring method using the SGM method will be described with reference to FIGS.

図2は、基準画像、高密度視差画像およびエッジ視差画像を示す概念図である。このうち、図2(a)は、基準画像を示し、図2(b)は、図2(a)に示す基準画像を用いて求められた高密度視差画像を示し、図2(c)は、図2(a)に示す基準画像を用いて求められたエッジ視差画像を示す概念図である。ここで、基準画像は、図1に示す基準画像Ibに相当し、撮像された被写体が輝度値によって表された画像である。また、高密度視差画像とは、基準画像の各画素を、SGM法によって導出された基準画像における各画素に対応する視差値で表した画像を示すものとする。そして、エッジ視差画像は、基準画像の各画素を、ブロックマッチング法によって導出された基準画像における各画素に対応する視差値で表した画像を示すものとする。ただし、ブロックマッチング法によって導出できる視差値は、後述するように、基準画像におけるエッジ部のような比較的テクスチャの強い部分であり、テクスチャの弱い部分のように視差値を導出できない場合は、例えば視差値を「0」として画像を構成する。   FIG. 2 is a conceptual diagram illustrating a reference image, a high-density parallax image, and an edge parallax image. 2A shows a reference image, FIG. 2B shows a high-density parallax image obtained using the reference image shown in FIG. 2A, and FIG. FIG. 3 is a conceptual diagram showing an edge parallax image obtained using the reference image shown in FIG. Here, the reference image corresponds to the reference image Ib shown in FIG. 1 and is an image in which the captured subject is represented by a luminance value. Further, the high-density parallax image indicates an image in which each pixel of the reference image is represented by a parallax value corresponding to each pixel in the reference image derived by the SGM method. The edge parallax image indicates an image in which each pixel of the reference image is represented by a parallax value corresponding to each pixel in the reference image derived by the block matching method. However, as will be described later, the disparity value that can be derived by the block matching method is a relatively textured portion such as an edge portion in the reference image, and when the disparity value cannot be derived such as a weak texture portion, for example, An image is configured with a parallax value of “0”.

SGM法は、画像におけるテクスチャが弱い部分に対しても適切に視差値を導出するための方法であり、図2(a)に示す基準画像に基づいて、図2(b)に示す高密度視差画像を導出する方法である。なお、ブロックマッチング法は、図2(a)に示す基準画像に基づいて、図2(c)に示すエッジ視差画像を導出する方法である。SGM法によれば、図2(b)および図2(c)における破線の楕円内を比べると分かるように、高密度視差画像は、エッジ視差画像に比べてテクスチャが弱い道路等においても詳細な視差値に基づく距離を表すことができるため、より詳細な測距を行うことができる。   The SGM method is a method for appropriately deriving a parallax value even for a portion having a weak texture in an image. Based on the reference image shown in FIG. 2A, the high-density parallax shown in FIG. This is a method for deriving an image. The block matching method is a method for deriving the edge parallax image shown in FIG. 2C based on the reference image shown in FIG. According to the SGM method, as can be seen by comparing the inside of the dashed ellipse in FIGS. 2B and 2C, the high-density parallax image is detailed even on roads where the texture is weaker than the edge parallax image. Since the distance based on the parallax value can be expressed, more detailed distance measurement can be performed.

SGM法は、基準画像に対する比較画像上の、一致度としてのコスト値を算出して直ちに視差値を導出せず、コスト値を算出後、さらに、合成コスト値を算出することで視差値を導出する方法である。そして、SGM法は、最終的に、基準画像におけるほぼ全ての画素に対応する視差値で表された視差画像(ここでは、高密度視差画像)を導出する。   In the SGM method, the cost value as the degree of coincidence on the comparison image with respect to the reference image is not calculated and the parallax value is not derived immediately, but the parallax value is derived by calculating the combined cost value after calculating the cost value. It is a method to do. The SGM method finally derives a parallax image (here, a high-density parallax image) represented by parallax values corresponding to almost all pixels in the reference image.

なお、ブロックマッチング法の場合は、コスト値を算出する点はSGM法と同じであるが、SGM法のように、合成コスト値を算出せずに、エッジ部のような比較的テクスチャの強い部分の視差値のみが導出される。   In the case of the block matching method, the cost value is calculated in the same way as the SGM method. However, as in the SGM method, a comparatively strong texture such as an edge portion is calculated without calculating a synthesis cost value. Only the parallax value is derived.

<コスト値の算出>
図3は、基準画像における基準画素に対応する比較画像における対応画素を求める場合の説明図である。図4は、シフト量とコスト値との関係の一例を示すグラフである。図3および図4を参照しながら、コスト値C(p,d)の算出方法について説明する。なお、以降、C(p,d)はC(x,y,d)を表すものとして説明する。
<Calculation of cost value>
FIG. 3 is an explanatory diagram for obtaining a corresponding pixel in a comparison image corresponding to a reference pixel in the reference image. FIG. 4 is a graph showing an example of the relationship between the shift amount and the cost value. A method for calculating the cost value C (p, d) will be described with reference to FIGS. 3 and 4. In the following description, C (p, d) represents C (x, y, d).

図3のうち、図3(a)は、基準画像における基準画素を示す概念図を示し、図3(b)は、図3(a)に示す基準画素に対応する比較画像における対応画素の候補を順次シフトしながら(ずらしながら)、コスト値を算出する際の概念図である。ここで、対応画素とは、基準画像における基準画素に最も類似する比較画像における画素を示す。また、コスト値とは、基準画像における基準画素に対する、比較画像における各画素の一致度を表す評価値である。すなわち、以下に示すコスト値(および合成コスト値)は、値が小さいほど、比較画像における画素が基準画素と類似していることを示す。   3A is a conceptual diagram showing reference pixels in the reference image, and FIG. 3B is a corresponding pixel candidate in the comparison image corresponding to the reference pixel shown in FIG. It is a conceptual diagram at the time of calculating a cost value while shifting (shifting) sequentially. Here, the corresponding pixel indicates a pixel in the comparison image that is most similar to the reference pixel in the reference image. The cost value is an evaluation value that represents the degree of coincidence of each pixel in the comparison image with respect to the reference pixel in the reference image. That is, the cost value (and synthesis cost value) shown below indicates that the smaller the value is, the more similar the pixel in the comparative image is to the reference pixel.

図3(a)に示すように、基準画像Ibにおける基準画素p(x,y)、および、基準画素p(x,y)に対する比較画像Iaにおけるエピポーラ線EL上の対応画素の候補である候補画素q(x+d,y)の各輝度値に基づいて、基準画素p(x,y)に対する対応画素の候補画素q(x+d,y)のコスト値C(p,d)が算出される。dは、基準画素pと候補画素qとのシフト量(ずれ量)であり、シフト量dは、画素単位でシフトされる。すなわち、図3では、候補画素q(x+d,y)を予め指定された範囲(例えば、0<d<25)において順次一画素分シフトしながら、候補画素q(x+d,y)と基準画素p(x,y)との輝度値の一致度であるコスト値C(p,d)が算出される。   As shown in FIG. 3A, a candidate that is a candidate for a reference pixel p (x, y) in the reference image Ib and a corresponding pixel on the epipolar line EL in the comparison image Ia with respect to the reference pixel p (x, y). Based on each luminance value of the pixel q (x + d, y), the cost value C (p, d) of the candidate pixel q (x + d, y) corresponding to the reference pixel p (x, y) is calculated. d is a shift amount (shift amount) between the reference pixel p and the candidate pixel q, and the shift amount d is shifted in units of pixels. That is, in FIG. 3, the candidate pixel q (x + d, y) and the reference pixel p are sequentially shifted by one pixel within a predetermined range (for example, 0 <d <25). A cost value C (p, d) that is the degree of coincidence of the luminance value with (x, y) is calculated.

なお、上述のように、撮像装置510a、510bは、それぞれ平行等位に配置されるため、比較画像Iaおよび基準画像Ibも、それぞれ平行等位の関係にある。したがって、基準画像Ibにおける基準画素pに対応する比較画像Iaにおける対応画素は、図3に紙面視横方向の線として示されるエピポーラ線EL上に存在することになり、比較画像Iaにおける対応画素を求めるためには、比較画像Iaのエピポーラ線EL上の画素を探索すればよい。   As described above, since the imaging devices 510a and 510b are arranged in parallel equiposition, the comparison image Ia and the reference image Ib are also in parallel equivalence relations. Therefore, the corresponding pixel in the comparison image Ia corresponding to the reference pixel p in the reference image Ib exists on the epipolar line EL shown as a horizontal line in FIG. 3, and the corresponding pixel in the comparison image Ia is In order to obtain it, the pixel on the epipolar line EL of the comparison image Ia may be searched.

このようにして算出されたコスト値C(p,d)は、シフト量dとの関係で、図4に示すグラフにより表される。図4の例では、コスト値Cは、シフト量d=5,12,19の場合が「0」となるため、最小値を求めることができない。例えば、画像におけるテクスチャが弱い部分がある場合には、このようにコスト値Cの最小値を求めることは困難になる。   The cost value C (p, d) calculated in this way is represented by the graph shown in FIG. 4 in relation to the shift amount d. In the example of FIG. 4, the cost value C is “0” when the shift amount d = 5, 12, and 19, and thus the minimum value cannot be obtained. For example, when there is a portion where the texture is weak in the image, it is difficult to obtain the minimum value of the cost value C in this way.

<合成コスト値の算出>
図5は、合成コストを導出するための概念図である。図6は、シフト量と合成コスト値との関係の一例を示すグラフである。図5および図6を参照しながら、合成コスト値Ls(p,d)の算出方法について説明する。
<Calculation of synthetic cost value>
FIG. 5 is a conceptual diagram for deriving the synthesis cost. FIG. 6 is a graph showing an example of the relationship between the shift amount and the synthesis cost value. A method for calculating the combined cost value Ls (p, d) will be described with reference to FIGS. 5 and 6.

合成コスト値の算出は、コスト値C(p,d)の算出だけでなく、基準画素p(x,y)の周辺の画素を基準画素とした場合のコスト値を、基準画素p(x,y)におけるコスト値C(p,d)に集約させて、合成コスト値Ls(p,d)を算出するものである。合成コスト値Ls(p,d)を算出するためには、まず、経路コスト値Lr(p,d)を算出する。経路コスト値Lr(p,d)は、下記の(式3)によって算出する。   The calculation of the combined cost value is not only the calculation of the cost value C (p, d), but also the cost value when the pixels around the reference pixel p (x, y) are used as the reference pixel is the reference pixel p (x, d The combined cost value Ls (p, d) is calculated by concentrating on the cost value C (p, d) in y). In order to calculate the combined cost value Ls (p, d), first, the route cost value Lr (p, d) is calculated. The route cost value Lr (p, d) is calculated by the following (Formula 3).

Lr(p,d)=C(p,d)+min(Lr(p−r,k)+P(d,k))
(式3)
(P=0(d=kの場合)、
P=P1(|d−k|=1の場合)、
P=P2(>P1)(|d−k|>1の場合))
Lr (p, d) = C (p, d) + min (Lr (p−r, k) + P (d, k))
(Formula 3)
(P = 0 (when d = k))
P = P1 (when | d−k | = 1),
P = P2 (> P1) (when | dk |> 1))

(式3)に示すように経路コスト値Lrは、再帰的に求められる。ここで、rは、集約方向の方向ベクトルを示し、x方向およびy方向の2成分を有する。min()は、最小値を求める関数である。Lr(p−r,k)は、基準画素pの座標からr方向に1画素シフトした座標の画素について、シフト量を変化させた場合(この場合のシフト量をkとしている)のそれぞれの経路コスト値Lrを示す。そして、経路コスト値Lr(p,d)のシフト量であるdと、シフト量kとの間の関係に基づいて、下記の(1)〜(3)のように値P(d,k)を求め、Lr(p−r,k)+P(d,k)を算出している。   As shown in (Formula 3), the route cost value Lr is obtained recursively. Here, r indicates a direction vector in the aggregation direction, and has two components in the x direction and the y direction. min () is a function for obtaining the minimum value. Lr (p−r, k) is the respective path when the shift amount is changed (the shift amount in this case is k) for the pixel having the coordinate shifted by one pixel in the r direction from the coordinate of the reference pixel p. The cost value Lr is shown. Then, based on the relationship between the shift amount d of the route cost value Lr (p, d) and the shift amount k, the value P (d, k) as shown in (1) to (3) below. Lr (p−r, k) + P (d, k) is calculated.

(1)d=kの場合、P=0とする。すなわち、Lr(p−r,k)+P(d,k)=Lr(p−r,k)となる。
(2)|d−k|=1の場合、P=P1とする。すなわち、Lr(p−r,k)+P(d,k)=Lr(p−r,k)+P1となる。
(3)|d−k|>1の場合、P=P2(>P1)とする。すなわち、Lr(p−r,k)+P(d,k)=Lr(p−r,k)+P2となる。
(1) When d = k, P = 0. That is, Lr (p−r, k) + P (d, k) = Lr (p−r, k).
(2) When | d−k | = 1, P = P1. That is, Lr (p−r, k) + P (d, k) = Lr (p−r, k) + P1.
(3) When | d−k |> 1, P = P2 (> P1). That is, Lr (p−r, k) + P (d, k) = Lr (p−r, k) + P2.

そして、min(Lr(p−r,k)+P(d,k))は、kを様々な値に変化させた場合の、上述の(1)〜(3)で算出したLr(p−r,k)+P(d,k)のうち最小の値を抽出した値となる。すなわち、比較画像Iaにおける基準画素pの座標の位置にある画素からr方向において隣接する画素(p−r)からシフト量kだけシフトした画素から離れた場合に、値P1または値P2(>P1)を加算することにより、比較画像Iaにおける基準画素pの座標から離れた画素についての、シフト量dが不連続な経路コスト値Lrの影響を受け過ぎないようにしている。また、値P1および値P2は、予め実験により定められた固定パラメータであり、経路上で隣接する基準画素の視差値が連続になりやすいようなパラメータになっている。例えば、P1=48、P2=96である。このように、比較画像Iaにおいてr方向の各画素における経路コスト値Lrを求めるために、最初は、基準画素p(x,y)の座標からr方向の一番端の画素から経路コスト値Lrを求め、r方向に沿って経路コスト値Lrが求められる。   Then, min (Lr (p−r, k) + P (d, k)) is Lr (p−r) calculated in the above (1) to (3) when k is changed to various values. , K) + P (d, k) is a value obtained by extracting the minimum value. In other words, the value P1 or the value P2 (> P1) when the pixel located at the coordinate position of the reference pixel p in the comparison image Ia moves away from the pixel shifted by the shift amount k from the pixel (pr) adjacent in the r direction. ) Is added so that the shift amount d for the pixels away from the coordinates of the reference pixel p in the comparison image Ia is not affected by the discontinuous path cost value Lr. Further, the value P1 and the value P2 are fixed parameters determined in advance by experiments, and are parameters such that the parallax values of the reference pixels adjacent on the path are likely to be continuous. For example, P1 = 48 and P2 = 96. Thus, in order to obtain the path cost value Lr for each pixel in the r direction in the comparison image Ia, first, the path cost value Lr from the extreme end pixel in the r direction from the coordinates of the reference pixel p (x, y). And the route cost value Lr is obtained along the r direction.

そして、図5に示すように、8方向(r、r45、r90、r135、r180、r225、r270およびr315)の経路コスト値LrであるLr、Lr45、Lr90、Lr135、Lr180、Lr225、Lr270およびLr315が求められ、最終的に下記の(式4)に基づいて、合成コスト値Ls(p,d)が求められる。 Then, as shown in FIG. 5, Lr 0 , Lr 45 , Lr which are route cost values Lr in eight directions (r 0 , r 45 , r 90 , r 135 , r 180 , r 225 , r 270 and r 315 ). 90 , Lr 135 , Lr 180 , Lr 225 , Lr 270 and Lr 315 are obtained, and finally, a combined cost value Ls (p, d) is obtained based on the following (Equation 4).

Ls(p,d)=ΣLr (式4)   Ls (p, d) = ΣLr (Formula 4)

以上のようにして、算出された合成コスト値Ls(p,d)は、シフト量dとの関係で、図6に示すグラフによって表すことができる。図6の例では、合成コスト値Lsは、シフト量d=3の場合が最小値となるため、視差値dp=3として導出される。なお、上述の説明においては、r方向の数を8個として説明しているが、これに限定されるものではない。例えば、8方向をさらに2つに分割して16方向、または、3つに分割して24方向等にしてもよい。あるいは、8方向のうちのいずれかの経路コスト値Lrを求め、合成コスト値Lsを算出するものとしてもよい。   As described above, the calculated combined cost value Ls (p, d) can be represented by the graph shown in FIG. 6 in relation to the shift amount d. In the example of FIG. 6, the combined cost value Ls is derived as a parallax value dp = 3 because the minimum value is obtained when the shift amount d = 3. In the above description, the number in the r direction is eight, but the present invention is not limited to this. For example, the eight directions may be further divided into two to be 16 directions, or may be divided into three to be 24 directions. Or it is good also as what calculates | requires the path | route cost value Lr in any of eight directions, and calculates the synthetic | combination cost value Ls.

[本実施の形態の具体的な説明]
以下、図7〜16を用いて、本実施の形態の具体的な説明をする。ここでは、ステレオマッチング処理を行う視差値導出装置1が自動車に搭載される場合を例に説明する。
[Specific Description of this Embodiment]
Hereinafter, this embodiment will be described in detail with reference to FIGS. Here, a case where the parallax value deriving device 1 that performs stereo matching processing is mounted on an automobile will be described as an example.

(視差値導出装置を備えた車両の概略構成)
図7は、本実施の形態に係る機器制御システムを車両に搭載した例を示す図である。図7を参照しながら、本実施の形態に係る機器制御システム50を搭載した車両100について説明する。図7のうち、図7(a)は、機器制御システム50を搭載した車両100の側面図であり、図7(b)は、車両100の正面図である。
(Schematic configuration of a vehicle equipped with a parallax value deriving device)
FIG. 7 is a diagram illustrating an example in which the device control system according to the present embodiment is mounted on a vehicle. A vehicle 100 equipped with the device control system 50 according to the present embodiment will be described with reference to FIG. 7A, FIG. 7A is a side view of the vehicle 100 on which the device control system 50 is mounted, and FIG. 7B is a front view of the vehicle 100.

図7に示すように、自動車である車両100は、機器制御システム50を備えている。機器制御システム50は、車両100の居室空間である車室に設置された視差値導出装置1と、制御装置5と、ステアリングホイール6と、ブレーキペダル7と、を備えている。   As shown in FIG. 7, a vehicle 100 that is an automobile includes a device control system 50. The device control system 50 includes a parallax value deriving device 1, a control device 5, a steering wheel 6, and a brake pedal 7 that are installed in a cabin that is a room space of the vehicle 100.

視差値導出装置1は、車両100の進行方向を撮像する撮像機能を有し、例えば、車両100のフロントウィンドウ内側のバックミラー近傍に設置される。視差値導出装置1は、詳細は後述するが、本体2と、本体2に固定された撮像部10aと、撮像部10bとを備えている。撮像部10a、10b(第1撮像手段、第2撮像手段)は、車両100の進行方向の被写体を撮像できるように本体2に固定されている。   The parallax value deriving device 1 has an imaging function for imaging the traveling direction of the vehicle 100 and is installed, for example, in the vicinity of the rearview mirror inside the front window of the vehicle 100. The parallax value deriving device 1 includes a main body 2, an imaging unit 10a fixed to the main unit 2, and an imaging unit 10b, as will be described in detail later. The imaging units 10a and 10b (first imaging unit and second imaging unit) are fixed to the main body 2 so that a subject in the traveling direction of the vehicle 100 can be imaged.

制御装置5は、視差値導出装置1から受信した視差画像の画像データに基づいて求まる視差値導出装置1から被写体までの距離情報により、各種車両制御を実行する。制御装置5は、車両制御の例として、視差値導出装置1から受信した視差画像の画像データに基づいて、ステアリングホイール6を含むステアリング系統(制御対象)を制御して障害物を回避するステアリング制御、または、ブレーキペダル7(制御対象)を制御して車両100を減速および停止させるブレーキ制御等を実行する。   The control device 5 executes various vehicle controls based on distance information from the parallax value deriving device 1 to the subject obtained based on the image data of the parallax images received from the parallax value deriving device 1. As an example of vehicle control, the control device 5 controls the steering system (control target) including the steering wheel 6 based on the image data of the parallax image received from the parallax value deriving device 1 to avoid an obstacle. Alternatively, brake control or the like for controlling the brake pedal 7 (control target) to decelerate and stop the vehicle 100 is executed.

このような視差値導出装置1および制御装置5を含む機器制御システム50のように、ステアリング制御またはブレーキ制御等の車両制御が実行されることによって、車両100の運転の安全性を向上することができる。   As in the device control system 50 including the parallax value deriving device 1 and the control device 5 as described above, vehicle control such as steering control or brake control is executed, so that the driving safety of the vehicle 100 can be improved. it can.

なお、上述のように、視差値導出装置1は、車両100の前方を撮像するものとしたが、これに限定されるものではない。すなわち、視差値導出装置1は、車両100の後方または側方を撮像するように設置されるものとしてもよい。この場合、視差値導出装置1は、車両100の後方の後続車、または側方を並進する他の車両等の位置を検出することができる。そして、制御装置5は、車両100の車線変更時または車線合流時等における危険を検知して、上述の車両制御を実行することができる。また、制御装置5は、車両100の駐車時等におけるバック動作において、視差値導出装置1によって検出された車両100の後方の障害物の視差画像に基づいて、衝突の危険があると判断した場合に、上述の車両制御を実行することができる。   As described above, the parallax value deriving device 1 images the front of the vehicle 100, but is not limited thereto. That is, the parallax value deriving device 1 may be installed so as to image the rear or side of the vehicle 100. In this case, the parallax value deriving device 1 can detect the position of a subsequent vehicle behind the vehicle 100 or another vehicle that translates laterally. And the control apparatus 5 can detect the danger at the time of the lane change of the vehicle 100, or at the time of lane merge, etc., and can perform the above-mentioned vehicle control. In addition, when the control device 5 determines that there is a risk of a collision based on the parallax image of the obstacle behind the vehicle 100 detected by the parallax value deriving device 1 in the back operation when the vehicle 100 is parked or the like. In addition, the vehicle control described above can be executed.

(視差値導出装置の構成)
図8は、本実施の形態に係る視差値導出装置の外観の一例を示す図である。図8に示すように、視差値導出装置1は、上述のように、本体2と、本体2に固定された撮像部10aと、撮像部10bとを備えている。撮像部10a、10bは、本体2に対して平行等位に配置された一対の円筒形状のカメラで構成されている。また、説明の便宜上、図8に示す撮像部10aを「左」のカメラと称し、撮像部10bを「右」のカメラと称するものとする。
(Configuration of parallax value deriving device)
FIG. 8 is a diagram illustrating an example of the appearance of the parallax value deriving device according to the present embodiment. As shown in FIG. 8, the parallax value deriving device 1 includes the main body 2, the imaging unit 10a fixed to the main body 2, and the imaging unit 10b as described above. The imaging units 10 a and 10 b are configured by a pair of cylindrical cameras arranged in parallel equiposition with respect to the main body 2. For convenience of explanation, the imaging unit 10a illustrated in FIG. 8 is referred to as a “left” camera, and the imaging unit 10b is referred to as a “right” camera.

<視差値導出装置のハードウェア構成>
図9は、本実施の形態に係る視差値導出装置のハードウェア構成の一例を示す図である。図9を参照しながら、視差値導出装置1のハードウェア構成について説明する。
<Hardware configuration of parallax value deriving device>
FIG. 9 is a diagram illustrating an example of a hardware configuration of the disparity value deriving device according to the present embodiment. A hardware configuration of the parallax value deriving device 1 will be described with reference to FIG.

図9に示すように、視差値導出装置1は、本体2と、撮像部10aと、撮像部10bと、信号変換部20aと、信号変換部20bと、画像処理部30と、を備えている。   As illustrated in FIG. 9, the parallax value deriving device 1 includes a main body 2, an imaging unit 10 a, an imaging unit 10 b, a signal conversion unit 20 a, a signal conversion unit 20 b, and an image processing unit 30. .

本体2は、視差値導出装置1の筐体を構成するものであり、撮像部10a、10bを固定して支持し、信号変換部20a、20bおよび画像処理部30を内蔵する。   The main body 2 constitutes the casing of the parallax value deriving device 1, and fixes and supports the imaging units 10a and 10b, and incorporates the signal conversion units 20a and 20b and the image processing unit 30.

撮像部10aは、前方の被写体を撮像してアナログ形式の画像データを生成する処理部である。撮像部10aは、撮像レンズ11aと、絞り12aと、画像センサ13aと、を備えている。   The imaging unit 10a is a processing unit that captures an image of a front subject and generates analog image data. The imaging unit 10a includes an imaging lens 11a, a diaphragm 12a, and an image sensor 13a.

撮像レンズ11aは、入射する光を屈折させて物体の像を画像センサ13aに結像させるための光学素子である。絞り12aは、撮像レンズ11aを通過した光の一部を遮ることによって、画像センサ13aに結像される光の量を調整する部材である。画像センサ13aは、撮像レンズ11aに入射し、絞り12aを通過した光を電気的なアナログ形式の画像データに変換する固体撮像素子である。画像センサ13aは、例えば、CCD(Charge Coupled Devices)またはCMOS(Complementary Metal Oxide Semiconductor)によって実現される。   The imaging lens 11a is an optical element that refracts incident light to form an image of an object on the image sensor 13a. The diaphragm 12a is a member that adjusts the amount of light imaged on the image sensor 13a by blocking part of the light that has passed through the imaging lens 11a. The image sensor 13a is a solid-state imaging device that converts light that has entered the imaging lens 11a and passed through the aperture 12a into electrical analog image data. The image sensor 13a is realized by, for example, a CCD (Charge Coupled Devices) or a CMOS (Complementary Metal Oxide Semiconductor).

撮像部10bは、前方の被写体を撮像してアナログ形式の画像データを生成する処理部である。撮像部10bは、撮像レンズ11bと、絞り12bと、画像センサ13bと、を備えている。撮像レンズ11b、絞り12bおよび画像センサ13bの機能は、それぞれ上述した撮像レンズ11a、絞り12aおよび画像センサ13aの機能と同様である。また、撮像レンズ11aおよび撮像レンズ11bは、左右のカメラが同一の条件で撮像されるように、それぞれのレンズ面が互いに同一平面上にあるように設置されている。   The imaging unit 10b is a processing unit that captures an image of a front subject and generates analog image data. The imaging unit 10b includes an imaging lens 11b, a diaphragm 12b, and an image sensor 13b. The functions of the imaging lens 11b, the diaphragm 12b, and the image sensor 13b are the same as the functions of the imaging lens 11a, the diaphragm 12a, and the image sensor 13a, respectively. Further, the imaging lens 11a and the imaging lens 11b are installed so that the respective lens surfaces are on the same plane so that the left and right cameras are imaged under the same conditions.

信号変換部20aは、撮像部10aにより生成されたアナログ形式の画像データを、デジタル形式の画像データに変換する処理部である。信号変換部20aは、CDS(Correlated Double Sampling)21aと、AGC(Auto Gain Control)22aと、ADC(Analog Digital Converter)23aと、フレームメモリ24aと、を備えている。   The signal conversion unit 20a is a processing unit that converts analog image data generated by the imaging unit 10a into digital image data. The signal converter 20a includes a CDS (Correlated Double Sampling) 21a, an AGC (Auto Gain Control) 22a, an ADC (Analog Digital Converter) 23a, and a frame memory 24a.

CDS21aは、画像センサ13aにより生成されたアナログ形式の画像データに対して、相関二重サンプリング、横方向の微分フィルタ、および縦方向の平滑フィルタ等によりノイズを除去する。AGC22aは、CDS21aによってノイズが除去されたアナログ形式の画像データの強度を制御する利得制御を行う。ADC23aは、AGC22aによって利得制御されたアナログ形式の画像データをデジタル形式の画像データに変換する。フレームメモリ24aは、ADC23aによって変換された画像データを記憶する。   The CDS 21a removes noise from the analog image data generated by the image sensor 13a using correlated double sampling, a horizontal differential filter, a vertical smoothing filter, and the like. The AGC 22a performs gain control for controlling the intensity of analog image data from which noise has been removed by the CDS 21a. The ADC 23a converts analog image data whose gain is controlled by the AGC 22a into digital image data. The frame memory 24a stores the image data converted by the ADC 23a.

信号変換部20bは、撮像部10bにより生成されたアナログ形式の画像データを、デジタル形式の画像データに変換する処理部である。信号変換部20bは、CDS21bと、AGC22bと、ADC23bと、フレームメモリ24bと、を備えている。CDS21b、AGC22b、ADC23bおよびフレームメモリ24bの機能は、それぞれ上述したCDS21a、AGC22a、ADC23aおよびフレームメモリ24aの機能と同様である。   The signal conversion unit 20b is a processing unit that converts analog image data generated by the imaging unit 10b into digital image data. The signal conversion unit 20b includes a CDS 21b, an AGC 22b, an ADC 23b, and a frame memory 24b. The functions of the CDS 21b, AGC 22b, ADC 23b, and frame memory 24b are the same as the functions of the CDS 21a, AGC 22a, ADC 23a, and frame memory 24a, respectively.

画像処理部30は、信号変換部20aおよび信号変換部20bによって変換された画像データに対して画像処理をする装置である。画像処理部30は、FPGA(Field Programmable Gate Array)31と、CPU(Central Processing Unit)32と、ROM(Read Only Memory)33と、RAM(Random Access Memory)34と、通信I/F(Interface)35と、バス39と、を備えている。   The image processing unit 30 is a device that performs image processing on the image data converted by the signal conversion unit 20a and the signal conversion unit 20b. The image processing unit 30 includes an FPGA (Field Programmable Gate Array) 31, a CPU (Central Processing Unit) 32, a ROM (Read Only Memory) 33, a RAM (Random Access Memory) 34, and a communication I / F (Interface). 35 and a bus 39.

FPGA31は、集積回路であり、画像データに基づく画像における視差値dpを導出する処理を行う。CPU32は、視差値導出装置1の各機能を制御する。ROM33は、CPU32が視差値導出装置1の各機能を制御するために実行する画像処理用プログラムを記憶している。RAM34は、CPU32のワークエリアとして使用される。通信I/F35は、外部コントローラ等と通信するためのインターフェースであり、図7に示す制御装置5が接続される。   The FPGA 31 is an integrated circuit and performs processing for deriving a parallax value dp in an image based on image data. The CPU 32 controls each function of the parallax value deriving device 1. The ROM 33 stores an image processing program that the CPU 32 executes to control each function of the parallax value deriving device 1. The RAM 34 is used as a work area for the CPU 32. The communication I / F 35 is an interface for communicating with an external controller or the like, and is connected to the control device 5 shown in FIG.

なお、通信I/F35には、例えば、自動車のCAN(Controller Area Network)、または、撮像画像または視差画像を表示する液晶ディスプレイまたは有機EL(Electro−Luminescence)ディスプレイ等の表示装置等が接続されてもよい。また、画像処理部30は、視差値dpを導出する集積回路としてFPGA31を備えるものとしているが、これに限定されるものではなく、ASIC(Application Specific Integrated Circuit)等の集積回路であってもよい。   Note that the communication I / F 35 is connected to a display device such as a CAN (Controller Area Network) of a car, a liquid crystal display that displays a captured image or a parallax image, or an organic EL (Electro-Luminescence) display. Also good. Further, the image processing unit 30 includes the FPGA 31 as an integrated circuit for deriving the parallax value dp. However, the image processing unit 30 is not limited thereto, and may be an integrated circuit such as an ASIC (Application Specific Integrated Circuit). .

バス39は、図9に示すように、FPGA31、CPU32、ROM33、RAM34および通信I/F35が互いに通信可能となるように接続するアドレスバスおよびデータバス等である。   As shown in FIG. 9, the bus 39 is an address bus, a data bus, or the like that is connected so that the FPGA 31, the CPU 32, the ROM 33, the RAM 34, and the communication I / F 35 can communicate with each other.

なお、上述の画像処理用プログラムは、インストール可能な形式または実行可能な形式のファイルで、コンピュータで読み取り可能な記録媒体に記録して流通させてもよい。この記録媒体は、CD−ROMまたはSDカード等である。   Note that the above-described image processing program may be distributed in a computer-readable recording medium in an installable or executable format file. This recording medium is a CD-ROM or an SD card.

<視差値導出装置のブロック構成および各ブロックの動作>
図10は、本実施の形態に係る視差値導出装置のブロック構成の一例を示す図である。図11は、基準画像の基準画素に対応する比較画像の対応画素を求める場合にローパスフィルタを切り替える動作を説明する図である。図12は、本実施の形態におけるシフト量と合成コスト値との関係の一例を示すグラフである。図13は、パラボラフィッティングによるサブピクセル推定を説明する図である。図14は、最小二乗法によるサブピクセル推定を説明する図である。図15は、本実施の形態のステレオマッチング処理によって求められる高密度視差画像の一例を示す概念図である。図10〜15を参照しながら、視差値導出装置1の要部のブロック構成および各ブロックの動作について説明する。
<Block Configuration of Disparity Value Deriving Device and Operations of Each Block>
FIG. 10 is a diagram illustrating an example of a block configuration of the disparity value deriving device according to the present embodiment. FIG. 11 is a diagram for explaining the operation of switching the low-pass filter when obtaining the corresponding pixel of the comparison image corresponding to the reference pixel of the reference image. FIG. 12 is a graph showing an example of the relationship between the shift amount and the combined cost value in the present embodiment. FIG. 13 is a diagram for explaining subpixel estimation by parabolic fitting. FIG. 14 is a diagram for explaining subpixel estimation by the method of least squares. FIG. 15 is a conceptual diagram illustrating an example of a high-density parallax image obtained by the stereo matching process of the present embodiment. The block configuration of the main part of the parallax value deriving device 1 and the operation of each block will be described with reference to FIGS.

図10に示すように、視差値導出装置1は、画像取得部110と、変換部210と、コスト算出部310と、コスト合成部320(合成手段)と、サブピクセル推定部330(導出手段)と、記憶部340(記憶手段)と、生成部350と、を備えている。   As shown in FIG. 10, the parallax value deriving device 1 includes an image acquisition unit 110, a conversion unit 210, a cost calculation unit 310, a cost synthesis unit 320 (synthesis unit), and a subpixel estimation unit 330 (derivation unit). And a storage unit 340 (storage means) and a generation unit 350.

画像取得部110は、左右2台のカメラにより前方の被写体を撮像して、それぞれアナログ形式の画像データを生成し、各画像データ基づく画像である2つの輝度画像を得る処理部である。画像取得部110は、図9に示す撮像部10aおよび撮像部10bによって実現される。   The image acquisition unit 110 is a processing unit that captures an object in front by two left and right cameras, generates image data in analog format, and obtains two luminance images that are images based on each image data. The image acquisition unit 110 is realized by the imaging unit 10a and the imaging unit 10b illustrated in FIG.

変換部210は、画像取得部110により得られた2つの輝度画像の画像データに対して、ノイズを除去し、デジタル形式の画像データに変換して出力する。ここで、変換部210が出力する2つの輝度画像の画像データ(以下、単に「輝度画像」と称する)のうち、画像取得部110の右のカメラ(撮像部10b)により撮像された画像データを基準画像Ibの画像データ(以下、単に「基準画像Ib」という)とし、左のカメラ(撮像部10a)により撮像された画像データを比較画像Iaの画像データ(以下、単に「比較画像Ia」という)とする。すなわち、変換部210は、画像取得部110から出力された2つの輝度画像に基づいて、基準画像Ibおよび比較画像Iaを出力する。変換部210は、図9に示す信号変換部20a、20bによって実現される。   The conversion unit 210 removes noise from the image data of the two luminance images obtained by the image acquisition unit 110, converts the image data into digital format image data, and outputs the image data. Here, image data captured by the right camera (imaging unit 10 b) of the image acquisition unit 110 among the image data of the two luminance images output by the conversion unit 210 (hereinafter simply referred to as “luminance image”). The image data of the reference image Ib (hereinafter simply referred to as “reference image Ib”), and the image data captured by the left camera (imaging unit 10a) is the image data of the comparison image Ia (hereinafter simply referred to as “comparison image Ia”). ). That is, the conversion unit 210 outputs the reference image Ib and the comparison image Ia based on the two luminance images output from the image acquisition unit 110. The converter 210 is realized by the signal converters 20a and 20b shown in FIG.

記憶部340は、コスト算出部310において、比較画像Iaにおいて、基準画素p(x,y)に対する対応画素の候補画素q(x+d,y)のコスト値C(p,d)を算出するために、基準画素pおよび候補画素qに対して施すローパスフィルタのデータ(以下、単に、ローパスフィルタという)(例えば、後述の図11に示すローパスフィルタF1、F2)を記憶している。記憶部340は、基準画素pと候補画素qとのシフト量dにより定まるローパスフィルタを記憶している。また、記憶部340は、コスト算出部310がシフト量dに応じてどのローパスフィルタを使用するかの判定基準になるシフト量dに対する閾値のデータを記憶している。例えば、記憶部340は、実験等に基づいて予め定められた閾値Th1、Th2(>Th1)を記憶しているものとする。この閾値Th1、Th2については、後述する。   The storage unit 340 uses the cost calculation unit 310 to calculate the cost value C (p, d) of the candidate pixel q (x + d, y) corresponding to the reference pixel p (x, y) in the comparison image Ia. Further, low-pass filter data (hereinafter simply referred to as a low-pass filter) (for example, low-pass filters F1 and F2 shown in FIG. 11 described later) stored in the reference pixel p and the candidate pixel q are stored. The storage unit 340 stores a low-pass filter determined by the shift amount d between the reference pixel p and the candidate pixel q. Further, the storage unit 340 stores threshold value data for the shift amount d, which is a criterion for determining which low-pass filter the cost calculation unit 310 uses according to the shift amount d. For example, it is assumed that the storage unit 340 stores threshold values Th1 and Th2 (> Th1) determined in advance based on experiments or the like. The threshold values Th1 and Th2 will be described later.

コスト算出部310は、基準画像Ibにおける基準画素p(x,y)(第1基準領域)の輝度値、および、基準画素p(x,y)に基づく比較画像Iaにおけるエピポーラ線上で、基準画素p(x,y)の位置に相当する画素からシフト量dでシフトすることにより特定される、対応画素の候補である候補画素q(x+d,y)の各輝度値に基づいて、各候補画素q(x+d,y)のコスト値C(p,d)を算出する。コスト算出部310は、フィルタ部310a(フィルタリング手段)と、算出部310b(算出手段)と、を有する。コスト算出部310は、図9に示すFPGA31によって実現される。   The cost calculation unit 310 calculates the reference pixel on the epipolar line in the comparison image Ia based on the luminance value of the reference pixel p (x, y) (first reference region) in the reference image Ib and the reference pixel p (x, y). Each candidate pixel is determined based on each luminance value of the candidate pixel q (x + d, y), which is a candidate for the corresponding pixel, specified by shifting from the pixel corresponding to the position of p (x, y) by the shift amount d. A cost value C (p, d) of q (x + d, y) is calculated. The cost calculation unit 310 includes a filter unit 310a (filtering unit) and a calculation unit 310b (calculation unit). The cost calculation unit 310 is realized by the FPGA 31 illustrated in FIG.

フィルタ部310aは、まず、記憶部340から閾値Th1、Th2を読み出して取得する。フィルタ部310aは、基準画像Ibの基準画素p(x,y)と比較する比較画像Iaの候補画素q(x+d,y)のシフト量dが、閾値Th1未満である場合、基準画素pおよび候補画素qに対応する被写体は遠いものであると判断する。この場合、フィルタ部310aは、記憶部340から1×1次元、かつ、フィルタ係数が「1」のローパスフィルタを読み出し、基準画素pおよび候補画素qに対して、読み出したローパスフィルタによるフィルタ処理(コンボリューション演算(畳み込み演算))を行う。具体的には、この場合、フィルタ部310aは、基準画素pおよび候補画素qの輝度値と、ローパスフィルタのフィルタ係数「1」との積を算出、すなわち、基準画素pおよび候補画素qの輝度値そのものを、それぞれフィルタ処理後の基準画素pおよび候補画素qの輝度値として求める。なお、この場合、フィルタ部310aによるフィルタ処理は、基準画素pおよび候補画素qの輝度値そのものが求まるので、1×1次元のフィルタ処理をしないものとしてもよい。   First, the filter unit 310a reads and acquires the threshold values Th1 and Th2 from the storage unit 340. When the shift amount d of the candidate pixel q (x + d, y) of the comparison image Ia to be compared with the reference pixel p (x, y) of the reference image Ib is less than the threshold Th1, the filter unit 310a determines the reference pixel p and the candidate. The subject corresponding to the pixel q is determined to be far away. In this case, the filter unit 310a reads a low-pass filter having a 1 × 1 dimension and a filter coefficient “1” from the storage unit 340, and performs filtering processing on the reference pixel p and the candidate pixel q using the read low-pass filter ( Convolution calculation (convolution calculation)) is performed. Specifically, in this case, the filter unit 310a calculates the product of the luminance value of the reference pixel p and the candidate pixel q and the filter coefficient “1” of the low-pass filter, that is, the luminance of the reference pixel p and the candidate pixel q. The values themselves are obtained as the luminance values of the reference pixel p and the candidate pixel q after the filter processing, respectively. Note that in this case, the filtering process by the filter unit 310a may determine the luminance values of the reference pixel p and the candidate pixel q, and thus the 1 × 1-dimensional filtering process may not be performed.

また、フィルタ部310aは、図11(a)に示すように、基準画像Ibの基準画素p(x,y)と比較する比較画像Iaの候補画素q(x+d1,y)のシフト量d1が、閾値Th1以上閾値Th2未満である場合、基準画素pおよび候補画素qに対応する被写体は中距離のものであると判断する。この場合、フィルタ部310aは、記憶部340から1×3次元、かつ、フィルタ係数が「1/3」のローパスフィルタF1を読み出し、基準画素pおよび候補画素qに対して、読み出したローパスフィルタF1によるフィルタ処理(コンボリューション演算(畳み込み演算))を行う。具体的には、この場合、フィルタ部310aは、基準画素pおよび基準画素pの左右の画素の3つの輝度値と、ローパスフィルタF1とのコンボリューション演算を行い、フィルタ処理後の基準画素pの輝度値を求める。これは、基準画素pおよび基準画素pの左右の画素の3つの輝度値の平均値を求めていることになる。また、同様に、フィルタ部310aは、候補画素qおよび候補画素qの左右の輝度値の3つの輝度値と、ローパスフィルタF1とのコンボリューション演算を行い、フィルタ処理後の候補画素qの輝度値を求める。これは、候補画素qおよび候補画素qの左右の画素の3つの輝度値の平均値を求めていることになる。   Further, as shown in FIG. 11A, the filter unit 310a has a shift amount d1 of the candidate pixel q (x + d1, y) of the comparison image Ia to be compared with the reference pixel p (x, y) of the reference image Ib. If the threshold value Th1 is greater than or equal to the threshold value Th2, the subject corresponding to the reference pixel p and the candidate pixel q is determined to be at a medium distance. In this case, the filter unit 310a reads the low-pass filter F1 having 1 × 3 dimensions and the filter coefficient “1/3” from the storage unit 340, and reads the low-pass filter F1 read out for the reference pixel p and the candidate pixel q. Filter processing (convolution calculation (convolution calculation)) is performed. Specifically, in this case, the filter unit 310a performs a convolution operation with the reference pixel p and the three luminance values of the left and right pixels of the reference pixel p and the low-pass filter F1, and calculates the reference pixel p after the filtering process. Find the luminance value. This means that the average value of the three luminance values of the reference pixel p and the left and right pixels of the reference pixel p is obtained. Similarly, the filter unit 310a performs a convolution operation with the three luminance values of the candidate pixel q and the left and right luminance values of the candidate pixel q and the low-pass filter F1, and the luminance value of the candidate pixel q after the filtering process. Ask for. This means that the average value of the three luminance values of the candidate pixel q and the left and right pixels of the candidate pixel q is obtained.

また、フィルタ部310aは、図11(b)に示すように、基準画像Ibの基準画素p(x,y)と比較する比較画像Iaの候補画素q(x+d2,y)のシフト量d2が、閾値Th2以上である場合、基準画素pおよび候補画素qに対応する被写体は近いものであると判断する。この場合、フィルタ部310aは、記憶部340から1×5次元、かつ、フィルタ係数が「1/5」のローパスフィルタF2を読み出し、基準画素pおよび候補画素qに対して、読み出したローパスフィルタF2によるフィルタ処理(コンボリューション演算(畳み込み演算))を行う。具体的には、この場合、フィルタ部310aは、基準画素p、および基準画素pの左右2つずつの画素の5つの輝度値と、ローパスフィルタF2とのコンボリューション演算を行い、フィルタ処理後の基準画素pの輝度値を求める。これは、基準画素p、および基準画素pの左右2つずつの画素の5つの輝度値の平均値を求めていることになる。また、同様に、フィルタ部310aは、候補画素qおよび候補画素qの左右2つずつの輝度値の5つの輝度値と、ローパスフィルタF2とのコンボリューション演算を行い、フィルタ処理後の候補画素qの輝度値を求める。これは、候補画素q、および候補画素qの左右2つずつの画素の5つの輝度値の平均値を求めていることになる。   Further, as shown in FIG. 11B, the filter unit 310a has a shift amount d2 of the candidate pixel q (x + d2, y) of the comparison image Ia to be compared with the reference pixel p (x, y) of the reference image Ib. If the threshold Th2 is equal to or greater than the threshold Th2, it is determined that the subjects corresponding to the reference pixel p and the candidate pixel q are close. In this case, the filter unit 310a reads the low-pass filter F2 having a 1 × 5 dimension and the filter coefficient “1/5” from the storage unit 340, and the low-pass filter F2 that has been read out with respect to the reference pixel p and the candidate pixel q. Filter processing (convolution calculation (convolution calculation)) is performed. Specifically, in this case, the filter unit 310a performs a convolution operation with the reference pixel p and the five luminance values of the left and right pixels of the reference pixel p and the low-pass filter F2, and after the filter processing, The luminance value of the reference pixel p is obtained. This means that the average value of the five luminance values of the reference pixel p and the two pixels on the left and right of the reference pixel p is obtained. Similarly, the filter unit 310a performs a convolution operation between the five luminance values of the left and right luminance values of the candidate pixel q and the candidate pixel q and the low-pass filter F2, and the candidate pixel q after the filtering process Find the brightness value of. This means that the average value of the five luminance values of the candidate pixel q and each of the left and right pixels of the candidate pixel q is obtained.

なお、上述の閾値の数、およびローパスフィルタの次元は例示であり、その他の閾値によりシフト量dの範囲を定め、それぞれのシフト量dの範囲に応じたローパスフィルタを適用するものとしてもよい。また、ローパスフィルタは、1次元のローパスフィルタとしたが、これに限定されるものではなく、m×n次元(m,n≧1)のローパスフィルタとしてもよい。ただし、上述のようにローパスフィルタを1次元とすることによってフィルタ処理の演算負荷を軽減することができる。   Note that the number of threshold values and the dimensions of the low-pass filter described above are examples, and the range of the shift amount d may be determined by other threshold values, and the low-pass filter corresponding to the range of each shift amount d may be applied. The low-pass filter is a one-dimensional low-pass filter, but is not limited to this, and may be an m × n-dimensional (m, n ≧ 1) low-pass filter. However, the calculation load of the filter processing can be reduced by making the low-pass filter one-dimensional as described above.

算出部310bは、フィルタ部310aによりローパスフィルタを用いてフィルタ処理が行われた後の基準画素pおよび候補画素qの輝度値に基づいて、候補画素qのコスト値Cを算出する。算出部310bが算出するコスト値Cとしては、例えば、SAD(Sum of Absolute Differences)、またはSSD(Sum of Squared Differences)等を用いることができる。例えば、算出部310bが算出するコスト値Cとして、SADを用いる場合、基準画素pおよび候補画素qそれぞれを中心に、例えば、3×3の領域をブロックとして想定する場合、このブロックに含まれる画素それぞれに対して、フィルタ部310aによる上述のフィルタ処理を行う必要がある。そして、シフト量dと、算出部310bにより算出されたコスト値Cとの関係を示すグラフが、例えば、上述の図4に示すグラフである。このように、コスト算出部310は、基準画像Ibおよび比較画像Iaを構成する画素の輝度値そのものを使用するのではなく、この輝度値に対して、シフト量dに応じたサイズのローパスフィルタによるフィルタ処理を行った後の輝度値に基づいてコスト値Cを算出する。具体的には、同じ被写体であれば、視差値導出装置1から遠い位置にある場合は小さく、近い位置にある場合は大きく撮像されることから、シフト量dが小さい(被写体が遠い)場合、サイズの小さいローパスフィルタを用い、シフト量dが大きい(被写体が近い)場合、サイズの大きいローパスフィルタを用いる。このように、シフト量dに大きさに応じて、適用するローパスフィルタのサイズを変えるので、導出される視差値の精度を向上させることができる。   The calculation unit 310b calculates the cost value C of the candidate pixel q based on the luminance values of the reference pixel p and the candidate pixel q after the filter processing by the filter unit 310a using the low-pass filter. As the cost value C calculated by the calculation unit 310b, for example, SAD (Sum of Absolute Differences), SSD (Sum of Squared Differences), or the like can be used. For example, when SAD is used as the cost value C calculated by the calculation unit 310b, the pixel included in this block is assumed when, for example, a 3 × 3 region is assumed as a block, centering on each of the reference pixel p and the candidate pixel q. It is necessary to perform the above-described filtering process by the filter unit 310a for each. And the graph which shows the relationship between the shift amount d and the cost value C calculated by the calculation part 310b is a graph shown in the above-mentioned FIG. 4, for example. In this way, the cost calculation unit 310 does not use the luminance values of the pixels constituting the reference image Ib and the comparison image Ia, but uses a low-pass filter having a size corresponding to the shift amount d for the luminance value. A cost value C is calculated based on the luminance value after performing the filtering process. Specifically, if the subject is the same, the image is small when the subject is far from the parallax value deriving device 1 and is large when the subject is close, so when the shift amount d is small (the subject is far), When a low-pass filter with a small size is used and the shift amount d is large (the subject is close), a low-pass filter with a large size is used. Thus, since the size of the low-pass filter to be applied is changed according to the shift amount d, the accuracy of the derived parallax value can be improved.

コスト合成部320は、基準画像Ibにおける基準画素p(x,y)の周辺の画素を基準画素とした場合のその基準画素についての比較画像Iaにおける画素のコスト値Cを、コスト算出部310により算出された候補画素q(x+d,y)のコスト値C(p,d)に集約させて、候補画素q(x+d,y)の合成コスト値Ls(p,d)(合成一致度)を算出する。コスト合成部320は、図9に示すFPGA31によって実現される。   The cost synthesis unit 320 uses the cost calculation unit 310 to calculate the cost value C of the pixel in the comparison image Ia for the reference pixel when the pixel around the reference pixel p (x, y) in the reference image Ib is the reference pixel. The synthesized cost value Ls (p, d) (synthetic matching degree) of the candidate pixel q (x + d, y) is calculated by aggregating the calculated cost values C (p + d, y) of the candidate pixel q (x + d, y). To do. The cost synthesis unit 320 is realized by the FPGA 31 illustrated in FIG.

具体的には、コスト合成部320は、合成コスト値Lsを算出するために、まず、上述の(式3)によって、所定のr方向の経路コスト値Lr(p,d)を算出する。この場合、(式3)におけるLr(p−r,k)は、基準画素pの座標からr方向に1画素シフトした座標の画素について、シフト量を変化させた場合(この場合のシフト量をkとしている)のそれぞれの経路コスト値Lrを示す。次に、コスト合成部320は、図5に示したように、8方向の経路コスト値LrであるLr、Lr45、Lr90、Lr135、Lr180、Lr225、Lr270およびLr315を算出し、最終的に上述の(式4)に基づいて、合成コスト値Ls(p,d)を算出する。そして、シフト量dと、コスト合成部320により算出された合成コスト値Lsとの関係を示すグラフが、図12に示すグラフである。図12に示すように、合成コスト値Lsは、シフト量d=3のとき最小値となる。 Specifically, in order to calculate the combined cost value Ls, the cost combining unit 320 first calculates a route cost value Lr (p, d) in a predetermined r direction according to the above (Equation 3). In this case, Lr (p−r, k) in (Expression 3) is obtained when the shift amount is changed with respect to the pixel at the coordinate shifted by one pixel in the r direction from the coordinate of the reference pixel p (the shift amount in this case is k)) is shown. Next, as shown in FIG. 5, the cost synthesis unit 320 stores Lr 0 , Lr 45 , Lr 90 , Lr 135 , Lr 180 , Lr 225 , Lr 270 and Lr 315 that are eight-way route cost values Lr. Finally, the combined cost value Ls (p, d) is calculated based on the above (Formula 4). And the graph which shows the relationship between the shift amount d and the synthetic | combination cost value Ls calculated by the cost synthetic | combination part 320 is a graph shown in FIG. As shown in FIG. 12, the synthesis cost value Ls becomes the minimum value when the shift amount d = 3.

サブピクセル推定部330は、コスト合成部320により算出された、基準画像Ibにおける基準画素についての比較画像Iaにおける画素の合成コスト値Lsの最小値(極値)に対応するシフト量d、およびそれに隣接するシフト量dにおける合成コスト値Lsに基づいて、サブピクセル推定を実行する。サブピクセル推定部330は、図9に示すFPGA31によって実現される。図13に示す合成コスト値Lsのグラフは、画素単位のシフト量dに対する合成コスト値Lsのグラフである。したがって、図13に示すグラフの合成コスト値Lsの最小値は、画素単位で区切られたシフト量d=3における合成コスト値Lsということになる。すなわち、図13に示すような画素単位で区切られたシフト量dに対する合成コスト値Lsのグラフにおいては、視差値dpとして画素単位の値を導出することしかできないことになる。ここで、サブピクセル推定とは、視差値dpを画素単位の値ではなく、画素より小さい単位(以下、サブピクセル単位という)で視差値dpを推定して導出するものである。   The sub-pixel estimation unit 330 calculates the shift amount d corresponding to the minimum value (extreme value) of the combined cost value Ls of the pixels in the comparison image Ia for the reference pixel in the reference image Ib calculated by the cost combining unit 320, and Based on the combined cost value Ls in the adjacent shift amount d, subpixel estimation is performed. The sub-pixel estimation unit 330 is realized by the FPGA 31 illustrated in FIG. The graph of the synthesis cost value Ls shown in FIG. 13 is a graph of the synthesis cost value Ls with respect to the shift amount d in pixel units. Therefore, the minimum value of the synthesis cost value Ls in the graph shown in FIG. 13 is the synthesis cost value Ls at the shift amount d = 3 divided in units of pixels. That is, in the graph of the combined cost value Ls with respect to the shift amount d divided in units of pixels as shown in FIG. 13, only a value in units of pixels can be derived as the parallax value dp. Here, the sub-pixel estimation is to derive the parallax value dp by estimating the parallax value dp in a unit smaller than the pixel (hereinafter referred to as sub-pixel unit) instead of the pixel unit value.

まず、図13を参照しながら、サブピクセル推定部330がパラボラフィッティングによるサブピクセル推定を実行する場合について説明する。サブピクセル推定部330は、コスト合成部320によって算出された合成コスト値Lsのグラフ(図12参照)において、合成コスト値Lsが最小となるシフト量dの値を求める。図12の例では、シフト量d=3の場合が、合成コスト値Lsが最小となる。次に、サブピクセル推定部330は、シフト量d=3に隣接するシフト量dを求める。具体的には、シフト量d=2,4である。次に、サブピクセル推定部330は、図12に示すシフト量dと合成コスト値Lsとのグラフにおいて、図13に示すように、シフト量d=2,3,4である3点を通る下に凸の2次曲線を求める。そして、サブピクセル推定部330は、その2次曲線の極小値に対応するサブピクセル単位のシフト量dが視差値dpであると推定する。   First, a case where the subpixel estimation unit 330 performs subpixel estimation by parabolic fitting will be described with reference to FIG. The sub-pixel estimation unit 330 obtains the value of the shift amount d that minimizes the synthesis cost value Ls in the graph of the synthesis cost value Ls calculated by the cost synthesis unit 320 (see FIG. 12). In the example of FIG. 12, the combined cost value Ls is minimum when the shift amount d = 3. Next, the sub-pixel estimation unit 330 obtains a shift amount d adjacent to the shift amount d = 3. Specifically, the shift amount d = 2,4. Next, in the graph of the shift amount d and the combined cost value Ls shown in FIG. 12, the sub-pixel estimation unit 330 passes through three points where the shift amount d = 2, 3, and 4 as shown in FIG. A convex quadratic curve is obtained. Then, the subpixel estimation unit 330 estimates that the shift amount d in subpixel units corresponding to the minimum value of the quadratic curve is the parallax value dp.

次に、図14を参照しながら、サブピクセル推定部330が最小二乗法によるサブピクセル推定を実行する場合について説明する。サブピクセル推定部330は、コスト合成部320によって算出された合成コスト値Lsのグラフ(図12参照)において、合成コスト値Lsが最小となるシフト量dの値を求める。図12の例では、シフト量d=3の場合が、合成コスト値Lsが最小となる。次に、サブピクセル推定部330は、シフト量d=3の近傍の4つのシフト量dを求める。具体的には、シフト量d=1,2,4,5である。次に、サブピクセル推定部330は、図12に示すシフト量dと合成コスト値Lsとのグラフにおいて、図14に示すように、最小二乗法によってシフト量d=1,2,3,4,5である5点の近傍を通る下に凸の2次曲線を求める。そして、サブピクセル推定部330は、その2次曲線の極小値に対応するサブピクセル単位のシフト量dが視差値dpであると推定する。   Next, a case where the subpixel estimation unit 330 performs subpixel estimation by the least square method will be described with reference to FIG. The sub-pixel estimation unit 330 obtains the value of the shift amount d that minimizes the synthesis cost value Ls in the graph of the synthesis cost value Ls calculated by the cost synthesis unit 320 (see FIG. 12). In the example of FIG. 12, the combined cost value Ls is minimum when the shift amount d = 3. Next, the sub-pixel estimation unit 330 obtains four shift amounts d in the vicinity of the shift amount d = 3. Specifically, the shift amount d = 1, 2, 4, 5. Next, as shown in FIG. 14, in the graph of the shift amount d and the combined cost value Ls shown in FIG. 12, the sub-pixel estimation unit 330 uses the least square method to shift the amount d = 1, 2, 3, 4, and so on. A convex quadratic curve passing through the vicinity of 5 points, which is 5, is obtained. Then, the subpixel estimation unit 330 estimates that the shift amount d in subpixel units corresponding to the minimum value of the quadratic curve is the parallax value dp.

サブピクセル推定部330は、図13に示すパラボラフィッティングによるサブピクセル推定、または、図14に示す最小二乗法によるサブピクセル推定のいずれかによって、視差値dpを推定して導出する。これによって、画素より小さい単位であるサブピクセル単位で視差値dpを導出することができるので、精度が高く、かつ密な視差値dpを導出することができる。   The subpixel estimation unit 330 estimates and derives the parallax value dp by either subpixel estimation by parabolic fitting shown in FIG. 13 or subpixel estimation by the least square method shown in FIG. As a result, the parallax value dp can be derived in units of sub-pixels, which is a unit smaller than the pixel, so that it is possible to derive a precise and dense parallax value dp.

なお、サブピクセル推定は、上述のパラボラフィッティングによるもの、または、最小二乗法によるものに限定されるものではなく、その他の方法によってサブピクセル推定を行うものとしてもよい。例えば、サブピクセル推定部330は、図13に示す3点を用いて、2次曲線ではなく、3点を通る等角直線を求めて視差値dpを推定する等角直線フィッティングによりサブピクセル推定を実行するものとしてもよい。   The sub-pixel estimation is not limited to the above-described parabolic fitting or the least-square method, and the sub-pixel estimation may be performed by other methods. For example, the sub-pixel estimation unit 330 uses the three points shown in FIG. 13 to perform sub-pixel estimation by equiangular straight line fitting that obtains a conformal straight line passing through the three points instead of the quadratic curve and estimates the parallax value dp. It may be executed.

また、最小二乗法によるサブピクセル推定において、図14に示すグラフ上の5点を用いて2次曲線を求めるものとしたが、これに限定されるものではなく、異なる数の点を用いて2次曲線を求めるものとしてもよい。   Further, in the sub-pixel estimation by the least square method, the quadratic curve is obtained using five points on the graph shown in FIG. 14, but the present invention is not limited to this, and 2 using a different number of points. A quadratic curve may be obtained.

また、サブピクセル推定部330によるサブピクセル推定によってサブピクセル単位の視差値dpを算出することに限定されるものではなく、サブピクセル推定の実行はせずに、画素単位の視差値dpを算出するものとしてもよい。この場合、サブピクセル推定部330は、コスト合成部320により算出された、基準画像Ibにおける基準画素についての比較画像Iaにおける画素の合成コスト値Lsの最小値に対応するシフト量dを視差値dpとすればよい。   Further, the present invention is not limited to calculating the parallax value dp in units of subpixels by subpixel estimation by the subpixel estimation unit 330. The parallax value dp in units of pixels is calculated without performing the subpixel estimation. It may be a thing. In this case, the sub-pixel estimation unit 330 calculates the shift amount d corresponding to the minimum value of the combined cost value Ls of the pixels in the comparison image Ia for the reference pixel in the reference image Ib calculated by the cost combining unit 320 as the parallax value dp. And it is sufficient.

生成部350は、サブピクセル推定部330により導出されたサブピクセル単位の視差値dpに基づいて、基準画像Ibの各画素の輝度値を、その画素に対応する視差値dpで表した画像である視差画像Ip(高密度視差画像)を生成する。生成部350は、図9に示すFPGA31によって実現される。図15のうち、図15(a)は、比較画像Iaの一例を示し、図15(b)は、基準画像Ibの一例を示し、図15(c)は、生成部350により生成された視差画像Ipの模式図を示す。   The generation unit 350 is an image in which the luminance value of each pixel of the reference image Ib is represented by the parallax value dp corresponding to the pixel based on the sub-pixel unit parallax value dp derived by the sub-pixel estimation unit 330. A parallax image Ip (high-density parallax image) is generated. The generation unit 350 is realized by the FPGA 31 illustrated in FIG. 15A shows an example of the comparison image Ia, FIG. 15B shows an example of the reference image Ib, and FIG. 15C shows the parallax generated by the generation unit 350. A schematic diagram of an image Ip is shown.

なお、コスト算出部310、コスト合成部320、サブピクセル推定部330および生成部350は、FPGA31によって実現、すなわちハードウェア回路によって実現されるものとしたが、これに限定されるものではない。すなわち、コスト算出部310、コスト合成部320、サブピクセル推定部330または生成部350の少なくともいずれかは、ソフトウェアであるプログラムがCPU32によって実行されることにより、実現されてもよい。また、コスト算出部310、コスト合成部320、サブピクセル推定部330および生成部350は、機能を概念的にブロック構成したものであって、このような構成に限定されるものではない。例えば、図10で独立した機能部として図示した複数の機能部を、1つの機能部として構成してもよい。一方、図10の1つの機能部が有する機能を複数の分割し、複数の機能部として構成するものとしてもよい。   In addition, although the cost calculation part 310, the cost synthetic | combination part 320, the subpixel estimation part 330, and the production | generation part 350 were implement | achieved by FPGA31, ie, implement | achieved by the hardware circuit, it is not limited to this. That is, at least one of the cost calculation unit 310, the cost synthesis unit 320, the subpixel estimation unit 330, and the generation unit 350 may be realized by the CPU 32 executing a program that is software. Moreover, the cost calculation part 310, the cost synthetic | combination part 320, the subpixel estimation part 330, and the production | generation part 350 are the block configurations of a function, Comprising: It is not limited to such a structure. For example, a plurality of functional units illustrated as independent functional units in FIG. 10 may be configured as one functional unit. On the other hand, the function of one functional unit in FIG. 10 may be divided into a plurality of parts and configured as a plurality of functional parts.

(視差値導出装置の画像処理動作)
図16は、本実施の形態に係る視差値導出装置のステレオマッチング処理の動作の一例を示すフローチャートである。図16を参照しながら、視差値導出装置1のステレオマッチング処理(SGM法)に基づく画像処理の動作の流れについて説明する。
(Image processing operation of parallax value deriving device)
FIG. 16 is a flowchart illustrating an example of the stereo matching processing operation of the disparity value deriving device according to the present embodiment. The flow of the image processing operation based on the stereo matching process (SGM method) of the parallax value deriving device 1 will be described with reference to FIG.

<ステップS1−1>
視差値導出装置1の画像取得部110は、左のカメラ(撮像部10a)により前方の被写体を撮像して、それぞれアナログ形式の画像データを生成し、その画像データに基づく画像である輝度画像を得る。これによって、後段の画像処理の対象となる画像データが得られることになる。そして、ステップS2−1へ移行する。
<Step S1-1>
The image acquisition unit 110 of the parallax value deriving device 1 images a front subject with the left camera (imaging unit 10a), generates analog image data, and generates a luminance image that is an image based on the image data. obtain. As a result, image data to be subjected to subsequent image processing is obtained. And it transfers to step S2-1.

<ステップS1−2>
視差値導出装置1の画像取得部110は、右のカメラ(撮像部10b)により前方の被写体を撮像して、それぞれアナログ形式の画像データを生成し、その画像データに基づく画像である輝度画像を得る。これによって、後段の画像処理の対象となる画像データが得られることになる。そして、ステップS2−2へ移行する。
<Step S1-2>
The image acquisition unit 110 of the parallax value deriving device 1 images a front subject with the right camera (imaging unit 10b), generates analog image data, and generates a luminance image that is an image based on the image data. obtain. As a result, image data to be subjected to subsequent image processing is obtained. Then, the process proceeds to step S2-2.

<ステップS2−1>
視差値導出装置1の変換部210は、撮像部10aにより撮像されて得られたアナログ形式の画像データに対して、ノイズを除去し、デジタル形式の画像データに変換する。このように、デジタル形式の画像データに変換することによって、その画像データに基づく画像に対して画素ごとの画像処理が可能となる。そして、ステップS3−1へ移行する。
<Step S2-1>
The conversion unit 210 of the parallax value deriving device 1 removes noise from analog image data obtained by imaging by the imaging unit 10a and converts the image data into digital image data. In this way, by converting the image data into digital image data, image processing for each pixel can be performed on an image based on the image data. And it transfers to step S3-1.

<ステップS2−2>
視差値導出装置1の変換部210は、撮像部10bにより撮像されて得られたアナログ形式の画像データに対して、ノイズを除去し、デジタル形式の画像データに変換する。このように、デジタル形式の画像データに変換することによって、その画像データに基づく画像に対して画素ごとの画像処理が可能となる。そして、ステップS3−2へ移行する。
<Step S2-2>
The conversion unit 210 of the parallax value deriving device 1 removes noise from analog image data obtained by imaging by the imaging unit 10b and converts the analog image data into digital image data. In this way, by converting the image data into digital image data, image processing for each pixel can be performed on an image based on the image data. Then, the process proceeds to step S3-2.

<ステップS3−1>
変換部210は、ステップS2−1において変換したデジタル形式の画像データに基づく画像をステレオマッチング処理における比較画像Iaとして出力する。これによって、ステレオマッチング処理において視差値を求めるための比較対象となる画像を得る。そして、ステップS4へ移行する。
<Step S3-1>
The converter 210 outputs an image based on the digital image data converted in step S2-1 as the comparison image Ia in the stereo matching process. Thus, an image to be compared for obtaining a parallax value in the stereo matching process is obtained. Then, the process proceeds to step S4.

<ステップS3−2>
変換部210は、ステップS2−2において変換したデジタル形式の画像データに基づく画像をステレオマッチング処理における基準画像Ibとして出力する。これによって、ステレオマッチング処理において視差値を求めるための基準となる画像を得る。そして、ステップS4へ移行する。
<Step S3-2>
The converter 210 outputs an image based on the digital image data converted in step S2-2 as the reference image Ib in the stereo matching process. Thus, an image serving as a reference for obtaining the parallax value in the stereo matching process is obtained. Then, the process proceeds to step S4.

<ステップS4>
視差値導出装置1のコスト算出部310のフィルタ部310aは、基準画像Ibの基準画素p(x,y)と比較する比較画像Iaの候補画素q(x+d,y)のシフト量dが、閾値Th1未満であるか、閾値Th1以上閾値Th2未満であるか、閾値Th2以上であるかを判定する。
<Step S4>
The filter unit 310a of the cost calculation unit 310 of the parallax value deriving device 1 determines that the shift amount d of the candidate pixel q (x + d, y) of the comparison image Ia to be compared with the reference pixel p (x, y) of the reference image Ib is a threshold value. It is determined whether it is less than Th1, a threshold value Th1 or more and less than a threshold value Th2, or a threshold value Th2 or more.

フィルタ部310aは、シフト量dが閾値Th1未満であると判定した場合、記憶部340から1×1次元、かつ、フィルタ係数が「1」のローパスフィルタを読み出す。そして、フィルタ部310aは、基準画素pおよび候補画素qに対して、読み出したローパスフィルタによるフィルタ処理(コンボリューション演算)を行い、フィルタ処理後の基準画素pおよび候補画素qの輝度値を求める。   When the filter unit 310a determines that the shift amount d is less than the threshold value Th1, the filter unit 310a reads a low-pass filter having 1 × 1 dimension and a filter coefficient of “1” from the storage unit 340. Then, the filter unit 310a performs filter processing (convolution calculation) using the read low-pass filter on the reference pixel p and the candidate pixel q, and obtains the luminance values of the reference pixel p and the candidate pixel q after the filter processing.

また、フィルタ部310aは、シフト量dが閾値Th1以上閾値Th2未満であると判定した場合、記憶部340から1×3次元、かつ、フィルタ係数が「1/3」のローパスフィルタF1を読み出す。そして、フィルタ部310aは、基準画素pおよび候補画素qに対して、読み出したローパスフィルタF1によるフィルタ処理(コンボリューション演算)を行い、フィルタ処理後の基準画素pおよび候補画素qの輝度値を求める。   Further, when the filter unit 310a determines that the shift amount d is greater than or equal to the threshold value Th1 and less than the threshold value Th2, the filter unit 310a reads the low-pass filter F1 having 1 × 3 dimensions and a filter coefficient of “1/3” from the storage unit 340. Then, the filter unit 310a performs a filtering process (convolution calculation) on the reference pixel p and the candidate pixel q using the read low-pass filter F1, and obtains luminance values of the reference pixel p and the candidate pixel q after the filtering process. .

また、フィルタ部310aは、シフト量dが閾値Th2以上であると判定した場合、記憶部340から1×5次元、かつ、フィルタ係数が「1/5」のローパスフィルタF2を読み出す。そして、フィルタ部310aは、基準画素pおよび候補画素qに対して、読み出したローパスフィルタF2によるフィルタ処理(コンボリューション演算)を行い、フィルタ処理後の基準画素pおよび候補画素qの輝度値を求める。   Further, when the filter unit 310a determines that the shift amount d is equal to or greater than the threshold value Th2, the filter unit 310a reads the low-pass filter F2 having 1 × 5 dimensions and a filter coefficient of “1/5” from the storage unit 340. Then, the filter unit 310a performs a filtering process (convolution calculation) on the reference pixel p and the candidate pixel q using the read low-pass filter F2, and obtains luminance values of the reference pixel p and the candidate pixel q after the filtering process. .

視差値導出装置1のコスト算出部310の算出部310bは、フィルタ部310aによりローパスフィルタを用いてフィルタ処理が行われた後の基準画素pおよび候補画素qの輝度値に基づいて、候補画素qのコスト値Cを算出する。   The calculation unit 310b of the cost calculation unit 310 of the parallax value derivation device 1 uses the candidate pixel q based on the luminance values of the reference pixel p and the candidate pixel q after the filter processing by the filter unit 310a using the low-pass filter. The cost value C is calculated.

このように、コスト算出部310は、基準画像Ibおよび比較画像Iaを構成する画素の輝度値そのものを使用するのではなく、この輝度値に対して、シフト量dに応じたサイズのローパスフィルタによるフィルタ処理を行った後の輝度値に基づいてコスト値Cを算出する。そして、ステップS5へ移行する。   In this way, the cost calculation unit 310 does not use the luminance values of the pixels constituting the reference image Ib and the comparison image Ia, but uses a low-pass filter having a size corresponding to the shift amount d for the luminance value. A cost value C is calculated based on the luminance value after performing the filtering process. Then, the process proceeds to step S5.

<ステップS5>
視差値導出装置1のコスト合成部320は、基準画像Ibにおける基準画素p(x,y)の周辺の画素を基準画素とした場合のその基準画素についての比較画像Iaにおける画素のコスト値Cを、コスト算出部310により算出された候補画素q(x+d,y)のコスト値C(p,d)に集約させて、候補画素q(x+d,y)の合成コスト値Ls(p,d)を算出する。このように、コスト合成部320は、コスト算出部310によりローパスフィルタを用いて算出されたコスト値Cを用いて合成コスト値Lsを算出する。そして、ステップS6へ移行する。
<Step S5>
The cost composition unit 320 of the parallax value deriving device 1 calculates the cost value C of the pixel in the comparison image Ia for the reference pixel when the pixel around the reference pixel p (x, y) in the reference image Ib is used as the reference pixel. Then, the cost value C (p, d) of the candidate pixel q (x + d, y) calculated by the cost calculation unit 310 is aggregated to obtain the combined cost value Ls (p, d) of the candidate pixel q (x + d, y). calculate. Thus, the cost synthesis unit 320 calculates the synthesis cost value Ls using the cost value C calculated by the cost calculation unit 310 using the low-pass filter. Then, the process proceeds to step S6.

<ステップS6>
視差値導出装置1のサブピクセル推定部330は、コスト合成部320により算出された、基準画像Ibにおける基準画素についての比較画像Iaにおける画素の合成コスト値Lsの最小値に対応するシフト量dに隣接するシフト量dにおける合成コスト値Lsに基づいて、サブピクセル推定を実行する。サブピクセル推定部330は、サブピクセル推定によって求めた近似曲線(図13および図14においては下に凸の2次曲線)の極小値に対応するサブピクセル単位のシフト量dが視差値dpであると推定する。推定された視差値dpは、比較画像Iaにおける基準画素pに対応する被写体の部分までの距離を示す値となる。そして、ステップS7へ移行する。
<Step S6>
The sub-pixel estimation unit 330 of the parallax value deriving device 1 calculates the shift amount d corresponding to the minimum value of the combined cost value Ls of the pixels in the comparison image Ia for the reference pixel in the reference image Ib calculated by the cost combining unit 320. Based on the combined cost value Ls in the adjacent shift amount d, subpixel estimation is performed. The sub-pixel estimation unit 330 has the parallax value dp as the shift amount d in sub-pixel units corresponding to the minimum value of the approximate curve obtained by sub-pixel estimation (the downwardly convex quadratic curve in FIGS. 13 and 14). Estimated. The estimated parallax value dp is a value indicating the distance to the portion of the subject corresponding to the reference pixel p in the comparison image Ia. Then, the process proceeds to step S7.

<ステップS7>
視差値導出装置1の生成部350は、サブピクセル推定部330により導出されたサブピクセル単位の視差値dpに基づいて、基準画像Ibの各画素の輝度値を、その画素に対応する視差値dpで表した画像である視差画像Ip(高密度視差画像)を生成する。
<Step S7>
The generation unit 350 of the parallax value deriving device 1 determines the luminance value of each pixel of the reference image Ib based on the sub-pixel unit parallax value dp derived by the sub-pixel estimation unit 330, and the parallax value dp corresponding to the pixel. A parallax image Ip (high-density parallax image) that is an image represented by

その後、図9に示されている通信I/F35を介して、視差画像Ipの画像データが出力され、視差値導出装置1の外部の装置(例えば、制御装置5)によって、視差画像Ipに基づき撮像部10a、10bと物体との間の距離が算出される。算出された距離は、別プロセスで行われる物体認識処理の結果と併せて、車両のブレーキまたはステアリング等の制御に利用される。   Thereafter, the image data of the parallax image Ip is output via the communication I / F 35 illustrated in FIG. 9, and is based on the parallax image Ip by a device outside the parallax value deriving device 1 (for example, the control device 5). A distance between the imaging units 10a and 10b and the object is calculated. The calculated distance is used for controlling the brake or steering of the vehicle together with the result of the object recognition process performed in a separate process.

(本実施の形態の主な効果)
以上のように、本実施の形態に係る視差値導出装置1のコスト算出部310は、基準画像Ibおよび比較画像Iaを構成する画素の輝度値そのものを使用するのではなく、この輝度値に対して、シフト量dに応じたローパスフィルタによるフィルタ処理を行った後の輝度値に基づいてコスト値Cを算出するものとしている。具体的には、同じ被写体であれば、視差値導出装置1から遠い位置にある場合は小さく、近い位置にある場合は大きく撮像されることから、シフト量dが小さい(被写体が遠い)場合、サイズの小さいローパスフィルタを用い、シフト量dが大きい(被写体が近い)場合、サイズの大きいローパスフィルタを用いる。これによって、シフト量dの大きさに応じて、適用するローパスフィルタのサイズを変えるので、導出される視差値の精度を向上させることができる。
(Main effects of this embodiment)
As described above, the cost calculation unit 310 of the parallax value deriving device 1 according to the present embodiment does not use the luminance values of the pixels constituting the reference image Ib and the comparison image Ia, but instead uses the luminance values. Thus, the cost value C is calculated on the basis of the luminance value after the filter processing by the low-pass filter corresponding to the shift amount d. Specifically, if the subject is the same, the image is small when the subject is far from the parallax value deriving device 1 and is large when the subject is close, so when the shift amount d is small (the subject is far), When a low-pass filter with a small size is used and the shift amount d is large (the subject is close), a low-pass filter with a large size is used. As a result, the size of the low-pass filter to be applied is changed according to the magnitude of the shift amount d, so that the accuracy of the derived parallax value can be improved.

また、視差値導出装置1において、サブピクセル推定部330は、画素より小さい単位であるサブピクセル単位で視差値dpを導出することができるので、精度が高く、かつ密な視差値dpを導出することができ、より正確な視差画像を得ることができる。   Further, in the parallax value deriving device 1, the sub-pixel estimation unit 330 can derive the parallax value dp in units of sub-pixels, which is a unit smaller than the pixel, and therefore derives a high-precision and dense parallax value dp. And a more accurate parallax image can be obtained.

なお、上述の実施の形態では、コスト合成部320は、コスト算出部310によりローパスフィルタを用いて算出されたコスト値Cを用いて合成コスト値Lsを算出し、この合成コスト値Lsに基づいて視差値dpが求められるものとしているが、これに限定されるものではない。すなわち、コスト合成部320によりローパスフィルタを用いて算出されたコスト値Cに基づいて視差値dpが求められるものとしてもよい。これによっても、導出される視差値の精度の向上が期待できる。ただし、コスト合成部320により、基準画素pの周辺の画素を基準画素とした場合のその基準画素についての比較画像Iaにおける画素のコスト値Cを、コスト算出部310により算出された候補画素qのコスト値C(p,d)に集約させて、候補画素qの合成コスト値Ls(p,d)が算出される場合、累積的に視差値の精度の向上が期待できる。   In the above-described embodiment, the cost synthesis unit 320 calculates the synthesis cost value Ls using the cost value C calculated by the cost calculation unit 310 using the low-pass filter, and based on the synthesis cost value Ls. Although the parallax value dp is obtained, the present invention is not limited to this. That is, the parallax value dp may be obtained based on the cost value C calculated by the cost synthesis unit 320 using a low-pass filter. This can also be expected to improve the accuracy of the derived parallax value. However, the cost value C of the pixel in the comparison image Ia for the reference pixel when the pixel around the reference pixel p is set as the reference pixel by the cost composition unit 320 is calculated using the candidate pixel q calculated by the cost calculation unit 310. When the synthesis cost value Ls (p, d) of the candidate pixel q is calculated by being aggregated into the cost value C (p, d), it can be expected that the accuracy of the parallax value is cumulatively improved.

また、上述の実施の形態では、一致度としてのコスト値Cは非類似度を表す評価値としているが、類似度を表す評価値であってもよい。この場合、合成コスト値Lsがサブピクセル単位で最大(極値)となるシフト量dが視差値dpとなる。   In the above-described embodiment, the cost value C as the degree of coincidence is an evaluation value that represents the degree of dissimilarity, but may be an evaluation value that represents the degree of similarity. In this case, the shift amount d at which the combined cost value Ls is maximum (extreme value) in subpixel units is the parallax value dp.

また、上述の実施の形態では、説明の簡略化のために、画素単位でのマッチングで説明したが、これに限定されるものではなく、複数の画素からなる所定領域単位でマッチングされてもよい。この場合、基準画素を含む所定領域は基準領域として示され、対応画素を含む所定領域は対応領域として示され、対応画素の候補画素は候補領域として示される。また、この基準領域には基準画素のみの場合も含まれ、対応領域には対応画素のみの場合も含まれ、候補領域には候補画素のみの場合も含まれる。   Further, in the above-described embodiment, for simplification of description, description has been made on matching in units of pixels. However, the present invention is not limited to this, and matching may be performed in units of a predetermined region including a plurality of pixels. . In this case, the predetermined area including the reference pixel is indicated as the reference area, the predetermined area including the corresponding pixel is indicated as the corresponding area, and the candidate pixel of the corresponding pixel is indicated as the candidate area. The reference area includes the case of only the reference pixel, the corresponding area includes the case of only the corresponding pixel, and the candidate area includes the case of only the candidate pixel.

また、上述の実施の形態では、視差値導出装置1の外部の機器(例えば、制御装置5)が視差画像(視差値)に基づき、距離Zを算出しているが、これに限定されるものではなく、画像処理部30のCPU32が距離Zを算出するものとしてもよい。   In the above-described embodiment, the device (for example, the control device 5) outside the parallax value deriving device 1 calculates the distance Z based on the parallax image (parallax value). However, the present invention is not limited to this. Instead, the CPU 32 of the image processing unit 30 may calculate the distance Z.

また、上述の実施の形態では、車両100としての自動車に搭載される視差値導出装置1について説明したが、これに限定されるものではない。例えば、他の車両の一例としてバイク、自転車、車椅子または農業用の耕運機等の車両に搭載されるものとしてもよい。また、移動体の一例としての車両だけでなく、ロボット等の移動体であってもよい。   Moreover, although the above-mentioned embodiment demonstrated the parallax value derivation | leading-out apparatus 1 mounted in the motor vehicle as the vehicle 100, it is not limited to this. For example, it may be mounted on a vehicle such as a motorcycle, bicycle, wheelchair, or agricultural cultivator as an example of another vehicle. In addition to a vehicle as an example of a moving body, a moving body such as a robot may be used.

さらに、ロボットは、移動体だけでなく、FA(Factory Automation)において固定設置される工業用ロボット等の装置であってもよい。また、固定設置される装置としては、ロボットだけでなく、防犯用の監視カメラ等であってもよい。   Furthermore, the robot may be an apparatus such as an industrial robot that is fixedly installed in an FA (Factory Automation) as well as a moving body. Further, the device to be fixedly installed may be not only a robot but also a surveillance camera for security.

なお、視差値導出装置1の変換部210、フィルタ部310a、算出部310b、コスト合成部320、サブピクセル推定部330、および生成部350の少なくともいずれかがプログラムの実行によって実現される場合、そのプログラムは、ROM等に予め組み込まれて提供される。本実施の形態の視差値導出装置1で実行されるプログラムは、インストール可能な形式または実行可能な形式のファイルでCD−ROM、フレキシブルディスク(FD)、CD−R、DVD等のコンピュータで読み取り可能な記録媒体に記録して提供するように構成してもよい。また、本実施の形態の視差値導出装置1で実行されるプログラムを、インターネット等のネットワークに接続されたコンピュータ上に格納し、ネットワーク経由でダウンロードさせることにより提供するように構成してもよい。また、本実施の形態の視差値導出装置1で実行されるプログラムを、インターネット等のネットワーク経由で提供または配布するように構成してもよい。本実施の形態の視差値導出装置1で実行されるプログラムは、上述した各機能部のうち少なくともいずれかを含むモジュール構成となっており、実際のハードウェアとしてはCPU32が上述のROM33からプログラムを読み出して実行することにより、上述の各機能部が主記憶装置(RAM34等)上にロードされて生成されるようになっている。   When at least one of the conversion unit 210, the filter unit 310a, the calculation unit 310b, the cost synthesis unit 320, the subpixel estimation unit 330, and the generation unit 350 of the parallax value derivation device 1 is realized by executing a program, The program is provided by being incorporated in advance in a ROM or the like. The program executed by the disparity value deriving device 1 according to the present embodiment is an installable or executable file and can be read by a computer such as a CD-ROM, flexible disk (FD), CD-R, or DVD. The recording medium may be recorded and provided. Further, the program executed by the disparity value deriving device 1 according to the present embodiment may be configured to be provided by being stored on a computer connected to a network such as the Internet and downloaded via the network. The program executed by the disparity value deriving device 1 according to the present embodiment may be configured to be provided or distributed via a network such as the Internet. The program executed by the parallax value deriving device 1 according to the present embodiment has a module configuration including at least one of the above-described functional units. As actual hardware, the CPU 32 downloads the program from the ROM 33 described above. By reading and executing, each functional unit described above is loaded on the main storage device (RAM 34 or the like) and generated.

1 視差値導出装置
2 本体
5 制御装置
6 ステアリングホイール
7 ブレーキペダル
10a、10b 撮像部
11a、11b 撮像レンズ
12a、12b 絞り
13a、13b 画像センサ
20a、20b 信号変換部
21a、21b CDS
22a、22b AGC
23a、23b ADC
24a、24b フレームメモリ
30 画像処理部
31 FPGA
32 CPU
33 ROM
34 RAM
35 通信I/F
39 バス
50 機器制御システム
100 車両
110 画像取得部
210 変換部
310 コスト算出部
310a フィルタ部
310b 算出部
320 コスト合成部
330 サブピクセル推定部
340 記憶部
350 生成部
510a、510b 撮像装置
511a、511b 撮像レンズ
B 基線長
C コスト値
d、d1、d2 シフト量
dp 視差値
E 物体
EL エピポーラ線
f 焦点距離
F1、F2 ローパスフィルタ
Ia 比較画像
Ib 基準画像
Ip 視差画像
Lr 経路コスト値
Ls 合成コスト値
S、Sa、Sb 点
Th1、Th2 閾値
Z 距離
DESCRIPTION OF SYMBOLS 1 Parallax value derivation | leading-out apparatus 2 Main body 5 Control apparatus 6 Steering wheel 7 Brake pedal 10a, 10b Imaging part 11a, 11b Imaging lens 12a, 12b Aperture 13a, 13b Image sensor 20a, 20b Signal conversion part 21a, 21b CDS
22a, 22b AGC
23a, 23b ADC
24a, 24b Frame memory 30 Image processing unit 31 FPGA
32 CPU
33 ROM
34 RAM
35 Communication I / F
39 bus 50 device control system 100 vehicle 110 image acquisition unit 210 conversion unit 310 cost calculation unit 310a filter unit 310b calculation unit 320 cost synthesis unit 330 subpixel estimation unit 340 storage unit 350 generation unit 510a, 510b imaging device 511a, 511b imaging lens B Baseline length C Cost value d, d1, d2 Shift amount dp Parallax value E Object EL Epipolar line f Focal length F1, F2 Low-pass filter Ia Comparison image Ib Reference image Ip Disparity image Lr Path cost value Ls Composite cost value S, Sa, Sb point Th1, Th2 threshold Z distance

特開2012−198077号公報JP 2012-198077 A

Claims (13)

第1撮像手段が被写体を撮像することにより得られた基準画像、および前記第1撮像手段の位置とは異なる位置の第2撮像手段が前記被写体を撮像することにより得られた比較画像に基づいて、前記被写体に対する視差を示す視差値を導出する視差値導出装置であって、
前記基準画像の第1基準領域と、前記比較画像における前記第1基準領域に相当する領域から所定のシフト量でシフトすることにより特定される、前記第1基準領域に対応する前記比較画像での対応領域の候補となる複数の候補領域と、に対して前記シフト量に応じたサイズのローパスフィルタによるフィルタ処理を行うフィルタリング手段と、
前記フィルタリング手段により前記フィルタ処理が行われた前記第1基準領域と、該フィルタ処理が行われた前記複数の候補領域それぞれとの一致度を算出する算出手段と、
前記一致度に基づいて、前記第1基準領域と前記対応領域との前記視差値を導出する導出手段と、
を備えた視差値導出装置。
Based on a reference image obtained by imaging the subject by the first imaging means and a comparative image obtained by imaging the subject by the second imaging means at a position different from the position of the first imaging means. A parallax value deriving device for deriving a parallax value indicating parallax with respect to the subject,
The first reference area of the reference image and the comparison image corresponding to the first reference area identified by shifting by a predetermined shift amount from an area corresponding to the first reference area in the comparison image. Filtering means for performing a filtering process with a low-pass filter having a size corresponding to the shift amount with respect to a plurality of candidate areas that are candidates for corresponding areas;
Calculating means for calculating a degree of coincidence between the first reference area on which the filtering process has been performed by the filtering means and each of the plurality of candidate areas on which the filtering process has been performed;
Derivation means for deriving the parallax value between the first reference area and the corresponding area based on the degree of coincidence;
A parallax value deriving device comprising:
前記フィルタリング手段は、前記第1基準領域の輝度値と、前記複数の候補領域の輝度値と、に対して前記ローパスフィルタによるフィルタ処理を行い、
前記算出手段は、前記フィルタ処理が行われた前記第1基準領域の輝度値と、該フィルタ処理が行われた前記複数の候補領域の輝度値と、に基づいて該複数の候補領域それぞれの前記一致度を算出し、
前記導出手段は、前記比較画像における前記各候補領域の前記一致度に基づく値の極値に対応する前記シフト量に基づいて前記視差値を導出する請求項1に記載の視差値導出装置。
The filtering means performs a filtering process by the low-pass filter on the luminance value of the first reference region and the luminance values of the plurality of candidate regions,
The calculation means is configured to calculate the luminance value of each of the plurality of candidate areas based on the luminance value of the first reference area on which the filtering process has been performed and the luminance value of the plurality of candidate areas on which the filtering process has been performed. Calculate the degree of match,
The parallax value deriving device according to claim 1, wherein the deriving unit derives the parallax value based on the shift amount corresponding to the extreme value of the value based on the degree of coincidence of the candidate regions in the comparison image.
前記フィルタリング手段は、前記シフト量が小さいほど、サイズの小さい前記ローパスフィルタにより前記フィルタ処理を行い、前記シフト量が大きいほど、サイズの大きい前記ローパスフィルタにより前記フィルタ処理を行う請求項1または2に記載の視差値導出装置。   3. The filtering unit according to claim 1, wherein the filtering unit performs the filter process with the low-pass filter having a smaller size as the shift amount is smaller, and performs the filter process with the low-pass filter having a larger size as the shift amount is larger. The parallax value deriving device described. 前記ローパスフィルタは、一次元のフィルタである請求項1〜3のいずれか一項に記載の視差値導出装置。   The parallax value deriving device according to claim 1, wherein the low-pass filter is a one-dimensional filter. 前記フィルタリング手段は、前記シフト量が所定値未満である場合、前記フィルタ処理を行わない請求項1〜4のいずれか一項に記載の視差値導出装置。   The parallax value deriving device according to claim 1, wherein the filtering unit does not perform the filtering process when the shift amount is less than a predetermined value. 前記第1基準領域の周辺の第2基準領域についての前記比較画像における一致度を、前記複数の候補領域の一致度に集約させて、該複数の候補領域それぞれについて合成一致度を求める合成手段を、さらに備え、
前記導出手段は、前記合成一致度に基づいて、前記第1基準領域と前記対応領域との前記視差値を導出する請求項1〜5のいずれか一項に記載の視差値導出装置。
A synthesizing unit that aggregates the matching degrees in the comparison image for the second reference area around the first reference area into the matching degrees of the plurality of candidate areas and obtains a synthesis matching degree for each of the plurality of candidate areas And more,
The parallax value deriving device according to claim 1, wherein the deriving unit derives the parallax value between the first reference area and the corresponding area based on the composite matching degree.
前記ローパスフィルタを予め記憶した記憶手段を、さらに備えた請求項1〜6のいずれか一項に記載の視差値導出装置。   The parallax value deriving device according to any one of claims 1 to 6, further comprising storage means for storing the low-pass filter in advance. 前記導出手段は、前記比較画像における前記各候補領域の前記一致度に基づく値の極値に対応する前記シフト量を含む隣接した複数の前記シフト量に基づいて、サブピクセル推定により前記視差値を導出する請求項1〜7のいずれか一項に記載の視差値導出装置。   The deriving means calculates the parallax value by sub-pixel estimation based on a plurality of adjacent shift amounts including the shift amount corresponding to the extreme value of the value based on the degree of coincidence of each candidate region in the comparison image. The parallax value deriving device according to claim 1, wherein the parallax value deriving device is derived. 請求項1〜8のいずれか一項に記載の視差値導出装置と、
前記視差値導出装置によって導出される前記視差値により求まる前記視差値導出装置から被写体までの距離情報によって、制御対象を制御する制御装置と、
を備えた機器制御システム。
The parallax value deriving device according to any one of claims 1 to 8,
A control device that controls a control target based on distance information from the parallax value deriving device to a subject that is obtained from the parallax value derived by the parallax value deriving device;
Equipment control system equipped with.
請求項9に記載の機器制御システムを備えた移動体。   A moving body comprising the device control system according to claim 9. 請求項9に記載の機器制御システムを備えたロボット。   A robot comprising the device control system according to claim 9. 第1撮像手段が被写体を撮像することにより得られた基準画像、および前記第1撮像手段の位置とは異なる位置の第2撮像手段が前記被写体を撮像することにより得られた比較画像に基づいて、前記被写体に対する視差を示す視差値を導出する視差値導出方法であって、
前記基準画像の第1基準領域と、前記比較画像における前記第1基準領域に相当する領域から所定のシフト量でシフトすることにより特定される、前記第1基準領域に対応する前記比較画像での対応領域の候補となる複数の候補領域と、に対して前記シフト量に応じたサイズのローパスフィルタによるフィルタ処理を行うフィルタリングステップと、
前記フィルタ処理を行った前記第1基準領域と、該フィルタ処理を行った前記複数の候補領域それぞれとの一致度を算出する算出ステップと、
前記一致度に基づいて、前記第1基準領域と前記対応領域との前記視差値を導出する導出ステップと、
を有する視差値導出方法。
Based on a reference image obtained by imaging the subject by the first imaging means and a comparative image obtained by imaging the subject by the second imaging means at a position different from the position of the first imaging means. A parallax value derivation method for deriving a parallax value indicating parallax with respect to the subject,
The first reference area of the reference image and the comparison image corresponding to the first reference area identified by shifting by a predetermined shift amount from an area corresponding to the first reference area in the comparison image. A filtering step of performing a filtering process with a low-pass filter having a size corresponding to the shift amount with respect to a plurality of candidate areas that are candidates for corresponding areas;
A calculation step of calculating a degree of coincidence between the first reference area subjected to the filtering process and each of the plurality of candidate areas subjected to the filtering process;
A derivation step for deriving the parallax value between the first reference area and the corresponding area based on the degree of coincidence;
A method for deriving a disparity value.
第1撮像手段が被写体を撮像することにより得られた基準画像、および前記第1撮像手段の位置とは異なる位置の第2撮像手段が前記被写体を撮像することにより得られた比較画像に基づいて、前記被写体に対する視差を示す視差値を導出するためのプログラムであって、
前記基準画像の第1基準領域と、前記比較画像における前記第1基準領域に相当する領域から所定のシフト量でシフトすることにより特定される、前記第1基準領域に対応する前記比較画像での対応領域の候補となる複数の候補領域と、に対して前記シフト量に応じたサイズのローパスフィルタによるフィルタ処理を行うフィルタリング手段と、
前記フィルタリング手段により前記フィルタ処理が行われた前記第1基準領域と、該フィルタ処理が行われた前記複数の候補領域それぞれとの一致度を算出する算出手段と、
前記一致度に基づいて、前記第1基準領域と前記対応領域との前記視差値を導出する導出手段と、
をコンピュータに実現させるためのプログラム。
Based on a reference image obtained by imaging the subject by the first imaging means and a comparative image obtained by imaging the subject by the second imaging means at a position different from the position of the first imaging means. , A program for deriving a parallax value indicating parallax with respect to the subject,
The first reference area of the reference image and the comparison image corresponding to the first reference area identified by shifting by a predetermined shift amount from an area corresponding to the first reference area in the comparison image. Filtering means for performing a filtering process with a low-pass filter having a size corresponding to the shift amount with respect to a plurality of candidate areas that are candidates for corresponding areas;
Calculating means for calculating a degree of coincidence between the first reference area on which the filtering process has been performed by the filtering means and each of the plurality of candidate areas on which the filtering process has been performed;
Derivation means for deriving the parallax value between the first reference area and the corresponding area based on the degree of coincidence;
A program to make a computer realize.
JP2014256658A 2014-12-18 2014-12-18 Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program Expired - Fee Related JP6459482B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014256658A JP6459482B2 (en) 2014-12-18 2014-12-18 Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014256658A JP6459482B2 (en) 2014-12-18 2014-12-18 Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program

Publications (2)

Publication Number Publication Date
JP2016118830A JP2016118830A (en) 2016-06-30
JP6459482B2 true JP6459482B2 (en) 2019-01-30

Family

ID=56243037

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014256658A Expired - Fee Related JP6459482B2 (en) 2014-12-18 2014-12-18 Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program

Country Status (1)

Country Link
JP (1) JP6459482B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3182009B2 (en) * 1992-12-24 2001-07-03 日本電信電話株式会社 Binocular stereoscopic device
WO2009101798A1 (en) * 2008-02-12 2009-08-20 Panasonic Corporation Compound eye imaging device, distance measurement device, parallax calculation method and distance measurement method
CN103593851B (en) * 2009-03-31 2017-11-28 松下知识产权经营株式会社 Stereo image processor
JP4782899B2 (en) * 2009-07-22 2011-09-28 パナソニック株式会社 Parallax detection device, distance measuring device, and parallax detection method
JP6048574B2 (en) * 2013-03-29 2016-12-21 株式会社ニコン Image processing apparatus, imaging apparatus, and image processing program
JP6202367B2 (en) * 2013-05-14 2017-09-27 株式会社リコー Image processing device, distance measurement device, mobile device control system, mobile device, and image processing program

Also Published As

Publication number Publication date
JP2016118830A (en) 2016-06-30

Similar Documents

Publication Publication Date Title
JP6565188B2 (en) Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program
US9378553B2 (en) Stereo image processing device for vehicle
JP6417886B2 (en) Parallax value deriving device, moving body, robot, parallax value production method, and program
JP6202367B2 (en) Image processing device, distance measurement device, mobile device control system, mobile device, and image processing program
JP6561512B2 (en) Parallax value deriving device, moving body, robot, parallax value deriving method, parallax value producing method, and program
JP6337504B2 (en) Image processing apparatus, moving body, robot, device control method and program
WO2017138245A1 (en) Image processing device, object recognition device, device control system, and image processing method and program
JP6589313B2 (en) Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program
JP6543935B2 (en) PARALLEL VALUE DERIVING DEVICE, DEVICE CONTROL SYSTEM, MOBILE OBJECT, ROBOT, PARALLEL VALUE DERIVING METHOD, AND PROGRAM
JP6455164B2 (en) Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program
JP2019511780A (en) Method for detecting an object near a road of a motor vehicle, computer device, driver assistance system, and motor vehicle
WO2016063545A1 (en) Stereo camera apparatus and vehicle provided with stereo camera apparatus
JP2016152027A (en) Image processing device, image processing method and program
JP6519138B2 (en) PARALLEL VALUE DERIVING DEVICE, MOBILE OBJECT, ROBOT, PARALLEL VALUE PRODUCTION METHOD, AND PROGRAM
JP6561511B2 (en) Parallax value deriving device, moving body, robot, parallax value production deriving method, parallax value producing method and program
CN107924570A (en) Method for the vision system and control vision system of motor vehicles
JP6387710B2 (en) Camera system, distance measuring method, and program
JP6459482B2 (en) Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program
JP6515547B2 (en) PARALLEL VALUE DERIVING DEVICE, DEVICE CONTROL SYSTEM, MOBILE OBJECT, ROBOT, PARALLEL VALUE PRODUCTION METHOD, AND PROGRAM
JP6442911B2 (en) Parallax value deriving device, moving object, robot, parallax value deriving method, and program
JP6701738B2 (en) Parallax value deriving device, parallax value deriving method and program
JP2023157660A (en) Image processing apparatus and image processing method
JP2015195019A (en) Disparity deriving apparatus, movable apparatus, robot, method of deriving disparity, method of producing disparity, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20171206

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20181107

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: 20181204

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20181217

R151 Written notification of patent or utility model registration

Ref document number: 6459482

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees