JP4091455B2 - Three-dimensional shape measuring method, three-dimensional shape measuring apparatus, processing program therefor, and recording medium - Google Patents

Three-dimensional shape measuring method, three-dimensional shape measuring apparatus, processing program therefor, and recording medium Download PDF

Info

Publication number
JP4091455B2
JP4091455B2 JP2003050687A JP2003050687A JP4091455B2 JP 4091455 B2 JP4091455 B2 JP 4091455B2 JP 2003050687 A JP2003050687 A JP 2003050687A JP 2003050687 A JP2003050687 A JP 2003050687A JP 4091455 B2 JP4091455 B2 JP 4091455B2
Authority
JP
Japan
Prior art keywords
distance
spatial frequency
frequency spectrum
region
subject
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 - Lifetime
Application number
JP2003050687A
Other languages
Japanese (ja)
Other versions
JP2004257934A (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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2003050687A priority Critical patent/JP4091455B2/en
Publication of JP2004257934A publication Critical patent/JP2004257934A/en
Application granted granted Critical
Publication of JP4091455B2 publication Critical patent/JP4091455B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は被計測物体の3次元形状を計測する3次元形状計測装置に関し、特に計測産業、通信産業、映像産業等の分野において使用される3次元形状計測装置に適用して有効な技術に関するものである。
【0002】
【従来の技術】
近年、携帯機器等で3次元画像が取り扱われる様になり、3次元画像の入力手段として、小型、低コスト、低消費電力、計測環境や計測範囲に制限の無い3次元形状計測装置が求められている。ところが、従来の3次元計測装置ではこれらの条件を全て満たせるものが存在しなかった。
【0003】
例えば、被計測物体に光を照射して計測するアクティブ型3次元計測装置は、照射光源を駆動するため消費電力が大きい、計測距離に制限がある、環境光に制限があり例えば太陽光の元では動作できない等の欠点を有する。また、これらの手法は照射光にレーザを用いる場合が多いが、この場合、安全性の観点においても民生用としては不適である。
【0004】
一方、被計測物体に特別な光を照射すること無く計測を行うパッシブ型3次元計測装置があれば上記の問題を解決できる。しかしながら、パッシブ型に属する3次元計測方法は性能に難点がある他、特に信頼性が低いため、大半の方法は実用的な計測装置を作れる段階に至っていない。
【0005】
ところで、Shape from Focusと呼ばれるパッシブ型に属する3次元計測方法がある(例えば非特許文献1参照)。この方法は異なった焦点位置の異なる複数の撮影手段で撮影した画像情報を取得し、該画像から撮影対象の3次元形状を求める。この方法の原理は、ある焦点位置の撮影手段で撮影した画像においては、焦点位置に近い領域は鮮明に写るのに対して、焦点位置から離れた領域はぼやけて写ることを利用して距離計測を行う。具体的には、画像内の各画素を中心とする近傍の空間周波数スペクトルを求め、ぼやけ具合を該空間周波数スペクトル強度の周波数に対する減衰率の大きさから求めることによって、該画素における被写体の距離を算出することにより実現できる。この方法は焦点位置を制御できるカメラだけで装置を構成できるので、極めて小型に出来、価格や消費電力等の点でも優位性が高い。一方、この方法は計測精度や分解能が低いが、民生用途ではこれらの性能は低くて十分なことが多い。
【0006】
しかしながら、従来のShape from Focusには以下に示す欠点があった。
1.画像内で濃淡の変化に乏しい領域は計測困難であり、無理に計測しても非常に計測誤差が多いばかりか、完全な誤計測によって無意味な距離を算出することもある。
2.1枚の画像だけからでは、遠距離にあるためぼやけて写っているのか、元々画材はぼやけて見える近距離の被写体だったのかを区別できないため、これを区別する為に焦点位置の異なる複数枚の画像を必要とする。この必要な画像枚数は分解能向上の目的の他、前記の計測誤差を小さくする目的もあり数十枚用いる場合もある。
3.複数枚の撮影画像の全画素について空間周波数スペクトルを求めるため計算コストが非常に大きい。
【0007】
これらの欠点を克服する方法として、被計測物体に種々のパターンのレーザ光を照射してぼやけ方を計測するアクティブ型の3次元計測装置がある(例えば特許文献1参照)。これは確実に安定した計測ができるので上記問題の1と2を解決できるものの、前記のアクティブ型の欠点を全て抱え込む問題が新たに生じる。
【0008】
【非特許文献1】
A.Pentland "A New Sense for Depth of Field", pp.523-531,VOL.PAMI-9,No.4,JULY 1987
【特許文献1】
特開2002−56348号公報
【0009】
【発明が解決しようとする課題】
前記の様に従来のShape from Focusと呼ばれるパッシブ型に属する3次元計測方法では、画像内で濃淡の変化に乏しい領域が計測困難、焦点位置の異なる数十枚の画像を必要とする、複数枚の撮影画像の全画素について空間周波数スペクトルを求めるため計算コストが非常に大きいという問題があり、一方、これらの欠点を克服する為にアクティブ型の3次元計測装置を用いた場合には、消費電力が大きい、計測距離に制限がある、環境光に制限がある、安全性の観点において民生用としては不適であるという問題がある。
【0010】
本発明の目的は、上記問題を解決し、1枚の画像だけからShape from Focus法によって簡易的な3次元形状を求めることが可能な技術を提供することにある。また本発明の他の目的は、2枚の画像だけからShape from Focus法によってより精度が高く計測範囲も広い3次元形状を求めることが可能な技術、計算コストを大幅に削減し処理時間を短縮させることが可能な技術、性能低下を最小限に押さえながら効率良く計算コストを削減することが可能な技術や、動力を不要として低コスト化をはかり、かつ、簡便な操作で高速に焦点位置を変更することが可能な技術を提供することにある。
【0011】
【課題を解決するための手段】
本発明は、所定の焦点位置で撮影された撮影画像における空間周波数スペクトルのスペクトル強度減衰率からその領域と撮影手段間の距離を求めるものである。
【0012】
本発明の3次元形状計測装置では、所定の焦点位置の撮影手段によって撮影が行われると、その撮影手段で撮影された撮影画像を画像入力手段により入力し、撮影画像内の輝度変化が所定値以上である領域の空間周波数スペクトルを空間周波数スペクトル演算手段により求める。
【0013】
そして前記領域の空間周波数に対するスペクトル強度の減衰が最小となる方向のスペクトル強度減衰率を減衰率演算手段により求めた後、その求めたスペクトル強度減衰率から該領域と撮影手段までの距離を距離演算手段により求める。すなわち、スペクトル強度減衰率は焦点から該領域までの距離情報を反映するので、スペクトル強度減衰率より焦点から該領域までの距離を求めた後、その求めた距離に焦点位置と撮影手段までの距離を加えることによって撮影手段と該領域間の距離を求める。また前記撮影画像内の輝度変化が前記所定値未満の領域については、距離が求められた領域からの補間によって当該被写体と前記撮影手段との距離を求める。
【0014】
前記の様に本発明の3次元形状計測装置では、所定の焦点位置で撮影された撮影画像における空間周波数スペクトルのスペクトル強度減衰率からその領域と撮影手段間の距離を求めるので、ある距離までの撮影対象の3次元形状の概略を簡易に計測することが可能となる。
【0015】
また本発明の3次元形状計測装置では、異なる焦点位置で撮影された2つの撮影画像における空間周波数スペクトルのスペクトル強度減衰率からその領域と撮影手段間の距離を求めるものとしても良い。
【0016】
すなわち本発明の3次元形状計測装置において、画像入力手段により、所定の位置に焦点位置を有する第1の撮影手段で撮影された第1の撮影画像と前記所定の位置とは異なる焦点位置を有する第2の撮影手段で撮影された第2の撮影画像とをそれぞれ入力する。
【0017】
次に空間周波数スペクトル演算手段により、前記第1及び第2の撮影画像内の輝度変化の少なくとも一方が所定値以上の領域について、輝度変化がより大きい方の撮影画像の空間周波数スペクトル及び他方の撮影画像の空間周波数スペクトルをそれぞれ第1の空間周波数スペクトル及び第2の空間周波数スペクトルとして求める。
【0018】
そして、減衰率演算手段により、前記第1の空間周波数スペクトルについて、空間周波数に対するスペクトル強度の減衰が最小となる方向の減衰率を第1の減衰率として求め、前記第2の空間周波数スペクトルについて、同じ方向の空間周波数に対するスペクトル強度の減衰率を第2の減衰率として求めた後、距離演算手段により、前記第1及び第2の減衰率に基づき当該領域の被写体と前記第1または第2の撮影手段との距離を求める。すなわち、前記第1及び第2の減衰率の比は焦点位置から該領域までの距離情報を反映するので、この比より焦点位置から該領域までの距離を求めた後、その求めた距離に焦点位置と撮影手段までの距離を加えることによって撮影手段と該領域間の距離を求める。また前記撮影画像内の輝度変化が前記所定値未満の領域については、距離が求められた領域からの補間によって当該被写体と前記撮影手段との距離を求める。
【0019】
前記の様に本発明の3次元形状計測装置では、異なる焦点位置で撮影された2つの撮影画像における空間周波数スペクトルのスペクトル強度減衰率からその領域と撮影手段間の距離を求めるので、撮影対象の3次元形状を簡易に計測することが可能であり、単一の撮影画像を用いた場合よりも正確に距離を求められる、遠方の距離も計測できる等の長所を有している。
【0020】
また本発明の3次元形状計測装置では、所定の焦点位置で撮影された撮影画像または異なる焦点位置で撮影された2つの撮影画像における空間周波数スペクトルのスペクトル強度減衰率からその領域と撮影手段間の距離を求める際に、輝度変化する境界部の法線方向における1次元空間周波数スペクトルのスペクトル強度減衰率から距離を求めるものとしても良い。
【0021】
すなわち本発明の3次元形状計測装置において、画像入力手段により、所定の位置に焦点位置を有する撮影手段で撮影された撮影画像や、異なる焦点位置を有する撮影手段で撮影された2つの撮影画像を入力した後、スペクトル演算手段により、所定の焦点位置で撮影された撮影画像内で輝度変化が所定値以上の領域、または異なる焦点位置で撮影された輝度変化がより大きい方の撮影画像内で輝度変化が所定値以上の領域について、該輝度変化の境界部の法線方向と該法線方向の1次元空間周波数スペクトルとを求める。
【0022】
次に減衰率演算手段により、前記法線方向の1次元空間周波数スペクトルについて、空間周波数に対するスペクトル強度の減衰率を求め、その求めたスペクトル強度減衰率に基づき当該領域の被写体と前記撮影手段との距離を求める。また前記撮影画像内の輝度変化が前記所定値未満の領域については、距離が求められた領域からの補間によって当該被写体と前記撮影手段との距離を求める。
【0023】
前記の様に本発明の3次元形状計測装置では、輝度変化する境界部の法線方向における次元空間周波数スペクトルのスペクトル強度減衰率から距離を求めるので、2次元の空間周波数スペクトルを求める必要が無くなって計算コストを大幅に削減することが可能となり、処理時間も短縮できる。
【0024】
また本発明の3次元形状計測装置では、所定の焦点位置で撮影された撮影画像または異なる焦点位置で撮影された2つの撮影画像における空間周波数スペクトルのスペクトル強度減衰率からその領域と撮影手段間の距離を求める際に、水平方向の1次元空間周波数スペクトルのスペクトル強度減衰率から距離を求めるものとしても良い。
【0025】
すなわち本発明の3次元形状計測装置において、画像入力手段により、所定の位置に焦点位置を有する撮影手段で撮影された撮影画像や、異なる焦点位置を有する撮影手段で撮影された2つの撮影画像を入力した後、スペクトル演算手段により、所定の焦点位置で撮影された撮影画像内で輝度変化が所定値以上の領域、または異なる焦点位置で撮影された輝度変化がより大きい方の撮影画像内で輝度変化が所定値以上の領域について、水平方向の1次元空間周波数スペクトルを求める。
【0026】
次に減衰率演算手段により、前記水平方向の1次元空間周波数スペクトルについて、空間周波数に対するスペクトル強度の減衰率を求め、その求めたスペクトル強度減衰率に基づき当該領域の被写体と前記撮影手段との距離を求める。また前記撮影画像内の輝度変化が前記所定値未満の領域については、距離が求められた領域からの補間によって当該被写体と前記撮影手段との距離を求める。
【0027】
前記の様に本発明の3次元形状計測装置では、水平方向の1次元空間周波数スペクトルのスペクトル強度減衰率から距離を求めるので、2次元の空間周波数スペクトルを求める必要が無く、輝度変化する境界部の向きを求める必要も無くなることから、計算コストを大幅に削減することが可能となり、処理時間も短縮できる。
また本発明の3次元形状計測装置では、可変光学系による焦点位置可変撮影装置を用いるものとしても良い。
【0028】
すなわち、可動部が駆動されることによって焦点位置が変化する光学系と、2段階の押す深さを持つシャッタと、前記シャッタの押された深さに応じて前記光学系の可動部を駆動する伝達手段とを備える焦点位置可変撮影装置を用い、シャッタが1段目の深さまで押し込まれた場合には所定の焦点位置で撮影を行い、更にシャッタが2段目の深さまで押し込まれた場合には、伝達手段により前記シャッタの押された深さに応じて可動部を駆動して撮像素子または結像光学系若しくはその両方を移動させ、前記所定の焦点位置とは異なる焦点位置で撮影を行う。
【0029】
前記の様に本発明の3次元形状計測装置では、可変光学系による焦点位置可変撮影装置を用いることにより、3次元形状計測を行う際に、焦点位置を動かす為の専用の動力が必要無くなる、撮影者に特別な操作を強いることなく自然かつ高速に可変焦点撮影が可能となる等の利点が得られる。
【0030】
以上の様に本発明の3次元形状計測装置によれば、所定の焦点位置で撮影された撮影画像や、異なる焦点位置で撮影された2つの撮影画像における空間周波数スペクトルのスペクトル強度減衰率からその領域と撮影手段間の距離を求めるので、従来よりも少ない枚数の画像だけからShape from Focus法によって簡易的な3次元形状を求めることが可能である。
【0031】
【発明の実施の形態】
(実施形態1)
以下に所定の焦点位置で撮影された撮影画像における空間周波数スペクトルのスペクトル強度減衰率からその領域と撮影手段間の距離を求める実施形態1の3次元形状計測装置について説明する。
【0032】
図1は本実施形態の3次元形状計測装置の概略構成を示す図である。図1に示す様に本実施形態の3次元形状計測装置は、画像入力手段102と、空間周波数スペクトル演算手段103と、スペクトル強度減衰率演算手段104と、距離演算手段105と、補間演算手段106とを有している。
【0033】
画像入力手段102は、所定の位置に焦点位置を有する撮影手段101で撮影された撮影画像を入力する手段である。空間周波数スペクトル演算手段103は、前記入力した撮影画像内の輝度変化が所定値以上の領域について空間周波数スペクトルを求める手段である。
【0034】
スペクトル強度減衰率演算手段104は、前記求めた空間周波数スペクトルについて、空間周波数に対するスペクトル強度の減衰が最小となる方向の減衰率を求める手段である。距離演算手段105は、前記求めた減衰率に基づき当該領域の被写体と撮影手段101との距離を求める手段である。
【0035】
補間演算手段106は、前記入力した撮影画像内の輝度変化が前記所定値未満の領域について、距離演算手段105により距離が求められた領域からの補間によって被写体と撮影手段101との距離を求める手段である。
【0036】
また本実施形態の3次元形状計測装置は、コンピュータとプログラムによっても実現でき、そのプログラムを記録媒体に記録することも、ネットワークを通して提供することも可能であるものとする。
【0037】
図2は本実施形態の3次元形状計測装置の処理概要を示す図である。焦点位置の近い撮影手段101によって撮影が行われると、ステップ201で3次元形状計測装置の画像入力手段102は、その撮影手段101で撮影された撮影画像206を入力する。取得された撮影画像206は撮影手段101から距離の近い領域207は鮮明に写っているのに対して距離の遠い領域208はぼやけた画像となっている。
【0038】
ステップ202において空間周波数スペクトル演算手段103は、撮影画像内の輝度変化が所定値以上である領域の空間周波数スペクトルを求める。
【0039】
まず、輝度変化が所定の設定値以上の領域を抽出した輪郭領域抽出データ209を求める。すると、物体の輪郭部等はその他の領域に比べると輝度変化が著しく大きいので、輝度変化が所定の設定値以上の領域を取り出すことによって輪郭部をより多く含む領域が効率良く抽出できる。
【0040】
次に、この領域に含まれる点毎に空間周波数スペクトルを求める。例えば、領域上のある点210の空間周波数スペクトルを求めると空間周波数スペクトル211に示す2次元の空間周波数スペクトルが得られる。なお、空間周波数スペクトル211のスペクトル強度を表す縦軸は対数的に取っているものとする。
【0041】
ステップ203においてスペクトル強度減衰率演算手段104は、ステップ202で抽出された領域の空間周波数に対するスペクトル強度の減衰が最小となる方向の減衰率を求める。
【0042】
例えば空間周波数スペクトル211の減衰率は領域212の平均値として得られる。なお、求めた空間周波数スペクトル211は2次元で表現されるので、最もスペクトル強度の減衰が小さい方向を決定してその方向における傾斜の平均値を求める減衰率とする。鮮明に写っている画像であれば減衰率は小さいが、焦点が合っていない領域のぼやけた画像はより大きな減衰率となる。
【0043】
空間周波数に対するスペクトル強度の減衰が最小となる方向を選んで減衰率を求めるのは、この方向におけるスペクトル強度の減衰率が、最も安定して測定可能であり、かつ、最も被写体の奥行き方向の距離情報を反映しているためである。
【0044】
ステップ204において距離演算手段105は、ステップ203で求めたスペクトル強度減衰率からその領域と撮影手段101までの距離を求める。焦点位置から遠い距離にある物体ほど画像がぼやけるのでその減衰率を-k[dB/Oct(dB per octave)]とすれば、kは焦点から該領域までの距離情報を反映するのでkより焦点から該領域までの距離を求めることが出来る。また、焦点位置と撮影手段101までの距離は既知なので前記求めた距離に焦点位置と撮影手段101までの距離を加えることによって撮影手段101と該領域間の距離が求められる。
【0045】
ところで、kはレンズの焦点位置自体、絞りの大きさ、レンズのMTF(Modulation Transfer Function;振幅伝達関数の略称であり、ある光学系で明暗の縞模様を結像させたときの明暗のコントラスト低下の度合いを表わす)、絞り等で生じる回折の影響も受けて変動するが、これら全ての影響を解析的に除去することは困難である。そこで、これらの影響要因が被写体に依存せず撮影手段の結像光学系のみで決まることに着目し、予めその撮影手段を用いて、不連続に輝度変化する領域の、ある被写体(例えば、右半分が黒、左半分が白の平面等)を距離を変えて撮影していき、距離とスペクトル強度減衰率をその都度計測することによって、減衰率→距離参照テーブル213を事前に作成しておく。この参照テーブルは、撮影手段の結像光学系の影響を全て織り込み済みなので、その後の計測時には、求めた減衰率から参照テーブルを参照して距離を読み出すことによって、撮影手段の結像光学系の影響を除去して距離だけを求めることが出来る。
【0046】
ステップ205において補間演算手段106は、ステップ204までの処理で距離の求められなかった領域について、距離演算手段105により距離を求めた近傍の領域から補間することによって距離を生成する。例えば、距離の求められなかった領域にある画素214の奥行きの距離zは、近傍の距離の求められたi点の画素215に対して、画素214までの距離をli、その画素における奥行き距離をZiとして、以下の数1による線形補間(1次補間)で求める。
【0047】
【数1】
z = Σ(Zi/li)/Σ(1/li)
【0048】
なお、近傍領域は所定面積の領域とするか、距離の求められた画素を所定数含む面積可変の領域とするか、また、補間方法も高次の補間方法、種々のスプライン関数に代表される有理補間方法等、様々なバリエーションがあり得るが、本発明の補間方法は特定の近傍領域の定義や補間方法に限定されるものではない。
【0049】
ステップ204までの処理で距離を求められなかった領域は、ステップ202において輝度変化がある設定値以下であった領域である。これらの領域は連続に輝度変化している場合が多いので、近傍の距離の求められた部分から補間して求めても比較的良い近似値を得ることが出来る。
【0050】
前記の様に本実施形態の3次元形状計測方法では、これらのステップを適用することによって、ある距離までの撮影対象の3次元形状の概略を簡易に計測することが可能となる。
次に、本実施形態の3次元形状計測装置のより具体的な構成と、その動作について説明する。
【0051】
図3は本実施形態の3次元形状計測装置の具体例を示す図である。図3の撮影カメラ301は焦点位置の近いカメラ、画像入力部302は撮影カメラ301で撮影された撮影画像を入力する入力部、画像記録メモリ303は入力された撮影画像を記録する為のメモリ、エッジ検出器304は画像内において画素の輝度値の変化が所定の設定値以上の領域を検出する検出器、輝度変化領域記録メモリ305は輝度値の変化が所定の設定値以上の領域を記録する為のメモリ、空間周波数スペクトル演算器306は撮影画像内の輝度変化が所定値以上の領域について空間周波数スペクトルを求める演算器である。エッジ検出器304、輝度変化領域記録メモリ305及び空間周波数スペクトル演算器306の組み合わせによって図2に掲げた空間周波数スペクトル演算手段103を構成している。
【0052】
空間周波数スペクトル記録メモリ307は前記求められた空間周波数スペクトルを記録する為のメモリ、最大分布方向検出器308は前記求められた空間周波数スペクトルの分布が最も広がっている方向を検出する検出器、スペクトル強度減衰率演算器309は最大分布方向検出器308が検出した方向における空間周波数に対するスペクトル強度の減衰率を算出する演算器、距離演算器310はスペクトル強度減衰率の値を距離に変換する演算器、減衰率→距離参照テーブル325はスペクトル強度減衰率の値を距離に変換する際に参照する参照テーブル、補間演算器311は近傍の距離を求めた領域から距離の値を補間する演算器、3次元形状記録メモリ312は計測された3次元形状データを格納する為のメモリである。また撮影物体313は撮影の対象となる物体であり、焦点位置314は撮影カメラ301のピントが最も合う位置を示している。なお、本装置の計測範囲の最も近距離側は焦点位置314までとなる。
【0053】
撮影画像データ315は、撮影カメラ301によって撮影され画像記録メモリ303に記録された画像データを表している。輪郭領域抽出データ316は、エッジ検出器304によって検出され輝度変化領域記録メモリ305に記録された、画素の輝度値の変化がある設定値以上であった領域を表している。空間周波数スペクトル317は、空間周波数スペクトル演算器306によって求められ空間周波数スペクトル記録メモリ307に記録された、ある画素を中心とする空間周波数スペクトルを表している。
【0054】
ある画素を中心とする空間周波数スペクトルは、1画素につき、この図の様に2次元分布のデータとなる。一般に空間周波数スペクトルは中心点(直流成分)が最大となり、空間周波数が増大するにつれて減衰していく。また空間周波数スペクトルは、輪郭部の法線方向に最も高周波数まで分布し、接線方向には急激な減衰を示す。
【0055】
図4は本実施形態の図3の3次元形状計測装置の処理手順を示すフローチャートである。図3の装置を用いて本実施形態の3次元形状計測方法を実行する動作を図4のフローチャートに従って説明する。
【0056】
撮影カメラ301で撮影物体313が撮影されると、ステップ401において画像入力部302は、撮影カメラ301で撮影された撮影画像を入力し、その入力した撮影画像データ315を画像記録メモリ303に記録する。
【0057】
ステップ402においてエッジ検出器304は、画像記録メモリ303から撮影画像データ315を読み出し、ある画素とその画素に隣接する画素の輝度値の差が予め設定した値以上である様な画素を全て抽出することによって輪郭領域を決定し、その輪郭領域の画素の情報を取り出して輝度変化領域記録メモリ305に輪郭領域抽出データ316の様に書き込む。なお、この時、隣接条件は4近傍であっても8近傍であっても構わないものとする。
【0058】
図5は本実施形態の画素の隣接条件の概要を示す図である。図5に示す様に、撮影画像データ315の座標(x,y)の画素Px,yと隣接する8近傍の画素は、Px-1,y-1、Px-1,y、Px-1,y+1、Px,y-1、Px,y+1、Px+1,y-1、Px+1,y、Px+1,y+1であり、4近傍の画素は、Px-1,y、Px,y-1、Px,y+1、Px+1,yである。
【0059】
ステップ403において空間周波数スペクトル演算器306は、輝度変化領域記録メモリ305から輪郭領域を読み出して、各々の画素毎に該画素を中心とする近傍のN×N画素の画像を画像記録メモリ303から読み出し、該近傍領域の画素をフーリエ変換することによって空間周波数スペクトル317を求めて空間周波数スペクトル記録メモリ307に書き込む。
【0060】
本実施形態ではフーリエ変換を用いる例をあげたが、コサイン/サイン変換やWaveLet変換等の異なる直交基底変換を用いても構わない。また空間周波数スペクトル分布の概略が近似的に判れば良いので、アダマール変換やウォルシュ変換等を用いることも可能であり、本実施形態は空間周波数スペクトルを求める為に使用する直交基底変換関数の種類を限定するものではない。また、FFTやWFT等の高速演算法を用いても良く、本実施形態は高速化の有無やその手法を限定するものではない。
【0061】
ステップ404において最大分布方向検出器308は、前記求められた空間周波数スペクトル317が最も高周波領域まで伸びている最大分布方向318を検出する。空間周波数スペクトル317は、図の様な分布形状をしているので、中心から各方向毎に周波数に対するスペクトル強度の減衰率を求めて最も減衰率の小さい方向を最大分布方向318としても良いが、ある空間周波数ωだけ中心から離れた同心円上において最大の空間周波数である地点と中心を結ぶことによって簡易的に最大分布方向318を検出しても良い。
【0062】
ステップ405においてスペクトル強度減衰率演算器309は、前記検出された最大分布方向318に向けた空間周波数スペクトル強度の周波数に対する減衰の平均値を求め、この値をスペクトル強度減衰率とする。
【0063】
ステップ406において距離演算器310は、減衰率→距離参照テーブル325を参照し、前記求められたスペクトル強度減衰率に対応する距離を減衰率→距離参照テーブル325から求める。なお、減衰率→距離参照テーブル325は図6に示す手順に従って以下の手続きで予め作成されているものとする。
【0064】
図6は本実施形態の減衰率→距離参照テーブル作成処理の処理手順を示すフローチャートである。右半分が黒で左半分が白の校正用撮影板608が撮影カメラ301の焦点位置x0に置かれると、ステップ601において3次元形状計測装置は、校正用撮影板608と撮影カメラ301との距離xを初期値のx0に設定する。
【0065】
次に撮影カメラ301によって校正用撮影板608が撮影されると、ステップ602において画像入力部302は、撮影された撮影画像を撮影カメラ301から入力し、画像記録メモリ303に格納する。
【0066】
ステップ603において空間周波数スペクトル演算器306は、前記格納した撮影画像を画像記録メモリ303から読み出した後、その撮影画像より白と黒の境界部における水平方向の空間周波数スペクトルを求め、空間周波数スペクトル記録メモリ307に格納する。
【0067】
ステップ604においてスペクトル強度減衰率演算器309は、前記格納した空間周波数スペクトルを空間周波数スペクトル記録メモリ307から読み出した後、水平方向の空間周波数スペクトル強度の周波数に対する減衰の平均値を求め、この値をスペクトル強度減衰率kとする。
【0068】
ステップ605において3次元形状計測装置は、校正用撮影板608と撮影カメラ301との距離xの値と前記求められたスペクトル強度減衰率kのペアを減衰率→距離参照テーブル325に書き加えていく。
【0069】
次に校正用撮影板608の位置がδxだけ撮影カメラ301から離されると、ステップ606において3次元形状計測装置は、校正用撮影板608と撮影カメラ301との距離xの値にδxを加算する。
【0070】
ステップ607では、校正用撮影板608との距離xの値と予め設定した最大計測距離とを比較し、距離xが最大計測距離以上であるならこの処理を終了し、そうでなければステップ602に戻る。以上のステップによって減衰率→距離参照テーブル325を生成する。
【0071】
ステップ407において補間演算器311は、ステップ402で取り出されなかった画素、即ち、距離演算器310によって距離の求められなかった画素全てについてステップ408とステップ409を適用することによってその画素における距離を補間生成する。
【0072】
ステップ408において補間演算器311は、ある画素を選択し、補間概略図319の様にその画素を原点320にした時の第1象限から第4象限までの各象限毎に該画素に最も近くかつ距離の求められた画素を1つずつ選択することによって、計4つの画素321〜324を求め、数1に従って該画素における距離を補間生成する。なお、第1象限から第4象限までの4画素を選択する理由は、補間される画素が必ず4画素を結ぶ四角形の内部に存在するのでより精度の高い内挿による補間が可能となるからである。しかしながら、画像の四隅に近い画素は必ずしもこの選択法で4画素求められないため、その場合には求められた画素のみから数1に従って補間生成する。また、本実施形態では各象限毎に画素を1つ選択したが、本実施形態は画素の選択法をこれに限定するものではない。そしてステップ409において補間演算器311は、前記補間生成した距離を3次元形状記録メモリ312に書き込む。
【0073】
以上説明した様に本実施形態の3次元形状計測装置によれば、所定の焦点位置で撮影された撮影画像における空間周波数スペクトルのスペクトル強度減衰率からその領域と撮影手段間の距離を求めるので、1枚の画像だけからShape from Focus法によって簡易的な3次元形状を求めることが可能である。
【0074】
(実施形態2)
以下に異なる焦点位置で撮影された2つの撮影画像における空間周波数スペクトルのスペクトル強度減衰率からその領域と撮影手段間の距離を求める実施形態2の3次元形状計測装置について説明する。
【0075】
図7は本実施形態の3次元形状計測装置の概略構成を示す図である。図7に示す様に本実施形態の3次元形状計測装置は、画像入力手段703と、空間周波数スペクトル演算手段704と、スペクトル強度減衰率演算手段705と、距離演算手段706と、補間演算手段707とを有している。
【0076】
画像入力手段703は、所定の位置に焦点位置を有する第1の撮影手段701で撮影された第1の撮影画像と前記所定の位置とは異なる焦点位置を有する第2の撮影手段702で撮影された第2の撮影画像とをそれぞれ入力する手段である。
【0077】
空間周波数スペクトル演算手段704は、前記入力した第1及び第2の撮影画像内の輝度変化の少なくとも一方が所定値以上の領域について、輝度変化がより大きい方の撮影画像の空間周波数スペクトル及び他方の撮影画像の空間周波数スペクトルをそれぞれ第1の空間周波数スペクトル及び第2の空間周波数スペクトルとして求める手段である。
【0078】
スペクトル強度減衰率演算手段705は、前記第1の空間周波数スペクトルについて、空間周波数に対するスペクトル強度の減衰が最小となる方向の減衰率を第1の減衰率として求め、前記第2の空間周波数スペクトルについて、同じ方向の空間周波数に対するスペクトル強度の減衰率を第2の減衰率として求める手段である。
【0079】
距離演算手段706は、前記求めた第1及び第2の減衰率に基づき当該領域の被写体と前記第1の撮影手段701または第2の撮影手段702との距離を求める手段である。補間演算手段707は、前記入力した第1及び第2の撮影画像内の輝度変化がいずれも前記所定値未満の領域について、距離演算手段706により距離が求められた領域からの補間によって当該被写体と前記第1の撮影手段701または第2の撮影手段702との距離を求める手段である。
【0080】
本実施形態の3次元形状計測装置は、コンピュータとプログラムによっても実現でき、そのプログラムを記録媒体に記録することも、ネットワークを通して提供することも可能であるものとする。
【0081】
図8は本実施形態の3次元形状計測処理の処理概要を示す図である。焦点位置の遠い撮影手段701によって撮影が行われると、ステップ801で3次元形状計測装置の画像入力手段703は、その撮影手段701で撮影された撮影画像807を入力する。取得された撮影画像807は撮影手段701から距離の遠い領域808は鮮明に写っているのに対して距離の近い領域809はぼやけた画像となっている。
【0082】
焦点位置の近い撮影手段702によって撮影が行われると、ステップ802において画像入力手段703は、その撮影手段702で撮影された撮影画像810を入力する。取得された撮影画像810は撮影手段702から距離の近い領域811は鮮明に写っているのに対して距離の遠い領域812はぼやけた画像となっている。
【0083】
なお、ステップ801とステップ802に関しては時間的な順序関係が無いので、ステップ802、ステップ801の順に行っても良く、撮影光軸を同軸とした2つの撮影手段を用いてステップ801とステップ802を同時に行っても良い。
【0084】
ステップ803において空間周波数スペクトル演算手段704は、撮影画像807内と撮影画像810内の少なくともどちらかの輝度変化がある設定値以上である輪郭領域抽出データ813に対して、その位置の領域における撮影画像807と撮影画像810の空間周波数スペクトルをそれぞれ求め、輝度変化のより大きい方を空間周波数スペクトル814、そうでない方を空間周波数スペクトル815とする。
【0085】
例えば、撮影画像810において領域816が所定の設定値以上の輝度変化であった場合、領域816の空間周波数スペクトルを求めて空間周波数スペクトル814とし、撮影画像807で領域816と同じ位置にある領域に対して空間周波数スペクトルを求めて空間周波数スペクトル815とする。なお、どちらの領域における輝度変化も同じ大きさであった場合には空間周波数スペクトル814と空間周波数スペクトル815の割り当ては任意で構わない。
【0086】
ステップ804においてスペクトル強度減衰率演算手段705は、空間周波数スペクトル814の周波数に対するスペクトル強度の減衰が最も小さい方向819における減衰率817を求め、空間周波数スペクトル815から同じ方向における減衰率を求める。
【0087】
ステップ805において距離演算手段706は、減衰率817と減衰率818からその領域と撮影手段間の距離を求める。具体的には減衰率817と減衰率818の比を求める。
【0088】
減衰率の比は焦点位置から該領域までの距離情報を反映するのでこの比より焦点位置から該領域までの距離を求めることが出来る。また、焦点位置と撮影手段までの距離は既知なので前記求めた距離に焦点位置と撮影手段までの距離を加えることによって撮影手段と該領域間の距離が求められる。
【0089】
ところで、減衰率の比はレンズの焦点位置自体、絞りの大きさ、レンズのMTF、絞り等で生じる回折の影響も受けて変動するが、これら全ての影響を解析的に除去することは困難である。そこで、これらの影響要因が被写体に依存せず撮影手段の結像光学系のみで決まることに着目し、予めその撮影手段を用いて、不連続に輝度変化する領域のある被写体(例えば、右半分が黒、左半分が白の平面等)を距離を変えて撮影していき、距離とスペクトル強度減衰率の比をその都度計測することによって、減衰率比→距離参照テーブル820を事前に作成しておく。この参照テーブルは撮影手段の結像光学系の影響を全て織り込み済みなので、その後の計測時には、求めた減衰率比から参照テーブルを参照して距離を読み出すことによって、撮影手段の結像光学系の影響を除去して距離だけを求めることが出来る。
【0090】
ステップ806において補間演算手段707は、ステップ805までの処理で距離の求められなかった領域について、距離演算手段706により距離を求めた近傍の領域から補間することによって距離を生成する。ステップ805までの処理で距離の求められなかった領域は、ステップ803において輝度変化がある設定値以下であった領域である。これらの領域は連続に輝度変化している場合が多いので、近傍の距離の求められた部分から補完することによって距離を近似することができる。この補間法は実施形態1の説明で示した方法で良い。
【0091】
これらのステップを適用することによって、撮影対象の3次元形状が簡易に計測できる。本実施形態の方法は、実施形態1の方法と比較して、より正確に距離を求められる、遠方の距離も計測できる等の長所を有する。
【0092】
また、画像の色情報も同時に取得したい場合、実施形態1の方法では遠景がぼやけるため、十分な高解像度の撮影手段を用いるか、色情報は別途の撮影手段を用いる必要があるが、本実施形態の方法では特に遠方に焦点位置を持つ撮影手段の焦点深度を深く設定しておくことによって容易に色画像を該撮影手段で同時に取得することも可能である。
次に、本実施形態の3次元形状計測装置のより具体的な構成と、その動作について説明する。
【0093】
図9は本実施形態の3次元形状計測装置の具体例を示す図である。図9の撮影カメラ901は焦点位置の遠いカメラ、撮影カメラ902は焦点位置の近いカメラである。ハーフミラー929とミラー930によって撮影カメラ901と撮影カメラ902は同軸上での画像撮影が可能となる。画像入力部903は撮影カメラ901及び撮影カメラ902で撮影された撮影画像を入力する入力部、画像記録メモリ904は撮影カメラ901の画像を記録する画像記録メモリ、画像記録メモリ905は撮影カメラ902の画像を記録する画像記録メモリ、エッジ検出器906は撮影カメラ901の撮影画像または撮影カメラ902の撮影画像のうち少なくとも一方の画像内における輝度値の変化が所定の設定値以上の領域を検出する検出器、輝度変化領域記録メモリ907は輝度値の変化が所定の設定値以上の領域をどちらの画像かの情報も含めて記録するメモリ、空間周波数スペクトル演算器908は前記検出された領域について空間周波数スペクトルを求める演算器である。
【0094】
空間周波数スペクトル記録メモリ909は撮影カメラ901の撮影画像の空間周波数スペクトルを記録するメモリ、空間周波数スペクトル記録メモリ910は撮影カメラ902の撮影画像の空間周波数スペクトルを記録するメモリ、最大分布方向検出器911は、より輝度変化の大きい方の画像よって空間周波数に対するスペクトル強度の減衰が最も小さい方向を検出する検出器、スペクトル強度減衰率演算器912は最大分布方向検出器911の検出した方向における撮影カメラ901の撮影画像のスペクトル強度減衰率を算出する演算器、スペクトル強度減衰率演算器913は最大分布方向検出器911の検出した方向における撮影カメラ902の撮影画像のスペクトル強度減衰率を算出する演算器、距離演算器914は、撮影カメラ901の撮影画像のスペクトル強度減衰率と撮影カメラ902の撮影画像のスペクトル強度減衰率の比を距離に変換する演算器、減衰率比→距離参照テーブル937はスペクトル強度減衰率の比を距離に変換する際に参照する参照テーブル、補間演算器915は近傍の距離を求めた領域から距離の値を補間する演算器、3次元形状記録メモリ916は計測された3次元形状データを格納するメモリ、撮影物体917は撮影の対象となる物体である。焦点位置918は撮影カメラ901のピントが最も合う位置、焦点位置919は撮影カメラ902のピントが最も合う位置を示している。なお、本装置の計測範囲は焦点位置918から焦点位置919の間である。
【0095】
図10は本実施形態の図9の3次元形状計測装置の処理手順を示すフローチャートである。図9の装置を用いて本実施形態の3次元形状計測方法を実行する動作を図10のフローチャートに従って説明する。
【0096】
撮影カメラ901で撮影物体917が撮影されると、ステップ1001において画像入力部903は、撮影カメラ901で撮影された撮影画像を入力し、その入力した画像データ920を画像記録メモリ904に記録する。
【0097】
撮影カメラ902で撮影物体917が撮影されると、ステップ1002において画像入力部903は、撮影カメラ902で撮影された撮影画像を入力し、その入力した画像データ921を画像記録メモリ905に記録する。
【0098】
ステップ1003においてエッジ検出器906は、画像記録メモリ904及び905から画像データ920及び921を読み出し、各々の画像毎に、ある画素とその画素に隣接する画素の輝度値の差が予め設定した値以上である様な画素を全て抽出することによって輪郭領域を決定し、輝度変化領域記録メモリ907に該領域を輪郭領域抽出データ922の様に書き込む。この際、より大きな輝度値の差を有する画像の情報も書き込む。例えば、白抜きで示した輪郭領域923は画像データ921から得た輪郭領域を表し、黒線で示した輪郭領域924は画像データ920から得た輪郭領域を表している。
【0099】
ステップ1004において空間周波数スペクトル演算器908は、輝度変化領域記録メモリ907から輪郭領域を読み出して、輪郭領域を構成する各々の画素毎に、該画素を中心とする近傍のN×N画素の画像を画像記録メモリ904及び905から読み出してフーリエ変換することによって空間周波数スペクトルを求めて空間周波数スペクトル記録メモリ909及び910に書き込む。
【0100】
本実施形態ではフーリエ変換を用いる例をあげたが、コサイン/サイン変換やWaveLet変換等の異なる直交基底変換を用いても構わない。また空間周波数スペクトル分布の概略が近似的に判れば良いので、アダマール変換やウォルシュ変換等を用いることも可能であり、本実施形態は空間周波数スペクトルを求める為に使用する直交基底変換関数の種類を限定するものではない。また、FFTやWFT等の高速演算法を用いても良く、本実施形態は高速化の有無やその手法を限定するものではない。
【0101】
ステップ1005において最大分布方向検出器911は、各々の画素毎に輝度変化のより大きい方の撮影画像の空間周波数スペクトルを空間周波数スペクトル記録メモリ909または空間周波数スペクトル記録メモリ910から選択し、空間周波数スペクトルが最も高周波領域まで伸びている方向を検出する。例えば、輪郭領域抽出データ922において画素925の空間周波数スペクトルを画像データ920及び921の画像から求めたものが空間周波数スペクトル926及び927である。画素925は白抜き線の画素なので、より輝度変化の大きい画像は画像データ921である。従って、画像データ921から空間周波数スペクトル927が最も高周波領域まで伸びている方向928を検出する。
【0102】
ステップ1006においてスペクトル強度減衰率演算器912及び913は、検出した方向における空間周波数に対するスペクトル強度の減衰率を画像毎にそれぞれ算出する。
【0103】
ステップ1007において距離演算器914は、前記算出されたそれぞれのスペクトル強度減衰率の比を取って、減衰率比→距離参照テーブル937を参照し、その減衰率比に対応する距離を減衰率比→距離参照テーブル937から求める。なお、減衰率比→距離参照テーブル937は図11に示す手順に従って以下の手続きで予め作成されているものとする。
【0104】
図11は本実施形態の減衰率比→距離参照テーブル作成処理の処理手順を示すフローチャートである。右半分が黒、左半分が白の校正用撮影板1109が撮影カメラ902の焦点位置919に置かれると、ステップ1101において3次元形状計測装置は、校正用撮影板1109と撮影カメラとの距離xを初期値に設定する。
【0105】
次に撮影カメラ901及び902によって校正用撮影板1109が撮影されると、ステップ1102において画像入力部903は、撮影された撮影画像を撮影カメラ901及び902から入力し、画像記録メモリ904及び905に格納する。
【0106】
ステップ1103において空間周波数スペクトル演算器908は、前記格納した撮影画像を画像記録メモリ904及び905から読み出した後、それらの撮影画像より白と黒の境界部における水平方向の空間周波数スペクトルをそれぞれ求め、空間周波数スペクトル記録メモリ909及び910にそれぞれ格納する。
【0107】
ステップ1104においてスペクトル強度減衰率演算器912及び913は、前記格納した空間周波数スペクトルを空間周波数スペクトル記録メモリ909及び910から読み出した後、それぞれの空間周波数スペクトルから周波数に対するスペクトル強度の減衰率をそれぞれ求める。
【0108】
ステップ1105において3次元形状計測装置は、前記求められたスペクトル強度の減衰率の比krを取り、ステップ1106において、校正用撮影板1109と撮影カメラとの距離xと前記求められたスペクトル強度減衰率比krのペアを減衰率比→距離参照テーブル937に書き加える。
【0109】
次に校正用撮影板1109の位置がδxだけ撮影カメラから離されると、ステップ1107において3次元形状計測装置は、校正用撮影板1109と撮影カメラとの距離xの値にδxを加算する。
【0110】
ステップ1108において、校正用撮影板1109との距離xの値と遠焦点位置918までの距離とを比較し、距離xが遠焦点位置918より遠くなれば処理を終了し、そうでなければステップ1102に戻る。以上のステップを実行することによって減衰率比→距離参照テーブル937を生成する。
【0111】
ステップ1008において補間演算器915は、ステップ1003で取り出されなかった画素、即ち、距離演算器914によって距離の求められなかった画素全てについてステップ1009とステップ1010を適用することによってその画素における距離を補間生成する。
【0112】
ステップ1009において補間演算器915は、ある画素を選択し、補間概略図931の様にその画素を原点932にした時の第1象限から第4象限までの各象限毎に該画素に最も近くかつ距離の求められた画素を1つずつ選択することによって、計4つの画素933〜936を求め、数1に従って該画素における距離を補間生成する。なお、第1象限から第4象限までの4画素を選択する理由は、補間される画素が必ず4画素を結ぶ四角形の内部に存在するのでより精度の高い内挿による補間が可能となるからである。しかしながら、画像の四隅に近い画素は必ずしもこの選択法で4画素求められないため、その場合は求められた画素のみから数1に従って補間生成する。また、本実施形態では各象限毎に画素を1つ選択したが、本実施形態は画素の選択法をこれに限定するものではない。そしてステップ1010において補間演算器915は、前記補間生成した距離を3次元形状記録メモリ916に書き込む。
【0113】
以上説明した様に本実施形態の3次元形状計測装置によれば、異なる焦点位置で撮影された2枚の撮影画像における空間周波数スペクトルのスペクトル強度減衰率からその領域と撮影手段間の距離を求めるので、2枚の画像だけからShape from Focus法によってより精度が高く計測範囲も広い3次元形状を求めることが可能である。
【0114】
(実施形態3)
以下に輝度変化する境界部の法線方向における1次元空間周波数スペクトルのスペクトル強度減衰率から距離を求める実施形態3の3次元形状計測装置について説明する。
【0115】
図12は本実施形態の3次元形状計測装置の概略構成を示す図である。図12に示す様に本実施形態の3次元形状計測装置は、画像入力手段1203と、法線方向1次元空間周波数スペクトル演算手段1204と、スペクトル強度減衰率演算手段1205と、距離演算手段1206と、補間演算手段1207とを有している。
【0116】
画像入力手段1203は、所定の位置に焦点位置を有する第1の撮影手段1201で撮影された第1の撮影画像と前記所定の位置とは異なる焦点位置を有する第2の撮影手段1202で撮影された第2の撮影画像とをそれぞれ入力する手段である。
【0117】
法線方向1次元空間周波数スペクトル演算手段1204は、前記入力した第1及び第2の撮影画像内の輝度変化の少なくとも一方が所定値以上の領域について、輝度変化がより大きい方の撮影画像の該輝度変化の境界部の法線方向を求めると共に、輝度変化がより大きい方の撮影画像の該法線方向の1次元空間周波数スペクトル及び他方の撮影画像の該法線方向の1次元空間周波数スペクトルをそれぞれ第1の空間周波数スペクトル及び第2の空間周波数スペクトルとして求める手段である。
【0118】
スペクトル強度減衰率演算手段1205は、前記第1及び第2の空間周波数スペクトルについて、空間周波数に対するスペクトル強度の減衰率をそれぞれ第1及び第2の減衰率として求める手段である。距離演算手段1206は、前記求めた第1及び第2の減衰率に基づき当該領域の被写体と前記第1の撮影手段1201または第2の撮影手段1202との距離を求める手段である。
【0119】
補間演算手段1207は、前記入力した第1及び第2の撮影画像内の輝度変化がいずれも前記所定値未満の領域について、距離演算手段1206により距離が求められている領域からの補間によって当該被写体と前記第1の撮影手段1201または第2の撮影手段1202との距離を求める手段である。
【0120】
図12では、実施形態2の様な装置で、輝度変化する境界部の法線方向における1次元空間周波数スペクトルのスペクトル強度減衰率から距離を求める場合の構成を示しているが、実施形態1の様な装置で同様にして距離を求めるものとしても良い。
【0121】
すなわち、画像入力手段1203では、所定の位置に焦点位置を有する撮影手段1201または撮影手段1202で撮影された撮影画像を入力し、法線方向1次元空間周波数スペクトル演算手段1204では、撮影画像内の輝度変化が所定値以上の領域について、該輝度変化の境界部の法線方向と該法線方向の1次元空間周波数スペクトルとを求め、スペクトル強度減衰率演算手段1205では、前記法線方向の1次元空間周波数スペクトルについて、空間周波数に対するスペクトル強度の減衰率を求め、距離演算手段1206では、前記減衰率に基づき当該領域の被写体と前記撮影手段との距離を求め、補間演算手段1207では、前記撮影画像内の輝度変化が前記所定値未満の領域について、距離演算手段1206により距離が求められている領域からの補間によって当該被写体と前記撮影手段との距離を求めるものとしても良い。
【0122】
また本実施形態の3次元形状計測装置は、コンピュータとプログラムによっても実現でき、そのプログラムを記録媒体に記録することも、ネットワークを通して提供することも可能であるものとする。
【0123】
図13は本実施形態の輝度変化する境界部の法線方向と空間周波数スペクトルの関係を示す図である。図13の撮影画像1301は輝度変化する境界部を撮影した画像であり、輝度変化境界部領域1302は輝度変化がある設定値以上であった境界部の領域である。輝度変化境界部法線方向1303は輝度変化する境界部の法線方向を矢印で示している。この輝度変化境界部領域1302の空間周波数スペクトルを求めると空間周波数スペクトル1304が得られる。
【0124】
輝度変化境界部法線方向1303において、空間周波数に対するスペクトル強度の減衰が最も小さい方向における減衰率を求めるわけであるが、この方向を矢印1305で示す。すると、輝度変化境界部法線方向1303と矢印1305は、ほぼ同方向であることがわかる。従って、輝度変化が所定の設定値以上の領域を検出する過程において、輝度変化する境界部の法線方向も検出しておけば、その方向の1次元空間周波数スペクトルを求め、それからスペクトル強度の減衰率を求めることによって同じ結果を得ることが出来る。これを行う為の処理を図14のフローチャートで示す。
【0125】
図14は本実施形態の3次元形状計測処理の処理概要を示す図である。所定の位置に焦点位置を有する撮影手段によって撮影が行われると、ステップ1401において画像入力手段1203は、その撮影手段で撮影された撮影画像を入力する。図12の様に実施形態2と同様の構成の場合であれば焦点位置の遠い撮影手段1201と焦点位置の近い撮影手段1202とを用いて2枚の画像を撮影し、実施形態1と同様の構成の場合であれば、焦点位置の近い撮影手段1202で画像を撮影する。
【0126】
ステップ1402において法線方向1次元空間周波数スペクトル演算手段1204は、輝度変化が所定の設定値以上の領域を検出する。前記の様に2枚の画像を撮影した場合には、それらの撮影画像内の輝度変化の少なくとも一方が所定値以上の領域を検出する。
【0127】
ステップ1403において法線方向1次元空間周波数スペクトル演算手段1204は、ステップ1402で検出した領域について、その中に含まれる輝度変化する境界部を検出して境界部の法線方向を求める。
【0128】
ステップ1404において法線方向1次元空間周波数スペクトル演算手段1204は、前記検出した法線方向の1次元空間周波数スペクトルを求め、スペクトル強度減衰率演算手段1205により周波数に対するスペクトル強度の減衰率を求める。前記の様に2枚の画像を撮影した場合には、輝度変化がより大きい方の撮影画像の該法線方向の1次元空間周波数スペクトル及び他方の撮影画像の該法線方向の1次元空間周波数スペクトルをそれぞれ第1の空間周波数スペクトル及び第2の空間周波数スペクトルとして求め、スペクトル強度減衰率演算手段1205により、前記第1及び第2の空間周波数スペクトルについて、空間周波数に対するスペクトル強度の減衰率をそれぞれ第1及び第2の減衰率として求める。
【0129】
ステップ1405において距離演算手段1206は、前ステップで求めた減衰率を用いて距離を求める。具体的な求め方は、実施形態1または実施形態2の作用で説明した方法に基づくものとする。また補間演算手段1207は、前記第1及び第2の撮影画像内の輝度変化がいずれも前記所定値未満の領域について、距離演算手段1206により距離が求められている領域からの補間によって当該被写体と前記第1の撮影手段1201または第2の撮影手段1202との距離を求める。
【0130】
本実施形態の3次元形状計測方法を用いることによって、2次元の空間周波数スペクトルを求める必要が無くなる為、計算コストを大幅に削減することが可能となり、処理時間も短縮できる。
次に、本実施形態の3次元形状計測装置のより具体的な構成と、その動作について説明する。
【0131】
図15は本実施形態の3次元形状計測装置の具体例を示す図である。本実施形態の3次元形状計測装置は、輝度変化する境界部の法線方向における1次元空間周波数スペクトルのスペクトル強度減衰率から距離を求める為の構成を、図3に示した実施形態1の装置に組み込んだものである。従って、実施形態1の図3の装置と全く同じ構成手段に関しては図3と同等の番号を与え説明を省略する。
【0132】
エッジベクトル検出器1501は、画像記録メモリ303に記録された画像内で輝度値の変化が所定の設定値以上の領域とその領域の法線ベクトルを検出する検出器、輝度変化領域記録メモリ1502は輝度値の変化が所定の設定値以上の領域とその法線ベクトルを記録するメモリ、空間周波数スペクトル演算器1503は法線ベクトル方向に1次元の空間周波数スペクトルを算出する演算器、空間周波数スペクトル記録メモリ1504は1次元の空間周波数スペクトルを記録するメモリである。
【0133】
図16は本実施形態の3次元形状計測処理の処理手順を示すフローチャートである。図15の装置を用いて本実施形態の3次元形状計測方法を実行する動作を図16のフローチャートに従って説明する。
【0134】
撮影カメラ301で撮影物体313が撮影されると、ステップ1601において画像入力部302は、撮影カメラ301で撮影された撮影画像を入力し、その入力した撮影画像データ315を画像記録メモリ303に記録する。
【0135】
ステップ1602においてエッジベクトル検出器1501は、画像記録メモリ303から撮影画像データ315を読み出し、ある画素とその画素に隣接する画素の輝度値の差が予め設定した値以上である様な画素を全て抽出することによって輪郭領域を決定する。次に輪郭領域を構成する各々の画素に対してその位置における輪郭領域と直交する法線ベクトルを求めて、輝度変化領域記録メモリ1502に該領域と法線ベクトルを書き込む。輪郭領域抽出データ1505はそのデータを模式的に表したものであり、各画素毎に単位長さの法線ベクトル1506も記録されているものとする。
【0136】
ステップ1603において空間周波数スペクトル演算器1503は、輝度変化領域記録メモリ1502から輪郭領域と法線ベクトルを読み出し、各々の画素毎に該画素を中心とし法線ベクトル方向の近傍のN画素の画像を画像記録メモリ303から読み出し、該近傍領域の画素をフーリエ変換することによって1次元の空間周波数スペクトル1507を求めて空間周波数スペクトル記録メモリ1504に書き込む。
【0137】
ステップ1604においてスペクトル強度減衰率演算器309は、1次元の空間周波数スペクトルからスペクトル強度減衰率を求める。
【0138】
ステップ1605において距離演算器310は、減衰率→距離参照テーブル325を参照し、前記求められたスペクトル強度減衰率に対応する距離を減衰率→距離参照テーブル325から求める。なお、減衰率→距離参照テーブル325は図6に示した手順に従って予め作成されているものとする。
【0139】
ステップ1606において補間演算器311は、ステップ1602で取り出されなかった画素、即ち、距離演算器310によって距離の求められなかった画素全てについてステップ1607とステップ1608を適用することによってその画素における距離を補間生成する。
【0140】
ステップ1607において補間演算器311は、ある画素を選択し、その画素を原点にした時の第1象限から第4象限までの各象限毎に該画素に最も近くかつ距離の求められた画素を1つずつ選択することによって、計4つの画素を求め、数1に従って該画素における距離を補間生成する。なお、本実施形態では各象限毎に画素を1つ選択したが、本実施形態は画素の選択法をこれに限定するものではない。そしてステップ1608において補間演算器311は、前記補間生成した距離を3次元形状記録メモリ312に書き込む。
【0141】
以上説明した様に本実施形態の3次元形状計測装置によれば、輝度変化する境界部の法線方向における1次元空間周波数スペクトルのスペクトル強度減衰率から距離を求めるので、計算コストを大幅に削減し処理時間を短縮させることが可能である。
【0142】
(実施形態4)
以下に水平方向の1次元空間周波数スペクトルのスペクトル強度減衰率から距離を求める実施形態4の3次元形状計測装置について説明する。
【0143】
図17は本実施形態の3次元形状計測装置の概略構成を示す図である。図17に示す様に本実施形態の3次元形状計測装置は、画像入力手段1702と、水平方向1次元空間周波数スペクトル演算手段1703と、スペクトル強度減衰率演算手段1704と、距離演算手段1705と、補間演算手段1706とを有している。
【0144】
画像入力手段1702は、所定の位置に焦点位置を有する撮影手段1701で撮影された撮影画像を入力する手段である。水平方向1次元空間周波数スペクトル演算手段1703は、前記入力した撮影画像内の輝度変化が所定値以上の領域について、水平方向の1次元空間周波数スペクトルを求める手段である。
【0145】
スペクトル強度減衰率演算手段1704は、前記水平方向の1次元空間周波数スペクトルについて、空間周波数に対するスペクトル強度の減衰率を求める手段である。距離演算手段1705は、前記求めた減衰率に基づき当該領域の被写体と撮影手段1701との距離を求める手段である。
【0146】
補間演算手段1706は、前記入力した撮影画像内の輝度変化が前記所定値未満の領域について、距離演算手段1705により距離が求められている領域からの補間によって当該被写体と撮影手段1701との距離を求める手段である。
【0147】
図17では、実施形態1の様な装置で水平方向の1次元空間周波数スペクトルのスペクトル強度減衰率から距離を求める場合の構成を示しているが、実施形態2の様な装置で同様にして距離を求めるものとしても良い。
【0148】
すなわち、画像入力手段1702では、所定の位置に焦点位置を有する第1の撮影手段1701で撮影された第1の撮影画像と前記所定の位置とは異なる焦点位置を有する第2の撮影手段(図示せず)で撮影された第2の撮影画像とをそれぞれ入力し、水平方向1次元空間周波数スペクトル演算手段1703では、前記第1及び第2の撮影画像内の輝度変化の少なくとも一方が所定値以上の領域について、輝度変化がより大きい方の撮影画像の水平方向の1次元空間周波数スペクトル及び他方の撮影画像の水平方向の1次元空間周波数スペクトルをそれぞれ第1の空間周波数スペクトル及び第2の空間周波数スペクトルとして求め、スペクトル強度減衰率演算手段1704では、前記第1及び第2の空間周波数スペクトルについて、空間周波数に対するスペクトル強度の減衰率をそれぞれ第1及び第2の減衰率として求め、距離演算手段1705では、前記第1及び第2の減衰率に基づき当該領域の被写体と前記第1または第2の撮影手段との距離を求め、補間演算手段1706では、前記第1及び第2の撮影画像内の輝度変化がいずれも前記所定値未満の領域について、距離演算手段1705により距離が求められている領域からの補間によって当該被写体と前記第1または第2の撮影手段との距離を求めるものとしても良い。
【0149】
また本実施形態の3次元形状計測装置は、コンピュータとプログラムによっても実現でき、そのプログラムを記録媒体に記録することも、ネットワークを通して提供することも可能であるものとする。
【0150】
図18は本実施形態の輝度変化する方向と水平方向の1次元空間周波数スペクトルの関係を示す図である。図18の撮影画像1801は水平方向に輝度変化する境界部を撮影した画像であり、輝度変化境界部領域1802は水平方向に輝度変化する境界部の領域である。この輝度変化境界部領域1802の水平方向の1次元空間周波数スペクトルを求めると空間周波数スペクトル1803が得られる。空間周波数スペクトル1803より減衰率1804を求めることによって水平方向に輝度変化する境界部の減衰率を効率良く求められる。
【0151】
一方、撮影画像1805は垂直方向に輝度変化する境界部を撮影した画像である。この撮影画像1805の輝度変化境界部領域1806の水平方向の1次元空間周波数スペクトルを求めると空間周波数スペクトル1807が得られる。空間周波数スペクトル1807は殆ど高周波成分が含まれないため減衰率を求めることができない。
【0152】
従って本実施形態の方法では、水平方向に輝度変化する境界部は正しく処理できるが、境界部が傾くに連れて誤差が大きくなり垂直方向に輝度変化する境界部は計測できない。しかしながら、視差効果を利用する3D画像生成に用いる場合は、主に水平方向に輝度変化する境界部だけ捉えられば十分なことが多いので、この種の用途に対しては本方法は有用である。更に本実施形態の方法では、実施形態3の方法と比較して境界部の向きの検出等が不要となるため、計算コストの削減や処理速度の向上を更に計ることが可能となる。
【0153】
図19は本実施形態の3次元形状計測処理の処理概要を示す図である。所定の位置に焦点位置を有する撮影手段によって撮影が行われると、ステップ1901において画像入力手段1702は、その撮影手段で撮影された撮影画像を入力する。図17の様に実施形態1と同様の構成の場合であれば、焦点位置の近い撮影手段1701で画像を撮影し、実施形態2と同様の構成の場合であれば、焦点位置の遠い撮影手段と焦点位置の近い撮影手段を用いて2枚の画像を撮影する。
【0154】
ステップ1902において水平方向1次元空間周波数スペクトル演算手段1703は、輝度変化が所定の設定値以上の領域を検出する。
【0155】
ステップ1903において水平方向1次元空間周波数スペクトル演算手段1703は、ステップ1902で検出した領域について、水平方向の1次元の空間周波数スペクトルを求め、スペクトル強度減衰率演算手段1704により空間周波数に対するスペクトル強度の減衰率を求める。
【0156】
ステップ1904において距離演算手段1705は、前ステップで求めた減衰率を用いて距離を求める。具体的な求め方は、実施形態1または実施形態2の作用で説明した方法に基づくものとする。また補間演算手段1706は、前記撮影画像内の輝度変化が前記所定値未満の領域について、距離演算手段1705により距離が求められている領域からの補間によって当該被写体と撮影手段1701との距離を求める。
【0157】
本実施形態の3次元形状計測方法を用いることによって、2次元の空間周波数スペクトルを求める必要が無くなり、輝度変化する境界部の向きを求める必要も無くなるので、計算コストを大幅に削減することが可能となり、処理時間も短縮できる。
【0158】
一方で、本実施形態の方法は、水平方向の処理のみなので垂直方向に距離が変わる領域を計測することができない。しかしながら、視差画像を生成する場合等では水平方向にのみ距離が変わる領域を計測できれば十分であることが多く、その様な用途に用いる場合は問題が無い。
次に、本実施形態の3次元形状計測装置のより具体的な構成と、その動作について説明する。
【0159】
図20は本実施形態の3次元形状計測装置の具体例を示す図である。本実施形態の3次元形状計測装置は、水平方向の1次元空間周波数スペクトルのスペクトル強度減衰率から距離を求める為の構成を、図3に示した実施形態1の装置に組み込んだものである。従って、実施形態1の図3の装置と全く同じ構成手段に関しては図3と同等の番号を与え説明を省略する。
【0160】
水平方向1次元空間周波数スペクトル演算器2001は水平方向の1次元空間周波数スペクトルを算出する演算器である。空間周波数スペクトル記録メモリ2002は水平方向の1次元空間周波数スペクトルを記録するメモリである。スペクトル強度減衰率演算器2003は水平方向の1次元空間周波数スペクトルの周波数に対するスペクトル強度の減衰率を算出する演算器である。
【0161】
図21は本実施形態の3次元形状計測処理の処理手順を示すフローチャートである。図20の装置を用いて本実施形態の3次元形状計測方法を実行する動作を図21のフローチャートに従って説明する。
【0162】
撮影カメラ301で撮影物体313が撮影されると、ステップ2101において画像入力部302は、撮影カメラ301で撮影された撮影画像を入力し、その入力した撮影画像データ315を画像記録メモリ303に記録する。
【0163】
ステップ2102においてエッジ検出器304は、画像記録メモリ303から撮影画像データ315を読み出して、ある画素とその画素に隣接する画素の輝度値の差が予め設定した値以上である様な画素を全て抽出することによって輪郭領域を決定し、輝度変化領域記録メモリ305に該領域を書き込む。
【0164】
ステップ2103において水平方向1次元空間周波数スペクトル演算器2001は、輝度変化領域記録メモリ305から輪郭領域を読み出し、各々の画素毎に該画素を中心とした水平方向の近傍のN画素の画像を画像記録メモリ303から読み出し、該近傍領域の画素をフーリエ変換することによって1次元の空間周波数スペクトル2004を求めて空間周波数スペクトル記録メモリ2002に書き込む。
【0165】
ステップ2104においてスペクトル強度減衰率演算器2003は、1次元の空間周波数スペクトルから水平方向のスペクトル強度減衰率を求める。
【0166】
ステップ2105において距離演算器310は、減衰率→距離参照テーブル325を参照し、前記求められたスペクトル強度減衰率に対応する距離を減衰率→距離参照テーブル325から求める。なお、減衰率→距離参照テーブル325は図6に示した手順に従って予め作成されているものとする。
【0167】
ステップ2106において補間演算器311、ステップ2102で取り出されなかった画素、即ち、距離演算器310によって距離の求められなかった画素全てについてステップ2107とステップ2108を適用することによってその画素における距離を補間生成する。
【0168】
ステップ2107において補間演算器311は、ある画素を選択し、その画素を原点にした時の第1象限から第4象限までの各象限毎に該画素に最も近くかつ距離の求められた画素を1つずつ選択することによって、計4つの画素を求め、数1に従って該画素における距離を補間生成する。なお、本実施形態では各象限毎に画素を1つ選択したが、本実施形態は画素の選択法をこれに限定するものではない。そしてステップ2108において補間演算器311は、前記補間生成した距離を3次元形状記録メモリ312に書き込む。
【0169】
以上説明した様に本実施形態の3次元形状計測装置によれば、水平方向の1次元の空間周波数スペクトルのスペクトル強度減衰率から距離を求めるので、性能低下を最小限に押さえながら効率良く計算コストを削減することが可能である。
【0170】
(実施形態5)
以下に可変光学系による焦点位置可変撮影装置を用いた実施形態5の3次元形状計測装置について説明する。
【0171】
図22は本実施形態の可変光学系による焦点位置可変撮影装置の概略構成を示す図である。図22に示す様に本実施形態の焦点位置可変撮影装置は、結像光学系2201と、撮像素子2202と、シャッタ手段2203と、伝達手段2204とを有している。
【0172】
結像光学系2201は、可動部が駆動されることによって焦点位置が変化する光学系である。撮像素子2202は、撮影対象の画像を検出する素子である。シャッタ手段2203は、2段階の押す深さを持つシャッタである。伝達手段2204は、シャッタ手段2203のシャッタの押された深さに応じて結像光学系2201の可動部を駆動する手段である。
【0173】
図22の(1)はシャッタを押す前の状態を表しており、結像光学系2201と撮像素子2202を合わせて焦点位置の可変光学系を用いた一つの撮影手段を構成している。
【0174】
本装置の動作を説明する。シャッタ手段2203を押すと、中間距離まで押し込まれた状態において図22の(2)に示す形態となる。この状態で1回目の撮影をすることによって、焦点位置の遠い撮影手段701で撮影された撮影画像807を入力する実施形態2のステップ801の処理を行うことができる。
【0175】
更にシャッタ手段2203を押し込むと、伝達手段2204によって撮像素子2202が結像光学系2201からより離れた位置に移動する。この時の形態を図22の(3)に示す。この結果、結像光学系2201と撮像素子2202を合わせて焦点位置の近い撮影光学系を構成することになるので、この状態で2回目の撮影をすることによって焦点位置の近い撮影手段702で撮影された撮影画像810を入力する実施形態2のステップ802の処理を行うことができる。
【0176】
本実施形態の焦点位置可変撮影装置を用いることにより、焦点位置を動かす為の専用の動力が必要無くなる、撮影者に特別な操作を強いることなく自然かつ高速に可変焦点撮影が可能となる等の利点を生じる。
次に、本実施形態の焦点位置可変撮影装置のより具体的な構成と、その動作について説明する。
【0177】
図23は本実施形態の可変光学系による焦点位置可変撮影装置の具体例を示す図である。シャッタボタン2301は、本実施形態の焦点位置可変撮影装置のシャッタを操作する為のボタンである。信号送信器2303はシャッタボタン2301が1段階目の深さ2302に達した時に信号を送る送信器である。信号送信器2305はシャッタボタン2301が2段階目の深さ2304に達した時に信号を送る送信器である。なお、信号送信器2303や信号送信器2305は能動的な素子で無く、単なる電気的なON/OFFを行うだけのスイッチであっても構わない。リンク機構2306はシャッタボタン2301が深さ2302から深さ2304に押されるときにその移動量を結像レンズ系2307に伝達する機構である。結像レンズ系2307は撮影画像を撮像素子2308上に結像する働きを有する。
【0178】
なお、リンク系の構成は本実施形態に限定するものではなく、シャッタボタンの移動量を伝達することによって結像レンズ系2307と撮像素子2308間の相対的な間隔を物理的または光学的に変えることができる構成であるならば本実施形態の焦点位置の可変光学系を駆動する伝達手段と見なされるものとする。また、結像レンズ系2307ではなく撮像素子2308の位置を動かすことによっても焦点位置を変えることができるのは言うまでもない。
【0179】
次に、本装置の動作を説明する。図23の(1)はシャッタボタン2301が押されていない状態である。この時、結像レンズ系2307は位置2309にあり、この状態でレンズの焦点位置は遠方にあるので遠くの物体にピントが合う状態である。
【0180】
図23の(2)はシャッタボタン2301が1段目の深さ2302に押された状態である。信号送信器2303によって撮影信号が送信され撮影を行うことができる。この際、結像レンズ系2307と撮像素子2308の相対的な位置は(1)と変わっていないので遠くの物体にピントが合う状態で撮影が行われる。
【0181】
図23の(3)はシャッタボタン2301が2段目の深さ2304に押された状態である。シャッタボタン2301が深さ2304まで押し込まれると、その動きはリンク機構2306を通して結像レンズ系2307に伝達され、結像レンズ系2307が位置2310へと前方に変移する。この状態ではレンズの焦点位置が近くなって、近くの物体にピントが合う状態となる。この状態で信号送信器2305によって撮影信号が送信され撮影を行うと、近くの物体にピントが合う状態で撮影が行われることになる。
【0182】
以上の様に本実施形態の焦点位置可変撮影装置では、特別な動力を必要とすること無く一つの撮影手段で異なる2焦点位置の撮影が可能、撮影者に特別な動作を強いること無く普通にシャッタボタンを押すだけで瞬時に焦点位置の異なる2枚の画像を続けて撮影可能とする利便性を提供できる。
【0183】
以上説明した様に本実施形態の3次元形状計測装置によれば、シャッタの押された深さに応じて光学系の可動部を駆動して焦点位置を変化させるので、動力を不要として低コスト化をはかり、かつ、簡便な操作で高速に焦点位置を変更することが可能である。
【0184】
【発明の効果】
本発明の方法及び装置によって、小型、低コスト低消費電力、計測環境や計測範囲に制限のない3次元形状計測装置を提供することができる。
本発明の方法及び装置によって、従来法では安定して計測できなかった領域も、計測できた領域から補間生成することによって、安定して概形を求めることができる。
本発明の方法及び装置によって、特に水平方向で変化する距離情報のみが必要な場合、更に計算コストが低く計算時間の早い計測装置を提供することができる。
本発明の装置によって、撮影者が普通にシャッタを押すだけで、焦点位置の異なる2枚の画像を続けて撮影可能とする装置を提供することができる。
【図面の簡単な説明】
【図1】実施形態1の3次元形状計測装置の概略構成を示す図である。
【図2】実施形態1の3次元形状計測装置の処理概要を示す図である。
【図3】実施形態1の3次元形状計測装置の具体例を示す図である。
【図4】実施形態1の図3の3次元形状計測装置の処理手順を示すフローチャートである。
【図5】実施形態1の画素の隣接条件の概要を示す図である。
【図6】実施形態1の減衰率→距離参照テーブル作成処理の処理手順を示すフローチャートである。
【図7】実施形態2の3次元形状計測装置の概略構成を示す図である。
【図8】実施形態2の3次元形状計測処理の処理概要を示す図である。
【図9】実施形態2の3次元形状計測装置の具体例を示す図である。
【図10】実施形態2の図9の3次元形状計測装置の処理手順を示すフローチャートである。
【図11】実施形態2の減衰率比→距離参照テーブル作成処理の処理手順を示すフローチャートである。
【図12】実施形態3の3次元形状計測装置の概略構成を示す図である。
【図13】実施形態3の輝度変化する境界部の法線方向と空間周波数スペクトルの関係を示す図である。
【図14】実施形態3の3次元形状計測処理の処理概要を示す図である。
【図15】実施形態3の3次元形状計測装置の具体例を示す図である。
【図16】実施形態3の3次元形状計測処理の処理手順を示すフローチャートである。
【図17】実施形態4の3次元形状計測装置の概略構成を示す図である。
【図18】実施形態4の輝度変化する方向と水平方向の1次元空間周波数スペクトルの関係を示す図である。
【図19】実施形態4の3次元形状計測処理の処理概要を示す図である。
【図20】実施形態4の3次元形状計測装置の具体例を示す図である。
【図21】実施形態4の3次元形状計測処理の処理手順を示すフローチャートである。
【図22】実施形態5の可変光学系による焦点位置可変撮影装置の概略構成を示す図である。
【図23】実施形態5の可変光学系による焦点位置可変撮影装置の具体例を示す図である。
【符号の説明】
101…撮影手段、102…画像入力手段、103…空間周波数スペクトル演算手段、104…スペクトル強度減衰率演算手段、105…距離演算手段、106…補間演算手段、206…撮影画像、207…距離の近い領域、208…距離の遠い領域、209…輪郭領域抽出データ、210…点、211…空間周波数スペクトル、212…領域、213…減衰率→距離参照テーブル、214及び215…画素、301…撮影カメラ、302…画像入力部、303…画像記録メモリ、304…エッジ検出器、305…輝度変化領域記録メモリ、306…空間周波数スペクトル演算器、307…空間周波数スペクトル記録メモリ、308…最大分布方向検出器、309…スペクトル強度減衰率演算器、310…距離演算器、311…補間演算器、312…3次元形状記録メモリ、313…撮影物体、314…焦点位置、315…撮影画像データ、316…輪郭領域抽出データ、317…空間周波数スペクトル、318…最大分布方向、319…補間概略図、320…原点、321〜324…画素、325…減衰率→距離参照テーブル、608…校正用撮影板、701及び702…撮影手段、703…画像入力手段、704…空間周波数スペクトル演算手段、705…スペクトル強度減衰率演算手段、706…距離演算手段、707…補間演算手段、807…撮影画像、808…距離の遠い領域、809…距離の近い領域、810…撮影画像、811…距離の近い領域、812…距離の遠い領域、813…輪郭領域抽出データ、814及び815…空間周波数スペクトル、816…領域、817及び818…減衰率、819…方向、820…減衰率比→距離参照テーブル、901及び902…撮影カメラ、903…画像入力部、904及び905…画像記録メモリ、906…エッジ検出器、907…輝度変化領域記録メモリ、908…空間周波数スペクトル演算器、909及び910…空間周波数スペクトル記録メモリ、911…最大分布方向検出器、912及び913…スペクトル強度減衰率演算器、914…距離演算器、915…補間演算器、916…3次元形状記録メモリ、917…撮影物体、918及び919…焦点位置、920及び921…画像データ、922…輪郭領域抽出データ、923及び924…輪郭領域、925…画素、926及び927…空間周波数スペクトル、928…方向、929…ハーフミラー、930…ミラー、931…補間概略図、932…原点、933〜936…画素、937…減衰率比→距離参照テーブル、1109…校正用撮影板、1201及び1202…撮影手段、1203…画像入力手段、1204…法線方向1次元空間周波数スペクトル演算手段、1205…スペクトル強度減衰率演算手段、1206…距離演算手段、1207…補間演算手段、1301…撮影画像、1302…輝度変化境界部領域、1303…輝度変化境界部法線方向、1304…空間周波数スペクトル、1305…矢印、1501…エッジベクトル検出器、1502…輝度変化領域記録メモリ、1503…空間周波数スペクトル演算器、1504…空間周波数スペクトル記録メモリ、1505…輪郭領域抽出データ、1506…法線ベクトル、1507…空間周波数スペクトル、1701…撮影手段、1702…画像入力手段、1703…水平方向1次元空間周波数スペクトル演算手段、1704…スペクトル強度減衰率演算手段、1705…距離演算手段、1706…補間演算手段、1801…撮影画像、1802…輝度変化境界部領域、1803…空間周波数スペクトル、1804…減衰率、1805…撮影画像、1806…輝度変化境界部領域、1807…空間周波数スペクトル、2001…水平方向1次元空間周波数スペクトル演算器、2002…空間周波数スペクトル記録メモリ、2003…スペクトル強度減衰率演算器、2004…空間周波数スペクトル、2201…結像光学系、2202…撮像素子、2203…シャッタ手段、2204…伝達手段、2301…シャッタボタン、2302…深さ、2303…信号送信器、2304…深さ、2305…信号送信器、2306…リンク機構、2307…結像レンズ系、2308…撮像素子、2309及び2310…位置。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a three-dimensional shape measuring apparatus for measuring a three-dimensional shape of an object to be measured, and more particularly to a technique effective when applied to a three-dimensional shape measuring apparatus used in the fields of measurement industry, communication industry, video industry and the like. It is.
[0002]
[Prior art]
In recent years, 3D images have been handled by portable devices and the like, and 3D shape measurement devices that are small, low cost, low power consumption, and have no restrictions on measurement environment or measurement range are required as input means for 3D images. ing. However, there is no conventional three-dimensional measuring apparatus that can satisfy all of these conditions.
[0003]
For example, an active type three-dimensional measuring apparatus that measures light by irradiating an object to be measured consumes a large amount of power to drive an illuminating light source, has a limited measurement distance, has limited environmental light, for example, In such a case, it cannot be operated. In many cases, these methods use a laser as the irradiation light, but in this case, they are unsuitable for consumer use from the viewpoint of safety.
[0004]
On the other hand, if there is a passive type three-dimensional measurement apparatus that performs measurement without irradiating the object to be measured with special light, the above problem can be solved. However, the three-dimensional measurement methods belonging to the passive type have difficulty in performance and are particularly unreliable, so most of the methods have not yet reached the stage where a practical measurement device can be made.
[0005]
By the way, there is a passive three-dimensional measurement method called Shape from Focus (see, for example, Non-Patent Document 1). In this method, image information captured by a plurality of imaging units having different focal positions is acquired, and a three-dimensional shape of an imaging target is obtained from the image. The principle of this method is that, in an image taken by a photographing means at a certain focal position, an area close to the focal position is clearly visible, while an area far from the focal position is blurred, and distance measurement is performed. I do. Specifically, the spatial frequency spectrum in the vicinity of each pixel in the image is obtained, and the degree of blurring is obtained from the magnitude of the attenuation rate with respect to the frequency of the spatial frequency spectrum intensity, thereby determining the distance of the subject in the pixel. This can be realized by calculating. In this method, the apparatus can be configured only by a camera that can control the focal position, so that the apparatus can be made extremely small, and is highly advantageous in terms of price and power consumption. On the other hand, this method has low measurement accuracy and resolution, but these performances are often sufficient for consumer use.
[0006]
However, the conventional Shape from Focus has the following drawbacks.
1. An area with little change in shading in an image is difficult to measure, and even if it is forcibly measured, there are many measurement errors, and a meaningless distance may be calculated by complete erroneous measurement.
2.1 Since only one image cannot be distinguished whether it is blurred because it is at a long distance, or whether the original material was originally a short-distance subject that appears blurry, the focal position is different to distinguish this. Requires multiple images. In addition to the purpose of improving the resolution, the necessary number of images may be used in order to reduce the measurement error, and several tens of images may be used.
3. Since the spatial frequency spectrum is obtained for all the pixels of a plurality of photographed images, the calculation cost is very high.
[0007]
As a method for overcoming these drawbacks, there is an active type three-dimensional measurement apparatus that measures the blurring method by irradiating the object to be measured with various patterns of laser light (see, for example, Patent Document 1). This can reliably solve the above problems 1 and 2 because the stable measurement can be performed, but a new problem arises in which all the defects of the active type are held.
[0008]
[Non-Patent Document 1]
A.Pentland "A New Sense for Depth of Field", pp.523-531, VOL.PAMI-9, No.4, JULY 1987
[Patent Document 1]
JP 2002-56348 A
[0009]
[Problems to be solved by the invention]
As described above, in the conventional 3D measurement method belonging to the passive type called Shape from Focus, it is difficult to measure the area where the change in shading is difficult in the image, and several images that require several tens of images with different focal positions are required. There is a problem that the calculation cost is very large because the spatial frequency spectrum is obtained for all the pixels of the photographed image. On the other hand, when an active type three-dimensional measuring device is used to overcome these disadvantages, the power consumption However, there is a problem that the measurement distance is limited, the ambient light is limited, and it is not suitable for consumer use in terms of safety.
[0010]
An object of the present invention is to provide a technique capable of solving the above-described problems and obtaining a simple three-dimensional shape from only one image by the Shape from Focus method. Another object of the present invention is a technology capable of obtaining a three-dimensional shape with higher accuracy and a wider measurement range by using the Shape from Focus method from only two images, greatly reducing the calculation cost and shortening the processing time. Technology that can reduce the cost of computation while minimizing performance degradation, low power by eliminating the need for power, and easy focus operation for fast focus positioning It is to provide a technology that can be changed.
[0011]
[Means for Solving the Problems]
In the present invention, the distance between the area and the imaging means is obtained from the spectral intensity attenuation rate of the spatial frequency spectrum in the captured image captured at a predetermined focal position.
[0012]
In the three-dimensional shape measuring apparatus of the present invention, when photographing is performed by the photographing means at a predetermined focal position, the photographed image photographed by the photographing means is input by the image input means, and the luminance change in the photographed image is a predetermined value. The spatial frequency spectrum of the above region is obtained by the spatial frequency spectrum calculation means.
[0013]
Then, after calculating the spectral intensity attenuation rate in the direction in which the attenuation of the spectral intensity with respect to the spatial frequency of the region is minimized by the attenuation rate calculating means, the distance calculation is performed on the distance from the calculated spectral intensity attenuation rate to the imaging means. Obtain by means. That is, since the spectral intensity attenuation rate reflects the distance information from the focal point to the region, after obtaining the distance from the focal point to the region from the spectral intensity attenuation factor, the distance from the focal point position to the imaging means is obtained at the obtained distance. Is added to obtain the distance between the photographing means and the area. For a region where the luminance change in the photographed image is less than the predetermined value, the distance between the subject and the photographing unit is obtained by interpolation from the region where the distance is obtained.
[0014]
As described above, in the three-dimensional shape measuring apparatus of the present invention, the distance between the region and the imaging means is obtained from the spectral intensity attenuation rate of the spatial frequency spectrum in the captured image captured at a predetermined focal position. It is possible to easily measure the outline of the three-dimensional shape to be imaged.
[0015]
In the three-dimensional shape measuring apparatus of the present invention, the distance between the area and the imaging means may be obtained from the spectral intensity attenuation rate of the spatial frequency spectrum in two captured images captured at different focal positions.
[0016]
That is, in the three-dimensional shape measuring apparatus of the present invention, the first input image captured by the first imaging unit having the focal position at a predetermined position is different from the predetermined position by the image input unit. The second photographed image photographed by the second photographing means is input respectively.
[0017]
Next, the spatial frequency spectrum calculation means calculates the spatial frequency spectrum of the photographic image having the larger luminance change and the other photographic image for the region where at least one of the luminance changes in the first and second photographic images is a predetermined value or more. The spatial frequency spectrum of the image is obtained as a first spatial frequency spectrum and a second spatial frequency spectrum, respectively.
[0018]
Then, the attenuation factor calculation means obtains, as the first attenuation factor, an attenuation factor in the direction in which the attenuation of the spectrum intensity with respect to the spatial frequency is minimized for the first spatial frequency spectrum, and for the second spatial frequency spectrum, After obtaining the attenuation factor of the spectral intensity with respect to the spatial frequency in the same direction as the second attenuation factor, the distance calculation means and the subject in the area and the first or second factor based on the first and second attenuation factors. Find the distance to the imaging means. That is, since the ratio between the first and second attenuation factors reflects the distance information from the focal position to the area, the distance from the focal position to the area is obtained from this ratio, and then the focus is set to the obtained distance. The distance between the photographing means and the area is obtained by adding the position and the distance to the photographing means. For a region where the luminance change in the photographed image is less than the predetermined value, the distance between the subject and the photographing unit is obtained by interpolation from the region where the distance is obtained.
[0019]
As described above, in the three-dimensional shape measurement apparatus of the present invention, the distance between the area and the imaging means is obtained from the spectral intensity attenuation rate of the spatial frequency spectrum in two captured images captured at different focal positions. It is possible to easily measure a three-dimensional shape, and has advantages such as being able to calculate a distance more accurately than when using a single photographed image, and measuring a distant distance.
[0020]
Further, in the three-dimensional shape measuring apparatus of the present invention, the area between the region and the image capturing means is calculated based on the spectral intensity attenuation rate of the spatial frequency spectrum in the captured image captured at a predetermined focal position or two captured images captured at different focal positions. When obtaining the distance, the distance may be obtained from the spectral intensity attenuation rate of the one-dimensional spatial frequency spectrum in the normal direction of the boundary where the luminance changes.
[0021]
That is, in the three-dimensional shape measuring apparatus according to the present invention, the image input means is used to capture a photographed image photographed by a photographing means having a focal position at a predetermined position or two photographed images photographed by photographing means having different focal positions. After input, the spectrum calculation means causes the luminance in the area where the luminance change is greater than or equal to a predetermined value in the captured image captured at the predetermined focal position, or in the captured image where the luminance change captured at a different focal position is larger. For a region where the change is greater than or equal to a predetermined value, the normal direction of the boundary of the luminance change and the one-dimensional spatial frequency spectrum in the normal direction are obtained.
[0022]
Next, an attenuation rate calculating means obtains a spectral intensity attenuation rate with respect to the spatial frequency for the one-dimensional spatial frequency spectrum in the normal direction, and based on the obtained spectral intensity attenuation rate, the subject in the area and the imaging means Find the distance. For a region where the luminance change in the photographed image is less than the predetermined value, the distance between the subject and the photographing unit is obtained by interpolation from the region where the distance is obtained.
[0023]
As described above, in the three-dimensional shape measuring apparatus of the present invention, since the distance is obtained from the spectral intensity attenuation rate of the dimensional spatial frequency spectrum in the normal direction of the boundary where the luminance changes, it is not necessary to obtain the two-dimensional spatial frequency spectrum. As a result, the calculation cost can be greatly reduced and the processing time can be shortened.
[0024]
Further, in the three-dimensional shape measuring apparatus of the present invention, the area between the region and the image capturing means is calculated based on the spectral intensity attenuation rate of the spatial frequency spectrum in the captured image captured at a predetermined focal position or two captured images captured at different focal positions. When obtaining the distance, the distance may be obtained from the spectral intensity attenuation rate of the one-dimensional spatial frequency spectrum in the horizontal direction.
[0025]
That is, in the three-dimensional shape measuring apparatus according to the present invention, the image input means is used to capture a photographed image photographed by a photographing means having a focal position at a predetermined position or two photographed images photographed by photographing means having different focal positions. After input, the spectrum calculation means causes the luminance in the area where the luminance change is greater than or equal to a predetermined value in the captured image captured at the predetermined focal position, or in the captured image where the luminance change captured at a different focal position is larger. A horizontal one-dimensional spatial frequency spectrum is obtained for a region where the change is a predetermined value or more.
[0026]
Next, an attenuation rate calculation means obtains an attenuation rate of the spectral intensity with respect to the spatial frequency for the horizontal one-dimensional spatial frequency spectrum, and based on the obtained spectral intensity attenuation rate, the distance between the subject in the region and the imaging means Ask for. For a region where the luminance change in the photographed image is less than the predetermined value, the distance between the subject and the photographing unit is obtained by interpolation from the region where the distance is obtained.
[0027]
As described above, in the three-dimensional shape measuring apparatus of the present invention, since the distance is obtained from the spectral intensity attenuation rate of the horizontal one-dimensional spatial frequency spectrum, there is no need to obtain the two-dimensional spatial frequency spectrum, and the boundary portion where the luminance changes Therefore, the calculation cost can be greatly reduced and the processing time can be shortened.
In the three-dimensional shape measuring apparatus of the present invention, a variable focal position imaging device using a variable optical system may be used.
[0028]
That is, an optical system whose focal position changes when the movable part is driven, a shutter having a two-step pressing depth, and the movable part of the optical system is driven according to the pressed depth of the shutter. When a variable focal position imaging device including a transmission means is used, when the shutter is pushed down to the first depth, shooting is performed at a predetermined focal position, and when the shutter is pushed down to the second depth. Takes a picture at a focal position different from the predetermined focal position by driving the movable part according to the pressed depth of the shutter by the transmission means to move the imaging element and / or the imaging optical system. .
[0029]
As described above, in the three-dimensional shape measuring apparatus of the present invention, by using the focal position variable imaging apparatus using the variable optical system, a dedicated power for moving the focal position is not necessary when performing three-dimensional shape measurement. There are advantages such that variable focus shooting can be performed naturally and at high speed without forcing the photographer to perform special operations.
[0030]
As described above, according to the three-dimensional shape measuring apparatus of the present invention, the spectral intensity attenuation rate of the spatial frequency spectrum in the photographed image photographed at the predetermined focal position or the two photographed images photographed at different focal positions. Since the distance between the area and the photographing means is obtained, a simple three-dimensional shape can be obtained from only a smaller number of images than in the prior art by the Shape from Focus method.
[0031]
DETAILED DESCRIPTION OF THE INVENTION
(Embodiment 1)
The three-dimensional shape measuring apparatus according to the first embodiment for obtaining the distance between the area and the imaging means from the spectral intensity attenuation rate of the spatial frequency spectrum in the captured image captured at a predetermined focal position will be described below.
[0032]
FIG. 1 is a diagram showing a schematic configuration of a three-dimensional shape measuring apparatus according to the present embodiment. As shown in FIG. 1, the three-dimensional shape measuring apparatus of this embodiment includes an image input unit 102, a spatial frequency spectrum calculation unit 103, a spectrum intensity attenuation rate calculation unit 104, a distance calculation unit 105, and an interpolation calculation unit 106. And have.
[0033]
The image input means 102 is a means for inputting a photographed image photographed by the photographing means 101 having a focal position at a predetermined position. The spatial frequency spectrum calculation means 103 is a means for obtaining a spatial frequency spectrum for a region where the luminance change in the inputted photographed image is a predetermined value or more.
[0034]
The spectral intensity attenuation rate calculating means 104 is a means for obtaining an attenuation rate in a direction in which the attenuation of the spectral intensity with respect to the spatial frequency is minimized with respect to the obtained spatial frequency spectrum. The distance calculation means 105 is a means for obtaining the distance between the subject in the area and the photographing means 101 based on the obtained attenuation rate.
[0035]
Interpolation calculating means 106 obtains the distance between the subject and the photographing means 101 by interpolation from the area where the distance is obtained by the distance calculating means 105 for the area where the luminance change in the inputted photographed image is less than the predetermined value. It is.
[0036]
Further, the three-dimensional shape measuring apparatus of the present embodiment can be realized by a computer and a program, and the program can be recorded on a recording medium or provided through a network.
[0037]
FIG. 2 is a diagram showing an outline of processing of the three-dimensional shape measuring apparatus according to this embodiment. When photographing is performed by the photographing unit 101 having a close focal position, the image input unit 102 of the three-dimensional shape measuring apparatus inputs a photographed image 206 photographed by the photographing unit 101 in step 201. In the acquired captured image 206, a region 207 close to the image capturing unit 101 is clearly visible, whereas a region 208 far away is a blurred image.
[0038]
In step 202, the spatial frequency spectrum calculation means 103 obtains a spatial frequency spectrum of a region where the luminance change in the captured image is equal to or greater than a predetermined value.
[0039]
First, contour area extraction data 209 is obtained by extracting an area where the luminance change is equal to or greater than a predetermined set value. Then, since the brightness change of the contour portion of the object is remarkably large compared to other regions, a region including more contour portions can be efficiently extracted by extracting a region where the brightness change is equal to or greater than a predetermined set value.
[0040]
Next, a spatial frequency spectrum is obtained for each point included in this region. For example, when the spatial frequency spectrum of a certain point 210 on the region is obtained, a two-dimensional spatial frequency spectrum shown in the spatial frequency spectrum 211 is obtained. It is assumed that the vertical axis representing the spectral intensity of the spatial frequency spectrum 211 is logarithmically taken.
[0041]
In step 203, the spectral intensity attenuation rate calculating means 104 obtains an attenuation rate in a direction that minimizes the attenuation of the spectral intensity with respect to the spatial frequency of the region extracted in step 202.
[0042]
For example, the attenuation rate of the spatial frequency spectrum 211 is obtained as an average value of the region 212. Since the obtained spatial frequency spectrum 211 is expressed two-dimensionally, the direction in which the attenuation of the spectrum intensity is the smallest is determined and the attenuation rate for obtaining the average value of the gradient in that direction. If the image is clear, the attenuation factor is small, but a blurred image in an out-of-focus area has a larger attenuation factor.
[0043]
The attenuation rate is determined by selecting the direction in which the spectral intensity attenuation with respect to the spatial frequency is the minimum. The attenuation rate of the spectral intensity in this direction is the most stable measurement and the distance in the depth direction of the subject. This is because the information is reflected.
[0044]
In step 204, the distance calculation means 105 obtains the distance from the region and the imaging means 101 from the spectral intensity attenuation rate obtained in step 203. As the object is farther away from the focal position, the image becomes more blurred. If the attenuation rate is -k [dB / Oct (dB per octave)], k reflects the distance information from the focal point to the region, so it is more focused than k. To the area can be obtained. Further, since the distance between the focal position and the photographing means 101 is known, the distance between the photographing means 101 and the region can be obtained by adding the distance between the focal position and the photographing means 101 to the obtained distance.
[0045]
By the way, k is the focal position of the lens itself, the size of the stop, and the MTF (Modulation Transfer Function) of the lens. It is an abbreviation for the amplitude transfer function. However, it is difficult to analytically remove all these effects. Therefore, paying attention to the fact that these influence factors do not depend on the subject and are determined only by the imaging optical system of the photographing means, using the photographing means in advance, a certain subject (for example, the right The plane of half is black, the left half is white, etc.) is taken at different distances, and the attenuation rate → distance reference table 213 is created in advance by measuring the distance and the spectral intensity attenuation rate each time. . Since this reference table has already incorporated all the effects of the imaging optical system of the imaging means, at the time of subsequent measurement, the distance of the imaging optical system of the imaging means is read by referring to the reference table from the obtained attenuation rate. Only the distance can be obtained by removing the influence.
[0046]
In step 205, the interpolation calculation means 106 generates a distance by interpolating the area for which the distance has not been obtained in the processing up to step 204 from the neighboring area for which the distance calculation means 105 has obtained the distance. For example, the depth distance z of the pixel 214 in the area where the distance cannot be obtained is the distance i to the pixel 214 with respect to the pixel 215 of the i point where the distance in the vicinity is obtained, and the depth distance at that pixel is Zi is obtained by linear interpolation (primary interpolation) according to the following equation (1).
[0047]
[Expression 1]
z = Σ (Zi / li) / Σ (1 / li)
[0048]
It should be noted that the neighborhood region is a region having a predetermined area, a region having a variable area including a predetermined number of pixels whose distances are obtained, and the interpolation method is represented by a high-order interpolation method and various spline functions. There may be various variations such as a rational interpolation method, but the interpolation method of the present invention is not limited to the definition of a specific neighborhood region or the interpolation method.
[0049]
The area for which the distance has not been obtained in the processing up to step 204 is an area where the luminance change is equal to or smaller than a certain set value in step 202. Since these regions often change in luminance continuously, a relatively good approximate value can be obtained even by interpolating from the portion where the distance in the vicinity is obtained.
[0050]
As described above, in the three-dimensional shape measurement method of the present embodiment, by applying these steps, it is possible to easily measure the outline of the three-dimensional shape of the imaging target up to a certain distance.
Next, a more specific configuration and operation of the three-dimensional shape measuring apparatus according to the present embodiment will be described.
[0051]
FIG. 3 is a diagram showing a specific example of the three-dimensional shape measuring apparatus of the present embodiment. 3 is a camera with a close focus position, the image input unit 302 is an input unit for inputting a photographed image taken by the photographing camera 301, an image recording memory 303 is a memory for recording the inputted photographed image, The edge detector 304 detects a region in the image where the change in the luminance value of the pixel is a predetermined set value or more, and the luminance change region recording memory 305 records a region where the change in the luminance value is a predetermined set value or more. A memory / spatial frequency spectrum calculator 306 is a calculator for obtaining a spatial frequency spectrum in a region where the luminance change in the photographed image is a predetermined value or more. A combination of the edge detector 304, the luminance change area recording memory 305, and the spatial frequency spectrum calculator 306 constitutes the spatial frequency spectrum calculator 103 shown in FIG.
[0052]
A spatial frequency spectrum recording memory 307 is a memory for recording the obtained spatial frequency spectrum, a maximum distribution direction detector 308 is a detector for detecting a direction in which the distribution of the obtained spatial frequency spectrum is most widened, and a spectrum. An intensity attenuation factor calculator 309 is a calculator that calculates the attenuation factor of the spectral intensity with respect to the spatial frequency in the direction detected by the maximum distribution direction detector 308, and a distance calculator 310 is an operator that converts the value of the spectrum intensity attenuation factor into a distance. The attenuation rate → distance reference table 325 is a reference table that is referred to when converting the value of the spectral intensity attenuation rate into the distance, and the interpolation calculator 311 is a calculator that interpolates the distance value from the area where the nearby distance is obtained. The dimensional shape recording memory 312 is a memory for storing measured three-dimensional shape data. A shooting object 313 is an object to be shot, and a focal position 314 indicates a position where the shooting camera 301 is in focus. Note that the closest distance side of the measurement range of the present apparatus is up to the focal position 314.
[0053]
The photographed image data 315 represents image data photographed by the photographing camera 301 and recorded in the image recording memory 303. The contour area extraction data 316 represents an area detected by the edge detector 304 and recorded in the brightness change area recording memory 305, where the change in the brightness value of the pixel is greater than or equal to a set value. A spatial frequency spectrum 317 represents a spatial frequency spectrum centered on a certain pixel, which is obtained by the spatial frequency spectrum calculator 306 and recorded in the spatial frequency spectrum recording memory 307.
[0054]
A spatial frequency spectrum centered on a pixel is data of a two-dimensional distribution for each pixel as shown in this figure. In general, the spatial frequency spectrum has the maximum center point (DC component) and attenuates as the spatial frequency increases. Further, the spatial frequency spectrum is distributed up to the highest frequency in the normal direction of the contour portion, and shows a sharp attenuation in the tangential direction.
[0055]
FIG. 4 is a flowchart showing a processing procedure of the three-dimensional shape measuring apparatus of FIG. 3 of the present embodiment. The operation of executing the three-dimensional shape measurement method of this embodiment using the apparatus of FIG. 3 will be described according to the flowchart of FIG.
[0056]
When the photographing object 313 is photographed by the photographing camera 301, the image input unit 302 inputs a photographed image photographed by the photographing camera 301 in step 401 and records the inputted photographed image data 315 in the image recording memory 303. .
[0057]
In step 402, the edge detector 304 reads the captured image data 315 from the image recording memory 303, and extracts all pixels whose difference in luminance value between a certain pixel and a pixel adjacent to the pixel is equal to or greater than a preset value. Thus, the contour region is determined, the pixel information of the contour region is extracted, and written in the luminance change region recording memory 305 as the contour region extraction data 316. At this time, the adjacent condition may be near 4 or near 8.
[0058]
FIG. 5 is a diagram showing an outline of the pixel adjacency condition according to this embodiment. As shown in FIG. 5, the eight neighboring pixels adjacent to the pixel Px, y at the coordinates (x, y) of the captured image data 315 are Px-1, y-1, Px-1, y, Px-1, y + 1, Px, y-1, Px, y + 1, Px + 1, y-1, Px + 1, y, Px + 1, y + 1, and the four neighboring pixels are Px-1, y, Px, y-1, Px, y + 1, and Px + 1, y.
[0059]
In step 403, the spatial frequency spectrum calculator 306 reads out the contour region from the luminance change region recording memory 305, and reads out an image of N × N pixels in the vicinity centering on the pixel from the image recording memory 303 for each pixel. The spatial frequency spectrum 317 is obtained by Fourier transforming the pixels in the neighboring area and written into the spatial frequency spectrum recording memory 307.
[0060]
In the present embodiment, an example using Fourier transform is given, but different orthogonal basis transforms such as cosine / sine transform and WaveLet transform may be used. In addition, since the outline of the spatial frequency spectrum distribution only needs to be approximated, it is possible to use Hadamard transform, Walsh transform, etc. In this embodiment, the type of orthogonal basis transform function used for obtaining the spatial frequency spectrum is determined. It is not limited. Further, a high-speed calculation method such as FFT or WFT may be used, and the present embodiment does not limit the presence or absence of speed-up and the method thereof.
[0061]
In step 404, the maximum distribution direction detector 308 detects the maximum distribution direction 318 in which the obtained spatial frequency spectrum 317 extends to the highest frequency region. Since the spatial frequency spectrum 317 has a distribution shape as shown in the figure, the attenuation rate of the spectrum intensity with respect to the frequency is obtained for each direction from the center, and the direction with the smallest attenuation rate may be set as the maximum distribution direction 318. The maximum distribution direction 318 may be simply detected by connecting the center and the point having the maximum spatial frequency on a concentric circle separated from the center by a certain spatial frequency ω.
[0062]
In step 405, the spectrum intensity attenuation rate calculator 309 obtains an average value of attenuation with respect to the frequency of the detected spatial frequency spectrum intensity in the maximum distribution direction 318, and uses this value as the spectrum intensity attenuation rate.
[0063]
In step 406, the distance calculator 310 refers to the attenuation rate → distance reference table 325 and obtains a distance corresponding to the obtained spectral intensity attenuation rate from the attenuation rate → distance reference table 325. It is assumed that the attenuation rate → distance reference table 325 is created in advance by the following procedure according to the procedure shown in FIG.
[0064]
FIG. 6 is a flowchart showing a processing procedure of attenuation rate → distance reference table creation processing of the present embodiment. When the calibration imaging plate 608 in which the right half is black and the left half is white is placed at the focal position x0 of the imaging camera 301, in step 601, the three-dimensional shape measuring apparatus determines the distance between the calibration imaging plate 608 and the imaging camera 301. Set x to the initial value x0.
[0065]
Next, when the calibration photographing plate 608 is photographed by the photographing camera 301, in step 602, the image input unit 302 inputs the photographed photographed image from the photographing camera 301 and stores it in the image recording memory 303.
[0066]
In step 603, the spatial frequency spectrum calculator 306 reads the stored captured image from the image recording memory 303, obtains a horizontal spatial frequency spectrum at the boundary between white and black from the captured image, and records the spatial frequency spectrum. Store in the memory 307.
[0067]
In step 604, the spectrum intensity attenuation rate calculator 309 reads the stored spatial frequency spectrum from the spatial frequency spectrum recording memory 307, obtains an average value of attenuation with respect to the frequency of the spatial frequency spectrum intensity in the horizontal direction, and obtains this value. It is assumed that the spectral intensity attenuation rate k.
[0068]
In step 605, the three-dimensional shape measurement apparatus writes a pair of the distance x between the calibration imaging plate 608 and the imaging camera 301 and the obtained spectral intensity attenuation rate k to the attenuation rate → distance reference table 325. .
[0069]
Next, when the position of the calibration imaging plate 608 is separated from the imaging camera 301 by δx, the three-dimensional shape measuring apparatus adds δx to the value of the distance x between the calibration imaging plate 608 and the imaging camera 301 in step 606. .
[0070]
In step 607, the value x of the distance to the calibration imaging plate 608 is compared with a preset maximum measurement distance. If the distance x is greater than or equal to the maximum measurement distance, this process ends. If not, the process proceeds to step 602. Return. The attenuation rate → distance reference table 325 is generated by the above steps.
[0071]
In step 407, the interpolation calculator 311 interpolates the distance at that pixel by applying step 408 and step 409 to all the pixels that have not been extracted in step 402, that is, the pixels whose distance has not been determined by the distance calculator 310. Generate.
[0072]
In step 408, the interpolation calculator 311 selects a pixel, and is closest to the pixel in each quadrant from the first quadrant to the fourth quadrant when the pixel is set to the origin 320 as shown in the interpolation schematic diagram 319. By selecting the pixels for which the distance is obtained one by one, a total of four pixels 321 to 324 are obtained, and the distance at the pixel is interpolated and generated according to Equation 1. The reason for selecting the four pixels from the first quadrant to the fourth quadrant is that interpolation with higher accuracy is possible because the interpolated pixels always exist inside a quadrilateral connecting the four pixels. is there. However, since the pixels near the four corners of the image are not necessarily obtained by this selection method, four pixels are interpolated and generated from only the obtained pixels. In this embodiment, one pixel is selected for each quadrant, but this embodiment does not limit the pixel selection method. In step 409, the interpolation calculator 311 writes the distance generated by the interpolation in the three-dimensional shape recording memory 312.
[0073]
As described above, according to the three-dimensional shape measurement apparatus of the present embodiment, the distance between the region and the imaging means is obtained from the spectral intensity attenuation rate of the spatial frequency spectrum in the captured image captured at a predetermined focal position. A simple three-dimensional shape can be obtained from only one image by the Shape from Focus method.
[0074]
(Embodiment 2)
A three-dimensional shape measuring apparatus according to the second embodiment for obtaining the distance between the region and the imaging means from the spectral intensity attenuation rate of the spatial frequency spectrum in two captured images captured at different focal positions will be described below.
[0075]
FIG. 7 is a diagram showing a schematic configuration of the three-dimensional shape measuring apparatus of the present embodiment. As shown in FIG. 7, the three-dimensional shape measuring apparatus of this embodiment includes an image input unit 703, a spatial frequency spectrum calculation unit 704, a spectrum intensity attenuation rate calculation unit 705, a distance calculation unit 706, and an interpolation calculation unit 707. And have.
[0076]
The image input unit 703 is photographed by the first photographing unit 701 having a focal position at a predetermined position and the second photographing unit 702 having a focal position different from the predetermined position. And a second photographed image.
[0077]
The spatial frequency spectrum calculation means 704 has a spatial frequency spectrum of the photographic image having the larger luminance change and the other of the inputted luminance changes in the first and second photographed images in the region where at least one of the luminance changes is a predetermined value or more. It is means for obtaining the spatial frequency spectrum of the photographed image as a first spatial frequency spectrum and a second spatial frequency spectrum, respectively.
[0078]
Spectral intensity attenuation rate calculating means 705 obtains, for the first spatial frequency spectrum, an attenuation rate in a direction that minimizes the attenuation of the spectral intensity with respect to the spatial frequency as the first attenuation rate, and for the second spatial frequency spectrum. This is means for obtaining the attenuation factor of the spectral intensity with respect to the spatial frequency in the same direction as the second attenuation factor.
[0079]
The distance calculation means 706 is a means for obtaining the distance between the subject in the area and the first photographing means 701 or the second photographing means 702 based on the obtained first and second attenuation factors. Interpolation calculation means 707 interpolates the subject from the area where the distance calculation means 706 calculates the distance for the area where the luminance change in the input first and second captured images is less than the predetermined value. Means for obtaining a distance from the first photographing means 701 or the second photographing means 702.
[0080]
The three-dimensional shape measuring apparatus of the present embodiment can be realized by a computer and a program, and the program can be recorded on a recording medium or provided through a network.
[0081]
FIG. 8 is a diagram showing a processing outline of the three-dimensional shape measurement processing of the present embodiment. When photographing is performed by the photographing means 701 having a far focal position, the image input means 703 of the three-dimensional shape measuring apparatus inputs a photographed image 807 photographed by the photographing means 701 in step 801. In the acquired captured image 807, a region 808 far from the image capturing unit 701 is clearly visible, whereas a region 809 near the distance is a blurred image.
[0082]
When photographing is performed by the photographing unit 702 having a close focal position, the image input unit 703 inputs the photographed image 810 photographed by the photographing unit 702 in step 802. In the acquired photographed image 810, a region 811 near the distance from the photographing means 702 is clearly shown, whereas a region 812 far away is a blurred image.
[0083]
Since step 801 and step 802 have no temporal order relationship, they may be performed in the order of step 802 and step 801. Steps 801 and 802 are performed using two photographing means having coaxial photographing optical axes. You may go at the same time.
[0084]
In step 803, the spatial frequency spectrum calculation unit 704 takes the captured image in the region at the position of the contour region extraction data 813 in which the luminance change in at least one of the captured image 807 and the captured image 810 is greater than or equal to a set value. The spatial frequency spectrums of 807 and the captured image 810 are respectively obtained, and the spatial frequency spectrum 814 is the one with the larger luminance change, and the spatial frequency spectrum 815 is the other.
[0085]
For example, when the region 816 has a luminance change equal to or greater than a predetermined setting value in the photographed image 810, the spatial frequency spectrum of the region 816 is obtained as the spatial frequency spectrum 814, and the region in the photographed image 807 is located at the same position as the region 816. On the other hand, a spatial frequency spectrum is obtained to obtain a spatial frequency spectrum 815. In addition, when the brightness | luminance change in either area | region is the same magnitude | size, allocation of the spatial frequency spectrum 814 and the spatial frequency spectrum 815 may be arbitrary.
[0086]
In step 804, the spectral intensity attenuation rate calculating means 705 obtains the attenuation rate 817 in the direction 819 where the attenuation of the spectral intensity with respect to the frequency of the spatial frequency spectrum 814 is the smallest, and obtains the attenuation rate in the same direction from the spatial frequency spectrum 815.
[0087]
In step 805, the distance calculation means 706 obtains the distance between the area and the imaging means from the attenuation rate 817 and the attenuation rate 818. Specifically, the ratio between the attenuation rate 817 and the attenuation rate 818 is obtained.
[0088]
Since the ratio of the attenuation rate reflects the distance information from the focal position to the area, the distance from the focal position to the area can be obtained from this ratio. Further, since the distance between the focal position and the photographing means is known, the distance between the photographing means and the region can be obtained by adding the distance between the focal position and the photographing means to the obtained distance.
[0089]
By the way, the ratio of the attenuation factor fluctuates due to the influence of diffraction caused by the focal position of the lens itself, the size of the diaphragm, the MTF of the lens, the diaphragm, etc., but it is difficult to remove all these effects analytically. is there. Therefore, paying attention to the fact that these influencing factors do not depend on the subject and are determined only by the imaging optical system of the photographing means, using the photographing means in advance, a subject having a region where the luminance changes discontinuously (for example, the right half) The distance reference table 820 is created in advance by measuring the ratio of the distance and the spectral intensity attenuation rate each time. Keep it. Since this reference table has already incorporated all the effects of the imaging optical system of the imaging means, at the time of subsequent measurement, the distance of the imaging optical system of the imaging means is read by referring to the reference table from the obtained attenuation rate ratio. Only the distance can be obtained by removing the influence.
[0090]
In step 806, the interpolation calculation means 707 generates a distance by interpolating the area for which the distance has not been obtained in the processing up to step 805 from the neighboring area for which the distance calculation means 706 has obtained the distance. The area where the distance has not been obtained in the processing up to step 805 is an area where the luminance change is not more than a certain set value in step 803. Since these regions often change in luminance continuously, the distance can be approximated by complementing from the portion where the distance in the vicinity is obtained. This interpolation method may be the method shown in the description of the first embodiment.
[0091]
By applying these steps, the three-dimensional shape of the imaging target can be easily measured. Compared with the method of the first embodiment, the method of the present embodiment has advantages such as being able to calculate the distance more accurately and measuring far distances.
[0092]
In addition, when it is desired to obtain color information of an image at the same time, since the distant view is blurred in the method according to the first embodiment, it is necessary to use a sufficiently high-resolution image capturing unit or use color capturing unit for color information. In the method of the embodiment, it is also possible to easily obtain a color image at the same time by the photographing means by setting the depth of focus of the photographing means having a focal position far away.
Next, a more specific configuration and operation of the three-dimensional shape measuring apparatus according to the present embodiment will be described.
[0093]
FIG. 9 is a diagram showing a specific example of the three-dimensional shape measuring apparatus of the present embodiment. The shooting camera 901 in FIG. 9 is a camera with a far focus position, and the shooting camera 902 is a camera with a close focus position. The half mirror 929 and the mirror 930 enable the photographing camera 901 and the photographing camera 902 to take an image on the same axis. An image input unit 903 is an input unit for inputting a photographic image taken by the photographic camera 901 and the photographic camera 902, an image recording memory 904 is an image recording memory for recording an image of the photographic camera 901, and an image recording memory 905 is an image of the photographing camera 902. An image recording memory for recording an image, and an edge detector 906 detects an area in which a change in luminance value in at least one of a photographed image of the photographing camera 901 or a photographed image of the photographing camera 902 is a predetermined set value or more. A brightness change area recording memory 907 is a memory that records the area where the change in brightness value is not less than a predetermined setting value including information on which image, and the spatial frequency spectrum calculator 908 is a spatial frequency detector for the detected area. This is an arithmetic unit for obtaining a spectrum.
[0094]
A spatial frequency spectrum recording memory 909 is a memory that records a spatial frequency spectrum of a photographed image of the photographing camera 901, a spatial frequency spectrum recording memory 910 is a memory that records a spatial frequency spectrum of a photographed image of the photographing camera 902, and a maximum distribution direction detector 911. Is a detector for detecting the direction in which the attenuation of the spectral intensity with respect to the spatial frequency is the smallest in the image having the larger luminance change, and the spectral intensity attenuation factor calculator 912 is a photographing camera 901 in the direction detected by the maximum distribution direction detector 911. A computing unit for calculating the spectral intensity attenuation rate of the captured image, and a spectral intensity attenuation rate calculating unit 913 for calculating the spectral intensity attenuation rate of the captured image of the imaging camera 902 in the direction detected by the maximum distribution direction detector 911, The distance calculator 914 is a camera 9 An arithmetic unit that converts the ratio of the spectral intensity attenuation rate of the captured image of 1 and the spectral intensity attenuation rate of the captured image of the imaging camera 902 into a distance, the attenuation rate ratio → distance reference table 937 converts the ratio of the spectral intensity attenuation rate into a distance. A reference table to be referred to when performing interpolation, an interpolation calculator 915 is a calculator that interpolates a distance value from an area from which a nearby distance is obtained, a three-dimensional shape recording memory 916 is a memory that stores measured three-dimensional shape data, and imaging An object 917 is an object to be imaged. A focal position 918 indicates a position where the photographing camera 901 is in focus, and a focal position 919 indicates a position where the photographing camera 902 is in focus. Note that the measurement range of the present apparatus is between the focal position 918 and the focal position 919.
[0095]
FIG. 10 is a flowchart showing a processing procedure of the three-dimensional shape measuring apparatus of FIG. 9 of the present embodiment. The operation of executing the three-dimensional shape measurement method of the present embodiment using the apparatus of FIG. 9 will be described according to the flowchart of FIG.
[0096]
When the photographing object 917 is photographed by the photographing camera 901, in step 1001, the image input unit 903 inputs a photographed image photographed by the photographing camera 901 and records the input image data 920 in the image recording memory 904.
[0097]
When the photographing object 917 is photographed by the photographing camera 902, the image input unit 903 inputs a photographed image photographed by the photographing camera 902 in step 1002, and records the inputted image data 921 in the image recording memory 905.
[0098]
In step 1003, the edge detector 906 reads the image data 920 and 921 from the image recording memories 904 and 905, and the difference between the luminance values of a certain pixel and a pixel adjacent to the pixel is greater than or equal to a preset value for each image. The contour region is determined by extracting all such pixels, and the region is written in the luminance change region recording memory 907 as the contour region extraction data 922. At this time, information of an image having a larger luminance value difference is also written. For example, a contour region 923 indicated by white represents a contour region obtained from the image data 921, and a contour region 924 indicated by a black line represents a contour region obtained from the image data 920.
[0099]
In step 1004, the spatial frequency spectrum calculator 908 reads out the contour region from the luminance change region recording memory 907, and for each pixel constituting the contour region, an image of N × N pixels in the vicinity centering on the pixel is obtained. A spatial frequency spectrum is obtained by reading from the image recording memories 904 and 905 and Fourier-transformed and written in the spatial frequency spectrum recording memories 909 and 910.
[0100]
In the present embodiment, an example using Fourier transform is given, but different orthogonal basis transforms such as cosine / sine transform and WaveLet transform may be used. In addition, since the outline of the spatial frequency spectrum distribution only needs to be approximated, it is possible to use Hadamard transform, Walsh transform, etc. In this embodiment, the type of orthogonal basis transform function used for obtaining the spatial frequency spectrum is determined. It is not limited. Further, a high-speed calculation method such as FFT or WFT may be used, and the present embodiment does not limit the presence or absence of speed-up and the method thereof.
[0101]
In step 1005, the maximum distribution direction detector 911 selects the spatial frequency spectrum of the captured image having the larger luminance change for each pixel from the spatial frequency spectrum recording memory 909 or the spatial frequency spectrum recording memory 910, and the spatial frequency spectrum. Detects the direction that extends to the highest frequency range. For example, spatial frequency spectra 926 and 927 are obtained by obtaining the spatial frequency spectrum of the pixel 925 from the images of the image data 920 and 921 in the contour region extraction data 922. Since the pixel 925 is a white line pixel, an image having a larger luminance change is the image data 921. Therefore, the direction 928 in which the spatial frequency spectrum 927 extends from the image data 921 to the highest frequency region is detected.
[0102]
In step 1006, the spectral intensity attenuation rate calculators 912 and 913 calculate the spectral intensity attenuation rate with respect to the spatial frequency in the detected direction for each image.
[0103]
In step 1007, the distance calculator 914 takes the ratio of the calculated spectral intensity attenuation factors, refers to the attenuation factor ratio → distance reference table 937, and sets the distance corresponding to the attenuation factor ratio to the attenuation factor ratio → It is obtained from the distance reference table 937. It is assumed that the attenuation ratio → distance reference table 937 is created in advance by the following procedure according to the procedure shown in FIG.
[0104]
FIG. 11 is a flowchart showing a processing procedure of the attenuation rate ratio → distance reference table creation processing of the present embodiment. When the calibration imaging plate 1109 whose right half is black and left half is white is placed at the focal position 919 of the imaging camera 902, in step 1101, the three-dimensional shape measuring apparatus determines the distance x between the calibration imaging plate 1109 and the imaging camera. Is set to the initial value.
[0105]
Next, when the calibration photographing plate 1109 is photographed by the photographing cameras 901 and 902, the image input unit 903 inputs the photographed photographed images from the photographing cameras 901 and 902 in step 1102 and stores them in the image recording memories 904 and 905. Store.
[0106]
In step 1103, the spatial frequency spectrum calculator 908 reads the stored captured images from the image recording memories 904 and 905, and obtains horizontal spatial frequency spectra at the boundary between white and black from the captured images, respectively. They are stored in the spatial frequency spectrum recording memories 909 and 910, respectively.
[0107]
In step 1104, the spectrum intensity attenuation rate calculators 912 and 913 read the stored spatial frequency spectrum from the spatial frequency spectrum recording memories 909 and 910, respectively, and then determine the attenuation rate of the spectrum intensity with respect to the frequency from each spatial frequency spectrum. .
[0108]
In step 1105, the three-dimensional shape measuring apparatus takes a ratio kr of the obtained spectral intensity attenuation rate, and in step 1106, the distance x between the calibration imaging plate 1109 and the imaging camera and the obtained spectral intensity attenuation rate. The ratio kr pair is added to the attenuation rate ratio → distance reference table 937.
[0109]
Next, when the position of the calibration imaging plate 1109 is separated from the imaging camera by δx, in step 1107, the three-dimensional shape measuring apparatus adds δx to the value of the distance x between the calibration imaging plate 1109 and the imaging camera.
[0110]
In step 1108, the distance x to the calibration imaging plate 1109 is compared with the distance to the far focus position 918. If the distance x is far from the far focus position 918, the process is terminated. Return to. By executing the above steps, the attenuation ratio → distance reference table 937 is generated.
[0111]
In step 1008, the interpolation calculator 915 interpolates the distance at that pixel by applying step 1009 and step 1010 to all the pixels that were not extracted in step 1003, that is, the pixels whose distance was not obtained by the distance calculator 914. Generate.
[0112]
In step 1009, the interpolation calculator 915 selects a pixel, and is closest to the pixel in each quadrant from the first quadrant to the fourth quadrant when the pixel is set to the origin 932 as shown in the interpolation schematic diagram 931 and By selecting the pixels for which distances have been obtained one by one, a total of four pixels 933 to 936 are obtained, and the distances in the pixels are interpolated and generated according to Equation 1. The reason for selecting the four pixels from the first quadrant to the fourth quadrant is that interpolation with higher accuracy is possible because the interpolated pixels always exist inside a quadrilateral connecting the four pixels. is there. However, since the pixels near the four corners of the image are not necessarily obtained by this selection method, four pixels are interpolated and generated according to Equation 1 from only the obtained pixels. In this embodiment, one pixel is selected for each quadrant, but this embodiment does not limit the pixel selection method. In step 1010, the interpolation calculator 915 writes the distance generated by the interpolation in the three-dimensional shape recording memory 916.
[0113]
As described above, according to the three-dimensional shape measuring apparatus of the present embodiment, the distance between the region and the imaging means is obtained from the spectral intensity attenuation rate of the spatial frequency spectrum in two captured images captured at different focal positions. Therefore, it is possible to obtain a three-dimensional shape with higher accuracy and a wider measurement range by using the Shape from Focus method from only two images.
[0114]
(Embodiment 3)
A three-dimensional shape measuring apparatus according to the third embodiment that obtains the distance from the spectral intensity attenuation rate of the one-dimensional spatial frequency spectrum in the normal direction of the boundary where the luminance changes will be described below.
[0115]
FIG. 12 is a diagram showing a schematic configuration of the three-dimensional shape measuring apparatus of the present embodiment. As shown in FIG. 12, the three-dimensional shape measurement apparatus of this embodiment includes an image input unit 1203, a normal direction one-dimensional spatial frequency spectrum calculation unit 1204, a spectral intensity attenuation rate calculation unit 1205, and a distance calculation unit 1206. Interpolation calculation means 1207 is provided.
[0116]
The image input unit 1203 is photographed by the first photographing unit 1202 having a focal position at a predetermined position and the second photographing unit 1202 having a focal position different from the predetermined position. And a second photographed image.
[0117]
The normal direction one-dimensional spatial frequency spectrum calculating means 1204 is configured to detect the image of the captured image having the larger luminance change in the region where at least one of the luminance changes in the input first and second captured images is a predetermined value or more. The normal direction of the boundary portion of the luminance change is obtained, and the one-dimensional spatial frequency spectrum in the normal direction of the photographed image having the larger luminance change and the one-dimensional spatial frequency spectrum in the normal direction of the other photographed image are obtained. Means for obtaining the first spatial frequency spectrum and the second spatial frequency spectrum, respectively.
[0118]
The spectral intensity attenuation rate calculating means 1205 is a means for obtaining the first and second attenuation rates of the spectral intensity with respect to the spatial frequency for the first and second spatial frequency spectra. The distance calculation means 1206 is a means for obtaining the distance between the subject in the area and the first photographing means 1201 or the second photographing means 1202 based on the obtained first and second attenuation factors.
[0119]
The interpolation calculation means 1207 performs interpolation on the subject by interpolating from the area for which the distance is calculated by the distance calculation means 1206 for the area where the luminance change in the input first and second captured images is less than the predetermined value. And a distance between the first photographing unit 1201 and the second photographing unit 1202.
[0120]
FIG. 12 shows a configuration in a case where the distance is obtained from the spectral intensity attenuation rate of the one-dimensional spatial frequency spectrum in the normal direction of the boundary portion where the luminance changes in the apparatus as in the second embodiment. It is good also as what calculates | requires distance similarly with such an apparatus.
[0121]
In other words, the image input unit 1203 inputs a photographed image photographed by the photographing unit 1201 or the photographing unit 1202 having a focal position at a predetermined position, and the normal direction one-dimensional spatial frequency spectrum calculation unit 1204 For a region where the luminance change is equal to or greater than a predetermined value, the normal direction of the boundary portion of the luminance change and the one-dimensional spatial frequency spectrum in the normal direction are obtained, and the spectral intensity attenuation rate calculation means 1205 calculates 1 in the normal direction. With respect to the three-dimensional spatial frequency spectrum, the attenuation rate of the spectral intensity with respect to the spatial frequency is obtained, the distance computing unit 1206 obtains the distance between the subject in the region and the imaging unit based on the attenuation rate, and the interpolation computing unit 1207 performs the imaging. The distance is calculated by the distance calculation means 1206 for an area where the luminance change in the image is less than the predetermined value. By interpolation from the region are or as obtaining the distance between the imaging means and the object.
[0122]
Further, the three-dimensional shape measuring apparatus of the present embodiment can be realized by a computer and a program, and the program can be recorded on a recording medium or provided through a network.
[0123]
FIG. 13 is a diagram showing the relationship between the normal direction of the boundary portion where the luminance changes and the spatial frequency spectrum of this embodiment. A photographed image 1301 in FIG. 13 is an image obtained by photographing a boundary portion where the luminance changes, and a luminance change boundary portion region 1302 is a boundary portion region where the luminance change is equal to or greater than a set value. The luminance change boundary normal direction 1303 indicates the normal direction of the boundary where the luminance changes by an arrow. When the spatial frequency spectrum of the luminance change boundary region 1302 is obtained, a spatial frequency spectrum 1304 is obtained.
[0124]
In the luminance change boundary normal direction 1303, the attenuation rate in the direction where the attenuation of the spectral intensity with respect to the spatial frequency is the smallest is obtained. This direction is indicated by an arrow 1305. Then, it can be seen that the luminance change boundary normal direction 1303 and the arrow 1305 are substantially in the same direction. Therefore, if the normal direction of the boundary where the luminance changes is detected in the process of detecting a region where the luminance change is equal to or greater than a predetermined set value, a one-dimensional spatial frequency spectrum in that direction is obtained, and then the spectral intensity is attenuated. The same result can be obtained by determining the rate. The process for doing this is shown in the flowchart of FIG.
[0125]
FIG. 14 is a diagram showing a processing outline of the three-dimensional shape measurement processing of the present embodiment. When photographing is performed by a photographing unit having a focal position at a predetermined position, in step 1401, the image input unit 1203 inputs a photographed image photographed by the photographing unit. In the case of the configuration similar to that of the second embodiment as shown in FIG. 12, two images are taken using the photographing means 1201 having a far focal position and the photographing means 1202 having a close focal position, and the same as in the first embodiment. In the case of the configuration, an image is captured by the imaging unit 1202 having a close focal position.
[0126]
In step 1402, the normal direction one-dimensional spatial frequency spectrum calculation means 1204 detects a region where the luminance change is equal to or greater than a predetermined set value. When two images are captured as described above, an area in which at least one of the luminance changes in the captured images is a predetermined value or more is detected.
[0127]
In step 1403, the normal direction one-dimensional spatial frequency spectrum calculation means 1204 detects the boundary portion where the luminance changes included in the region detected in step 1402 and obtains the normal direction of the boundary portion.
[0128]
In step 1404, the normal direction one-dimensional spatial frequency spectrum calculation means 1204 obtains the detected normal direction one-dimensional spatial frequency spectrum, and the spectrum intensity attenuation rate calculation means 1205 obtains the attenuation rate of the spectrum intensity with respect to the frequency. When two images are captured as described above, the one-dimensional spatial frequency spectrum in the normal direction of the captured image with the larger luminance change and the one-dimensional spatial frequency in the normal direction of the other captured image. The spectrum is obtained as a first spatial frequency spectrum and a second spatial frequency spectrum, respectively, and the spectral intensity attenuation rate calculating means 1205 determines the attenuation rate of the spectral intensity with respect to the spatial frequency for each of the first and second spatial frequency spectra. It calculates | requires as a 1st and 2nd attenuation factor.
[0129]
In step 1405, the distance calculation means 1206 obtains the distance using the attenuation rate obtained in the previous step. The specific method of determination is based on the method described in the operation of the first or second embodiment. Further, the interpolation calculation means 1207 interpolates the subject and the subject by interpolation from the area for which the distance is calculated by the distance calculation means 1206 for the area where the luminance change in both the first and second captured images is less than the predetermined value. A distance from the first photographing unit 1201 or the second photographing unit 1202 is obtained.
[0130]
By using the three-dimensional shape measurement method of this embodiment, it is not necessary to obtain a two-dimensional spatial frequency spectrum, so that the calculation cost can be greatly reduced and the processing time can be shortened.
Next, a more specific configuration and operation of the three-dimensional shape measuring apparatus according to the present embodiment will be described.
[0131]
FIG. 15 is a diagram showing a specific example of the three-dimensional shape measuring apparatus of the present embodiment. The three-dimensional shape measuring apparatus according to the present embodiment has a configuration for obtaining the distance from the spectral intensity attenuation rate of the one-dimensional spatial frequency spectrum in the normal direction of the boundary where the luminance changes, as shown in FIG. It is built in. Therefore, the same constituent means as in the apparatus of FIG. 3 of the first embodiment is given the same number as in FIG.
[0132]
An edge vector detector 1501 is a detector that detects an area in which a change in luminance value is equal to or greater than a predetermined set value in the image recorded in the image recording memory 303 and a normal vector of the area, and a luminance change area recording memory 1502 A memory for recording a region where a change in luminance value is a predetermined value or more and a normal vector thereof, a spatial frequency spectrum calculator 1503 is a calculator for calculating a one-dimensional spatial frequency spectrum in the direction of the normal vector, and a spatial frequency spectrum recording A memory 1504 is a memory for recording a one-dimensional spatial frequency spectrum.
[0133]
FIG. 16 is a flowchart showing the processing procedure of the three-dimensional shape measurement processing of the present embodiment. The operation of executing the three-dimensional shape measurement method of the present embodiment using the apparatus of FIG. 15 will be described according to the flowchart of FIG.
[0134]
When the photographing object 313 is photographed by the photographing camera 301, the image input unit 302 inputs a photographed image photographed by the photographing camera 301 in step 1601 and records the inputted photographed image data 315 in the image recording memory 303. .
[0135]
In step 1602, the edge vector detector 1501 reads the captured image data 315 from the image recording memory 303 and extracts all pixels whose luminance value difference between a certain pixel and a pixel adjacent to the pixel is equal to or larger than a preset value. To determine the contour region. Next, a normal vector orthogonal to the contour region at that position is obtained for each pixel constituting the contour region, and the region and normal vector are written into the luminance change region recording memory 1502. The contour area extraction data 1505 schematically represents the data, and it is assumed that a normal vector 1506 having a unit length is also recorded for each pixel.
[0136]
In step 1603, the spatial frequency spectrum calculator 1503 reads the contour region and the normal vector from the luminance change region recording memory 1502, and images N pixels in the vicinity of the normal vector direction centered on the pixel for each pixel. A one-dimensional spatial frequency spectrum 1507 is obtained by reading from the recording memory 303 and Fourier-transforming the pixels in the neighboring region, and written in the spatial frequency spectrum recording memory 1504.
[0137]
In step 1604, the spectrum intensity attenuation rate calculator 309 obtains the spectrum intensity attenuation rate from the one-dimensional spatial frequency spectrum.
[0138]
In step 1605, the distance calculator 310 refers to the attenuation rate → distance reference table 325 and obtains a distance corresponding to the obtained spectral intensity attenuation rate from the attenuation rate → distance reference table 325. It is assumed that the attenuation rate → distance reference table 325 is created in advance according to the procedure shown in FIG.
[0139]
In step 1606, the interpolation calculator 311 interpolates the distance at that pixel by applying step 1607 and step 1608 to all the pixels that have not been extracted in step 1602, ie, the pixels whose distance has not been determined by the distance calculator 310. Generate.
[0140]
In step 1607, the interpolation computing unit 311 selects a pixel, and sets the pixel closest to the pixel and the distance obtained for each quadrant from the first quadrant to the fourth quadrant when the pixel is set as the origin. By selecting one by one, a total of four pixels are obtained, and the distances at the pixels are interpolated and generated according to Equation 1. In this embodiment, one pixel is selected for each quadrant, but this embodiment does not limit the pixel selection method. In step 1608, the interpolation calculator 311 writes the distance generated by the interpolation in the three-dimensional shape recording memory 312.
[0141]
As described above, according to the three-dimensional shape measurement apparatus of this embodiment, the distance is obtained from the spectral intensity attenuation rate of the one-dimensional spatial frequency spectrum in the normal direction of the boundary where the luminance changes, so that the calculation cost is greatly reduced. However, the processing time can be shortened.
[0142]
(Embodiment 4)
Hereinafter, a three-dimensional shape measuring apparatus according to Embodiment 4 for obtaining a distance from a spectral intensity attenuation rate of a one-dimensional spatial frequency spectrum in the horizontal direction will be described.
[0143]
FIG. 17 is a diagram showing a schematic configuration of the three-dimensional shape measuring apparatus of the present embodiment. As shown in FIG. 17, the three-dimensional shape measurement apparatus of this embodiment includes an image input unit 1702, a horizontal one-dimensional spatial frequency spectrum calculation unit 1703, a spectrum intensity attenuation rate calculation unit 1704, a distance calculation unit 1705, And an interpolation calculation means 1706.
[0144]
The image input unit 1702 is a unit that inputs a photographed image photographed by the photographing unit 1701 having a focal position at a predetermined position. A horizontal one-dimensional spatial frequency spectrum calculating means 1703 is a means for obtaining a horizontal one-dimensional spatial frequency spectrum for a region where the luminance change in the input photographed image is a predetermined value or more.
[0145]
The spectrum intensity attenuation rate calculating means 1704 is a means for obtaining an attenuation rate of the spectrum intensity with respect to the spatial frequency for the one-dimensional spatial frequency spectrum in the horizontal direction. The distance calculation means 1705 is a means for obtaining the distance between the subject in the area and the photographing means 1701 based on the obtained attenuation rate.
[0146]
The interpolation calculation means 1706 calculates the distance between the subject and the photographing means 1701 by interpolation from the area where the distance is calculated by the distance calculation means 1705 for the area where the luminance change in the inputted photographed image is less than the predetermined value. It is a means to seek.
[0147]
FIG. 17 shows a configuration in the case where the distance is obtained from the spectral intensity attenuation rate of the one-dimensional spatial frequency spectrum in the horizontal direction using the apparatus as in the first embodiment. It is good also as what asks for.
[0148]
In other words, the image input unit 1702 has a first photographed image photographed by the first photographing unit 1701 having a focal position at a predetermined position and a second photographing unit having a focal position different from the predetermined position (FIG. And a second one-shot spatial frequency spectrum calculating means 1703, in which at least one of the luminance changes in the first and second shot images is greater than or equal to a predetermined value. The horizontal one-dimensional spatial frequency spectrum of the captured image with the larger luminance change and the horizontal one-dimensional spatial frequency spectrum of the other captured image are respectively the first spatial frequency spectrum and the second spatial frequency. The spectrum intensity attenuation rate calculating means 1704 obtains the spectrum as a spatial frequency with respect to the first and second spatial frequency spectra. The first and second attenuation factors are obtained as the first and second attenuation factors, respectively, and the distance calculation means 1705 determines the subject in the area and the first or second imaging means based on the first and second attenuation factors. In the interpolation calculation means 1706, the area where the luminance change in the first and second captured images is less than the predetermined value from the area where the distance is calculated by the distance calculation means 1705 is calculated. The distance between the subject and the first or second photographing unit may be obtained by interpolation.
[0149]
Further, the three-dimensional shape measuring apparatus of the present embodiment can be realized by a computer and a program, and the program can be recorded on a recording medium or provided through a network.
[0150]
FIG. 18 is a diagram showing the relationship between the direction of luminance change and the one-dimensional spatial frequency spectrum in the horizontal direction according to this embodiment. A captured image 1801 in FIG. 18 is an image obtained by capturing a boundary portion where the luminance changes in the horizontal direction, and a luminance change boundary portion region 1802 is a region of the boundary portion where the luminance changes in the horizontal direction. When a one-dimensional spatial frequency spectrum in the horizontal direction of the luminance change boundary region 1802 is obtained, a spatial frequency spectrum 1803 is obtained. By obtaining the attenuation factor 1804 from the spatial frequency spectrum 1803, the attenuation factor at the boundary where the luminance changes in the horizontal direction can be obtained efficiently.
[0151]
On the other hand, the photographed image 1805 is an image obtained by photographing the boundary portion where the luminance changes in the vertical direction. When a one-dimensional spatial frequency spectrum in the horizontal direction of the luminance change boundary area 1806 of the photographed image 1805 is obtained, a spatial frequency spectrum 1807 is obtained. Since the spatial frequency spectrum 1807 contains almost no high frequency component, the attenuation rate cannot be obtained.
[0152]
Therefore, in the method of the present embodiment, the boundary portion where the luminance changes in the horizontal direction can be correctly processed, but the error increases as the boundary portion tilts, and the boundary portion where the luminance changes in the vertical direction cannot be measured. However, when used for 3D image generation using the parallax effect, it is often sufficient to capture only the boundary portion where the luminance changes mainly in the horizontal direction, so this method is useful for this type of application. . Furthermore, the method according to the present embodiment does not require detection of the direction of the boundary portion as compared with the method according to the third embodiment, so that it is possible to further reduce the calculation cost and improve the processing speed.
[0153]
FIG. 19 is a diagram showing a process overview of the three-dimensional shape measurement process of the present embodiment. When photographing is performed by a photographing unit having a focal position at a predetermined position, in step 1901, the image input unit 1702 inputs a photographed image photographed by the photographing unit. In the case of the configuration similar to that of the first embodiment as shown in FIG. 17, an image is captured by the imaging unit 1701 having a close focal position, and in the case of the configuration similar to that of the second embodiment, the imaging unit having a far focal position. Two images are photographed using photographing means having a close focal position.
[0154]
In step 1902, the horizontal one-dimensional spatial frequency spectrum calculation means 1703 detects a region where the luminance change is equal to or greater than a predetermined set value.
[0155]
In step 1903, the horizontal one-dimensional spatial frequency spectrum calculation means 1703 obtains a horizontal one-dimensional spatial frequency spectrum for the region detected in step 1902, and the spectral intensity attenuation rate calculation means 1704 attenuates the spectral intensity with respect to the spatial frequency. Find the rate.
[0156]
In step 1904, the distance calculation means 1705 obtains the distance using the attenuation rate obtained in the previous step. The specific method of determination is based on the method described in the operation of the first or second embodiment. The interpolation calculation unit 1706 obtains the distance between the subject and the photographing unit 1701 by interpolation from the region where the distance is obtained by the distance calculation unit 1705 for the region where the luminance change in the photographed image is less than the predetermined value. .
[0157]
By using the three-dimensional shape measurement method of this embodiment, it is not necessary to obtain a two-dimensional spatial frequency spectrum, and it is not necessary to obtain the direction of a boundary portion where the luminance changes, so that the calculation cost can be greatly reduced. Thus, the processing time can be shortened.
[0158]
On the other hand, since the method of the present embodiment is only processing in the horizontal direction, it is not possible to measure a region where the distance changes in the vertical direction. However, when generating a parallax image or the like, it is often sufficient to be able to measure a region whose distance changes only in the horizontal direction, and there is no problem when used for such applications.
Next, a more specific configuration and operation of the three-dimensional shape measuring apparatus according to the present embodiment will be described.
[0159]
FIG. 20 is a diagram showing a specific example of the three-dimensional shape measuring apparatus of the present embodiment. The three-dimensional shape measuring apparatus according to the present embodiment incorporates a configuration for obtaining a distance from the spectral intensity attenuation rate of a horizontal one-dimensional spatial frequency spectrum in the apparatus according to the first embodiment shown in FIG. Therefore, the same constituent means as in the apparatus of FIG. 3 of the first embodiment is given the same number as in FIG.
[0160]
A horizontal one-dimensional spatial frequency spectrum calculator 2001 is a calculator that calculates a horizontal one-dimensional spatial frequency spectrum. A spatial frequency spectrum recording memory 2002 is a memory for recording a horizontal one-dimensional spatial frequency spectrum. The spectral intensity attenuation factor calculator 2003 is an arithmetic unit that calculates the spectral intensity attenuation factor with respect to the frequency of the horizontal one-dimensional spatial frequency spectrum.
[0161]
FIG. 21 is a flowchart showing the processing procedure of the three-dimensional shape measurement processing of the present embodiment. The operation of executing the three-dimensional shape measurement method of the present embodiment using the apparatus of FIG. 20 will be described according to the flowchart of FIG.
[0162]
When the photographing object 313 is photographed by the photographing camera 301, the image input unit 302 inputs a photographed image photographed by the photographing camera 301 in step 2101 and records the inputted photographed image data 315 in the image recording memory 303. .
[0163]
In step 2102, the edge detector 304 reads the photographed image data 315 from the image recording memory 303, and extracts all pixels whose luminance value difference between a certain pixel and a pixel adjacent to the pixel is equal to or larger than a preset value. Thus, the contour region is determined, and the region is written in the luminance change region recording memory 305.
[0164]
In step 2103, the horizontal one-dimensional spatial frequency spectrum calculator 2001 reads the contour region from the luminance change region recording memory 305, and records an image of N pixels in the horizontal direction centering on the pixel for each pixel. A one-dimensional spatial frequency spectrum 2004 is obtained by reading from the memory 303 and Fourier transforming the pixels in the neighboring region, and written in the spatial frequency spectrum recording memory 2002.
[0165]
In step 2104, the spectral intensity attenuation factor calculator 2003 obtains a horizontal spectral intensity attenuation factor from the one-dimensional spatial frequency spectrum.
[0166]
In step 2105, the distance calculator 310 refers to the attenuation rate → distance reference table 325 and obtains a distance corresponding to the obtained spectral intensity attenuation rate from the attenuation rate → distance reference table 325. It is assumed that the attenuation rate → distance reference table 325 is created in advance according to the procedure shown in FIG.
[0167]
In step 2106, the interpolation calculation unit 311 and the pixel not extracted in step 2102, that is, the pixel whose distance is not obtained by the distance calculation unit 310 are applied to step 2107 and step 2108, and the distance in the pixel is generated by interpolation. To do.
[0168]
In step 2107, the interpolation calculator 311 selects a pixel, and sets the pixel closest to the pixel and the distance obtained for each quadrant from the first quadrant to the fourth quadrant when the pixel is set as the origin. By selecting one by one, a total of four pixels are obtained, and the distances at the pixels are interpolated and generated according to Equation 1. In this embodiment, one pixel is selected for each quadrant, but this embodiment does not limit the pixel selection method. In step 2108, the interpolation calculator 311 writes the distance generated by the interpolation in the three-dimensional shape recording memory 312.
[0169]
As described above, according to the three-dimensional shape measuring apparatus of the present embodiment, the distance is obtained from the spectral intensity attenuation rate of the one-dimensional spatial frequency spectrum in the horizontal direction, so that the calculation cost can be efficiently calculated while minimizing performance degradation. Can be reduced.
[0170]
(Embodiment 5)
The three-dimensional shape measuring apparatus according to the fifth embodiment using the variable focal position imaging apparatus using the variable optical system will be described below.
[0171]
FIG. 22 is a diagram showing a schematic configuration of a focal position variable photographing apparatus using the variable optical system of the present embodiment. As shown in FIG. 22, the variable focal position imaging device of this embodiment includes an imaging optical system 2201, an image sensor 2202, shutter means 2203, and transmission means 2204.
[0172]
The imaging optical system 2201 is an optical system whose focal position changes when the movable part is driven. The image sensor 2202 is an element that detects an image to be captured. The shutter unit 2203 is a shutter having a two-step pressing depth. The transmission unit 2204 is a unit that drives the movable part of the imaging optical system 2201 according to the pressed depth of the shutter of the shutter unit 2203.
[0173]
(1) in FIG. 22 shows a state before the shutter is pressed, and the imaging optical system 2201 and the image sensor 2202 are combined to constitute one photographing unit using a variable optical system for the focal position.
[0174]
The operation of this apparatus will be described. When the shutter unit 2203 is pressed, the configuration shown in (2) of FIG. By performing the first photographing in this state, the processing in step 801 of the second embodiment in which the photographed image 807 photographed by the photographing means 701 with a far focal position is input can be performed.
[0175]
When the shutter unit 2203 is further pushed in, the image sensor 2202 is moved further away from the imaging optical system 2201 by the transmission unit 2204. The form at this time is shown in FIG. As a result, the imaging optical system 2201 and the image sensor 2202 are combined to form a photographing optical system with a close focal position. Therefore, the second photographing is performed in this state, and the photographing means 702 with a close focal position is used for photographing. The process of step 802 of the second embodiment for inputting the captured image 810 can be performed.
[0176]
By using the variable focal position imaging device of this embodiment, no dedicated power is required to move the focal position, variable focal imaging can be performed naturally and at high speed without forcing the photographer to perform special operations, etc. Produces benefits.
Next, a more specific configuration and operation of the focal position variable photographing apparatus of the present embodiment will be described.
[0177]
FIG. 23 is a diagram showing a specific example of the variable focal position imaging device using the variable optical system of the present embodiment. A shutter button 2301 is a button for operating the shutter of the variable focus position photographing apparatus of the present embodiment. A signal transmitter 2303 is a transmitter that transmits a signal when the shutter button 2301 reaches the depth 2302 of the first stage. A signal transmitter 2305 is a transmitter that transmits a signal when the shutter button 2301 reaches the depth 2304 of the second stage. Note that the signal transmitter 2303 and the signal transmitter 2305 are not active elements, and may be switches that simply perform electrical ON / OFF. The link mechanism 2306 is a mechanism that transmits the amount of movement to the imaging lens system 2307 when the shutter button 2301 is pushed from the depth 2302 to the depth 2304. The imaging lens system 2307 has a function of forming a photographed image on the image sensor 2308.
[0178]
Note that the configuration of the link system is not limited to this embodiment, and the relative distance between the imaging lens system 2307 and the image sensor 2308 is changed physically or optically by transmitting the movement amount of the shutter button. If it can be configured, it can be regarded as a transmission means for driving the variable optical system of the focal position of this embodiment. Needless to say, the focal position can also be changed by moving the position of the image sensor 2308 rather than the imaging lens system 2307.
[0179]
Next, the operation of this apparatus will be described. FIG. 23 (1) shows a state where the shutter button 2301 is not pressed. At this time, the imaging lens system 2307 is at a position 2309, and in this state, the focal position of the lens is far away, so that a far object is in focus.
[0180]
(2) in FIG. 23 shows a state in which the shutter button 2301 is pushed to the first depth 2302. An imaging signal is transmitted by the signal transmitter 2303 so that imaging can be performed. At this time, since the relative positions of the imaging lens system 2307 and the image sensor 2308 are not changed from (1), shooting is performed in a state where a distant object is in focus.
[0181]
(3) in FIG. 23 shows a state in which the shutter button 2301 is pressed to the second depth 2304. When the shutter button 2301 is pushed down to the depth 2304, the movement is transmitted to the imaging lens system 2307 through the link mechanism 2306, and the imaging lens system 2307 is moved forward to the position 2310. In this state, the focal position of the lens is close, and a nearby object is in focus. In this state, when a photographing signal is transmitted by the signal transmitter 2305 and photographing is performed, photographing is performed in a state where a nearby object is in focus.
[0182]
As described above, in the variable focal position imaging device of the present embodiment, it is possible to perform imaging at two different focal positions with one imaging means without requiring special power, and it is normal without forcing the photographer to perform special operations. It is possible to provide the convenience that two images with different focal positions can be continuously captured by simply pressing the shutter button.
[0183]
As described above, according to the three-dimensional shape measurement apparatus of this embodiment, the focal position is changed by driving the movable part of the optical system in accordance with the pressed depth of the shutter. It is possible to change the focal position at high speed by simple operation.
[0184]
【The invention's effect】
By the method and apparatus of the present invention, it is possible to provide a small-sized, low-cost, low-power-consumption, three-dimensional shape measuring apparatus with no limitation on measurement environment and measurement range.
By using the method and apparatus of the present invention, a region that could not be measured stably by the conventional method can be obtained stably by generating an interpolation from the measured region.
With the method and apparatus of the present invention, it is possible to provide a measuring apparatus with lower calculation cost and quick calculation time, particularly when only distance information that changes in the horizontal direction is required.
With the apparatus of the present invention, it is possible to provide an apparatus that can continuously capture two images with different focal positions by simply pressing the shutter by the photographer.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating a schematic configuration of a three-dimensional shape measuring apparatus according to a first embodiment.
FIG. 2 is a diagram illustrating a processing outline of the three-dimensional shape measurement apparatus according to the first embodiment.
FIG. 3 is a diagram illustrating a specific example of the three-dimensional shape measurement apparatus according to the first embodiment.
4 is a flowchart showing a processing procedure of the three-dimensional shape measuring apparatus shown in FIG. 3 according to the first embodiment.
FIG. 5 is a diagram illustrating an outline of a pixel adjacency condition according to the first embodiment.
FIG. 6 is a flowchart illustrating a processing procedure of attenuation rate → distance reference table creation processing according to the first exemplary embodiment.
7 is a diagram showing a schematic configuration of a three-dimensional shape measuring apparatus according to Embodiment 2. FIG.
FIG. 8 is a diagram illustrating a processing outline of a three-dimensional shape measurement process according to the second embodiment.
FIG. 9 is a diagram illustrating a specific example of the three-dimensional shape measurement apparatus according to the second embodiment.
10 is a flowchart showing a processing procedure of the three-dimensional shape measuring apparatus shown in FIG. 9 according to the second embodiment.
FIG. 11 is a flowchart illustrating a processing procedure of attenuation rate ratio → distance reference table creation processing according to the second embodiment;
FIG. 12 is a diagram illustrating a schematic configuration of a three-dimensional shape measurement apparatus according to a third embodiment.
FIG. 13 is a diagram illustrating a relationship between a normal direction of a boundary portion where the luminance changes and a spatial frequency spectrum according to the third embodiment.
FIG. 14 is a diagram illustrating a processing outline of a three-dimensional shape measurement process according to the third embodiment.
FIG. 15 is a diagram illustrating a specific example of the three-dimensional shape measurement apparatus according to the third embodiment.
FIG. 16 is a flowchart illustrating a processing procedure of a three-dimensional shape measurement process according to the third embodiment.
FIG. 17 is a diagram illustrating a schematic configuration of a three-dimensional shape measuring apparatus according to a fourth embodiment.
FIG. 18 is a diagram illustrating a relationship between a luminance changing direction and a horizontal one-dimensional spatial frequency spectrum according to the fourth embodiment.
FIG. 19 is a diagram illustrating a processing outline of a three-dimensional shape measurement process according to the fourth embodiment.
FIG. 20 is a diagram illustrating a specific example of the three-dimensional shape measurement apparatus according to the fourth embodiment.
FIG. 21 is a flowchart illustrating a processing procedure of a three-dimensional shape measurement process according to the fourth embodiment.
FIG. 22 is a diagram illustrating a schematic configuration of a focal position variable imaging apparatus using a variable optical system according to a fifth embodiment.
FIG. 23 is a diagram illustrating a specific example of a focal position variable imaging apparatus using a variable optical system according to a fifth embodiment.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 101 ... Imaging | photography means, 102 ... Image input means, 103 ... Spatial frequency spectrum calculation means, 104 ... Spectral intensity attenuation rate calculation means, 105 ... Distance calculation means, 106 ... Interpolation calculation means, 206 ... Captured image, 207 ... Close distance Area 208: Distant area 209 ... Contour area extraction data 210 ... Points 211 ... Spatial frequency spectrum 212 ... Area 213 ... Attenuation rate-> Distance reference table 214 and 215 ... Pixel, 301 ... Shooting camera, 302 ... Image input unit, 303 ... Image recording memory, 304 ... Edge detector, 305 ... Luminance change area recording memory, 306 ... Spatial frequency spectrum calculator, 307 ... Spatial frequency spectrum recording memory, 308 ... Maximum distribution direction detector, 309 ... Spectral intensity attenuation rate calculator, 310 ... Distance calculator, 311 ... Interpolator, DESCRIPTION OF SYMBOLS 12 ... Three-dimensional shape recording memory, 313 ... Shooting object, 314 ... Focus position, 315 ... Shooting image data, 316 ... Contour region extraction data, 317 ... Spatial frequency spectrum, 318 ... Maximum distribution direction, 319 ... Interpolation schematic diagram, 320 ... Origin, 321-324 ... Pixel, 325 ... Attenuation rate → Distance reference table, 608 ... Calibration imaging plate, 701 and 702 ... Imaging means, 703 ... Image input means, 704 ... Spatial frequency spectrum calculation means, 705 ... Spectral intensity Attenuation rate calculation means, 706 ... distance calculation means, 707 ... interpolation calculation means, 807 ... photographed image, 808 ... area far away, 809 ... area near distance, 810 ... photographed image, 811 ... area near distance, 812 ... Distant area, 813 ... contour area extraction data, 814 and 815 ... spatial frequency spectrum, 816 ... area, 17 and 818 ... attenuation rate, 819 ... direction, 820 ... attenuation rate ratio → distance reference table, 901 and 902 ... photographing camera, 903 ... image input unit, 904 and 905 ... image recording memory, 906 ... edge detector, 907 ... Luminance change area recording memory, 908... Spatial frequency spectrum calculator, 909 and 910... Spatial frequency spectrum recording memory, 911... Maximum distribution direction detector, 912 and 913 ... Spectral intensity attenuation rate calculator, 914. ... Interpolation calculator, 916 ... Three-dimensional shape recording memory, 917 ... Shooting object, 918 and 919 ... Focus position, 920 and 921 ... Image data, 922 ... Contour area extraction data, 923 and 924 ... Contour area, 925 ... Pixel, 926 and 927 ... spatial frequency spectrum, 928 ... direction, 929 ... half mirror, 9 DESCRIPTION OF SYMBOLS 30 ... Mirror, 931 ... Interpolation schematic diagram, 932 ... Origin, 933-936 ... Pixel, 937 ... Attenuation rate ratio → Distance reference table, 1109 ... Calibration plate, 1201 and 1202 ... Shooting means, 1203 ... Image input means, 1204 ... Normal direction one-dimensional spatial frequency spectrum calculating means 1205 ... Spectral intensity attenuation rate calculating means 1206 ... Distance calculating means 1207 ... Interpolating calculating means 1301 ... Photographed image 1302 ... Luminance change boundary region 1303 ... Luminance Normal direction of change boundary portion 1304 ... Spatial frequency spectrum, 1305 ... Arrow, 1501 ... Edge vector detector, 1502 ... Luminance change region recording memory, 1503 ... Spatial frequency spectrum calculator, 1504 ... Spatial frequency spectrum recording memory, 1505 ... Outline region extraction data, 1506... Normal vector, 150 ... Spatial frequency spectrum, 1701 ... Imaging means, 1702 ... Image input means, 1703 ... Horizontal one-dimensional spatial frequency spectrum calculation means, 1704 ... Spectral intensity attenuation rate calculation means, 1705 ... Distance calculation means, 1706 ... Interpolation calculation means, 1801 ... taken image, 1802 ... luminance change boundary region, 1803 ... spatial frequency spectrum, 1804 ... attenuation factor, 1805 ... taken image, 1806 ... luminance change boundary region, 1807 ... spatial frequency spectrum, 2001 ... horizontal one-dimensional spatial frequency Spectrum calculator 2002 ... Spatial frequency spectrum recording memory 2003 ... Spectral intensity attenuation factor calculator 2004 ... Spatial frequency spectrum 2201 ... Imaging optical system 2202 ... Imaging element 2203 ... Shutter means 2204 ... Transmission means 2301 ... Shutter button , 2302 ... depth, 2303 ... signal transmitter, 2304 ... depth, 2305 ... signal transmitter, 2306 ... link mechanism 2307 ... imaging lens system, 2308 ... imaging element, 2309 and 2310 ... position.

Claims (14)

影手段で撮影された撮影画像を入力する第1のステップと、
前記撮影画像内の輝度変化が所定値以上の領域について、該領域内の画素を中心とする近傍領域の輝度の2次元空間周波数スペクトル分布を求める第2のステップと、
前記2次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰が最小となる当該2次元空間周波数スペクトル分布の中心からの方向を検出し、該方向における前記減衰率を求める第3のステップと、
前記第3のステップで求めた減衰率、および被写体と前記撮影手段との距離と前記減衰率との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記撮影手段との距離を求める第4のステップと、
前記撮影画像内の輝度変化が前記所定値未満の領域について、前記第4のステップで被写体と前記撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記撮影手段との距離を求める第5のステップとを有することを特徴とする3次元形状計測方法。
A first step of inputting image captured by the shadow unit shooting,
A second step of obtaining a two-dimensional spatial frequency spectrum distribution of luminance in a neighboring region centered on a pixel in the region for a region where the luminance change in the captured image is equal to or greater than a predetermined value ;
For the two-dimensional spatial frequency spectrum distribution, and detects the direction from the center of the two-dimensional spatial frequency spectrum distribution attenuation factor is minimized to a high frequency region from the DC component of the spectrum intensity with respect to the spatial frequency, the attenuation rate in the direction A third step for determining
A fourth method for obtaining the distance between the subject in the area and the photographing unit based on the attenuation rate obtained in the third step and a table in which the correspondence between the distance between the subject and the photographing unit and the attenuation factor is recorded in advance . And the steps
For an area where the luminance change in the captured image is less than the predetermined value , the distance between the subject in the area and the imaging means by interpolation from the area in which the distance between the subject and the imaging means is obtained in the fourth step. And a fifth step for obtaining the three-dimensional shape measurement method.
1の撮影手段で撮影された第1の撮影画像と前記第1の撮影手段の焦点位置とは異なる焦点位置を有する第2の撮影手段で撮影された第2の撮影画像とをそれぞれ入力する第1のステップと、
前記第1及び第2の撮影画像内の輝度変化の少なくとも一方が所定値以上の領域について、輝度変化がより大きい方の撮影画像の前記領域内の画素を中心とする近傍領域の輝度の2次元空間周波数スペクトル分布及び他方の撮影画像の前記領域内の画素を中心とする近傍領域の輝度の2次元空間周波数スペクトル分布をそれぞれ第1の2次元空間周波数スペクトル分布及び第2の2次元空間周波数スペクトル分布として求める第2のステップと、
前記第1の2次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰が最小となる当該2次元空間周波数スペクトル分布の中心からの方向を検出し、該方向における前記減衰率を第1の減衰率として求め、前記第2の2次元空間周波数スペクトル分布について、前記方向と同じ方向における前記減衰率を第2の減衰率として求める第3のステップと、
前記第3のステップで求めた第1の減衰率と第2の減衰率の比を減衰率比として求め、該減衰率比、および被写体と前記第1または第2の撮影手段との距離と前記減衰率比との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記第1または第2の撮影手段との距離を求める第4のステップと、
前記第1及び第2の撮影画像内の輝度変化がいずれも前記所定値未満の領域について、前記第4のステップで被写体と前記第1または第2の撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記第1または第2の撮影手段との距離を求める第5のステップとを有することを特徴とする3次元形状計測方法。
A first photographed image photographed by the first photographing means and a second photographed image photographed by the second photographing means having a focal position different from the focal position of the first photographing means are respectively input. A first step;
For a region where at least one of the luminance changes in the first and second photographed images is greater than or equal to a predetermined value , the two-dimensional luminance of the neighboring region centered on the pixel in the region of the photographed image having the larger luminance change spatial frequency spectrum distribution and the other captured each of the first two-dimensional spatial frequency spectrum distribution of the luminance of the neighboring region centering pixels in the area of the image of the two-dimensional spatial frequency spectrum distribution and the second two-dimensional spatial frequency spectrum A second step for obtaining a distribution ;
For the first two-dimensional spatial frequency spectrum distribution , a direction from the center of the two-dimensional spatial frequency spectrum distribution where the attenuation rate from the direct current component of the spectral intensity with respect to the spatial frequency to the high frequency region is minimized is detected in the direction. It obtains the attenuation factor as a first attenuation factor, for the second two-dimensional spatial frequency spectrum distribution, a third step of obtaining the attenuation factor in the same direction as the direction as the second attenuation factor,
The ratio between the first attenuation factor and the second attenuation factor obtained in the third step is obtained as an attenuation factor ratio, the attenuation factor ratio, the distance between the subject and the first or second photographing means, and the A fourth step of obtaining a distance between the subject in the area and the first or second imaging means based on a table in which the correspondence relationship with the attenuation rate ratio is recorded in advance ;
From the area where the distance between the subject and the first or second photographing means is obtained in the fourth step for the area where the luminance change in the first and second photographed images is both less than the predetermined value. And a fifth step of obtaining a distance between the subject in the region and the first or second photographing means by interpolation of the three-dimensional shape measurement method.
影手段で撮影された撮影画像を入力する第1のステップと、
前記撮影画像内の輝度変化が所定値以上の領域について、該輝度変化の境界部の法線方向と該法線方向の輝度の1次元空間周波数スペクトル分布とを求める第2のステップと、
記1次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰率を求める第3のステップと、
前記第3のステップで求めた減衰率、および被写体と前記撮影手段との距離と前記減衰率との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記撮影手段との距離を求める第4のステップと、
前記撮影画像内の輝度変化が前記所定値未満の領域について、前記第4のステップで被写体と前記撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記撮影手段との距離を求める第5のステップとを有することを特徴とする3次元形状計測方法。
A first step of inputting image captured by the shadow unit shooting,
A second step of obtaining a normal direction of a boundary portion of the luminance change and a one-dimensional spatial frequency spectrum distribution of luminance in the normal direction for a region where the luminance change in the captured image is equal to or greater than a predetermined value;
For the previous SL one-dimensional spatial frequency spectrum distribution, a third step of obtaining the attenuation factor of the DC component of the spectral intensity with respect to the spatial frequency to a high frequency region,
A fourth method for obtaining the distance between the subject in the area and the photographing unit based on the attenuation rate obtained in the third step and a table in which the correspondence between the distance between the subject and the photographing unit and the attenuation factor is recorded in advance . And the steps
For an area where the luminance change in the captured image is less than the predetermined value , the distance between the subject in the area and the imaging means by interpolation from the area in which the distance between the subject and the imaging means is obtained in the fourth step. And a fifth step for obtaining the three-dimensional shape measurement method.
1の撮影手段で撮影された第1の撮影画像と前記第1の撮影手段の焦点位置とは異なる焦点位置を有する第2の撮影手段で撮影された第2の撮影画像とをそれぞれ入力する第1のステップと、
前記第1及び第2の撮影画像内の輝度変化の少なくとも一方が所定値以上の領域について、輝度変化がより大きい方の撮影画像の該輝度変化の境界部の法線方向を求めると共に、輝度変化がより大きい方の撮影画像の該法線方向の輝度の1次元空間周波数スペクトル分布及び他方の撮影画像の該法線方向の輝度の1次元空間周波数スペクトル分布をそれぞれ第1の1次元空間周波数スペクトル分布及び第2の1次元空間周波数スペクトル分布として求める第2のステップと、
前記第1及び第2の1次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰率をそれぞれ第1及び第2の減衰率として求める第3のステップと、
前記第3のステップで求めた第1の減衰率と第2の減衰率の比を減衰率比として求め、該減衰率比、および被写体と前記第1または第2の撮影手段との距離と前記減衰率比との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記第1または第2の撮影手段との距離を求める第4のステップと、
前記第1及び第2の撮影画像内の輝度変化がいずれも前記所定値未満の領域について、前記第4のステップで被写体と前記第1または第2の撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記第1または第2の撮影手段との距離を求める第5のステップとを有することを特徴とする3次元形状計測方法。
A first photographed image photographed by the first photographing means and a second photographed image photographed by the second photographing means having a focal position different from the focal position of the first photographing means are respectively input. A first step;
For a region where at least one of the luminance changes in the first and second captured images is equal to or greater than a predetermined value, the normal direction of the boundary portion of the luminance change of the captured image having the larger luminance change is obtained, and the luminance change one-dimensional spatial frequency spectrum distribution and the other of the normal line direction of the luminance of the captured image the one-dimensional spatial frequency spectrum distribution of each of the first one-dimensional spatial frequency spectrum of but luminance normal line direction of the larger side of the captured image A second step for obtaining a distribution and a second one-dimensional spatial frequency spectrum distribution ;
A third step for obtaining the first and second attenuation factors for the first and second one-dimensional spatial frequency spectrum distributions , respectively, from the direct current component of the spectral intensity with respect to the spatial frequency to the high frequency region ;
The ratio between the first attenuation factor and the second attenuation factor obtained in the third step is obtained as an attenuation factor ratio, the attenuation factor ratio, the distance between the subject and the first or second photographing means, and the A fourth step of obtaining a distance between the subject in the area and the first or second imaging means based on a table in which the correspondence relationship with the attenuation rate ratio is recorded in advance ;
From the area where the distance between the subject and the first or second photographing means is obtained in the fourth step for the area where the luminance change in the first and second photographed images is both less than the predetermined value. And a fifth step of obtaining a distance between the subject in the region and the first or second photographing means by interpolation of the three-dimensional shape measurement method.
影手段で撮影された撮影画像を入力する第1のステップと、
前記撮影画像内の輝度変化が所定値以上の領域について、水平方向の輝度の1次元空間周波数スペクトル分布を求める第2のステップと、
記1次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰率を求める第3のステップと、
前記第3のステップで求めた減衰率、および被写体と前記撮影手段との距離と前記減衰率との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記撮影手段との距離を求める第4のステップと、
前記撮影画像内の輝度変化が前記所定値未満の領域について、前記第4のステップで被写体と前記撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記撮影手段との距離を求める第5のステップとを有することを特徴とする3次元形状計測方法。
A first step of inputting image captured by the shadow unit shooting,
A second step of obtaining a one-dimensional spatial frequency spectrum distribution of horizontal luminance in a region where the luminance change in the captured image is equal to or greater than a predetermined value;
For the previous SL one-dimensional spatial frequency spectrum distribution, a third step of obtaining the attenuation factor of the DC component of the spectral intensity with respect to the spatial frequency to a high frequency region,
A fourth method for obtaining the distance between the subject in the area and the photographing unit based on the attenuation rate obtained in the third step and a table in which the correspondence between the distance between the subject and the photographing unit and the attenuation factor is recorded in advance . And the steps
For an area where the luminance change in the captured image is less than the predetermined value , the distance between the subject in the area and the imaging means by interpolation from the area in which the distance between the subject and the imaging means is obtained in the fourth step. And a fifth step for obtaining the three-dimensional shape measurement method.
1の撮影手段で撮影された第1の撮影画像と前記第1の撮影手段の焦点位置とは異なる焦点位置を有する第2の撮影手段で撮影された第2の撮影画像とをそれぞれ入力する第1のステップと、
前記第1及び第2の撮影画像内の輝度変化の少なくとも一方が所定値以上の領域について、輝度変化がより大きい方の撮影画像の水平方向の輝度の1次元空間周波数スペクトル分布及び他方の撮影画像の水平方向の輝度の1次元空間周波数スペクトル分布をそれぞれ第1の1次元空間周波数スペクトル分布及び第2の1次元空間周波数スペクトル分布として求める第2のステップと、
前記第1及び第2の1次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰率をそれぞれ第1及び第2の減衰率として求める第3のステップと、
前記第3のステップで求めた第1の減衰率と第2の減衰率の比を減衰率比として求め、該減衰率比、および被写体と前記第1または第2の撮影手段との距離と前記減衰率比との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記第1または第2の撮影手段との距離を求める第4のステップと、
前記第1及び第2の撮影画像内の輝度変化がいずれも前記所定値未満の領域について、前記第4のステップで被写体と前記第1または第2の撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記第1または第2の撮影手段との距離を求める第5のステップとを有することを特徴とする3次元形状計測方法。
A first photographed image photographed by the first photographing means and a second photographed image photographed by the second photographing means having a focal position different from the focal position of the first photographing means are respectively input. A first step;
In a region where at least one of the luminance changes in the first and second photographed images is equal to or greater than a predetermined value , the one-dimensional spatial frequency spectrum distribution of the horizontal luminance of the photographed image having the larger luminance change and the other photographed image a second step of determining a horizontal one-dimensional spatial frequency spectrum distribution and the second one-dimensional spatial frequency spectrum distribution first respective one-dimensional spatial frequency spectrum distribution of the luminance of,
A third step for obtaining the first and second attenuation factors for the first and second one-dimensional spatial frequency spectrum distributions , respectively, from the direct current component of the spectral intensity with respect to the spatial frequency to the high frequency region ;
The ratio between the first attenuation factor and the second attenuation factor obtained in the third step is obtained as an attenuation factor ratio, the attenuation factor ratio, the distance between the subject and the first or second photographing means, and the A fourth step of obtaining a distance between the subject in the area and the first or second imaging means based on a table in which the correspondence relationship with the attenuation rate ratio is recorded in advance ;
From the area where the distance between the subject and the first or second photographing means is obtained in the fourth step for the area where the luminance change in the first and second photographed images is both less than the predetermined value. And a fifth step of obtaining a distance between the subject in the region and the first or second photographing means by interpolation of the three-dimensional shape measurement method.
影手段で撮影された撮影画像を入力する画像入力手段と、
前記撮影画像内の輝度変化が所定値以上の領域について、該領域内の画素を中心とする近傍領域の輝度の2次元空間周波数スペクトル分布を求めるスペクトル演算手段と、
前記2次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰が最小となる当該2次元空間周波数スペクトル分布の中心からの方向を検出し、該方向における前記減衰率を求める減衰率演算手段と、
前記減衰率演算手段で求めた減衰率、および被写体と前記撮影手段との距離と前記減衰率との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記撮影手段との距離を求める距離演算手段と、
前記撮影画像内の輝度変化が前記所定値未満の領域について、前記距離演算手段で被写体と前記撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記撮影手段との距離を求める補間演算手段とを備えることを特徴とする3次元形状計測装置。
Image input means for inputting the image captured by the shadow unit shooting,
The region change in luminance than the predetermined value in the captured image, a spectrum calculation means for obtaining a two-dimensional spatial frequency spectrum distribution of the luminance of the neighboring region centering pixels within the region,
For the two-dimensional spatial frequency spectrum distribution , a direction from the center of the two-dimensional spatial frequency spectrum distribution where the attenuation rate from the direct current component of the spectral intensity with respect to the spatial frequency to the high frequency region is minimized is detected, and the attenuation rate in the direction is detected. A decay rate calculating means for obtaining
Distance calculation for determining the attenuation rate obtained by the attenuation rate calculating means and the distance between the subject and the photographing means in the area based on a table in which the correspondence between the distance between the subject and the photographing means and the attenuation ratio is recorded in advance. Means,
For region luminance change is smaller than the predetermined value in the captured image, the distance between the imaging means and the object of the area by interpolation from the region where the distance is determined between the imaging means and the object in the distance calculating means A three-dimensional shape measuring apparatus, comprising: a required interpolation calculation means.
1の撮影手段で撮影された第1の撮影画像と前記第1の撮影手段の焦点位置とは異なる焦点位置を有する第2の撮影手段で撮影された第2の撮影画像とをそれぞれ入力する画像入力手段と、
前記第1及び第2の撮影画像内の輝度変化の少なくとも一方が所定値以上の領域について、輝度変化がより大きい方の撮影画像の前記領域内の画素を中心とする近傍領域の輝度の2次元空間周波数スペクトル分布及び他方の撮影画像の前記領域内の画素を中心とする近傍領域の輝度の2次元空間周波数スペクトル分布をそれぞれ第1の2次元空間周波数スペクトル分布及び第2の2次元空間周波数スペクトル分布として求めるスペクトル演算手段と、
前記第1の2次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰が最小となる当該2次元空間周波数スペクトル分布の中心からの方向を検出し、該方向における前記減衰率を第1の減衰率として求め、前記第2の2次元空間周波数スペクトル分布について、前記方向と同じ方向における前記減衰率を第2の減衰率として求める減衰率演算手段と、
前記減衰率演算手段で求めた第1の減衰率と第2の減衰率の比を減衰率比として求め、該減衰率比、および被写体と前記第1または第2の撮影手段との距離と前記減衰率比との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記第1または第2の撮影手段との距離を求める距離演算手段と、
前記第1及び第2の撮影画像内の輝度変化がいずれも前記所定値未満の領域について、前記距離演算手段で被写体と前記第1または第2の撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記第1または第2の撮影手段との距離を求める補間演算手段とを備えることを特徴とする3次元形状計測装置。
A first photographed image photographed by the first photographing means and a second photographed image photographed by the second photographing means having a focal position different from the focal position of the first photographing means are respectively input. Image input means;
For a region where at least one of the luminance changes in the first and second photographed images is greater than or equal to a predetermined value , the two-dimensional luminance of the neighboring region centered on the pixel in the region of the photographed image having the larger luminance change spatial frequency spectrum distribution and the other captured each of the first two-dimensional spatial frequency spectrum distribution of the luminance of the neighboring region centering pixels in the area of the image of the two-dimensional spatial frequency spectrum distribution and the second two-dimensional spatial frequency spectrum Spectrum calculation means to obtain as distribution ;
For the first two-dimensional spatial frequency spectrum distribution , a direction from the center of the two-dimensional spatial frequency spectrum distribution where the attenuation rate from the direct current component of the spectral intensity with respect to the spatial frequency to the high frequency region is minimized is detected in the direction. obtains the attenuation factor as a first attenuation factor, for the second two-dimensional spatial frequency spectrum distribution, the attenuation factor calculating means for obtaining the attenuation factor in the same direction as the direction as the second attenuation factor,
The ratio of the first attenuation rate and the second attenuation rate obtained by the attenuation rate calculating means is obtained as an attenuation rate ratio, and the attenuation rate ratio, the distance between the subject and the first or second imaging means, and the Distance calculating means for obtaining a distance between the subject in the area and the first or second imaging means based on a table in which the correspondence relationship with the attenuation rate ratio is recorded in advance ;
For areas where the luminance changes in the first and second photographed images are both less than the predetermined value, from the area where the distance between the subject and the first or second photographing means is obtained by the distance calculating means . 3. A three-dimensional shape measuring apparatus comprising: an interpolation calculation unit that obtains a distance between a subject in the region and the first or second imaging unit by interpolation.
影手段で撮影された撮影画像を入力する画像入力手段と、
前記撮影画像内の輝度変化が所定値以上の領域について、該輝度変化の境界部の法線方向と該法線方向の輝度の1次元空間周波数スペクトル分布とを求めるスペクトル演算手段と、
記1次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰率を求める減衰率演算手段と、
前記減衰率演算手段で求めた減衰率、および被写体と前記撮影手段との距離と前記減衰 率との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記撮影手段との距離を求める距離演算手段と、
前記撮影画像内の輝度変化が前記所定値未満の領域について、前記距離演算手段で被写体と前記撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記撮影手段との距離を求める補間演算手段とを備えることを特徴とする3次元形状計測装置。
Image input means for inputting the image captured by the shadow unit shooting,
For region luminance change is equal to or more than a predetermined value in the captured image, a spectrum calculation means for obtaining a one-dimensional spatial frequency spectrum distribution of brightness in the normal direction and normal line direction of the boundary of the luminance change,
For the previous SL one-dimensional spatial frequency spectrum distribution, the attenuation factor calculating means for obtaining the attenuation factor of the DC component of the spectral intensity with respect to the spatial frequency to a high frequency region,
Distance calculation for determining the attenuation rate obtained by the attenuation rate calculating means, and the distance between the subject and the photographing means in the area based on a table in which the correspondence between the distance between the subject and the photographing means and the attenuation ratio is recorded in advance. Means,
For region luminance change is smaller than the predetermined value in the captured image, the distance between the imaging means and the object of the area by interpolation from the region where the distance is determined between the imaging means and the object in the distance calculating means A three-dimensional shape measuring apparatus, comprising: a required interpolation calculation means.
1の撮影手段で撮影された第1の撮影画像と前記第1の撮影手段の焦点位置とは異なる焦点位置を有する第2の撮影手段で撮影された第2の撮影画像とをそれぞれ入力する画像入力手段と、
前記第1及び第2の撮影画像内の輝度変化の少なくとも一方が所定値以上の領域について、輝度変化がより大きい方の撮影画像の該輝度変化の境界部の法線方向を求めると共に、輝度変化がより大きい方の撮影画像の該法線方向の輝度の1次元空間周波数スペクトル分布及び他方の撮影画像の該法線方向の輝度の1次元空間周波数スペクトル分布をそれぞれ第1の1次元空間周波数スペクトル分布及び第2の1次元空間周波数スペクトル分布として求めるスペクトル演算手段と、
前記第1及び第2の1次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰率をそれぞれ第1及び第2の減衰率として求める減衰率演算手段と、
前記減衰率演算手段で求めた第1の減衰率と第2の減衰率の比を減衰率比として求め、該減衰率比、および被写体と前記第1または第2の撮影手段との距離と前記減衰率比との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記第1または第2の撮影手段との距離を求める距離演算手段と、
前記第1及び第2の撮影画像内の輝度変化がいずれも前記所定値未満の領域について、前記距離演算手段で被写体と前記第1または第2の撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記第1または第2の撮影手段との距離を求める補間演算手段とを備えることを特徴とする3次元形状計測装置。
A first photographed image photographed by the first photographing means and a second photographed image photographed by the second photographing means having a focal position different from the focal position of the first photographing means are respectively input. Image input means;
In a region where at least one of the luminance changes in the first and second photographed images is equal to or greater than a predetermined value, the normal direction of the boundary of the luminance change of the photographed image having the larger luminance change is obtained, and the luminance change one-dimensional spatial frequency spectrum distribution and the other of the normal line direction of the luminance of the captured image the one-dimensional spatial frequency spectrum distribution of each of the first one-dimensional spatial frequency spectrum of but luminance normal line direction of the larger side of the captured image Spectrum calculating means for obtaining the distribution and the second one-dimensional spatial frequency spectrum distribution ;
Attenuation rate calculating means for obtaining the first and second attenuation factors as the first and second attenuation factors for the first and second one-dimensional spatial frequency spectrum distributions , respectively, from the direct current component of the spectral intensity to the spatial frequency to the high frequency region ;
The ratio of the first attenuation rate and the second attenuation rate obtained by the attenuation rate calculating means is obtained as an attenuation rate ratio, and the attenuation rate ratio, the distance between the subject and the first or second imaging means, and the Distance calculating means for obtaining a distance between the subject in the area and the first or second imaging means based on a table in which the correspondence relationship with the attenuation rate ratio is recorded in advance ;
For areas where the luminance changes in the first and second photographed images are both less than the predetermined value, from the area where the distance between the subject and the first or second photographing means is obtained by the distance calculating means . 3. A three-dimensional shape measuring apparatus comprising: an interpolation calculation unit that obtains a distance between a subject in the region and the first or second imaging unit by interpolation.
影手段で撮影された撮影画像を入力する画像入力手段と、
前記撮影画像内の輝度変化が所定値以上の領域について、水平方向の輝度の1次元空間周波数スペクトル分布を求めるスペクトル演算手段と、
記1次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰率を求める減衰率演算手段と、
前記減衰率演算手段で求めた減衰率、および被写体と前記撮影手段との距離と前記減衰率との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記撮影手段との距離を求める距離演算手段と、
前記撮影画像内の輝度変化が前記所定値未満の領域について、前記距離演算手段で被写体と前記撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記撮影手段との距離を求める補間演算手段とを有することを特徴とする3次元形状計測装置。
Image input means for inputting the image captured by the shadow unit shooting,
Change in luminance for an area equal to or greater than a predetermined value in said captured image, a spectrum calculation means for obtaining the one-dimensional spatial frequency spectrum distribution in the horizontal direction of the luminance,
For the previous SL one-dimensional spatial frequency spectrum distribution, the attenuation factor calculating means for obtaining the attenuation factor of the DC component of the spectral intensity with respect to the spatial frequency to a high frequency region,
Distance calculation for determining the attenuation rate obtained by the attenuation rate calculating means and the distance between the subject and the photographing means in the area based on a table in which the correspondence between the distance between the subject and the photographing means and the attenuation ratio is recorded in advance. Means,
For region luminance variation is smaller than the predetermined value in the captured image, the distance between the imaging means and the object of the area by interpolation from the region where the distance is determined between the imaging means and the object in the distance calculating means A three-dimensional shape measuring apparatus having an interpolation calculation means to be obtained.
1の撮影手段で撮影された第1の撮影画像と前記第1の撮影手段の焦点位置とは異なる焦点位置を有する第2の撮影手段で撮影された第2の撮影画像とをそれぞれ入力する画像入力手段と、
前記第1及び第2の撮影画像内の輝度変化の少なくとも一方が所定値以上の領域について、輝度変化がより大きい方の撮影画像の水平方向の輝度の1次元空間周波数スペクトル分布及び他方の撮影画像の水平方向の輝度の1次元空間周波数スペクトル分布をそれぞれ第1の1次元空間周波数スペクトル分布及び第2の1次元空間周波数スペクトル分布として求めるスペクトル演算手段と、
前記第1及び第2の1次元空間周波数スペクトル分布について、空間周波数に対するスペクトル強度の直流成分から高周波領域までの減衰率をそれぞれ第1及び第2の減衰率として求める減衰率演算手段と、
前記減衰率演算手段で求めた第1の減衰率と第2の減衰率の比を減衰率比として求め、該減衰率比、および被写体と前記第1または第2の撮影手段との距離と前記減衰率比との対応関係を予め記録したテーブルに基づき当該領域の被写体と前記第1または第2の撮影手段との距離を求める距離演算手段と、
前記第1及び第2の撮影画像内の輝度変化がいずれも前記所定値未満の領域について、前記距離演算手段で被写体と前記第1または第2の撮影手段との距離が求められた領域からの補間によって当該領域の被写体と前記第1または第2の撮影手段との距離を求める補間演算手段とを備えることを特徴とする3次元形状計測装置。
A first photographed image photographed by the first photographing means and a second photographed image photographed by the second photographing means having a focal position different from the focal position of the first photographing means are respectively input. Image input means;
In a region where at least one of the luminance changes in the first and second photographed images is equal to or greater than a predetermined value , the one-dimensional spatial frequency spectrum distribution of the luminance in the horizontal direction of the photographed image having the larger luminance change and the other photographed image a spectrum calculating means for obtaining a one-dimensional spatial frequency spectrum distribution in the horizontal direction of the luminance as a first one-dimensional spatial frequency spectrum distribution and the second one-dimensional spatial frequency spectrum distribution each,
Attenuation rate calculating means for obtaining the first and second attenuation factors as the first and second attenuation factors for the first and second one-dimensional spatial frequency spectrum distributions , respectively, from the direct current component of the spectral intensity to the spatial frequency to the high frequency region ;
The ratio of the first attenuation rate and the second attenuation rate obtained by the attenuation rate calculating means is obtained as an attenuation rate ratio, and the attenuation rate ratio, the distance between the subject and the first or second imaging means, and the Distance calculating means for obtaining a distance between the subject in the area and the first or second imaging means based on a table in which the correspondence relationship with the attenuation rate ratio is recorded in advance ;
For areas where the luminance changes in the first and second photographed images are both less than the predetermined value, from the area where the distance between the subject and the first or second photographing means is obtained by the distance calculating means . 3. A three-dimensional shape measuring apparatus comprising: an interpolation calculation unit that obtains a distance between a subject in the region and the first or second imaging unit by interpolation.
前記請求項1乃至請求項6に記載のステップをコンピュータに実行させることを特徴とするプログラム。  A program for causing a computer to execute the steps according to any one of claims 1 to 6. 前記請求項1に記載のプログラムを記録したことを特徴とするコンピュータ読み取り可能な記録媒体。A computer-readable recording medium characterized by recording a program according to claim 1 3.
JP2003050687A 2003-02-27 2003-02-27 Three-dimensional shape measuring method, three-dimensional shape measuring apparatus, processing program therefor, and recording medium Expired - Lifetime JP4091455B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003050687A JP4091455B2 (en) 2003-02-27 2003-02-27 Three-dimensional shape measuring method, three-dimensional shape measuring apparatus, processing program therefor, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003050687A JP4091455B2 (en) 2003-02-27 2003-02-27 Three-dimensional shape measuring method, three-dimensional shape measuring apparatus, processing program therefor, and recording medium

Publications (2)

Publication Number Publication Date
JP2004257934A JP2004257934A (en) 2004-09-16
JP4091455B2 true JP4091455B2 (en) 2008-05-28

Family

ID=33116037

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003050687A Expired - Lifetime JP4091455B2 (en) 2003-02-27 2003-02-27 Three-dimensional shape measuring method, three-dimensional shape measuring apparatus, processing program therefor, and recording medium

Country Status (1)

Country Link
JP (1) JP4091455B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4665125B2 (en) * 2006-08-17 2011-04-06 独立行政法人産業技術総合研究所 Method for measuring height and apparatus therefor
JP5243833B2 (en) * 2008-04-04 2013-07-24 株式会社日立製作所 Image signal processing circuit, image display device, and image signal processing method
JP5178553B2 (en) * 2009-01-27 2013-04-10 オリンパス株式会社 Imaging device
JP2011039918A (en) * 2009-08-17 2011-02-24 Sony Corp Apparatus and method for processing image and program
JP5556494B2 (en) * 2010-08-10 2014-07-23 株式会社ニコン Image processing apparatus, image processing method, and program

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61201373A (en) * 1985-03-04 1986-09-06 Nec Corp Processing method for image signal
JPH0560528A (en) * 1991-09-03 1993-03-09 Hitachi Ltd Input device for three-dimensional information
JPH05231842A (en) * 1992-02-19 1993-09-07 Hitachi Eng Co Ltd Shape pattern inspection method and device
DE69331719T2 (en) * 1992-06-19 2002-10-24 Agfa Gevaert Nv Method and device for noise suppression
JP3481631B2 (en) * 1995-06-07 2003-12-22 ザ トラスティース オブ コロンビア ユニヴァーシティー イン ザ シティー オブ ニューヨーク Apparatus and method for determining a three-dimensional shape of an object using relative blur in an image due to active illumination and defocus
FR2776456B1 (en) * 1998-03-20 2000-06-16 Centre Nat Etd Spatiales IMPROVEMENT IN IMAGE ACQUISITION BY BROOM PUSH
JP2000242799A (en) * 1999-02-18 2000-09-08 Nippon Telegr & Teleph Corp <Ntt> Device and method for detecting structure domain, and recording medium recording program
JP3595736B2 (en) * 1999-07-14 2004-12-02 株式会社オプトン Non-contact shape measurement method
JP3685667B2 (en) * 1999-10-27 2005-08-24 株式会社日立製作所 Three-dimensional shape detection method and apparatus, and inspection method and apparatus
JP2002056348A (en) * 2000-08-07 2002-02-20 Tohken Co Ltd Hand readout device with autofocus function, autofocus method, and distance measuring method
JP2003036437A (en) * 2001-07-25 2003-02-07 Konica Corp Method and device for evaluating sharpness and image recorder

Also Published As

Publication number Publication date
JP2004257934A (en) 2004-09-16

Similar Documents

Publication Publication Date Title
Jeon et al. Accurate depth map estimation from a lenslet light field camera
KR102480245B1 (en) Automated generation of panning shots
JP5362087B2 (en) Method for determining distance information, method for determining distance map, computer apparatus, imaging system, and computer program
US10670829B2 (en) Imaging device
JP5868183B2 (en) Imaging apparatus and imaging method
US20130335535A1 (en) Digital 3d camera using periodic illumination
JP2001194114A (en) Image processing apparatus and method and program providing medium
KR20200044676A (en) Method and apparatus for active depth sensing and calibration method thereof
KR20140004592A (en) Image blur based on 3d depth information
JP2008123141A (en) Corresponding point search method and three-dimensional position measurement method
CN107517346B (en) Photographing method and device based on structured light and mobile device
JP2018503066A (en) Accuracy measurement of image-based depth detection system
JP6304244B2 (en) 3D shape measuring apparatus, 3D shape measuring method, and 3D shape measuring program
CN110213491B (en) Focusing method, device and storage medium
US11512946B2 (en) Method and system for automatic focusing for high-resolution structured light 3D imaging
Bailey et al. Fast depth from defocus from focal stacks
JP7378219B2 (en) Imaging device, image processing device, control method, and program
CN113643414A (en) Three-dimensional image generation method and device, electronic equipment and storage medium
JP5857712B2 (en) Stereo image generation apparatus, stereo image generation method, and computer program for stereo image generation
US11348271B2 (en) Image processing device and three-dimensional measuring system
JP4091455B2 (en) Three-dimensional shape measuring method, three-dimensional shape measuring apparatus, processing program therefor, and recording medium
JP6867645B2 (en) Image processing equipment, methods, and programs
Chen et al. Finding optimal focusing distance and edge blur distribution for weakly calibrated 3-D vision
JP2017134561A (en) Image processing device, imaging apparatus and image processing program
CN109859313B (en) 3D point cloud data acquisition method and device, and 3D data generation method and system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050120

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061010

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070130

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070330

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080228

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110307

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110307

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120307

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130307

Year of fee payment: 5