JP2015121430A - Distance image creation device and distance image creation method - Google Patents

Distance image creation device and distance image creation method Download PDF

Info

Publication number
JP2015121430A
JP2015121430A JP2013264337A JP2013264337A JP2015121430A JP 2015121430 A JP2015121430 A JP 2015121430A JP 2013264337 A JP2013264337 A JP 2013264337A JP 2013264337 A JP2013264337 A JP 2013264337A JP 2015121430 A JP2015121430 A JP 2015121430A
Authority
JP
Japan
Prior art keywords
pixel
distance value
distance
calculated
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
JP2013264337A
Other languages
Japanese (ja)
Other versions
JP6312420B2 (en
Inventor
悠介 矢田
Yusuke Yada
悠介 矢田
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.)
Stanley Electric Co Ltd
Original Assignee
Stanley Electric 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 Stanley Electric Co Ltd filed Critical Stanley Electric Co Ltd
Priority to JP2013264337A priority Critical patent/JP6312420B2/en
Publication of JP2015121430A publication Critical patent/JP2015121430A/en
Application granted granted Critical
Publication of JP6312420B2 publication Critical patent/JP6312420B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Measurement Of Optical Distance (AREA)
  • Optical Radar Systems And Details Thereof (AREA)

Abstract

PROBLEM TO BE SOLVED: To accurately calculate, in a light flying time type distance image sensor, a distance value of a structure with inclination or a moving object with inclination with a compact and inexpensive device without causing a reduction in processing speed and frame rate.SOLUTION: A distance image creation device estimates, for a pixel of which distance value cannot be calculated due to the presence of inclination of a reflection surface of an object, a distance value of the pixel by using a distance value and a brightness value of a neighboring pixel of which distance value has been successfully calculated. The distance image creation device specifies the inclination direction of the reflection surface of the object, calculates the inclination of the reflection surface, and performs the estimation by using the inclination.

Description

本発明は、光飛行時間型距離画像センサを用いた距離画像生成技術に関し、特に、フレア現象の影響を補正する技術に関する。   The present invention relates to a distance image generation technique using an optical time-of-flight distance image sensor, and more particularly to a technique for correcting the influence of a flare phenomenon.

光飛行型距離画像センサを用いて、撮影対象空間の対象物の、当該センサからの距離を画素値とする距離画像を生成する距離画像生成装置がある。その中で、光飛行時間型(TOF方式:Time Of Flight方式)距離画像センサは、変調光を出射する光源とそれを受光する受光素子とからなり、変調光を出射し、画素毎に受光した反射光を元に距離値を算出する(例えば、特許文献1参照)。受光した変調光の反射光により生じる電荷を、変調光の変調周波数に同期させ、電荷を振り分ける振り分け型のTOF方式もある(例えば、特許文献2参照)。   There is a distance image generation device that generates a distance image having a pixel value of a distance from an object in an imaging target space using the optical flight distance image sensor. Among them, a time-of-flight type (TOF method: Time Of Flight method) distance image sensor is composed of a light source that emits modulated light and a light receiving element that receives the modulated light. The modulated light is emitted and received for each pixel. A distance value is calculated based on the reflected light (see, for example, Patent Document 1). There is also a sorting-type TOF method in which charges generated by reflected light of received modulated light are synchronized with the modulation frequency of the modulated light and the charges are distributed (see, for example, Patent Document 2).

物体の距離値を算出するためには、必ず物体からの反射光を受光する必要がある。しかしながら、物体が極度の傾斜を持つ場合、変調光の反射光が戻ってこず、傾斜部分の大部分に関して距離値を算出できないことがある。この問題は能動方式の距離画像センサすべてにおいて起こり得る。特に、表面が鏡面のように表面荒れによる乱反射や散乱のない物体の場合ほど顕著に起こる。   In order to calculate the distance value of an object, it is necessary to receive reflected light from the object. However, when the object has an extreme inclination, the reflected light of the modulated light does not return and the distance value may not be calculated for most of the inclined part. This problem can occur in all active range image sensors. In particular, this occurs more markedly in the case of an object that has no irregular reflection or scattering due to surface roughness such as a mirror surface.

これを解決するため、レーザセンサにおいて、予め取得した背景データと、異なった位置の複数のレーザセンサから物体位置を検出する手法がある(例えば、特許文献3参照)。また、予め検出物体の距離情報・勾配情報を保存しておき、測定した距離情報から勾配情報を算出し、整合をとり、物体を検出する手法がある(例えば、特許文献4参照)。さらに、物体が傾斜している場合の低反射状態での検出精度を高めるため、低強度の反射光を受光した場合のノイズによる影響が小さくなるよう受光部を改良し、距離精度を高める手法がある(例えば、特許文献5参照)。   In order to solve this, there is a method of detecting an object position from a plurality of laser sensors at different positions from background data acquired in advance in a laser sensor (see, for example, Patent Document 3). In addition, there is a method in which distance information / gradient information of a detected object is stored in advance, gradient information is calculated from the measured distance information, alignment is performed, and an object is detected (see, for example, Patent Document 4). Furthermore, in order to improve the detection accuracy in the low reflection state when the object is tilted, there is a method for improving the distance accuracy by improving the light receiving unit so that the influence of noise when receiving low intensity reflected light is reduced. Yes (see, for example, Patent Document 5).

特開2005−235893号公報JP 2005-235893 A 特開2011−179925号公報JP 2011-179925 A 特開2009−85927号公報JP 2009-85927 A 特開2006−145352号公報JP 2006-145352 A 特開2006−084429号公報JP 2006-084429 A

特許文献3に記載の手法では、予め背景データが必要となる。従って、車両に設置する場合など、頻繁に背景が変化する状況では用いることが出来ない。さらに、複数のセンサを使用するため、装置が大型になり価格も高くなる。また、複数のセンサを用いるため、処理が膨大なものとなりフレームレートの低下を招く。   The technique described in Patent Document 3 requires background data in advance. Therefore, it cannot be used in situations where the background changes frequently, such as when installed in a vehicle. Furthermore, since a plurality of sensors are used, the apparatus becomes large and the price is high. Further, since a plurality of sensors are used, the processing becomes enormous and the frame rate is lowered.

特許文献4に記載の手法では、テンプレートとして、予め元画像情報をもつことが必須となる。そのため、特定の物体のみしか検出することができない。また、予めデータを保持する必要があるため、処理情報が増加する。   In the method described in Patent Document 4, it is essential to have original image information in advance as a template. Therefore, only a specific object can be detected. Moreover, since it is necessary to hold data in advance, processing information increases.

特許文献5に記載の手法では、受光部の改良が必要となり、センサの価格が向上する。また、構造が複雑となるため、作製も難しい。また、反射光自体を受光できない場合、距離値の算出もできない。   In the method described in Patent Document 5, the light receiving unit needs to be improved, and the price of the sensor is increased. In addition, since the structure is complicated, it is difficult to manufacture. Further, when the reflected light itself cannot be received, the distance value cannot be calculated.

本発明は、上記事情に鑑みてなされたもので、光飛行時間型距離画像センサにおいて、傾斜を持つ構造物、もしくは傾斜をもつ動物体であっても、処理速度やフレームレートの低下を招くことなく、小型で安価な装置で、精度よく距離値を算出することを目的とする。   The present invention has been made in view of the above circumstances, and in a time-of-flight distance image sensor, even if it is a structure having an inclination or an animal body having an inclination, the processing speed and the frame rate are reduced. The objective is to calculate the distance value with a small and inexpensive device with high accuracy.

本発明は、対象物の反射面が傾斜を有することにより距離値を算出できない画素について、近傍の距離値を算出できた画素の距離値および輝度値を用いて、当該画素の距離値を推定する。推定は、対象物の反射面の傾斜方向を特定し、反射面の傾きを算出し、その傾きを用いて行う。   The present invention estimates a distance value of a pixel using a distance value and a luminance value of a pixel for which a distance value of a neighborhood can be calculated for a pixel for which a distance value cannot be calculated due to the reflection surface of the object having an inclination. . The estimation is performed by specifying the inclination direction of the reflection surface of the object, calculating the inclination of the reflection surface, and using the inclination.

具体的には、対象空間に変調した変調光を照射する光源部と、前記光源部から照射され、前記対象空間内の対象物の表面で反射した反射光を含む入射光を受光して電荷に変換する、画素毎に設けられた光電変換素子と、前記光電変換素子ごとに複数設けられた電荷蓄積部と、前記変調光の変調に同期して、前記光電変換素子により変換された電荷を前記複数の電荷蓄積部に振り分ける電荷振分部と、を備える距離画像生成装置における距離画像生成方法であって、前記電荷蓄積部に蓄積された電荷を用いて画素値が輝度値である輝度画像を生成するとともに、前記複数の電荷蓄積部に蓄積された電荷を用いて画素値が距離値である距離画像を生成する画像生成ステップと、前記対象物の表面に傾斜があることにより前記距離値が得られない距離値未算出画素の距離値を、当該距離値未算出画素の近傍の画素の前記輝度値および前記距離値を用いて算出する距離値算出ステップと、を含むことを特徴とする距離画像生成方法を提供する。   Specifically, a light source unit that irradiates modulated light to the target space, and incident light including reflected light that is irradiated from the light source unit and reflected by the surface of the target object in the target space is received and charged. The photoelectric conversion element provided for each pixel to be converted, a plurality of charge storage units provided for each photoelectric conversion element, and the charge converted by the photoelectric conversion element in synchronization with the modulation of the modulated light A distance image generation method in a distance image generation device including a charge distribution unit that distributes to a plurality of charge storage units, wherein a luminance image whose pixel value is a luminance value using charges stored in the charge storage unit An image generation step of generating a distance image having a pixel value as a distance value using the charges accumulated in the plurality of charge accumulation units, and the distance value is determined by the inclination of the surface of the object. Unacceptable distance A distance value calculating step of calculating a distance value of a pixel whose value has not been calculated by using the luminance value and the distance value of a pixel in the vicinity of the pixel whose distance value has not been calculated. provide.

また、対象空間に変調した変調光を照射する光源部と、前記光源部から照射され、前記対象空間内の対象物の表面で反射した反射光を含む入射光を受光して電荷に変換する、画素毎に設けられた光電変換素子と、前記光電変換素子ごとに複数設けられた電荷蓄積部と、
前記変調光の変調に同期して、前記光電変換素子により変換された電荷を前記複数の電荷蓄積部に振り分ける電荷振分部と、前記電荷蓄積部に蓄積された電荷を用いて画素値が輝度値である輝度画像を生成する輝度画像生成部と、前記複数の電荷蓄積部に蓄積された電荷を用いて画素値が距離値である距離画像を生成する距離画像生成部と、を備え、前記距離画像生成部は、前記対象物の表面に傾斜があることにより前記距離値が得られない距離値未算出画素の距離値を、当該距離値未算出画素の近傍の画素の前記輝度値および前記距離値を用いて算出する距離値算出部を備えることを特徴とする距離画像生成装置を提供する。
In addition, a light source unit that irradiates modulated light that is modulated into the target space, and incident light including reflected light that is irradiated from the light source unit and reflected by the surface of the target object in the target space is received and converted into charges. A photoelectric conversion element provided for each pixel; a plurality of charge storage units provided for each photoelectric conversion element;
In synchronism with the modulation of the modulated light, the charge distribution unit that distributes the charges converted by the photoelectric conversion element to the plurality of charge storage units, and the pixel value using the charges stored in the charge storage units A luminance image generation unit that generates a luminance image that is a value; and a distance image generation unit that generates a distance image whose pixel value is a distance value using charges accumulated in the plurality of charge accumulation units, The distance image generation unit obtains the distance value of a distance value uncalculated pixel for which the distance value cannot be obtained due to the inclination of the surface of the object, the luminance value of the pixel in the vicinity of the distance value uncalculated pixel, and the Provided is a distance image generation device including a distance value calculation unit that calculates using a distance value.

本発明によれば、光飛行時間型距離画像センサにおいて、傾斜を持つ構造物、もしくは傾斜をもつ動物体であっても、処理速度やフレームレートの低下を招くことなく、小型で安価な装置で、精度よく距離値を算出できる。   According to the present invention, in a time-of-flight distance image sensor, even a structure having an inclination or an animal body having an inclination is a small and inexpensive device without causing a reduction in processing speed and frame rate. The distance value can be calculated with high accuracy.

本発明の実施形態の距離画像生成装置のブロック図である。It is a block diagram of the distance image generation device of the embodiment of the present invention. 本発明の実施形態の変調信号とゲート信号との関係を説明するための説明図である。It is explanatory drawing for demonstrating the relationship between the modulation signal and gate signal of embodiment of this invention. 光飛行時間型距離画像生成装置による距離画像生成の原理を説明するための説明図である。It is explanatory drawing for demonstrating the principle of the distance image generation by the optical time-of-flight distance image generation apparatus. (a)および(b)は、光飛行時間型距離画像生成装置において、対象物の反射面に傾きがある場合、距離値が得られないことを説明するための説明図である。(A) And (b) is explanatory drawing for demonstrating that a distance value is not obtained in the optical time-of-flight distance image generation device, when the reflective surface of a target object has inclination. 光飛行時間型距離画像生成装置において、対象物の反射面に傾きがある場合、距離値が得られないことを説明するための説明図である。It is explanatory drawing for demonstrating that a distance value cannot be obtained in the optical time-of-flight distance image generation device, when the reflective surface of a target object has inclination. 光飛行時間型距離画像生成装置において、対象物の反射面に傾きがある場合、距離値が得られないことを説明するための説明図である。It is explanatory drawing for demonstrating that a distance value cannot be obtained in the optical time-of-flight distance image generation device, when the reflective surface of a target object has inclination. (a)は、光飛行時間型距離画像生成装置と対象物との配置を説明するための説明図であり、(b)および(c)は、それぞれ、(a)に示す配置で撮像した際に得られる距離画像および輝度画像を説明するための説明図である。(A) is explanatory drawing for demonstrating arrangement | positioning with a time-of-flight type distance image generation apparatus and a target object, (b) and (c) are each when imaged by the arrangement | positioning shown to (a). It is explanatory drawing for demonstrating the distance image and brightness | luminance image which are obtained. 本実施形態の距離画像生成装置で得られる距離画像および輝度画像の画素位置を説明するための説明図である。It is explanatory drawing for demonstrating the pixel position of the distance image and luminance image which are obtained with the distance image generation device of this embodiment. 本実施形態の、1つの画素に対する推定距離値算出処理のフローチャートである。It is a flowchart of the estimation distance value calculation process with respect to one pixel of this embodiment. 本実施形態の傾斜方向判別処理のフローチャートである。It is a flowchart of the inclination direction discrimination | determination process of this embodiment. (a)は、本実施形態のメモリXの格納領域を、(b)は、本実施形態のメモリYの格納領域を、それぞれ説明するための説明図である。(A) is an explanatory view for explaining a storage area of the memory X of the present embodiment, and (b) is an explanatory diagram for explaining a storage area of the memory Y of the present embodiment. 本実施形態の−X方向推定距離値算出処理のフローチャートである。It is a flowchart of -X direction estimation distance value calculation processing of this embodiment. 本実施形態の−Y方向推定距離値算出処理のフローチャートである。It is a flowchart of -Y direction estimated distance value calculation processing of this embodiment. 本実施形態の+X方向推定距離値算出処理のフローチャートである。It is a flowchart of + X direction estimated distance value calculation processing of the present embodiment. 本実施形態の+Y方向推定距離値算出処理のフローチャートである。It is a flowchart of + Y direction estimated distance value calculation processing of the present embodiment. 本実施形態の推定距離値算出処理の具体例1を説明するための説明図である。It is explanatory drawing for demonstrating the specific example 1 of the estimated distance value calculation process of this embodiment. 本実施形態の推定距離値算出処理の具体例2を説明するための説明図である。It is explanatory drawing for demonstrating the specific example 2 of the estimated distance value calculation process of this embodiment. 本実施形態の推定距離値算出処理の具体例3を説明するための説明図である。It is explanatory drawing for demonstrating the specific example 3 of the estimated distance value calculation process of this embodiment. 本実施形態の推定距離値算出処理の具体例4を説明するための説明図である。It is explanatory drawing for demonstrating the specific example 4 of the estimated distance value calculation process of this embodiment. 本実施形態の距離画像生成処理のフローチャートである。It is a flowchart of the distance image generation process of this embodiment. 本実施形態の本発明の変形例の変調信号とゲート信号との関係を説明するための説明図である。It is explanatory drawing for demonstrating the relationship between the modulation signal and gate signal of the modification of this invention of this embodiment. 本実施形態の本発明の変形例の変調信号とゲート信号との関係を説明するための説明図である。It is explanatory drawing for demonstrating the relationship between the modulation signal and gate signal of the modification of this invention of this embodiment.

以下、本発明を適用する実施形態について説明する。以下、本発明の実施形態を説明するための全図において、同一機能を有するものは同一符号を付し、その繰り返しの説明は省略する。   Hereinafter, embodiments to which the present invention is applied will be described. Hereinafter, in all the drawings for explaining the embodiments of the present invention, those having the same function are denoted by the same reference numerals, and repeated explanation thereof is omitted.

<距離画像生成装置構成>
まず、本実施形態の距離画像生成装置の構成を説明する。図1は、本実施形態の距離画像生成装置の機能ブロック図である。
<Distance image generator configuration>
First, the configuration of the distance image generation device of this embodiment will be described. FIG. 1 is a functional block diagram of the distance image generation apparatus of the present embodiment.

本図に示すように、本実施形態の距離画像生成装置100は、照射される変調光111と入射光112との位相差を用いて距離画像を生成するもので、光源部110と、光電変換部120と、電荷振分部130と、制御部140と、電荷蓄積部150と、輝度画像生成部160と、推定距離値算出部171を含む距離画像生成部170と、を備える。   As shown in the figure, the distance image generating apparatus 100 of the present embodiment generates a distance image using a phase difference between irradiated modulated light 111 and incident light 112, and includes a light source unit 110, photoelectric conversion, and the like. Unit 120, charge distribution unit 130, control unit 140, charge storage unit 150, luminance image generation unit 160, and distance image generation unit 170 including an estimated distance value calculation unit 171.

なお、本実施形態の距離画像生成装置100は、CPUと、メモリと、記憶装置とを備える。電荷振分部130、制御部140、輝度画像生成部160、および、距離画像生成部170は、CPUが、予め記憶装置に格納されたプログラムを、メモリにロードして実行することにより実現される。   Note that the distance image generation device 100 of this embodiment includes a CPU, a memory, and a storage device. The charge distribution unit 130, the control unit 140, the luminance image generation unit 160, and the distance image generation unit 170 are realized by the CPU loading a program stored in the storage device in advance into the memory and executing it. .

光源部110は、後述する制御部140の制御に従って、対象空間に変調光(例えば、正弦波もしくは矩形波等で高速に変調させた赤外光もしくは可視光)111を照射する発光源である。光源110には、LED等の高速変調が可能なデバイスが用いられる。   The light source unit 110 is a light source that irradiates the target space with modulated light (for example, infrared light or visible light modulated at high speed with a sine wave or a rectangular wave) under the control of the control unit 140 described later. As the light source 110, a device capable of high-speed modulation such as an LED is used.

光電変換部120は、光源部110から照射された変調光111が対象空間(距離画像生成装置100の視野)内の対象物113で反射された反射光を含む入射光112を受光し、電荷に変換する。光電変換部120は、受光量に応じた電荷に変換する複数の光電変換素子を備える。この光電変換素子が画素を形成する。このため、各光電変換素子は、輝度画像および距離画像の各画素に対応づけて規則的に配列されるこの光電変換部120の前には、レンズが配置されてもよい。   The photoelectric conversion unit 120 receives incident light 112 including reflected light, which is reflected from the object 113 in the target space (the field of view of the distance image generation device 100), of the modulated light 111 emitted from the light source unit 110, and converts it into electric charges. Convert. The photoelectric conversion unit 120 includes a plurality of photoelectric conversion elements that convert charges according to the amount of received light. This photoelectric conversion element forms a pixel. Therefore, each photoelectric conversion element may be provided with a lens in front of the photoelectric conversion unit 120 that is regularly arranged in association with each pixel of the luminance image and the distance image.

電荷振分部130は、後述する制御部140の制御に従って、光電変換部120が変換した電荷を後述する電荷蓄積部150に振り分ける。振り分けは、光電変換素子毎に行う。   The charge distribution unit 130 distributes the charges converted by the photoelectric conversion unit 120 to the charge storage unit 150 (to be described later) under the control of the control unit 140 (to be described later). The sorting is performed for each photoelectric conversion element.

電荷蓄積部150は、電荷振分部130が振り分けた電荷を蓄積する。距離情報である変調光111と入射光112との位相差は、電荷蓄積部150に蓄積された電荷を用いて算出する。この位相差を算出するためには、少なくとも3つ以上の位相情報(電荷蓄積部に蓄積された電荷)が必要である。   The charge storage unit 150 stores the charge distributed by the charge distribution unit 130. The phase difference between the modulated light 111 and the incident light 112, which is distance information, is calculated using the charges accumulated in the charge accumulation unit 150. In order to calculate this phase difference, at least three or more pieces of phase information (charges accumulated in the charge accumulation unit) are necessary.

3つ以上の位相情報の取得は、1つの電荷蓄積部150により実現してもよいし、複数の電荷蓄積部150により実現してもよい。以下、本実施形態では、具体例は、この電荷蓄積部150を4つとして説明する。これらの4つの電荷蓄積部150を区別する必要がある場合は、それぞれ、151、152、153、154とする。この4つ1組の電荷蓄積部150が、画素毎に設けられる。   The acquisition of three or more pieces of phase information may be realized by one charge storage unit 150 or may be realized by a plurality of charge storage units 150. Hereinafter, in this embodiment, a specific example will be described assuming that there are four charge storage units 150. When it is necessary to distinguish these four charge storage units 150, they are denoted as 151, 152, 153, and 154, respectively. This set of four charge storage units 150 is provided for each pixel.

位相情報を取得する1以上の電荷蓄積部150は、画素(光電変換素子)毎に設けられる。なお、電荷蓄積部150には、電荷そのものを蓄積してもよいし、この電荷量をAD変換後のデータを蓄積してもよい。以下、本実施形態では、電荷そのものも、AD変換後のデータも、特に区別することなく電荷蓄積部150に蓄積されるものを電荷と呼ぶ。   One or more charge storage units 150 that acquire phase information are provided for each pixel (photoelectric conversion element). The charge storage unit 150 may store the charge itself, or may store data after AD conversion of this charge amount. In the present embodiment, what is stored in the charge storage unit 150 without distinction between the charge itself and the data after AD conversion is referred to as a charge.

制御部140は、光源部110と電荷振分部130とを同期制御する。制御は、変調信号とゲート信号とにより行う。   The control unit 140 controls the light source unit 110 and the charge distribution unit 130 in synchronization. Control is performed by the modulation signal and the gate signal.

変調信号は、変調光の変調および出力タイミングを指示する信号であり、光源部110に向けて出力される。光源部110は、変調信号により変調された変調光111を生成し、対象空間に照射する。照射された変調光111は、対象物113により反射され、反射光となる。反射光は、入射光112として光電変換部120に入射し、電荷に変換されて電荷振分部130に送られる。   The modulation signal is a signal that instructs modulation and output timing of the modulated light, and is output toward the light source unit 110. The light source unit 110 generates modulated light 111 modulated by the modulation signal and irradiates the target space. The irradiated modulated light 111 is reflected by the object 113 and becomes reflected light. The reflected light enters the photoelectric conversion unit 120 as incident light 112, is converted into charges, and is sent to the charge distribution unit 130.

ゲート信号は、各電荷蓄積部150への電荷の振り分けを指示する信号で、電荷振分部130に向けて出力される。電荷振分部130は、ゲート信号に応じて各電荷蓄積部150(151、152、153、154)に電荷を振り分ける。   The gate signal is a signal for instructing the charge distribution to each charge storage unit 150 and is output toward the charge distribution unit 130. The charge distribution unit 130 distributes the charges to the charge storage units 150 (151, 152, 153, 154) according to the gate signal.

制御部140は、光源部110の変調周期に同期し、変調周期と電荷振分部130の個数応じた時間だけずらしたゲート信号を生成する。例えば、変調周期が10MHzで電荷蓄積部が4つであれば、変調周期を4分割した時間(25ns)ずつずらしたタイミングでゲート信号を生成する。これにより、電荷は、ゲート信号に応じて、それぞれの電荷蓄積部150に振り分けられる。   The control unit 140 generates a gate signal that is synchronized with the modulation period of the light source unit 110 and is shifted by a time corresponding to the modulation period and the number of the charge distribution units 130. For example, if the modulation period is 10 MHz and there are four charge storage units, the gate signal is generated at a timing that is shifted by a time (25 ns) obtained by dividing the modulation period into four. As a result, the charge is distributed to each charge storage unit 150 in accordance with the gate signal.

本実施形態の変調信号およびゲート信号の出力タイミングの一例を図2に示す。ここでは、変調信号の1周期Tqを4当分した期間に、それぞれ、4つの電荷蓄積部150に順に電荷を振り分ける場合の、変調信号114およびゲート信号115を示す。   An example of the output timing of the modulation signal and the gate signal of this embodiment is shown in FIG. Here, the modulation signal 114 and the gate signal 115 are shown in the case where charges are sequentially distributed to the four charge storage units 150 in a period obtained by dividing one period Tq of the modulation signal by four.

また、制御部140は、輝度画像生成部160および距離画像生成部170に読出信号を送信し、電荷蓄積部150に蓄積された電荷を、それぞれ読みださせる。なお、変調光111の変調周波数は数十MHzである。従って、変調の1周期は数十ns程度となる。距離画像を得るためには、数百〜数十万周期の電荷蓄積時間を要する。本実施形態の制御部140は、この電荷蓄積時間単位で、輝度画像生成部160および距離画像生成部170が、電荷蓄積部150から電荷を読み出すよう、読出信号を出力する。   In addition, the control unit 140 transmits a read signal to the luminance image generation unit 160 and the distance image generation unit 170 to read out the charges accumulated in the charge accumulation unit 150, respectively. Note that the modulation frequency of the modulated light 111 is several tens of MHz. Therefore, one modulation period is about several tens of ns. In order to obtain a distance image, a charge accumulation time of several hundred to several hundred thousand cycles is required. The control unit 140 according to the present embodiment outputs a read signal so that the luminance image generation unit 160 and the distance image generation unit 170 read charges from the charge storage unit 150 in units of the charge storage time.

なお、変調信号とゲート信号と読出信号とを合わせて制御信号と呼ぶ。   The modulation signal, the gate signal, and the readout signal are collectively referred to as a control signal.

輝度画像生成部160は、各電荷蓄積部150に蓄積された電荷から、各画素の輝度値を算出し、算出した輝度値を画素値とする輝度画像を生成する。算出の詳細は、後述する。   The luminance image generation unit 160 calculates the luminance value of each pixel from the charges stored in each charge storage unit 150, and generates a luminance image using the calculated luminance value as a pixel value. Details of the calculation will be described later.

距離画像生成部170は、各電荷蓄積部150に蓄積された電荷から、各画素の距離値を算出し、算出した距離値を画素値とする距離画像を生成する。距離値は、視野内の、対象物までの距離の値である。算出の詳細は、後述する。   The distance image generation unit 170 calculates a distance value of each pixel from the charges stored in each charge storage unit 150, and generates a distance image using the calculated distance value as a pixel value. The distance value is a value of the distance to the object in the visual field. Details of the calculation will be described later.

<TOF方式の距離画像生成の原理>
ここで、光飛行時間型(TOF方式)の距離画像生成装置100における距離画像生成の原理を説明する。図3は、距離画像生成の原理を説明するための図である。
<Principle of TOF method of distance image generation>
Here, the principle of distance image generation in the time-of-flight (TOF method) distance image generation apparatus 100 will be described. FIG. 3 is a diagram for explaining the principle of distance image generation.

光源部110から出射される変調光111の強度が本図のような正弦曲線を描くように変化する場合、光電変換部120への入射光112の強度も同様に正弦曲線を描くよう変化する。このとき、変調光111と入射光112とには、光が対象物まで往復する飛行時間による位相の遅延(位相差φ)が生じる。   When the intensity of the modulated light 111 emitted from the light source unit 110 changes so as to draw a sine curve as shown in the figure, the intensity of the incident light 112 to the photoelectric conversion unit 120 also changes so as to draw a sine curve. At this time, the modulated light 111 and the incident light 112 have a phase delay (phase difference φ) due to the time of flight of the light traveling back and forth to the object.

光の速度cは既知であるため、この位相差φと変調周波数fとを用い、対象物までの距離値Dは、以下の式(1)で求めることができる。
Since the speed c of light is known, the distance value D to the object can be obtained by the following formula (1) using the phase difference φ and the modulation frequency f.

従って、位相差φがわかれば、距離値Dは求めることができる。本実施形態では、変調光の1周期Tpを4等分し、それぞれの期間に電荷量を、それぞれ、4つの電荷蓄積部150に蓄積する。   Therefore, if the phase difference φ is known, the distance value D can be obtained. In the present embodiment, one period Tp of the modulated light is divided into four equal parts, and the charge amount is accumulated in the four charge accumulation units 150 in each period.

変調光111と入射光112との位相差φは、変調光111の1周期を4等分した各期間をTq(T1、T2、T3、T4)とし、それぞれの期間に蓄積される電荷量をC1、C2、C3、C4とすると、以下の式(2)で表される。
なお、1周期Tpを4等分した各期間Tq(T1、T2、T3、T4)は、例えば、0度から90度の間、90度から180度の間、180度から270度の間、270度から0度の間とする。
The phase difference φ between the modulated light 111 and the incident light 112 is defined as Tq (T1, T2, T3, T4) where each period obtained by dividing one period of the modulated light 111 into four equal parts, and the amount of charge accumulated in each period. Assuming C1, C2, C3, and C4, they are represented by the following formula (2).
Each period Tq (T1, T2, T3, T4) obtained by dividing one period Tp into four is, for example, between 0 degrees and 90 degrees, between 90 degrees and 180 degrees, between 180 degrees and 270 degrees, Between 270 degrees and 0 degrees.

距離画像生成部170は、上述の電荷蓄積時間間隔で蓄積された各電荷量C1、C2、C3、C4を用い、画素毎に、式(2)に従って位相差φを求める。そして、求めた位相差φを用いて、式(1)に従って、対象物113までの距離値Dを求め、距離値を画素値とする距離画像を生成する。   The distance image generation unit 170 uses the charge amounts C1, C2, C3, and C4 accumulated at the above-described charge accumulation time interval to obtain the phase difference φ for each pixel according to the equation (2). Then, using the obtained phase difference φ, a distance value D to the object 113 is obtained according to the equation (1), and a distance image having the distance value as a pixel value is generated.

また、本実施形態の輝度画像生成部160は、各電荷蓄積部150に蓄積された電荷(C1、C2、C3、C4)を用いて、画素毎に、輝度値を算出する。輝度値の算出方法は、電荷量を相対的な値に変換するものであれよく、特に規定しない。例えば、以下の式(3)に従って、輝度値Bを求め、輝度値を画素値とする輝度画像を生成する。
B=C1+C2+C3+C4 ・・・(3)
In addition, the luminance image generation unit 160 according to the present embodiment calculates a luminance value for each pixel using the charges (C1, C2, C3, and C4) accumulated in each charge accumulation unit 150. The method for calculating the luminance value may be a method for converting the charge amount into a relative value, and is not particularly defined. For example, the luminance value B is obtained according to the following equation (3), and a luminance image having the luminance value as a pixel value is generated.
B = C1 + C2 + C3 + C4 (3)

なお、電荷蓄積時間Tf間隔毎に得られる1枚の距離画像および輝度画像をフレームと呼ぶ。また、電荷蓄積時間Tfを、1フレーム時間Tfと呼ぶ。   A single distance image and luminance image obtained at every charge accumulation time Tf interval are referred to as a frame. The charge accumulation time Tf is referred to as 1 frame time Tf.

<傾斜面により距離値が算出できない理由>
TOF方式の距離画像生成装置100では、上述のように、光源部110から照射された変調光111が、対象物113で反射され、光電変換部120で受光される。そして、距離画像生成部170が、その反射光(入射光112)の位相差より距離値を算出する。この様子を図4(a)に示す。このため、反射光を受光できない場合は、原理的に距離値を算出することは出来ない。
<Reason why distance value cannot be calculated due to inclined surface>
In the TOF range image generation apparatus 100, the modulated light 111 emitted from the light source unit 110 is reflected by the object 113 and received by the photoelectric conversion unit 120 as described above. Then, the distance image generation unit 170 calculates a distance value from the phase difference of the reflected light (incident light 112). This is shown in FIG. For this reason, if the reflected light cannot be received, the distance value cannot be calculated in principle.

例えば、図4(b)対象物113の、反射面が極度の傾斜を持つ場合、傾斜の一部分からの反射光しか受光できないことがある。この場合、実際には、対象物113があるにもかかわらず、距離値が算出できない。   For example, when the reflection surface of the object 113 in FIG. 4B has an extreme inclination, only reflected light from a part of the inclination may be received. In this case, the distance value cannot actually be calculated despite the presence of the object 113.

具体的に説明すると、以下のとおりである。   Specifically, it is as follows.

仮に、本実施形態の距離画像生成装置100の画素数をN×N(Nは1以上の整数)とし、画角をθとする。1画素あたりの水平および垂直方向の撮像範囲は、θ/Nの範囲である。よって、中央画素からn番目の画素(nは1以上N以下の整数)の撮像範囲は、(n−1)×θ/Nからn×θ/Nである。なお、距離画像生成装置100の受光面に鉛直方向を0度とする。   Assume that the number of pixels of the distance image generating apparatus 100 of the present embodiment is N × N (N is an integer of 1 or more), and the angle of view is θ. The imaging range in the horizontal and vertical directions per pixel is a range of θ / N. Therefore, the imaging range of the nth pixel (n is an integer of 1 to N) from the central pixel is from (n−1) × θ / N to n × θ / N. The vertical direction on the light receiving surface of the distance image generating device 100 is set to 0 degree.

図5に示すように、距離画像生成装置100の光源部110から照射された光が前方の対象物113に反射し、n番目の画素(に対応して配置される光電変換素子)に入射されるためには、対象物113の反射面となる表面の傾きが、(90−n×θ/2)/2度未満である必要がある。なお、対象物113は鏡面平板とする。このため、対象物113の反射面が、(90−n×θ/2)/2度以上の傾斜を持つ場合、n番目の画素において反射光を受光できず、距離値を算出できない。   As shown in FIG. 5, the light emitted from the light source unit 110 of the distance image generation device 100 is reflected by the front object 113 and is incident on the nth pixel (a photoelectric conversion element arranged correspondingly). In order to achieve this, the inclination of the surface serving as the reflecting surface of the object 113 needs to be less than (90−n × θ / 2) / 2 degrees. The object 113 is a mirror flat plate. For this reason, when the reflecting surface of the object 113 has an inclination of (90−n × θ / 2) / 2 degrees or more, the nth pixel cannot receive the reflected light and the distance value cannot be calculated.

また、図6に示すように、距離画像生成装置100の受光面に対し、対象物113の反射面の傾きがθaであり、距離画像生成装置100と対象物113との距離がDである場合、光源部110の位置は、受光部である光電変換部120センサからD・cos(n×θ/N)・{1+tan(n×θ/N+2θa)}離れた位置に設置する必要がある。   In addition, as illustrated in FIG. 6, when the inclination of the reflection surface of the object 113 is θa with respect to the light receiving surface of the distance image generation device 100, and the distance between the distance image generation device 100 and the object 113 is D. The light source unit 110 needs to be installed at a position away from the photoelectric conversion unit 120 sensor, which is a light receiving unit, by D · cos (n × θ / N) · {1 + tan (n × θ / N + 2θa)}.

従って、傾斜が(90−n×θ/2)/2度未満であったとしても、反射光を得るためには、光源部110を受光部である光電変換部120から十分な距離を離し設置する必要がある。このため、装置自体の大きさを非常に大きくする必要がある。光源部110と光電変換部120との間に、これらの距離を確保できない場合は、受光できず、距離値を算出できない。   Therefore, even if the inclination is less than (90−n × θ / 2) / 2 degrees, the light source unit 110 is placed at a sufficient distance from the photoelectric conversion unit 120 as the light receiving unit in order to obtain reflected light. There is a need to. For this reason, it is necessary to enlarge the size of the device itself. If these distances cannot be secured between the light source unit 110 and the photoelectric conversion unit 120, light cannot be received and the distance value cannot be calculated.

一方、光源部110から照射された変調光111の反射光は受光できなくとも、実際に対象物113は存在するため、周囲の環境光による反射光は、光電変換部120で受光される。そして、それは輝度として出力することができる。   On the other hand, even if the reflected light of the modulated light 111 emitted from the light source unit 110 cannot be received, the object 113 actually exists, and thus the reflected light from the surrounding environmental light is received by the photoelectric conversion unit 120. And it can be output as luminance.

図7(a)〜図7(c)を用いて、距離画像生成装置100で、視野内に反射面に傾斜を持つ対象物113aと傾斜無しの対象物(壁)113bとが含まれる範囲を撮影し、得られる距離画像210と輝度画像220を説明する。図7(a)は、距離画像生成装置100と、対象物113aおよび113bの配置を説明するための図であり、図7(b)は、当該撮像空間の距離画像、図7(c)は、同輝度画像である。   7 (a) to 7 (c), the range image generation apparatus 100 includes a range in which an object 113a having an inclined reflection surface and an object (wall) 113b having no inclination are included in the visual field. A distance image 210 and a luminance image 220 obtained by photographing will be described. FIG. 7A is a diagram for explaining the arrangement of the distance image generation device 100 and the objects 113a and 113b. FIG. 7B is a distance image of the imaging space, and FIG. , The same luminance image.

距離画像210は、対象物113aの反射面の傾斜の一部と、後方の壁113bとの距離値を画素値とする画像である。輝度画像220は、対象物113aの反射面の傾斜の全体と後方の壁113bとによる輝度値を画素値とする画像である。   The distance image 210 is an image in which a distance value between a part of the inclination of the reflection surface of the object 113a and the rear wall 113b is a pixel value. The luminance image 220 is an image having a pixel value as a luminance value by the entire inclination of the reflection surface of the object 113a and the rear wall 113b.

このように、対象物113aの反射面の傾斜に対応する画素の大部分では、輝度値が存在するにもかかわらず、距離値が0となる。距離画像210および輝度画像220の対応する画素値を比べることにより、傾斜により距離値が算出されていないことがわかるとともに、傾斜部分に対応する画素を判別できる。さらに、傾斜の一部では距離値を算出できている。従って、隣接する画素の距離値、あるいは、所定の間隔の画素間の距離値を用い、傾斜の傾きを算出することができる。そして、算出した傾斜の傾きを用い、傾斜部の、未算出の距離値を算出することができる。   As described above, in most of the pixels corresponding to the inclination of the reflection surface of the object 113a, the distance value is 0 although the luminance value exists. By comparing the corresponding pixel values of the distance image 210 and the luminance image 220, it can be seen that the distance value is not calculated by the inclination, and the pixel corresponding to the inclined portion can be determined. Furthermore, a distance value can be calculated for a part of the slope. Therefore, the inclination of the inclination can be calculated using the distance value between adjacent pixels or the distance value between pixels at a predetermined interval. Then, an uncalculated distance value of the inclined portion can be calculated using the calculated inclination of the inclination.

本実施形態では、これを利用し、各画素の輝度値と、距離値を算出できた画素の距離値とを用い、傾斜によって算出できなかった距離値を推定する。すなわち、本実施形態の距離画像生成部170は、図1に示すように、対象物113の反射面に傾きがあることにより距離値が得られない距離値未算出画素の距離値を、推定距離値として算出する推定距離値算出部(距離値算出部)171を備える。推定距離値の算出には、距離値未算出画素の近傍の画素の輝度値と距離値とを用いる。   In the present embodiment, this is used to estimate the distance value that could not be calculated due to the inclination by using the luminance value of each pixel and the distance value of the pixel for which the distance value could be calculated. That is, as shown in FIG. 1, the distance image generation unit 170 according to the present embodiment calculates the distance value of the distance value uncalculated pixels whose distance value cannot be obtained due to the inclination of the reflection surface of the object 113 as the estimated distance. An estimated distance value calculation unit (distance value calculation unit) 171 that is calculated as a value is provided. For the calculation of the estimated distance value, the luminance value and the distance value of the pixels in the vicinity of the pixel whose distance value has not been calculated are used.

推定距離値算出部171は、輝度画像生成部160が生成した輝度画像および距離画像生成部170が生成した距離画像を用い、距離値未算出画素の推定距離値を算出し、距離画像の当該画素の画素値に置き換える。以下、推定距離値算出部171による、推定距離値算出処理について説明する。   The estimated distance value calculation unit 171 uses the luminance image generated by the luminance image generation unit 160 and the distance image generated by the distance image generation unit 170 to calculate an estimated distance value of a pixel whose distance value has not been calculated, and the pixel of the distance image. Replace with the pixel value of. Hereinafter, the estimated distance value calculation process by the estimated distance value calculation unit 171 will be described.

推定距離値算出処理の説明に先立ち、図8に、本実施形態の距離画像生成装置100で得られる距離画像および輝度画像の画素位置300を示す。本図に示すように、本実施形態の距離画像および輝度画像は、X方向N画素、Y方向M画素(N、Mは、ともに1以上の整数)の、N×M画素とする。X方向およびY方向は、直交する。また、それぞれ、図中、右側が+方向、下側が+方向とする。画素位置は1〜N、および、1〜Mの範囲であり、画像の左上を画素位置(1,1)とする。   Prior to the description of the estimated distance value calculation process, FIG. 8 shows a pixel position 300 of the distance image and the luminance image obtained by the distance image generation device 100 of the present embodiment. As shown in the figure, the distance image and the luminance image of the present embodiment are N × M pixels of N pixels in the X direction and M pixels in the Y direction (N and M are integers of 1 or more). The X direction and the Y direction are orthogonal to each other. In the drawing, the right side is the + direction and the lower side is the + direction. The pixel position ranges from 1 to N and 1 to M, and the upper left corner of the image is the pixel position (1, 1).

推定距離値算出処理に先立ち、推定距離値算出部171は、距離画像生成部170および輝度画像生成部160が生成した距離値および輝度値を読み出し、画素位置をアドレスとして、それぞれ、内部のメモリ領域D(メモリD)およびメモリ領域B(メモリB)に保存する。メモリDは、距離値格納領域として、メモリBは輝度値格納領域として、それぞれ、予め確保される。   Prior to the estimated distance value calculation process, the estimated distance value calculation unit 171 reads out the distance value and the luminance value generated by the distance image generation unit 170 and the luminance image generation unit 160, and uses the pixel position as an address, respectively, in an internal memory area. The data is stored in D (memory D) and memory area B (memory B). The memory D is secured in advance as a distance value storage area, and the memory B is secured in advance as a brightness value storage area.

本実施形態の推定距離値算出部171は、予め定めた順に、各画素について、傾斜の有無を判別し、傾斜有と判別された場合は、その傾斜の方向を判別し、それぞれ、推定距離値を算出する推定距離値算出処理を実行する。本実施形態では、X方向にn=1からNの順に、Y方向にm=1からMまで繰り返す。以下、1つの処理対象画素(n,m)に対する、上記推定距離値算出処理の流れを説明する。   The estimated distance value calculation unit 171 of the present embodiment determines the presence / absence of inclination for each pixel in a predetermined order. If it is determined that there is an inclination, the estimated distance value calculation unit 171 determines the direction of the inclination. An estimated distance value calculation process for calculating is performed. In this embodiment, the process is repeated from n = 1 to N in the X direction and from m = 1 to M in the Y direction. Hereinafter, the flow of the estimated distance value calculation process for one processing target pixel (n, m) will be described.

<推定距離値算出処理>
図9に、本実施形態の推定距離値算出部171による処理対象画素(n,m)を対象とする推定距離値算出処理の処理フローを示す。
<Estimated distance value calculation process>
FIG. 9 shows a processing flow of an estimated distance value calculation process for the processing target pixel (n, m) by the estimated distance value calculation unit 171 of the present embodiment.

推定距離値算出部171は、まず、ステップS1001およびステップS1002で、処理対象画素(n,m)が、距離値未算出画素であるか否かを判別する。すなわち、距離値が0である処理対象画素(n,m)の視野内の対象物113の反射面の傾斜の有無を判別する。ここでは、輝度値が予め定めた輝度閾値Bth以上である場合、傾斜有と判別する。これは、距離値が0であっても、輝度値も小さい場合は、視野内の処理対象画素(n,m)に対応する領域に、対象物113がないため、距離値も算出できていないと判断されるためである。   First, in step S1001 and step S1002, the estimated distance value calculation unit 171 determines whether or not the processing target pixel (n, m) is a distance value non-calculated pixel. That is, it is determined whether or not the reflection surface of the object 113 within the field of view of the processing target pixel (n, m) having a distance value of 0 is inclined. Here, if the luminance value is equal to or greater than a predetermined luminance threshold Bth, it is determined that there is an inclination. This is because even when the distance value is 0 and the luminance value is small, the distance 113 cannot be calculated because there is no object 113 in the area corresponding to the processing target pixel (n, m) in the field of view. This is because it is judged.

具体的には、まず、処理対象画素(n,m)の距離値が、0であるか否かを判別する(ステップS1001)。そして、距離値が0である場合、当該処理対象画素(n,m)の輝度値と、予め定めた輝度閾値Bthとを比較し(ステップS1002)、輝度値が輝度閾値Bth以上であれば、傾斜有、すなわち、処理対象画素(n,m)は、距離値未算出画素であると判別する。   Specifically, first, it is determined whether or not the distance value of the processing target pixel (n, m) is 0 (step S1001). If the distance value is 0, the luminance value of the processing target pixel (n, m) is compared with a predetermined luminance threshold Bth (step S1002). If the luminance value is equal to or higher than the luminance threshold Bth, It is discriminated that there is an inclination, that is, the processing target pixel (n, m) is a pixel whose distance value has not been calculated.

なお、ここで用いる輝度閾値Bthは、周囲の環境によって大きく異なるため、一概に値を決定できるものではなく、実際の使用環境化において設定する。   Note that the luminance threshold value Bth used here varies greatly depending on the surrounding environment, and therefore cannot be determined unconditionally, but is set in an actual use environment.

以下、説明を簡単にするために、画素(n,m)の視野にある対象物113の反射面を、単に画素(n,m)の面と略称する。   Hereinafter, in order to simplify the description, the reflection surface of the object 113 in the field of view of the pixel (n, m) is simply referred to as the surface of the pixel (n, m).

ステップS1002において、距離値未算出画素、すなわち、傾斜有と判別された場合、その傾斜がX方向であるか、Y方向であるか、判別する(ステップS1101、S1201)。傾斜方向判別処理の詳細は、後述する。   If it is determined in step S1002 that the distance value has not been calculated, that is, the pixel has an inclination, it is determined whether the inclination is in the X direction or the Y direction (steps S1101 and S1201). Details of the inclination direction determination processing will be described later.

そして、X方向と判別された場合は、−X方向推定距離値算出処理を行い(ステップS1102)、処理対象画素(n,m)の推定距離値Dcを算出し、処理を終了する。−X方向推定距離値算出処理では、処理対象画素(n,m)よりも−X方向の、既に距離値または推定距離値Dcが算出されている画素の距離値を用いて、処理対象画素(n,m)の推定距離値Dcを算出する。処理の詳細は、後述する。   If it is determined that the direction is the X direction, -X direction estimated distance value calculation processing is performed (step S1102), the estimated distance value Dc of the processing target pixel (n, m) is calculated, and the processing ends. In the -X direction estimated distance value calculation processing, the processing target pixel ((X, Y, M)) is processed using the distance value of the pixel whose distance value or estimated distance value Dc has already been calculated in the -X direction. n, m) of the estimated distance value Dc is calculated. Details of the processing will be described later.

また、Y方向と判別された場合は、−Y方向推定距離値算出処理を行い(ステップS1202)、処理対象画素(n,m)の推定距離値Dcを算出し、処理を終了する。−Y方向推定距離値算出処理も、処理対象画素(n,m)よりも−Y方向の、既に距離値または推定距離値Dcが算出されている画素の距離値を用いて、処理対象画素(n,m)の推定距離値Dcを算出する、処理の詳細は、後述する。   On the other hand, if it is determined that the direction is the Y direction, a -Y direction estimated distance value calculation process is performed (step S1202), an estimated distance value Dc of the processing target pixel (n, m) is calculated, and the process ends. -Y direction estimated distance value calculation processing is also performed using a distance value of a pixel whose distance value or estimated distance value Dc has already been calculated in the -Y direction with respect to the processing target pixel (n, m). Details of the process of calculating the estimated distance value Dc of (n, m) will be described later.

一方、傾斜がいずれの方向とも判別できない場合、方向判別不可時処理を行い(ステップS1301)、処理を終了する。   On the other hand, when the inclination cannot be discriminated from any direction, a process when the direction cannot be discriminated is performed (step S1301), and the process ends.

また、ステップS1001で、処理対象画素(n,m)の距離値が0でない場合、当該処理対象画素(n,m)については、推定距離値Dcの算出は不要である。しかしながら、−X方向、または、−Y方向に隣接する画素に、距離値未算出画素がある場合、処理対象画素(n,m)等を用いて未算出の画素の距離値を算出する。   If the distance value of the processing target pixel (n, m) is not 0 in step S1001, it is not necessary to calculate the estimated distance value Dc for the processing target pixel (n, m). However, when there is a distance value uncalculated pixel in a pixel adjacent to the −X direction or the −Y direction, the distance value of the uncalculated pixel is calculated using the processing target pixel (n, m) or the like.

従って、ここでは、まず、−X方向、または、−Y方向に隣接する画素が、距離値未算出画素であるか否かを判別する(ステップS1401)。判別は、推定距離値算出部171が、推定距離値を算出する際に、ワークメモリとして用いる、メモリ領域X(以後、単にメモリXと呼ぶ。)およびメモリ領域Y(以後、単にメモリYと呼ぶ。)を用いて行う。−X方向に隣接する画素(n−1,m)が未算出であるか否かは、メモリXを用いて、−Y方向に隣接する画素(n,m−1)が未算出であるか否かは、メモリYを用いてそれぞれ行う。各メモリ領域の構成の詳細、判別の詳細は、後述する。   Therefore, here, first, it is determined whether or not a pixel adjacent in the −X direction or the −Y direction is a distance value uncalculated pixel (step S1401). In the determination, the estimated distance value calculation unit 171 uses the memory area X (hereinafter simply referred to as “memory X”) and the memory area Y (hereinafter simply referred to as “memory Y”) used as work memory when calculating the estimated distance value. )). Whether or not the pixel (n−1, m) adjacent in the −X direction has not been calculated is whether or not the pixel (n, m−1) adjacent in the −Y direction has not been calculated using the memory X. The determination is made using the memory Y. Details of the configuration of each memory area and details of determination will be described later.

−X方向に隣接する画素(n−1,m)が距離値未算出画素である場合(ステップS1401)、当該画素(n−1,m)の面と、処理対象画素(n,m)の面とが連続しているか否かを判別する(ステップS1402)。判別の詳細は、後述する。   When the pixel (n−1, m) adjacent in the −X direction is a distance value uncalculated pixel (step S1401), the surface of the pixel (n−1, m) and the processing target pixel (n, m) It is determined whether or not the surface is continuous (step S1402). Details of the determination will be described later.

−X方向に隣接する距離値未算出画素(n−1,m)の面と連続している場合、+X方向推定距離値算出処理を行う(ステップS1403)。+X方向推定距離値算出処理では、推定距離値Dc算出対象である−X方向に隣接する距離値未算出画素(n−1,m)よりも、+X方向の、距離値が算出されている画素の距離値を用いて、距離値未算出の画素の推定距離値Dcを算出する。推定距離値Dc算出対象の画素は、当該画素(n−1,m)および当該画素(n−1,m)と連続した面に対応する距離値未算出画素である。処理の詳細は、後述する。   When the distance value non-calculated pixel (n−1, m) adjacent to the −X direction is continuous with the surface, + X direction estimated distance value calculation processing is performed (step S1403). In the + X direction estimated distance value calculation process, the distance value non-calculated pixel (n−1, m) adjacent to the −X direction, which is the estimated distance value Dc calculation target, for which the distance value is calculated in the + X direction Is used to calculate an estimated distance value Dc of a pixel whose distance value has not been calculated. The pixel for which the estimated distance value Dc is to be calculated is a pixel for which the distance value has not been calculated corresponding to the pixel (n−1, m) and a surface continuous with the pixel (n−1, m). Details of the processing will be described later.

ステップS1402で連続面でないと判別された場合、および、+X方向推定距離値算出処理を終えた場合、判別に用いたメモリXをリセットする(ステップS1404)。そして、−Y方向に隣接する画素(n,m−1)が距離値未算出画素であるか否かの判別(ステップS1405)にうつる。なお、ステップS1401で−X方向に隣接する画素(n−1,m)が距離値未算出画素でないと判別された場合も、ステップS1404へ移行する。   If it is determined in step S1402 that the surface is not a continuous surface, and if the + X direction estimated distance value calculation process is completed, the memory X used for the determination is reset (step S1404). Then, it is determined whether or not the pixel (n, m−1) adjacent in the −Y direction is a distance value non-calculated pixel (step S1405). If it is determined in step S1401 that the pixel (n−1, m) adjacent in the −X direction is not a distance value uncalculated pixel, the process proceeds to step S1404.

Y方向に隣接する画素(n,m−1)が距離値未算出画素である場合(ステップS1405)、当該画素(n,m−1)の面と、処理対象画素(n,m)の面とが連続しているか否かを判別する(ステップS1406)。判別の詳細は、後述する。   When the pixel (n, m−1) adjacent in the Y direction is a distance value non-calculated pixel (step S1405), the surface of the pixel (n, m−1) and the surface of the processing target pixel (n, m) Whether or not is continuous (step S1406). Details of the determination will be described later.

−Y方向に隣接する距離値未算出画素(n,m−1)の面と連続している場合、+Y方向推定距離値算出処理を行う(ステップS1407)。+Y方向推定距離値算出処理では、推定距離値Dc算出対象である−Y方向に隣接する距離値未算出画素(n,m−1)よりも、+Y方向の、距離値が算出されている画素の距離値を用いて、距離値未算出画素の推定距離値Dcを算出する。推定距離値Dc算出対象の画素は、当該画素(n,m−1)および当該画素(n,m−1)と連続した面に対応する距離値未算出画素である。処理の詳細は、後述する。   When it is continuous with the surface of the distance value uncalculated pixel (n, m−1) adjacent in the −Y direction, + Y direction estimated distance value calculation processing is performed (step S1407). In the + Y direction estimated distance value calculation process, the distance value non-calculated pixel (n, m−1) adjacent to the −Y direction, which is the estimated distance value Dc calculation target, for which the distance value is calculated in the + Y direction Is used to calculate the estimated distance value Dc of the pixel whose distance value has not been calculated. The pixel for which the estimated distance value Dc is to be calculated is a pixel for which the distance value has not yet been calculated, corresponding to the pixel (n, m−1) and a surface continuous with the pixel (n, m−1). Details of the processing will be described later.

ステップS1406で連続面でないと判別された場合、および、+Y方向推定距離値算出処理を終えた場合、メモリYのアドレスnの領域をリセットし(ステップS1408)、処理を終了する。なお、ステップS1405で−Y方向に隣接する画素(n,m−1)が距離値未算出でないと判別された場合も、ステップS1408へ移行する。   When it is determined in step S1406 that the surface is not a continuous surface, and when the + Y direction estimated distance value calculation process is completed, the area of the address n in the memory Y is reset (step S1408), and the process ends. If it is determined in step S1405 that the pixel (n, m−1) adjacent in the −Y direction is not yet calculated, the process proceeds to step S1408.

なお、本実施形態の推定距離値算出部171は、全画素について、上記処理を繰り返す。各画素の処理を終える毎に、X方向の終端画素であるか判別し、終端画素であれば、メモリXをリセットする。さらに、Y方向の終端画素であるかを判別し、終端画素であれば、メモリYのアドレスnの領域をリセットする。これにより、全画素の処理を終えると、メモリXおよびメモリYの全領域がリセットされる。   Note that the estimated distance value calculation unit 171 of the present embodiment repeats the above process for all pixels. Every time processing of each pixel is finished, it is determined whether the pixel is a terminal pixel in the X direction, and if it is a terminal pixel, the memory X is reset. Further, it is determined whether the pixel is a terminal pixel in the Y direction, and if it is a terminal pixel, the area of the address n in the memory Y is reset. Thereby, when the processing of all the pixels is finished, all the areas of the memory X and the memory Y are reset.

<傾斜方向判別処理>
次に、上記ステップS1101およびステップS1201における、推定距離値算出部171による傾斜方向判別処理の詳細を説明する。本実施形態では、隣接する画素との間で、輝度値比を計算し、輝度値比が、所定範囲であれば、上述のように、当該方向に連続面であり、傾斜も当該方向と判別する。図10は、本実施形態の傾斜方向判別処理の処理フローである。
<Inclination direction discrimination processing>
Next, details of the inclination direction determination processing by the estimated distance value calculation unit 171 in step S1101 and step S1201 will be described. In the present embodiment, a luminance value ratio is calculated between adjacent pixels, and if the luminance value ratio is within a predetermined range, as described above, the surface is a continuous surface, and the inclination is also determined from the direction. To do. FIG. 10 is a processing flow of the inclination direction determination processing of the present embodiment.

まず、傾斜がX方向であるか否かを調べるため、処理対象画素(n,m)に−X方向に隣接する画素(n−1,m)の輝度値B(n−1,m)を取得する(ステップS2101)。そして、処理対象画素(n,m)画素の輝度値B(n,m)との間で、輝度値比RB=B(n−1,m)/B(n,m)を算出する(ステップS2102)。   First, in order to check whether the inclination is in the X direction, the luminance value B (n−1, m) of the pixel (n−1, m) adjacent to the processing target pixel (n, m) in the −X direction is used. Obtain (step S2101). Then, a luminance value ratio RB = B (n−1, m) / B (n, m) is calculated between the luminance value B (n, m) of the pixel (n, m) to be processed (step) S2102).

そして、算出した輝度値比RBが、輝度値比閾値RBthの範囲内であるか否かを判別し(ステップS2103)、範囲内であれば、X方向に連続面であり、傾斜もX方向であると判別する(ステップS2104)。   Then, it is determined whether or not the calculated luminance value ratio RB is within the range of the luminance value ratio threshold RBth (step S2103). If it is within the range, it is a continuous surface in the X direction, and the inclination is also in the X direction. It is determined that it exists (step S2104).

一方、ステップS2103において、範囲外である場合、今度は、Y方向に連続面であるかどうかを判別する。判別は、−Y方向に隣接する画素(n,m−1)の輝度値B(n,m−1)を用いて行う。   On the other hand, if it is out of range in step S2103, it is next determined whether or not the surface is a continuous surface in the Y direction. The determination is performed using the luminance value B (n, m−1) of the pixel (n, m−1) adjacent in the −Y direction.

まず、−Y方向に隣接する画素(n,m−1)の輝度値B(n,m−1)を取得する(ステップ2105)。そして、輝度値比RB=B(n,m−1)/B(m,m)を算出し(ステップS2106)、輝度値比閾値RBthの範囲内であるか否かを判別する(ステップS2107)。   First, the luminance value B (n, m−1) of the pixel (n, m−1) adjacent in the −Y direction is acquired (step 2105). Then, the luminance value ratio RB = B (n, m−1) / B (m, m) is calculated (step S2106), and it is determined whether or not the luminance value ratio is within the range of the luminance value ratio threshold RBth (step S2107). .

範囲内であれば、Y方向に連続面であり、傾斜もY方向であると判別する(ステップS2108)。   If it is within the range, it is determined that the surface is a continuous surface in the Y direction and the inclination is also in the Y direction (step S2108).

最後にいずれの方向においても、輝度値比が、輝度値比閾値の範囲外である場合、判別不可と判別する(ステップS2109)。   Finally, in any direction, if the luminance value ratio is outside the range of the luminance value ratio threshold value, it is determined that the determination is impossible (step S2109).

なお、ここで用いる輝度値比閾値RBthも、周囲の環境によって大きく異なるため、一概に値を決定できるものではなく、実際の使用環境化において設定する。   Note that the luminance value ratio threshold value RBth used here is also largely different depending on the surrounding environment, so the value cannot be determined unconditionally, and is set in actual use environment.

また、本処理においては使用しないが、隣接する画素(n−1,m)および(n,m−1)の輝度値を取得する際、距離値も併せて取得しておく。   Although not used in this processing, when acquiring the luminance values of the adjacent pixels (n−1, m) and (n, m−1), the distance value is also acquired.

<メモリX、メモリY>
図9に示すように、本実施形態の推定距離値算出部171は、傾斜方向が定まると、当該方向の、マイナス方向に隣接する画素の距離値を用いて、処理対象画素の推定距離値Dcを算出する。以下、ここで用いるメモリXおよびメモリYについて、図11(a)および図11(b)を用いて説明する。
<Memory X, Memory Y>
As illustrated in FIG. 9, when the inclination direction is determined, the estimated distance value calculation unit 171 of the present embodiment uses the distance value of the pixel adjacent to the minus direction in the direction to determine the estimated distance value Dc of the processing target pixel. Is calculated. Hereinafter, the memory X and the memory Y used here will be described with reference to FIGS. 11 (a) and 11 (b).

本実施形態のメモリX410は、−X方向推定距離値算出処理、+X方向推定距離値算出処理および後述の方向判別不可時処理に用いるワーキングメモリである。図11(a)に示すように、メモリX410は、処理対象画素(n,m)の画素位置を特定する情報(画素位置)を保存する画素位置1(411)と、処理対象画素(n,m)と連続する面の、−X方向の端部の画素位置を保存する画素位置2(412)と、処理対象画素(n,m)を含む面の、X方向の傾きを保存する傾き413とを備える。   The memory X410 according to the present embodiment is a working memory used for -X direction estimated distance value calculation processing, + X direction estimated distance value calculation processing, and processing to be described later when direction determination is impossible. As shown in FIG. 11A, the memory X410 includes a pixel position 1 (411) for storing information (pixel position) specifying the pixel position of the processing target pixel (n, m), and a processing target pixel (n, m, n). m) a pixel position 2 (412) for storing the pixel position at the end in the −X direction on the surface continuous with the surface, and a gradient 413 for storing the inclination in the X direction on the surface including the processing target pixel (n, m). With.

同様に、本実施形態のメモリY420は、−Y方向推定距離値算出処理、+Y方向推定距離値算出処理および後述の方向判別不可時処理に用いるワーキングメモリである。図11(b)に示すように、メモリY420は、距離画像および輝度画像のX方向の画素位置をアドレス424として、処理対象画素(n,m)の画素位置を保存する画素位置1(421)と、処理対象画素(n,m)と連続する面の、−Y方向の端部の画素位置を保存する画素位置2(422)と、処理対象画素(n,m)を含む面の、Y方向の傾きを保存する傾き423とを備える。   Similarly, the memory Y420 of the present embodiment is a working memory used for the -Y direction estimated distance value calculation process, the + Y direction estimated distance value calculation process, and a later-described direction discrimination impossible process. As shown in FIG. 11B, the memory Y420 stores the pixel position of the processing target pixel (n, m) at the pixel position in the X direction of the distance image and the luminance image as the address 424, and the pixel position 1 (421). Y of the surface including the pixel to be processed (n, m), the pixel position 2 (422) for storing the pixel position at the end in the −Y direction, and the surface including the pixel to be processed (n, m). An inclination 423 for storing the inclination of the direction.

以下の各処理では、これらのメモリXおよびメモリYを用いて、距離値未算出の画素の推定距離値を算出する。   In each of the following processes, the estimated distance value of a pixel whose distance value has not been calculated is calculated using these memories X and Y.

<−X方向推定距離値算出処理>
次に、ステップS1102の、傾斜がX方向と判別された際に、推定距離値算出部171が実行する−X方向推定距離値算出処理について説明する。−X方向推定距離値算出処理は、上述のように、処理対象画素(n,m)よりも−X方向の、既に距離値または推定距離値Dcが算出されている画素の距離値を用いて、処理対象画素(n,m)の推定距離値Dcを算出する処理である。図12に、本実施形態の−X方向推定距離値算出処理の処理フローを示す。
<-X direction estimated distance value calculation processing>
Next, the -X direction estimated distance value calculation process executed by the estimated distance value calculation unit 171 when the inclination is determined to be the X direction in step S1102 will be described. As described above, the −X direction estimated distance value calculation process uses the distance value of the pixel whose distance value or estimated distance value Dc is already calculated in the −X direction from the processing target pixel (n, m). This is a process of calculating the estimated distance value Dc of the processing target pixel (n, m). FIG. 12 shows a process flow of the -X direction estimated distance value calculation process of the present embodiment.

まず、メモリYのアドレスnの内容をリセットする(ステップS3101)。これは、本処理では、傾斜がX方向であると判別されたため、Y方向の傾斜の算出に用いるメモリYの内容は不要となるためである。   First, the contents of the address n in the memory Y are reset (step S3101). This is because in this process, since the inclination is determined to be in the X direction, the contents of the memory Y used for calculating the inclination in the Y direction are not necessary.

次に、メモリXに何等かの情報が保存されているか否かを判別する(ステップS3102)。処理対象画素(n,m)の−X方向に隣接する画素(n−1,m)の距離値が算出されている場合、メモリXには何も情報が保存されていない。すなわち、現在の処理対象画素(n,m)は、X方向に画素の処理を進めてきた中で、距離値が算出されている画素の後で、初めて出現する距離値の算出されていない画素となる。   Next, it is determined whether or not any information is stored in the memory X (step S3102). When the distance value of the pixel (n−1, m) adjacent to the processing target pixel (n, m) in the −X direction is calculated, no information is stored in the memory X. That is, the current pixel to be processed (n, m) is a pixel that has not been calculated for a distance value that appears for the first time after a pixel for which a distance value has been calculated while processing pixels in the X direction. It becomes.

また、ここでは、−X方向に隣接する画素(n−1,m)の距離値および輝度値は、傾斜方向の判定時に既に取得し、また、この画素の面との連続性は、既に判定済みである。従って、ここでは、この連続面の端部の画素を判別する。   In addition, here, the distance value and the luminance value of the pixel (n−1, m) adjacent in the −X direction are already acquired at the time of determining the tilt direction, and the continuity with the surface of this pixel is already determined. It is done. Therefore, here, the pixel at the end of the continuous surface is determined.

このため、−X方向に順に1画素ずつ距離値および輝度値を取得し、隣接する画素の距離値および輝度値を用いて、連続性を判別する(ステップS3103、3104、3105)。判別は、探索画素(n−i,m)と、そのX方向に隣接する画素(n−i−1,m)との距離値および輝度値を用いて行う。   For this reason, a distance value and a luminance value are sequentially acquired for each pixel in the −X direction, and continuity is determined using the distance value and the luminance value of adjacent pixels (steps S3103, 3104, and 3105). The discrimination is performed using the distance value and the luminance value between the search pixel (n−i, m) and the pixel (n−i−1, m) adjacent in the X direction.

探索画素(n−i,m)の距離値をD(n−1,m)、輝度値をB(n−i,m)とし、隣接画素(n−i−1,m)の距離値をD(n−i−1,m)、輝度値をB(n−i−1,m)とすると、両者の距離差Ddif=D(n−i,m)−D(n−i−1,m)の絶対値が、予め定めた距離閾値Dth以下であり、かつ、両者の輝度値比RB=B(n−i,m)/B(n−i−1,m)が、輝度値比閾値Bthの範囲内である場合、連続面と判別する。   The distance value of the search pixel (n−i, m) is D (n−1, m), the luminance value is B (n−i, m), and the distance value of the adjacent pixel (n−i−1, m) is If D (n−i−1, m) and the luminance value is B (n−i−1, m), the distance difference between them Ddif = D (n−i, m) −D (n−i−1, The absolute value of m) is less than or equal to a predetermined distance threshold Dth, and the luminance value ratio RB = B (n−i, m) / B (n−i−1, m) is the luminance value ratio. When it is within the range of the threshold Bth, it is determined as a continuous surface.

連続面と判別された場合、探索画素(n−i,m)が、距離画像および輝度画像の、X方向の端部の画素であるか否かを判別する(ステップS3106)。端部の画素でなければ、さらに−X方向に1つ先の画素を探索画素とし(i=i+1;ステップS3107)、ステップS3104からの処理を繰り返す。   When it is determined as a continuous surface, it is determined whether or not the search pixel (n−i, m) is a pixel at the end in the X direction of the distance image and the luminance image (step S3106). If the pixel is not an end pixel, the next pixel in the −X direction is set as a search pixel (i = i + 1; step S3107), and the processing from step S3104 is repeated.

一方、端部の画素であれば、探索画素(n−i,m)の距離値D(n−i,m)と、処理対象画素(n,m)に−X方向に隣接する画素(n−1,m)の距離値D(n−i,m)とを用いて、この連続面の傾きを算出する(ステップS3108)。傾きKは、以下の式(4)で算出する。
K=(D(n−1,m)−D(n−i,m))/(i−1) ・・・(4)
なお、算出した傾きKは、メモリXに保存する。
On the other hand, if the pixel is an end pixel, the distance value D (n−i, m) of the search pixel (n−i, m) and the pixel (n that is adjacent to the processing target pixel (n, m) in the −X direction) The inclination of the continuous surface is calculated using the distance value D (n−i, m) of (−1, m) (step S3108). The inclination K is calculated by the following equation (4).
K = (D (n−1, m) −D (n−i, m)) / (i−1) (4)
The calculated slope K is stored in the memory X.

そして、算出した傾きKを用いて、処理対象画素(n,m)の推定距離値Dcを、以下の式(5)に従って、算出する(ステップS3109)。
Dc(n,m)=D(n−1,m)+K ・・・(5)
Then, using the calculated slope K, an estimated distance value Dc of the processing target pixel (n, m) is calculated according to the following equation (5) (step S3109).
Dc (n, m) = D (n-1, m) + K (5)

そして、メモリXの画素位置1には、処理対象画素(n,m)の画素位置(n,m)を保存し(ステップS3110)、処理を終了する。   Then, the pixel position (n, m) of the processing target pixel (n, m) is stored in the pixel position 1 of the memory X (step S3110), and the process ends.

一方、ステップS3105で、探索画素(n−i,m)の面は、当該画素にX方向に隣接する画素の面と連続ではないと判別された場合は、まず、このときのiが2であるか否かを判別する(ステップS3111)。   On the other hand, if it is determined in step S3105 that the surface of the search pixel (n−i, m) is not continuous with the surface of the pixel adjacent to the pixel in the X direction, first, i at this time is 2. It is determined whether or not there is (step S3111).

iが2でない場合、すなわち、2より大きい場合、処理対象画素(n,m)の−X方向に、2以上の、連続する面であって距離値を有する画素がある。従って、これらの画素値を用いて、処理対象画素(n,m)が含まれる面の傾きは算出できる。従って、この場合は、ステップS3108へ移行し、以降の処理を行う。   When i is not 2, that is, when i is larger than 2, there are two or more pixels that are continuous surfaces and have a distance value in the −X direction of the processing target pixel (n, m). Therefore, the inclination of the surface including the processing target pixel (n, m) can be calculated using these pixel values. Therefore, in this case, the process proceeds to step S3108, and the subsequent processing is performed.

一方、iが2である場合、処理対象画素(n,m)の−X方向には、連続する面であって距離値を有する画素が1つしかない。すなわち、処理対象画素(n,m)に隣接する画素(n−1,m)のみである。よって、傾きは算出できない。従って、この場合、処理対象画素(n,m)の画素位置(n,m)をメモリXの画素位置1に保存し、この隣接する画素(n−1,m)の画素位置(n−1,m)を、連続する面の端部の画素として、メモリXの画素位置2に保存し(ステップS3112)、処理を終了する。これにより、傾きKは算出されないものの、メモリXには、処理対象画素(n,m)と、当該画素の面が含まれる連続面の−X方向の端部の画素とが保持される。   On the other hand, when i is 2, there is only one pixel which is a continuous surface and has a distance value in the −X direction of the processing target pixel (n, m). That is, only the pixel (n−1, m) adjacent to the processing target pixel (n, m). Therefore, the slope cannot be calculated. Therefore, in this case, the pixel position (n, m) of the processing target pixel (n, m) is stored in the pixel position 1 of the memory X, and the pixel position (n−1) of the adjacent pixel (n−1, m) is stored. , M) are stored in the pixel position 2 of the memory X as pixels at the end of the continuous surface (step S3112), and the process ends. Accordingly, although the inclination K is not calculated, the processing target pixel (n, m) and the pixels at the end in the −X direction of the continuous surface including the surface of the pixel are held in the memory X.

一方、ステップS3102に、メモリXに何等かの情報が保存されている場合、現在の処理対象画素(n,m)は、距離値が算出されている画素の後で、初めて出現する距離値未算出画素ではない。   On the other hand, if any information is stored in the memory X in step S3102, the current processing target pixel (n, m) is the distance value that does not appear for the first time after the pixel whose distance value is calculated. It is not a calculated pixel.

まず、傾きKが保存されているか否かを判別する(ステップS3113)。ここでは、処理対象画素(n,m)の面は、−X方向に隣接する画素(n−1,m)の面とは連続している。従って、−X方向に隣接する画素(n−1,m)で用いた傾きをそのまま用いて、推定距離値Dcを算出できる。従って、傾きが保存されている場合は、ステップS3109へ移行し、以降の処理を実行する。   First, it is determined whether or not the inclination K is stored (step S3113). Here, the surface of the processing target pixel (n, m) is continuous with the surface of the pixel (n-1, m) adjacent in the −X direction. Accordingly, the estimated distance value Dc can be calculated using the gradient used in the pixel (n−1, m) adjacent in the −X direction as it is. Therefore, if the tilt is stored, the process proceeds to step S3109, and the subsequent processing is executed.

一方、傾きKが保存されていない場合は、画素位置2が保存されている。この場合、距離値のない処理対象画素(n,m)が加わっても、傾きを算出することはできないため、ステップS3110へ移行し、メモリXの画素位置1を、処理対象画素(n,m)に更新する(ステップS3110)。これにより、連続面の範囲と、距離値未算出画素の範囲とが保存される。   On the other hand, when the inclination K is not stored, the pixel position 2 is stored. In this case, even if the processing target pixel (n, m) having no distance value is added, the inclination cannot be calculated. Therefore, the process proceeds to step S3110, and the pixel position 1 in the memory X is set to the processing target pixel (n, m). (Step S3110). As a result, the range of the continuous surface and the range of the pixel whose distance value has not been calculated are stored.

<−Y方向推定距離値算出処理>
次に、ステップS1202の、傾斜がY方向と判別された際に、推定距離値算出部171が実行する、−Y方向推定距離値算出処理について説明する。図13に、本実施形態の−Y方向補正値算出処理の処理フローを示す。
<-Y direction estimated distance value calculation processing>
Next, the -Y direction estimated distance value calculation process executed by the estimated distance value calculation unit 171 when the inclination is determined to be the Y direction in step S1202 will be described. FIG. 13 shows a process flow of the −Y direction correction value calculation process of the present embodiment.

−Y方向推定距離値算出処理は、基本的に、上述の−X方向推定距離値算出処理と同様である。ただし、探索の方向、メモリYへの保存態様が異なる。以下、−X方向推定距離値算出処理と異なる点に主眼をおいて説明する。   The -Y direction estimated distance value calculation process is basically the same as the -X direction estimated distance value calculation process described above. However, the search direction and the storage mode in the memory Y are different. Hereinafter, a description will be given focusing on differences from the -X direction estimated distance value calculation processing.

まず、メモリXの内容をリセットする(ステップS3202)。これは、本処理では、傾斜がY方向であると判別されたためである。   First, the contents of the memory X are reset (step S3202). This is because in this process, it is determined that the inclination is in the Y direction.

そして、メモリYの、処理対象画素(n,m)のX方向の画素位置nをアドレスとする欄に、何等かの情報が保存されているか否かを判別する(ステップ3202)。保存されていない場合は、−Y方向に順に1画素ずつ距離値および輝度値を取得し、連続性を判別する(ステップS3203、3204、3205)。判別は、−X方向推定距離値算出処理と同様に、探索画素(n,m−i)と、そのY方向に隣接する画素(n,m−i−1)との距離値および輝度値を用いて行う。   Then, it is determined whether or not any information is stored in a column of the memory Y where the pixel position n in the X direction of the processing target pixel (n, m) is an address (step 3202). If not stored, the distance value and the luminance value are sequentially acquired pixel by pixel in the −Y direction, and continuity is determined (steps S3203, 3204, and 3205). In the same manner as in the −X direction estimated distance value calculation process, the distance value and the luminance value between the search pixel (n, mi) and the pixel (n, mi−1) adjacent in the Y direction are determined. To do.

端部と判定されるまで、上記処理を繰り返し、端部と判定されると(ステップS3206)、−X方向推定距離値算出処理と同様に、この連続面の傾きを算出する(ステップS3208)。そして、算出した傾きKを、メモリYのアドレスn欄に保存する。   The above process is repeated until it is determined to be an end, and if it is determined to be an end (step S3206), the inclination of this continuous surface is calculated (step S3208), as in the -X direction estimated distance value calculation process. Then, the calculated inclination K is stored in the address n column of the memory Y.

そして、この傾きKを用いて、処理対象画素(n,m)の推定距離値Dcを算出し(ステップS3209)、メモリYのアドレスnの画素位置1に、処理対象画素(n,m)画素の画素位置(n,m)を保存し(ステップS3210)、処理を終了する。   Then, the estimated distance value Dc of the processing target pixel (n, m) is calculated using the slope K (step S3209), and the processing target pixel (n, m) pixel is located at the pixel position 1 of the address n in the memory Y. Is stored (step S3210), and the process is terminated.

一方、ステップS3205で、探索画素(n,m−i)の面は、当該画素にY方向に隣接する画素の面と連続ではないと判別された場合は、まず、このときのiが2であるか否かを判別する(ステップS3211)。   On the other hand, if it is determined in step S3205 that the surface of the search pixel (n, mi) is not continuous with the surface of the pixel adjacent to the pixel in the Y direction, first, i at this time is 2. It is determined whether or not there is (step S3211).

iが2でない場合は、ステップS3208へ移行し、以降の処理を行う。一方、iが2である場合、処理対象画素(n,m)の−Y方向には、連続する面であって距離値を有する画素が1つしかない。従って、この場合、処理対象画素(n,m)の画素位置(n,m)をメモリYのアドレスnの画素位置1に保存し、この隣接する画素(n,m−1)の画素位置(n,m−1)を、連続する面の端部の画素として、メモリYのアドレスnの画素位置2に保存し(ステップS3212)、処理を終了する。   If i is not 2, the process proceeds to step S3208, and the subsequent processing is performed. On the other hand, when i is 2, there is only one pixel that is a continuous surface and has a distance value in the −Y direction of the processing target pixel (n, m). Therefore, in this case, the pixel position (n, m) of the processing target pixel (n, m) is stored in the pixel position 1 of the address n in the memory Y, and the pixel position ( n, m-1) is stored in the pixel position 2 of the address n in the memory Y as a pixel at the end of the continuous surface (step S3212), and the process is terminated.

一方、ステップS3202に、メモリYのアドレスnに何等かの情報が保存されている場合、まず、傾きKが保存されているか否かを判別する(ステップS3213)。傾きが保存されている場合は、ステップS3209へ移行し、以降の処理を実行する。   On the other hand, if any information is stored in the address n of the memory Y in step S3202, it is first determined whether or not the slope K is stored (step S3213). If the tilt is stored, the process proceeds to step S3209, and the subsequent processing is executed.

一方、傾きKが保存されていない場合は、ステップS3210へ移行し、メモリYのアドレスnの画素位置1を、処理対象画素(n,m)に更新する(ステップS3210)。これにより、連続面の範囲と、距離値未算出画素の範囲とが保存される。   On the other hand, if the slope K is not stored, the process proceeds to step S3210, and the pixel position 1 at the address n in the memory Y is updated to the processing target pixel (n, m) (step S3210). As a result, the range of the continuous surface and the range of the pixel whose distance value has not been calculated are stored.

<方向判別不可時処理>
推定距離値算出処理のステップS1301の方向判別不可時処理について説明する。本処理は、傾斜はあるものの、その方向を判別できない場合に行われる。ここでは、メモリXの画素位置1および画素位置2に、処理対象画素(n,m)を保存する。また、メモリYのアドレスnの画素位置1および画素位置2に、処理対象画素(n,m)を保存する。これは、後述の+X方向推定距離値算出処理または+Y方向推定距離値算出処理に用いられる。
<Processing when direction cannot be determined>
A process when the direction cannot be determined in step S1301 of the estimated distance value calculation process will be described. This processing is performed when there is an inclination but the direction cannot be determined. Here, the processing target pixel (n, m) is stored in the pixel position 1 and the pixel position 2 of the memory X. In addition, the processing target pixel (n, m) is stored in the pixel position 1 and the pixel position 2 of the address n in the memory Y. This is used for + X direction estimated distance value calculation processing or + Y direction estimated distance value calculation processing described later.

<距離値未算出画素有無判別処理>
次に、ステップS1401およびステップS1405で行う、隣接する画素に距離値未算出画素があるか否かの判別手法を説明する。
<Distance value uncalculated pixel presence / absence determination process>
Next, a method for determining whether or not there is a distance value uncalculated pixel in adjacent pixels, which is performed in step S1401 and step S1405, will be described.

上述のように、−X方向推定距離値算出処理において、処理対象画素(n,m)の推定距離値Dcを算出できない場合、メモリXには、当該処理対象画素(n,m)と、処理対象画素(n,m)の面と連続する面の−X方向の端部の画素位置とが、それぞれ、画素位置1および画素位置2に保存される。そして、傾きKには、何も保存されない。   As described above, when the estimated distance value Dc of the processing target pixel (n, m) cannot be calculated in the −X direction estimated distance value calculation processing, the processing target pixel (n, m) and the processing are stored in the memory X. The pixel position at the end in the −X direction of the surface continuous with the surface of the target pixel (n, m) is stored in the pixel position 1 and the pixel position 2, respectively. Nothing is stored in the slope K.

従って、本ステップでは、これを利用し、推定距離値算出部171は、メモリXにアクセスし、画素位置2が保存されているか否か、あるいは、傾きKが保存されているか否かによって、−X方向に隣接する画素(n−1,m)が距離値未算出画素であるか否かを判別する。すなわち、画素位置2に画素位置の情報が保存されている、あるいは、傾きKが保存されていない場合、画素(n−1,m)を距離値未算出画素と判別する。   Therefore, in this step, using this, the estimated distance value calculation unit 171 accesses the memory X and determines whether or not the pixel position 2 is stored or whether the slope K is stored or not. It is determined whether or not the pixel (n−1, m) adjacent in the X direction is a distance value uncalculated pixel. That is, when the pixel position information is stored in the pixel position 2 or the inclination K is not stored, the pixel (n−1, m) is determined to be a pixel whose distance value has not been calculated.

なお、ステップS1405の判別も同様であり、推定距離値算出部171は、メモリYのアドレスn欄にアクセスし、上記同様、画素位置2に画素位置の情報が保存されている、あるいは、傾きKが保存されていない場合、画素(n,m−1)を距離値未算出画素と判別する。   The determination in step S1405 is also the same, and the estimated distance value calculation unit 171 accesses the address n column of the memory Y, and the pixel position information is stored in the pixel position 2 as described above, or the slope K Is not stored, the pixel (n, m−1) is determined as a pixel whose distance value has not been calculated.

<連続性判別処理>
次に、ステップS1402およびステップS1406の、連続面であるか否かの判別手法について説明する。
<Continuity discrimination processing>
Next, the determination method of whether it is a continuous surface of step S1402 and step S1406 is demonstrated.

ここでは、上述のように、輝度値比RBを用いて判別する。すなわち、処理対象画素(n,m)の輝度値と、−X方向に隣接する距離値未算出の画素(n−1,m)の輝度値との間で、輝度値比RBを算出し、輝度値比閾値RBthの範囲内である場合、連続面と判別する。   Here, as described above, the determination is made using the luminance value ratio RB. That is, the luminance value ratio RB is calculated between the luminance value of the processing target pixel (n, m) and the luminance value of the pixel (n−1, m) that is adjacent to the −X direction and the distance value has not been calculated. When it is within the range of the luminance value ratio threshold RBth, it is determined as a continuous surface.

ステップS1406の判別手法も同様で、処理対象画素(n,m)の輝度値と、−Y方向に隣接する距離値未算出の画素(n,m−1)の輝度値との間で輝度値比RBを算出し、輝度値比閾値RBthの範囲内である場合、連続面と判別する。   The determination method in step S1406 is the same, and the luminance value between the luminance value of the processing target pixel (n, m) and the luminance value of the pixel (n, m−1) that is adjacent to the −Y direction and has not yet been calculated. When the ratio RB is calculated and is within the range of the luminance value ratio threshold RBth, it is determined as a continuous surface.

<+X方向推定距離値算出処理>
次に、ステップS1403の、+X方向推定距離値算出処理について説明する。上述のように、処理対象画素(n,m)よりも+X方向の、既に距離値が算出されている画素の距離値を用いて、処理対象画素(n,m)よりも−X側の、距離値未算出画素の距離値を算出する処理である。図14に、本実施形態の+X方向推定距離値算出処理の処理フローを示す。
<+ X direction estimated distance value calculation processing>
Next, the + X direction estimated distance value calculation process in step S1403 will be described. As described above, by using the distance value of the pixel whose distance value has already been calculated in the + X direction from the processing target pixel (n, m), the -X side of the processing target pixel (n, m) This is a process of calculating a distance value of a pixel whose distance value has not been calculated. FIG. 14 shows a process flow of the + X direction estimated distance value calculation process of the present embodiment.

この場合、メモリXには、画素位置1に、処理対象画素(n,m)に−X方向に隣接する画素(n−1,m)が保存され、画素位置2に、処理対象画素(n,m)の面の−X方向の端部の画素位置が保存される。   In this case, the memory X stores a pixel (n−1, m) adjacent to the processing target pixel (n, m) in the −X direction at the pixel position 1 and a processing target pixel (n , M), the pixel positions at the ends in the −X direction of the plane are stored.

まず、画素位置2に保存される、−X方向の端部の画素が、距離値を有しているか否かを判別する(ステップS3301)。上述のように、−X方向推定距離値算出処理で、連続面の傾きが算出できず、距離値未算出となるのは、連続面の−X方向の全ての画素に距離値がない場合と、端部の画素1つだけに距離値がある場合とである。   First, it is determined whether or not the pixel at the end in the −X direction stored in the pixel position 2 has a distance value (step S3301). As described above, in the -X direction estimated distance value calculation process, the slope of the continuous surface cannot be calculated, and the distance value is not calculated when all the pixels in the -X direction of the continuous surface have no distance value. This is the case where only one pixel at the end has a distance value.

+X方向推定距離値算出処理では、処理対象画素(n,m)には距離値があるため、連続面の−X方向の端部の画素1つだけに距離値がある場合であっても、処理対象画素(n,m)の距離値を用いて、傾きを算出することができる。   In the + X direction estimated distance value calculation process, since the processing target pixel (n, m) has a distance value, even when only one pixel at the end in the −X direction of the continuous surface has a distance value, The inclination can be calculated using the distance value of the processing target pixel (n, m).

従って、画素位置2に保存される画素が距離値を有している場合、処理対象画素(n,m)の距離値と、画素位置2に保存される画素の距離値とを用いて傾きKを算出し(ステップS3307)、当該傾きKを用いて、画素位置1から画素位置2までの距離値未算出の画素の推定距離値を算出する(ステップS3308)。ここでは、画素位置2に+X方向に隣接する画素から、画素位置1の画素(処理対象画素(n,m)に−X方向に隣接する画素)までの推定距離値を算出する。   Therefore, when the pixel stored in the pixel position 2 has a distance value, the gradient K is calculated using the distance value of the processing target pixel (n, m) and the distance value of the pixel stored in the pixel position 2. (Step S3307), and using the inclination K, an estimated distance value of a pixel whose distance value from the pixel position 1 to the pixel position 2 has not been calculated is calculated (step S3308). Here, an estimated distance value from a pixel adjacent to the pixel position 2 in the + X direction to a pixel at the pixel position 1 (a pixel adjacent to the processing target pixel (n, m) in the −X direction) is calculated.

さらに、メモリXの画素位置2の画素から画素位置1の画素までの面は、X方向に傾斜していることとなるため、メモリYの、これらをアドレスとする領域をリセットし(ステップS3309)、処理を終了する。   Further, since the surface from the pixel at the pixel position 2 to the pixel at the pixel position 1 in the memory X is inclined in the X direction, the area of the memory Y using these as addresses is reset (step S3309). The process is terminated.

一方、ステップS3301において、画素位置2の画素に距離値がない場合、−X方向の画素の距離値を用いて、未算出の画素の距離値を算出することはできない。従って、+X方向に1画素ずつ、連続面の端部まで、距離値と輝度値とを取得し、これらを用いて、連続面の傾きを算出する(ステップS3302〜ステップS3307)。傾きを算出したら、ステップS3308において、画素位置2から画素位置1間の、距離値未算出画素の推定距離値を算出する(ステップS3308)。   On the other hand, in step S3301, when the pixel at the pixel position 2 has no distance value, the distance value of the uncalculated pixel cannot be calculated using the distance value of the pixel in the −X direction. Therefore, the distance value and the luminance value are acquired pixel by pixel in the + X direction to the end of the continuous surface, and the inclination of the continuous surface is calculated using these values (steps S3302 to S3307). After calculating the inclination, in step S3308, the estimated distance value of the pixel whose distance value has not been calculated between the pixel position 2 and the pixel position 1 is calculated (step S3308).

ステップS3304の、連続面の判断手法は、上述の各推定距離値算出処理と同様であり、距離値差Ddifの絶対値が距離閾値以下であり、かつ、輝度値比RBが輝度値比閾値RBth範囲内であれば、連続面と判別する。   The determination method of the continuous surface in step S3304 is the same as that of each estimated distance value calculation process described above, the absolute value of the distance value difference Ddif is equal to or less than the distance threshold value, and the luminance value ratio RB is the luminance value ratio threshold value RBth. If it is within the range, it is determined as a continuous surface.

なお、処理対象画素(n,m)が+X方向の連続面の端部である場合、すなわち、処理フローにおいて、iが1の場合(ステップS3310)、連続面において、距離値が得られるのが、この処理対象画素(n,m)のみとなる。従って、この場合は、+X方向に探索しても、傾きを得ることはできず、距離値未算出画素の推定距離値を得ることはできない。この場合は、ステップS3309へ進む。   When the processing target pixel (n, m) is the end of the continuous surface in the + X direction, that is, when i is 1 in the processing flow (step S3310), the distance value is obtained on the continuous surface. Only the processing target pixel (n, m) is obtained. Therefore, in this case, even if searching in the + X direction, the inclination cannot be obtained, and the estimated distance value of the pixel whose distance value has not been calculated cannot be obtained. In this case, the process proceeds to step S3309.

<+Y方向推定距離値算出処理>
次に、ステップS1407の、+Y方向推定距離値算出処理について説明する。上述のように、処理対象画素(n,m)よりも+Y方向の、既に距離値が算出されている画素の距離値を用いて、処理対象画素(n,m)よりも−Y側の、距離値未算出画素の距離値を算出する処理である。図15に、本実施形態の+Y方向推定距離値算出処理の処理フローを示す。本処理は基本的に+X方向推定距離値算出処理と同様である。以下、+X方向推定距離値算出処理と異なる点に主眼をおいて説明する。
<+ Y direction estimated distance value calculation processing>
Next, the + Y direction estimated distance value calculation process in step S1407 will be described. As described above, by using the distance value of the pixel whose distance value has already been calculated in the + Y direction from the processing target pixel (n, m), on the −Y side from the processing target pixel (n, m), This is a process of calculating a distance value of a pixel whose distance value has not been calculated. FIG. 15 shows a process flow of the + Y direction estimated distance value calculation process of the present embodiment. This process is basically the same as the + X direction estimated distance value calculation process. The following description will focus on differences from the + X direction estimated distance value calculation process.

この場合、メモリYのアドレスnには、画素位置1に、処理対象画素(n,m)に−X方向に隣接する画素(n,m−1)が保存され、画素位置2に、処理対象画素(n,m)の面の−Y方向の端部の画素位置が保存される。   In this case, the pixel (n, m−1) adjacent to the processing target pixel (n, m) in the −X direction is stored at the address n of the memory Y at the pixel position 1, and the processing target is stored at the pixel position 2. The pixel position at the end in the −Y direction of the surface of the pixel (n, m) is stored.

まず、画素位置2に保存される、−Y方向の端部の画素が、距離値を有しているか否かを判別する(ステップS3401)。画素位置2に保存される画素が距離値を有している場合、処理対象画素(n,m)の距離値と、画素位置2に保存される画素の距離値とを用いて傾きKを算出し(ステップS3407)、当該傾きKを用いて、画素位置1および画素位置2間の距離値未算出画素の推定距離値を算出する(ステップS3408)。ここでは、画素位置2に+Y方向に隣接する画素から、画素位置1の画素(処理対象画素(n,m)に−Y方向に隣接する画素)までの推定距離値を算出し、処理を終了する。   First, it is determined whether or not the pixel at the end in the −Y direction stored in the pixel position 2 has a distance value (step S3401). When the pixel stored at the pixel position 2 has a distance value, the inclination K is calculated using the distance value of the processing target pixel (n, m) and the distance value of the pixel stored at the pixel position 2. (Step S3407), the estimated distance value of the pixel whose distance value is not calculated between the pixel position 1 and the pixel position 2 is calculated using the inclination K (Step S3408). Here, the estimated distance value from the pixel adjacent to the pixel position 2 in the + Y direction to the pixel at the pixel position 1 (the pixel adjacent to the processing target pixel (n, m) in the −Y direction) is calculated, and the processing is ended. To do.

一方、ステップS3401において、画素位置2の画素に距離値がない場合、+Y方向に1画素ずつ、連続面の端部まで、距離値と輝度値とを取得し、これらを用いて、連続面の傾きを算出する(ステップS3402〜ステップS3407)。   On the other hand, if there is no distance value in the pixel at pixel position 2 in step S3401, the distance value and the luminance value are acquired one pixel at a time in the + Y direction to the edge of the continuous surface, and these are used to The inclination is calculated (steps S3402 to S3407).

ステップS3404の、連続面の判断手法は、上述の各推定距離値算出処理と同様であり、距離値差Ddifの絶対値が距離閾値以下であり、かつ、輝度値比RBが輝度値比閾値RBth範囲内であれば、連続面と判別する。   The determination method of the continuous surface in step S3404 is the same as the above-described estimated distance value calculation processing, the absolute value of the distance value difference Ddif is less than or equal to the distance threshold value, and the luminance value ratio RB is the luminance value ratio threshold value RBth. If it is within the range, it is determined as a continuous surface.

なお、処理対象画素(n,m)が+X方向の連続面の端部である場合、すなわち、処理フローにおいて、iが1の場合(ステップS3409)、+Y方向に探索しても、傾きを得ることはできず、距離値未算出画素の推定距離値を得ることはできない。このため、このまま処理を終了する。   Note that if the pixel to be processed (n, m) is an end of a continuous surface in the + X direction, that is, if i is 1 in the processing flow (step S3409), the inclination is obtained even if searching in the + Y direction. It is not possible to obtain the estimated distance value of the pixel whose distance value has not been calculated. Therefore, the process is terminated as it is.

<具体例による推定距離値算出処理の説明>
上記の推定距離値算出処理を具体例で説明する。以降の例では、物体は図示されている画素にのみ存在するものとし、図示されていない画素には物体は存在しないものとする。すなわち、図示されている画素の輝度値は、全て輝度閾値Bth以上とする。また、メモリX,Yには情報は一切保存されていないものとする。さらに、いずれの画素も、終端画素ではないものとする。
<Description of Estimated Distance Value Calculation Processing Using Specific Example>
The estimated distance value calculation process will be described with a specific example. In the following examples, it is assumed that an object exists only in the illustrated pixel, and no object exists in the pixel not illustrated. That is, the luminance values of the illustrated pixels are all equal to or higher than the luminance threshold Bth. Also, it is assumed that no information is stored in the memories X and Y. Further, it is assumed that none of the pixels is a terminal pixel.

<具体例1>
図16に、対象物113の反射面の形状および対応画素の配置を示す。画素読み出し方向にそって距離値を算出する例を説明する。距離値が算出されていない画素の、推定距離値を、当該画素の−X方向の画素の距離値を用いて算出する例である。これは、上記図9のステップS1102、図12で傾きを得て、推定距離値を算出可能なフローに相当する。
<Specific example 1>
FIG. 16 shows the shape of the reflecting surface of the object 113 and the arrangement of corresponding pixels. An example of calculating the distance value along the pixel readout direction will be described. This is an example in which the estimated distance value of a pixel whose distance value has not been calculated is calculated using the distance value of the pixel in the −X direction of the pixel. This corresponds to the flow in which the estimated distance value can be calculated by obtaining the slope in step S1102 of FIG. 9 and FIG.

画素(n,m)について、距離値が0でないため、ステップS1401以降の処理を行う。まず、未算出画素有無判別処理を行う。メモリXより情報を読み出す。メモリXには何も保存されていない。次に、メモリYより情報を読み出す。メモリYにも何も保存されていないため、隣接画素に距離値未算出画素はないと判別し、この画素の処理を終える。そして、次の画素(n+1,m)についての処理へうつる。   Since the distance value is not 0 for the pixel (n, m), the processing after step S1401 is performed. First, uncalculated pixel presence / absence determination processing is performed. Read information from memory X. Nothing is stored in the memory X. Next, information is read from the memory Y. Since nothing is stored in the memory Y, it is determined that there is no distance value uncalculated pixel in the adjacent pixel, and the processing of this pixel is finished. Then, the process proceeds to the next pixel (n + 1, m).

画素(n+1,m)についても距離値が0でないため、画素(n,m)と同様の処理を繰り返し、画素(n+2,m)の処理へうつる。その後、画素(n+2,m)、画素(n+3,m)についても、同様の処理が行われ、画素(n+4,m)の処理へうつる。   Since the distance value is not 0 for the pixel (n + 1, m), the same processing as that of the pixel (n, m) is repeated, and the processing of the pixel (n + 2, m) is performed. Thereafter, the same processing is performed on the pixel (n + 2, m) and the pixel (n + 3, m), and the processing on the pixel (n + 4, m) is performed.

画素(n+4,m)については、距離値が0であるため、ステップS1101に進み、傾斜方向を判別する。ここでは、X方向と判別されたものとする。従って、ステップS1102の−X方向補正距離値算出処理にうつる。   Since the distance value is 0 for the pixel (n + 4, m), the process proceeds to step S1101 to determine the tilt direction. Here, it is assumed that the X direction is determined. Accordingly, the process proceeds to the -X direction correction distance value calculation process in step S1102.

まず、n+4をアドレスとしたメモリYの領域をリセットする。そして、メモリXを読み出し、傾きが保存されているか判別する。   First, the area of the memory Y with n + 4 as an address is reset. Then, the memory X is read out and it is determined whether or not the inclination is stored.

傾きは保存されていないため、X方向−2画素つまり画素(n+2,m)の距離値および輝度値を読み出し、距離差・輝度値比を算出し、連続平面の端部探索処理(ステップS3104〜ステップS3107)を行う。画素(n+3,m)と画素(n+2,m)との間では、距離差は距離閾値範囲内であり、輝度値比も輝度比閾値範囲内とする。従って、連続平面と判別される。また、画素(n+2,m)は、始端画素ではない。   Since the inclination is not stored, the distance value and the luminance value of the X direction -2 pixel, that is, the pixel (n + 2, m) are read, the distance difference / luminance value ratio is calculated, and the edge search process of the continuous plane (steps S3104 to S3104) Step S3107) is performed. Between the pixel (n + 3, m) and the pixel (n + 2, m), the distance difference is within the distance threshold range, and the luminance value ratio is also within the luminance ratio threshold range. Therefore, it is determined as a continuous plane. Further, the pixel (n + 2, m) is not the starting end pixel.

従って、X方向−3画素つまり画素(n+1,m)の距離値・輝度値を読み出し、同様に探索処理を繰り返す。画素(n+2,m)と画素(n+1,m)との間では、距離差が距離閾値範囲外(範囲未満)とする。従って、不連続面と判別される。このとき、iは3であるため、ステップS3108の傾きの算出へうつる。   Accordingly, the distance value / luminance value of the X direction-3 pixel, that is, the pixel (n + 1, m) is read out, and the search process is repeated in the same manner. The distance difference between the pixel (n + 2, m) and the pixel (n + 1, m) is outside the distance threshold range (less than the range). Therefore, it is determined as a discontinuous surface. At this time, since i is 3, the process proceeds to the calculation of the slope in step S3108.

画素(n+2,m)と画素(n+3,m)との距離値Q,Rを用いて、傾きKは、(R−Q)/(n+3−n−2)=R−Qと算出される。そして、傾きK=R−Qを用いて、画素(n+4,m)の距離値が2R−Qと算出される。   Using the distance values Q and R between the pixel (n + 2, m) and the pixel (n + 3, m), the slope K is calculated as (R−Q) / (n + 3−n−2) = R−Q. Then, using the gradient K = R−Q, the distance value of the pixel (n + 4, m) is calculated as 2R−Q.

なお、画素(n+4,m)は、メモリXの画素位置1(411)に保存され、傾きKは、メモリXの傾き(413)に保存される。そして、次の画素(n+5,m)についての処理へうつる。   The pixel (n + 4, m) is stored in the pixel position 1 (411) of the memory X, and the inclination K is stored in the inclination (413) of the memory X. Then, the process proceeds to the next pixel (n + 5, m).

画素(n+5,m)については、輝度値は輝度閾値以上であるため、物体は存在すると判別される。そして、距離値が0であるため、ステップS1101に進み、傾斜方向を判別する。ここでは、X方向と判別されたものとする。すなわち、画素(n+4,m)の面と連続面である。よって、ステップS1102の−X方向補正距離値算出処理にうつる。   For the pixel (n + 5, m), the luminance value is greater than or equal to the luminance threshold value, and therefore it is determined that an object exists. Since the distance value is 0, the process proceeds to step S1101 to determine the tilt direction. Here, it is assumed that the X direction is determined. That is, the surface is continuous with the surface of the pixel (n + 4, m). Therefore, the process proceeds to the -X direction correction distance value calculation process in step S1102.

まず、n+5をアドレスとしたメモリYの領域をリセットする。そして、メモリXを読み出し、−X方向隣接画素(n+4,m)に対応づけて、傾きが保存されているか判別する。   First, the area of the memory Y with n + 5 as an address is reset. Then, the memory X is read out, and it is determined whether or not the inclination is stored in association with the adjacent pixels (n + 4, m) in the −X direction.

傾きは保存されているため、この傾きR−Qと、画素(n+4,m)の距離値2R−Qとを用い、画素(n+5,m)の距離値3R−2Qを算出する。そして、メモリXの画素位置1を、画素(n+5,m)に更新し、次の画素(n+6,m)へうつる。   Since the inclination is stored, the distance value 3R-2Q of the pixel (n + 5, m) is calculated using the inclination RQ and the distance value 2R-Q of the pixel (n + 4, m). Then, the pixel position 1 in the memory X is updated to the pixel (n + 5, m), and the next pixel (n + 6, m) is transferred.

画素(n+6,m)については、距離値が0でないため、まず、距離値未算出画素有無判別処理を行う。メモリXを読み出す。ここで、メモリXには、傾きが保存されている。従って、−X方向に隣接する画素に距離値未算出画素はないと判別する。よって、メモリXをリセットし、メモリYの読み出しにうつる。   Since the distance value is not 0 for the pixel (n + 6, m), first, a distance value non-calculated pixel presence / absence determination process is performed. Read memory X. Here, the inclination is stored in the memory X. Accordingly, it is determined that there is no distance value uncalculated pixel in pixels adjacent in the −X direction. Therefore, the memory X is reset and reading of the memory Y is started.

メモリYには何も保存されていないため、次の画素についての処理へうつり、処理を繰り返す。   Since nothing is stored in the memory Y, the process proceeds to the process for the next pixel and the process is repeated.

<具体例2>
次に、対象物113の形状、位置が、図17に示す態様である場合の処理を説明する。距離値が算出されていない画素の推定距離値を、当該画素の+X方向の画素を用いて算出する例である。図9において、S1102の−X方向推定距離値算出処理では距離値を得られず、+X方向に隣接する画素の距離値を用いて、ステップS1403、図14の+X方向推定距離算出処理の、ステップS3302〜S3306の処理を行い、傾きを算出し、距離値を得る例である。
<Specific example 2>
Next, processing when the shape and position of the target object 113 are in the form shown in FIG. 17 will be described. This is an example in which the estimated distance value of a pixel whose distance value has not been calculated is calculated using a pixel in the + X direction of the pixel. In FIG. 9, the distance value cannot be obtained in the −X direction estimated distance value calculation process of S1102, and step S1403 and the step of + X direction estimated distance calculation process of FIG. 14 are performed using the distance values of pixels adjacent in the + X direction. This is an example in which the processing of S3302 to S3306 is performed, the inclination is calculated, and the distance value is obtained.

処理対象画素(n,m)は距離値が0でないため、ステップS1401以降の処理を行う。メモリXに画素位置が保存されているかを確認し、保存されていないためメモリXをリセットし、メモリYの確認にうつる。メモリYにも画素位置は保存されていないため、次の画素(n+1,m)の処理へうつる。画素(n+1,m)は画素(n,m)と同様の処理をされ、画素(n+2,m)の処理へうつる。   Since the distance value of the processing target pixel (n, m) is not 0, the processing after step S1401 is performed. It is confirmed whether the pixel position is stored in the memory X. Since the pixel position is not stored, the memory X is reset and the memory Y is checked. Since the pixel position is not stored in the memory Y, the process proceeds to the next pixel (n + 1, m). The pixel (n + 1, m) is processed in the same manner as the pixel (n, m), and the process proceeds to the pixel (n + 2, m).

画素(n+2,m)は距離値が0である。ここでは、傾斜方向は判別できないものとする。この場合、メモリXの画素位置1および画素位置2に画素(n+2,m)を保存する。また、メモリYのラインn+2の画素位置1および画素位置2に、同じく画素位置(n+2,m)を保存する。そして、次の画素(n+3,m)の処理へうつる。   Pixel (n + 2, m) has a distance value of zero. Here, it is assumed that the inclination direction cannot be determined. In this case, the pixel (n + 2, m) is stored in the pixel position 1 and the pixel position 2 of the memory X. Similarly, the pixel position (n + 2, m) is stored in the pixel position 1 and the pixel position 2 of the line n + 2 of the memory Y. Then, the process proceeds to the next pixel (n + 3, m).

次の処理対象画素(n+3,m)も、距離値が0であるため、傾斜方向を判別する。ここでは、X方向と判別できたものとする。以後、−X方向推定距離値算出処理を行う。   Since the distance value of the next processing target pixel (n + 3, m) is 0, the inclination direction is determined. Here, it is assumed that the X direction can be determined. Thereafter, -X direction estimated distance value calculation processing is performed.

まず、メモリYの、アドレスn+3の領域をリセットし、メモリXに、画素位置1と、画素位置2および傾きのいずれかが保存されているか判別する。ここでは、画素位置1と、画素位置2とが保存され、傾きは保存されていない。よって、ステップS3110へ移行し、画素位置1を、画素(n+3,m)に更新し、次の画素(n+4,m)へうつる。なお、画素位置2は、画素(n+2,m)のままである。   First, the area at the address n + 3 in the memory Y is reset, and it is determined whether the pixel position 1, the pixel position 2, or the inclination is stored in the memory X. Here, the pixel position 1 and the pixel position 2 are stored, and the inclination is not stored. Therefore, the process proceeds to step S3110, the pixel position 1 is updated to the pixel (n + 3, m), and the next pixel (n + 4, m) is transferred. Note that the pixel position 2 remains the pixel (n + 2, m).

処理対象画素(n+4,m)については、画素(n+3,m)と同様の処理が行われ、同様に判別され、画素(n+5,m)の処理へうつる。   The processing target pixel (n + 4, m) is subjected to the same processing as that of the pixel (n + 3, m), is determined in the same manner, and proceeds to the processing of the pixel (n + 5, m).

処理対象画素(n+5,m)は、距離値が0でないため、ステップS1401以降の処理を行う。まず、距離値未算出画素有無判別処理を行う。   Since the processing target pixel (n + 5, m) has a distance value that is not 0, the processing after step S1401 is performed. First, a distance value non-calculated pixel presence / absence determination process is performed.

まず、メモリXを読み出し、画素位置2に位置情報が保存されているか判断する。画素位置2に位置情報が保存されているため、−X方向に隣接する画素の面と連続しているか否かを判別する。ここでは、連続しているものとする。よって、+X方向推定距離値算出処理を行う。   First, the memory X is read, and it is determined whether or not position information is stored at the pixel position 2. Since the position information is stored at the pixel position 2, it is determined whether or not it is continuous with the surface of the pixel adjacent in the −X direction. Here, it shall be continuous. Therefore, + X direction estimated distance value calculation processing is performed.

次に、X方向+1画素つまり画素(n+6,m)の距離値と輝度値とを取得し、処理対象画素(n+5,m)との間で、連続面であるかを判別する。ここでは、連続面と判別されたものとする。さらに、X方向+2画素つまり(n+7,m)の距離値と輝度値とを取得し、連続性を判別する。ここでは、不連続と判別されたものとする。   Next, the distance value and the luminance value of the X direction + 1 pixel, that is, the pixel (n + 6, m) are acquired, and it is determined whether or not the processing target pixel (n + 5, m) is a continuous surface. Here, it is assumed that it is determined as a continuous surface. Further, the distance value and the luminance value in the X direction +2 pixels, that is, (n + 7, m) are acquired, and the continuity is determined. Here, it is assumed that it is determined as discontinuous.

この場合、ステップS3310において、iは2であるため、同じ連続面で2つの距離値を得ることができ、傾きは算出可能である。すなわち、画素(n+5,m)の距離値Qと画素(n+6,m)の距離値Rとを用いて、傾きKを算出する。算出される傾きはR−Qである。   In this case, since i is 2 in step S3310, two distance values can be obtained on the same continuous surface, and the slope can be calculated. That is, the slope K is calculated using the distance value Q of the pixel (n + 5, m) and the distance value R of the pixel (n + 6, m). The calculated slope is RQ.

この傾きを用いて距離値を算出する。ここでは、メモリXに保存されている画素位置1から画素位置2に向かって順に距離値を算出する。画素位置1に保存されている画素(n+4,m)の距離値は、傾きがR−Q、画素(n+5,m)の距離値がQであることから、2Q−Rと算出される。同様に画素(n+3,m)の距離値は、3Q−2Rと算出され、画素(n+2,m)の距離値は、4Q−3Rと算出される。   A distance value is calculated using this inclination. Here, the distance value is calculated in order from the pixel position 1 stored in the memory X toward the pixel position 2. The distance value of the pixel (n + 4, m) stored at the pixel position 1 is calculated as 2Q−R since the slope is R−Q and the distance value of the pixel (n + 5, m) is Q. Similarly, the distance value of the pixel (n + 3, m) is calculated as 3Q-2R, and the distance value of the pixel (n + 2, m) is calculated as 4Q-3R.

画素(n+2,m)は画素位置2であるので、ここまで距離値を算出後、画素位置1から画素位置2までに対応する範囲(n+4〜n+2)をアドレスとするメモリYの領域をリセットする。そして、メモリXをリセットする。   Since the pixel (n + 2, m) is at the pixel position 2, after calculating the distance value so far, the area of the memory Y having the range (n + 4 to n + 2) corresponding to the pixel position 1 to the pixel position 2 as an address is reset. . Then, the memory X is reset.

次に、メモリYのアドレス(n+5)の情報を読み出す。ここでは、画素位置2に位置情報は保存されていない。よって、次の画素(n+6,m)の処理へうつる。   Next, the information at the address (n + 5) of the memory Y is read. Here, position information is not stored at pixel position 2. Therefore, the process proceeds to the next pixel (n + 6, m).

処理対象画素(n+6,m)は、距離値が0でないため、ステップS1401以降の処理を行う。まず、メモリXを読み出し、画素位置2に位置情報が保存されているか判別する。画素位置2に位置情報が保存されていない。従って、メモリXをリセットし、メモリYを読み出す。ここでは、メモリYのアドレスn+6の画素位置2にも位置情報は記録されていない。従って、隣接する画素に、距離値未算出画素はないと判別し、次の画素(n+7,m)の処理へうつり、処理を繰り返す。   The processing target pixel (n + 6, m) does not have a distance value of 0, and therefore the processing from step S1401 is performed. First, the memory X is read, and it is determined whether or not position information is stored at the pixel position 2. Position information is not stored at pixel position 2. Therefore, the memory X is reset and the memory Y is read. Here, no position information is recorded at pixel position 2 at address n + 6 in memory Y. Accordingly, it is determined that there is no distance value uncalculated pixel in the adjacent pixels, the process proceeds to the next pixel (n + 7, m), and the process is repeated.

<具体例3>
次に、対象物113の形状、位置が、図18に示す態様である場合の処理を説明する、同一平面の両端部に対応する画素の画素値を用いて距離値を算出する例である。具体例2同様、図9において、S1102の−X方向推定距離値算出処理では距離値を得られず、+X方向に隣接する画素の距離値を用いて、ステップS1403、図14の+X方向推定距離算出処理で距離値を得る例である。ただし、本例は、ステップS3301からステップS3307へ移行する例である。
<Specific example 3>
Next, an example of calculating a distance value using pixel values of pixels corresponding to both ends of the same plane will be described in the case where the shape and position of the object 113 are in the form shown in FIG. As in the second specific example, in FIG. 9, the distance value cannot be obtained in the −X direction estimated distance value calculation process of S1102, and the distance value of pixels adjacent in the + X direction is used to perform step S1403 and the + X direction estimated distance of FIG. It is an example which obtains a distance value by calculation processing. However, this example is an example in which the process proceeds from step S3301 to step S3307.

処理対象画素(n,m)は距離値が0でないため、ステップS1401以降の処理を行う。ここでは、メモリXに画素位置が保存されているかを確認し、保存されていないためメモリXをリセットし、メモリYの確認にうつる。メモリYにも画素位置は保存されていないため、次の画素(n+1,m)の処理へうつる。   Since the distance value of the processing target pixel (n, m) is not 0, the processing after step S1401 is performed. Here, it is confirmed whether or not the pixel position is stored in the memory X. Since the pixel position is not stored, the memory X is reset and the memory Y is checked. Since the pixel position is not stored in the memory Y, the process proceeds to the next pixel (n + 1, m).

処理対象画素(n+1,m)は、距離値が0でないため、ステップS1401以降の処理を行う。ここでは、画素(n,m)と同様の処理が行われ、次の画素(n+2,m)の処理へうつる。   Since the processing target pixel (n + 1, m) has a distance value that is not 0, the processing after step S1401 is performed. Here, the same processing as that for the pixel (n, m) is performed, and the processing proceeds to the processing for the next pixel (n + 2, m).

処理対象画素(n+2,m)は、距離値は0である。従って、まず、傾斜方向を判別する。ここでは、X方向と判別できたものとする。よって、−X方向推定距離値算出処理を行う。   The processing target pixel (n + 2, m) has a distance value of 0. Therefore, first, the inclination direction is determined. Here, it is assumed that the X direction can be determined. Therefore, -X direction estimated distance value calculation processing is performed.

アドレス(n+2)のメモリYをリセットする。そして、メモリXを読み出し、データが保存されているか否かを判別する。ここでは、何も保存されていないため、連続面の端部を探索するステップS3103以降の処理にうつる。ここでは、連続面の端部として、隣接する画素(n+1,m)が特定される。すなわち、このときiは2である。   The memory Y at the address (n + 2) is reset. Then, the memory X is read to determine whether data is stored. Since nothing is stored here, the process goes to step S3103 and subsequent steps for searching for the end of the continuous surface. Here, the adjacent pixel (n + 1, m) is specified as the end of the continuous surface. That is, i is 2 at this time.

よって、処理対象画素(n+2,m)の連続面の−X方向側には、画素(n+1,m)しかなく、面の傾きを算出することはできない。従って、ステップS3112にうつり、処理対象画素(n+2,m)を、メモリXの画素位置1に、連続面の端部に対応する画素(n+1,m)を、メモリXの画素位置2に保存する。そして、次の画素(n+3,m)の処理へうつる。   Therefore, there are only pixels (n + 1, m) on the −X direction side of the continuous surface of the processing target pixel (n + 2, m), and the inclination of the surface cannot be calculated. Accordingly, in step S3112 the processing target pixel (n + 2, m) is stored in the pixel position 1 of the memory X, and the pixel (n + 1, m) corresponding to the edge of the continuous surface is stored in the pixel position 2 of the memory X. . Then, the process proceeds to the next pixel (n + 3, m).

処理対象画素(n+3,m)は、距離値が0であるため、まず、傾斜の方向を判別する。X方向と判別されたものとし、−X方向推定距離値算出処理を行う。   Since the processing target pixel (n + 3, m) has a distance value of 0, first, the direction of inclination is determined. It is assumed that the direction is the X direction, and the -X direction estimated distance value calculation process is performed.

アドレス(n+3)のメモリYをリセットする。そして、メモリXを読出す。ここでは、画素位置1、画素位置2は保存されているが、傾きが保存されていないため、ステップS3110へ移行し、画素位置1を、処理対象画素(n+3,m)に更新し、次の画素(n+4,m)の処理へうつる。   The memory Y at the address (n + 3) is reset. Then, the memory X is read. Here, although the pixel position 1 and the pixel position 2 are stored, but the inclination is not stored, the process proceeds to step S3110, and the pixel position 1 is updated to the processing target pixel (n + 3, m). The process proceeds to the processing of the pixel (n + 4, m).

画素(n+4,m)は画素(n+3,m)と同様の処理が行われ、次の画素(n+5,m)にうつる。その際にメモリXの画素位置1は、画素位置(n+4,m)に更新される。   The pixel (n + 4, m) is processed in the same manner as the pixel (n + 3, m) and moves to the next pixel (n + 5, m). At that time, the pixel position 1 of the memory X is updated to the pixel position (n + 4, m).

処理対象画素(n+5,m)は、距離値が0でないため、ステップS1401以降の処理を行う。まず、距離値未算出画素有無判別処理を行う。ここでは、メモリXを読み出し、画素位置2に、画素位置が保存されていることから、−X方向に隣接する画素に未算出画素があると判別する。   Since the processing target pixel (n + 5, m) has a distance value that is not 0, the processing after step S1401 is performed. First, a distance value non-calculated pixel presence / absence determination process is performed. Here, since the memory X is read and the pixel position is stored at the pixel position 2, it is determined that there is an uncalculated pixel in the pixel adjacent in the −X direction.

そして、処理対象画素(n+5,m)と、−X方向に隣接する画素(n+4,m)との連続性を判別する。ここでは、連続と判別されたものとする。従って、+X方向推定距離値算出処理を行う。   Then, the continuity between the processing target pixel (n + 5, m) and the pixel (n + 4, m) adjacent in the −X direction is determined. Here, it is assumed that it is determined to be continuous. Therefore, + X direction estimated distance value calculation processing is performed.

メモリXの画素位置2に格納されている画素、すなわち、連続面の端部の画素の距離値が算出されているか否かを判別する。ここでは、画素位置2には、(n+1,m)が格納されている。また、この画素は、距離値がQと算出されている。   It is determined whether or not the distance value of the pixel stored in the pixel position 2 of the memory X, that is, the pixel at the end of the continuous surface is calculated. Here, (n + 1, m) is stored in the pixel position 2. Further, the distance value of this pixel is calculated as Q.

従って、ステップS3307へ移行し、処理対象画素(n+5,m)の距離値Rと、画素(n+1,m)の距離値Qとを用いて、この連続面の傾きを算出する。ここで算出される傾きKは、(R−Q)/4である。そして、この傾きを用いて、画素位置2から画素位置1までの間の、距離値未算出画素の推定距離値を算出する。   Accordingly, the process proceeds to step S3307, and the inclination of the continuous surface is calculated using the distance value R of the processing target pixel (n + 5, m) and the distance value Q of the pixel (n + 1, m). The slope K calculated here is (R−Q) / 4. And using this inclination, the estimated distance value of the pixel whose distance value has not been calculated between the pixel position 2 and the pixel position 1 is calculated.

最後に、メモリXにおける画素位置1から画素位置2までに対応する範囲をアドレスとするメモリYの領域をリセットする。そして、メモリXをリセットする。   Finally, the area of the memory Y whose address is a range corresponding to the pixel position 1 to the pixel position 2 in the memory X is reset. Then, the memory X is reset.

次に、メモリYのアドレス(n+5)の情報を読み出す。ここでは、画素位置2に位置情報は保存されていない。よって、次の画素(n+6,m)の処理へうつる。   Next, the information at the address (n + 5) of the memory Y is read. Here, position information is not stored at pixel position 2. Therefore, the process proceeds to the next pixel (n + 6, m).

処理対象画素(n+6,m)は、距離値が0でないため、ステップS1401以降の処理を行う。まず、距離値未算出画素有無判別処理を行う。ここでは、メモリXの画素位置2には、位置情報は保存されていない。また、メモリYも同様である。従って、隣接画素に距離値未算出画素はないものと判別し、次の画素(n+7,m)の処理へうつり、処理を繰り返す。   The processing target pixel (n + 6, m) does not have a distance value of 0, and therefore the processing from step S1401 is performed. First, a distance value non-calculated pixel presence / absence determination process is performed. Here, position information is not stored in the pixel position 2 of the memory X. The same applies to the memory Y. Therefore, it is determined that there is no distance value uncalculated pixel in the adjacent pixels, and the process proceeds to the next pixel (n + 7, m), and the process is repeated.

<具体例4>
次に、対象物113の形状、位置が、図19に示す態様である場合の処理を説明する。傾斜を有する面に対応する全画素の距離値が得られていないため、推定距離値も算出できない例である。
<Specific Example 4>
Next, processing when the shape and position of the target object 113 are in the form shown in FIG. 19 will be described. This is an example in which the estimated distance value cannot be calculated because the distance values of all the pixels corresponding to the inclined surface are not obtained.

処理対象画素(n,m)は、距離値が0でないため、ステップS1401以降の処理を行う。ここでは、メモリXに画素位置が保存されているかを確認し、保存されていないためメモリXをリセットし、メモリYの確認にうつる。メモリYにも画素位置は保存されていないため、次の画素(n+1,m)の処理へうつる。   Since the processing target pixel (n, m) has a distance value which is not 0, the processing after step S1401 is performed. Here, it is confirmed whether or not the pixel position is stored in the memory X. Since the pixel position is not stored, the memory X is reset and the memory Y is checked. Since the pixel position is not stored in the memory Y, the process proceeds to the next pixel (n + 1, m).

処理対象画素(n+1,m)は、距離値が0である。従って、まず、傾斜方向を判別する。ここでは、傾斜方向は判別できないものとする。この場合、メモリXの画素位置1および画素位置2に画素(n+1,m)を保存する。また、メモリYのラインn+1の画素位置1および画素位置2に、同じく画素位置(n+1,m)を保存する。そして、次の画素(n+2,m)の処理へうつる。   The processing target pixel (n + 1, m) has a distance value of 0. Therefore, first, the inclination direction is determined. Here, it is assumed that the inclination direction cannot be determined. In this case, the pixel (n + 1, m) is stored in the pixel position 1 and the pixel position 2 of the memory X. Similarly, the pixel position (n + 1, m) is stored in the pixel position 1 and the pixel position 2 of the line n + 1 of the memory Y. Then, the process proceeds to the next pixel (n + 2, m).

次の処理対象画素(n+2,m)も、距離値が0であるため、傾斜方向を判別する。ここでは、X方向と判別できたものとする。以後、−X方向推定距離値算出処理を行う。   Since the distance value of the next processing target pixel (n + 2, m) is 0, the inclination direction is determined. Here, it is assumed that the X direction can be determined. Thereafter, -X direction estimated distance value calculation processing is performed.

まず、メモリYの、アドレスn+2の領域をリセットし、メモリXに、画素位置1と、画素位置2および傾きのいずれかが保存されているか判別する。ここでは、画素位置1と、画素位置2とが保存され、傾きは保存されていない。よって、ステップS3110へ移行し、画素位置1を、画素(n+2,m)に更新し、次の画素(n+3,m)へうつる。なお、画素位置2は、画素(n+1,m)のままである。   First, the area at the address n + 2 in the memory Y is reset, and it is determined whether the pixel position 1, the pixel position 2, or the inclination is stored in the memory X. Here, the pixel position 1 and the pixel position 2 are stored, and the inclination is not stored. Therefore, the process proceeds to step S3110, where the pixel position 1 is updated to the pixel (n + 2, m), and the next pixel (n + 3, m) is transferred. Note that the pixel position 2 remains the pixel (n + 1, m).

処理対象画素(n+3,m)、処理対象画素(n+4,m)および処理対象画素(n+5,m)についても、それぞれ、画素(n+2,m)と同様の処理が行われ、同様に判別され、画素(n+6,m)の処理へうつる。なお、メモリXにおいて、この時点では、画素位置1には、画素(n+5,m)が保存され、画素位置2には、画素(n+1,m)が保存され、傾きは保存されない。   The processing target pixel (n + 3, m), the processing target pixel (n + 4, m), and the processing target pixel (n + 5, m) are also processed in the same manner as the pixel (n + 2, m), respectively, and are similarly determined. The process proceeds to processing of the pixel (n + 6, m). At this time, in the memory X, the pixel (n + 5, m) is stored in the pixel position 1, the pixel (n + 1, m) is stored in the pixel position 2, and the inclination is not stored.

画素(n+6,m)の距離値は0でないため、ステップS1401以降の処理を行う。まず、距離値未算出画素有無判別処理を行う。ここでは、メモリXの画素位置2には、画素(n+1,m)が保存されている。従って、X方向の隣接画素に、距離値未算出画素はあると判別される。   Since the distance value of the pixel (n + 6, m) is not 0, the processing after step S1401 is performed. First, a distance value non-calculated pixel presence / absence determination process is performed. Here, a pixel (n + 1, m) is stored in the pixel position 2 of the memory X. Therefore, it is determined that there is a distance value uncalculated pixel in the adjacent pixels in the X direction.

まず、隣接画素の面とX方向に連続性があるか判別する。ここでは、連続性はないと判別され、メモリXをリセットし、Y方向の隣接画素に、距離値未算出画素があるか否かを判別する。ここでは、メモリYの同アドレスには画素位置情報は保存されていないものとする。従って、Y方向には、隣接画素に、距離値未算出画素はないと判別される。   First, it is determined whether there is continuity between adjacent pixel surfaces and the X direction. Here, it is determined that there is no continuity, the memory X is reset, and it is determined whether or not there is a distance value uncalculated pixel in the adjacent pixels in the Y direction. Here, it is assumed that pixel position information is not stored at the same address in the memory Y. Therefore, in the Y direction, it is determined that there is no distance value uncalculated pixel in the adjacent pixels.

従って、この場合、距離値未算出のX方向隣接画素の距離値は算出できない状態で、メモリXも、処理対象画素(n+6,m)のX方向の画素位置nをアドレスとするメモリYの領域もリセットされ、次の画素の処理へうつる。   Accordingly, in this case, the memory X is also an area of the memory Y having the pixel position n in the X direction of the processing target pixel (n + 6, m) as an address in a state where the distance value of the X direction adjacent pixels whose distance value has not been calculated cannot be calculated. Is also reset, and the process proceeds to the next pixel.

このように、本例では、画素(n+1,m)から画素(n+5,m)までの画素の傾きは算出されず、距離値は0のままとなる。   Thus, in this example, the inclination of the pixel from the pixel (n + 1, m) to the pixel (n + 5, m) is not calculated, and the distance value remains 0.

<距離画像生成処理の流れ>
最後に、以上の各部による、本実施形態の距離画像生成処理の流れを説明する。図20は、本実施形態の距離画像生成処理の処理フローである。
<Flow of distance image generation processing>
Finally, the flow of the distance image generation process of the present embodiment by the above units will be described. FIG. 20 is a processing flow of the distance image generation processing of the present embodiment.

まず、光源部110が変調光を照射し、その反射光を含む入射光を光電変換部120が受光し、電荷振分部130が各電荷蓄積部150に振り分ける。これを、距離画像を生成するに足る電荷が蓄積されるまで継続する。このとき、距離画像を生成するに足る電荷が蓄積されると(ステップS1901)、輝度画像生成部160は、輝度画像を生成し、距離画像生成部170は、距離画像を生成する(ステップS1902)。   First, the light source unit 110 emits modulated light, the incident light including the reflected light is received by the photoelectric conversion unit 120, and the charge distribution unit 130 distributes the light to each charge storage unit 150. This continues until enough charge is accumulated to generate the distance image. At this time, if charges sufficient to generate a distance image are accumulated (step S1901), the luminance image generation unit 160 generates a luminance image, and the distance image generation unit 170 generates a distance image (step S1902). .

その後、推定距離値算出部171は、距離値未算出画素の推定距離値を上記手法で算出し(ステップS1903)、距離画像生成部170は、算出した推定距離値を、当該距離値未算出画素の距離値とし(ステップS1904)、処理を終了する。   Thereafter, the estimated distance value calculation unit 171 calculates the estimated distance value of the pixel for which the distance value has not been calculated by the above method (step S1903), and the distance image generation unit 170 uses the calculated estimated distance value as the pixel for which the distance value has not been calculated. (Step S1904), and the process ends.

以上説明したように、本実施形態の距離画像生成装置は、対象空間に変調した変調光111を照射する光源部110と、前記光源部から照射され、前記対象空間内の対象物113の表面で反射した反射光を含む入射光112を受光して電荷に変換する、画素毎に設けられた光電変換素子(光電変換部120)と、前記光電変換素子ごとに複数設けられた電荷蓄積部150と、前記光源部110の変調に同期して、前記光電変換素子により変換された電荷を前記複数の電荷蓄積部150に振り分ける電荷振分部130と、前記電荷蓄積部150に蓄積された電荷を用いて画素値が輝度値である輝度画像220を生成する輝度画像生成部160と、前記複数の電荷蓄積部150に蓄積された電荷を用いて画素値が距離値である距離画像210を生成する距離画像生成部170と、を備え、前記距離画像生成部170は、前記対象物113の表面に傾斜があることにより前記距離値が得られない距離値未算出画素の距離値を、当該距離値未算出画素の近傍の画素の前記輝度値および前記距離値を用いて算出する距離値算出部(推定距離値算出部171)を備える。
ここで用いる近傍の画素は、上述の−X方向推定距離値算出処理などで、iを変更して探索しているように、前記距離値未算出画素に所定方向に隣接して連なる画素であって、隣接する画素との輝度値比が所定範囲の画素である。
As described above, the distance image generation device according to the present embodiment has the light source unit 110 that irradiates the modulated light 111 that is modulated into the target space, and the surface of the target object 113 that is irradiated from the light source unit and that is within the target space. A photoelectric conversion element (photoelectric conversion unit 120) provided for each pixel that receives incident light 112 including reflected reflected light and converts it into charges, and a plurality of charge storage units 150 provided for each photoelectric conversion element; The charge distribution unit 130 that distributes the charges converted by the photoelectric conversion elements to the plurality of charge storage units 150 in synchronization with the modulation of the light source unit 110 and the charges stored in the charge storage unit 150 are used. A luminance image generation unit 160 that generates a luminance image 220 whose pixel value is a luminance value, and a distance image 210 whose pixel value is a distance value using the charges accumulated in the plurality of charge accumulation units 150. A distance image generation unit 170 that performs the distance value calculation of the distance value uncalculated pixels for which the distance value cannot be obtained due to the inclination of the surface of the object 113. A distance value calculation unit (estimated distance value calculation unit 171) that calculates using the luminance value and the distance value of the pixels in the vicinity of the value non-calculated pixel is provided.
The neighboring pixels used here are pixels that are adjacent to the non-distance value calculation pixels adjacent to each other in a predetermined direction as searched by changing i in the above-mentioned -X direction estimated distance value calculation processing or the like. Thus, the luminance value ratio between adjacent pixels is a pixel in a predetermined range.

また、前記推定距離値算出部171は、−X方向推定距離値算出処理のステップS3103〜ステップS3106のループ、+X方向推定距離値算出処理のステップS3302〜3305のループ、同S3301などに記載されているように、前記近傍画素内に前記距離値が算出された複数の画素がある場合、当該複数の画素を用いて、前記対象物の表面の傾きを算出し、当該傾きを用いて前記距離値未算出画素の距離値を算出する。   Further, the estimated distance value calculation unit 171 is described in the loop of steps S3103 to S3106 of the -X direction estimated distance value calculation process, the loop of steps S3302 to 3305 of the + X direction estimated distance value calculation process, and the same S3301. As described above, when there are a plurality of pixels for which the distance value is calculated in the neighboring pixels, the distance value is calculated by using the plurality of pixels to calculate the inclination of the surface of the object. The distance value of the uncalculated pixel is calculated.

本実施形態の推定距離値算出部171は、画素毎に、予め定めた順に、距離値が算出されていない画素(距離値未算出画素)であるか否かを判別し、距離値未算出画素であると判別された場合、上述のステップS1101、ステップS1201のように、前記対象物113の表面の傾斜方向を特定し、特定された傾斜方向の、前記順に画素を判別する方向とは逆方向に隣接して連なる画素であって、隣接する画素との輝度値の比(輝度値比)が所定範囲の画素を近傍の画素として、距離値未算出画素の距離値を推定する。   The estimated distance value calculation unit 171 of the present embodiment determines, for each pixel, whether or not the pixel is a pixel for which a distance value has not been calculated (distance value uncalculated pixel) in a predetermined order. When it is determined that the pixel is inclined, as in steps S1101 and S1201 described above, the inclination direction of the surface of the object 113 is specified, and the direction of the specified inclination direction is opposite to the direction in which the pixels are determined in the order. A distance value of a pixel whose distance value has not been calculated is estimated using a pixel that is adjacent to the pixel and has a luminance value ratio (luminance value ratio) with a neighboring pixel as a neighboring pixel.

本実施形態では、上述のように、特定される傾斜方向は、X方向およびY方向のいずれかである。従って、X方向と特定された場合、ステップS1102の−X方向推定距離値算出処理を行う。この−X方向推定距離値算出処理において、ステップS3103からステップS3107のように、−X方向に連なる画素であって、視野内の面が連続する画素範囲を特定し、これらの画素の距離値を用いて、距離値未算出画素の距離値を算出する。Y方向と特定された場合も同様である。   In the present embodiment, as described above, the specified inclination direction is either the X direction or the Y direction. Therefore, when the X direction is specified, the estimated X-direction distance value calculation process in step S1102 is performed. In this -X direction estimated distance value calculation process, as in steps S3103 to S3107, a pixel range that is continuous in the -X direction and has a continuous surface in the field of view is specified, and the distance value of these pixels is determined. The distance value of the pixel whose distance value has not been calculated is calculated. The same applies when the Y direction is specified.

一方、本実施形態の推定距離値算出部171は、否と判別された場合、判別対象画素に前記順に画素を判別する方向と逆方向に隣接する画素が距離値未算出画素であるか否かを判別し、距離値未算出画素と判別された場合、前記傾斜方向の、前記順に画素を判別する方向に隣接して連なる画素であって、隣接する画素との輝度値比が所定範囲の画素を前記近傍の画素として、当該距離値未算出画素の距離値を算出する。   On the other hand, if it is determined NO, the estimated distance value calculation unit 171 of the present embodiment determines whether or not a pixel adjacent to the determination target pixel in the reverse direction to the pixel determination order is a distance value non-calculated pixel. If the pixel is determined to be a pixel whose distance value has not yet been calculated, pixels that are adjacent to each other in the inclination direction and in the direction in which the pixels are sequentially determined, and that have a luminance value ratio with the adjacent pixels in a predetermined range Is used as the neighboring pixel, and the distance value of the pixel whose distance value has not been calculated is calculated.

上述のように、本実施形態の推定距離値算出部171は、処理対象画素が、距離値未算出画素でない場合、ステップS1401へ移行する。そして、まず、−X方向に隣接する画素であって視野内の面が連続面である画素に距離値未算出画素がないかを判別し、ある場合は、ステップS1403の+X方向推定距離値算出処理に進む。そして、ステップS3302からステップS3306のように、+X方向に視野内の面が連続する画素範囲を特定し、これらの画素の距離値を用いて、距離値未算出画素の距離値を算出する。   As described above, the estimated distance value calculation unit 171 of the present embodiment proceeds to step S1401 when the processing target pixel is not a distance value non-calculated pixel. First, it is determined whether a pixel that is adjacent to the −X direction and the surface in the field of view is a continuous surface has no distance value calculated pixel. If there is, the + X direction estimated distance value is calculated in step S1403. Proceed to processing. Then, as in steps S3302 to S3306, a pixel range in which surfaces in the field of view are continuous in the + X direction is specified, and the distance value of the distance value uncalculated pixels is calculated using the distance values of these pixels.

視野内の面が連続するか否かの判別は、上述のように、輝度値比を用いて行う。輝度値比が所定範囲であれば、両画素の視野内の対象物113の反射面は連続していると判断する。   Whether the surfaces in the field of view are continuous or not is determined using the luminance value ratio as described above. If the luminance value ratio is within a predetermined range, it is determined that the reflecting surface of the object 113 in the field of view of both pixels is continuous.

このように、本実施形態によれば、変調光による反射光が存在しない箇所があっても、当該箇所の輝度値と、近傍の輝度値および距離値とを用いて推定距離値を算出する。対象物113の反射面に傾斜があるため、距離値が得られない場合であっても、推定距離値を算出できる。従って、対象物の形状によらず、高精度な距離画像を得ることができる。   As described above, according to the present embodiment, even if there is a portion where there is no reflected light due to the modulated light, the estimated distance value is calculated using the luminance value of the portion, the nearby luminance value, and the distance value. Since the reflecting surface of the object 113 is inclined, the estimated distance value can be calculated even when the distance value cannot be obtained. Therefore, a highly accurate distance image can be obtained regardless of the shape of the object.

このとき、本実施形態によれば、傾き値、画素位置のメモリ保存・読み出し処理を行うことにより、同一処理の繰り返しを防いでいる。例えば、−X方向推定距離値算出処理の、ステップS3113から、ステップS3109へ移行する処理のように、先の距離値未算出画素が、探索範囲に含まれ、かつ、反射面の傾きが算出されている場合は、この傾きを利用して推定距離値を算出する。   At this time, according to the present embodiment, the same processing is prevented from being repeated by performing memory storage / reading processing of the inclination value and the pixel position. For example, the previous distance value non-calculated pixel is included in the search range and the inclination of the reflecting surface is calculated as in the process of shifting from step S3113 to step S3109 in the -X direction estimated distance value calculation process. If it is, the estimated distance value is calculated using this inclination.

このように、本実施形態では、一度算出した傾き、情報を保存し、後過程において活用することにより、同一算術処理の増加により処理速度の低下を防ぎ、フレームレートの大幅な低下を抑えることができる。   As described above, in the present embodiment, the slope and information calculated once are stored and used in the subsequent process, thereby preventing a decrease in processing speed due to an increase in the same arithmetic processing and suppressing a significant decrease in frame rate. it can.

また、本実施形態によれば、1つの距離画像生成装置100で得られる情報を用いて推定距離値を算出しているため、複数の距離画像生成装置を用いる必要がない。従って、安価かつ小型にすることが可能である。   Moreover, according to this embodiment, since the estimated distance value is calculated using information obtained by one distance image generation device 100, it is not necessary to use a plurality of distance image generation devices. Therefore, it is possible to reduce the cost and size.

さらに、推定距離値は、蓄積された電荷から算出される距離値および輝度値を用いて算出する。従って、基準となる背景データが不必要であるため、動物体であってもリアルタイムに推定距離値を得ることができる。   Further, the estimated distance value is calculated using the distance value and the luminance value calculated from the accumulated charges. Therefore, since background data serving as a reference is unnecessary, an estimated distance value can be obtained in real time even for a moving object.

<変形例>
なお、上記実施形態では、光源部110から常に変調光を照射し、その反射光を含む入射光により、蓄積された電荷から、距離値および輝度値を算出し、距離画像および輝度画像をそれぞれ得ている。しかしながら、距離画像、輝度画像の手法は、これに限定されない。例えば、独立したタイミングで取得するよう構成してもよい。
<Modification>
In the above embodiment, the light source unit 110 always emits modulated light, and the incident light including the reflected light calculates the distance value and the luminance value from the accumulated charges, thereby obtaining the distance image and the luminance image, respectively. ing. However, the method of the distance image and the luminance image is not limited to this. For example, you may comprise so that it may acquire at an independent timing.

すなわち、輝度値算出用電荷取得期間および距離値算出用電荷取得期間を設ける。これらの期間は、タイミングチャートとして予め定め、記憶装置等に保存しておく。   That is, a luminance value calculation charge acquisition period and a distance value calculation charge acquisition period are provided. These periods are determined in advance as timing charts and stored in a storage device or the like.

この場合、制御部140は、輝度値算出用電荷取得期間は輝度画像生成部160に制御信号(読出信号)を送り、電荷を読み出させ、距離値算出用電荷の場合は距離画像生成部170に制御信号(読出信号)を送り電荷を読み出させる。   In this case, the control unit 140 sends a control signal (read signal) to the luminance image generation unit 160 during the luminance value calculation charge acquisition period to read out the charge, and in the case of the distance value calculation charge, the distance image generation unit 170. Then, a control signal (read signal) is sent to read the charge.

輝度値を算出する場合、上述のように、最終的に合算するため、位相情報は必要ない。強度情報のみが得られればよい。従って、所定期間ごとに、複数の電荷蓄積部に振り分ける必要はない。従って、例えば、図21に示すように、制御部140は、輝度値算出用電荷取得期間は、ゲート信号を、1つの電荷蓄積部150にのみ電荷が蓄積されるよう出力してもよい。このような制御により、変調光と環境光とから輝度値が算出される。   When the luminance value is calculated, phase information is not necessary because it is finally added as described above. Only intensity information needs to be obtained. Therefore, it is not necessary to distribute the plurality of charge storage units every predetermined period. Therefore, for example, as illustrated in FIG. 21, the control unit 140 may output the gate signal so that charges are accumulated only in one charge accumulation unit 150 during the luminance value calculation charge acquisition period. With such control, the luminance value is calculated from the modulated light and the ambient light.

また、輝度値の算出には、変調光は不要である。従って、光源部110への変調信号を制御してもよい。すなわち、制御部140は、距離値算出用電荷取得期間は、光源部110に変調信号を送り、輝度値算出用電荷取得期間は、光源部110に変調信号を送信しない。すなわち、制御部140は、輝度値算出用電荷取得期間は、光源部110を、変調光を照射しないよう制御する。これは、予め定めたタイミングチャートに従って行う。この場合、制御部140は、距離値算出用電荷取得期間のみ、変調信号に同期させて、ゲート信号を出力する。   Further, no modulated light is required for calculating the luminance value. Therefore, the modulation signal to the light source unit 110 may be controlled. That is, the control unit 140 transmits a modulation signal to the light source unit 110 during the distance value calculation charge acquisition period, and does not transmit a modulation signal to the light source unit 110 during the luminance value calculation charge acquisition period. That is, the control unit 140 controls the light source unit 110 not to emit the modulated light during the luminance value calculation charge acquisition period. This is performed according to a predetermined timing chart. In this case, the control unit 140 outputs the gate signal in synchronization with the modulation signal only during the distance value calculating charge acquisition period.

この場合の、輝度値算出用電荷取得期間の変調信号とゲート信号の一例を図22に示す。このように、この期間は、変調信号は送信しない。一方、ゲート信号は、図21同様、1つの電荷蓄積部150にのみ電荷が蓄積されるよう出力される。   An example of the modulation signal and the gate signal in the luminance value calculation charge acquisition period in this case is shown in FIG. Thus, no modulated signal is transmitted during this period. On the other hand, the gate signal is output so that charges are stored only in one charge storage unit 150, as in FIG.

光源部110は、変調信号を受信したときのみ、当該変調信号に従って、発光する。光電変換部120は、変調光の反射光を含む入射光を受光する。また、光源部110が発光していない間は、光電変換部120は、環境光のみを受光する。   The light source unit 110 emits light according to the modulation signal only when the modulation signal is received. The photoelectric conversion unit 120 receives incident light including reflected light of modulated light. In addition, while the light source unit 110 is not emitting light, the photoelectric conversion unit 120 receives only ambient light.

なお、輝度値算出用電荷取得期間は、変調信号1周期に対し、それぞれ1:1の割合で設けてもよいし、1:10であってもよく、自由に設定できる。   The luminance value calculation charge acquisition period may be provided at a ratio of 1: 1 or 1:10 for each period of the modulation signal, and can be freely set.

このように構成することにより、各画素の輝度を受光する期間と、各画素の反射光を受光する期間とをそれぞれ設け、結果として出力される輝度値と距離値とを、上述の手法で相互利用し、傾斜部の距離値を算出する。   With this configuration, a period for receiving the luminance of each pixel and a period for receiving the reflected light of each pixel are provided, and the luminance value and the distance value output as a result are mutually determined by the above-described method. Utilizing this, the distance value of the inclined portion is calculated.

これにより、変調光による反射光が存在しない場合であっても、確実に輝度値を得ることができ、より、高精度な推定距離値を算出できる。   As a result, even when there is no reflected light due to the modulated light, it is possible to reliably obtain the luminance value and to calculate a more accurate estimated distance value.

なお、上記実施形態では、推定距離値算出部171を、距離画像生成部170が備えるものとして記載しているが、この構成に限定されない。例えば、距離画像生成装置100とデータの送受信可能な、距離画像生成装置100とは独立して設けられた情報処理装置が推定距離値算出部171を実現するよう構成してもよい。   In the above embodiment, the estimated distance value calculation unit 171 is described as being included in the distance image generation unit 170, but is not limited to this configuration. For example, an information processing device that can transmit and receive data to and from the distance image generation device 100 and that is provided independently of the distance image generation device 100 may be configured to realize the estimated distance value calculation unit 171.

また、輝度画像生成部160および距離画像生成部170も同様に、外部装置で実現されてもよい。この場合、所定量電荷が蓄積される毎に、制御部140が、輝度画像生成部160および距離画像生成部170を実現する外部装置に電荷を送信する。   Similarly, the luminance image generation unit 160 and the distance image generation unit 170 may be realized by an external device. In this case, every time a predetermined amount of charge is accumulated, the control unit 140 transmits the charge to an external device that implements the luminance image generation unit 160 and the distance image generation unit 170.

100:距離画像生成装置、110:光源部、111:変調光、112:入射光、113:対象物、113a:対象物、113b:壁、114:変調信号、115:ゲート信号、120:光電変換部、130:電荷振分部、140:制御部、150:電荷蓄積部、160:輝度画像生成部、170:距離画像生成部、171:推定距離値算出部、210:距離画像、220:輝度画像、300:画素位置、410:メモリX、411:画素位置1、412:画素位置2、413:傾き、420:メモリY、421:画素位置1、422:画素位置2、423:傾き、424:アドレス   DESCRIPTION OF SYMBOLS 100: Distance image generation apparatus, 110: Light source part, 111: Modulated light, 112: Incident light, 113: Object, 113a: Object, 113b: Wall, 114: Modulation signal, 115: Gate signal, 120: Photoelectric conversion Unit: 130: charge distribution unit, 140: control unit, 150: charge storage unit, 160: luminance image generation unit, 170: distance image generation unit, 171: estimated distance value calculation unit, 210: distance image, 220: luminance Image: 300: Pixel position, 410: Memory X, 411: Pixel position 1, 412: Pixel position 2, 413: Tilt, 420: Memory Y, 421: Pixel position 1, 422: Pixel position 2, 423: Tilt, 424 :address

Claims (11)

対象空間に変調した変調光を照射する光源部と、
前記光源部から照射され、前記対象空間内の対象物の表面で反射した反射光を含む入射光を受光して電荷に変換する、画素毎に設けられた光電変換素子と、
前記光電変換素子ごとに複数設けられた電荷蓄積部と、
前記変調光の変調に同期して、前記光電変換素子により変換された電荷を前記複数の電荷蓄積部に振り分ける電荷振分部と、を備える距離画像生成装置における距離画像生成方法であって、
前記電荷蓄積部に蓄積された電荷を用いて画素値が輝度値である輝度画像を生成するとともに、前記複数の電荷蓄積部に蓄積された電荷を用いて画素値が距離値である距離画像を生成する画像生成ステップと、
前記対象物の表面に傾斜があることにより前記距離値が得られない距離値未算出画素の距離値を、当該距離値未算出画素の近傍の画素の前記輝度値および前記距離値を用いて算出する距離値算出ステップと、を含むこと
を特徴とする距離画像生成方法。
A light source unit that emits modulated light modulated into the target space;
A photoelectric conversion element provided for each pixel that receives incident light including reflected light irradiated from the light source unit and reflected by the surface of the object in the target space, and converts the incident light into charges;
A plurality of charge storage portions provided for each photoelectric conversion element;
A distance image generation method in a distance image generation apparatus comprising: a charge distribution unit that distributes charges converted by the photoelectric conversion elements to the plurality of charge storage units in synchronization with modulation of the modulated light,
A luminance image whose pixel value is a luminance value is generated using the charge accumulated in the charge accumulation unit, and a distance image whose pixel value is a distance value using the charge accumulated in the plurality of charge accumulation units. An image generation step to generate;
A distance value of a distance value non-calculated pixel for which the distance value cannot be obtained due to an inclination on the surface of the object is calculated using the luminance value and the distance value of pixels in the vicinity of the distance value non-calculated pixel. A distance value calculating step. A distance image generating method comprising:
対象空間に変調した変調光を照射する光源部と、
前記光源部から照射され、前記対象空間内の対象物の表面で反射した反射光を含む入射光を受光して電荷に変換する、画素毎に設けられた光電変換素子と、
前記光電変換素子ごとに複数設けられた電荷蓄積部と、
前記変調光の変調に同期して、前記光電変換素子により変換された電荷を前記複数の電荷蓄積部に振り分ける電荷振分部と、を備える装置に接続されたコンピュータに
前記電荷蓄積部に蓄積された電荷を用いて画素値が輝度値である輝度画像を生成するとともに、前記複数の電荷蓄積部に蓄積された電荷を用いて画素値が距離値である距離画像を生成する手順、および
前記対象物の表面に傾斜があることにより前記距離値が得られない距離値未算出画素の距離値を、当該距離値未算出画素の近傍の画素の前記輝度値および前記距離値を用いて算出する手順を実行させるためのプログラム。
A light source unit that emits modulated light modulated into the target space;
A photoelectric conversion element provided for each pixel that receives incident light including reflected light irradiated from the light source unit and reflected by the surface of the object in the target space, and converts the incident light into charges;
A plurality of charge storage portions provided for each photoelectric conversion element;
A charge distribution unit that distributes the charges converted by the photoelectric conversion elements to the plurality of charge storage units in synchronization with the modulation of the modulated light, and is stored in the charge storage unit. Generating a luminance image whose pixel value is a luminance value using the measured charge, and generating a distance image whose pixel value is a distance value using the charges accumulated in the plurality of charge accumulation units, and the target A procedure for calculating a distance value of a distance value non-calculated pixel for which the distance value cannot be obtained due to an inclination of the surface of the object, using the luminance value and the distance value of a pixel in the vicinity of the distance value non-calculated pixel. A program for running
対象空間に変調した変調光を照射する光源部と、
前記光源部から照射され、前記対象空間内の対象物の表面で反射した反射光を含む入射光を受光して電荷に変換する、画素毎に設けられた光電変換素子と、
前記光電変換素子ごとに複数設けられた電荷蓄積部と、
前記変調光の変調に同期して、前記光電変換素子により変換された電荷を前記複数の電荷蓄積部に振り分ける電荷振分部と、
前記電荷蓄積部に蓄積された電荷を用いて画素値が輝度値である輝度画像を生成する輝度画像生成部と、
前記複数の電荷蓄積部に蓄積された電荷を用いて画素値が距離値である距離画像を生成する距離画像生成部と、を備え、
前記距離画像生成部は、前記対象物の表面に傾斜があることにより前記距離値が得られない距離値未算出画素の距離値を、当該距離値未算出画素の近傍の画素の前記輝度値および前記距離値を用いて算出する距離値算出部を備えること
を特徴とする距離画像生成装置。
A light source unit that emits modulated light modulated into the target space;
A photoelectric conversion element provided for each pixel that receives incident light including reflected light irradiated from the light source unit and reflected by the surface of the object in the target space, and converts the incident light into charges;
A plurality of charge storage portions provided for each photoelectric conversion element;
A charge distribution unit that distributes the charges converted by the photoelectric conversion elements to the plurality of charge storage units in synchronization with the modulation of the modulated light;
A luminance image generation unit that generates a luminance image whose pixel value is a luminance value using the charge accumulated in the charge accumulation unit;
A distance image generation unit that generates a distance image in which a pixel value is a distance value using charges accumulated in the plurality of charge accumulation units;
The distance image generation unit calculates a distance value of a distance value non-calculated pixel for which the distance value cannot be obtained due to an inclination on a surface of the object, the luminance value of a pixel in the vicinity of the distance value uncalculated pixel, and A distance image generation apparatus comprising a distance value calculation unit that calculates using the distance value.
請求項3記載の距離画像生成装置であって、
前記近傍の画素は、前記距離値未算出画素に所定方向に隣接して連なる画素であって、隣接する画素との輝度値比が所定範囲の画素であること
を特徴とする距離画像生成装置。
The distance image generating device according to claim 3,
The neighboring pixel is a pixel adjacent to and adjacent to the pixel whose distance value has not been calculated in a predetermined direction, and a luminance value ratio with the adjacent pixel is a pixel within a predetermined range.
請求項4記載の距離画像生成装置であって、
前記距離値算出部は、前記近傍画素内に前記距離値が算出された複数の画素がある場合、当該複数の画素を用いて、前記対象物の表面の傾きを算出し、当該傾きを用いて前記距離値未算出画素の距離値を算出すること
を特徴とする距離画像生成装置。
The distance image generating device according to claim 4,
When there are a plurality of pixels for which the distance value is calculated in the neighboring pixels, the distance value calculation unit calculates the inclination of the surface of the object using the plurality of pixels, and uses the inclination A distance image generation apparatus characterized by calculating a distance value of the pixel whose distance value has not been calculated.
請求項4または5記載の距離画像生成装置であって、
前記距離値算出部は、画素毎に、予め定めた順に、距離値未算出画素であるか否かを判別し、距離値未算出画素であると判別された場合、前記対象物の表面の傾斜方向を特定し、特定された傾斜方向の、前記順に画素を判別する方向とは逆方向に隣接して連なる画素であって、隣接する画素との輝度値比が所定範囲の画素を前記近傍の画素として、前記距離値未算出画素の距離値を算出すること
を特徴とする距離画像生成装置。
The distance image generating device according to claim 4 or 5,
The distance value calculation unit determines, for each pixel, whether or not the pixel is a distance value non-calculated pixel in a predetermined order. If the distance value calculation unit determines that the pixel is a distance value non-calculated pixel, the inclination of the surface of the object is determined. The direction is specified, and the pixels in the specified inclination direction are adjacent to each other in the direction opposite to the direction in which the pixels are determined in the order, and the pixels whose luminance value ratio with the adjacent pixels is within a predetermined range A distance image generating apparatus, wherein a distance value of the pixel whose distance value has not been calculated is calculated as a pixel.
請求項6記載の距離画像生成装置であって、
前記距離値算出部は、否と判別された場合、当該判別対象画素に前記順に画素を判別する方向と逆方向に隣接する画素が距離値未算出画素であるか否かを判別し、距離値未算出画素と判別された場合、前記傾斜方向の、前記順に画素を判別する方向に隣接して連なる画素であって、隣接する画素との輝度値比が所定範囲の画素を前記近傍の画素として、当該距離値未算出画素の距離値を算出すること
を特徴とする距離画像生成装置。
The distance image generation device according to claim 6,
When it is determined that the distance value calculation unit is not, the distance value calculation unit determines whether or not a pixel adjacent to the determination target pixel in the reverse direction to the pixel determination order is a distance value non-calculated pixel. When it is determined as an uncalculated pixel, a pixel that is adjacent to and in a direction in which the pixels are sequentially determined in the tilt direction and that has a luminance value ratio with the adjacent pixel in a predetermined range is set as the neighboring pixel. A distance image generating apparatus that calculates a distance value of the distance value non-calculated pixels.
請求項6記載の距離画像生成装置であって、
前記距離値算出部は、距離値未算出画素と判別された画素については、先に距離値未算出画素と判別された画素が前記近傍画素に含まれ、かつ、前記傾きが算出されている場合、当該傾きを用いて前記距離値を算出すること
を特徴とする距離画像生成装置。
The distance image generation device according to claim 6,
The distance value calculation unit, for a pixel determined to be a distance value non-calculated pixel, a pixel previously determined to be a distance value non-calculated pixel is included in the neighboring pixels and the inclination is calculated And calculating the distance value using the inclination.
請求項6から8いずれか1項記載の距離画像生成装置であって、
前記距離値算出部は、前記近傍の画素の端部画素を特定し、前記傾きの算出に、当該端部画素の距離値を用いること
を特徴とする距離画像生成装置。
The distance image generating device according to any one of claims 6 to 8,
The distance value calculation unit identifies an end pixel of the neighboring pixels, and uses the distance value of the end pixel for calculating the inclination.
請求項3から9いずれか1項記載の距離画像生成装置であって、
前記前記電荷振分部を制御する制御部をさらに備え、
前記制御部は、前記輝度画像生成のための電荷を取得する際は、予め定めた1つの電荷蓄積部に全ての電荷を蓄積するよう前記電荷振分部を制御すること
を特徴とする距離画像生成装置。
The distance image generation device according to any one of claims 3 to 9,
A control unit for controlling the charge distribution unit;
The control unit controls the charge distribution unit to store all charges in one predetermined charge storage unit when acquiring the charge for generating the luminance image. Generator.
請求項3から9いずれか1項記載の距離画像生成装置であって、
前記光源部を制御する制御部をさらに備え、
前記制御部は、前記輝度画像生成のための電荷を取得する際は、前記変調光を照射しないよう前記光源部を制御すること
を特徴とする距離画像生成装置。
The distance image generation device according to any one of claims 3 to 9,
A control unit for controlling the light source unit;
The distance image generation device, wherein the control unit controls the light source unit not to irradiate the modulated light when acquiring the charge for generating the luminance image.
JP2013264337A 2013-12-20 2013-12-20 Distance image generator Active JP6312420B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013264337A JP6312420B2 (en) 2013-12-20 2013-12-20 Distance image generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013264337A JP6312420B2 (en) 2013-12-20 2013-12-20 Distance image generator

Publications (2)

Publication Number Publication Date
JP2015121430A true JP2015121430A (en) 2015-07-02
JP6312420B2 JP6312420B2 (en) 2018-04-18

Family

ID=53533175

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013264337A Active JP6312420B2 (en) 2013-12-20 2013-12-20 Distance image generator

Country Status (1)

Country Link
JP (1) JP6312420B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017044663A (en) * 2015-08-28 2017-03-02 シャープ株式会社 Optical sensor
JP2017166915A (en) * 2016-03-15 2017-09-21 キヤノン株式会社 Information processing apparatus, information processing method, and program
WO2018042887A1 (en) * 2016-08-30 2018-03-08 ソニーセミコンダクタソリューションズ株式会社 Distance measurement device and control method for distance measurement device
WO2023013777A1 (en) * 2021-08-05 2023-02-09 株式会社小糸製作所 Gated camera, vehicular sensing system, and vehicular lamp

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000293687A (en) * 1999-02-02 2000-10-20 Minolta Co Ltd Three-dimensional shape data processor and three- dimensional shape data processing method
JP2006105694A (en) * 2004-10-01 2006-04-20 Matsushita Electric Works Ltd Distance image sensor
US20070064976A1 (en) * 2005-09-20 2007-03-22 Deltasphere, Inc. Methods, systems, and computer program products for acquiring three-dimensional range information
US20070182949A1 (en) * 2005-12-21 2007-08-09 Cristiano Niclass Method and arrangement for measuring the distance to an object
JP2008122223A (en) * 2006-11-13 2008-05-29 Suzuki Motor Corp Distance measuring device
JP2009047662A (en) * 2007-08-22 2009-03-05 Hamamatsu Photonics Kk Solid imaging device and depth map measuring device
JP2009047475A (en) * 2007-08-15 2009-03-05 Hamamatsu Photonics Kk Solid-state imaging element
JP2011122913A (en) * 2009-12-10 2011-06-23 Stanley Electric Co Ltd Distance image generation apparatus and distance image generation method
JP2013076645A (en) * 2011-09-30 2013-04-25 Stanley Electric Co Ltd Distance image generation apparatus and distance image generation method
JP2013096941A (en) * 2011-11-04 2013-05-20 Sony Corp Imaging device, imaging method, and program

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000293687A (en) * 1999-02-02 2000-10-20 Minolta Co Ltd Three-dimensional shape data processor and three- dimensional shape data processing method
JP2006105694A (en) * 2004-10-01 2006-04-20 Matsushita Electric Works Ltd Distance image sensor
US20070064976A1 (en) * 2005-09-20 2007-03-22 Deltasphere, Inc. Methods, systems, and computer program products for acquiring three-dimensional range information
US20070182949A1 (en) * 2005-12-21 2007-08-09 Cristiano Niclass Method and arrangement for measuring the distance to an object
JP2008122223A (en) * 2006-11-13 2008-05-29 Suzuki Motor Corp Distance measuring device
JP2009047475A (en) * 2007-08-15 2009-03-05 Hamamatsu Photonics Kk Solid-state imaging element
JP2009047662A (en) * 2007-08-22 2009-03-05 Hamamatsu Photonics Kk Solid imaging device and depth map measuring device
JP2011122913A (en) * 2009-12-10 2011-06-23 Stanley Electric Co Ltd Distance image generation apparatus and distance image generation method
JP2013076645A (en) * 2011-09-30 2013-04-25 Stanley Electric Co Ltd Distance image generation apparatus and distance image generation method
JP2013096941A (en) * 2011-11-04 2013-05-20 Sony Corp Imaging device, imaging method, and program

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017044663A (en) * 2015-08-28 2017-03-02 シャープ株式会社 Optical sensor
JP2017166915A (en) * 2016-03-15 2017-09-21 キヤノン株式会社 Information processing apparatus, information processing method, and program
WO2018042887A1 (en) * 2016-08-30 2018-03-08 ソニーセミコンダクタソリューションズ株式会社 Distance measurement device and control method for distance measurement device
CN108139484A (en) * 2016-08-30 2018-06-08 索尼半导体解决方案公司 The control method of range unit and range unit
US10641606B2 (en) 2016-08-30 2020-05-05 Sony Semiconductor Solutions Corporation Distance measuring device and method of controlling distance measuring device
US11310411B2 (en) 2016-08-30 2022-04-19 Sony Semiconductor Solutions Corporation Distance measuring device and method of controlling distance measuring device
CN108139484B (en) * 2016-08-30 2023-03-31 索尼半导体解决方案公司 Distance measuring device and method for controlling distance measuring device
WO2023013777A1 (en) * 2021-08-05 2023-02-09 株式会社小糸製作所 Gated camera, vehicular sensing system, and vehicular lamp

Also Published As

Publication number Publication date
JP6312420B2 (en) 2018-04-18

Similar Documents

Publication Publication Date Title
US11105617B2 (en) Hybrid light measurement method for measuring three-dimensional profile
CN107219533B (en) Laser radar point cloud and image co-registration formula detection system
JP6312420B2 (en) Distance image generator
US11153483B2 (en) Shelf-viewing camera with multiple focus depths
JP6528447B2 (en) Disparity calculation system and distance measuring device
KR101550474B1 (en) Method and device for finding and tracking pairs of eyes
KR101850068B1 (en) Detecting device for lidar light source without rotation
US10302424B2 (en) Motion contrast depth scanning
CN107036534B (en) Method and system for measuring displacement of vibration target based on laser speckle
RU2363019C2 (en) Method and device of analysing surface oscillations by means of movable spectroscopic interferometer
Moore et al. Development of a new underwater bathymetric laser imaging system: L-bath
US10715718B2 (en) Phase detect auto-focus three dimensional image capture system
JP5208692B2 (en) Position measuring system and position measuring method
US11803982B2 (en) Image processing device and three-dimensional measuring system
CN113538551A (en) Depth map generation method and device and electronic equipment
JP6772639B2 (en) Parallax calculation system, mobiles and programs
JP2019194670A (en) Range differentiators for auto-focusing in optical imaging systems
JP6668594B2 (en) Parallax calculation system, information processing device, information processing method, and program
US4657393A (en) Pattern optimization when measuring depth to a surface using lens focusing
EP4009274A1 (en) Image processing device, three-dimensional measurement system, and image processing method
JPWO2020183710A1 (en) Image processing equipment and 3D measurement system
JP6379646B2 (en) Information processing apparatus, measurement method, and program
CN110617780B (en) Laser interference device and three-dimensional reconstruction imaging system applying same
JP3887377B2 (en) Image information acquisition apparatus, image information acquisition method, and image information acquisition program
WO2022113877A1 (en) Three-dimensional-measurement device and three-dimensional-measurement method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20161104

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170821

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170829

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20171027

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180320

R150 Certificate of patent or registration of utility model

Ref document number: 6312420

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250