JP6515650B2 - Calibration apparatus, distance measuring apparatus and calibration method - Google Patents

Calibration apparatus, distance measuring apparatus and calibration method Download PDF

Info

Publication number
JP6515650B2
JP6515650B2 JP2015082299A JP2015082299A JP6515650B2 JP 6515650 B2 JP6515650 B2 JP 6515650B2 JP 2015082299 A JP2015082299 A JP 2015082299A JP 2015082299 A JP2015082299 A JP 2015082299A JP 6515650 B2 JP6515650 B2 JP 6515650B2
Authority
JP
Japan
Prior art keywords
parallax
image
offset
disparity
feature points
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
JP2015082299A
Other languages
Japanese (ja)
Other versions
JP2016200557A (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.)
Tokyo Institute of Technology NUC
Original Assignee
Tokyo Institute of Technology NUC
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 Tokyo Institute of Technology NUC filed Critical Tokyo Institute of Technology NUC
Priority to JP2015082299A priority Critical patent/JP6515650B2/en
Publication of JP2016200557A publication Critical patent/JP2016200557A/en
Application granted granted Critical
Publication of JP6515650B2 publication Critical patent/JP6515650B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、車両等の移動体に搭載されるステレオカメラによる距離計測装置をリアルタイムで校正する校正装置、その校正装置を搭載した距離計測装置及びその校正方法に関する。   The present invention relates to a calibration device for calibrating in real time a distance measurement device using a stereo camera mounted on a mobile body such as a vehicle, a distance measurement device equipped with the calibration device, and a calibration method thereof.

近年、自動車の安全性向上をアシストする装置として衝突防止装置や車間距離制御装置等を搭載した自動車が販売されており、さらに進んで自動運転の実現を目指した研究開発が盛んに行われている。これらの装置は、前方の自動車等までの距離を自動で計測し、車間距離が短くなると運転者への警告発報等を行い、さらに短くなると衝突回避のためにブレーキやステアリング等の制御を行うものである。つまり、これらの装置において車間距離の自動計測は必須であり、自動運転においても必須な処理である。   In recent years, automobiles equipped with a collision prevention device, an inter-vehicle distance control device, and the like have been marketed as devices for assisting in the improvement of automobile safety, and research and development aimed at achieving automatic driving are being carried out actively. . These devices automatically measure the distance to the car ahead etc., alert the driver when the distance between vehicles becomes short, etc., and control the brakes and steering etc. for collision avoidance when the distance between them becomes even shorter. It is a thing. That is, in these devices, automatic measurement of the inter-vehicle distance is essential, and is also an essential processing in automatic driving.

車間距離の自動計測では、レーダーやステレオカメラ等が使用されているが、ステレオカメラは、複数の立体物の大きさ、位置、速度等を瞬時に検出し、さらに走行領域の境界となる側壁、路肩、白線等の路面のマークまで的確に検出することができるという利点を有している。   Radars, stereo cameras, etc. are used in automatic measurement of inter-vehicle distance, but stereo cameras detect the size, position, speed, etc. of a plurality of three-dimensional objects in an instant, and further, side wall which becomes the boundary of traveling area, It has an advantage that it is possible to accurately detect road surface marks such as road shoulders and white lines.

ステレオカメラは複数(通常は2つ)のカメラを1つに纏めたようなもので、複数のレンズで被写体を撮像し、撮像された複数の画像から被写体までの距離を計測する。   A stereo camera is a combination of a plurality of (usually two) cameras into one, which captures an object with a plurality of lenses, and measures the distance to the object from a plurality of captured images.

ここで、ステレオカメラによる距離の計測について説明する。図1は平行等位に設置された2台のカメラで構成されるステレオカメラによる距離計測の原理を説明するための図である。カメラ11及び12は平行等位に距離Bだけ離して設置されており(即ち基線長はB)、焦点距離は同じfである。光軸方向は図の真上方向で、カメラ11,12の設置面から光軸方向に距離Zだけ離れた位置に被写体Aを置いた場合、被写体Aの像は、カメラ11では光学中心Oと被写体Aを結ぶ直線と撮像面13との交点であるPに、カメラ12では光学中心Oと被写体Aを結ぶ直線と撮像面14との交点であるPにそれぞれ結像する。そして、直線APと平行で光学中心Oを通る直線を引き、その直線と撮像面13との交点をP’とすると、P’はカメラ12でのPと同じ位置であり、PとP’のずれが視差となる。通常、視差は方向の差を意味し角度で表されることが多いが、ここではPとP’の距離Dを視差と呼ぶことにする。この距離D(視差D)を計測することにより、三角形AOと三角形O’Pが相似であることから、被写体Aまでの距離Zは下記数1で求めることができる。 Here, measurement of distance by a stereo camera will be described. FIG. 1 is a view for explaining the principle of distance measurement by a stereo camera composed of two cameras installed in parallel and equal positions. The cameras 11 and 12 are arranged at equal distances parallel to each other by a distance B (i.e. the base length is B), and the focal lengths are the same f. When the subject A is placed at a position away from the installation surface of the cameras 11 and 12 by the distance Z in the optical axis direction, the image of the subject A is the optical center O 1 of the camera 11. and the P 1 is an intersection of the straight line and the imaging surface 13 connecting the object a, respectively imaged on P 2 is an intersection of the straight line and the imaging surface 14 connecting the camera 12 in the optical center O 2 and the object a. Then, if a straight line parallel to the straight line AP 2 and passing through the optical center O 1 is drawn and the point of intersection of the straight line and the imaging surface 13 is P 2 ′, P 2 ′ is at the same position as P 2 at the camera 12 The disparity between P 1 and P 2 ′ is parallax. Usually, parallax means a difference in direction and is often expressed by an angle, but here, the distance D between P 1 and P 2 ′ is called parallax. By measuring the distance D (parallax D), the distance Z to the subject A can be determined by the following equation 1 because the triangle AO 2 O 1 and the triangle O 1 P 2 ′ P 1 are similar.

数1が成立するためには、2つのカメラを図1に示されるように正確に平行等位に設置し、画像にずれが生じないようにしなければならない。しかし、2つのカメラを強固に固定することによりずれを生じないようにしようとするとコストがかかってしまうので、撮像後の画像を補正して調整するのが現実的な解決策となっている。画像補正による調整はステレオカメラの出荷前にも実施されているが、ステレオカメラを自動車に搭載して使用していくにしたがい、振動や温度変化等の影響を受けてずれが生じてしまうことがあるので、ステレオカメラを使用中にも自動的に調整されることが望まれている。 In order for Equation 1 to hold, the two cameras must be placed exactly parallel as shown in FIG. 1 to ensure that the images do not shift. However, if it is attempted to prevent the occurrence of a gap by firmly fixing the two cameras, it costs money, so it is a realistic solution to correct and adjust the image after imaging. Adjustment by image correction is carried out before shipment of the stereo camera, but as the stereo camera is mounted on a car and used, displacement may occur due to the influence of vibration, temperature change, etc. As such, it is desirable that the stereo camera be adjusted automatically while in use.

ずれには光軸回りの回転(ロール)による回転ずれ、上下方向の動き(チルト又はピッチ)による縦ずれ及び左右方向の動き(パン又はヨー)による横ずれがある。このうち、カメラを平行等位に設置した場合、回転ずれ及び縦ずれは、ステレオマッチングがうまくいかなくなるので検出しやすいが、横ずれはステレオマッチングが正常に行えるので、ステレオマッチングでは検出されず、さらにそのずれが視差に直接加わるので、算出される距離に及ぼす影響が大きい。特に、遠距離にある被写体の距離の計測ではその影響が大きい。よって、この横ずれによる視差の誤差(視差オフセット)を検出し、視差を補正する必要がある。   The deviation includes rotation deviation due to rotation (roll) around the optical axis, vertical deviation due to vertical movement (tilt or pitch), and lateral deviation due to horizontal movement (pan or yaw). Among them, when the camera is installed in parallel parallel position, rotational shift and vertical shift are easy to detect because stereo matching does not work well, but lateral shift is not detected by stereo matching because stereo matching can be performed normally. Since the deviation directly adds to the parallax, the influence on the calculated distance is large. In particular, the effect is large when measuring the distance of an object at a long distance. Therefore, it is necessary to detect the parallax error (parallax offset) due to the lateral shift and correct the parallax.

視差オフセットの検出として、無限遠と見做せる位置にある物体に対する視差は0となるはずであるが、0ではない場合、その視差の値が視差オフセットとなることから、月のように無限遠と見做せる位置にある物体の視差を計測することにより視差オフセットを算出することができる。しかし、そのような物体は常に撮影できるわけではない。そこで、走行中の周囲にある物体を用いて視差オフセットを算出し、視差を補正する方法が提案されている。   As for the detection of the parallax offset, the parallax for an object at a position that can be regarded as infinity should be 0, but if it is not 0, the value of the parallax becomes the parallax offset. The parallax offset can be calculated by measuring the parallax of an object at a position where it can be regarded as. However, such objects can not always be photographed. Therefore, a method has been proposed in which a parallax offset is calculated using an object in the vicinity while traveling to correct the parallax.

特開平9−126759号公報(特許文献1)では、自車両近傍の左右の白線を認識し、最小二乗法により左右それぞれの白線を直線近似し、近似直線の交点を無限遠点とすることによりカメラ間の相対ずれ角を算出し、補正を行っている。特開2001−169310号公報(特許文献2)では、信号機や電柱のようにサイズ等が既知の静止対象物の視差を2つの時刻において算出し、その2つの時刻間の車両移動量を車速より算出し、算出した視差と車両移動量に基づいて視差オフセットを算出し、視差を補正している。   In Japanese Patent Laid-Open No. 9-126759 (Patent Document 1), the left and right white lines in the vicinity of the host vehicle are recognized, the left and right white lines are linearly approximated by the least squares method, and the intersection point of the approximation straight lines is taken as an infinite point. The relative shift angle between the cameras is calculated and corrected. In Japanese Patent Application Laid-Open No. 2001-169310 (Patent Document 2), the parallax of a stationary object whose size is known, such as a traffic light and a utility pole, is calculated at two times, and the amount of movement of the vehicle between the two times is calculated from the vehicle speed. The parallax offset is calculated based on the calculated parallax and the amount of movement of the vehicle to correct the parallax.

特許文献1及び特許文献2では白線や信号機等の特定の対象物を使用して補正を行っているので、特定の対象物がない環境では補正ができない。即ち、白線がない又は片側にしか白線がない環境では特許文献1の方法は使用できず、信号機や電柱がない高速道路等では特許文献2の方法は使用できない。   In patent document 1 and patent document 2, since correction | amendment is performed using specific objects, such as a white line and a signal apparatus, correction | amendment can not be performed in the environment without a specific object. That is, the method of Patent Document 1 can not be used in an environment in which there is no white line or there is only a white line on one side, and the method of Patent Document 2 can not be used on a highway or the like without traffic lights or telephone poles.

特許第4894771号公報(特許文献3)では、特定の対象物の認識処理を行わずに視差オフセットを算出する方法を提供している。特許文献3では、入力画像中の複数の特徴点の視差と2次元のオプティカルフロー(物体の動きをベクトルで表したもの)を算出し、平坦な道路面上の特徴点においては、その特徴点の垂直成分及び視差並びに視差オフセットで校正された視差の2乗及びオプティカルフローの垂直成分はそれぞれ特定の関係を有することを利用して、視差オフセットを算出している。これにより、特定の対象物を認識することなく視差を補正できるが、入力画像に平坦な道路面が含まれていなければならず、建物や電柱等の立体物を有効利用することができず、道路面の大部分が隠されてしまう渋滞時等では補正の精度が劣化する。   Japanese Patent No. 4894771 (Patent Document 3) provides a method of calculating a parallax offset without performing recognition processing of a specific object. In Patent Document 3, the parallax of a plurality of feature points in an input image and a two-dimensional optical flow (the motion of an object represented by a vector) are calculated, and the feature points on a flat road surface are calculated. The disparity offset is calculated using that the vertical component and the disparity and the square of the disparity calibrated with the disparity offset and the vertical component of the optical flow respectively have a specific relationship. Thereby, the parallax can be corrected without recognizing a specific object, but the input image must include a flat road surface, and a three-dimensional object such as a building or a telephone pole can not be used effectively. The accuracy of the correction degrades in traffic jams where most of the road surface is hidden.

特許第5440461号公報(特許文献4)及び特開2013−224919号公報(特許文献5)では、上記の問題を解決すべく、特定の形状物に依存せず、走行中に撮影される様々な画像を利用した視差オフセットの検出方法が提案されている。特許文献4及び特許文献5では、地面に対して静止している複数の被写体を利用して視差オフセットを算出している。つまり、同一の被写体を走行中の2地点からステレオカメラで撮影した画像に対して、視差オフセットの影響をキャンセルするために、特許文献4では視差と視差の差分を2軸とした空間で計測データをモデル化し、特許文献5では視差の差分の代わりに視差の比又は視差の逆数の差を使用して計測データをモデル化する。そして、モデルを表す関数のパラメータから視差オフセットを算出している。   In patent 5440461 (patent document 4) and Unexamined-Japanese-Patent No. 2013-224919 (patent document 5), in order to solve the above-mentioned problem, it does not depend on a specific shape thing, but variously photographed during traveling A method of detecting a parallax offset using an image has been proposed. In Patent Document 4 and Patent Document 5, parallax offsets are calculated using a plurality of objects stationary with respect to the ground. That is, in order to cancel the influence of the parallax offset with respect to images taken by the stereo camera from two points while traveling the same subject, in Patent Document 4, the measurement data is in a space in which the difference between the parallax and the parallax is two axes. In Patent Document 5, measurement data is modeled using a parallax ratio or a difference of inverse parallax instead of a parallax difference. Then, the disparity offset is calculated from the parameters of the function representing the model.

特開平9−126759号公報JP-A-9-126759 特開2001−169310号公報JP 2001-169310 A 特許第4894771号公報Patent No. 4894771 特許第5440461号公報Patent No. 5440461 特開2013−224919号公報JP, 2013-224919, A

西久保直輝、押田康太郎、岡雄平、実吉敬二、「FPGAによるステレオカメラの自動校正」、第29回日本ロボット学会学術講演会予稿集、東京都、2011年9月Naoki Nishikubo, Kotaro Oshida, Yuhei Oka, Keiji Jikichi, "Auto-calibration of stereo camera with FPGA", Proceedings of the 29th Annual Conference of the Robotics Society of Japan, Tokyo, September 2011

しかしながら、特許文献4及び特許文献5の方法が適用できるのは静止物体に限られ、さらに、モデル化による手法を利用しているので、高い精度で視差オフセットを算出するためには多くの計測データが必要であり、演算量が増大となる。   However, the methods of Patent Document 4 and Patent Document 5 can be applied only to stationary objects, and further, since a modeling method is used, a large amount of measurement data is required to calculate the parallax offset with high accuracy. Calculation amount is increased.

本発明は上述のような事情よりなされたものであり、本発明の目的は、移動体が移動中での視差オフセットの算出において、白線や信号機等の特定の対象物や平坦な道路等の特定の形状物の存在が必要であるとか、適用範囲は静止物体に限られる等の制約条件を設定する必要がなく、ステレオカメラ(ステレオ画像撮像装置)で撮像される様々な画像を利用でき、計測データが少なくても精度良く安定して視差オフセットを求めることができる校正装置及び校正方法並びにその校正装置を搭載してリアルタイムに高精度で視差を補正し、正確な距離計測を行う距離計測装置を提供することにある。   The present invention has been made under the circumstances as described above, and it is an object of the present invention to specify a specific object such as a white line or a traffic light, a flat road, etc. in calculating the parallax offset while the moving object is moving. It is not necessary to set the restriction condition that the existence of the shape object is required or the application range is limited to the stationary object, etc., and various images captured by the stereo camera (stereo image pickup device) can be used. A calibration apparatus and calibration method capable of accurately and stably obtaining a parallax offset even if there are few data, and a distance measurement apparatus that carries the calibration apparatus and corrects the parallax with high accuracy in real time and performs accurate distance measurement It is to provide.

本発明は、移動体に搭載されて距離計測を行う距離計測装置にて用いられるステレオ画像撮像装置のパラメータを校正する校正装置に関し、本発明の上記目的は、前記ステレオ画像撮像装置で撮像された基準画像1の中の立体物上の少なくとも2つの特徴点を抽出し、前記各特徴点の画面座標1を求める立体物特徴点抽出部と、前記ステレオ画像撮像装置で撮影された比較画像1を用いて前記各特徴点の視差1を算出する視差算出部と、前記基準画像1及び前記比較画像1を撮像した時刻より所定の時間経過した後に前記ステレオ画像撮像装置で撮像された基準画像2及び比較画像2を入力し、前記基準画像2又は前記比較画像2を用いて前記各特徴点のオプティカルフローを検出し、前記基準画像2及び前記比較画像2を用いて前記基準画像2の中での前記各特徴点の画面座標2及び視差2を算出する移動検出部と、前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて前記ステレオ画像撮像装置のパラメータの校正に使用する視差オフセットを算出する視差オフセット算出部を備え、前記視差オフセット算出部は、前記ステレオ画像撮像装置で撮像される画像の画面座標を三次元座標に変換する変換式を用いて前記三次元座標での2点の移動量の差を表わした差分式に基づいて定義された、視差オフセットを未知数とした評価関数により前記視差オフセットを算出することにより達成される。   The present invention relates to a calibration apparatus for calibrating parameters of a stereo imaging apparatus used in a distance measurement apparatus mounted on a mobile body and performing distance measurement, and the above object of the present invention is that it is imaged by the stereo imaging apparatus A three-dimensional object feature point extraction unit for extracting at least two feature points on a three-dimensional object in a reference image 1 and obtaining screen coordinates 1 of the respective feature points, and a comparison image 1 captured by the stereo image capturing device And a reference image 2 captured by the stereo image capturing device after a predetermined time has elapsed from the time of capturing the reference image 1 and the comparative image 1 using the disparity calculating unit that calculates the disparity 1 of the feature points. The comparison image 2 is input, the optical flow of each feature point is detected using the reference image 2 or the comparison image 2, and the reference image is detected using the reference image 2 and the comparison image 2 Using the movement detection unit for calculating the screen coordinates 2 and the parallax 2 of each feature point in 2; and using the screen coordinates 1, the parallax 1, the screen coordinates 2 and the parallax 2 A parallax offset calculation unit that calculates a parallax offset used to calibrate a parameter, the parallax offset calculation unit using a conversion equation that converts screen coordinates of an image captured by the stereo image capturing device into three-dimensional coordinates. This is achieved by calculating the disparity offset using an evaluation function with the disparity offset as an unknown number defined based on a difference formula representing the difference between the amounts of movement of two points in the three-dimensional coordinate.

また、本発明の上記目的は、前記評価関数は前記移動量の差の二乗和として定義され、前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて数値解析により前記評価関数を最小とする視差オフセットを求めることにより、或いは、前記評価関数は前記差分式で構成され、前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて前記各差分式を0とする個別視差オフセットを算出し、前記個別視差オフセットの代表値を前記視差オフセットとすることにより、或いは、前記視差オフセット算出部は、前記画面座標1及び前記視差1より前記各特徴点の三次元座標1を算出し、前記画面座標2及び前記視差2より前記各特徴点の三次元座標2を算出し、前記三次元座標1及び前記三次元座標2より算出される移動量の差が所定の閾値より大きい特徴点の組合せは前記視差オフセットの算出には使用しないことにより、或いは、前記移動検出部は、前記基準画像1及び前記比較画像1を撮像した時刻後の所定の時間間隔で所定の数の基準画像及び比較画像を入力し、最後に入力した基準画像N及び比較画像N以外の基準画像及び比較画像に対してはオプティカルフローの検出のみを行い、前記基準画像N及び比較画像Nに対してのみ前記各特徴点の視差2の算出まで行うことにより、より効果的に達成される。   Further, in the above object of the present invention, the evaluation function is defined as a sum of squares of differences of the movement amounts, and the evaluation is made by numerical analysis using the screen coordinates 1, the parallax 1, the screen coordinates 2 and the parallax 2 By obtaining a parallax offset that minimizes the function, or the evaluation function is configured by the difference equation, each difference equation is calculated using the screen coordinates 1, the parallax 1, the screen coordinates 2, and the parallax 2 The individual parallax offset to be 0 is calculated, and the representative value of the individual parallax offset is used as the parallax offset, or the parallax offset calculation unit calculates the cubic of each of the feature points from the screen coordinates 1 and the parallax 1 The original coordinates 1 are calculated, the three-dimensional coordinates 2 of the feature points are calculated from the screen coordinates 2 and the parallax 2, and the movement calculated from the three-dimensional coordinates 1 and the three-dimensional coordinates 2 The combination of feature points whose difference is larger than a predetermined threshold value is not used for calculation of the parallax offset, or the movement detection unit determines the predetermined time after capturing the reference image 1 and the comparison image 1 A predetermined number of reference images and comparison images are input at time intervals, and only optical flow detection is performed on reference images and comparison images other than the reference image N and comparison image N input last. This is achieved more effectively by calculating the parallax 2 of each feature point only for the comparative image N.

また、上記校正装置を搭載することにより、リアルタイムに高精度で視差を補正し、正確な距離計測を行う距離計測装置を達成できる。   In addition, by mounting the above-described calibration device, it is possible to achieve a distance measurement device that corrects the parallax with high accuracy in real time and performs accurate distance measurement.

本発明の校正装置によれば、立体物上の特徴点を用いて視差オフセットを算出しており、移動している立体物でも利用できるので、ステレオ画像撮像装置で撮像されるほぼ全ての画像を利用することができる。また、少なくとも2つの特徴点があれば視差オフセットを算出できるので、計測データが少なくても精度良く視差オフセットを算出することができる。   According to the calibration device of the present invention, the parallax offset is calculated using feature points on a solid object, and even a moving solid object can be used, so almost all the images captured by the stereo image pickup device are It can be used. In addition, since the parallax offset can be calculated if there are at least two feature points, the parallax offset can be accurately calculated even if there are few measurement data.

また、本発明の校正装置を搭載した距離計測装置によれば、リアルタイムに高精度で視差を補正できるので、正確な距離計測を行うことができる。   Further, according to the distance measuring device equipped with the calibration device of the present invention, since the parallax can be corrected with high accuracy in real time, accurate distance measurement can be performed.

ステレオカメラによる距離の計測の原理を示す概略図である。It is the schematic which shows the principle of measurement of the distance by a stereo camera. 画面座標及び三次元座標の座標軸の設定を示す図である。It is a figure which shows the setting of the coordinate axis of a screen coordinate and a three-dimensional coordinate. 本発明の構成例(第1実施形態)を示すブロック図である。It is a block diagram which shows the structural example (1st Embodiment) of this invention. 本発明の動作例(第1実施形態)を示すフローチャートである。It is a flowchart which shows the operation example (1st Embodiment) of this invention. ステレオマッチングでのマッチング領域の例を示すイメージ図である。It is an image figure showing an example of a matching field in stereo matching. サブピクセル精度での算出方法を示すイメージ図である。It is an image figure which shows the calculation method in sub-pixel precision. オプティカルフロー検出でのマッチング領域の例を示すイメージ図である。It is an image figure which shows the example of the matching area | region in optical flow detection. 本発明のシミュレーション結果を示す図である。It is a figure which shows the simulation result of this invention. 本発明の構成例(第2実施形態)を示すブロック図である。It is a block diagram which shows the structural example (2nd Embodiment) of this invention. 本発明の動作例(第2実施形態)の一部(視差オフセット算出部での動作)を示すフローチャートである。It is a flowchart which shows a part (operation | movement in a parallax offset calculation part) of the operation example (2nd Embodiment) of this invention. 本発明の構成例(第3実施形態)を示すブロック図である。It is a block diagram which shows the structural example (3rd Embodiment) of this invention. 本発明の動作例(第3実施形態)を示すフローチャートである。It is a flowchart which shows the operation example (3rd Embodiment) of this invention.

本発明では、移動体に搭載されたステレオ画像撮像装置が移動しても、撮像される立体物の形状は変わらないので、立体物上の点(特徴点)の移動距離及び移動方向は同じであるということを利用して、視差オフセットを算出する。つまり、撮像された画像(撮像画像)上での特徴点の位置は二次元の座標(画面座標)で定義されるので、ステレオ画像撮像装置が移動した場合、撮像画像上での特徴点が動いた距離は特徴点が最初にどの位置にあるかにより異なるが、三次元の座標(三次元座標)で位置が定義される実際の特徴点が動いた距離は、立体物の形状は変わらないので、特徴点の最初の位置に関係なく同じである。さらには、動いた方向も同じである。そして、画面座標での特徴点の位置から三次元座標での特徴点の位置の算出において視差を使用するので、その視差に視差オフセットを加味し、画面座標から三次元座標への変換式を用いて三次元座標での移動距離を定式化すれば、移動距離は同じであるという条件の下、複数の特徴点の画面座標の値から視差オフセットの最適解を求めることができる。   In the present invention, even if the stereo imaging device mounted on the moving object moves, the shape of the solid object to be captured does not change, so the movement distance and movement direction of the points (feature points) on the solid object are the same. Parallax offset is calculated using the fact that there is. That is, since the position of the feature point on the captured image (captured image) is defined by two-dimensional coordinates (screen coordinates), the feature point on the captured image moves when the stereo imaging device moves. The distance varies depending on where the feature point is initially located, but the distance the actual feature point moved whose position is defined by three-dimensional coordinates (three-dimensional coordinates) does not change the shape of the solid object , Is the same regardless of the initial position of the feature point. Furthermore, the moving direction is also the same. And since parallax is used in calculation of the position of the feature point in three-dimensional coordinates from the position of the feature point in screen coordinates, the parallax offset is added to the disparity, and the conversion formula from screen coordinates to three-dimensional coordinates is used. If the movement distance in three-dimensional coordinates is formulated, the optimum solution of the parallax offset can be obtained from the values of the screen coordinates of a plurality of feature points under the condition that the movement distance is the same.

なお、本発明では、ステレオ画像撮像装置において、撮像画像に対してシェーディング補正、カメラ間感度差補正、歪み補正等が実施されるものとする。シェーディングとは、撮像画像の画面の端にいくほど明るさが減衰してしまう現象のことである。カメラ間感度差とは、同一製品のカメラでも個体差があるので、輝度の検出のされ方に差が生じてしまうことを言う。シェーディング及びカメラ間感度差は、後述のステレオマッチング等での誤検出の原因となるので、ステレオ画像撮像装置において補正しておく。また、カメラから得られる画像は、カメラのレンズの影響を受け、画像中心から離れるほど歪み量が大きくなるので、この歪みも補正しておく。さらに、回転ずれ及び縦ずれについてもステレオ画像撮像装置において検出し、校正しておく。   In the present invention, it is assumed that shading correction, inter-camera sensitivity difference correction, distortion correction, and the like are performed on a captured image in a stereo image capturing apparatus. Shading is a phenomenon in which the brightness decreases as it gets closer to the edge of the screen of the captured image. The inter-camera sensitivity difference means that differences occur in how luminance is detected because there are individual differences among cameras of the same product. Since the shading and the inter-camera sensitivity difference cause erroneous detection in stereo matching described later, they are corrected in the stereo image pickup device. Further, the image obtained from the camera is affected by the lens of the camera, and the amount of distortion increases as the distance from the center of the image increases, so this distortion is also corrected. Furthermore, rotational deviation and vertical deviation are also detected by the stereo image pickup apparatus and calibrated.

計測の対象となる特徴点の抽出は、例えば非特許文献1に記載されている「特徴点検出」の方法で行う。即ち、撮像画像の中から、互いに直角な2方向にエッジの強い領域を特徴点として抽出する。   Extraction of feature points to be measured is performed by the method of “feature point detection” described in Non-Patent Document 1, for example. That is, regions having strong edges in two directions perpendicular to each other are extracted as feature points from the captured image.

次に、画面座標から三次元座標への変換について説明する。   Next, conversion from screen coordinates to three-dimensional coordinates will be described.

図2は、画面座標及び三次元座標の座標軸の設定を示す図で、図1でのカメラ11に対応している。図2に示されるように、カメラ11の光学中心Oを通り、カメラ11の光軸と垂直に交わる平面上において、光学中心Oを原点として、水平方向を三次元座標のx軸、垂直方向を三次元座標のy軸、光軸方向を三次元座標のz軸とする。また、カメラ11の光軸は撮像面13の中心を通り、撮像面13は光軸と垂直に交わるように設定されているとして、撮像面13上において、中心を原点として、三次元座標のx軸と平行で反対方向を画面座標のi軸、三次元座標のy軸と平行で反対方向を画面座標のj軸とする。撮像面では被写体は逆さまに映るので、撮像された画像において、被写体から見るとi軸及びj軸はx軸及びy軸とそれぞれ同じ方向となる。このような座標軸の設定において、被写体Aの三次元座標での位置(座標)が(X,Y,Z)で、画面座標での位置(座標)が(I,J)の場合、X及びYは下記数2及び数3で、Zは前述の数1でそれぞれ求めることができる。 FIG. 2 is a view showing setting of coordinate axes of screen coordinates and three-dimensional coordinates, which corresponds to the camera 11 in FIG. As shown in FIG. 2, through the optical center O 1 of the camera 11, in a plane on intersecting perpendicular to the optical axis of the camera 11, the optical center O 1 as the origin, x-axis of the three-dimensional coordinates in the horizontal direction, vertical The direction is y-axis of three-dimensional coordinates, and the optical axis direction is z-axis of three-dimensional coordinates. In addition, assuming that the optical axis of the camera 11 passes through the center of the imaging surface 13 and the imaging surface 13 is set to intersect the optical axis perpendicularly, x on the imaging surface 13 with the center as the origin, x of three-dimensional coordinates. The opposite direction parallel to the axis is i axis of screen coordinates, and the opposite direction parallel to the y axis of three dimensional coordinates is j axis of screen coordinates. Since the subject appears upside down on the imaging plane, in the captured image, the i-axis and the j-axis are in the same direction as the x-axis and the y-axis respectively when viewed from the subject. In such a coordinate axis setting, when the position (coordinates) of the subject A in three-dimensional coordinates is (X, Y, Z) and the position (coordinates) in the screen coordinates is (I, J), X and Y Is given by the following equation 2 and equation 3, and Z can be obtained by the above equation 1.

ここで、図1の場合と同様に、Bは基線長、Dは視差である。 Here, as in the case of FIG. 1, B is a base length and D is a parallax.

計測された視差Dに誤差(視差オフセット)がなければ、被写体Aの三次元座標での座標が画面座標の座標より数1〜3を用いて算出できるが、視差オフセットDが加算されている場合、三次元座標での座標(X,Y,Z)は下記数4〜6のようになる。 If there is no error (parallax offset) in the measured parallax D, the coordinates of the subject A in three-dimensional coordinates can be calculated from the coordinates of the screen coordinates using Equations 1 to 3, but the parallax offset D 0 is added In the case, coordinates (X, Y, Z) in three-dimensional coordinates are as shown in the following expressions 4 to 6.


撮像画像から抽出された特徴点α及びαの時刻tでの画面座標の値をそれぞれ(I(t),J(t))及び(I(t),J(t))とし、計測された視差をそれぞれD(t)及びD(t)とすると、時刻tからtまでの三次元座標での特徴点αとαの座標の変化量(移動量)の差は下記数7〜9のようになる。

The values of the screen coordinates at time t of the feature points α m and α n extracted from the captured image are (I m (t), J m (t)) and (I n (t), J n (t), respectively. Assuming that the measured parallaxes are D m (t) and D n (t), respectively, change amounts of coordinates of feature points α m and α n in three-dimensional coordinates from time t 1 to t 2 (movement The difference in amount) is as shown in the following numbers 7-9.


ここで、Exmn,Eymn及びEzmnは、それぞれx座標での変化量の差、y座標での変化量の差及びz座標での変化量の差である。

Here, Ex mn , Ey mn and Ez mn are respectively the difference in change amount in the x coordinate, the difference in change amount in the y coordinate, and the difference in change amount in the z coordinate.

特徴点α及びαが同一の立体物上に存在する場合、特徴点α及びαそれぞれの三次元座標での移動距離は同じであり、さらに移動方向も同じであるから、Exmn,Eymn及びEzmnは全て0となる。よって、Exmn=Eymn=Ezmn=0を満たすDを算出することにより、視差オフセットを求めることができるが、Exmn=0、Eymn=0及びEzmn=0それぞれから算出されるDが同じ値になるとは限らない。実測データには計測精度や演算精度等の様々な要因により誤差が混入するからである。同様に、特徴点が3点以上の場合、特徴点の複数の組合せから算出されるDでも不一致は生じる。そこで、実測データから最適解を求める手法にて最適なDを求め、その最適なDを視差オフセットとする。 If the feature point alpha m and alpha n are on the same three-dimensional object, the moving distance of the feature points alpha m and alpha n each of the three-dimensional coordinates are the same, yet because the moving direction is the same, Ex mn , Ey mn and Ez mn are all zero. Therefore, the parallax offset can be determined by calculating D 0 satisfying Ex mn = Ey mn = Ez mn = 0, but is calculated from Ex mn = 0, Ey mn = 0, and Ez mn = 0, respectively. D 0 does not necessarily have the same value. This is because errors occur in the measured data due to various factors such as measurement accuracy and calculation accuracy. Similarly, when the number of feature points is three or more, a mismatch also occurs at D 0 calculated from a plurality of combinations of feature points. Therefore, the optimal D 0 is determined from the actual measurement data by the method of determining the optimal solution, and the optimal D 0 is defined as the disparity offset.

まずは数値解析の手法にてDの最適解を求める方法について説明する。 First, a method of obtaining an optimal solution of D 0 by a numerical analysis method will be described.

L個の特徴点α,α,…,αに対して下記数10で表わされる目的関数(評価関数)を定義する。 L number of feature points α 1, α 2, ..., to define the objective function (cost function) represented by the following Expression 10 with respect to alpha L.

ここで、m,nは1以上L以下の整数で、
はm<nを満たすm,nの各組合せでの二乗和の総和を意味する。そして、この評価関数を最小とするDを算出し、そのDを視差オフセットとする。数値解析の手法としては、最急降下法、ニュートン法等を用いる。
Here, m and n are integers of 1 or more and L or less,
Means the sum of the sum of squares at each combination of m and n satisfying m <n. Then, to calculate the D 0 of the evaluation function and minimize, to the D 0 and parallax offset. As a method of numerical analysis, the steepest descent method, the Newton method, etc. are used.

次に、代表値の算出により視差オフセットを算出する方法について説明する。つまり、複数の視差オフセット(個別視差オフセット)Dを算出し、個別視差オフセットの代表値(平均値、最頻値等)を視差オフセットとする。 Next, a method of calculating the disparity offset by calculating the representative value will be described. That is, a plurality of disparity offsets (individual disparity offsets) D 0 are calculated, and a representative value (average value, mode value, etc.) of the individual disparity offsets is taken as the disparity offset.

m<nを満たすm,nの組合せにてExmn=0、Eymn=0及びEzmn=0を満たすDをそれぞれ算出し、算出された全てのDの代表値を視差オフセットとする。代表値の算出において、不適と推測される個別視差オフセットを除外して算出しても良い。例えば、個別視差オフセットの平均値を算出し、平均値との偏差の絶対値が所定の値以上の個別視差オフセットを除いて再度算出した平均値を視差オフセットとする。或いは、単純に絶対値が所定の値以上の個別視差オフセットを除いて代表値を算出しても良い。このような個別視差オフセットは、対象とした特徴点が異なる移動物体上に存在している等、条件を満たしていない可能性があるからである。 Calculate D 0 satisfying Ex mn = 0, Ey mn = 0, and Ez mn = 0 with the combination of m and n satisfying m <n, and let the calculated representative value of all D 0 be the parallax offset . In the calculation of the representative value, the calculation may be performed excluding the individual parallax offset assumed to be unsuitable. For example, the average value of the individual disparity offsets is calculated, and the average value calculated again except for the individual disparity offsets whose absolute value of deviation from the average value is equal to or more than a predetermined value is taken as the disparity offset. Alternatively, the representative value may be calculated simply by excluding the individual parallax offset whose absolute value is equal to or more than a predetermined value. Such an individual parallax offset is because there is a possibility that the condition is not satisfied, for example, the target feature points are present on different moving objects.

数値解析による方法と個別視差オフセット算出による方法を組み合わせた方法で視差オフセットを算出しても良い。例えば、数10の代わりに、下記数11の3式を評価関数として、各評価関数を最小とする視差オフセット(個別視差オフセット)Dを算出し、個別視差オフセットの代表値を視差オフセットとする。 The parallax offset may be calculated by a method combining the method by numerical analysis and the method by individual parallax offset calculation. For example, instead of Equation 10, the parallax offset (individual disparity offset) D 0 which minimizes each evaluation function is calculated using the following three equations 11 as an evaluation function, and the representative value of the individual disparity offset is used as the parallax offset .

mとnの組合せを複数のグループに分け、各グループにて数10を評価関数として個別視差オフセットを算出し、算出された個別視差オフセットの代表値を視差オフセットとしても良い。例えば、特徴点が撮像画像上で複数箇所に固まって存在していたら、各固まりを1つのグループとする。この組み合わせた方法においても、不適と推測される個別視差オフセットを除外しても良い。 The combination of m and n may be divided into a plurality of groups, individual parallax offsets may be calculated using Equation 10 as an evaluation function in each group, and the representative value of the calculated individual parallax offsets may be used as the parallax offset. For example, if the feature points are present in a plurality of places on the captured image, each group is set as one group. Also in this combined method, individual disparity offsets which are estimated to be unsuitable may be excluded.

なお、最適な視差オフセットの算出において、x座標、y座標及びz座標全てのデータを使用せずに、少なくとも1つの座標のデータを使用して算出しても良い。   In the calculation of the optimal parallax offset, calculation may be performed using data of at least one coordinate without using data of all the x coordinate, y coordinate, and z coordinate.

ステレオ画像撮像装置は所定の時間間隔で画像を撮像し、出力する。視差オフセットも所定の時間間隔で算出(更新)されるが、視差オフセット算出の時間間隔は画像撮像の時間間隔と同じでも良いが、画像撮像の時間間隔よりも長くても良い。例えば、視差オフセットの算出に必要な処理時間が画像撮像の時間間隔より長い場合、視差オフセット算出の時間間隔は長くなる。   The stereo image pickup device picks up an image at predetermined time intervals and outputs the image. Although the parallax offset is also calculated (updated) at a predetermined time interval, the time interval of the parallax offset calculation may be the same as the time interval of image capturing, but may be longer than the time interval of image capturing. For example, when the processing time required to calculate the parallax offset is longer than the time interval for capturing an image, the time interval for calculating the parallax offset is long.

このように、本発明の校正装置では、視差オフセット算出の対象となる特徴点は立体物上に存在すれば良く、特徴点の抽出は自動で行うので、ステレオ画像撮像装置で撮像されるほぼ全ての画像を利用することができる。また、少なくとも2つの特徴点が存在すれば良く、特徴点の3つの座標(x座標、y座標、z座標)を使用して視差オフセットを算出できるので、計測データが少なくても精度良く視差オフセットを算出することができる。   As described above, in the calibration device of the present invention, the feature points to be subjected to the parallax offset calculation may be present on a three-dimensional object, and the feature points are automatically extracted. Therefore, almost all images captured by the stereo image capturing device You can use the image of In addition, as long as at least two feature points need to be present and the parallax offset can be calculated using the three coordinates (x coordinate, y coordinate, z coordinate) of the feature point, the parallax offset can be accurately performed even if the measurement data is small. Can be calculated.

以下に、本発明の実施の形態を、図面を参照して詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

図3は本発明の構成例(第1実施形態)を示すブロック図である。本構成例では、校正装置20は、メモリ210、立体物特徴点抽出部220、視差算出部230、移動検出部240及び視差オフセット算出部250より構成され、ステレオ画像撮像装置10から出力される基準画像及び比較画像を入力し、視差オフセットを算出する。   FIG. 3 is a block diagram showing a configuration example (first embodiment) of the present invention. In this configuration example, the calibration device 20 includes the memory 210, the solid object feature point extraction unit 220, the disparity calculation unit 230, the movement detection unit 240, and the disparity offset calculation unit 250, and the reference output from the stereo image capturing device 10. An image and a comparison image are input, and a parallax offset is calculated.

ステレオ画像撮像装置10は2台のカメラを備え、2台のカメラの焦点距離は同じfで、カメラ間の距離(基線長)はBで、光軸が平行になるように事前に調整されている。この2台のカメラが平行等位になるようにステレオ画像撮像装置10は車両等の移動体に設置される。移動体の進行方向に向かって右側(図1においてカメラ11の位置に相当)のカメラが基準画像を撮像し、左側(図1においてカメラ12の位置に相当)のカメラが比較画像を撮像する。基準画像及び比較画像は同じタイミングで所定の時間間隔で撮像され、前述のように、補正(シェーディング補正、カメラ間感度差補正、歪み補正等)並びに回転ずれ及び縦ずれの校正が施されて、出力される。   The stereo image capturing apparatus 10 includes two cameras, the focal length of the two cameras is the same f, the distance between the cameras (base length) is B, and the optical axes are adjusted in advance so as to be parallel. There is. The stereo image pickup device 10 is installed on a movable body such as a vehicle so that the two cameras are in parallel equidistant position. The camera on the right (corresponding to the position of the camera 11 in FIG. 1) captures the reference image in the traveling direction of the moving body, and the camera on the left (corresponding to the position of the camera 12 in FIG. 1) captures the comparison image. The reference image and the comparison image are captured at predetermined time intervals at the same timing and subjected to correction (shading correction, inter-camera sensitivity difference correction, distortion correction, etc.) and rotational shift and vertical shift calibration as described above, It is output.

ステレオ画像撮像装置10から出力された基準画像及び比較画像はメモリ210に格納される。立体物特徴点抽出部220は、メモリ210に格納された基準画像(基準画像1)から複数の特徴点(特徴点1)を抽出する。視差算出部230は、メモリ210に格納された基準画像1とそれに対応した比較画像(比較画像1)を用いて、特徴点1の視差(視差1)をステレオマッチングにて算出する。移動検出部240はオプティカルフロー検出部241及び視差検出部242より構成され、オプティカルフロー検出部241は、基準画像1より後に撮像された基準画像(基準画像2)をメモリ210から読み出し、オプティカルフローの検出手法により基準画像2から特徴点1に対応する特徴点(特徴点2)を検出し、視差算出部242は、基準画像2とそれに対応した比較画像(比較画像2)を用いて、特徴点2の視差(視差2)をステレオマッチングにて算出する。視差オフセット算出部250は、特徴点1及び特徴点2の画面座標の値並びに視差1及び視差2から数値解析により視差オフセットを算出する。   The reference image and the comparison image output from the stereo image capturing device 10 are stored in the memory 210. The three-dimensional object feature point extraction unit 220 extracts a plurality of feature points (feature points 1) from the reference image (reference image 1) stored in the memory 210. The disparity calculating unit 230 calculates the disparity (disparity 1) of the feature point 1 by stereo matching using the reference image 1 stored in the memory 210 and the comparison image (comparison image 1) corresponding thereto. The movement detection unit 240 includes an optical flow detection unit 241 and a parallax detection unit 242. The optical flow detection unit 241 reads from the memory 210 a reference image (reference image 2) captured after the reference image 1, The feature point (feature point 2) corresponding to the feature point 1 is detected from the reference image 2 by the detection method, and the parallax calculating unit 242 uses the reference image 2 and the comparison image (comparison image 2) corresponding thereto. The two parallaxes (parallax 2) are calculated by stereo matching. The parallax offset calculation unit 250 calculates the parallax offset from the values of the screen coordinates of the feature point 1 and the feature point 2 and the parallax 1 and the parallax 2 by numerical analysis.

このような構成の校正装置20の動作例を図4のフローチャートを参照して説明する。   An operation example of the calibration apparatus 20 having such a configuration will be described with reference to the flowchart of FIG.

ステレオ画像撮像装置10が所定の時間間隔で撮像して出力した基準画像及び比較画像は、順次、メモリ210に格納される。メモリ210には、同じタイミングで撮像された基準画像と比較画像が対応付くように格納される。   The reference image and the comparison image that are picked up and output at predetermined time intervals by the stereo image pickup device 10 are sequentially stored in the memory 210. The memory 210 stores the reference image and the comparison image, which are captured at the same timing, in correspondence with each other.

立体物特徴点抽出部220は、時刻t1に撮像された基準画像SP1をメモリ210より読み出し、非特許文献1に記載されている「特徴点検出」の方法により複数の特徴点(特徴点1)を抽出する(ステップS10)。基準画像には、図2で示されている撮像面と同様の座標軸(i軸、j軸)をもつ二次元の座標(画面座標)が設定されており、抽出された各特徴点1の画面座標での座標値(I1,J1)(k=1,2,…,K、Kは特徴点の数)を要素とした画面座標データ(画面座標)TC1が出力される。 The three-dimensional object feature point extraction unit 220 reads the reference image SP1 captured at time t1 from the memory 210, and a plurality of feature points (feature points 1) according to the method of “feature point detection” described in Non-Patent Document 1. Are extracted (step S10). In the reference image, two-dimensional coordinates (screen coordinates) having coordinate axes (i-axis, j-axis) similar to those of the imaging plane shown in FIG. 2 are set, and the screen of each extracted feature point 1 Screen coordinate data (screen coordinates) TC1 having the coordinate values (I1 k , J1 k ) (k = 1, 2,..., K, and K are the number of feature points) at the coordinates are output.

画面座標データTC1は視差算出部230、オプティカルフロー検出部241及び視差オフセット算出部250に入力される。   The screen coordinate data TC1 is input to the disparity calculating unit 230, the optical flow detecting unit 241, and the disparity offset calculating unit 250.

視差算出部230は、基準画像SP1及び基準画像SP1に対応付けられた時刻t1に撮像された比較画像CP1をメモリ210より読み出し、画面座標データTC1を用いて、ステレオマッチングの手法により、各特徴点1の視差を算出する。ステレオマッチングの手法としては画像を小領域(ウィンドウ)に分けてマッチングする領域ベース法を使用し、マッチングの評価関数としてはSAD(Sum of Absolute Difference)関数を使用する。まず、画面座標データTC1により基準画像SP1における特徴点1の位置(基準位置1)を特定する。基準位置1を特定した後、比較画像CP1において、図5に示されるような、基準位置1より水平方向の右側の領域の画像データ(輝度)と基準画像SP1での基準位置1の画像データ(輝度)とのマッチングを行う(ステップS20)。即ち、両方の画像データのSAD値をSAD関数より算出し、マッチング領域内でSAD値が最小となる箇所を比較画像CP1での特徴点1の位置(比較位置1)とする。ステレオ画像撮像装置10内での2台のカメラの位置より、マッチング領域を図4に示される領域に限定している。そして、基準位置1と比較位置1のずれから視差を算出するが、ずれの精度を上げるために、サブピクセル精度の視差を求める(ステップS30)。図6は、図5に示されるマッチング領域での一部のSAD値を模擬化した図で、s2において最小のSAD値になっているとする。図6において、SAD関数は最小値付近では線形近似できると仮定し、SAD値が最小となる位置のs2とその前後の位置のSAD値のうちSAD値が大きい方の位置(図6ではs3)を直線で結び(図6では直線s2s3)、さらに傾きがその直線の傾きと逆符号でSAD値が小さい方の位置(図6ではs1)を通る直線を引き、2つの直線の交点を真の比較位置1とする。この真の比較位置1と基準位置1のずれを視差とする。なお、最小値付近でのSAD関数を線形近似ではなく、二次曲線等で近似しても良い。算出された各特徴点1の視差D1(k=1,2,…,K)は視差データPA1として視差オフセット算出部250に出力される。 The disparity calculating unit 230 reads the comparison image CP1 captured at time t1 associated with the reference image SP1 and the reference image SP1 from the memory 210, and uses the screen coordinate data TC1 to perform feature matching by stereo matching. Calculate the disparity of 1. The stereo matching method uses a region-based method in which an image is divided into small regions (windows) for matching, and a SAD (Sum of Absolute Difference) function is used as a matching evaluation function. First, the position (reference position 1) of the feature point 1 in the reference image SP1 is specified by the screen coordinate data TC1. After specifying the reference position 1, as shown in FIG. 5, in the comparison image CP1, the image data (brightness) of the region on the right side in the horizontal direction from the reference position 1 and the image data of the reference position 1 in the reference image SP1 ( Matching with the luminance) (step S20). That is, SAD values of both image data are calculated by the SAD function, and a position where the SAD value is minimum in the matching area is set as the position (comparison position 1) of the feature point 1 in the comparison image CP1. From the positions of the two cameras in the stereo image pickup device 10, the matching area is limited to the area shown in FIG. Then, the parallax is calculated from the deviation between the reference position 1 and the comparison position 1, but in order to increase the deviation accuracy, the parallax with sub-pixel accuracy is obtained (step S30). FIG. 6 is a diagram simulating a part of SAD values in the matching area shown in FIG. 5, and it is assumed that the minimum SAD value is obtained at s2. In FIG. 6, it is assumed that the SAD function can be linearly approximated near the minimum value, and the position of the one with the largest SAD value (s3 in FIG. 6) among s2 of the position where the SAD value is minimum and the position before and after it. Are drawn by a straight line (line s2s3 in FIG. 6), and the slope is the reverse sign of the slope of the straight line and the SAD value is smaller (in FIG. 6) a straight line is drawn. The comparison position is 1. The deviation between the true comparison position 1 and the reference position 1 is taken as parallax. The SAD function near the minimum value may be approximated not by linear approximation but by a quadratic curve or the like. The calculated parallax D1 k (k = 1, 2,..., K) of each feature point 1 is output to the parallax offset calculation unit 250 as parallax data PA1.

画面座標データTC1を入力したオプティカルフロー検出部241は、メモリ210より基準画像SP1と時刻t2(t2>t1)に撮像された基準画像SP2を読み出し、オプティカルフローの検出手法により基準画像SP2から特徴点1に対応する特徴点(特徴点2)を検出する。まず、画面座標データTC1により基準画像SP1における特徴点1の位置(基準位置1)を特定する。基準位置1を特定した後、ステレオマッチングの手法と同様に、SAD関数を評価関数として、基準画像SP2において、基準位置1以外の領域の画像データと基準画像SP1での基準位置1の画像データとのマッチングを行う(ステップS40)。即ち、両方の画像データのSAD値をSAD関数より算出し、SAD値が最小となる箇所を特徴点2の仮の位置とする。この際、マッチング領域を、図7に示されるように、特徴点1の移動先として予測される領域に限定しても良い。特徴点2の仮の位置を検出したら、視差検出部230と同様に、仮の位置を基にサブピクセル精度で特徴点2の位置(基準位置2)を求める(ステップS50)。即ち、仮の位置の上下左右の位置のSAD値を基に、i軸方向及びj軸方向の両方向で線形近似等により基準位置2を求める。求められた基準位置2の座標値(I2,J2)(k=1,2,…,K)は画面座標データTC2として視差算出部242及び視差オフセット算出部250に出力される。 The optical flow detection unit 241 which has input the screen coordinate data TC1 reads the reference image SP1 and the reference image SP2 captured at time t2 (t2> t1) from the memory 210, and detects the feature points from the reference image SP2 by the optical flow detection method. A feature point (feature point 2) corresponding to 1 is detected. First, the position (reference position 1) of the feature point 1 in the reference image SP1 is specified by the screen coordinate data TC1. After specifying the reference position 1, similarly to the stereo matching method, with the SAD function as an evaluation function, in the reference image SP2, image data of an area other than the reference position 1 and image data of the reference position 1 in the reference image SP1. Matching is performed (step S40). That is, the SAD values of both image data are calculated by the SAD function, and the place where the SAD value is minimum is taken as the temporary position of the feature point 2. At this time, as shown in FIG. 7, the matching area may be limited to the area predicted as the movement destination of the feature point 1. When the temporary position of the feature point 2 is detected, the position (reference position 2) of the feature point 2 is obtained with sub-pixel accuracy based on the temporary position, as in the parallax detection unit 230 (step S50). That is, based on the SAD values at the upper, lower, left, and right positions of the temporary position, the reference position 2 is determined by linear approximation or the like in both the i-axis direction and the j-axis direction. The calculated coordinate values (I2 k , J2 k ) (k = 1, 2,..., K) of the reference position 2 are output to the parallax calculating unit 242 and the parallax offset calculating unit 250 as screen coordinate data TC2.

視差算出部242は、基準画像SP2及び基準画像SP2に対応付けられた時刻t2に撮像された比較画像CP2をメモリ210より読み出し、画面座標データTC2を用いて、視差算出部230と同様にステレオマッチングの手法により、各特徴点2の視差を算出する(ステップS60、S70)。動作内容は視差算出部230と同様である。算出された各特徴点2の視差D2(k=1,2,…,K)は視差データPA2として視差オフセット算出部250に出力される。 The parallax calculating unit 242 reads the comparison image CP2 captured at time t2 associated with the reference image SP2 and the reference image SP2 from the memory 210, and uses the screen coordinate data TC2 to perform stereo matching similarly to the parallax calculating unit 230. The parallax of each feature point 2 is calculated by the following method (steps S60 and S70). The operation content is the same as that of the disparity calculating unit 230. The calculated parallax D2 k (k = 1, 2,..., K) of each feature point 2 is output to the parallax offset calculation unit 250 as parallax data PA2.

視差オフセット算出部250は、入力された画面座標データTC1、視差データPA1、画面座標データTC2及び視差データPA2を用いて、下記数12で定義される評価関数F(D0)を最小とする視差オフセットD0を数値解析の手法(最急降下法、ニュートン法等)により求める(ステップS80)。   The parallax offset calculation unit 250 uses the input screen coordinate data TC1, parallax data PA1, screen coordinate data TC2 and parallax data PA2 to minimize the parallax offset that minimizes the evaluation function F (D0) defined by the following equation 12. D0 is determined by a numerical analysis method (the steepest descent method, Newton method, etc.) (step S80).

ここで、a,bは1以上K以下の整数で、
はa<bを満たすa,bの各組合せでの二乗和の総和を意味する。
Here, a and b are integers of 1 or more and K or less,
Denotes the sum of the sum of squares at each combination of a and b satisfying a <b.

算出された視差オフセットD0は校正装置20を搭載した距離計測装置での距離計測に用いられる視差の補正に使用される。   The calculated parallax offset D0 is used to correct the parallax used for distance measurement in the distance measuring device on which the calibration device 20 is mounted.

ステレオ画像撮像装置10が画像を撮像する時間間隔と同じ時間間隔で視差オフセットの算出を行う場合は、基準画像2を基準画像1とし、比較画像2を比較画像1として、次の時刻に撮像された画像を基準画像2及び比較画像2として、ステップS10〜S80を繰り返す。この場合、立体物特徴点抽出部220の特徴点抽出(ステップS10)及び視差算出部230の視差算出(ステップS20、S30)を省略し、オプティカルフロー検出部241が検出した基準位置2及び視差算出部242が算出した視差を流用しても良い。   When the parallax offset is calculated at the same time interval as the time interval at which the stereo imaging device 10 captures an image, the reference image 2 is taken as the reference image 1 and the comparison image 2 is taken as the comparison image 1 at the next time Steps S10 to S80 are repeated using the obtained images as the reference image 2 and the comparison image 2. In this case, the feature point extraction (step S10) of the solid object feature point extraction unit 220 and the parallax calculation (steps S20 and S30) of the parallax calculation unit 230 are omitted, and the reference position 2 detected by the optical flow detection unit 241 and the parallax calculation The parallax calculated by the unit 242 may be diverted.

視差オフセットD0の算出は、前述のように、数値解析の手法ではなく、EXab=0、EYab=0及びEZab=0(a<b)を満たす個別視差オフセットを算出し、算出された全ての個別視差オフセットの代表値(平均値、最頻値等)を視差オフセットD0とする方法で行っても良い。この方法において、前述のように、不適と推測される個別視差オフセットを除外しても良い。数値解析による方法と個別視差オフセット算出による方法を組み合わせた方法で視差オフセットを算出しても良い。 As described above, the parallax offset D0 is calculated not by using a numerical analysis method, but by calculating individual parallax offsets that satisfy EX ab = 0, EY ab = 0, and EZ ab = 0 (a <b) The representative value (average value, mode value, etc.) of all the individual disparity offsets may be set as the disparity offset D0. In this method, as described above, individual disparity offsets that are presumed to be unsuitable may be excluded. The parallax offset may be calculated by a method combining the method by numerical analysis and the method by individual parallax offset calculation.

なお、第1実施形態では、視差算出部230及び242でのステレオマッチング並びにオプティカルフロー検出部241でのオプティカルフロー検出における評価関数としてSAD関数を使用しているが、SSD(Sum of Squared Difference)関数を使用しても良い。または、SAD関数又はSSD関数を使用した方法ではなく、位相限定相関法によりずれを算出しても良い。また、サブピクセル精度で位置を求めているが、精度よりも処理時間を優先する場合等では、サブピクセル精度まで求めなくても良い。   In the first embodiment, the SAD function is used as an evaluation function in stereo matching in the parallax calculation units 230 and 242 and optical flow detection in the optical flow detection unit 241. However, an SSD (Sum of Squared Difference) function is used. You may use Alternatively, instead of using the SAD function or the SSD function, the deviation may be calculated by the phase only correlation method. In addition, although the position is determined with sub-pixel accuracy, it is not necessary to determine sub-pixel accuracy when processing time is prioritized over accuracy.

また、オプティカルフロー検出部241は、基準画像SP2から特徴点2を検出しているが、比較画像CP2から検出しても良い。この場合においてマッチング領域を限定する場合は、視差算出部230が出力した視差データPA1を利用することになり、視差算出部242は、基準画像SP2において特徴点2の検出を行い、視差D2(k=1,2,…,K)を算出することになる。 Further, the optical flow detection unit 241 detects the feature point 2 from the reference image SP2, but may detect it from the comparison image CP2. In this case, when limiting the matching area, the parallax data PA1 output from the parallax calculating unit 230 is used, and the parallax calculating unit 242 detects the feature point 2 in the reference image SP2, and the parallax D2 k k = 1, 2,..., K) is to be calculated.

第1実施形態での動作例では、立体物特徴点抽出部220、視差算出部230、オプティカルフロー検出部241及び視差算出部242は、それぞれ全ての特徴点に対する処理が完了した後にデータを出力しているが、立体物特徴点抽出部220が特徴点1を抽出するたびに座標値を出力し、視差算出部230、オプティカルフロー検出部241及び視差算出部242の処理を実行するようにしても良い。即ち、ステップS10〜S70を特徴点単位で実行し、全ての特徴点に対する処理が完了した後に、ステップS80を実行する。   In the operation example in the first embodiment, the three-dimensional object feature point extraction unit 220, the parallax calculation unit 230, the optical flow detection unit 241, and the parallax calculation unit 242 each output data after processing for all feature points is completed. However, the coordinate value is output each time the solid object feature point extraction unit 220 extracts the feature point 1, and the processes of the parallax calculation unit 230, the optical flow detection unit 241, and the parallax calculation unit 242 may be executed. good. That is, steps S10 to S70 are executed in units of feature points, and after processing for all feature points is completed, step S80 is executed.

図8は、本発明のシミュレーション結果を示す図である。   FIG. 8 is a diagram showing simulation results of the present invention.

移動体の前方10mと20mに立体物を置き、移動体を5m前進させ、前進前と前進後の2地点でそれぞれ基準画像と比較画像を撮像する。B×f=100、視差オフセットD0=5と設定し、それぞれの立体物に特徴点を1点ずつ設定した場合(2points)、2点ずつ設定した場合(4points)及び3点ずつ設定した場合(6points)でシミュレーションを行った。なお、視差の測定精度は0.2px(ピクセル)である。図8において、横軸は視差オフセットD0、縦軸は評価関数のDensity(深さ)である。図8で示されるように、3つの場合全てにおいてD0=5近辺にピークがあり、高精度に視差オフセットが検出されていることがわかる。   A solid object is placed 10 m and 20 m in front of the moving object, the moving object is advanced 5 m, and a reference image and a comparison image are respectively taken at two points before and after advancing. When B × f = 100 and disparity offset D0 = 5 are set, and one feature point is set to each solid object (2 points), two points are set (4 points) and three points are set (3 points) The simulation was performed at 6 points). The parallax measurement accuracy is 0.2 px (pixel). In FIG. 8, the horizontal axis is the parallax offset D0, and the vertical axis is the density (depth) of the evaluation function. As shown in FIG. 8, it can be seen that there is a peak near D0 = 5 in all three cases, and the parallax offset is detected with high accuracy.

第1実施形態において、視差オフセット算出部が視差オフセットを算出する前に、不適切な特徴点の組合せを検出し、視差オフセットの算出ではその組合せは使用しないことにより、視差オフセットの算出の精度を上げることができる。具体的には、2つの特徴点の三次元座標におけるx座標、y座標及びz座標での時刻t1からt2までの変化量(移動量)の差を算出し、その差が所定の閾値以上の特徴点の組合せは視差オフセットの算出では使用しない。このような特徴点は異なる移動物体上に存在している等の可能性があるので、条件を満たさないのである。   In the first embodiment, before the disparity offset calculation unit calculates the disparity offset, the combination of inappropriate feature points is detected, and the combination is not used in the calculation of the disparity offset, so that the accuracy of calculation of the disparity offset can be calculated. You can raise it. Specifically, the difference between the amount of change (amount of movement) from time t1 to t2 in the three-dimensional coordinates of the two feature points in the three-dimensional coordinates and y coordinates is calculated, and the difference is equal to or greater than a predetermined threshold The combination of feature points is not used in the calculation of disparity offset. Such feature points do not satisfy the condition because they may be present on different moving objects.

上述の不適切な特徴点の組合せを除外する機能を追加した構成例(第2実施形態)のブロック図を図9に示す。視差オフセット算出部350を除いて、第2実施形態の構成は、図3に示される第1実施形態の構成と同じであるため、同一構成についての説明は省略する。   A block diagram of a configuration example (second embodiment) to which a function of excluding the combination of the above-mentioned inappropriate feature points is added is shown in FIG. The configuration of the second embodiment is the same as that of the first embodiment shown in FIG. 3 except for the parallax offset calculation unit 350, and thus the description of the same configuration is omitted.

視差オフセット算出部350は、移動量検査部351、視差オフセット推定部352及びメモリ353より構成される。移動量検査部351は、特徴点1及び特徴点2の画面座標の値、視差1及び視差2、さらにメモリ353に格納された視差オフセットを用いて各特徴点の三次元座標におけるx座標、y座標及びz座標での時刻t1からt2までの変化量を算出し、変化量の差(絶対値)が所定の閾値以上の特徴点の組合せを抽出する。視差オフセット推定部352は、移動量検査部351が抽出した特徴点の組合せを除いた組合せで、特徴点1及び特徴点2の画面座標の値並びに視差1及び視差2から数値解析等により視差オフセットを算出する。算出された視差オフセットは出力されるとともに、メモリ353に格納され、次の視差オフセット算出での移動量検査部351の変化量算出に使用される。なお、変化量算出で使用する視差オフセットの初期値としては0を使用する。   The disparity offset calculating unit 350 includes a movement amount checking unit 351, a disparity offset estimating unit 352, and a memory 353. The movement amount inspection unit 351 uses the values of screen coordinates of the feature point 1 and the feature point 2, the parallax 1 and the parallax 2, and the parallax offset stored in the memory 353, and the x coordinate in three dimensions of each feature point The amount of change from time t1 to t2 in the coordinate and z coordinate is calculated, and a combination of feature points whose difference (absolute value) in the amount of change is equal to or greater than a predetermined threshold value is extracted. The parallax offset estimation unit 352 is a combination excluding the combination of the feature points extracted by the movement amount inspection unit 351 and is a parallax offset by numerical analysis or the like from the values of the screen coordinates of the feature point 1 and the feature point 2 and the parallax 1 and parallax 2 Calculate The calculated parallax offset is output, and is stored in the memory 353, and is used to calculate the amount of change of the movement amount inspection unit 351 in the next parallax offset calculation. In addition, 0 is used as an initial value of the parallax offset used by change amount calculation.

視差オフセット算出部350の動作例を図10のフローチャートを参照して説明する。   An operation example of the disparity offset calculation unit 350 will be described with reference to the flowchart of FIG.

移動量検査部351は、画面座標データTC1、視差データPA1、画面座標データTC2及び視差データPA2を入力し、メモリ353に格納された視差オフセットD0を読み出し、各特徴点の三次元座標におけるx座標、y座標及びz座標での時刻t1からt2までの変化量VX、VY及びVZ(k=1,2,…,K)を下記数13より算出する(ステップS810)。 The movement amount inspection unit 351 receives the screen coordinate data TC1, the parallax data PA1, the screen coordinate data TC2 and the parallax data PA2, reads the parallax offset D0 stored in the memory 353, and x coordinate in three dimensional coordinates of each feature point The change amounts VX k , VY k and VZ k (k = 1, 2,..., K) from time t1 to t2 in the y and z coordinates are calculated from the following equation 13 (step S810).

そして、下記数14より算出される2つの特徴点の変化量の差(絶対値)ΔVXab、ΔVYab及びΔVZab(a,bは1以上K以下の整数、a<b)の少なくとも1つが所定の閾値θ以上である特徴点の組合せを抽出し(ステップS820)、除外組合せデータEPとして出力する。 Then, at least one of differences (absolute values) ΔVX ab , ΔVY ab and ΔVZ ab (where a and b are integers of 1 or more and K or less, a <b) between the amounts of change of two feature points calculated from A combination of feature points which are equal to or greater than a predetermined threshold θ is extracted (step S820), and is output as excluded combination data EP.

なお、所定の閾値θはΔVXab、ΔVYab及びΔVZabに対して共通ではなく、異なる閾値を用いても良い。 The predetermined threshold θ may not be common to ΔVX ab , ΔVY ab, and ΔVZ ab , and different threshold may be used.

視差オフセット推定部352は、画面座標データTC1、視差データPA1、画面座標データTC2、視差データPA2及び除外組合せデータEPを入力し、除外組合せデータEPに含まれる特徴点の組合せ以外の特徴点の組合せで、画面座標データTC1、視差データPA1、画面座標データTC2及び視差データPA2を用いて、第1実施形態での視差オフセット算出部250と同様に、数値解析の手法等により視差オフセットD0を求める(ステップS830)。   The parallax offset estimation unit 352 receives the screen coordinate data TC1, the parallax data PA1, the screen coordinate data TC2, the parallax data PA2, and the excluded combination data EP, and combines the feature points other than the combination of the feature points included in the excluded combination data EP. Then, using the screen coordinate data TC1, the parallax data PA1, the screen coordinate data TC2, and the parallax data PA2, the parallax offset D0 is determined by the numerical analysis method or the like as in the parallax offset calculation unit 250 in the first embodiment Step S830).

なお、第2実施形態では、不適切な特徴点の組合せの抽出と視差オフセットの算出を分けて行っているが、視差オフセットの算出の中で不適切な特徴点の組合せの抽出を行い、抽出された組合せを視差オフセットの算出に使用しないようにしても良い。即ち、ステップS820及びS830を特徴点の組合せ単位で実行しても良い。   In the second embodiment, extraction of an inappropriate combination of feature points and calculation of a parallax offset are separately performed, but extraction of an inappropriate combination of feature points in calculation of a parallax offset is performed and extraction is performed. You may make it not use the calculated combination for calculation of parallax offset. That is, steps S820 and S830 may be performed in combination of feature points.

視差オフセットの算出において、特徴点の移動距離が短すぎると、算出される視差オフセットの精度が落ちる可能性があり、特徴点の移動距離が長い方が精度を上げることができる。しかし、移動距離が長いと、移動後の特徴点を画像から検出するのに時間がかかり、特徴点を正確に検出できないおそれもある。そこで、特徴点を抽出した後、ステレオ画像撮像装置から出力される所定の数の画像に対しては特徴点の検出(オプティカルフローの検出)のみを行い、その後の画像に対して視差オフセットの算出まで行うことにより、特徴点の検出の精度を落とすことなく、算出される視差オフセットの精度を上げることができる。   In the calculation of the parallax offset, if the movement distance of the feature point is too short, the accuracy of the calculated parallax offset may fall, and the longer the movement distance of the feature point, the higher the accuracy. However, when the movement distance is long, it takes time to detect the feature point after movement from the image, and there is also a possibility that the feature point can not be detected accurately. Therefore, after extracting feature points, only detection of feature points (detection of optical flow) is performed on a predetermined number of images output from the stereo image pickup apparatus, and parallax offset is calculated on the subsequent images. By performing the above, it is possible to increase the accuracy of the calculated parallax offset without degrading the detection accuracy of the feature point.

このような処理を行う本発明の構成例(第3実施形態)のブロック図を図11に示す。図3に示される第1実施形態に対して、第3実施形態にはスイッチ410〜415が追加され、さらに移動検出部にメモリ443が追加されている。なお、第1実施形態と同一構成には同一符号を付して説明は省略する。   A block diagram of a configuration example (third embodiment) of the present invention that performs such processing is shown in FIG. With respect to the first embodiment shown in FIG. 3, switches 410 to 415 are added to the third embodiment, and a memory 443 is further added to the movement detection unit. The same components as those of the first embodiment are denoted by the same reference numerals and the description thereof will be omitted.

第3実施形態の動作例を図12のフローチャートを参照して説明する。なお、第3実施形態では、時刻tに撮像された画像から特徴点の抽出を行い、時刻t,t,…,tに撮像された画像は特徴点の検出のみを行い、時刻tN+1に撮像された画像に対して視差オフセットの検出まで行うとする。 An operation example of the third embodiment will be described with reference to the flowchart of FIG. In the third embodiment, it was extracted from the captured image of the feature point in time t 1, the time t 2, t 3, ..., images captured at t N only performs detection of the feature point, time It is assumed that detection of parallax offset is performed on an image captured at t N + 1 .

立体物特徴点抽出部220が時刻tに撮像された画像を基準画像SP1及び比較画像CP1としてメモリ210より読み出す時、スイッチ410,411はONで、スイッチ412,413,414,415はOFFとなる(ステップS100)。立体物特徴点抽出部220は特徴点の抽出を行い、視差算出部230は視差の算出を行い、画面座標データTC1及び視差データPA1が視差オフセット算出部250に出力される(ステップS110)。画面座標データTC1はオプティカルフロー検出部441にも出力され、オプティカルフロー検出部441は第1実施形態でのオプティカルフロー検出部241と同様に、時刻tに撮像された基準画像SP2をメモリ210より読み出して、基準画像SP1も用いて特徴点を検出し、画面座標データTC2を出力する(ステップS120)。出力された画面座標データTC2はメモリ443に格納される。 When three-dimensional object feature point extraction unit 220 reads from the memory 210 the image captured at time t 1 as a reference image SP1 and comparison image CP1, switches 410 and 411 in ON, the switch 412,413,414,415 is OFF and (Step S100). The three-dimensional object feature point extraction unit 220 extracts feature points, the parallax calculation unit 230 calculates parallax, and the screen coordinate data TC1 and the parallax data PA1 are output to the parallax offset calculation unit 250 (step S110). Screen coordinate data TC1 is output to the optical flow detection section 441, from the optical flow detection unit 441, like the optical flow detector 241 in the first embodiment, the memory 210 the reference image SP2 captured at time t 2 The feature point is detected using the reference image SP1 as well, and the screen coordinate data TC2 is output (step S120). The output screen coordinate data TC2 is stored in the memory 443.

次に、スイッチ410,411,412,413,414はOFFで、スイッチ415のみONとなる(ステップS130)。そして、オプティカルフロー検出部441の特徴点検出のみが実施される。即ち、オプティカルフロー検出部441は、時刻tに撮像された画像を基準画像SP1としてメモリ210より読み出し、時刻tに撮像された画像を基準画像SP2として読み出し、さらにメモリ443より画面座標データTC2を読み出し、基準画像SP2より特徴点を検出する(ステップS140)。この際、基準画像SP1における特徴点の位置の特定を、画面座標データTC2を用いて行う。検出された特徴点の座標値は画面座標データTC2として出力され、メモリ443に格納される。格納された画面座標データTC2は、次の時刻での特徴点の位置の特定に使用される。 Next, the switches 410, 411, 412, 413 and 414 are turned off, and only the switch 415 is turned on (step S130). Then, only feature point detection of the optical flow detection unit 441 is performed. That is, the optical flow detection unit 441 reads from the memory 210 the image captured at time t 2 as a reference image SP1, reads out the image captured at time t 3 as a reference image SP2, further screen coordinate data TC2 from the memory 443 Are read out, and feature points are detected from the reference image SP2 (step S140). At this time, the position of the feature point in the reference image SP1 is specified using the screen coordinate data TC2. The coordinate values of the detected feature point are output as screen coordinate data TC 2 and stored in the memory 443. The stored screen coordinate data TC2 is used to specify the position of the feature point at the next time.

その後、時刻tN−1に撮像された画像を基準画像SP1としてメモリ210より読み出すまで、各時刻に撮像された画像に対してステップS140を繰り返す。 After that, step S140 is repeated for the image captured at each time until the image captured at time tN -1 is read out from the memory 210 as the reference image SP1.

時刻tに撮像された画像を基準画像SP1としてメモリ210より読み出す時、スイッチ410,411はOFFで、スイッチ412,413,414,415はONとなる(ステップS150)。そして、ステップS140と同様の処理によりオプティカルフロー検出部441は特徴点の検出を行い、画面座標データTC2を出力する(ステップS160)。画面座標データTC2は視差算出部242及び視差オフセット算出部250に入力される。視差算出部242は、メモリ210より時刻tN+1に撮像された画像を基準画像SP2及び比較画像CP2として読み出し、入力した画面座標データTC2を用いて視差を算出し、視差データPA2として視差オフセット算出部250に出力する(ステップS170)。視差オフセット算出部250は、入力された画面座標データTC1、視差データPA1、画面座標データTC2及び視差データPA2を用いて、視差オフセットD0を求める(ステップS180)。 When reading from the memory 210 the image captured at time t N as a reference image SP1, switches 410 and 411 in the OFF, the switch 412,413,414,415 becomes ON (step S150). Then, the optical flow detection unit 441 detects a feature point by the same processing as step S140, and outputs the screen coordinate data TC2 (step S160). The screen coordinate data TC2 is input to the disparity calculating unit 242 and the disparity offset calculating unit 250. The parallax calculation unit 242 reads the image captured at time t N + 1 from the memory 210 as the reference image SP2 and the comparison image CP2, calculates the parallax using the input screen coordinate data TC2, and calculates the parallax offset calculation unit as the parallax data PA2. It outputs to 250 (step S170). The parallax offset calculation unit 250 obtains the parallax offset D0 using the input screen coordinate data TC1, the parallax data PA1, the screen coordinate data TC2, and the parallax data PA2 (step S180).

なお、第3実施形態では、撮像された画像に対する処理の切り替えをスイッチにて行っているが、時刻に関する情報等を画像に付加し、その情報を基に各部にて行う処理を切り替えるようにしても良い。

以上、本発明に係る校正装置について説明したが、本発明は上述の実施形態に限らず、本発明の要旨を逸脱することなく、その他種々の構成、方法を採り得ることは勿論である。また、本発明に係る校正装置は、コンピュータシステムを利用し、ソフトウェア(コンピュータプログラム)により実装されることができ、そして、ASIC(Application Specific Integrated Circuit)、GPU(Graphics Processing Unit)やFPGA(Field Programmable Gate Array)等のハードウェアにより実装されることも勿論できる。
In the third embodiment, the switch of the processing for the captured image is performed by a switch, but information on the time is added to the image, and the processing to be performed in each part is switched based on the information. Also good.

The calibration apparatus according to the present invention has been described above. However, the present invention is not limited to the above-described embodiment, and it goes without saying that various other configurations and methods can be adopted without departing from the scope of the present invention. Further, the calibration device according to the present invention can be implemented by software (computer program) using a computer system, and ASIC (Application Specific Integrated Circuit), GPU (Graphics Processing Unit), FPGA (Field Programmable) It can of course be implemented by hardware such as Gate Array).

11、12 カメラ
10 ステレオ画像撮像装置
20、30、40 校正装置
210、353、443 メモリ
220 立体物特徴点抽出部
230、242、 視差検出部
240、440 移動検出部
241、441 オプティカルフロー検出部
250、350 視差オフセット算出部
351 移動量検査部
352 視差オフセット推定部
410、411、412、413、414、415 スイッチ
Reference Signs List 11 and 12 camera 10 stereo image capturing device 20, 30, 40 calibration device 210, 353, 443 memory 220 three-dimensional object feature point extraction unit 230, 242, parallax detection unit 240, 440 movement detection unit 241, 441 optical flow detection unit 250 , 350 Parallax offset calculation unit 351 Movement amount inspection unit 352 Parallax offset estimation unit 410, 411, 412, 413, 414, 415 switch

Claims (11)

移動体に搭載されて距離計測を行う距離計測装置にて用いられるステレオ画像撮像装置のパラメータを校正する校正装置において、
前記ステレオ画像撮像装置で撮像された基準画像1の中の立体物上の少なくとも2つの特徴点を抽出し、前記各特徴点の画面座標1を求める立体物特徴点抽出部と、
前記ステレオ画像撮像装置で撮影された比較画像1を用いて前記各特徴点の視差1を算出する視差算出部と、
前記基準画像1及び前記比較画像1を撮像した時刻より所定の時間経過した後に前記ステレオ画像撮像装置で撮像された基準画像2及び比較画像2を入力し、前記基準画像2又は前記比較画像2を用いて前記各特徴点のオプティカルフローを検出し、前記基準画像2及び前記比較画像2を用いて前記基準画像2の中での前記各特徴点の画面座標2及び視差2を算出する移動検出部と、
前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて前記ステレオ画像撮像装置のパラメータの校正に使用する視差オフセットを算出する視差オフセット算出部を備え、
前記視差オフセット算出部は、前記ステレオ画像撮像装置で撮像される画像の画面座標を三次元座標に変換する変換式を用いて前記三次元座標での2点の移動量の差を表わした差分式に基づいて定義された、視差オフセットを未知数とした評価関数により前記視差オフセットを算出することを特徴とする校正装置。
In a calibration device for calibrating parameters of a stereo imaging device used in a distance measurement device mounted on a mobile body and performing distance measurement,
A three-dimensional object feature point extraction unit that extracts at least two feature points on a three-dimensional object in the reference image 1 captured by the stereo image capturing device, and obtains the screen coordinates 1 of the respective feature points;
A disparity calculating unit that calculates the disparity 1 of the feature points using the comparison image 1 captured by the stereo image capturing device;
The reference image 2 and the comparison image 2 captured by the stereo image capturing device are input after a predetermined time has elapsed from the time when the reference image 1 and the comparison image 1 were captured, and the reference image 2 or the comparison image 2 is input. A movement detection unit that detects an optical flow of each of the feature points using the reference image 2 and the comparison image 2 and calculates the screen coordinates 2 and the parallax 2 of the feature points in the reference image 2 When,
A parallax offset calculation unit configured to calculate a parallax offset used for calibration of a parameter of the stereo imaging device using the screen coordinates 1, the parallax 1, the screen coordinates 2 and the parallax 2;
The disparity offset calculation unit is a difference equation representing a difference between movement amounts of two points in the three-dimensional coordinates using a conversion equation that converts screen coordinates of an image captured by the stereo image capturing device into three-dimensional coordinates. A calibration apparatus characterized in that the disparity offset is calculated by an evaluation function with the disparity offset as an unknown number defined based on.
前記評価関数は前記移動量の差の二乗和として定義され、前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて数値解析により前記評価関数を最小とする視差オフセットを求める請求項1に記載の校正装置。   The evaluation function is defined as a sum of squares of differences of the movement amounts, and a parallax offset which makes the evaluation function minimum is obtained by numerical analysis using the screen coordinates 1, the parallax 1, the screen coordinates 2 and the parallax 2. The calibration device according to claim 1. 前記評価関数は前記差分式で構成され、前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて前記各差分式を0とする個別視差オフセットを算出し、前記個別視差オフセットの代表値を前記視差オフセットとする請求項1に記載の校正装置。   The evaluation function is composed of the differential equation, and using the screen coordinates 1, the parallax 1, the screen coordinates 2 and the parallax 2 to calculate an individual parallax offset where the respective difference formulas are 0, the individual parallax offset The calibration apparatus according to claim 1, wherein the disparity offset is a representative value of 前記視差オフセット算出部は、前記画面座標1及び前記視差1より前記各特徴点の三次元座標1を算出し、前記画面座標2及び前記視差2より前記各特徴点の三次元座標2を算出し、前記三次元座標1及び前記三次元座標2より算出される移動量の差が所定の閾値より大きい特徴点の組合せは前記視差オフセットの算出には使用しない請求項1乃至3のいずれかに記載の校正装置。   The disparity offset calculation unit calculates three-dimensional coordinates 1 of the feature points from the screen coordinates 1 and the disparity 1 and calculates three-dimensional coordinates 2 of the feature points from the screen coordinates 2 and the disparity 2 4. The combination according to any one of claims 1 to 3, wherein a combination of feature points whose difference in movement amount calculated from the three-dimensional coordinate 1 and the three-dimensional coordinate 2 is larger than a predetermined threshold is not used for calculating the parallax offset. Calibration device. 前記移動検出部は、前記基準画像1及び前記比較画像1を撮像した時刻後の所定の時間間隔で所定の数の基準画像及び比較画像を入力し、最後に入力した基準画像N及び比較画像N以外の基準画像及び比較画像に対してはオプティカルフローの検出のみを行い、前記基準画像N及び比較画像Nに対してのみ前記各特徴点の視差2の算出まで行う請求項1乃至4のいずれかに記載の校正装置。   The movement detection unit inputs a predetermined number of reference images and comparison images at predetermined time intervals after the time of capturing the reference image 1 and the comparison image 1, and finally inputs the reference image N and the comparison image N. The optical flow is detected only for reference images and comparison images other than the above, and calculation of parallax 2 of each feature point is performed only for the reference image N and the comparison image N. Calibration device as described in. 請求項1乃至5のいずれかに記載の校正装置を搭載していることを特徴とする距離計測装置。   A distance measuring device comprising the calibration device according to any one of claims 1 to 5. 移動体に搭載されて距離計測を行う距離計測装置にて用いられるステレオ画像撮像装置のパラメータを校正する校正方法において、
前記ステレオ画像撮像装置で撮像された基準画像1の中の立体物上の少なくとも2つの特徴点を抽出し、前記各特徴点の画面座標1を求める立体物特徴点抽出ステップと、
前記ステレオ画像撮像装置で撮影された比較画像1を用いて前記各特徴点の視差1を算出する視差算出ステップと、
前記基準画像1及び前記比較画像1を撮像した時刻より所定の時間経過した後に前記ステレオ画像撮像装置で撮像された基準画像2及び比較画像2を入力し、前記基準画像2又は前記比較画像2を用いて前記各特徴点のオプティカルフローを検出し、前記基準画像2及び前記比較画像2を用いて前記基準画像2の中での前記各特徴点の画面座標2及び視差2を算出する移動検出ステップと、
前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて前記ステレオ画像撮像装置のパラメータの校正に使用する視差オフセットを算出する視差オフセット算出ステップを有し、
前記視差オフセット算出ステップは、前記ステレオ画像撮像装置で撮像される画像の画面座標を三次元座標に変換する変換式を用いて前記三次元座標での2点の移動量の差を表わした差分式に基づいて定義された、視差オフセットを未知数とした評価関数により前記視差オフセットを算出することを特徴とする校正方法。
In a calibration method for calibrating parameters of a stereo image pickup device mounted on a moving body and used in a distance measurement device that performs distance measurement,
A solid object feature point extraction step of extracting at least two feature points on a solid object in the reference image 1 captured by the stereo image capturing device, and determining screen coordinates 1 of the feature points;
A parallax calculation step of calculating the parallax 1 of the feature points using the comparative image 1 captured by the stereo image capturing device;
The reference image 2 and the comparison image 2 captured by the stereo image capturing device are input after a predetermined time has elapsed from the time when the reference image 1 and the comparison image 1 were captured, and the reference image 2 or the comparison image 2 is input. A movement detection step of detecting an optical flow of each of the feature points using the reference image 2 and the comparison image 2 to calculate screen coordinates 2 and a parallax 2 of the feature points in the reference image 2 When,
A parallax offset calculating step of calculating a parallax offset to be used for calibration of a parameter of the stereo imaging device using the screen coordinates 1, the parallax 1, the screen coordinates 2 and the parallax 2;
The disparity offset calculating step is a difference formula representing a difference between movement amounts of two points in the three-dimensional coordinates using a conversion formula for converting screen coordinates of an image captured by the stereo image capturing apparatus into three-dimensional coordinates. And calculating the disparity offset using an evaluation function with the disparity offset as an unknown number defined on the basis of.
前記評価関数は前記時間変化量の二乗和として定義され、前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて数値解析により前記評価関数を最小とする視差オフセットを求める請求項7に記載の校正方法。   The evaluation function is defined as a sum of squares of the time variation, and a parallax offset which makes the evaluation function minimum is obtained by numerical analysis using the screen coordinates 1, the parallax 1, the screen coordinates 2 and the parallax 2. The calibration method according to Item 7. 前記評価関数は前記差分式で構成され、前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて前記各差分式を0とする個別視差オフセットを算出し、前記個別視差オフセットの代表値を前記視差オフセットとする請求項7に記載の校正方法。   The evaluation function is composed of the differential equation, and using the screen coordinates 1, the parallax 1, the screen coordinates 2 and the parallax 2 to calculate an individual parallax offset where the respective difference formulas are 0, the individual parallax offset The calibration method according to claim 7, wherein the disparity offset is a representative value of 前記視差オフセット算出ステップは、前記画面座標1及び前記視差1より前記各特徴点の三次元座標1を算出し、前記画面座標2及び前記視差2より前記各特徴点の三次元座標2を算出し、前記三次元座標1及び前記三次元座標2より算出される移動量の差が所定の閾値より大きい特徴点の組合せは前記視差オフセットの算出には使用しない請求項7乃至9のいずれかに記載の校正方法。   The disparity offset calculating step calculates three-dimensional coordinates 1 of the feature points from the screen coordinates 1 and the disparity 1 and calculates three-dimensional coordinates 2 of the feature points from the screen coordinates 2 and the disparity 2 10. A combination of feature points whose difference in movement amount calculated from the three-dimensional coordinate 1 and the three-dimensional coordinate 2 is larger than a predetermined threshold is not used for calculation of the parallax offset. Calibration method. 前記移動検出ステップは、前記基準画像1及び前記比較画像1を撮像した時刻後の所定の時間間隔で所定の数の基準画像及び比較画像を入力し、最後に入力した基準画像N及び比較画像N以外の基準画像及び比較画像に対してはオプティカルフローの検出のみを行い、前記基準画像N及び比較画像Nに対してのみ前記各特徴点の視差2の算出まで行う請求項7乃至10のいずれかに記載の校正方法。
In the movement detection step, a predetermined number of reference images and comparison images are input at predetermined time intervals after the time of capturing the reference image 1 and the comparison image 1, and the reference image N and the comparison image N input last The optical flow detection is performed only on the reference image and the comparison image other than the reference image, and the calculation of the parallax 2 of each feature point is performed only on the reference image N and the comparison image N. The calibration method described in.
JP2015082299A 2015-04-14 2015-04-14 Calibration apparatus, distance measuring apparatus and calibration method Expired - Fee Related JP6515650B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015082299A JP6515650B2 (en) 2015-04-14 2015-04-14 Calibration apparatus, distance measuring apparatus and calibration method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015082299A JP6515650B2 (en) 2015-04-14 2015-04-14 Calibration apparatus, distance measuring apparatus and calibration method

Publications (2)

Publication Number Publication Date
JP2016200557A JP2016200557A (en) 2016-12-01
JP6515650B2 true JP6515650B2 (en) 2019-05-22

Family

ID=57424370

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015082299A Expired - Fee Related JP6515650B2 (en) 2015-04-14 2015-04-14 Calibration apparatus, distance measuring apparatus and calibration method

Country Status (1)

Country Link
JP (1) JP6515650B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6925816B2 (en) 2017-02-09 2021-08-25 株式会社小松製作所 Position measurement system, work machine, and position measurement method
JP6981881B2 (en) * 2018-01-10 2021-12-17 株式会社デンソーテン Camera misalignment detection device and camera misalignment detection method
WO2019144289A1 (en) * 2018-01-23 2019-08-01 SZ DJI Technology Co., Ltd. Systems and methods for calibrating an optical system of a movable object
JP7099832B2 (en) * 2018-02-28 2022-07-12 株式会社Soken Distance measuring device and calibration parameter estimation method
CN108284838A (en) * 2018-03-27 2018-07-17 杭州欧镭激光技术有限公司 A kind of detecting system and detection method for detecting outside vehicle environmental information
CN110232738B (en) * 2019-06-18 2022-12-02 西安电子科技大学 Multi-view remote sensing image stereo reconstruction method based on disparity map and key points
CN113012241A (en) * 2021-04-28 2021-06-22 歌尔股份有限公司 Parallax detection method and device for binocular camera, electronic equipment and storage medium
CN115100026B (en) * 2022-06-15 2023-07-14 佳都科技集团股份有限公司 Label coordinate conversion method, device, equipment and storage medium based on target object

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001084383A (en) * 1999-09-09 2001-03-30 Univ Tokyo Movement detection method
WO2008155961A1 (en) * 2007-06-21 2008-12-24 Konica Minolta Holdings, Inc. Distance measuring device
JP6182866B2 (en) * 2012-03-21 2017-08-23 株式会社リコー Calibration device, distance measuring device, and vehicle

Also Published As

Publication number Publication date
JP2016200557A (en) 2016-12-01

Similar Documents

Publication Publication Date Title
JP6515650B2 (en) Calibration apparatus, distance measuring apparatus and calibration method
US10339390B2 (en) Methods and apparatus for an imaging system
JP6707022B2 (en) Stereo camera
US10909395B2 (en) Object detection apparatus
US10482615B2 (en) Image processing device and image processing method
Nienaber et al. A comparison of low-cost monocular vision techniques for pothole distance estimation
JP2008039491A (en) Stereo image processing apparatus
JP2008298533A (en) Obstruction measurement method, device, and system
CN105551020A (en) Method and device for detecting dimensions of target object
JP5548212B2 (en) Crosswalk sign detection method and crosswalk sign detection device
JPWO2014181581A1 (en) Calibration apparatus, calibration system, and imaging apparatus
CN111382591A (en) Binocular camera ranging correction method and vehicle-mounted equipment
JP2011064639A (en) Distance measuring device and distance measuring method
JP2009092551A (en) Method, apparatus and system for measuring obstacle
WO2019058729A1 (en) Stereo camera
Yang et al. Effect of field of view on the accuracy of camera calibration
JP7232005B2 (en) VEHICLE DRIVING ENVIRONMENT DETECTION DEVICE AND DRIVING CONTROL SYSTEM
JP7004971B2 (en) Calibration equipment, calibration method and calibration program
EP3373199A2 (en) Object detector, object detection method, carrier means, and equipment control system
EP3343511A1 (en) Image processing apparatus and image processing method
WO2020095549A1 (en) Imaging device
JP5964093B2 (en) Vehicle size measuring device, vehicle size measuring method, and program
JP2018125706A (en) Imaging apparatus
JP6561688B2 (en) DETECTING DEVICE, DETECTING METHOD, IMAGING DEVICE, DEVICE CONTROL SYSTEM, AND PROGRAM
Feng et al. A new distance detection algorithm for images in deflecting angle

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180410

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190214

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190401

R150 Certificate of patent or registration of utility model

Ref document number: 6515650

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees