JP2016200557A - Calibration device, distance measurement apparatus and calibration method - Google Patents

Calibration device, distance measurement apparatus and calibration method Download PDF

Info

Publication number
JP2016200557A
JP2016200557A JP2015082299A JP2015082299A JP2016200557A JP 2016200557 A JP2016200557 A JP 2016200557A JP 2015082299 A JP2015082299 A JP 2015082299A JP 2015082299 A JP2015082299 A JP 2015082299A JP 2016200557 A JP2016200557 A JP 2016200557A
Authority
JP
Japan
Prior art keywords
parallax
image
feature point
reference image
offset
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.)
Granted
Application number
JP2015082299A
Other languages
Japanese (ja)
Other versions
JP6515650B2 (en
Inventor
敬二 實吉
Keiji Saneyoshi
敬二 實吉
啓明 岩田
Hiroaki Iwata
啓明 岩田
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

Abstract

PROBLEM TO BE SOLVED: To provide a calibration device, a calibration method and a distance measurement apparatus which can accurately and stably obtain parallax off-set even if a mobile body is moving and measurement data is small.SOLUTION: A calibration device comprises: a three-dimensional object feature point extraction part which extracts at least two feature points on a three-dimensional object in a reference image 1 and obtains image coordinates 1 of each feature point; a parallax calculation part which calculates a parallax 1 of each feature point using a comparison image 1; a movement detection part which calculates image coordinates 2 and a parallax 2 of each feature point in a reference image 2 using the reference image 2 and a comparison image 2 imaged after the elapse of prescribed time; and a parallax off-set calculation part which calculates parallax off-set using the image coordinates 1, parallax 1, image coordinates 2 and parallax 2. The parallax off-set calculation part calculates the parallax off-set by an evaluation function with the parallax off-set as unknown defined on the basis of a differential formula expressing a difference in a movement amount of two points with three-dimensional coordinates using a conversion formula for converting the image coordinates of the reference image into the three-dimensional coordinates.SELECTED DRAWING: Figure 3

Description

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

近年、自動車の安全性向上をアシストする装置として衝突防止装置や車間距離制御装置等を搭載した自動車が販売されており、さらに進んで自動運転の実現を目指した研究開発が盛んに行われている。これらの装置は、前方の自動車等までの距離を自動で計測し、車間距離が短くなると運転者への警告発報等を行い、さらに短くなると衝突回避のためにブレーキやステアリング等の制御を行うものである。つまり、これらの装置において車間距離の自動計測は必須であり、自動運転においても必須な処理である。   In recent years, automobiles equipped with anti-collision devices, inter-vehicle distance control devices, etc. have been sold as devices that assist in improving the safety of automobiles, and research and development aimed at realizing automatic driving has been actively pursued. . These devices automatically measure the distance to the vehicle in front of the vehicle, and when the distance between the vehicles is shortened, a warning is given to the driver. When the distance is further shortened, the brakes and steering are controlled to avoid a collision. Is. That is, automatic measurement of the inter-vehicle distance is indispensable in these apparatuses, and is also indispensable processing in automatic driving.

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

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

ここで、ステレオカメラによる距離の計測について説明する。図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, the distance measurement by the stereo camera will be described. FIG. 1 is a diagram for explaining the principle of distance measurement by a stereo camera composed of two cameras installed in parallel equiposition. The cameras 11 and 12 are installed in parallel equidistant positions by a distance B (that is, the base line length is B), and the focal length is the same f. When the subject A is placed at a position away from the installation plane of the cameras 11 and 12 by a distance Z in the optical axis direction, the optical axis direction is the optical center O 1 in the camera 11. The camera 12 forms an image at P 1 that is the intersection of the straight line connecting the subject A and the imaging surface 13, and the camera 12 forms an image at P 2 that is the intersection of the optical center O 2 and the subject A and the imaging surface 14. Then, if a straight line passing through the optical center O 1 in parallel with the straight line AP 2 is drawn and the intersection of the straight line and the imaging surface 13 is P 2 ′, P 2 ′ is the same position as P 2 in the camera 12, The difference between P 1 and P 2 ′ is parallax. Usually, the parallax means a difference in direction and is often expressed by an angle. Here, the distance D between P 1 and P 2 ′ is called parallax. By measuring this distance D (parallax D), since the triangle AO 2 O 1 and the triangle O 1 P 2 ′ P 1 are similar, the distance Z to the subject A can be obtained by the following equation (1).

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

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

視差オフセットの検出として、無限遠と見做せる位置にある物体に対する視差は0となるはずであるが、0ではない場合、その視差の値が視差オフセットとなることから、月のように無限遠と見做せる位置にある物体の視差を計測することにより視差オフセットを算出することができる。しかし、そのような物体は常に撮影できるわけではない。そこで、走行中の周囲にある物体を用いて視差オフセットを算出し、視差を補正する方法が提案されている。   As the detection of the parallax offset, the parallax with respect to an object at a position that can be considered as infinity should be zero, but if it is not zero, the parallax value becomes the parallax offset, so that the parallax is infinite like the moon The parallax offset can be calculated by measuring the parallax of the object at a position that can be considered as follows. However, such an object cannot always be photographed. In view of this, a method has been proposed in which a parallax offset is calculated using an object in the vicinity of the 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 square method, and the intersection of the approximate lines is set to an infinite point. The relative deviation angle between the cameras is calculated and corrected. In Japanese Patent Laid-Open No. 2001-169310 (Patent Document 2), the parallax of a stationary object whose size is known, such as a traffic light or a utility pole, is calculated at two times, and the amount of vehicle movement between the two times is calculated from the vehicle speed. The parallax offset is calculated based on the calculated parallax and the vehicle movement amount, and the parallax is corrected.

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

特許第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 and two-dimensional optical flow (which represents the motion of an object as a vector) of a plurality of feature points in an input image are calculated. For feature points on a flat road surface, the feature points are calculated. The parallax offset is calculated by utilizing the fact that the vertical component and the parallax, and the square of the parallax calibrated by the parallax offset and the vertical component of the optical flow have specific relationships, respectively. Thereby, parallax can be corrected without recognizing a specific object, but the input image must include a flat road surface, and solid objects such as buildings and utility poles cannot be used effectively, The accuracy of correction deteriorates when there is a traffic jam where most of the road surface is hidden.

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

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

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

本発明は上述のような事情よりなされたものであり、本発明の目的は、移動体が移動中での視差オフセットの算出において、白線や信号機等の特定の対象物や平坦な道路等の特定の形状物の存在が必要であるとか、適用範囲は静止物体に限られる等の制約条件を設定する必要がなく、ステレオカメラ(ステレオ画像撮像装置)で撮像される様々な画像を利用でき、計測データが少なくても精度良く安定して視差オフセットを求めることができる校正装置及び校正方法並びにその校正装置を搭載してリアルタイムに高精度で視差を補正し、正確な距離計測を行う距離計測装置を提供することにある。   The present invention has been made under the circumstances as described above, and the object of the present invention is to specify a specific object such as a white line or a traffic light, a flat road, or the like in calculating a parallax offset while the moving body is moving. It is not necessary to set constraints such as the presence of a shape object or the application range is limited to a stationary object, and various images captured by a stereo camera (stereo image capturing device) can be used for measurement. A calibration device and calibration method capable of obtaining a parallax offset with high accuracy and stability even with a small amount of data, and a distance measurement device equipped with the calibration device to correct parallax with high accuracy in real time and perform 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 device that calibrates a parameter of a stereo image capturing device used in a distance measuring device that is mounted on a moving body and performs distance measurement, and the above object of the present invention is captured by the stereo image capturing device. At least two feature points on the three-dimensional object in the reference image 1 are extracted, and a three-dimensional object feature point extracting unit for obtaining the screen coordinates 1 of each feature point, and a comparison image 1 photographed by the stereo image capturing device A parallax calculating unit that calculates parallax 1 of each feature point, 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, and 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 2 and the comparison image 2 are used to detect the reference image. 2, the movement detection unit for calculating the screen coordinates 2 and the parallax 2 of each feature point, and the stereo image imaging device 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 for parameter calibration, and the parallax offset calculation unit uses a conversion formula that converts screen coordinates of an image captured by the stereo image capturing device into three-dimensional coordinates. This is achieved by calculating the parallax offset with an evaluation function defined with a parallax offset as an unknown, which is defined based on a difference formula representing a difference in the amount of movement of two points in the three-dimensional coordinates.

また、本発明の上記目的は、前記評価関数は前記移動量の差の二乗和として定義され、前記画面座標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, the object of the present invention is to define the evaluation function as a sum of squares of the difference in the movement amount, and to perform the evaluation by numerical analysis using the screen coordinates 1, the parallax 1, the screen coordinates 2, and the parallax 2. By obtaining the parallax offset that minimizes the function, or the evaluation function is configured by the difference formula, and the difference formula is calculated using the screen coordinate 1, the parallax 1, the screen coordinate 2, and the parallax 2. By calculating the individual parallax offset to be 0 and setting the representative value of the individual parallax offset as the parallax offset, or the parallax offset calculating unit can calculate the cubic of each feature point from the screen coordinates 1 and the parallax 1 The original coordinate 1 is calculated, the three-dimensional coordinate 2 of each feature point is calculated from the screen coordinate 2 and the parallax 2, and the movement calculated from the three-dimensional coordinate 1 and the three-dimensional coordinate 2 A combination of feature points whose difference is larger than a predetermined threshold is not used for calculating the parallax offset, or the movement detecting unit is configured to perform a predetermined process after the time when the reference image 1 and the comparative image 1 are captured. A predetermined number of reference images and comparison images are input at time intervals, and only the optical flow is detected for the reference image and comparison image other than the last input reference image N and comparison image N, and the reference image N Further, only the comparison image N is calculated until the parallax 2 of each feature point is calculated.

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

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

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

ステレオカメラによる距離の計測の原理を示す概略図である。It is the schematic which shows the principle of the distance measurement 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 which shows the example of the matching area | region in stereo matching. サブピクセル精度での算出方法を示すイメージ図である。It is an image figure which shows the calculation method in subpixel accuracy. オプティカルフロー検出でのマッチング領域の例を示すイメージ図である。It is an image figure which shows the example of the matching area | region in the 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, since the shape of the three-dimensional object to be imaged does not change even when the stereo image pickup device mounted on the moving body moves, the moving distance and moving direction of the point (feature point) on the three-dimensional object are the same. Utilizing this fact, the parallax offset is calculated. 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 image capturing apparatus moves. Although the distance varies depending on where the feature point is initially located, the distance that the actual feature point whose position is defined by three-dimensional coordinates (three-dimensional coordinates) moved does not change the shape of the three-dimensional object. The same regardless of the initial position of the feature point. Furthermore, the direction of movement is the same. And since the parallax is used in the calculation of the position of the feature point in the three-dimensional coordinates from the position of the feature point in the screen coordinates, a parallax offset is added to the parallax, and a conversion formula from the screen coordinates to the three-dimensional coordinates is used. If the movement distance in three-dimensional coordinates is formulated, an optimal solution for parallax offset can be obtained from the screen coordinate values 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 brightness decreases as it goes to the edge of the screen of a captured image. The difference in sensitivity between cameras means that there is a difference in how brightness is detected because there are individual differences even in cameras of the same product. Since the shading and the sensitivity difference between cameras cause erroneous detection in stereo matching described later, the correction is performed in the stereo image capturing apparatus. In addition, an image obtained from the camera is affected by the lens of the camera, and the amount of distortion increases as the distance from the image center increases. Therefore, this distortion is also corrected. Furthermore, rotational deviation and vertical deviation are also detected and calibrated by the stereo image pickup apparatus.

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

次に、画面座標から三次元座標への変換について説明する。   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 diagram showing the setting of the coordinate axes of the screen coordinates and the three-dimensional coordinates, and corresponds to the camera 11 in FIG. As shown in FIG. 2, on the plane that passes through the optical center O 1 of the camera 11 and intersects the optical axis of the camera 11 perpendicularly, the optical center O 1 is the origin and the horizontal direction is the x-axis of the three-dimensional coordinate, The direction is the y-axis of the three-dimensional coordinate, and the optical axis direction is the z-axis of the three-dimensional coordinate. Further, assuming that the optical axis of the camera 11 passes through the center of the imaging surface 13 and that the imaging surface 13 intersects the optical axis perpendicularly, on the imaging surface 13, the center is the origin and x of the three-dimensional coordinates. The opposite direction parallel to the axis is the i-axis of the screen coordinates, and the opposite direction is the j-axis of the screen coordinates parallel to the y-axis of the three-dimensional coordinates. Since the subject appears upside down on the imaging surface, 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 the three-dimensional coordinates is (X, Y, Z) and the position (coordinates) in the screen coordinates is (I, J), X and Y Is obtained by the following equations 2 and 3, and Z can be obtained by the aforementioned equation 1, respectively.

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

計測された視差Dに誤差(視差オフセット)がなければ、被写体Aの三次元座標での座標が画面座標の座標より数1〜3を用いて算出できるが、視差オフセットDが加算されている場合、三次元座標での座標(X,Y,Z)は下記数4〜6のようになる。 If the error (parallax offset) to the measured parallax D, although the coordinates in the three-dimensional coordinates of the object A can be calculated using equation 1-3 from coordinates in the screen coordinate, parallax offset D 0 is added In this case, coordinates (X, Y, Z) in three-dimensional coordinates are as shown in the following equations 4-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 the 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. ), And the measured parallax is D m (t) and D n (t), respectively, the amount of change (movement) of the coordinates of the feature points α m and α n in the three-dimensional coordinates from time t 1 to t 2 The difference in amount is as shown in the following formulas 7-9.


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

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

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

まずは数値解析の手法にてDの最適解を求める方法について説明する。 First, a method for 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 total sum of squares in each combination of m and n satisfying m <n. Then, D 0 that minimizes this evaluation function is calculated, and the D 0 is set as a parallax offset. As the method of numerical analysis, the steepest descent method, Newton method, or the like is used.

次に、代表値の算出により視差オフセットを算出する方法について説明する。つまり、複数の視差オフセット(個別視差オフセット)Dを算出し、個別視差オフセットの代表値(平均値、最頻値等)を視差オフセットとする。 Next, a method for calculating a parallax offset by calculating a representative value will be described. In other words, it calculates a plurality of parallax offset (individual disparity offset) D 0, the representative value of the individual parallax offset (mean value, mode, etc.) to the parallax offset.

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

数値解析による方法と個別視差オフセット算出による方法を組み合わせた方法で視差オフセットを算出しても良い。例えば、数10の代わりに、下記数11の3式を評価関数として、各評価関数を最小とする視差オフセット(個別視差オフセット)Dを算出し、個別視差オフセットの代表値を視差オフセットとする。 The parallax offset may be calculated by a method combining a method based on numerical analysis and a method based on individual parallax offset calculation. For example, instead of Equation 10, the following equation 11 is used as an evaluation function to calculate a parallax offset (individual parallax offset) D 0 that minimizes each evaluation function, and the representative value of the individual parallax 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, and the individual parallax offset may be calculated for each group using Equation 10 as an evaluation function, and the representative value of the calculated individual parallax offset may be used as the parallax offset. For example, if feature points are present in a plurality of places on the captured image, each group is regarded as one group. In this combined method, the individual parallax offset that is estimated to be inappropriate may be excluded.

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

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

このように、本発明の校正装置では、視差オフセット算出の対象となる特徴点は立体物上に存在すれば良く、特徴点の抽出は自動で行うので、ステレオ画像撮像装置で撮像されるほぼ全ての画像を利用することができる。また、少なくとも2つの特徴点が存在すれば良く、特徴点の3つの座標(x座標、y座標、z座標)を使用して視差オフセットを算出できるので、計測データが少なくても精度良く視差オフセットを算出することができる。   As described above, in the calibration apparatus of the present invention, the feature points for which the parallax offset is calculated need only exist on the three-dimensional object, and the feature points are automatically extracted. Images can be used. In addition, it is sufficient that at least two feature points exist, and the parallax offset can be calculated using the three coordinates (x coordinate, y coordinate, z coordinate) of the feature points, so that the parallax offset can be accurately obtained even with a small amount of measurement data. Can be calculated.

以下に、本発明の実施の形態を、図面を参照して詳細に説明する。   Embodiments of the present invention will be described below 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 a memory 210, a three-dimensional object feature point extraction unit 220, a parallax calculation unit 230, a movement detection unit 240, and a parallax offset calculation unit 250, and is a 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 pickup apparatus 10 includes two cameras, the focal lengths of the two cameras are the same f, the distance between the cameras (baseline length) is B, and the optical axes are adjusted in advance so as to be parallel to each other. Yes. The stereo image pickup device 10 is installed on a moving body such as a vehicle so that the two cameras are in parallel equiposition. A camera on the right side (corresponding to the position of the camera 11 in FIG. 1) captures a reference image in the traveling direction of the moving body, and a camera on the left side (corresponding to the position of the camera 12 in FIG. 1) captures a comparative image. The reference image and the comparative image are captured at a predetermined time interval at the same timing, and as described above, correction (shading correction, inter-camera sensitivity difference correction, distortion correction, etc.) and calibration of rotational deviation and vertical deviation are performed, 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 apparatus 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 parallax calculation unit 230 calculates the parallax (parallax 1) of the feature point 1 by stereo matching using the reference image 1 stored in the memory 210 and the corresponding comparison image (comparison image 1). The movement detection unit 240 includes an optical flow detection unit 241 and a parallax detection unit 242, and the optical flow detection unit 241 reads a reference image (reference image 2) captured after the reference image 1 from the memory 210, and performs optical flow detection. 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 calculation unit 242 uses the reference image 2 and the comparison image (comparison image 2) corresponding to the feature point. 2 parallaxes (parallax 2) are calculated by stereo matching. The parallax offset calculation unit 250 calculates the parallax offset by numerical analysis from the screen coordinate values of the feature points 1 and 2 and the parallax 1 and the parallax 2.

このような構成の校正装置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 captured and output by the stereo image capturing apparatus 10 at predetermined time intervals are sequentially stored in the memory 210. The memory 210 stores a reference image and a comparative image that are captured at the same timing so as to correspond to 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 point 1) by the “feature point detection” method described in Non-Patent Document 1. Is extracted (step S10). In the reference image, two-dimensional coordinates (screen coordinates) having the same coordinate axes (i-axis, j-axis) as the imaging surface shown in FIG. 2 are set, and the screen of each extracted feature point 1 is set. Screen coordinate data (screen coordinates) TC1 having the coordinate values (I1 k , J1 k ) in coordinates (k = 1, 2,..., K, K being the number of feature points) as elements is output.

画面座標データTC1は視差算出部230、オプティカルフロー検出部241及び視差オフセット算出部250に入力される。   The screen coordinate data TC1 is input to the parallax calculator 230, the optical flow detector 241 and the parallax offset calculator 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 parallax calculation unit 230 reads the reference image SP1 and the comparison image CP1 captured at the time t1 associated with the reference image SP1 from the memory 210, and uses the screen coordinate data TC1 to perform each feature point using a stereo matching technique. 1 parallax is calculated. As a stereo matching method, a region-based method is used in which an image is divided into small regions (windows), and a matching evaluation function uses a SAD (Sum of Absolute Difference) 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, in the comparison image CP1, as shown in FIG. 5, the image data (luminance) of the region on the right side of the reference position 1 in the horizontal direction and the image data of the reference position 1 in the reference image SP1 ( (Luminance) is matched (step S20). That is, the SAD value of both image data is calculated from the SAD function, and the position where the SAD value is minimum in the matching area is set as the position of the feature point 1 (comparison position 1) in the comparison image CP1. The matching area is limited to the area shown in FIG. 4 based on the positions of the two cameras in the stereo image capturing apparatus 10. Then, the parallax is calculated from the shift between the reference position 1 and the comparison position 1, but in order to increase the accuracy of the shift, the parallax with sub-pixel accuracy is obtained (step S30). FIG. 6 is a diagram simulating a part of the SAD values in the matching region 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 in the vicinity of the minimum value, and the position where the SAD value is larger among the SAD values at the position where the SAD value is minimum and the SAD values before and after the position (s3 in FIG. 6). Are drawn with a straight line (straight line s2s3 in FIG. 6), and a straight line passing through the position where the slope is opposite to the slope of the straight line and the SAD value is smaller (s1 in FIG. 6) is drawn. The comparison position is 1. The deviation between the true comparison position 1 and the reference position 1 is defined as parallax. Note that 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 to which the screen coordinate data TC1 is input reads the reference image SP1 and the reference image SP2 captured at time t2 (t2> t1) from the memory 210, and features from the reference image SP2 by the optical flow detection method. The feature point corresponding to 1 (feature point 2) 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, as in the stereo matching method, using the SAD function as an evaluation function, in the reference image SP2, the image data of the region other than the reference position 1 and the image data of the reference position 1 in the reference image SP1 Are matched (step S40). That is, the SAD values of both image data are calculated from the SAD function, and the location where the SAD value is minimum is set as the temporary position of the feature point 2. At this time, the matching region may be limited to a region predicted as the movement destination of the feature point 1 as shown in FIG. When the temporary position of the feature point 2 is detected, the position of the feature point 2 (reference position 2) is obtained with sub-pixel accuracy based on the temporary position, similarly to the parallax detection unit 230 (step S50). That is, the reference position 2 is obtained by linear approximation or the like in both the i-axis direction and the j-axis direction based on the SAD values at the upper, lower, left, and right positions of the temporary position. The obtained coordinate values (I2 k , J2 k ) (k = 1, 2,..., K) of the reference position 2 are output to the parallax calculation unit 242 and the parallax offset calculation 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 calculation unit 242 reads the reference image SP2 and the comparison image CP2 captured at the time t2 associated with the reference image SP2 from the memory 210, and uses the screen coordinate data TC2 to perform stereo matching similarly to the parallax calculation unit 230. The parallax of each feature point 2 is calculated by this method (steps S60 and S70). The operation content is the same as that of the parallax calculation 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, and the parallax offset that minimizes the evaluation function F (D0) defined by the following Equation 12 D0 is obtained by a numerical analysis method (steepest descent method, Newton method, etc.) (step S80).

ここで、a,bは1以上K以下の整数で、
はa<bを満たすa,bの各組合せでの二乗和の総和を意味する。
Here, a and b are integers between 1 and K,
Means the sum of square sums in each combination of a and b satisfying a <b.

算出された視差オフセットD0は校正装置20を搭載した距離計測装置での距離計測に用いられる視差の補正に使用される。   The calculated parallax offset D0 is used for correction of 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 when the stereo image capturing apparatus 10 captures an image, the reference image 2 is set as the reference image 1 and the comparison image 2 is set 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 three-dimensional 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 and the parallax calculation detected by the optical flow detection unit 241 are omitted. The parallax calculated by the unit 242 may be used.

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

なお、第1実施形態では、視差算出部230及び242でのステレオマッチング並びにオプティカルフロー検出部241でのオプティカルフロー検出における評価関数としてSAD関数を使用しているが、SSD(Sum of Squared Difference)関数を使用しても良い。または、SAD関数又はSSD関数を使用した方法ではなく、位相限定相関法によりずれを算出しても良い。また、サブピクセル精度で位置を求めているが、精度よりも処理時間を優先する場合等では、サブピクセル精度まで求めなくても良い。   In the first embodiment, an 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, but an SSD (Sum of Squared Difference) function. May be used. Alternatively, the shift may be calculated not by a method using the SAD function or the SSD function but by the phase only correlation method. Further, although the position is obtained with sub-pixel accuracy, the sub-pixel accuracy may not be obtained when priority is given to processing time over accuracy.

また、オプティカルフロー検出部241は、基準画像SP2から特徴点2を検出しているが、比較画像CP2から検出しても良い。この場合においてマッチング領域を限定する場合は、視差算出部230が出力した視差データPA1を利用することになり、視差算出部242は、基準画像SP2において特徴点2の検出を行い、視差D2(k=1,2,…,K)を算出することになる。 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 the matching region is limited, the parallax data PA1 output from the parallax calculation unit 230 is used, and the parallax calculation unit 242 detects the feature point 2 in the reference image SP2 and performs parallax D2 k ( k = 1, 2,..., K).

第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, each time the three-dimensional object feature point extraction unit 220 extracts the feature point 1, a coordinate value is output, and the processing of the parallax calculation unit 230, the optical flow detection unit 241, and the parallax calculation unit 242 is executed. good. That is, steps S10 to S70 are executed in units of feature points, and after the processing for all feature points is completed, step S80 is executed.

図8は、本発明のシミュレーション結果を示す図である。   FIG. 8 is a diagram showing a simulation result 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 three-dimensional object is placed 10 m and 20 m ahead of the moving body, the moving body is advanced 5 m, and a reference image and a comparative image are taken at two points before and after the advancement, respectively. When B × f = 100 and parallax offset D0 = 5 are set, one feature point is set for 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 measurement accuracy of parallax is 0.2 px (pixel). In FIG. 8, the horizontal axis represents the parallax offset D0, and the vertical axis represents the evaluation function Density (depth). As shown in FIG. 8, in all three cases, there is a peak in the vicinity of D0 = 5, and it can be seen that the parallax offset is detected with high accuracy.

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

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

視差オフセット算出部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 parallax offset calculation unit 350 includes a movement amount inspection unit 351, a parallax offset estimation unit 352, and a memory 353. The movement amount inspection unit 351 uses the values of the screen coordinates of the feature points 1 and 2, the parallax 1 and the parallax 2, and the parallax offset stored in the memory 353, and the x coordinate in the three-dimensional coordinates of each feature point, y The amount of change from the time t1 to the time t2 in the coordinates and the 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 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. The parallax offset is calculated by numerical analysis or the like from the values of the screen coordinates of the feature points 1 and 2 and the parallax 1 and the parallax 2. Is calculated. The calculated parallax offset is output and stored in the memory 353, and is used to calculate the change amount of the movement amount inspection unit 351 in the next parallax offset calculation. Note that 0 is used as the initial value of the parallax offset used in the change amount calculation.

視差オフセット算出部350の動作例を図10のフローチャートを参照して説明する。   An example of the operation of the parallax 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 inputs 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 reads the x coordinate in the three-dimensional coordinates of each feature point The change amounts VX k , VY k and VZ k (k = 1, 2,..., K) from the time t1 to the time t2 in the y-coordinate and the z-coordinate are calculated from the following equation 13 (step S810).

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

なお、所定の閾値θはΔVXab、ΔVYab及びΔVZabに対して共通ではなく、異なる閾値を用いても良い。 The predetermined threshold θ is not common to ΔVX ab , ΔVY ab and ΔVZ ab , and different thresholds 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 exclusion combination data EP, and a combination of feature points other than the combination of the feature points included in the exclusion combination data EP. Thus, 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 obtained by a numerical analysis method or the like, similarly to the parallax offset calculation unit 250 in the first embodiment ( Step S830).

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

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

このような処理を行う本発明の構成例(第3実施形態)のブロック図を図11に示す。図3に示される第1実施形態に対して、第3実施形態にはスイッチ410〜415が追加され、さらに移動検出部にメモリ443が追加されている。なお、第1実施形態と同一構成には同一符号を付して説明は省略する。   FIG. 11 shows a block diagram of a configuration example (third embodiment) of the present invention for performing such processing. Compared 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. In addition, the same code | symbol is attached | subjected to the same structure as 1st Embodiment, and description is abbreviate | omitted.

第3実施形態の動作例を図12のフローチャートを参照して説明する。なお、第3実施形態では、時刻tに撮像された画像から特徴点の抽出を行い、時刻t,t,…,tに撮像された画像は特徴点の検出のみを行い、時刻tN+1に撮像された画像に対して視差オフセットの検出まで行うとする。 The operation example of 3rd Embodiment is demonstrated 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 the parallax offset is detected up to the image picked up at tN + 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 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 OFF, and only the switch 415 is ON (step S130). Then, only the feature point detection of the optical flow detection unit 441 is performed. That is, the optical flow detection section 441 reads from the memory 210 the images 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 And a feature point is 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 detected coordinate value of the feature point is 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を繰り返す。 Thereafter, Step S140 is repeated for the images imaged at each time until the image imaged at time tN −1 is read 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 feature points by the same processing as in step S140, and outputs screen coordinate data TC2 (step S160). The screen coordinate data TC <b> 2 is input to the parallax calculation unit 242 and the parallax offset calculation unit 250. The parallax calculation unit 242 reads the image captured at time tN + 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 sets 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, parallax data PA1, screen coordinate data TC2, and 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 process is switched with respect to the captured image by the switch. However, the information related to the time is added to the image, and the process performed in each unit is switched based on the information. Also good.

Although the calibration apparatus according to the present invention has been described above, the present invention is not limited to the above-described embodiment, and it is needless to say that various other configurations and methods can be adopted without departing from the gist of the present invention. The calibration apparatus according to the present invention can be implemented by software (computer program) using a computer system, and can be implemented by ASIC (Application Specific Integrated Circuit), GPU (Graphics Processing Unit) or FPGA (Field Programmable). Of course, it can also 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 スイッチ
11, 12 Camera 10 Stereo imaging device 20, 30, 40 Calibration device 210, 353, 443 Memory 220 Solid 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 that calibrates the parameters of a stereo imaging device used in a distance measuring device that is mounted on a moving body and measures distance,
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 each feature point;
A parallax calculation unit that calculates the parallax 1 of each feature point 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 apparatus after a predetermined time has elapsed from the time when the reference image 1 and the comparison image 1 are captured are input, and the reference image 2 or the comparison image 2 is input. A motion detector that detects an optical flow of each feature point using the reference image 2 and calculates the screen coordinates 2 and parallax 2 of each feature point in the reference image 2 using the reference image 2 and the comparison image 2 When,
A parallax offset calculating unit that calculates a parallax offset to be used for calibration of the parameters of the stereo image capturing device using the screen coordinates 1, the parallax 1, the screen coordinates 2, and the parallax 2;
The parallax offset calculation unit is a difference formula that represents a difference in the amount of movement of two points in the three-dimensional coordinates using a conversion formula that converts screen coordinates of an image captured by the stereo image capturing device into three-dimensional coordinates. A calibration apparatus, wherein the parallax offset is calculated by an evaluation function defined on the basis of the evaluation function with the parallax offset as an unknown.
前記評価関数は前記移動量の差の二乗和として定義され、前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて数値解析により前記評価関数を最小とする視差オフセットを求める請求項1に記載の校正装置。   The evaluation function is defined as a sum of squares of the difference in the movement amount, and a parallax offset that minimizes the evaluation function 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 difference formula, and uses the screen coordinate 1, the parallax 1, the screen coordinate 2, and the parallax 2 to calculate an individual parallax offset that sets each differential formula to 0, and the individual parallax offset The calibrating apparatus according to claim 1, wherein the representative value is the parallax offset. 前記視差オフセット算出部は、前記画面座標1及び前記視差1より前記各特徴点の三次元座標1を算出し、前記画面座標2及び前記視差2より前記各特徴点の三次元座標2を算出し、前記三次元座標1及び前記三次元座標2より算出される移動量の差が所定の閾値より大きい特徴点の組合せは前記視差オフセットの算出には使用しない請求項1乃至3のいずれかに記載の校正装置。   The parallax offset calculation unit calculates the three-dimensional coordinate 1 of each feature point from the screen coordinate 1 and the parallax 1, and calculates the three-dimensional coordinate 2 of each feature point from the screen coordinate 2 and the parallax 2. 4. A combination of feature points in which a difference in movement calculated from the three-dimensional coordinate 1 and the three-dimensional coordinate 2 is greater than a predetermined threshold is not used for calculating the parallax offset. Calibration equipment. 前記移動検出部は、前記基準画像1及び前記比較画像1を撮像した時刻後の所定の時間間隔で所定の数の基準画像及び比較画像を入力し、最後に入力した基準画像N及び比較画像N以外の基準画像及び比較画像に対してはオプティカルフローの検出のみを行い、前記基準画像N及び比較画像Nに対してのみ前記各特徴点の視差2の算出まで行う請求項1乃至4のいずれかに記載の校正装置。   The movement detection unit inputs a predetermined number of reference images and comparison images at a predetermined time interval after the time when the reference image 1 and the comparison image 1 are captured, and the reference image N and the comparison image N that are input last. 5. The method according to claim 1, wherein only the optical flow is detected for the reference image and the comparative image other than the above, and the parallax 2 of each feature point is calculated only for the reference image N and the comparative image N. The calibration device described in 1. 請求項1乃至5のいずれかに記載の校正装置を搭載していることを特徴とする距離計測装置。   A distance measuring device, comprising the calibration device according to claim 1. 移動体に搭載されて距離計測を行う距離計測装置にて用いられるステレオ画像撮像装置のパラメータを校正する校正方法において、
前記ステレオ画像撮像装置で撮像された基準画像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 the parameters of a stereo imaging device used in a distance measuring device mounted on a moving body and measuring distance,
A three-dimensional object feature point extracting step of extracting at least two feature points on the three-dimensional object in the reference image 1 captured by the stereo image capturing device and obtaining the screen coordinates 1 of each of the feature points;
A parallax calculating step of calculating the parallax 1 of each feature point 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 apparatus after a predetermined time has elapsed from the time when the reference image 1 and the comparison image 1 are captured are input, and the reference image 2 or the comparison image 2 is input. A movement detection step of detecting an optical flow of each feature point using the reference image 2 and calculating a screen coordinate 2 and a parallax 2 of each feature point in the reference image 2 using the reference image 2 and the comparison image 2. When,
A parallax offset calculating step of calculating a parallax offset used for calibration of the parameters of the stereo image capturing device using the screen coordinates 1, the parallax 1, the screen coordinates 2 and the parallax 2;
The parallax offset calculating step is a difference equation that represents a difference in the amount of movement of two points in the three-dimensional coordinates using a conversion equation for converting the screen coordinates of an image captured by the stereo image capturing device into three-dimensional coordinates. A calibration method characterized in that the parallax offset is calculated by an evaluation function defined on the basis of the parallax offset as an unknown.
前記評価関数は前記時間変化量の二乗和として定義され、前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて数値解析により前記評価関数を最小とする視差オフセットを求める請求項7に記載の校正方法。   The evaluation function is defined as a sum of squares of the time change amount, and a parallax offset that minimizes the evaluation function is obtained by numerical analysis using the screen coordinate 1, the parallax 1, the screen coordinate 2, and the parallax 2. Item 8. The calibration method according to Item 7. 前記評価関数は前記差分式で構成され、前記画面座標1、前記視差1、前記画面座標2及び前記視差2を用いて前記各差分式を0とする個別視差オフセットを算出し、前記個別視差オフセットの代表値を前記視差オフセットとする請求項7に記載の校正方法。   The evaluation function is composed of the difference formula, and uses the screen coordinate 1, the parallax 1, the screen coordinate 2, and the parallax 2 to calculate an individual parallax offset that sets each differential formula to 0, and the individual parallax offset The calibration method according to claim 7, wherein the representative value is the parallax offset. 前記視差オフセット算出ステップは、前記画面座標1及び前記視差1より前記各特徴点の三次元座標1を算出し、前記画面座標2及び前記視差2より前記各特徴点の三次元座標2を算出し、前記三次元座標1及び前記三次元座標2より算出される移動量の差が所定の閾値より大きい特徴点の組合せは前記視差オフセットの算出には使用しない請求項7乃至9のいずれかに記載の校正方法。   The parallax offset calculating step calculates a three-dimensional coordinate 1 of each feature point from the screen coordinates 1 and the parallax 1, and calculates a three-dimensional coordinate 2 of each feature point from the screen coordinates 2 and the parallax 2. 10. A combination of feature points in which a difference in movement 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 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 a predetermined time interval after the time when the reference image 1 and the comparison image 1 are captured, and the reference image N and the comparison image N that are input last. 11. The method according to claim 7, wherein only the optical flow is detected for the reference image and the comparison image other than the above, and the parallax 2 of each feature point is calculated only for the reference image N and the comparison image N. Calibration method described in 1.
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 true JP2016200557A (en) 2016-12-01
JP6515650B2 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)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180103868A (en) * 2017-02-09 2018-09-19 가부시키가이샤 고마쓰 세이사쿠쇼 Position measurement system, work machine, and position measurement method
JP2019120631A (en) * 2018-01-10 2019-07-22 株式会社デンソーテン Camera deviation detection device, and camera deviation detection method
JP2019148548A (en) * 2018-02-28 2019-09-05 株式会社Soken Range-finding device and estimation method of calibration parameter
CN110232738A (en) * 2019-06-18 2019-09-13 西安电子科技大学 Multiple view remote sensing images stereo reconstruction method based on disparity map and key point
CN110998241A (en) * 2018-01-23 2020-04-10 深圳市大疆创新科技有限公司 System and method for calibrating an optical system of a movable object
CN113012241A (en) * 2021-04-28 2021-06-22 歌尔股份有限公司 Parallax detection method and device for binocular camera, electronic equipment and storage medium
JP2021516396A (en) * 2018-03-27 2021-07-01 杭州欧▲雷▼激光技▲術▼有限公司 Detection system and detection method for detecting vehicle external environment information
CN115100026A (en) * 2022-06-15 2022-09-23 佳都科技集团股份有限公司 Label coordinate conversion method, device and equipment based on target object and storage medium

Citations (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
JP2013224919A (en) * 2012-03-21 2013-10-31 Ricoh Co Ltd Calibration device, distance measuring apparatus, and vehicle

Patent Citations (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
JP2013224919A (en) * 2012-03-21 2013-10-31 Ricoh Co Ltd Calibration device, distance measuring apparatus, and vehicle

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180103868A (en) * 2017-02-09 2018-09-19 가부시키가이샤 고마쓰 세이사쿠쇼 Position measurement system, work machine, and position measurement method
KR102076631B1 (en) * 2017-02-09 2020-02-12 가부시키가이샤 고마쓰 세이사쿠쇼 Positioning Systems, Work Machines, and Positioning Methods
US11120577B2 (en) 2017-02-09 2021-09-14 Komatsu Ltd. Position measurement system, work machine, and position measurement method
JP2019120631A (en) * 2018-01-10 2019-07-22 株式会社デンソーテン Camera deviation detection device, and camera deviation detection method
CN110998241A (en) * 2018-01-23 2020-04-10 深圳市大疆创新科技有限公司 System and method for calibrating an optical system of a movable object
JP2019148548A (en) * 2018-02-28 2019-09-05 株式会社Soken Range-finding device and estimation method of calibration parameter
JP7099832B2 (en) 2018-02-28 2022-07-12 株式会社Soken Distance measuring device and calibration parameter estimation method
JP2021516396A (en) * 2018-03-27 2021-07-01 杭州欧▲雷▼激光技▲術▼有限公司 Detection system and detection method for detecting vehicle external environment information
CN110232738A (en) * 2019-06-18 2019-09-13 西安电子科技大学 Multiple view remote sensing images stereo reconstruction method based on disparity map and key point
CN113012241A (en) * 2021-04-28 2021-06-22 歌尔股份有限公司 Parallax detection method and device for binocular camera, electronic equipment and storage medium
CN115100026A (en) * 2022-06-15 2022-09-23 佳都科技集团股份有限公司 Label coordinate conversion method, device and equipment based on target object and storage medium
CN115100026B (en) * 2022-06-15 2023-07-14 佳都科技集团股份有限公司 Label coordinate conversion method, device, equipment and storage medium based on target object

Also Published As

Publication number Publication date
JP6515650B2 (en) 2019-05-22

Similar Documents

Publication Publication Date Title
JP6515650B2 (en) Calibration apparatus, distance measuring apparatus and calibration method
CN107850446B (en) Self-position estimating device and self-position estimate method
US10482615B2 (en) Image processing device and image processing method
US10909395B2 (en) Object detection apparatus
JP6707022B2 (en) Stereo camera
Nienaber et al. A comparison of low-cost monocular vision techniques for pothole distance estimation
US10810749B2 (en) Image processing apparatus, moving body device control system, computer-readable medium, and image processing method
EP2924612A1 (en) Object detection device, object detection method, and computer readable storage medium comprising object detection program
KR20190059639A (en) Apparatus and method for measureing a crack in a concrete surface
JP2017058274A (en) Measurement device, method, and program
JP5548212B2 (en) Crosswalk sign detection method and crosswalk sign detection device
JP2017181476A (en) Vehicle location detection device, vehicle location detection method and vehicle location detection-purpose computer program
KR20180098945A (en) Method and apparatus for measuring speed of vehicle by using fixed single camera
JP2017036981A (en) Level-difference detection apparatus and level-difference detection method
JP2009276233A (en) Parameter calculating apparatus, parameter calculating system and program
JPWO2014181581A1 (en) Calibration apparatus, calibration system, and imaging apparatus
JP2011232965A (en) Plane area detection device and stereo camera system
KR102195040B1 (en) Method for collecting road signs information using MMS and mono camera
JP6477340B2 (en) Road boundary detection device, self-position estimation device, and road boundary detection method
JP2010145219A (en) Movement estimation device and program
EP3373199A2 (en) Object detector, object detection method, carrier means, and equipment control system
EP3288260A1 (en) Image processing device, imaging device, equipment control system, equipment, image processing method, and carrier means
JP2019113434A (en) Calibrator, calibration method, and calibration program
WO2022133986A1 (en) Accuracy estimation method and system
WO2020095549A1 (en) Imaging device

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