JP6730214B2 - Parallax calculator - Google Patents

Parallax calculator Download PDF

Info

Publication number
JP6730214B2
JP6730214B2 JP2017056106A JP2017056106A JP6730214B2 JP 6730214 B2 JP6730214 B2 JP 6730214B2 JP 2017056106 A JP2017056106 A JP 2017056106A JP 2017056106 A JP2017056106 A JP 2017056106A JP 6730214 B2 JP6730214 B2 JP 6730214B2
Authority
JP
Japan
Prior art keywords
image
node
correction
cost
processing
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.)
Active
Application number
JP2017056106A
Other languages
Japanese (ja)
Other versions
JP2018159590A (en
Inventor
和寿 石丸
和寿 石丸
尚利 野村
尚利 野村
白井 孝昌
孝昌 白井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2017056106A priority Critical patent/JP6730214B2/en
Publication of JP2018159590A publication Critical patent/JP2018159590A/en
Application granted granted Critical
Publication of JP6730214B2 publication Critical patent/JP6730214B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Measurement Of Optical Distance (AREA)
  • Image Analysis (AREA)

Description

本開示は、視点の異なる二つの画像から視差を演算する技術に関する。 The present disclosure relates to a technique of calculating parallax from two images having different viewpoints.

特許文献1には、視点の異なる二つの画像を用い、画像上の各画素における視差を求める技術が開示されている。視差を求めるには、各画像からそれぞれ選択された二つの画素同士がどの程度類似しているかを表す類似コストを求める。更に、ある方向に並んだ画素列に着目し、隣接する画素の情報を利用して類似コストを補正する。この補正には、いわゆるビタビアルゴリズムが用いられる。ビタビアルゴリズムを用いた補正の結果は、適用する方向によって異なったものとなるため、少なくとも左方向、右方向、上方向、下方向の4方向について実施する。これらの補正結果を用いて画素毎に視差を特定する。 Patent Document 1 discloses a technique of using two images having different viewpoints to obtain a parallax at each pixel on the image. In order to obtain the parallax, a similarity cost indicating how similar the two pixels selected from each image are to each other is obtained. Further, paying attention to the pixel rows arranged in a certain direction, the similar cost is corrected by using the information of the adjacent pixels. A so-called Viterbi algorithm is used for this correction. Since the result of the correction using the Viterbi algorithm differs depending on the applied direction, it is performed at least in the four directions of leftward, rightward, upward, and downward. The parallax is specified for each pixel using these correction results.

特開2015−114269号公報JP, 2015-114269, A

ところで、取得した画像から解像度の異なる複数の画像からなる階層画像を生成し、この階層画像に対して解像度の低い画像から順番に同様の処理を施し、低解像度の画像で得られた情報を順次利用することで、処理を効率化する技術も知られている。ここでは、低解像度での処理結果を用いて、ビタビアルゴリズムにおける視差の探査範囲を限定することが考えられる。 By the way, a layered image composed of a plurality of images with different resolutions is generated from the acquired image, the same processing is performed on the layered images in order from the image with the lowest resolution, and the information obtained from the images with the low resolution is sequentially processed. There is also known a technique for making the processing efficient by using the same. Here, it is conceivable to limit the parallax search range in the Viterbi algorithm using the processing result at low resolution.

しかしながら、本発明者の詳細な検討の結果、階層画像を利用した場合、解像度の異なる各画像毎に類似コストの生成、補正を実施することになるため、膨大な処理量が必要となるという課題を見出した。 However, as a result of a detailed study by the present inventor, when a hierarchical image is used, a similar cost is generated and corrected for each image having a different resolution, which requires a huge amount of processing. Found.

また、一般に、処理を実行するプロセッサが高速アクセスすることのできる内部メモリの容量は限られており、処理の対象となる画像は、アクセス速度に劣る外部メモリに格納される。そして、内部メモリに格納できる分だけ外部メモリから画像の一部を読み込みんで、その処理が終了すると、処理結果を外部メモリに格納し、次の画像の一部に対する処理を繰り返すことになる。そして、画像の上方の行から順にデータ読み込んで処理を実行する場合、下方向の補正処理は、順次読み込まれるデータに基づいて、右方向および左方向の補正処理と共に、並列に処理を実行することができる。しかし、上方向の補正処理は、画像の下方の行から順にデータを読み込む必要があり、右方向、左方向、下方向の補正処理が終了してから、別途、あらためて実行する必要がある。その結果、外部メモリに対するアクセス量が増大するため、より処理負荷が増大するという課題もあった。 In general, the capacity of the internal memory that can be accessed at high speed by the processor that executes the process is limited, and the image to be processed is stored in the external memory that is inferior in access speed. Then, a part of the image is read from the external memory as much as can be stored in the internal memory, and when the processing is completed, the processing result is stored in the external memory and the processing for the next part of the image is repeated. When the data is sequentially read from the upper row of the image and the processing is executed, the correction processing in the downward direction should be performed in parallel with the correction processing in the rightward and leftward directions based on the sequentially read data. You can However, the upward correction process needs to read data sequentially from the lower row of the image, and needs to be separately executed again after the right, left, and downward correction processes are completed. As a result, the amount of access to the external memory increases, and there is also a problem that the processing load increases.

本開示は、視差演算の精度を維持しつつ処理負荷を削減する技術を提供する。 The present disclosure provides a technique for reducing the processing load while maintaining the accuracy of parallax calculation.

本開示の一態様による視差演算装置は、記憶部(422)と、処理部(41,421)と、を備える。
記憶部は、互いに異なる視点から同一撮影領域を含むように撮像された一対の画像を基本画像対とし、基本画像対から生成された基本画像対とは解像度が異なる一対以上の画像対を、基本画像対とともに画像対群として記憶する。
The parallax calculation device according to an aspect of the present disclosure includes a storage unit (422) and a processing unit (41, 421).
The storage unit uses a pair of images captured so as to include the same shooting region from different viewpoints as a basic image pair, and a pair of image pairs having a resolution different from that of the basic image pair generated from the basic image pair. The image pairs are stored together with the image pairs.

処理部は、記憶部に記憶された画像対群に基づいて視差画像を生成する。なお、処理部は、選択部(S220)と、コスト生成部(S320)と、コスト補正部(S330〜S390,S520〜S550)と、制限部(S410)と、視差生成部(S270)と、を備える。 The processing unit generates a parallax image based on the image pair group stored in the storage unit. The processing unit includes a selection unit (S220), a cost generation unit (S320), cost correction units (S330 to S390, S520 to S550), a restriction unit (S410), and a parallax generation unit (S270). Equipped with.

選択部は、画像対群から、解像度が低い順にいずれか一つの画像対を選択する。
コスト生成部は、選択部にて選択された画像対である選択画像対を構成する二つの画像のうち、一方を基準画像、他方を比較画像とし、節点空間に属する節点の一つを注目節点として、注目節点に対応する基準画像上の画素と前記注目節点に対応する視差だけ離れた比較画像上の画素との類似度が高いほど値が小さくなるように算出される節点コストを、節点空間に属する全ての節点について生成する。但し、節点は、基準画像内での画素の2次元位置と、選択画像対の画素サイズ単位で表現された視差とで表現される3次元点である。節点空間は、節点を一意に表現し、且つ、基準画像の画像サイズおよび検出対象となる視差の最大値で制限された3次元空間である。
The selection unit selects any one of the image pairs from the group of image pairs in ascending order of resolution.
The cost generation unit uses one of the two images forming the selected image pair, which is the image pair selected by the selection unit, as the reference image and the other as the comparison image, and selects one of the nodes belonging to the node space as the target node. As a node space, a node cost calculated so that the value becomes smaller as the similarity between the pixel on the reference image corresponding to the node of interest and the pixel on the comparison image corresponding to the node of interest separated by parallax becomes higher. Generate for all nodes belonging to. However, the node is a three-dimensional point expressed by the two-dimensional position of the pixel in the reference image and the parallax expressed in the pixel size unit of the selected image pair. The node space is a three-dimensional space that uniquely represents the nodes and is limited by the image size of the reference image and the maximum value of the parallax to be detected.

コスト補正部は、予め設定された補正ベクトルが示す方向に沿って並んだ節点空間内の画素列を対象画素列とし、コスト生成部にて生成され対象画素列に関わる複数の節点の節点コストを、ビタビアルゴリズム利用した補正処理により補正する。 The cost correction unit sets the pixel row in the node space arranged along the direction indicated by the preset correction vector as the target pixel row, and calculates the node costs of the plurality of nodes related to the target pixel row generated by the cost generation unit. , It is corrected by the correction processing using the Viterbi algorithm.

制限部は、選択部にて最後に選択される選択画像対を最終画像対、最終画像対以外の選択画像対を非最終画像対として、選択画像対が非最終画像対である場合にコスト補正部での補正結果から、選択部にて次に選択される選択画像対に対してコスト補正部が実施する補正処理での探査範囲を制限する。 The limiting unit sets the last selected image pair selected by the selecting unit as the final image pair, and the selected image pairs other than the final image pair as the non-final image pair, and performs cost correction when the selected image pair is the non-final image pair. Based on the correction result of the section, the search range is limited in the correction process performed by the cost correction section for the selected image pair selected next by the selection section.

視差生成部は、選択画像対が最終画像対である場合に、コスト生成部およびコスト補正部での処理結果から、画素毎に節点コストが最小となる節点に対応した視差を算出する。
ただし、コスト補正部は、選択画像対を構成する画素の位置をX−Y座標で表した場合、補正処理として、X−Y座標のX軸の正方向を補正ベクトル示す方向とする右向処理(S330)と、X軸の負方向を補正ベクトルが示す方向とする左向処理(S340)と、X−Y座標のY軸の正方向を補正ベクトルが示す方向とする下向処理(S360)とを実行し、画像対群のうち予め指定されたいずれか一つの画像対である指定画像対が選択画像対である場合には、Y軸の負方向を補正ベクトルが示す方向とする上向処理(S520)を更に実行する。
When the selected image pair is the final image pair, the parallax generation unit calculates the parallax corresponding to the node having the minimum node cost for each pixel from the processing results of the cost generation unit and the cost correction unit.
However, when the position of the pixels forming the selected image pair is represented by XY coordinates, the cost correction unit performs rightward processing in which the positive direction of the X axis of the XY coordinates is the direction indicating the correction vector, as the correction processing. (S330), leftward processing in which the negative direction of the X axis is the direction indicated by the correction vector (S340), and downward processing in which the positive direction of the Y axis of the XY coordinates is the direction indicated by the correction vector (S360). And when the designated image pair, which is any one of the image pairs designated in advance in the image pair group, is the selected image pair, the upward direction with the negative direction of the Y axis as the direction indicated by the correction vector is performed. The process (S520) is further executed.

上述の構成によれば、他の補正処理とは並列に実行することができず、処理時間を大きく増大させる要因である上向処理を、全ての画像対に施すのではなく、一つの画像対にだけ施している。このため、視差画像の精度を低下させることなく、処理負荷を削減することができる。 According to the above-described configuration, the upward processing, which cannot be executed in parallel with other correction processing and is a factor that greatly increases the processing time, is not applied to all the image pairs, but one image pair is processed. It is only applied to. Therefore, the processing load can be reduced without lowering the accuracy of the parallax image.

なお、本開示の構成は、発明者らが鋭意実験を重ねた結果として得られた以下の知見に基づくものである。即ち、発明者らは、全ての画像対に対する補正処理において上向処理を省略した場合、視差画像の精度が大きく低下するが、少なくとも一つの画像対に対して上向処理を施した場合、全ての画像対に対して上向処理を施した場合と比較して、大きな精度低下が見られないことを見出した。 The configuration of the present disclosure is based on the following knowledge obtained as a result of the inventors' earnest experiments. That is, when the upward processing is omitted in the correction processing for all image pairs, the accuracy of the parallax image is significantly reduced, but when the upward processing is performed for at least one image pair, It was found that a large decrease in accuracy was not seen in comparison with the case where the upward processing was applied to the image pair of.

なお、この欄及び特許請求の範囲に記載した括弧内の符号は、一つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、本開示の技術的範囲を限定するものではない。 It should be noted that the reference numerals in parentheses described in this column and the claims indicate the correspondence with the specific means described in the embodiments to be described later as one aspect, and do not indicate the technical scope of the present disclosure. It is not limited.

測距装置の構成を示すブロック図である。It is a block diagram which shows the structure of the distance measuring device. 節点の配置に経路コストの計算に関する説明図である。It is explanatory drawing regarding the calculation of the path cost in arrangement|positioning of a node. 節点空間NPSと補正ベクトルV+X,V-Xと節点平面Pとの関係を示す説明図である。Is an explanatory view showing a joint space NPS correction vector V + X, the relationship between V -X and the node plane P X. 節点空間NPSと補正ベクトルV+Y,V-Yと節点平面Pとの関係を示す説明図である。It is an explanatory view showing a joint space NPS correction vector V + Y, the relationship between V -Y and the node plane P Y. 節点空間NPSと補正ベクトルV+X+Y,V-X-Yと節点平面PXYとの関係を示す説明図である。It is explanatory drawing which shows the relationship between the nodal space NPS, correction vector V +X+Y , V- XY , and nodal plane PXY . 節点空間NPSと補正ベクトルV+X-Y,V-X+Yと節点平面P-XYとの関係を示す説明図である。Node Spatial NPS correction vector V + XY, is an explanatory diagram showing a relationship between V -X + Y and the node plane P -XY. 距離演算処理のフローチャートである。It is a flowchart of a distance calculation process. 視差演算処理のフローチャートである。It is a flow chart of parallax calculation processing. 解像度が互いに異なる複数の画像を示す図である。It is a figure which shows the some image from which resolution differs mutually. 第1最適化処理のフローチャートである。It is a flowchart of a 1st optimization process. 第1最適化処理での処理概要を示す説明図である。It is explanatory drawing which shows the process outline in a 1st optimization process. 第2最適化処理のフローチャートである。It is a flowchart of a 2nd optimization process. 下向処理の有無による効果の違いを示す距離画像である。It is a distance image which shows the difference of the effect by the presence or absence of downward processing.

以下、図面を参照しながら、本開示の実施形態を説明する。
[1.構成]
本実施形態の測距装置1は、同じ場所を同時に撮影した複数の撮像画像の視差を検出することによって撮像画像中の各点までの距離を検出する装置である。特に、測距装置1では、一対の撮像画像の各画素間の類似度を表すコストを求め、求めたコストに対して動的計画法であるビタビアルゴリズムを適用することでコストを補正する。そして補正されたコストが最小となる視差を画素間の視差として求める。
Hereinafter, embodiments of the present disclosure will be described with reference to the drawings.
[1. Constitution]
The distance measuring device 1 of the present embodiment is a device that detects the distance to each point in a captured image by detecting the parallax of a plurality of captured images that have been captured at the same location at the same time. Particularly, in the distance measuring apparatus 1, the cost representing the similarity between each pixel of a pair of captured images is calculated, and the cost is corrected by applying the Viterbi algorithm, which is a dynamic programming method, to the calculated cost. Then, the parallax that minimizes the corrected cost is obtained as the parallax between pixels.

測距装置1は、車両に搭載され、図1に示すように、一対の撮像部2,3と、画像処理部4とを備える。以下、測距装置1が搭載された車両を自車両という。
一対の撮像部2,3は、いずれも、自車両の進行方向の風景が撮像範囲内となる周知のカメラとして構成されている。一対の撮像部2,3は、互いの光軸が水平方向に所定の距離だけ離れ且つ平行となるように配置され、いわゆるステレオカメラを構成する。一対の撮像部2,3は、予め決まった時間で周期的に同時に撮像を行い、その撮像画像を画像処理部4へ出力する。
The distance measuring device 1 is mounted on a vehicle and includes a pair of image capturing units 2 and 3 and an image processing unit 4, as shown in FIG. Hereinafter, the vehicle equipped with the distance measuring device 1 is referred to as a host vehicle.
Each of the pair of imaging units 2 and 3 is configured as a well-known camera whose scenery in the traveling direction of the vehicle is within the imaging range. The pair of imaging units 2 and 3 are arranged such that their optical axes are separated from each other in the horizontal direction by a predetermined distance and are parallel to each other, and configure a so-called stereo camera. The pair of imaging units 2 and 3 periodically and simultaneously capture images at a predetermined time, and output the captured images to the image processing unit 4.

画像処理部4は、CPU41と、RAM、ROM、フラッシュメモリ等の半導体メモリ(以下、メモリ42)と、を有する周知のマイクロコンピュータを中心に構成される。画像処理部4の各種機能は、CPU41が非遷移的実体的記録媒体に格納されたプログラムを実行することにより実現される。この例では、メモリ42が、プログラムを格納した非遷移的実体的記録媒体に該当する。また、このプログラムが実行されることで、プログラムに対応する方法が実行される。なお、画像処理部4を構成するマイクロコンピュータの数は1つでも複数でもよい。 The image processing unit 4 is mainly composed of a well-known microcomputer having a CPU 41 and a semiconductor memory (hereinafter, memory 42) such as a RAM, a ROM, and a flash memory. Various functions of the image processing unit 4 are realized by the CPU 41 executing a program stored in the non-transitional physical recording medium. In this example, the memory 42 corresponds to a non-transitional substantive recording medium storing a program. By executing this program, the method corresponding to the program is executed. The number of microcomputers forming the image processing unit 4 may be one or more.

画像処理部4は、CPU41がプログラムを実行することで距離演算処理を少なくとも実現する。画像処理部4が有する機能を実現する手法はソフトウェアに限るものではなく、その一部又は全部の要素について、一つあるいは複数のハードウェアを用いて実現してもよい。例えば、上記機能がハードウェアである電子回路によって実現される場合、その電子回路は多数の論理回路を含むデジタル回路、又はアナログ回路、あるいはこれらの組合せによって実現してもよい。 The image processing unit 4 realizes at least distance calculation processing by the CPU 41 executing a program. The method for realizing the function of the image processing unit 4 is not limited to software, and one or more hardware may be used for some or all of the elements. For example, when the above functions are realized by an electronic circuit that is hardware, the electronic circuit may be realized by a digital circuit including a large number of logic circuits, an analog circuit, or a combination thereof.

メモリ42は、内部メモリ421と、外部メモリ422とを含む。内部メモリ421は、CPU41からの高速にアクセスすることができる比較的小容量のメモリである。内部メモリ421には、実行中のプログラムの処理対象となるデータ等が格納される。外部メモリ422は、内部メモリ421と比較して大容量のメモリであり、CPU41からのアクセスが内部メモリ421と比較して低速となる。外部メモリ422には、一対の撮像部2,3から取得される撮像画像のほか、後述する距離演算処理にて距離画像を生成する過程で生成される各種データが格納される。 The memory 42 includes an internal memory 421 and an external memory 422. The internal memory 421 is a relatively small capacity memory that can be accessed from the CPU 41 at high speed. The internal memory 421 stores data to be processed by the program being executed. The external memory 422 is a memory having a larger capacity than the internal memory 421, and the access from the CPU 41 is slower than that of the internal memory 421. The external memory 422 stores the captured images acquired from the pair of imaging units 2 and 3, as well as various data generated in the process of generating the distance image in the distance calculation process described later.

[2.原理]
画像処理部4が実行する処理を説明する前に、距離画像の生成に必要な視差の算出に関わる節点NP、節点空間NPS、節点コストD(p,up)、節点コストD(p,up)の補正について説明する。以下では、処理対象となる一対の画像(以下、画像対)のうち、一方の画像を基準画像、他方の画像を比較画像とよぶ。
[2. principle]
Before describing the processing executed by the image processing unit 4, the node NP, the node space NPS, the node cost D(p,up), and the node cost D(p,up) related to the calculation of the parallax necessary for generating the distance image are described. The correction will be described. In the following, one of the pair of images to be processed (hereinafter, image pair) is referred to as a reference image, and the other image is referred to as a comparison image.

[2−1.節点および節点空間]
節点空間NPSとは、図2〜6に示すように、基準画像の画素(即ち、ピクセル)の位置を表すX軸およびY軸と、基準画像上の画素と比較画像上の画素との視差を表すZ軸とで表現される3次元空間である。節点空間NPSは、画素の大きさを単位とする離散的な値をとる。この節点空間NPS内の各点(x,y,z)が節点NPである。各節点NPは、基準画像上の画素(x,y)と、画素(x,y)に対して視差zを有する比較画像上の画素との対応関係を示す。
[2-1. Node and node space]
As shown in FIGS. 2 to 6, the nodal space NPS is a parallax between pixels on the reference image and pixels on the comparison image and the X-axis and the Y-axis indicating the position of the pixel (that is, the pixel) of the reference image. It is a three-dimensional space represented by the Z axis and the Z axis. The nodal space NPS takes discrete values in units of pixel size. Each point (x, y, z) in this node space NPS is a node NP. Each node NP indicates a correspondence relationship between the pixel (x, y) on the reference image and the pixel on the comparison image having the parallax z with respect to the pixel (x, y).

節点空間NPSを表現する座標において、X軸、Y軸は、図2に示すように、基準画像および比較画像の画像面の左上隅を原点として、X軸の正方向が右向きとなり、Y軸の正方向が下向きとなるように設定される。以下では、X軸の正方向を右方向、X軸の負方向を左方向、Y軸の正方向を下方向、Y軸の負方向を上方向という。 In the coordinates expressing the nodal space NPS, as shown in FIG. 2, the X-axis and the Y-axis have the positive direction of the X-axis as the right direction with the upper left corner of the image planes of the reference image and the comparative image as the origin, and the Y-axis The forward direction is set to be downward. Below, the positive direction of the X axis is referred to as the right direction, the negative direction of the X axis is referred to as the left direction, the positive direction of the Y axis is referred to as the downward direction, and the negative direction of the Y axis is referred to as the upward direction.

節点空間NPSのX軸およびY軸のサイズは、基準画像や比較画像を構成する画素数によって決まる。節点空間NPSのZ軸のサイズは、検知対象とする視差の範囲によって決まる。 The X-axis and Y-axis sizes of the nodal space NPS are determined by the number of pixels forming the reference image and the comparison image. The size of the Z axis of the node space NPS is determined by the range of parallax to be detected.

[2−2.節点コスト]
節点コストD(p,up)は、節点NP毎に求められ、pで特定される基本画像上の画素と、pから視差upだけ離れた比較画像上の画素との類似度を表す。節点コストD(p,up)は、両画素の類似度が高いほど小さな値をとるように設定される。pは、節点NPが属する画素の位置を表すX−Y座標(x,y)に対応し、upは視差、すなわち節点NPのZ座標(z)に対応する。節点コストD(p,up)は、例えば、SSIMを用いて求める。SSIMは、Structual Similarityの略である。SSIMは公知の手法であるため、ここでの説明は省略する。
[2-2. Node cost]
The node cost D(p,up) is obtained for each node NP, and represents the degree of similarity between the pixel on the basic image specified by p and the pixel on the comparative image that is separated from p by the parallax up. The node cost D(p,up) is set to take a smaller value as the similarity between both pixels is higher. p corresponds to the XY coordinates (x, y) representing the position of the pixel to which the node NP belongs, and up corresponds to the parallax, that is, the Z coordinate (z) of the node NP. The node cost D(p,up) is obtained by using, for example, SSIM. SSIM is an abbreviation for Structural Similarity. Since SSIM is a known method, its description is omitted here.

[2−3.節点コストの補正]
節点コストD(p,up)に対する補正(以下、補正処理)は、予め決められた複数種類の補正ベクトルVが示す方向に沿って複数回実施する。補正ベクトルVには、図3に示すように、右方向を示すV+X、左方向を示すV-Xが含まれる。補正ベクトルVには、図4に示すように、下方向を示すV+Y、上方向を示すV-Yが含まれる。補正ベクトルVには、図5に示すように、右上方向を示すV+X-Y、左下方向を示すV-X+Yが含まれる。補正ベクトルVには、図6に示すように、右下方向を示すV+X+Y、左下方向を示すV-X-Yが含まれる。
[2-3. Correction of node cost]
The correction (hereinafter referred to as correction processing) for the node cost D(p,up) is performed a plurality of times along the directions indicated by a plurality of predetermined types of correction vectors V. As shown in FIG. 3, the correction vector V includes V +X indicating the right direction and V -X indicating the left direction. As shown in FIG. 4, the correction vector V includes V +Y indicating the downward direction and V −Y indicating the upward direction. As shown in FIG. 5, the correction vector V includes V +XY indicating the upper right direction and V -X+Y indicating the lower left direction. As shown in FIG. 6, the correction vector V includes V +X +Y indicating the lower right direction and V -XY indicating the lower left direction.

補正処理では、補正ベクトルVが示す方向に沿って、節点空間NPSから切り出した複数の節点平面Pのそれぞれに対して以下の処理を実行する。ここでは、説明のため、視差を表す軸を行方向、補正ベクトルVが示す方向、即ち切り出した画素列が並ぶ方向を行方向、視差を表すZ軸に沿った方向を列方向として、図2に示すように、マトリクス上の各節点をNP(i、j)で表現するものとする。iが切り出した画素列上での画素の位置を表し、jが視差を表す。つまり、節点平面P上には、節点NP(i,j)がマトリクス状に配置される。 In the correction process, the following process is executed for each of the plurality of nodal planes P cut out from the nodal space NPS along the direction indicated by the correction vector V. Here, for the sake of description, the axis representing the parallax is the row direction, the direction indicated by the correction vector V, that is, the direction in which the cut-out pixel columns are arranged is the row direction, and the direction along the Z axis representing the parallax is the column direction. As shown in, each node on the matrix is represented by NP(i,j). i represents the position of the pixel on the clipped pixel row, and j represents the parallax. That is, the nodes NP(i,j) are arranged in a matrix on the node plane P.

ここで、節点平面P上の任意の節点NP(i,j)を終了節点、節点平面Pにおける補正ベクトルVの始端側に位置する画素に対応する複数の節点NP(1,j)を開始節点とする。各開始節点NP(1,j)から終了節点NP(i,j)に至る全ての経路の中で、経路コストが最小となる経路である最小コスト経路を、ビタビアルゴリズムによって探査する。具体的には、経路コストは、着目する経路に属する全ての節点の節点コストD(p,up)と、着目する経路上で隣接する節点間の視差コストS(up,up)との総和である。視差コストS(up,uq)は、視差がupである節点から、視差がuqである節点へ移動する場合のコストである。視差コストS(up,uq)は、視差upと視差uqとの差が大きいほど値が大きくなるように設定される。視差コストS(up,uq)は、例えば、視差upと視差uqとの差分の絶対値を用いることができる。 Here, an arbitrary node NP(i,j) on the node plane P is an end node, and a plurality of nodes NP(1,j) corresponding to pixels located on the start end side of the correction vector V on the node plane P are start nodes. And Among all the routes from each start node NP(1,j) to the end node NP(i,j), the minimum cost route, which is the route having the minimum route cost, is searched by the Viterbi algorithm. Specifically, the route cost is the sum of the node costs D(p,up) of all nodes belonging to the route of interest and the disparity cost S(up,up) between adjacent nodes on the route of interest. is there. The parallax cost S(up, uq) is a cost when moving from a node having a parallax of up to a node having a parallax of uq. The parallax cost S(up, uq) is set to increase as the difference between the parallax up and the parallax uq increases. As the parallax cost S(up, uq), for example, the absolute value of the difference between the parallax up and the parallax uq can be used.

例えば、図2のマトリクス上では、節点NP(1,3)を開始節点、節点NP(4,2)を終了節点とする経路が示されており、その経路中には四つの節点NP(1,3)、NP(2,2)、NP(3,2)、NP(4,2)が含まれている。この場合、経路コストはD(1,3)+{D(2,2)+S(2,3)}+{D(3,2)+S(2,2)}+{D(4,2)+S(2,2)}で求められることになる。 For example, on the matrix of FIG. 2, a route having the node NP(1,3) as the start node and the node NP(4,2) as the end node is shown, and four nodes NP(1 , 3), NP(2,2), NP(3,2), NP(4,2). In this case, the route cost is D(1,3)+{D(2,2)+S(2,3)}+{D(3,2)+S(2,2)}+{D(4,2) +S(2,2)}.

つまり、補正処理では、ビタビアルゴリズムを用いて、最小コスト経路となる節点コストおよび視差コストの組み合わせを探査する。但し、この探査において、節点間の移動の際に許容される視差の上限が予め設定されており、設定された上限の範囲内で経路が設定される。なお、視差の上限を絞ることは、経路の探査範囲を絞ること、ひいては補正処理の処理量を削減することに繋がる。 That is, in the correction process, the Viterbi algorithm is used to search for a combination of the node cost and the parallax cost, which is the minimum cost route. However, in this exploration, the upper limit of the parallax allowed when moving between nodes is set in advance, and the route is set within the set upper limit. Note that narrowing the upper limit of parallax leads to narrowing the route search range, and thus reducing the amount of correction processing.

そして、最小コスト経路の経路コストが、終了節点における節点コストの補正値Eとなる。以下では、補正ベクトルVを用いた補正処理によって得られる補正値を、補正値Eと表記する。他の補正ベクトルの場合も同様である。 Then, the route cost of the minimum cost route becomes the correction value E of the node cost at the end node. Hereinafter, the correction value obtained by the correction process using the correction vector V X will be referred to as the correction value E X. The same applies to other correction vectors.

なお、pで特定される画素に関する節点コストD(p,up)の補正値は、全ての経路についての経路コストを毎回計算する必要はなく、p−1で特定される画素に関する節点コストの補正値と、視差コストS(up,uq)とから簡単に求めることができる。これは、例えば、特許文献1として示した特開2015−114269号公報などに記載された公知の技術であるため、その詳細についての説明は省略する。 The correction value of the node cost D(p,up) for the pixel specified by p does not need to calculate the route costs for all the paths each time, and the correction of the node cost for the pixel specified by p-1 is performed. It can be easily obtained from the value and the parallax cost S(up,uq). This is a known technique described in, for example, Japanese Patent Application Laid-Open No. 2015-114269 disclosed as Patent Document 1, and therefore detailed description thereof will be omitted.

[3.処理]
[3−1.距離演算処理]
次に、画像処理部4が実行する距離演算処理について、図7のフローチャートを用いて説明する。距離演算処理は、画像処理部4の動作中において繰り返し実行される。
[3. processing]
[3-1. Distance calculation processing]
Next, the distance calculation processing executed by the image processing unit 4 will be described with reference to the flowchart of FIG. 7. The distance calculation process is repeatedly executed during the operation of the image processing unit 4.

この距離測定処理が実行されると、画像処理部4は、まずS110にて、外部メモリ422から基本画像対を取得する。基本画像対は、一対の撮像部2,3において同時に撮像され、外部メモリ422に格納された一対の撮像画像である。 When this distance measurement processing is executed, the image processing unit 4 first acquires a basic image pair from the external memory 422 in S110. The basic image pair is a pair of captured images that are simultaneously captured by the pair of imaging units 2 and 3 and stored in the external memory 422.

S120では、基本画像対間で垂直方向のずれを補正することで、両画像を互いに平行化する。具体的には、両画像の間で互いに対応関係にある画像領域の高さが一致するように、予め設定された補正パラメータに従って画素全体の垂直方向の座標を変換する。平行化は、一対の撮像部2,3間での相対的な姿勢のずれやレンズによる画像の歪みを補正する処理である。 In S120, the two images are made parallel to each other by correcting the vertical shift between the pair of basic images. Specifically, the vertical coordinates of all the pixels are converted according to a preset correction parameter so that the heights of the image areas in a corresponding relationship between the two images match. The parallelization is a process of correcting a relative posture shift between the pair of imaging units 2 and 3 and a distortion of an image due to a lens.

S130では、S120で平行化された基本画像対を用いて、視差画像を生成する視差演算処理を実行する。視差演算処理の詳細については後述する。視差画像は、基準画像を構成する各画素と比較画像を構成する各画素との対応関係、すなわち、同じものが写っている場所を関連付ける情報である視差を、各画素の画素値とする画像である。 In S130, a parallax calculation process for generating a parallax image is executed using the basic image pair parallelized in S120. Details of the parallax calculation processing will be described later. A parallax image is an image in which the pixel value of each pixel is the corresponding relationship between each pixel that forms the reference image and each pixel that forms the comparison image, that is, the parallax that is the information that associates the place where the same image appears. is there.

S140では、視差画像が示す情報である視差に基づき、各画素に写っている物標までの距離を画素毎に算出することで、その算出された距離を画素値とする距離画像を生成して、本処理を終了する。なお、視差から距離を求める手法は周知であるため、ここでの説明は省略する。 In S140, the distance to the target imaged in each pixel is calculated for each pixel based on the parallax which is the information indicated by the parallax image, and a distance image having the calculated distance as a pixel value is generated. , This process ends. Note that the method of obtaining the distance from the parallax is well known, and thus the description thereof is omitted here.

距離画像は、物標の検出や、検出された物標に関する情報の抽出に用いられ、抽出された情報は、例えば、自動運転や危険回避等のための各種車両制御に利用される。
[3−2.視差演算処理]
画像処理部4が、先のS140で実行する視差演算処理の詳細を、図8のフローチャートを用いて説明する。
The distance image is used for detecting a target object and extracting information about the detected target object, and the extracted information is used for various vehicle controls such as automatic driving and danger avoidance.
[3-2. Parallax calculation processing]
Details of the parallax calculation process executed by the image processing unit 4 in S140 will be described with reference to the flowchart of FIG. 8.

視差演算処理が開始されると、画像処理部4は、S210にて、S120で平行化され基本画像対を用いて、階層画像対を生成する。具体的には、基本画像対の解像度(以下、第3解像度)よりも低い第1解像度を有する一対の画像からなる第1画像対と、第3解像度より低く、第1解像度より高い第2解像度を有する一対の画像からなる第2画像対を作成する。ここでは、図9に示すように、第1解像度を有する画像G1は、第3解像度を有する画像(即ち、撮像画像)G3の横方向および縦方向の解像度をそれぞれ1/4にしたものである。第2解像度を有する画像G2は、画像G3の横方向および縦方向の解像度をそれぞれ1/2にしたものである。以下、これら第1〜第3画像対を総称して階層画像対という。階層画像対は外部メモリ422に格納される。 When the parallax calculation process is started, the image processing unit 4 generates a hierarchical image pair using the basic image pair parallelized in S120 in S210. Specifically, a first image pair composed of a pair of images having a first resolution lower than the resolution of the basic image pair (hereinafter, third resolution) and a second resolution lower than the third resolution and higher than the first resolution. A second image pair consisting of a pair of images having Here, as shown in FIG. 9, the image G1 having the first resolution is an image (that is, a captured image) G3 having the third resolution in which the horizontal and vertical resolutions are each ¼. .. The image G2 having the second resolution is obtained by halving the horizontal and vertical resolutions of the image G3. Hereinafter, these first to third image pairs will be generically referred to as hierarchical image pairs. The hierarchical image pair is stored in the external memory 422.

S220では、外部メモリ422に格納されている階層画像対から、一つの画像対を選択画像対として選択する。但し、選択画像対は、本ステップが繰り返される毎に、解像度が低いものから順番に選択される。従って、最初は第1画像対が選択され、次に第2画像対が選択され、最後に第3画像対が選択される。 In S220, one image pair is selected as the selected image pair from the hierarchical image pairs stored in the external memory 422. However, the selected image pairs are selected in order from the one with the lowest resolution each time this step is repeated. Therefore, first the first image pair is selected, then the second image pair is selected, and finally the third image pair is selected.

S230では、S220にて選択された選択画像対に対して第1最適化処理を実行する。第1最適化処理では、節点コストの算出および補正を行うと共に、その補正結果に基づいて、S220にて次に選択される選択画像対に対する処理で使用する視差の探査範囲を設定する。その詳細については後述する。 In S230, the first optimization process is executed on the selected image pair selected in S220. In the first optimization process, the nodal cost is calculated and corrected, and the parallax search range used in the process for the selected image pair selected next in S220 is set based on the correction result. The details will be described later.

S240では、選択画像対が予め指定された指定画像対であるか否かを判断する。指定画像は、第1〜第3画像対の中のいずれか一つである。選択画像が指定画像対であればS250に移行し、選択画像が指定画像対でなければS260に移行する。 In S240, it is determined whether the selected image pair is a designated image pair designated in advance. The designated image is any one of the first to third image pairs. If the selected image is the designated image pair, the process proceeds to S250, and if the selected image is not the designated image pair, the process proceeds to S260.

S250では、S230での第1最適化処理での処理結果を用いて、第2最適化処理を実行する。第2最適化処理では、節点コストの補正を行う。その詳細については後述する。 In S250, the second optimization process is executed using the processing result of the first optimization process in S230. In the second optimization process, the node cost is corrected. The details will be described later.

S260では、選択画像対が最終画像対、つまり第3画像対であるか否かを判断する。選択画像対が最終画像対であればS270に移行し、選択画像対が最終画像対でなければ、つまり、非最終画像対であればS220に戻る。 In S260, it is determined whether the selected image pair is the final image pair, that is, the third image pair. If the selected image pair is the final image pair, the process proceeds to S270, and if the selected image pair is not the final image pair, that is, if it is the non-final image pair, the process returns to S220.

S270では、最終画像対について求められた補正された節点コストに基づき、視差画像を生成して、本処理を終了する。具体的には、注目する画素(以下、注目画素)についの節点コストが最小となる節点を抽出し、その節点に対応する視差を、注目画素の画素値とすることで視差画像を生成する。 In S270, a parallax image is generated based on the corrected nodal cost obtained for the final image pair, and this processing ends. Specifically, a parallax image is generated by extracting the node having the lowest node cost for the pixel of interest (hereinafter, the pixel of interest) and setting the parallax corresponding to the node as the pixel value of the pixel of interest.

[3−3.第1最適化処理]
画像処理部4が、先のS230で実行する第1最適化処理の詳細を、図10のフローチャート、および図11の説明図に沿って説明する。
[3-3. First optimization processing]
Details of the first optimization process executed by the image processing unit 4 in S230 will be described with reference to the flowchart of FIG. 10 and the explanatory diagram of FIG.

この第1最適化処理が実行されると、画像処理部4は、まずS310にて、外部メモリ422に格納されている選択画像対の両画像について、予め設定されたmライン分だけ内部メモリ421に読み込む。1ラインとは、画像上でX軸に沿って並ぶ画素列のことをいう。mは2以上の整数である。 When this first optimization process is executed, the image processing unit 4 firstly, in S310, for both images of the selected image pair stored in the external memory 422, the internal memory 421 for a preset number of m lines. Read into. One line refers to a pixel row arranged along the X axis on the image. m is an integer of 2 or more.

S320では、S310にて読み込んだ画像について、各画素について節点コストD(p,up)を算出する。これにより、図3に示すように、X軸に沿って1列に配置された画素列に関する節点平面Pがm個作成されることになる。 In S320, the node cost D(p,up) is calculated for each pixel in the image read in S310. As a result, as shown in FIG. 3, m nodal planes P X relating to the pixel rows arranged in one row along the X axis are created.

S330では、S320での節点コストD(p,up)の算出結果を用い、m個の節点平面Pのそれぞれについて、補正ベクトルV+Xが示す右方向にビタビアルゴリズムを適用する補正処理を実行する。これにより、m個の節点平面Pに存在する全ての節点コストD(p,up)について、その補正値E+Xが求められる。 In S330, using the calculation result of the node cost D(p,up) in S320, the correction process of applying the Viterbi algorithm to the right direction indicated by the correction vector V +X is executed for each of the m node planes P X. To do. As a result, the correction value E +X is obtained for all the node costs D(p,up) existing in the m node planes P X.

S340では、S320での節点コストD(p,up)の算出結果を用い、m個の節点平面Pのそれぞれについて、補正ベクトルV-Xが示す左方向にビタビアルゴリズムを適用する補正処理を実行することで、これにより、m個の節点平面Pに存在する全ての節点コストD(p,up)について、その補正値E-Xが求められる。 In S340, using the calculation result of the node cost D(p,up) in S320, a correction process of applying the Viterbi algorithm to the left direction indicated by the correction vector V -X is executed for each of the m node planes P X. By doing so, the correction value E −X is obtained for all the node costs D(p,up) existing in the m number of node planes P X.

S350では、n個の節点平面Pに存在する全ての節点について、注目節点の節点コストD(p,up)を、S330およびS340で求められた注目節点の補正値の合計値E+X+E-Xで置換することにより、節点コストD(p,up)を更新する。 In S350, the node cost D(p,up) of the target node is calculated for all the nodes existing in the n number of node planes P X , and the total value E +X +E of the correction values of the target node obtained in S330 and S340. Update the node cost D(p,up) by replacing with -X .

S360では、S350での節点コストD(p,up)の更新結果を用い、補正ベクトルV+Yが示す下方向にビタビアルゴリズムを適用する補正処理を実行する。この補正処理は、図4に示すように、Y軸に沿って1列に配置された画素列に関する節点平面P+Y上の節点に対する処理である。但し、ここでは、画像はmライン分、すなわち、Y軸に沿ってm画素分しか読み込まれていないため、節点平面P+Yの一部に対して補正処理を実行することになる。但し、上述したように、pで特定される画素に関する節点の補正値は、一つ前のp−1で特定される画素に関する節点の補正値から求めることができる。つまり、mライン読み込んでいれば、補正ベクトルV+Yの始端側からm番目までの画素に関する節点の補正値E+Yが求められる。 In S360, the correction process of applying the Viterbi algorithm in the downward direction indicated by the correction vector V +Y is executed using the update result of the node cost D(p,up) in S350. As shown in FIG. 4, this correction process is a process for the nodes on the node plane P +Y regarding the pixel columns arranged in one line along the Y axis. However, here, since the image is read for m lines, that is, for m pixels along the Y axis, the correction process is executed for a part of the nodal plane P +Y . However, as described above, the correction value of the node regarding the pixel specified by p can be obtained from the correction value of the node regarding the pixel specified by the preceding p-1. That is, if read m lines, the correction value E + Y of the node is obtained about the pixel from the starting end side of the correction vector V + Y up to m-th.

S370では、S350での節点コストD(p,up)の更新結果を用い、補正ベクトルV+X+Yが示す右下方向にビタビアルゴリズムを適用する補正処理を実行する。この補正処理は、図5に示すように、X軸の正方向かつY軸の正方向に向かう斜め右下方向に沿って1列に配置された画素列に関する節点平面PXY上の節点に対する処理である。その詳細は、使用する節点平面が異なる以外は、S360での処理と同様である。この補正処理により、節点の補正値E+X+Yが求められる。 In S370, using the update result of the node cost D(p,up) in S350, the correction process of applying the Viterbi algorithm to the lower right direction indicated by the correction vector V +X+Y is executed. As shown in FIG. 5, this correction process is a process for the nodes on the nodal plane P XY regarding the pixel rows arranged in one row along the diagonally lower right direction toward the positive direction of the X axis and the positive direction of the Y axis. Is. The details are the same as the processing in S360, except that the nodal planes used are different. By this correction processing, the correction value E +X+Y of the node is obtained.

S380では、S350での節点コストD(p,up)の更新結果を用い、補正ベクトルV-X+Yが示す左下方向にビタビアルゴリズムを適用する補正処理を実行する。この補正処理は、図6に示すように、X軸の正方向かつY軸の正方向に向かう斜め左下方向沿って1列に配置された画素列に関する節点平面P-XY上の節点に対する処理である。その詳細は、使用する節点平面が異なる以外は、S360での処理と同様である。この補正処理により、節点の補正値E-X+Yが求められる。 In S380, using the update result of the node cost D(p,up) in S350, the correction process of applying the Viterbi algorithm to the lower left direction indicated by the correction vector V −X+Y is executed. As shown in FIG. 6, this correction process is a process for the nodes on the nodal plane P -XY regarding the pixel rows arranged in one row along the diagonally lower left direction toward the positive direction of the X axis and the positive direction of the Y axis. is there. The details are the same as the processing in S360, except that the nodal planes used are different. By this correction processing, the correction value E −X+Y of the node is obtained.

S390では、S360〜S380にて補正値が求められた全ての節点について、注目節点の節点コストD(p,up)を、S360〜S380で求められた注目節点の補正値の合計値E+Y+E+X+Y+E-X+Yで置換することにより、節点コストD(p,up)を更新する。また、更新された節点コストD(p,up)のうち、当該第1最適化処理での以降の処理で参照されることのない部分の節点コストD(p,up)については、外部メモリ422に格納する。 In S390, the node cost D(p,up) of the target node is calculated for all the nodes for which the correction values are calculated in S360 to S380, and the total value E +Y of the correction values of the target node calculated in S360 to S380. Update the node cost D(p,up) by substituting +E +X+Y +E- X+Y . In addition, regarding the node cost D(p,up) of the updated node cost D(p,up) that is not referred to in the subsequent processes in the first optimization process, the external memory 422 is used. To store.

S400では、選択画像対の読み込みを終了したか否かを判断する。読み込みが終了していなければ、S210に戻って、次のnライン分の画像を読み込んで同様の処理を繰り返す。読み込みが終了していればS410に移行する。 In S400, it is determined whether the reading of the selected image pair has been completed. If the reading is not completed, the process returns to S210 to read the image for the next n lines and repeat the same processing. If the reading is completed, the process proceeds to S410.

S410では、節点空間NPSを構成する全ての節点NPの節点コストD(p,up)が、補正ベクトルV+X,V-X,V+Y,V+X+Y,V-X+Yが示す5方向についての補正値が反映されたされたものとなっている。この補正された節点コストD(p,up)を参照して、画素毎の視差を求め、その視差の分布等から、次に選択される選択画像対に対してビタビアルゴリズムを適用する際に用いる視差の探査範囲を設定して、本処理を終了する。なお、次に選択される選択画像対から検出される視差は、今回検出された視差から大きく外れることはないため、探査範囲は、その範囲が限定される方向に設定されることになる。 In S410, the nodal costs D(p,up) of all the nodes NP forming the nodal space NPS are corrected vectors V +X , V- X , V +Y , V +X+Y , V- X+Y. The correction values for the five directions shown are reflected. This corrected node cost D(p,up) is referred to, and the parallax for each pixel is obtained, and it is used when the Viterbi algorithm is applied to the selected image pair selected next from the distribution of the parallax or the like. The parallax search range is set, and this processing ends. It should be noted that the parallax detected from the selected pair of images to be selected next does not deviate significantly from the parallax detected this time, so the search range is set in a direction in which the range is limited.

[3−4.第2最適化処理]
画像処理部4が、先のS250で実行する第2最適化処理の詳細を、図12のフローチャートに沿って説明する。
[3-4. Second optimization process]
The details of the second optimization process executed by the image processing unit 4 in S250 will be described with reference to the flowchart of FIG.

この第2最適化処理が実行されると、画像処理部4は、まずS510にて、外部メモリ422に格納されている第1最適化処理での処理結果、即ち、5方向の補正値が反映された節点コストD(p,up)を、画像の下方から順に予め設定されたnライン分だけ内部メモリ421に読み込む。つまり、X軸に沿って1列に配置された画素列に関する節点平面Pがn個読み込まれることになる。節点平面Pについては、図3を参照のこと。 When this second optimization processing is executed, the image processing unit 4 first reflects the processing result of the first optimization processing stored in the external memory 422, that is, the correction values in the five directions, in S510. The node cost D(p,up) thus selected is read into the internal memory 421 in order from the bottom of the image by a preset n lines. In other words, n nodal planes P X relating to the pixel rows arranged in one row along the X axis are read. See FIG. 3 for the nodal plane P X.

S520では、S510で取得した節点コストD(p,up)を用い、補正ベクトルV-Yが示す上方向にビタビアルゴリズムを適用する補正処理を実行する。この補正処理は、S350での処理と比較して、補正を行う方向が反対方向となる以外は同様であるため、その詳細については説明を省略する。この補正処理により、補正ベクトルV-Yの始端側からn番目までの画素に関する節点の補正値E-Yが求められる。 In S520, using the node cost D(p,up) acquired in S510, a correction process of applying the Viterbi algorithm in the upward direction indicated by the correction vector V -Y is executed. This correction process is the same as the process in S350 except that the direction in which the correction is performed is the opposite direction, and therefore description thereof will be omitted. By this correction process, the correction vector V -Y node of the correction value E -Y regarding pixel to n-th from the starting end side of the can be determined.

S530では、S510で取得した節点コストD(p,up)を用い、補正ベクトルV-X-Yが示す左上方向にビタビアルゴリズムを適用する補正処理を実行する。この補正処理は、S370での処理と比較して、補正を行う方向が反対方向となる以外は同様であるため、その詳細については説明を省略する。この補正処理により、節点の補正値E-X-Yが求められる。 In S530, using the node cost D(p,up) acquired in S510, a correction process of applying the Viterbi algorithm to the upper left direction indicated by the correction vector V -XY is executed. This correction process is the same as the process in S370, except that the direction in which the correction is performed is the opposite direction, and therefore description thereof will be omitted. By this correction processing, the correction value E- XY of the node is obtained.

S540では、S510で取得した節点コストD(p,up)を用い、補正ベクトルV+X-Yが示す右上方向にビタビアルゴリズムを適用する補正処理を実行する。この補正処理は、S380での処理と比較して、補正を行う方向が反対となる以外は同様であるため、その詳細については説明を省略する。この補正処理により、節点の補正値E+X-Yが求められる。 In S540, the nodal cost D(p,up) acquired in S510 is used to execute a correction process in which the Viterbi algorithm is applied in the upper right direction indicated by the correction vector V +XY . This correction process is the same as the process in S380 except that the direction in which the correction is performed is opposite, and thus the detailed description thereof is omitted. By this correction processing, the correction value E +XY of the node is obtained.

S550では、S520〜S540にて補正値が求められた全ての節点について、注目節点の節点コストD(p,up)を、S520〜S540で求められた注目節点の補正値の合計値E-Y+E-X-Y+E+X-Yで置換することにより、節点コストD(p,up)を更新する。 In S550, the node cost D(p,up) of the target node is calculated for all the nodes for which the correction values are calculated in S520 to S540, and the total value E- Y of the correction values of the target node calculated in S520 to S540. The node cost D(p,up) is updated by replacing with +E −XY +E +XY .

S560では、選択画像対から生成された節点空間の全ての節点コストD(p,up)の読み込みを終了したか否かを判断する。読み込みが終了していなければ、S510に戻って、次のnライン分の画像に関する節点コストD(p,up)を読み込んで同様の処理を繰り返す。読み込みが終了していれば本処理を終了する。 In S560, it is determined whether reading of all the node costs D(p,up) in the node space generated from the selected image pair has been completed. If the reading has not been completed, the process returns to S510, the node cost D(p,up) for the image for the next n lines is read, and the same processing is repeated. If the reading is completed, this process is completed.

本実施形態において、視差演算処理を実行する画像処理部4が視差演算装置に相当する。外部メモリ422が記憶部、CPU41,内部メモリ421が処理部に相当する。S220が選択部、S320がコスト生成部、S330〜S390及びS520〜S550がコスト補正部、S410が制限部、S270が視差演算部に相当する。S330が右向処理、S340が左向処理、S360が下向処理、S370が右下向処理、S380が左下向処理、S520が上向処理、S530が左上向処理、S540が右上向処理に相当する。 In the present embodiment, the image processing unit 4 that executes the parallax calculation process corresponds to the parallax calculation device. The external memory 422 corresponds to a storage unit, and the CPU 41 and the internal memory 421 correspond to a processing unit. S220 is a selection unit, S320 is a cost generation unit, S330 to S390 and S520 to S550 are cost correction units, S410 is a restriction unit, and S270 is a parallax calculation unit. S330 is rightward processing, S340 is leftward processing, S360 is downward processing, S370 is right downward processing, S380 is left downward processing, S520 is upward processing, S530 is upper left processing, and S540 is equivalent to upper right processing. To do.

[4.効果]
以上詳述した実施形態によれば、以下の効果を奏する。
(1)測距装置1では、視差演算処理において、選択画像対が指定画像対でない場合、第1最適化処理だけを実施し、選択画像が指定画像対である場合だけ、第1最適化処理に加えて第2最適化処理を実施している。つまり、8方向の補正処理のうち、第1最適化処理で行う5方向の補正処理とは並列に実行することができない3方向の補正処理を、3つある選択画像対のうち、一つの画像対にだけ適用している。従って、視差の演算結果、ひいては距離画像の精度を低下させることなく、処理負荷を削減することができる。
[4. effect]
According to the embodiment described in detail above, the following effects are achieved.
(1) In the range finder 1, in the parallax calculation process, if the selected image pair is not the designated image pair, only the first optimization process is performed, and only if the selected image is the designated image pair, the first optimization process is performed. In addition to the above, the second optimization processing is executed. That is, of the correction processing in the eight directions, the correction processing in the three directions that cannot be performed in parallel with the correction processing in the five directions performed in the first optimization processing is performed on one of the three selected image pairs. It applies only to pairs. Therefore, the processing load can be reduced without lowering the accuracy of the parallax calculation result and thus the distance image.

図13は、左上図が撮像画像である。左下図が上述の測距装置1によって得られた実施例の距離画像である。但し、第3画像対を指定画像対としている。右上図が第1〜第3画像対の全てについて第1最適化処理および第2最適化処理をいずれも実施して得られた比較例1の距離画像である。右下図が第1〜第3画像対の全てについて第1最適化処理のみを実施して得られた比較例2の距離画像である。比較例2は、比較例1と比較して、破線で囲んだ車両部分の距離画像に劣化が現れている。これに対して、実施例では、比較例1と比較して顕著な劣化が現れていないことがわかる。 In FIG. 13, the upper left diagram is a captured image. The lower left diagram is a range image of the embodiment obtained by the above distance measuring device 1. However, the third image pair is the designated image pair. The upper right diagram is a range image of Comparative Example 1 obtained by performing both the first optimization process and the second optimization process on all of the first to third image pairs. The lower right diagram is a range image of Comparative Example 2 obtained by performing only the first optimization process on all of the first to third image pairs. In Comparative Example 2, as compared with Comparative Example 1, deterioration appears in the distance image of the vehicle portion surrounded by the broken line. On the other hand, in the example, it can be seen that no remarkable deterioration appears as compared with the comparative example 1.

(2)測距装置1では、視差演算処理において、解像度が異なる複数の画像対を、解像度の低いものから順番に処理し、解像度の低い画像対の処理結果から、次に解像度の高い画像対に対して補正処理を実施する際の探査範囲を制限している。従って、測距装置1では、画素数の多い解像度の高い画像対に対する処理を効率よく実施することができ、処理負荷を更に削減することができる。 (2) In the range finder 1, in the parallax calculation process, a plurality of image pairs with different resolutions are processed in order from the one with the lowest resolution, and the image pair with the next highest resolution is obtained from the processing result of the image pair with the lowest resolution. The search range is limited when the correction process is performed. Therefore, the distance measuring apparatus 1 can efficiently perform processing on an image pair having a large number of pixels and a high resolution, and the processing load can be further reduced.

[5.他の実施形態]
以上、本開示の実施形態について説明したが、本開示は上述の実施形態に限定されることなく、種々変形して実施することができる。
[5. Other Embodiments]
Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the above-described embodiments, and various modifications can be implemented.

(a)上記実施形態では、一対の撮像部2,3から得られる撮像画像を用いて視差を検出するものを示したが、3台以上の撮像部を用いてもよい。
(b)上記実施形態では、撮像画像対から、互いに異なる2種類の低解像度の画像対を生成しているが、これに限定されるものではない。生成される低解像度の画像対は、一つであってもよいし、三つ以上であってもよい。
(A) In the above embodiment, the one in which parallax is detected using the captured images obtained from the pair of image capturing units 2 and 3 has been described, but three or more image capturing units may be used.
(B) In the above embodiment, two different types of low-resolution image pairs are generated from the captured image pair, but the present invention is not limited to this. The number of low-resolution image pairs generated may be one, or three or more.

(c)上記実施形態では、第1最適化処理では5方向、第2最適化処理では3方向の補正処理を行っているが、これに限定されるものではない。例えば、第1最適化処理では、右方向、左方向、下方向の補正処理による補正値E+X,E-X,E+Yだけを求めてもよい。また、第2最適化処理では上方向の補正処理による補正値E-Yだけを求めてもよい。 (C) In the above-described embodiment, correction processing is performed in five directions in the first optimization processing and three directions in the second optimization processing, but the present invention is not limited to this. For example, in the first optimization processing, only the correction values E +X , E −X , and E +Y obtained by the correction processing in the right direction, the left direction, and the downward direction may be obtained. Further, in the second optimization process, only the correction value E −Y obtained by the upward correction process may be obtained.

(d)上記実施形態では、第1最適化処理において、補正値E+X,E-Xによって更新された節点コストD(p,up)を用いて補正値E+Y,E+X+Y,E-X+Yを求め、その求めた補正値E+Y,E+X+Y,E-X+Yによって、節点コストD(p,up)を再度更新しているが、これに限定されるものではない。例えば、S320で求めた節点コストD(p,up)により全ての補正値を求め、その求めた補正値によって、節点コストD(p,up)を1回だけ更新してもよい。 (D) In the above-described embodiment, in the first optimization process, the correction values E +Y , E +X +Y are calculated by using the node costs D(p,up) updated by the correction values E +X , E -X . , E −X+Y , and the node cost D(p,up) is updated again by the calculated correction values E +Y , E +X+Y , E −X+Y . It is not something that will be done. For example, all the correction values may be obtained from the node costs D(p,up) obtained in S320, and the node costs D(p,up) may be updated only once with the obtained correction values.

(e)上記実施形態における1つの構成要素が有する複数の機能を、複数の構成要素によって実現したり、1つの構成要素が有する1つの機能を、複数の構成要素によって実現したりしてもよい。また、複数の構成要素が有する複数の機能を、1つの構成要素によって実現したり、複数の構成要素によって実現される1つの機能を、1つの構成要素によって実現したりしてもよい。また、上記実施形態の構成の一部を省略してもよい。また、上記実施形態の構成の少なくとも一部を、他の上記実施形態の構成に対して付加又は置換してもよい。なお、特許請求の範囲に記載した文言から特定される技術思想に含まれるあらゆる態様が本開示の実施形態である。 (E) A plurality of functions of one constituent element in the above-described embodiment may be realized by a plurality of constituent elements, or one function of one constituent element may be realized by a plurality of constituent elements. .. Further, a plurality of functions of a plurality of constituent elements may be realized by one constituent element, or one function realized by a plurality of constituent elements may be realized by one constituent element. Moreover, you may omit a part of structure of the said embodiment. Further, at least a part of the configuration of the above-described embodiment may be added or replaced with respect to the configuration of the other above-described embodiment. Note that all aspects included in the technical idea specified by the wording recited in the claims are embodiments of the present disclosure.

(f)上述した視差演算装置(即ち、視差演算処理を実行する画像処理部4)の他、当該視差演算装置を構成要素とするシステム、当該視差演算装置としてコンピュータを機能させるためのプログラム、このプログラムを記録した半導体メモリ等の非遷移的実態的記録媒体、視差演算方法など、種々の形態で本開示を実現することもできる。 (F) In addition to the parallax calculation device (that is, the image processing unit 4 that executes the parallax calculation process) described above, a system including the parallax calculation device as a component, a program for causing a computer to function as the parallax calculation device, The present disclosure can also be realized in various forms such as a non-transitional physical recording medium such as a semiconductor memory recording a program and a parallax calculation method.

1…測距装置、2,3…撮像部、4…画像処理部、41…CPU、42…メモリ、421…内部メモリ、422…外部メモリ。 1... Distance measuring device, 2, 3... Imaging unit, 4... Image processing unit, 41... CPU, 42... Memory, 421... Internal memory, 422... External memory.

Claims (6)

互いに異なる視点から同一撮影領域を含むように撮像された一対の画像を基本画像対とし、前記基本画像対から生成された前記基本画像対とは解像度が異なる一対以上の画像対を、前記基本画像対とともに画像対群として記憶するように構成された記憶部(422)と、
前記記憶部に記憶された画像対群に基づいて視差画像を生成するように構成された処理部(41,421)と、
を備え、
前記処理部は、
前記画像対群から、解像度が低い順にいずれか一つの画像対を選択するように構成された選択部(S220)と、
前記選択部にて選択された画像対である選択画像対を構成する二つの画像のうち、一方を基準画像、他方を比較画像とし、前記基準画像内での画素の2次元位置と、前記選択画像対の画素サイズ単位で表現された視差とで表現される3次元点を節点とし、前記節点を一意に表現し、且つ、前記基準画像の画像サイズおよび検出対象となる前記視差の最大値で制限された3次元空間を節点空間として、前記節点空間に属する節点の一つを注目節点として、前記注目節点に対応する前記基準画像上の画素と前記注目節点に対応する視差だけ離れた前記比較画像上の画素との類似度が高いほど値が小さくなるように算出される節点コストを、前記節点空間に属する全ての節点について生成するように構成されたコスト生成部(S320)と、
予め設定された補正ベクトルが示す方向に沿って並んだ前記節点空間内の画素列を対象画素列とし、前記コスト生成部にて生成され前記対象画素列に関わる前記複数の節点の節点コストを、ビタビアルゴリズム利用した補正処理により補正するように構成されたコスト補正部(S330〜S390、S520〜S550)と、
前記選択部にて最後に選択される前記選択画像対を最終画像対、前記最終画像対以外の前記選択画像対を非最終画像対として、前記選択画像対が前記非最終画像対である場合に前記コスト補正部での補正結果から、前記選択部にて次に選択される選択画像対に対して前記コスト補正部が実施する前記補正処理での探査範囲を制限するように構成された制限部(S410)と、
前記選択画像対が前記最終画像対である場合に、前記コスト生成部および前記コスト補正部での処理結果から、前記画素毎に前記節点コストが最小となる前記節点に対応した視差を算出するように構成された視差演算部(S270)と、
を備え、
前記コスト補正部は、前記選択画像対を構成する画素の位置をX−Y座標で表した場合に、前記補正処理として、前記X−Y座標のX軸の正方向を前記補正ベクトル示す方向とする右向処理(S330)と、前記X軸の負方向を前記補正ベクトルが示す方向とする左向処理(S340)と、前記X−Y座標のY軸の正方向を前記補正ベクトルが示す方向とする下向処理(S360)とを実行し、前記画像対群のうち予め指定されたいずれか一つの画像対である指定画像対が前記選択画像対である場合には、前記Y軸の負方向を前記補正ベクトルが示す方向とする上向処理(S520)を更に実行する、
視差演算装置。
A pair of images captured so as to include the same shooting region from different viewpoints is a basic image pair, and a pair of image pairs having a resolution different from that of the basic image pair generated from the basic image pair is the basic image pair. A storage unit (422) configured to store together with the pair as an image pair group;
A processing unit (41, 421) configured to generate a parallax image based on the image pair group stored in the storage unit;
Equipped with
The processing unit is
A selection unit (S220) configured to select one of the image pairs from the group of image pairs in ascending order of resolution;
Of the two images forming the selected image pair that is the image pair selected by the selection unit, one is the reference image and the other is the comparison image, and the two-dimensional position of the pixel in the reference image and the selection A three-dimensional point represented by a parallax represented by a pixel size unit of an image pair is a node, the node is uniquely represented, and the image size of the reference image and the maximum value of the parallax to be detected are expressed as The limited three-dimensional space is used as a nodal space, one of the nodes belonging to the nodal space is taken as a target node, and the comparison is performed with a pixel on the reference image corresponding to the target node and a parallax corresponding to the target node. A cost generation unit (S320) configured to generate a node cost calculated such that the value becomes smaller as the degree of similarity to the pixel on the image becomes higher, for all nodes belonging to the node space;
A pixel row in the node space arranged along the direction indicated by a preset correction vector is a target pixel row, and the node costs of the plurality of nodes related to the target pixel row generated by the cost generation unit are A cost correction unit (S330 to S390, S520 to S550) configured to perform correction by the correction processing using the Viterbi algorithm,
When the selected image pair finally selected by the selection unit is a final image pair, the selected image pairs other than the final image pair are non-final image pairs, and the selected image pair is the non-final image pair. A limiter configured to limit the search range in the correction processing performed by the cost corrector for the selected image pair selected next by the selector based on the correction result of the cost corrector. (S410),
When the selected image pair is the final image pair, the parallax corresponding to the node that minimizes the node cost is calculated for each pixel from the processing results of the cost generation unit and the cost correction unit. A parallax calculation unit (S270) configured in
Equipped with
When the positions of the pixels forming the selected image pair are represented by XY coordinates, the cost correction unit performs, as the correction processing, a positive direction of the X axis of the XY coordinates as a direction indicating the correction vector. Rightward processing (S330), leftward processing (S340) in which the negative direction of the X axis is the direction indicated by the correction vector, and positive direction of the Y axis of the XY coordinates is the direction indicated by the correction vector. When the designated image pair, which is any one of the image pairs designated in advance in the image pair group, is the selected image pair, the downward processing (S360) is performed. Further, an upward process (S520) in which the direction is the direction indicated by the correction vector is executed,
Parallax calculator.
請求項1に記載の視差演算装置であって、
前記コスト生成部は、前記記憶部から前記選択画像対の画像を、前記X軸の正方向に並んだ1又は複数行分の画像を取得し、取得した前記画像の処理を終了する毎に、前記Y軸の正方向に順次移動して未処理の画像を順次取得する、視差演算装置。
The parallax calculation device according to claim 1,
The cost generation unit acquires the image of the selected image pair from the storage unit, an image of one or a plurality of lines arranged in the positive direction of the X axis, every time the processing of the acquired image is completed, A parallax calculation device that sequentially moves in the positive direction of the Y-axis and sequentially acquires unprocessed images.
請求項1または請求項2に記載の視差演算装置であって、
前記指定画像対が前記最終画像対である、
視差演算装置。
The parallax calculation device according to claim 1 or 2, wherein
The designated image pair is the final image pair,
Parallax calculator.
請求項1から請求項3のいずれか1項に記載の視差演算装置であって、
前記コスト処理部が実行する前記補正処理は、前記対象画素列中で前記補正ベクトルの始端側に位置する画素に関する複数の節点のいずれかを開始節点とし、前記対象画素列に含まれる全ての画素に関する複数の節点のいずれかを終了節点として、前記開始節点から前記終了節点に至る全ての経路の中で、前記経路上に位置する全ての前記節点の節点コストと、前記経路上で隣接する前記節点間の視差の差が大きいほど大きな値となる視差コストとの総和である経路コストが最小となる経路である最小コスト経路を前記ビタビアルゴリズムにより求め、前記最小コスト経路の経路コストを前記終了節点の節点コストの補正値として求める、
視差演算装置。
The parallax calculation device according to any one of claims 1 to 3,
The correction processing executed by the cost processing unit is one of a plurality of nodes related to the pixel located on the starting end side of the correction vector in the target pixel row as a start node, and all pixels included in the target pixel row. As an end node of any of the plurality of nodes with respect to, in all routes from the start node to the end node, the node costs of all the nodes located on the route, and the adjacent on the route The greater the difference in disparity between nodes is, the larger the disparity cost becomes, and the minimum cost route, which is the route with the minimum route cost, is obtained by the Viterbi algorithm, and the route cost of the minimum cost route is the end node. Obtained as a correction value for the node cost of
Parallax calculator.
請求項1から請求項4のいずれか1項に記載の視差演算装置であって、
前記コスト補正部は、前記補正処理として、更に、前記X軸の正方向かつ前記Y軸の正方向へ向かう斜め方向を前記補正ベクトルが示す方向とする右下向処理(S370)と、前記X軸の負方向かつ前記Y軸の正方向へ向かう斜め方向を前記補正ベクトルが示す方向とする左下向処理(S380)とを実行する、
視差演算装置。
The parallax calculation device according to any one of claims 1 to 4,
The cost correction unit further includes, as the correction processing, a downward right processing (S370) in which an oblique direction toward the positive direction of the X axis and the positive direction of the Y axis is a direction indicated by the correction vector; And a downward left processing (S380) in which a diagonal direction toward the negative direction of the axis and the positive direction of the Y axis is the direction indicated by the correction vector,
Parallax calculator.
請求項1から請求項5のいずれか1項に記載の視差演算装置であって、
前記コスト補正部は、前記指定画像対が前記選択画像対である場合、前記補正処理として、更に、前記X軸の正方向かつ前記Y軸の負方向へ向かう斜め方向を前記補正ベクトルが示す方向とする右上向処理(S540)と、前記X軸の負方向かつ前記Y軸の負方向へ向かう斜め方向を前記補正ベクトルが示す方向とする左上向処理(S530)とを実行する、
視差演算装置。
The parallax calculation device according to any one of claims 1 to 5,
When the designated image pair is the selected image pair, the cost correction unit further performs, as the correction processing, a direction in which the correction vector indicates an oblique direction toward the positive direction of the X axis and the negative direction of the Y axis. And an upper left processing (S530) in which the correction vector indicates a diagonal direction toward the negative direction of the X axis and the negative direction of the Y axis.
Parallax calculator.
JP2017056106A 2017-03-22 2017-03-22 Parallax calculator Active JP6730214B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017056106A JP6730214B2 (en) 2017-03-22 2017-03-22 Parallax calculator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017056106A JP6730214B2 (en) 2017-03-22 2017-03-22 Parallax calculator

Publications (2)

Publication Number Publication Date
JP2018159590A JP2018159590A (en) 2018-10-11
JP6730214B2 true JP6730214B2 (en) 2020-07-29

Family

ID=63796546

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017056106A Active JP6730214B2 (en) 2017-03-22 2017-03-22 Parallax calculator

Country Status (1)

Country Link
JP (1) JP6730214B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114459423B (en) * 2022-01-24 2023-06-13 长江大学 Method for monocular measuring and calculating distance of navigation ship

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101875532B1 (en) * 2011-11-23 2018-07-11 엘지이노텍 주식회사 Apparatus and method for hierarchical stereo matching
JP6321365B2 (en) * 2013-12-13 2018-05-09 株式会社Soken Corresponding point search method and distance measuring device
JP6423314B2 (en) * 2015-06-04 2018-11-14 株式会社Soken Corresponding point search method and distance measuring device
JP2017045124A (en) * 2015-08-24 2017-03-02 株式会社日本自動車部品総合研究所 Parallax detection device

Also Published As

Publication number Publication date
JP2018159590A (en) 2018-10-11

Similar Documents

Publication Publication Date Title
US10818018B2 (en) Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
WO2020017334A1 (en) Vehicle-mounted environment recognition device
JP5170276B2 (en) Image reconstruction device, image reconstruction method, and image reconstruction program
JP6321365B2 (en) Corresponding point search method and distance measuring device
JP6212021B2 (en) Distance detector
JP6730214B2 (en) Parallax calculator
JP6571492B2 (en) Corresponding point search method and distance measuring device
JP6282133B2 (en) Imaging device, control method thereof, and control program
WO2010061859A1 (en) Stereo image processing device, stereo image processing method, and recording medium
JP2016164709A (en) Image processing device, imaging apparatus, and image processing program
CN114764823A (en) Self-correcting depth calculation method, system, medium, and depth image processing apparatus
JP6532328B2 (en) Image processing apparatus, control method therefor, and control program
JP7195785B2 (en) Apparatus, method and program for generating 3D shape data
CN109859313B (en) 3D point cloud data acquisition method and device, and 3D data generation method and system
JP6602412B2 (en) Information processing apparatus and method, information processing system, and program.
JP2017045124A (en) Parallax detection device
JP6305232B2 (en) Information processing apparatus, imaging apparatus, imaging system, information processing method, and program.
US20170289493A1 (en) Projection apparatus, image processing apparatus, and image processing method
JP2017199285A (en) Information processor, information processing method, program
JP2020140497A (en) Calculation device, and parallax calculation method
US9380285B2 (en) Stereo image processing method, stereo image processing device and display device
WO2017154423A1 (en) Image processing device, image processing method, and program
JP6596286B2 (en) Image high resolution system and high resolution method
JP5248992B2 (en) 3D object model information generation apparatus and program
US20120098939A1 (en) Image processing apparatus and method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190718

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200527

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200702

R150 Certificate of patent or registration of utility model

Ref document number: 6730214

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250