JP4904638B2 - Method and apparatus for generating three-dimensional shape data and computer program - Google Patents

Method and apparatus for generating three-dimensional shape data and computer program Download PDF

Info

Publication number
JP4904638B2
JP4904638B2 JP2001177582A JP2001177582A JP4904638B2 JP 4904638 B2 JP4904638 B2 JP 4904638B2 JP 2001177582 A JP2001177582 A JP 2001177582A JP 2001177582 A JP2001177582 A JP 2001177582A JP 4904638 B2 JP4904638 B2 JP 4904638B2
Authority
JP
Japan
Prior art keywords
attribute value
volume data
data
outside
volume
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
JP2001177582A
Other languages
Japanese (ja)
Other versions
JP2002366934A (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.)
Konica Minolta Inc
Original Assignee
Konica Minolta Inc
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 Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP2001177582A priority Critical patent/JP4904638B2/en
Priority to US10/166,261 priority patent/US6914601B2/en
Publication of JP2002366934A publication Critical patent/JP2002366934A/en
Application granted granted Critical
Publication of JP4904638B2 publication Critical patent/JP4904638B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Image Generation (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、3次元形状データの生成方法および装置並びにコンピュータプログラムに関する。
【0002】
【従来の技術】
従来より、物体の3次元形状データを生成する方法の1つとして、シルエット法(Shape From Silhouette )が知られている。
【0003】
シルエット法は、物体を異なる視点から撮影(または撮像)して得られた複数の画像から、当該物体の3次元形状を復元する。つまり、シルエット法では、物体を複数の視線方法から撮影した画像に基づいて、それぞれの視線方向から見た物体の形状を反映する物体存在領域を3次元画像空間内のボクセルの集合として記述する。そして、すべての方向から見た物体存在領域内のボクセルの集合をその3次元空間内の物体として求める。
【0004】
【発明が解決しようとする課題】
しかし、シルエット法では、物体の窪んだ部分または凹んだ部分がシルエット画像として表れないため、そのような凹部領域の形状を復元することができない。
【0005】
他方、物体の3次元形状を復元する他の方法として、光切断法などにより非接触で物体を計測するレンジセンサ(3次元計測装置)を用いる方法がある。しかし、レンジセンサを用いた場合には、物体の表面の反射率が極めて低い場合にデータが欠落してしまい、その部分の3次元形状を復元できないという問題点がある。
【0006】
本発明は、上述の問題に鑑みてなされたもので、凹部領域や低反射率の部分があった場合でも、できるだけ少ないメモリ容量で且つ少ない演算時間で正確に3次元形状を復元することを目的とする。
【0007】
本発明の1つの形態による方法では、物体についての3次元形状データを生成する方法であって、前記物体についての視点の異なる複数の画像からシルエット法を用いてボリュームデータに変換することによって第1のボリュームデータを生成する第1のステップ、前記物体について3次元計測によって得られた3次元データをボリュームデータに変換することによって第2のボリュームデータを生成する第2のステップ、前記第1のボリュームデータと第2のボリュームデータとを統合して1つのボリュームデータとする第3のステップを有し、前記ボリュームデータは、ボリュームを表現する座標系内の離散的な各座標位置を格子点とする複数のボクセルによって構成され、前記各ボクセルの格子点において、物体の表面からの距離に応じた値が属性値として保持されており、前記属性値について、当該格子点が物体の外部にあることを示す外部(遠)、当該格子点が物体の外部にあり前記外部(遠)よりも物体の表面に近いことを示す外部(近)、当該格子点が物体の内部にあることを示す内部(遠)、および、当該格子点が物体の内部にあり前記内部(遠)よりも物体の表面に近いことを示す外部(近)の4つに分類し、前記第3のステップにおいて、前記各ボクセルの格子点について、前記第1のボリュームデータによる前記属性値と前記第2のボリュームデータによる前記属性値とに基づいて統合された属性値である統合属性値を求める。
【0008】
好ましくは、第1のステップにおいて、シルエット法を用いてボリュームデータに変換するに際し、
(a) ボリュームを表現する座標系内の離散的な各座標位置において、前記物体の画像の輪郭と当該画像の視点とにより定まる視体積の境界までの距離に応じた値を求めるステップ、
(b) 各座標位置について、前記物体の複数の画像について求めた複数の値に基づいて物体表面からの距離に応じた値を決定し、各座標位置に対応付けて保持するステップを実行する。
【0009】
また、第2のステップにおいて、3次元データをボリュームデータに変換するに際し、
(a) ボリュームを表現する座標系内の離散的な各座標位置において、前記物体の3次元データで表される物体表面までの距離に応じた値を求めるステップ、
(b) 求めた値を各座標位置に対応付けて保持するステップを実行する。
【0010】
生成されたボリュームデータを逆変換することにより、物体の3次元形状が復元される。
本発明によると、3次元形状データの生成方法の相違によるそれぞれの欠点を補って欠落のない精度のよい3次元モデルが生成される。
【0011】
【発明の実施の形態】
図1は本実施形態に係る3次元データ生成装置1のブロック図である。
図1において、3次元データ生成装置1は、装置本体10、磁気ディスク装置11、媒体ドライブ装置12、ディスプレイ装置13、キーボード14、およびマウス15などからなる。
【0012】
装置本体10は、CPU、RAM、ROM、ビデオRAM、入出力ポート、および各種コントローラなどからなる。RAMおよびROMなどに記憶されたプログラムをCPUが実行することにより、以下に説明する種々の機能が実現される。
【0013】
磁気ディスク装置11には、OS(Operating System) 、3次元モデルMLを生成するためのモデリングプログラムPR、その他のプログラム、入力された3次元データ(3次元形状データ)DT、画像(2次元画像データ)FT、ボリュームデータDV、生成された3次元モデルML、その他のデータなどが格納されている。これらのプログラムおよびデータは、適時、装置本体10のRAMにローディングされる。
【0014】
なお、モデリングプログラムPRには、初期化処理、属性値設定処理、属性値決定処理、境界判定処理、分割処理、統合処理、逆変換処理、マッピング処理、およびその他の処理のためのプログラムが含まれる。
【0015】
媒体ドライブ装置12は、CD−ROM(CD)、フロッピィディスクFD、光磁気ディスク、コンパクトフラッシュなどの半導体メモリHM、その他の記録媒体にアクセスし、データまたはプログラムの読み書きを行う。記録媒体の種類に応じて適切なドライブ装置が用いられる。上に述べたモデリングプログラムPRは、これら記録媒体からインストールすることも可能である。3次元データDTおよび画像FTなども記録媒体を介して入力することが可能である。
【0016】
ディスプレイ装置13の表示面HGには、上に述べた種々のデータ、3次元データDT、画像FT、モデリングプログラムPRによる処理過程の画像、生成された3次元モデルML、その他のデータまたは画像が表示される。
【0017】
キーボード14およびマウス15は、ディスプレイ装置13に表示された画像FTおよび3次元データDTに対して、ユーザが種々の指定を行うために用いられる他、装置本体10に種々のデータを入力しまたは指令を与えるために用いられる。
【0018】
図示は省略したが、装置本体10には、被写体である物体を種々の視線で撮影しまたは種々の視点から撮影して画像FTを入力するためのデジタルカメラを接続することが可能である。画像FTから被写体である物体の輪郭を切り出すことにより、シルエット画像FSが生成される。シルエット画像FSに基づいて、シルエット法によって3次元データDTを生成することが可能である。
【0019】
また、視差のある2枚の画像に基づいて3次元再構成を行い、3次元データDTを生成することも可能である。
また、装置本体10には、物体を撮影してその3次元データDTを入力するための3次元入力装置(3次元計測装置)を接続することも可能である。そのような3次元入力装置は、例えば光切断法によって物体の3次元データDTを非接触で計測する。また、3次元入力装置から、3次元データDTではなく、3次元データDTを生成するための元となるデータを出力し、装置本体10によって3次元データDTを演算によって求めてもよい。
【0020】
このようにして得られた3次元データDT、または3次元データDTを生成する途中のデータは、物体の3次元形状を境界表現形式で表現するものである。
本実施形態においては、境界表現形式で表現された物体の3次元形状を、各ボクセル(Voxel)に多値の属性値dを持たせたボリュームデータ(Volume Data )DVに変換する。ボクセルとは、3次元空間を小さな単位の格子に分解し、単位格子によって構成される小さな立方体である。
【0021】
また、生成方法の異なる複数の3次元形状から変換された複数のボリュームデータDVを、1つのボリュームデータDVに統合することも行われる。
最終的なボリュームデータDVは、再度、境界表現形式の形状表現に逆変換される。その際に、例えば、公知の零等値面抽出法などを用いることができる。つまり、隣接する頂点(格子点)を結ぶ辺上の零等値面に対応する点を算出し、それらの点を連結した三角ポリゴンを生成することにより、ポリゴンメッシュに変換することができる。
【0022】
逆変換によって得られた3次元形状に、テクスチャ画像を貼り付けることも行われる。このようにして3次元モデルMLが生成される。
3次元データ生成装置1は、パーソナルコンピュータまたはワークステーションなどを用いて構成することが可能である。上に述べたプログラムおよびデータは、ネットワークNWを介して受信して取得することも可能である。
【0023】
図2は3次元データ生成装置1による3次元モデルMLの生成処理の流れを示すフローチャートである。
図2において、適当なサイズのボリューム(ボリュームデータDV)が準備され、初期化が行われる(#1)。ボリュームとして、例えば、50×50×50ボクセル、または100×100×100ボクセル程度のサイズのものが用いられる。ボリュームは立方体でなくてもよい。また、座標系におけるボクセルの中心の座標および姿勢なども設定される。
【0024】
ボリュームは、ボクセルの各頂点に、2種類の多値のデータを属性値dとして格納することができる。つまり、各頂点に対して、2つの属性値ds,drを格納する領域が設けられる。これは、ボクセルの各頂点に多値のデータを属性値として格納することが可能なボリュームが2つある、とすることもできる。この場合に、一方を第1のボリューム、他方を第2のボリュームと記載することができる。
【0025】
なお、本明細書において、「ボリューム」のことを「ボリュームデータ」と記載することがある。その場合には、「ボリュームデータ」は、ボクセルによって所定の形状となるように構成され、ボクセルの各頂点にデータを格納することが可能な3次元領域を意味する。
【0026】
また、ボクセルの頂点は、隣合うボクセルについて共通である。したがって、周縁部にはない頂点については、8つのボクセルの頂点となる。頂点はボリュームデータの格子点と一致する。したがって、「頂点」を「格子点」と記載することがある。
【0027】
さて、図2に戻って、シルエット画像を用いて変換処理が行われ、第1のボリュームデータDVが生成される(#2)。レンジデータを用いて変換処理が行われ、第2のボリュームデータDVが生成される(#3)。なお、レンジデータとは、レンジファインダなどと呼称される3次元計測装置を用いて、物体を計測して得られた3次元形状データである。また、視差のある複数の画像からステレオ法によって再構成された3次元形状データも、ここにいうレンジデータに含まれる。
【0028】
これら、第1および第2のボリュームデータDVが統合される(#4)。統合されたボリュームデータDVが、境界表現形式の形状表現に逆変換される(#5)。必要に応じてテクスチャマッピングが行われる(#6)。
【0029】
以下において、ボリュームデータDVへの変換処理、および複数のボリュームデータDVの統合処理について、詳しく説明する。まず、変換処理について説明する。
〔第1の実施形態による変換処理〕
図3は3次元データ生成装置1による変換処理を示すフローチャート、図4は変換処理の変形例を示すフローチャートである。これらのフローチャートで示す変換処理は、レンジデータ、その他の3次元形状データ、およびシルエット画像を用いた変換処理に適用される。
【0030】
図3において、まず、物体の3次元形状を表す3次元データDTが準備される。または、3次元データDTに代えて、3次元データDTの生成の元となる複数の画像FTが準備される。そして、3次元データDTとボリュームデータDVとの位置合わせが行われる(#11)。通常、ボリュームデータDVの中に3次元データDTが丁度納まるように、それらのサイズおよび位置が決定される。
【0031】
ボリュームを構成するボクセルの各頂点について、それぞれの頂点から3次元形状を表現する境界まで、つまり物体の表面までの距離に応じた値が求められる(#12)。求められた値は、各頂点の属性値として保持される(#13)。
【0032】
このようにして、各ボクセルの頂点、つまり格子点には、多値の属性値が格納され、多値の属性値を持った格子点群により構成されるボリュームデータDVが生成される。
【0033】
図4において、物体の表面と交差するボクセルが抽出される(#22)。このようなボクセルを「境界ボクセル」と記載することがある。境界ボクセルについて、その頂点から物体の表面までの距離に応じた値が求められる(#23)。求められた値は、上と同様に各頂点の属性値として保持される(#24)。
【0034】
なお、ある頂点が境界ボクセルと他のボクセルとの共通の頂点である場合に、その頂点は境界ボクセルの頂点として扱う。
〔第2の実施形態による変換処理〕
第2の実施形態に基づいて、変換処理についてさらに詳しく説明する。なお、第2および第3の実施形態は、主としてシルエット画像を用いた変換処理に適用される。
【0035】
図5は第2の実施形態の変換処理を示すフローチャート、図6は図5のステップ#34の属性値の設定処理のサブルーチンを示すフローチャート、図7はシルエット画像FSをボリュームデータDVに投影した状態を説明するための図、図8は図7に示すシルエット画像FSの一部を拡大して示す図、図9はボリュームデータDVを水平面で切断した状態を示す図、図10は境界ボクセルを拡大して示す図、図11はボリュームデータDVを格納したボリュームテーブルTLsの例を示す図である。
【0036】
図5において、まず、設定されたボリュームデータDVについて、すべての格子点TPに初期値をセットする。これによってボリュームデータDVを初期化する(#31)。格子点TPの初期値として、例えば、物体内部を意味する「プラス無限大」をセットする。この場合、「プラス無限大」は本発明における第1の特定値である。初期化が完了した時点において、図10に示すボリュームデータDVはすべて初期値となる。
【0037】
次に、1つの画像FTを入力する(#32)。その際に、画像FTを撮影したときのカメラパラメータも入力する。カメラパラメータとして、焦点距離などのカメラ内部行列、視点位置などの外部行列が挙げられる。これらを含んだ射影行列を入力してもよい。カメラパラメータに基づいて、画像FTをボリュームデータDVに投影する際の視点位置および投影方向が決定される。
【0038】
なお、ステップ#32で画像FTを入力すると、画像FTは磁気ディスク装置11に格納される。磁気ディスク装置11に格納された画像FTは、プログラムによって自動的にRAM上に読み込まれ、以降の処理が加えられる。しかし、ステップ#32での画像の入力を、磁気ディスク装置11に格納された画像FTをRAM上に読み込む、という意味に用いてもよい。その場合には、予め多数の画像FTを磁気ディスク装置11に格納しておき、ステップ#32で指定された1つの画像FTをRAM上に読み込むようにすればよい。また、画像の入力を、磁気ディスク装置11に格納された多数の画像FTの中から、処理すべき1つの画像FTを指定する、という意味に用いることも可能である。
【0039】
入力された画像FTから、被写体である物体の輪郭が切り出されることにより、シルエット画像FSが生成される(#33)。シルエット画像FSは、輪郭が分かればよいので、モノクロの画像で充分である。シルエット画像の生成は、公知の方法によって自動的にまたは手動により行うことができる。
【0040】
ボリュームデータDV、つまりボクセルVXの各頂点(格子点)TPの属性値が求められ、設定される(#34)。属性値は、各頂点TPと物体の表面との間の符号付き距離として求められる。つまり、例えば、図7および図8に示されるように、シルエット画像FSによる輪郭(遮蔽輪郭)と視点VPとで定まる視体積VVの境界SFから頂点TPまでの距離Lsを、視体積VVの内側に向かう方向を+(プラス)として求めたものである。詳しくは後述する。
【0041】
処理の必要な画像FTが残っている場合に、次の1つの画像を入力する(#35でイエス、#32)。これが、必要なすべての画像FTについての処理が終了するまで繰り返される(#35)。予定したすべての画像FTについての処理を終えた場合でも、必要に応じて画像FTを追加してステップ#32〜34の処理を行うことが可能である。
【0042】
なお、ステップ#32で画像FTを入力する代わりに、シルエット画像FSを入力することも可能である。その場合には、ステップ#33は不要である。
図6において、属性値の設定に際し、まず、ボリュームを構成する1つの格子点TPに注目する(#41)。注目している格子点TPの属性値をチェックする(#42)。属性値が「マイナス無限大」であれば、ステップ#45に進む。つまり、属性値が「マイナス無限大」であるということは、その格子点TPは物体の外部にあることを意味する。物体の外部にある格子点TPは切り取られるので、それ以上に属性値を求める必要はない。この場合、「マイナス無限大」は、本発明における第2の特定値である。
【0043】
なお、最初の画像を処理する時点では、全格子点に初期値として「プラス無限大」がセットされているので、すべてステップ#43に進む。2枚目以降の画像を処理する時点では、以前の画像の処理により、「プラス無限大」、「マイナス無限大」、または後述の「符号付き距離ds」のいずれかが属性値としてセットされており、「マイナス無限大」以外、つまり「プラス無限大」または「符号付き距離ds」の場合に、ステップ#43に進む。
【0044】
属性値が「マイナス無限大」でなければ、ステップ#43において、符号付き距離dsの算出を行う。符号付き距離の算出には種々の方法がある。次に第1から第3までの3つの方法を説明する。
(第1の方法)
注目している格子点TPと、その格子点TPに隣接している格子点(つまり同じボクセルVXについての頂点)とを、それぞれ視点VPに向かって画像FT上に投影する。投影された点同士を画像FT上でつないだときに、それによってできる辺が輪郭(遮蔽輪郭)と交差する場合に、符号付き距離を計算する。
【0045】
つまり、図7に示すように、あるボクセルVXが、視体積VVの境界SF上にある場合に、そのボクセルVXは境界ボクセルVXsである。境界ボクセルVXsの頂点TPについて、符号付き距離を計算する。
【0046】
図9において、視体積VVの境界SFと交差するボクセルVXが、境界ボクセルVXsとして中間濃度で示されている。図10において、境界ボクセルVXsの各頂点TPから視体積VVの境界SFまでの距離を求める。求めた距離、またはそれに対応する数値が、それぞれの頂点TPの属性値として示されている。
【0047】
距離の単位またはスケールは、適当に設定してよい。距離の最大値は、ボクセルVXの対角線の長さである。したがって、対角線の長さを基準として、距離を正規化してもよい。また、視体積VVの内部にある頂点TPについては、距離の符号をそのまま正の値とし、外部にある頂点TPについては、距離にマイナスを付けて負の値とする。
【0048】
例えば、属性値として8ビットのデータを用いる場合には、最上位ビットを符号ビットとし、下位7ビットで距離を示す。これによって、−127〜+128の値を表現することができるので、−127を、外部を示す「マイナス無限大」に対応させ、+128を、内部を示す「プラス無限大」に対応させ、−126〜+127を符号付き距離に対応させる。属性値として、12ビット、16ビット、その他のビット数のデータを用いることができる。
【0049】
したがって、格子点TPが視体積VVの境界SF上にある場合には、その属性値は零となる。格子点TPが視体積VVの内部にいくにしたがって属性値は大きくなり、外部にいくにしたがって属性値は小さくなる。
【0050】
辺が遮蔽輪郭と交差しない場合には、つまり境界ボクセルVXsでない場合には、その格子点TPは視体積VVの内部または外部に存在する。外部にある場合には、その格子点TPは切り取るべき点であるから、属性値を「マイナス無限大」とする。内部にある場合には属性値を「プラス無限大」のままとする。
(第2の方法)
注目している格子点TPを視点VPに向かって画像FT上に投影する。投影された点を中心とし、中心から一定の半径の円の内部の領域に遮蔽輪郭があるか否かをチェックする。遮蔽輪郭が存在する場合に、符号付き距離を計算する。領域内に遮蔽輪郭が存在しない場合で、格子点TPが視体積VVの外部にある場合には、属性値を「マイナス無限大」とする。

(第3の方法)
遮蔽輪郭を一定間隔でサンプリングし、サンプリング点と視点VPとを結ぶ直線を得る。これらの直線は、遮蔽輪郭を通る視線である。視体積VVの境界SFに代えて視線を用い、3次元的に符号付き距離を算出する。つまり、境界ボクセルVXsの頂点TPについて、頂点TPから視線までの距離を算出する。注目する格子点TPが視体積VVの外部にある場合には、属性値を「マイナス無限大」とする。
【0051】
そして、ステップ#44において、格子点TPに属性値をセットする。属性値をセットする際には、既にセットされている属性値よりも小さい値のみをセットする。既にセットされている属性値よりも大きい値が新たに得られている場合には、その新しい属性値は無視する。
【0052】
つまり、属性値として、新たに「マイナス無限大」が得られたとすると、先にセットされている属性値が何であれ、属性値は「マイナス無限大」となる。このようにして物体の外部が切り取られていく。
【0053】
なお、属性値が新旧とも符号付き距離であった場合には、それらの平均値を求めてそれを新たな属性値dとしてもよい。
すべての格子点TPに対して処理を行ったかどうかをチェックする(#45)。まだ処理を行っていない格子点TPがある場合は、ステップ#41以降を繰り返す。すべての格子点TPについての処理を終えた場合にはリターンする。これによって、図11に示すようなボリュームテーブルTLsが完成する。
【0054】
第2の実施形態によると、1つの画像FTごとに処理が行われるので、画像の処理が終わればその画像を削除することができ、それだけ使用するメモリ容量が少なくて済む。
〔第3の実施形態による変換処理〕
第2の実施形態の変換処理では、画像FTを追加していくことにより変換処理を進行したが、最初に複数枚の画像FTをまとめて入力し(読み込み)、処理を行うことも可能である。次にその例を第3の実施形態として示す。
【0055】
図12は第3の実施形態の変換処理を示すフローチャート、図13は図12のステップ#54の属性値の設定処理のサブルーチンを示すフローチャートである。
【0056】
図12において、ステップ#51は図5のステップ#31と同様である。ステップ#52では、物体について撮影したすべての画像FTを一時に入力する。その際に、それぞれの画像FTを撮影したときのカメラパラメータを入力する。各画像FTについて、ステップ#33と同様にシルエット画像FSが生成される(#53)。そして、属性値の設定が行われる(#54)。
【0057】
図13において、属性値の設定に際し、まず、ステップ#41と同様に、1つの格子点TPに注目する(#61)。注目している格子点TPが、視体積VVに対してどのような位置に存在するかをチェックする(#62)。
【0058】
すなわち、格子点TPが視体積VVの境界SFの付近に存在する場合には属性値を仮に「BORDER」とし、視体積VVの内部に存在する場合には属性値を「INSIDE」とし、被写体の外部に存在する場合には属性値を「OUTSIDE 」とする。属性値「INSIDE」「OUTSIDE 」は、本発明における第1の特定値および第2の特定値である。次に2つのチェック方法について説明する。
(第1の方法)
注目している格子点TPと隣接している格子点とを、すべての画像FT上に投影する。投影されたそれぞれの画像FT上において、投影された2つの点を各画像FT上でつないだときに、それによってできる辺が輪郭(遮蔽輪郭)と交差するか否かを判断する。1つでも交差する画像FTが存在すれば、格子点TPは視体積VVの境界SF付近に存在すると判断し、属性値を仮に「BORDER」とする。交差する画像FTがない場合で、格子点TPの投影点が遮蔽輪郭の外部に存在している画像が1つでもあれば、格子点TPは被写体の外部に存在すると判断し、属性値を仮に「OUTSIDE 」とする。それ以外の場合は、格子点TPは被写体の内部に存在すると判断し、属性値を仮に「INSIDE」とする。
(第2の方法)
注目している格子点TPをすべての画像FT上に投影する。投影された各点を中心とし、中心から一定の半径の円の内部の領域に遮蔽輪郭があるか否かをチェックする。遮蔽輪郭を含むと判断された画像が1つでも存在する場合は、視体積VVの境界SF付近に存在すると判断する。遮蔽輪郭を含むと判断された画像がない場合で、格子点TPの投影点が遮蔽輪郭外に存在している画像が1つでもあれば、被写体の外部に存在すると判断する。それ以外の場合は、被写体の内部に存在すると判断する。
【0059】
このようにして、1つの格子点TPについて、全ての画像FTを考慮した上で、仮の属性値を決定する。
仮の属性値が「OUTSIDE 」または「INSIDE」である場合には、属性値を、例えば、それぞれ「マイナス無限大」または「プラス無限大」とする。仮の属性値が「BORDER」である場合には、符号付き距離を計算する(#63)。
【0060】
符号付き距離の計算方法は、基本的にはステップ#43の説明で述べたと同様である。しかし、ここでは、1つの格子点TPについて、すべての画像FTを同時に考慮して符号付き距離を決定する。
【0061】
すなわち、例えば、次のようにして符号付き距離を計算する。
(第1の方法)
注目している格子点TPを、すべての画像FT上に投影する。投影したすべての画像FTの中から、投影点から遮蔽輪郭までの距離が一番近いものを選択する。選択された画像FTについて、その遮蔽輪郭上の点を通る視線を求める。格子点TPからその視線までの距離を求める。求めた距離に正負の符号を付けて属性値とする。
(第2の方法)
すべての画像FTについて、遮蔽輪郭を一定間隔でサンプリングし、ステップ#34での第3の方法と同様に、遮蔽輪郭を通る視線を用いて3次元的に符号付き距離を算出する。
【0062】
次に、ステップ#64では、ステップ#44と同様に格子点TPに属性値をセットする。但し、こここでは、各格子点TPに対して、最終的な属性値がセットされる。
【0063】
ステップ#65では、ステップ#45と同様に、すべての格子点TPに対して処理を行ったかどうかがチェックされる。
第3の実施形態によると、仮の属性値が「BORDER」である格子点TPのみについて符号付き距離を計算するので、符号付き距離の計算量が大幅に低減する。したがって、処理速度が速い。
〔第4の実施形態による変換処理〕
次に、第4の実施形態として、8分木(Octree) 表現を用いた変換処理について説明する。
【0064】
図14は第4の実施形態の変換処理を示すフローチャート、図15は図14のステップ#75の交差判定処理のサブルーチンを示すフローチャート、図16および図17は8分木表現の原理を説明するための図である。
【0065】
図16および図17に示すように、8分木表現では、対象とする物体よりも大きい立方体を定義し、これをルートキューブ(Root-Cube)RCとする。ルートキューブを、x,y,zの各方向に沿ってそれぞれ2等分すると、体積が8分の1の立方体が8つ生成される。このような分割を任意のレベルまで再起的に繰り返すことにより、8分木のデータが生成される。8分木表現それ自体は公知である。
【0066】
図14において、まず、ルートキューブを設定する(#71)。ルートキューブの設定に当たっては、その中心の座標およびサイズを入力する。また、ルートキューブのすべての頂点に対して、物体内部を意味する「CO」を初期値としてセットする。また、ルートキューブの属性を、遮蔽輪郭と交差していることを表す「GRAY」とし、レベルを「0」とする。属性が「GRAY」であるキューブは、本発明における境界キューブに相当する。
【0067】
次に、被写体である物体を撮影した画像FTについて、必要なすべての画像を入力する(#72)。その際に、それぞれの画像FTを撮影したときのカメラパラメータを入力する。
【0068】
ステップ#73において、ステップ#33と同様にシルエット画像FSが生成される。
ステップ#74において、キューブ(ルートキューブ)の分割が行われる。ここでの分割は、属性が「GRAY」であるキューブのみがついて行われる。分割は、8分割とされる。そして、レベルを1つ上げる。
【0069】
ステップ#75において、キューブの交差判定が行われる。ここでは、分割されたそれぞれのキューブを画像FT上に投影し、遮蔽輪郭との交差の有無を判断する。その判断結果に基づいて、キューブの属性を決定する。
【0070】
そして、所定のレベルに達するまで、ステップ#74および75の処理を繰り返す(#76)。または、属性が「GRAY」であるキューブがなくなった場合には、そこで終了する。その場合には、以降の処理において、境界上にあるキューブ、または頂点が境界上にあるキューブを、属性が「GRAY」であるキューブとして用いる。
【0071】
処理が終わると、属性が「GRAY」であるキューブについて、各頂点の属性値を求めて設定する(#77)。各頂点について属性値を求める方法は、第2の実施形態において説明した方法を用いることができる。
【0072】
図15において、分割されたキューブのうちの1つに注目する(#81)。キューブをすべての画像FT上に投影し、それぞれにおいて遮蔽輪郭との交差の有無を判断する(#82)。
【0073】
その判断の結果、遮蔽輪郭に対して交差する画像FTが1つでも存在すれば、そのキューブの属性を「GRAY」に設定する。すべての画像において、投影したキューブが遮蔽輪郭内に存在する場合は、キューブの属性を、物体内部を表す「WHITE 」に設定する。すべての画像において、投影したキューブが遮蔽輪郭外に存在する場合は、物体外部を表す「BLACK 」に設定する(#83)。
【0074】
ここでの「GRAY」「WHITE 」「BLACK 」は、それぞれ、上に述べた「BORDER」「INSIDE」「OUTSIDE 」に対応する。
分割された8つのキューブのすべてについての処理が行われた場合には(#84でイエス)、リターンする。
【0075】
第4の実施形態においても、属性が「GRAY」であるキューブの格子点TPのみについて符号付き距離を計算するので、符号付き距離の計算量が大幅に低減し、処理速度が速い。
【0076】
このように、第1〜第4の実施形態の変換処理によると、格子点TPに多値のデータを持たせることができ、少ない個数のボクセルVXによって高精度の3次元形状を表現することができる。したがって、少ないメモリ容量で物体の3次元形状を高精度に表現することができる。
【0077】
上に述べた第2〜第4の実施形態の変換処理は、主としてシルエット画像に適用されるものである。次に、主としてレンジデータに対して適用される変換処理について詳しく説明する。
〔第5の実施形態による変換処理〕
図18は第5の実施形態の変換処理を示すフローチャート、図19はスペースカービングを説明するための図、図20はボリュームデータDVを水平面で切断した状態を示す図、図21は境界ボクセルを拡大して示す図、図22〜25は最近点MDを求める方法を説明するための図である。
【0078】
ここでは、複数のレンジデータDRに対して変換処理を行う。このような複数のレンジデータは、例えば、物体の周囲の異なる位置から物体を複数回に分けて計測することにより得られる。なお、ボリュームデータDVに対するレンジデータの位置合わせは済んでいるものとする。
【0079】
図18において、スペースカービング(space carving ) を行う(#91)。スペースカービングは、ボリュームデータDVから、物体ではない不要な部分を切り取る処理である。
【0080】
すなわち、図19に示すように、ボリュームデータDVのボクセルVXのうち、レンジデータDRの外部にあるボクセルVXについて、その頂点TPの属性値として「マイナス無限大」をセットする。その際に、視点VPからレンジデータDRに対して、レンジデータDRを含むような視線を仮想し、その視線の内側にあって且つレンジデータDRの外側にあるボクセルVXを、切り取るべきボクセルVXとする。但し、上の実施形態の場合と同様に、レンジデータDRの近傍にある頂点TPについては除外する。図19において、白いボクセルが外部のボクセルVXとして表示されている。
【0081】
1つの格子点TPxに注目する(#92)。注目している格子点TPxの属性値をチェックする(#93)。属性値が「マイナス無限大」でなければ、ステップ#94に進む。
【0082】
その格子点TPxについて、最近点MDを求める(#94)。i番目のレンジデータDRにおける最近点MDを最近点riとする。最近点MDの求め方は次のとおりである。
【0083】
図22に示すように、複数のレンジデータDRのそれぞれに対して、格子点TPxから垂線を下ろす。1つのレンジデータDRに対して複数の垂線が引ける場合には、そのうちの最も短い垂線を選択する。垂足点が最近点MD1,2である。但し、垂線の長さLM1,2が所定の長さαよりも短いことを条件とする。つまり、垂線の長さLM1,2がいずれも所定の長さαよりも大きい場合には、最近点MDは存在しないものとする。
【0084】
最近点MDが存在しない場合には(#95でノー)、その格子点TPxの属性値を「プラス無限大」とする(#96)。1つまたは複数の最近点MDが存在する場合には(#95でイエス)、最近点MDのうち、格子点TPxに最も近い最近点MDを最近点rmin とする(#97)。
【0085】
なお、ここでは、最近点MDは、レンジデータDRを構成する3次元のポリゴンデータDPの中から選ばれる。
つまり、図23および図25において、格子点TPxに対するレンジデータDR上の最近点MD1は、レンジデータDRのポリゴンデータDPとして存在する3次元点と一致する。したがって、最近点MD1の座標はポリゴンデータDPの座標と一致する。ポリゴンデータDPの座標は既知であるので、最近点MD1の座標は極めて容易に求められる。しかし、最近点MD1は、レンジデータDRに対して真に最も近い点とはいえない。したがって、後で符号付き距離を求める際に、法線となす角の余弦をかけて補正する。
【0086】
これに対し、図24に示すように、ポリゴンメッシュPM上の任意の点PMTを最近点MDとした場合には、レンジデータDRに対する真の最近点を得ることができる。しかし、この場合に、最近点MD1の座標は、周辺のポリゴンデータDPの座標から演算により求める必要があるので、座標を求めるのに時間がかかる。
【0087】
さて、図18に戻り、ステップ#98において、格子点TPxからレンジデータDRまでの符号付き距離を、格子点TPxから1つまたは複数の最近点MDまでの距離の加重平均によって求める。符号付き距離の求め方は次のとおりである。
【0088】
すなわち、最近点MDの中で、最近点rmin から一定の距離内にある最近点MDのみを抽出する。その中には最近点rmin も含める。つまり、最近点rmin から一定の距離よりも遠い最近点MDを除外する。抽出された最近点MDについて、格子点TPxからの距離を求める。求めたすべての距離を加重平均することにより得られる。
【0089】
すなわち、格子点TPxの符号付き距離はdr(x)は、
dr(x)=Σwi ・〔ni ・(ri −TPx)〕/Σwi ……(1)
但し、ri はi番目のレンジデータにおける最近点
ni は最近点ri の法線ベクトル
wi は最近点ri の重み
【0090】
【数1】

Figure 0004904638
【0091】
として求められる。
すなわち、格子点TPxと最近点ri との間の距離は、格子点TPxと最近点ri とを結ぶ線の長さ(つまりそれらの間の距離)に、その線と最近点ri における法線とのなす角の余弦をかけた値として求められる。つまり、格子点TPxまでの最近点MDにおける法線方向の距離として求められる。距離の符号は、法線方向がマイナスである。求めた距離について、各最近点ri の信頼性に応じた重み(荷重)を与えて平均する。これによって符号付き距離が求まる。
【0092】
重みwi は、最近点ri における法線ベクトルni と、格子点TPxを始点とし最近点ri を終点とするベクトルとがなす角の余弦である。つまり、その角が大きいほど、信頼性は小さくなると考えられるので、重みwi を小さくする。
【0093】
求めた符号付き距離を、その格子点TPxの属性値として格納する。
すべての格子点TPに対して処理を行ったかどうかがチェックされる(#99)。まだ処理を行っていない格子点TPがある場合は、ステップ#92以降を繰り返す。すべての格子点TPについての処理を終えた場合には終了する。これによって、レンジデータDRに対応した、図11のボリュームテーブルTLsと同様なボリュームテーブルTLrが完成する。
〔ボリュームデータの統合〕
さて、ステップ#2および3において、シルエット画像FSを用いたボリュームデータDVと、レンジデータDRを用いたボリュームデータDVとが生成された。ステップ#4では、これらのボリュームデータDVを統合する。ボリュームデータDVの統合に際しては、各ボリュームデータDVの互いに対応するボクセルVXの2つの属性値に基づいて、当該ボクセルVXの統合された属性値を求める。なお、シルエット画像FSによるボリュームデータDVの属性値を、シルエット属性値ds、レンジデータDRによるボリュームデータDVの属性値を、レンジ属性値dr、統合されたボリュームデータDVの属性値を統合属性値dtと記載することがある。
【0094】
図26は格子点TPの属性値と物体の表面HMとの位置関係を示す図、図27は2つの属性値の統合方法を示す図である。
図26に示すように、物体の表面HMに対し、属性値の値に応じて、外部(遠)、外部(近)、内部(近)、内部(遠)の4つに分類する。
【0095】
すなわち、属性値が「マイナス無限大」の場合に外部(遠)、属性値が「プラス無限大」の場合に内部(遠)、属性値が負であって「マイナス無限大」でない場合に外部(近)、属性値が正であって「プラス無限大」でない場合に内部(近)となる。これは、シルエット画像FSおよびレンジデータDRのいずれによるボリュームデータDVに対しても適用される。
【0096】
図27に示すように、シルエット属性値dsが外部(遠)である場合に、レンジ属性値drの内容に係わらず、統合属性値dtは外部(遠)を示す「マイナス無限大」である。シルエット属性値dsおよびレンジ属性値drが共に内部(遠)である場合に、統合属性値dtは内部(遠)を示す「プラス無限大」である。シルエット属性値dsが内部(遠)で且つレンジ属性値drが外部(遠)である場合には、これは実際にはあり得ないが、統合属性値dtは外部(遠)を示す「マイナス無限大」である。
【0097】
それ以外で、一方が外部(遠)または内部(遠)で他方が外部(近)または内部(近)であった場合には、外部(近)または内部(近)であった方の属性値が用いられる。両方が外部(近)または内部(近)であった場合には、両方の属性値が混合される。混合によって、統合属性値dtは次の(3)式により計算される。
【0098】
dt=wxdr+(1−wx)ds ……(3)
但し、wxは格子点TPxにおけるレンジ属性値drの重みを表す。つまり、レンジ属性値drの重みwxに応じた比で、レンジ属性値drとシルエット属性値dsとが混合される。荷重wxの値は、物体の形状などに応じて決定される。このように、重みに応じた適当な比で加算されることにより、シルエット画像FSによるボリュームデータDVとレンジデータDRによるボリュームデータDVとの境界部分が滑らかに接続される。得られた統合属性値dtは、その格子点TPの属性値として格納される。このようにして、すべての格子点TPについて属性値が求められる。これによって統合処理が完了する。
【0099】
このように、シルエット画像FSによるボリュームデータDVとレンジデータDRによるボリュームデータDVとを統合することにより、それぞれの欠点を補って欠落のない精度のよい3次元モデルMLを生成することができる。
【0100】
したがって、物体に凹部領域や低反射率の部分があった場合でも、できるだけ少ないメモリ容量で且つ少ない演算時間で、正確に3次元形状を復元することができる。
【0101】
上に述べた実施形態においては、属性値をボクセルの頂点にセットしたが、属性値をセットするのは必ずしもボクセルの頂点である必要はない。例えば、ボクセルの重心であってもよい。
【0102】
また、境界と交差するボクセルについてのみ、頂点と境界との距離値をセットするようにしているが、全ボクセルについて行ってもよい。但し、実施例のように交差するボクセルについてのみ演算する方が、演算時間が短縮される。物体の内部を正、外部を負として表現したが、逆であってもよい。
【0103】
第4の実施形態では、キューブを8分割する例について説明したが、8分割に限らず、xyzそれぞれの方向に3分割し、つまりキューブを27分割してもよいし、それ以上に分割してもよい。
【0104】
上に述べた実施形態において、3次元データ生成装置1の全体または各部の構成、処理の内容および順序、ボクセルVXの個数、属性値の桁数などは、本発明の趣旨に沿って適宜変更することができる。
【0105】
【発明の効果】
本発明によると、凹部領域や低反射率の部分があった場合でも、できるだけ少ないメモリ容量で且つ少ない演算時間で正確に3次元形状を復元することができる。
【図面の簡単な説明】
【図1】本実施形態に係る3次元データ生成装置のブロック図である。
【図2】3次元データ生成装置による3次元モデルの生成処理の流れを示すフローチャートである。
【図3】3次元データ生成装置による変換処理を示すフローチャートである。
【図4】変換処理の変形例を示すフローチャートである。
【図5】第2の実施形態の変換処理を示すフローチャートである。
【図6】図5のステップ#34の属性値の設定処理のサブルーチンを示すフローチャートである。
【図7】シルエット画像をボリュームデータに投影した状態を説明するための図である。
【図8】図7に示すシルエット画像の一部を拡大して示す図である。
【図9】ボリュームデータを水平面で切断した状態を示す図である。
【図10】境界ボクセルを拡大して示す図である。
【図11】ボリュームデータを格納したボリュームテーブルの例を示す図である。
【図12】第3の実施形態の変換処理を示すフローチャートである。
【図13】図12のステップ#54の属性値の設定処理のサブルーチンを示すフローチャートである。
【図14】第4の実施形態の変換処理を示すフローチャートである。
【図15】図14のステップ#75の交差判定処理のサブルーチンを示すフローチャートである。
【図16】8分木表現の原理を説明するための図である。
【図17】8分木表現の原理を説明するための図である。
【図18】第5の実施形態の変換処理を示すフローチャートである。
【図19】スペースカービングを説明するための図である。
【図20】ボリュームデータを水平面で切断した状態を示す図である。
【図21】境界ボクセルを拡大して示す図である。
【図22】最近点を求める方法を説明するための図である。
【図23】最近点を求める方法を説明するための図である。
【図24】最近点を求める方法を説明するための図である。
【図25】最近点を求める方法を説明するための図である。
【図26】格子点の属性値と物体の表面との位置関係を示す図である。
【図27】2つの属性値の統合方法を示す図である。
【符号の説明】
1 3次元データ生成装置
10 装置本体(第1の変換手段、第2の変換手段、統合手段)
11 磁気ディスク装置
DV ボリュームデータ
VX ボクセル
FT 画像
FS シルエット画像
CD CD−ROM(記録媒体)
FD フロッピィディスク(記録媒体)
TL ボリュームテーブル(ボリュームデータ)
PR モデリングプログラム(コンピュータプログラム)[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a method and apparatus for generating three-dimensional shape data, and a computer program.
[0002]
[Prior art]
Conventionally, a silhouette method (Shape From Silhouette) is known as one of methods for generating three-dimensional shape data of an object.
[0003]
In the silhouette method, the three-dimensional shape of an object is restored from a plurality of images obtained by photographing (or imaging) the object from different viewpoints. That is, in the silhouette method, based on images obtained by photographing an object from a plurality of line-of-sight methods, an object existence region that reflects the shape of the object viewed from each line-of-sight direction is described as a set of voxels in the three-dimensional image space. Then, a set of voxels in the object existence area viewed from all directions is obtained as an object in the three-dimensional space.
[0004]
[Problems to be solved by the invention]
However, in the silhouette method, a depressed portion or a depressed portion of the object does not appear as a silhouette image, and thus the shape of such a recessed region cannot be restored.
[0005]
On the other hand, as another method for restoring the three-dimensional shape of the object, there is a method using a range sensor (three-dimensional measurement apparatus) that measures the object in a non-contact manner by a light cutting method or the like. However, when the range sensor is used, there is a problem that data is lost when the reflectance of the surface of the object is extremely low, and the three-dimensional shape of the portion cannot be restored.
[0006]
The present invention has been made in view of the above-described problems, and it is an object of the present invention to accurately restore a three-dimensional shape with as little memory capacity as possible and with a small calculation time even when there is a recessed region or a low reflectance portion. And
[0007]
  According to one aspect of the present invention, there is provided a method for generating three-dimensional shape data for an object, wherein a first method is performed by converting a plurality of images of the object with different viewpoints into volume data using a silhouette method. A first step of generating volume data of the second, a second step of generating second volume data by converting the three-dimensional data obtained by three-dimensional measurement of the object into volume data, the first volume A third step of integrating the data and the second volume data into one volume data;The volume data is composed of a plurality of voxels having lattice points at discrete coordinate positions in the coordinate system representing the volume, and values corresponding to the distance from the surface of the object at the lattice points of the voxels. Is stored as an attribute value, and for the attribute value, the outside (far) indicating that the grid point is outside the object, and the surface of the object is more external than the outside (far) when the grid point is outside the object. Outside (near) indicating that the grid point is inside the object (far), and that the grid point is inside the object and closer to the surface of the object than the inside (far) In the third step, for the lattice point of each voxel, the attribute value by the first volume data and the second volume data are used for the lattice points of the voxels. Obtaining an integrated attribute value is an integrated attribute value based on the sexual value.
[0008]
Preferably, in the first step, when converting to volume data using the silhouette method,
(A) obtaining a value corresponding to the distance to the boundary of the visual volume determined by the contour of the image of the object and the viewpoint of the image at each discrete coordinate position in the coordinate system representing the volume;
(B) For each coordinate position, a value corresponding to the distance from the object surface is determined based on a plurality of values obtained for a plurality of images of the object, and a step of holding the value in association with each coordinate position is executed.
[0009]
In the second step, when converting the three-dimensional data into volume data,
(A) obtaining a value corresponding to the distance to the object surface represented by the three-dimensional data of the object at each discrete coordinate position in the coordinate system representing the volume;
(B) A step of holding the obtained value in association with each coordinate position is executed.
[0010]
By inversely transforming the generated volume data, the three-dimensional shape of the object is restored.
According to the present invention, an accurate three-dimensional model without missing is generated by making up for each defect due to a difference in the method of generating three-dimensional shape data.
[0011]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 is a block diagram of a three-dimensional data generation apparatus 1 according to this embodiment.
In FIG. 1, the three-dimensional data generation device 1 includes a device main body 10, a magnetic disk device 11, a medium drive device 12, a display device 13, a keyboard 14, a mouse 15, and the like.
[0012]
The apparatus main body 10 includes a CPU, a RAM, a ROM, a video RAM, an input / output port, various controllers, and the like. Various functions described below are realized by the CPU executing programs stored in the RAM and ROM.
[0013]
The magnetic disk device 11 includes an OS (Operating System), a modeling program PR for generating a three-dimensional model ML, other programs, input three-dimensional data (three-dimensional shape data) DT, and images (two-dimensional image data). ) FT, volume data DV, generated three-dimensional model ML, and other data are stored. These programs and data are loaded into the RAM of the apparatus main body 10 at appropriate times.
[0014]
The modeling program PR includes programs for initialization processing, attribute value setting processing, attribute value determination processing, boundary determination processing, division processing, integration processing, inverse transformation processing, mapping processing, and other processing. .
[0015]
The medium drive device 12 accesses a semiconductor memory HM such as a CD-ROM (CD), a floppy disk FD, a magneto-optical disk, a compact flash, and other recording media, and reads / writes data or programs. An appropriate drive device is used according to the type of the recording medium. The modeling program PR described above can also be installed from these recording media. The three-dimensional data DT and the image FT can also be input via a recording medium.
[0016]
On the display surface HG of the display device 13, the various data described above, the three-dimensional data DT, the image FT, the image of the processing process by the modeling program PR, the generated three-dimensional model ML, and other data or images are displayed. Is done.
[0017]
The keyboard 14 and the mouse 15 are used for the user to make various designations for the image FT and the three-dimensional data DT displayed on the display device 13, and input various data or commands to the apparatus main body 10. Used to give
[0018]
Although not shown, the apparatus main body 10 can be connected to a digital camera for photographing an object as a subject with various lines of sight or photographing from various viewpoints and inputting an image FT. The silhouette image FS is generated by cutting out the outline of the object that is the subject from the image FT. Based on the silhouette image FS, the three-dimensional data DT can be generated by the silhouette method.
[0019]
It is also possible to generate 3D data DT by performing 3D reconstruction based on two images with parallax.
The apparatus main body 10 can be connected to a three-dimensional input device (three-dimensional measurement device) for photographing an object and inputting the three-dimensional data DT. Such a three-dimensional input device measures the three-dimensional data DT of an object in a non-contact manner by, for example, a light cutting method. Further, instead of the three-dimensional data DT, data that is the basis for generating the three-dimensional data DT may be output from the three-dimensional input device, and the three-dimensional data DT may be obtained by calculation by the apparatus body 10.
[0020]
The three-dimensional data DT obtained in this way, or data in the process of generating the three-dimensional data DT, represents the three-dimensional shape of the object in the boundary representation format.
In the present embodiment, the three-dimensional shape of the object expressed in the boundary expression format is converted into volume data (Volume Data) DV in which each voxel has a multivalued attribute value d. A voxel is a small cube composed of unit lattices by dividing a three-dimensional space into small unit lattices.
[0021]
Further, a plurality of volume data DV converted from a plurality of three-dimensional shapes having different generation methods are also integrated into one volume data DV.
The final volume data DV is again converted back to a shape representation in the boundary representation format. At that time, for example, a known zero isosurface extraction method or the like can be used. That is, a point corresponding to a zero isosurface on an edge connecting adjacent vertices (lattice points) is calculated, and a triangular polygon obtained by connecting these points can be converted into a polygon mesh.
[0022]
A texture image is also pasted on the three-dimensional shape obtained by the inverse transformation. In this way, the three-dimensional model ML is generated.
The three-dimensional data generation apparatus 1 can be configured using a personal computer or a workstation. The programs and data described above can be received and acquired via the network NW.
[0023]
FIG. 2 is a flowchart showing a flow of processing for generating the three-dimensional model ML by the three-dimensional data generating apparatus 1.
In FIG. 2, an appropriately sized volume (volume data DV) is prepared and initialized (# 1). As the volume, for example, a volume of about 50 × 50 × 50 voxels or 100 × 100 × 100 voxels is used. The volume does not have to be a cube. Also, the coordinates and posture of the center of the voxel in the coordinate system are set.
[0024]
The volume can store two types of multivalued data as attribute values d at each vertex of the voxel. That is, an area for storing two attribute values ds and dr is provided for each vertex. This may be that there are two volumes capable of storing multivalued data as attribute values at each vertex of the voxel. In this case, one can be described as a first volume and the other as a second volume.
[0025]
In this specification, “volume” may be referred to as “volume data”. In this case, “volume data” means a three-dimensional area that is configured to have a predetermined shape by voxels and that can store data at each vertex of the voxel.
[0026]
Also, the voxel vertices are common to neighboring voxels. Therefore, the vertices that are not in the peripheral edge are the vertices of eight voxels. The vertex coincides with the grid point of the volume data. Therefore, “vertex” may be described as “grid point”.
[0027]
Now, returning to FIG. 2, the conversion process is performed using the silhouette image, and the first volume data DV is generated (# 2). Conversion processing is performed using the range data, and second volume data DV is generated (# 3). Note that the range data is three-dimensional shape data obtained by measuring an object using a three-dimensional measuring device called a range finder or the like. The three-dimensional shape data reconstructed from a plurality of images with parallax by the stereo method is also included in the range data referred to here.
[0028]
These first and second volume data DV are integrated (# 4). The integrated volume data DV is inversely transformed into a shape representation in the boundary representation format (# 5). Texture mapping is performed as necessary (# 6).
[0029]
Hereinafter, the conversion processing to volume data DV and the integration processing of a plurality of volume data DV will be described in detail. First, the conversion process will be described.
[Conversion processing according to the first embodiment]
FIG. 3 is a flowchart showing conversion processing by the three-dimensional data generation apparatus 1, and FIG. 4 is a flowchart showing a modification of the conversion processing. The conversion processing shown in these flowcharts is applied to conversion processing using range data, other three-dimensional shape data, and a silhouette image.
[0030]
In FIG. 3, first, three-dimensional data DT representing the three-dimensional shape of an object is prepared. Alternatively, instead of the three-dimensional data DT, a plurality of images FT that is a source for generating the three-dimensional data DT is prepared. Then, the alignment of the three-dimensional data DT and the volume data DV is performed (# 11). Normally, the size and position of the three-dimensional data DT are determined so that the three-dimensional data DT is exactly contained in the volume data DV.
[0031]
For each vertex of the voxel constituting the volume, a value corresponding to the distance from each vertex to the boundary expressing the three-dimensional shape, that is, the surface of the object is obtained (# 12). The obtained value is held as the attribute value of each vertex (# 13).
[0032]
In this way, multi-value attribute values are stored at the vertices of each voxel, that is, lattice points, and volume data DV composed of lattice point groups having multi-value attribute values is generated.
[0033]
In FIG. 4, voxels that intersect the surface of the object are extracted (# 22). Such a voxel may be referred to as a “boundary voxel”. A value corresponding to the distance from the vertex to the surface of the object is obtained for the boundary voxel (# 23). The obtained value is held as the attribute value of each vertex in the same manner as above (# 24).
[0034]
When a certain vertex is a common vertex between the boundary voxel and other voxels, the vertex is treated as a vertex of the boundary voxel.
[Conversion processing according to the second embodiment]
Based on the second embodiment, the conversion processing will be described in more detail. Note that the second and third embodiments are mainly applied to conversion processing using a silhouette image.
[0035]
FIG. 5 is a flowchart showing the conversion processing of the second embodiment, FIG. 6 is a flowchart showing the attribute value setting processing subroutine of step # 34 in FIG. 5, and FIG. 7 is a state in which the silhouette image FS is projected onto the volume data DV. FIG. 8 is an enlarged view showing a part of the silhouette image FS shown in FIG. 7, FIG. 9 is a view showing a state in which the volume data DV is cut along a horizontal plane, and FIG. 10 is an enlarged view of boundary voxels. FIG. 11 is a diagram showing an example of a volume table TLs storing volume data DV.
[0036]
In FIG. 5, first, initial values are set at all grid points TP for the set volume data DV. As a result, the volume data DV is initialized (# 31). As the initial value of the lattice point TP, for example, “plus infinity” meaning the inside of the object is set. In this case, “plus infinity” is the first specific value in the present invention. When the initialization is completed, all of the volume data DV shown in FIG. 10 have initial values.
[0037]
Next, one image FT is input (# 32). At that time, the camera parameters when the image FT is taken are also input. Camera parameters include camera internal matrix such as focal length and external matrix such as viewpoint position. A projection matrix including these may be input. Based on the camera parameters, the viewpoint position and the projection direction when the image FT is projected onto the volume data DV are determined.
[0038]
When the image FT is input in step # 32, the image FT is stored in the magnetic disk device 11. The image FT stored in the magnetic disk device 11 is automatically read into the RAM by a program, and the subsequent processing is added. However, the image input in step # 32 may be used to mean that the image FT stored in the magnetic disk device 11 is read into the RAM. In that case, a large number of images FT may be stored in advance in the magnetic disk device 11, and one image FT designated in step # 32 may be read onto the RAM. Further, the input of an image can also be used to designate one image FT to be processed from among a large number of images FT stored in the magnetic disk device 11.
[0039]
The silhouette image FS is generated by cutting out the contour of the object that is the subject from the input image FT (# 33). The silhouette image FS only needs to be known in outline, so a monochrome image is sufficient. The silhouette image can be generated automatically or manually by a known method.
[0040]
The volume data DV, that is, the attribute value of each vertex (grid point) TP of the voxel VX is obtained and set (# 34). The attribute value is obtained as a signed distance between each vertex TP and the surface of the object. That is, for example, as shown in FIGS. 7 and 8, the distance Ls from the boundary SF of the visual volume VV determined by the contour (shielding contour) by the silhouette image FS and the viewpoint VP to the vertex TP is set to the inner side of the visual volume VV. The direction toward is taken as + (plus). Details will be described later.
[0041]
When an image FT that needs to be processed remains, the next one image is input (Yes in # 35, # 32). This is repeated until the processing for all necessary images FT is completed (# 35). Even when the processing has been completed for all scheduled images FT, it is possible to perform steps # 32 to # 34 by adding an image FT as necessary.
[0042]
Instead of inputting the image FT at step # 32, it is also possible to input a silhouette image FS. In that case, step # 33 is unnecessary.
In FIG. 6, when setting the attribute value, first, attention is paid to one lattice point TP constituting the volume (# 41). The attribute value of the focused lattice point TP is checked (# 42). If the attribute value is “minus infinity”, the process proceeds to step # 45. That is, that the attribute value is “minus infinity” means that the lattice point TP is outside the object. Since the grid point TP outside the object is cut off, there is no need to obtain an attribute value beyond that. In this case, “minus infinity” is the second specific value in the present invention.
[0043]
At the time of processing the first image, since “plus infinity” is set as the initial value for all grid points, the process proceeds to step # 43. At the time of processing the second and subsequent images, either “plus infinity”, “minus infinity”, or “signed distance ds” described later is set as an attribute value by the processing of the previous image. If it is other than “minus infinity”, ie, “plus infinity” or “signed distance ds”, the process proceeds to step # 43.
[0044]
If the attribute value is not “minus infinity”, the signed distance ds is calculated in step # 43. There are various methods for calculating the signed distance. Next, three methods from the first to the third will be described.
(First method)
The focused lattice point TP and the lattice point adjacent to the lattice point TP (that is, the vertex for the same voxel VX) are each projected onto the image FT toward the viewpoint VP. When projected points are connected to each other on the image FT, a signed distance is calculated in a case where a side formed thereby intersects with a contour (shielding contour).
[0045]
That is, as shown in FIG. 7, when a certain voxel VX is on the boundary SF of the visual volume VV, the voxel VX is a boundary voxel VXs. A signed distance is calculated for the vertex TP of the boundary voxel VXs.
[0046]
In FIG. 9, voxels VX that intersect the boundary SF of the visual volume VV are shown as intermediate voxels as boundary voxels VXs. In FIG. 10, the distance from each vertex TP of the boundary voxel VXs to the boundary SF of the visual volume VV is obtained. The obtained distance or a numerical value corresponding to the distance is shown as an attribute value of each vertex TP.
[0047]
The unit or scale of the distance may be set appropriately. The maximum value of the distance is the length of the diagonal line of the voxel VX. Therefore, the distance may be normalized based on the length of the diagonal line. For the vertex TP inside the visual volume VV, the sign of the distance is set to a positive value as it is, and for the vertex TP located outside, a negative value is added to the distance.
[0048]
For example, when 8-bit data is used as the attribute value, the most significant bit is a sign bit and the lower 7 bits indicate a distance. As a result, values of −127 to +128 can be expressed, so that −127 corresponds to “minus infinity” indicating the outside, +128 corresponds to “plus infinity” indicating the interior, and −126 ˜ + 127 corresponds to the signed distance. As the attribute value, data of 12 bits, 16 bits, or other number of bits can be used.
[0049]
Therefore, when the lattice point TP is on the boundary SF of the visual volume VV, the attribute value is zero. The attribute value increases as the lattice point TP moves into the visual volume VV, and the attribute value decreases as it moves outward.
[0050]
If the side does not intersect the occlusion outline, that is, if it is not the boundary voxel VXs, the lattice point TP exists inside or outside the view volume VV. If it is outside, the grid point TP is a point to be cut out, so the attribute value is set to “minus infinity”. If it is inside, the attribute value remains “plus infinity”.
(Second method)
The target lattice point TP is projected on the image FT toward the viewpoint VP. It is checked whether or not there is a shielding outline in a region inside a circle having a certain radius from the center with the projected point as the center. Calculate signed distance if occluded contour exists. When there is no shielding contour in the region and the lattice point TP is outside the visual volume VV, the attribute value is set to “minus infinity”.
.
(Third method)
The shielding contour is sampled at regular intervals, and a straight line connecting the sampling point and the viewpoint VP is obtained. These straight lines are lines of sight passing through the shielding contour. Using a line of sight instead of the boundary SF of the visual volume VV, a signed distance is calculated three-dimensionally. That is, for the vertex TP of the boundary voxel VXs, the distance from the vertex TP to the line of sight is calculated. When the focused lattice point TP is outside the visual volume VV, the attribute value is set to “minus infinity”.
[0051]
In step # 44, an attribute value is set at the grid point TP. When setting an attribute value, only a value smaller than an already set attribute value is set. If a new value larger than the already set attribute value is obtained, the new attribute value is ignored.
[0052]
In other words, if “minus infinity” is newly obtained as the attribute value, the attribute value becomes “minus infinity” whatever the previously set attribute value. In this way, the outside of the object is cut off.
[0053]
In addition, when the attribute value is a signed distance for both old and new, an average value thereof may be obtained and used as a new attribute value d.
It is checked whether or not processing has been performed for all grid points TP (# 45). If there is a grid point TP that has not yet been processed, step # 41 and subsequent steps are repeated. When the processing for all the lattice points TP is completed, the process returns. As a result, the volume table TLs as shown in FIG. 11 is completed.
[0054]
According to the second embodiment, since processing is performed for each image FT, the image can be deleted when the processing of the image is completed, and the memory capacity to be used can be reduced accordingly.
[Conversion processing according to the third embodiment]
In the conversion process of the second embodiment, the conversion process has progressed by adding the image FT. However, it is also possible to input (read) a plurality of images FT at a time and perform the process. . Next, an example is shown as a third embodiment.
[0055]
FIG. 12 is a flowchart showing the conversion process of the third embodiment, and FIG. 13 is a flowchart showing a subroutine of the attribute value setting process in step # 54 of FIG.
[0056]
In FIG. 12, step # 51 is the same as step # 31 of FIG. In step # 52, all the images FT taken of the object are input at a time. At that time, the camera parameters when each image FT is photographed are input. For each image FT, a silhouette image FS is generated as in step # 33 (# 53). Then, an attribute value is set (# 54).
[0057]
In FIG. 13, when setting an attribute value, first, attention is paid to one grid point TP as in step # 41 (# 61). It is checked at what position the focused lattice point TP is present with respect to the visual volume VV (# 62).
[0058]
That is, when the lattice point TP exists near the boundary SF of the visual volume VV, the attribute value is “BORDER”, and when the lattice point TP exists inside the visual volume VV, the attribute value is “INSIDE”. If it exists outside, the attribute value is “OUTSIDE”. The attribute values “INSIDE” and “OUTSIDE” are the first specific value and the second specific value in the present invention. Next, two checking methods will be described.
(First method)
The target grid point TP and the adjacent grid point are projected on all the images FT. In each projected image FT, when the two projected points are connected on each image FT, it is determined whether or not a side formed thereby intersects the contour (shielding contour). If there is at least one intersecting image FT, it is determined that the lattice point TP exists in the vicinity of the boundary SF of the visual volume VV, and the attribute value is assumed to be “BORDER”. If there is no intersecting image FT and there is at least one image where the projection point of the grid point TP exists outside the shielding contour, it is determined that the grid point TP exists outside the subject, and the attribute value is temporarily set. “OUTSIDE”. In other cases, it is determined that the grid point TP exists inside the subject, and the attribute value is temporarily set to “INSIDE”.
(Second method)
The focused lattice point TP is projected on all the images FT. It is checked whether or not there is a shielding outline in a region inside a circle having a certain radius from the center with each projected point as the center. If there is even one image that is determined to include the occlusion contour, it is determined that the image exists near the boundary SF of the visual volume VV. If there is no image determined to include the occlusion outline and there is one image in which the projection point of the lattice point TP exists outside the occlusion outline, it is determined that the image exists outside the subject. In other cases, it is determined that the object exists inside the subject.
[0059]
In this way, a temporary attribute value is determined for one lattice point TP in consideration of all images FT.
When the temporary attribute value is “OUTSIDE” or “INSIDE”, the attribute value is, for example, “minus infinity” or “plus infinity”, respectively. If the provisional attribute value is “BORDER”, the signed distance is calculated (# 63).
[0060]
The calculation method of the signed distance is basically the same as described in the explanation of Step # 43. However, here, for one grid point TP, the signed distance is determined in consideration of all the images FT at the same time.
[0061]
That is, for example, the signed distance is calculated as follows.
(First method)
The target lattice point TP is projected on all the images FT. From all the projected images FT, the one having the shortest distance from the projection point to the shielding contour is selected. For the selected image FT, a line of sight passing through a point on the shielding contour is obtained. The distance from the grid point TP to the line of sight is obtained. An attribute value is added to the obtained distance with a positive or negative sign.
(Second method)
For all images FT, the occlusion contour is sampled at regular intervals, and the signed distance is calculated three-dimensionally using the line of sight that passes through the occlusion contour, as in the third method in step # 34.
[0062]
Next, in step # 64, an attribute value is set at the grid point TP as in step # 44. However, here, the final attribute value is set for each lattice point TP.
[0063]
In step # 65, as in step # 45, it is checked whether or not processing has been performed for all grid points TP.
According to the third embodiment, since the signed distance is calculated only for the lattice point TP whose provisional attribute value is “BORDER”, the calculation amount of the signed distance is greatly reduced. Therefore, the processing speed is fast.
[Conversion processing according to the fourth embodiment]
Next, a conversion process using octree representation will be described as a fourth embodiment.
[0064]
FIG. 14 is a flowchart showing the conversion process of the fourth embodiment, FIG. 15 is a flowchart showing a subroutine of the intersection determination process in step # 75 of FIG. 14, and FIGS. 16 and 17 are diagrams for explaining the principle of the octree representation. FIG.
[0065]
As shown in FIGS. 16 and 17, in the octree representation, a cube larger than the target object is defined, and this is defined as a root cube (Root-Cube) RC. When the root cube is divided into two equal parts along the x, y, and z directions, eight cubes having a volume of 1/8 are generated. By repeating such division recursively to an arbitrary level, data of an octree is generated. The octree representation itself is known.
[0066]
In FIG. 14, first, a root cube is set (# 71). When setting the root cube, enter the coordinates and size of its center. Also, “CO” meaning the inside of the object is set as an initial value for all the vertices of the root cube. Further, the attribute of the root cube is set to “GRAY” indicating that it intersects the occlusion outline, and the level is set to “0”. A cube whose attribute is “GRAY” corresponds to a boundary cube in the present invention.
[0067]
Next, all necessary images are input for the image FT obtained by photographing the object that is the subject (# 72). At that time, the camera parameters when each image FT is photographed are input.
[0068]
In step # 73, a silhouette image FS is generated as in step # 33.
In step # 74, the cube (root cube) is divided. The division here is performed only for cubes having the attribute “GRAY”. The division is 8 divisions. Then raise the level by one.
[0069]
In step # 75, a cube intersection determination is performed. Here, each divided cube is projected onto the image FT, and the presence or absence of an intersection with the shielding contour is determined. Based on the determination result, the attributes of the cube are determined.
[0070]
Then, steps # 74 and 75 are repeated until a predetermined level is reached (# 76). Or, when there are no more cubes with the attribute “GRAY”, the process ends there. In that case, in the subsequent processing, a cube on the boundary or a cube whose vertex is on the boundary is used as a cube whose attribute is “GRAY”.
[0071]
When the processing is completed, the attribute value of each vertex is obtained and set for the cube having the attribute “GRAY” (# 77). As a method for obtaining the attribute value for each vertex, the method described in the second embodiment can be used.
[0072]
In FIG. 15, attention is paid to one of the divided cubes (# 81). The cube is projected on all the images FT, and it is determined whether or not there is an intersection with the occlusion contour in each of them (# 82).
[0073]
As a result of the determination, if there is even one image FT that intersects the occlusion outline, the attribute of the cube is set to “GRAY”. In all the images, when the projected cube exists within the occlusion outline, the cube attribute is set to “WHITE” representing the inside of the object. In all the images, when the projected cube exists outside the occlusion outline, it is set to “BLACK” representing the outside of the object (# 83).
[0074]
“GRAY”, “WHITE”, and “BLACK” here correspond to “BORDER”, “INSIDE”, and “OUTSIDE” described above, respectively.
If processing has been performed for all of the eight divided cubes (Yes in # 84), the process returns.
[0075]
Also in the fourth embodiment, since the signed distance is calculated only for the lattice point TP of the cube whose attribute is “GRAY”, the calculation amount of the signed distance is greatly reduced, and the processing speed is high.
[0076]
As described above, according to the conversion processes of the first to fourth embodiments, multivalued data can be given to the lattice points TP, and a highly accurate three-dimensional shape can be expressed by a small number of voxels VX. it can. Therefore, the three-dimensional shape of the object can be expressed with high accuracy with a small memory capacity.
[0077]
The conversion processes of the second to fourth embodiments described above are mainly applied to silhouette images. Next, the conversion process mainly applied to the range data will be described in detail.
[Conversion processing according to the fifth embodiment]
18 is a flowchart showing the conversion process of the fifth embodiment, FIG. 19 is a diagram for explaining space carving, FIG. 20 is a diagram showing a state in which the volume data DV is cut along a horizontal plane, and FIG. 21 is an enlarged view of boundary voxels. FIGS. 22 to 25 are diagrams for explaining a method of obtaining the nearest point MD.
[0078]
Here, conversion processing is performed on a plurality of range data DR. Such a plurality of range data can be obtained, for example, by measuring an object in multiple times from different positions around the object. It is assumed that the range data has been aligned with the volume data DV.
[0079]
In FIG. 18, space carving is performed (# 91). Space carving is a process of cutting out unnecessary parts that are not objects from the volume data DV.
[0080]
That is, as shown in FIG. 19, among the voxels VX of the volume data DV, “minus infinity” is set as the attribute value of the vertex TP for the voxel VX outside the range data DR. At that time, a line of sight including the range data DR is hypothesized from the viewpoint VP to the range data DR, and the voxel VX inside the line of sight and outside the range data DR is the voxel VX to be cut off. To do. However, as in the case of the above embodiment, the vertex TP in the vicinity of the range data DR is excluded. In FIG. 19, white voxels are displayed as external voxels VX.
[0081]
Attention is paid to one lattice point TPx (# 92). The attribute value of the focused lattice point TPx is checked (# 93). If the attribute value is not “minus infinity”, the process proceeds to step # 94.
[0082]
For the lattice point TPx, the nearest point MD is obtained (# 94). The closest point MD in the i-th range data DR is set as the closest point ri. The method for obtaining the nearest point MD is as follows.
[0083]
As shown in FIG. 22, a perpendicular is drawn from the lattice point TPx for each of the plurality of range data DR. When a plurality of perpendicular lines can be drawn for one range data DR, the shortest perpendicular line is selected. The droop point is the latest points MD1 and MD2. However, it is a condition that the lengths LM1 and LM2 of the perpendicular are shorter than the predetermined length α. That is, when the perpendicular lengths LM1 and LM2 are both greater than the predetermined length α, the nearest point MD does not exist.
[0084]
If the nearest point MD does not exist (No in # 95), the attribute value of the lattice point TPx is set to “plus infinity” (# 96). If one or more nearest points MD exist (Yes in # 95), the nearest point MD closest to the grid point TPx is set as the nearest point rmin (# 97).
[0085]
Here, the nearest point MD is selected from the three-dimensional polygon data DP constituting the range data DR.
That is, in FIGS. 23 and 25, the nearest point MD1 on the range data DR with respect to the lattice point TPx coincides with the three-dimensional point existing as the polygon data DP of the range data DR. Therefore, the coordinates of the nearest point MD1 coincide with the coordinates of the polygon data DP. Since the coordinates of the polygon data DP are known, the coordinates of the nearest point MD1 can be obtained very easily. However, the nearest point MD1 is not truly the closest point to the range data DR. Therefore, when calculating the signed distance later, the correction is performed by applying the cosine of the angle formed with the normal.
[0086]
On the other hand, as shown in FIG. 24, when an arbitrary point PMT on the polygon mesh PM is set as the nearest point MD, a true nearest point with respect to the range data DR can be obtained. However, in this case, it is necessary to obtain the coordinates of the nearest point MD1 by calculation from the coordinates of the surrounding polygon data DP.
[0087]
Returning to FIG. 18, in step # 98, a signed distance from the grid point TPx to the range data DR is obtained by a weighted average of the distances from the grid point TPx to one or more nearest points MD. The method for obtaining the signed distance is as follows.
[0088]
That is, only the nearest point MD within a certain distance from the nearest point rmin is extracted from the nearest points MD. The nearest point rmin is also included in this. That is, the nearest point MD far from the nearest point rmin by a certain distance is excluded. For the extracted nearest point MD, the distance from the grid point TPx is obtained. It is obtained by weighted average of all obtained distances.
[0089]
That is, the signed distance of the grid point TPx is dr (x)
dr (x) = Σwi · [ni · (ri−TPx)] / Σwi (1)
Where ri is the closest point in the i-th range data
ni is the normal vector of the nearest point ri
wi is the weight of the nearest point ri
[0090]
[Expression 1]
Figure 0004904638
[0091]
As required.
That is, the distance between the lattice point TPx and the nearest point ri is the length of the line connecting the lattice point TPx and the nearest point ri (that is, the distance between them), and the normal line at that point and the nearest point ri. Is obtained by multiplying the cosine of the angle formed by That is, the distance in the normal direction at the nearest point MD to the lattice point TPx is obtained. The sign of the distance is negative in the normal direction. The obtained distance is averaged by giving a weight (load) according to the reliability of each nearest point ri. Thereby, the signed distance is obtained.
[0092]
The weight w i is the cosine of the angle formed by the normal vector ni at the nearest point ri and the vector starting from the lattice point TPx and ending at the nearest point ri. That is, since the reliability is considered to decrease as the angle increases, the weight wi is decreased.
[0093]
The obtained signed distance is stored as an attribute value of the lattice point TPx.
It is checked whether processing has been performed for all grid points TP (# 99). If there is a grid point TP that has not been processed yet, step # 92 and subsequent steps are repeated. When the processes for all the lattice points TP are completed, the process ends. As a result, a volume table TLr corresponding to the range data DR and similar to the volume table TLs of FIG. 11 is completed.
[Integration of volume data]
In steps # 2 and # 3, volume data DV using the silhouette image FS and volume data DV using the range data DR are generated. In step # 4, these volume data DV are integrated. When integrating the volume data DV, the integrated attribute value of the voxel VX is obtained based on the two attribute values of the voxel VX corresponding to each other of the volume data DV. Note that the attribute value of the volume data DV by the silhouette image FS is the silhouette attribute value ds, the attribute value of the volume data DV by the range data DR is the range attribute value dr, and the attribute value of the integrated volume data DV is the integrated attribute value dt. May be described.
[0094]
FIG. 26 is a diagram showing a positional relationship between the attribute value of the lattice point TP and the surface HM of the object, and FIG.
As shown in FIG. 26, the surface HM of the object is classified into four types: outside (far), outside (near), inside (near), and inside (far) according to the value of the attribute value.
[0095]
That is, external (far) when the attribute value is “minus infinity”, internal (far) when the attribute value is “plus infinity”, and external when the attribute value is negative and not “minus infinity” (Near) If the attribute value is positive and not “plus infinity”, it is internal (near). This is applied to the volume data DV by either the silhouette image FS or the range data DR.
[0096]
As shown in FIG. 27, when the silhouette attribute value ds is outside (far), the integrated attribute value dt is “minus infinity” indicating outside (far) regardless of the contents of the range attribute value dr. When the silhouette attribute value ds and the range attribute value dr are both inside (far), the integrated attribute value dt is “plus infinity” indicating the inside (far). If the silhouette attribute value ds is inside (far) and the range attribute value dr is outside (far), this is not possible, but the integrated attribute value dt is “minus infinity” indicating the outside (far). "Large".
[0097]
Otherwise, if one is outside (far) or inside (far) and the other is outside (near) or inside (near), the attribute value that was outside (near) or inside (near) Is used. If both are external (near) or internal (near), both attribute values are mixed. By mixing, the integrated attribute value dt is calculated by the following equation (3).
[0098]
dt = wxdr + (1-wx) ds (3)
However, wx represents the weight of the range attribute value dr at the lattice point TPx. That is, the range attribute value dr and the silhouette attribute value ds are mixed at a ratio corresponding to the weight wx of the range attribute value dr. The value of the load wx is determined according to the shape of the object. In this way, by adding at an appropriate ratio according to the weight, the boundary portion between the volume data DV by the silhouette image FS and the volume data DV by the range data DR is smoothly connected. The obtained integrated attribute value dt is stored as the attribute value of the lattice point TP. In this way, attribute values are obtained for all grid points TP. This completes the integration process.
[0099]
In this way, by integrating the volume data DV based on the silhouette image FS and the volume data DV based on the range data DR, it is possible to generate a highly accurate three-dimensional model ML that compensates for the respective defects.
[0100]
Therefore, even when the object has a concave region or a low reflectance portion, the three-dimensional shape can be accurately restored with as little memory capacity as possible and with a short calculation time.
[0101]
In the embodiment described above, the attribute value is set at the vertex of the voxel. However, it is not always necessary to set the attribute value at the vertex of the voxel. For example, it may be the center of gravity of the voxel.
[0102]
In addition, the distance value between the vertex and the boundary is set only for the voxel that intersects the boundary, but may be performed for all the voxels. However, the calculation time is shortened by calculating only the intersecting voxels as in the embodiment. Although the inside of the object is expressed as positive and the outside is expressed as negative, it may be reversed.
[0103]
In the fourth embodiment, an example in which a cube is divided into eight parts has been described. However, the present invention is not limited to eight parts, but is divided into three parts in each of xyz directions, that is, the cube may be divided into 27 parts or more. Also good.
[0104]
In the embodiment described above, the configuration of the whole or each part of the three-dimensional data generation device 1, the contents and order of processing, the number of voxels VX, the number of digits of attribute values, and the like are changed as appropriate in accordance with the spirit of the present invention. be able to.
[0105]
【The invention's effect】
According to the present invention, a three-dimensional shape can be accurately restored with as little memory capacity as possible and with a short calculation time even when there is a recessed area or a portion with low reflectance.
[Brief description of the drawings]
FIG. 1 is a block diagram of a three-dimensional data generation apparatus according to an embodiment.
FIG. 2 is a flowchart showing a flow of processing for generating a three-dimensional model by the three-dimensional data generating apparatus.
FIG. 3 is a flowchart showing conversion processing by the three-dimensional data generation apparatus.
FIG. 4 is a flowchart showing a modification of the conversion process.
FIG. 5 is a flowchart illustrating a conversion process according to the second embodiment.
FIG. 6 is a flowchart showing a subroutine of attribute value setting processing in step # 34 of FIG. 5;
FIG. 7 is a diagram for explaining a state in which a silhouette image is projected onto volume data.
8 is an enlarged view showing a part of the silhouette image shown in FIG.
FIG. 9 is a diagram illustrating a state in which volume data is cut along a horizontal plane.
FIG. 10 is an enlarged view showing boundary voxels.
FIG. 11 is a diagram showing an example of a volume table storing volume data.
FIG. 12 is a flowchart illustrating conversion processing according to the third embodiment.
FIG. 13 is a flowchart showing a subroutine of attribute value setting processing in step # 54 of FIG. 12;
FIG. 14 is a flowchart illustrating a conversion process according to the fourth embodiment.
FIG. 15 is a flowchart showing a subroutine of intersection determination processing in step # 75 of FIG.
FIG. 16 is a diagram for explaining the principle of octree representation;
FIG. 17 is a diagram for explaining the principle of octree representation;
FIG. 18 is a flowchart illustrating conversion processing according to the fifth embodiment.
FIG. 19 is a diagram for explaining space carving.
FIG. 20 is a diagram illustrating a state in which volume data is cut along a horizontal plane.
FIG. 21 is an enlarged view showing boundary voxels.
FIG. 22 is a diagram for explaining a method for obtaining a closest point;
FIG. 23 is a diagram for explaining a method for obtaining a closest point;
FIG. 24 is a diagram for explaining a method for obtaining a closest point;
FIG. 25 is a diagram for explaining a method for obtaining a closest point;
FIG. 26 is a diagram illustrating a positional relationship between an attribute value of a lattice point and the surface of an object.
FIG. 27 is a diagram illustrating a method for integrating two attribute values.
[Explanation of symbols]
1 3D data generator
10 Device body (first conversion means, second conversion means, integration means)
11 Magnetic disk unit
DV volume data
VX Voxel
FT image
FS silhouette image
CD CD-ROM (recording medium)
FD floppy disk (recording medium)
TL volume table (volume data)
PR modeling program (computer program)

Claims (8)

物体についての3次元形状データを生成する方法であって、
前記物体についての視点の異なる複数の画像からシルエット法を用いてボリュームデータに変換することによって第1のボリュームデータを生成する第1のステップ、
前記物体について3次元計測によって得られた3次元データをボリュームデータに変換することによって第2のボリュームデータを生成する第2のステップ、
前記第1のボリュームデータと第2のボリュームデータとを統合して1つのボリュームデータとする第3のステップ、を有し、
前記ボリュームデータは、ボリュームを表現する座標系内の離散的な各座標位置を格子点とする複数のボクセルによって構成され、前記各ボクセルの格子点において、物体の表面からの距離に応じた値が属性値として保持されており、
前記属性値について、当該格子点が物体の外部にあることを示す外部(遠)、当該格子点が物体の外部にあり前記外部(遠)よりも物体の表面に近いことを示す外部(近)、当該格子点が物体の内部にあることを示す内部(遠)、および、当該格子点が物体の内部にあり前記内部(遠)よりも物体の表面に近いことを示す外部(近)の4つに分類し、
前記第3のステップにおいて、前記各ボクセルの格子点について、前記第1のボリュームデータによる前記属性値と前記第2のボリュームデータによる前記属性値とに基づいて統合された属性値である統合属性値を求める、
ことを特徴とする3次元形状データの生成方法。
A method of generating three-dimensional shape data about an object,
A first step of generating first volume data by converting a plurality of images of the object from different viewpoints into volume data using a silhouette method;
A second step of generating second volume data by converting three-dimensional data obtained by three-dimensional measurement of the object into volume data;
A third step of integrating the first volume data and the second volume data into one volume data;
The volume data is composed of a plurality of voxels having lattice points at discrete coordinate positions in a coordinate system representing the volume, and a value corresponding to the distance from the surface of the object is obtained at the lattice point of each voxel. As an attribute value,
For the attribute value, the outside (far) indicating that the grid point is outside the object, and the outside (near) indicating that the grid point is outside the object and closer to the surface of the object than the outside (far). Inside (far) indicating that the grid point is inside the object, and outside (near) indicating that the grid point is inside the object and closer to the surface of the object than the inside (far). Classified into
In the third step, an integrated attribute value that is an attribute value integrated based on the attribute value based on the first volume data and the attribute value based on the second volume data on the lattice point of each voxel. Seeking
A method for generating three-dimensional shape data.
前記第1のボリュームデータによる前記属性値が前記外部(遠)である場合に、前記第2のボリュームデータによる前記属性値に係わらず、前記統合属性値を外部(遠)とし、When the attribute value by the first volume data is the external (far), the integrated attribute value is external (far) regardless of the attribute value by the second volume data,
前記第1のボリュームデータによる前記属性値および前記第2のボリュームデータによる前記属性値が共に内部(遠)である場合に、前記統合属性値を内部(遠)とし、When the attribute value based on the first volume data and the attribute value based on the second volume data are both internal (far), the integrated attribute value is internal (far),
前記第1のボリュームデータによる前記属性値が前記内部(遠)でありかつ前記第2のボリュームデータによる前記属性値が前記外部(遠)である場合に、前記統合属性値を外部(遠)とし、When the attribute value based on the first volume data is the inside (far) and the attribute value based on the second volume data is the outside (far), the integrated attribute value is set to the outside (far). ,
それ以外で前記第1のボリュームデータによる前記属性値と前記第2のボリュームデータによる前記属性値とが異なる場合に、前記統合属性値を外部(近)または内部(近)とし、Otherwise, if the attribute value according to the first volume data is different from the attribute value according to the second volume data, the integrated attribute value is external (near) or internal (near),
前記第1のボリュームデータによる前記属性値と前記第2のボリュームデータによる前記属性値との両方が外部(近)または内部(近)で同じである場合に、それら両方の前記属性値を混合して前記統合属性値を求める、When both the attribute value based on the first volume data and the attribute value based on the second volume data are the same on the outside (near) or inside (near), both the attribute values are mixed. To obtain the integrated attribute value,
請求項1記載の3次元形状データの生成方法。The method for generating three-dimensional shape data according to claim 1.
前記第1のボリュームデータによる前記属性値と前記第2のボリュームデータによる前記属性値との両方が外部(近)または内部(近)で同じである場合に、前記統合属性値dtを、次の式、
dt=wx・dr+(1−wx)ds
但し、wx:格子点における第2のボリュームデータによる属性値の重み
ds:第1のボリュームデータによる属性値
dr:第2のボリュームデータによる属性値
で算出する、
請求項2記載の3次元形状データの生成方法。
When both the attribute value based on the first volume data and the attribute value based on the second volume data are the same outside (near) or inside (near), the integrated attribute value dt is formula,
dt = wx · dr + (1−wx) ds
However, wx: Weight of attribute value by second volume data at grid point
ds: attribute value based on the first volume data
dr: attribute value based on second volume data
Calculate with
The method for generating three-dimensional shape data according to claim 2.
第1のステップにおいて、シルエット法を用いてボリュームデータに変換するに際し、
(a)ボリュームを表現する座標系内の離散的な各座標位置において、前記物体の画像の輪郭と当該画像の視点とにより定まる視体積の境界までの距離に応じた値を求めるステップ、
(b)各座標位置について、前記物体の複数の画像について求めた複数の値に基づいて物体表面からの距離に応じた値を決定し、各座標位置に対応付けて保持するステップ、
を実行する請求項1ないし3のいずれかに記載の3次元形状データの生成方法。
In the first step, when converting to volume data using the silhouette method,
(A) obtaining a value corresponding to the distance to the boundary of the visual volume determined by the contour of the image of the object and the viewpoint of the image at each discrete coordinate position in the coordinate system representing the volume;
(B) For each coordinate position, determining a value according to the distance from the object surface based on a plurality of values obtained for a plurality of images of the object, and holding the value in association with each coordinate position;
The method for generating three-dimensional shape data according to claim 1, wherein:
第2のステップにおいて、3次元データをボリュームデータに変換するに際し、
(a)ボリュームを表現する座標系内の離散的な各座標位置において、前記物体の3次元データで表される物体表面までの距離に応じた値を求めるステップ、
(b)求めた値を各座標位置に対応付けて保持するステップ、
を実行する請求項1ないし3のいずれかに記載の3次元形状データの生成方法。
In the second step, when converting the three-dimensional data into volume data,
(A) obtaining a value corresponding to the distance to the object surface represented by the three-dimensional data of the object at each discrete coordinate position in the coordinate system representing the volume;
(B) a step of holding the obtained value in association with each coordinate position;
The method for generating three-dimensional shape data according to claim 1, wherein:
物体についての3次元形状データを生成する装置であって、
前記物体についての視点の異なる複数の画像からシルエット法を用いてボリュームデータに変換することによって第1のボリュームデータを生成する第1の変換手段、
前記物体について3次元計測によって得られた3次元データをボリュームデータに変換することによって第2のボリュームデータを生成する第2の変換手段、および、
前記第1のボリュームデータと第2のボリュームデータとを統合して1つのボリュームデータとする統合手段、を有し
前記ボリュームデータは、ボリュームを表現する座標系内の離散的な各座標位置を格子点とする複数のボクセルによって構成され、前記各ボクセルの格子点において、物体の表面からの距離に応じた値が属性値として保持されており、
前記統合手段において、
前記属性値について、当該格子点が物体の外部にあることを示す外部(遠)、当該格子点が物体の外部にあり前記外部(遠)よりも物体の表面に近いことを示す外部(近)、当該格子点が物体の内部にあることを示す内部(遠)、および、当該格子点が物体の内部にあり前記内部(遠)よりも物体の表面に近いことを示す外部(近)の4つに分類し、
前記各ボクセルの格子点について、前記第1のボリュームデータによる前記属性値と前記第2のボリュームデータによる前記属性値とに基づいて統合された属性値である統合属性値を求める、
ことを特徴とする3次元形状データの生成装置。
An apparatus for generating three-dimensional shape data about an object,
First conversion means for generating first volume data by converting a plurality of images with different viewpoints of the object into volume data using a silhouette method;
Second conversion means for generating second volume data by converting three-dimensional data obtained by three-dimensional measurement of the object into volume data; and
Integration means for integrating the first volume data and the second volume data into one volume data ;
The volume data is composed of a plurality of voxels having lattice points at discrete coordinate positions in a coordinate system representing the volume, and a value corresponding to the distance from the surface of the object is obtained at the lattice point of each voxel. As an attribute value,
In the integration means,
For the attribute value, the outside (far) indicating that the grid point is outside the object, and the outside (near) indicating that the grid point is outside the object and closer to the surface of the object than the outside (far). Inside (far) indicating that the grid point is inside the object, and outside (near) indicating that the grid point is inside the object and closer to the surface of the object than the inside (far). Classified into
For the lattice points of each voxel, an integrated attribute value that is an attribute value integrated based on the attribute value by the first volume data and the attribute value by the second volume data is obtained.
An apparatus for generating three-dimensional shape data.
物体についての3次元形状データを生成するためのコンピュータプログラムであって、
前記物体についての視点の異なる複数の画像からシルエット法を用いてボリュームデータに変換することによって第1のボリュームデータを生成する第1のステップ、
前記物体について3次元計測によって得られた3次元データをボリュームデータに変換することによって第2のボリュームデータを生成する第2のステップ、
前記第1のボリュームデータと第2のボリュームデータとを統合して1つのボリュームデータとする第3のステップ、
の各処理をコンピュータに実行させるものであり、さらに、前記コンピュータに、
前記ボリュームデータは、ボリュームを表現する座標系内の離散的な各座標位置を格子点とする複数のボクセルによって構成され、前記各ボクセルの格子点において、物体の表面からの距離に応じた値が属性値として保持されるように処理を実行させ、
前記属性値について、当該格子点が物体の外部にあることを示す外部(遠)、当該格子点が物体の外部にあり前記外部(遠)よりも物体の表面に近いことを示す外部(近)、当該格子点が物体の内部にあることを示す内部(遠)、および、当該格子点が物体の内部にあり前記内部(遠)よりも物体の表面に近いことを示す外部(近)の4つに分類する処理を実行させ、
前記第3のステップにおいて、前記各ボクセルの格子点について、前記第1のボリュームデータによる前記属性値と前記第2のボリュームデータによる前記属性値とに基づいて統合された属性値である統合属性値を求める処理を実行させる、
ためのコンピュータプログラム。
A computer program for generating three-dimensional shape data about an object,
A first step of generating first volume data by converting a plurality of images of the object from different viewpoints into volume data using a silhouette method;
A second step of generating second volume data by converting three-dimensional data obtained by three-dimensional measurement of the object into volume data;
A third step of integrating the first volume data and the second volume data into one volume data;
The above processing is executed by a computer, and the computer further includes:
The volume data is composed of a plurality of voxels having lattice points at discrete coordinate positions in a coordinate system representing the volume, and a value corresponding to the distance from the surface of the object is obtained at the lattice point of each voxel. Execute the process so that it is retained as an attribute value,
For the attribute value, the outside (far) indicating that the grid point is outside the object, and the outside (near) indicating that the grid point is outside the object and closer to the surface of the object than the outside (far). Inside (far) indicating that the grid point is inside the object, and outside (near) indicating that the grid point is inside the object and closer to the surface of the object than the inside (far). Process to classify
In the third step, an integrated attribute value that is an attribute value integrated based on the attribute value based on the first volume data and the attribute value based on the second volume data on the lattice point of each voxel. To execute the process for
Computer program for.
請求項7記載のコンピュータプログラムが記録されたコンピュータ読み取り可能な記録媒体。  A computer-readable recording medium on which the computer program according to claim 7 is recorded.
JP2001177582A 2001-06-12 2001-06-12 Method and apparatus for generating three-dimensional shape data and computer program Expired - Fee Related JP4904638B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2001177582A JP4904638B2 (en) 2001-06-12 2001-06-12 Method and apparatus for generating three-dimensional shape data and computer program
US10/166,261 US6914601B2 (en) 2001-06-12 2002-06-11 Method, apparatus, and computer program for generating three-dimensional shape data or volume data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001177582A JP4904638B2 (en) 2001-06-12 2001-06-12 Method and apparatus for generating three-dimensional shape data and computer program

Publications (2)

Publication Number Publication Date
JP2002366934A JP2002366934A (en) 2002-12-20
JP4904638B2 true JP4904638B2 (en) 2012-03-28

Family

ID=19018403

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001177582A Expired - Fee Related JP4904638B2 (en) 2001-06-12 2001-06-12 Method and apparatus for generating three-dimensional shape data and computer program

Country Status (1)

Country Link
JP (1) JP4904638B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4557629B2 (en) * 2004-08-06 2010-10-06 株式会社東芝 Image processing method, image processing program, and image processing computer
JP5120926B2 (en) 2007-07-27 2013-01-16 有限会社テクノドリーム二十一 Image processing apparatus, image processing method, and program
JP6518517B2 (en) * 2015-05-29 2019-05-22 株式会社日立製作所 Point cloud data modeling device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001084403A (en) * 1999-09-10 2001-03-30 Minolta Co Ltd Method and device for synthesizing three-dimensional data

Also Published As

Publication number Publication date
JP2002366934A (en) 2002-12-20

Similar Documents

Publication Publication Date Title
US8711143B2 (en) System and method for interactive image-based modeling of curved surfaces using single-view and multi-view feature curves
KR101388133B1 (en) Method and apparatus for creating a 3D model from 2D photograph image
KR101744079B1 (en) The face model generation method for the Dental procedure simulation
KR101681095B1 (en) Apparatus and method for generating depth image that have same viewpoint and same resolution with color image
CN109003333B (en) Interactive grid model cutting method and device based on texture and modeling equipment
US20240153123A1 (en) Isogeometric Analysis Method Based on a Geometric Reconstruction Model
WO2021142996A1 (en) Point cloud denoising method, system, and device employing image segmentation, and storage medium
JP2011129082A (en) Three-dimensional object recognition device and three-dimensional object recognition method
JP4035978B2 (en) Three-dimensional shape model evaluation method, generation method, and apparatus
JP6863596B6 (en) Data processing device and data processing method
CN109191554A (en) A kind of super resolution image reconstruction method, device, terminal and storage medium
US6914601B2 (en) Method, apparatus, and computer program for generating three-dimensional shape data or volume data
JP2000348213A (en) Three-dimensional image generating device, three- dimensional image generating and display device, and method thereof and recording medium
Verykokou et al. A Comparative analysis of different software packages for 3D Modelling of complex geometries
JP4229398B2 (en) Three-dimensional modeling program, three-dimensional modeling control program, three-dimensional modeling data transmission program, recording medium, and three-dimensional modeling method
CN109448135A (en) A method of the threedimensional model repairing based on multi-source data
JP3950376B2 (en) Shape model generation method and apparatus from three-dimensional point group, shape model generation program from three-dimensional point group, and recording medium recording the program
JP4904638B2 (en) Method and apparatus for generating three-dimensional shape data and computer program
JP2002366935A (en) Method and device for generating three-dimensional shape data and computer program
JP4320577B2 (en) Three-dimensional model generation method and apparatus, and computer program
KR101699847B1 (en) Apparatus and method for clipping for 3d graphic rendering
IL280826B2 (en) Determining an enclosing wall surface of a cavity of an organ
JP3739209B2 (en) Automatic polygon generation system from point cloud
JP2003123057A (en) Method and device for generating three-dimensional shape model
KR101673442B1 (en) The method and apparatus for remeshing visual hull approximation by DBSS(displaced butterfly subdivision surface)

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20050613

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20050704

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080425

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110112

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110125

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110325

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20111226

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

Free format text: PAYMENT UNTIL: 20150120

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees