JP2013127416A - Range finder, range finding system, range finding program and parallax correction method - Google Patents

Range finder, range finding system, range finding program and parallax correction method Download PDF

Info

Publication number
JP2013127416A
JP2013127416A JP2011277294A JP2011277294A JP2013127416A JP 2013127416 A JP2013127416 A JP 2013127416A JP 2011277294 A JP2011277294 A JP 2011277294A JP 2011277294 A JP2011277294 A JP 2011277294A JP 2013127416 A JP2013127416 A JP 2013127416A
Authority
JP
Japan
Prior art keywords
image
parallax
imaging system
temperature
correction value
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.)
Granted
Application number
JP2011277294A
Other languages
Japanese (ja)
Other versions
JP6060482B2 (en
Inventor
Sadao Takahashi
禎郎 高橋
Takeshi Maruyama
剛 丸山
Masahiro Fujimoto
真裕 藤本
Jun Watabe
順 渡部
Shigeru Ouchida
茂 大内田
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2011277294A priority Critical patent/JP6060482B2/en
Publication of JP2013127416A publication Critical patent/JP2013127416A/en
Application granted granted Critical
Publication of JP6060482B2 publication Critical patent/JP6060482B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Measurement Of Optical Distance (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a range finder, a range finding system, a range finding program and a parallax correction method for highly accurately correcting a parallax calculated from a first image and a second image according to a temperature when imaging the first image and the second image to exactly measure a distance.SOLUTION: The range finder includes: a parallax arithmetic section 204 for calculating the parallax on the basis of the first image and the second image; a temperature difference calculation section 205 for calculating a temperature difference to be a difference between the temperature when imaging the first image and the second image and a reference temperature; a parallax correction section 206 for calculating a first correction value for correcting an error component by expansion and contraction of a base line length and a second correction value for correcting an error component by a change of a magnification of the first image and the second image on the basis of the temperature difference and correcting the parallax calculated by the parallax arithmetic section 204 on the basis of the first correction value and the second correction value to calculate a corrected parallax; and a distance calculation section 207 for calculating a distance up to a subject on the basis of the corrected parallax, the base line length without expansion and contraction and a focal distance.

Description

本発明は、測距装置、測距システム、測距プログラムおよび視差補正方法に関する。   The present invention relates to a distance measuring device, a distance measuring system, a distance measuring program, and a parallax correction method.

ステレオカメラを利用した測距システムは、近年、様々な分野で広く利用されている。例えば、ステレオカメラを利用した測距システムを搭載した自動車、家電、デジタルカメラなどが実用化されている。   In recent years, ranging systems using stereo cameras have been widely used in various fields. For example, automobiles, home appliances, digital cameras, and the like equipped with a ranging system using a stereo camera have been put into practical use.

ステレオカメラは、第1レンズおよび第1撮像素子を含む第1撮像系と、第2レンズおよび第2撮像素子を含む第2撮像系とを備える。第1撮像系と第2撮像系とは、焦点距離が等しく、光軸が互いに平行である。第1撮像系と第2撮像系の光軸間の距離は、基線長と呼ばれる。   The stereo camera includes a first imaging system including a first lens and a first imaging element, and a second imaging system including a second lens and a second imaging element. The first imaging system and the second imaging system have the same focal length and the optical axes are parallel to each other. The distance between the optical axes of the first imaging system and the second imaging system is called the baseline length.

ステレオカメラを利用した測距システムでは、第1撮像系により撮像された被写体の第1画像と、第2撮像系により撮像された被写体の第2画像とに基づき、被写体までの距離を計測する。具体的には、第1画像と第2画像から、第1撮像素子における被写体の像の位置と第2撮像素子における被写体の像の位置との差分である視差を求める。そして、求めた視差と、上記の基線長と、第1撮像系および第2撮像系の焦点距離とに基づいて、三角測量の原理により被写体までの距離を計測する。   In the distance measuring system using a stereo camera, the distance to the subject is measured based on the first image of the subject imaged by the first imaging system and the second image of the subject imaged by the second imaging system. Specifically, a parallax that is a difference between the position of the subject image on the first image sensor and the position of the subject image on the second image sensor is obtained from the first image and the second image. Then, based on the obtained parallax, the above-described baseline length, and the focal lengths of the first imaging system and the second imaging system, the distance to the subject is measured by the principle of triangulation.

また、ステレオカメラのカメラモジュールとして、第1レンズおよび第2レンズを同一面上に一体形成したレンズアレイを備えるステレオカメラモジュールも提案されている。このレンズアレイを備えるステレオカメラモジュールは、小型化が容易で、様々な機器に搭載可能という利点を持つ一方、温度変化の影響を受けやすいという欠点がある。特にレンズアレイが樹脂により構成されている場合、温度変化によってレンズアレイが伸縮し、計測される距離に誤差が生じる。   As a camera module for a stereo camera, a stereo camera module including a lens array in which a first lens and a second lens are integrally formed on the same surface has been proposed. A stereo camera module provided with this lens array has the advantage that it can be easily miniaturized and can be mounted on various devices, while it is susceptible to temperature changes. In particular, when the lens array is made of resin, the lens array expands and contracts due to a temperature change, and an error occurs in the measured distance.

このような問題に対し、温度センサをステレオカメラモジュールに搭載して環境温度を検出し、検出した環境温度に応じて補正を行う技術が提案されている。例えば、特許文献1には、撮像素子が実装された基板に温度センサを装着して基板の温度を検出し、検出した温度に基づいて、温度変化に伴う基線長の変化分だけ視差を補正する技術が開示されている。   In order to solve such a problem, a technique has been proposed in which a temperature sensor is mounted on a stereo camera module to detect an environmental temperature, and correction is performed according to the detected environmental temperature. For example, in Patent Document 1, a temperature sensor is mounted on a substrate on which an image sensor is mounted, and the temperature of the substrate is detected. Based on the detected temperature, the parallax is corrected by the change in the baseline length associated with the temperature change. Technology is disclosed.

また、特許文献2には、レンズアレイに温度センサを装着してレンズアレイの温度を検出し、検出した温度に基づいて基線長を補正し、補正後の基線長を用いて距離を算出する技術が開示されている。   Japanese Patent Application Laid-Open No. 2004-228561 discloses a technique for detecting a temperature of a lens array by attaching a temperature sensor to the lens array, correcting a base line length based on the detected temperature, and calculating a distance using the corrected base line length. Is disclosed.

しかし、上記の従来技術は、温度変化に応じた基線長の変化分のみを補正する技術であるため、補正が不十分であるという問題があった。すなわち、温度変化によりステレオカメラモジュールを構成する部材が伸縮すると、基線長だけでなく、レンズと撮像素子間の距離(バックフォーカス)や、レンズアレイの材質に応じた屈折率にも変化が生じ、これら基線長の変化以外の要因によっても画像が変化する。しかし、従来技術では基線長の変化分のみを補正するため、高精度な補正を行うことができない。   However, the above-described conventional technique is a technique for correcting only the change in the baseline length according to the temperature change, and thus has a problem that the correction is insufficient. That is, when the members constituting the stereo camera module expand and contract due to temperature changes, not only the base line length but also the distance between the lens and the image sensor (back focus) and the refractive index according to the material of the lens array change, The image changes due to factors other than the change in the baseline length. However, since the conventional technique corrects only the change in the baseline length, it cannot perform highly accurate correction.

本発明は、上記に鑑みてなされたものであって、第1画像および第2画像の撮像時の温度に応じて、第1画像および第2画像から算出される視差を高精度に補正して、正確な距離の計測を行うことができる測距装置、測距システム、測距プログラムおよび視差正方法を提供することを目的とする。   The present invention has been made in view of the above, and corrects the parallax calculated from the first image and the second image with high accuracy according to the temperature at the time of capturing the first image and the second image. An object of the present invention is to provide a distance measuring device, a distance measuring system, a distance measuring program, and a parallax correction method capable of accurately measuring a distance.

上述した課題を解決し、目的を達成するために、本発明に係る測距装置は、第1レンズを含む第1撮像系と、前記第1レンズと一体成形された第2レンズを含む第2撮像系と、を備えるステレオカメラモジュールから、前記第1撮像系により撮像された被写体の第1画像と前記第2撮像系により撮像された前記被写体の第2画像とを入力する入力手段と、前記第1画像と前記第2画像とに基づいて、前記第1画像における前記被写体の位置と前記第2画像における前記被写体の位置との差分である視差を算出する視差算出手段と、前記第1画像および前記第2画像の撮像時の温度と基準温度との差分である温度差を算出する温度差算出手段と、前記温度差に基づいて、前記第1撮像系と前記第2撮像系との光軸間の距離である基線長の伸縮による誤差成分を補正するための第1補正値と、前記第1画像および前記第2画像の倍率の変化による誤差成分を補正するための第2補正値とを算出し、前記視差を、前記第1補正値と前記第2補正値とに基づいて補正して、補正視差を算出する視差補正手段と、前記補正視差と、伸縮のない前記基線長と、前記第1撮像系および前記第2撮像系の焦点距離とに基づいて、前記被写体までの距離を算出する距離算出手段と、を備えることを特徴とする。   In order to solve the above-described problems and achieve the object, a distance measuring apparatus according to the present invention includes a first imaging system including a first lens, and a second lens including a second lens integrally formed with the first lens. Input means for inputting a first image of the subject imaged by the first imaging system and a second image of the subject imaged by the second imaging system from a stereo camera module comprising an imaging system; Disparity calculating means for calculating a disparity that is a difference between the position of the subject in the first image and the position of the subject in the second image based on the first image and the second image; and the first image And a temperature difference calculating means for calculating a temperature difference that is a difference between a temperature at the time of capturing the second image and a reference temperature, and light from the first imaging system and the second imaging system based on the temperature difference. For expansion and contraction of the baseline length, which is the distance between axes A first correction value for correcting the error component and a second correction value for correcting an error component due to a change in magnification of the first image and the second image, and calculating the parallax A parallax correction unit that corrects based on the first correction value and the second correction value to calculate a corrected parallax; the corrected parallax; the baseline length without expansion and contraction; the first imaging system and the second imaging Distance calculating means for calculating the distance to the subject based on the focal length of the system.

また、本発明に係る測距システムは、第1レンズを含み、被写体の第1画像を撮像する第1撮像系と、前記第1レンズと一体成形された第2レンズを含み、前記被写体の第2画像を撮像する第2撮像系と、前記第1画像と前記第2画像とに基づいて、前記第1画像における前記被写体の位置と前記第2画像における前記被写体の位置との差分である視差を算出する視差算出手段と、前記第1画像および前記第2画像の撮像時の温度と基準温度との差分である温度差を算出する温度差算出手段と、前記温度差に基づいて、前記第1撮像系と前記第2撮像系との光軸間の距離である基線長の伸縮による誤差成分を補正するための第1補正値と、前記第1画像および前記第2画像の倍率の変化による誤差成分を補正するための第2補正値とを算出し、前記視差を、前記第1補正値と前記第2補正値とに基づいて補正して、補正視差を算出する視差補正手段と、前記補正視差と、伸縮のない前記基線長と、前記第1撮像系および前記第2撮像系の焦点距離とに基づいて、前記被写体までの距離を算出する距離算出手段と、を備えることを特徴とする。   The distance measuring system according to the present invention includes a first lens, includes a first imaging system that captures a first image of the subject, and a second lens integrally formed with the first lens. A parallax that is a difference between the position of the subject in the first image and the position of the subject in the second image based on the second imaging system that captures two images, and the first image and the second image Based on the temperature difference, a parallax calculating unit that calculates a temperature difference, a temperature difference calculating unit that calculates a temperature difference that is a difference between a temperature at the time of capturing the first image and the second image, and a reference temperature. A first correction value for correcting an error component due to expansion / contraction of a base line length, which is a distance between optical axes of one imaging system and the second imaging system, and a change in magnification of the first image and the second image. And a second correction value for correcting the error component A parallax correcting unit that corrects the parallax based on the first correction value and the second correction value to calculate a corrected parallax, the corrected parallax, the baseline length without expansion and contraction, and the first imaging And a distance calculating means for calculating a distance to the subject based on a focal length of the system and the second imaging system.

また、本発明に係る測距プログラムは、第1レンズを含む第1撮像系と、前記第1レンズと一体成形された第2レンズを含む第2撮像系と、を備えるステレオカメラモジュールから、前記第1撮像系により撮像された被写体の第1画像と前記第2撮像系により撮像された前記被写体の第2画像とを入力する機能と、前記第1画像と前記第2画像とに基づいて、前記第1画像における前記被写体の位置と前記第2画像における前記被写体の位置との差分である視差を算出する機能と、前記第1画像および前記第2画像の撮像時の温度と基準温度との差分である温度差を算出する機能と、前記温度差に基づいて、前記第1撮像系と前記第2撮像系との光軸間の距離である基線長の伸縮による誤差成分を補正するための第1補正値と、前記第1画像および前記第2画像の倍率の変化による誤差成分を補正するための第2補正値とを算出し、前記視差を、前記第1補正値と前記第2補正値とに基づいて補正して、補正視差を算出する機能と、前記補正視差と、伸縮のない前記基線長と、前記第1撮像系および前記第2撮像系の焦点距離とに基づいて、前記被写体までの距離を算出する機能と、をコンピュータに実現させる。   A ranging program according to the present invention includes a stereo camera module including a first imaging system including a first lens and a second imaging system including a second lens integrally formed with the first lens. Based on the function of inputting the first image of the subject imaged by the first imaging system and the second image of the subject imaged by the second imaging system, and the first image and the second image, A function of calculating a parallax that is a difference between the position of the subject in the first image and the position of the subject in the second image, and a temperature and a reference temperature at the time of capturing the first image and the second image A function for calculating a temperature difference that is a difference, and an error component due to expansion and contraction of a base line length that is a distance between optical axes of the first imaging system and the second imaging system, based on the temperature difference. A first correction value and the first image; And a second correction value for correcting an error component due to a change in magnification of the second image, and correcting the parallax based on the first correction value and the second correction value. A function of calculating parallax, a function of calculating a distance to the subject based on the corrected parallax, the baseline length without expansion and contraction, and focal lengths of the first imaging system and the second imaging system; Is realized on a computer.

また、本発明に係る視差補正方法は、第1レンズを含む第1撮像系と、前記第1レンズと一体成形された第2レンズを含む第2撮像系と、を備えるステレオカメラモジュールから、前記第1撮像系により撮像された被写体の第1画像と前記第2撮像系により撮像された前記被写体の第2画像とを入力し、前記第1画像における前記被写体の位置と前記第2画像における前記被写体の位置との差分である視差を算出する装置において実行される視差補正方法であって、前記第1画像および前記第2画像の撮像時の温度と基準温度との差分である温度差を算出するステップと、前記温度差に基づいて、前記第1撮像系と前記第2撮像系との光軸間の距離である基線長の伸縮による誤差成分を補正するための第1補正値を算出するステップと、前記温度差に基づいて、前記第1画像および前記第2画像の倍率の変化による誤差成分を補正するための第2補正値を算出するステップと、前記第1補正値と前記第2補正値とに基づいて、前記視差を補正するステップと、を含むことを特徴とする。   The parallax correction method according to the present invention includes a stereo camera module including a first imaging system including a first lens, and a second imaging system including a second lens integrally formed with the first lens. A first image of a subject imaged by the first imaging system and a second image of the subject imaged by the second imaging system are input, and the position of the subject in the first image and the second image in the second image are input. A parallax correction method executed in an apparatus that calculates parallax that is a difference from a position of a subject, and calculates a temperature difference that is a difference between a temperature at the time of capturing the first image and the second image and a reference temperature And a first correction value for correcting an error component due to expansion / contraction of a base line length, which is a distance between the optical axes of the first imaging system and the second imaging system, is calculated based on the temperature difference. Step and said Calculating a second correction value for correcting an error component due to a change in magnification of the first image and the second image based on the degree difference; and the first correction value and the second correction value. And the step of correcting the parallax.

本発明によれば、第1画像および第2画像の撮像時の温度に応じて、第1画像および第2画像から算出される視差を高精度に補正して、正確な距離の計測を行うことができるという効果を奏する。   According to the present invention, accurate distance measurement is performed by correcting the parallax calculated from the first image and the second image with high accuracy according to the temperature at the time of capturing the first image and the second image. There is an effect that can be.

図1は、ステレオカメラモジュールの一構成例を示す図である。FIG. 1 is a diagram illustrating a configuration example of a stereo camera module. 図2は、図1に示した構成のステレオカメラモジュールをモデル化した図である。FIG. 2 is a diagram in which the stereo camera module having the configuration shown in FIG. 1 is modeled. 図3は、ある基準温度からΔtだけ温度上昇したときのステレオカメラモジュールをモデル化した図である。FIG. 3 is a diagram modeling the stereo camera module when the temperature rises by Δt from a certain reference temperature. 図4は、測距装置の機能的な構成を示すブロック図である。FIG. 4 is a block diagram showing a functional configuration of the distance measuring apparatus. 図5は、視差補正部の演算回路の一構成を示す図である。FIG. 5 is a diagram illustrating a configuration of the arithmetic circuit of the parallax correction unit. 図6は、視差補正部の演算回路の他の構成を示す図である。FIG. 6 is a diagram illustrating another configuration of the arithmetic circuit of the parallax correction unit. 図7は、第1画像および第2画像から算出される視差と環境温度との関係を示す図である。FIG. 7 is a diagram illustrating a relationship between the parallax calculated from the first image and the second image and the environmental temperature. 図8は、レンズアレイを直接測定した温度と温度センサにより測定した基板の温度との関係を示す図である。FIG. 8 is a diagram showing the relationship between the temperature directly measured by the lens array and the temperature of the substrate measured by the temperature sensor.

以下に添付図面を参照して、この発明に係る測距装置、測距システム、測距プログラムおよび視差補正方法の実施の形態を詳細に説明する。   Hereinafter, embodiments of a distance measuring device, a distance measuring system, a distance measuring program, and a parallax correction method according to the present invention will be described in detail with reference to the accompanying drawings.

測距システムは、ステレオカメラモジュールと、測距装置と、を備える。測距装置は、ステレオカメラモジュールの2つの撮像系(第1撮像系および第2撮像系)により撮像された被写体の画像(第1画像および第2画像)に基づいて、ステレオカメラモジュールから被写体までの距離を計測する。測距装置は、ステレオカメラモジュールと一体に構成(ステレオカメラモジュールに内蔵)されていてもよいし、ステレオカメラモジュールから分離した外部装置として構成され、ステレオカメラモジュールに対して第1画像および第2画像を入力可能に接続されてもよい。以下では、測距装置をステレオカメラモジュールから分離した外部装置として構成した例について説明する。   The distance measuring system includes a stereo camera module and a distance measuring device. The distance measuring device is based on the images of the subject (first image and second image) captured by the two imaging systems (first imaging system and second imaging system) of the stereo camera module, from the stereo camera module to the subject. Measure the distance. The distance measuring device may be configured integrally with the stereo camera module (built in the stereo camera module), or may be configured as an external device separated from the stereo camera module, and the first image and the second image with respect to the stereo camera module. You may connect so that an image can be input. Hereinafter, an example in which the distance measuring device is configured as an external device separated from the stereo camera module will be described.

(ステレオカメラモジュール)
まず、図1を参照してステレオカメラモジュールの構成について説明する。図1は、本実施形態に係るステレオカメラモジュール100の一構成例を示す図であり、図1(a)は、ステレオカメラモジュール100を正面側から見た正面図、図1(b)は図1(a)のX−X線断面図、図1(c)は、ステレオカメラモジュール100を裏面側から見た裏面図である。
(Stereo camera module)
First, the configuration of the stereo camera module will be described with reference to FIG. FIG. 1 is a diagram illustrating a configuration example of a stereo camera module 100 according to the present embodiment. FIG. 1A is a front view of the stereo camera module 100 viewed from the front side, and FIG. XX sectional drawing of 1 (a) and FIG.1 (c) are the back views which looked at the stereo camera module 100 from the back surface side.

ステレオカメラモジュール100は、鏡枠101により保持されたレンズアレイ110および基板120を備える。   The stereo camera module 100 includes a lens array 110 and a substrate 120 held by a lens frame 101.

鏡枠101は、例えば、樹脂またはステンレススチール(SUS)を矩形の筒状に成形して作製される部品であり、ステレオカメラモジュール100の側壁部を構成する。鏡枠101の内面には、突起102が立設されている。レンズアレイ110は、この突起102上に支持されている。また、基板120は、鏡枠101の端部に接合され、ステレオカメラモジュール100の裏面を構成している。   The lens frame 101 is, for example, a part produced by molding resin or stainless steel (SUS) into a rectangular cylindrical shape, and constitutes a side wall portion of the stereo camera module 100. A protrusion 102 is erected on the inner surface of the lens frame 101. The lens array 110 is supported on the protrusions 102. The substrate 120 is bonded to the end of the lens frame 101 and constitutes the back surface of the stereo camera module 100.

レンズアレイ110は、第1レンズ111および第2レンズ112を一体成形した光学部品である。第1レンズ111は、後述する第1撮像素子の撮像面に被写体の像を結像させる機能を持つ。第2レンズ112は、後述する第2撮像素子の撮像面に被写体の像を結像させる機能を持つ。レンズアレイ110は、例えば、透明樹脂材を成形して作製される。レンズアレイ110を構成する透明樹脂材としては、例えば、ZEONEX E48R(製品名、日本ゼオン株式会社製、ZEONEXは日本ゼオン株式会社の登録商標)などが好適である。   The lens array 110 is an optical component in which the first lens 111 and the second lens 112 are integrally molded. The first lens 111 has a function of forming an image of a subject on an imaging surface of a first imaging element described later. The second lens 112 has a function of forming an image of a subject on an imaging surface of a second imaging element described later. The lens array 110 is produced by molding a transparent resin material, for example. As the transparent resin material constituting the lens array 110, for example, ZEONEX E48R (product name, manufactured by Nippon Zeon Co., Ltd., ZEONEX is a registered trademark of Nippon Zeon Co., Ltd.) is suitable.

基板120のレンズアレイ110と対向する一方の主面部には、例えばCMOSイメージセンサとして構成された第1撮像素子121および第2撮像素子122が実装されている。第1撮像素子121は、その撮像面の中心が第1レンズ111の光軸中心と一致するように、基板120上の位置が定められている。また、第2撮像素子122は、その撮像面の中心が第2レンズ112の光軸中心と一致するように、基板120上の位置が定められている。   A first image sensor 121 and a second image sensor 122 configured as, for example, CMOS image sensors are mounted on one main surface portion of the substrate 120 facing the lens array 110. The position of the first imaging element 121 on the substrate 120 is determined so that the center of the imaging surface coincides with the optical axis center of the first lens 111. Further, the position of the second imaging element 122 on the substrate 120 is determined so that the center of the imaging surface thereof coincides with the optical axis center of the second lens 112.

第1撮像素子121および第2撮像素子122は、例えば、同一のシリコンウエハ上に形成されて一体に切り出された構成である。この構成により、レンズアレイ110として構成された第1レンズ111および第2レンズに対する第1撮像素子121および第2撮像素子122の位置合わせが容易となる。なお、第1撮像素子121と第2撮像素子122とを独立して形成して基板120に実装することも可能である。   For example, the first image sensor 121 and the second image sensor 122 are formed on the same silicon wafer and cut out integrally. With this configuration, the first image sensor 121 and the second image sensor 122 can be easily aligned with the first lens 111 and the second lens configured as the lens array 110. Note that the first image sensor 121 and the second image sensor 122 can be formed independently and mounted on the substrate 120.

第1レンズ111と第1撮像素子121は、被写体の第1画像を撮像する第1撮像系を構成する。また、第2レンズ112と第2撮像素子122は、被写体の第2画像を撮像する第2撮像系を構成する。第1撮像系と第2撮像系とは、焦点距離が等しく、光軸が互いに平行である。第1撮像系と第2撮像系の光軸間の距離は、基線長と呼ばれる。   The first lens 111 and the first imaging element 121 constitute a first imaging system that captures a first image of the subject. Further, the second lens 112 and the second imaging element 122 constitute a second imaging system that captures a second image of the subject. The first imaging system and the second imaging system have the same focal length and the optical axes are parallel to each other. The distance between the optical axes of the first imaging system and the second imaging system is called the baseline length.

レンズアレイ110の前方(被写体側)には、アパーチャアレイ130が配置されている。アパーチャアレイ130は、鏡枠101の内周に嵌合する矩形の板材として構成される。アパーチャアレイ130には、第1撮像系の光軸上で開口する第1アパーチャ131と、第2撮像系の光軸上で開口する第2アパーチャ132とが設けられている。第1アパーチャ131は第1撮像系に入射する光量を制限する絞りの機能を持ち、第2アパーチャ132は、第2撮像系に入射する光量を制限する絞りの機能を持つ。   An aperture array 130 is disposed in front of the lens array 110 (subject side). The aperture array 130 is configured as a rectangular plate that fits on the inner periphery of the lens frame 101. The aperture array 130 includes a first aperture 131 that opens on the optical axis of the first imaging system, and a second aperture 132 that opens on the optical axis of the second imaging system. The first aperture 131 has a diaphragm function for limiting the amount of light incident on the first imaging system, and the second aperture 132 has a function of a diaphragm for limiting the amount of light incident on the second imaging system.

第1撮像系と第2撮像系との間には、第1アパーチャ131を介して入射した光が第2撮像系に干渉するのを防止するとともに、第2アパーチャ132を介して入射した光が第1撮像系に干渉するのを防止するための遮光壁103が設けられている。なお、第1撮像素子131と第2撮像素子132との間の距離や、第1撮像系および第2撮像系の画角によっては、第1撮像系と第2撮像系とで光の干渉が生じない構成とすることもできる。この場合には、遮光壁103は不要となる。   Between the first imaging system and the second imaging system, the light incident through the first aperture 131 is prevented from interfering with the second imaging system, and the light incident through the second aperture 132 is A light shielding wall 103 for preventing interference with the first imaging system is provided. Depending on the distance between the first image pickup device 131 and the second image pickup device 132 and the angle of view of the first image pickup system and the second image pickup system, light interference may occur between the first image pickup system and the second image pickup system. It can also be set as the structure which does not arise. In this case, the light shielding wall 103 is not necessary.

基板120の裏面側(第1撮像素子121および第2撮像素子122の実装面とは逆側の面)には、基板120の温度が変化すると抵抗値が変化するサーミスタ141が取り付けられている。サーミスタ141は、該サーミスタ141の抵抗値の変化を、基板120の温度変化を表すデジタル値として出力する温度センサ回路142に接続されている。ステレオカメラモジュール100では、これらサーミスタ141および温度センサ回路142により、基板120の温度を測定できるようになっている。以下では、サーミスタ141と温度センサ回路142との組み合わせを、温度センサ140と表記する。   A thermistor 141 whose resistance value changes as the temperature of the substrate 120 changes is attached to the back side of the substrate 120 (the surface opposite to the mounting surface of the first image sensor 121 and the second image sensor 122). The thermistor 141 is connected to a temperature sensor circuit 142 that outputs a change in resistance value of the thermistor 141 as a digital value representing a temperature change of the substrate 120. In the stereo camera module 100, the temperature of the substrate 120 can be measured by the thermistor 141 and the temperature sensor circuit 142. Hereinafter, a combination of the thermistor 141 and the temperature sensor circuit 142 is referred to as a temperature sensor 140.

また、基板120の裏面側には、記憶部150が設けられている。記憶部150には、ステレオカメラモジュール100の各種パラメータが記憶されている。具体的には、例えば、第1撮像系と第2撮像系との間の光軸間の距離である基線長(環境温度が基準温度のときの伸縮のない基線長)、第1撮像系および第2撮像系の焦点距離(環境温度が基準温度のときの焦点距離)、オフセット値、歪み補正のためのカメラキャリブレーションパラメータ、キャリブレーション時における温度センサ140の出力値(基準温度)などが、記憶部150に記憶されている。   A storage unit 150 is provided on the back side of the substrate 120. The storage unit 150 stores various parameters of the stereo camera module 100. Specifically, for example, a baseline length that is the distance between the optical axes between the first imaging system and the second imaging system (baseline length without expansion and contraction when the environmental temperature is the reference temperature), the first imaging system, and The focal length of the second imaging system (focal length when the ambient temperature is the reference temperature), the offset value, the camera calibration parameter for distortion correction, the output value (reference temperature) of the temperature sensor 140 at the time of calibration, etc. Stored in the storage unit 150.

また、基板120の裏面側には、FPC(フレキシブル配線基板)160を介してステレオカメラモジュール100に接続された測距装置との間の信号伝送を司るインタフェース回路170が設けられている。このインタフェース回路170によりFPC160を介して測距装置との間で伝送される信号は、第1撮像系により撮像された第1画像の画像信号、第2撮像系により撮像された第2画像の画像信号、カメラ制御信号、温度センサ140の出力信号、記憶部150に記憶された上記の各種パラメータなどである。   Further, on the back side of the substrate 120, an interface circuit 170 that manages signal transmission with a distance measuring device connected to the stereo camera module 100 via an FPC (flexible wiring substrate) 160 is provided. Signals transmitted from the interface circuit 170 to the distance measuring device via the FPC 160 are an image signal of the first image captured by the first imaging system and an image of the second image captured by the second imaging system. A signal, a camera control signal, an output signal of the temperature sensor 140, and various parameters described above stored in the storage unit 150.

(ステレオ測距の原理と温度変化による影響)
次に、図2および図3を参照して、ステレオカメラモジュール100を用いたステレオ測距の原理と温度変化の影響について説明する。
(Principles of stereo ranging and the effects of temperature changes)
Next, the principle of stereo distance measurement using the stereo camera module 100 and the influence of temperature change will be described with reference to FIGS.

図2は、図1に示した構成のステレオカメラモジュール100をモデル化した図であり、ある基準温度のときの第1撮像系および第2撮像系の位置関係を表している。基準温度のときは、図2に示すように、第1レンズ111の主点を通って第1撮像素子121の撮像面に垂直に当たる光軸中心(第1撮像系の光軸)が、第1撮像素子121の撮像面の中心CLに一致する。また、第2レンズ112の主点を通って第2撮像素子122の撮像面に垂直に当たる光軸中心(第2撮像系の光軸)が、第2撮像素子122の撮像面の中心CRに一致する。第1撮像系の光軸と第2撮像系の光軸とは互いに平行であり、第1レンズ111の主点と第2レンズ112の主点とを結ぶ線分は、第1撮像系の光軸および第2撮像系の光軸に対して垂直で、第1撮像素子121の撮像面および第2撮像素子122の撮像面に対して平行となる。   FIG. 2 is a diagram in which the stereo camera module 100 having the configuration shown in FIG. 1 is modeled, and shows the positional relationship between the first imaging system and the second imaging system at a certain reference temperature. At the reference temperature, as shown in FIG. 2, the optical axis center (the optical axis of the first imaging system) that passes through the principal point of the first lens 111 and is perpendicular to the imaging surface of the first imaging element 121 is the first. This coincides with the center CL of the imaging surface of the image sensor 121. The optical axis center (optical axis of the second imaging system) that passes through the principal point of the second lens 112 and is perpendicular to the imaging surface of the second imaging element 122 coincides with the center CR of the imaging surface of the second imaging element 122. To do. The optical axis of the first imaging system and the optical axis of the second imaging system are parallel to each other, and the line segment connecting the principal point of the first lens 111 and the principal point of the second lens 112 is the light of the first imaging system. It is perpendicular to the axis and the optical axis of the second imaging system, and is parallel to the imaging plane of the first imaging element 121 and the imaging plane of the second imaging element 122.

第1レンズ111の主点と第2レンズ112の主点とを結ぶ線分の長さは、基線長Bである。被写体の位置から、第1レンズ111の主点と第2レンズ112の主点とを結ぶ線分に対して垂直に下ろした垂線は、第1レンズ111の主点と第2レンズ112の主点とを結ぶ線分の中点と交差する。この交点と被写体の位置との間の距離が、計測の対象となる被写体までの距離Zである。また、第1レンズ111の主点と第1撮像素子121の撮像面の中心CLとの間の距離が第1撮像系の焦点距離f、第2レンズ112の主点と第2撮像素子122の撮像面の中心CRとの間の距離が第2撮像系の焦点距離fとなり、第1撮像系の焦点距離fと第2撮像系の焦点距離fは等しい値である。   The length of the line segment connecting the principal point of the first lens 111 and the principal point of the second lens 112 is a baseline length B. A perpendicular line drawn perpendicularly to the line segment connecting the principal point of the first lens 111 and the principal point of the second lens 112 from the position of the subject is the principal point of the first lens 111 and the principal point of the second lens 112. Intersects the midpoint of the line segment connecting A distance between the intersection and the position of the subject is a distance Z to the subject to be measured. The distance between the principal point of the first lens 111 and the center CL of the imaging surface of the first image sensor 121 is the focal length f of the first imaging system, and the principal point of the second lens 112 and the second image sensor 122. The distance from the center CR of the imaging surface is the focal length f of the second imaging system, and the focal length f of the first imaging system and the focal length f of the second imaging system are equal.

ここで、第1撮像素子121の撮像面の中心CLから被写体の像が結像した位置までの距離をdL、第2撮像素子122の撮像面の中心CRから被写体の像が結像した位置までの距離をdRとすると、第1撮像系により撮像された第1画像における被写体の位置と第2撮像系により撮像された第2画像における被写体の位置との差分である視差dsは、下記式(1)のように表すことができる。
ds=dL+dR=B・f/Z ・・・(1)
Here, the distance from the center CL of the imaging surface of the first image sensor 121 to the position where the subject image is formed is dL, and from the center CR of the imaging surface of the second image sensor 122 to the position where the subject image is formed. Is a disparity ds that is a difference between the position of the subject in the first image captured by the first imaging system and the position of the subject in the second image captured by the second imaging system. It can be expressed as 1).
ds = dL + dR = B · f / Z (1)

基準温度の環境下では、基線長Bと第1撮像系および第2撮像系の焦点距離fに変動はなく、固定の値である。したがって、第1撮像系により撮像された第1画像と第2撮像系により撮像された第2画像とから視差dsを求めれば、上記式(1)より、被写体までの距離Zを算出することができる。   Under the environment of the reference temperature, the base line length B and the focal lengths f of the first imaging system and the second imaging system do not vary and are fixed values. Therefore, if the parallax ds is obtained from the first image captured by the first imaging system and the second image captured by the second imaging system, the distance Z to the subject can be calculated from the above equation (1). it can.

しかし、ステレオカメラモジュール100が設置されている環境の温度(環境温度)が変化したときには、ステレオカメラモジュール100を構成する各部品の材料の線膨張率に応じて、部品が伸縮する。そして、ステレオカメラモジュール100の構成部品の伸縮により、上記の基線長Bが伸縮することになる。例えば、レンズアレイ110の材料として広く用いられる上記の透明樹脂材ZEONEX E48Rの線膨張率は6×10−5である。一方、基板120上の第1撮像素子121および第2撮像素子122はシリコンで構成されているため、線膨張係数は2.4×10−6である。したがって、温度変化による基線長Bの伸縮は、おおよそレンズアレイ110の伸縮に支配されることがわかる。 However, when the temperature of the environment in which the stereo camera module 100 is installed (environmental temperature) changes, the parts expand and contract according to the linear expansion coefficient of the material of each part constituting the stereo camera module 100. Then, the base line length B is expanded and contracted by expansion and contraction of the components of the stereo camera module 100. For example, the linear expansion coefficient of the transparent resin material ZEONEX E48R widely used as the material of the lens array 110 is 6 × 10 −5 . On the other hand, since the first image sensor 121 and the second image sensor 122 on the substrate 120 are made of silicon, the linear expansion coefficient is 2.4 × 10 −6 . Therefore, it can be seen that the expansion and contraction of the base line length B due to the temperature change is almost governed by the expansion and contraction of the lens array 110.

また、環境温度が変化すると、レンズアレイ110の伸縮により、第1レンズ111および第2レンズ112の屈折率が変化する。屈折率は、物質の密度が大きくなると大きくなるため、温度が上昇すると屈折率は減少し、温度が下降すると屈折率は増大する。第1レンズ111および第2レンズ112の屈折率の温度に対する変動率は、極端な高温域や低温域を除く一般的な室温範囲では一定値とみなしてよい。例えば、上記の透明樹脂材ZEONEX E48Rの屈折率の温度係数は、およそ−1×10−4である。 Further, when the environmental temperature changes, the refractive indexes of the first lens 111 and the second lens 112 change due to the expansion and contraction of the lens array 110. Since the refractive index increases as the density of the substance increases, the refractive index decreases as the temperature increases, and the refractive index increases as the temperature decreases. The variation rate of the refractive index of the first lens 111 and the second lens 112 with respect to the temperature may be regarded as a constant value in a general room temperature range excluding an extremely high temperature range or a low temperature range. For example, the temperature coefficient of the refractive index of the transparent resin material ZEONEX E48R is approximately −1 × 10 −4 .

また、環境温度が変化すると、レンズアレイ110と基板120を保持する鏡枠101にも伸縮が生じる。鏡枠101は、ステンレススチール(SUS)により構成されることが多い。SUSの線膨張係数は1.0×10−6〜1.5×10−6である。環境温度が変化すると、この鏡枠101の線膨張係数に応じた伸縮により、レンズアレイ110と基板120間の距離、つまり第1レンズ111および第2レンズ112と第1撮像素子121および第2撮像素子122間の距離(バックフォーカス)も変動することになる。 Further, when the environmental temperature changes, the lens frame 101 that holds the lens array 110 and the substrate 120 also expands and contracts. The lens frame 101 is often made of stainless steel (SUS). The linear expansion coefficient of SUS is 1.0 × 10 −6 to 1.5 × 10 −6 . When the environmental temperature changes, the distance between the lens array 110 and the substrate 120, that is, the first lens 111 and the second lens 112, the first imaging element 121, and the second imaging are caused by expansion and contraction according to the linear expansion coefficient of the lens frame 101. The distance (back focus) between the elements 122 also varies.

第1レンズ111や第2レンズ112の屈折率が変化するということは、第1レンズ111から射出されて第1撮像素子121へ入射する光の角度や、第2レンズ112から射出されて第2撮像素子122へ入射する光の角度が変わるということである。環境温度が上昇し、レンズアレイ110が伸張すると、第1レンズ111および第2レンズ112の密度が小さくなって屈折率が減少する。すなわち、第1レンズ111や第2レンズ112で光があまり曲がらなくなるため、第1撮像素子121や第2撮像素子122に投影される像が大きくなる。一方、環境温度が下降する場合は、反対に第1撮像素子121や第2撮像素子122に投影される像が小さくなる。   The change in the refractive index of the first lens 111 and the second lens 112 means that the angle of light emitted from the first lens 111 and incident on the first image sensor 121 or the second angle emitted from the second lens 112 is second. That is, the angle of light incident on the image sensor 122 changes. When the environmental temperature rises and the lens array 110 expands, the density of the first lens 111 and the second lens 112 decreases and the refractive index decreases. That is, since the light does not bend much by the first lens 111 and the second lens 112, the image projected on the first image sensor 121 and the second image sensor 122 becomes large. On the other hand, when the environmental temperature decreases, the image projected on the first image sensor 121 and the second image sensor 122 becomes smaller.

第1撮像素子121や第2撮像素子122に投影される像の、環境温度の変化に起因する変化は、ピンホールカメラのモデルでは焦点距離fの変化に相当する。第1レンズ111や第2レンズ112の屈折率の変化、および、第1レンズ111および第2レンズ112と第1撮像素子121および第2撮像素子122間の距離(バックフォーカス)は常温の範囲では小さいため、焦点距離fが環境温度に比例して伸張すると考えてよい。したがって焦点距離fの膨張率τfを下記式(2)のように定義できる。ここで、Δfは焦点距離fの変化量、Δtは環境温度の変化量である。
Δf=τf・f・Δt ・・・(2)
The change caused by the change in the environmental temperature of the image projected on the first image sensor 121 and the second image sensor 122 corresponds to the change in the focal length f in the pinhole camera model. Changes in the refractive indices of the first lens 111 and the second lens 112 and the distances (back focus) between the first lens 111 and the second lens 112 and the first image sensor 121 and the second image sensor 122 are in the range of room temperature. Since it is small, it may be considered that the focal length f extends in proportion to the environmental temperature. Therefore, the expansion rate τf of the focal length f can be defined as the following formula (2). Here, Δf is the amount of change in focal length f, and Δt is the amount of change in environmental temperature.
Δf = τf · f · Δt (2)

ここで、環境温度が変化したときに観測される視差ds’を求めてみる。図3は、ある基準温度からΔtだけ温度上昇したときのステレオカメラモジュール100をモデル化した図であり、構成部品に温度膨張が生じたときの第1撮像系および第2撮像系の位置関係を表している。   Here, the parallax ds' observed when the environmental temperature changes is obtained. FIG. 3 is a diagram modeling the stereo camera module 100 when the temperature rises by Δt from a certain reference temperature, and shows the positional relationship between the first imaging system and the second imaging system when temperature expansion occurs in the component parts. Represents.

計測の対象となる被写体までの距離をZ、ステレオカメラモジュール100の焦点距離をf+Δf(fは温度変化前の焦点距離、Δfは温度変化による焦点距離の変化量)、基線長をB+ΔB(Bは温度変化前の基線長、ΔBは温度変化による基線長の変化量)、第1撮像素子121の撮像面の中心CLから被写体の像が結像した位置までの距離をd1、第2撮像素子122の撮像面の中心CRから被写体の像が結蔵した位置までの距離をd2、第1撮像素子121の撮像面における第1レンズ111の光軸上の位置から被写体の像が結像した位置までの距離をdL’、第2撮像素子122の撮像面における第2レンズ122の光軸上の位置から被写体の像が結像した位置までの距離をdR’とすると、視差ds’は下記式(3)で表される。
ds’=dL’+dR’+ΔB/2・2=(B+ΔB)(f+Δf)/Z+ΔB ・・・(3)
The distance to the subject to be measured is Z, the focal length of the stereo camera module 100 is f + Δf (f is the focal length before temperature change, Δf is the amount of change in focal length due to temperature change), and the baseline length is B + ΔB (B is Base line length before temperature change, ΔB is change amount of base line length due to temperature change), distance from the center CL of the imaging surface of the first image sensor 121 to the position where the subject image is formed, d1, second image sensor 122 The distance from the center CR of the imaging surface to the position where the subject image is accumulated is d2, and from the position on the optical axis of the first lens 111 on the imaging surface of the first imaging element 121 to the position where the subject image is formed. Is dL ′, and the distance from the position on the optical axis of the second lens 122 on the imaging surface of the second image sensor 122 to the position where the image of the subject is formed is dR ′, the parallax ds ′ is expressed by the following formula ( 3).
ds ′ = dL ′ + dR ′ + ΔB / 2 · 2 = (B + ΔB) (f + Δf) / Z + ΔB (3)

ここで、Δf・ΔB≒0であるとすると、下記式(4)が得られる。
ds’=ds+ΔB+(B・Δf+f・ΔB)/Z=ds(1+Δf/f+ΔB/B)+ΔB ・・・(4)
Here, if Δf · ΔB≈0, the following equation (4) is obtained.
ds ′ = ds + ΔB + (B · Δf + f · ΔB) / Z = ds (1 + Δf / f + ΔB / B) + ΔB (4)

したがって、観測される視差ds’から温度変化前の視差ds(=dL+dR)を求める式は、下記式(5)のようになる。
ds=ds’−ΔB/(1+Δf/f+ΔB/B) ・・・(5)
Therefore, the equation for obtaining the parallax ds before temperature change from the observed parallax ds ′ (= dL + dR) is as shown in the following equation (5).
ds = ds′−ΔB / (1 + Δf / f + ΔB / B) (5)

ここで、Δf=τf・f・Δt(上記式(2))であり、ΔB=B・τB・Δt(τBはレンズアレイ110の線膨張率)であるので、τf+τB=τとすると、上記式(5)は下記式(6)のように変形できる。
ds=ds’−B・τB・Δt/(1+τ・Δt) ・・・(6)
Here, Δf = τf · f · Δt (the above formula (2)) and ΔB = B · τB · Δt (τB is a linear expansion coefficient of the lens array 110), and therefore, when τf + τB = τ, the above formula (5) can be modified as shown in the following formula (6).
ds = ds′−B · τB · Δt / (1 + τ · Δt) (6)

上記式(6)で示されるように、温度変化に起因する観測される視差の変化量(ds’−ds)には、基線長Bの伸縮だけでなく、基線長Bの伸縮と第1レンズ111や第2レンズ112の屈折率の変化などによる焦点距離fの変化による画像の倍率の変化も影響している。後者の倍率の変化による視差の変化量は、温度変化の大きさに応じて変化するので、温度の変化が大きくなった場合は特に影響を受けることになる。   As shown in the above formula (6), the observed parallax change amount (ds'-ds) caused by the temperature change is not only the expansion / contraction of the baseline length B but also the expansion / contraction of the baseline length B and the first lens. A change in the magnification of the image due to a change in the focal length f due to a change in the refractive index of the lens 111 or the second lens 112 is also influential. Since the amount of change in parallax due to the latter change in magnification changes according to the magnitude of temperature change, it is particularly affected when the temperature change becomes large.

そこで、本実施形態に係る測距システムでは、基線長Bの伸縮だけでなく、画像の倍率の変化も考慮して、観測される視差ds’を環境温度の変化に応じて補正することで、被写体までの距離を正確に計測できるようにしている。具体的には、ステレオカメラモジュール100で第1画像および第2画像を撮像する際の温度(本実施形態では基板120の温度)を温度センサ140により測定して、キャリブレーション時に温度センサ140により測定された基準温度との差分(温度差Δt)を求める。そして、この温度差Δtに基づいて、環境温度の変化に起因する基線長Bの伸縮による誤差成分を補正するための第1補正値と、環境温度の変化に起因する第1画像および第2画像の倍率の変化による誤差成分を補正するための第2補正値とを算出する。そして、第1画像と第2画像とに基づいて算出される視差ds’を第1補正値と第2補正値とに基づいて補正して、補正視差dsを得る。そして、補正視差dsと、伸縮のない基線長Bおよび焦点距離fとから、被写体までの距離Zを算出する。   Therefore, in the distance measuring system according to the present embodiment, the observed parallax ds ′ is corrected according to the change in the environmental temperature in consideration of not only the expansion / contraction of the baseline length B but also the change in the magnification of the image. The distance to the subject can be measured accurately. Specifically, the temperature at which the stereo camera module 100 captures the first image and the second image (in this embodiment, the temperature of the substrate 120) is measured by the temperature sensor 140, and is measured by the temperature sensor 140 during calibration. A difference (temperature difference Δt) from the calculated reference temperature is obtained. Then, based on the temperature difference Δt, a first correction value for correcting an error component due to the expansion and contraction of the base line length B caused by the change in the environmental temperature, and the first image and the second image caused by the change in the environmental temperature. And a second correction value for correcting an error component due to a change in magnification. Then, the parallax ds ′ calculated based on the first image and the second image is corrected based on the first correction value and the second correction value to obtain a corrected parallax ds. Then, a distance Z to the subject is calculated from the corrected parallax ds, the base line length B without expansion and contraction, and the focal length f.

本実施形態では、第1画像と第2画像とに基づいて視差ds’を算出する処理や、第1補正値と第2補正値とに基づいて視差ds’を補正して補正視差dsを算出する処理、補正視差dsを用いて被写体までの距離Zを算出する処理を、ステレオカメラモジュール100から分離した外部装置である測距装置により行う。以下、この測距装置の具体的な構成例について説明する。   In the present embodiment, the process of calculating the parallax ds ′ based on the first image and the second image, or correcting the parallax ds ′ based on the first correction value and the second correction value to calculate the corrected parallax ds. And a process for calculating the distance Z to the subject using the corrected parallax ds is performed by a distance measuring device which is an external device separated from the stereo camera module 100. Hereinafter, a specific configuration example of the distance measuring device will be described.

(測距装置)
図4は、本実施形態に係る測距装置200の機能的な構成を示すブロック図である。測距装置200は、図4に示すように、第1インタフェース部201と、カメラ制御部202と、画像信号歪み補正部203と、視差演算部204と、温度差算出部205と、視差補正部206と、距離算出部207と、第2インタフェース部208と、を備える。これらの各部(その全部または一部)は、例えば、測距装置200がCPUやROM、RAM、入出力回路などを備えるマイクロコンピュータとして構成されている場合、このマイクロコンピュータで実行されるプログラム(ソフトウェア)により実現することができる。また、測距装置200が備える上記の各部(その全部または一部)を、例えば、ASIC(Application Specific Integrated Circuit)やFPGA(Field-Programmable Gate Array)などの専用のハードウェアを用いて構成することもできる。
(Ranging device)
FIG. 4 is a block diagram showing a functional configuration of the distance measuring apparatus 200 according to the present embodiment. As shown in FIG. 4, the distance measuring device 200 includes a first interface unit 201, a camera control unit 202, an image signal distortion correction unit 203, a parallax calculation unit 204, a temperature difference calculation unit 205, and a parallax correction unit. 206, a distance calculation unit 207, and a second interface unit 208. For example, when the distance measuring device 200 is configured as a microcomputer including a CPU, a ROM, a RAM, an input / output circuit, and the like, these units (all or a part thereof) are programs (software) executed by the microcomputer. ). Further, each of the above-described units (all or a part thereof) included in the distance measuring device 200 is configured using dedicated hardware such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field-Programmable Gate Array). You can also.

第1インタフェース部201は、ステレオカメラモジュール100との間でFPC160を介した信号伝送を行うためのインタフェースである。第1インタフェース部201は、カメラ制御部202の制御に応じて、ステレオカメラモジュール100から第1画像および第2画像を入力する機能を持つ。   The first interface unit 201 is an interface for performing signal transmission with the stereo camera module 100 via the FPC 160. The first interface unit 201 has a function of inputting the first image and the second image from the stereo camera module 100 under the control of the camera control unit 202.

カメラ制御部202は、ステレオカメラモジュール100の動作を制御する。カメラ制御部202は、第1撮像素子121や第2撮像素子122からの画像信号の読み出しを制御するとともに、例えば、自動露出、ホワイトバランス、画像信号モード(グレースケール/YUVカラー/Raw画像)など、ステレオカメラモジュール100による画像の撮像に関する各種機能の設定を実行する。ステレオカメラモジュール100による画像の撮像に関する各種機能の設定は、例えば、カメラ制御部202内のレジスタの値により決定される。   The camera control unit 202 controls the operation of the stereo camera module 100. The camera control unit 202 controls reading of image signals from the first image sensor 121 and the second image sensor 122 and, for example, automatic exposure, white balance, image signal mode (grayscale / YUV color / raw image), and the like. Then, setting of various functions relating to image capturing by the stereo camera module 100 is executed. The setting of various functions related to image capturing by the stereo camera module 100 is determined by the value of a register in the camera control unit 202, for example.

また、カメラ制御部202は、測距装置200の電源が投入された際に、ステレオカメラモジュール100の基板120に搭載された記憶部150からステレオカメラモジュール100の各種パラメータの読み出しを行う。具体的には、カメラ制御部202は、測距装置200の電源投入時に、環境温度が基準温度のときの伸縮のない基線長B、環境温度が基準温度のときの焦点距離f、オフセット値、歪み補正のためのカメラキャリブレーションパラメータ、キャリブレーション時における温度センサ140の出力値(基準温度)などを、ステレオカメラモジュール100の記憶部150から読み出す。ステレオカメラモジュール100の記憶部150から読み出されたこれらの各種パラメータは、測距装置200内部の図示しないメモリに保存される。   The camera control unit 202 reads various parameters of the stereo camera module 100 from the storage unit 150 mounted on the substrate 120 of the stereo camera module 100 when the distance measuring device 200 is turned on. Specifically, when the distance measuring apparatus 200 is turned on, the camera control unit 202 has a baseline length B without expansion and contraction when the environmental temperature is the reference temperature, a focal length f when the environmental temperature is the reference temperature, an offset value, The camera calibration parameters for distortion correction, the output value (reference temperature) of the temperature sensor 140 at the time of calibration, and the like are read from the storage unit 150 of the stereo camera module 100. These various parameters read from the storage unit 150 of the stereo camera module 100 are stored in a memory (not shown) inside the distance measuring apparatus 200.

画像信号歪み補正部203は、第1インタフェース部201から入力された第1画像および第2画像の画像信号の歪みを補正する。画像信号歪み補正部203は、電源投入の際にステレオカメラモジュール100の記憶部150から読み出されたカメラキャリブレーションパラメータが図示しないメモリに保存されているので、そのカメラキャリブレーションパラメータをメモリから読み出して画像信号の歪み補正を実行する。画像信号の歪み補正の方式は、例えば、ルックアップテーブル方式、あるいは多項式近似方式など、広く知られている様々な方式を利用することができる。ルックアップテーブル方式で画像信号の歪み補正を実行する場合、記憶部150に記憶されているカメラキャリブレーションパラメータはルックアップテーブルの値である。多項式近似方式で画像信号の歪みを実行する場合は、多項式の係数が記憶部150に記憶されている。   The image signal distortion correction unit 203 corrects the distortion of the image signals of the first image and the second image input from the first interface unit 201. The image signal distortion correction unit 203 reads the camera calibration parameters from the memory because the camera calibration parameters read from the storage unit 150 of the stereo camera module 100 when the power is turned on are stored in a memory (not shown). To correct the image signal distortion. As the image signal distortion correction method, for example, various well-known methods such as a look-up table method or a polynomial approximation method can be used. When image signal distortion correction is performed using the lookup table method, the camera calibration parameters stored in the storage unit 150 are values in the lookup table. When executing distortion of an image signal by a polynomial approximation method, polynomial coefficients are stored in the storage unit 150.

視差演算部204は、画像信号歪み補正部203で歪み補正が実行された後の第1画像および第2画像の画像信号に基づいて視差ds’を算出し、算出した視差ds’を視差補正部206に出力する。視差演算部204による視差ds’の算出は、例えば、第1画像における被写体の位置と第2画像における被写体の位置との差分を画素単位で検出する処理となる。例えば、視差演算部204による視差ds’の算出方式には、画素単位のマッチング位置を検出するためのブロックマッチングアルゴリズムとしてZSSD(Zero-mean Sum of Squared Differences)を用いることができる。また、副画素(サブピクセル)単位のマッチング位置を推定するための方式として、広く知られている二次曲線フィッティングを使用することができる。ZSSDは、第1画像と第2画像とのブロックマッチングに使用するブロックの画素値の平均値を各画素から引いた値を使って、差分二乗和を計算する。この差分二乗和の最小値が得られるマッチングブロックの位置を画素単位のマッチング位置とし、マッチングさせるブロックを1画素左右にずらしたときに得られる差分二乗和の値とを用いて二次曲線フィッティングを行って、サブピクセルのマッチング位置を推定する。このZSSD方式は、特に第1画像と第2画像とで明るさが異なるときに有利な方法である。   The parallax calculation unit 204 calculates the parallax ds ′ based on the image signals of the first image and the second image after the distortion correction is executed by the image signal distortion correction unit 203, and uses the calculated parallax ds ′ as the parallax correction unit. It outputs to 206. The calculation of the parallax ds ′ by the parallax calculation unit 204 is, for example, a process of detecting the difference between the position of the subject in the first image and the position of the subject in the second image in units of pixels. For example, ZSSD (Zero-Sum of Squared Differences) can be used as a block matching algorithm for detecting a matching position in units of pixels in the parallax ds ′ calculation method by the parallax calculation unit 204. As a method for estimating a matching position in units of subpixels (subpixels), a well-known quadratic curve fitting can be used. ZSSD calculates the sum of squared differences using a value obtained by subtracting the average value of pixel values of blocks used for block matching between the first image and the second image from each pixel. The position of the matching block where the minimum value of the sum of squared differences is obtained is the matching position in pixel units, and quadratic curve fitting is performed using the value of the sum of squared differences obtained when the matching block is shifted left and right by one pixel. Go to estimate the matching position of the sub-pixel. This ZSSD method is particularly advantageous when the brightness differs between the first image and the second image.

温度差算出部205は、ステレオカメラモジュール100によって第1画像および第2画像の撮像が行われたときに温度センサ140により測定された基板120の温度(撮像時温度)を、第1インタフェース部201を介して取得する。また、温度差算出部205は、測距装置200の電源投入時にカメラ制御部202によってステレオカメラモジュール100の記憶部150から読み出され、測距装置200内部の図示しないメモリに格納された、キャリブレーション時における温度センサ140の出力値(基準温度)をメモリから読み出す。そして、温度差算出部205は、撮像時温度と基準温度との差分である温度差Δtを算出し、算出した温度差Δtを視差補正部206に出力する。   The temperature difference calculation unit 205 uses the first interface unit 201 to calculate the temperature of the substrate 120 (temperature during imaging) measured by the temperature sensor 140 when the first image and the second image are captured by the stereo camera module 100. To get through. The temperature difference calculation unit 205 is read from the storage unit 150 of the stereo camera module 100 by the camera control unit 202 when the distance measuring device 200 is turned on, and stored in a memory (not shown) inside the distance measuring device 200. The output value (reference temperature) of the temperature sensor 140 at the time of calibration is read from the memory. Then, the temperature difference calculation unit 205 calculates a temperature difference Δt that is a difference between the imaging temperature and the reference temperature, and outputs the calculated temperature difference Δt to the parallax correction unit 206.

視差補正部206は、温度差算出部205が算出した温度差Δtに基づいて、基線長Bの伸縮による誤差成分を補正するための第1補正値と、第1画像および第2画像の倍率の変化による誤差成分を補正するための第2補正値とを算出し、視差演算部204が算出した視差ds’を、第1補正値と第2補正値とに基づいて補正して、補正視差dsを算出する。すなわち、補正視差演算部206は、温度差算出部205が算出した温度差Δtに基づき、上記式(6)で示す演算を実行し、補正視差dsを算出する。上記式(6)の演算で使用するパラメータτ,τBは、測距装置200内部の図示しないメモリにあらかじめ格納されている。また、パラメータBは、環境温度が基準温度のときの伸縮のない基線長であり、測距装置200の電源投入時にカメラ制御部202によってステレオカメラモジュール100の記憶部150から読み出され、測距装置200内部の図示しないメモリに格納されている。   The parallax correction unit 206, based on the temperature difference Δt calculated by the temperature difference calculation unit 205, the first correction value for correcting the error component due to the expansion and contraction of the baseline length B, and the magnification of the first image and the second image A second correction value for correcting the error component due to the change is calculated, and the parallax ds ′ calculated by the parallax calculation unit 204 is corrected based on the first correction value and the second correction value, thereby correcting parallax ds. Is calculated. That is, the corrected parallax calculating unit 206 calculates the corrected parallax ds by executing the calculation represented by the above formula (6) based on the temperature difference Δt calculated by the temperature difference calculating unit 205. The parameters τ and τB used in the calculation of the above formula (6) are stored in advance in a memory (not shown) inside the distance measuring apparatus 200. The parameter B is a baseline length without expansion and contraction when the environmental temperature is the reference temperature, and is read from the storage unit 150 of the stereo camera module 100 by the camera control unit 202 when the distance measuring device 200 is turned on. It is stored in a memory (not shown) inside the apparatus 200.

図5は、視差補正部206が上記式(6)の演算を実行する場合の演算回路の構成を示している。この場合、視差補正部206は、伸縮のない基線長BにτBを乗算した値に温度差Δtを乗算して第1補正値を算出する。また、視差補正部206は、τに温度差Δtを乗算した値に1を加算して第2補正値を算出する。そして、視差補正部206は、視差演算部204が算出した視差ds’から第1補正値を減算した値に対して第2補正値を除算した値を、補正視差dsとして算出する。   FIG. 5 shows a configuration of an arithmetic circuit when the parallax correction unit 206 executes the calculation of the above equation (6). In this case, the parallax correction unit 206 calculates the first correction value by multiplying the value obtained by multiplying the baseline length B without expansion / contraction by τB by the temperature difference Δt. In addition, the parallax correction unit 206 calculates a second correction value by adding 1 to a value obtained by multiplying τ by the temperature difference Δt. Then, the parallax correction unit 206 calculates a value obtained by dividing the second correction value by the value obtained by subtracting the first correction value from the parallax ds ′ calculated by the parallax calculation unit 204 as the corrected parallax ds.

また、τ・Δtが小さい値の場合は、視差補正部206は、上記式(6)の近似式となる下記式(7)を使用して補正視差ds’を算出することも可能である。ここで、τ・τBは、十分0に近いとしている。
ds=ds’(1−τ・Δt)−B・τB・Δt ・・・(7)
In the case where τ · Δt is a small value, the parallax correction unit 206 can also calculate the corrected parallax ds ′ using the following equation (7) that is an approximation of the above equation (6). Here, τ · τB is sufficiently close to zero.
ds = ds ′ (1−τ · Δt) −B · τB · Δt (7)

図6は、視差補正部206が上記式(7)の演算を実行する場合の演算回路の構成を示している。この場合、視差補正部206は、τBに温度差Δtを乗算した値に伸縮のない基線長Bを乗算して第1補正値を算出する。また、視差補正部206は、τに温度差Δtを乗算した値から1を減算して第2補正値を算出する。そして、視差補正部206は、視差演算部204が算出した視差ds’に第2補正値を乗算した値から第1補正値を減算した値を、補正視差dsとして算出する。   FIG. 6 shows a configuration of an arithmetic circuit when the parallax correction unit 206 executes the calculation of the above equation (7). In this case, the parallax correction unit 206 calculates the first correction value by multiplying the value obtained by multiplying τB by the temperature difference Δt by the baseline length B without expansion / contraction. Further, the parallax correction unit 206 calculates a second correction value by subtracting 1 from a value obtained by multiplying τ by the temperature difference Δt. Then, the parallax correction unit 206 calculates, as the corrected parallax ds, a value obtained by subtracting the first correction value from the value obtained by multiplying the parallax ds ′ calculated by the parallax calculation unit 204 by the second correction value.

距離算出部207は、視差補正部206が算出した補正視差dsと、伸縮のない基線長Bと、焦点距離fとに基づいて、被写体までの距離Zを算出する。被写体までの距離Zは、例えば下記式(8)により算出することができる。
Z=B・f/(ds−doffset) ・・・(8)
The distance calculation unit 207 calculates the distance Z to the subject based on the corrected parallax ds calculated by the parallax correction unit 206, the baseline length B without expansion and contraction, and the focal length f. The distance Z to the subject can be calculated by the following equation (8), for example.
Z = B · f / (ds−d offset ) (8)

ここで、doffsetは無限遠を撮影したときに得られる視差である。また、Bとfはキャリブレーション時の基線長の値と焦点距離(伸縮のない基線長および焦点距離)である。これらの値は、ステレオカメラモジュール100のキャリブレーションパラメータと同様に、ステレオカメラモジュール100の記憶部150にあらかじめ記憶されており、測距装置200の電源投入後、カメラ制御部202によって記憶部150から読み出されて測距装置200内部の図示しないメモリに格納される。上記式(8)の演算には、このメモリに格納されている値が用いられる。 Here, d offset is a parallax obtained when photographing at infinity. B and f are the value of the base line length and the focal length at the time of calibration (base line length and focal length without expansion and contraction). These values are stored in advance in the storage unit 150 of the stereo camera module 100 in the same manner as the calibration parameters of the stereo camera module 100. After the distance measuring device 200 is turned on, the camera control unit 202 removes these values from the storage unit 150. It is read out and stored in a memory (not shown) inside the distance measuring device 200. The value stored in this memory is used for the calculation of the above equation (8).

第2インタフェース部208は、距離算出部207が算出した被写体までの距離の情報を、測距装置200からFPC210を介して外部の情報処理装置に出力するためのインタフェースである。   The second interface unit 208 is an interface for outputting information on the distance to the subject calculated by the distance calculation unit 207 from the distance measuring device 200 to an external information processing device via the FPC 210.

(温度係数τ、τBの決定方法)
次に、上記式(6)または上記式(7)の演算により補正視差dsを算出するために使用される温度係数であるτとτBを決定する方法の具体例について説明する。
(Method for determining temperature coefficients τ, τB)
Next, a specific example of a method for determining τ and τB that are temperature coefficients used for calculating the corrected parallax ds by the calculation of the above formula (6) or the above formula (7) will be described.

環境温度の変化に起因する視差の誤差成分は、上述したように、レンズアレイ110の伸縮による影響が支配的である。しかし、環境温度の変化を検出するためにステレオカメラモジュール100に設けられた温度センサ140は、レンズアレイ110の温度を直接測定しているわけではない。また、ステレオカメラモジュール100を構成する各部品の材質が異なれば、それぞれの材質に特有の線膨張率があり、さらにステレオカメラモジュール100の製造方法によっても、ステレオカメラモジュール100を構成する各部品の伸縮の仕方が異なってくる。したがって、温度係数であるτとτBは、あらかじめ実験的に求めておく。以下では、τとτBを実験的に求める具体的手法について説明する。   As described above, the parallax error component resulting from the change in environmental temperature is dominated by the expansion and contraction of the lens array 110. However, the temperature sensor 140 provided in the stereo camera module 100 in order to detect a change in the environmental temperature does not directly measure the temperature of the lens array 110. Further, if the material of each component constituting the stereo camera module 100 is different, each material has a specific linear expansion coefficient. Further, depending on the manufacturing method of the stereo camera module 100, each component constituting the stereo camera module 100 is also different. The way of expansion and contraction is different. Therefore, the temperature coefficients τ and τB are experimentally obtained in advance. Hereinafter, a specific method for experimentally obtaining τ and τB will be described.

ある基準温度のときに、ステレオカメラモジュール100から所定の距離だけ離れた位置にある被写体を撮像し、得られた第1画像および第2画像から視差を算出しておく。次に、環境温度を上下させて基板120の温度を変化させ、複数の環境温度において、同様に被写体を撮像して視差を算出するとともに、温度センサ140により測定された温度を記録する。すると、図7に示すようなデータが得られる。図7は、算出される視差と環境温度との関係を示す図である。図7に示すように、温度差が小さい場合は、温度変化に対して視差が直線的に変化するが、温度差が大きくなると、上記式(6)の分母の項の影響が大きくなってくるので、温度差と視差との関係が直線からずれていく。この図7に示すデータに対して、上記式(6)を用いたフィッティングを実行することにより、温度係数τとτBとを決定することができる。   At a certain reference temperature, a subject located at a predetermined distance from the stereo camera module 100 is imaged, and the parallax is calculated from the obtained first and second images. Next, the ambient temperature is raised and lowered to change the temperature of the substrate 120, and the subject is similarly imaged and the parallax is calculated at a plurality of ambient temperatures, and the temperature measured by the temperature sensor 140 is recorded. Then, data as shown in FIG. 7 is obtained. FIG. 7 is a diagram illustrating the relationship between the calculated parallax and the environmental temperature. As shown in FIG. 7, when the temperature difference is small, the parallax changes linearly with respect to the temperature change. However, when the temperature difference becomes large, the influence of the denominator term of the above equation (6) becomes large. Therefore, the relationship between the temperature difference and the parallax deviates from the straight line. The temperature coefficients τ and τB can be determined by performing fitting using the above equation (6) on the data shown in FIG.

ここでτBは、理想的にはレンズアレイ110の材質の線膨張係数であるが、温度センサ140が基板120に装着されているため、温度センサ140により測定される温度はレンズアレイ110の温度とは異なる。実際に測定すると、熱電対を用いて直接測定したレンズアレイ110の温度(以下、レンズ温度という。)と温度センサ140により測定される基板120の温度(以下、基板温度という。)とは、図8に示すように直線的な関係にあることが分かった。図8は、レンズ温度と基板温度との関係を示す図である。   Here, τB is ideally a linear expansion coefficient of the material of the lens array 110, but since the temperature sensor 140 is mounted on the substrate 120, the temperature measured by the temperature sensor 140 is the same as the temperature of the lens array 110. Is different. When actually measured, the temperature of the lens array 110 (hereinafter referred to as the lens temperature) directly measured using a thermocouple and the temperature of the substrate 120 (hereinafter referred to as the substrate temperature) measured by the temperature sensor 140 are shown in FIG. As shown in FIG. 8, it was found that there was a linear relationship. FIG. 8 is a diagram showing the relationship between the lens temperature and the substrate temperature.

図8に示すように、レンズ温度と基板温度との関係は、直線的ではあるが、その傾きが1ではない。図8の例では、レンズ温度よりも基板温度の方が温度上昇が急峻で、その傾きは1.1である。したがって、基板温度とレンズ温度との関係は、基板温度=1.1×レンズ温度+定数として表すことができる。この場合には、τBはレンズアレイ110の線膨張係数に0.9を乗じた値にほぼ等しいことが実験で確かめられている。もちろん、ステレオカメラモジュール100の構成が異なる場合には、レンズ温度の変化と基板温度の変化との関係は異なってくるので、τBの値も異なってくる。このように、補正視差dsを算出するために使用される温度係数であるτとτBは、あらかじめ実験的に求めておくことができる。   As shown in FIG. 8, the relationship between the lens temperature and the substrate temperature is linear, but the inclination is not 1. In the example of FIG. 8, the substrate temperature is steeper than the lens temperature, and the gradient is 1.1. Therefore, the relationship between the substrate temperature and the lens temperature can be expressed as substrate temperature = 1.1 × lens temperature + constant. In this case, it has been experimentally confirmed that τB is substantially equal to a value obtained by multiplying the linear expansion coefficient of the lens array 110 by 0.9. Of course, when the configuration of the stereo camera module 100 is different, the relationship between the change in the lens temperature and the change in the substrate temperature is different, so the value of τB is also different. Thus, τ and τB, which are temperature coefficients used for calculating the corrected parallax ds, can be obtained experimentally in advance.

(実施形態の効果)
以上、具体的な例を挙げながら詳細に説明したように、本実施形態に係る測距システムでは、測距装置200が、ステレオカメラモジュール100で第1画像および第2画像を撮像する際の温度と基準温度との温度差Δtに基づいて、環境温度の変化に起因する基線長Bの伸縮による誤差成分を補正するための第1補正値と、環境温度の変化に起因する第1画像および第2画像の倍率の変化による誤差成分を補正するための第2補正値とを算出する。そして、第1画像と第2画像とに基づいて算出される視差ds’を、第1補正値と第2補正値とに基づいて補正して補正視差dsを算出し、算出した補正視差dsを用いて被写体までの距離Zを算出する。したがって、本実施形態に係る測距システムによれば、第1画像および第2画像の撮像時の温度に応じて、第1画像および第2画像から算出される視差ds’を高精度に補正して、被写体までの距離Zを正確に計測することができる。
(Effect of embodiment)
As described above in detail with specific examples, in the distance measuring system according to the present embodiment, the temperature at which the distance measuring device 200 captures the first image and the second image with the stereo camera module 100 is described. The first correction value for correcting the error component due to the expansion and contraction of the baseline length B caused by the change in the environmental temperature based on the temperature difference Δt between the first image and the reference temperature, and the first image and the first image caused by the change in the environmental temperature A second correction value for correcting an error component due to a change in magnification of the two images is calculated. Then, the parallax ds ′ calculated based on the first image and the second image is corrected based on the first correction value and the second correction value to calculate the corrected parallax ds, and the calculated correction parallax ds is calculated. Using this, the distance Z to the subject is calculated. Therefore, according to the distance measuring system according to the present embodiment, the parallax ds ′ calculated from the first image and the second image is corrected with high accuracy according to the temperature at the time of capturing the first image and the second image. Thus, the distance Z to the subject can be accurately measured.

また、測距装置200の視差補正部206が、上記式(6)で示す演算を行って、視差ds’から第1補正値を減算した値に対して第2補正値を除算した値を補正視差dsとして算出する場合には、厳密な計算により極めて正確に視差ds’を補正して補正視差dsを算出することができる。   Further, the parallax correction unit 206 of the distance measuring device 200 performs the calculation represented by the above formula (6) to correct a value obtained by dividing the second correction value by the value obtained by subtracting the first correction value from the parallax ds ′. In the case of calculating the parallax ds, the corrected parallax ds can be calculated by correcting the parallax ds ′ very accurately by strict calculation.

また、測距装置200の視差補正部206が、上記式(7)で示す演算を行って、視差ds’と第2補正値とを乗算した値から第1補正値を減算した値を補正視差dsとして算出する場合には、除算演算を使わずに低コストで補正視差dsを算出することができる。   In addition, the parallax correction unit 206 of the distance measuring device 200 performs the calculation represented by the above equation (7), and the corrected parallax is obtained by subtracting the first correction value from the value obtained by multiplying the parallax ds ′ and the second correction value. When calculating as ds, the corrected parallax ds can be calculated at low cost without using a division operation.

本実施形態に係る測距システムにおいて、図4に示した測距装置200の機能的な構成は、一例として、測距装置200を構成するマイクロコンピュータのCPUが、測距プログラムを実行することにより実現することができる。この場合、マイクロコンピュータのCPUが実行する測距プログラムは、例えば、マイクロコンピュータのROMなどに予め組み込まれて提供される。   In the distance measuring system according to the present embodiment, the functional configuration of the distance measuring apparatus 200 shown in FIG. 4 is, for example, as a result of the CPU of the microcomputer constituting the distance measuring apparatus 200 executing the distance measuring program. Can be realized. In this case, the distance measurement program executed by the CPU of the microcomputer is provided by being incorporated in advance in a ROM of the microcomputer, for example.

また、測距装置200を構成するマイクロコンピュータのCPUが実行する測距プログラムは、インストール可能な形式又は実行可能な形式のファイルでCD−ROM、フレキシブルディスク、CD−R、DVD等のコンピュータで読み取り可能な記録媒体に記録して提供するように構成してもよい。また、測距装置200を構成するマイクロコンピュータのCPUが実行する測距プログラムを、インターネットなどのネットワークに接続されたコンピュータ上に格納し、ネットワーク経由でダウンロードさせることにより提供するように構成してもよい。また、測距装置200を構成するマイクロコンピュータのCPUが実行する測距プログラムを、インターネットなどのネットワーク経由で提供または配布するように構成してもよい。   The distance measuring program executed by the CPU of the microcomputer constituting the distance measuring apparatus 200 is an installable or executable file and is read by a computer such as a CD-ROM, flexible disk, CD-R, or DVD. You may comprise so that it may record on a possible recording medium and provide. Further, the distance measuring program executed by the CPU of the microcomputer constituting the distance measuring apparatus 200 may be stored on a computer connected to a network such as the Internet and provided by being downloaded via the network. Good. Further, the distance measuring program executed by the CPU of the microcomputer constituting the distance measuring apparatus 200 may be provided or distributed via a network such as the Internet.

測距装置200を構成するマイクロコンピュータのCPUが実行する測距プログラムは、例えば、第1インタフェース部201、カメラ制御部202、画像信号歪み補正部203、視差演算部204、温度差算出部205、視差補正部206、距離算出部207および第2インタフェース部208を含むモジュール構成となっており、実際のハードウェアとしてはCPU(プロセッサ)が上記ROMから測距プログラムを読み出して実行することにより上記各部が主記憶装置(例えばRAM)上にロードされ、第1インタフェース部201、カメラ制御部202、画像信号歪み補正部203、視差演算部204、温度差算出部205、視差補正部206、距離算出部207および第2インタフェース部208が主記憶装置上に生成されるようになっている。   The ranging program executed by the CPU of the microcomputer constituting the ranging device 200 includes, for example, a first interface unit 201, a camera control unit 202, an image signal distortion correction unit 203, a parallax calculation unit 204, a temperature difference calculation unit 205, The module configuration includes a parallax correction unit 206, a distance calculation unit 207, and a second interface unit 208. As actual hardware, a CPU (processor) reads out and executes a distance measurement program from the ROM, and the above-described units. Are loaded on the main storage device (for example, RAM), the first interface unit 201, the camera control unit 202, the image signal distortion correction unit 203, the parallax calculation unit 204, the temperature difference calculation unit 205, the parallax correction unit 206, and the distance calculation unit. 207 and the second interface unit 208 are generated on the main storage device Going on.

以上、本発明の具体的な実施形態について説明したが、本発明は、上述した実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化することができる。   The specific embodiments of the present invention have been described above. However, the present invention is not limited to the above-described embodiments as they are, and may be embodied by modifying constituent elements without departing from the scope of the invention in the implementation stage. can do.

100 ステレオカメラモジュール
110 レンズアレイ
111 第1レンズ
112 第2レンズ
120 基板
121 第1撮像素子
122 第2撮像素子
140 温度センサ
200 測距装置
204 視差演算部
205 温度差算出部
206 視差補正部
207 距離算出部
DESCRIPTION OF SYMBOLS 100 Stereo camera module 110 Lens array 111 1st lens 112 2nd lens 120 Board | substrate 121 1st image sensor 122 2nd image sensor 140 Temperature sensor 200 Distance measuring device 204 Parallax calculating part 205 Temperature difference calculation part 206 Parallax correction part 207 Distance calculation Part

特開2007−322128号公報JP 2007-322128 A 特開2009−250785号公報JP 2009-250785 A

Claims (6)

第1レンズを含む第1撮像系と、前記第1レンズと一体成形された第2レンズを含む第2撮像系と、を備えるステレオカメラモジュールから、前記第1撮像系により撮像された被写体の第1画像と前記第2撮像系により撮像された前記被写体の第2画像とを入力する入力手段と、
前記第1画像と前記第2画像とに基づいて、前記第1画像における前記被写体の位置と前記第2画像における前記被写体の位置との差分である視差を算出する視差算出手段と、
前記第1画像および前記第2画像の撮像時の温度と基準温度との差分である温度差を算出する温度差算出手段と、
前記温度差に基づいて、前記第1撮像系と前記第2撮像系との光軸間の距離である基線長の伸縮による誤差成分を補正するための第1補正値と、前記第1画像および前記第2画像の倍率の変化による誤差成分を補正するための第2補正値とを算出し、前記視差を、前記第1補正値と前記第2補正値とに基づいて補正して、補正視差を算出する視差補正手段と、
前記補正視差と、伸縮のない前記基線長と、前記第1撮像系および前記第2撮像系の焦点距離とに基づいて、前記被写体までの距離を算出する距離算出手段と、を備えることを特徴とする測距装置。
A stereo camera module comprising: a first imaging system including a first lens; and a second imaging system including a second lens integrally formed with the first lens, and a first image of the subject imaged by the first imaging system. Input means for inputting one image and a second image of the subject imaged by the second imaging system;
Parallax calculation means for calculating a parallax that is a difference between the position of the subject in the first image and the position of the subject in the second image based on the first image and the second image;
Temperature difference calculating means for calculating a temperature difference that is a difference between a temperature at the time of capturing the first image and the second image and a reference temperature;
Based on the temperature difference, a first correction value for correcting an error component due to expansion and contraction of a baseline length, which is a distance between the optical axes of the first imaging system and the second imaging system, and the first image and A second correction value for correcting an error component due to a change in magnification of the second image is calculated, and the parallax is corrected based on the first correction value and the second correction value, thereby correcting parallax. Parallax correction means for calculating
Distance calculating means for calculating a distance to the subject based on the corrected parallax, the base line length without expansion and contraction, and the focal lengths of the first imaging system and the second imaging system. Ranging device.
前記視差補正手段は、前記視差から前記第1補正値を減算した値に対して前記第2補正値を除算した値を前記補正視差として算出することを特徴とする請求項1に記載の測距装置。   2. The distance measurement according to claim 1, wherein the parallax correction unit calculates a value obtained by dividing the second correction value with respect to a value obtained by subtracting the first correction value from the parallax as the correction parallax. apparatus. 前記視差補正手段は、前記視差と前記第2補正値とを乗算した値から前記第1補正値を減算した値を前記補正視差として算出することを特徴とする請求項1に記載の測距装置。   2. The distance measuring apparatus according to claim 1, wherein the parallax correction unit calculates a value obtained by subtracting the first correction value from a value obtained by multiplying the parallax and the second correction value as the correction parallax. . 第1レンズを含み、被写体の第1画像を撮像する第1撮像系と、
前記第1レンズと一体成形された第2レンズを含み、前記被写体の第2画像を撮像する第2撮像系と、
前記第1画像と前記第2画像とに基づいて、前記第1画像における前記被写体の位置と前記第2画像における前記被写体の位置との差分である視差を算出する視差算出手段と、
前記第1画像および前記第2画像の撮像時の温度と基準温度との差分である温度差を算出する温度差算出手段と、
前記温度差に基づいて、前記第1撮像系と前記第2撮像系との光軸間の距離である基線長の伸縮による誤差成分を補正するための第1補正値と、前記第1画像および前記第2画像の倍率の変化による誤差成分を補正するための第2補正値とを算出し、前記視差を、前記第1補正値と前記第2補正値とに基づいて補正して、補正視差を算出する視差補正手段と、
前記補正視差と、伸縮のない前記基線長と、前記第1撮像系および前記第2撮像系の焦点距離とに基づいて、前記被写体までの距離を算出する距離算出手段と、を備えることを特徴とする測距システム。
A first imaging system including a first lens and capturing a first image of a subject;
A second imaging system that includes a second lens integrally molded with the first lens, and that captures a second image of the subject;
Parallax calculation means for calculating a parallax that is a difference between the position of the subject in the first image and the position of the subject in the second image based on the first image and the second image;
Temperature difference calculating means for calculating a temperature difference that is a difference between a temperature at the time of capturing the first image and the second image and a reference temperature;
Based on the temperature difference, a first correction value for correcting an error component due to expansion and contraction of a baseline length, which is a distance between the optical axes of the first imaging system and the second imaging system, and the first image and A second correction value for correcting an error component due to a change in magnification of the second image is calculated, and the parallax is corrected based on the first correction value and the second correction value, thereby correcting parallax. Parallax correction means for calculating
Distance calculating means for calculating a distance to the subject based on the corrected parallax, the base line length without expansion and contraction, and the focal lengths of the first imaging system and the second imaging system. Ranging system.
第1レンズを含む第1撮像系と、前記第1レンズと一体成形された第2レンズを含む第2撮像系と、を備えるステレオカメラモジュールから、前記第1撮像系により撮像された被写体の第1画像と前記第2撮像系により撮像された前記被写体の第2画像とを入力する機能と、
前記第1画像と前記第2画像とに基づいて、前記第1画像における前記被写体の位置と前記第2画像における前記被写体の位置との差分である視差を算出する機能と、
前記第1画像および前記第2画像の撮像時の温度と基準温度との差分である温度差を算出する機能と、
前記温度差に基づいて、前記第1撮像系と前記第2撮像系との光軸間の距離である基線長の伸縮による誤差成分を補正するための第1補正値と、前記第1画像および前記第2画像の倍率の変化による誤差成分を補正するための第2補正値とを算出し、前記視差を、前記第1補正値と前記第2補正値とに基づいて補正して、補正視差を算出する機能と、
前記補正視差と、伸縮のない前記基線長と、前記第1撮像系および前記第2撮像系の焦点距離とに基づいて、前記被写体までの距離を算出する機能と、をコンピュータに実現させる測距プログラム。
A stereo camera module comprising: a first imaging system including a first lens; and a second imaging system including a second lens integrally formed with the first lens, and a first image of the subject imaged by the first imaging system. A function of inputting one image and a second image of the subject imaged by the second imaging system;
A function of calculating a parallax that is a difference between the position of the subject in the first image and the position of the subject in the second image based on the first image and the second image;
A function of calculating a temperature difference which is a difference between a temperature at the time of capturing the first image and the second image and a reference temperature;
Based on the temperature difference, a first correction value for correcting an error component due to expansion and contraction of a baseline length, which is a distance between the optical axes of the first imaging system and the second imaging system, and the first image and A second correction value for correcting an error component due to a change in magnification of the second image is calculated, and the parallax is corrected based on the first correction value and the second correction value, thereby correcting parallax. A function for calculating
Ranging that causes the computer to realize the function of calculating the distance to the subject based on the corrected parallax, the baseline length without expansion and contraction, and the focal lengths of the first imaging system and the second imaging system program.
第1レンズを含む第1撮像系と、前記第1レンズと一体成形された第2レンズを含む第2撮像系と、を備えるステレオカメラモジュールから、前記第1撮像系により撮像された被写体の第1画像と前記第2撮像系により撮像された前記被写体の第2画像とを入力し、前記第1画像における前記被写体の位置と前記第2画像における前記被写体の位置との差分である視差を算出する装置において実行される視差補正方法であって、
前記第1画像および前記第2画像の撮像時の温度と基準温度との差分である温度差を算出するステップと、
前記温度差に基づいて、前記第1撮像系と前記第2撮像系との光軸間の距離である基線長の伸縮による誤差成分を補正するための第1補正値を算出するステップと、
前記温度差に基づいて、前記第1画像および前記第2画像の倍率の変化による誤差成分を補正するための第2補正値を算出するステップと、
前記第1補正値と前記第2補正値とに基づいて、前記視差を補正するステップと、を含むことを特徴とする視差補正方法。
A stereo camera module comprising: a first imaging system including a first lens; and a second imaging system including a second lens integrally formed with the first lens, and a first image of the subject imaged by the first imaging system. One image and a second image of the subject captured by the second imaging system are input, and a parallax that is a difference between the position of the subject in the first image and the position of the subject in the second image is calculated. A parallax correction method executed in an apparatus that performs:
Calculating a temperature difference that is a difference between a temperature at the time of imaging the first image and the second image and a reference temperature;
Calculating a first correction value for correcting an error component due to expansion / contraction of a baseline length, which is a distance between optical axes of the first imaging system and the second imaging system, based on the temperature difference;
Calculating a second correction value for correcting an error component due to a change in magnification of the first image and the second image based on the temperature difference;
And correcting the parallax based on the first correction value and the second correction value.
JP2011277294A 2011-12-19 2011-12-19 Ranging device, ranging system, ranging program, and parallax correction method Expired - Fee Related JP6060482B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011277294A JP6060482B2 (en) 2011-12-19 2011-12-19 Ranging device, ranging system, ranging program, and parallax correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011277294A JP6060482B2 (en) 2011-12-19 2011-12-19 Ranging device, ranging system, ranging program, and parallax correction method

Publications (2)

Publication Number Publication Date
JP2013127416A true JP2013127416A (en) 2013-06-27
JP6060482B2 JP6060482B2 (en) 2017-01-18

Family

ID=48778030

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011277294A Expired - Fee Related JP6060482B2 (en) 2011-12-19 2011-12-19 Ranging device, ranging system, ranging program, and parallax correction method

Country Status (1)

Country Link
JP (1) JP6060482B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180059245A1 (en) * 2014-10-31 2018-03-01 Rockwell Automation Safety Ag Absolute distance measurement for time-of-flight sensors
CN111985398A (en) * 2020-08-20 2020-11-24 广州洪拓光电技术有限公司 Infrared-assisted binocular distance measurement method and distance compensation heat value acquisition method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006105811A (en) * 2004-10-06 2006-04-20 Fuji Electric Device Technology Co Ltd Semiconductor optical sensor device and distance measurement method
WO2010010707A1 (en) * 2008-07-23 2010-01-28 パナソニック株式会社 Image pickup device and semiconductor circuit element

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006105811A (en) * 2004-10-06 2006-04-20 Fuji Electric Device Technology Co Ltd Semiconductor optical sensor device and distance measurement method
WO2010010707A1 (en) * 2008-07-23 2010-01-28 パナソニック株式会社 Image pickup device and semiconductor circuit element

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180059245A1 (en) * 2014-10-31 2018-03-01 Rockwell Automation Safety Ag Absolute distance measurement for time-of-flight sensors
US10677922B2 (en) * 2014-10-31 2020-06-09 Rockwell Automotive Safety AG Absolute distance measurement for time-of-flight sensors
US11709266B2 (en) 2014-10-31 2023-07-25 Rockwell Automation Safety Ag Absolute distance measurement for time-of-flight sensors
CN111985398A (en) * 2020-08-20 2020-11-24 广州洪拓光电技术有限公司 Infrared-assisted binocular distance measurement method and distance compensation heat value acquisition method
CN111985398B (en) * 2020-08-20 2023-11-28 广州洪拓光电技术有限公司 Infrared auxiliary binocular range finding method and range compensation heat value acquisition method

Also Published As

Publication number Publication date
JP6060482B2 (en) 2017-01-18

Similar Documents

Publication Publication Date Title
JP5549230B2 (en) Ranging device, ranging module, and imaging device using the same
US9681043B2 (en) Multi-camera imaging system, and compensation method for image reconstruction
JP4378434B2 (en) Compound eye camera module
JP6427900B2 (en) Calibration method, calibration system, program, and moving object
JP4510930B2 (en) Imaging device and semiconductor circuit element
JP6537237B2 (en) INFORMATION PROCESSING APPARATUS AND METHOD
EP2902967B1 (en) Stereo camera calibration method, disparity calculating device, and stereo camera
WO2009125577A1 (en) Imaging device, imaging system, and imaging method
JP2011209269A (en) Image pickup apparatus and range obtaining system
US10277799B2 (en) Image capturing apparatus, and control method and storage medium thereof
JP2009250785A (en) Imaging device
WO2016079965A1 (en) Depth detection apparatus, imaging apparatus and depth detection method
JP6060482B2 (en) Ranging device, ranging system, ranging program, and parallax correction method
JP2019132855A (en) Stereo camera calibration method, parallax calculation device, and stereo camera
JP2011147079A (en) Image pickup device
JP5377092B2 (en) Imaging apparatus and distance measuring method
JP2014060621A (en) Optical component alignment device
JP6680335B2 (en) Stereo camera, vehicle, calculation method and program
JP2020165968A (en) Calibration method, calibration device, and program
JP5866779B2 (en) Ranging device and imaging device
JP2005010353A (en) Projector
JP3745056B2 (en) Ranging position adjustment device
JP2021148450A (en) Width measurement device
JP2006029983A (en) Displacement measuring device
JP5489607B2 (en) Imaging device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141118

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150903

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150915

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151106

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160412

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160608

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20161128

R151 Written notification of patent or utility model registration

Ref document number: 6060482

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees