JP2010002280A - Imaging device, distance measuring device, and parallax calculating method - Google Patents
Imaging device, distance measuring device, and parallax calculating method Download PDFInfo
- Publication number
- JP2010002280A JP2010002280A JP2008160941A JP2008160941A JP2010002280A JP 2010002280 A JP2010002280 A JP 2010002280A JP 2008160941 A JP2008160941 A JP 2008160941A JP 2008160941 A JP2008160941 A JP 2008160941A JP 2010002280 A JP2010002280 A JP 2010002280A
- Authority
- JP
- Japan
- Prior art keywords
- parallax
- imaging system
- optical axis
- reference image
- image
- 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.)
- Pending
Links
Images
Landscapes
- Measurement Of Optical Distance (AREA)
- Image Processing (AREA)
- Studio Devices (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、複数の撮像系を有し、当該撮像系間において生じる視差を算出する撮像装置及び視差算出方法、並びに、算出された視差から被写体までの距離を測定する測距装置に関し、特に微小な視差を高精度に算出することができる撮像装置、視差算出方法、測距装置に関する。 The present invention relates to an imaging apparatus and a parallax calculation method that have a plurality of imaging systems, calculate parallax generated between the imaging systems, and a distance measuring apparatus that measures the distance from the calculated parallax to a subject. The present invention relates to an imaging device, a parallax calculation method, and a distance measuring device that can calculate accurate parallax with high accuracy.
複数の視点間の視差の計測が可能な従来の撮像装置として、特許文献1の撮像装置がある。特許文献1の撮像装置は、複数の視点の画像情報を用いて、視点間の視差を計測する。特許文献1の撮像装置は、1つの視点の画像情報を基準画像として扱い、他の視点の画像情報を参照画像として扱う。そして、特許文献1の撮像装置は、基準画像に対する参照画像の画像特徴の類似度を求める。そして、特許文献1の撮像装置は、この類似度を最小とするずらし量dの類似度h(d)と、前後のずらし量(d−1及びd+1)の類似度(h(d−1)及びh(d+1))とを利用して、下記式(1)のように、一画素より細かい分解能で視差d’を求める。
As a conventional imaging device capable of measuring parallax between a plurality of viewpoints, there is an imaging device disclosed in
ここで、0以上のずらし量の類似度のみを演算する一般的な撮像装置は、類似度が最小となるずらし量が0の場合、最小の類似度を与えるずらし量の前のずらし量d−1での類似度h(−1)を求めることができない。そのため、一般的な撮像装置は、式(1)の演算を実施できないため、一画素より細かい分解能で視差d’を求めることができない。 Here, in a general imaging apparatus that calculates only a similarity with a shift amount of 0 or more, when the shift amount that minimizes the similarity is 0, the shift amount d− before the shift amount that gives the minimum similarity is d−. The similarity h (-1) at 1 cannot be obtained. Therefore, since a general imaging device cannot perform the calculation of Expression (1), the parallax d ′ cannot be obtained with a resolution finer than one pixel.
そこで、特許文献1の撮像装置は、ずらし量を−1から予め設定された正値まで変化させ、変化させたずらし量のそれぞれにおける類似度を求める。これにより、特許文献1の撮像装置は、類似度を最小とするずらし量dが0の場合でも、最小の類似度を与えるずらし量の前のずらし量d−1での類似度h(−1)を求めることができる。そのため、特許文献1の撮像装置は、式(1)を用いて一画素より細かい分解能で視差d’を求めることができる。すなわち、特許文献1の撮像装置は、視差が0付近であっても細かい分解能で視差d’を求めることができる。
しかしながら、特許文献1に記載された従来の撮像装置は、負数(−1)のずらし量を用いて視差演算をする必要があるため、演算が複雑になるとともに、演算を実現するための回路規模が大きくなるという問題があった。
However, since the conventional imaging device described in
そこで、本発明は、上記問題に鑑みなされたもので、微小な視差を高精度で算出するとともに、視差演算のための回路規模の増大を抑制することができる撮像装置などを提供することを目的とする。 Therefore, the present invention has been made in view of the above problems, and an object thereof is to provide an imaging device and the like that can calculate a minute parallax with high accuracy and suppress an increase in circuit scale for parallax calculation. And
上記目的を達成するために、本発明に係る撮像装置は、レンズと前記レンズに対応する撮像領域とを有する、基準撮像系と一つ以上の参照撮像系とを備え、同一の被写体を撮像したときの前記基準撮像系と前記参照撮像系との間に生じる視差を算出する撮像装置であって、前記基準撮像系及び前記参照撮像系により生成された基準画像及び参照画像において、前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心に対応する位置である光軸位置をそれぞれ取得する光軸位置取得手段と、前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心を互いに結ぶ直線の方向である基線方向のうち前記基準撮像系が有するレンズの光軸中心に近づく向きへ前記参照画像の光軸位置から所定画素数移動した位置と、前記基準画像の光軸位置とが、同一の座標値となるように前記基準画像及び前記参照画像の平面座標を設定する座標設定手段と、前記座標設定手段により設定された座標に基づいて、前記基準画像の一部領域と前記参照画像の一部領域との画像の類似度合いを表す評価値を算出し、算出された評価値から仮視差を算出する仮視差演算手段と、前記仮視差演算手段により算出された仮視差から前記所定画素数を減算することにより、前記基準撮像系と前記参照撮像系との間に生じる視差を算出する視差算出手段とを備えることを特徴とする。具体的には、前記仮視差演算手段は、前記基準画像の一部の領域である基準ブロックを選択する基準ブロック選択手段と、前記基準ブロックを示す座標値と同一の座標値で示される前記参照画像の一部の領域から、前記基線方向のうち前記基準撮像系の有するレンズの光軸中心から遠ざかる方へ、所定のずらし量ごとにずらしていった領域を参照ブロックとして選択し、選択した参照ブロックごとに前記基準ブロックとの前記評価値を算出する評価値算出手段と、算出された前記評価値のうち複数の評価値に基づく補間式を用いて、類似度合いが最大となるずらし量を前記仮視差として算出する仮視差算出手段とを有することを特徴とする。 In order to achieve the above object, an imaging apparatus according to the present invention includes a standard imaging system and one or more reference imaging systems each having a lens and an imaging region corresponding to the lens, and images the same subject. An imaging apparatus for calculating a parallax generated between the reference imaging system and the reference imaging system when the reference imaging system generates a reference image and a reference image generated by the reference imaging system and the reference imaging system. And optical axis position acquisition means for acquiring an optical axis position that is a position corresponding to the optical axis center of the lens respectively included in the reference imaging system, and light of the lens included in each of the standard imaging system and the reference imaging system A position obtained by moving a predetermined number of pixels from the optical axis position of the reference image in a direction approaching the optical axis center of the lens included in the reference imaging system in a base line direction that is a direction of a straight line connecting the axial centers. The coordinate setting means for setting the plane coordinates of the reference image and the reference image so that the optical axis position of the reference image has the same coordinate value, and the coordinates set by the coordinate setting means, Temporary parallax calculation means for calculating an evaluation value representing a degree of similarity between the partial area of the reference image and the partial area of the reference image, and calculating temporary parallax from the calculated evaluation value; and the temporary parallax calculation And a parallax calculating unit that calculates a parallax generated between the reference imaging system and the reference imaging system by subtracting the predetermined number of pixels from the temporary parallax calculated by the unit. Specifically, the temporary parallax calculation means includes a reference block selection means for selecting a reference block that is a partial area of the reference image, and the reference indicated by the same coordinate value as the coordinate value indicating the reference block. Select an area that is shifted by a predetermined shift amount as a reference block from a partial area of the image to a direction away from the optical axis center of the lens of the reference imaging system in the baseline direction, and select the selected reference Using the evaluation value calculating means for calculating the evaluation value with the reference block for each block, and using an interpolation formula based on a plurality of evaluation values among the calculated evaluation values, the shift amount that maximizes the similarity is Temporary parallax calculation means for calculating as temporary parallax is provided.
これにより、負数のずらし量を用いることなく微小な視差を高精度に算出できるので、微小な視差を高精度に算出するとともに、視差演算のための回路規模の増大を抑制することが可能となる。 As a result, a minute parallax can be calculated with high accuracy without using a negative shift amount, so that it is possible to calculate a minute parallax with high accuracy and to suppress an increase in circuit scale for parallax calculation. .
また、前記座標設定手段は、前記基線方向のうち前記基準撮像系が有するレンズの光軸中心に近づく向きへ、前記参照画像の光軸位置から一画素移動した位置と、前記基準画像の光軸位置とが、同一の座標値となるように、前記平面座標を設定することが好ましい。 Further, the coordinate setting means includes a position moved by one pixel from the optical axis position of the reference image in a direction approaching the optical axis center of the lens of the reference imaging system in the baseline direction, and an optical axis of the reference image The plane coordinates are preferably set so that the position has the same coordinate value.
これにより、参照画像を一画素だけ大きくするだけでよいので、視差演算において使用する記憶領域などの増大による回路規模の増大を抑制することが可能となる。 As a result, since it is only necessary to enlarge the reference image by one pixel, it is possible to suppress an increase in circuit scale due to an increase in the storage area used in the parallax calculation.
また、前記参照画像は、前記基準画像と比べて、前記基線方向のうち前記基準撮像系の有するレンズの光軸中心に近づく向きへ、前記所定画素数だけ大きな画像であることが好ましい。 Further, it is preferable that the reference image is an image larger than the reference image by the predetermined number of pixels toward the direction closer to the optical axis center of the lens of the reference imaging system in the baseline direction.
これにより、参照ブロックを選択する際に、参照ブロックが選択可能か否かを確認する必要がないため、視差演算を簡易にすることができ、視差演算のための回路規模の増大を抑制することが可能となる。 As a result, when selecting a reference block, it is not necessary to check whether or not the reference block can be selected, so that the parallax calculation can be simplified and an increase in circuit scale for the parallax calculation is suppressed. Is possible.
また、本発明に係る測距装置は、レンズと前記レンズに対応する撮像領域とを有する、基準撮像系と一つ以上の参照撮像系とを備え、同一の被写体を撮像したときの前記基準撮像系と前記参照撮像系との間に生じる視差に基づいて、前記被写体までの距離を算出する測距装置であって、前記基準撮像系及び前記参照撮像系により生成された基準画像及び参照画像において、前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心に対応する位置である光軸位置をそれぞれ取得する光軸位置取得手段と、前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心を互いに結ぶ直線の方向である基線方向のうち前記基準撮像系が有するレンズの光軸中心に近づく向きへ前記参照画像の光軸位置から所定画素数移動した位置と、前記基準画像の光軸位置とが、同一の座標値となるように前記基準画像及び前記参照画像の平面座標を設定する座標設定手段と、前記座標設定手段により設定された座標に基づいて、前記基準画像の一部領域と前記参照画像の一部領域との画像の類似度合いを表す評価値を算出し、算出された評価値から仮視差を算出する仮視差演算手段と、前記仮視差演算手段により算出された仮視差から前記所定画素数を減算することにより、前記基準撮像系と前記参照撮像系との間に生じる視差を算出する視差算出手段と、前記視差算出手段により算出された視差を用いて、前記被写体までの距離を算出する距離算出手段とを備えることを特徴とする。 The distance measuring device according to the present invention includes a reference imaging system and one or more reference imaging systems each having a lens and an imaging region corresponding to the lens, and the reference imaging when imaging the same subject. A distance measuring device that calculates a distance to the subject based on a parallax generated between a system and the reference imaging system, wherein a reference image and a reference image generated by the standard imaging system and the reference imaging system An optical axis position acquisition unit that acquires an optical axis position that is a position corresponding to an optical axis center of the lens of each of the standard imaging system and the reference imaging system, and the standard imaging system and the reference imaging system, respectively. A predetermined number of pixels from the optical axis position of the reference image in a direction approaching the optical axis center of the lens of the reference imaging system in a base line direction that is a direction of a straight line connecting the optical axis centers of the lens with each other Coordinate setting means for setting the plane coordinates of the reference image and the reference image so that the moved position and the optical axis position of the reference image have the same coordinate value; and the coordinates set by the coordinate setting means A temporary parallax calculating means for calculating an evaluation value indicating a degree of similarity between the partial area of the reference image and the partial area of the reference image based on the calculated evaluation value; A parallax calculating unit that calculates a parallax generated between the reference imaging system and the reference imaging system by subtracting the predetermined number of pixels from the temporary parallax calculated by the temporary parallax calculating unit; and the parallax calculating unit And a distance calculating means for calculating a distance to the subject using the calculated parallax.
これにより、微小な視差の算出精度の向上に伴う遠方の距離の高精度化を実現するとともに、距離演算のための回路規模の増大を抑制することができる。 As a result, it is possible to increase the accuracy of the far distance accompanying the improvement of the calculation accuracy of the minute parallax, and to suppress an increase in the circuit scale for the distance calculation.
なお、本発明は、このような撮像装置として実現することができるだけでなく、このような撮像装置が備える特徴的な手段をステップとする視差算出方法として実現したり、それらのステップをコンピュータに実行させるプログラムとして実現したりすることもできる。そして、そのようなプログラムは、CD−ROM等の記録媒体やインターネット等の伝送媒体を介して配信することができる。 Note that the present invention can be realized not only as such an imaging apparatus, but also as a parallax calculation method using steps characteristic of the imaging apparatus, or by executing these steps on a computer. It can also be realized as a program to be executed. Such a program can be distributed via a recording medium such as a CD-ROM or a transmission medium such as the Internet.
本発明によれば、2つ以上撮像系を備え、同一の被写体を撮像したときの各撮像系間に生じる視差を算出する撮像装置などにおいて、負数のずらし量を用いた視差演算が不要となるので、微小な視差の算出を高精度で行うとともに、視差演算のための回路規模の増大を抑制することが可能となる。 According to the present invention, in an imaging apparatus that includes two or more imaging systems and calculates parallax generated between the imaging systems when the same subject is imaged, parallax calculation using a negative shift amount becomes unnecessary. Therefore, it is possible to calculate a minute parallax with high accuracy and to suppress an increase in circuit scale for parallax calculation.
以下、本発明の好ましい実施の形態を、図面を参照しながら説明する。 Hereinafter, preferred embodiments of the present invention will be described with reference to the drawings.
(実施の形態1)
図1は、本発明の実施の形態1に係る測距装置101の構成を示す断面図である。図1に示すように、測距装置101は、回路部120と、その回路部120の上方に設けられたレンズモジュール部110とを備えている。
(Embodiment 1)
FIG. 1 is a cross-sectional view showing a configuration of a
レンズモジュール部110は、円筒状の鏡筒111と、その鏡筒111の開口を覆う上部カバーガラス112と、その上部カバーガラス112の下方であって鏡筒111の内部に設けられたレンズアレイ113とを有している。また、回路部120は、基板121と、その基板121上に設けられたパッケージ122と、撮像素子123と、パッケージカバーガラス124と、半導体回路素子であるシステムLSI(以下、SLSIと記す)125とを有している。
The
鏡筒111は、上述のとおり円筒状であって、その内壁面は光の乱反射を防止するためにつやが消された黒で着色されている。また、鏡筒111は、樹脂を射出成形することにより形成される。
The
上部カバーガラス112は、円盤状であり、光学ガラス材或いは透明樹脂などから形成され、鏡筒111の上部の内壁に接着剤などを用いて固着される。また、上部カバーガラス112の表面には、摩擦などによる損傷を防止するための保護膜と、入射光の反射を防止するための反射防止膜とが設けられている。
The
図2は、本発明の実施の形態1に係る測距装置101のレンズアレイ113の構成を示す平面図である。図2に示すように、レンズアレイ113は、略円盤状であり、光学ガラス材、透明樹脂などから形成される。また、レンズアレイ113には、円形の第1のレンズ部113a、第2のレンズ部113b、第3のレンズ部113c、及び第4のレンズ部113dが、2行2列の碁盤目状に配設されている。
FIG. 2 is a plan view showing the configuration of the
ここで、第1〜第4のレンズ部113a〜113dの配列方向に沿って、図2に示すようにx軸及びy軸を設定する。第1のレンズ部113a、第2のレンズ部113b、第3のレンズ部113c、及び第4のレンズ部113dにおいて、被写体側から入射した光は、撮像素子123側へ射出され、撮像素子123上に4つの像が結像される。
Here, along the arrangement direction of the first to
また、図2に示すように、各レンズ部は、レンズ中心である、光軸中心114a、光軸中心114b、光軸中心114c及び光軸中心114dを有する。そして、光軸中心114aと、光軸中心114b、光軸中心114c及び光軸中心114dとをそれぞれ結ぶ直線の方向を各レンズ間における基線方向という。
As shown in FIG. 2, each lens unit has an
なお、図2に示すように、第1のレンズ部113aの光軸中心114a及び第2のレンズ部113bの光軸中心114bは、x軸方向ではDxだけ離れており、かつ、y軸方向では一致する。第1のレンズ部113aの光軸中心114a及び第3のレンズ部113cの光軸中心114cは、x軸方向では一致しており、かつ、y軸方向ではDyだけ離れている。第3のレンズ部113cの光軸中心114c及び第4のレンズ部113dの光軸中心114dは、x軸方向ではDxだけ離れており、かつ、y軸方向は一致する。第4のレンズ部113dの光軸中心114d及び第1のレンズ部113aの光軸中心114aは、x軸方向ではDxだけ離れており、かつ、y軸方向ではDyだけ離れている。以下、実施の形態1の係る測距装置101において、DxとDyとは等しいものとする。
As shown in FIG. 2, the
図1に示す測距装置101の各構成部の説明に戻る。
基板121は、樹脂基板から構成され、上面に鏡筒111がその底面を接して接着剤などを用いて固着される。このようにして、測距装置101では、レンズモジュール部110と回路部120とが固定される。
Returning to the description of each component of the
The
パッケージ122は、金属端子部を有する樹脂からなり、鏡筒111の内側において、基板121の上面にその金属端子部が半田づけ等されて固着される。
The
撮像素子123は、CCDセンサ或いはCMOSセンサのような固体撮像素子であり、その受光面が第1のレンズ部113a、第2のレンズ部113b、第3のレンズ部113c、及び第4のレンズ部113dの光軸と略垂直になるようにして配置される。撮像素子123の各端子は、パッケージ122の内側の底部の金属端子にワイヤーボンディングにより金線127で接続され、基板121を介して、SLSI125と電気的に接続される。撮像素子123の受光面に、第1のレンズ部113a、第2のレンズ部113b、第3のレンズ部113c、及び第4のレンズ部113dから射出された光がそれぞれ結像し、その光の情報がフォトダイオードにより電気信号へ変換される。そして、その電気信号がSLSI125に転送される。
The
図3は、本発明の実施の形態1に係る測距装置101の回路部120の構成を示す平面図である。パッケージカバーガラス124は、平板状であり、透明樹脂により形成され、パッケージ122の上面に接着などにより固着される。なお、図3においては、便宜上、パッケージカバーガラス124を透して見える撮像素子123などの記載は省略する。
FIG. 3 is a plan view showing the configuration of the
SLSI125は、後述の方法により、撮像素子123から入力された電気信号を用いて、各種演算を行う。また、SLSI125は、上位CPUと通信を行い、外部に画像情報、距離情報などを出力する。なお、SLSI125は、電源(例えば3.3V)とグランド(例えば、0V)とに接続される。
The
図4は、本発明の実施の形態1に係る測距装置101の撮像素子の構成を示す平面図である。図4に示すように、撮像素子123は、第1の撮像領域123a、第2の撮像領域123b、第3の撮像領域123c、及び第4の撮像領域123dを含んで構成されている。これらの第1〜第4の撮像領域123a〜123dは、それぞれの受光面が、第1〜第4のレンズ部113a〜113dの光軸と略垂直になるようにして2行2列で配置される。これらの第1〜第4の撮像領域123a〜123dにて撮像信号が生成される。
FIG. 4 is a plan view showing the configuration of the image sensor of
なお、本実施の形態1においては、第1のレンズ部113a及び第1の撮像領域123aが基準撮像系である。また、第2のレンズ部113b及び第2の撮像領域123b、第3のレンズ部113c及び第3の撮像領域123c、並びに第4のレンズ部113d及び第4の撮像領域123dが参照撮像系である。
In the first embodiment, the
次に、被写体距離と視差との関係を説明する。本発明の実施の形態1に係る測距装置101は、4つのレンズ部(第1のレンズ部113a、第2のレンズ部113b、第3のレンズ部113c、及び第4のレンズ部113d)を有するため、4つのレンズ部がそれぞれ形成する4つの物体像の相対的位置が、被写体距離に応じて変化する。
Next, the relationship between subject distance and parallax will be described. The
図5は、本発明の実施の形態1に係る測距装置101において、無限遠にある物体を撮像したときの物体像の位置を説明するための図である。図5においては、簡単のため、レンズアレイ113において、第1のレンズ部113a、及び第2のレンズ部113bのみを記す。無限遠にある物体10からの光の第1のレンズ部113aへの代表的な入射光L1と、無限遠にある物体10からの光の第2のレンズ部113bへの代表的な入射光L2とは平行である(ここで、図5において、物体10は2つ描画されているが、単一の物体である。無限遠の物体10を有限な紙面上に描画できない。そのため、図5において、入射光L1と入射光L2とが平行であることを明示するために、2つの位置の無限遠にある物体10を描画している)。このため、第1のレンズ部113aの光軸中心114aと第2のレンズ部113bの光軸中心114bとの間の距離と、撮像素子123上の物体像11aが結像される位置と物体像11bが結像される位置との間の距離とは等しい。すなわち、視差はない。
FIG. 5 is a diagram for explaining the position of an object image when an object at infinity is imaged in
図6は、本発明の実施の形態1に係る測距装置101において、有限距離の位置にある物体を撮像したときの物体像の位置を説明するための図である。図6において、簡単のため、レンズアレイ113において、第1のレンズ部113a、及び第2のレンズ部113bのみを記す。有限距離の位置にある物体12からの光の第1のレンズ部113aへの代表的な入射光L1と、有限距離の位置にある物体12からの光の第2のレンズ部113bへの代表的な入射光L2とは平行ではない。したがって、第1のレンズ部113aの光軸中心114aと第2のレンズ部113bの光軸中心114bとの間の距離に比べて、撮像素子123上の物体像13aが結像される位置と物体像13bが結像される位置との間の距離は長い。すなわち、視差がある。
FIG. 6 is a diagram for explaining the position of an object image when an object at a finite distance is imaged in
ここで、第1のレンズ部113aの主点から物体像12までの距離(被写体距離)をA、第1のレンズ部113aと第2のレンズ部113bとの光軸間距離をD、レンズ部113a,113bの焦点距離をfとする。この場合、図6の直角を挟む2辺の長さがA、Dの直角三角形と、直角を挟む2辺の長さがf、Δの直角三角形とが相似である。したがって、視差値Δは、焦点距離f、光軸間距離D及び被写体距離Aを用いて、下記式(2)のように表される。
Here, the distance from the principal point of the
その他のレンズ部についても同様の関係が成立する。このように、被写体距離に応じて4つのレンズ部113a、113b、113c、113dがそれぞれ形成する4つの物体像の相対的位置が変化する。例えば、被写体距離Aが小さくなると、視差値Δが大きくなる。そこで、下記式(3)のように、式(2)を被写体距離Aについて解くことにより、視差値Δから被写体距離Aを求めることができる。
The same relationship is established for the other lens units. In this manner, the relative positions of the four object images formed by the four
次に、本発明の実施の形態1に係る測距装置101の機能構成を説明する。図7は、本発明の実施の形態1に係る測距装置101の機能構成を示すブロック図である。SLSI125は、システム制御部131、撮像素子駆動部132、撮像信号入力部133、入出力部134、画像切出部141、視差演算部142、視差補正部143、失敗検知部144、及び距離演算部145を有する。
Next, the functional configuration of the
システム制御部131は、CPU(中央演算処理装置:Central Processing Unit)、ロジック回路などから構成され、SLSI125の全体を制御する。
The
撮像素子駆動部132は、ロジック回路などから構成され、システム制御部131の命令により電子シャッター或いは撮像素子123を駆動するための信号を発生し、この信号に応じた電圧を撮像素子123に印加する。
The image
撮像信号入力部133は、直列に接続された、CDS回路(相関二重サンプリング回路:Correlated Double Sampling Circuit)、AGC(自動利得制御器:Automatic Gain Controller)、及びADC(アナログ/デジタル変換器:Analog Digital Converter)から構成される。
The imaging
具体的には、撮像信号入力部133は、撮像素子123から電気信号を取得し、取得した電気信号の固定ノイズを、CDS回路により除去する。さらに、撮像信号入力部133は、固定ノイズが除去された電気信号のゲインを、AGCにより調整する。さらに、撮像信号入力部133は、ゲインが調整された電気信号を、ADCによりアナログ信号からデジタル信号に変換する。このように、撮像信号入力部133は、撮像素子123から取得した電気信号を用いて、デジタル信号である撮像信号I0を生成する。
Specifically, the imaging
入出力部134は、外部機器からの入力の受付け、及び、距離演算部145が算出した距離情報などの外部機器への出力を行う。
The input /
画像切出部141は、光軸位置取得手段の一例であり、撮像信号入力部133により生成された撮像信号I0における、基準画像である第1の撮像信号I1並びに参照画像である第2の撮像信号I2、第3の撮像信号I3、及び第4の撮像信号I4の光軸位置を取得する。
The
ここで、光軸位置とは、各レンズの光軸中心に対応する画像内の位置であり、レンズの光軸中心を通り撮像素子123の撮像面に垂直な線(光軸)が撮像面と交差する位置である。この光軸位置は、各撮像系をキャリブレーションすることにより、あらかじめ算出されている。そして、光軸位置を特定するための情報は、例えば、図示していない記憶部に格納されている。
Here, the optical axis position is a position in the image corresponding to the optical axis center of each lens, and a line (optical axis) that passes through the optical axis center of the lens and is perpendicular to the imaging surface of the
また、画像切出部141は、取得した第1の撮像信号I1の光軸位置が画像の中心となるように、第1の撮像信号I1を撮像信号I0から切り出す。さらに、画像切出部141は、第1の撮像信号I1と比べて、光軸中心114aと光軸中心114bとを結ぶ直線の方向(基線方向)のうちレンズ部113aの光軸中心114aに近づく向きへ、第2の撮像信号I2の光軸位置からの距離が一画素だけ大きな画像となるように第2の撮像信号I2を、撮像信号I0から切り出す。また、画像切出部141は、第3の撮像信号I3及び第4の撮像信号I4も、第2の撮像信号I2と同様に、撮像信号I0から切り出す。
The
また、画像切出部141は、座標設定手段の一例でもあり、基線方向のうちレンズ部113aの光軸中心114aに近づく向きへ、第2の撮像信号I2の光軸位置から一画素移動した位置と、第1の撮像信号の光軸位置とが、同一の座標値となるように第1の撮像信号I1及び第2の撮像信号I2のxy座標を設定する。さらに、画像切出部141は、第3の撮像信号I3及び第4の撮像信号I4についても、第2の撮像信号I2と同様にxy座標を設定する。
The
ここで、xy座標は、平面座標の一例であり、x座標及びy座標により平面上の位置が特定できる座標である。 Here, the xy coordinate is an example of a plane coordinate, and is a coordinate whose position on the plane can be specified by the x coordinate and the y coordinate.
なお、第2の撮像信号I2の光軸位置から移動させる画素数である一画素は一例であり、本発明に係る測距装置は、一画素より大きな画素数だけ移動した位置と基準画像の光軸位置とが対応するようにxy座標を設定してもよい。この場合、画像切出部141は、一画素より大きな画素数だけ大きな画像となるように、第2の撮像信号I2、第3の撮像信号I3及び第4の撮像信号I4を、撮像信号I0から切り出す。
Note that one pixel, which is the number of pixels to be moved from the optical axis position of the second imaging signal I2, is an example, and the distance measuring device according to the present invention has a position moved by a number of pixels larger than one pixel and light of the reference image. The xy coordinates may be set so as to correspond to the axis position. In this case, the
視差演算部142は、仮視差演算手段の一例であり、画像切出部141により設定された座標に基づいて、第1の撮像信号I1の一部領域と第2の撮像信号I2の一部領域との画像の類似度合いを表す評価値を算出し、算出された評価値から仮視差を算出する。
The
詳細には、視差演算部142は、基準ブロック選択手段の一例であり、第1の撮像信号I1の一部の領域である基準ブロックを選択する。
Specifically, the
また、視差演算部142は、評価値算出手段の一例であり、基準ブロックを示す座標値と同一の座標値で示される第2の撮像信号I2の一部の領域から、基線方向のうち光軸中心114aから遠ざかる向きへ、所定のずらし量ごとにずらしていった領域を参照ブロックとして選択し、選択した参照ブロックごとに、基準ブロックとの評価値を算出する。
Further, the
また、視差演算部142は、仮視差算出手段の一例であり、算出された前記評価値のうち複数の評価値に基づく補間式を用いて、類似度合いが最大となるずらし量を仮視差として算出する。
Further, the
さらに、視差演算部142は、第3の撮像信号I3及び第4の撮像信号I4についても、第2の撮像信号I2と同様に類似度合いが最大となるずらし量を算出する。そして、視差演算部142は、算出されたずらし量の中で、最も評価値の類似度合いが最大となるずらし量を仮視差として特定する。
Further, the
視差補正部143は、視差算出手段の一例であり、仮視差から一画素を減算することにより、第1の撮像信号I1と、第2の撮像信号I2、第3の撮像信号I3又は第4の撮像信号I4との間に生じている視差を算出する。
The
失敗検知部144は、視差判定手段の一例であり、視差補正部143により算出された視差が負数であるか否かを判定する。
The
また、失敗検知部144は、失敗情報出力手段の一例でもあり、視差判定手段において負数であると判定された場合、視差演算が失敗したことを示す失敗情報を出力する。
The
距離演算部145は、距離算出手段の一例であり、視差補正部143により算出された視差を用いて、被写体までの距離を算出する。
The
次に、以上のように構成された本実施の形態における測距装置101の基本的な動作について説明する。
Next, the basic operation of the
図8は、本発明の実施の形態1に係る測距装置101の動作を示すフローチャートである。SLSI125のシステム制御部131により、測距装置101は、このフローチャートのとおりに動作される。
FIG. 8 is a flowchart showing the operation of the
測距装置101は、例えば、上位CPU(図示せず)が、入出力部134を介し、測距装置101に動作の開始を命令することにより、動作を開始する。
The
動作を開始すると、撮像信号入力部133は、撮像素子123から入力された電気信号を、撮像信号I0へ変換する。そして、撮像信号入力部133は、撮像信号I0を画像切出部141及び入出力部134へ出力する(ステップS1020)。具体的には、撮像信号入力部133は、x方向の画素数がH0画素であり、y方向の画素数がV0画素である撮像信号I0(x,y)を、I0(0,0)((x,y)=(0,0))、I0(1,0)、I0(2,0)、・・・、I0(H0−2,V0−1)、I0(H0−1,V0−1)の順に出力する。
When the operation starts, the imaging
次に、画像切出部141は、入力された撮像信号I0から基準画像及び参照画像を切り出す(ステップS1100)。具体的には、画像切出部141は、例えば記憶部に格納された光軸位置を特定するための情報を取得する。そして、画像切出部141は、取得した光軸位置を特定するため情報を用いて、撮像信号I0から、基準画像である第1の撮像信号I1並びに参照画像である、第2の撮像信号I2、第3の撮像信号I3、及び第4の撮像信号I4を作成する。
Next, the
次に、画像切出部141は、基準画像及び参照画像に対してxy座標を設定する(ステップS1150)。このxy座標は、基線方向のうち基準撮像系が有するレンズの光軸中心に近づく向きへ、参照画像の光軸位置から所定画素数移動した位置と、基準画像の光軸位置とが、同一の座標値となるように設定された座標である。そして、画像切出部141は、基準画像である第1の撮像信号I1並びに参照画像である、第2の撮像信号I2、第3の撮像信号I3、及び第4の撮像信号I4を出力する。
Next, the
以下に、ステップS1100及びステップS1150における画像切出部141の処理を、図9を用いて、さらに詳しく説明する。
Hereinafter, the processing of the
図9は、本発明の実施の形態1に係る測距装置101の撮像信号の切り出し位置を説明するための図である。図9において、座標(xc1,yc1)、座標(xc2,yc2)、座標(xc3,yc3)、及び座標(xc4,yc4)は、それぞれ、撮像信号I0における第1のレンズ部113a、第2のレンズ部113b、第3のレンズ部113c、及び第4のレンズ部113dの光軸中心に対応する位置(光軸位置)の座標である。
FIG. 9 is a diagram for explaining the cutout position of the imaging signal of the
画像切出部141は、中心が第1のレンズ部113aの光軸中心に対応する位置(光軸位置)の座標(xc1,yc1)となり、かつ、大きさがx方向の画素数がH1画素、y方向の画素数がV1画素となるように、第1の撮像信号I1を撮像信号I0から切り出す。すなわち、画像切出部141は、下記式(4)〜式(6)のように、x方向の画素数がH1画素、y方向の画素数がV1画素となる第1の撮像信号I1を切り出す。さらに、画像切出部141は、下記式(4)〜式(6)に示すように、切出した第1の撮像信号I1に対して、原点が座標(x01,y01)となるように、xy座標を設定する。
The image cut-out
また、画像切出部141は、中心が第2のレンズ部113bの光軸中心114bに対応する位置(光軸位置)の座標(xc2,yc2)となり、かつ、その大きさがx方向の画素数がH1画素、y方向の画素数がV1画素となる領域より、x方向(基線方向)において、負の向き(レンズ部113aの光軸中心114aへ近づく向き)に一画素だけ、正の向きに(レンズ部113aの光軸中心114aから遠ざかる向き)にSB画素だけ大きい領域となるように、第2の撮像信号I2を撮像信号I0から切り出す。すなわち、画像切出部141は、下記式(7)〜式(11)のように、x方向の画素数がH2画素及びy方向の画素数がV2画素となる第2の撮像信号I2を切り出す。
Further, the
さらに、画像切出部141は、切り出した第2の撮像信号I2に対して、原点の座標が座標(x02,y02)となるように、xy座標を設定する。つまり、画像切出部141は、基線方向のうちレンズ部113aの光軸中心114aに近づく向きへ、第2の撮像信号I2の光軸位置(xc2,yc2)から一画素移動した位置(xc2−1,yc2)と、第1の撮像信号の光軸位置(xc1,yc1)とが、同一の座標値となるようにxy座標を設定する。
Further, the
また、画像切出部141は、中心が第3のレンズ部113cの光軸中心114cに対応する位置(光軸位置)の座標(xc3,yc3)となり、かつ、大きさがx方向の画素数がH1画素、y方向の画素数がV1画素となる領域より、y方向(基線方向)において、負の向き(レンズ部113aの光軸中心114aへ近づく向き)に一画素だけ、正の向き(レンズ部113aの光軸中心114aから遠ざかる向き)にSB画素だけ大きい領域となるように、第3の撮像信号I3を撮像信号I0から切り出す。すなわち、画像切出部141は、下記式(12)〜式(16)のように、x方向の画素数がH3画素及びy方向の画素数がV3画素となる第3の撮像信号I3を切り出す。
In addition, the
さらに、画像切出部141は、切り出した第3の撮像信号I3に対して、原点の座標が座標(x03,y03)となるように、xy座標を設定する。つまり、画像切出部141は、基線方向のうちレンズ部113aの光軸中心114aに近づく向きへ、第3の撮像信号I3の光軸位置(xc3,yc3)から一画素移動した位置(xc3,yc3−1)と、第1の撮像信号の光軸位置(xc1,yc1)とが、同一の座標値となるようにxy座標を設定する。
Further, the
また、画像切出部141は、中心が第4のレンズ部113dの光軸中心114dに対応する位置(光軸位置)の座標(xc4,yc4)となり、かつ、大きさがx方向の画素数がH1画素、y方向の画素数がV1画素となる領域より、x方向において、負の向きに一画素だけ、正の向きにSB画素だけ、y方向において、負の向きに一画素だけ、正の向きにSB画素だけ大きい領域となるように、第4の撮像信号I4を撮像信号I0から切り出す。すなわち、画像切出部141は、第1の撮像信号I1と比べて、x軸を−45度回転させた方向(基線方向)のレンズ部113aの光軸中心114aへ近づく向きに2の平方根の画素分だけ大きい領域となるように、第4の撮像信号I4を撮像信号I0から切り出す。つまり、下記式(17)〜式(21)のように、x方向の画素数がH4画素及びy方向の画素数がV4画素となる第4の撮像信号I4を切り出す。
Further, the
さらに、画像切出部141は、切り出した第4の撮像信号I4に対して、原点の座標が座標(x04,y04)となるように、xy座標を設定する。つまり、画像切出部141は、基線方向のうちレンズ部113aの光軸中心114aに近づく向きへ、第4の撮像信号I4の光軸位置(xc4,yc4)から一画素移動した位置(xc4−1,yc4−1)と、第1の撮像信号の光軸位置(xc1,yc1)とが、同一の座標値となるようにxy座標を設定する。
Further, the
図8のフローチャートの説明に戻る。
次に、視差演算部142、視差補正部143及び距離演算部145は、距離の演算を実行する(ステップS1200)。
Returning to the flowchart of FIG.
Next, the
以下に、図10を用いて、ステップS1200の処理の詳細について説明する。図10は、本発明の実施の形態1に係る測距装置101の距離演算に関する動作を示すフローチャートである。図10のフローチャートは、図8におけるステップS1200の処理の詳細を示す。
Hereinafter, the details of the process of step S1200 will be described with reference to FIG. FIG. 10 is a flowchart showing an operation related to the distance calculation of the
まず、視差演算部142は、撮像信号I1の一部の画像領域である基準ブロックを選択する(ステップS1220)。
First, the
ここで、ステップS1220において、視差演算部142が選択する基準ブロックの詳細を、図11を用いて説明する。図11は、本発明の実施の形態1に係る測距装置101において、視差演算部142が選択する基準ブロックを説明するための図である。図11に示すように、視差演算部142により選択される基準ブロックは、第1の撮像信号I1上において、x方向の画素数がHB画素、y方向の画素数がVB画素となる画像である。ステップS1150(図8)が実行された後、初めてこのステップS1220を実行されるときは、視差演算部142は、ブロックの中心が(HB/2,VB/2)の基準ブロックを選択する。以後、このステップS1220が実行されるときは、視差演算部142は、ブロックの中心を右側に順に一画素ずつずらした基準ブロックを選択する。なお、図11において右端のブロック(中心が(H1−HB/2、0)、(H1−HB/2,1)、・・・のブロック)を視差演算部142が選択した場合、次は、一画素下の行の左端のブロック(中心が(HB/2,1)、(HB/2,2)、・・・のブロック)を視差演算部142は基準ブロックとして選択する。すなわち、視差演算部142は、インデックス(i,j)を設定し、中心が(i,j)、x方向の画素数がHB画素、y方向の画素数がVB画素のブロックを基準ブロックとして選択する。インデックス(i,j)において、ステップS1150(図8)が実行された後、視差演算部142が初めてこのステップS1220の処理を実行するときに、インデックス(i,j)を(HB/2,VB/2)に初期化する。そして、初期化以後、視差演算部142がステップS1220の処理を実行する度に、視差演算部142は、iを1ずつ大きくする。前回のiがH1−HB/2のとき、視差演算部142は、iを0にし、jを1だけ大きくする。
Here, details of the reference block selected by the
図10のフローチャートの説明に戻る。
次に、視差演算部142は、基準画像である第1の撮像信号I1と、参照画像である第2の撮像信号I2、第3の撮像信号I3、及び第4の撮像信号I4と、を用いて、基準画像上の各画素における視差Δ(仮視差)を演算し、演算した視差Δ(仮視差)を出力する(ステップS1230)。この視差Δ(仮視差)の演算において、視差演算部142は、まず、第1の撮像信号I1と第2の撮像信号I2とにおける、視差(仮視差)と視差信頼度とを演算する。
Returning to the flowchart of FIG.
Next, the
以下に、第1の撮像信号I1と第2の撮像信号I2とにおける、視差(仮視差)と視差信頼度との演算について、詳細に説明する。視差演算部142は、最初に、第1の撮像信号I1と第2の撮像信号I2との視差評価値R12(kx)を演算する。ここで、kxは基準ブロックと同一の座標値となる参照画像の一部領域に対して、参照ブロックをどれだけずらして選択するかを示すずらし量である。視差演算部142は、kxを、kx=0、1、2、・・・、SB+1のように変化させる。
Hereinafter, the calculation of the parallax (temporary parallax) and the parallax reliability in the first imaging signal I1 and the second imaging signal I2 will be described in detail. First, the
図12は、本発明の実施の形態1に係る測距装置101において、第1の撮像信号I1と第2の撮像信号I2とを利用したときの視差演算における視差評価値の演算領域を説明するための図である。
FIG. 12 illustrates a calculation area of a parallax evaluation value in the parallax calculation when the first imaging signal I1 and the second imaging signal I2 are used in the
基準ブロックI1bで示される領域は、第1の撮像信号I1において、インデックス(i,j)で示されるブロックである。すなわち、基準ブロックI1bは、第1の撮像信号I1において、中心の座標が(i,j)、x方向の画素数がHB画素、y方向の画素数がVB画素であるブロックである。 The area indicated by the reference block I1b is a block indicated by the index (i, j) in the first imaging signal I1. That is, the reference block I1b is a block in the first imaging signal I1 whose center coordinates are (i, j), the number of pixels in the x direction is HB pixels, and the number of pixels in the y direction is VB pixels.
また、参照ブロックI2bで示される領域は、第2の撮像信号I2において、基準ブロックI1bの座標値と同一となる座標値のブロックから、x方向にkxだけずれた領域のブロックである。すなわち、参照ブロックI2bは、第2の撮像信号I2において、中心の座標が(i+kx,j)、x方向の画素数がHB画素、y方向の画素数がVB画素であるブロックである。 In addition, the area indicated by the reference block I2b is a block of an area that is shifted by kx in the x direction from the block having the same coordinate value as the coordinate value of the standard block I1b in the second imaging signal I2. That is, the reference block I2b is a block in which the center coordinates are (i + kx, j), the number of pixels in the x direction is HB pixels, and the number of pixels in the y direction is VB pixels in the second imaging signal I2.
ここで、視差演算部142は、ずらし量kxを0からSB+1まで変化させた場合(kx=0からSB+1)について、下記式(22)に示される絶対値差分総和(SAD:Sum of Absolute Differences)を演算する。ここで、視差演算部142は、演算したSADを視差評価値R12(kx)として扱う。すなわち、視差演算部142は、第1の撮像信号I1を基準画像とし、第2の撮像信号I2を参照画像として、視差評価値R12(kx)を演算する。
Here, when the shift amount kx is changed from 0 to SB + 1 (kx = 0 to SB + 1), the
式(22)において、ΣΣは、インデックス(i,j)で示されるブロック内の各画素の総和を示す。つまり、式(22)において、xはi−HB/2からi+HB/2−1まで変化し、yはj−VB/2からj+VB/2−1まで変化する。 In Expression (22), ΣΣ represents the total sum of each pixel in the block indicated by the index (i, j). That is, in Expression (22), x changes from i−HB / 2 to i + HB / 2-1, and y changes from j−VB / 2 to j + VB / 2-1.
この視差評価値R12(kx)は、第1の撮像信号I1においてインデックス(i,j)で示される中心座標(i,j)の基準ブロックの画像と、第2の撮像信号I2においてインデックス(i,j)で示される中心座標(i,j)のブロックからx方向にkxだけずれた領域の参照ブロックの画像とが、どれだけ相関があるか(類似しているか)を示し、値が小さいほど相関が大きい(類似度合いが大きい)ことを示す。 The parallax evaluation value R12 (kx) is an image of the reference block at the center coordinates (i, j) indicated by the index (i, j) in the first imaging signal I1 and the index (i in the second imaging signal I2. , J) indicates how much the image of the reference block in the region shifted by kx in the x direction from the block of the central coordinates (i, j) indicated by (i, j) is correlated (similar), and the value is small The higher the correlation, the greater the degree of similarity.
図13は、本発明の実施の形態1に係る測距装置101の第1の撮像信号I1と第2の撮像信号I2を利用したときの視差演算における、ずらし量と視差評価値との関係を説明する図である。図13に示すように、視差評価値R12(kx)はずらし量kxの値によって変化し、ずらし量kx=Δのときに視差評価値R12(kx)は極小値となる。つまり、第1の撮像信号I1においてインデックス(i,j)で示される中心座標(i,j)の基準ブロックに対して、第2の撮像信号I2においてインデックス(i,j)で示される中心座標(i,j)のブロックからx方向にずらし量Δだけずれた領域の参照ブロックが最も相関が高い(最も類似度合いが大きい)ブロックである。そこで、視差演算部142は、インデックス(i,j)で示されるブロックにおける第1の撮像信号I1と第2の撮像信号I2との視差評価値R12(kx)が最小値となるずらし量をずらし量Δと特定する。
FIG. 13 shows the relationship between the shift amount and the parallax evaluation value in the parallax calculation when the first imaging signal I1 and the second imaging signal I2 of the
さらに、視差演算部142は、下記式(23)のように、等角フィッティングの補間式を利用してxy座標における視差値Δ12(i,j)(仮視差)を算出する。その結果、視差演算部142は、ずらし量単位(一画素)未満の分解能で視差(仮視差)を求めることが可能となる。
Further, the
また、視差演算部142は、下記式(24)のように、視差評価値R12(Δ)を用いて、座標(i,j)における第1の撮像信号I1と第2の撮像信号I2との視差信頼度C12(i,j)を算出する。
Further, the
次に、視差演算部142は、第1の撮像信号I1と第3の撮像信号I3との視差(仮視差)及び視差信頼度も上記と同様に求める。ただし、視差演算部142は、第3の撮像信号I3において参照ブロックをずらす方向を、第1のレンズ部113aの光軸中心と第3のレンズ部113cの光軸中心とを結ぶ直線の方向であるy方向に変更する。また、ずらし量はkyとする。
Next, the
具体的には、視差演算部142は、下記式(25)のように、インデックス(i,j)で示されるブロックにおける第1の撮像信号I1と第3の撮像信号I3との視差評価値R13(ky)を求める。すなわち、視差演算部142は、第1の撮像信号I1を基準画像として扱うとともに、第3の撮像信号I3を参照画像として扱うことにより、視差評価値R13(ky)を演算する。そして、視差演算部142は、視差評価値R13(ky)が最小値となるずらし量Δを特定する。さらに、視差演算部142は、下記式(26)のように、等角フィッティングの補間式を利用して、座標(i,j)における第1の撮像信号I1と第3の撮像信号I3とのxy座標における視差値Δ13(i,j)(仮視差)を算出する。また、視差演算部142は、下記式(27)のように、視差評価値R13(Δ)を用いて、座標(i,j)における第1の撮像信号I1と第3の撮像信号I3との視差信頼度C13(i,j)を算出する。
Specifically, the
次に、視差演算部142は、第1の撮像信号I1と第4の撮像信号I4との視差(仮視差)及び視差信頼度も上記と同様に求める。ただし、視差演算部142は、第4の撮像信号I4において参照ブロックをずらす方向を斜め方向(第1のレンズ部113aの光軸中心114aと第4のレンズ部113dの光軸中心114dとを結ぶ直線の方向)に変更する。また、ずらし量はx方向にkx、y方向にkxとする。
Next, the
具体的には、視差演算部142は、下記式(28)のように、インデックス(i,j)で示されるブロックにおける第1の撮像信号I1と第4の撮像信号I4との視差評価値R14(kx)を求める。すなわち、視差演算部142は、第1の撮像信号I1を基準画像として扱うとともに、第4の撮像信号I4を参照画像として扱うことにより、視差評価値R14(kx)を演算する。そして、視差演算部142は、視差評価値R14(kx)が最小値を与えるずらし量Δを特定する。さらに、視差演算部142は、下記式(29)のように、等角フィッティングの補間式を利用して、座標(i,j)における第1の撮像信号I1と第4の撮像信号I4とのxy座標における視差値Δ14(i,j)(仮視差)を算出する。また、視差演算部142は、下記式(30)のように、視差評価値R14(Δ)を用いて、座標(i,j)における第1の撮像信号I1と第4の撮像信号I4との視差信頼度C14(i,j)を算出する。
Specifically, the
そして、視差演算部142は、上記3つの視差信頼度を比較することにより、最も信頼できる視差値(仮視差)を選択する。すなわち、視差演算部142は、下記式(31)のように、3つの視差信頼度C12(i,j)、C13(i,j)、及びC14(i,j)を比較することにより、最も値が小さい視差信頼度に対応する視差値(仮視差)を選択する。例えば、視差信頼度C12(i,j)が最も小さな値であるとき、視差演算部142は、視差値Δ12(i,j)を座標(i,j)における視差値Δ(i,j)(仮視差)として選択する。また、例えば、視差信頼度C13(i,j)が最も小さな値であるとき、視差値Δ13(i,j)を座標(i,j)における視差値Δ(i,j)(仮視差)として選択する。また、例えば、視差信頼度C14(i,j)が最も小さな値であるとき、視差値Δ14(i,j)を座標(i,j)における視差値Δ(i,j)(仮視差)として選択する。
Then, the
なお、本実施の形態1では、視差演算部142は、視差信頼度(C12、C13、C14)を、絶対値差分総和(式(22)、式(25)、式(28))を用いて算出したが、例えば、正規化相関係数を用いて算出してもよい。この場合、視差演算部142は、最も値が大きい視差信頼度が最も信頼できる視差信頼度となるので、最も値が大きい視差信頼度に対応する視差値(仮視差)を選択する。
In the first embodiment, the
図10のフローチャートの説明に戻る。
次に、視差補正部143は、視差演算部142が算出した視差値Δ(仮視差)の補正を行い、補正後の視差値である補正後視差値を出力する。
Returning to the flowchart of FIG.
Next, the
図9に示すように、基準画像である第1の撮像信号I1において、光軸中心114aに対応する位置(光軸位置)の座標(xc1,yc1)と原点の座標(x01,y01)との差は、(H1/2,V1/2)である。一方、参照画像である第2の撮像信号I2において、光軸中心114bに対応する位置(光軸位置)の座標(xc2,yc2)と原点の座標(x02,y02)との差は、(H1/2+1,V1/2)である。すなわち、第2の撮像信号I2(参照画像)における光軸位置の座標値は、第1の撮像信号I1(基準画像)における光軸位置の座標値に比べて、x方向(基準撮像系と参照撮像系の光軸中心を結ぶ直線の方向)の負の向き(基準撮像系の光軸中心へ近づく向き)に一画素だけ大きい。そのため、視差値Δ(i,j)(仮視差)は、本来の視差に対して一画素分だけ大きい。
As shown in FIG. 9, in the first imaging signal I1, which is the reference image, the coordinates (xc1, yc1) of the position (optical axis position) corresponding to the
また、参照画像である第3の撮像信号I3において、光軸中心114cに対応する位置(光軸位置)の座標(xc3,yc3)と原点の座標(x03,y03)との差は、(H1/2,V1/2+1)である。すなわち、第3の撮像信号I3(参照画像)における光軸位置の座標値は、第1の撮像信号I1(基準画像)における光軸位置の座標値に比べて、y方向(基準撮像系と参照撮像系の光軸中心を結ぶ直線の方向)の負の向き(基準撮像系の光軸中心へ近づく向き)に一画素だけ大きい。そのため、視差値Δ(i,j)(仮視差)は、本来の視差に対して一画素分だけ大きい。
Further, in the third imaging signal I3 which is the reference image, the difference between the coordinates (xc3, yc3) of the position (optical axis position) corresponding to the
また、参照画像である第4の撮像信号I4において、光軸中心114dに対応する位置(光軸位置)の座標(xc4,yc4)と原点の座標(x04,y04)との差は、(H1/2+1,V1/2+1)である。すなわち、第4の撮像信号I4(参照画像)における光軸位置の座標値は、第1の撮像信号I1(基準画像)における光軸位置の座標値に比べて、x軸を−45度回転させた方向(基準撮像系と参照撮像系の光軸中心を結ぶ直線の方向)の負の向き(基準撮像系の光軸中心へ近づく向き)に一画素だけ大きい。つまり、第4の撮像信号I4(参照画像)における光軸位置の座標値は、第1の撮像信号I1(基準画像)における光軸位置の座標値に比べて、x方向の負の向きに一画素だけ、y方向の負の向きに一画素だけ大きい。そのため、視差値Δ(i,j)(仮視差)は、本来の視差に対して、一画素分だけ大きい。
In the fourth imaging signal I4 as the reference image, the difference between the coordinates (xc4, yc4) of the position (optical axis position) corresponding to the
ここで、所定方向に一画素大きいとは、当該所定方向の直線上に、周期的に画素の中心が現れる場合の、一周期分の距離大きいことを意味する。 Here, “one pixel larger in a predetermined direction” means that the distance of one cycle is larger when the center of the pixel periodically appears on a straight line in the predetermined direction.
このように、視差演算部142が算出した視差値Δは、本来の視差に比べて大きくなるため、視差補正部143は、視差値Δ(仮視差)を補正することにより本来の視差を算出する。例えば、視差値Δ12(i,j)、視差値Δ13(i,j)、あるいは視差値Δ14(i,j)が視差値Δ(仮視差)として選択されている場合には、下記式(32)のように、視差補正部143は、座標(i,j)における視差値Δ(i,j)から一画素だけ減算することにより、座標(i,j)における本来の視差値である補正後視差値Δa(i,j)を算出する。
Thus, since the parallax value Δ calculated by the
次に、失敗検知部144は、視差補正部143により補正された視差値を用いて、視差演算の失敗を検知する。そして、失敗が検知された場合、失敗検知部144は、失敗フラッグDDEの値を1としたうえで出力する。
Next, the
図5に示すように、被写体距離が無限遠のときに視差は最も小さな値0となるので、視差値が負数となることはない。そのため、視差補正部143により補正された視差値が負数となるとき、失敗検知部144は、視差演算が失敗したと判断する。具体的には、下記式(33)のように、失敗検知部144は、座標(i,j)における補正後視差値Δa(i,j)が0以上のとき、失敗フラッグDDEを0(DDE=0)に設定する。一方、失敗検知部144は、座標(i,j)における補正後視差値Δa(i,j)が0より小さいとき、失敗フラッグDDEを1(DDE=1)に設定する。なお、この失敗の原因として、撮像信号へのノイズの重畳などが考えられる。
As shown in FIG. 5, since the parallax is the smallest value 0 when the subject distance is infinite, the parallax value does not become a negative number. Therefore, when the parallax value corrected by the
次に、距離演算部145は、補正後視差値Δaと失敗フラッグDDEとを用いて距離の演算を行う。そして、距離演算部145は、演算した距離データDISを出力する(ステップS1260)。具体的には、距離演算部145は、式(3)へ、視差補正部143により算出された補正後視差値Δa(i,j)などを代入することにより、距離データDIS(i,j)を算出する。つまり、距離演算部145は、下記式(34)のように、距離データDIS(i,j)を算出する。
Next, the
なお、失敗フラッグDDE(i,j)が0のときは、視差が正しく求められているため、距離演算部145は上記演算を行う。一方、失敗フラッグDDE(i,j)が1のときは、視差が正しく求められていないため、距離演算部145は上記演算を行わない。例えば、距離演算部145は、距離データDIS(i,j)を0と設定する。
Note that when the failure flag DDE (i, j) is 0, since the parallax is correctly obtained, the
式(34)において、fは焦点距離、Dxはx方向の光軸間距離、pは撮像素子123の受光素子の間隔である。また、式(34)では、補正後視差値Δaが画素単位であるため、補正後視差値Δaにpを乗ずることにより、補正後視差値Δaが焦点距離fなどと同一の単位系となるように変換されている。
In Expression (34), f is the focal length, Dx is the distance between the optical axes in the x direction, and p is the interval between the light receiving elements of the
次に、距離演算部145は、基準画像内のすべてのブロックが選択されたか否かを判定する(ステップS1270)。ここで、すべてのブロックが選択されていたとき(インデックス(i,j)が(H1−HB/2,V1−VB/2)であるとき)(ステップS1270のYes)、図8のステップS1910の処理が実行される。一方、すべてのブロックが選択されていないとき(インデックス(i,j)が(H1−HB/2,V1−VB/2)でないとき)(ステップS1270のNo)、再び、ステップS1220の処理が実行される。すなわち、ステップS1220において、インデックス(i,j)が(HB/2,VB/2)に初期化され、iをHB/2からH1−HB/2まで、jをVB/2からV1−VB/2まで変化させつつ、ステップS1230、ステップS1240、ステップS1250、及びステップS1260の動作が繰り返される。
Next, the
図8のフローチャートの説明に戻る。
入出力部134は、画像データ、距離データ、及び失敗情報データを測距装置101の外部に出力する(ステップS1910)。具体的には、入出力部134は、画像データとして、撮像信号I0或いは第1の撮像信号I1を出力する。また、入出力部134は、距離データとして、距離データDISを出力する。また、入出力部134は、失敗情報データとして、失敗フラッグDDEを出力する。
Returning to the flowchart of FIG.
The input /
システム制御部131は、動作を終了するかどうかを判断する(ステップS1920)。例えば、システム制御部131は、入出力部134を介し、上位CPU(図示せず)と通信することにより、動作を終了するかどうかの命令を要求する。そして、システム制御部131が上位CPUから終了命令を受信した場合(ステップS1920のYes)、処理を終了する。一方、システム制御部131が上位CPUから終了命令を受信しない場合(ステップS1920のNo)、ステップS1020の処理が実行される。すなわち、システム制御部131が上位CPUから終了命令を受信しない限り、ステップS1020、ステップS1100、ステップS1150、ステップS1200、及びステップS1910の処理が繰り返される。
The
実施の形態1に係る測距装置101は、以上のように構成されて動作することにより、以下の効果を奏する。
The
まず、図14(a)〜(d)を用いて、実施の形態1に係る測距装置101の効果を説明する。図14(a)〜(d)は、実施の形態1に係る測距装置101による効果を説明するための図である。
First, the effects of the
図14(a)及び図14(b)に示すように、基準画像である第1の撮像信号I1と参照画像である第2の撮像信号I2との視差が微小である場合に、一般的な測距装置は、基準ブロックと同一の位置(各光軸位置から同一の距離及び方向の位置)から選択する参照ブロックをずらしていくので、ずらし量の最小値(0)で視差評価値R12(kx)が最小となる。そのため、一般的な測距装置は、視差が微小である場合(視差評価値の最小となるずらし量が0である場合)、最小となる視差評価値のずらし量より小さなずらし量における視差評価値を利用した補間関数により、視差の分解能及び精度を高めることができない。 As shown in FIGS. 14A and 14B, when the parallax between the first imaging signal I1 that is the reference image and the second imaging signal I2 that is the reference image is very small, Since the distance measuring device shifts the reference block to be selected from the same position as the reference block (position of the same distance and direction from each optical axis position), the parallax evaluation value R12 (with a minimum shift amount (0)) kx) is minimized. For this reason, when the parallax is very small (when the shift amount that minimizes the parallax evaluation value is 0), a general distance measuring device has a parallax evaluation value at a shift amount that is smaller than the shift amount of the parallax evaluation value that is minimum. The resolution and accuracy of the parallax cannot be increased by the interpolation function using.
これに対し、図14(d)の点線の垂直軸で示すように、従来の測距装置(例えば、特許文献1の撮像装置)は、負数のずらし量まで視差評価値R12(kx)を演算することにより、補間関数を用いて視差の分解能及び精度を高めることができる。しかし、従来の測距装置は、ずらし量を負数とする必要があるため、視差演算を実行するための回路の規模が大きくなる。 On the other hand, as shown by the dotted vertical axis in FIG. 14D, the conventional distance measuring device (for example, the imaging device of Patent Document 1) calculates the parallax evaluation value R12 (kx) up to a negative shift amount. By doing so, the resolution and accuracy of the parallax can be increased using the interpolation function. However, since the conventional distance measuring device needs to set the shift amount to a negative number, the scale of the circuit for executing the parallax calculation increases.
そこで、図14(d)の実線の垂直軸で示すように、本実施の形態1に係る測距装置101は、基準ブロックより一画素小さな位置から選択する参照ブロックをずらしていく。その結果、本実施の形態1に係る測距装置101は、ずらし量が常に正数となるので、微小な視差における視差の分解能及び精度を高めるとともに、視差演算のための回路規模の増大を抑制することが可能となる。
Therefore, as shown by the solid vertical axis in FIG. 14D, the
さらに、本実施の形態1に係る測距装置101は、基線方向のうち基準撮像系が有するレンズであるレンズ部113aの光軸中心114aに近づく向きへ、参照画像の光軸位置から一画素移動した位置と、基準画像の光軸位置とが同一の座標となるように、xy座標を設定する。したがって、測距装置101は、基準ブロックの座標値と同一の座標値から参照ブロックをずらしながら、視差評価値R12(kx)を演算するだけで、ずらし量を常に正数とすることが可能となる。そして、測距装置101は、一般的な測距装置による視差演算と同様の視差演算を行った後に、得られた視差(仮視差)から一画素減算するだけで、微小な視差における視差の分解能及び精度を高めることが可能となる。すなわち、測距装置101は、一般的な測距装置の視差演算をほとんどそのまま流用することができるので、視差演算のための回路規模の増大を抑制することが可能となる。
Further, the
また、図14(c)に示すように、本実施の形態1に係る測距装置101では、参照画像は、基準画像と比べて、レンズ部113aの光軸中心114aに近づく向きへ一画素大きい。したがって、測距装置101では、基準画像のすべての画素に対して、同一の位置(各光軸位置から同一の距離及び方向の位置)より、基線方向のうちレンズ部113aの光軸中心114aに近づく向きへ一画素移動した位置の参照画像が存在する。したがって、測距装置101は、参照ブロックを選択する際に、参照ブロックが選択可能か否かを確認する必要がないため、視差演算を簡易にすることができ、視差演算のための回路規模の増大を抑制することが可能となる。また、測距装置101は、基準画像の全領域について、視差を高精度に算出することも可能となる。また、測距装置101は、参照画像を一画素だけ大きくするだけでよいので、視差演算において使用する記憶領域などの増大による回路規模の増大を抑えることができる。
As shown in FIG. 14C, in the
なお、本実施の形態1に係る測距装置101は、上述のように視差演算が簡易になることから、視差演算の速度を向上させるという効果も期待できる。
In addition, since the
以下に、上述の効果をさらに具体的に説明する。
一般的な撮像装置は、図14(a)及び図14(b)に示すように、基準画像である第1の撮像信号I1及び参照画像である第2の撮像信号I2において、光軸位置からx方向(基線方向)の負の向き(レンズ部113aの光軸中心114aに近づく向き)の画素数が同一のとき、視差評価値R12(kx)(SAD)を最小とするずらし量Δとその前後のずらし量(ずらし量Δ−1、ずらし量Δ+1)とにおける視差評価値R12(Δ−1)、R12(Δ)、及びR12(Δ+1)を用いて、分解能が一画素未満の視差Δ12(i,j)を求める。そして、一般的な撮像装置は、式(32)のような視差の補正を行わず、この視差Δ12(i,j)に基づき距離演算する。そのため、図14(a)及び図14(b)に示すように、一般的な撮像装置は、左端のブロック(図11において、インデックスが(HB/2,0)、(HB/2,1)、・・・、(HB/2,VB/2)で示されるブロック)において、視差が0付近で視差評価値R12(kx)(SAD)を最小とするずらし量Δが0のとき、ずらし量Δ−1の視差評価値R12(Δ−1)を演算することができない(ずらし量−1の視差評価値R12(−1)を演算することができない)。そのため、一般的な撮像装置は、基準画像の左端のブロックでは、式(23)を用いて一画素未満の分解能の視差を求めることができない。
Hereinafter, the above-described effects will be described more specifically.
As shown in FIG. 14A and FIG. 14B, a general image pickup apparatus uses a first image pickup signal I1 that is a reference image and a second image pickup signal I2 that is a reference image from an optical axis position. When the number of pixels in the negative direction in the x direction (baseline direction) (direction approaching the
一方、実施の形態1に係る測距装置101では、図14(c)に示すように、基準画像である第1の撮像信号I1と比較して、参照画像である第2の撮像信号I2は、光軸中心からx方向(基線方向)の負の向き(レンズ部113aの光軸中心114aに近づく向き)に一画素だけ大きい画素数を持つ。そして、測距装置101は、式(23)のように、視差評価値R12(kx)(SAD)を最小とするずらし量Δとその前後のずらし量(ずらし量Δ−1及びずらし量Δ+1)とにおける視差評価値R12(Δ−1)、R12(Δ)、及びR12(Δ+1)を用いて、分解能が一画素未満の視差Δ12(i,j)(仮視差)を求める。そして、測距装置101は、式(32)のように、求めた視差Δ12(i,j)(仮視差)から一画素を減算することにより、視差Δ12a(i,j)を求める。そして、測距装置101は、このようにして求めた視差Δ12a(i,j)に基づき距離演算する。そのため、測距装置101は、図14(c)及び図14(d)に示すように、左端のブロック(図11において、インデックスが(HB/2,0)、(HB/2,1)、・・・、(HB/2,VB/2)で示されるブロック)において、視差が0付近で視差評価値R12(kx)(SAD)を最小とするずらし量Δが1のとき、ずらし量Δ−1の視差評価値R12(Δ−1)を演算する(ずらし量0の視差評価値R12(0)を演算する)ことができる。それゆえ、測距装置101は、視差値Δ(i,j)を求めることができ、視差を1だけ減算する補正を行い視差値Δa(i,j)を求める。そして、このようにして求めた視差値Δa(i,j)は0付近である。すなわち、測距装置101は、基準画像の左端のブロック(図11において、インデックスが(HB/2,0)、(HB/2,1)、・・・、(HB/2,VB/2)で示されるブロック)においても、視差0付近で一画素未満の高分解能な視差を求めることができる。それゆえ、測距装置101は、遠方での高精度な測距を実現する。すなわち、測距装置101は、広い画像領域で、遠方での高精度な測距を実現する。
On the other hand, in the
また、実施の形態1に係る測距装置101において、0以上のずらし量のみが必要であり、負のずらし量が不要となる。そのため、測距装置101は、式(22)の参照画像の座標の計算において、負数を考慮する必要がなく、符号ビットを省略できる。つまり、測距装置101は、その省略可能な符号ビットの分だけ回路規模或いは処理時間を縮小できるので、低コストであり、かつ、遠方を高精度に測距することができる測距装置を実現する。
In the
また、ずらし量に負数を導入すると、測距装置は、ずらし量が負数のとき、この負数に対応した参照画像があるかどうかを逐次検証する必要がある。その結果、その検証に要するロジックの分だけ回路規模或いは処理時間が増大する。実施の形態1に係る測距装置101は、ずらし量を0以上に限定するため、上記の検証が不要となり、その分だけ回路規模或いは処理時間を縮小でき、低コストに遠方を高精度に測距できる測距装置を実現する。
In addition, when a negative number is introduced into the shift amount, the distance measuring device needs to sequentially verify whether there is a reference image corresponding to the negative number when the shift amount is a negative number. As a result, the circuit scale or processing time increases by the amount of logic required for the verification. Since the
また、実施の形態1に係る測距装置101では、図9に示すように、基準画像である第1の撮像信号I1と比較し、参照画像である第2の撮像信号I2は、光軸位置からx方向(基線方向)の負の向き(光軸中心114aに近づく向き)に一画素だけ大きい画素数を持つ。また、測距装置101では、第2の撮像信号I2は、光軸位置からx方向(光軸方向)の正の向き(光軸中心114aから遠ざかる向き)にSB画素だけ大きい画素数を持つ。すなわち、測距装置101は、基準画像の左端のブロック(図11において、インデックスが(HB/2,0)、(HB/2,1)、・・・、(HB/2,VB/2)で示されるブロック)、及び基準画像の右端のブロック(図11において、インデックスが(H1−HB/2,0)、(H1−HB/2,1)、・・・、(H1−HB/2,VB/2)で示されるブロック)においても、視差評価値R12(kx)(SAD)を演算することができる。仮に、ずらし量を−1或いはSB+2とすると、測距装置は参照画像にない座標を参照するため、視差評価値R12(kx)を演算できない。実施の形態1に係る測距装置101は、参照画像である第2の撮像信号I2用に、必要最小限の画素数を持ち、必要最小限の記憶容量のみを持つため、低コストであり、かつ、遠方を高精度に測距できる測距装置を実現する。また、ずらし量に対応した参照画像があるかどうかを逐次検証する必要ない。そのため、その分だけ回路規模或いは処理時間を縮小でき、低コストに遠方を高精度に測距できる測距装置を実現する。
In the
なお、本発明は、本実施の形態1の測距装置101が備える、距離演算部145以外の構成部を備える撮像装置として実現することもできる。さらに、本発明は、このような撮像装置を備える、三次元位置測定装置或いは画像合成装置として実現することもできる。
Note that the present invention can also be realized as an imaging apparatus including components other than the
(実施の形態2)
次に、本発明の実施の形態2に係る撮像システムについて説明する。本発明の実施の形態2に係る撮像システムは、本発明の実施の形態1に係る測距装置101を利用したものである。以下、本発明の実施の形態2に係る撮像システムについて、図面を参照しながら説明する。
(Embodiment 2)
Next, an imaging system according to
図15は、本発明の実施の形態2に係る撮像システム202の構成を示すブロック図である。本発明の実施の形態2に係る撮像システム202は、測距装置101、撮像システム制御部203、及び画像認識部204を有する。
FIG. 15 is a block diagram showing a configuration of the
撮像システム制御部203は、CPUなどから構成され、撮像システム202の全体を制御する。
The imaging
測距装置101は、本発明の実施の形態1に記述された測距装置であり、撮像システム制御部203の命令によって制御され、画像データI1(ここでは第1の撮像信号I1とする)、距離データDIS、及び失敗情報データDDEを出力する。
The
画像認識部204は、CPUなどから構成される。画像認識部204は、失敗情報データDDEに基づき、画像データI1と失敗でない箇所の距離データDISとを利用して各種画像認識を行う。例えば、画像認識部204は、顔面を撮影したとき、画像データI1と距離データDISとを用いて顔向きを判断するにあたり、失敗箇所の距離データは無視する。
The
このように、本発明の実施の形態2に係る撮像システムによれば、実施の形態1と同様に、広い画像領域で、遠方での高精度な測距を実現する。 As described above, according to the imaging system according to the second embodiment of the present invention, as in the first embodiment, high-precision distance measurement in a distant place is realized in a wide image area.
また、本発明の実施の形態2に係る撮像システムによれば、失敗情報データDDEに基づき、画像データI1と失敗でない箇所の距離データDISとを利用して各種画像認識を行うことにより、認識精度を向上できる。 Further, according to the imaging system according to the second embodiment of the present invention, recognition accuracy is achieved by performing various image recognition using the image data I1 and the distance data DIS of the part that has not failed based on the failure information data DDE. Can be improved.
以上、本発明に係る測距装置について、実施の形態に基づいて説明したが、本発明は、これらの実施の形態に限定されるものではない。本発明の趣旨を逸脱しない限り、当業者が思いつく各種変形を本実施の形態に施したもの、異なる実施の形態における構成要素を組み合わせて構築される形態なども、本発明の範囲内に含まれる。 Although the distance measuring apparatus according to the present invention has been described based on the embodiments, the present invention is not limited to these embodiments. Unless it deviates from the gist of the present invention, various modifications conceived by those skilled in the art have been made in the present embodiment, and forms constructed by combining components in different embodiments are also included in the scope of the present invention. .
例えば、実施の形態1に係る測距装置101は、式(22)、式(25)、及び式(28)のように視差評価値としてSADを用いたが、本発明に係る測距装置は、式(22)を下記式(35)のように変形した、二乗和(SSD:Sum of Squared Differences)を用いてもよい。なお、本発明に係る測距装置は、式(25)、式(28)の演算においても、同様に二乗和を用いてもよい。
For example, the
また、実施の形態1に係る測距装置101は、式(23)、式(26)、式(29)のように、等角フィッティングの補間式を利用することにより一画素未満の分解能の視差を求めたが、本発明に係る測距装置は、式(23)を下記式(36)のように変形した、パラボラフィッティングの補間式を用いて一画素未満の分解能の視差を求めてもよい。なお、本発明に係る測距装置は、式(26)、式(29)の演算においても、同様にパラボラフィッティングの補間式を用いてもよい。
In addition, the
また、実施の形態1の係る測距装置101において、式(22)、式(25)、式(28)のように都度ブロック内の総和を演算したが、本発明に係る測距装置は、式(22)を下記式(37)のように変形し、再帰的に演算してもよい。なお、本発明に係る測距装置は、式(25)、式(28)の演算においても、同様に再帰的に演算してもよい。
Further, in the
また、実施の形態1に係る測距装置101が備えるレンズアレイ113において、各レンズ部間の距離であるDxとDyは等しい。しかしながら、本発明に係る測距装置はこのようなレンズアレイを備える測距装置に限定されるわけではない。つまり、本発明に係る測距装置は、DxとDyとが異なっていてもよい。この場合、測距装置は、DxとDyとが異なることによる処理の変更が必要となる。例えば、測距装置は、中心が第4のレンズ部113dの光軸中心114dに対応する位置(光軸位置)の座標(xc4,yc4)となり、かつ、大きさがx方向の画素数がH1画素、y方向の画素数がV1画素となる領域より、x方向の負の向きに一画素だけ、正の向きにSB画素だけ、y方向の負の向きにDy/Dx画素だけ、正の向きにSB*Dy/Dx画素だけ大きい領域となるように、第4の撮像信号I4を撮像信号I0から切り出す。すなわち、測距装置は、下記式(38)及び式(39)のように、切り出した第4の撮像信号I4に対して原点の座標が座標(x04,y04)となるようにxy座標を設定する。その結果、測距装置において、第4の撮像信号I4の大きさは、下記式(40)及び式(41)のように、x方向の画素数がH4と、y方向の画素数V4となる。なお、測距装置は、式(41)において、V4を整数にするために、適宜切り上げなどの処理を行ってもよい。また、測距装置は、下記式(42)のように、ずらす方向を第1のレンズ部113aの光軸中心114aと第4のレンズ部113dの光軸中心114dとを結ぶ直線に一致させる。ここで、測距装置は、座標が小数点となる箇所のブロックについて、適宜、線形補間を用いて画像(例えば、輝度値)を求める。また、測距装置は、視差信頼度C13(i,j)が最も小さいとき、x方向の視差に合わせるために、下記式(43)のように、視差Δ13(i,j)にDx/Dyを乗じ、下記式(44)のように、視差Δ(i,j)にDy/Dxを乗じる。
In the
また、実施の形態1に係る測距装置101において、レンズアレイ113は略円形に成型されているが、本発明に係る測距装置は、このようなレンズアレイを備える測距装置に限定されない。図16A及び図16Bは、実施の形態1の変形例に係る測距装置のレンズアレイの構成を示す平面図である。図16Aに示すレンズアレイ301のように、本発明に係る測距装置が備えるレンズアレイは長方形状に成型されてもよい。さらに、図16Bに示すレンズアレイ302のように、本発明に係る測距装置が備えるレンズアレイは、その端面等に平面方向に伸びる突起等が設けられていてもよい。このように、レンズアレイが略円形でなくても、レンズ部はほぼ等方に膨張するため、変形例に係る測距装置は、実施の形態1の測距装置101と同様の効果を得ることができる。
In the
また、実施の形態1に係る測距装置101において、レンズアレイ113は4つのレンズ部を有していたが、本発明に係る測距装置は、このようなレンズアレイを備える測距装置に限定されない。本発明に係る測距装置において、レンズアレイが有するレンズ部の数が異なっていてもよい。図17A及び図17Bは、実施の形態1の変形例に係る測距装置のレンズアレイの構成を示す平面図である。図17Aに示すレンズアレイ303のように、本発明に係る測距装置は、2つのレンズ部を持つものでもよい。また、図17Bに示すレンズアレイ304のように、本発明に係る測距装置は、9つのレンズ部を持つものでもよい。
In the
さらに、本発明は、このような撮像装置或いは測距装置の特徴的な構成部が行う処理を実行する視差算出方法及び測距方法として実現したり、それらの方法をコンピュータに実行させるプログラムとして実現したりすることもできる。そして、そのようなプログラムは、CD−ROM等の記録媒体やインターネット等の伝送媒体を介して配信することができるのは言うまでもない。 Furthermore, the present invention is realized as a parallax calculation method and a distance measurement method for executing processing performed by the characteristic components of such an imaging device or a distance measurement device, or as a program for causing a computer to execute these methods. You can also do it. Needless to say, such a program can be distributed via a recording medium such as a CD-ROM or a transmission medium such as the Internet.
本発明に係る撮像装置及び測距装置は、微小な視差を高精度に算出するとともに、回路規模の増大を抑制した小型の撮像装置及び測距装置であるため、カメラ機能を備えた携帯型電話機、デジタルスチルカメラ、車載用カメラ、監視用カメラ、三次元計測器、及び立体画像入力カメラ等に有用である。 Since the imaging device and the distance measuring device according to the present invention are a small imaging device and a distance measuring device that calculate a minute parallax with high accuracy and suppress an increase in circuit scale, a mobile phone having a camera function It is useful for digital still cameras, in-vehicle cameras, surveillance cameras, three-dimensional measuring instruments, stereoscopic image input cameras, and the like.
101 測距装置
110 レンズモジュール部
111 鏡筒
112 カバーガラス
113 レンズアレイ
120 回路部
121 基板
122 パッケージ
123 撮像素子
124 パッケージカバーガラス
125 SLSI
127 金線
131 システム制御部
132 撮像素子駆動部
133 撮像信号入力部
134 入出力部
141 画像切出部
142 視差演算部
143 視差補正部
144 失敗検知部
145 距離演算部
202 撮像システム
203 撮像システム制御部
204 画像認識部
DESCRIPTION OF
127
Claims (8)
前記基準撮像系及び前記参照撮像系により生成された基準画像及び参照画像において、前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心に対応する位置である光軸位置をそれぞれ取得する光軸位置取得手段と、
前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心を互いに結ぶ直線の方向である基線方向のうち前記基準撮像系が有するレンズの光軸中心に近づく向きへ前記参照画像の光軸位置から所定画素数移動した位置と、前記基準画像の光軸位置とが、同一の座標値となるように前記基準画像及び前記参照画像の平面座標を設定する座標設定手段と、
前記座標設定手段により設定された座標に基づいて、前記基準画像の一部領域と前記参照画像の一部領域との画像の類似度合いを表す評価値を算出し、算出された評価値から仮視差を算出する仮視差演算手段と、
前記仮視差演算手段により算出された仮視差から前記所定画素数を減算することにより、前記基準撮像系と前記参照撮像系との間に生じる視差を算出する視差算出手段とを備える
撮像装置。 A standard imaging system and one or more reference imaging systems, each having a lens and an imaging area corresponding to the lens, are generated between the standard imaging system and the reference imaging system when imaging the same subject. An imaging device for calculating parallax,
In the standard image and the reference image generated by the standard imaging system and the reference imaging system, the optical axis position that is a position corresponding to the optical axis center of the lens respectively included in the standard imaging system and the reference imaging system is acquired. Optical axis position acquisition means for
The light of the reference image in a direction approaching the optical axis center of the lens of the reference imaging system among the base line directions that are directions of straight lines connecting the optical axis centers of the lenses of the standard imaging system and the reference imaging system. Coordinate setting means for setting the plane coordinates of the reference image and the reference image so that the position moved by a predetermined number of pixels from the axis position and the optical axis position of the reference image have the same coordinate value;
Based on the coordinates set by the coordinate setting means, an evaluation value representing the degree of similarity between the partial area of the reference image and the partial area of the reference image is calculated, and temporary disparity is calculated from the calculated evaluation value. Temporary parallax calculation means for calculating
An imaging apparatus comprising: a parallax calculating unit that calculates a parallax generated between the reference imaging system and the reference imaging system by subtracting the predetermined number of pixels from the temporary parallax calculated by the temporary parallax calculating unit.
前記基準画像の一部の領域である基準ブロックを選択する基準ブロック選択手段と、
前記基準ブロックを示す座標値と同一の座標値で示される前記参照画像の一部の領域から、前記基線方向のうち前記基準撮像系の有するレンズの光軸中心から遠ざかる方へ、所定のずらし量ごとにずらしていった領域を参照ブロックとして選択し、選択した参照ブロックごとに前記基準ブロックとの前記評価値を算出する評価値算出手段と、
算出された前記評価値のうち複数の評価値に基づく補間式を用いて、類似度合いが最大となるずらし量を前記仮視差として算出する仮視差算出手段とを有する
請求項1に記載の撮像装置。 The temporary parallax calculation means includes
A reference block selecting means for selecting a reference block which is a partial area of the reference image;
A predetermined shift amount from a partial area of the reference image indicated by the same coordinate value as the coordinate value indicating the reference block to a direction away from the optical axis center of the lens of the reference imaging system in the baseline direction An evaluation value calculating means for selecting an area shifted every time as a reference block, and calculating the evaluation value of the reference block for each selected reference block;
The imaging apparatus according to claim 1, further comprising: a temporary parallax calculation unit that calculates, as the temporary parallax, a shift amount that maximizes the degree of similarity using an interpolation formula based on a plurality of evaluation values among the calculated evaluation values. .
請求項2に記載の撮像装置。 The coordinate setting means includes a position moved by one pixel from the optical axis position of the reference image in a direction closer to the optical axis center of the lens of the reference imaging system in the baseline direction, and an optical axis position of the reference image. The imaging apparatus according to claim 2, wherein the planar coordinates are set so that the two have the same coordinate value.
請求項1に記載の撮像装置。 The imaging apparatus according to claim 1, wherein the reference image is an image that is larger by the predetermined number of pixels toward the direction closer to the optical axis center of the lens of the standard imaging system in the baseline direction than the reference image. .
前記視差算出手段により算出された視差が負数であるか否かを判定する視差判定手段と、
前記視差判定手段により負数であると判定された場合、視差演算が失敗したことを示す失敗情報を出力する失敗情報出力手段とを備える
請求項1に記載の撮像装置。 The imaging device further includes:
Parallax determination means for determining whether or not the parallax calculated by the parallax calculation means is a negative number;
The imaging apparatus according to claim 1, further comprising failure information output means for outputting failure information indicating that the parallax calculation has failed when the parallax determination means determines that the number is negative.
前記基準撮像系及び前記参照撮像系により生成された基準画像及び参照画像において、前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心に対応する位置である光軸位置をそれぞれ取得する光軸位置取得手段と、
前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心を互いに結ぶ直線の方向である基線方向のうち前記基準撮像系が有するレンズの光軸中心に近づく向きへ前記参照画像の光軸位置から所定画素数移動した位置と、前記基準画像の光軸位置とが、同一の座標値となるように前記基準画像及び前記参照画像の平面座標を設定する座標設定手段と、
前記座標設定手段により設定された座標に基づいて、前記基準画像の一部領域と前記参照画像の一部領域との画像の類似度合いを表す評価値を算出し、算出された評価値から仮視差を算出する仮視差演算手段と、
前記仮視差演算手段により算出された仮視差から前記所定画素数を減算することにより、前記基準撮像系と前記参照撮像系との間に生じる視差を算出する視差算出手段と、
前記視差算出手段により算出された視差を用いて、前記被写体までの距離を算出する距離算出手段とを備える
測距装置。 A standard imaging system and one or more reference imaging systems, each having a lens and an imaging area corresponding to the lens, are generated between the standard imaging system and the reference imaging system when imaging the same subject. A distance measuring device that calculates a distance to the subject based on parallax,
In the standard image and the reference image generated by the standard imaging system and the reference imaging system, the optical axis position that is a position corresponding to the optical axis center of the lens respectively included in the standard imaging system and the reference imaging system is acquired. Optical axis position acquisition means for
The light of the reference image in a direction approaching the optical axis center of the lens of the reference imaging system among the base line directions that are directions of straight lines connecting the optical axis centers of the lenses of the standard imaging system and the reference imaging system. Coordinate setting means for setting the plane coordinates of the reference image and the reference image so that the position moved by a predetermined number of pixels from the axis position and the optical axis position of the reference image have the same coordinate value;
Based on the coordinates set by the coordinate setting means, an evaluation value representing the degree of similarity between the partial area of the reference image and the partial area of the reference image is calculated, and temporary disparity is calculated from the calculated evaluation value. Temporary parallax calculation means for calculating
Parallax calculating means for calculating a parallax generated between the reference imaging system and the reference imaging system by subtracting the predetermined number of pixels from the temporary parallax calculated by the temporary parallax calculating means;
A distance measuring device comprising: distance calculating means for calculating a distance to the subject using the parallax calculated by the parallax calculating means.
前記基準撮像系及び前記参照撮像系により生成された基準画像及び参照画像において、前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心に対応する位置である光軸位置をそれぞれ取得する光軸位置取得ステップと、
前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心を互いに結ぶ直線の方向である基線方向のうち前記基準撮像系が有するレンズの光軸中心に近づく向きへ前記参照画像の光軸位置から所定画素数移動した位置と、前記基準画像の光軸位置とが、同一の座標値となるように前記基準画像及び前記参照画像の平面座標を設定する座標設定ステップと、
前記座標設定ステップにおいて設定された座標に基づいて、前記基準画像の一部領域と前記参照画像の一部領域との画像の類似度合いを表す評価値を算出し、算出された評価値から仮視差を算出する仮視差演算ステップと、
前記仮視差演算ステップにおいて算出された仮視差から前記所定画素数を減算することにより、前記基準撮像系と前記参照撮像系との間に生じる視差を算出する視差算出ステップとを含む
視差算出方法。 When the same subject is imaged in an imaging device having a lens and an imaging region corresponding to the lens and including a standard imaging system and one or more reference imaging systems, the standard imaging system and the reference imaging system A parallax calculation method for calculating a parallax that occurs in between,
In the standard image and the reference image generated by the standard imaging system and the reference imaging system, the optical axis position that is a position corresponding to the optical axis center of the lens respectively included in the standard imaging system and the reference imaging system is acquired. An optical axis position acquisition step to perform,
The light of the reference image in a direction approaching the optical axis center of the lens of the reference imaging system among the base line directions that are directions of straight lines connecting the optical axis centers of the lenses of the standard imaging system and the reference imaging system. A coordinate setting step of setting the plane coordinates of the reference image and the reference image so that the position moved by a predetermined number of pixels from the axis position and the optical axis position of the reference image have the same coordinate value;
Based on the coordinates set in the coordinate setting step, an evaluation value representing the degree of similarity between the partial area of the reference image and the partial area of the reference image is calculated, and temporary parallax is calculated from the calculated evaluation value. A temporary parallax calculation step for calculating
A parallax calculation method including a parallax calculation step of calculating a parallax generated between the reference imaging system and the reference imaging system by subtracting the predetermined number of pixels from the temporary parallax calculated in the temporary parallax calculation step.
前記基準撮像系及び前記参照撮像系により生成された基準画像及び参照画像において、前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心に対応する位置である光軸位置をそれぞれ取得する光軸位置取得ステップと、
前記基準撮像系及び前記参照撮像系がそれぞれ有する前記レンズの光軸中心を互いに結ぶ直線の方向である基線方向のうち前記基準撮像系が有するレンズの光軸中心に近づく向きへ前記参照画像の光軸位置から所定画素数移動した位置と、前記基準画像の光軸位置とが、同一の座標値となるように前記基準画像及び前記参照画像の平面座標を設定する座標設定ステップと、
前記座標設定ステップにおいて設定された座標に基づいて、前記基準画像の一部領域と前記参照画像の一部領域との画像の類似度合いを表す評価値を算出し、算出された評価値から仮視差を算出する仮視差演算ステップと、
前記仮視差演算ステップにおいて算出された仮視差から前記所定画素数を減算することにより、前記基準撮像系と前記参照撮像系との間に生じる視差を算出する視差算出ステップとをコンピュータに実行させる
プログラム。 When the same subject is imaged in an imaging device having a lens and an imaging region corresponding to the lens, the imaging device including a standard imaging system and one or more reference imaging systems, the standard imaging system and the reference imaging system A program for calculating parallax between
In the standard image and the reference image generated by the standard imaging system and the reference imaging system, the optical axis position that is a position corresponding to the optical axis center of the lens respectively included in the standard imaging system and the reference imaging system is acquired. An optical axis position acquisition step to perform,
The light of the reference image in a direction approaching the optical axis center of the lens of the reference imaging system among the base line directions that are directions of straight lines connecting the optical axis centers of the lenses of the standard imaging system and the reference imaging system. A coordinate setting step for setting the plane coordinates of the reference image and the reference image so that the position moved by a predetermined number of pixels from the axis position and the optical axis position of the reference image have the same coordinate value;
Based on the coordinates set in the coordinate setting step, an evaluation value representing the degree of similarity between the partial area of the reference image and the partial area of the reference image is calculated, and temporary parallax is calculated from the calculated evaluation value. A temporary parallax calculation step for calculating
A program for causing a computer to execute a parallax calculation step of calculating a parallax generated between the reference imaging system and the reference imaging system by subtracting the predetermined number of pixels from the temporary parallax calculated in the temporary parallax calculation step .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008160941A JP2010002280A (en) | 2008-06-19 | 2008-06-19 | Imaging device, distance measuring device, and parallax calculating method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008160941A JP2010002280A (en) | 2008-06-19 | 2008-06-19 | Imaging device, distance measuring device, and parallax calculating method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010002280A true JP2010002280A (en) | 2010-01-07 |
Family
ID=41584131
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008160941A Pending JP2010002280A (en) | 2008-06-19 | 2008-06-19 | Imaging device, distance measuring device, and parallax calculating method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010002280A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017067636A (en) * | 2015-09-30 | 2017-04-06 | キヤノン株式会社 | Imaging apparatus |
JP2018200722A (en) * | 2018-08-29 | 2018-12-20 | キヤノン株式会社 | Image processing apparatus and control method therefor, program, and recording medium |
CN112447537A (en) * | 2019-09-03 | 2021-03-05 | 德律科技股份有限公司 | Detection system and detection method |
WO2022163216A1 (en) * | 2021-01-27 | 2022-08-04 | ソニーグループ株式会社 | Moving body, information processing method, and program |
-
2008
- 2008-06-19 JP JP2008160941A patent/JP2010002280A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017067636A (en) * | 2015-09-30 | 2017-04-06 | キヤノン株式会社 | Imaging apparatus |
JP2018200722A (en) * | 2018-08-29 | 2018-12-20 | キヤノン株式会社 | Image processing apparatus and control method therefor, program, and recording medium |
CN112447537A (en) * | 2019-09-03 | 2021-03-05 | 德律科技股份有限公司 | Detection system and detection method |
CN112447537B (en) * | 2019-09-03 | 2024-04-12 | 德律科技股份有限公司 | Detection system and detection method |
WO2022163216A1 (en) * | 2021-01-27 | 2022-08-04 | ソニーグループ株式会社 | Moving body, information processing method, and program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4510930B2 (en) | Imaging device and semiconductor circuit element | |
US11652975B2 (en) | Field calibration of stereo cameras with a projector | |
JP4264464B2 (en) | Imaging device and semiconductor circuit element | |
US8405820B2 (en) | Ranging device and ranging module and image-capturing device using the ranging device or the ranging module | |
JP6427900B2 (en) | Calibration method, calibration system, program, and moving object | |
US9880055B2 (en) | Spectroscopic imaging apparatus and spectroscopic imaging method | |
US8212912B2 (en) | Imaging device, imaging system, and imaging method | |
KR102382871B1 (en) | Electronic Device for controlling lens focus and the controlling Method thereof | |
US20140118516A1 (en) | Solid state imaging module, solid state imaging device, and information processing device | |
KR20200100498A (en) | An electronic device and method of controlling auto focusing thereof | |
WO2012147495A1 (en) | Information acquisition device and object detection device | |
US12069394B2 (en) | Depth map determination method and electronic device to which same method is applied | |
KR20180076307A (en) | Method for Calibrating Driving Amount of Actuator Configured to Correct Blurring of Image Taken by Camera | |
JP2010002280A (en) | Imaging device, distance measuring device, and parallax calculating method | |
KR20210071253A (en) | Camera movement controlling method and apparatus | |
JP2019074535A (en) | Calibration method, calibration device and program | |
JP5857712B2 (en) | Stereo image generation apparatus, stereo image generation method, and computer program for stereo image generation | |
JP2011147079A (en) | Image pickup device | |
JP6628678B2 (en) | Distance measuring device, imaging device, and distance measuring method | |
JP7275941B2 (en) | 3D information acquisition device and 3D information acquisition method | |
KR102606835B1 (en) | Electronic device for generating depth map and method thereof | |
JP6680335B2 (en) | Stereo camera, vehicle, calculation method and program | |
KR102551261B1 (en) | Method for generating depth information by using structured light pattern projected to external object and Electronic device using the same | |
JP2020165968A (en) | Calibration method, calibration device, and program | |
KR20200036264A (en) | Method and electronic device for auto focusing |