JP4018950B2 - Stereo camera misalignment inspection apparatus and misalignment inspection method - Google Patents

Stereo camera misalignment inspection apparatus and misalignment inspection method Download PDF

Info

Publication number
JP4018950B2
JP4018950B2 JP2002227777A JP2002227777A JP4018950B2 JP 4018950 B2 JP4018950 B2 JP 4018950B2 JP 2002227777 A JP2002227777 A JP 2002227777A JP 2002227777 A JP2002227777 A JP 2002227777A JP 4018950 B2 JP4018950 B2 JP 4018950B2
Authority
JP
Japan
Prior art keywords
pair
cameras
pattern
calculated
distance data
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
JP2002227777A
Other languages
Japanese (ja)
Other versions
JP2004069437A (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.)
Subaru Corp
Original Assignee
Fuji Jukogyo KK
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 Fuji Jukogyo KK filed Critical Fuji Jukogyo KK
Priority to JP2002227777A priority Critical patent/JP4018950B2/en
Publication of JP2004069437A publication Critical patent/JP2004069437A/en
Application granted granted Critical
Publication of JP4018950B2 publication Critical patent/JP4018950B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、一対のカメラの位置ずれをテストチャートを利用して検査する位置ずれ検査装置および位置ずれ検査方法に関する。
【0002】
【従来の技術】
近年、車外監視、踏切監視、地形認識または高度計といった様々な用途において、ステレオ式監視装置が注目・実用化されている。この監視装置では、対象物の認識・監視を行う前提として、距離データである視差を算出する必要がある。視差は、ステレオカメラより得られる一対の撮像画像に基づき、ステレオマッチング処理を行うことによって算出される。
【0003】
このようなステレオカメラを車体に取り付ける際には、その取り付け位置に関して高レベルの精度が要求される。なぜなら、ステレオカメラの取り付け位置にずれ、すなわち、一対のカメラの相対的な位置にずれ(位置ずれ)が生じると、それに起因してカメラそれぞれの撮像方向がずれてしまうため、算出された距離データに直接影響を及ぼしてしまうからである。特に、カメラの上下方向・回転方向のずれは、ステレオマッチングを行う際に、各画像における同一水平ライン(エピポーラライン)のずれとなって現れるため、算出された距離データの信頼性が低下してしまう場合がある。
【0004】
この点に関して、特開2001−91247号公報では、ステレオ画像に基づき算出された距離データの信頼性を検査する技術が提案されている。この従来技術では、ランダムな輝度パターンが描かれたテストチャートをステレオカメラで撮像することによって、一対の撮像画像を取得するとともに、これらの撮像画像に基づき距離データを算出する。そして、撮像画像に写し出されたテストチャートに関する距離データを評価サンプルとして、ステレオカメラとテストチャートとの間の実距離に基づき、この距離データを評価する。これにより、算出された距離データの信頼性が判定される。
【0005】
【発明が解決しようとする課題】
しかしながら、上記公報に記載された従来技術では、距離データの信頼性を評価することはできるものの、それがどの程度のカメラの位置ずれに起因しているのか、すなわち、そのずれ量を特定することまでは開示されていない。また、距離データの信頼性を正確に判定するためには、サブピクセル単位、すなわち1画素(1ピクセル)以下の分解能でずれを検出することが好ましい。この従来技術では、距離データをサブピクセル単位で算出し、これによりサブピクセル単位で位置ずれの判定を行うことを開示している。しかしながら、この手法は、距離データをサブピクセル単位で算出するため、計算処理量が大きく、また、計算処理が煩雑となってしまう可能性がある。
【0007】
また、本発明の目的は、カメラの位置ずれ、特に、上下方向・回転方向の位置ずれを有効に検査するテストチャートを用いて、距離データの信頼性を低下させるカメラの位置ずれを有効に検査することである。
【0008】
【課題を解決するための手段】
かかる課題を解決するために、第1の発明は、所定のカメラ基線長だけ離間された一対のカメラによって取得された一対の撮像画像に基づき算出される距離データを用いて、一対のカメラの相対的な位置ずれを検査する際に、一対のカメラの前方でカメラ基線と基準方向とを一致させて平行に配置されるとともに、一対のカメラによって撮像されることにより、一対の撮像画像に写し出されるテストチャートを提供する。このテストチャートは、テストチャートに描かれるパターンが、基準方向から斜めに傾いている。
【0009】
ここで、第1の発明において、パターンは、斜め方向に延在する同一輝度階調の直線を形成することが好ましい。この場合、パターンは、傾き角の異なる複数の直線で構成される屈曲したパターンであることが好ましい。また、この場合、複数の直線のそれぞれは、輝度階調が異なることが好ましい。
【0010】
また、第1の発明において、パターンは、基準方向と直交する方向にパターンが隣接して配置されたパターン群を構成しており、パターン群は、直交方向においてランダムな輝度階調となることが好ましい。
【0011】
また、第2の発明は、一対の撮像画像に基づき算出される距離データを用いて一対のカメラの相対的な位置ずれを検査する位置ずれ検査装置において、一対のカメラと、ステレオ画像処理部と、検査部とを有する位置ずれ検査装置を提供する。この位置ずれ検査装置において、一対のカメラは、所定のカメラ基線長だけ離間されて、撮像画像を出力する。また、ステレオ画像処理部は、一対のカメラの前方でカメラ基線と基準方向とを一致させて平行に配置されているとともに、基準方向から斜めに傾いたパターンが描かれたテストチャートを、一対のカメラで撮像することによって得られた撮像画像に基づいて、距離データを算出する。検査部は、算出された距離データに基づき、一対のカメラの相対的な位置ずれを検査する。
【0012】
ここで、第2の発明において、上述したパターンは、傾き角の異なる複数の直線で構成される屈曲したパターンであることが好ましい。この場合、検査部は、パターンの傾き角の変化する位置で距離データを複数の領域に分割する。そして、分割された領域のそれぞれにおいて視差に関する近似直線が算出され、パターンを構成する直線の傾きと算出された近似直線とに基づき、一対のカメラの相対的なずれ量が算出されることが望ましい。
【0013】
また、第2の発明において、検査部は、パターンを構成する直線の傾きと、算出された近似直線とをパラメータとして、一対のカメラの相対的な上下方向および回転方向のずれ量を算出することが好ましい。また、検査部は、パターンを構成する直線の傾きと、近似直線と、テストチャートまでの実距離に対応する視差とをパラメータとして、一対のカメラの相対的な左右方向のずれ量を算出することが好ましい。
【0014】
また、第2の発明は、一対のカメラの相対的な位置ずれに起因した一対の撮像画像の相対的なずれを補正パラメータを用いて補正する画像補正部をさらに有することが好ましい。このとき、検査部は、画像補正部に対し、算出されたずれ量に基づき補正パラメータを出力することが望ましい。
【0015】
また、第2の発明において、パターンを構成する複数の直線のそれぞれは、輝度階調が異なることが好ましい。
【0016】
さらに、第2の発明において、パターンは、基準方向と直交する方向にパターンが隣接して配置されたパターン群を構成しており、直交方向において、隣接するパターンの輝度階調がそれぞれ異なることが好ましい。
【0017】
さらに、第3の発明は、所定のカメラ基線長だけ離間された一対のカメラによって取得された一対の撮像画像に基づき算出される距離データを用いて、一対のカメラの相対的な位置ずれを検査する位置ずれ検査方法を提供する。この位置ずれ検査方法では、第1のステップとして、一対のカメラの前方でカメラ基線と基準方向とを一致させて平行に配置されているとともに基準方向から斜めに傾いたパターンが描かれたテストチャートを、一対のカメラで撮像する。第2のステップとして、撮像された一対の撮像画像に基づいて、距離データを算出する。第3のステップは、算出された距離データに基づき、一対のカメラの相対的な位置ずれを検査する。
【0018】
ここで、第3の発明において、上述したパターンは、傾き角の異なる複数の直線で構成される屈曲したパターンであることが好ましい。この場合、第3のステップは、パターンの傾き角の変化する位置で距離データを複数の領域に分割する。そして、分割された領域のそれぞれにおいて視差に関する近似直線が算出され、パターンを構成する直線の傾きと算出された近似直線とに基づき、一対のカメラの相対的なずれ量が算出されることが望ましい。
【0019】
また、第3の発明において、第3のステップは、パターンを構成する直線の傾きと、算出された近似直線とをパラメータとして、一対のカメラの相対的な上下方向および回転方向のずれ量を算出することが好ましい。また、第3のステップは、パターンを構成する直線の傾きと、算出された近似直線と、テストチャートまでの実距離に対応する視差とをパラメータとして、一対のカメラの相対的な左右方向のずれ量を算出することが好ましい。
【0020】
さらに、第3の発明は、一対のカメラの相対的な位置ずれに起因した一対の画像の相対的なずれを補正パラメータを用いて補正する第4のステップと、算出されたずれ量に基づき、補正パラメータをフィードバック補正する第5のステップとをさらに有することが好ましい。
【0021】
【発明の実施の形態】
図1は、本実施形態にかかるステレオ式監視装置1のブロック構成図である。本実施形態にかかるステレオ式監視装置1は、一例として、自車両前方の走行状況を監視する車外監視装置として機能する。なお、本実施形態の特徴の一つとして、このステレオ式監視装置1は、これら車外監視を行う前提として、例えば、製品出荷前の検査段階において、ステレオカメラの位置ずれを検査・調整する位置ずれ検査装置としても機能する。
【0022】
車外の景色を撮像するステレオカメラは、ルームミラーの近傍に取り付けられており、所定のカメラ基線長だけ離間された一対のカメラ2,3で構成されている。これら一対のカメラ2,3のそれぞれには、イメージセンサ(例えば、CCDまたはCMOSセンサ等)が内蔵されている。メインカメラ2は、ステレオ画像処理を行う際に必要な基準画像(右画像)を撮像し、サブカメラ3は、比較画像(左画像)を撮像する。互いの同期が取れている状態において、カメラ2,3から出力された各アナログ画像は、A/Dコンバータ4,5により、所定の輝度階調(例えば、256階調のグレースケール)のデジタル画像に変換される。
【0023】
デジタル化された一対の画像データは、画像補正部6において、輝度の補正や画像の幾何学的な変換等が行われる。通常、一対のカメラ2,3の位置は、程度の差はあるものの誤差(すなわち、位置ずれ)が存在するため、それに起因したずれが左右の各画像に生じている。このずれを補正するために、アフィン変換等を用いて、画像の回転や平行移動等の幾何学的な変換が行われる。数式1は、アフィン変換の基本形を示す。なお、本明細書では、「アフィン変換」という用語を、画像データを回転、移動または拡大・縮小する幾何学的な座標変換を総称する意味で用いる。
【数1】

Figure 0004018950
【0024】
この数式において、(i,j)は変換前の画像データの座標であり、(i’,j’)は変換後の画像データの座標である。また、補正パラメータとしてのアフィンパラメータSHFTI,SHFTJはそれぞれ、i方向(画像の水平方向)への移動、j方向(画像の垂直方向)への移動を表している。アフィンパラメータθ,Kはそれぞれθの回転、K倍の角度(|K|<1の場合は縮小)を示している。この画像補正部6は、後段の検査部14からの指示に基づき、これらアフィンパラメータの適切な値を使用することができる。
【0025】
このような画像処理を経て、メインカメラ2より基準画像データが得られ、サブカメラ3より比較画像データが得られる。これらの画像データ(ステレオ画像データ)は、各画素の輝度値(0〜255)の集合である。ここで、画像データによって規定される画像平面は、i−j座標系で表現され、画像の左下隅を原点として、水平方向をi座標軸、垂直方向をj座標軸とする。一フレーム(一画像の表示単位)相当のステレオ画像データは、後段のステレオ画像処理部7に出力されるとともに、画像データメモリ8に格納される。
【0026】
ステレオ画像処理部7は、基準画像データと比較画像データとに基づいて、一フレーム相当の撮像画像に関する距離データを算出する。ここで、「距離データ」とは、画像データによって規定される画像平面において小領域毎に算出された視差dの集合であり、個々の視差dは画像平面上の位置(i,j)と対応付けられている。それぞれの視差dは、基準画像の一部を構成する所定面積(例えば、4×4画素)の画素ブロック毎に1つ算出される。
【0027】
図2は、基準画像に設定される画素ブロックの説明図である。例えば、基準画像が200×512画素で構成されている場合、一フレーム相当の撮像画像から、画素ブロックPBijの個数相当(50×128個)の視差群が算出され得る。周知のように、視差dは、その算出単位である画素ブロックPBijに関する水平方向のずれ量であり、画素ブロックPBijに写し出された対象物までの距離と大きな相関がある。すなわち、画素ブロックPBij内に写し出されている対象物がカメラ2,3に近いほど、この画素ブロックPBijの視差dは大きくなり、対象物が遠いほど視差dは小さくなる(無限に遠い場合、視差dは0になる)。
【0028】
ある画素ブロックPBij(相関元)に関する視差dを算出する場合、この画素ブロックPBijの輝度特性と相関を有する領域(相関先)を比較画像において特定する。上述したように、カメラ2,3から対象物までの距離は、基準画像と比較画像との間における水平方向のずれ量として現れる。したがって、比較画像において相関先を探索する場合、相関元となる画素ブロックPijのj座標と同じ水平線(エピポーラライン)上を探索すればよい。ステレオ画像処理部7は、相関元のi座標を基準に設定された所定の探索範囲内において、エピポーラライン上を一画素ずつシフトしながら、相関元と相関先の候補との間の相関性を順次評価する(ステレオマッチング)。そして、原則として、最も相関が高いと判断される相関先(相関先の候補の内のいずれか)の水平方向のずれ量を、その画素ブロックPBijの視差dとする。
【0029】
2つの画素ブロックの相関は、例えば、シティブロック距離CBを算出することにより評価することができる。数式2は、シティブロック距離CBの基本形を示す。同数式において、p1ijは一方の画素ブロックのij番目の画素の輝度値であり、p2ijは他方の画素ブロックのij番目の輝度値である。シティブロック距離CBは、位置的に対応した輝度値p1ij,p2ijの差(絶対値)の画素ブロック全体における総和であって、その差が小さいほど両画素ブロックの相関が大きいことを意味している。
【数2】
Figure 0004018950
【0030】
基本的に、エピポーラライン上に存在する画素ブロック毎に算出されたシティブロック距離CBのうち、その値が最小となる画素ブロックが相関先と判断される。このようにして特定された相関先と相関元との間のずれ量が視差dとなる。なお、シティブロック距離CBを算出するステレオ画像処理部7のハードウェア構成については、特開平5−114099号公報に開示されているので、必要ならば参照されたい。このような処理を経て算出された距離データ、すなわち、画像上の位置(i,j)と対応付けられた視差dの集合は、距離データメモリ9に格納される。
【0031】
マイクロコンピュータ10は、CPU、ROM、RAM、入出力インターフェース等で構成されているが、これを機能的に捉えた場合、認識部11と、検査部14とを有する。
【0032】
認識部11は、道路形状(白線)や車両前方の立体物(走行車)等を認識する。これらの認識は、距離データメモリ9に格納された距離データDに基づいて行われる。なお、認識部11は、これらの認識に際し、画像データメモリ8中に記憶された画像データをさらに利用してもよい。また、図示していない車速センサや舵角センサからのセンサ情報、或いはナビゲーション情報等も必要に応じて参照される。そして、これらの認識結果に基づいて、前方のカーブや立体物に対する警報が必要と判定された場合、モニタやスピーカー等の警報装置12を作動させてドライバーに注意を促す。また、必要に応じて制御装置13を制御することにより、AT(自動変速機)のシフトダウンやエンジン出力の抑制、或いはブレーキの作動といった車両制御が実行される。
【0033】
図1に示す検査装置15は、製品の検査工程(例えば、製品の出荷前、或いは、定期点検時)においてのみ接続される外付けの装置である。マイクロコンピュータ10に検査装置15が接続され、検査装置15によって検査の開始が指示されると、検査部14は予めプログラムされた検査ルーチンを実行する。具体的には、検査部14は、テストチャートを撮像した一対の撮像画像から算出された距離データに基づき、一対のカメラ2,3の相対的な位置ずれを検査する。換言すれば、検査部14は、カメラ2,3に相対的な位置ずれが生じているか否かを判断し、位置ずれが生じていると判断した場合には、このずれ量を算出するとともに、この位置ずれを調整すべく算出されたずれ量を画像補正部6に出力する。
【0034】
図3および図4は、本実施形態にかかる位置ずれの検査手順を示したフローチャートである。まず、検査者は、検査ルーチンの開始指示に先立ち、所定のパターンが描かれたテストチャートを車両前方の所定位置に配置しておく。図5は、テストチャートの配置位置と検査対象である車両との関係を示した図である。同図において、テストチャート16は、車長方向(Z軸)に関してステレオカメラの取り付け位置からZ1の距離で、車高方向(Y軸)に関して地面から十字交点(例えば、テストチャート16の中央点)CまでがY1の高さで配置されている。このとき、テストチャート16は、基準方向を車幅方向(X軸)、すなわち、カメラ2,3のカメラ基線と一致させて平行に配置されている。ここで、基準方向とは、ステレオカメラ前方にテストチャート16を配置した際に、カメラ基線に対して、このテストチャート16に描かれるパターンが斜めに傾くように、テストチャート16の平面上に設定される方向をいう。このような状態でテストチャート16をカメラ2,3で撮像することにより、撮像画像にテストチャート16が写し出される。
【0035】
図6は、テストチャートの一例を示した図である。本実施形態における特徴の一つであるテストチャート16には、基準方向から斜めに傾いたパターンが描かれている。このようなパターンの一例としては、斜め方向に延在する同一輝度階調の直線(この直線は所定の幅を有する)を形成したパターンが挙げられる。テストチャート16では、このような直線が組合わされて、傾き角の異なる2本の直線で構成される屈曲したパターン、すなわち、略V字状のパターンが描かれている。また、同図に示す例では、このようなパターンが、基準方向と直交する方向(上下方向)に隣接して配置されたパターン群を構成している。同図において、直線のそれぞれに示した階調A〜Fはそれぞれ異なる輝度の階調を表現しており、このパターン群は、上下方向にランダムな輝度階調となるように構成されている。
【0036】
再び図3を参照して、検査ルーチンの手順を説明する。検査者が検査装置15を操作して検査の開始を指示すると、マイクロコンピュータ10(すなわち検査部14)は、1フレーム分の距離データDを、距離データメモリ9から読み出す(ステップ1)。
【0037】
ステップ2において、読み出された距離データDを処理対象として、この距離データDが信頼し得るものであるか、すなわち、距離Z1相当の視差dが算出されているか否かが評価される。換言すれば、このステップ2では、距離データDの信頼性を評価することにより、一対のカメラ2,3の相対的な位置ずれが検査される(より具体的には、位置ずれがあるか否かが判断される)。このステップ2では、撮像画像に写し出されたテストチャート16に関する距離データDを評価サンプルとして、この評価サンプルの距離値(視差d)と出現度数との関係を示したヒストグラムが生成される。そして、生成されたヒストグラムの特性が適正率rとして定量的に算出されるとともに、設定されたしきい値rthとこの適正率rとを比較することにより、算出された距離データDの信頼性が評価される。このとき、適正率rがしきい値rth以上であれば、信頼できる距離データDが算出されている(すなわち、カメラ2,3に位置ずれが生じていない)として肯定判定され、図4に示すステップ19に進む。これに対して、適正率rが判定しきい値rth未満であれば、信頼できない距離データDが算出されている(すなわち、カメラ2,3に位置ずれが生じている)として否定判定され、後段のステップ3に進む。なお、テストチャートを使用した距離データの検査方法およびその検査装置については、特開2001−91247号公報に開示されているので、必要ならば参照されたい。
【0038】
ステップ2に続くステップ3において、読み出された距離データDが、画像平面上の座標位置に対応する二次元的な平面において、縦方向に延在する短冊状の区分に切断(分割)される。そして、分割された区分のそれぞれを処理対象として、視差dに関するヒストグラム(頻度分布)が算出される(ステップ4)。このヒストグラムは、ある一つの区分における視差dの値と、その値相当の視差dの出現度数との関係を示すものであり、このステップ4により、分割された区分相当数のヒストグラムが算出される。
【0039】
ステップ5において、各区分を代表する代表視差d’が特定される。このステップ5では、算出されたヒストグラムを用いて、出現頻度が最も多く、かつ、所定のしきい値dth以上となる視差dの値が、代表視差d’として特定される。例えば、このしきい値dthは、テストチャート16までの距離Z1に相当する視差dを基準として、この基準となる視差dの値より若干小さめな値として決定されている。このとき、代表視差d’の候補となる視差dがヒストグラム内(すなわち、区分内)に存在しないときは、その区分については、代表視差d’の特定は行われない。このような代表視差d’の特定処理が分割された全ての区分に対応するヒストグラムについて行われ、最大で分割された区分相当数の代表視差d’が特定される。
【0040】
ステップ6において、テストチャート16に描かれたパターンの傾き角の変化する位置で、距離データDが複数の領域に分割される。具体的には、テストチャート16のパターンを構成する直線の傾き角が変化する位置(図6に示す「変化位置」)を基準として、この変化位置と座標位置的に対応する距離データD上の位置を境に、距離データDが複数の領域に分割される。図7は、距離データの領域分割の一例を示した説明図である。同図に示すように、V字状のテストチャート16を用いた場合、距離データDは、V字の中心を境に、2つの領域AreaL(図中左側),AreaR(図中右側)に分割されることとなる。このとき、この領域AreaL,AreaRと位置的に対応する区分に関して特定された代表視差d’が、領域AreaL,AreaRのそれぞれに対応付けられる。
【0041】
なお、ステップ6において、各領域に対応づけられる代表視差d’の個数が、所定の個数より小さい場合には、検査部14は、この距離データDを不適と判断し、後段のステップ20に進むことが好ましい。例えば、このような不適と判断される距離データDには、本実施形態で示す範囲内で調整可能な位置ずれ以上のずれが起こっている、或いは、アフィン変換では修正できないようなずれが生じていることが考えられる。
【0042】
そして、ステップ7において、領域AreaL,AreaRのそれぞれを処理対象として、この領域に対応付けられた代表視差d’に関する近似直線が算出される。換言すれば、このステップ7では、分割された領域AreaL,AreaRのそれぞれにおいて、視差d(正確には、代表視差d’)に関する近似直線が算出される。図8は、領域毎に算出される近似直線の一例を示す図である。この近似直線は、同図に示すように距離データD平面上のi座標と視差dとの直交二次元座標系において、例えば、最小二乗法を用いて算出される。算出された近似直線は、数式3に示すような一般形で示され、この近似直線を規定する直線パラメータα,βが領域AreaL,AreaRのそれぞれについて算出されることとなる。ここで、数式3において、領域AreaLに関して算出される近似直線d’Lについては、その直線パラメータα,βに添字としてLが付されいる。また、領域AreaRに関して算出される近似直線d’Rについては、その直線パラメータα,βに添字としてRが付されている。
【数3】
Figure 0004018950
【0043】
図9は、カメラ2,3の上下方向への相対的なずれに起因した視差のずれを示した説明図である。一般に、カメラ2,3に相対的な位置ずれがないと仮定した場合、平行に配置されたテストチャート16を撮像したならば、この撮像画像に基づき算出される視差dの値は、距離Z1に相当する値として一様にその値が定まる。ところで、カメラ2,3に上下方向の相対的な位置ずれが存在する場合(例えば、メインカメラ2を基準としてサブカメラ3がずれている場合)、比較画像に写し出されるテストチャート16のV字パターンは、本来あるべきの位置(破線で示すV字のパターン)よりも、例えば、上側にシフトした位置(実線で示すV字のパターン)に存在する(同図(a)参照)。この状態でステレオマッチングを行ったならば、マッチングされる位置(対応点)は、同一輝度階調のパターンが傾斜しているため本来マッチングされる位置よりも左右方向(すなわち、図中の矢印方向)に大きくずれる。換言すれば、このパターンによれば、カメラ2,3の上下方向の位置ずれは、左右方向のずれ、すなわち、視差のずれとして反映されることとなる。当然、このとき算出されるテストチャート16に関する視差の値は、真値から大きくずれた値となる。
【0044】
また、屈曲したパターンが描かれたテストチャートを使用した場合、パターンの傾き角が変化する位置を境に直線の傾きが逆転するため、それにともない算出される視差の値は、視差の真値よりも大きくなるものと、小さくなるものとが存在する。V字パターンが描かれたテストチャート16を使用した場合、同図に示す例では、V字の中心を境に、距離データDの左側では視差dの値が真値よりも大きくなり、また、距離データDの右側では視差dの値が真値よりも小さくなる。このような場合には、それぞれの領域AreaL,AreaRに対応付けられた視差dに関する近似直線は、図中(b)に示したような実線の軌跡となる。
【0045】
また、図10は、カメラ2,3の回転方向への相対的なずれに起因した視差のずれを示した説明図である。同図(a)に示すように、回転方向のずれが存在する場合(例えば、メインカメラ2を基準としてサブカメラ3がずれる場合)、比較画像に写し出されるテストチャート16のV字パターンは、本来あるべき位置よりも、例えば、時計回り方向にシフトした位置に存在している。この状態で、ステレオマッチングを行ったならば、マッチングされる位置(対応点)は、パターンが傾斜しているため、図中の矢印方向にずれる。また、V字パターンが描かれたテストチャート16を使用した場合、同図に示す例では、算出される視差dの値は、距離データDの左側から右側にかけて真値よりも大きくなっていく傾向となる。このような場合には、それぞれの領域AreaL,AreaRに対応付けられた視差dに関する近似直線は、同図(b)に示したような実線の軌跡となる。
【0046】
さらに、図11は、カメラ2,3の左右方向への相対的なずれに起因した視差のずれを示した説明図である。同図(a)に示すように、左右方向のずれが存在する場合(例えば、メインカメラ2を基準としてサブカメラ3がずれる場合)、比較画像に写し出されるテストチャート16のV字のパターンは、本来あるべき位置より、例えば、右方向にシフトした位置に存在している。この状態でステレオマッチングを行ったならば、マッチングされる位置(対応点)は、本来マッチングされる位置よりも左右方向(すなわち、図中の矢印方向)にずれた位置となる。このような場合には、それぞれの領域AreaL,AreaRに対応付けられた視差dに関する近似直線は、同図(b)に示したような実線の軌跡となる。
【0047】
図9〜11に示して説明したように、カメラ2,3に相対的な位置ずれが生じていると仮定した場合、テストチャート16を撮像することによって検出されるあるi座標位置における視差dの値は、一般に、数式4に示す関係を満たす。
【数4】
Figure 0004018950
【0048】
ここで、dLは、パターンの傾きの変化位置、すなわち、V字の中心を境とした領域AreaLにおける視差、dRは、領域AreaRにおける視差である。また、Δiは基準画像と比較画像との左右方向への相対的なずれ量(すなわち、カメラ2,3の左右方向への相対的なずれ量)、Δjはカメラ2,3の上下方向への相対的なずれ量、Δθはカメラ2,3の回転方向への相対的なずれ量である。また、Cはテストチャート16までの距離Z1に相当する視差dである。さらに、A(すなわち、ALおよびAR)は、数式5で示されるように、テストチャート16のパターンの傾きによって与えられる定数である。
【数5】
Figure 0004018950
【0049】
この数式5において、αLは、V字の右下がりの直線(V字の中心を境に左側)の傾きを示し、αRは、V字の右上がりの直線(V字の中心を境に右側)の傾きを示している。また、pvは、カメラ2,3の1画素相当の高さ、phは、カメラ2,3の1画素相当の幅を示している。
【0050】
数式4から理解されるように、テストチャート16が写し出された撮像画像に基づき算出された距離データDによって特定される視差dは、視差dの真値Cに以下に示す3つのずれ量が加味される。
(1)左右方向の位置ずれ量Δi
(2)上下方向の位置ずれが反映された左右方向のずれ
(3)回転方向の位置ずれが反映された左右方向のずれ
ここで、回転方向の位置ずれが反映された左右方向のずれは、i座標値に回転方向のずれ量Δθとパターンの傾きAとを乗じた値、上下方向の位置ずれが反映された左右方向のずれは、上下方向のずれΔjに傾きAを乗じた値として算出される。
【0051】
したがって、算出された視差d(正確には、代表視差d’)に関する近似直線が数式3として求められているならば、数式3と数式6とに基づき、これらのずれ量Δi,ΔjおよびΔθが特定可能となる。
【0052】
そこで、再び図3に示すステップ8において、以下に示す数式6に基づき、ステレオカメラのずれ量が算出される。数式6から理解されるように、このステップ8では、カメラ2,3の相対的な位置ずれとして、上下方向のずれ量Δj、左右方向のずれ量Δiおよび回転方向のずれ量Δθのそれぞれが一義的に特定される。
【数6】
Figure 0004018950
【0053】
この数式6の意味するところは、テストチャート16のパターンを構成する直線の傾きと、ステップ7において算出された近似直線とに基づき、カメラ2,3の相対的な位置ずれを算出できることである。すなわち、同式から理解されるように、パターンを構成する直線の傾きと、算出された近似直線とをパラメータとして、カメラ2,3の相対的な上下方向および回転方向のずれΔj,Δθが算出される。また、パターンを構成する直線の傾きと、近似直線と、テストチャート16までの実距離Z1に対応する視差Cとをパラメータとして、カメラ2,3の相対的な左右方向のずれΔiが算出される。
【0054】
そして、図4に示すステップ9において、算出された上下方向のずれ量Δjと、所定のしきい値Δjthとが比較され、算出されたずれ量Δjが補正すべきずれ量であるか否かが判断される。具体的には、算出されたずれ量Δjが所定のしきい値Δjth以下となるか否かにより、このずれ量Δjが、補正すべきずれ量であるか否かの判断が行われる。ここで、所定のしきい値Δjthは、算出されたずれ量Δiが許容可能となるずれ量の最大値として決定されている。したがって、このステップ9で肯定判定された場合、検査部14は、現在のカメラ2,3の状態が補正する程度のずれが生じていないと判断し、ステップ10に進む。このとき、検査部14は、画像補正部6にて用いられるアフィンパラメータの現在値を把握しており、左右方向のパラメータSHFTJを現在値のまま維持する(ステップ10)。ここで、アフィンパラメータの現在値とは、製品出荷前の検査段階では、例えば0(すなわち、未定値)をいい、定期点検における検査段階では、製品出荷時の検査段階(或いは、以前の定期点検時における検査段階)で決定された値をいう。一方、このステップ9で否定判定された場合、検査部14は、現在のカメラ2,3の状態に補正すべきずれが生じていると判断し、ステップ11に進む。そして、検査部14は、パラメータSHFTJの現在値に、算出されたずれ量Δj相当の値を加算した値を、パラメータSHFTJの現在値として更新する(ステップ11)。
【0055】
ステップ12において、算出された左右方向のずれ量Δiと、所定のしきい値Δithとが比較され、算出されたずれ量Δiが補正すべきずれ量であるか否かが判断される。そして、ステップ9に示した処理と同様、算出されたずれ量Δiが所定のしきい値Δith以下と判断された場合には、左右方向のアフィンパラメータSHFTIが現在値のまま維持される(ステップ13)。一方、算出されたずれ量Δiが所定のしきい値Δithより大きいと判断された場合には、パラメータSHFTIの現在値に、算出されたずれ量Δi相当の値を加算した値が、パラメータSHFTIの現在値として更新される(ステップ14)。
【0056】
さらに、算出された回転方向のずれ量Δθと、所定のしきい値Δθthとが比較される(ステップ15)。そして、ステップ9およびステップ12と同様、回転方向のアフィンパラメータθが現在値のまま維持される(ステップ16)、或いは、パラメータθの現在値に、算出されたずれ量Δθ相当の値を加算した値が、パラメータθの現在値として更新される(ステップ17)。そして、算出されたずれ量(具体的には、更新されたアフィンパラメータ)が画像補正部6に対して出力さる。これにより、算出されたずれ量に基づき、一対の画像の相対的なずれを補正する補正パラメータ(すなわち、アフィンパラメータ)がフィードバック補正される。なお、このとき算出されたずれ量のそれぞれが、所定のしきい値以下となる場合には、後述するステップ18をスキップして、ステップ19に進む。
【0057】
そして、ステップ16(またはステップ17)に続くステップ18において、更新されたアフィンパラメータで画像変換が行われた一対の撮像画像に基づき算出された距離データDを読み出し、上述したステップ2と同様に、距離データの信頼性が評価される。このとき、距離データDが信頼性に足りるものであると判断された場合には、ステップ19に進み、調整結果を「OK」として、本ルーチンを抜ける。この場合、検査部14における検査結果を受けて、検査装置15は検査者に対して検査結果が「良好」である旨を通知する。一方、この距離データDが信頼性に足りるものではないと判断された場合、ステップ20に進み、検査結果を「NG」として、本ルーチンを抜ける。この場合、検査部14における検査結果を受けて、検査装置15は、検査者に対して調整結果が「不良」である旨を通知する。
【0058】
以上の説明からわかるように、本実施形態に示す位置ずれ検査手法では、まず、予め規定された位置に配置されたテストチャート16を一対のカメラ2,3で撮像する。そして、撮像画像に写し出されたテストチャート16に関する距離データDに基づき、距離データDの算出異常の有無、すなわち、カメラ2,3の位置ずれが検査される。上述したテストチャート16は、パターンが斜めに傾いているため、カメラ2,3の位置ずれに起因して、マッチングする対応点を左右方向にずらす作用がある。したがって、このとき算出される視差dの値は真値からずれた値となる。特に、カメラ2,3の上下方向・回転方向のずれに対しては、このテストチャート16を用いることにより、位置ずれが大きな視差のずれとして現れるので、これらの位置ずれを有効に特定することができる。それ故に、微少な位置ずれ(すなわち、これらの位置ずれに起因する一対の撮像画像の相対的なずれがサブピクセル単位となるようなずれ)であっても、この位置ずれの特定を効率的かつ正確に行うことができる。
【0059】
また、テストチャート16には、傾き角の異なる複数の直線で構成される屈曲したパターン(本実施形態では、V字状のパターン)が描かれている。この傾き角の変化する位置を境に、距離データDを領域分割し、それぞれの領域で視差dに関する近似直線を求めることで、この近似直線とパターンの傾きとに基づき、カメラ2,3の位置ずれを特定することができる。また、本実施形態では、これらの位置ずれが定量的に特定されるため、この位置ずれに起因した一対の撮像画像の相対的な位置ずれの補正を、自動的に行うことができる。
【0060】
なお、上述した実施形態では、距離データのカメラ2,3の位置ずれを検査・調整することを主として説明をおこなったが、このテストチャート16の使用方法は、上述した実施形態に限定されるものではない。例えば、カメラ2,3の位置ずれの他にも、ステレオカメラの感度バランスのずれ、カメラのレンズ特性の影響、または適切でない画像補正等に起因して、算出された距離データの信頼性が低下してしまう場合がある。本実施形態に示すテストチャート16は、上述したように視差dの値を真値から拡大してずらす作用を奏する。したがって、テストチャート16を用いて、ステップ2の処理を行えば、これらの要素の起因して距離データDの信頼性が低下する場合であっても、この距離データDの信頼性を有効に評価することができる。
【0061】
なお、本実施形態では、ステップ2において、距離データDを評価するステップを設けているが、上述した検査ルーチンにステップ2を設けるか否かは選択的である。例えば、製品出荷前の検査段間で、単に、最適なアフィンパラメータを求めるために行われるのであれば、このステップ2は省略可能である。このようなステップ2は、例えば、経時的な変化が予想される、定期点検時の検査段階のみに実行されてもよい。
【0062】
また、本実施形態では、テストチャートとして、V字状のパターンが描かれたテストチャート16を用いて説明をおこなったが、本発明のテストチャートはこれに限定されるものではない。例えば、テストチャートは、傾き角の異なる複数の直線で構成されるパターン、例えば、W字状のパターンが描かれていてもよい。このようなパターンでは、エピポーラライン上の探索領域内に同一輝度階調のパターンが複数存在しないように、複数の直線のそれぞれが、輝度階調が異なることが好ましい。なお、W字状のパターンが描かれているテストチャートでは、距離データDは、左右方向にかけて直線の傾き角の変化する位置を境に、4つの領域に分割されることとなる。
【0063】
また、テストチャートの別の一例としては、上述したテストチャート16を上下方向で線対称に配置した、X字状のパターン、或いは、◇状のパターンであってもよい。このようなパターンが描かれるテストチャートでは、距離データDは、上下左右の4つの領域に分割されるとなる。
【0064】
また、本明細書において、「パターンが基準方向から斜めに傾いている」とは、その傾きが斜めとなるような曲線をも含むことに理解されたい。したがって、V字状と近似する略U字状(二次関数)のパターンであってもよいし、W字状のパターンと近似する波形状のパターンであってもよい。また、上述した◇状のパターンと近似する、楕円或いは円状のパターンであっても、上述したテストパターン16と同様の作用、効果を奏することができる。
【0065】
また、テストチャートの別の一例としては、パターンとして水平な縞模様が描かれるようなテストチャートも挙げられる。なお、このとき、テストチャートの平面に設定される基準方向は、カメラ基線に対して、パターンが斜めに傾くようにさせる関係上、水平な縞模様に対して斜めに傾いて設定されることとなる。この場合、検査時には、このテストチャート、或いは、ステレオカメラ全体を回転させ、カメラ基線とテストチャートの基準方向とを一致させることで、上述した実施形態と同様な作用、効果を奏することができる。
【0066】
【発明の効果】
このように、本発明によれば、テストチャートに描かれるパターンが斜めに傾いている。このテストチャートを所定のカメラ基線長だけ離間された一対のカメラで撮像した場合、取得された一対の撮像画像に基づき算出される距離データでは、カメラの位置ずれが左右方向のずれ、すなわち、視差の値として反映される。これにより、カメラの位置ずれを効果的に検査することができる。
【図面の簡単な説明】
【図1】 本実施形態にかかるステレオ式監視装置のブロック構成図
【図2】 基準画像に設定される画素ブロックの説明図
【図3】 本実施形態にかかる位置ずれの検査手順を示したフローチャート
【図4】 本実施形態にかかる位置ずれの検査手順を示したフローチャート
【図5】 テストチャートの配置位置と検査対象である車両との関係を示した図
【図6】 テストチャートの一例を示した図
【図7】 距離データの領域分割の一例を示した説明図
【図8】 領域毎に算出される近似直線の一例を示す図
【図9】 カメラの上下方向への相対的なずれに起因した視差のずれを示した説明図
【図10】 カメラの回転方向への相対的なずれに起因した視差のずれを示した説明図
【図11】 カメラの左右方向への相対的ずれに起因した視差のずれを示した説明図
【符号の説明】
1 ステレオ式監視装置
2 メインカメラ
3 サブカメラ
4 A/Dコンバータ
5 A/Dコンバータ
6 画像補正部
7 ステレオ画像処理部
8 画像データメモリ
9 距離データメモリ
10 マイクロコンピュータ
11 認識部
12 警報装置
13 制御装置
14 検査部
15 検査装置
16 テストチャート[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a misalignment inspection apparatus and a misalignment inspection method for inspecting misalignment of a pair of cameras using a test chart.
[0002]
[Prior art]
In recent years, stereo-type monitoring devices have been attracting attention and put into practical use in various applications such as vehicle exterior monitoring, level crossing monitoring, terrain recognition, or altimeter. In this monitoring apparatus, it is necessary to calculate parallax that is distance data as a premise for recognizing and monitoring an object. The parallax is calculated by performing a stereo matching process based on a pair of captured images obtained from a stereo camera.
[0003]
When such a stereo camera is attached to the vehicle body, a high level of accuracy is required for the attachment position. This is because if the stereo camera mounting position is deviated, that is, if the relative position of the pair of cameras is deviated (positional deviation), the imaging direction of each camera will be deviated. This is because it directly affects In particular, the deviation in the vertical direction and rotation direction of the camera appears as a deviation of the same horizontal line (epipolar line) in each image when performing stereo matching, which reduces the reliability of the calculated distance data. May end up.
[0004]
In this regard, Japanese Patent Laid-Open No. 2001-91247 proposes a technique for inspecting the reliability of distance data calculated based on a stereo image. In this conventional technique, a pair of captured images are acquired by capturing a test chart on which a random luminance pattern is drawn with a stereo camera, and distance data is calculated based on these captured images. Then, using the distance data regarding the test chart displayed in the captured image as an evaluation sample, the distance data is evaluated based on the actual distance between the stereo camera and the test chart. Thereby, the reliability of the calculated distance data is determined.
[0005]
[Problems to be solved by the invention]
However, although the prior art described in the above publication can evaluate the reliability of the distance data, it is possible to specify how much the camera is misaligned, that is, the amount of the misalignment. It is not disclosed until. Further, in order to accurately determine the reliability of the distance data, it is preferable to detect the deviation with a resolution of sub-pixel units, that is, one pixel (one pixel) or less. This prior art discloses that distance data is calculated in units of sub-pixels, and thereby determination of positional deviation is performed in units of sub-pixels. However, since this method calculates distance data in units of subpixels, the amount of calculation processing is large, and the calculation processing may be complicated.
[0007]
The object of the present invention is to Effective inspection of camera misalignment, especially vertical and rotational misalignment Using a test chart, it is effective to inspect the positional deviation of the camera that reduces the reliability of the distance data.
[0008]
[Means for Solving the Problems]
In order to solve such a problem, the first invention uses a distance data calculated based on a pair of captured images acquired by a pair of cameras separated by a predetermined camera baseline length, and uses a distance data When inspecting a general misalignment, the camera base line and the reference direction are arranged in parallel in front of the pair of cameras, and are imaged by the pair of cameras, so that they are displayed in the pair of captured images. Provide a test chart. In this test chart, the pattern drawn on the test chart is inclined obliquely from the reference direction.
[0009]
Here, in the first invention, the pattern preferably forms a straight line having the same luminance gradation extending in an oblique direction. In this case, the pattern is preferably a bent pattern composed of a plurality of straight lines having different inclination angles. In this case, it is preferable that the plurality of straight lines have different luminance gradations.
[0010]
In the first invention, the pattern constitutes a group of patterns arranged adjacent to each other in a direction orthogonal to the reference direction, and the pattern group may have random luminance gradations in the orthogonal direction. preferable.
[0011]
The second invention is a misregistration inspection apparatus that inspects a relative misregistration between a pair of cameras using distance data calculated based on a pair of captured images. A pair of cameras, a stereo image processing unit, A misalignment inspection apparatus having an inspection unit is provided. In this misalignment inspection apparatus, the pair of cameras are separated by a predetermined camera baseline length and output a captured image. In addition, the stereo image processing unit is arranged in parallel with the camera base line and the reference direction aligned in front of the pair of cameras, and a test chart in which a pattern inclined obliquely from the reference direction is drawn Distance data is calculated based on a captured image obtained by capturing with a camera. The inspection unit inspects a relative positional deviation between the pair of cameras based on the calculated distance data.
[0012]
Here, in the second invention, the pattern described above is preferably a bent pattern composed of a plurality of straight lines having different inclination angles. In this case, the inspection unit divides the distance data into a plurality of regions at positions where the inclination angle of the pattern changes. Then, it is desirable that an approximate straight line related to parallax is calculated in each of the divided areas, and a relative shift amount between the pair of cameras is calculated based on the inclination of the straight line forming the pattern and the calculated approximate straight line. .
[0013]
In the second invention, the inspection unit calculates the relative vertical and rotational shift amounts of the pair of cameras using the slope of the straight line constituting the pattern and the calculated approximate straight line as parameters. Is preferred. In addition, the inspection unit calculates a relative left-right displacement amount of the pair of cameras using parameters of the inclination of the straight line constituting the pattern, the approximate straight line, and the parallax corresponding to the actual distance to the test chart. Is preferred.
[0014]
Moreover, it is preferable that the second invention further includes an image correction unit that corrects a relative shift between a pair of captured images caused by a relative positional shift between the pair of cameras using a correction parameter. At this time, it is desirable that the inspection unit outputs a correction parameter to the image correction unit based on the calculated shift amount.
[0015]
In the second invention, it is preferable that each of the plurality of straight lines constituting the pattern has a different luminance gradation.
[0016]
Furthermore, in the second invention, the patterns constitute a pattern group in which the patterns are arranged adjacent to each other in a direction orthogonal to the reference direction, and the luminance gradations of the adjacent patterns are different in the orthogonal direction. preferable.
[0017]
Furthermore, the third invention inspects a relative positional shift between a pair of cameras using distance data calculated based on a pair of captured images acquired by a pair of cameras separated by a predetermined camera baseline length. A positional deviation inspection method is provided. In this misalignment inspection method, as a first step, a test chart in which a camera base line and a reference direction are arranged in parallel in front of a pair of cameras and arranged in parallel and obliquely inclined from the reference direction is drawn. Are imaged with a pair of cameras. As a second step, distance data is calculated based on a pair of captured images. In the third step, the relative positional deviation between the pair of cameras is inspected based on the calculated distance data.
[0018]
Here, in the third invention, the pattern described above is preferably a bent pattern composed of a plurality of straight lines having different inclination angles. In this case, the third step divides the distance data into a plurality of regions at positions where the inclination angle of the pattern changes. Then, it is desirable that an approximate straight line related to parallax is calculated in each of the divided areas, and a relative shift amount between the pair of cameras is calculated based on the inclination of the straight line forming the pattern and the calculated approximate straight line. .
[0019]
In the third invention, the third step calculates the relative vertical and rotational shift amounts of the pair of cameras using the slope of the straight line constituting the pattern and the calculated approximate straight line as parameters. It is preferable to do. Also, the third step is the relative left-right displacement between the pair of cameras, using as parameters the slope of the straight line constituting the pattern, the calculated approximate straight line, and the parallax corresponding to the actual distance to the test chart. It is preferred to calculate the amount.
[0020]
Furthermore, the third invention is based on the fourth step of correcting the relative displacement of the pair of images due to the relative displacement of the pair of cameras using the correction parameter, and the calculated amount of displacement. Preferably, the method further includes a fifth step of feedback correcting the correction parameter.
[0021]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 is a block configuration diagram of a stereo monitoring device 1 according to the present embodiment. As an example, the stereo monitoring device 1 according to the present embodiment functions as an out-of-vehicle monitoring device that monitors a traveling state ahead of the host vehicle. Note that as one of the features of the present embodiment, the stereo type monitoring apparatus 1 is based on the premise that the outside monitoring is performed, for example, in the inspection stage before product shipment, the positional deviation for inspecting and adjusting the positional deviation of the stereo camera. It also functions as an inspection device.
[0022]
A stereo camera that captures the scenery outside the vehicle is attached in the vicinity of the rearview mirror, and includes a pair of cameras 2 and 3 that are separated by a predetermined camera base line length. Each of the pair of cameras 2 and 3 includes an image sensor (for example, a CCD or CMOS sensor). The main camera 2 captures a reference image (right image) necessary for performing stereo image processing, and the sub camera 3 captures a comparison image (left image). In a state where each other is synchronized, each analog image output from the cameras 2 and 3 is converted into a digital image of a predetermined luminance gradation (for example, 256 gradation gray scale) by the A / D converters 4 and 5. Is converted to
[0023]
A pair of digitized image data is subjected to brightness correction, image geometric conversion, and the like in the image correction unit 6. Usually, there is an error (that is, a positional shift) between the positions of the pair of cameras 2 and 3, but there is a shift in the left and right images. In order to correct this deviation, geometrical transformation such as image rotation or translation is performed using affine transformation or the like. Equation 1 shows the basic form of affine transformation. In this specification, the term “affine transformation” is used to generically refer to geometric coordinate transformation for rotating, moving, enlarging / reducing image data.
[Expression 1]
Figure 0004018950
[0024]
In this equation, (i, j) is the coordinates of the image data before conversion, and (i ′, j ′) is the coordinates of the image data after conversion. The affine parameters SHFTI and SHFTJ as correction parameters represent movement in the i direction (horizontal direction of the image) and movement in the j direction (vertical direction of the image), respectively. The affine parameters θ and K indicate the rotation of θ and the angle K times (reduction when | K | <1). The image correction unit 6 can use appropriate values of these affine parameters based on an instruction from the inspection unit 14 at the subsequent stage.
[0025]
Through such image processing, reference image data is obtained from the main camera 2, and comparison image data is obtained from the sub camera 3. These image data (stereo image data) is a set of luminance values (0 to 255) of each pixel. Here, the image plane defined by the image data is expressed in the ij coordinate system, with the lower left corner of the image as the origin, the horizontal direction as the i coordinate axis, and the vertical direction as the j coordinate axis. Stereo image data corresponding to one frame (one image display unit) is output to the subsequent stereo image processing unit 7 and stored in the image data memory 8.
[0026]
The stereo image processing unit 7 calculates distance data related to a captured image corresponding to one frame based on the reference image data and the comparison image data. Here, the “distance data” is a set of parallax d calculated for each small area on the image plane defined by the image data, and each parallax d corresponds to a position (i, j) on the image plane. It is attached. Each parallax d is calculated for each pixel block of a predetermined area (for example, 4 × 4 pixels) constituting a part of the reference image.
[0027]
FIG. 2 is an explanatory diagram of pixel blocks set in the reference image. For example, when the reference image is composed of 200 × 512 pixels, a parallax group corresponding to the number of pixel blocks PBij (50 × 128) can be calculated from a captured image corresponding to one frame. As is well known, the parallax d is the amount of horizontal displacement with respect to the pixel block PBij that is the calculation unit, and has a large correlation with the distance to the object projected in the pixel block PBij. That is, the closer the object projected in the pixel block PBij is to the cameras 2 and 3, the larger the parallax d of the pixel block PBij is, and the farther the object is, the smaller the parallax d is. d becomes 0).
[0028]
When calculating the parallax d regarding a certain pixel block PBij (correlation source), a region (correlation destination) having a correlation with the luminance characteristic of the pixel block PBij is specified in the comparison image. As described above, the distance from the cameras 2 and 3 to the object appears as a horizontal shift amount between the reference image and the comparison image. Therefore, when searching for the correlation destination in the comparison image, it is only necessary to search on the same horizontal line (epipolar line) as the j coordinate of the pixel block Pij as the correlation source. The stereo image processing unit 7 shifts the correlation between the correlation source candidate and the correlation destination candidate while shifting one pixel at a time on the epipolar line within a predetermined search range set based on the i coordinate of the correlation source. Sequential evaluation (stereo matching). In principle, the amount of horizontal deviation of the correlation destination (one of the correlation destination candidates) determined to have the highest correlation is defined as the parallax d of the pixel block PBij.
[0029]
The correlation between two pixel blocks can be evaluated, for example, by calculating a city block distance CB. Formula 2 shows a basic form of the city block distance CB. In the equation, p1ij is the luminance value of the ijth pixel of one pixel block, and p2ij is the ijth luminance value of the other pixel block. The city block distance CB is the total sum of the differences (absolute values) of the luminance values p1ij and p2ij corresponding to each other in the entire pixel block, and the smaller the difference, the greater the correlation between both pixel blocks. .
[Expression 2]
Figure 0004018950
[0030]
Basically, among the city block distances CB calculated for each pixel block existing on the epipolar line, the pixel block having the smallest value is determined as the correlation destination. The amount of deviation between the correlation destination specified in this way and the correlation source is the parallax d. Note that the hardware configuration of the stereo image processing unit 7 for calculating the city block distance CB is disclosed in Japanese Patent Laid-Open No. 5-1114099, so refer to it if necessary. The distance data calculated through such processing, that is, a set of parallax d associated with the position (i, j) on the image is stored in the distance data memory 9.
[0031]
The microcomputer 10 includes a CPU, a ROM, a RAM, an input / output interface, and the like. When the microcomputer 10 is viewed as a function, the microcomputer 10 includes a recognition unit 11 and an inspection unit 14.
[0032]
The recognition unit 11 recognizes a road shape (white line), a three-dimensional object (running vehicle) in front of the vehicle, and the like. These recognitions are performed based on the distance data D stored in the distance data memory 9. Note that the recognition unit 11 may further use the image data stored in the image data memory 8 for the recognition. Further, sensor information from a vehicle speed sensor or a steering angle sensor, navigation information, or the like, not shown, is referred to as necessary. Then, based on these recognition results, when it is determined that an alarm for a forward curve or a three-dimensional object is necessary, the alarm device 12 such as a monitor or a speaker is activated to alert the driver. Further, by controlling the control device 13 as necessary, vehicle control such as AT (automatic transmission) shift down, engine output suppression, or brake operation is executed.
[0033]
An inspection device 15 shown in FIG. 1 is an external device that is connected only in a product inspection process (for example, before shipment of a product or during periodic inspection). When the inspection device 15 is connected to the microcomputer 10 and the inspection device 15 instructs the start of the inspection, the inspection unit 14 executes a pre-programmed inspection routine. Specifically, the inspection unit 14 inspects the relative positional deviation between the pair of cameras 2 and 3 based on the distance data calculated from the pair of captured images obtained by capturing the test chart. In other words, the inspection unit 14 determines whether or not a relative positional shift has occurred in the cameras 2 and 3, and when determining that the positional shift has occurred, calculates the shift amount, The shift amount calculated to adjust the positional shift is output to the image correction unit 6.
[0034]
FIG. 3 and FIG. 4 are flowcharts showing the misalignment inspection procedure according to the present embodiment. First, the inspector arranges a test chart on which a predetermined pattern is drawn at a predetermined position in front of the vehicle prior to an instruction to start the inspection routine. FIG. 5 is a diagram showing a relationship between the arrangement position of the test chart and the vehicle to be inspected. In the figure, a test chart 16 is a distance Z1 from the stereo camera mounting position in the vehicle length direction (Z axis) and a cross point from the ground in the vehicle height direction (Y axis) (for example, the center point of the test chart 16). Up to C are arranged at the height of Y1. At this time, the test chart 16 is arranged in parallel so that the reference direction coincides with the vehicle width direction (X axis), that is, the camera base line of the cameras 2 and 3. Here, the reference direction is set on the plane of the test chart 16 so that the pattern drawn on the test chart 16 is inclined with respect to the camera base line when the test chart 16 is arranged in front of the stereo camera. The direction to be done. When the test chart 16 is imaged by the cameras 2 and 3 in such a state, the test chart 16 is displayed on the captured image.
[0035]
FIG. 6 is a diagram showing an example of a test chart. On the test chart 16 which is one of the features in the present embodiment, a pattern inclined obliquely from the reference direction is drawn. As an example of such a pattern, there is a pattern in which a straight line having the same luminance gradation extending in an oblique direction (the straight line has a predetermined width) is formed. In the test chart 16, such straight lines are combined to draw a bent pattern composed of two straight lines having different inclination angles, that is, a substantially V-shaped pattern. Further, in the example shown in the figure, such a pattern constitutes a pattern group arranged adjacent to a direction (vertical direction) orthogonal to the reference direction. In the figure, gradations A to F shown on the straight lines represent gradations having different luminances, and this pattern group is configured to have random luminance gradations in the vertical direction.
[0036]
The procedure of the inspection routine will be described with reference to FIG. 3 again. When the inspector operates the inspection device 15 to instruct the start of the inspection, the microcomputer 10 (that is, the inspection unit 14) reads the distance data D for one frame from the distance data memory 9 (step 1).
[0037]
In step 2, the read distance data D is processed, and it is evaluated whether the distance data D is reliable, that is, whether the parallax d corresponding to the distance Z1 is calculated. In other words, in this step 2, the relative positional deviation between the pair of cameras 2 and 3 is inspected by evaluating the reliability of the distance data D (more specifically, whether there is a positional deviation or not). Is judged). In this step 2, the distance data D related to the test chart 16 projected on the captured image is used as an evaluation sample, and a histogram showing the relationship between the distance value (parallax d) of this evaluation sample and the appearance frequency is generated. The characteristics of the generated histogram are quantitatively calculated as the appropriate rate r, and the reliability of the calculated distance data D is compared by comparing the set threshold value rth with the appropriate rate r. Be evaluated. At this time, if the appropriate rate r is equal to or greater than the threshold value rth, an affirmative determination is made that reliable distance data D has been calculated (that is, no positional deviation has occurred in the cameras 2 and 3), and the result is shown in FIG. Proceed to step 19. On the other hand, if the appropriate rate r is less than the determination threshold value rth, a negative determination is made that the unreliable distance data D has been calculated (that is, the camera 2 or 3 is misaligned), and the subsequent stage Proceed to step 3. The distance data inspection method using the test chart and the inspection apparatus thereof are disclosed in Japanese Patent Laid-Open No. 2001-91247, so refer to them if necessary.
[0038]
In step 3 following step 2, the read distance data D is cut (divided) into strip-like sections extending in the vertical direction on a two-dimensional plane corresponding to the coordinate position on the image plane. . Then, a histogram (frequency distribution) regarding the parallax d is calculated for each of the divided sections as a processing target (step 4). This histogram shows the relationship between the value of the parallax d in a certain section and the appearance frequency of the parallax d corresponding to that value, and the histogram of the number of divided sections corresponding to this step 4 is calculated. .
[0039]
In step 5, a representative parallax d ′ representing each section is identified. In this step 5, using the calculated histogram, the value of the parallax d having the highest appearance frequency and equal to or greater than a predetermined threshold value dth is specified as the representative parallax d ′. For example, the threshold value dth is determined as a value slightly smaller than the reference value of the parallax d with reference to the parallax d corresponding to the distance Z1 to the test chart 16. At this time, when the parallax d that is a candidate for the representative parallax d ′ does not exist in the histogram (that is, in the section), the representative parallax d ′ is not specified for the section. Such a process for specifying the representative parallax d ′ is performed on the histograms corresponding to all the divided sections, and the corresponding number of representative parallaxes d ′ divided at the maximum are specified.
[0040]
In step 6, the distance data D is divided into a plurality of regions at positions where the inclination angle of the pattern drawn on the test chart 16 changes. Specifically, with reference to the position where the inclination angle of the straight line constituting the pattern of the test chart 16 changes ("change position" shown in FIG. 6) as a reference, the distance data D corresponding to this change position in terms of the coordinate position. The distance data D is divided into a plurality of regions with the position as a boundary. FIG. 7 is an explanatory diagram showing an example of area division of distance data. As shown in the figure, when the V-shaped test chart 16 is used, the distance data D is divided into two areas AreaL (left side in the figure) and AreaR (right side in the figure) with the V-shaped center as a boundary. Will be. At this time, the representative parallax d ′ specified for the section corresponding to the areas AreaL and AreaR is associated with each of the areas AreaL and AreaR.
[0041]
If the number of representative parallaxes d ′ associated with each region is smaller than the predetermined number in step 6, the inspection unit 14 determines that the distance data D is inappropriate, and proceeds to step 20 in the subsequent stage. It is preferable. For example, in the distance data D determined to be inappropriate, there is a shift larger than the position shift that can be adjusted within the range shown in the present embodiment, or a shift that cannot be corrected by affine transformation. It is possible that
[0042]
Then, in step 7, an approximate straight line relating to the representative parallax d 'associated with this area is calculated for each of the areas AreaL and AreaR. In other words, in step 7, an approximate straight line related to the parallax d (more precisely, the representative parallax d ′) is calculated in each of the divided areas AreaL and AreaR. FIG. 8 is a diagram illustrating an example of an approximate line calculated for each region. This approximate straight line is calculated using, for example, the least square method in an orthogonal two-dimensional coordinate system of the i coordinate and the parallax d on the distance data D plane as shown in FIG. The calculated approximate straight line is shown in a general form as shown in Equation 3, and straight line parameters α and β defining the approximate straight line are calculated for each of the areas AreaL and AreaR. Here, in Equation 3, for the approximate straight line d′ L calculated for the area AreaL, L is added as a subscript to the straight line parameters α and β. Further, for the approximate straight line d′ R calculated for the area AreaR, R is added as a subscript to the straight line parameters α and β.
[Equation 3]
Figure 0004018950
[0043]
FIG. 9 is an explanatory diagram showing a parallax shift caused by a relative shift in the vertical direction of the cameras 2 and 3. In general, when it is assumed that there is no relative displacement between the cameras 2 and 3, if the test chart 16 arranged in parallel is imaged, the value of the parallax d calculated based on this captured image is the distance Z1. The corresponding value is uniformly determined. By the way, when there is a relative positional shift in the vertical direction between the cameras 2 and 3 (for example, when the sub camera 3 is shifted with respect to the main camera 2), the V-shaped pattern of the test chart 16 projected on the comparison image. Exists at a position shifted upward (a V-shaped pattern indicated by a solid line), for example, from a position (V-shaped pattern indicated by a broken line) that should be originally (see FIG. 5A). If stereo matching is performed in this state, the matching position (corresponding point) is the left-right direction (that is, the direction of the arrow in the figure) because the pattern of the same luminance gradation is inclined. ). In other words, according to this pattern, the vertical position shift of the cameras 2 and 3 is reflected as the horizontal shift, that is, the parallax shift. Naturally, the parallax value related to the test chart 16 calculated at this time is a value greatly deviated from the true value.
[0044]
In addition, when using a test chart with a bent pattern, the slope of the straight line reverses at the position where the tilt angle of the pattern changes, so the calculated parallax value is more than the true value of the parallax. There are those that become larger and those that become smaller. When the test chart 16 on which a V-shaped pattern is drawn is used, in the example shown in the figure, the value of the parallax d is larger than the true value on the left side of the distance data D with the V-shaped center as a boundary. On the right side of the distance data D, the value of the parallax d is smaller than the true value. In such a case, the approximate straight line related to the parallax d associated with each of the areas AreaL and AreaR becomes a solid line locus as shown in FIG.
[0045]
FIG. 10 is an explanatory diagram showing a shift in parallax caused by a relative shift in the rotation direction of the cameras 2 and 3. As shown in FIG. 5A, when there is a shift in the rotational direction (for example, when the sub camera 3 is shifted with respect to the main camera 2), the V-shaped pattern of the test chart 16 projected on the comparison image is originally For example, it exists in a position shifted in the clockwise direction from the desired position. If stereo matching is performed in this state, the matching position (corresponding point) is shifted in the direction of the arrow in the figure because the pattern is inclined. Further, when the test chart 16 on which a V-shaped pattern is drawn is used, in the example shown in the figure, the calculated value of the parallax d tends to be larger than the true value from the left side to the right side of the distance data D. It becomes. In such a case, the approximate straight line regarding the parallax d associated with each of the areas AreaL and AreaR becomes a solid line locus as shown in FIG.
[0046]
Further, FIG. 11 is an explanatory diagram showing a parallax shift caused by a relative shift in the left-right direction of the cameras 2 and 3. As shown in FIG. 6A, when there is a horizontal shift (for example, when the sub camera 3 is shifted with respect to the main camera 2), the V-shaped pattern of the test chart 16 projected on the comparison image is It exists at a position shifted to the right, for example, from the original position. If stereo matching is performed in this state, the matched position (corresponding point) is shifted in the left-right direction (that is, the arrow direction in the drawing) from the originally matched position. In such a case, the approximate straight line regarding the parallax d associated with each of the areas AreaL and AreaR becomes a solid line locus as shown in FIG.
[0047]
As shown in FIGS. 9 to 11, when it is assumed that a relative positional shift occurs in the cameras 2 and 3, the parallax d at a certain i coordinate position detected by imaging the test chart 16. The value generally satisfies the relationship shown in Equation 4.
[Expression 4]
Figure 0004018950
[0048]
Here, dL is the parallax in the area AreaL with the change position of the inclination of the pattern, that is, the center of the V shape, and dR is the parallax in the area AreaR. Δi is a relative shift amount in the left-right direction between the reference image and the comparison image (that is, a relative shift amount in the left-right direction of the cameras 2 and 3), and Δj is a vertical shift of the cameras 2 and 3 A relative shift amount Δθ is a relative shift amount in the rotation direction of the cameras 2 and 3. C is the parallax d corresponding to the distance Z1 to the test chart 16. Furthermore, A (that is, AL and AR) is a constant given by the inclination of the pattern of the test chart 16 as shown in Equation 5.
[Equation 5]
Figure 0004018950
[0049]
In Equation 5, αL indicates the slope of a V-shaped downward straight line (left side of the center of the V-shape), and αR is a straight line of V-shaped upward rightward (right side of the center of the V-shape). The slope of Further, pv represents a height corresponding to one pixel of the cameras 2 and 3, and ph represents a width corresponding to one pixel of the cameras 2 and 3.
[0050]
As can be understood from Equation 4, the parallax d specified by the distance data D calculated based on the captured image on which the test chart 16 is copied includes the following three deviation amounts in addition to the true value C of the parallax d: Is done.
(1) Amount of displacement Δi in the left-right direction
(2) Left-right displacement that reflects vertical displacement
(3) Misalignment in the left-right direction reflecting the misalignment in the rotational direction
Here, the left-right direction deviation in which the positional deviation in the rotation direction is reflected is a value obtained by multiplying the i coordinate value by the deviation amount Δθ in the rotation direction and the pattern inclination A, and the left-right direction in which the vertical position deviation is reflected. Is calculated as a value obtained by multiplying the vertical deviation Δj by the slope A.
[0051]
Therefore, if an approximate straight line relating to the calculated parallax d (more precisely, the representative parallax d ′) is obtained as Formula 3, these deviation amounts Δi, Δj, and Δθ are calculated based on Formula 3 and Formula 6. It becomes possible to specify.
[0052]
Therefore, in step 8 shown in FIG. 3 again, the shift amount of the stereo camera is calculated based on the following formula 6. As can be understood from Equation 6, in this step 8, as the relative positional deviation between the cameras 2 and 3, each of the vertical deviation amount Δj, the horizontal deviation amount Δi, and the rotational deviation Δθ is unambiguous. Specific.
[Formula 6]
Figure 0004018950
[0053]
The meaning of Equation 6 is that the relative positional deviation between the cameras 2 and 3 can be calculated based on the slope of the straight line constituting the pattern of the test chart 16 and the approximate straight line calculated in Step 7. That is, as understood from the equation, the relative vertical and rotational deviations Δj and Δθ of the cameras 2 and 3 are calculated using the slope of the straight line constituting the pattern and the calculated approximate straight line as parameters. Is done. Also, the relative left-right displacement Δi of the cameras 2 and 3 is calculated using parameters such as the slope of the straight line constituting the pattern, the approximate straight line, and the parallax C corresponding to the actual distance Z1 to the test chart 16. .
[0054]
Then, in step 9 shown in FIG. 4, the calculated vertical shift amount Δj is compared with a predetermined threshold value Δjth to determine whether the calculated shift amount Δj is a shift amount to be corrected. To be judged. Specifically, whether or not the deviation amount Δj is a deviation amount to be corrected is determined based on whether or not the calculated deviation amount Δj is equal to or less than a predetermined threshold value Δjth. Here, the predetermined threshold value Δjth is determined as the maximum value of the deviation amount that allows the calculated deviation amount Δi. Therefore, when an affirmative determination is made in step 9, the inspection unit 14 determines that there is no deviation that corrects the current state of the cameras 2 and 3, and proceeds to step 10. At this time, the inspection unit 14 grasps the current value of the affine parameter used in the image correction unit 6, and maintains the left-right parameter SHFTJ as the current value (step 10). Here, the current value of the affine parameter means, for example, 0 (that is, an undetermined value) in the inspection stage before product shipment, and in the inspection stage in the periodic inspection, the inspection stage at the time of product shipment (or the previous periodic inspection). The value determined in the inspection stage at the time). On the other hand, if a negative determination is made in step 9, the inspection unit 14 determines that there is a shift to be corrected in the current state of the cameras 2 and 3, and proceeds to step 11. Then, the inspection unit 14 updates a value obtained by adding a value corresponding to the calculated shift amount Δj to the current value of the parameter SHFTJ as the current value of the parameter SHFTJ (step 11).
[0055]
In step 12, the calculated left-right deviation amount Δi is compared with a predetermined threshold value Δith to determine whether or not the calculated deviation amount Δi is a deviation amount to be corrected. Similarly to the processing shown in step 9, when it is determined that the calculated deviation amount Δi is equal to or smaller than the predetermined threshold value Δith, the left and right affine parameters SHFTI are maintained at the current values (step 13). ). On the other hand, when it is determined that the calculated deviation amount Δi is larger than the predetermined threshold value Δith, a value obtained by adding a value corresponding to the calculated deviation amount Δi to the current value of the parameter SHFTI is the value of the parameter SHFTI. It is updated as the current value (step 14).
[0056]
Further, the calculated rotational deviation Δθ is compared with a predetermined threshold value Δθth (step 15). Then, as in step 9 and step 12, the affine parameter θ in the rotational direction is maintained at the current value (step 16), or a value corresponding to the calculated deviation amount Δθ is added to the current value of the parameter θ. The value is updated as the current value of the parameter θ (step 17). Then, the calculated shift amount (specifically, the updated affine parameter) is output to the image correction unit 6. Thereby, based on the calculated shift amount, a correction parameter (that is, an affine parameter) for correcting the relative shift between the pair of images is feedback-corrected. If each of the calculated deviation amounts is equal to or less than a predetermined threshold value, the process skips step 18 described later and proceeds to step 19.
[0057]
Then, in step 18 following step 16 (or step 17), the distance data D calculated based on the pair of captured images that have been subjected to image conversion with the updated affine parameters is read out, similarly to step 2 described above. The reliability of the distance data is evaluated. At this time, if it is determined that the distance data D is sufficient in reliability, the process proceeds to step 19 where the adjustment result is set to “OK” and the routine is exited. In this case, receiving the inspection result in the inspection unit 14, the inspection device 15 notifies the inspector that the inspection result is “good”. On the other hand, if it is determined that the distance data D is not reliable, the process proceeds to step 20 where the test result is set to “NG” and the routine is exited. In this case, receiving the inspection result in the inspection unit 14, the inspection device 15 notifies the inspector that the adjustment result is “defective”.
[0058]
As can be seen from the above description, in the misalignment inspection method shown in the present embodiment, first, the test chart 16 arranged at a predetermined position is imaged by the pair of cameras 2 and 3. Then, based on the distance data D related to the test chart 16 shown in the captured image, the presence or absence of calculation abnormality of the distance data D, that is, the positional deviation of the cameras 2 and 3 is inspected. The test chart 16 described above has an effect of shifting the matching corresponding points in the left-right direction due to the positional deviation of the cameras 2 and 3 because the pattern is inclined obliquely. Accordingly, the value of the parallax d calculated at this time is a value deviated from the true value. In particular, with respect to the vertical and rotational shifts of the cameras 2 and 3, by using this test chart 16, the positional shifts appear as large parallax shifts. Therefore, it is possible to effectively identify these positional shifts. it can. Therefore, even if there is a slight misalignment (that is, a misalignment in which the relative misalignment between a pair of captured images due to these misalignments is in sub-pixel units), the misregistration can be identified efficiently Can be done accurately.
[0059]
Further, the test chart 16 depicts a bent pattern (in this embodiment, a V-shaped pattern) composed of a plurality of straight lines having different inclination angles. The distance data D is divided into regions with the position where the inclination angle changes as a boundary, and approximate lines related to the parallax d are obtained in the respective regions. The deviation can be specified. Further, in the present embodiment, since these positional deviations are quantitatively specified, it is possible to automatically correct the relative positional deviation between the pair of captured images caused by the positional deviation.
[0060]
In the above-described embodiment, the description has been mainly made of inspecting and adjusting the positional deviation of the cameras 2 and 3 in the distance data. However, the method of using the test chart 16 is limited to the above-described embodiment. is not. For example, in addition to the positional shift of the cameras 2 and 3, the reliability of the calculated distance data is reduced due to a shift in the sensitivity balance of the stereo camera, the influence of the lens characteristics of the camera, or improper image correction. May end up. The test chart 16 shown in the present embodiment has an effect of shifting the value of the parallax d by enlarging from the true value as described above. Therefore, if the process of step 2 is performed using the test chart 16, the reliability of the distance data D is effectively evaluated even when the reliability of the distance data D is reduced due to these factors. can do.
[0061]
In the present embodiment, a step for evaluating the distance data D is provided in Step 2, but whether or not Step 2 is provided in the above-described inspection routine is optional. For example, this step 2 can be omitted if it is simply performed to obtain an optimum affine parameter between inspection stages before product shipment. Such step 2 may be performed only in the inspection stage at the time of periodic inspection, for example, in which a change with time is expected.
[0062]
In the present embodiment, the test chart 16 in which a V-shaped pattern is drawn is described as the test chart. However, the test chart of the present invention is not limited to this. For example, the test chart may have a pattern composed of a plurality of straight lines having different inclination angles, for example, a W-shaped pattern. In such a pattern, it is preferable that each of the plurality of straight lines has a different luminance gradation so that a plurality of patterns having the same luminance gradation do not exist in the search region on the epipolar line. In the test chart in which a W-shaped pattern is drawn, the distance data D is divided into four regions with a position where the inclination angle of the straight line changes in the left-right direction as a boundary.
[0063]
As another example of the test chart, an X-shaped pattern or a ◇ -shaped pattern in which the above-described test chart 16 is arranged line-symmetrically in the vertical direction may be used. In the test chart in which such a pattern is drawn, the distance data D is divided into four areas, upper, lower, left, and right.
[0064]
In the present specification, it should be understood that “the pattern is inclined obliquely from the reference direction” includes a curve whose inclination is oblique. Therefore, it may be a substantially U-shaped (secondary function) pattern that approximates a V-shape, or a wave-shaped pattern that approximates a W-shaped pattern. Further, even an elliptical or circular pattern that approximates the above-described ◇ -shaped pattern can exhibit the same operations and effects as the test pattern 16 described above.
[0065]
Another example of the test chart is a test chart in which a horizontal stripe pattern is drawn as a pattern. At this time, the reference direction set on the plane of the test chart is set to be inclined with respect to the horizontal stripe pattern because the pattern is inclined with respect to the camera base line. Become. In this case, at the time of inspection, this test chart or the entire stereo camera is rotated so that the camera base line and the reference direction of the test chart coincide with each other.
[0066]
【The invention's effect】
Thus, according to the present invention, the pattern drawn on the test chart is inclined obliquely. When this test chart is captured by a pair of cameras separated by a predetermined camera baseline length, the distance data calculated based on the acquired pair of captured images indicates that the camera position shift is a lateral shift, that is, parallax. It is reflected as the value of. Thereby, it is possible to effectively inspect the positional deviation of the camera.
[Brief description of the drawings]
FIG. 1 is a block diagram of a stereo type monitoring apparatus according to an embodiment.
FIG. 2 is an explanatory diagram of a pixel block set in a reference image
FIG. 3 is a flowchart showing a misalignment inspection procedure according to the embodiment.
FIG. 4 is a flowchart showing a misalignment inspection procedure according to the embodiment.
FIG. 5 is a diagram showing the relationship between the position of the test chart and the vehicle to be inspected
FIG. 6 shows an example of a test chart
FIG. 7 is an explanatory diagram showing an example of area division of distance data
FIG. 8 is a diagram showing an example of an approximate line calculated for each region
FIG. 9 is an explanatory diagram showing a parallax shift caused by a relative shift in the vertical direction of the camera.
FIG. 10 is an explanatory diagram showing a parallax shift caused by a relative shift in the rotation direction of the camera.
FIG. 11 is an explanatory diagram showing a parallax shift caused by a relative shift in the left-right direction of the camera.
[Explanation of symbols]
1 Stereo monitoring device
2 Main camera
3 Sub camera
4 A / D converter
5 A / D converter
6 Image correction unit
7 Stereo image processing unit
8 Image data memory
9 Distance data memory
10 Microcomputer
11 Recognition unit
12 Alarm device
13 Control device
14 Inspection Department
15 Inspection equipment
16 Test chart

Claims (8)

一対の撮像画像に基づき算出される距離データを用いて一対のカメラの相対的な位置ずれを検査する位置ずれ検査装置において、
所定のカメラ基線長だけ離間されて、撮像画像を出力する一対のカメラと、
前記一対のカメラの前方で前記カメラ基線と基準方向とを一致させて平行に配置されているとともに、前記基準方向から斜めに傾いたパターンが描かれたテストチャートを、前記一対のカメラで撮像することによって得られた撮像画像に基づいて、距離データを算出するステレオ画像処理部と、
前記算出された距離データに基づき、前記一対のカメラの相対的な位置ずれを検査する検査部とを有し、
前記パターンは、傾き角の異なる複数の前記直線で構成される屈曲したパターンであり、
前記検査部は、前記パターンの傾き角の変化する位置で前記距離データを複数の領域に分割し、当該分割された領域のそれぞれにおいて視差に関する近似直線を算出し、前記パターンを構成する直線の傾きと、前記算出された近似直線とをパラメータとして、前記一対のカメラの相対的な上下方向および回転方向のずれ量を算出するとともに、前記パターンを構成する直線の傾きと、前記近似直線と、前記テストチャートまでの実距離に対応する視差とをパラメータとして、前記一対のカメラの相対的な左右方向のずれ量を算出することを特徴とする位置ずれ検査装置。
In a misalignment inspection apparatus that inspects a relative misalignment between a pair of cameras using distance data calculated based on a pair of captured images,
A pair of cameras that are separated by a predetermined camera baseline length and output a captured image;
A test chart in which a pattern tilted obliquely from the reference direction is drawn with the pair of cameras is arranged in parallel with the camera base line and the reference direction aligned in front of the pair of cameras. A stereo image processing unit for calculating distance data based on the captured image obtained by
An inspection unit that inspects a relative displacement between the pair of cameras based on the calculated distance data ;
The pattern is a bent pattern composed of a plurality of the straight lines having different inclination angles,
The inspection unit divides the distance data into a plurality of areas at a position where the inclination angle of the pattern changes, calculates an approximate straight line related to parallax in each of the divided areas, and the inclination of the straight lines constituting the pattern And using the calculated approximate straight line as a parameter, the relative vertical and rotational shift amounts of the pair of cameras are calculated, the slope of the straight line constituting the pattern, the approximate straight line, A positional deviation inspection apparatus that calculates a relative lateral deviation amount of the pair of cameras using a parallax corresponding to an actual distance to a test chart as a parameter .
前記一対のカメラの相対的な位置ずれに起因した前記一対の撮像画像の相対的なずれを補正パラメータを用いて補正する画像補正部をさらに有し、
前記検査部は、前記画像補正部に対し、前記算出されたずれ量に基づき補正パラメータを出力することを特徴とする請求項に記載された位置ずれ検査装置。
An image correction unit that corrects a relative shift between the pair of captured images caused by a relative positional shift between the pair of cameras using a correction parameter;
The positional deviation inspection apparatus according to claim 1 , wherein the inspection unit outputs a correction parameter to the image correction unit based on the calculated deviation amount.
前記パターンを構成する複数の直線のそれぞれは、輝度階調が異なることを特徴とする請求項1または2に記載された位置ずれ検査装置。Each of the plurality of straight lines constituting the pattern, position inspection system according to claim 1 or 2, characterized in that the luminance gradation is different. 前記パターンは、前記基準方向と直交する方向に前記パターンが隣接して配置されたパターン群を構成しており、前記直交方向において、隣接する前記パターンの輝度階調がそれぞれ異なることを特徴とする請求項1から3のいずれかに記載された位置ずれ検査装置。The pattern constitutes a pattern group in which the patterns are arranged adjacent to each other in a direction orthogonal to the reference direction, and the luminance gradations of the adjacent patterns are different in the orthogonal direction. The misalignment inspection apparatus according to claim 1 . 所定のカメラ基線長だけ離間された一対のカメラによって取得された一対の撮像画像に基づき算出される距離データを用いて、前記一対のカメラの相対的な位置ずれを検査する位置ずれ検査方法において、
前記一対のカメラの前方で前記カメラ基線と基準方向とを一致させて平行に配置されているとともに前記基準方向から斜めに傾いたパターンが描かれたテストチャートを、前記一対のカメラで撮像する第1のステップと、
前記撮像された一対の撮像画像に基づいて、距離データを算出する第2のステップと、
前記算出された距離データに基づき、前記一対のカメラの相対的な位置ずれを検査する第3のステップと
を有し、
前記パターンは、傾き角の異なる複数の前記直線で構成される屈曲したパターンであり、
前記第3のステップは、前記パターンの傾き角の変化する位置で前記距離データを複数の領域に分割し、当該分割された領域のそれぞれにおいて視差に関する近似直線を算出し、前記パターンを構成する直線の傾きと、前記算出された近似直線とをパラメータとして、前記一対のカメラの相対的な上下方向および回転方向のずれ量を算出するとともに、前 記パターンを構成する直線の傾きと、前記算出された近似直線と、前記テストチャートまでの実距離に対応する視差とをパラメータとして、前記一対のカメラの相対的な左右方向のずれ量を算出することを特徴とする位置ずれ検査方法。
In the misalignment inspection method for inspecting the relative misalignment of the pair of cameras using distance data calculated based on the pair of captured images acquired by the pair of cameras separated by a predetermined camera base line length,
A test chart in which a pattern tilted obliquely from the reference direction is drawn with the pair of cameras is arranged in parallel with the camera base line and the reference direction aligned in front of the pair of cameras. 1 step,
A second step of calculating distance data based on the captured pair of captured images;
Based on the distance data the calculated, have a third step of checking the relative displacement of the pair of cameras,
The pattern is a bent pattern composed of a plurality of the straight lines having different inclination angles,
The third step divides the distance data into a plurality of regions at positions where the inclination angle of the pattern changes, calculates an approximate straight line related to parallax in each of the divided regions, and forms the pattern the inclination of the a approximate line the calculated parameters, to calculate the relative vertical and shift amount of the rotation direction of the pair of cameras, and the slope of the line constituting the front Symbol pattern, the calculated A positional deviation inspection method , wherein a relative lateral deviation amount of the pair of cameras is calculated using the approximate straight line and a parallax corresponding to an actual distance to the test chart as parameters .
前記一対のカメラの相対的な位置ずれに起因した前記一対の画像の相対的なずれを補正パラメータを用いて補正する第4のステップと、
前記算出されたずれ量に基づき、前記補正パラメータをフィードバック補正する第5のステップと
をさらに有することを特徴とする請求項に記載された位置ずれ検査方法。
A fourth step of correcting a relative shift between the pair of images caused by a relative positional shift between the pair of cameras using a correction parameter;
6. The positional deviation inspection method according to claim 5 , further comprising a fifth step of feedback-correcting the correction parameter based on the calculated deviation amount.
前記パターンを構成する複数の直線のそれぞれは、輝度階調が異なることを特徴とする請求項5または6に記載された位置ずれ検査方法。  The misregistration inspection method according to claim 5 or 6, wherein each of the plurality of straight lines constituting the pattern has a different luminance gradation. 前記パターンは、前記基準方向と直交する方向に前記パターンが隣接して配置されたパターン群を構成しており、前記直交方向において、隣接する前記パターンの輝度階調がそれぞれ異なることを特徴とする請求項5から7のいずれかに記載された位置ずれ検査方法。  The patterns constitute a pattern group in which the patterns are arranged adjacent to each other in a direction orthogonal to the reference direction, and the luminance gradations of the adjacent patterns are different in the orthogonal direction. The misregistration inspection method according to claim 5.
JP2002227777A 2002-08-05 2002-08-05 Stereo camera misalignment inspection apparatus and misalignment inspection method Expired - Fee Related JP4018950B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002227777A JP4018950B2 (en) 2002-08-05 2002-08-05 Stereo camera misalignment inspection apparatus and misalignment inspection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002227777A JP4018950B2 (en) 2002-08-05 2002-08-05 Stereo camera misalignment inspection apparatus and misalignment inspection method

Publications (2)

Publication Number Publication Date
JP2004069437A JP2004069437A (en) 2004-03-04
JP4018950B2 true JP4018950B2 (en) 2007-12-05

Family

ID=32014708

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002227777A Expired - Fee Related JP4018950B2 (en) 2002-08-05 2002-08-05 Stereo camera misalignment inspection apparatus and misalignment inspection method

Country Status (1)

Country Link
JP (1) JP4018950B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010048553A (en) * 2006-12-19 2010-03-04 Panasonic Corp Inspecting method of compound-eye distance measuring device and chart used for same
WO2009107365A1 (en) * 2008-02-26 2009-09-03 パナソニック株式会社 Test method and test device for compound-eye distance measuring device and chart used therefor
JP6299317B2 (en) * 2014-03-24 2018-03-28 サクサ株式会社 Image processing device
JP6566302B2 (en) * 2014-07-22 2019-08-28 株式会社リコー IMAGING DEVICE, IMAGING DEVICE ERROR CHECK METHOD, AND PROGRAM
JP6786635B2 (en) * 2018-05-15 2020-11-18 株式会社東芝 Vehicle recognition device and vehicle recognition method
CN112752094B (en) * 2020-12-28 2023-12-01 歌尔科技有限公司 Double-camera optical axis detection equipment

Also Published As

Publication number Publication date
JP2004069437A (en) 2004-03-04

Similar Documents

Publication Publication Date Title
JP4109077B2 (en) Stereo camera adjustment device and stereo camera adjustment method
JP4889351B2 (en) Image processing apparatus and processing method thereof
US7317474B2 (en) Obstacle detection apparatus and method
US6985619B1 (en) Distance correcting apparatus of surroundings monitoring system and vanishing point correcting apparatus thereof
JP4803927B2 (en) Distance correction apparatus and distance correction method for monitoring system
US7492964B2 (en) System and method for detecting obstacle
US6873912B2 (en) Vehicle tracking system
JP5109294B2 (en) 3D position correction device
JP2001082955A (en) Device for adjusting dislocation of stereoscopic image
JP3255360B2 (en) Inspection method of distance data and its inspection device
JP4032843B2 (en) Monitoring system and monitoring method, distance correction device and distance correction method in the monitoring system
JP4767052B2 (en) Optical axis deviation detector
JP4296617B2 (en) Image processing apparatus, image processing method, and recording medium
JP4018950B2 (en) Stereo camera misalignment inspection apparatus and misalignment inspection method
JP4209637B2 (en) Distance correction apparatus and distance correction method for monitoring system
JP4053314B2 (en) Stereo image misalignment adjusting device, misalignment adjusting method, and stereo monitoring device
JP3327068B2 (en) Road surface measurement device
JP2005250994A (en) Stereo image processor
JP4248212B2 (en) Stereo image processing apparatus and stereo image processing method
JP4462533B2 (en) Road lane detection device
JP4468019B2 (en) Image processing device
JPH11190611A (en) Three-dimensional measuring method and three-dimensional measuring processor using this method
JPH09126759A (en) Range finding method by on-vehicle camera and range finder using the camera
WO2023067867A1 (en) Vehicle-mounted control device, and three-dimensional information acquisition method
JP2001175845A (en) Vehicle end detecting device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050729

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070511

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070530

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070717

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070921

R150 Certificate of patent or registration of utility model

Ref document number: 4018950

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100928

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100928

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110928

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120928

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130928

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees