JP6251099B2 - Distance calculation device - Google Patents
Distance calculation device Download PDFInfo
- Publication number
- JP6251099B2 JP6251099B2 JP2014060285A JP2014060285A JP6251099B2 JP 6251099 B2 JP6251099 B2 JP 6251099B2 JP 2014060285 A JP2014060285 A JP 2014060285A JP 2014060285 A JP2014060285 A JP 2014060285A JP 6251099 B2 JP6251099 B2 JP 6251099B2
- Authority
- JP
- Japan
- Prior art keywords
- vanishing point
- line
- parallax
- point parallax
- straight line
- 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
Links
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
- Measurement Of Optical Distance (AREA)
Description
本発明は、複数のカメラにより撮影された画像を用いて対象物までの距離を算出する距離算出装置に関する。 The present invention relates to a distance calculation device that calculates a distance to an object using images taken by a plurality of cameras.
車載ステレオカメラにより撮影された一方の画像における画素ブロックと、その画素ブロックと相関を有する他方の画像における画素ブロックとの視差に基づき、三角測量の原理を用いて対象物までの距離を算出することが行われている。距離を正確に算出するためには、視差以外の位置的なずれがステレオカメラ画像に存在しないことが望ましいが、ステレオカメラの取り付け精度に起因する位置的なずれや、振動等で生じた位置的なずれが存在する。特に、水平方向の並進ずれは、視差の誤差となって表れるため、距離の算出誤差の要因となる。そこで、ステレオカメラの水平方向の並進ずれに起因した誤差を補正して、対象物までの距離を算出する装置が提案されている。 Calculate the distance to the object using the principle of triangulation based on the parallax between the pixel block in one image taken by the in-vehicle stereo camera and the pixel block in the other image correlated with the pixel block Has been done. In order to calculate the distance accurately, it is desirable that there is no positional shift other than parallax in the stereo camera image, but the positional shift caused by the positional shift caused by the mounting accuracy of the stereo camera, vibration, etc. There is a gap. Particularly, the translational deviation in the horizontal direction appears as a parallax error, which causes a distance calculation error. In view of this, there has been proposed an apparatus that corrects an error caused by translational displacement in the horizontal direction of a stereo camera and calculates a distance to an object.
例えば、特許文献1は、ステレオカメラにより得られた一方の画像平面において、距離方向に延在する互いに平行な近似直線の交点から第1消失点を算出するとともに、同様にして他方の画像平面から第2消失点を算出している。そして、第1消失点と第2消失点とのずれ量から消失点視差を算出し、算出した消失点視差を用いて算出距離を補正している。 For example, Patent Document 1 calculates a first vanishing point from the intersection of approximate straight lines extending in the distance direction in one image plane obtained by a stereo camera, and similarly from the other image plane. A second vanishing point is calculated. Then, the vanishing point parallax is calculated from the shift amount between the first vanishing point and the second vanishing point, and the calculated distance is corrected using the calculated vanishing point parallax.
特許文献1では、距離方向に延在する白線が道路の左右に存在し、左右の白線対は互いに平行であることが多いことから、距離方向に延在する白線から算出した近似直線が互いに平行であることを仮定して、消失点視差を算出している。しかしながら、道路面がうねっていた場合などには、近似直線対に互いに平行ではないものも含まれるおそれがある。近似直線対に互いに平行でないものが含まれている場合、消失点視差の算出精度が低下するとともに、距離の算出精度が低下するおそれがある。 In Patent Document 1, white lines extending in the distance direction exist on the left and right sides of the road, and pairs of white lines on the left and right are often parallel to each other. Therefore, approximate straight lines calculated from the white lines extending in the distance direction are parallel to each other. Assuming that the vanishing point parallax is calculated. However, when the road surface is wavy, there is a possibility that the approximate straight line pair is not parallel to each other. If the approximate straight line pair includes those that are not parallel to each other, the calculation accuracy of the vanishing point parallax may be lowered and the calculation accuracy of the distance may be reduced.
本発明は、上記実情に鑑み、距離の算出精度を向上させることが可能な距離算出装置を提供することを主たる目的とする。 In view of the above circumstances, the present invention has as its main object to provide a distance calculation device capable of improving the distance calculation accuracy.
上記課題を解決するため、本発明は、距離算出装置であって、道路を含む周辺環境を撮影する複数の画像撮影装置と、前記複数の画像撮影装置により撮影された一対の画像に基づいて、視差を算出する視差算出手段と、前記画像において、前記道路の左右の境界線を構成するエッジ点を抽出する境界線抽出手段と、前記境界線抽出手段により抽出された前記エッジ点に基づき、前記左右の境界線を近似する所定長の線分である近似直線を算出する近似直線算出手段と、前記一対の画像における消失点視差の値を変えながら、各消失点視差について、前記近似直線算出手段により算出された前記左右の近似直線のうちの一方の前記近似直線の第1端から他方の前記近似直線を含む直線へ下ろした垂線の足と、前記第1端と対応する前記他方の近似直線の第2端との一致度を算出する一致度算出手段と、前記一致度算出手段により算出された前記一致度のうちの最も高い前記一致度に対応する前記消失点視差を、前記一対の画像における消失点視差として決定する消失点視差決定手段と、前記視差算出手段により算出された視差、及び前記消失点視差決定手段により決定された消失点視差に基づいて、対象物までの距離を算出する距離算出手段と、を備える。 In order to solve the above problems, the present invention is a distance calculation device based on a plurality of image capturing devices that capture a surrounding environment including a road and a pair of images captured by the plurality of image capturing devices. Based on the parallax calculation means for calculating the parallax, the boundary line extraction means for extracting the edge points constituting the left and right boundary lines of the road in the image, and the edge points extracted by the boundary line extraction means, Approximate straight line calculating means for calculating an approximate straight line that is a line segment of a predetermined length that approximates the left and right boundary lines, and the approximate straight line calculating means for each vanishing point parallax while changing the value of the vanishing point parallax in the pair of images. Of the right and left approximate straight lines calculated by the above, the foot of a perpendicular line dropped from the first end of one of the approximate straight lines to the straight line including the other approximate straight line, and the vicinity of the other corresponding to the first end A degree of coincidence calculating means for calculating the degree of coincidence with the second end of the straight line, and the vanishing point parallax corresponding to the highest degree of coincidence calculated by the degree of coincidence calculating means A vanishing point parallax determining unit that determines the vanishing point parallax in the image, a parallax calculated by the parallax calculating unit, and a vanishing point parallax determined by the vanishing point parallax determining unit are calculated. And a distance calculating means.
本発明によれば、複数の画像撮影装置により撮影された一対の画像に基づいて、視差が算出される。また、画像から、道路の左右の境界線を構成するエッジ点が抽出される。そして、抽出されたエッジ点に基づき、左右の境界線を近似する所定長の線分である近似直線が算出される。 According to the present invention, the parallax is calculated based on a pair of images captured by a plurality of image capturing devices. In addition, edge points constituting the left and right boundary lines of the road are extracted from the image. Based on the extracted edge points, an approximate straight line that is a line segment of a predetermined length that approximates the left and right boundary lines is calculated.
ここで、消失点視差が間違っていると、本来平行ではない左右の近似直線が平行になったり、本来平行の左右の近似直線が平行でなくなったりする。そこで、消失点視差の値が変えられながら、各消失点視差について、算出された左右の近似直線のうちの一方の近似直線の第1端から他方の近似直線を含む直線へ下ろした垂線の足と、第1端と対応する他方の近似直線の第2端との一致度が算出される。そして、算出された一致度のうちの最も高い一致度に対応する消失点視差が、一対の画像における消失点視差として決定される。 Here, if the vanishing point parallax is wrong, the left and right approximate straight lines that are not originally parallel may become parallel, or the originally parallel left and right approximate straight lines may not be parallel. Therefore, for each vanishing point parallax, while the value of the vanishing point parallax is changed, the foot of a perpendicular line dropped from the first end of one of the calculated approximate straight lines to the straight line including the other approximate straight line And the degree of coincidence between the second end of the other approximate line corresponding to the first end. Then, the vanishing point parallax corresponding to the highest matching degree among the calculated matching degrees is determined as the vanishing point parallax in the pair of images.
左右の近似直線が実空間において真に平行で、消失点視差が真の値である場合、左右の近似直線のうちの一方の近似直線の第1端から他方へ下ろした垂線の足と、他方の近似直線の第2端とは一致し、一致度は最も高くなる。よって、算出された一致度のうちの最も高い一致度に対応する消失点視差が、正しい消失点視差として選択され、一対の画像における消失点視差として決定される。これにより、消失点視差の算出精度を向上させることができる。さらに、算出された視差、及び決定された消失点視差に基づいて、対象物までの距離が算出される。したがって、消失点視差の算出精度を向上させることができ、ひいては、距離の算出精度を向上させることができる。 When the left and right approximate lines are truly parallel in real space and the vanishing point parallax is a true value, the vertical leg that is lowered from the first end of one of the left and right approximate lines to the other, and the other Coincides with the second end of the approximate straight line, and the degree of coincidence is the highest. Therefore, the vanishing point parallax corresponding to the highest matching degree among the calculated matching degrees is selected as the correct vanishing point parallax and determined as the vanishing point parallax in the pair of images. Thereby, the calculation accuracy of vanishing point parallax can be improved. Further, the distance to the object is calculated based on the calculated parallax and the determined vanishing point parallax. Accordingly, the vanishing point parallax calculation accuracy can be improved, and the distance calculation accuracy can be improved.
以下、距離算出装置を具現化した実施形態について、図面を参照しつつ説明する。まず、図1を参照して、本実施形態に係る距離算出装置10の構成について説明する。距離算出装置10は、一対の画像撮影装置20、及び画像処理装置30を備える。 Hereinafter, an embodiment embodying a distance calculation device will be described with reference to the drawings. First, with reference to FIG. 1, the structure of the distance calculation apparatus 10 which concerns on this embodiment is demonstrated. The distance calculation device 10 includes a pair of image capturing devices 20 and an image processing device 30.
一対の画像撮影装置20は、CCDやCMOSセンサ、あるいは赤外線カメラ等のイメージセンサを内蔵したステレオカメラであり、一方はメインカメラ21、他方はサブカメラ22となる。メインカメラ21及びサブカメラ22は、それぞれ、ルームミラーの右端と左端に、車幅方向において所定のカメラ基線長で取り付けられ、通常の走行状態において車両前方の道路や先行車両等を含む周辺環境を撮影する。 The pair of image capturing devices 20 is a stereo camera with a built-in image sensor such as a CCD or CMOS sensor, or an infrared camera. One is a main camera 21 and the other is a sub camera 22. The main camera 21 and the sub camera 22 are attached to the right end and the left end of the rearview mirror with a predetermined camera base line length in the vehicle width direction, respectively. Take a picture.
メインカメラ21は、基準画像信号を出力し、サブカメラ22は、比較画像信号を出力する。メインカメラ21及びサブカメラ22は、互いに同期が取れており、同一タイミングで周辺環境を撮影し、一対のアナログ画像データを画像処理装置30へ出力する。 The main camera 21 outputs a reference image signal, and the sub camera 22 outputs a comparison image signal. The main camera 21 and the sub camera 22 are synchronized with each other, capture the surrounding environment at the same timing, and output a pair of analog image data to the image processing device 30.
画像処理装置30は、CPU、RAM、ROM及びI/O等から構成されたマイクロコンピュータ、A/D変換回路から構成され、画像平行化部40、境界線抽出部50、視差算出部60、補正量算出部70、及び距離算出部80の機能を実現する。 The image processing apparatus 30 includes a microcomputer configured by a CPU, a RAM, a ROM, an I / O, and the like, an A / D conversion circuit, an image parallelizing unit 40, a boundary line extracting unit 50, a parallax calculating unit 60, a correction. The functions of the quantity calculation unit 70 and the distance calculation unit 80 are realized.
画像平行化部40は、画像撮影装置20から入力された一対のアナログ画像データを、A/D変換回路により、それぞれ所定の輝度階調のデジタル画像データに変換する。さらに、画像平行化部40は、一対のデジタル画像データを、メインカメラ21及びサブカメラ22の姿勢とレンズのひずみ係数とで補正して、一対のデジタル画像を平行化する。これにより、一対のデジタル画像、すなわちステレオ画像におけるエピポーライン(水平線)が一致するとともに、エピポーラインがu軸(図3(a)参照)に平行になる。ステレオ画像におけるエピポーラインの一致は、ステレオマッチングの精度を確保するために必要となる。画像平行化部40により補正されたステレオ画像は、視差算出部60及び境界線抽出部50へ出力される。 The image collimator 40 converts the pair of analog image data input from the image capturing device 20 into digital image data having a predetermined luminance gradation by an A / D conversion circuit. Further, the image collimating unit 40 corrects the pair of digital image data with the posture of the main camera 21 and the sub camera 22 and the distortion coefficient of the lens, and parallelizes the pair of digital images. Thereby, the epipo line (horizontal line) in a pair of digital images, that is, a stereo image is coincident, and the epipo line is parallel to the u axis (see FIG. 3A). The coincidence of epipolines in a stereo image is necessary to ensure the accuracy of stereo matching. The stereo image corrected by the image collimator 40 is output to the parallax calculator 60 and the boundary line extractor 50.
視差算出部60は、ステレオ画像に基づいて視差dを算出する。視差dは、同じ対象物をメインカメラ21及びサブカメラ22により撮影した際に、メインカメラ21の画像(基準画像)における対象物の位置と、サブカメラ22の画像(参照画像)における対象物の位置との差である。視差算出部60は、基準画像において、例えば4×4ピクセルのピクセルブロック毎に、1つの視差dを算出する。 The parallax calculation unit 60 calculates the parallax d based on the stereo image. The parallax d indicates the position of the object in the image (standard image) of the main camera 21 and the object in the image (reference image) of the sub camera 22 when the same object is photographed by the main camera 21 and the sub camera 22. It is the difference from the position. The disparity calculating unit 60 calculates one disparity d for each pixel block of 4 × 4 pixels in the reference image, for example.
視差dは、図2に示すように、画像撮影装置20の近傍ほど大きく、遠方ほど小さくなる。そして、理論的には、ステレオ画像の消失点における視差である消失点視差d0は0になる。すなわち、理論的には、ステレオ画像において消失点の位置は一致する。 As shown in FIG. 2, the parallax d increases as the distance from the image capturing device 20 increases, and decreases as the distance increases. Theoretically, the vanishing point parallax d0 that is the parallax at the vanishing point of the stereo image is zero. That is, theoretically, the positions of the vanishing points coincide in the stereo image.
画像撮影装置20は、車両への初期搭載時に、平行化後のステレオ画像において、消失点視差d0が0になるように構成されている。しかしながら、車両の振動等により画像撮影装置20の位置にずれが生じ、消失点視差d0が0でなくなることがある。消失点視差d0が小さい場合は、ステレオ画像のマッチング率には影響を与えないが、三角測量の原理を用いて算出する対象物までの距離に影響を与える。そのため、三角測量の原理を用いて対象物までの距離を算出する際には、視差dを、消失点視差d0の分だけ補正する必要がある(図3(b)参照)。消失点視差d0の詳しい算出方法は後述する。 The image capturing device 20 is configured such that the vanishing point parallax d0 becomes 0 in the parallelized stereo image when initially mounted on the vehicle. However, the position of the image capturing device 20 may be shifted due to vibrations of the vehicle and the vanishing point parallax d0 may not be zero. When the vanishing point parallax d0 is small, the stereo image matching rate is not affected, but the distance to the object calculated using the triangulation principle is affected. For this reason, when calculating the distance to the object using the principle of triangulation, it is necessary to correct the parallax d by the vanishing point parallax d0 (see FIG. 3B). A detailed method for calculating the vanishing point parallax d0 will be described later.
距離算出部80は、視差算出部60により算出された視差d、及び後述する消失点視差決定部73により決定された消失点視差d0に基づいて、車両から対象物までの距離を算出する。詳しくは、図3(a)に示すように、基準画像において座標軸u,vを設定した場合、距離算出部80は、基準画像における対象物の座標(u,v,d)を、図3(b)に示すように、消失点視差d0を用いて、実空間の座標(X,Y,Z)に変換する。そして、距離算出部80は、対象物の実空間上の座標(X,Y,Z)から、実空間における距離を算出する。 The distance calculation unit 80 calculates the distance from the vehicle to the object based on the parallax d calculated by the parallax calculation unit 60 and the vanishing point parallax d0 determined by the vanishing point parallax determination unit 73 described later. Specifically, as shown in FIG. 3A, when the coordinate axes u and v are set in the reference image, the distance calculation unit 80 determines the coordinates (u, v, d) of the object in the reference image as shown in FIG. As shown in b), the vanishing point parallax d0 is used to convert to real space coordinates (X, Y, Z). Then, the distance calculation unit 80 calculates the distance in the real space from the coordinates (X, Y, Z) of the object in the real space.
次に、消失点視差d0の算出方法について説明する。高精度に消失点視差d0を求めるためには、実空間において互いに平行な直線を一組見つける必要がある。そこで、境界線抽出部50及び補正量算出部70では、左右の境界線を構成するエッジ点を抽出し、抽出したエッジ点に基づいて近似直線のペアを複数算出する。さらに、消失点視差d0を変えながら、各消失点視差d0において、算出した複数の線分ペアの中から最も平行性の高い線分ペアを選択する。選択した線分ペアの一方の端Aから他方の線分を含む直線へ下ろした垂線の足と、端Aと対応する他方の線分の端Bとの一致度Mを算出する。そして、最も一致度Mが高い線分ペアに対応する消失点視差d0を、ステレオ画像における消失点視差d0とする。以下、詳しく説明する。 Next, a method for calculating the vanishing point parallax d0 will be described. In order to obtain the vanishing point parallax d0 with high accuracy, it is necessary to find a set of straight lines parallel to each other in the real space. Therefore, the boundary line extraction unit 50 and the correction amount calculation unit 70 extract edge points constituting the left and right boundary lines, and calculate a plurality of approximate straight line pairs based on the extracted edge points. Further, while changing the vanishing point parallax d0, the line segment pair having the highest parallelism is selected from the plurality of calculated line segment pairs for each vanishing point parallax d0. The degree of coincidence M between the leg of the perpendicular line drawn from one end A of the selected line segment pair to the straight line including the other line segment and the end B of the other line segment corresponding to the end A is calculated. Then, the vanishing point parallax d0 corresponding to the line segment pair having the highest matching degree M is set as the vanishing point parallax d0 in the stereo image. This will be described in detail below.
境界線抽出部50は、基準画像の所定領域内(図4参照)において、例えば、縦16×横64ピクセルのピクセルブロックごとに1点を取得し、取得した点に基づいて、3次元Hough変換で道路面の式を算出する。また、境界線抽出部50は、基準画像において、道路の左右の境界線を構成するエッジ点を抽出する。詳しくは、境界線抽出部50は、基準画像において、左端から水平方向にアップエッジ点を探索する。そして、境界線抽出部50は、探索したエッジ点に基づいて、道路上にある白線対を表す直線を2次元Hough変換で検出する。白線対を表す直線は、基準画像内にある傾きが正の直線及び負の直線のそれぞれから、含まれるエッジ点が最も多い直線である。 The boundary line extraction unit 50 acquires, for example, one point for each pixel block of 16 × 64 pixels within a predetermined region of the reference image (see FIG. 4), and performs a three-dimensional Hough transform based on the acquired points. To calculate the road surface formula. In addition, the boundary line extraction unit 50 extracts edge points constituting the left and right boundary lines of the road in the reference image. Specifically, the boundary line extraction unit 50 searches for an up-edge point in the horizontal direction from the left end in the reference image. And the boundary line extraction part 50 detects the straight line showing the white line pair on a road by two-dimensional Hough transformation based on the searched edge point. The straight line representing the white line pair is a straight line having the largest number of edge points from each of the positive and negative straight lines in the reference image.
さらに、図4に示すように、画像撮影装置20の近傍の所定領域をエッジ抽出領域とする。この所定領域には、2次元Hough変換で検出された右側の破線の白線を表す線分と、同様に検出された左側の直線の白線を表す直線とが含まれる。そして、境界線抽出部50は、高精度にエッジ点を抽出するため、2次元Hough変換で検出した左右の白線のおおよその傾きに対して、それぞれ垂直な方向にエッジを持つピクセルほどエッジ強度が強くなるフィルタを、基準画像の輝度データにかけ、左右のエッジ点をそれぞれ抽出する(図5(a)のハッチング部分)。さらに、境界線抽出部50は、フィルタをかけて算出した左右のエッジ点のうち、エッジ強度が閾値以上のエッジ点を、道路の左右の境界線を構成するエッジ点としてそれぞれ抽出する(図5(b)の白抜き部分)。このように、白線に対して垂直な方向にエッジ点を探索することにより、画像の水平方向にエッジ点を検索する場合よりも、高精度に白線の輪郭が検出される。 Further, as shown in FIG. 4, a predetermined area near the image capturing device 20 is set as an edge extraction area. This predetermined area includes a line segment representing the right broken white line detected by the two-dimensional Hough transform and a straight line representing the left detected white line. In order to extract edge points with high accuracy, the boundary line extraction unit 50 has a higher edge strength for pixels having edges in directions perpendicular to the approximate inclination of the left and right white lines detected by the two-dimensional Hough transform. The filter that becomes stronger is applied to the luminance data of the reference image, and the left and right edge points are respectively extracted (hatched portions in FIG. 5A). Further, the boundary line extraction unit 50 extracts edge points having edge strengths equal to or higher than a threshold value from among the left and right edge points calculated by filtering as edge points constituting the left and right boundary lines of the road (FIG. 5). (Outlined part of (b)). Thus, by searching for the edge point in the direction perpendicular to the white line, the outline of the white line is detected with higher accuracy than when searching for the edge point in the horizontal direction of the image.
補正量算出部70は、近似直線算出部71、一致度算出部72、消失点視差決定部73、及び信頼度算出部74を備え、視差dの補正量すなわち消失点視差d0を算出する。 The correction amount calculation unit 70 includes an approximate straight line calculation unit 71, a coincidence calculation unit 72, a vanishing point parallax determination unit 73, and a reliability calculation unit 74, and calculates a correction amount of the parallax d, that is, the vanishing point parallax d0.
信頼度算出部74は、画像撮影装置20の近傍を撮影したピクセルの画像データほど信頼度を高く算出する。信頼度は、あるピクセルの画像データが、真の値である確率に相当する。一般に、画像撮影装置20の近傍を撮影したピクセルの画像データほど、真の値である確率は高く、遠方を撮影したピクセルの画像データほど、真の値である確率は低い。 The reliability calculation unit 74 calculates a higher reliability for the image data of the pixel that has captured the vicinity of the image capturing device 20. The reliability corresponds to the probability that the image data of a certain pixel is a true value. In general, the probability of a true value is higher as the pixel image data is captured in the vicinity of the image capturing device 20, and the probability of a true value is lower as the pixel image data is captured far away.
近似直線算出部71は、境界線抽出部50により抽出されたエッジ強度が閾値以上の左右のエッジ点に基づき、左右の白線の近似直線を算出する。近似直線算出部71は、まず、右側の破線の白線を表す線分を近似する近似直線(第1直線)を算出する。詳しくは、近似直線算出部71は、境界線抽出部50により抽出された右側のエッジ点を、信頼度算出部74により算出された信頼度で重み付けする。そして、近似直線算出部71は、重み付けした右側のエッジ点について、最小二乗法により、右側の線分を近似する近似直線の式(図6(b)参照)を算出する。αrx、αry、βrx、及びβryは係数である。 The approximate straight line calculation unit 71 calculates the approximate straight line of the left and right white lines based on the left and right edge points whose edge intensity extracted by the boundary line extraction unit 50 is equal to or greater than the threshold value. The approximate straight line calculation unit 71 first calculates an approximate straight line (first straight line) that approximates a line segment that represents a white broken line on the right side. Specifically, the approximate line calculation unit 71 weights the right edge point extracted by the boundary line extraction unit 50 with the reliability calculated by the reliability calculation unit 74. Then, the approximate straight line calculation unit 71 calculates an approximate straight line formula (see FIG. 6B) that approximates the right line segment by the least square method for the weighted right edge point. αrx, αry, βrx, and βry are coefficients.
次に、近似直線算出部71は、境界線抽出部50により抽出された左側のエッジ点から、図6(a)に示すように、右側の線分と同じ長さの線分を複数切り出す。実際の道路では、長い直線道路は少なく、カーブしていたりうねっていたりする道路が多い。カーブしていたりうねっていたりする道路の白線を、長い直線で近似すると、実空間において互いに平行な直線をみつけられないおそれがある。そのため、近似直線算出部71は、左側の長い直線を構成するエッジ点から、右側の線分と同じ長さの短い線分を複数切り出す。 Next, the approximate straight line calculation unit 71 cuts out a plurality of line segments having the same length as the right line segment from the left edge point extracted by the boundary line extraction unit 50, as shown in FIG. In actual roads, there are few long straight roads, and there are many roads that are curved or undulating. If the white line of a curved or wavy road is approximated by a long straight line, there is a risk that straight lines parallel to each other may not be found in real space. Therefore, the approximate straight line calculation unit 71 cuts out a plurality of short line segments having the same length as the right line segment from the edge points constituting the long left straight line.
そして、近似直線算出部71は、境界線抽出部50により抽出された左側のエッジ点を、信頼度で重み付けし、信頼度で重み付けした左側のエッジ点について、最小二乗法により、複数の線分のそれぞれを近似する近似直線(第2直線)の式(図6(c)参照)を算出する。詳しくは、近似直線算出部71は、境界線抽出部50により抽出された左側のエッジ点において、手前側から奥方向に1ピクセルずつずらしながら、右側の線分と同じ長さの線分を切り出し、それぞれの線分を近似する近似直線の式を算出する。本実施形態では、左側で80本の線分を切り出したとする。この場合、左側のそれぞれの線分と右側の線分とで、80個の線分ペアができる。また、この場合、左側の近似直線の係数、αlx、αly、βlx、及びβlyは、それぞれ80個算出される。 Then, the approximate straight line calculation unit 71 weights the left edge point extracted by the boundary line extraction unit 50 with reliability, and the left edge point weighted with reliability uses a least square method to obtain a plurality of line segments. An approximate straight line (second straight line) equation (see FIG. 6C) is calculated. Specifically, the approximate straight line calculation unit 71 cuts out a line segment having the same length as the right line segment while shifting the left edge point extracted by the boundary line extraction unit 50 pixel by pixel from the near side to the back direction. Then, an approximate straight line equation that approximates each line segment is calculated. In the present embodiment, it is assumed that 80 line segments are cut out on the left side. In this case, 80 line segment pairs are formed by the left line segment and the right line segment. In this case, 80 coefficients of the approximate straight line on the left side, αlx, αly, βlx, and βly are each calculated.
なお、左右の白線がどちらも長い直線の場合は、一方の白線を構成するエッジ点から所定長の線分を切り出し、所定長の線分の近似直線を算出する。そして、他方の白線を構成するエッジ点から所定長の線分を複数切り出し、各線分の近似直線をそれぞれ算出する。 When both the left and right white lines are long straight lines, a predetermined length line segment is cut out from the edge points constituting one of the white lines, and an approximate straight line is calculated. Then, a plurality of line segments of a predetermined length are cut out from the edge points constituting the other white line, and approximate lines for each line segment are calculated.
ここで、実空間で平行な線分ペア(図7(a)参照)を近似した近似直線において、消失点視差d0を誤った値に変化させると、線分ペアが平行ではなくなる(図7(b)参照)。逆に、実空間で平行でない線分ペアを近似する近似直線において、消失点視差d0を誤った値に変化させることにより、線分ペアが平行になることもある。誤った消失点視差d0の値で線分ペアが平行になっている場合、線分ペアの進行方向の位置はずれるため、一方の線分の近傍側の端から他方の線分を含む直線へ下ろした垂線の足は、他方の線分の近傍側の端とずれる。これに対して、真の消失点視差d0で線分ペアが平行になっている場合、一方の線分の近傍側の端から他方の線分を含む直線へ下ろした垂線の足と、他方の線分の近傍側の端とが一致する線分ペアが存在する。このような線分ペアを、実空間において真に平行な線分ペアとする。そして、消失点視差d0の値を変化させて、実空間において真に平行な線分ペアに最も近い線分ペアの一組を探し、探した線分ペアに対応する消失点視差d0を、ステレオ画像の消失点視差d0と決定する。 Here, when the vanishing point parallax d0 is changed to an incorrect value in an approximate straight line approximating a pair of line segments parallel to each other in real space (see FIG. 7A), the line segment pairs are not parallel (FIG. 7 ( b)). Conversely, in an approximate straight line that approximates a pair of line segments that are not parallel in real space, the line segment pair may be parallel by changing the vanishing point parallax d0 to an incorrect value. When the line segment pair is parallel with the wrong vanishing point parallax d0, the position of the line segment pair in the traveling direction shifts, so it is lowered from the end near one line segment to a straight line including the other line segment. The leg of the vertical line is shifted from the end on the near side of the other line segment. On the other hand, when the line segment pair is parallel with the true vanishing point parallax d0, the leg of the perpendicular line dropped from the end near one line segment to the straight line including the other line segment, and the other There exists a line segment pair whose end on the vicinity side of the line segment coincides. Such a line segment pair is a line segment pair that is truly parallel in real space. Then, by changing the value of the vanishing point parallax d0, a pair of line segments closest to a truly parallel line segment pair in the real space is searched, and the vanishing point parallax d0 corresponding to the found line segment pair is determined as stereo. The vanishing point parallax d0 of the image is determined.
そこで、近似直線算出部71は、右側の線分の近似直線を算出するとともに、左側の複数の線分の近似直線をそれぞれ算出する。さらに、近似直線算出部71は、算出した左側の複数の近似直線の係数を平滑化し、特異点を減らして近似直線の係数を真の値に近づける。詳しくは、手前側の線分から順に係数を並べて平滑化する。図8(a)は、左側の複数の近似直線の係数αlxを、手前側から順に並べた図である。近似直線算出部71は、線分ペア番号が小さい方から順に係数αlxを平滑化する。 Therefore, the approximate straight line calculation unit 71 calculates an approximate straight line on the right line segment and calculates an approximate straight line on the left side of the plurality of line segments. Further, the approximate straight line calculation unit 71 smoothes the calculated coefficients of the plurality of approximate straight lines on the left side, reduces singular points, and brings the approximate straight line coefficients close to the true value. Specifically, smoothing is performed by arranging coefficients in order from the line segment on the front side. FIG. 8A is a diagram in which the coefficients αlx of a plurality of approximate straight lines on the left are arranged in order from the front side. The approximate line calculation unit 71 smoothes the coefficient αlx in order from the smallest line segment pair number.
平滑化方法は、どのような方法でもよいが、例えば、図8(a)に示す係数αlxについて線形補間をし、線形補間した係数αlxについて移動平均を行うことにより平滑化する。図8(b)は、平滑化した係数αlxを示す。このように平滑化することにより、実際の道路の滑らかな勾配に対応して、滑らかに変化する係数αlxが得られる。また、近似直線算出部71は、同様にして、係数αly,βlx,βlyについても平滑化を行う。以上により、80個の線分ペアの近似直線が算出される。 Any smoothing method may be used. For example, linear interpolation is performed on the coefficient αlx shown in FIG. 8A, and smoothing is performed by performing a moving average on the linearly interpolated coefficient αlx. FIG. 8B shows the smoothed coefficient αlx. By smoothing in this way, a coefficient αlx that smoothly changes corresponding to the smooth slope of the actual road is obtained. Similarly, the approximate line calculation unit 71 smoothes the coefficients αly, βlx, βly as well. Thus, an approximate straight line of 80 line segment pairs is calculated.
一致度算出部72は、消失点視差d0の値を、−3〜3まで0.05[pix]刻みで変化させ、各消失点視差d0について、近似直線算出部71により算出された線分ペアの中から、最も平行性の高い線分ペアを決定する。具体的には、一致度算出部72は、各消失点視差d0について、αlxd0+βlx=αrxd0+βrx、及びαlyd0+βly=αryd0+βry(平行条件)を満たす線分ペアを、最も平行性の高い線分ペアに決定する。直線道路では複数の線分ペアが平行条件を満たす。複数の線分ペアが平行条件を満たす場合は、複数の線分ペアを最も平行性の高い線分ペアに決定する。 The degree of coincidence calculation unit 72 changes the value of the vanishing point parallax d0 from −3 to 3 in steps of 0.05 [pix], and for each vanishing point parallax d0, the line segment pair calculated by the approximate line calculation unit 71 The pair of line segments with the highest parallelism is determined from among the above. Specifically, for each vanishing point parallax d0, the degree-of-match calculation unit 72 determines the line segment pair that satisfies αlxd0 + βlx = αrxd0 + βrx and αlyd0 + βly = αryd0 + βry (parallel condition) as the line segment pair with the highest parallelism. On straight roads, multiple line pairs satisfy the parallel condition. When a plurality of line segment pairs satisfy the parallel condition, the plurality of line segment pairs are determined as the line segment pair having the highest parallelism.
そして、一致度算出部72は、各消失点視差d0について、決定した線分ペアの一致度Mを算出する。図9(a)に示すように、左右の線分ペアが平行で、消失点視差d0が真の値のときは、右側の線分の端A(第1端)から左側の線分を含む直線に向けて下ろした垂線の足が、左側の線分の端B(第2端)に一致する線分ペアが存在する。端Aと端Bは、それぞれ右側の線分の近傍側の端と左側の線分の近傍側の端で対応している。この場合、左側の線分の近似直線に向けて右側の線分のどこから垂線を下ろしても、垂線の長さLiと道路の幅Wとは一致する。 Then, the matching degree calculation unit 72 calculates the matching degree M of the determined line segment pair for each vanishing point parallax d0. As shown in FIG. 9A, when the left and right line segment pairs are parallel and the vanishing point parallax d0 is a true value, the left line segment from the end A (first end) of the right line segment is included. There is a line segment pair in which the leg of the perpendicular line drawn down toward the straight line coincides with the end B (second end) of the left line segment. The end A and the end B correspond to an end near the right line segment and an end near the left line segment, respectively. In this case, the length Li of the perpendicular line and the width W of the road are the same regardless of where the perpendicular line is drawn from the right line segment toward the approximate straight line on the left line segment.
一方、図9(b),(c)に示すように、消失点視差d0の値が誤っているときは、右側の線分の端Aから左側の線分を含む直線に向けて下ろした垂線の足は、左側の線分の端Bからずれる。そこで、一致度算出部72は、端Aから下ろした垂線の足と、端Bとのずれ量を数値化し、これを一致度Mとする。ずれ量が小さいほど、一致度Mは高くなる。なお、線分の遠方側の端のデータよりも、近傍側の端のデータの方が信頼度が高いので、一致度Mの算出には、線分の近傍側の端を用いるとよい。 On the other hand, as shown in FIGS. 9B and 9C, when the value of the vanishing point parallax d0 is incorrect, the perpendicular is drawn from the end A of the right line segment toward the straight line including the left line segment. Is shifted from the end B of the left line segment. Therefore, the coincidence calculation unit 72 digitizes the amount of deviation between the leg of the perpendicular drawn from the end A and the end B, and sets this as the coincidence M. The smaller the deviation amount, the higher the matching degree M. It should be noted that since the data at the end on the near side has higher reliability than the data at the end on the far side of the line segment, it is preferable to use the end on the near side of the line segment for calculation of the matching degree M.
消失点視差決定部73は、一致度算出部72により算出された一致度Mのうち、最も高い一致度Mに対応する消失点視差d0を、すなわち真に平行な線分ペアに最も近い線分ペアに対応する消失点視差d0を、ステレオ画像における消失点視差d0として決定する。図10(a)に、消失点視差d0ごとに選択した線分ペアの一致度Mをプロットした図を示す。また、図10(b)に、図10(a)において、一致度Mが高い領域を拡大した図を示す。図10(b)に示すように、一致度Mが最も高くなるのは、消失点視差d0が0.25のときである。よって、この場合、消失点視差決定部73は、ステレオ画像における消失点視差d0を0.25と決定する。 The vanishing point parallax determining unit 73 selects the vanishing point parallax d0 corresponding to the highest matching degree M among the matching degrees M calculated by the matching degree calculating unit 72, that is, the line segment closest to the truly parallel line segment pair. The vanishing point parallax d0 corresponding to the pair is determined as the vanishing point parallax d0 in the stereo image. FIG. 10A is a diagram in which the degree of coincidence M of the pair of line segments selected for each vanishing point parallax d0 is plotted. FIG. 10B shows an enlarged view of the region where the degree of coincidence M is high in FIG. As shown in FIG. 10B, the coincidence degree M is highest when the vanishing point parallax d0 is 0.25. Therefore, in this case, the vanishing point parallax determining unit 73 determines the vanishing point parallax d0 in the stereo image as 0.25.
さらに、消失点視差決定部73は、時間的に連続した複数の異なる時点において、撮影されたステレオ画像のそれぞれに対して消失点視差d0を決定し、決定した複数の消失点視差d0に基づいて、距離算出部80が用いる消失点視差d0を統計的に決定する。消失点視差d0を決定する時間間隔は、画像処理装置30の処理能力に応じて設定する。 Further, the vanishing point parallax determining unit 73 determines a vanishing point parallax d0 for each of the captured stereo images at a plurality of different time points that are temporally continuous, and based on the determined plurality of vanishing point parallaxes d0. The vanishing point parallax d0 used by the distance calculation unit 80 is statistically determined. The time interval for determining the vanishing point parallax d0 is set according to the processing capability of the image processing device 30.
具体的には、消失点視差決定部73は、複数のステレオ画像のそれぞれに対して決定した消失点視差d0について、消失点視差d0に対応する左右の線分ペアの間隔と道路の幅Wとの偏差が、最も小さくなる道路の幅W0を用いて、例えば、K-means法によりグループ化する(図12参照)。そして、消失点視差決定部は、グループごとに統計した結果に基づいて、距離算出部80が用いる消失点視差d0に決定する。詳しくは、消失点視差決定部73は、各グループの分散を求め、分散の大きいグループを外れ値として除外し、分散の小さいグループの平均値を、距離算出部80が用いる消失点視差d0に決定する。 Specifically, for the vanishing point parallax d0 determined for each of the plurality of stereo images, the vanishing point parallax determining unit 73 determines the interval between the left and right line segment pairs corresponding to the vanishing point parallax d0, the width W of the road, and the like. Are grouped by, for example, the K-means method using the width W0 of the road with the smallest deviation (see FIG. 12). And a vanishing point parallax determination part determines to the vanishing point parallax d0 which the distance calculation part 80 uses based on the result statistics for every group. Specifically, the vanishing point parallax determination unit 73 obtains the variance of each group, excludes the group having a large variance as an outlier, and determines the average value of the group having a small variance as the vanishing point parallax d0 used by the distance calculation unit 80. To do.
以下に、各ステレオ画像について決定した消失点視差d0について、消失点視差d0に対応する左右の線分ペアの間隔との偏差が、最も小さくなる道路の幅W0の算出方法について説明する。消失点視差決定部73は、各線分ペアについて、右側の近似直線から、左側の近似直線を含む直線へ向けて下ろした垂線の長さLiと、道路の幅Wとの偏差に基づいて、平行度Eを算出する。まず、消失点視差決定部73は、垂線の長さLiを算出する。詳しくは、図11(a)に示すように、右側の近似直線上の点Pri(ur,vr,dr)を通る垂直面と、左側の近似直線との交点Pli(ul,vl,dl)を算出し、点Priと点Pliとの距離を算出する。この距離が、垂線の長さLiとなる。 In the following, a method for calculating the width W0 of the road where the deviation between the vanishing point parallax d0 determined for each stereo image and the interval between the left and right line segment pairs corresponding to the vanishing point parallax d0 is the smallest will be described. The vanishing point parallax determining unit 73 performs parallel processing for each line segment pair based on the deviation between the length Li of the perpendicular line drawn from the right approximate line toward the straight line including the left approximate line and the width W of the road. The degree E is calculated. First, the vanishing point parallax determination unit 73 calculates the length Li of the perpendicular. Specifically, as shown in FIG. 11A, an intersection Pli (ul, vl, dl) between a vertical plane passing through a point Pri (ur, vr, dr) on the right approximate line and the left approximate line is represented. And the distance between the point Pri and the point Pli is calculated. This distance is the perpendicular length Li.
消失点視差決定部73は、右側の線分の近傍側の端Aから遠方側の端までの間で、点Priの位置を1ピクセルずつ奥方向へずらしながら左側の近似直線へ垂線を下ろし、各垂線の長さLiを算出する。よって、垂線の長さLiは、右側の線分に含まれるピクセル数分算出される。なお、点Priの位置を、所定数のピクセルずつ奥方向へずらしながら、左側の近似直線へ垂線を下ろしてもよい。 The vanishing point parallax determination unit 73 lowers the perpendicular to the approximate straight line on the left side while shifting the position of the point Pri one pixel at a time between the vicinity end A and the far end on the right side of the line segment, The length Li of each perpendicular is calculated. Therefore, the length Li of the perpendicular is calculated for the number of pixels included in the right line segment. Note that a perpendicular line may be dropped to the approximate straight line on the left side while shifting the position of the point Pri by a predetermined number of pixels in the depth direction.
次に、消失点視差決定部73は、図11(b)に示す式を用いて平行度Eを算出する。具体的には、消失点視差決定部73は、各垂線の長さLiと道路の幅Wとの偏差の2乗値を算出し、各偏差の2乗値を、信頼度算出部74により算出された信頼度Viの逆数で重み付けする。消失点視差決定部73は、信頼度Viの逆数で重み付けした各偏差の2乗値を、すべて加算して平行度Eを算出する。 Next, the vanishing point parallax determination unit 73 calculates the parallelism E using the formula shown in FIG. Specifically, the vanishing point parallax determination unit 73 calculates the square value of the deviation between the length Li of each perpendicular and the width W of the road, and calculates the square value of each deviation by the reliability calculation unit 74. Weighting is performed by the reciprocal of the reliability Vi. The vanishing point parallax determining unit 73 calculates the parallelism E by adding all the square values of the deviations weighted by the reciprocal of the reliability Vi.
画像撮影装置20の近傍を撮影したピクセルの画像データほど情報の信頼度が高い。そのため、画像撮影装置20の近傍では、実空間で線分ペアが平行のときに偏差の二乗値は0に近い値になるが、遠方では、実空間で線分ペアが平行のときでも偏差の二乗値が0よりも大きな値になることがある。そこで、同じ偏差でも、遠方よりも近傍の方の平行度Eが低くなるように、信頼度Viの逆数で各偏差の二乗値を重み付けする。 Pixel image data obtained by photographing the vicinity of the image photographing device 20 has higher information reliability. Therefore, in the vicinity of the image capturing device 20, the square value of the deviation is close to 0 when the line segment pair is parallel in the real space, but in the distance, the deviation of the deviation is even when the line segment pair is parallel in the real space. The square value may be larger than zero. Therefore, even for the same deviation, the square value of each deviation is weighted by the reciprocal of the reliability Vi so that the parallelism E in the vicinity is lower than that in the distance.
平行度Eは、線分ペアが実空間において平行のときに0となり、線分ペアが実空間において平行から離れるほど大きな値となる。すなわち、平行度Eは、線分ペアの平行性を表す指標となり、値が小さいほど高い平行性を示す。 The parallelism E becomes 0 when the line segment pair is parallel in the real space, and becomes larger as the line segment pair is separated from the parallel in the real space. That is, the parallelism E is an index representing the parallelism of the line segment pair, and the higher the value, the higher the parallelism.
さらに、消失点視差決定部73は、図11(b)に示す平行度Eの式を道路の幅Wで偏微分する。偏微分が0となるときの道路の幅Wが、偏差が最も小さくなる道路の幅W0である。道路の幅W0は、各ステレオ画像を取得した際に、車両が走行していた実際の道路の幅に近い値となる。このように算出した道路の幅W0を用いて、統計することにより、距離算出に用いる消失点視差d0を高精度に算出できる。 Further, the vanishing point parallax determining unit 73 performs partial differentiation on the equation of parallelism E shown in FIG. The width W of the road when the partial differential is 0 is the width W0 of the road with the smallest deviation. The width W0 of the road is a value close to the actual width of the road on which the vehicle was traveling when each stereo image was acquired. By calculating using the road width W0 calculated in this way, the vanishing point parallax d0 used for distance calculation can be calculated with high accuracy.
このようにして決定した消失点視差d0の時間変化を図13に示す。時間の経過とともに、消失点視差d0の値が収束している様子がわかる。収束後の消失点視差d0は、精度の高い値になる。 FIG. 13 shows the time change of the vanishing point parallax d0 determined in this way. It can be seen that the value of the vanishing point parallax d0 converges as time passes. The vanishing point parallax d0 after convergence is a highly accurate value.
なお、境界線抽出部50、視差算出部60、近似直線算出部71、一致度算出部72、消失点視差決定部73、信頼度算出部74及び距離算出部80が、それぞれ、境界線抽出手段、視差算出手段、近似直線算出手段、一致度算出手段、消失点視差決定手段、信頼度算出手段、及び距離算出手段に相当する。 Note that the boundary line extraction unit 50, the parallax calculation unit 60, the approximate straight line calculation unit 71, the coincidence degree calculation unit 72, the vanishing point parallax determination unit 73, the reliability calculation unit 74, and the distance calculation unit 80 are each a boundary line extraction unit. , Parallax calculation means, approximate straight line calculation means, coincidence calculation means, vanishing point parallax determination means, reliability calculation means, and distance calculation means.
次に、消失点視差d0を算出する処理手順について、図14のフローチャートを参照して説明する。本処理は、画像処理装置30が所定時間間隔で実行する。 Next, a processing procedure for calculating the vanishing point parallax d0 will be described with reference to the flowchart of FIG. This process is executed by the image processing apparatus 30 at predetermined time intervals.
まず、画像撮影装置20により撮影された一対のアナログ画像を、デジタル化するとともに平行化したステレオ画像を取得する(S10)。続いて、S10で取得したステレオ画像に基づいて、画像座標上の各点における視差dを算出する(S11)。 First, a pair of analog images photographed by the image photographing device 20 is digitized and a parallel stereo image is acquired (S10). Subsequently, the parallax d at each point on the image coordinates is calculated based on the stereo image acquired in S10 (S11).
続いて、画像撮影装置20の近傍の所定領域において、道路の左右の境界線である左右の白線の輪郭を表すエッジ点を抽出する(S12)。続いて、S12で抽出した右側の所定長の線分を構成するエッジ点を、信頼度で重み付けする。そして、重み付けしたエッジ点を最小二乗法で近似し、右側の線分を近似する近似直線を算出する(S13)。同様に、右側の線分の近傍側及び遠方側で、所定のピクセル数ずつずらしながら、所定長の線分を近似する直線を複数算出する。 Subsequently, edge points representing the outlines of the left and right white lines, which are the left and right boundary lines of the road, are extracted in a predetermined region near the image capturing device 20 (S12). Subsequently, the edge points constituting the line segment of the predetermined length on the right extracted in S12 are weighted with reliability. Then, the weighted edge point is approximated by the least square method, and an approximate straight line that approximates the right line segment is calculated (S13). Similarly, a plurality of straight lines approximating a predetermined length of the line segment are calculated while shifting by a predetermined number of pixels on the near side and the far side of the right line segment.
続いて、S12で抽出した左側のエッジ点について、手前側から奥方向に1ピクセルずつずらしながら、右側の線分と同じ長さの線分を複数切り出す。そして、切り出した各線分に属するエッジ点を信頼度で重み付けし、重み付けしたエッジ点を最小二乗法で近似して、各線分を近似する近似直線を算出する(S14)。なお、S13で左側の所定長の線分の近似直線を算出し、S14で右側の複数の線分の近似直線を算出してもよい。 Subsequently, with respect to the left edge point extracted in S12, a plurality of line segments having the same length as the right line segment are cut out while shifting one pixel at a time from the front side. Then, the edge points belonging to each cut line segment are weighted with reliability, the weighted edge points are approximated by the least square method, and an approximate straight line approximating each line segment is calculated (S14). Note that an approximate straight line of a predetermined length on the left side may be calculated in S13, and an approximate straight line on the right side may be calculated in S14.
続いて、S14で算出した左側の近似直線の係数αlx,αly,βlx,βlyを平滑化する。また、S13で算出した右側の近似直線の係数αrx,αry,βrx,βryと、右側の線分の近傍側及び遠方側で複数の線分を近似した直線の係数とを平滑化する(S15)。そして、各消失点視差d0において、平滑化した係数を左側及び右側の各近似直線の係数とする。 Subsequently, the coefficients αlx, αly, βlx, βly of the left approximate straight line calculated in S14 are smoothed. Further, the coefficients αrx, αry, βrx, βry of the right approximate line calculated in S13 and the coefficients of the line approximating a plurality of line segments on the near side and the far side of the right line segment are smoothed (S15). . In each vanishing point parallax d0, the smoothed coefficients are used as the coefficients of the left and right approximate straight lines.
続いて、各消失点視差d0において、複数の線分ペアの中から実空間で最も平行になる線分ペアを決定する(S16)。続いて、各消失点視差d0において、S16で決定した各線分ペアの一致度Mを算出する(S17)。そして、各消失点視差d0について算出した一致度Mの中で、最も高い一致度Mに対応する消失点視差d0を、S10で取得したステレオ画像の消失点視差d0に決定する(S18)。 Subsequently, in each vanishing point parallax d0, a line segment pair that is most parallel in the real space is determined from a plurality of line segment pairs (S16). Subsequently, in each vanishing point parallax d0, the coincidence degree M of each line segment pair determined in S16 is calculated (S17). Then, the vanishing point parallax d0 corresponding to the highest matching degree M among the matching degrees M calculated for each vanishing point parallax d0 is determined as the vanishing point parallax d0 of the stereo image acquired in S10 (S18).
続いて、S10でステレオ画像を取得するよりも前に、所定の時間間隔で取得された複数のステレオ画像について、それぞれ決定した複数の消失点視差d0、及びS18で決定した消失点視差d0に基づき、距離の算出に用いる消失点視差d0を決定する(S19)。詳しくは、異なる時点で決定した複数の消失点視差d0について、平行度Eが最小となる道路の幅W0を用いてK-means法等の統計処理を行い、距離の算出に用いる消失点視差d0を決定する。 Subsequently, based on the plurality of vanishing point parallaxes d0 determined in S18 and the vanishing point parallax d0 determined in S18 for the plurality of stereo images acquired at predetermined time intervals before the stereo image is acquired in S10. The vanishing point parallax d0 used for calculating the distance is determined (S19). Specifically, for a plurality of vanishing point parallaxes d0 determined at different points in time, statistical processing such as a K-means method is performed using the road width W0 that minimizes the parallelism E, and the vanishing point parallax d0 used for distance calculation is performed. To decide.
以上で本処理を終了する。次に本処理を行って消失点視差d0を更新するまでは、今回の処理で算出した消失点視差d0を用いて、図3(b)の式から対象物までの距離を算出する。 This process is complete | finished above. Next, until the vanishing point parallax d0 is updated by performing this process, the vanishing point parallax d0 calculated in the current process is used to calculate the distance to the object from the equation in FIG.
以上説明した本実施形態によれば、以下の効果を奏する。 According to this embodiment described above, the following effects are obtained.
・道路の左右の境界線を構成するエッジ点が抽出され、抽出されたエッジ点に基づき、左右の境界線を近似する所定長の線分である近似直線が算出される。そして、消失点視差d0の値が変えられながら、各消失点視差d0について、算出された左右の近似直線のうちの一方の近似直線の端Aから他方の近似直線を含む直線へ下ろした垂線の足と、他方の近似直線の端Bとの一致度Mが算出される。そして、算出された一致度Mのうちの最も高い一致度Mに対応する消失点視差d0が、ステレオ画像における消失点視差d0として決定される。これにより、消失点視差d0の算出精度を向上させることができる。さらに、算出された視差d、及び決定された消失点視差d0に基づいて、対象物までの距離が算出される。したがって、消失点視差d0の算出精度を向上させることができ、ひいては、距離の算出精度を向上させることができる。 Edge points that constitute the left and right boundary lines of the road are extracted, and an approximate straight line that is a line segment of a predetermined length that approximates the left and right boundary lines is calculated based on the extracted edge points. Then, while the value of the vanishing point parallax d0 is changed, for each vanishing point parallax d0, a perpendicular line dropped from the end A of one of the calculated approximate straight lines to the straight line including the other approximated line. The degree of coincidence M between the foot and the end B of the other approximate line is calculated. Then, the vanishing point parallax d0 corresponding to the highest matching degree M among the calculated matching degrees M is determined as the vanishing point parallax d0 in the stereo image. Thereby, the calculation accuracy of the vanishing point parallax d0 can be improved. Further, the distance to the object is calculated based on the calculated parallax d and the determined vanishing point parallax d0. Therefore, it is possible to improve the calculation accuracy of the vanishing point parallax d0, and consequently improve the calculation accuracy of the distance.
・複数の異なる時点でステレオ画像が取得され、各ステレオ画像に対して消失点視差d0が決定される。そして、各ステレオ画像に対して決定された消失点視差d0に基づいて、距離算出に用いられる消失点視差d0が統計的に決定される。これにより、外れ値が除外され、消失点視差d0の算出精度を向上させることができる。 A stereo image is acquired at a plurality of different time points, and the vanishing point parallax d0 is determined for each stereo image. And the vanishing point parallax d0 used for distance calculation is statistically determined based on the vanishing point parallax d0 determined for each stereo image. Thereby, outliers are excluded, and the calculation accuracy of the vanishing point parallax d0 can be improved.
・画像撮影装置20の近傍を撮影したピクセルの画像データほど信頼度が高くなるように、重み付けされたエッジ点に基づいて、近似直線が算出される。これにより、近似直線を高精度に算出することができ、ひいては、消失点視差d0の算出精度を向上させることができる。 An approximate straight line is calculated on the basis of the weighted edge points so that the reliability of the image data of the pixels captured in the vicinity of the image capturing device 20 is higher. Thereby, the approximate straight line can be calculated with high accuracy, and as a result, the calculation accuracy of the vanishing point parallax d0 can be improved.
・カーブやうねりのある道路でも道路の形状に沿った線を近似できるように、左側の近似直線と右側の近似直線との複数の線分ペアが算出される。そして、各消失点視差d0において、算出された複数の線分ペアの中から、最も平行性の線分ペアが決定され、決定された線分ペアについて、一致度Mが算出される。よって、道路の形状に関わらず、複数の線分ペアの中から平行性の高い線分ペアを見つけ、消失点視差d0を高精度に算出することができる。 A plurality of line segment pairs of an approximate straight line on the left side and an approximate straight line on the right side are calculated so that a line along the shape of the road can be approximated even on a road with a curve or undulation. Then, in each vanishing point parallax d0, the most parallel line segment pair is determined from the calculated plurality of line segment pairs, and the matching degree M is calculated for the determined line segment pair. Therefore, regardless of the shape of the road, it is possible to find a highly parallel line segment pair from a plurality of line segment pairs and calculate the vanishing point parallax d0 with high accuracy.
・1ピクセルずつずらしながら、左側の直線の白線を構成するエッジ点から線分を多数切り出し、それぞれの線分を近似する近似直線を算出することにより、道路のカーブやうねりが大きい場合でも、平行性の高い線分ペアを見つけられる。ひいては、消失点視差d0を高精度に算出することができる。 -By shifting one pixel at a time, a number of line segments are cut out from the edge points that make up the white line of the left straight line, and an approximate straight line that approximates each line segment is calculated, so that even if the road curve or undulation is large, it is parallel You can find high-quality line segment pairs. As a result, the vanishing point parallax d0 can be calculated with high accuracy.
・一方の線分から他方の線分を含む直線へ下ろした垂線の長さLiと道路の幅Wとの偏差の二乗値が、最小となる道路の幅W0を用いて、複数の画像のそれぞれに対して決定された消失点視差d0がグループ化される。そして、グループごとに消失点視差d0が統計された結果に基づいて、距離の算出に用いる消失点視差d0が決定される。これにより、距離の算出に用いる消失点視差d0を、統計的に高精度で算出することができる。 -The square value of the deviation between the length Li of the vertical line drawn from one line segment to the straight line including the other line segment and the road width W is the minimum road width W0. The vanishing point parallax d0 determined for the group is grouped. Then, the vanishing point parallax d0 used for calculating the distance is determined based on the result of the statistics of the vanishing point parallax d0 for each group. Thereby, the vanishing point parallax d0 used for calculating the distance can be statistically calculated with high accuracy.
・垂線の長さLiと道路の幅Wとの偏差の二乗値が同じ値でも、画像撮影装置20の遠方よりも近傍の方の平行度Eが低くなるように、信頼度の逆数で重み付けられた偏差の二乗値から、平行度Eが算出される。これにより、平行度Eを高精度に算出することができ、ひいては、統計による消失点視差d0の算出精度を向上させることができる。 Even if the square value of the deviation between the length Li of the perpendicular line and the width W of the road is the same value, the parallelism E in the vicinity of the image capturing device 20 is weighted by the reciprocal of the reliability so that the parallelism E in the vicinity is lower than in the distance. The parallelism E is calculated from the square value of the deviation. Thereby, the parallelism E can be calculated with high accuracy, and consequently the calculation accuracy of the vanishing point parallax d0 by statistics can be improved.
(他の実施形態)
・長い直線道路を走行している場合には、左右の白線をそれぞれ1つの直線で近似し、一致度Eを算出してもよい。
(Other embodiments)
-When traveling on a long straight road, the left and right white lines may be approximated by one straight line, and the degree of coincidence E may be calculated.
・長い直線から所定長の線分を複数切り出す際に、奥方向へ所定数のピクセルずつずらしながら切り出してよい。 -When a plurality of line segments of a predetermined length are cut out from a long straight line, they may be cut out while shifting by a predetermined number of pixels in the depth direction.
・一つの時点で取得されたステレオ画像について決定された消失点視差d0を、次の時点で取得されたステレオ画像について消失点視差d0が決定されるまでの間、距離の算出に用いてもよい。すなわち、統計処理を行って消失点視差d0を決定しなくてもよい。 The vanishing point parallax d0 determined for the stereo image acquired at one time point may be used for calculating the distance until the vanishing point parallax d0 is determined for the stereo image acquired at the next time point. . That is, the vanishing point parallax d0 may not be determined by performing statistical processing.
・消失点視差d0の算出精度が低下するおそれはあるが、信頼度で重み付けしていないエッジ点から近似直線を算出してもよい。 Although there is a possibility that the calculation accuracy of the vanishing point parallax d0 may decrease, an approximate straight line may be calculated from edge points that are not weighted with reliability.
・消失点視差d0の算出精度が低下するおそれはあるが、信頼度の逆数で重み付けしていない偏差の二乗値を加算して、平行度Eを算出してもよい。 Although the calculation accuracy of the vanishing point parallax d0 may be reduced, the parallelism E may be calculated by adding the square value of the deviation that is not weighted by the reciprocal of the reliability.
・道路の幅W0として、対象としている道路の規格幅が既知の場合は、規格幅を用いてもよい。また、道路の幅W0は、一般的にある白線認識から導出される結果を利用してもよい。 If the standard width of the target road is known as the road width W0, the standard width may be used. As the road width W0, a result generally derived from a certain white line recognition may be used.
20…画像撮影装置、30…画像処理装置、50…境界線抽出部、60…視差算出部、71…近似直線算出部、72…一致度算出部、73…消失点視差決定部、74…信頼度算出部、80…距離算出部。 DESCRIPTION OF SYMBOLS 20 ... Image pick-up device, 30 ... Image processing device, 50 ... Boundary line extraction part, 60 ... Parallax calculation part, 71 ... Approximate straight line calculation part, 72 ... Concordance degree calculation part, 73 ... Vanishing point parallax determination part, 74 ... Trust Degree calculation unit, 80... Distance calculation unit.
Claims (7)
前記複数の画像撮影装置により撮影された一対の画像に基づいて、視差を算出する視差算出手段(60)と、
前記画像において、前記道路の左右の境界線を構成するエッジ点を抽出する境界線抽出手段(50)と、
前記境界線抽出手段により抽出された前記エッジ点に基づき、前記左右の境界線を近似する所定長の線分である近似直線を算出する近似直線算出手段(71)と、
前記一対の画像における消失点視差の値を変えながら、各消失点視差について、前記近似直線算出手段により算出された前記左右の近似直線のうちの一方の前記近似直線の第1端から他方の前記近似直線を含む直線へ下ろした垂線の足と、前記第1端と対応する前記他方の近似直線の第2端との一致度を算出する一致度算出手段(72)と、
前記一致度算出手段により算出された前記一致度のうちの最も高い前記一致度に対応する前記消失点視差を、前記一対の画像における消失点視差として決定する消失点視差決定手段(73)と、
前記視差算出手段により算出された視差、及び前記消失点視差決定手段により決定された消失点視差に基づいて、対象物までの距離を算出する距離算出手段(80)と、を備えることを特徴とする距離算出装置。 A plurality of image capturing devices (20) for capturing a surrounding environment including a road;
Parallax calculating means (60) for calculating parallax based on a pair of images captured by the plurality of image capturing devices;
In the image, boundary line extraction means (50) for extracting edge points constituting the left and right boundary lines of the road;
Approximate straight line calculating means (71) for calculating an approximate straight line that is a line segment of a predetermined length that approximates the left and right boundary lines based on the edge points extracted by the boundary line extracting means;
While changing the value of the vanishing point parallax in the pair of images, for each vanishing point parallax, from the first end of one of the approximate lines calculated by the approximate line calculation unit to the other of the left and right approximate lines A degree of coincidence calculation means (72) for calculating a degree of coincidence between a foot of a perpendicular line drawn down to a straight line including an approximate straight line and a second end of the other approximate straight line corresponding to the first end;
Vanishing point parallax determining means (73) for determining, as the vanishing point parallax in the pair of images, the vanishing point parallax corresponding to the highest matching degree of the matching degrees calculated by the matching degree calculating means;
Distance calculating means (80) for calculating the distance to the object based on the parallax calculated by the parallax calculating means and the vanishing point parallax determined by the vanishing point parallax determining means. Distance calculation device to do.
前記一致度算出手段は、各消失点視差について、前記第1直線と各第2直線との線分ペアの中から、最も平行性の高い前記線分ペアを決定し、決定した最も平行性の高い前記線分ペアの前記一致度を算出する請求項1に記載の距離算出装置。 The approximate straight line calculating means calculates a first straight line that is an approximate straight line of the predetermined length line from an edge point constituting one of the left and right boundary lines for each vanishing point parallax, and the left and right boundary lines A plurality of second straight lines that are approximate straight lines of the predetermined length from the edge points constituting the other of
The degree-of-match calculation means determines, for each vanishing point parallax, the line segment pair having the highest parallelism from the line segment pairs of the first straight line and the second straight line, and determines the most parallel determined The distance calculation device according to claim 1, wherein the degree of coincidence of the pair of line segments that is high is calculated.
前記近似直線算出手段は、前記信頼度算出手段により算出された信頼度で重み付けされた前記エッジ点に基づいて、前記近似直線を算出する請求項1〜3のいずれかに記載の距離算出装置。 A reliability calculation means (74) for calculating the reliability of the image data of a pixel obtained by imaging the vicinity of the image capturing device;
The distance calculation device according to claim 1, wherein the approximate line calculation unit calculates the approximate line based on the edge points weighted with the reliability calculated by the reliability calculation unit.
前記消失点視差決定手段は、複数の前記画像のそれぞれに対して決定した前記消失点視差に基づいて、前記距離算出手段により用いられる前記消失点視差を統計的に決定する請求項1〜4のいずれかに記載の距離算出装置。 The plurality of image capturing devices capture the pair of images at a plurality of different time points,
The vanishing point parallax determining unit statistically determines the vanishing point parallax used by the distance calculating unit based on the vanishing point parallax determined for each of the plurality of images. The distance calculation apparatus in any one.
前記消失点視差決定手段は、複数の前記画像のそれぞれに対して決定した前記消失点視差に対応する前記左右の近似直線の間隔と前記道路の幅との偏差であって、前記信頼度算出手段により算出された信頼度の逆数で重み付けされた前記偏差が、最も小さくなる前記道路の幅を用いる請求項6に記載の距離算出装置。 A reliability calculation means for calculating the reliability higher as the image data of the pixel that has captured the vicinity of the image capturing device;
The vanishing point parallax determining means is a deviation between an interval between the left and right approximate straight lines corresponding to the vanishing point parallax determined for each of the plurality of images and the width of the road, and the reliability calculating means The distance calculation device according to claim 6, wherein the deviation weighted by the reciprocal of the reliability calculated by using the width of the road that is the smallest.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2014060285A JP6251099B2 (en) | 2014-03-24 | 2014-03-24 | Distance calculation device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2014060285A JP6251099B2 (en) | 2014-03-24 | 2014-03-24 | Distance calculation device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2015184121A JP2015184121A (en) | 2015-10-22 |
| JP6251099B2 true JP6251099B2 (en) | 2017-12-20 |
Family
ID=54350820
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2014060285A Expired - Fee Related JP6251099B2 (en) | 2014-03-24 | 2014-03-24 | Distance calculation device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6251099B2 (en) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6895403B2 (en) * | 2018-03-20 | 2021-06-30 | 株式会社東芝 | Image processing equipment, driving support system, and image processing method |
| JP7262350B2 (en) * | 2019-09-12 | 2023-04-21 | 京セラ株式会社 | Road surface detection device, object detection device, object detection system, moving body and object detection method |
| KR20210103865A (en) * | 2020-02-14 | 2021-08-24 | 삼성전자주식회사 | Vanishing point extraction device and method of extracting vanishing point |
| CN112129262B (en) * | 2020-09-01 | 2023-01-06 | 珠海一微半导体股份有限公司 | Visual ranging method and visual navigation chip of multi-camera group |
| CN112146620B (en) * | 2020-11-25 | 2021-03-16 | 腾讯科技(深圳)有限公司 | Target object ranging method and device |
| CN116721270B (en) * | 2023-08-10 | 2023-10-20 | 泰安汉阳电子科技有限公司 | Data processing method for intelligent water meter |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3807651B2 (en) * | 1999-02-24 | 2006-08-09 | 三菱電機株式会社 | White line recognition device |
| JP4803927B2 (en) * | 2001-09-13 | 2011-10-26 | 富士重工業株式会社 | Distance correction apparatus and distance correction method for monitoring system |
| JP2003294422A (en) * | 2002-03-28 | 2003-10-15 | Fuji Heavy Ind Ltd | Object recognition apparatus and object recognition method |
| JP4832321B2 (en) * | 2007-01-26 | 2011-12-07 | 三洋電機株式会社 | Camera posture estimation apparatus, vehicle, and camera posture estimation method |
| US8571314B2 (en) * | 2010-09-02 | 2013-10-29 | Samsung Electronics Co., Ltd. | Three-dimensional display system with depth map mechanism and method of operation thereof |
-
2014
- 2014-03-24 JP JP2014060285A patent/JP6251099B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2015184121A (en) | 2015-10-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5954668B2 (en) | Image processing apparatus, imaging apparatus, and image processing method | |
| JP6251099B2 (en) | Distance calculation device | |
| US8928736B2 (en) | Three-dimensional modeling apparatus, three-dimensional modeling method and computer-readable recording medium storing three-dimensional modeling program | |
| JP5792662B2 (en) | Parallax calculation device, distance calculation device, and parallax calculation method | |
| CN105374019B (en) | A kind of more depth map fusion methods and device | |
| US9619886B2 (en) | Image processing apparatus, imaging apparatus, image processing method and program | |
| JP5752618B2 (en) | Stereo parallax calculation device | |
| JP6570296B2 (en) | Image processing apparatus, image processing method, and program | |
| JPWO2012096163A1 (en) | Image processing apparatus, image processing method, and program thereof | |
| KR20100119559A (en) | Method and system for converting 2d image data to stereoscopic image data | |
| US10205928B2 (en) | Image processing apparatus that estimates distance information, method of controlling the same, and storage medium | |
| JPWO2013038833A1 (en) | Image processing system, image processing method, and image processing program | |
| RU2725561C2 (en) | Method and device for detection of lanes | |
| KR101223206B1 (en) | Method and system for generating 3-dimensional video content | |
| EP2887313A1 (en) | Image processing apparatus, system, image processing method, and computer-readable recording medium | |
| JP6526527B2 (en) | Identification device and authentication system | |
| CN112424565A (en) | Vehicle-mounted environment recognition device | |
| JP6655869B2 (en) | Image processing apparatus, image processing method, and program | |
| JP6395429B2 (en) | Image processing apparatus, control method thereof, and storage medium | |
| US9538161B2 (en) | System and method for stereoscopic photography | |
| US9674503B2 (en) | Stereo matching apparatus using image property | |
| KR101804157B1 (en) | Disparity map generating method based on enhanced semi global matching | |
| JP4209637B2 (en) | Distance correction apparatus and distance correction method for monitoring system | |
| KR101558805B1 (en) | Interpolation factors correction apparatus for stereo matching | |
| US20120154388A1 (en) | Stereo image processing method, stereo image processing device and display device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20161219 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A821 Effective date: 20161219 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20171023 |
|
| 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: 20171031 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20171124 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6251099 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| LAPS | Cancellation because of no payment of annual fees |