JP4110501B2 - Random pattern generation apparatus and method, distance image generation apparatus and method, and program providing medium - Google Patents

Random pattern generation apparatus and method, distance image generation apparatus and method, and program providing medium Download PDF

Info

Publication number
JP4110501B2
JP4110501B2 JP33110699A JP33110699A JP4110501B2 JP 4110501 B2 JP4110501 B2 JP 4110501B2 JP 33110699 A JP33110699 A JP 33110699A JP 33110699 A JP33110699 A JP 33110699A JP 4110501 B2 JP4110501 B2 JP 4110501B2
Authority
JP
Japan
Prior art keywords
projection pattern
pattern
image
suitability
generated
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
JP33110699A
Other languages
Japanese (ja)
Other versions
JP2001147110A5 (en
JP2001147110A (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.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP33110699A priority Critical patent/JP4110501B2/en
Publication of JP2001147110A publication Critical patent/JP2001147110A/en
Publication of JP2001147110A5 publication Critical patent/JP2001147110A5/ja
Application granted granted Critical
Publication of JP4110501B2 publication Critical patent/JP4110501B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、物体の三次元形状を求めるためのランダムパターン生成装置とその方法、距離画像生成装置とその方法、およびプログラム提供媒体に関する。特に三次元空間上である距離範囲に存在する物体を複数の異なる位置から撮影した画像を用いて被写体表面の三次元形状を計測する方法、すなわちステレオ画像法において好適なランダムパターン生成装置とその方法、距離画像生成装置とその方法、およびプログラム提供媒体に関する。
【0002】
【従来の技術】
物体の三次元形状を求める従来手法として、大きく分けて能動的手法(アクティブ手法)と受動的手法(パッシブ手法)がある。能動的手法としては、光を投射して、その光が反射して帰ってくるまでの時間を測定することで各測定対象物体までの距離を求める方法や、測定対象にスリット状のパターン光をあてて測定対象に投影されたパターン光の形状を調べることによって三次元形状を計測する光切断法といった方法がある。
【0003】
また、受動的手法として代表的なものは、三角測量の原理を利用したステレオ画像法であり、これは2台以上のカメラを使って、その画像間の対応点を見つけることで視差を求め、距離を計測する方法である。
【0004】
ステレオ画像法について、その原理を簡単に説明する。ステレオ画像法は複数のカメラを用いて2つ以上の視点(異なる視線方向)から同一対象物を撮影して得られる複数の画像における画素同士を対応づけることで測定対象物の三次元空間における位置を求めようとするものである。例えば基準カメラと参照カメラにより異なる視点から同一対象物を撮影して、それぞれの画像内の測定対象物の距離を三角測量の原理により測定する。
【0005】
図1は、ステレオ画像法の原理を説明する図である。基準カメラ(Camera 1)と参照カメラ(Camera 2)は異なる視点から同一対象物を撮影する。基準カメラによって撮影された画像中の「mb」というポイントの奥行きを求めることを考える。
【0006】
基準カメラによる撮影画像中のポイント「mb」に見える物体は、異なる視点から同一物体を撮影している参照カメラによって撮影された画像において、「m1」、「m2」、「m3」のようにある直線上に展開されることになる。この直線をエピポーラライン(Epipolar line)Lpと呼ぶ。
【0007】
基準カメラにおけるポイント「mb」の位置は、参照カメラによる画像中では「エピポーラ・ライン」と呼ばれる直線上に現れる。撮像対象となる点P(P1,P2,P3を含む直線上に存在する点)は、基準カメラの視線上に存在する限り、奥行きすなわち基準カメラとの距離の大小に拘らず、基準画像上では同じ観察点「mb」に現れる。これに対し、参照カメラによる撮影画像上における点Pは、エピポーラ・ライン上に基準カメラと観察点Pとの距離の大小に応じた位置にあらわれる。
【0008】
図1には、エピポーラ・ラインと、参照画像中における観察点「mb」の対応を図解している。同図に示すように、観察点Pの位置がP1,P2,P3へと変化するに従って、参照画像中の観察点は「m1」、「m2」、「m3」へとシフトする。
【0009】
以上の幾何光学的性質を利用して、観察点「mb」をエピポーラ・ライン上で探索することにより、点Pの距離を同定することができる。これが「ステレオ画像法」の基本的原理である。このような方法で画面上のすべての画素についての三次元情報を取得する。取得した三次元情報は画素ごとに対応した画素属性データとして使用することが可能となる。
【0010】
上述のステレオ画像法は1台の基準カメラと1台の参照カメラとを用いた構成としたが、参照カメラを複数用いたマルチベースラインステレオ(Multi Baseline Stereo)法によって評価値を求めて、該評価値に基づいて画素ごとの三次元情報を取得するように構成してもよい。マルチベースラインステレオ画像法は、1つの基準カメラと複数の参照カメラによって撮影される画像を用い、複数の参照カメラ画像それぞれについて基準カメラ画像との相関を表す評価値を求め、それぞれの評価値を加算し、その加算値を最終的な評価値とするものである。このマルチベースラインステレオ画像法の詳細は、例えば「複数の基線長を利用したステレオマッチング」、電子情報通信学会論文誌D−11Vol.J75−D−II No.8 pp.1317−1327 1992年8月、に記載されている。
【0011】
上述のように、ステレオ画像法は、複数のカメラを用いて2つ以上の視点(異なる視線方向)から同一対象物を撮影して得られる複数の画像における画素同士を対応づけること、すなわち「対応点付け(マッチング)」を実施することで測定対象物の三次元空間における位置を求めようとするものである。
【0012】
従来、よく使われている「対応点付け」の手法は、Pixel−basedマッチング、Area−basedマッチングとFeature−basedマッチングに大別される。Pixel−basedマッチングとは、一方の画像における点の対応を、他方の画像でそのまま探索する方法である(C.Lawrence Zitnick and Jon A. Webb: Multi−baseline Stereo Using Surface Extraction, Technical Report, CMU−CS−96−196,
(1996)参照)。
【0013】
Area−basedマッチングとは、一方の画像における点の対応を、他方の画像で探す時、その点の周りの局所的な画像パターンを用いて探索する方法である(奥富、金出: 複数の基線長を利用したステレオマッチング、電子情報通信学会論文誌D−II、Vol.J75−D−II, No.8, pp.1317−1327, (1992)、横山、三輪、芦ヶ原、小柳津、林、後: Stereo Camera System and Its Application、 SRF’97、(1997)、金出、木村: ビデオレート・ステレオマシン、日本ロボット学会誌、Vol.13, No.3, pp.322〜326, (1995)、金出、蚊野、木村、川村、吉田、織田: ビデオレートステレオマシンの開発、日本ロボット学会誌、Vol.15, No.2, pp.261〜267, (1997)、山口、高地、井口: 適応ウィンドウ法を用いた石像計測のためのステレオ対応付け、人文科学とコンピュータ、Vol.32, No.10, pp.55〜60, (1996)、横矢: 最近の信号処理総合特集号 コンピュータビジョンの最近の話題、システム/制御/情報、Vol.38, No.8, pp.436〜441, (1994)参照)。
【0014】
Feature−basedマッチングとは、画像から濃淡エッジなどの特徴を抽出し、画像間の特徴だけを用いて対応付けを行う方法である(H.H.Baker and T.O.Binford: Depth from edgeand intensity based stereo, In Proc. IJCAI’81, (1981)、石山、角保、河井、植芝、富田: セグメントベーストステレオにおける対応候補探索、信学技報、Vol.96, No.136, (1997)、W.E.L.Grimson: Computational experiments with a feature based stereo algorithm, IEEE Trans. PAMI, Vol.7, No.1, pp.17〜34, (1985))。
【0015】
上記の各手法の特徴を整理すると、次のようになる。
(1)Pixel−basedマッチングとArea−basedマッチングは各々の画素に対して、対応点を探索するので、求められた距離画像は密である。一方、Feature−basedマッチングは、特徴点だけに対して、対応付けを行うので、得られた距離画像は疎である。
【0016】
(2)Area−basedマッチングは、一種の相関演算を行うため、Pixel−basedマッチングとFeature−basedマッチングに比べて、計算コストがかかるが、アルゴリズムの高速化によって、必ずしも解決できない問題ではない。
【0017】
(3)Pixel−basedマッチングは、画素間の対応付けだけを行うため、計算速度がかなり速いが、左右カメラ間の特性の違いによって、画素間の濃淡値を用いる対応付けが容易ではない。
【0018】
上述の特徴から、一般的に、高精度で対象の3次元形状(または奥行き)を画素毎に求めるための手法としてArea−basedマッチングは有効であり、よく使われている。
【0019】
上述の各種の方法により、ステレオ画像法における対応点付け処理が行なわれる。しかしながら、白い壁や人間の顔などの特徴(濃淡、形状、色等)のほとんどない対象に対しては、上述のいずれの方法を使用しても、3次元形状を計測するために必要となる対応点付け処理が困難となる。これが、ステレオ画像法による処理における一つの大きな課題となっている。
【0020】
白い壁や人間の顔などの特徴(濃淡、形状、色等)のほとんどない対象に対しての対応付け処理をより正確に行なうため、チェッカや周波数変調された正弦波などの周期的なパターンを投光することによって、マルチベースラインステレオシステムによる画像マッチングのエラーを低減する手法が、いくつか開示されている(S.B.Kang, J.A.Webb, C.L.Zitnick and T.Kanade: A Multibaseline Stereo System with Active Illumination and Real−time Image Acquisition, Proc IEEE Int Conf. Comput. Vis., Vol.5, pp.88〜93, (1995)、M.Noguchi and S.K.Nayar: Microscopic Shape from Focus Using Active Illumination, Proc Int. Conf. Pattern Recogn., Vol.12, No.Vol 1, pp.147〜152, (1994)参照)。
【0021】
【発明が解決しようとする課題】
しかしながら、上述した従来手法では、対応付け処理におけるエラー、すなわちミスマッチングの完全な除去を達成することはできなかった。また、上述の周波数変調された周期的なパターンを投光して対応付け処理を実行する構成は、複数台(3台以上)のカメラを用いるマルチベースラインステレオマシンにおいては、ミスマッチング領域減少に対して効果があるが、2台のカメラを用いる2眼ステレオ視に対しては、生成される模様が周期的であるために類似する模様同士の対応付けにエラーが発生する可能性があり、必ずしも有効とはならないという欠点がある。
【0022】
そこで、我々は、例えば乱数を用いた非周期的な投光パターンを生成して、このランダムパターンを測定対象に投光することで、高精度な距離画像生成を可能とする構成を提案(特願平11−269838にて出願済み)した。
【0023】
このように、模様のない被写体に非周期のランダムパターンを投光して対応付け処理を行なう測定方法によれば、白い壁や人間の顔などの特徴(濃淡、形状、色等)のほとんどない対象に対しての対応付け処理がより正確になされ、距離画像生成が高精度に行なわれる。
【0024】
しかしながら、非周期的なパターンを投光した場合でも、測定対象の形状、あるいは、測定対象とランダムパターン投光手段および撮像装置との位置関係等によっては、撮影画面上で一定の周期を持つ繰り返しパターンが生成されてしまう場合があり、このような場合は対応付け処理が困難になり、距離画像生成に支障をきたす場合がある。非周期的なランダムパターンを投影した場合でも、その投影した結果が繰り返しパターンを含むかどうかは、実際に投影しないと確定できない。
【0025】
複数種類のランダムパターンを順番に投影して測定を行うシステムもある。この場合にも、複数のランダムパターンを用いることによりうまく測定できない部分が減少することは期待できるが、予め決められた数種類の模様では、全てのうまく測定できない部分を補うことはできない。また、カメラの配置などを含む様々な環境の変化に追随することも難しい。
【0026】
本発明は、上述の問題点に鑑みてなされたものであり、ステレオ画像法に従った距離画像生成方法における、ランダムパターン生成装置とその方法、距離画像生成装置とその方法、およびプログラム提供媒体を提供するものであり、対応点付け処理においてミスマッチング領域の発生しにくいランダムテクスチャ、例えば二値または濃淡のランダム点群からなる非周期ランダム画像パターン構成およびその生成方法を提供するものである。
【0027】
さらに、本発明は測定対象上のパターンが適切になるよう、すなわち対応点付け処理においてミスマッチングが発生しないように、パターン投光により撮影された画像に基づいて、さらに投光すべき新たなランダムパターンを決定してミスマッチング領域の発生を低下させた距離画像生成装置とその方法を提供するものである。
【0028】
さらに、本発明は測定対象上のパターンが適切になるよう、すなわち対応点付け処理においてミスマッチングが発生しないようなパターンを、パターン投光により撮影された画像に基づいて生成する構成。具体的には、たとえばステレオカメラは等間隔で繰り返される模様を苦手とするので、投影した結果が繰り返しの成分を持たないように計算し、適切なランダムパターンを作成し、投光して距離画像の生成を行なう構成を提供する。
【0029】
【課題を解決するための手段】
本発明は、上記課題を参酌してなされたものであり、その第1の側面は、
ステレオ画像法に従った三次元形状の計測において測定対象に投光する投光パターンを生成するランダムパターン生成装置において、
乱数を用いた異なる複数の非周期的投光パターンを生成可能な投光パターン生成手段と、
前記投光パターン生成手段において生成された投光パターンの評価を実行する投光パターン評価手段とを有し、
前記投光パターン評価手段は、前記投光パターン生成手段の生成した投光パターンのパターンとしての適性度を示すパターン適性度指標値を該生成投光パターンに基づいて算出し、算出したパターン適性度指標値を予め定めた閾値と比較することによって、生成投光パターンが三次元形状計測用の投光パターンとして適性を持つか否かを判定する構成を有し、
前記投光パターン評価手段は、
(1)投光パターンを構成する画素値の周期的変化を示す変化率、
(2)投光パターンを構成する画像の画素値に基づく特徴行列の固有値から算出される特徴量、
(3)投光パターンを構成する異なる部分領域の類似度を示す領域間相関値、
(4)投光パターンを構成する画像の分散値、
上記(1)〜(4)のいずれかの値を前記パターン適性度指標値として算出し、算出値と予め定めた閾値と比較することによって、生成投光パターンが三次元形状計測用の投光パターンとして適性を持つか否かを判定する構成であることを特徴とするランダムパターン生成装置にある。
【0030】
さらに、本発明のランダムパターン生成装置の一実施態様において、前記投光パターン生成手段は、正規乱数を規定する標準偏差sを変更することによって、異なる非周期的投光パターンを生成する構成を有し、生成した投光パターンが前記投光パターン評価手段において、三次元形状計測用の投光パターンとしての適性を持たないと判定された場合に、前記標準偏差sを変更した新たな非周期的投光パターンを生成する構成を有することを特徴とする。
【0031】
さらに、本発明のランダムパターン生成装置の一実施態様において、前記投光パターン生成手段は、正規乱数からなる画像を閾値Tを用いて二値化した二値画像を生成する構成を有するとともに、前記閾値Tを変更することによって、異なる非周期的投光パターンを生成する構成を有し、生成した投光パターンが前記投光パターン評価手段において、三次元形状計測用の投光パターンとしての適性を持たないと判定された場合に、前記閾値Tを変更した新たな非周期的投光パターンを生成する構成を有することを特徴とする。
【0032】
さらに、本発明のランダムパターン生成装置の一実施態様において、前記投光パターン生成手段は、正規乱数に基づく濃淡画像を生成する構成を有し、生成した投光パターンが前記投光パターン評価手段において、三次元形状計測用の投光パターンとしての適性を持たないと判定された場合に、正規乱数を規定するパラメータを変更した新たな非周期的投光パターンを生成する構成を有することを特徴とする。
【0037】
さらに、本発明のランダムパターン生成装置の一実施態様において、前記投光パターン評価手段は、前記投光パターン生成手段の生成した投光パターンから部分領域であるウィンドーを少なくとも1以上抽出して前記パターン適性度指標値を算出する構成であることを特徴とする。
【0038】
さらに、本発明の第2の側面は、
ステレオ画像法に従った三次元形状の計測において測定対象に投光する投光パターンを生成するランダムパターン生成方法において、
(a)乱数を用いた非周期的投光パターンを生成する投光パターン生成ステップと、
(b)前記投光パターン生成ステップにおいて生成された投光パターンを評価する評価ステップであり、
(c)前記投光パターン生成ステップにおいて生成した投光パターンのパターンとしての適性度を示すパターン適性度指標値として、
(1)投光パターンを構成する画素値の周期的変化を示す変化率、
(2)投光パターンを構成する画像の画素値に基づく特徴行列の固有値から算出される特徴量、
(3)投光パターンを構成する異なる部分領域の類似度を示す領域間相関値、
(4)投光パターンを構成する画像の分散値、
上記(1)〜(4)のいずれかの値を、前記生成投光パターンに基づいて算出するパターン適性度指標値算出ステップと、
(d)算出したパターン適性度指標値を予め定めた閾値と比較することによって、生成投光パターンが三次元形状計測用投光パターンとして適性を持つか否かを判定する適性判定ステップと、
を含む評価ステップと、を有し、
前記適性判定ステップにおいて適正ありとの判定がでるまで、前記ステップ(a)において異なる投光パターンを生成し、(a)〜(d)のステップを繰り返し実行し、
前記評価ステップ中の適性判定ステップにおいて適正ありと判定された投光パターンを三次元形状計測用投光パターンとすることを特徴とするランダムパターン生成方法にある。
【0047】
さらに、本発明の第3の側面は、
測定対象を異なる視点から撮影した画像を用いて前記測定対象の三次元形状を計測して距離画像を生成する距離画像生成装置において、
乱数を用いた異なる複数の非周期的投光パターンを生成可能な投光パターン生成手段と、
前記測定対象の投光パターン画像を撮り込む基準カメラと、
前記基準カメラと異なる視点において投光パターン画像を撮り込む参照カメラと、
前記基準カメラまたは参照カメラによって撮り込まれた投光パターン画像の少なくともいずれかの投光パターン画像におけるパターン適性を評価し、距離画像生成用の投光パターン画像として適性を有するか否かを評価する投光パターン評価手段であり、投光パターンのパターンとしての適性度を示すパターン適性度指標値として、
(1)投光パターンを構成する画素値の周期的変化を示す変化率、
(2)投光パターンを構成する画像の画素値に基づく特徴行列の固有値から算出される特徴量、
(3)投光パターンを構成する異なる部分領域の類似度を示す領域間相関値、
(4)投光パターンを構成する画像の分散値、
上記(1)〜(4)のいずれかの値を算出して、算出したパターン適性度指標値を予め定めた閾値と比較することによって、生成投光パターンが三次元形状計測用投光パターンとして適性を持つか否かを判定する投光パターン評価手段と、
前記基準カメラおよび参照カメラによって撮り込まれた各投光パターン画像間の対応を検出し視差データを出力する画像間対応付け手段と、
前記画像間対応付け手段の出力する視差データに基づいて距離画像を生成する距離画像生成手段とを有し、
前記投光パターン生成手段は、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価手段によって距離画像生成用投光パターン画像として適性なしと判定された場合、新たな非周期的投光パターンを生成し、
前記画像間対応付け手段および前記距離画像生成手段は、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価手段によって距離画像生成用投光パターン画像として適性ありと判定されたことを条件として処理を実行する構成であることを特徴とする距離画像生成装置にある。
【0049】
さらに、本発明の距離画像生成装置の一実施態様において、前記投光パターン生成手段は、正規乱数を規定する標準偏差sを変更することによって、異なる非周期的投光パターンを生成する構成を有し、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価手段において、距離画像生成用投光パターンとして適性をなしと判定された場合に、前記標準偏差sを変更した新たな非周期的投光パターンを生成する構成を有することを特徴とする。
【0050】
さらに、本発明の距離画像生成装置の一実施態様において、前記投光パターン生成手段は、正規乱数からなる画像を閾値Tを用いて二値化した二値画像を生成する構成を有するとともに、前記閾値Tを変更することによって、異なる非周期的投光パターンを生成する構成を有し、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価手段において、距離画像生成用投光パターンとして適性をなしと判定された場合に、前記閾値Tを変更した新たな非周期的投光パターンを生成する構成を有することを特徴とする。
【0057】
さらに、本発明の第4の側面は、
測定対象を異なる視点から撮影した画像を用いて前記測定対象の三次元形状を計測して距離画像を生成する距離画像生成装置において、
測定対象に対して投光するパターンを生成する投光パターン生成手段であり、乱数を用いた異なる複数の非周期的投光パターンを生成可能であるとともに、パターンとしての適性度を示すパターン適性度指標値を生成投光パターンに基づいて算出し、算出したパターン適性度指標値を予め定めた閾値と比較することで距離画像生成用投光パターンとしての適性を判定し、適性ありと判定されたパターンのみを投光パターンとして設定する投光パターン生成手段と、
前記測定対象の投光パターン画像を撮り込む基準カメラと、
前記基準カメラと異なる視点において投光パターン画像を撮り込む参照カメラと、
前記基準カメラおよび参照カメラによって撮り込まれた各投光パターン画像間の対応を検出し視差データを出力する画像間対応付け手段と、
前記画像間対応付け手段の出力する視差データに基づいて距離画像を生成する距離画像生成手段と、
前記距離画像生成手段の生成した距離画像中のミスマッチング領域を検出するミスマッチング領域検出手段と、
を有し、
前記投光パターン生成手段は、前記ミスマッチング領域検出手段が予め定めた閾値以上のミスマッチング領域を検出した場合に新たな非周期的投光パターンを生成する構成を有することを特徴とする距離画像生成装置にある。
【0066】
さらに、本発明の第5の側面は、
測定対象を異なる視点から撮影した画像を用いて前記測定対象の三次元形状を計測して距離画像を生成する距離画像生成方法において、
乱数を用いた非周期的投光パターンを生成する投光パターン生成ステップと、
前記測定対象の投光パターン画像を基準カメラと参照カメラを適用して、異なる視点から、同期したタイミングで撮り込む画像撮り込みステップと、
前記基準カメラまたは参照カメラによって撮り込まれた投光パターン画像の少なくともいずれかの投光パターン画像におけるパターン適性を評価し、距離画像生成用の投光パターン画像として適性を有するか否かを評価する投光パターン評価ステップであり、投光パターンのパターンとしての適性度を示すパターン適性度指標値として、
(1)投光パターンを構成する画素値の周期的変化を示す変化率、
(2)投光パターンを構成する画像の画素値に基づく特徴行列の固有値から算出される特徴量、
(3)投光パターンを構成する異なる部分領域の類似度を示す領域間相関値、
(4)投光パターンを構成する画像の分散値、
上記(1)〜(4)のいずれかの値を算出して、算出したパターン適性度指標値を予め定めた閾値と比較することによって、生成投光パターンが三次元形状計測用投光パターンとして適性を持つか否かを判定する投光パターン評価ステップと、
前記基準カメラおよび参照カメラによって撮り込まれた各投光パターン画像間の対応を検出し視差データを出力する画像間対応付けステッップと、
前記画像間対応付け手段の出力する視差データに基づいて距離画像を生成する距離画像生成ステップとを有し、
前記投光パターン生成ステップは、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価ステップにおいて距離画像生成用投光パターン画像として適性なしと判定された場合、新たな非周期的投光パターンを繰り返し生成し、
前記画像間対応付けステップおよび前記距離画像生成ステップは、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価ステップにおいて距離画像生成用投光パターン画像として適性ありと判定されたことを条件として処理を実行することを特徴とする距離画像生成方法にある。
【0076】
さらに、本発明の第6の側面は、
測定対象を異なる視点から撮影した画像を用いて前記測定対象の三次元形状を計測して距離画像を生成する距離画像生成方法において、
乱数を用いた非周期的投光パターンを生成するとともに、パターンとしての適性度を示すパターン適性度指標値を生成投光パターンに基づいて算出し、算出したパターン適性度指標値を予め定めた閾値と比較することで距離画像生成用投光パターンとしての適性を判定し、適性ありと判定されたパターンのみを投光パターンとして設定する投光パターン生成ステップと、
前記測定対象の投光パターン画像を基準カメラと参照カメラを適用して、異なる視点から同期したタイミングで撮り込む画像撮り込みステップと、
前記基準カメラおよび参照カメラによって撮り込まれた各投光パターン画像間の対応を検出し視差データを出力する画像間対応付けステップと、
前記画像間対応付けステップにおいて出力される視差データに基づいて距離画像を生成する距離画像生成ステップと、
前記距離画像生成ステップにおいて生成された投光パターン画像に基づく距離画像中のミスマッチング領域を検出するミスマッチング領域検出ステップと、
を有し、
前記投光パターン生成ステップは、生成した投光パターンに基づいて得られる距離画像について前記ミスマッチング領域検出ステップにおいて予め定めた閾値以上のミスマッチング領域が検出された場合に新たな非周期的投光パターンを生成することを特徴とする距離画像生成方法にある。
【0085】
さらに、本発明の第7の側面は、
測定対象を異なる視点から撮影した画像を用いて前記測定対象の三次元形状を計測する三次元形状計測を実行するために用いられる投光パターン生成処理をコンピュータ・システム上で実行せしめるコンピュータ・プログラムを有形的に提供するプログラム提供媒体であって、前記コンピュータ・プログラムは、
(a)乱数を用いた非周期的投光パターンを生成する投光パターン生成ステップと、
(b)前記投光パターン生成ステップにおいて生成された投光パターンを評価する評価ステップであり、
(c)前記投光パターン生成ステップにおいて生成した投光パターンのパターンとしての適性度を示すパターン適性度指標値として、
(1)投光パターンを構成する画素値の周期的変化を示す変化率、
(2)投光パターンを構成する画像の画素値に基づく特徴行列の固有値から算出される特徴量、
(3)投光パターンを構成する異なる部分領域の類似度を示す領域間相関値、
(4)投光パターンを構成する画像の分散値、
上記(1)〜(4)のいずれかの値を、前記生成投光パターンに基づいて算出するパターン適性度指標値算出ステップと、
(d)算出したパターン適性度指標値を予め定めた閾値と比較することによって、生成投光パターンが三次元形状計測用投光パターンとして適性を持つか否かを判定する適性判定ステップと、
を含む評価ステップと、を有し、
前記適性判定ステップにおいて適正ありとの判定がでるまで、前記ステップ(a)において異なる投光パターンを生成し、(a)〜(d)のステップを繰り返し実行し、
前記評価ステップ中の適性判定ステップにおいて適正ありと判定された投光パターンを三次元形状計測用投光パターンとして決定するステップと、を含むことを特徴とするプログラム提供媒体にある。
【0086】
本発明の第7の側面に係るプログラム提供媒体は、例えば、様々なプログラム・コードを実行可能な汎用コンピュータ・システムに対して、コンピュータ・プログラムをコンピュータ可読な形式で提供する媒体である。媒体は、CDやFD、MOなどの記憶媒体、あるいは、ネットワークなどの伝送媒体など、その形態は特に限定されない。
【0087】
このようなプログラム提供媒体は、コンピュータ・システム上で所定のコンピュータ・プログラムの機能を実現するための、コンピュータ・プログラムと提供媒体との構造上又は機能上の協働的関係を定義したものである。換言すれば、該提供媒体を介してコンピュータ・プログラムをコンピュータ・システムにインストールすることによって、コンピュータ・システム上では協働的作用が発揮され、本発明の他の側面と同様の作用効果を得ることができるのである。
【0088】
本発明のさらに他の目的、特徴や利点は、後述する本発明の実施例や添付する図面に基づくより詳細な説明によって明らかになるであろう。
【0089】
【発明の実施の形態】
[ランダムパターン生成装置−実施例1]
まず、本発明のランダムパターン生成装置を適用した距離画像生成装置の構成例を図2に示し、距離画像生成装置の概要について説明する。距離画像生成装置は、先に説明したステレオ画像法を適用して計測対象の三次元形状を計測するものであり、立体形状を持つ、例えば人の顔等の被測定対象物に対して角度の異なる位置に配置した2つのカメラ、いわゆる基準カメラと参照カメラを用いて像を撮り込み、これら2つのカメラの撮影する画像に基づいて図1で説明したステレオ画像法に基づいて被測定対象物の表面形状を計測するものである。
【0090】
本発明のランダムパターン生成装置によって生成されたランダムパターンは、距離画像生成装置の投光パターン生成及び照射手段220において照射される。この投光パターンは一様乱数や正規乱数に基づく非周期的投光パターンである。投光パターン生成及び照射手段220で計測対象200に対して投光される非周期投光パターンは、例えばドットのサイズ、線の長さ、太さ、位置、濃度等に周期性を持たないパターンであり、例えば図3(a)、(b)に示すようなパターンである。これらのパターン生成手法については、後段で詳細に説明する。
【0091】
本発明のランダムパターン生成装置によって生成された非周期的パターンは例えば予めスライド等に形成され、フラッシュ光をスライドを介して照射することによって測定対象に対してパターンの投影が可能となる。あるいは、透過型液晶表示素子等を用いて動的にランダムパターンを生成して投影することができる。動的なランダムパターン生成手法については後段で詳細に説明する。計測対象200の表面に形成された非周期パターンを計測対象とともに撮像することにより、距離画像生成時の基準カメラと参照カメラの撮像データの対応付けを容易にすることができる。
【0092】
本発明の距離画像生成装置の構成について説明を続ける。基準カメラ201と参照カメラ202は、計測対象200に対して異なる視線方向に配置されて、各視線方向の画像、すなわちランダムパターンの投影された計測対象200を撮影する。基準カメラ201、参照カメラ202によって撮影される画像は、同期したタイミングで撮り込まれる。基準カメラ201、参照カメラ202から撮り込まれた画像はそれぞれA/D変換部を介してフレームメモリ203、204に格納される。
【0093】
画像間対応付け手段205は、フレームメモリ1a,203とフレームメモリ2a,204の基準カメラ及び参照カメラ各々の投光パターン画像間の対応付け処理を行なう。すなわち、基準カメラ201の撮影した画像の各画素に対する参照カメラ202の撮影した参照画像の画素の対応付け処理を行ない、基準画像に対する参照画像の視差データを距離画像生成手段206に出力する。
【0094】
投光パターン生成及び照射手段220の照射する投光パターンは、先に説明したように非周期的なパターンであり、各カメラによって撮影した画像の対応付けが比較的容易に行われる。距離画像生成手段206は、画像間対応付け手段205の生成した視差データに基づいて距離画像を生成し、画像メモリ207に格納する。画像メモリ207に格納された距離画像は、出力手段208を介して出力される。
【0095】
なお、図2に示す構成の各ブロックにおける処理、およびブロック間データ転送制御等は、図示しない制御手段によって制御され、所定のメモリ、例えばRAM,ROM等の半導体メモリ、磁気ディスク、光ディスク等の記憶媒体に記録された制御プログラムによって制御することができる。また、図示しない入力手段によってユーザがコマンド、パラメータ等を入力して各制御態様を変更することが可能である。
【0096】
図4に投光パターン生成及び照射手段220の具体的構成例、すなわちランダム点群からなる画像パターンの投光装置の構成と、画像撮影装置との関係を示す。
【0097】
一般に、テクスチャ画像パターンを対象に投光すると、画像の明るさが問題となる。ここでは、十分な光量を得るために、ストロボ投光系を光源として用いている。一方、撮影装置側では、背景光の影響を抑え、投光パターンのコントラストを向上す得るために、基準カメラ402と参照カメラ403の電子シャッターを調整することによって、CCD蓄積時間をコントロールする。また、投光装置と投光パターン生成及び照射手段220との間において、制御手段401を共有することによって、投光パターン生成及び照射手段220によってテクスチャ画像パターンが投光される瞬間、基準カメラ402と参照カメラ403により計測対象を同時に撮り込む構成としている。各カメラによって撮り込まれた画像は、画像メモリ404(図2におけるフレームメモリ203,204に対応)に別々に格納されて、各画像間の対応付け処理、さらに距離画像生成処理に使用される。
【0098】
図4に示す投光パターン生成及び照射手段220中のスライドは、非周期的パターンが記録されたスライドである。上述のようにドットのサイズ、線の長さ、太さ、位置、濃度等に周期性がない、いわゆる非周期的な投光パターン、例えば図3(a)、(b)に示すようなパターンが記録されたスライドである。
【0099】
以下、非周期的な投光パターンの生成処理構成の詳細について説明する。図5に本発明のランダムパターン生成装置の機能構成を示すブロック図、図6に本発明のランダムパターン生成装置において、非周期的な投光パターンであるランダムテクスチャパターンを生成する処理フロー示す。以下、図5および図6を用いて本発明のランダムパターン生成装置について説明する。
【0100】
図5における一様乱数発生手段501において発生した一様乱数に基づいて正規乱数発生手段502は、予め設定された標準偏差s、平均値amに基づいて正規乱数Rkを発生する。標準偏差sは、標準偏差設定手段507において様々な値を設定可能であり、設定された標準偏差に基づいて様々な正規乱数が正規乱数発生手段502において発生可能である。
【0101】
画像生成手段503は、正規乱数発生手段502において発生された正規乱数Rkに基づいて画像rd_im[k]を生成する。
【0102】
次に二値画像生成手段504は、予め定めた閾値Tにより画像rd_im[k]の二値化処理を行ない、二値画像f(i,j)を生成する。閾値Tは、閾値設定手段508において様々な値を設定可能であり、設定された閾値に基づいて様々な二値画像が二値画像生成手段504において生成可能である。
【0103】
次に、変化率検出手段505は、二値画像生成手段504の生成した二値画像f(i,j)の変化率rを求め、さらに、変化率判定手段506が、変化率検出手段505の検出した変化率rと、予め定めた閾値T1との比較を実行する。変化率rは、生成された二値画像が周期性を持たない場合、値が大きくなり、周期性がある場合、例えば画素値が010101等の繰り返しを含む場合に低下する値であるパターン適性度指標値である。変化率rについての算出式については図6のフローについての説明中で詳述する。
【0104】
変化率判定手段506の閾値T1との比較処理において、変化率rが閾値T1を上回っている場合は、十分な非周期性が保持されたランダムパターンであると判定され、二値画像生成手段504で生成された二値画像が投光用パターンとして使用される。
【0105】
次に、図6のフローに従って、より具体的な処理について説明する。図6のステップ601では、0−1間一様乱数の発生処理が行われ、配列a[n]に格納される。これらは2値(0または1)、あるいは濃淡値(0〜1間の値を持ち得る)のいずれかの一様乱数である。
【0106】
ステップ602では標準偏差s、平均値amとなる正規乱数(gauss)の発生処理がなされる。正規乱数Rkは以下の式によって0−1一様乱数に基づいて発生される。
【0107】
【数1】

Figure 0004110501
【0108】
次に、ステップ603において、正規乱数に基づくランダムテクスチャ画像rd_im[k]が生成される。ここで、k=0〜K−1,rd_im[k]=Rk,K=XSIZE×YSIZE(画像サイズ)である。
【0109】
さらに、ステップ604で、ステップ603で生成された正規乱数に基づくランダムテクスチャ画像rd_im[k]の二値化処理を行なう、これは予め定められた閾値Tに基づいて実行され。この結果得られる二値画像がf(i,j)とされる。
【0110】
次に、ステップ605において、二値画像f(i,j)のパターン適性度指標値としての変化率rが算出される。変化率rの算出は、以下の式に基づいて実行される。
【0111】
【数2】
Figure 0004110501
【0112】
なお、上記式においてAは、正規化係数である。
【0113】
次に、ステップ606において、変化率rと、予め定めた閾値T1との比較処理が行なわれ、変化率rが閾値T1より大であれば、十分なランダム性を有する二値画像であると判定され、ステップ607において投光パターン画像生成処理を終了する。
【0114】
ステップ606における判定がNo、すなわち変化率rが予め定めた閾値T1より大でないと判定された場合には、生成された二値画像が投光に不適切な周期成分を含むと判定され、ステップ608に進み、標準偏差sまたは、閾値Tの少なくともいずけか一方の値を変更して、ステップ602以下、少なくともステップ604以下の処理を繰り返して、新たな二値画像f(i,j)を生成する。
【0115】
最終的にステップ606において、変化率r>閾値T1がYesとなった時点で、その二値画像が十分なランダム性を有する二値画像であると判定され、ステップ607に進み、投光パターン画像生成処理を終了する。
【0116】
以上、図5、図6を用いて説明した本発明のランダムパターン生成装置、およびランダムパターン生成方法によれば、一様乱数に基づいて生成された二値画像の変化率rを予め定めた閾値Tより大となること保証して投光用ランダム画像パターンを生成するように構成したので、ステレオ画像処理における対応付け処理において問題となる、すなわちミスマッチングの原因となる周期成分が十分取り除かれた良好なランダムパターンの生成が可能となる。
【0117】
[ランダムパターン生成装置−その他の実施例]
以下、本発明のランダムパターン生成装置、およびランダムパターン生成方法における二値画像パターンの評価方法の異なる態様について、図7、図8、図9を用いて説明する。図5、図6における生成された二値画像パターンの評価は、図6におけるステップ605,606において示されるように、生成した二値画像全体からパターン適性度指標値としての変化率rを算出して、この変化率rと閾値T1を比較することによって行なっていた。図7〜9では、二値画像f(x,y)から一部領域を抽出して、その一部領域についてのパターン適性度指標値として変化率、特徴量による判定、さらにパターンマッチングによる判定処理を行なう態様である。
【0118】
まず、図7を用いて、二値画像f(x,y)から一部領域(ウィンドー)のパターンを抽出して、パターン変化率パラメータを用いるランダム画像パターンの評価方法を説明する。
【0119】
図7のステップ701において、サイズがXSIZE×YSIZEの二値画像f(x,y)を取得する。例えば図7右上に示すランダムパターンである。
【0120】
ステップ702では、評価基準サイズとして適用されるウィンドーのサイズ:Nx×Nyを設定する。例えば図7右下に示すNx×Nyのウィンドーである。ステップ703では、ウィンドーの位置を設定する座標xm,ymを設定する。これらの座標は、x座標値:xm=Nx/2、y座標値:ym=Ny/2として設定される。
【0121】
次に、ステップ704において、(xm,ym)によって定義されるウィンドーの変化率γmを以下の式に従って求める。
【0122】
【数3】
Figure 0004110501
【0123】
次に、ステップ705において、(xm,ym)によって定義されるウィンドーのパターン適性度指標値としての変化率γmと予め定めた閾値T2との比較を実行して、変化率γmが閾値T2より大であれば、そのウィンドーは十分なランダム性を有する二値画像であると判定され、ステップ706において、さらに比較すべきウインドゥ領域があるか否かを判定して、ある場合は、ステップ708に進み、xm,ymを更新して、新たなウィンドー領域の変化率の算出および閾値との比較を実行する。
【0124】
ステップ705における判定がNo、すなわち変化率γmが予め定めた閾値T2より大でないと判定された場合には、生成された二値画像における当該ウィンドーが投光に不適切な周期成分を含むと判定され、ステップ707に進み、投光パターンとして不適切であると判定し、ステップ709において評価処理を終了する。
【0125】
このように投光パターンとして不適切であるとの判定がなされた場合において、新たなランダムパターンが必要である場合は、先に説明した図6のステップ608において標準偏差s、または閾値Tを変更して新たな二値画像f’(x,y)の生成処理を行なうことになる。
【0126】
図7のフローにおいて、ステップ705の評価判定がすべてYesとなり、評価ウィンドーが終了した場合は、ステップ709に進み、評価が終了し、生成された二値画像f(x,y)が投光パターンとして適切であると判定する。
【0127】
次に、図8を用いて、二値画像f(x,y)から一部領域(ウィンドー)のパターンを抽出して、パターンの特徴量パラメータを用いるランダム画像パターンの評価方法を説明する。
【0128】
図8のステップ801において、サイズがXSIZE×YSIZEの二値画像f(x,y)を取得する。例えば図8右上に示すランダムパターンである。
【0129】
ステップ802では、評価基準サイズとして適用されるウィンドーのサイズ:Nx×Nyを設定する。例えば図8右下に示すNx×Nyのウィンドーである。ステップ803では、ウィンドーの位置を設定する座標xm,ymを設定する。これらの座標は、x座標値:xm=Nx/2、y座標値:ym=Nn/2として設定される。
【0130】
次に、ステップ804において、(xm,ym)によって定義されるウィンドーの特徴行列Rを以下の式に従って求める。
【0131】
【数4】
Figure 0004110501
【0132】
次に、ステップ805において、特徴行列Rの固有値:λm1、λm2を求め、ステップ806において、(xm,ym)によって定義されるウィンドーの特徴行列Rの固有値:λm1、λm2から求められるパターン適性度指標値としての特徴量:λ=min(λm1,λm2)と予め定めた閾値λTとの比較を実行して、特徴量:λが閾値λTより大であれば、そのウィンドーは十分なランダム性を有する二値画像であると判定され、ステップ807において、さらに比較すべきウインドー領域があるか否かを判定して、ある場合は、ステップ809に進み、xm,ymを更新して、新たなウィンドー領域の特徴量の算出および閾値との比較を実行する。
【0133】
ステップ806における判定がNo、すなわち特徴量:λが予め定めた閾値λTより大でないと判定された場合には、生成された二値画像における当該ウィンドーが投光に不適切な周期成分を含むと判定され、ステップ808に進み、投光パターンとして不適切であると判定し、ステップ810において評価処理を終了する。
【0134】
このように投光パターンとして不適切であるとの判定がなされた場合において、新たなランダムパターンが必要である場合は、先に説明した図6のステップ608において標準偏差s、または閾値Tを変更して新たな二値画像f’(x,y)の生成処理を行なうことになる。
【0135】
図8のフローにおいて、ステップ806の評価判定がすべてYesとなり、評価ウィンドーが終了した場合は、ステップ810に進み、評価が終了し、生成された二値画像f(x,y)が投光パターンとして適切であると判定する。
【0136】
次に、図9を用いて、二値画像f(x,y)から一部領域(ウィンドー)のパターンを複数抽出して、ウィンドー間のマッチングスコアを用いてランダム画像パターンの評価を行なう方法を説明する。前述の図7、図8の処理フローでは1つの部分領域における画像の特徴について評価していたが、ここでは、異なる部分領域間において、類似するパターンが存在するか否かを判定して、類似パターンがあると判定された場合は、投光パターンとしては不適切であるとの判定を行なうものである。
【0137】
図9のステップ901において、サイズがXSIZE×YSIZEの二値画像f(x,y)を取得する。
【0138】
ステップ902では、評価基準サイズとして適用されるウィンドーのサイズ:Nx×Nyを設定する。例えば図9右下に示すNx×Nyのウィンドーである。この場合比較対象となるウィンドーも同一サイズのウィンドーとして設定される。ステップ903では、ウィンドーの位置を設定する座標xm,ymを設定する。これらの座標は、x座標値:xm=Nx/2、y座標値:ym=Nn/2として設定される。
【0139】
次に、ステップ904において、画像内の2つのウィンドーのパターンP1(i,j)とP2(i,j)との領域間相関値がパターン適性度指標値として以下の式に従って求められる。
【0140】
【数5】
Figure 0004110501
【0141】
次に、ステップ905において、上記式に従って求められるパターン適性度指標値としての相関値rmと予め定めた閾値T3との比較を実行して、相関値rmが閾値T3より小であれば、ステップ904で比較した2つのウィンドーは不適切な類似パターンを有さない画像であると判定され、ステップ906において、さらに比較すべきウインドゥ領域があるか否かを判定して、ある場合は、ステップ908に進み、xm,ymを更新して、新たなウィンドー領域を設定してステップ904以下のパターンマッチング処理を行なう。
【0142】
ステップ905における判定がNo、すなわち相関値rmが予め定めた閾値T3より小でないと判定された場合には、ステップ904で比較した2つのウィンドーは不適切な類似パターンを有すると判定され、ステップ907に進み、投光パターンとして不適切であると判定し、ステップ909において評価処理を終了する。
【0143】
このように投光パターンとして不適切であるとの判定がなされた場合において、新たなランダムパターンが必要である場合は、先に説明した図6のステップ608において標準偏差s、または閾値Tを変更して新たな二値画像f’(x,y)の生成処理を行なうことになる。
【0144】
図9のフローにおいて、ステップ905の評価判定がすべてYesとなり、評価ウィンドーが終了した場合は、ステップ909に進み、評価が終了し、生成された二値画像f(x,y)が投光パターンとして適切であると判定する。
【0145】
以上では、主として二値画像によるパターンを投光する例について説明したが、二値画像ではなく濃淡パターンを投光する場合におけるパターン生成処理とそのパターン評価方法の例について、以下説明する。
【0146】
まず、濃淡画像によるランダムパターンの生成処理フローを図10に示す。図10のフローの各ステップについて説明する。まず、ステップ1001、ステップ1002において濃淡パターンを生成する画像領域の座標値の初期値をi=0,j=0として設定する。
【0147】
次に、ステップ1003において、0−1間の一様乱数を発生し、これを配列a[n]として格納する。さらに、ステップ1004において、ステップ1003で発生した一様乱数の配列a[n]に基づいて標準偏差s、平均値amとなる正規乱数Rを発生し、設定した座標(i,j)に対応する濃淡データをR=f(i,j)として設定する。これが座標(i,j)の濃淡値となる。
【0148】
ステップ1005、ステップ1006では、濃淡値を設定した座標と、投光パターン画像の設定サイズとの比較を実行して濃淡値の未設定領域の有無を判定する。未設定領域がある場合は、それぞれステップ1007、ステップ1008で座標を更新し、さらに、ステップ1003以降の処理を繰り返し実行して、各座標の濃淡値を乱数に基づいて設定する。XSIZE×YSIZEの領域に含まれる座標すべての濃淡値が決定されると、ステップ1009に進み、濃淡データからなる投光パターンの生成処理が終了する。
【0149】
なお、乱数の発生方法としては様々な手法が適用可能である。図10のフロー中に示す方法は一例を示しているにすぎず、本発明に適用される乱数発生方法は図10に示した方法に限定されるものではない。
【0150】
図10のフローにしたがって生成されたランダムパターンは、二値画像パターンではなく、濃淡値をもっているので、濃淡パターン画像としてのパターンとしての適性度を評価することが必要となる。
【0151】
濃淡値を有する投光パターンの評価処理フローを図11に示す。図11は、図11の右上に示す濃淡画像f(x,y)から、例えば図11の右下に示す一部領域(ウィンドー)のパターンを抽出して分散値を求めて濃淡画像パターンを評価する方法を示したものである。
【0152】
図11のステップ1101において、サイズがXSIZE×YSIZEの濃淡画像f(x,y)を取得する。例えば図11右上に示す濃淡パターンである。
【0153】
ステップ1102では、評価基準サイズとして適用されるウィンドーのサイズ:Nx×Nyを設定する。例えば図11右下に示すNx×Nyのウィンドーである。ステップ1103では、ウィンドーの位置を設定する座標xm,ymを設定する。これらの座標は、x座標値:xm=Nx/2、y座標値:ym=Ny/2として設定される。
【0154】
次に、ステップ1104において、(xm,ym)によって定義されるウィンドー内の分散値σmを以下の式に従って求める。
【0155】
【数6】
Figure 0004110501
【0156】
次に、ステップ1105において、(xm,ym)によって定義されるウィンドーのパターンとしての適性度を示すパターン適性度指標値としての分散値σmと予め定めた閾値σTとの比較を実行して、分散値σmが閾値σTより大であれば、そのウィンドーは十分なランダム性を有する濃淡画像であると判定され、ステップ1106において、さらに比較すべきウインドゥ領域があるか否かを判定して、ある場合は、ステップ1108に進み、xm,ymを更新して、新たなウィンドー領域の分散値の算出および閾値との比較を実行する。
【0157】
ステップ1105における判定がNo、すなわち分散値σmが予め定めた閾値σTより大でないと判定された場合には、生成された濃淡画像における当該ウィンドーが投光に不適切であると判定され、ステップ1107に進み、投光パターンとして不適切であると判定し、ステップ1109において評価処理を終了する。
【0158】
このように投光パターンとして不適切であるとの判定がなされた場合において、新たなランダムパターンが必要である場合は、先に説明した図10のステップ1004において標準偏差sを変更して新たな濃淡画像の生成処理を行なうことが可能である。
【0159】
図11のフローにおいて、ステップ1105の評価判定がすべてYesとなり、評価ウィンドーが終了した場合は、ステップ1109に進み、評価が終了し、生成された濃淡画像f(x,y)が投光パターンとして適切であると判定する。
【0160】
図12は、上述した方法によって生成された投光用画像パターンを対象(平面)に投光し、観測された2枚の画像から距離画像を求めた例を示した図である。図12(a)は、上述した本発明のランダムパターン生成方法に従って生成したランダム点群からなる投光用画像パターンを示す。図12(b)(c)は、そのパターンを測定対象である無地の壁に投光し、それぞれカメラ1とカメラ2(例えば、基準カメラと参照カメラ)により観測された画像である。
【0161】
図12(d)は、結果として得られる測定対象である無地の壁の距離画像である。この距離画像は、基準カメラ画像における任意のNx×Nyウィンドー内のパターンを用いて、参照カメラ画像におけるエピポーラライン上の対応付け、すなわち基準カメラ画像における任意のNx×Nyウィンドー内のパターンと同様のパターンが参照カメラ画像のエピポーラライン上のどの部分に表れるかを求めることによって視差データを取得し、その視差データに基づいて得られる距離画像である。図12(d)の距離画像は、測定対象である無地の壁に一律の距離データが反映されており、この結果は測定対象が無地の壁でも、本発明のランダムパターン生成方法に従って生成したランダム点群からなる投光用画像パターンを投光することによって、カメラとの距離を精度良く計測することを示している。
【0162】
図13は、上述のランダム点群からなる画像パターンを顔に投光し、基準カメラと参照カメラにより観測されたステレオ画像から求められた距離画像の計測結果の例を模式的に示した概念図である。
【0163】
図13(a)は、上述した本発明のランダムパターン生成方法に従って生成したランダム点群からなる投光用画像パターンを示す。図13(b)は、そのパターンを測定対象である顔に投光した模式図である。
【0164】
図13(c)(d)は、測定対象である顔に投光用画像パターン投光し、それぞれ基準カメラと参照カメラにより観測された画像である。
【0165】
図13(e)は、結果として得られる測定対象である顔の距離画像である。この距離画像は、説明のために抽象的に示す概念図であり、実際のものとは異なるが本発明のランダムパターン生成方法に従って生成したランダム点群からなる投光用画像パターンを投光した場合の対応点付け処理においてはミスマッチングの発生可能性が低減され、測定対象のほぼ全ての面で正確な距離が求められる。すなわち基準カメラから測定対象である顔の各部位までの距離に応じた濃淡が示される精度の高い距離画像が得られる。本発明のランダムパターン生成方法を用いることにより、測定対象が人の顔のような特徴がはっきりしない対象であっても、基準カメラ画像と参照カメラ画像との対応点付け処理においてミスマッチングが発生する可能性が低減され、距離画像(または3次元形状)を高精度に生成することができる。
【0166】
なお、上述の実施例では、画像撮り込みを行なうカメラを2台として、2つの投光パターン画像から距離画像を求める構成について説明したが、さらに3台以上のカメラを用いたマルチベースラインステレオシステム(例えば特開平10−289315号に開示)において本実施例を適用することも可能である。また、固定されたカメラ装置群ではなく、一台一台を自由に動かすことの出来るカメラ群を用いてステレオ撮影するような場合にも、本発明のランダムパターン生成装置とその方法は適用可能である。
【0167】
[距離画像生成装置−実施例1]
次に、上述のランダムパターン生成装置、方法を適用した距離画像生成装置および距離画像生成方法について説明する。
【0168】
図14に、本発明の距離画像生成装置の構成ブロック図を示す。距離画像生成装置は、先に説明したステレオ画像法を適用して計測対象の三次元形状を計測するものであり、立体形状を持つ、例えば人の顔等の被測定対象物に対して角度の異なる位置に配置した2つのカメラ、いわゆる基準カメラと参照カメラを用いて像を撮り込み、これら2つのカメラの撮影する画像に基づいて図1で説明したステレオ画像法に基づいて被測定対象物の表面形状を計測する。
【0169】
前述した本発明のランダムパターン生成装置は、図14における投光パターン生成装置1211に相当する。投光パターン生成装置1211において生成されたランダムパターンは、投光パターン照射手段1212において照射される。この投光パターンは一様乱数や正規乱数に基づく非周期的投光パターンである。
【0170】
投光パターン評価手段1210は、基準カメラ201、参照カメラ204によって撮影された投光パターン画像の少なくともいずれか一方の画像の評価を実行する。この画像評価は、前述のランダムパターン生成装置に関する説明中で述べた図5の構成、および図6〜図9の評価フローにおける評価を基準カメラ201、または参照カメラ204によって撮影された投光パターン画像に適用して実行される。または、投光パターンとして濃淡画像を使用することも可能であり、図10、図11の処理にしたがって、投光パターンの生成、および評価を実行してもよい。
【0171】
すなわち、例えば、投光パターン評価手段1210が、図14の基準カメラ201の撮り込んだ投光パターン画像について図6の評価フローに従って評価を行なう場合は、フレームメモリ1a,203からの画像を図6の評価フローのステップ605に従って、撮り込み画像p(i,j)、または撮り込み画像p(i,j)を所定の閾値Tpで処理して得られる二値画像p’(i,j)の変化率rをパターンとしての適性度を示すパターン適性度指標値として算出して、ステップ606の閾値との比較を実行して適切な投光パターンであるか否かの判定を行なう。
【0172】
また、先に説明した図7の評価フローに従って基準カメラ201、または参照カメラ204によって撮影された投光パターン画像の評価を行なう場合は、撮り込み画像p(i,j)、または撮り込み画像p(i,j)を所定の閾値Tpで処理して得られる二値画像p’(i,j)をステップ701に示される二値画像として、図7に示す以下のステップ702〜709を実行して、各ウィンドーの変化率rmをパターンとしての適性度を示すパターン適性度指標値として算出して評価を行なう。
【0173】
また、先に説明した図8の評価フローに従って基準カメラ201、または参照カメラ204によって撮影された投光パターン画像の評価を行なう場合は、撮り込み画像p(i,j)、または撮り込み画像p(i,j)を所定の閾値Tpで処理して得られる二値画像p’(i,j)をステップ801に示される二値画像として、図8に示す以下のステップ802〜810を実行して、各ウィンドーの特徴行列Rの固有値をパターンとしての適性度を示すパターン適性度指標値として求め、これを閾値と比較して評価を行なう。
【0174】
また、先に説明した図9の評価フローに従って基準カメラ201、または参照カメラ204によって撮影された投光パターン画像の評価を行なう場合は、撮り込み画像p(i,j)、または撮り込み画像p(i,j)を所定の閾値Tpで処理して得られる二値画像p’(i,j)をステップ901に示される二値画像として、図9に示す以下のステップ902〜909を実行して、異なるウィンドー間のマッチング率を求め、これをパターンとしての適性度を示すパターン適性度指標値として閾値と比較して評価を行なう。
【0175】
また、上記以外にもパターン画像の分散値(図11参照)を使用した評価も可能であり、さらに投光パターンとして濃淡画像を使用する場合には、図10、図11の処理にしたがって、投光パターンの生成、および評価処理を実行する。
【0176】
なお、投光パターン評価手段1210は、基準カメラ201の撮り込み画像、参照カメラ202の撮り込み画像のいずれか一方を評価する構成であっても、あるいは両画像の評価を行なう構成としてもよい。
【0177】
上述の各種評価方法によって投光パターンとして不適切であると判定された場合は、図14の投光パターン生成手段1211において、当該パターンの使用を中止し、新たな投光パターンを選択、または生成して測定対象に照射する。
【0178】
投光パターン生成装置1211は、異なる非周期パターンを予めスライド等に形成した投光パターンスライドを複数有し、これら複数の投光パターンから順次投光パターンを選択して照射し、投光パターン評価手段1210において投光パターンとして適切であると認められたものを最終的な投光パターン、すなわち距離画像を生成するためのパターンとして選択する。あるいは、投光パターン照射手段1212が透過型液晶表示素子を有し、投光パターン生成装置1211が透過型液晶表示素子を制御して動的にランダムパターンを生成して投影する構成としてもよい。動的なランダムパターン生成手法については、図15を用いて詳細に説明する。
【0179】
投光パターン評価手段1210において投光パターンとして適切であると認められた場合は、その結果が画像対応付け手段205に通知され、その投光パターンにおいて計測対象とともに基準カメラ201と参照カメラ202により撮影され、フレームメモリ203、204に格納された画像に基づいて、画像間対応付け手段205が投光パターン画像間の対応付け処理を行なう。すなわち、基準カメラ201の撮影した画像の各画素に対する参照カメラ202の撮影した参照画像の画素の対応付け処理を行ない、基準画像に対する参照画像の視差データを距離画像生成手段206に出力し、距離画像生成手段206が距離画像の生成処理を実行する。
【0180】
本発明の距離画像生成装置において、距離画像の生成される際に使用される投光パターンは、投光パターン生成手段1211によって生成または選択され、投光パターン評価手段1210において適切であると認められた投光パターンであるので、画像の対応付け処理においてミスマッチングの発生が抑制されることとなり、画像間対応付け手段205における画像間の対応付け処理、および距離画像生成手段206における距離画像生成処理が高精度に行われる。
【0181】
なお、図14に示す構成の各ブロックにおける処理、およびブロック間データ転送制御等は、図示しない制御手段によって制御され、所定のメモリ、例えばRAM,ROM等の半導体メモリ、磁気ディスク、光ディスク等の記憶媒体に記録された制御プログラムによって制御することができる。また、図示しない入力手段によってユーザがコマンド、パラメータ等を入力して各制御態様を変更することが可能である。
【0182】
次に、投光パターン照射手段1212が透過型液晶表示素子を有し、投光パターン生成装置1211が透過型液晶表示素子を制御して動的にランダムパターンを生成して投影する構成ブロック図を図15に示す。
【0183】
図15に示されるように、投光パターン照射手段1212は透過型液晶表示素子1320を有し、光源1321からの光が透過型液晶表示素子1320を介して測定対象200に照射される。
【0184】
投光パターン生成手段1211は、液晶制御手段1307を有し、液晶制御手段1307が透過型液晶表示素子1320に様々な非周期パターンを形成する制御を実行する。また、投光パターン生成手段1211は、先にランダムパターン生成装置の説明中で用いた図5の構成部501〜504,507,508と同様の構成を持ち、例えば2値の一様乱数を発生する一様乱数発生手段1301、一様乱数発生手段1301において発生した一様乱数に基づいて、予め設定された標準偏差s、平均値amに基づいて正規乱数Rkを発生する正規乱数発生手段1302、正規乱数発生手段1302において発生された正規乱数Rkに基づいて画像rd_im[k]を生成する画像生成手段1303、予め定めた閾値Tにより画像rd_im[k]の二値化処理を行ない、二値画像f(i,j)を生成する二値画像生成手段1304を有する。
【0185】
液晶制御手段1307は、二値画像生成手段1304の生成した二値画像に対応するパターンを形成するように透過型液晶表示素子1320を制御する。
【0186】
標準偏差sは、標準偏差設定手段1305において様々な値を設定可能であり、設定された標準偏差に基づいて様々な正規乱数が正規乱数発生手段1302において発生可能であり、閾値Tについても閾値設定手段1306において様々な値を設定可能であり、これら各種設定値に基づいて様々な二値画像が二値画像生成手段1304において生成される。
【0187】
一方、投光パターン評価手段1210は、基準カメラ201の撮り込み画像、参照カメラ202の撮り込み画像をフレームメモリ1a,203、フレームメモリ1a,204を介して受信し、撮影画像変化率検出手段1308において撮り込み画像p(i,j)、または撮り込み画像p(i,j)を所定の閾値Tpで処理して得られる二値画像p’(i,j)の変化率rをパターンとしての適性度を示すパターン適性度指標値として算出する。さらに変化率判定手段1309が予め定めた閾値T1との比較処理を実行して適切な投光パターンであるか否かの判定を行なう。
【0188】
変化率判定手段1309における判定結果は、投光パターン生成手段1211にフィードバックされ、比較結果が不適切な投光パターンであると判定した場合には、投光パターン生成手段1211の閾値T設定手段1306、または標準偏差s設定手段1305において新たな閾値T、または標準偏差sが設定されて新たな二値画像が生成される。この新たな二値画像に基づくパターンが液晶制御手段1307の制御のもとに投光パターン照射手段1212中の透過型液晶表示素子1320に形成される。
【0189】
変化率判定手段1309における比較結果が適切な投光パターンであると判定した場合には、図15には示されていないが、図14で説明したように画像対応付け手段205に通知され、各フレームメモリに格納された画像データに基づく対応付け処理が開始される。
【0190】
なお、図15においては、投光パターン評価手段1210が、先のランダムパターン生成装置の説明における図5、6の画像評価構成を採用したものについて示したが、この評価構成に限らず、図7で説明した各ウィンドーの変化率rmに基づく評価、図8で説明した各ウィンドーの特徴行列の固有値に基づく評価、図9で説明した2つのウィンドー間のマッチング率に基づく評価構成のいずれを適用することも可能である。
【0191】
図16に本発明の距離画像生成装置における投光パターン決定処理フローを示す。以下、図16の各ステップについて図14、図15を参照しながら、その処理を説明する。
【0192】
ステップ1401は、測定対象200に投影する投光パターンを設定するステップである。投光パターン生成手段1211が、予め複数の非周期パターンを形成したスライドを有する場合は、その中から1つのスライドを投光パターンとして選択する。投光パターン生成手段1211が透過型液晶表示素子1320を有する場合は、投光パターン生成手段1211が図15に示す二値画像生成手段1304で生成した二値画像に基づくパターンを透過型液晶表示素子1320に形成するように液晶制御手段1307によって制御する。
【0193】
ステップ1402は測定対象200にある投光パターンを照射して、基準カメラ201、参照カメラ202を用いて撮影するステップである。各カメラで撮影された画像は、フレームメモリ1a,203、フレームメモリ2a,204に格納される。
【0194】
ステップ1403は、撮影された画像に基づく投光パターンの評価処理ステップである。投光パターン評価手段1210において、撮影された画像に基づく投光パターンの評価処理が実行される。これら評価処理は、先に説明した図5〜図9の評価処理構成を適用して行なわれる。
【0195】
ステップ1404は、投光パターン評価手段1210における評価処理において投光パターンとして不適切な部分があるか否かを判定するステップであり、不適切な部分がない場合は、ステップ1405に進み、画像間対応付け手段205、距離画像生成手段において撮り込み画像に基づく画像間対応付け処理および距離画像生成処理が実行される。
【0196】
ステップ1404における判定がNo、すなわち投光パターン評価手段1210における評価処理において投光パターンとして不適切な部分があると判定された場合は、ステップ1406に進み、新たな投光パターンの生成、または選択処理がなされ、さらにステップ1401以下の処理、すなわち新たな投光パターンの照射、撮影、評価処理が実行される。
【0197】
本発明の距離画像生成装置における、実際の画像取得例を図17に示す。図17は測定対象に予め模様が付されており、この模様の付された測定対象に非周期投光パターンを照射して撮影すると、撮影結果が測定対象の本来の模様と投光パターンの重なりが発生して対応付け処理が困難になる例を示したものである。
【0198】
図17(a)が測定対象に付されている模様であり、(b)が最初の投光パターンである。投光パターン自体は非周期なものであるが、この非周期パターンが、測定対象に投光し(c)、これを撮影すると、(d)のように測定対象の本来の模様と投光パターンの重なりが発生して対応付け処理が困難になる。図14または13で示す投光パターン評価手段は、この図17(d)に示す画像の評価を、前述のように例えば図5〜9で説明した各方法で行なう。
【0199】
図17(d)に示す画像の評価は、投光パターンとして不適切であるとの評価となるので、投光パターン生成手段1211は、新たな投光パターン(e)を生成して、測定対象に投光(f)して、その結果(g)を得る。この画像(g)についても評価処理がなされ、評価の結果が適切であると判定されることにより、対応付け処理、距離画像生成処理が開始される。
【0200】
本発明の距離画像生成装置は、上述のように、投光パターンを、その撮影画像に基づいて評価・検討して、ミスマッチングの発生が抑制された適正な投光パターン照射画像についての距離画像生成が可能な構成としたので、より高精度な距離画像を得ることができる。
【0201】
また、不適切な投光パターン、すなわち対応付け処理においてミスマッチングが多く発生するような投光パターン画像についての対応点付け処理、距離画像生成処理を行なう以前に、適切な投光パターンを選択することが可能となるので、処理の複雑な対応点付け処理、距離画像生成処理を何度も繰り返して行なう必要なく1回のみの処理で高精度な距離画像を得ることができる。
【0202】
なお、上述の実施例では、画像撮り込みを行なうカメラを2台として、2つの投光パターン画像から距離画像を求める構成について説明したが、さらに3台以上のカメラを用いたマルチベースラインステレオシステム(例えば特開平10−289315号に開示)において本実施例を適用することも可能であり、各カメラにおける取り込み画像のいずれか、または複数の画像に対して上述の評価を実行する構成としてもよい。
【0203】
また、固定されたカメラ装置群ではなく、一台一台を自由に動かすことの出来るカメラ群を用いてステレオ撮影するような場合にも、本発明の構成は適応でき、各カメラの移動後の撮影画像の評価が容易に実行可能であり、任意の位置にカメラを設定することが容易となる。
【0204】
[距離画像生成装置−実施例2]
上述の距離画像生成装置の実施例1の構成は、取得投光パターン画像の評価を距離画像生成以前に実行する構成であるが、実際に距離画像を生成してそのミスマッチング領域の有無を判定して、その判定に基づいて新たな投光パターンを生成する構成について実施例2として説明する。
【0205】
距離画像は、例えば基準カメラと測定対象との距離値を撮影画像の各画素に例えば濃淡値として反映させた画像データであり、三次元グラフィックデータの生成等に用いられる。前述の実施例1では、距離画像の生成ステップ以前に投光パターンの適性を判定する構成であったが、実際の距離画像においてミスマッチング領域が検出される可能性を皆無にすることは保証されるものではなく、そこで実施例2では、距離画像生成後にミスマッチング領域が検出された場合に、さらに新たな投光パターンを照射してミスマッチング領域を削減した高精度な距離画像を得る構成を提供する。なお、ミスマッチング領域とは、距離画像において、正確な距離を示していない画素領域であり、画像間対応付け処理が正確に実行されなかった場合に発生する。
【0206】
実施例2の構成を図18に示す。実施例1と異なる点は、ミスマッチング領域検出手段1601であり、ミスマッチング領域検出手段1601は、距離画像生成手段206によって生成された距離画像を格納した画像メモリ207から距離画像を取得してミスマッチング領域を検出する。
【0207】
ミスマッチング領域検出手段1601によって距離画像中にミスマッチング領域が検出された場合は、投光パターン生成手段1602に通知され、新たな投光パターンが生成、または選択され、投光パターン照射手段1603によって新たな投光パターンが照射される。投光パターン照射手段1603の構成は、実施例1と同様であり、説明を省略する。
【0208】
投光パターン生成手段1602は、測定対象に対して投光するパターンを生成する構成を持ち、乱数を用いた異なる複数の非周期的投光パターンを生成可能である。さらに、実施例1における投光パターン評価手段と同様の評価構成を持ち、生成した投光パターンについてパターンとしての適性度を示すパターン適性度指標値に基づく判定を行なって判定の良好なもののみを投光パターンとして設定する。
【0209】
すなわち、生成投光パターンのパターンとしての適性度を示すパターン適性度指標値、例えば前述した変化率、特徴量、分散値等を算出し、算出したパターンとしての適性度を示すパターン適性度指標値を予め定めた閾値と比較することで距離画像生成用投光パターンとしての適性を判定し、適性ありと判定されたパターンのみを投光パターンとして設定する。従って、投光パターン生成手段1602によって生成され、投光パターン照射手段1603によって照射される投光パターンは基本的に周期性を生じにくい投光パターンとなる。
【0210】
ミスマッチング領域検出手段1601の処理を中心として、以下実施例2の構成を説明する。図19に本実施例の距離画像生成装置の処理フローを示す。
【0211】
ステップ1701は、測定対象200に投影する投光パターンを設定するステップである。投光パターン生成手段1602が、予め複数の非周期パターンを形成したスライドを有する場合は、その中から1つのスライドを投光パターンとして選択する。投光パターン生成手段1602が、図15で説明した透過型液晶表示素子を有する場合は、投光パターン生成手段1602が図15に示す二値画像生成手段1304で生成した二値画像に基づくパターンを透過型液晶表示素子1320に形成するように液晶制御手段1307によって制御する。
【0212】
ステップ1702は投光パターン画像に基づく距離画像の生成処理ステップであり、基準カメラ201、参照カメラ202で撮影された画像、すなわちフレームメモリ1a,203、フレームメモリ2a,204に格納された画像に基づいて、画像間対応付け手段205、距離画像生成手段206において実行される。
【0213】
ステップ1703は、生成された距離画像に基づくミスマッチング領域の検出処理であり、ミスマッチング領域検出手段1601によって実行される。ミスマッチング領域の検出処理について、図20、図21を用いて説明する。
【0214】
図20は、ミスマッチングの検出処理の概略を示すものであり、ステップ1801において距離画像のラベリング処理を実行し、ラベリング画像1802を取得し、ラベリング画像1802に基づいて、ステップ1803においてミスマッチング領域を検出する。
【0215】
図20に示すステップ1801におけるラベリング処理の詳細処理フローを図21に示す。まず、図21のステップ2101において、図18に示すミスマッチング領域検出手段1601は、画像メモリ207から距離画像D1を読み出す。
【0216】
ステップ2102において、ミスマッチング領域検出手段1601は、ラベリング処理を開始する座標を設定するための初期化処理として、ラベリング未処理画素数kを初期化し、ミスマッチング領域検出手段1601は、内蔵する座標記憶用バッファx[k],y[k]を初期化する。
【0217】
ステップ2103において、ミスマッチング領域検出手段1601は、距離画像D1の中の計測対象(被写体)に対応する部分の任意の位置座標を注目画素の座標(i,j)として設定する。
【0218】
ステップ2104において、ミスマッチング領域検出手段1601は、距離画像D1の注目画素の画素値g(i,j)を抽出する。画素値g(i,j)は、画素(i,j)の距離値を示している。
【0219】
次に、ステップ2105において、ミスマッチング領域検出手段1601は、注目画素(i,j)に隣接する画素の内の1つの未処理画素の画素値g(i+m,j+n)(ただしm,n=−1,0,1)を抽出する。
【0220】
ステップ2106において、ミスマッチング領域検出手段1601は、注目する画素(i,j)の画素値g(i,j)が、ラベル値L0であるか否かを判定し、さらに注目する画素の画素値g(i,j)と隣接する画素の画素値g(i+m,j+n)の差の絶対値が所定の閾値より小さいか否かを判定する。
【0221】
この閾値との比較により、画素(i,j)と隣接画素(i+m,j+n)の連続性が判定される。すなわち画素(i,j)と隣接画素(i+m,j+n)の画素値、g(i,j)とg(i+m,j+n)との差分が閾値より小さければその2つの画素は連続する領域にあると判定され、閾値より大であれば不連続の領域であると判定する。
【0222】
注目する画素の画素値g(i,j)がL0でなく、かつ、隣接する画素の画素値g(i+m.j+n)が画素値g(i,j)に対して連続していると判定された場合ステップ2107に進む。
【0223】
ステップ2107において、ミスマッチング領域検出手段1601は、ラベリング未処理画素数kを1だけインクリメントし、隣接する画素のx座標i+mを座標記憶用バッファx[k]に記憶し、y座標j+nを座標記憶用バッファy[k]に記憶する。
【0224】
ステップ2108において、ミスマッチング領域検出手段1601は、注目する画素に隣接する8つの全ての画素に対してステップ2105,2106の処理を施したか否かを判定し、隣接する画素にステップ2105,2106の処理を施していないものが存在すると判定した場合、ステップ2105に戻り、それ以降の処理を繰り返す。その後、ステップ2108で、隣接する8つの全ての画素に対してステップ2105,2106の処理を施したと判定された場合、ステップ2109に進む。
【0225】
ステップ2109において、ミスマッチング領域検出手段1601は、注目画素の画素値g(i,j)をラベル値L0に置換する。ここで、ラベル値L0は、距離画像D1の測定対象(被写体)に対応する部分の画素に対して付されるものである。
【0226】
ステップ2110において、ミスマッチング領域検出手段1601は、ラベリング未処理画素数kが0であるか否かを判定し、ラベリング未処理画素数kが0ではないと判定した場合、ステップ2111に進む。
【0227】
ステップ2111において、ミスマッチング領域検出手段1601は、座標記憶用バッファx[k]に記憶されている値を注目画素のx座標とし、座標記憶用バッファy[k]に記憶されている値を注目画素のy座標とする。これにより、先ほどまでの注目画素に隣接し、かつ画素値が連続する画素が新たな注目画素とされる。その後、ミスマッチング領域検出手段1601は、ラベリング未処理画素数kを1だけインクリメントしてステップ2104に戻る。
【0228】
その後、ステップ2110において、ラベリング未処理画素数kが0であると判定されるまで、ステップ2104以降の処理が繰り返され、ラベリング未処理画素数kが0であると判定された場合、ステップ2112に進む。ステップ2112において、ミスマッチング領域検出手段1601は、距離画像D1の画素で画素値がラベル値L0に置換されていない画素の画素値をミスマッチング領域であることを示すラベル値L1に置換する。
【0229】
上述のようなラベリング処理が終了すると、距離画像D1において距離データが所定の閾値以下の差分を有する連続領域には同一のラベルが付与され、例えば図20のラベリング画像1802が得られる。
【0230】
ミスマッチング領域検出手段1601は、同一ラベルが付与された画素に囲まれていて、かつ周囲と異なるラベルが付与された小さな孤立領域が存在するか否かを上記のラベル値にしたがって判定する。図20のラベリング画像1802では、領域B,C,Dがこれらの条件に該当し、この領域B,C,Dをミスマッチング領域であると判定(ステップ1803)する。
【0231】
図19に戻って、さらに説明を続ける。上述のようなミスマッチング領域検出処理の結果、ミスマッチング領域が検出されなかった場合は、ステップ1704の判定がNoとなり、ステップ1705に進み、生成された距離画像が出力される。
【0232】
また、ミスマッチング領域が検出された場合は、ステップ1706に進み、新たな投光パターンの生成、または選択処理がなされ、さらにステップ1701以下の処理、すなわち新たな投光パターンに基づく距離画像生成処理、ミスマッチング領域検出処理が実行される。新たな投光パターンの生成処理は、実施例1と同様の処理であり、説明を省略する。
【0233】
なお、図19のステップ1704は、ミスマッチング領域が検出されたか否かで処理を変更する構成としてあるが、ある一定の閾値を定めて、ミスマッチング領域が設定閾値以上の量を超える場合にのみ新たな投光パターンに基づく距離画像生成処理を行なうように構成してもよい。
【0234】
本実施例の距離画像生成装置および方法によれば、生成された距離画像に基づくミスマッチング領域を検出して新たな投光パターンの設定を行なう構成であり、また、投光パターン生成手段が生成し使用されるパターンは、変化率等の各種のパターンとしての適性度を示すパターン適性度指標値に基づいて距離画像生成用投光パターンとしての適性が良好であると判定されたパターンのみとしたので、適切な距離画像の生成が可能であり、ミスマッチング領域の解消された高精度な距離画像を出力することができる。
【0235】
以上、特定の実施例を参照しながら、本発明について詳解してきた。しかしながら、本発明の要旨を逸脱しない範囲で当業者が該実施例の修正や代用を成し得ることは自明である。すなわち、例示という形態で本発明を開示してきたのであり、限定的に解釈されるべきではない。また、上述の実施例を適宜組み合わせて構成したものも、本発明の範囲に含まれるものであり、本発明の要旨を判断するためには、冒頭に記載した特許請求の範囲の欄を参酌すべきである。
【0236】
【発明の効果】
以上詳記したように、本発明によれば、投光用ランダムパターンを、パターンあるいは撮影画像に基づいて、パターンの変化率、特徴量、分散値、あるいはパターンマッチング等のパターンとしての適性度を示すパターン適性度指標値により評価することにより、適切な投光パターンを得る構成としたので、様々な測定対象に対して、適切な投光パターン画像を取得することが可能となり、高精度な距離画像が得られる。
【0237】
さらに、本発明によれば、投光パターンを、パターンあるいはその撮影画像に基づいて評価・検討して、ミスマッチングの発生が抑制された適正な投光パターン照射画像についての距離画像生成を可能としたので、より高精度な距離画像を得ることができ、ミスマッチングが多く発生するような投光パターン画像についての対応点付け処理、距離画像生成処理を行なう以前に、適切な投光パターンを選択することが可能となるので、処理の複雑な対応点付け処理、距離画像生成処理を何度も繰り返して行なう必要なく1回のみの処理で高精度な距離画像を得ることができる。
【0238】
さらに、本発明によれば、生成された距離画像に基づくミスマッチング領域を検出して新たな投光パターンの設定を行なう構成とし、変化率等の各種のパターンとしての適性度を示すパターン適性度指標値に基づいて距離画像生成用投光パターンとしての適性が良好であると判定されたパターンのみを使用するように構成したので、ミスマッチング領域の解消された高精度な距離画像を出力することが可能となる。
【図面の簡単な説明】
【図1】本発明において使用される三次元情報取得構成として適用可能なステレオ画像法について説明した図である。
【図2】本発明のランダムパターン生成装置を適用した距離画像生成装置の一実施例の構成を示すブロック図である。
【図3】本発明における投光パターン生成及び照射手段において用いられる非周期投光パターンの例を示す図である。
【図4】本発明における投光パターン生成及び照射手段の構成例を示す図である。
【図5】本発明のランダムパターン生成装置の構成ブロック図である。
【図6】本発明のランダムパターン生成装置の投光パターン生成処理フローを説明する図である。
【図7】本発明のランダムパターン生成装置における投光パターン評価処理フロー(その1)を説明する図である。
【図8】本発明のランダムパターン生成装置における投光パターン評価処理フロー(その2)を説明する図である。
【図9】本発明のランダムパターン生成装置における投光パターン評価処理フロー(その3)を説明する図である。
【図10】本発明のランダムパターン生成装置の濃淡投光パターン生成処理フローを説明する図である。
【図11】本発明のランダムパターン生成装置における濃淡投光パターン評価処理フローを説明する図である。
【図12】本発明のランダムパターン生成装置において生成した投光パターンによる距離画像生成例(その1)を示す図である。
【図13】本発明のランダムパターン生成装置において生成した投光パターンによる距離画像生成例(その2)を示す図である。
【図14】本発明の距離画像生成装置の一実施例(実施例1)の構成を示すブロック図である。
【図15】本発明の距離画像生成装置の投光パターン生成手段、投光パターン評価手段の詳細構成を示す図である。
【図16】本発明の距離画像生成装置における距離画像生成処理のフローチャートを示す図である。
【図17】本発明の距離画像生成装置における投光パターン生成手段、投光パターン評価手段の処理過程を説明する図である。
【図18】本発明の距離画像生成装置の一実施例(実施例2)の構成を示すブロック図である。
【図19】本発明の距離画像生成装置の処理フローを示す図である。
【図20】本発明の距離画像生成装置におけるミスマッチング領域の検出処理フローを示す図である。
【図21】本発明の距離画像生成装置における距離画像に基づくラベリング処理の処理フローを示す図である。
【符号の説明】
201…基準カメラ
202…参照カメラ
203,204…フレームメモリ
205…画像間対応付け手段
206…距離画像生成手段
207…画像メモリ
208…出力手段
220…投光パターン生成及び照射手段
401…制御手段
402…カメラ1(基準カメラ)
403…カメラ2(参照カメラ)
404…画像メモリ
501…一様乱数発生手段
502…正規乱数発生手段
503…画像生成手段
504…二値画像生成手段
505…変化率検出手段
506…変化率判定手段
507…標準偏差設定手段
508…閾値設定手段
1210…投光パターン評価手段
1211…投光パターン生成手段
1212…投光パターン照射手段
1301…一様乱数発生手段
1302…正規乱数発生手段
1303…画像生成手段
1304…二値画像生成手段
1305…標準偏差設定手段
1306…閾値設定手段
1307…液晶制御手段
1308…撮影画像変化率検出手段
1309…変化率判定手段
1601…ミスマッチング領域検出手段
1602…投光パターン生成手段
1603…投光パターン照射手段[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a random pattern generation device and method for determining the three-dimensional shape of an object, a distance image generation device and method, and a program providing medium. In particular, a method for measuring the three-dimensional shape of the surface of an object using images obtained by photographing an object existing in a distance range in a three-dimensional space from a plurality of different positions, that is, a random pattern generation apparatus suitable for a stereo image method and the method thereof The present invention relates to a distance image generating apparatus and method, and a program providing medium.
[0002]
[Prior art]
Conventional methods for obtaining a three-dimensional shape of an object are roughly classified into an active method (active method) and a passive method (passive method). Active methods include projecting light and measuring the time it takes for the light to be reflected and returning, as well as obtaining the distance to each object to be measured, or applying slit-shaped pattern light to the object to be measured. There is a method such as a light cutting method in which a three-dimensional shape is measured by examining the shape of the pattern light projected to the measurement object.
[0003]
A typical passive method is a stereo image method that uses the principle of triangulation, which uses two or more cameras to find the corresponding points between the images, finds the parallax, This is a method of measuring distance.
[0004]
The principle of the stereo imaging method will be briefly described. The stereo image method uses a plurality of cameras to associate the pixels in a plurality of images obtained by photographing the same object from two or more viewpoints (different gaze directions), thereby positioning the measurement object in a three-dimensional space. Is to seek. For example, the same object is photographed from different viewpoints by a standard camera and a reference camera, and the distance of the measurement object in each image is measured by the principle of triangulation.
[0005]
FIG. 1 is a diagram for explaining the principle of the stereo imaging method. The reference camera (Camera 1) and the reference camera (Camera 2) capture the same object from different viewpoints. Consider obtaining the depth of a point “mb” in an image taken by a reference camera.
[0006]
The objects that appear at the point “mb” in the image captured by the reference camera are “m1”, “m2”, and “m3” in the image captured by the reference camera that captures the same object from different viewpoints. It will be developed on a straight line. This straight line is referred to as an epipolar line Lp.
[0007]
The position of the point “mb” in the reference camera appears on a straight line called “epipolar line” in the image by the reference camera. As long as the point P to be imaged (a point existing on a straight line including P1, P2, and P3) exists on the line of sight of the reference camera, regardless of the depth, that is, the distance from the reference camera, on the reference image It appears at the same observation point “mb”. On the other hand, the point P on the image captured by the reference camera appears on the epipolar line at a position corresponding to the distance between the reference camera and the observation point P.
[0008]
FIG. 1 illustrates the correspondence between the epipolar line and the observation point “mb” in the reference image. As shown in the figure, as the position of the observation point P changes to P1, P2, and P3, the observation point in the reference image shifts to “m1”, “m2”, and “m3”.
[0009]
The distance of the point P can be identified by searching the observation point “mb” on the epipolar line using the above geometric optical properties. This is the basic principle of the “stereo imaging method”. In this way, three-dimensional information about all pixels on the screen is acquired. The acquired three-dimensional information can be used as pixel attribute data corresponding to each pixel.
[0010]
The stereo image method described above has a configuration using one reference camera and one reference camera. However, an evaluation value is obtained by a multi-baseline stereo method using a plurality of reference cameras, You may comprise so that the three-dimensional information for every pixel may be acquired based on an evaluation value. In the multi-baseline stereo image method, images obtained by one reference camera and a plurality of reference cameras are used, evaluation values representing correlations with the reference camera images are obtained for each of the plurality of reference camera images, and the respective evaluation values are obtained. Addition is performed, and the addition value is used as a final evaluation value. Details of the multi-baseline stereo imaging method are described in, for example, “Stereo matching using a plurality of baseline lengths”, IEICE Transactions D-11 Vol. J75-D-II No. 8 pp. 1317-1327, August 1992.
[0011]
As described above, the stereo imaging method associates pixels in a plurality of images obtained by photographing the same object from two or more viewpoints (different gaze directions) using a plurality of cameras. By performing “scoring”, the position of the measurement object in the three-dimensional space is determined.
[0012]
Conventionally, the method of “corresponding points” that is often used is roughly divided into Pixel-based matching, Area-based matching, and Feature-based matching. Pixel-based matching is a method in which correspondence between points in one image is searched as it is in the other image (C. Lawrence Zitnick and Jon A. Webb: Multi-baseline Stereo Usage Surface Re-Technology, Tec. CS-96-196,
(1996)).
[0013]
Area-based matching is a method of searching for a correspondence of a point in one image using a local image pattern around the point when searching in the other image (Okutomi, Kaide: multiple baselines) Stereo matching using the head, IEICE Transactions D-II, Vol. J75-D-II, No. 8, pp. 1317-1327, (1992), Yokoyama, Miwa, Kasumigahara, Koyanazu, Hayashi , After: Stereo Camera System and Its Application, SRF '97, (1997), Kinade, Kimura: Video rate stereo machine, Journal of the Robotics Society of Japan, Vol.13, No.3, pp.322-326 (1995) ), Kaide, Mosquito field, Kimura, Kawamura, Yoshida, Oda: Development of video rate stereo machine, Nippon Vol.15, No.2, pp.261-267, (1997), Yamaguchi, Takachi, Iguchi: Stereo correspondence for stone image measurement using adaptive window method, humanities and computer, Vol. 32, No. 10, pp. 55-60, (1996), Yokoya: Recent Special Issue on Signal Processing Recent Topics in Computer Vision, System / Control / Information, Vol.38, No.8, pp.436 ~ 441, (1994)).
[0014]
Feature-based matching is a method of extracting features such as shading edges from images and performing association using only features between images (H. H. Baker and TO B. Inford: Depth from edge intensity). based stereo, In Proc. IJCAI '81, (1981), Ishiyama, Kakuho, Kawai, Ueshiba, Tomita: Search for corresponding candidates in segment-based stereo, IEICE Technical Report, Vol. 96, No. 136, (1997), W. E. L. Grimson: Computational experience with a feature based stereo algorithm, IEEE Trans. PAMI, Vol. 17-34, (1985)).
[0015]
The characteristics of the above methods are summarized as follows.
(1) Since Pixel-based matching and Area-based matching search for corresponding points for each pixel, the obtained distance image is dense. On the other hand, in Feature-based matching, since only the feature points are associated, the obtained distance image is sparse.
[0016]
(2) Area-based matching performs a kind of correlation operation, and thus requires a calculation cost as compared with Pixel-based matching and Feature-based matching, but is not necessarily a problem that cannot be solved by increasing the algorithm speed.
[0017]
(3) Pixel-based matching performs only association between pixels, and thus has a considerably high calculation speed. However, association using gray values between pixels is not easy due to a difference in characteristics between the left and right cameras.
[0018]
From the above-mentioned features, in general, Area-based matching is effective and often used as a method for obtaining a three-dimensional shape (or depth) of an object for each pixel with high accuracy.
[0019]
Corresponding point marking processing in the stereo image method is performed by the various methods described above. However, it is necessary to measure a three-dimensional shape with any of the above-described methods for an object having almost no features (shading, shape, color, etc.) such as a white wall or a human face. Corresponding point marking processing becomes difficult. This is one big problem in the processing by the stereo image method.
[0020]
Periodic patterns such as checkers and frequency-modulated sine waves are used in order to more accurately perform matching processing on objects that have almost no features (such as shading, shape, and color) such as white walls and human faces. Several techniques have been disclosed for reducing image matching errors by multi-baseline stereo systems by projecting light (SB Kang, JA Webb, CL Zitnick and T. Kanade). : A Multibaseline Stereo System with Active Illumination and Real-time Image Acquisition, Proc IEEE Int Conf. Comput. Vis., Vol. guchi and S.K.Nayar:... Microscopic Shape from Focus Using Active Illumination, Proc Int Conf Pattern Recogn, Vol.12, No.Vol 1, pp.147~152, (1994) see).
[0021]
[Problems to be solved by the invention]
However, with the above-described conventional method, it is impossible to achieve complete removal of errors in matching processing, that is, mismatching. In addition, the configuration in which the above-described frequency-modulated periodic pattern is projected and the association process is performed reduces the mismatch region in a multi-baseline stereo machine using a plurality of (three or more) cameras. Although it is effective for two-lens stereo vision using two cameras, an error may occur in matching similar patterns because the generated pattern is periodic, There is a drawback that it is not always effective.
[0022]
Therefore, for example, we have proposed a configuration that enables high-accuracy range image generation by generating a non-periodic projection pattern using random numbers and projecting this random pattern onto the measurement target. Filed in Japanese Patent Application No. 11-269838).
[0023]
As described above, according to the measurement method in which a non-periodic random pattern is projected onto an object having no pattern and the association process is performed, there are almost no features (shading, shape, color, etc.) such as a white wall or a human face. The associating process with respect to the object is performed more accurately, and the distance image generation is performed with high accuracy.
[0024]
However, even when a non-periodic pattern is projected, depending on the shape of the measurement target or the positional relationship between the measurement target, the random pattern projection unit, and the imaging device, etc., it is repeated with a certain period on the shooting screen. In some cases, a pattern may be generated. In such a case, the association processing becomes difficult, and the distance image generation may be hindered. Even when an aperiodic random pattern is projected, whether or not the projected result includes a repetitive pattern cannot be determined unless it is actually projected.
[0025]
There is also a system that performs measurement by sequentially projecting multiple types of random patterns. In this case as well, it can be expected that a portion that cannot be measured well by using a plurality of random patterns can be reduced, but it is not possible to make up for all the portions that cannot be measured well with several predetermined patterns. It is also difficult to keep up with various environmental changes including camera placement.
[0026]
The present invention has been made in view of the above-described problems, and relates to a random pattern generation device and method, a distance image generation device and method, and a program providing medium in a distance image generation method according to a stereo image method. The present invention provides a random texture in which mismatching regions are unlikely to occur in the corresponding scoring process, for example, a non-periodic random image pattern configuration composed of binary or shaded random point groups and a generation method thereof.
[0027]
Furthermore, the present invention provides a new random light to be projected based on an image photographed by pattern projection so that the pattern on the measurement object is appropriate, that is, mismatching does not occur in the matching process. The present invention provides a distance image generation apparatus and method that reduce the occurrence of mismatching regions by determining a pattern.
[0028]
Furthermore, the present invention is configured to generate a pattern based on an image photographed by pattern projection so that the pattern on the measurement target is appropriate, that is, no mismatching occurs in the corresponding marking process. Specifically, for example, stereo cameras are not good at patterns that are repeated at regular intervals, so the projection result is calculated so that it does not have repetitive components, an appropriate random pattern is created, and the distance image is projected Provides a configuration for generating
[0029]
[Means for Solving the Problems]
  The present invention has been made in consideration of the above problems, and the first aspect thereof is
  Followed stereo imagingIn a random pattern generation device that generates a light projection pattern that projects a measurement target in measurement of a three-dimensional shape,
  A projection pattern generating means capable of generating a plurality of different aperiodic projection patterns using random numbers;
  A projection pattern evaluation unit that performs evaluation of the projection pattern generated in the projection pattern generation unit;
  The light projection pattern evaluation unit calculates a pattern suitability index value indicating the suitability of the light projection pattern generated by the light projection pattern generation unit based on the generated light projection pattern, and calculates the pattern suitability By comparing the index value with a predetermined threshold, it is possible to determine whether or not the generated projection pattern is suitable as a projection pattern for three-dimensional shape measurement.And
The light projection pattern evaluation means includes:
(1) a change rate indicating a periodic change in pixel values constituting a light projection pattern;
(2) a feature amount calculated from an eigenvalue of a feature matrix based on a pixel value of an image constituting a projection pattern;
(3) An inter-region correlation value indicating the similarity between different partial regions constituting the projection pattern,
(4) The dispersion value of the image constituting the projection pattern,
The value of any one of (1) to (4) is calculated as the pattern suitability index value, and the generated light projection pattern is projected for three-dimensional shape measurement by comparing the calculated value with a predetermined threshold value. It is a configuration that determines whether or not it has suitability as a patternThe present invention resides in a random pattern generation device.
[0030]
Furthermore, in one embodiment of the random pattern generation device of the present invention, the projection pattern generation means has a configuration for generating different aperiodic projection patterns by changing a standard deviation s that defines a normal random number. When the generated light projection pattern is determined not to be suitable as a light projection pattern for three-dimensional shape measurement in the light projection pattern evaluation unit, a new aperiodic pattern in which the standard deviation s is changed is determined. It has the structure which produces | generates a light projection pattern.
[0031]
Furthermore, in one embodiment of the random pattern generation device of the present invention, the projection pattern generation means has a configuration for generating a binary image obtained by binarizing an image composed of normal random numbers using a threshold T, and By changing the threshold value T, a different aperiodic projection pattern is generated, and the generated projection pattern is suitable as a projection pattern for three-dimensional shape measurement in the projection pattern evaluation unit. When it is determined that the threshold value T is not included, a new aperiodic projection pattern in which the threshold value T is changed is generated.
[0032]
Furthermore, in one embodiment of the random pattern generation device of the present invention, the projection pattern generation unit has a configuration for generating a grayscale image based on a normal random number, and the generated projection pattern is the projection pattern evaluation unit. When it is determined that the projection pattern is not suitable as a projection pattern for measuring a three-dimensional shape, it has a configuration for generating a new aperiodic projection pattern in which a parameter defining a normal random number is changed. To do.
[0037]
Furthermore, in one embodiment of the random pattern generation device of the present invention, the projection pattern evaluation unit extracts at least one or more windows that are partial areas from the projection pattern generated by the projection pattern generation unit, and the pattern The configuration is characterized in that the aptitude index value is calculated.
[0038]
  Furthermore, the second aspect of the present invention provides
  Followed stereo imagingIn a random pattern generation method for generating a light projection pattern to be projected onto a measurement object in measurement of a three-dimensional shape
(A) a projection pattern generation step of generating an aperiodic projection pattern using random numbers;
(B) an evaluation step for evaluating the projection pattern generated in the projection pattern generation step;
  (C) A pattern suitability index value indicating the suitability of the projection pattern generated in the projection pattern generation step as the patternAs
(1) a change rate indicating a periodic change in pixel values constituting a light projection pattern;
(2) a feature amount calculated from an eigenvalue of a feature matrix based on a pixel value of an image constituting a projection pattern;
(3) An inter-region correlation value indicating the similarity between different partial regions constituting the projection pattern,
(4) The dispersion value of the image constituting the projection pattern,
Any one of the above values (1) to (4)A pattern suitability index value calculating step for calculating based on the generated projection pattern;
  (D) an aptitude determination step for determining whether or not the generated light projection pattern has suitability as a three-dimensional shape measurement light projection pattern by comparing the calculated pattern suitability index value with a predetermined threshold;
  An evaluation step including:
  Until it is determined that there is appropriateness in the suitability determination step, different projection patterns are generated in step (a), and steps (a) to (d) are repeatedly executed.
  In the random pattern generation method, the light projection pattern determined to be appropriate in the suitability determination step in the evaluation step is used as a light projection pattern for three-dimensional shape measurement.
[0047]
  Furthermore, the third aspect of the present invention provides
  In a distance image generation device that generates a distance image by measuring a three-dimensional shape of the measurement object using images taken from different viewpoints,
  A projection pattern generating means capable of generating a plurality of different aperiodic projection patterns using random numbers;
  A reference camera for capturing a projection pattern image of the measurement target;
  A reference camera that captures a projection pattern image at a different viewpoint from the reference camera;
  Evaluate the pattern suitability of at least one of the projection pattern images captured by the reference camera or the reference camera, and evaluate whether it is suitable as a projection pattern image for generating a distance image. Light projection pattern evaluation meansAs a pattern suitability index value indicating the suitability of the light projection pattern,
(1) a change rate indicating a periodic change in pixel values constituting a light projection pattern;
(2) a feature amount calculated from an eigenvalue of a feature matrix based on a pixel value of an image constituting a projection pattern;
(3) An inter-region correlation value indicating the similarity between different partial regions constituting the projection pattern,
(4) The dispersion value of the image constituting the projection pattern,
By calculating one of the above values (1) to (4) and comparing the calculated pattern suitability index value with a predetermined threshold value, the generated light projection pattern becomes a three-dimensional shape measurement light projection pattern. A projection pattern evaluation means for determining whether or not it has aptitude,
  An image-to-image association unit that detects correspondence between the projection pattern images captured by the reference camera and the reference camera and outputs parallax data;
  Distance image generating means for generating a distance image based on the parallax data output by the image correlation means;
  When the projection pattern image obtained based on the generated projection pattern is determined not to be suitable as the projection pattern image for distance image generation by the projection pattern evaluation unit, Generate a periodic flood pattern,
  The inter-image association unit and the distance image generation unit determine that the projection pattern image obtained based on the generated projection pattern is appropriate as the projection pattern image for generating the distance image by the projection pattern evaluation unit. The distance image generating apparatus is characterized in that the processing is executed on the condition of the above.
[0049]
Furthermore, in one embodiment of the distance image generation device of the present invention, the light projection pattern generation means has a configuration for generating different aperiodic light projection patterns by changing a standard deviation s that defines a normal random number. When the projection pattern image obtained based on the generated projection pattern is determined to be not suitable as the projection pattern for distance image generation in the projection pattern evaluation unit, the standard deviation s is changed. It has the structure which produces | generates a new aperiodic light projection pattern.
[0050]
Furthermore, in one embodiment of the distance image generating apparatus of the present invention, the projection pattern generating means has a configuration for generating a binary image obtained by binarizing an image composed of normal random numbers using a threshold T, and By changing the threshold value T, a different aperiodic projection pattern is generated, and a projection pattern image obtained on the basis of the generated projection pattern is used for distance image generation in the projection pattern evaluation unit. When it is determined that there is no suitability as a light projection pattern, a new aperiodic light projection pattern in which the threshold value T is changed is generated.
[0057]
Furthermore, the fourth aspect of the present invention provides
In a distance image generation device that generates a distance image by measuring a three-dimensional shape of the measurement object using images taken from different viewpoints,
This is a projection pattern generation means for generating a pattern to be projected onto a measurement target, and can generate a plurality of different aperiodic projection patterns using random numbers, and also shows a pattern suitability indicating the suitability of the pattern The index value is calculated based on the generated light projection pattern, and the suitability as the distance image generation light projection pattern is determined by comparing the calculated pattern suitability index value with a predetermined threshold value. A projection pattern generating means for setting only a pattern as a projection pattern;
A reference camera for capturing a projection pattern image of the measurement target;
A reference camera that captures a projection pattern image at a different viewpoint from the reference camera;
An image-to-image association unit that detects correspondence between the projection pattern images captured by the reference camera and the reference camera and outputs parallax data;
A distance image generating means for generating a distance image based on the parallax data output by the inter-image association means;
A mismatching area detecting means for detecting a mismatching area in the distance image generated by the distance image generating means;
Have
The projection image generation unit has a configuration for generating a new aperiodic projection pattern when the mismatching region detection unit detects a mismatching region equal to or greater than a predetermined threshold. In the generator.
[0066]
  Furthermore, the fifth aspect of the present invention provides
  In a distance image generation method for generating a distance image by measuring a three-dimensional shape of the measurement object using images taken from different viewpoints of the measurement object,
  A projection pattern generation step for generating a non-periodic projection pattern using random numbers;
  The projection pattern image of the measurement target,With reference cameraApply a reference camera and synchronize from different viewpointsImage capture step to capture,
  Evaluate the pattern suitability of at least one of the projection pattern images captured by the reference camera or the reference camera, and evaluate whether it is suitable as a projection pattern image for generating a distance image. Projection pattern evaluation stepAs a pattern suitability index value indicating the suitability of the light projection pattern,
(1) a change rate indicating a periodic change in pixel values constituting a light projection pattern;
(2) a feature amount calculated from an eigenvalue of a feature matrix based on a pixel value of an image constituting a projection pattern;
(3) An inter-region correlation value indicating the similarity between different partial regions constituting the projection pattern,
(4) The dispersion value of the image constituting the projection pattern,
By calculating one of the above values (1) to (4) and comparing the calculated pattern suitability index value with a predetermined threshold value, the generated light projection pattern becomes a three-dimensional shape measurement light projection pattern. Projection pattern evaluation step for determining whether or not there is suitabilityWhen,
  An image-corresponding step for detecting a correspondence between each projection pattern image captured by the reference camera and the reference camera and outputting parallax data;
  A distance image generation step for generating a distance image based on the parallax data output by the inter-image association means;
  In the projection pattern generation step, when it is determined that the projection pattern image obtained based on the generated projection pattern is not suitable as the projection pattern image for distance image generation in the projection pattern evaluation step, Repeatedly generate a periodic flood pattern,
  In the association step between images and the distance image generation step, it is determined that the projection pattern image obtained based on the generated projection pattern is appropriate as the projection pattern image for distance image generation in the projection pattern evaluation step. The distance image generation method is characterized in that the process is executed on the condition.
[0076]
  Furthermore, the sixth aspect of the present invention provides
  In a distance image generation method for generating a distance image by measuring a three-dimensional shape of the measurement object using images taken from different viewpoints of the measurement object,
  A non-periodic projection pattern using random numbers is generated, a pattern suitability index value indicating suitability as a pattern is calculated based on the generated projection pattern, and the calculated pattern suitability index value is a predetermined threshold value A light projection pattern generation step for determining suitability as a light projection pattern for distance image generation by comparing with, and setting only a pattern determined to be suitable as a light projection pattern;
  The projection pattern image of the measurement target,With reference cameraApply a reference camera and synchronize from different viewpointsImage capture step to capture,
  An image-to-image association step of detecting correspondence between each projection pattern image captured by the reference camera and the reference camera and outputting parallax data;
  A distance image generation step for generating a distance image based on the parallax data output in the inter-image association step;
  A mismatching region detection step for detecting a mismatching region in the distance image based on the projection pattern image generated in the distance image generation step;
  Have
  The light projection pattern generation step includes a new aperiodic light projection when a mismatching area equal to or greater than a predetermined threshold is detected in the mismatching area detection step in the distance image obtained based on the generated light projection pattern. A distance image generation method is characterized by generating a pattern.
[0085]
  Furthermore, the seventh aspect of the present invention provides
  A computer program for executing a projection pattern generation process used for executing a three-dimensional shape measurement for measuring a three-dimensional shape of the measurement target using images obtained by photographing the measurement target from different viewpoints on a computer system. A program providing medium provided tangibly, the computer program comprising:
(A) a projection pattern generation step of generating an aperiodic projection pattern using random numbers;
(B) an evaluation step for evaluating the projection pattern generated in the projection pattern generation step;
  (C) A pattern suitability index value indicating the suitability of the projection pattern generated in the projection pattern generation step as the patternAs
(1) a change rate indicating a periodic change in pixel values constituting a light projection pattern;
(2) a feature amount calculated from an eigenvalue of a feature matrix based on a pixel value of an image constituting a projection pattern;
(3) An inter-region correlation value indicating the similarity between different partial regions constituting the projection pattern,
(4) The dispersion value of the image constituting the projection pattern,
Any one of the above values (1) to (4)A pattern suitability index value calculating step for calculating based on the generated projection pattern;
  (D) an aptitude determination step for determining whether or not the generated light projection pattern has suitability as a three-dimensional shape measurement light projection pattern by comparing the calculated pattern suitability index value with a predetermined threshold;
  An evaluation step including:
  Until it is determined that there is appropriateness in the suitability determination step, different projection patterns are generated in step (a), and steps (a) to (d) are repeatedly executed.
  And determining a light projection pattern determined to be appropriate in the suitability determination step in the evaluation step as a light projection pattern for three-dimensional shape measurement.
[0086]
The program providing medium according to the seventh aspect of the present invention is a medium that provides a computer program in a computer-readable format to, for example, a general-purpose computer system that can execute various program codes. The form of the medium is not particularly limited, such as a storage medium such as a CD, FD, or MO, or a transmission medium such as a network.
[0087]
Such a program providing medium defines a structural or functional cooperative relationship between a computer program and a providing medium for realizing a function of a predetermined computer program on a computer system. . In other words, by installing a computer program in the computer system via the provided medium, a cooperative action is exhibited on the computer system, and the same effects as the other aspects of the present invention are obtained. Can do it.
[0088]
Other objects, features, and advantages of the present invention will become apparent from a more detailed description based on embodiments of the present invention described later and the accompanying drawings.
[0089]
DETAILED DESCRIPTION OF THE INVENTION
[Random pattern generation apparatus-Example 1]
First, FIG. 2 shows a configuration example of a distance image generation apparatus to which the random pattern generation apparatus of the present invention is applied, and an outline of the distance image generation apparatus will be described. The distance image generation apparatus measures the three-dimensional shape of the measurement target by applying the stereo image method described above, and has a three-dimensional shape, for example, an angle with respect to the measurement target object such as a human face. Images are taken using two cameras arranged at different positions, a so-called reference camera and a reference camera, and the object to be measured is based on the stereo image method described in FIG. The surface shape is measured.
[0090]
The random pattern generated by the random pattern generation device of the present invention is irradiated by the projection pattern generation and irradiation unit 220 of the distance image generation device. This projection pattern is an aperiodic projection pattern based on a uniform random number or a regular random number. The aperiodic projection pattern projected onto the measurement target 200 by the projection pattern generation and irradiation unit 220 is a pattern having no periodicity in, for example, dot size, line length, thickness, position, density, etc. For example, the pattern is as shown in FIGS. 3 (a) and 3 (b). These pattern generation methods will be described in detail later.
[0091]
The non-periodic pattern generated by the random pattern generation device of the present invention is formed in advance on a slide or the like, for example, and the pattern can be projected onto the measurement object by irradiating flash light through the slide. Alternatively, a random pattern can be dynamically generated and projected using a transmissive liquid crystal display element or the like. The dynamic random pattern generation method will be described in detail later. By capturing an aperiodic pattern formed on the surface of the measurement target 200 together with the measurement target, it is possible to easily associate the image data of the reference camera and the reference camera when generating the distance image.
[0092]
The description of the configuration of the distance image generation device of the present invention will be continued. The reference camera 201 and the reference camera 202 are arranged in different line-of-sight directions with respect to the measurement object 200, and take images of the respective line-of-sight directions, that is, the measurement object 200 onto which a random pattern is projected. Images taken by the reference camera 201 and the reference camera 202 are taken at a synchronized timing. Images captured from the reference camera 201 and the reference camera 202 are stored in the frame memories 203 and 204 via the A / D converters, respectively.
[0093]
The inter-image association unit 205 performs association processing between the projection pattern images of the base camera and the reference camera of the frame memories 1a and 203 and the frame memories 2a and 204, respectively. That is, the process of associating the pixels of the reference image captured by the reference camera 202 with the pixels of the image captured by the standard camera 201 is performed, and the parallax data of the reference image for the standard image is output to the distance image generation unit 206.
[0094]
The projection pattern generated by the projection pattern generation and irradiation unit 220 is a non-periodic pattern as described above, and the images captured by the cameras can be associated with each other relatively easily. The distance image generation unit 206 generates a distance image based on the parallax data generated by the inter-image association unit 205 and stores it in the image memory 207. The distance image stored in the image memory 207 is output via the output unit 208.
[0095]
Note that the processing in each block having the configuration shown in FIG. 2 and inter-block data transfer control are controlled by a control means (not shown) and stored in a predetermined memory, for example, a semiconductor memory such as RAM or ROM, a magnetic disk, an optical disk, or the like. It can be controlled by a control program recorded on the medium. In addition, the control mode can be changed by a user inputting a command, a parameter, or the like using an input unit (not shown).
[0096]
FIG. 4 shows a specific configuration example of the light projection pattern generation / irradiation means 220, that is, the configuration of a light projection device for an image pattern composed of random point groups, and the relationship with the image photographing device.
[0097]
Generally, when projecting a texture image pattern, the brightness of the image becomes a problem. Here, in order to obtain a sufficient amount of light, a strobe projection system is used as a light source. On the other hand, on the photographing apparatus side, the CCD accumulation time is controlled by adjusting the electronic shutters of the reference camera 402 and the reference camera 403 in order to suppress the influence of background light and improve the contrast of the projection pattern. Further, by sharing the control unit 401 between the light projecting device and the light projecting pattern generation / irradiation unit 220, the reference camera 402 is instantly used when the texture image pattern is projected by the light projection pattern generation / irradiation unit 220. The reference camera 403 captures the measurement object at the same time. Images captured by each camera are separately stored in the image memory 404 (corresponding to the frame memories 203 and 204 in FIG. 2), and are used for association processing between images and distance image generation processing.
[0098]
The slide in the projection pattern generation and irradiation unit 220 shown in FIG. 4 is a slide on which an aperiodic pattern is recorded. As described above, the dot size, line length, thickness, position, density, etc. have no periodicity, so-called non-periodic projection patterns, for example, patterns as shown in FIGS. Is a recorded slide.
[0099]
The details of the non-periodic projection pattern generation processing configuration will be described below. FIG. 5 is a block diagram showing a functional configuration of the random pattern generation device of the present invention, and FIG. 6 shows a processing flow for generating a random texture pattern that is an aperiodic projection pattern in the random pattern generation device of the present invention. Hereinafter, the random pattern generation device of the present invention will be described with reference to FIGS. 5 and 6.
[0100]
Based on the uniform random number generated by the uniform random number generating means 501 in FIG. 5, the normal random number generating means 502 generates a normal random number Rk based on a preset standard deviation s and average value am. The standard deviation s can be set to various values in the standard deviation setting means 507, and various normal random numbers can be generated in the normal random number generation means 502 based on the set standard deviation.
[0101]
The image generation unit 503 generates an image rd_im [k] based on the normal random number Rk generated by the normal random number generation unit 502.
[0102]
Next, the binary image generation unit 504 performs binarization processing of the image rd_im [k] with a predetermined threshold T, and generates a binary image f (i, j). Various values can be set for the threshold value T in the threshold value setting means 508, and various binary images can be generated in the binary image generation means 504 based on the set threshold value.
[0103]
Next, the change rate detection unit 505 obtains the change rate r of the binary image f (i, j) generated by the binary image generation unit 504, and the change rate determination unit 506 further determines the change rate detection unit 505. A comparison between the detected change rate r and a predetermined threshold value T1 is executed. The rate of change r is a value that increases when the generated binary image has no periodicity, and decreases when the periodicity has a periodicity, for example, when the pixel value includes repetition such as 010101, etc. It is an index value. The calculation formula for the rate of change r will be described in detail in the description of the flow of FIG.
[0104]
In the comparison process with the threshold value T1 of the change rate determination unit 506, when the change rate r exceeds the threshold value T1, it is determined that the random pattern has sufficient aperiodicity, and the binary image generation unit 504 is determined. The binary image generated in (1) is used as a projection pattern.
[0105]
Next, more specific processing will be described according to the flow of FIG. In step 601 of FIG. 6, a uniform random number generation process between 0 and 1 is performed and stored in the array a [n]. These are uniform random numbers that are either binary (0 or 1) or gray values (can have values between 0 and 1).
[0106]
In step 602, processing for generating a normal random number (gauss) having a standard deviation s and an average value am is performed. The normal random number Rk is generated based on the 0-1 uniform random number according to the following equation.
[0107]
[Expression 1]
Figure 0004110501
[0108]
Next, in step 603, a random texture image rd_im [k] based on normal random numbers is generated. Here, k = 0 to K−1, rd_im [k] = Rk, and K = XSIZE × YSIZE (image size).
[0109]
Further, in step 604, binarization processing of the random texture image rd_im [k] based on the normal random number generated in step 603 is performed, which is executed based on a predetermined threshold T. The binary image obtained as a result is defined as f (i, j).
[0110]
Next, in step 605, a change rate r as a pattern suitability index value of the binary image f (i, j) is calculated. The change rate r is calculated based on the following equation.
[0111]
[Expression 2]
Figure 0004110501
[0112]
In the above formula, A is a normalization coefficient.
[0113]
Next, in step 606, a comparison process between the rate of change r and a predetermined threshold value T1 is performed. If the rate of change r is greater than the threshold value T1, it is determined that the binary image has sufficient randomness. In step 607, the projection pattern image generation process is terminated.
[0114]
If the determination in step 606 is No, that is, if it is determined that the rate of change r is not greater than the predetermined threshold value T1, it is determined that the generated binary image includes a periodic component that is inappropriate for light projection, and step Proceeding to step 608, the standard deviation s or at least one of the threshold values T is changed, and the processing of step 602 and the following steps and step 604 and the subsequent steps is repeated to obtain a new binary image f (i, j). Is generated.
[0115]
Finally, at step 606, when the rate of change r> threshold value T1 becomes Yes, it is determined that the binary image is a binary image having sufficient randomness, and the process proceeds to step 607 to project the light projection pattern image. The generation process ends.
[0116]
As described above, according to the random pattern generation device and the random pattern generation method of the present invention described with reference to FIGS. 5 and 6, the threshold value for which the rate of change r of the binary image generated based on the uniform random number is determined in advance. Since it is configured to generate a random image pattern for projection by guaranteeing that it is larger than T, periodic components that cause problems in stereo image processing, that is, cause mismatching, are sufficiently removed. A good random pattern can be generated.
[0117]
[Random pattern generator-other embodiments]
Hereinafter, different aspects of the binary image pattern evaluation method in the random pattern generation apparatus and random pattern generation method of the present invention will be described with reference to FIGS. 7, 8, and 9. The evaluation of the generated binary image pattern in FIGS. 5 and 6 is performed by calculating a change rate r as a pattern suitability index value from the entire generated binary image, as shown in steps 605 and 606 in FIG. The change rate r is compared with the threshold value T1. 7 to 9, a partial area is extracted from the binary image f (x, y), the pattern suitability index value for the partial area is determined based on the change rate, the feature amount, and the determination process based on pattern matching. It is the aspect which performs.
[0118]
First, a random image pattern evaluation method using a pattern change rate parameter by extracting a pattern of a partial region (window) from a binary image f (x, y) will be described with reference to FIG.
[0119]
In step 701 in FIG. 7, a binary image f (x, y) having a size of XSIZE × YSIZE is acquired. For example, the random pattern shown in the upper right of FIG.
[0120]
In step 702, the size of the window to be applied as the evaluation reference size: Nx × Ny is set. For example, it is an Nx × Ny window shown in the lower right of FIG. In step 703, coordinates xm and ym for setting the window position are set. These coordinates are set as x coordinate value: xm = Nx / 2 and y coordinate value: ym = Ny / 2.
[0121]
Next, in step 704, a window change rate γm defined by (xm, ym) is obtained according to the following equation.
[0122]
[Equation 3]
Figure 0004110501
[0123]
Next, in step 705, the change rate γm as the window pattern suitability index value defined by (xm, ym) is compared with a predetermined threshold T2, and the change rate γm is greater than the threshold T2. If so, it is determined that the window is a binary image having sufficient randomness. In step 706, it is determined whether there is a window area to be compared. If there is, the process proceeds to step 708. , Xm, ym are updated, and a new window area change rate is calculated and compared with a threshold value.
[0124]
If the determination in step 705 is No, that is, if it is determined that the rate of change γm is not greater than the predetermined threshold value T2, it is determined that the window in the generated binary image includes a periodic component that is inappropriate for light projection. Then, the process proceeds to step 707, where it is determined that the projection pattern is inappropriate, and in step 709, the evaluation process is terminated.
[0125]
When it is determined that the projection pattern is inappropriate as described above, if a new random pattern is required, the standard deviation s or the threshold value T is changed in step 608 of FIG. 6 described above. Thus, a process for generating a new binary image f ′ (x, y) is performed.
[0126]
In the flow of FIG. 7, when all the evaluation determinations in Step 705 are Yes and the evaluation window is completed, the process proceeds to Step 709, where the evaluation is completed, and the generated binary image f (x, y) is the projection pattern. As appropriate.
[0127]
Next, a method for evaluating a random image pattern using a pattern feature value parameter by extracting a pattern of a partial region (window) from the binary image f (x, y) will be described with reference to FIG.
[0128]
In step 801 of FIG. 8, a binary image f (x, y) having a size of XSIZE × YSIZE is acquired. For example, the random pattern shown in the upper right of FIG.
[0129]
In step 802, a window size: Nx × Ny to be applied is set as the evaluation reference size. For example, an Nx × Ny window shown in the lower right of FIG. In step 803, coordinates xm and ym for setting the position of the window are set. These coordinates are set as x coordinate value: xm = Nx / 2 and y coordinate value: ym = Nn / 2.
[0130]
Next, in step 804, a window feature matrix R defined by (xm, ym) is obtained according to the following equation.
[0131]
[Expression 4]
Figure 0004110501
[0132]
Next, in step 805, eigenvalues: λm1 and λm2 of the feature matrix R are obtained, and in step 806, the pattern suitability index obtained from the eigenvalues of the window feature matrix R defined by (xm, ym): λm1, λm2. The feature amount as a value: λ = min (λm1, λm2) is compared with a predetermined threshold value λT, and if the feature amount: λ is larger than the threshold value λT, the window has sufficient randomness. In step 807, it is determined whether or not there is a window area to be compared. If so, the process proceeds to step 809, where xm and ym are updated to obtain a new window area. The feature amount is calculated and compared with a threshold value.
[0133]
If the determination in step 806 is No, that is, if it is determined that the feature amount λ is not larger than the predetermined threshold λT, the window in the generated binary image includes a periodic component that is inappropriate for light projection. In step 808, it is determined that the light projection pattern is inappropriate. In step 810, the evaluation process ends.
[0134]
When it is determined that the projection pattern is inappropriate as described above, if a new random pattern is required, the standard deviation s or the threshold value T is changed in step 608 of FIG. 6 described above. Thus, a process for generating a new binary image f ′ (x, y) is performed.
[0135]
In the flow of FIG. 8, when all the evaluation determinations in step 806 are Yes and the evaluation window is completed, the process proceeds to step 810, the evaluation is completed, and the generated binary image f (x, y) is the projection pattern. As appropriate.
[0136]
Next, referring to FIG. 9, a method of extracting a plurality of partial region (window) patterns from the binary image f (x, y) and evaluating a random image pattern using a matching score between windows. explain. In the processing flow of FIG. 7 and FIG. 8 described above, the image characteristics in one partial area are evaluated. Here, it is determined whether there is a similar pattern between different partial areas, and the similarity is determined. When it is determined that there is a pattern, it is determined that the light projection pattern is inappropriate.
[0137]
In step 901 of FIG. 9, a binary image f (x, y) having a size of XSIZE × YSIZE is acquired.
[0138]
In step 902, the size of the window to be applied as the evaluation reference size: Nx × Ny is set. For example, it is an Nx × Ny window shown in the lower right of FIG. In this case, the windows to be compared are also set as windows of the same size. In step 903, coordinates xm and ym for setting the position of the window are set. These coordinates are set as x coordinate value: xm = Nx / 2 and y coordinate value: ym = Nn / 2.
[0139]
Next, in step 904, the inter-region correlation value between the patterns P1 (i, j) and P2 (i, j) of the two windows in the image is obtained as a pattern suitability index value according to the following equation.
[0140]
[Equation 5]
Figure 0004110501
[0141]
Next, in step 905, the correlation value rm as the pattern suitability index value obtained according to the above equation is compared with a predetermined threshold value T3. If the correlation value rm is smaller than the threshold value T3, step 904 is executed. In step 906, it is determined whether or not there is a window area to be compared. In step 908, the two windows compared in step 908 are determined to be images having no inappropriate similar pattern. Then, xm and ym are updated, a new window area is set, and the pattern matching process in step 904 and subsequent steps is performed.
[0142]
When the determination in step 905 is No, that is, when it is determined that the correlation value rm is not smaller than the predetermined threshold value T3, it is determined that the two windows compared in step 904 have inappropriate similar patterns, and step 907 In step 909, the evaluation process is terminated.
[0143]
When it is determined that the projection pattern is inappropriate as described above, if a new random pattern is required, the standard deviation s or the threshold value T is changed in step 608 of FIG. 6 described above. Thus, a process for generating a new binary image f ′ (x, y) is performed.
[0144]
In the flow of FIG. 9, when all the evaluation determinations in step 905 are Yes and the evaluation window is completed, the process proceeds to step 909, where the evaluation is completed, and the generated binary image f (x, y) is the projection pattern. As appropriate.
[0145]
In the above, an example in which a pattern based on a binary image is projected has been described. However, an example of pattern generation processing and a pattern evaluation method in the case of projecting a light and shade pattern instead of a binary image will be described below.
[0146]
First, FIG. 10 shows a processing flow for generating a random pattern using a grayscale image. Each step of the flow of FIG. 10 will be described. First, in step 1001 and step 1002, the initial values of the coordinate values of the image area for generating the light and shade pattern are set as i = 0 and j = 0.
[0147]
Next, in step 1003, a uniform random number between 0 and 1 is generated and stored as an array a [n]. Further, in step 1004, a normal random number R having a standard deviation s and an average value am is generated based on the uniform random number array a [n] generated in step 1003, and corresponds to the set coordinates (i, j). The grayscale data is set as R = f (i, j). This is the gray value of the coordinates (i, j).
[0148]
In step 1005 and step 1006, the coordinates where the gray value is set are compared with the set size of the projection pattern image to determine the presence / absence of the gray value non-set area. If there is an unset area, the coordinates are updated in step 1007 and step 1008, respectively, and the processing after step 1003 is repeatedly executed to set the gray value of each coordinate based on a random number. When the gray values of all the coordinates included in the area of XSIZE × YSIZE are determined, the process proceeds to step 1009, and the process of generating the light projection pattern composed of the gray data is completed.
[0149]
Various methods can be applied as a random number generation method. The method shown in the flow of FIG. 10 is merely an example, and the random number generation method applied to the present invention is not limited to the method shown in FIG.
[0150]
Since the random pattern generated according to the flow of FIG. 10 has a gray value instead of a binary image pattern, it is necessary to evaluate the suitability of the pattern as a gray pattern image.
[0151]
FIG. 11 shows an evaluation process flow of a light projection pattern having a gray value. 11 extracts, for example, a partial area (window) pattern shown in the lower right of FIG. 11 from the gray image f (x, y) shown in the upper right of FIG. 11 to obtain a dispersion value, and evaluates the gray image pattern. It shows how to do.
[0152]
In step 1101 of FIG. 11, a grayscale image f (x, y) having a size of XSIZE × YSIZE is acquired. For example, the shading pattern shown in the upper right of FIG.
[0153]
In step 1102, a window size to be applied as the evaluation reference size: Nx × Ny is set. For example, it is an Nx × Ny window shown in the lower right of FIG. In step 1103, coordinates xm and ym for setting the position of the window are set. These coordinates are set as x coordinate value: xm = Nx / 2 and y coordinate value: ym = Ny / 2.
[0154]
Next, in step 1104, a dispersion value σm in the window defined by (xm, ym) is obtained according to the following equation.
[0155]
[Formula 6]
Figure 0004110501
[0156]
Next, in step 1105, the variance value σm as the pattern suitability index value indicating the suitability as the window pattern defined by (xm, ym) is compared with a predetermined threshold value σT to perform dispersion. If the value σm is larger than the threshold σT, it is determined that the window is a gray image having sufficient randomness, and it is determined in step 1106 whether there is a window area to be compared. In step 1108, xm and ym are updated, and a new dispersion value of the window area is calculated and compared with a threshold value.
[0157]
If the determination in step 1105 is No, that is, if it is determined that the variance value σm is not greater than the predetermined threshold σT, it is determined that the window in the generated grayscale image is inappropriate for light projection, and step 1107 In step 1109, the evaluation process is terminated.
[0158]
Thus, when it is determined that the light projection pattern is inappropriate, if a new random pattern is necessary, the standard deviation s is changed in step 1004 of FIG. Grayscale image generation processing can be performed.
[0159]
In the flow of FIG. 11, when all the evaluation determinations in step 1105 are “Yes” and the evaluation window is completed, the process proceeds to step 1109, where the evaluation is completed, and the generated grayscale image f (x, y) is used as the projection pattern. Judge that it is appropriate.
[0160]
FIG. 12 is a diagram showing an example in which a distance image is obtained from two observed images by projecting the projection image pattern generated by the above-described method onto a target (plane). FIG. 12A shows a light projection image pattern composed of random point groups generated according to the above-described random pattern generation method of the present invention. FIGS. 12B and 12C are images observed by a camera 1 and a camera 2 (for example, a standard camera and a reference camera), respectively, by projecting the pattern onto a plain wall as a measurement target.
[0161]
FIG. 12D is a distance image of the plain wall that is the measurement target obtained as a result. This distance image uses a pattern in an arbitrary Nx × Ny window in the reference camera image, and is associated with an epipolar line in the reference camera image, that is, similar to a pattern in an arbitrary Nx × Ny window in the reference camera image. This is a distance image obtained based on the parallax data obtained by obtaining parallax data by determining in which part on the epipolar line of the reference camera image the pattern appears. In the distance image of FIG. 12 (d), uniform distance data is reflected on the plain wall that is the measurement target, and this result shows that the random image generated according to the random pattern generation method of the present invention is measured even when the measurement target is a plain wall. It shows that the distance to the camera is accurately measured by projecting a projection image pattern made up of point clouds.
[0162]
FIG. 13 is a conceptual diagram schematically showing an example of a distance image measurement result obtained from a stereo image observed by a reference camera and a reference camera by projecting an image pattern composed of the above-mentioned random point cloud onto a face. It is.
[0163]
FIG. 13A shows an image pattern for projection composed of random point groups generated according to the above-described random pattern generation method of the present invention. FIG. 13B is a schematic diagram in which the pattern is projected onto the face to be measured.
[0164]
FIGS. 13C and 13D are images obtained by projecting a projection image pattern onto the face to be measured and observed by the reference camera and the reference camera, respectively.
[0165]
FIG. 13E shows a distance image of the face to be measured as a result. This distance image is a conceptual diagram that is abstractly shown for explanation, and is different from an actual image, but when a projection image pattern composed of random point groups generated according to the random pattern generation method of the present invention is projected In the corresponding point marking process, the possibility of mismatching is reduced, and an accurate distance is required on almost all surfaces of the measurement target. That is, it is possible to obtain a highly accurate distance image in which shades corresponding to the distance from the reference camera to each part of the face to be measured are shown. By using the random pattern generation method of the present invention, mismatching occurs in the matching process between the reference camera image and the reference camera image even if the measurement object is an object whose feature is not clear, such as a human face. The possibility is reduced, and the distance image (or three-dimensional shape) can be generated with high accuracy.
[0166]
In the above-described embodiment, a configuration has been described in which two cameras are used to capture an image, and a distance image is obtained from two projection pattern images. However, a multi-baseline stereo system using three or more cameras is further described. It is also possible to apply this embodiment in (for example, disclosed in JP-A-10-289315). Also, the random pattern generation apparatus and method of the present invention can be applied to a case where stereo shooting is performed using a camera group in which each unit can be moved freely instead of a fixed camera unit group. is there.
[0167]
[Distance Image Generating Device—Embodiment 1]
Next, a distance image generation device and a distance image generation method to which the above-described random pattern generation device and method are applied will be described.
[0168]
FIG. 14 is a block diagram showing the configuration of the distance image generating apparatus according to the present invention. The distance image generation apparatus measures the three-dimensional shape of the measurement target by applying the stereo image method described above, and has a three-dimensional shape, for example, an angle with respect to the measurement target object such as a human face. Images are taken using two cameras arranged at different positions, a so-called reference camera and a reference camera, and the object to be measured is based on the stereo image method described in FIG. Measure the surface shape.
[0169]
The random pattern generation device of the present invention described above corresponds to the light projection pattern generation device 1211 in FIG. The random pattern generated by the light projection pattern generation device 1211 is irradiated by the light projection pattern irradiation unit 1212. This projection pattern is an aperiodic projection pattern based on a uniform random number or a regular random number.
[0170]
The light projection pattern evaluation unit 1210 evaluates at least one of the light projection pattern images photographed by the standard camera 201 and the reference camera 204. This image evaluation is performed by using the configuration of FIG. 5 described in the description of the random pattern generation device described above and the evaluation pattern in FIGS. 6 to 9 for the projection pattern image captured by the reference camera 201 or the reference camera 204. It is applied to and executed. Alternatively, a grayscale image can be used as the projection pattern, and generation and evaluation of the projection pattern may be executed according to the processes of FIGS. 10 and 11.
[0171]
That is, for example, when the light projection pattern evaluation unit 1210 evaluates the light projection pattern image captured by the reference camera 201 in FIG. 14 according to the evaluation flow in FIG. 6, the images from the frame memories 1a and 203 are displayed in FIG. The captured image p (i, j) or the binary image p ′ (i, j) obtained by processing the captured image p (i, j) with a predetermined threshold value Tp in accordance with step 605 of the evaluation flow of The change rate r is calculated as a pattern suitability index value indicating the suitability of the pattern, and a comparison with the threshold value in step 606 is executed to determine whether or not the light projection pattern is appropriate.
[0172]
When the projection pattern image photographed by the standard camera 201 or the reference camera 204 is evaluated according to the evaluation flow of FIG. 7 described above, the captured image p (i, j) or the captured image p is used. The following steps 702 to 709 shown in FIG. 7 are executed with the binary image p ′ (i, j) obtained by processing (i, j) with a predetermined threshold Tp as a binary image shown in step 701. Then, the change rate rm of each window is calculated as a pattern suitability index value indicating the suitability of the pattern, and evaluation is performed.
[0173]
When the projection pattern image photographed by the standard camera 201 or the reference camera 204 is evaluated according to the evaluation flow of FIG. 8 described above, the captured image p (i, j) or the captured image p is used. The following steps 802 to 810 shown in FIG. 8 are executed with the binary image p ′ (i, j) obtained by processing (i, j) with a predetermined threshold Tp as a binary image shown in step 801. Thus, the eigenvalue of the feature matrix R of each window is obtained as a pattern suitability index value indicating the suitability of the pattern, and this is compared with a threshold value for evaluation.
[0174]
When the projection pattern image photographed by the standard camera 201 or the reference camera 204 is evaluated according to the evaluation flow of FIG. 9 described above, the captured image p (i, j) or the captured image p is used. The following steps 902 to 909 shown in FIG. 9 are executed with the binary image p ′ (i, j) obtained by processing (i, j) with a predetermined threshold Tp as a binary image shown in step 901. Then, a matching rate between different windows is obtained, and this is evaluated by comparing it with a threshold value as a pattern suitability index value indicating the suitability of the pattern.
[0175]
In addition to the above, evaluation using the dispersion value of the pattern image (see FIG. 11) is also possible. Further, when a grayscale image is used as the projection pattern, the projection is performed according to the processing of FIGS. A light pattern is generated and an evaluation process is executed.
[0176]
The light projection pattern evaluation unit 1210 may be configured to evaluate either the captured image of the standard camera 201 or the captured image of the reference camera 202, or may be configured to evaluate both images.
[0177]
If it is determined by the above-described various evaluation methods that the projection pattern is inappropriate, the projection pattern generation unit 1211 in FIG. 14 stops using the pattern and selects or generates a new projection pattern. And irradiate the object to be measured.
[0178]
The projection pattern generation device 1211 has a plurality of projection pattern slides in which different non-periodic patterns are formed in advance on a slide, etc., and sequentially selects and irradiates a projection pattern from the plurality of projection patterns, and evaluates the projection pattern. What is recognized as an appropriate projection pattern in the means 1210 is selected as a final projection pattern, that is, a pattern for generating a distance image. Alternatively, the light projection pattern irradiating unit 1212 may have a transmissive liquid crystal display element, and the light projection pattern generation device 1211 may control the transmissive liquid crystal display element to dynamically generate and project a random pattern. The dynamic random pattern generation method will be described in detail with reference to FIG.
[0179]
If the projection pattern evaluation unit 1210 recognizes that the projection pattern is appropriate, the result is notified to the image association unit 205, and the projection pattern is photographed by the reference camera 201 and the reference camera 202 together with the measurement target in the projection pattern. Then, based on the images stored in the frame memories 203 and 204, the inter-image association unit 205 performs association processing between the projection pattern images. That is, the pixel image of the reference image captured by the reference camera 202 is associated with each pixel of the image captured by the standard camera 201, and the parallax data of the reference image with respect to the standard image is output to the distance image generation unit 206. The generation unit 206 executes a distance image generation process.
[0180]
In the distance image generation apparatus of the present invention, the light projection pattern used when the distance image is generated is generated or selected by the light projection pattern generation means 1211 and is recognized as appropriate by the light projection pattern evaluation means 1210. Therefore, the occurrence of mismatching is suppressed in the image association process, the image association process in the image association unit 205, and the distance image generation process in the distance image generation unit 206. Is performed with high accuracy.
[0181]
The processing in each block having the configuration shown in FIG. 14 and inter-block data transfer control are controlled by a control means (not shown) and stored in a predetermined memory, for example, a semiconductor memory such as a RAM or a ROM, a magnetic disk, an optical disk, or the like. It can be controlled by a control program recorded on the medium. In addition, the control mode can be changed by a user inputting a command, a parameter, or the like using an input unit (not shown).
[0182]
Next, a configuration block diagram in which the projection pattern irradiation unit 1212 has a transmissive liquid crystal display element, and the projection pattern generation device 1211 dynamically generates a random pattern by controlling the transmissive liquid crystal display element and projects it. As shown in FIG.
[0183]
As shown in FIG. 15, the light projection pattern irradiating means 1212 has a transmissive liquid crystal display element 1320, and the measurement target 200 is irradiated with light from the light source 1321 through the transmissive liquid crystal display element 1320.
[0184]
The projection pattern generation unit 1211 includes a liquid crystal control unit 1307, and the liquid crystal control unit 1307 executes control for forming various non-periodic patterns on the transmissive liquid crystal display element 1320. The light projection pattern generation unit 1211 has the same configuration as the configuration units 501 to 504, 507, and 508 of FIG. 5 used in the description of the random pattern generation device, and generates, for example, a binary uniform random number. Uniform random number generating means 1301, normal random number generating means 1302 for generating a normal random number Rk based on a preset standard deviation s and an average value am based on the uniform random number generated in the uniform random number generating means 1301; An image generation unit 1303 that generates an image rd_im [k] based on the normal random number Rk generated by the normal random number generation unit 1302, performs a binarization process on the image rd_im [k] using a predetermined threshold T, and outputs a binary image Binary image generation means 1304 for generating f (i, j) is included.
[0185]
The liquid crystal control unit 1307 controls the transmissive liquid crystal display element 1320 so as to form a pattern corresponding to the binary image generated by the binary image generation unit 1304.
[0186]
The standard deviation s can be set to various values in the standard deviation setting means 1305, and various normal random numbers can be generated in the normal random number generation means 1302 based on the set standard deviation. Various values can be set in the means 1306, and various binary images are generated in the binary image generation means 1304 based on these various setting values.
[0187]
On the other hand, the projection pattern evaluation unit 1210 receives the captured image of the standard camera 201 and the captured image of the reference camera 202 via the frame memories 1a and 203 and the frame memories 1a and 204, and the captured image change rate detection unit 1308. The pattern of the change rate r of the captured image p (i, j) or the binary image p ′ (i, j) obtained by processing the captured image p (i, j) with a predetermined threshold value Tp in FIG. It is calculated as a pattern suitability index value indicating the suitability. Further, the change rate determination unit 1309 performs a comparison process with a predetermined threshold value T1 to determine whether the light projection pattern is appropriate.
[0188]
The determination result in the change rate determination unit 1309 is fed back to the projection pattern generation unit 1211. When the comparison result is determined to be an inappropriate projection pattern, the threshold value T setting unit 1306 of the projection pattern generation unit 1211 is used. Alternatively, a new threshold value T or standard deviation s is set in the standard deviation s setting means 1305, and a new binary image is generated. A pattern based on the new binary image is formed on the transmissive liquid crystal display element 1320 in the projection pattern irradiation unit 1212 under the control of the liquid crystal control unit 1307.
[0189]
When it is determined that the comparison result in the change rate determination unit 1309 is an appropriate light projection pattern, although not shown in FIG. 15, the image association unit 205 is notified as described in FIG. The association process based on the image data stored in the frame memory is started.
[0190]
In FIG. 15, the light projection pattern evaluation unit 1210 employs the image evaluation configuration of FIGS. 5 and 6 in the description of the random pattern generation device described above, but is not limited to this evaluation configuration. Any one of the evaluation based on the change rate rm of each window described in the above, the evaluation based on the eigenvalue of the feature matrix of each window described in FIG. 8, and the evaluation configuration based on the matching rate between the two windows described in FIG. It is also possible.
[0191]
FIG. 16 shows a light projection pattern determination processing flow in the distance image generation apparatus of the present invention. Hereinafter, the processing of each step of FIG. 16 will be described with reference to FIGS. 14 and 15.
[0192]
Step 1401 is a step of setting a light projection pattern to be projected onto the measurement target 200. When the light projection pattern generation unit 1211 has a slide in which a plurality of non-periodic patterns are formed in advance, one slide is selected as the light projection pattern. When the light projection pattern generation unit 1211 includes the transmissive liquid crystal display element 1320, a pattern based on the binary image generated by the binary image generation unit 1304 shown in FIG. Control is performed by liquid crystal control means 1307 so as to form 1320.
[0193]
Step 1402 is a step of irradiating the projection pattern on the measuring object 200 and photographing using the standard camera 201 and the reference camera 202. Images taken by each camera are stored in the frame memories 1a and 203 and the frame memories 2a and 204.
[0194]
Step 1403 is a projection pattern evaluation process step based on the photographed image. The light projection pattern evaluation unit 1210 executes a light projection pattern evaluation process based on the photographed image. These evaluation processes are performed by applying the above-described evaluation process configuration shown in FIGS.
[0195]
Step 1404 is a step of determining whether or not there is an inappropriate part as the light projection pattern in the evaluation process in the light projection pattern evaluation unit 1210. If there is no inappropriate part, the process proceeds to Step 1405, where The association unit 205 and the distance image generation unit execute an image correlation process and a distance image generation process based on the captured image.
[0196]
If the determination in step 1404 is No, that is, if it is determined that there is an inappropriate portion as the light projection pattern in the evaluation process in the light projection pattern evaluation unit 1210, the process proceeds to step 1406 to generate or select a new light projection pattern. Processing is performed, and further, processing after step 1401, that is, irradiation of a new projection pattern, photographing, and evaluation processing are executed.
[0197]
An actual image acquisition example in the distance image generation apparatus of the present invention is shown in FIG. In FIG. 17, a pattern is preliminarily attached to the measurement target. When the measurement target with this pattern is irradiated with a non-periodic projection pattern, the result of the measurement overlaps the original pattern of the measurement target and the projection pattern. This shows an example in which the association processing becomes difficult due to the occurrence of the above.
[0198]
FIG. 17A shows a pattern attached to the measurement target, and FIG. 17B shows the first light projection pattern. Although the light projection pattern itself is aperiodic, this aperiodic pattern is projected onto the measurement object (c), and when this is photographed, the original pattern of the measurement object and the light projection pattern as shown in (d) As a result, the matching process becomes difficult. The projection pattern evaluation unit shown in FIG. 14 or 13 performs the evaluation of the image shown in FIG. 17D by the methods described with reference to FIGS.
[0199]
Since the evaluation of the image shown in FIG. 17D is an evaluation that the image is inappropriate as the light projection pattern, the light projection pattern generation unit 1211 generates a new light projection pattern (e) to measure the measurement target. (F) to obtain the result (g). Evaluation processing is also performed on this image (g), and when it is determined that the result of the evaluation is appropriate, association processing and distance image generation processing are started.
[0200]
As described above, the distance image generation apparatus of the present invention evaluates and examines the projection pattern based on the captured image, and the distance image of the appropriate projection pattern irradiation image in which the occurrence of mismatching is suppressed. Since it can be generated, a more accurate distance image can be obtained.
[0201]
In addition, an appropriate light projection pattern is selected before performing a corresponding point marking process and a distance image generation process for an inappropriate light projection pattern, that is, a light projection pattern image in which mismatching frequently occurs in the association process. Therefore, it is possible to obtain a highly accurate distance image by a single process without the necessity of repeatedly performing complicated corresponding point marking processing and distance image generation processing.
[0202]
In the above-described embodiment, a configuration has been described in which two cameras are used to capture an image, and a distance image is obtained from two projection pattern images. However, a multi-baseline stereo system using three or more cameras is further described. The present embodiment can also be applied in (for example, disclosed in JP-A-10-289315), and the above-described evaluation may be performed on one or a plurality of images captured by each camera. .
[0203]
In addition, the configuration of the present invention can be applied to a case where stereo shooting is performed using a camera group in which each unit can be moved freely instead of a fixed camera device group. Evaluation of a captured image can be easily executed, and it becomes easy to set a camera at an arbitrary position.
[0204]
[Distance Image Generation Device—Embodiment 2]
The configuration of the above-described first embodiment of the distance image generation device is a configuration in which the evaluation of the acquired light projection pattern image is executed before the distance image generation, but the distance image is actually generated and the presence / absence of the mismatch region is determined. A configuration for generating a new light projection pattern based on the determination will be described as a second embodiment.
[0205]
The distance image is image data in which, for example, a distance value between the reference camera and the measurement target is reflected as a gray value on each pixel of the captured image, and is used for generating three-dimensional graphic data. In the first embodiment described above, the suitability of the projection pattern is determined before the distance image generation step, but it is guaranteed that there is no possibility that a mismatching region is detected in the actual distance image. Therefore, in the second embodiment, when a mismatching area is detected after the distance image is generated, a new light projection pattern is irradiated to obtain a highly accurate distance image in which the mismatching area is reduced. provide. Note that the mismatching region is a pixel region that does not indicate an accurate distance in the distance image, and occurs when the inter-image association processing is not accurately executed.
[0206]
The configuration of Example 2 is shown in FIG. The difference from the first embodiment is a mismatching region detection unit 1601. The mismatching region detection unit 1601 acquires a distance image from the image memory 207 that stores the distance image generated by the distance image generation unit 206, and makes a mistake. Detect matching regions.
[0207]
When a mismatching area is detected in the distance image by the mismatching area detection unit 1601, the projection pattern generation unit 1602 is notified, and a new projection pattern is generated or selected, and the projection pattern irradiation unit 1603 A new projection pattern is irradiated. The configuration of the light projection pattern irradiation unit 1603 is the same as that of the first embodiment, and a description thereof is omitted.
[0208]
The light projection pattern generation unit 1602 has a configuration for generating a pattern to be projected onto the measurement target, and can generate a plurality of different aperiodic light projection patterns using random numbers. Furthermore, it has the same evaluation configuration as the light projection pattern evaluation means in the first embodiment, and performs determination based on the pattern suitability index value indicating the suitability of the generated light projection pattern as a pattern, and only those having good judgment. Set as projection pattern.
[0209]
That is, the pattern suitability index value indicating the suitability as the pattern of the generated light projection pattern, for example, the above-described change rate, feature amount, variance value, etc. is calculated, and the pattern suitability index value indicating the suitability as the calculated pattern Is compared with a predetermined threshold value to determine the suitability as the distance image generation light projection pattern, and only the pattern determined to be suitable is set as the light projection pattern. Therefore, the projection pattern generated by the projection pattern generation unit 1602 and irradiated by the projection pattern irradiation unit 1603 is basically a projection pattern that hardly causes periodicity.
[0210]
The configuration of the second embodiment will be described below with a focus on the processing of the mismatching area detection unit 1601. FIG. 19 shows a processing flow of the distance image generating apparatus of this embodiment.
[0211]
Step 1701 is a step of setting a light projection pattern to be projected onto the measurement target 200. When the light projection pattern generation unit 1602 has a slide in which a plurality of non-periodic patterns are formed in advance, one slide is selected as the light projection pattern. When the light projection pattern generation unit 1602 has the transmissive liquid crystal display element described with reference to FIG. 15, a pattern based on the binary image generated by the light projection pattern generation unit 1602 with the binary image generation unit 1304 shown in FIG. Control is performed by the liquid crystal control means 1307 so as to form the transmissive liquid crystal display element 1320.
[0212]
Step 1702 is a distance image generation processing step based on the projection pattern image, and is based on images taken by the base camera 201 and the reference camera 202, that is, images stored in the frame memories 1a and 203 and the frame memories 2a and 204. This is executed by the image correlation unit 205 and the distance image generation unit 206.
[0213]
Step 1703 is a mismatching area detection process based on the generated distance image, and is executed by the mismatching area detection means 1601. Mismatch region detection processing will be described with reference to FIGS. 20 and 21. FIG.
[0214]
FIG. 20 shows an outline of the mismatching detection process. The distance image labeling process is executed in step 1801 to obtain a labeling image 1802. Based on the labeling image 1802, the mismatching area is determined in step 1803. To detect.
[0215]
FIG. 21 shows a detailed processing flow of the labeling process in step 1801 shown in FIG. First, in step 2101 of FIG. 21, the mismatching area detection unit 1601 shown in FIG. 18 reads the distance image D1 from the image memory 207.
[0216]
In step 2102, the mismatching area detection unit 1601 initializes the number k of unlabeled pixels as an initialization process for setting coordinates for starting the labeling process, and the mismatching area detection unit 1601 stores the built-in coordinate memory. The buffers x [k] and y [k] are initialized.
[0217]
In step 2103, the mismatching region detection means 1601 sets an arbitrary position coordinate of a portion corresponding to the measurement target (subject) in the distance image D1 as the coordinate (i, j) of the target pixel.
[0218]
In step 2104, the mismatching region detection means 1601 extracts the pixel value g (i, j) of the target pixel of the distance image D1. The pixel value g (i, j) indicates the distance value of the pixel (i, j).
[0219]
Next, in step 2105, the mismatching region detection means 1601 determines the pixel value g (i + m, j + n) (where m, n = −) of one unprocessed pixel among the pixels adjacent to the target pixel (i, j). 1, 0, 1) is extracted.
[0220]
In step 2106, the mismatching area detection unit 1601 determines whether the pixel value g (i, j) of the pixel of interest (i, j) is the label value L0, and further the pixel value of the pixel of interest. It is determined whether or not the absolute value of the difference between g (i, j) and the pixel value g (i + m, j + n) of an adjacent pixel is smaller than a predetermined threshold value.
[0221]
The continuity between the pixel (i, j) and the adjacent pixel (i + m, j + n) is determined by comparison with this threshold value. That is, if the pixel value of the pixel (i, j) and the adjacent pixel (i + m, j + n) and the difference between g (i, j) and g (i + m, j + n) are smaller than the threshold value, the two pixels are in a continuous region. If it is greater than the threshold, it is determined that the region is a discontinuous region.
[0222]
It is determined that the pixel value g (i, j) of the pixel of interest is not L0, and the pixel value g (i + m.j + n) of the adjacent pixel is continuous with respect to the pixel value g (i, j). If YES, go to step 2107.
[0223]
In step 2107, the mismatching area detection unit 1601 increments the number k of unlabeled pixels by 1, stores the x coordinate i + m of the adjacent pixel in the coordinate storage buffer x [k], and stores the y coordinate j + n as the coordinate. Stored in the buffer y [k].
[0224]
In step 2108, the mismatching region detection means 1601 determines whether or not the processing of steps 2105 and 2106 has been performed on all eight pixels adjacent to the pixel of interest, and steps 2105 and 2106 are performed on the adjacent pixels. If it is determined that there is something that has not been processed, the process returns to step 2105 and the subsequent processing is repeated. Thereafter, if it is determined in step 2108 that the processing of steps 2105 and 2106 has been performed on all eight adjacent pixels, the process proceeds to step 2109.
[0225]
In step 2109, the mismatching area detection unit 1601 replaces the pixel value g (i, j) of the target pixel with the label value L0. Here, the label value L0 is given to the pixel of the part corresponding to the measurement object (subject) of the distance image D1.
[0226]
In step 2110, the mismatching region detection unit 1601 determines whether or not the number of unlabeled pixels k is 0. If it is determined that the number of unlabeled pixels k is not 0, the process proceeds to step 2111.
[0227]
In step 2111, the mismatching area detection unit 1601 sets the value stored in the coordinate storage buffer x [k] as the x coordinate of the target pixel, and uses the value stored in the coordinate storage buffer y [k] as the target. The y coordinate of the pixel. Thereby, a pixel adjacent to the previous pixel of interest and having a continuous pixel value is set as a new pixel of interest. Thereafter, the mismatching region detection unit 1601 increments the number k of unlabeled pixels by 1 and returns to Step 2104.
[0228]
After that, in step 2110, the processing from step 2104 is repeated until it is determined that the number of unprocessed pixels k that are labeled k is 0. If it is determined that the number of unprocessed pixels k that are labeled k is 0, move on. In step 2112, the mismatching region detection unit 1601 replaces the pixel value of the pixel of the distance image D1 whose pixel value is not replaced with the label value L0 with the label value L1 indicating that it is a mismatching region.
[0229]
When the labeling process as described above is completed, the same label is assigned to the continuous region in which the distance data has a difference equal to or smaller than a predetermined threshold in the distance image D1, and for example, a labeling image 1802 in FIG. 20 is obtained.
[0230]
The mismatching region detection means 1601 determines whether or not there is a small isolated region that is surrounded by pixels to which the same label is assigned and that has a label different from the surroundings. In the labeling image 1802 of FIG. 20, regions B, C, and D satisfy these conditions, and it is determined that these regions B, C, and D are mismatching regions (step 1803).
[0231]
Returning to FIG. 19, the description will be further continued. If no mismatched area is detected as a result of the mismatched area detection process described above, the determination in step 1704 is No, and the process proceeds to step 1705, where the generated distance image is output.
[0232]
If a mismatching area is detected, the process proceeds to step 1706, where a new light projection pattern is generated or selected, and further, the processing after step 1701, that is, a distance image generation process based on the new light projection pattern is performed. A mismatching area detection process is executed. The process for generating a new light projection pattern is the same as that in the first embodiment, and a description thereof will be omitted.
[0233]
Note that step 1704 in FIG. 19 is configured to change the process depending on whether or not a mismatching region is detected, but only when a certain threshold value is set and the mismatching region exceeds the set threshold value or more. You may comprise so that the distance image generation process based on a new light projection pattern may be performed.
[0234]
According to the distance image generation apparatus and method of the present embodiment, the configuration is such that a mismatching region based on the generated distance image is detected and a new light projection pattern is set, and the light projection pattern generation means generates The pattern used is only a pattern that is determined to have good suitability as a distance image generation light projection pattern based on a pattern suitability index value indicating suitability as various patterns such as change rate. Therefore, it is possible to generate an appropriate distance image, and it is possible to output a highly accurate distance image from which the mismatching region has been eliminated.
[0235]
The present invention has been described in detail above with reference to specific embodiments. However, it is obvious that those skilled in the art can make modifications and substitutions of the embodiments without departing from the gist of the present invention. In other words, the present invention has been disclosed in the form of exemplification, and should not be interpreted in a limited manner. Further, what is configured by appropriately combining the above-described embodiments is also included in the scope of the present invention, and in order to determine the gist of the present invention, the column of the claims described at the beginning is referred to. Should.
[0236]
【The invention's effect】
As described above in detail, according to the present invention, the randomness pattern for projection is adjusted based on the pattern or the captured image, and the suitability degree as a pattern such as a pattern change rate, a feature amount, a variance value, or pattern matching is obtained. Since it is configured to obtain an appropriate projection pattern by evaluating with the pattern suitability index value shown, it is possible to acquire an appropriate projection pattern image for various measurement objects, and a highly accurate distance An image is obtained.
[0237]
Furthermore, according to the present invention, it is possible to evaluate and examine the projection pattern based on the pattern or the captured image, and to generate a distance image for an appropriate projection pattern irradiation image in which occurrence of mismatching is suppressed. As a result, a more accurate range image can be obtained, and an appropriate projection pattern can be selected before performing the corresponding point marking process and the range image generation process for the projection pattern image that often causes mismatching. Therefore, it is possible to obtain a highly accurate distance image by a single process without the necessity of repeatedly performing complicated corresponding point marking processing and distance image generation processing.
[0238]
Furthermore, according to the present invention, a pattern suitability degree indicating a suitability degree as various patterns such as a change rate is set by detecting a mismatching region based on the generated distance image and setting a new projection pattern. Since it is configured to use only a pattern that is determined to be suitable as a projection pattern for generating a distance image based on the index value, a highly accurate distance image from which the mismatching area is eliminated can be output. Is possible.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating a stereo image method applicable as a three-dimensional information acquisition configuration used in the present invention.
FIG. 2 is a block diagram showing a configuration of an embodiment of a distance image generating apparatus to which the random pattern generating apparatus of the present invention is applied.
FIG. 3 is a diagram showing an example of an aperiodic light projection pattern used in the light projection pattern generation and irradiation means in the present invention.
FIG. 4 is a diagram illustrating a configuration example of a light projection pattern generation and irradiation unit in the present invention.
FIG. 5 is a configuration block diagram of a random pattern generation device of the present invention.
FIG. 6 is a diagram for explaining a projection pattern generation process flow of the random pattern generation apparatus of the present invention.
FIG. 7 is a diagram for explaining a projection pattern evaluation processing flow (No. 1) in the random pattern generation device of the present invention.
FIG. 8 is a diagram for explaining a projection pattern evaluation processing flow (No. 2) in the random pattern generation device of the present invention.
FIG. 9 is a diagram for explaining a projection pattern evaluation process flow (part 3) in the random pattern generation device of the present invention;
FIG. 10 is a diagram for explaining a light projection pattern generation processing flow of the random pattern generation device of the present invention.
FIG. 11 is a diagram for explaining a light projection pattern evaluation process flow in the random pattern generation apparatus of the present invention.
FIG. 12 is a diagram showing a first example of distance image generation using a light projection pattern generated by the random pattern generation device of the present invention.
FIG. 13 is a diagram showing a distance image generation example (No. 2) using a light projection pattern generated by the random pattern generation device of the present invention.
FIG. 14 is a block diagram showing a configuration of an embodiment (Example 1) of a distance image generating apparatus according to the present invention.
FIG. 15 is a diagram showing a detailed configuration of a light projection pattern generation unit and a light projection pattern evaluation unit of the distance image generation apparatus of the present invention.
FIG. 16 is a flowchart of distance image generation processing in the distance image generation apparatus of the present invention.
FIG. 17 is a diagram illustrating a processing process of a light projection pattern generation unit and a light projection pattern evaluation unit in the distance image generation apparatus of the present invention.
FIG. 18 is a block diagram showing a configuration of an embodiment (embodiment 2) of a distance image generating apparatus of the present invention.
FIG. 19 is a diagram showing a processing flow of the distance image generating apparatus of the present invention.
FIG. 20 is a diagram showing a detection process flow of a mismatching region in the distance image generation device of the present invention.
FIG. 21 is a diagram showing a processing flow of a labeling process based on a distance image in the distance image generating apparatus of the present invention.
[Explanation of symbols]
201 ... reference camera
202 ... Reference camera
203, 204 ... frame memory
205 ... Image association means
206: Distance image generating means
207 ... Image memory
208: Output means
220 ... Projection pattern generation and irradiation means
401: Control means
402 ... Camera 1 (reference camera)
403 ... Camera 2 (reference camera)
404: Image memory
501: Uniform random number generation means
502: Regular random number generation means
503 ... Image generation means
504 ... Binary image generation means
505 ... Change rate detection means
506 ... Change rate determination means
507 ... Standard deviation setting means
508 ... Threshold setting means
1210 ... Light projection pattern evaluation means
1211 ... Light projection pattern generation means
1212: Light projection pattern irradiation means
1301 ... Uniform random number generation means
1302: Regular random number generating means
1303 ... Image generation means
1304: Binary image generation means
1305: Standard deviation setting means
1306: Threshold setting means
1307: Liquid crystal control means
1308 ... Photographed image change rate detection means
1309: Change rate determination means
1601 ... Mismatching region detection means
1602 ... Light projection pattern generation means
1603 ... Light projection pattern irradiation means

Claims (13)

ステレオ画像法に従った三次元形状の計測において測定対象に投光する投光パターンを生成するランダムパターン生成装置において、
乱数を用いた異なる複数の非周期的投光パターンを生成可能な投光パターン生成手段と、
前記投光パターン生成手段において生成された投光パターンの評価を実行する投光パターン評価手段とを有し、
前記投光パターン評価手段は、前記投光パターン生成手段の生成した投光パターンのパターンとしての適性度を示すパターン適性度指標値を該生成投光パターンに基づいて算出し、算出したパターン適性度指標値を予め定めた閾値と比較することによって、生成投光パターンが三次元形状計測用の投光パターンとして適性を持つか否かを判定する構成を有し、
前記投光パターン評価手段は、
(1)投光パターンを構成する画素値の周期的変化を示す変化率、
(2)投光パターンを構成する画像の画素値に基づく特徴行列の固有値から算出される特徴量、
(3)投光パターンを構成する異なる部分領域の類似度を示す領域間相関値、
(4)投光パターンを構成する画像の分散値、
上記(1)〜(4)のいずれかの値を前記パターン適性度指標値として算出し、算出値と予め定めた閾値と比較することによって、生成投光パターンが三次元形状計測用の投光パターンとして適性を持つか否かを判定する構成であることを特徴とするランダムパターン生成装置。
In a random pattern generation device that generates a projection pattern to be projected onto a measurement object in measurement of a three-dimensional shape according to a stereo image method ,
A projection pattern generating means capable of generating a plurality of different aperiodic projection patterns using random numbers;
A projection pattern evaluation unit that performs evaluation of the projection pattern generated in the projection pattern generation unit;
The light projection pattern evaluation unit calculates a pattern suitability index value indicating the suitability of the light projection pattern generated by the light projection pattern generation unit based on the generated light projection pattern, and calculates the pattern suitability by comparing with a predetermined threshold index value, generating projection patterns have a determining configuration whether with suitability as projection pattern for three-dimensional shape measurement,
The light projection pattern evaluation means includes:
(1) a change rate indicating a periodic change in pixel values constituting a light projection pattern;
(2) a feature amount calculated from an eigenvalue of a feature matrix based on a pixel value of an image constituting a projection pattern;
(3) An inter-region correlation value indicating the similarity between different partial regions constituting the projection pattern,
(4) The dispersion value of the image constituting the projection pattern,
The value of any one of (1) to (4) above is calculated as the pattern suitability index value, and the generated light projection pattern is projected for three-dimensional shape measurement by comparing the calculated value with a predetermined threshold value. A random pattern generation device having a configuration for determining whether or not a pattern has suitability .
前記投光パターン生成手段は、正規乱数を規定する標準偏差sを変更することによって、異なる非周期的投光パターンを生成する構成を有し、生成した投光パターンが前記投光パターン評価手段において、三次元形状計測用の投光パターンとしての適性を持たないと判定された場合に、前記標準偏差sを変更した新たな非周期的投光パターンを生成する構成を有することを特徴とする請求項1に記載のランダムパターン生成装置。  The projection pattern generation unit has a configuration for generating a different aperiodic projection pattern by changing a standard deviation s that defines a normal random number, and the generated projection pattern is the projection pattern evaluation unit. When it is determined that the projection pattern is not suitable as a projection pattern for measuring a three-dimensional shape, a new aperiodic projection pattern in which the standard deviation s is changed is generated. Item 2. The random pattern generation device according to Item 1. 前記投光パターン生成手段は、正規乱数からなる画像を閾値Tを用いて二値化した二値画像を生成する構成を有するとともに、前記閾値Tを変更することによって、異なる非周期的投光パターンを生成する構成を有し、生成した投光パターンが前記投光パターン評価手段において、三次元形状計測用の投光パターンとしての適性を持たないと判定された場合に、前記閾値Tを変更した新たな非周期的投光パターンを生成する構成を有することを特徴とする請求項1に記載のランダムパターン生成装置。  The light projection pattern generation means has a configuration for generating a binary image obtained by binarizing an image made of normal random numbers using a threshold value T, and changing the threshold value T allows different aperiodic light projection patterns to be generated. The threshold T is changed when it is determined by the projection pattern evaluation means that the generated projection pattern is not suitable as a projection pattern for three-dimensional shape measurement. The random pattern generation device according to claim 1, wherein the random pattern generation device has a configuration for generating a new aperiodic projection pattern. 前記投光パターン生成手段は、正規乱数に基づく濃淡画像を生成する構成を有し、生成した投光パターンが前記投光パターン評価手段において、三次元形状計測用の投光パターンとしての適性を持たないと判定された場合に、正規乱数を規定するパラメータを変更した新たな非周期的投光パターンを生成する構成を有することを特徴とする請求項1に記載のランダムパターン生成装置。  The projection pattern generation unit has a configuration for generating a grayscale image based on normal random numbers, and the generated projection pattern has suitability as a projection pattern for three-dimensional shape measurement in the projection pattern evaluation unit. 2. The random pattern generation device according to claim 1, further comprising a configuration for generating a new aperiodic projection pattern in which a parameter defining a normal random number is changed when it is determined that there is no normal random number. 前記投光パターン評価手段は、前記投光パターン生成手段の生成した投光パターンから部分領域であるウィンドーを少なくとも1以上抽出して前記パターン適性度指標値を算出する構成であることを特徴とする請求項1に記載のランダムパターン生成装置。  The projection pattern evaluation unit is configured to extract at least one or more windows that are partial areas from the projection pattern generated by the projection pattern generation unit and calculate the pattern suitability index value. The random pattern generation device according to claim 1. ステレオ画像法に従った三次元形状の計測において測定対象に投光する投光パターンを生成するランダムパターン生成方法において、
(a)乱数を用いた非周期的投光パターンを生成する投光パターン生成ステップと、
(b)前記投光パターン生成ステップにおいて生成された投光パターンを評価する評価ステップであり、
(c)前記投光パターン生成ステップにおいて生成した投光パターンのパターンとしての適性度を示すパターン適性度指標値として、
(1)投光パターンを構成する画素値の周期的変化を示す変化率、
(2)投光パターンを構成する画像の画素値に基づく特徴行列の固有値から算出される特徴量、
(3)投光パターンを構成する異なる部分領域の類似度を示す領域間相関値、
(4)投光パターンを構成する画像の分散値、
上記(1)〜(4)のいずれかの値を、前記生成投光パターンに基づいて算出するパターン適性度指標値算出ステップと、
(d)算出したパターン適性度指標値を予め定めた閾値と比較することによって、生成投光パターンが三次元形状計測用投光パターンとして適性を持つか否かを判定する適性判定ステップと、
を含む評価ステップと、を有し、
前記適性判定ステップにおいて適正ありとの判定がでるまで、前記ステップ(a)において異なる投光パターンを生成し、(a)〜(d)のステップを繰り返し実行し、
前記評価ステップ中の適性判定ステップにおいて適正ありと判定された投光パターンを三次元形状計測用投光パターンとすることを特徴とするランダムパターン生成方法。
In a random pattern generation method for generating a projection pattern to be projected onto a measurement object in measurement of a three-dimensional shape according to a stereo image method ,
(A) a projection pattern generation step for generating a non-periodic projection pattern using random numbers;
(B) an evaluation step for evaluating the projection pattern generated in the projection pattern generation step;
(C) As a pattern suitability index value indicating the suitability as a pattern of the projection pattern generated in the projection pattern generation step ,
(1) a change rate indicating a periodic change in pixel values constituting a light projection pattern;
(2) a feature amount calculated from an eigenvalue of a feature matrix based on a pixel value of an image constituting a projection pattern;
(3) An inter-region correlation value indicating the similarity between different partial regions constituting the projection pattern,
(4) The dispersion value of the image constituting the projection pattern,
A pattern suitability index value calculating step for calculating any one of the values (1) to (4) based on the generated light projection pattern;
(D) an aptitude determination step for determining whether or not the generated light projection pattern has suitability as a three-dimensional shape measurement light projection pattern by comparing the calculated pattern suitability index value with a predetermined threshold;
An evaluation step including:
Until it is determined that there is appropriateness in the suitability determining step, different projection patterns are generated in step (a), and steps (a) to (d) are repeatedly executed.
A random pattern generation method characterized in that the projection pattern determined to be appropriate in the suitability determination step in the evaluation step is used as a three-dimensional shape measurement projection pattern.
測定対象を異なる視点から撮影した画像を用いて前記測定対象の三次元形状を計測して距離画像を生成する距離画像生成装置において、
乱数を用いた異なる複数の非周期的投光パターンを生成可能な投光パターン生成手段と、
前記測定対象の投光パターン画像を撮り込む基準カメラと、
前記基準カメラと異なる視点において投光パターン画像を撮り込む参照カメラと、
前記基準カメラまたは参照カメラによって撮り込まれた投光パターン画像の少なくともいずれかの投光パターン画像におけるパターン適性を評価し、距離画像生成用の投光パターン画像として適性を有するか否かを評価する投光パターン評価手段であり、投光パターンのパターンとしての適性度を示すパターン適性度指標値として、
(1)投光パターンを構成する画素値の周期的変化を示す変化率、
(2)投光パターンを構成する画像の画素値に基づく特徴行列の固有値から算出される特徴量、
(3)投光パターンを構成する異なる部分領域の類似度を示す領域間相関値、
(4)投光パターンを構成する画像の分散値、
上記(1)〜(4)のいずれかの値を算出して、算出したパターン適性度指標値を予め定めた閾値と比較することによって、生成投光パターンが三次元形状計測用投光パターンとして適性を持つか否かを判定する投光パターン評価手段と、
前記基準カメラおよび参照カメラによって撮り込まれた各投光パターン画像間の対応を検出し視差データを出力する画像間対応付け手段と、
前記画像間対応付け手段の出力する視差データに基づいて距離画像を生成する距離画像生成手段とを有し、
前記投光パターン生成手段は、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価手段によって距離画像生成用投光パターン画像として適性なしと判定された場合、新たな非周期的投光パターンを生成し、
前記画像間対応付け手段および前記距離画像生成手段は、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価手段によって距離画像生成用投光パターン画像として適性ありと判定されたことを条件として処理を実行する構成であることを特徴とする距離画像生成装置。
In a distance image generation device that generates a distance image by measuring a three-dimensional shape of the measurement object using images taken from different viewpoints,
A projection pattern generating means capable of generating a plurality of different aperiodic projection patterns using random numbers;
A reference camera for capturing a projection pattern image of the measurement target;
A reference camera that captures a projection pattern image at a different viewpoint from the reference camera;
Evaluate the pattern suitability of at least one of the projection pattern images captured by the reference camera or the reference camera, and evaluate whether or not the projection pattern image for the distance image generation has suitability. It is a light projection pattern evaluation means , as a pattern suitability index value indicating the suitability as a pattern of the light projection pattern,
(1) a change rate indicating a periodic change in pixel values constituting a light projection pattern;
(2) a feature amount calculated from an eigenvalue of a feature matrix based on a pixel value of an image constituting a projection pattern;
(3) An inter-region correlation value indicating the similarity between different partial regions constituting the projection pattern,
(4) The dispersion value of the image constituting the projection pattern,
By calculating one of the above values (1) to (4) and comparing the calculated pattern suitability index value with a predetermined threshold value, the generated light projection pattern becomes a three-dimensional shape measurement light projection pattern. A projection pattern evaluation means for determining whether or not it has aptitude,
An image-to-image association unit that detects correspondence between the projection pattern images captured by the reference camera and the reference camera and outputs parallax data;
Distance image generating means for generating a distance image based on the parallax data output by the image correlation means;
When the projection pattern image obtained based on the generated projection pattern is determined not to be suitable as the projection pattern image for distance image generation by the projection pattern evaluation unit, Generate a periodic flood pattern,
The inter-image association unit and the distance image generation unit determine that a projection pattern image obtained based on the generated projection pattern is appropriate as a projection image for distance image generation by the projection pattern evaluation unit. A distance image generation apparatus characterized in that the processing is executed on the condition of the above.
前記投光パターン生成手段は、正規乱数を規定する標準偏差sを変更することによって、異なる非周期的投光パターンを生成する構成を有し、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価手段において、距離画像生成用投光パターンとして適性をなしと判定された場合に、前記標準偏差sを変更した新たな非周期的投光パターンを生成する構成を有することを特徴とする請求項に記載の距離画像生成装置。The projection pattern generating means has a configuration for generating a different aperiodic projection pattern by changing a standard deviation s defining a normal random number, and a projection pattern obtained based on the generated projection pattern When the light projection pattern evaluation unit determines that the image is suitable as a distance image generation light projection pattern, a new aperiodic light projection pattern in which the standard deviation s is changed is generated. The distance image generating apparatus according to claim 7 . 前記投光パターン生成手段は、正規乱数からなる画像を閾値Tを用いて二値化した二値画像を生成する構成を有するとともに、前記閾値Tを変更することによって、異なる非周期的投光パターンを生成する構成を有し、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価手段において、距離画像生成用投光パターンとして適性をなしと判定された場合に、前記閾値Tを変更した新たな非周期的投光パターンを生成する構成を有することを特徴とする請求項に記載の距離画像生成装置。The light projection pattern generation unit has a configuration for generating a binary image obtained by binarizing an image made of normal random numbers using a threshold value T, and changing the threshold value T allows different aperiodic light projection patterns to be generated. The projection pattern image obtained based on the generated projection pattern is determined by the projection pattern evaluation means as having no suitability as the projection pattern for distance image generation. The distance image generating apparatus according to claim 7 , wherein the distance image generating apparatus has a configuration for generating a new aperiodic projection pattern in which the threshold value T is changed. 測定対象を異なる視点から撮影した画像を用いて前記測定対象の三次元形状を計測して距離画像を生成する距離画像生成装置において、
測定対象に対して投光するパターンを生成する投光パターン生成手段であり、乱数を用いた異なる複数の非周期的投光パターンを生成可能であるとともに、パターンとしての適性度を示すパターン適性度指標値を生成投光パターンに基づいて算出し、算出したパターン適性度指標値を予め定めた閾値と比較することで距離画像生成用投光パターンとしての適性を判定し、適性ありと判定されたパターンのみを投光パターンとして設定する投光パターン生成手段と、
前記測定対象の投光パターン画像を撮り込む基準カメラと、
前記基準カメラと異なる視点において投光パターン画像を撮り込む参照カメラと、
前記基準カメラおよび参照カメラによって撮り込まれた各投光パターン画像間の対応を検出し視差データを出力する画像間対応付け手段と、
前記画像間対応付け手段の出力する視差データに基づいて距離画像を生成する距離画像生成手段と、
前記距離画像生成手段の生成した距離画像中のミスマッチング領域を検出するミスマッチング領域検出手段と、
を有し、
前記投光パターン生成手段は、前記ミスマッチング領域検出手段が予め定めた閾値以上のミスマッチング領域を検出した場合に新たな非周期的投光パターンを生成する構成を有することを特徴とする距離画像生成装置。
In a distance image generation device that generates a distance image by measuring a three-dimensional shape of the measurement object using images taken from different viewpoints,
This is a projection pattern generation means for generating a pattern to be projected onto a measurement target, and can generate a plurality of different aperiodic projection patterns using random numbers, and also shows a pattern suitability indicating the suitability of the pattern The index value is calculated based on the generated light projection pattern, and the suitability as the distance image generation light projection pattern is determined by comparing the calculated pattern suitability index value with a predetermined threshold value. A projection pattern generating means for setting only a pattern as a projection pattern;
A reference camera for capturing a projection pattern image of the measurement target;
A reference camera that captures a projection pattern image at a different viewpoint from the reference camera;
An image-to-image association unit that detects correspondence between the projection pattern images captured by the reference camera and the reference camera and outputs parallax data;
A distance image generating means for generating a distance image based on the parallax data output by the inter-image association means;
A mismatching area detecting means for detecting a mismatching area in the distance image generated by the distance image generating means;
Have
The distance image having a configuration in which the projection pattern generation unit generates a new aperiodic projection pattern when the mismatching region detection unit detects a mismatching region equal to or greater than a predetermined threshold. Generator.
測定対象を異なる視点から撮影した画像を用いて前記測定対象の三次元形状を計測して距離画像を生成する距離画像生成方法において、
乱数を用いた非周期的投光パターンを生成する投光パターン生成ステップと、
前記測定対象の投光パターン画像を基準カメラと参照カメラを適用して、異なる視点から、同期したタイミングで撮り込む画像撮り込みステップと、
前記基準カメラまたは参照カメラによって撮り込まれた投光パターン画像の少なくともいずれかの投光パターン画像におけるパターン適性を評価し、距離画像生成用の投光パターン画像として適性を有するか否かを評価する投光パターン評価ステップであり、投光パターンのパターンとしての適性度を示すパターン適性度指標値として、
(1)投光パターンを構成する画素値の周期的変化を示す変化率、
(2)投光パターンを構成する画像の画素値に基づく特徴行列の固有値から算出される特徴量、
(3)投光パターンを構成する異なる部分領域の類似度を示す領域間相関値、
(4)投光パターンを構成する画像の分散値、
上記(1)〜(4)のいずれかの値を算出して、算出したパターン適性度指標値を予め 定めた閾値と比較することによって、生成投光パターンが三次元形状計測用投光パターンとして適性を持つか否かを判定する投光パターン評価ステップと、
前記基準カメラおよび参照カメラによって撮り込まれた各投光パターン画像間の対応を検出し視差データを出力する画像間対応付けステッップと、
前記画像間対応付け手段の出力する視差データに基づいて距離画像を生成する距離画像生成ステップとを有し、
前記投光パターン生成ステップは、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価ステップにおいて距離画像生成用投光パターン画像として適性なしと判定された場合、新たな非周期的投光パターンを繰り返し生成し、
前記画像間対応付けステップおよび前記距離画像生成ステップは、生成した投光パターンに基づいて得られる投光パターン画像が前記投光パターン評価ステップにおいて距離画像生成用投光パターン画像として適性ありと判定されたことを条件として処理を実行することを特徴とする距離画像生成方法。
In a distance image generation method for generating a distance image by measuring a three-dimensional shape of the measurement object using images taken from different viewpoints of the measurement object,
A projection pattern generation step for generating a non-periodic projection pattern using random numbers;
An image capturing step of capturing the light projection pattern image of the measurement object at a synchronized timing from different viewpoints by applying a standard camera and a reference camera ;
Evaluate the pattern suitability of at least one of the projection pattern images captured by the reference camera or the reference camera, and evaluate whether or not the projection pattern image for the distance image generation has suitability. As a pattern suitability index value indicating the suitability as a pattern of the light projection pattern in the light projection pattern evaluation step ,
(1) a change rate indicating a periodic change in pixel values constituting a light projection pattern;
(2) a feature amount calculated from an eigenvalue of a feature matrix based on a pixel value of an image constituting a projection pattern;
(3) An inter-region correlation value indicating the similarity between different partial regions constituting the projection pattern,
(4) The dispersion value of the image constituting the projection pattern,
By calculating one of the above values (1) to (4) and comparing the calculated pattern suitability index value with a predetermined threshold value, the generated light projection pattern becomes a three-dimensional shape measurement light projection pattern. A projection pattern evaluation step for determining whether or not it has aptitude ; and
An image-corresponding step for detecting a correspondence between each projection pattern image captured by the reference camera and the reference camera and outputting parallax data;
A distance image generation step for generating a distance image based on the parallax data output by the inter-image association means;
In the projection pattern generation step, when it is determined that the projection pattern image obtained based on the generated projection pattern is not suitable as the projection pattern image for distance image generation in the projection pattern evaluation step, Repeatedly generate a periodic flood pattern,
In the association step between images and the distance image generation step, it is determined that the projection pattern image obtained based on the generated projection pattern is appropriate as the projection image pattern for distance image generation in the projection pattern evaluation step. A distance image generation method characterized in that processing is executed on the condition.
測定対象を異なる視点から撮影した画像を用いて前記測定対象の三次元形状を計測して距離画像を生成する距離画像生成方法において、
乱数を用いた非周期的投光パターンを生成するとともに、パターンとしての適性度を示すパターン適性度指標値を生成投光パターンに基づいて算出し、算出したパターン適性度指標値を予め定めた閾値と比較することで距離画像生成用投光パターンとしての適性を判定し、適性ありと判定されたパターンのみを投光パターンとして設定する投光パターン生成ステップと、
前記測定対象の投光パターン画像を基準カメラと参照カメラを適用して、異なる視点から同期したタイミングで撮り込む画像撮り込みステップと、
前記基準カメラおよび参照カメラによって撮り込まれた各投光パターン画像間の対応を検出し視差データを出力する画像間対応付けステップと、
前記画像間対応付けステップにおいて出力される視差データに基づいて距離画像を生成する距離画像生成ステップと、
前記距離画像生成ステップにおいて生成された投光パターン画像に基づく距離画像中のミスマッチング領域を検出するミスマッチング領域検出ステップと、
を有し、
前記投光パターン生成ステップは、生成した投光パターンに基づいて得られる距離画像について前記ミスマッチング領域検出ステップにおいて予め定めた閾値以上のミスマッチング領域が検出された場合に新たな非周期的投光パターンを生成することを特徴とする距離画像生成方法。
In a distance image generation method for generating a distance image by measuring a three-dimensional shape of the measurement object using images taken from different viewpoints of the measurement object,
A non-periodic projection pattern using random numbers is generated, a pattern suitability index value indicating suitability as a pattern is calculated based on the generated projection pattern, and the calculated pattern suitability index value is a predetermined threshold value A light projection pattern generation step for determining suitability as a light projection pattern for distance image generation by comparing with, and setting only a pattern determined as suitable as a light projection pattern;
An image capturing step of capturing the light projection pattern image of the measurement object at a timing synchronized from different viewpoints by applying a standard camera and a reference camera ;
An image-to-image association step of detecting correspondence between each projection pattern image captured by the reference camera and the reference camera and outputting parallax data;
A distance image generation step for generating a distance image based on the parallax data output in the inter-image association step;
A mismatching region detection step for detecting a mismatching region in the distance image based on the projection pattern image generated in the distance image generation step;
Have
The light projection pattern generation step includes a new aperiodic light projection when a mismatching area equal to or greater than a predetermined threshold is detected in the mismatching area detection step in the distance image obtained based on the generated light projection pattern. A distance image generation method characterized by generating a pattern.
測定対象を異なる視点から撮影した画像を用いて前記測定対象の三次元形状を計測する三次元形状計測を実行するために用いられる投光パターン生成処理をコンピュータ・システム上で実行せしめるコンピュータ・プログラムを有形的に提供するプログラム提供媒体であって、前記コンピュータ・プログラムは、
(a)乱数を用いた非周期的投光パターンを生成する投光パターン生成ステップと、
(b)前記投光パターン生成ステップにおいて生成された投光パターンを評価する評価ステップであり、
(c)前記投光パターン生成ステップにおいて生成した投光パターンのパターンとしての適性度を示すパターン適性度指標値として、
(1)投光パターンを構成する画素値の周期的変化を示す変化率、
(2)投光パターンを構成する画像の画素値に基づく特徴行列の固有値から算出される特徴量、
(3)投光パターンを構成する異なる部分領域の類似度を示す領域間相関値、
(4)投光パターンを構成する画像の分散値、
上記(1)〜(4)のいずれかの値を、前記生成投光パターンに基づいて算出するパターン適性度指標値算出ステップと、
(d)算出したパターン適性度指標値を予め定めた閾値と比較することによって、生成投光パターンが三次元形状計測用投光パターンとして適性を持つか否かを判定する適性判定ステップと、
を含む評価ステップと、を有し、
前記適性判定ステップにおいて適正ありとの判定がでるまで、前記ステップ(a)において異なる投光パターンを生成し、(a)〜(d)のステップを繰り返し実行し、
前記評価ステップ中の適性判定ステップにおいて適正ありと判定された投光パターンを三次元形状計測用投光パターンとして決定するステップと、を含むことを特徴とするプログラム提供媒体。
A computer program for executing a projection pattern generation process used for executing a three-dimensional shape measurement for measuring a three-dimensional shape of the measurement target using images obtained by photographing the measurement target from different viewpoints on a computer system. A program providing medium provided tangibly, the computer program comprising:
(A) a projection pattern generation step for generating a non-periodic projection pattern using random numbers;
(B) an evaluation step for evaluating the projection pattern generated in the projection pattern generation step;
(C) As a pattern suitability index value indicating the suitability as a pattern of the projection pattern generated in the projection pattern generation step ,
(1) a change rate indicating a periodic change in pixel values constituting a light projection pattern;
(2) a feature amount calculated from an eigenvalue of a feature matrix based on a pixel value of an image constituting a projection pattern;
(3) An inter-region correlation value indicating the similarity between different partial regions constituting the projection pattern,
(4) The dispersion value of the image constituting the projection pattern,
A pattern suitability index value calculating step for calculating any one of the values (1) to (4) based on the generated light projection pattern;
(D) an aptitude determination step for determining whether or not the generated light projection pattern has suitability as a three-dimensional shape measurement light projection pattern by comparing the calculated pattern suitability index value with a predetermined threshold;
An evaluation step including:
Until it is determined that there is appropriateness in the suitability determining step, different projection patterns are generated in step (a), and steps (a) to (d) are repeatedly executed.
And determining the projection pattern determined to be appropriate in the suitability determination step in the evaluation step as a projection pattern for three-dimensional shape measurement.
JP33110699A 1999-11-22 1999-11-22 Random pattern generation apparatus and method, distance image generation apparatus and method, and program providing medium Expired - Fee Related JP4110501B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33110699A JP4110501B2 (en) 1999-11-22 1999-11-22 Random pattern generation apparatus and method, distance image generation apparatus and method, and program providing medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33110699A JP4110501B2 (en) 1999-11-22 1999-11-22 Random pattern generation apparatus and method, distance image generation apparatus and method, and program providing medium

Publications (3)

Publication Number Publication Date
JP2001147110A JP2001147110A (en) 2001-05-29
JP2001147110A5 JP2001147110A5 (en) 2006-04-27
JP4110501B2 true JP4110501B2 (en) 2008-07-02

Family

ID=18239938

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33110699A Expired - Fee Related JP4110501B2 (en) 1999-11-22 1999-11-22 Random pattern generation apparatus and method, distance image generation apparatus and method, and program providing medium

Country Status (1)

Country Link
JP (1) JP4110501B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013224895A (en) * 2012-04-23 2013-10-31 Sharp Corp Three dimensional measuring device
US9659379B2 (en) 2014-10-03 2017-05-23 Ricoh Company, Ltd. Information processing system and information processing method

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4577126B2 (en) * 2005-07-08 2010-11-10 オムロン株式会社 Projection pattern generation apparatus and generation method for stereo correspondence
JP5002144B2 (en) * 2005-09-30 2012-08-15 株式会社トプコン Projection apparatus and system for three-dimensional measurement
US8218903B2 (en) 2007-04-24 2012-07-10 Sony Computer Entertainment Inc. 3D object scanning using video camera and TV monitor
JP5052463B2 (en) * 2008-09-10 2012-10-17 日立建機株式会社 Stereo image processing device for work machines
JP5359930B2 (en) * 2010-02-25 2013-12-04 カシオ計算機株式会社 Imaging apparatus, display method, and program
JP2011215041A (en) * 2010-03-31 2011-10-27 Topcon Corp Device and method for projecting target
JP5440363B2 (en) * 2010-04-27 2014-03-12 カシオ計算機株式会社 Information processing apparatus and method, and program
JP5143314B2 (en) * 2010-08-25 2013-02-13 三洋電機株式会社 Information acquisition device and object detection device
JP2013113600A (en) * 2011-11-25 2013-06-10 Sharp Corp Stereo three-dimensional measuring apparatus
JP2013124884A (en) * 2011-12-13 2013-06-24 Canon Inc Information processing apparatus, control method of information processing apparatus and program
US8634020B2 (en) * 2012-03-30 2014-01-21 Mitsubishi Electric Research Laboratories, Inc. Structured light projection and acquisition
JP5981353B2 (en) * 2013-01-09 2016-08-31 シャープ株式会社 3D measuring device
JP6254849B2 (en) 2014-01-17 2017-12-27 キヤノン株式会社 Image processing apparatus and image processing method
JP2022049269A (en) 2020-09-16 2022-03-29 セイコーエプソン株式会社 Three-dimensional shape measuring method and three-dimensional shape measuring device
JPWO2022254854A1 (en) * 2021-05-31 2022-12-08

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2921496B2 (en) * 1996-07-15 1999-07-19 三菱電機株式会社 Image processing device and object transfer device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013224895A (en) * 2012-04-23 2013-10-31 Sharp Corp Three dimensional measuring device
US9659379B2 (en) 2014-10-03 2017-05-23 Ricoh Company, Ltd. Information processing system and information processing method

Also Published As

Publication number Publication date
JP2001147110A (en) 2001-05-29

Similar Documents

Publication Publication Date Title
JP4110501B2 (en) Random pattern generation apparatus and method, distance image generation apparatus and method, and program providing medium
US10354129B2 (en) Hand gesture recognition for virtual reality and augmented reality devices
US9392262B2 (en) System and method for 3D reconstruction using multiple multi-channel cameras
Zhang et al. Rapid shape acquisition using color structured light and multi-pass dynamic programming
Kadambi et al. 3d depth cameras in vision: Benefits and limitations of the hardware: With an emphasis on the first-and second-generation kinect models
US7711182B2 (en) Method and system for sensing 3D shapes of objects with specular and hybrid specular-diffuse surfaces
JP2001264033A (en) Three-dimensional shape-measuring apparatus and its method, three-dimensional modeling device and its method, and program providing medium
JP2001194114A (en) Image processing apparatus and method and program providing medium
US20120176478A1 (en) Forming range maps using periodic illumination patterns
KR20090055803A (en) Method and apparatus for generating multi-viewpoint depth map, method for generating disparity of multi-viewpoint image
Priya et al. Object recognition and 3D reconstruction of occluded objects using binocular stereo
EP3832601A1 (en) Image processing device and three-dimensional measuring system
JP2001194126A (en) Apparatus and method for measuring three-dimensional shape and program providing medium
Wong et al. Fast acquisition of dense depth data by a new structured light scheme
JP2001091232A (en) Three-dimensional shape measuring device and method, and recording medium
JP4337203B2 (en) Distance image generating apparatus, distance image generating method, and program providing medium
Koch et al. Comparison of monocular depth estimation methods using geometrically relevant metrics on the IBims-1 dataset
JP3988574B2 (en) Image processing device
JP2001159506A (en) Three-dimensional shape measuring device and method and recording medium
JP2018195070A (en) Information processing apparatus, information processing method, and program
JPH0991436A (en) Image processing method and device therefor
JPH04130587A (en) Three-dimensional picture evaluation device
Kim et al. An accurate and robust stereo matching algorithm with variable windows for 3D measurements
Karbasi et al. Analysis and enhancement of the denoising depth data using Kinect through iterative technique
JP3253328B2 (en) Distance video input processing method

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060313

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060313

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071122

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071204

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080122

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080327

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

Free format text: PAYMENT UNTIL: 20110418

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees