[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

JP3806473B2 - Ranging device - Google Patents

Ranging device Download PDF

Info

Publication number
JP3806473B2
JP3806473B2 JP32037996A JP32037996A JP3806473B2 JP 3806473 B2 JP3806473 B2 JP 3806473B2 JP 32037996 A JP32037996 A JP 32037996A JP 32037996 A JP32037996 A JP 32037996A JP 3806473 B2 JP3806473 B2 JP 3806473B2
Authority
JP
Japan
Prior art keywords
sensor
area
calculation
difference
distance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP32037996A
Other languages
Japanese (ja)
Other versions
JPH10160456A (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.)
Olympus Corp
Original Assignee
Olympus 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 Olympus Corp filed Critical Olympus Corp
Priority to JP32037996A priority Critical patent/JP3806473B2/en
Publication of JPH10160456A publication Critical patent/JPH10160456A/en
Application granted granted Critical
Publication of JP3806473B2 publication Critical patent/JP3806473B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Measurement Of Optical Distance (AREA)
  • Focusing (AREA)
  • Automatic Focus Adjustment (AREA)

Description

【0001】
【発明の属する技術分野】
本発明はカメラやビデオ等に使われる測距装置に係わり、より正確な距離測定とピント合せが可能な装置を提供するための技術に関する。
【0002】
【従来の技術】
通常、カメラ等に採用される測距装置は光を利用するものが多く、装置側から信号光を投射する方式の「アクティブタイプ」と、対象物の輝度分布像を利用する方式の「パッシブタイプ」に大別される。これらは共に三角測距を基本原理としており、アクティブタイプでは投光と受光の位置間隔を基本の長さ(基線長)とし、パッシブタイプでは2つの受光位置を基準としその視差による対象物の像の相対位置差にしたがって対象物までの距離を求めている。この対象物の像を観察するためには受光位置ごとの光量を測定する必要があることから、複数の光センサを並べて成るラインセンサを利用している。
【0003】
まず、このパッシブタイプの測距装置の測距方法について図1を用いて説明する。2つの受光レンズ1a,1bが基線長Bだけ離間して配置され、被写体6からこれらのレンズを介して入射した光はそれぞれラインセンサ2a,2b上に曲線パターン3a,3bのような光パターンを形成するが、これらパターンは被写体6上の輝度分布と両方の受光レンズの相対位置関係に依存し、得られる両パターン3a,3bの相対位置差xは、上記基線長Bとレンズ、センサ間距離fおよび被写体距離Lに依存する。つまり次の関係が成立する。
x = B×f/L …(式a)
このようなラインセンサの出力から演算によって相対位置差を算出する方法(以下、相関演算と称す)については、特公平7−54371号公報に開示されている。
【0004】
また、この光パターンのどの部分を利用して測距するのかも重要な技術であり、例えば図5に示すように人物6aを測距しようとしても、もし、センサアレイ2aのRn2の部分に入射した光を加味してしまうと、背景の山6bの輝度が混入し(以下、遠近混在と称す)、正しい測距ができなくなる。つまり図中R1 〜Rn1までのセンサに入射する光だけは利用しても、Rn2のセンサ信号は利用しないようにする例えば特公平5−88445号公報に開の技術が正確な測距には必要となる。
【0005】
さらに、特開平2−135311号公報に開示された焦点検出装置によれば、ラインセンサの各データのデータ変化を調べて、その中の変化率の小さい所に該当する信号を測距に利用している。
さらにまた、カメラの撮影レンズの焦点距離に従って測距枠を切り替える技術は古くから広く知られており、例えば特開昭53−99935号公報に開示された自動焦点調節を行うカメラの測距範囲表示装置などがあり、撮影シーンの画面内における測距エリアを一定に設定することで、上記誤差の発生を防止するような技術もあった。
【0006】
【発明が解決しようとする課題】
しかしながら、まず特公平7−54371号公報に開示の技術は上記「遠近混在」の問題には触れておらず、他方の特公平5−88445号公報に開示の技術では、相関演算後はこの結果が不適当の場合にセンサのエリアを切り替えるというものであり、その判定や切替え制御の分、よけいな時間を要しかつデータを何度も加工し直す関係からマイコン等を利用して判定や演算をするのにもメモリ容量やプログラムの容量が増加する等の不具合があった。つまり、これらの従来技術を単に組み合わせたとしても、高速かつ高精度の測距装置は提供することは困難である。
【0007】
また、従来の装置の運用上においては、測距する被写体の明暗の分布によっても誤差を生じ、この誤差を対策しなければ同じ距離であっても被写体によって測距の誤差を生じるだけでなく、あるいは被写体の部分によって測距の誤差を生じることが有り得る。また一般に、測距装置でも採用する構成部品やそれらの組立ての「ばらつき」によっても、必ずしも設計どおりの測距結果が出力できないことが多く、したがって製造時にこの問題を対策するための調整工程が必要である。しかし、この調整工程においても、調整用チャートと測距装置の位置関係の微妙なズレに起因して正確な安定した出力が得られないことがある。なぜならば、この出力が安定しない限り正しい調整は困難であり、結果として正確な測距装置の提供も不可能となっているが、この問題に関しても上述の従来技術には考慮されていなかった。
【0008】
そこで本発明は上記の問題点に鑑みてなされ、どのような対象物に対しても常に正しい測距ができるような測距装置を提供するものであり、そのためには、パッシブタイプの測距装置の対象物の持つ固有なパターン(例えばチャート)に対する依存性(即ち被写体に基づく固有な「クセ」)を取り除くための対策を施した測距装置を提供することを目的とするものである。また本発明では上記遠近混在の誤差にも強い測距装置を提案し、カメラやビデオのピント合わせ用に応用する際に、対象物に正確なピント合わせができるような測距装置を提供することを目的としている。
【0009】
【課題を解決するための手段】
上記の目的を達成するために、第1の発明は、測距装置であって、視差を有する一対の受光素子列により被写体像を受光して、一対の被写体像信号を出力する受光手段と、前記一対の被写体像信号につきそれぞれ所定サイズに分割された複数のエリアの中から1つを選択する選択手段と、前記選択したエリア内の両端の受光素子のセンサ信号レベルと、この両端の受光素子のそれぞれに隣接する受光素子のセンサ信号レベルとの差を求め、この差の計算結果が所定条件を満たすように当該選択されたエリアのサイズ、又は位置を変更する変更手段と、上記変更手段で変更されたエリアのセンサ信号を用いて相関演算及び補間演算を行う相関手段と、を具備する。
【0010】
【発明の実施の形態】
以下に図面を参照しながら、本発明に係わる複数の実施形態について説明する。
まずその前提として、図1に、前述したパッシブタイプの測距装置における光パターンの相対位置差算出方法について説明する。
において、両受光レンズ1a、1bの位置の差B(基線長)により、センサアレイ2a、2b上に入射する光分布の相対位置差xは、被写体距離Lに依存して変化する。各受光レンズの焦点距離をfとすると、被写体距離Lは次式で求められる。
L = B×f/x …(式b)
センサアレイの各センサは光の入射量にしたがって電流信号を出力するので、これらをA/D変換器4によりディジタル信号に変換すれば、像ずれ量を算出する演算手段5による相関演算によって上記相対位置差xが検出できる。この結果をワンチップマイコン等からなる演算制御手段(CPU)10に入力して上記式bに基づき演算することで被写体距離Lが求められる。以上がパッシブタイプの三角測距方式の基本原理と一般的な装置構成である。
【0011】
上記のずれ量演算機能は、一般的に後述のように2つのプロセスから成るが、これらはCUP10内に制御プログラムとして内蔵していてもよい。このような技術を用いてカメラのピント合わせを行う場合、このCPU10がカメラの動作を制御し、撮影用ピント合わせ用レンズ等をモータなどのアクチュエータを介して適宜制御すれば自動焦点( AF) 機能付きカメラが提供できる。
【0012】
像ずれ量の演算のためには、両方のラインセンサにおけるセンサピッチの単位でどれだけ像がずれているかを調べる演算ステップ(即ち相関演算)を必要とする。そして、これより細かい分解能でさらに正確にずれ量を算出する演算ステップ(以下、補間演算と称す)を必要とする。
【0013】
センサアレイ2a上に図が示す波形3aのようなパターンで光が入射した場合は、各センサR1〜R6の出力の大きさは、図2(b)に棒グラフで示したような分布3aとなる。なおここでは、‘R’は右側(Right)のセンサを示し、‘L’は左側(Left)のセンサを示して、これらに付された添え字の1〜6は、例えば受光レンズ光軸基準でのセンサの位置の絶対位置を示していると仮定する。左側センサの出力L1〜L6から出力R1〜R6と同じ信号が出力される場合には、上記相対位置差xは0となるので、求める被写体距離Lは「無限遠」となる。
【0014】
また、被写体が「有限距離」に存在すると、上記xとセンサピッチSPから決るセンサの数Sだけシフトしたところの左側センサLには、図2(c)に示すような上記出力R1 〜R6 に類似する値の出力信号が得られる。
図2(a)のグラフにおける縦軸の値FF(i) は次式に従って求められる。
【0015】
FF(i) = Σ|R(i) −L(i) | …(式c)
すなわち、あるRのセンサの出力から対応するLのセンサの出力を引き算し、その絶対値を各センサごとに加算した結果FFを用いればよい。すなわち、まずRi からLi を引き算してその絶対値をとり、所定の幅でiを変化させてこれらを加算する。
次に、Ri またはLi の一方のセンサを1単位だけずらし、先に差をとった隣接するセンサと同様に差をとると、次式のようなにFF(i+1) が表せる。
【0016】
FF(i+1) = Σ|R(i+1) −L(i) | …(式d)
このように順次、ずらし量(以下、SIFT量と称す)を変更しながらFFが得られるが、RとLとの差の和であるFFが最小値(Fmin )となるSIFT量の所が最もよく対応がとれている位置と考えられるため、この場合のSIFT量が上記Sとして求められる。以上が相関演算に関するプロセスの概略手順である。
【0017】
また、上記Sを加味して両センサアレイの出力分布を図示すると、図2(b)のように、L側のSだけずれた各センサから対応する添え字の付いたR側各センサと同様の出力が得られる。
【0018】
続いて、図2(b)〜(d)を用いて「補間演算」プロセスについて詳しく説明する。実際の2つのセンサアレイ上の像のズレ量はぴったりとセンサのピッチでずれるわけではなく、また正確な測距にはピッチより細かい精度にて像ズレ量を検出しなければならない。そこで補間演算を行う。図2(b),(c)中のRとLは各々図1中のセンサアレイ2a,2bを構成する一部のセンサ出力を表わしている。
また、図2(d)には、すでに「相関演算」が終了した上記Sだけシフトさせた後で比較しやすい状態に直したグラフを示してある。すなわち、L0 〜L4 は正確にはLs 〜Ls+4 と記述するべきであるが、記載上繁雑になるのを避けてこのSは省略して記してある。
ここで、Lのセンサには上記Sだけシフトした後もR基準でまだxだけずれた光が入射しているとする。このとき例えば、L1 のセンサにはR0 とR1 に入射する光が混じり合って入射し、同様に、各LのセンサにもR基準でxだけずれた光が順次に入射するので、各Lの出力(L1 〜L3 )は、図16の[式1]に示したように表現されることがわかる。
【0019】
上記Fmin とFmin から上記シフト量をプラス方向とマイナス方向にずらしたFFの値F-1とF+1は、この各Rn ,Ln の出力を用いて表現すると、図17の[式2]のように表される。さらに、[式1]を用いて[式2]を展開すると、値Fmin ,F-1,F+1のそれぞれは図18の[式3]のように表される。
また、この[式3]中の{|R0 −R1 |+|R1 −R2 |+|R2 −R3 |}を(ΣΔR)として表現すると、この(ΣΔR)に依存せず、先のズレ量xが図19の[式4]に示す演算によって求められる。以上が「補間演算」である。
【0020】
なお、これらの演算は、図1中の演算部5にて行われるが、ワンチップマイコン等の演算制御手段(CPU)10において所定のプログラムに従って行ってもよい。
【0021】
図3には、本発明の主な実施形態に係わるカメラの構成の概念図を示す。このカメラには前述したレンズ1a,1bやセンサアレイ2a,2b等から成る基本構成の測距ユニット100が測距装置として搭載されている。ユニット内蔵の相関手段5は高速のハードロジック回路(不図示)で構成されている。
A/D変換回路4は、センサアレイのアナログ出力をディジタルデータに変換する回路であり、ここでは変換データを記憶する機能も有するものとする。出力回路7はシリアル通信で、この記憶データをCPU10に対して出力する。このCPU10は、図示のように上記シリアル通信用の各ポート要素やカメラの各機能を制御する端子等から成るポート19と、これを制御する演算用レジスタ14,や汎用のレジスタ18と、演算部17と、データの一時記憶用のRAM15と、所定アルゴリズムでこれらを制御するためのプログラムが格納したROM16等から構成されている。
【0022】
このCPU10からポート19を介し、所定の制御によって繰出し制御を行う繰出し手段12によりピント合わせ用のレンズ13が繰り出されると共に、シャッタ8などが駆動制御される。
また、上記ポート19を介しROM(EEPROM)9が設けられており、後述する一実施形態例のように、このEEPROM9はカメラの部品のばらつきや、組立て精度のばらつきによって生じる誤差を補正するための固有な補正係数を記憶するなどに利用する電気的に書込み可能なROMであり、製造ラインの調整工程(図14)にて、補正値の検出およびEEPROMへの書込み記憶が行われる。
このように、CPU10はこの補正データを参照しながら撮影時の測距制御等をはじめとするカメラの統括的制御を行う。
【0023】
(第1実施形態)
まず図4には、本発明の実施形態に係わる演算処理等の概略的処理手順をフローチャートで示している。本発明の測距装置においてはおよそ次のような手順で処理が実行される。すなわち、最初にセンサアレイの入射光に基づくデータや、センサピッチ単位の相関値等を読み込む(S101)。続いて、左右のセンサから所定エリアでの測距するためのデータを本発明の1つの特徴的な後述する手法によって読み込む。概略的には、一定のエリアからやみくもに左右のデータを読み込んでそれぞれに補間演算するのではなく、例えばn=0〜3の中でエリア端部の右側センサのデータ|R1 −R0 |と|Rn+1 −Rn |(即ち|R4 −R3 |)の大きさを比較し(S102)、その差が所定条件を満たすエリアまでシフトすることでエリア変更を行いながら(S103)、もう一方の左側センサのデータ出力も求め、その後、相関演算および補間演算とを行う(S104)。そして、この結果から被写体までの正しい距離を得て、ピント合わせ等に使用することができる。
【0024】
図7のフローチャートには、前述のような構成のカメラの測距装置の処理動作について本発明の第1実施形態として詳しく例示している。
まず、相関エリアを指定する。例えばここでは、R1 〜R3 (図1(d)参照)として示したような相関エリアを指定してセンサアレイに入射する光パターンに基づくデータをA/D変換手段4でA/D変換する(S1)。
【0025】
相関部5により、演算されたセンサピッチ単位の相関結果Sを読み込み(S2)、R側のセンサから所定のエリアで測距するためのデータを読み込む(S3)。前述したように本発明の特徴の1つともなる手法として、先に指定したエリアをやみくもに補間演算せず、エリア端部のセンサデータ|R1 −R0 |(図7では|Rn −Rn-1 |)及び|Rn+1 −Rn |(図7では|R4+n −R3+n |)の大きさを比較して(S4〜S7)、これらの差が所定値Rco以下になる領域までS12,S13でシフトしてから演算を行うと、この処理手法により、図18の[式3]に示すF+1は、常に近似を成立させるので正しい測距が可能となる。 上記ステップS6において、エリアの末尾側のデータ差が大きいことを判定された場合は、データ差の小さい方のエリアの数字の若い方にシフトする(S12)。
【0026】
また、上記ステップS7にてエリアの最初側のデータ差が大きいことを判定された場合は、データ差の小さい方のエリアの数字の大きい方にシフトする(S13)。これらのシフトによってステップS3に戻り同様な処理を繰り返すことにより、図5(c)で説明したような作用効果を得ることができる。
続いて、前述のようにして、選択された領域に対するL側センサの出力も求め(S8)、図17の[式2]に基づく演算を行い(S9)、図19の[式4]に基づき補間演算を行って(S10)、xを求めて、この結果とSを用いて距離Lを求め、ピント合わせを行う(S11)。
なお、このフローチャートに従う測距制御は、カメラのシャッタ動作に先立って瞬時に行われる。
【0027】
(作用効果1)
以上に説明のように、本実施形態の測距装置によれば、[式3]で示した式に基づく演算手法を用いて近似誤差を最小限に抑え、誤測距の無い結果値から算出された値に基づいて正確なピント合わせが可能となる。また、測距ユニット中のハードロジック回路によって構成された相関演算手段を利用してシフト量Sを求めるので、演算の高速化も可能となる。
【0028】
(作用効果1' )
その他にも、従来の課題であった「遠近混在」の誤差は、本発明の特徴でもある上記|R1 −R0 |及び|Rn+1 −Rn |(図1では|R4 −R3 |)を判定し、先に述べた近似が成り立つエリアを選択し直すようにする技術によっても軽減することができる。例えば、図5(b)のようなシーンで、測距ユニット100で人物6aを測距するとき、背景の明るい木6bが、センサアレイに入ってしまうと、図5(a)の2つのグラフに示したようなデータが左右2つのセンサアレイ(右側( R) 、左側( L) )から得られる。ここで、横軸はセンサアレイを構成する各センサの位置nを示し、縦軸は各センサの出力値Ln ,Rn を表わし、幅Kは人物6aの顔の幅に対応する。このようなシーンでは、顔と背景の混ざり合ったセンサ出力が生じ得るが、例えば図5(c)に示すようなエリアEにて測距を行うと、このような混在出力を演算に加味して誤測距となり得る。
しかし、本発明の手法を用いれば、エリア最初のセンサ1と、その前のセンサ0の出力の差と、エリア最後のセンサEとその隣のセンサE+1の出力差を比較するので、同じエリア幅Eであっても、「エリア変更」にて図5(d)に示すような、最初のセンサ1と、その前のセンサ0の出力の差と、エリア最後のセンサEとその隣のセンサE+1の出力差の小さいエリアを選択して、遠近混在の効き難いところで補間演算を行うので、正しい測距が可能となることがわかる。
【0029】
(第2実施形態)
上述した第1実施形態では、相関演算手段等の利用により確かに高速演算が実現できたが、その後の処理においてエリア端部のデータ差の近似判別を行い上記「エリア変更」が行われていくうちに、当該被写体像の測距しているポイントが変化して、既に求めたシフト量Sが変化してしまう恐れが生じ得る。
そこで、図8のフローチャートに示す第2実施形態では、上述の問題点を対策すべく、相関演算前にエリア端部のデータ差の近似判別を行って、相関演算時と補間演算時の使用エリアの「変化」を無くするようにしている。なお、ここでは、相関演算もCPUが図11に示すようなアルゴリズムに従って実行されるものとし、図8中のステップS27にサブルーチン「相関演算」として設けている。また、説明を簡単にするために、相関は図1や[式3]に合わせて3つのセンサを合わせたエリアで行うものとする。
【0030】
まず最初に、センサアレイ(ラインセンサ)の中のどの部分を用いて測距を行うかを選択する為のステップであり、ここではn0 番目のセンサの次から3つ、また、判定にはその両端のn0 とn4 を利用するため、読み込み開始ポイントとしてはn0 を入力している(S20)。
そして、R側のデータの読込みを行い(S21)、続くステップS22〜S25,およびステップS35,S36では、前述した第1実施形態の図7と同様に、エリア端部の近似適当性の判定及びエリアシフトを行い、この結果に従って、続くステップS21〜S26において左右RおよびLのセンサアレイの選択されたエリアの実質的なデータ読込みを行う。
この後、前述の相関演算を行い(S27)、続いて、図7のステップS9と同様にしてFmin ,F-1,F+1の算出を行い(S28〜S30)、補間演算を行いxを算出し(S31)、こうして得られた値S,xに基づいて距離Lを算出し(S32)、この測距値に従って最適なピント合わせを行う(S33)。
【0031】
(作用効果2)
このように本実施形態では補間処理時のみならず、相関処理時においても上記エリア端部の近似誤差を低減する為の判定を行っており、その結果を考慮したエリアを用いているので、エリアを切り替える際には相関誤差が発生しない。したがって本実施形態によれば、補間時の近似誤差の無い正確なピント合わせの可能なAFカメラを提供できる。
【0032】
(第3実施形態)
以上の実施形態は比較的単純なものであったが1つ問題もある。つまり上記実施形態では、近似が成立する所までセンサのエリアを変更移動していくため、計測したい領域を計れなくなってしまうと言う副作用が心配される。そこでこの問題を対策する例として第3実施形態のフローチャートを図9に例示する。必要最小限度のエリアだけを測定対象にでき、かつ誤差の少ない測距を図ったものである。
【0033】
例えば本実施形態では、次に詳しく説明する図9のフローチャートに従って測距の際に所定の領域内でエリアを適宜シフトして、近似誤差の最も少ないエリアのデータだけを用いた測距手法を行っている。すなわち、
まず、前述した図8のステップS20と同様にエリアの先頭の1つ前のセンサ番号n0 をnとして指定し、さらに近似誤差比較用の定数Rc4を100にセットする(S40)。こうして選択されたR側のセンサのデータを読み込んでCPUに入力し(S41)、次のステップS42,S43,S44では、エリア両端部のデータ差の差Rc3を算出する(S41〜S44)。
【0034】
このようにして得られたRc3を比較定数Rc4と比較し(S45)、もしもRc3の方が小さければ、この場合のnをn1 とし(S46)、このときのRc3を新たな比較定数Rc4とし(S47)、nをインクリメントした後(S48)、nがn0 から5センサ単位分以上は大きくならないように判定して(S49)、この範囲内なら再度上記ステップS41に戻ってループし端部誤差Rc3が最小となるnを求める。このループを回った後は、nがn0 〜n0+5 の間で誤差が最小値となる場合のnがn1 として求められる。よって、本実施形態では最初に指定したエリアの近傍にて最低の誤差エリアを求めるので、狙った通りのポイントが正しく測距できる。
なお、ステップS50以降の対応するLのセンサデータの読込みから補間演算、ピント合わせまでのステップS50〜S53は、図8のステップS26以降と同様である。
【0035】
(作用効果3)
このように本実施形態では、定められた領域内でエリアをシフトして、最も近似誤差の少ないエリアのデータを用いて測距を行うことにより、測定したい領域以外の箇所を計測してしまうことなく、なお且つエリア端部の近似誤差を最小限に抑えた測距の高精度化を可能としている。
【0036】
(第4実施形態)
次に、図10および図11を用いて本発明の第4実施形態を説明する。この実施形態はまず、図10(b)に示すような測距エリアの一部が人物6からはずれた状態を検出する場合に、そのはずれたセンサを除いて測距演算を行うことによって、先に説明した「遠近混在誤差」(図6参照)を対策する実施形態である。この例は、撮影する場合に応じて測距に用いるエリアを狭くできるので、より遠近混在誤差には強い。また、このような誤差が生じない場合はエリアを小さくすることはないので、遠距離であっても人の顔よりも大きな被写体などに対してはより高精度の距離測定が可能とすることができる。
【0037】
また、図10(b)のような撮影シーンでは、被写体から外れたセンサは、相関が悪くなるので、図10(a)にグラフで示すように差分|Rn −Ln+s |の結果が、被写体に当たったセンサに比べ異なった値となる。この原理を利用して図10の例でいえば中央のセンサR2 ,Ls+2 の差分Fc 以上のセンサ出力は除去して補間演算を行う。
【0038】
上述の機能をCPUにおいて実現するには、図11のフローチャートのようなアルゴリズムをプログラムとして採用すればよい。なお、このフローチャートでは説明の簡易化のためにエリアの最大幅はR0 〜R4 までの4センサとし、上記遠近混在誤差が、エリアの両端のいずれかのセンサを省略して演算するようにしている。したがって、通常は4センサ、あるいは誤差が生じそうな場合は3センサを対象とした演算処理を行う。なお、実際の設計では、ノイズ成分を相殺し、量子化誤差も軽減するために最も沢山のセンサを用いてより広いエリアで演算を行うが、この場合においても前述の要旨を拡張して応用することができる。
【0039】
ステップS1〜S3は、既に説明した図7の同番号ステップと等価な処理である。これに続くステップS60からは、対応したL側のセンサデータ読み込みを行い(S60)、先に説明したエリアの最初のセンサ0を指定する(S61)。図10に示したRとLの差分Fi を計算し(S62)、指定センサのインクリメントし(S65)、これをセンサ4になるまでの判定(S66)に従ってステップ62に戻り繰り返す。なお、センサ2は、丁度中心のセンサなのでステップS63でステップS64に分岐し、このときの差分F2 を図10のように判定用の閾値Fc とする。
【0040】
続くステップS67,S68,S69は、本発明の1つの特徴であるエリア端部の判定ステップ群であり、それぞれセンサ0〜4までと、0〜3までと、1〜4までの三通りの場合について端部の近似判定を行う(S67〜S69)。この場合、エリアは広い方が精度の点でより好ましく、まず最も広いエリアについて判定するが、本実施形態では更に図10で説明した差分Fの判定も行うために、ステップS70,S71,S72へと分岐して、Fc と差異の少ない領域を選択してさらにエリアを絞り込む。つまり、これらの判定によりRi ,Li の差分Fi が基準値Fc を大きく外れたものは除去するように制御している。
そして、このようなプロセスで選択されたエリアを用いて続くステップS73,S74,S75にてそれぞれ補間演算を行う。なお、補間演算用のFmin ,F-1,F+1を算出する演算アルゴリズムは図8等と同様に行う。
【0041】
(作用効果4)
このように本実施形態では、エリアの大きさを変更して遠近混在誤差を対策し、対象物が人物の場合はエリアを狭くして遠距離の影響をなくし、なおかつ人物以外の被写体の場合は測距エリアを広くとることができ、被写体に最適な測距センサを選択して、より高精度のピント合わせを可能としている。
【0042】
(第5実施形態)。
また同様の手法に基づき第5実施形態として、図13のようなフローチャートも例示する。
ステップS80では、図11のステップS66までの流れのように、エリア中央のセンサについて、左右L,Rの差分Fを求め、基準の差分値Fc とする。 次に、このように求めたFc から大きく外れないエリアを検出し(S81)、その両端のセンサ番号を求め、これらをi1 ,i2 とする(但しi1 <i2 )。続くステップS82は、本発明の特徴の1つであるエリア端部の近似誤差判定の処理を行うステップであり、R側のセンサについてi1 とその前のセンサの差異を基準として、前記i2 までの間のセンサの中で|Ri1−1−Ri1|とほぼ同じ出力差をもつ|Ri+1 −Ri |の値を示すものを検出して、その番号iをi3 とする(S82)。そして、上記のようにして求められたi3 とi1 の番号の間のセンサを用いて、相関演算、補間演算の像位置差の検出を行うことで、パッシブタイプの測距の原理に従う距離測定ができる。
【0043】
(作用効果5)
このように本実施形態によっても、エリアの大きさを適宜変更して遠近混在誤差に対する対策を講じ、被写体にとって最適な測距センサの部分を適宜に選択してピント合わせの高精度化を実現している。
【0044】
(第6実施形態)
本発明の手法は、例えばカメラの撮影時に生じる測距誤差以外の誤差低減にも役立つ。そこで次に第6実施形態として、カメラの組立て工程において本発明の主旨を応用した例を詳しく説明する。
前述のようにEEPROM9(図3)はカメラの部品のばらつきや、組立て精度のばらつきによって生じる誤差を補正するため、固有な補正係数を記憶する等のために設けられているが、図14(a)に示すような製造ラインの調整工程において補正値の検出が行われ、EEPROMへの記憶が行われ、この補正データを参照しながらCPUが所定の制御を行う。詳しくは、この調整工程の作業者21によって、ベルトコンベア22で搬送されて来る製造途中のカメラ測距機能を調整されるカメラ23が順次、固定台24に保持され、パソコン20と通信可能に接続され、所定のチャート25,26を測距することによりそのカメラの部品や組立て上の「ばらつき」によって生じている測距誤差に関し、設計値からのずれが検出される。パソコン20はこの測距誤差のずれを補正するための補正データを逐次算出し、当該カメラ内蔵のメモリ(EEPROM9)にこの補正データを書き込む。
【0045】
なお、通常の組立工程では例えば受光レンズのわずかな取り付け誤差等が生じ、これに起因して、図15(a)に示す像位置差(S+x)とピント合わせレンズの繰出し量の関係を表すグラフ中の直線は、所定の傾きの設計値の破線との間にHの傾き誤差を発生することが多い。そこで、本発明を適用した製造工程において、二点の測距結果よりこの傾き誤差を検出してこの値を当該カメラのメモリ中に記憶させて出荷する。このカメラは、この記憶された固有な誤差の値を用いて撮影時に本来の設計値通りの許容範囲内の精度で正しく補正を行うことができる。
【0046】
なお、使用する2つのチャートの一方は、距離L1 に、もう一方は距離L2 に置かれており、L1 の方のチャートはパソコンの制御によって上下に可能となっており、これが測距エリアから対比するとL2 の距離のチャートが測距可能となる。各チャート上には図に示したように白黒のパターンがあって、この明暗の分布にて像位置検出を行って測距を行う。
【0047】
この明暗分布により得られるセンサデータは図14(b)の波形になるが、得られたデータのどの領域を使って補間処理を行うかによって測距データが異なってしまう。同じ測距エリアを用いたとしても、図14(b)の幅E1を選んだ場合は、前述の端部の近似が成立し難く、一方、図14(c)の幅E2を選んだ場合は、前述の端部の近似が成立し易い。つまり、E1よりもE2のほうを用いるほうが正しく測距が可能といえるが、調整時に正しい測距データが得られなければ正しい補正係数の算出もできず、正しくない補正係数を用いて測距するカメラだと正確なピント合わせができなくなる。そこで本実施形態はこのように調整工程上で生じる誤差に対策するため、図15(b)に示すようなフローチャートに従って、パソコン20がカメラ23の測距装置の調整を次の手順で行う。
【0048】
まず、L1 の距離のチャートを測距視野内に入れて(S201)、測距ユニットからのデータを読み込む(S202)。
ステップS203において、本発明のエリア端部の近似誤差を図示の式に基づく条件判定を行い(S203)、もし条件を満たしていればステップS205に分岐する。一方、上記式を満たしていなければ、エリアを変更し(S204)、上記ステップS203に戻って同様な条件判定を繰り返しながらこの条件を満たすエリアを捜し出す。
これによって、図14(b)のようなエリアでの誤差は改善されて図14(c)のようなエリアにシフトされ、誤差の少ない像の位置差計算がステップS205にて行われる。
【0049】
続いて、L1 のチャートを測距視野からのチャートを測距できるようにL2 チャートをセットし(S206)、ステップS207〜S210までで、上述したステップS202〜S205で行ったと同様なプロセスにより適切なエリアを選択し、誤差の少ない像位置差計算を行う。こうして得られたL1 とL2 の像位置差の差に基づいて当該測距装置の完成度を検査し、この結果と設計値とを比較して前述のグラフ直線の傾き誤差に代表される補正係数Hを算出し(S211)、この値をカメラのEEPROMに記憶させ(S212)、この調整工程を終了する。
【0050】
(作用効果6)
本実施形態によれば、調整時に生じるチャートとカメラの微妙な位置関係の誤差によって図13(b),(c)のように測距エリアが変化して測距誤差が変動したりすることはなく、常に正しい補正係数の算出が可能となり、正確な調整が行える。このように調整されたカメラは、カメラ内蔵のCPUのROM容量やタイムラグの関係で測距シーケンス中にエリア端部の近似補正のアルゴリズムを有さななくても正確なピント合わせが可能となる。
(変形例)
以上に例示した実施形態ではすべてセンサピッチ単位の相関量Sを求める手段として、本発明の測距装置(図3)を構成するユニット100に内蔵の相関手段5は、高速なハードロジック回路で構成されていることを示したが、この構成には限らずCPU10に等価なこの機能を担当させて、図12に示すフローチャートのような演算制御手順をソフトウエアによって実現し、シフト量Sを算出してもよい。ここでの処理手順は相関量Sを求めるためのプロセスであり、前述の図2で説明したFFの最小値を" FF1" とし、グラフの横軸であるシフト量を" SFT" として表わし、またnはセンサ番号を表す整数であるとして説明する。
【0051】
まずFF1を100に初期設定し(S251)、SFT,n,FFを0に初期設定する(S252)。続くステップS253〜S256までは、差分の算出処理ループである。すなわち、差分FF1をとり(S253)、このとった差分をFFに加算する(S254)。センサ番号nを1つインクリメントした後(S255)、所定の限度数nc (即ち対象エリア数)との比較によりこの処理ループの繰り返しを判定する(S256)。
【0052】
上記処理ループにより差分の各センサごとの和がFFとして求まると、次にFFとFF1との大小比較を行い(S257)、FF1の方が大きい場合はFFをFF1に代入する(S258)と共に、SFTをSに代入する(S259)。 SFTを1つインクリメントした後(S60)、所定の限度値Smax になるまではステップS53に戻って上述のステップを繰り返す。Smax になれば図7中のステップS3に移行する。
【0053】
(作用効果7)
このように、相関量を求める手段は上記ステップS251〜S261のプログラムでソフトウエア的にも可能で、これから明らかなように相関の加算をとる為の対象エリア数nc が小さければ、上記処理ループの繰返し回数も減少して高速化できる。またピッチ単位の相関演算は多少荒くても正確なS値が求められるので、エリア切替えの無い演算処理より更に高速処理が可能となる。
【0054】
(その他の変形例)
なお、本発明の実施形態にはこの他にも、本発明の要旨を逸脱しない範囲で種々の変形が可能である。
【0055】
以上、本明細書中には次の発明が含まれる。
[1] 視差を有する一対の受光素子列により被写体像を受光して、一対の被写体像信号を出力する受光手段と、
前記一対の被写体像信号につきそれぞれ所定サイズに分割されたブロックの中から1つずつのブロックを順次選択するブロック選択手段と、
前記選択したブロック内の両端のセンサ信号レベルと、隣接するそれぞれに隣接するセンサ信号レベルとの差を求め、この差の計算結果に従って当該選択されたブロックに関する所定の演算手順を変更する変更手段と、
を具備することを特徴とする測距装置。
[2] 前記演算手順の変更は、ブロックのサイズ、又はブロックの位置を変更することにより行うことを特徴とする[1]に記載の測距装置。
[3] 視差を有する異なる視野から観測した被写体像の輝度分布に従った2つの光パターン信号を出力する2つのラインセンサと、前記ラインセンサの出力からブロックを選択する選択手段と、前記比較されたブロックの信号同士を比較して、視差に基づく前記被写体像の相対位置差を算出する手段と、調整用データを記憶する記憶手段とを有する測距装置を調整するために用いる調整器であって、
前記調整器が、前記選択手段によって選択されたブロックの両端に位置するセンサと、これに隣接するセンサとの信号差を計算し、この計算結果に応じて選択されたブロックを変更することを特徴とする調整器を有する測距装置。
【0056】
また、そのほかに次のような発明も含まれる。
(1) 視差を有する異なる視野から観測した被写体像に対応する2つの光パターン信号を出力する2つのラインセンサと、上記ラインセンサの出力からブロックを選択する選択手段と、上記比較されたブロックの信号同士を比較して、視差に基づく上記被写体像の相対位置差を算出する手段とを有する測距装置において、
上記選択手段は、選択されたブロックの両端に位置するセンサと、それに隣接するセンサとの信号レベル差を求め、その結果に応じて上記選択されたブロックを変更することを特徴とする測距装置。
(2) 上記選択手段は、上記選択されたブロックの最初のセンサとその前のブロックの最後のセンサとの出力差の絶対値と、選択されたブロックの最後のセンサとその次のブロックの最初のセンサの出力差の絶対値とを比較することを特徴とする(1)に記載の測距装置。
(3) 上記選択手段は、上記選択されたブロックに隣接する複数のブロックについて上記比較を行い、その結果に応じて上記算出手段が上記相対位置差算出を行うことを特徴とする(2)に記載の測距装置。
(4) 上記選択手段は、上記選択されたブロックについて上記比較を行い、その比較結果が所定の関係を満たさない場合、このブロックを分割した第2のブロックについて再度上記比較を行い、その結果に応じて上記算出手段は上記相対位置差算出を行うことを特徴とする(2)に記載の測距装置。
(5) 視差を有する一対の受光素子列により観測した被写体像に対応する一対の被写体像信号を出力し、
前記被写体像信号を所定サイズのブロックに分割して1つずつ順次選択し、
前記選択したブロック内の両端のセンサ像信号レベルと、これらに隣接するそれぞれの隣接位置の信号レベルとの差を求め、この結果に応じて前記選択したブロックに関する所定の演算手順を変更し、次のブロックを選択することにより、視差に基づく前記被写体像の相対位置差を算出することを特徴とする測距装置。
【0057】
さらに、本明細書にはほかにも次の発明が含まれている。
(1' ) 視差を有する異なる視野から観測した被写体像の輝度分布に従った2つの光パターン信号を出力する2つのラインセンサと、
上記ラインセンサの出力の1エリア部分を選択する選択手段と、
上記比較された部分からの2つの光パターン信号を比較して上記被写体像の視差に基づく相対位置差を、算出する算出手段と、
を有する測距装置において、
上記選択手段が、選択されたエリア部分の両端に位置するセンサと、その隣接するセンサとの差を計算、比較し、上記選択された部分を変更する機能を有することを特徴とする。
(2' ) (1' )において、上記選択手段は、上記選択されたエリア部分の最初のセンサとその前のセンサの出力差の絶対値と、最後のセンサとその次のセンサの出力差の絶対値を比較する機能を有する。
(3' ) (2' )において、上記選択手段は、上記選択されたエリア部分に隣接する複数のエリア部分について上記比較を行い、その結果に従って上記算出手段は上記相対位置差算出を行うことを特徴とする。
(4' ) (2' )において、上記選択手段は、上記選択されたエリア部分について上記比較を行い、これが所定の関係を満たさない場合、このエリア部分を分割した第2のエリア部分について上記比較を行い、その結果に従って上記算出手段は上記相対位置差算出を行うことを特徴とする。
(5' ) 視差を有する異なる視野から観測した被写体像の輝度分布に従った2つの光パターン信号を出力する2つのラインセンサと、
上記ラインセンサの出力の1エリア部分を選択する選択手段と、
上記比較された部分からの2つの光パターン信号を比較して上記被写体像の視差に基づく相対位置差を、算出する算出手段と、
調整用データを記憶する記憶手段と、
を有する測距装置を調整するための調整機において、
上記調整機が、上記選択手段によって選択されたエリア部分の両端に位置するセンサと、その隣接するセンサとの差を計算、比較し、上記選択された部分を変更するように、上記選択手段を制御する切換え機能を有することを特徴とする。
【0058】
【発明の効果】
以上説明したように本発明の技術によれば、パッシブタイプの測距装置の測距範囲を被写体に対して適切に切り替えて、補間演算の近似誤差を最小限におさえ、より正確な距離測定を可能としている。従ってこの技術の応用によって、正確なピント合わせが可能なカメラおよびビデオカメラ等を提供することができる。
【図面の簡単な説明】
【図1】 図1は、本発明の実施形態に係わる測距装置の基本構造を示す構成図。
【図2】 図2(a)〜(d)は本発明に係わる測距の演算原理を示し、
(a)は、焦点とずらし量との関係を示すグラフ、
(b)は、右側センサRのセンサ部分ごとの信号出力を示すグラフ、
(c)は、左側センサLのセンサ部分ごとの信号出力を示すグラフ、
(d)は、左右のセンサ出力と隣接するセンサ部分の出力の関係を示すグラフ。
【図3】 図3は、本発明の測距装置の構成を詳しく示すブロック構成図。
【図4】 図4は、本発明の実施形態に係わる演算処理の概要処理フローチャート。
【図5】 図5(a)〜(d)はセンサ出力と被写体の幅との関係を示し、(a)は、左右のセンサアレイの出力を示す2つのグラフ、
(b)は、カメラと被写体および背景の位置関係を示す概念図、
(c)は、エリアEで測距したときの出力波形、
(d)は、エリア変更後の出力波形。
【図6】 図6は、ラインセンサと被写体との位置関係を示す概念図。
【図7】 図7は、本測距装置の第1実施形態の演算処理手順を示すフローチャート。
【図8】 図8は、本測距装置の第2実施形態の演算処理手順を示すフローチャート。
【図9】 図9は、本測距装置の第3実施形態の演算処理手順を示すフローチャート。
【図10】 図10(a),(b)はセンサ出力と、被写体とセンサの位置関係を示し、
(a)は、左右のセンサ信号を示すグラフ、
(b)は、撮影シーンにおける被写体と右センサエリアの対応位置を示す図。
【図11】 図11は、本測距装置の第4実施形態の演算処理手順を示すフローチャート。
【図12】 図12は、本測距装置の相関手段に相当する制御手順を示すフローチャート。
【図13】 図13は、本測距装置の第5実施形態の演算処理手順を示すフローチャート。
【図14】 図14(a)〜(c)は本測距装置の第6実施形態を適用する応用例を示し、
(a)は、カメラの製造・検査ラインを示す説明図、
(b)は、幅E1のときのセンサデータ出力の波形図、
(c)は、幅E2のときのセンサデータ出力の波形図。
【図15】 図15は本測距装置の第6実施形態を示し、
(a)は、ピント調整の為の繰出し量の設計値との関係を示すグラフ、
(b)は、第6実施形態としての演算処理手順を示すフローチャート。
【図16】 図16は、右センサRを基準としずれ量xの光がLセンサに入射する場合の各Lセンサ部分の出力を表す[式1]を示す図。
【図17】 図17は、左右のセンサにおける差分による[式2]を示す図。
【図18】 図18は、[式2]をさらに展開して表した[式3]を示す図。
【図19】 図19は、補間演算で求まるFの最小値とシフト量の関係を表す[式4]を示す図。
【符号の説明】
1a,1b…レンズ(センサ用)、
2a,2b…ラインセンサ、
3a,3b…信号出力波形、
4…A/D変換部、
5…演算部(相関手段)、
6…被写体、
7…出力部、
8…シャッタ、
9…EEPROM、
10…制御手段(CPU)、
12…繰り出し手段、
13…ズームレンズ、
14…演算用レジスタ、
15…RAM、
16…ROM、
17…演算手段、
18…レジスタ(汎用)、
19…ポート。
S1〜S13…本発明の第1実施形態としての処理ステップ、
S20〜S36…本発明の第2実施形態としての処理ステップ、
S40〜S53…本発明の第3実施形態としての処理ステップ、
S60〜S75…本発明の第4実施形態としての処理ステップ、
S80〜S83…本発明の第5実施形態としての処理ステップ、
S101〜S104…本発明の実施形態の概略的な処理ステップ、
S201〜S212…本発明の第6実施形態としての処理ステップ、
S251〜S261…本発明の1つの変形例としての処理ステップ。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a distance measuring device used for a camera, a video, and the like, and more particularly to a technique for providing a device capable of more accurate distance measurement and focusing.
[0002]
[Prior art]
Usually, distance measuring devices used in cameras, etc., often use light, and the “active type” method that projects signal light from the device side and the “passive type” method that uses the luminance distribution image of the object. ”. Both of these are based on the basic principle of triangulation. In the active type, the distance between the light projecting and receiving positions is the basic length (base line length), and in the passive type, the image of the target object is based on the two light receiving positions. The distance to the object is obtained according to the relative position difference. In order to observe the image of the object, it is necessary to measure the amount of light at each light receiving position. Therefore, a line sensor in which a plurality of optical sensors are arranged is used.
[0003]
First, the distance measuring method of this passive type distance measuring device will be described with reference to FIG. Two light receiving lenses 1a and 1b are spaced apart by a base line length B, and light incident from the subject 6 through these lenses has a light pattern such as a curved pattern 3a and 3b on the line sensors 2a and 2b, respectively. However, these patterns depend on the luminance distribution on the subject 6 and the relative positional relationship between the two light receiving lenses, and the relative positional difference x between the two patterns 3a and 3b is the distance between the base line length B and the distance between the lens and the sensor. Depends on f and subject distance L. That is, the following relationship is established.
x = B × f / L (formula a)
A method of calculating the relative position difference by calculation from the output of such a line sensor (hereinafter referred to as correlation calculation) is disclosed in Japanese Patent Publication No. 7-54371.
[0004]
Further, it is an important technique to use which portion of the light pattern to measure the distance. For example, as shown in FIG. 5, even if the person 6a is to be measured, it enters the Rn2 portion of the sensor array 2a. If the added light is taken into account, the luminance of the background mountain 6b is mixed (hereinafter referred to as “mixed perspective”), and correct distance measurement cannot be performed. That is, only the light incident on the sensors R1 to Rn1 in the figure is used, but the sensor signal of Rn2 is not used. For example, the technique disclosed in Japanese Patent Publication No. 5-88445 is necessary for accurate distance measurement. It becomes.
[0005]
Further, according to the focus detection apparatus disclosed in Japanese Patent Laid-Open No. 2-135311, the data change of each data of the line sensor is examined, and a signal corresponding to a place with a small change rate is used for distance measurement. ing.
Furthermore, a technique for switching a distance measurement frame according to the focal length of a camera photographing lens has been widely known for a long time. For example, a distance measurement range display of a camera performing automatic focus adjustment disclosed in Japanese Patent Laid-Open No. 53-99935 is disclosed. There is also a technique for preventing the above-described error from occurring by setting a fixed distance measuring area in the screen of the shooting scene.
[0006]
[Problems to be solved by the invention]
However, first, the technique disclosed in Japanese Patent Publication No. 7-54371 does not touch on the above-mentioned problem of “mixing of perspective”. In the other technique disclosed in Japanese Patent Publication No. 5-88445, this result is obtained after the correlation calculation. If the sensor area is inappropriate, the sensor area is switched, and because of the determination and switching control, it takes a lot of time and the data is processed and processed many times. However, there are problems such as an increase in memory capacity and program capacity. That is, even if these conventional techniques are simply combined, it is difficult to provide a high-speed and high-precision distance measuring device.
[0007]
In addition, in the operation of the conventional apparatus, an error is also caused by the distribution of light and darkness of the subject to be measured, and if this error is not taken into account, not only does the subject have a distance measurement error even at the same distance, Alternatively, a distance measurement error may occur depending on the portion of the subject. Also, in general, it is not always possible to output the distance measurement results as designed due to the "variation" in the components used in the distance measurement device and their assembly. Therefore, an adjustment process is required to deal with this problem during manufacturing. It is. However, even in this adjustment process, an accurate and stable output may not be obtained due to a slight shift in the positional relationship between the adjustment chart and the distance measuring device. This is because correct adjustment is difficult unless the output is stabilized, and as a result, it is impossible to provide an accurate distance measuring device. However, this problem has not been taken into consideration in the above-described prior art.
[0008]
Accordingly, the present invention has been made in view of the above-described problems, and provides a distance measuring device that can always perform a correct distance measurement for any object. To that end, a passive distance measuring device is provided. It is an object of the present invention to provide a distance measuring apparatus that takes measures to remove the dependence on a specific pattern (for example, a chart) possessed by the target object (that is, a specific “characteristic” based on a subject). In addition, the present invention proposes a distance measuring device that is resistant to the above-mentioned errors of mixing near and far, and provides a distance measuring device that can accurately focus on an object when applied for focusing on a camera or video. It is an object.
[0009]
[Means for Solving the Problems]
  To achieve the above object, the first invention is a distance measuring device, wherein a light receiving means for receiving a subject image by a pair of light receiving element arrays having parallax and outputting a pair of subject image signals; Selection means for selecting one of a plurality of areas divided into a predetermined size for each of the pair of subject image signals, sensor signal levels of light receiving elements at both ends in the selected area, and light receiving elements at both ends A change means for obtaining a difference from the sensor signal level of each adjacent light receiving element, and changing the size or position of the selected area so that a calculation result of the difference satisfies a predetermined condition; and Correlation means for performing correlation calculation and interpolation calculation using the sensor signal of the changed area.
[0010]
DETAILED DESCRIPTION OF THE INVENTION
  A plurality of embodiments according to the present invention will be described below with reference to the drawings.
  First, as a premise,FIG.Next, a method for calculating the relative position difference of the light pattern in the above-described passive type distance measuring device will be described.
  Figure1The relative position difference x of the light distribution incident on the sensor arrays 2a and 2b changes depending on the subject distance L due to the difference B (base line length) between the positions of the two light receiving lenses 1a and 1b. If the focal length of each light receiving lens is f, the subject distance L is obtained by the following equation.
          L = B × f / x (Formula b)
  Since each sensor of the sensor array outputs a current signal according to the amount of incident light, if these are converted into digital signals by the A / D converter 4, the relative calculation is performed by the correlation calculation by the calculation means 5 for calculating the image shift amount. The position difference x can be detected. The subject distance L is obtained by inputting this result into a calculation control means (CPU) 10 comprising a one-chip microcomputer or the like and calculating based on the above equation b. The above is the basic principle and general apparatus configuration of the passive type triangulation system.
[0011]
The above deviation amount calculation function is generally composed of two processes as will be described later, but these may be built in the CUP 10 as a control program. When the camera is focused using such a technique, the CPU 10 controls the operation of the camera, and an automatic focus (AF) function can be achieved by appropriately controlling the photographing focus lens and the like via an actuator such as a motor. Can be provided with a camera.
[0012]
In order to calculate the image shift amount, a calculation step (that is, correlation calculation) for checking how much the image is shifted in units of sensor pitch in both line sensors is required. Then, a calculation step (hereinafter referred to as interpolation calculation) for calculating the shift amount more accurately with a finer resolution is required.
[0013]
  Figure on sensor array 2a1When the light is incident in a pattern like the waveform 3a shown in FIG. 2, the output magnitudes of the sensors R1 to R6 have a distribution 3a as shown by a bar graph in FIG. Here, “R” indicates a right sensor, “L” indicates a left sensor, and subscripts 1 to 6 attached thereto are, for example, optical axis reference of the light receiving lens. Suppose that the absolute position of the sensor position at is indicated. The same signals as the outputs R1 to R6 are output from the outputs L1 to L6 of the left sensor.OutputIn this case, since the relative position difference x is 0, the subject distance L to be obtained is “infinity”.
[0014]
If the subject is present at a "finite distance", the left sensor L shifted by the number S of sensors determined from the x and the sensor pitch SP has the outputs R1 to R6 as shown in FIG. A similar value of the output signal is obtained.
The value FF (i) on the vertical axis in the graph of FIG.
[0015]
FF (i) = Σ | R (i) −L (i) | (Formula c)
In other words, the result FF obtained by subtracting the output of the corresponding L sensor from the output of a certain R sensor and adding the absolute value for each sensor may be used. That is, first, Li is subtracted from Ri to take its absolute value, and i is changed by a predetermined width and added.
Next, if one of Ri or Li is shifted by one unit and the difference is taken in the same manner as the adjacent sensor which has previously taken the difference, FF (i + 1) can be expressed by the following equation.
[0016]
FF (i + 1) = Σ | R (i + 1) −L (i) |
In this way, the FF can be obtained while sequentially changing the shift amount (hereinafter referred to as the SIFT amount), but the SIFT amount where the FF, which is the sum of the differences between R and L, becomes the minimum value (Fmin) is the most. Since it is considered that the position is well matched, the SIFT amount in this case is obtained as S. The above is the outline procedure of the process related to the correlation calculation.
[0017]
Further, when the output distribution of both sensor arrays is illustrated with the above S taken into account, as shown in FIG. 2 (b), it is the same as the R side sensors with corresponding subscripts from the sensors shifted by S on the L side. Is obtained.
[0018]
Next, the “interpolation calculation” process will be described in detail with reference to FIGS. The actual image shift amounts on the two sensor arrays are not exactly shifted by the sensor pitch, and for accurate distance measurement, the image shift amount must be detected with a finer accuracy than the pitch. Therefore, an interpolation operation is performed. R and L in FIGS. 2B and 2C respectively represent a part of sensor outputs constituting the sensor arrays 2a and 2b in FIG.
FIG. 2 (d) shows a graph that has been shifted to the above-described S for which the “correlation calculation” has already been completed, and has been made easier to compare. That is, L0 to L4 should be accurately described as Ls to Ls + 4, but this S is omitted so as not to become complicated in description.
Here, it is assumed that light shifted by x with respect to the R reference is incident on the L sensor after shifting by S. At this time, for example, the light incident on R0 and R1 is mixedly incident on the L1 sensor, and similarly, the light shifted by x on the R reference is sequentially incident on each L sensor. It can be seen that the outputs (L1 to L3) are expressed as shown in [Equation 1] in FIG.
[0019]
FF values F-1 and F + 1 obtained by shifting the shift amount from Fmin and Fmin in the plus and minus directions are expressed by using the outputs of the respective Rn and Ln. It is expressed as follows. Further, when [Expression 2] is expanded using [Expression 1], values Fmin, F-1, and F + 1 are expressed as [Expression 3] in FIG.
In addition, if {| R0−R1 | + | R1−R2 | + | R2−R3 |} in [Equation 3] is expressed as (ΣΔR), the previous deviation amount x does not depend on (ΣΔR). Is obtained by the calculation shown in [Equation 4] in FIG. The above is the “interpolation calculation”.
[0020]
These calculations are performed by the calculation unit 5 in FIG. 1, but may be performed by a calculation control means (CPU) 10 such as a one-chip microcomputer according to a predetermined program.
[0021]
FIG. 3 is a conceptual diagram of the configuration of a camera according to the main embodiment of the present invention. This camera is equipped with a distance measuring unit 100 having a basic configuration including the lenses 1a and 1b and the sensor arrays 2a and 2b described above as a distance measuring device. The unit built-in correlation means 5 is constituted by a high-speed hard logic circuit (not shown).
The A / D conversion circuit 4 is a circuit that converts the analog output of the sensor array into digital data. Here, the A / D conversion circuit 4 also has a function of storing the converted data. The output circuit 7 outputs this stored data to the CPU 10 by serial communication. As shown in the figure, the CPU 10 includes a port 19 composed of each port element for serial communication and a terminal for controlling each function of the camera, an arithmetic register 14 for controlling the port, a general-purpose register 18, and an arithmetic unit. 17, a RAM 15 for temporary storage of data, and a ROM 16 storing a program for controlling these with a predetermined algorithm.
[0022]
Through the port 19 from the CPU 10, the focusing lens 13 is fed out by the feeding means 12 that performs feeding control by predetermined control, and the shutter 8 and the like are driven and controlled.
Also, a ROM (EEPROM) 9 is provided via the port 19, and this EEPROM 9 corrects errors caused by variations in camera parts and assembly accuracy, as in an embodiment described later. This is an electrically writable ROM that is used to store a unique correction coefficient. The correction value is detected and written to the EEPROM in the manufacturing line adjustment step (FIG. 14).
As described above, the CPU 10 performs overall control of the camera including distance measurement control at the time of photographing while referring to the correction data.
[0023]
(First embodiment)
First, FIG. 4 is a flowchart showing a schematic processing procedure such as arithmetic processing according to the embodiment of the present invention. In the distance measuring apparatus of the present invention, processing is executed in the following procedure. That is, first, data based on incident light of the sensor array, correlation values in sensor pitch units, and the like are read (S101). Subsequently, data for distance measurement in a predetermined area is read from the left and right sensors by one characteristic method described later. Schematically, the left and right data are not read indefinitely from a certain area and are interpolated. For example, the data of the right sensor at the end of the area | R1 −R0 | and | Rn + 1−Rn | (ie, | R4−R3 |) is compared (S102), and the area is changed by shifting the difference to an area satisfying a predetermined condition (S103), while the other left side The sensor data output is also obtained, and then correlation calculation and interpolation calculation are performed (S104). From this result, the correct distance to the subject can be obtained and used for focusing.
[0024]
In the flowchart of FIG. 7, the processing operation of the camera distance measuring apparatus having the above-described configuration is illustrated in detail as the first embodiment of the present invention.
First, a correlation area is specified. For example, here, A / D conversion is performed on the data based on the light pattern incident on the sensor array by designating correlation areas as shown as R1 to R3 (see FIG. 1D) (see FIG. 1D). S1).
[0025]
The correlation unit 5 reads the calculated correlation result S in sensor pitch units (S2), and reads data for distance measurement in a predetermined area from the R side sensor (S3). As described above, as a technique that is one of the features of the present invention, sensor data | R1 -R0 | (in FIG. |) And | Rn + 1-Rn | (in FIG. 7, | R4 + n-R3 + n |) are compared (S4 to S7). , S13, the calculation is performed after the shift, and with this processing method, F + 1 shown in [Expression 3] in FIG. If it is determined in step S6 that the data difference on the end side of the area is large, the shift is made to the smaller number in the area with the smaller data difference (S12).
[0026]
If it is determined in step S7 that the data difference on the first side of the area is large, the shift is made to the larger number in the area with the smaller data difference (S13). By returning to step S3 by these shifts and repeating the same processing, the operation and effect described with reference to FIG. 5C can be obtained.
Subsequently, as described above, the output of the L-side sensor for the selected region is also obtained (S8), calculation based on [Equation 2] in FIG. 17 is performed (S9), and based on [Equation 4] in FIG. Interpolation is performed (S10), x is obtained, the distance L is obtained using this result and S, and focusing is performed (S11).
Note that the distance measurement control according to this flowchart is performed instantaneously prior to the shutter operation of the camera.
[0027]
(Operation effect 1)
As described above, according to the distance measuring apparatus of the present embodiment, the calculation method based on the expression shown in [Expression 3] is used to minimize the approximation error and calculate from the result value without erroneous distance measurement. Accurate focusing can be performed based on the obtained value. Further, since the shift amount S is obtained by using the correlation calculation means configured by the hard logic circuit in the distance measuring unit, the calculation speed can be increased.
[0028]
(Function 1)
In addition, the error of “mixing of perspective”, which has been a problem in the prior art, determines the above-mentioned | R1 −R0 | and | Rn + 1 −Rn | (in FIG. 1, | R4 −R3 |), which is also a feature of the present invention However, it can also be mitigated by a technique for reselecting the area where the approximation described above is established. For example, in a scene as shown in FIG. 5B, when the distance measuring unit 100 measures the person 6a, if the bright tree 6b enters the sensor array, the two graphs in FIG. The data as shown in Fig. 5 is obtained from the two left and right sensor arrays (right (R), left (L)). Here, the horizontal axis indicates the position n of each sensor constituting the sensor array, the vertical axis indicates the output values Ln and Rn of each sensor, and the width K corresponds to the face width of the person 6a. In such a scene, a sensor output in which the face and the background are mixed may be generated. However, for example, when ranging is performed in the area E as shown in FIG. 5C, such a mixed output is added to the calculation. Can result in false ranging.
However, if the method of the present invention is used, the difference between the outputs of the first sensor 1 and the preceding sensor 0 and the output difference of the last sensor E and the adjacent sensor E + 1 are compared. Even in the case of E, as shown in FIG. 5D in “area change”, the difference between the outputs of the first sensor 1 and the previous sensor 0, the last sensor E in the area, and the adjacent sensor E + 1 It is understood that correct distance measurement is possible because an area where the output difference is small is selected and interpolation calculation is performed at a place where it is difficult to mix the perspective.
[0029]
(Second Embodiment)
In the first embodiment described above, the high-speed calculation can be realized by using the correlation calculation means or the like. However, in the subsequent processing, the above-mentioned “area change” is performed by performing the approximate determination of the data difference at the end of the area. In the meantime, the distance measurement point of the subject image may change, and the already obtained shift amount S may change.
Therefore, in the second embodiment shown in the flowchart of FIG. 8, in order to deal with the above-described problems, an approximate determination of the data difference at the end of the area is performed before the correlation calculation, and the area used during the correlation calculation and the interpolation calculation. The “change” is eliminated. Here, the correlation calculation is also executed by the CPU according to the algorithm shown in FIG. 11, and is provided as a subroutine “correlation calculation” in step S27 in FIG. For simplicity of explanation, the correlation is assumed to be performed in an area in which three sensors are combined in accordance with FIG. 1 and [Equation 3].
[0030]
First, it is a step for selecting which part of the sensor array (line sensor) is used for distance measurement. Here, three steps from the n0th sensor are used. Since n0 and n4 at both ends are used, n0 is input as a reading start point (S20).
Then, the R side data is read (S21), and in subsequent steps S22 to S25, and steps S35 and S36, as in the case of FIG. Area shift is performed, and in accordance with the result, in the subsequent steps S21 to S26, substantial data reading of the selected areas of the left and right R and L sensor arrays is performed.
Thereafter, the above-described correlation calculation is performed (S27). Subsequently, Fmin, F-1, and F + 1 are calculated in the same manner as in step S9 of FIG. 7 (S28 to S30), interpolation calculation is performed, and x is calculated. The distance L is calculated (S31), and the distance L is calculated based on the values S and x thus obtained (S32). Optimum focusing is performed according to the distance measurement value (S33).
[0031]
(Operation effect 2)
As described above, in the present embodiment, determination is performed not only at the time of interpolation processing but also at the time of correlation processing to reduce the approximation error at the end of the area, and the area considering the result is used. No correlation error occurs when switching between. Therefore, according to the present embodiment, it is possible to provide an AF camera capable of accurate focusing without an approximation error during interpolation.
[0032]
(Third embodiment)
Although the above embodiment is relatively simple, there is one problem. That is, in the above-described embodiment, the sensor area is changed and moved to the place where the approximation is established, and therefore, there is a concern that a side area that the area to be measured cannot be measured can be measured. FIG. 9 illustrates a flowchart of the third embodiment as an example of countermeasures against this problem. Only the minimum necessary area can be measured, and distance measurement with little error is intended.
[0033]
For example, in the present embodiment, a distance measurement method using only data of an area with the smallest approximate error is performed by appropriately shifting the area within a predetermined area during distance measurement according to the flowchart of FIG. 9 described in detail below. ing. That is,
First, similarly to step S20 in FIG. 8 described above, the sensor number n0 immediately preceding the head of the area is designated as n, and the constant Rc4 for approximation error comparison is set to 100 (S40). The R-side sensor data thus selected is read and input to the CPU (S41), and in the next steps S42, S43, and S44, the difference Rc3 of the data difference at both ends of the area is calculated (S41 to S44).
[0034]
Rc3 thus obtained is compared with a comparison constant Rc4 (S45). If Rc3 is smaller, n in this case is set to n1 (S46), and Rc3 at this time is set as a new comparison constant Rc4 ( S47) After n is incremented (S48), it is determined that n does not increase by more than 5 sensor units from n0 (S49). If it is within this range, the process returns to step S41 again to loop and end error Rc3. Find n that minimizes. After this loop, n is obtained as n1 when n is between n0 and n0 + 5 and the error is minimum. Therefore, in this embodiment, since the lowest error area is obtained in the vicinity of the area designated first, the target point can be correctly measured.
Note that steps S50 to S53 from the reading of the corresponding L sensor data after step S50 to the interpolation calculation and focusing are the same as those after step S26 in FIG.
[0035]
(Operation effect 3)
As described above, in the present embodiment, by shifting the area within the determined area and performing distance measurement using the data of the area with the smallest approximate error, a part other than the area to be measured is measured. In addition, it is possible to improve the accuracy of distance measurement while minimizing the approximation error at the end of the area.
[0036]
(Fourth embodiment)
Next, a fourth embodiment of the present invention will be described with reference to FIGS. 10 and 11. In this embodiment, first, when a state in which a part of the distance measurement area as shown in FIG. 10B is deviated from the person 6 is detected, the distance calculation is performed by removing the deviated sensor. This is an embodiment that takes measures against the “perspective mixed error” (see FIG. 6) described in the above. In this example, since the area used for distance measurement can be narrowed according to the case of shooting, it is more resistant to mixed perspective errors. In addition, if such an error does not occur, the area is not reduced, so that it is possible to measure a distance with higher accuracy for a subject larger than a human face even at a long distance. it can.
[0037]
In addition, in the shooting scene as shown in FIG. 10B, a sensor that is out of the subject has a poor correlation. Therefore, as shown in the graph of FIG. 10A, the difference | Rn−Ln + s | The value is different from that of the sensor that hits the subject. Using this principle, in the example of FIG. 10, the sensor output exceeding the difference Fc between the sensors R2 and Ls + 2 at the center is removed and interpolation calculation is performed.
[0038]
In order to realize the above functions in the CPU, an algorithm as shown in the flowchart of FIG. 11 may be adopted as a program. In this flowchart, for the sake of simplicity of explanation, the maximum width of the area is assumed to be 4 sensors from R0 to R4, and the above-mentioned mixed error is calculated by omitting any sensor at both ends of the area. . Accordingly, calculation processing is normally performed on four sensors or on three sensors when an error is likely to occur. In actual design, in order to cancel the noise component and reduce the quantization error, the calculation is performed in a wider area using the largest number of sensors. In this case, the above gist is expanded and applied. be able to.
[0039]
Steps S1 to S3 are equivalent to the steps with the same numbers in FIG. From the subsequent step S60, the corresponding L side sensor data is read (S60), and the first sensor 0 in the area described above is designated (S61). The difference Fi between R and L shown in FIG. 10 is calculated (S62), the designated sensor is incremented (S65), and this is repeated by returning to step 62 according to the determination (S66) until becoming the sensor 4. Since the sensor 2 is just the center sensor, the process branches to step S64 in step S63, and the difference F2 at this time is set as a threshold value Fc for determination as shown in FIG.
[0040]
Subsequent steps S67, S68, and S69 are a group of determination steps for the area edge that is one feature of the present invention, and there are three cases of sensors 0 to 4, 0 to 3, and 1 to 4, respectively. Approximate determination of the end is performed for (S67 to S69). In this case, a wider area is more preferable in terms of accuracy. First, the widest area is determined, but in this embodiment, in order to further determine the difference F described with reference to FIG. 10, the process proceeds to steps S70, S71, and S72. Branch to select an area with little difference from Fc and further narrow down the area. That is, the control is performed so that the difference Fi between Ri and Li greatly deviates from the reference value Fc by these determinations.
Then, using the area selected in such a process, interpolation is performed in subsequent steps S73, S74, and S75. Note that the calculation algorithm for calculating Fmin, F-1, and F + 1 for interpolation calculation is the same as in FIG.
[0041]
(Operation effect 4)
As described above, in the present embodiment, the size of the area is changed to deal with the perspective error, and when the target object is a person, the area is narrowed to eliminate the influence of the long distance, and in the case of a subject other than the person, A wide ranging area can be set, and a ranging sensor that is most suitable for the subject is selected to enable more accurate focusing.
[0042]
(Fifth embodiment).
Further, a flowchart as shown in FIG. 13 is also illustrated as a fifth embodiment based on the same technique.
In step S80, as in the flow up to step S66 in FIG. 11, the difference F between the left and right L and R is obtained for the sensor in the center of the area, and is set as the reference difference value Fc. Next, an area that does not deviate significantly from Fc thus obtained is detected (S81), sensor numbers at both ends thereof are obtained, and these are set as i1 and i2 (where i1 <i2). The subsequent step S82 is a step of performing an approximate error determination process at the end of the area which is one of the features of the present invention. Among them, the sensor indicating the value of | Ri + 1-Ri | having almost the same output difference as | Ri1-1-Ri1 | is detected, and its number i is set to i3 (S82). Then, by using the sensor between the numbers i3 and i1 obtained as described above, the image position difference between the correlation calculation and the interpolation calculation is detected, so that the distance measurement according to the principle of the passive type distance measurement can be performed. it can.
[0043]
(Operation effect 5)
As described above, according to the present embodiment, the size of the area is appropriately changed to take measures against mixed errors, and the distance measuring sensor part that is most suitable for the subject is appropriately selected to achieve high accuracy of focusing. ing.
[0044]
(Sixth embodiment)
The technique of the present invention is also useful for reducing errors other than the distance measurement error that occurs during shooting with a camera, for example. Therefore, as a sixth embodiment, an example in which the gist of the present invention is applied in a camera assembly process will be described in detail.
As described above, the EEPROM 9 (FIG. 3) is provided for storing a unique correction coefficient in order to correct errors caused by variations in camera parts and assembly accuracy. The correction value is detected and stored in the EEPROM in the manufacturing line adjustment process as shown in FIG. 6), and the CPU performs predetermined control while referring to the correction data. Specifically, a camera 23 that adjusts the camera ranging function during manufacture that is conveyed by the belt conveyor 22 by the operator 21 in this adjustment process is sequentially held by the fixed base 24 and connected to the personal computer 20 so as to be communicable. Then, by measuring the predetermined charts 25 and 26, a deviation from the design value is detected with respect to the distance measurement error caused by "variation" in the parts and assembly of the camera. The personal computer 20 sequentially calculates correction data for correcting the distance measurement error deviation, and writes the correction data in the memory (EEPROM 9) built in the camera.
[0045]
Note that, in the normal assembly process, for example, a slight attachment error of the light receiving lens occurs, and as a result, a graph showing the relationship between the image position difference (S + x) and the amount of extension of the focusing lens shown in FIG. The middle straight line often generates an H tilt error between the design value and the broken line having a predetermined tilt. Therefore, in the manufacturing process to which the present invention is applied, this inclination error is detected from the distance measurement results at two points, and this value is stored in the memory of the camera before shipment. This camera can correct correctly with the accuracy within the allowable range as originally designed by using the stored inherent error value.
[0046]
One of the two charts to be used is placed at a distance L1, and the other chart is at a distance L2. The chart of L1 can be moved up and down by the control of a personal computer. Then, the distance chart of L2 can be measured. As shown in the figure, there are black and white patterns on each chart, and distance measurement is performed by detecting the image position based on this light and dark distribution.
[0047]
The sensor data obtained by this light / dark distribution has the waveform of FIG. 14B, but the distance measurement data differs depending on which region of the obtained data is used for the interpolation process. Even if the same distance measurement area is used, when the width E1 of FIG. 14B is selected, the above-mentioned approximation of the end portion is difficult to be established, whereas when the width E2 of FIG. 14C is selected. The above-described end approximation is easily established. In other words, it can be said that the distance can be correctly measured by using E2 rather than E1, but if correct distance data is not obtained at the time of adjustment, the correct correction coefficient cannot be calculated, and the distance is measured using an incorrect correction coefficient. A camera cannot focus accurately. Therefore, in the present embodiment, the personal computer 20 performs the adjustment of the distance measuring device of the camera 23 according to the following procedure in accordance with the flowchart shown in FIG.
[0048]
First, a distance chart of L1 is placed in the distance measuring field (S201), and data from the distance measuring unit is read (S202).
In step S203, a condition determination based on the equation shown in the figure is performed on the approximation error at the end of the area according to the present invention (S203). If the condition is satisfied, the process branches to step S205. On the other hand, if the above equation is not satisfied, the area is changed (S204), and the process returns to step S203 to search for an area that satisfies this condition while repeating the same condition determination.
Thereby, the error in the area as shown in FIG. 14B is improved and shifted to the area as shown in FIG. 14C, and the position difference calculation of the image with less error is performed in step S205.
[0049]
Subsequently, the L2 chart is set so that the chart of the L1 chart can be measured from the ranging field of view (S206). Select an area and perform image position difference calculation with little error. Based on the difference in image position difference between L1 and L2 obtained in this way, the completeness of the distance measuring device is inspected, and the result is compared with the design value so that the correction coefficient represented by the inclination error of the above-mentioned graph straight line. H is calculated (S211), this value is stored in the EEPROM of the camera (S212), and this adjustment process is terminated.
[0050]
(Operation effect 6)
According to the present embodiment, the distance measurement error varies as shown in FIGS. 13B and 13C due to the error in the delicate positional relationship between the chart and the camera generated during adjustment. Therefore, it is possible to always calculate a correct correction coefficient and perform accurate adjustment. The camera adjusted in this way can be accurately focused without having an algorithm for approximate correction of the edge of the area during the distance measurement sequence due to the ROM capacity of the CPU built in the camera and the time lag.
(Modification)
In the embodiments exemplified above, as a means for obtaining the correlation amount S in sensor pitch units, the correlation means 5 built in the unit 100 constituting the distance measuring apparatus (FIG. 3) of the present invention is constituted by a high-speed hard logic circuit. However, the present invention is not limited to this configuration, and the CPU 10 is in charge of this equivalent function, and the arithmetic control procedure shown in the flowchart of FIG. 12 is realized by software, and the shift amount S is calculated. May be. The processing procedure here is a process for obtaining the correlation amount S. The minimum value of the FF described in FIG. 2 is represented as “FF1”, the shift amount on the horizontal axis of the graph is represented as “SFT”, and In the following description, n is an integer representing a sensor number.
[0051]
First, FF1 is initialized to 100 (S251), and SFT, n, and FF are initialized to 0 (S252). The subsequent steps S253 to S256 are a difference calculation processing loop. That is, the difference FF1 is taken (S253), and the obtained difference is added to the FF (S254). After the sensor number n is incremented by 1 (S255), the repetition of this processing loop is determined by comparison with a predetermined limit number nc (that is, the number of target areas) (S256).
[0052]
When the sum of the differences for each sensor is obtained as FF by the above processing loop, FF is compared with FF1 (S257). If FF1 is larger, FF is substituted into FF1 (S258), SFT is substituted into S (S259). After incrementing SFT by one (S60), the process returns to step S53 and repeats the above steps until a predetermined limit value Smax is reached. When Smax is reached, the process proceeds to step S3 in FIG.
[0053]
(Operation effect 7)
As described above, the means for obtaining the correlation amount can also be realized in software by the program in steps S251 to S261. As is clear from this, if the target area number nc for adding the correlation is small, the processing loop The number of repetitions can be reduced to increase the speed. In addition, since the correlation unit for each pitch can be obtained with an accurate S value even if it is somewhat rough, higher-speed processing is possible than calculation processing without area switching.
[0054]
(Other variations)
In addition, various modifications can be made to the embodiments of the present invention without departing from the gist of the present invention.
[0055]
The present invention includes the following invention as described above.
[1] Light receiving means for receiving a subject image by a pair of light receiving element rows having parallax and outputting a pair of subject image signals;
Block selecting means for sequentially selecting one block out of blocks divided into a predetermined size for each of the pair of subject image signals;
Change means for obtaining a difference between sensor signal levels at both ends in the selected block and adjacent sensor signal levels adjacent to each other and changing a predetermined calculation procedure related to the selected block according to a calculation result of the difference; ,
A distance measuring device comprising:
[2] The ranging apparatus according to [1], wherein the calculation procedure is changed by changing a block size or a block position.
[3] The two line sensors that output two light pattern signals according to the luminance distribution of the subject image observed from different fields of view having parallax, and the selection means that selects a block from the outputs of the line sensors, An adjuster used for adjusting a distance measuring apparatus having means for comparing the signals of the obtained blocks and calculating a relative position difference of the subject image based on parallax and a storage means for storing adjustment data. And
The adjuster calculates a signal difference between a sensor located at both ends of the block selected by the selection unit and a sensor adjacent thereto, and changes the selected block according to the calculation result. A ranging device having an adjuster.
[0056]
In addition, the following inventions are also included.
(1) Two line sensors that output two light pattern signals corresponding to subject images observed from different fields of view having parallax, selection means for selecting a block from the output of the line sensor, and the comparison of the compared blocks A distance measuring apparatus having means for comparing signals and calculating a relative position difference of the subject image based on parallax;
The distance measuring device characterized in that the selection means obtains a signal level difference between a sensor located at both ends of the selected block and a sensor adjacent thereto, and changes the selected block according to the result. .
(2) The selection means includes the absolute value of the output difference between the first sensor of the selected block and the last sensor of the previous block, the first sensor of the selected block and the first of the next block. The distance measuring device according to (1), wherein the absolute value of the output difference of the sensors is compared.
(3) The selection unit performs the comparison for a plurality of blocks adjacent to the selected block, and the calculation unit performs the relative position difference calculation according to the result. The described distance measuring device.
(4) The selection means performs the comparison for the selected block, and if the comparison result does not satisfy a predetermined relationship, performs the comparison again for the second block obtained by dividing the block, Accordingly, the distance measuring device according to (2), wherein the calculation means calculates the relative position difference.
(5) outputting a pair of subject image signals corresponding to the subject image observed by the pair of light receiving element arrays having parallax;
The subject image signal is divided into blocks of a predetermined size and sequentially selected one by one,
The difference between the sensor image signal level at both ends in the selected block and the signal level at each adjacent position adjacent thereto is obtained, and a predetermined calculation procedure related to the selected block is changed according to the result, and A distance measuring device that calculates a relative position difference of the subject image based on parallax by selecting a block.
[0057]
Further, the present specification includes the following inventions in addition.
(1 ′) two line sensors that output two light pattern signals according to the luminance distribution of the subject image observed from different fields of view having parallax;
Selecting means for selecting one area portion of the output of the line sensor;
A calculating means for comparing two light pattern signals from the compared portion and calculating a relative position difference based on the parallax of the subject image;
Ranging device having
The selection means has a function of calculating and comparing a difference between a sensor located at both ends of the selected area portion and an adjacent sensor, and changing the selected portion.
(2 ′) In (1 ′), the selection means calculates the absolute value of the output difference between the first sensor and the previous sensor in the selected area portion, and the output difference between the last sensor and the next sensor. Has a function of comparing absolute values.
(3 ′) In (2 ′), the selection means performs the comparison for a plurality of area portions adjacent to the selected area portion, and the calculation means performs the relative position difference calculation according to the result. Features.
(4 ') In (2'), the selection means performs the comparison for the selected area portion, and if this does not satisfy a predetermined relationship, the selection means compares the second area portion obtained by dividing the area portion. According to the result, the calculation means calculates the relative position difference.
(5 ′) two line sensors that output two light pattern signals according to the luminance distribution of the subject image observed from different fields of view having parallax;
Selecting means for selecting one area portion of the output of the line sensor;
A calculating means for comparing two light pattern signals from the compared portion and calculating a relative position difference based on the parallax of the subject image;
Storage means for storing adjustment data;
In an adjusting machine for adjusting a distance measuring device having
The adjustment means calculates and compares the difference between the sensor located at both ends of the area portion selected by the selection means and the adjacent sensor, and changes the selected portion so as to change the selected portion. It has a switching function to control.
[0058]
【The invention's effect】
As described above, according to the technology of the present invention, the distance measurement range of the passive type distance measuring device is appropriately switched for the subject, and the approximation error of the interpolation calculation is minimized and more accurate distance measurement is performed. It is possible. Therefore, by applying this technique, it is possible to provide a camera and a video camera that can be accurately focused.
[Brief description of the drawings]
FIG. 1 is a configuration diagram showing a basic structure of a distance measuring apparatus according to an embodiment of the present invention.
2 (a) to 2 (d) show the calculation principle of distance measurement according to the present invention;
(A) is a graph showing the relationship between the focus and the shift amount;
(B) is a graph showing the signal output for each sensor portion of the right sensor R;
(C) is a graph showing the signal output for each sensor portion of the left sensor L,
(D) is a graph showing the relationship between the left and right sensor outputs and the outputs of adjacent sensor portions.
FIG. 3 is a block diagram showing in detail the structure of the distance measuring device of the present invention.
FIG. 4 is an outline processing flowchart of arithmetic processing according to the embodiment of the present invention.
FIGS. 5A to 5D show the relationship between the sensor output and the width of the subject, and FIG. 5A shows two graphs showing the outputs of the left and right sensor arrays;
(B) is a conceptual diagram showing the positional relationship between the camera, the subject and the background;
(C) is an output waveform when ranging in area E,
(D) is an output waveform after area change.
FIG. 6 is a conceptual diagram showing a positional relationship between a line sensor and a subject.
FIG. 7 is a flowchart showing a calculation processing procedure of the first embodiment of the distance measuring apparatus.
FIG. 8 is a flowchart showing a calculation processing procedure of the second embodiment of the distance measuring apparatus.
FIG. 9 is a flowchart showing a calculation processing procedure of the third embodiment of the distance measuring apparatus.
FIGS. 10A and 10B show the sensor output and the positional relationship between the subject and the sensor.
(A) is a graph showing left and right sensor signals;
(B) is a figure which shows the corresponding position of the to-be-photographed object and the right sensor area in the imaging | photography scene.
FIG. 11 is a flowchart illustrating a calculation processing procedure according to the fourth embodiment of the distance measuring apparatus.
FIG. 12 is a flowchart showing a control procedure corresponding to the correlation means of the distance measuring apparatus.
FIG. 13 is a flowchart showing a calculation processing procedure of the fifth embodiment of the distance measuring apparatus.
FIGS. 14A to 14C show application examples to which the sixth embodiment of the distance measuring device is applied,
(A) is explanatory drawing which shows the manufacture and inspection line of a camera,
(B) is a waveform diagram of sensor data output when the width is E1,
(C) is a waveform diagram of sensor data output when the width is E2.
FIG. 15 shows a sixth embodiment of the distance measuring device,
(A) is a graph showing the relationship with the design value of the feed amount for focus adjustment;
(B) is a flowchart showing a calculation processing procedure as the sixth embodiment.
FIG. 16 is a diagram illustrating [Equation 1] representing an output of each L sensor portion when light of a deviation amount x is incident on the L sensor with the right sensor R as a reference.
FIG. 17 is a diagram illustrating [Expression 2] based on a difference between the left and right sensors;
FIG. 18 is a diagram illustrating [Expression 3] in which [Expression 2] is further developed.
FIG. 19 is a diagram illustrating [Expression 4] representing the relationship between the minimum value of F obtained by interpolation and the shift amount.
[Explanation of symbols]
1a, 1b ... lenses (for sensors),
2a, 2b ... line sensors,
3a, 3b ... signal output waveform,
4 A / D converter,
5 ... operation part (correlation means),
6 ... Subject,
7 ... Output section,
8 ... Shutter
9… EEPROM,
10: Control means (CPU),
12 ... Feeding means,
13 ... Zoom lens,
14: Register for calculation,
15 ... RAM,
16 ... ROM,
17 ... calculation means,
18: Register (general purpose),
19 ... Port.
S1 to S13 ... processing steps as the first embodiment of the present invention,
S20 to S36 ... processing steps as the second embodiment of the present invention,
S40 to S53: processing steps as a third embodiment of the present invention,
S60 to S75: processing steps as a fourth embodiment of the present invention,
S80 to S83 ... processing steps as the fifth embodiment of the present invention,
S101 to S104 ... Schematic processing steps of the embodiment of the present invention,
S201 to S212 ... Processing steps as the sixth embodiment of the present invention,
S251 to S261: Processing steps as one modification of the present invention.

Claims (1)

視差を有する一対の受光素子列により被写体像を受光して、一対の被写体像信号を出力する受光手段と、
前記一対の被写体像信号につきそれぞれ所定サイズに分割された複数のエリアの中から1つを選択する選択手段と、
前記選択したエリア内の両端の受光素子のセンサ信号レベルと、この両端の受光素子のそれぞれに隣接する受光素子のセンサ信号レベルとの差を求め、この差の計算結果が所定条件を満たすように当該選択されたエリアのサイズ、又は位置を変更する変更手段と、
上記変更手段で変更されたエリアのセンサ信号を用いて相関演算及び補間演算を行う相関手段と、
を具備することを特徴とする測距装置。
Light receiving means for receiving a subject image by a pair of light receiving element rows having parallax and outputting a pair of subject image signals;
Selecting means for selecting one of a plurality of areas divided into a predetermined size for each of the pair of subject image signals;
The difference between the sensor signal level of the light receiving element at both ends in the selected area and the sensor signal level of the light receiving element adjacent to each of the light receiving elements at both ends is obtained, and the calculation result of this difference satisfies the predetermined condition. Changing means for changing the size or position of the selected area ;
Correlation means for performing correlation calculation and interpolation calculation using the sensor signal of the area changed by the changing means,
A distance measuring device comprising:
JP32037996A 1996-11-29 1996-11-29 Ranging device Expired - Fee Related JP3806473B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP32037996A JP3806473B2 (en) 1996-11-29 1996-11-29 Ranging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP32037996A JP3806473B2 (en) 1996-11-29 1996-11-29 Ranging device

Publications (2)

Publication Number Publication Date
JPH10160456A JPH10160456A (en) 1998-06-19
JP3806473B2 true JP3806473B2 (en) 2006-08-09

Family

ID=18120823

Family Applications (1)

Application Number Title Priority Date Filing Date
JP32037996A Expired - Fee Related JP3806473B2 (en) 1996-11-29 1996-11-29 Ranging device

Country Status (1)

Country Link
JP (1) JP3806473B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5531774B2 (en) * 2010-05-20 2014-06-25 リコーイメージング株式会社 Automatic focusing apparatus and camera equipped with the same
JP2015102735A (en) 2013-11-26 2015-06-04 株式会社ニコン Focus detection device and imaging device

Also Published As

Publication number Publication date
JPH10160456A (en) 1998-06-19

Similar Documents

Publication Publication Date Title
JP3530906B2 (en) Imaging position detection program and camera
JP4892014B2 (en) camera
JP3806473B2 (en) Ranging device
JP2002140693A (en) Image processing parameter determination device, its method and recording medium with recorded image processing parameter determination program
JP2881995B2 (en) Object detection device for optical instruments
JP3847390B2 (en) Ranging device
JP3806489B2 (en) Ranging device
US6038405A (en) Automatic focus detection device
JP2006251777A (en) Focus detection apparatus and optical apparatus
JP4127808B2 (en) Ranging device
JP4282300B2 (en) Camera ranging device
JP2002250857A (en) Range finder
JPH09211316A (en) Image signal processor
KR19990023868A (en) Distance measuring method
JP3798866B2 (en) Ranging device
JP6532411B2 (en) IMAGE PROCESSING DEVICE, IMAGING DEVICE, AND IMAGE PROCESSING PROGRAM
JP3984138B2 (en) Ranging device and camera equipped with the same
JPH09243358A (en) Passive type range finder
JP7559015B2 (en) IMAGE PROCESSING APPARATUS, IMAGING APPARATUS, IMAGE PROCESSING METHOD, AND COMPUTER PROGRAM
JP2005250296A (en) Focusing device and focusing method
JP2005147959A (en) Distance-measuring method and distance-measuring device
JP3618925B2 (en) Imaging device
JP2005134621A (en) Focus detector of camera
JPH0674762A (en) Distance measuring apparatus
JPH1026525A (en) Range finding method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050916

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20051206

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060206

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060515

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

Free format text: PAYMENT UNTIL: 20100519

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100519

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20110519

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120519

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20130519

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20140519

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees