JP2019120590A - Parallax value calculation device, parallax value calculation method and program - Google Patents

Parallax value calculation device, parallax value calculation method and program Download PDF

Info

Publication number
JP2019120590A
JP2019120590A JP2018000877A JP2018000877A JP2019120590A JP 2019120590 A JP2019120590 A JP 2019120590A JP 2018000877 A JP2018000877 A JP 2018000877A JP 2018000877 A JP2018000877 A JP 2018000877A JP 2019120590 A JP2019120590 A JP 2019120590A
Authority
JP
Japan
Prior art keywords
pixel
image
value
parallax
pixels
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2018000877A
Other languages
Japanese (ja)
Inventor
吾妻 健夫
Takeo Azuma
健夫 吾妻
登 一生
Kazuo Nobori
一生 登
佐藤 智
Satoshi Sato
智 佐藤
信彦 若井
Nobuhiko Wakai
信彦 若井
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.)
Panasonic Intellectual Property Management Co Ltd
Original Assignee
Panasonic Intellectual Property Management 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 Panasonic Intellectual Property Management Co Ltd filed Critical Panasonic Intellectual Property Management Co Ltd
Priority to JP2018000877A priority Critical patent/JP2019120590A/en
Publication of JP2019120590A publication Critical patent/JP2019120590A/en
Pending legal-status Critical Current

Links

Abstract

To provide a technology that improves calculation accuracy of a parallax value among a plurality of images.SOLUTION: A parallax value calculation device acquires a first image and a second image imaged by two cameras, generates a first enlarged image and a second enlarged image by performing enlargement processing in a predetermined parallax direction to each of the first image and the second image, calculates a first census feature quantity and a second census feature quantity by comparing a pixel value with a peripheral pixel for each first pixel of the first enlarged image and for each second pixel of the second enlarged image, calculates a difference degree for each of the second pixels using the first census feature quantity and the second census feature quantity for each first pixel, acquires a parallax value corresponding to the smallest difference degree as the parallax value of a pixel of a parallax image corresponding to the first enlarged image for each first pixel, and calculates a parallax value for each pixel of the first image by performing reduction processing of the parallax image.SELECTED DRAWING: Figure 14

Description

本開示は、視差値算出装置、視差値算出方法及びプログラムに関する。   The present disclosure relates to a disparity value calculating device, a disparity value calculating method, and a program.

近年、自動車の安全運転支援システム及び自動運転システム、不審者等を検出する監視カメラシステム又はロボット等の開発分野において、カメラで撮像された画像を用いて、カメラから被写体までの距離を算出する技術が検討されている。上記距離を算出する技術として、複数のカメラで撮像された画像から上記距離を算出するステレオ測距技術がある。複数のカメラの撮像画像では、同一の被写体が見える方向が異なり、このような方向の違いは、視差と呼ばれる。ステレオ測距技術では、三角測量の技術が利用され、視差に基づき被写体までの距離が算出される。視差の精度は、被写体が遠い程、被写体の測距結果の誤差に与える影響が大きい。そこで、複数の画像間の視差を求めるための技術が検討されている。例えば、特許文献1は、ステレオカメラで撮像された2つの画像における視差を算出する技術を、開示している。特許文献1では、2つの画像の画素を対応付けるために、画素値のセンサス変換とセンサス変換された画素値の相関演算とが用いられる。非特許文献1は、Semi−Global Maching(SGM)と呼ばれる視差値算出方法を開示している。   In recent years, in a development field such as a safe driving support system and an automatic driving system of a car, a surveillance camera system for detecting a suspicious person or a robot, a technology for calculating a distance from a camera to a subject using an image captured by the camera Is being considered. As a technique for calculating the distance, there is a stereo distance measuring technique for calculating the distance from images taken by a plurality of cameras. In captured images of a plurality of cameras, the direction in which the same object is viewed is different, and such difference in direction is called parallax. In stereo ranging technology, triangulation technology is used to calculate the distance to the subject based on the parallax. The accuracy of the parallax has a greater effect on the error of the distance measurement result of the subject as the subject is farther. Therefore, techniques for determining the parallax between a plurality of images are being studied. For example, Patent Document 1 discloses a technique for calculating parallax in two images captured by a stereo camera. In Patent Document 1, in order to associate pixels of two images, a census conversion of pixel values and a correlation operation of census-converted pixel values are used. Non-Patent Document 1 discloses a disparity value calculation method called Semi-Global Maching (SGM).

特許第4168125号公報Patent No. 4168125 gazette

Heiko Hirschmuller著、「Stereo Processing by Semiglobal Matching and Mutual Information」、IEEE、IEEE Transactions on Pattern Analysis Machine Intelligence、2008年2月、Vol. 39、No. 2Heiko Hirschmuller, "Stereo Processing by Semiglobal Matching and Mutual Information", IEEE, IEEE Transactions on Pattern Analysis Machine Intelligence, February 2008, Vol. 39, No. 2

特許文献1及び非特許文献1の技術は、サブピクセル精度の視差値の算出精度が低い場合がある。   The techniques of Patent Document 1 and Non-Patent Document 1 may have low accuracy in calculation of disparity values with sub-pixel accuracy.

そこで本開示は、複数の画像間の視差値の算出精度を向上する視差値算出装置、視差値算出方法及びプログラムを提供する。   Thus, the present disclosure provides a parallax value calculation device, a parallax value calculation method, and a program that improve the calculation accuracy of parallax values between a plurality of images.

本開示の一態様に係る視差値算出装置は、プロセッサとメモリとを備え、前記プロセッサは、(a)第1の位置に配置された第1のカメラで撮像された第1の画像と、第2の位置に配置された第2のカメラで撮像された第2の画像とを前記メモリから取得し、(b)前記第1の画像に対して、予め定められた視差方向への拡大処理により、前記第1の画像の画素の数を増やすことによって、複数の第1の画素を含む第1の拡大画像を生成し、前記第2の画像に対して、予め定められた視差方向への拡大処理により、前記第2の画像の画素の数を増やすことによって、複数の第2の画素を含む第2の拡大画像を生成し、(c)前記第1の拡大画像において、前記複数の第1の画素毎に、周囲の画素との画素値の比較により、第1のセンサス特徴量を算出し、前記第2の拡大画像において、前記複数の第2の画素毎に、周囲の画素との画素値の比較により、第2のセンサス特徴量を算出し、(d)前記複数の第1の画素それぞれについて、前記第1のセンサス特徴量と、少なくとも1つの前記第2の画素の前記第2のセンサス特徴量とを用いて、前記少なくとも1つの第2の画素それぞれの位置での前記第1の画素に対する視差値に対応する相違度を算出し、(e)前記複数の第1の画素それぞれについて、前記相違度を用いて、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得し、(f)前記視差画像の画素毎の視差値に対して、縮小処理をすることにより、前記第2の画像に対する前記第1の画像の画素毎の視差値を算出する。   A parallax value calculation device according to an aspect of the present disclosure includes a processor and a memory, the processor including: (a) a first image captured by a first camera disposed at a first position; The second image captured by the second camera arranged at position 2 is acquired from the memory, and (b) the first image is enlarged by a predetermined parallax direction. Generating a first enlarged image including a plurality of first pixels by increasing the number of pixels of the first image, and enlarging the second image in a predetermined parallax direction Processing to generate a second magnified image including a plurality of second pixels by increasing the number of pixels of the second image; and (c) in the first magnified image, the plurality of first images. The first census feature by comparing pixel values with surrounding pixels for each pixel of And calculating a second census feature value by comparing pixel values with surrounding pixels for each of the plurality of second pixels in the second enlarged image, and (d) calculating the plurality of second plurality of The first census feature amount and the second census feature amount of the at least one second pixel are used for each of the one pixel, and the at the position of each of the at least one second pixel Calculating the degree of difference corresponding to the parallax value for the first pixel, and (e) selecting the parallax value corresponding to the smallest degree of difference using the degree of difference for each of the plurality of first pixels Acquiring a parallax value for each pixel in the parallax image corresponding to the first enlarged image, and (f) performing a reduction process on the parallax value for each pixel of the parallax image to obtain the second image Of the first image against To calculate the disparity value of Motogoto.

本開示の一態様に係る視差値算出方法は、(a)第1の位置に配置された第1のカメラで撮像される第1の画像と、第2の位置に配置された第2のカメラで撮像される第2の画像とを取得し、(b)前記第1の画像に対して、予め定められた視差方向への拡大処理により、前記第1の画像の画素の数を増やすことによって、複数の第1の画素を含む第1の拡大画像を生成し、前記第2の画像に対して、予め定められた視差方向への拡大処理により、前記第2の画像の画素の数を増やすことによって、複数の第2の画素を含む第2の拡大画像を生成し、(c)前記第1の拡大画像において、前記複数の第1の画素毎に、周囲の画素との画素値の比較により、第1のセンサス特徴量を算出し、前記第2の拡大画像において、前記複数の第2の画素毎に、周囲の画素との画素値の比較により、第2のセンサス特徴量を算出し、(d)前記複数の第1の画素それぞれについて、前記第1のセンサス特徴量と、少なくとも1つの前記第2の画素の前記第2のセンサス特徴量とを用いて、前記少なくとも1つの第2の画素それぞれの位置での前記第1の画素に対する視差値に対応する相違度を算出し、(e)前記複数の第1の画素それぞれについて、前記相違度を用いて、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得し、(f)前記視差画像の画素毎の視差値に対して、縮小処理をすることにより、前記第2の画像に対する前記第1の画像の画素毎の視差値を算出し、処理(a)〜処理(f)の少なくとも1つは、少なくとも1つのプロセッサによって実行される。   A parallax value calculation method according to an aspect of the present disclosure includes: (a) a first image captured by a first camera disposed at a first position, and a second camera disposed at a second position (B) increasing the number of pixels of the first image by performing enlargement processing in a predetermined parallax direction on the first image (b). Generating a first enlarged image including a plurality of first pixels, and increasing the number of pixels of the second image by performing enlargement processing on the second image in a predetermined parallax direction Thereby generating a second enlarged image including a plurality of second pixels, and (c) comparing pixel values with surrounding pixels for each of the plurality of first pixels in the first enlarged image Calculates a first census feature amount, and the plurality of second pixels in the second enlarged image A second census feature value is calculated by comparing pixel values with surrounding pixels, and (d) the first census feature value and the at least one first census feature value for each of the plurality of first pixels. The difference degree corresponding to the parallax value with respect to the first pixel at each position of the at least one second pixel is calculated using the second census feature value of two pixels, and (e) the above The parallax value for each pixel in the parallax image corresponding to the first enlarged image is acquired by selecting the parallax value corresponding to the smallest degree of difference using the degree of difference for each of the plurality of first pixels And (f) calculating a parallax value for each pixel of the first image with respect to the second image by performing reduction processing on the parallax value for each pixel of the parallax image, and processing (a) ~ At least one of processing (f) It is performed by at least one processor.

本開示の一態様に係るプログラムは、(a)第1の位置に配置された第1のカメラで撮像された第1の画像と、第2の位置に配置された第2のカメラで撮像された第2の画像とを取得し、(b)前記第1の画像に対して、予め定められた視差方向への拡大処理により、前記第1の画像の画素の数を増やすことによって、複数の第1の画素を含む第1の拡大画像を生成し、前記第2の画像に対して、予め定められた視差方向への拡大処理により、前記第2の画像の画素の数を増やすことによって、複数の第2の画素を含む第2の拡大画像を生成し、(c)前記第1の拡大画像において、前記複数の第1の画素毎に、周囲の画素との画素値の比較により、第1のセンサス特徴量を算出し、前記第2の拡大画像において、前記複数の第2の画素毎に、周囲の画素との画素値の比較により、第2のセンサス特徴量を算出し、(d)前記複数の第1の画素それぞれについて、前記第1のセンサス特徴量と、少なくとも1つの前記第2の画素の前記第2のセンサス特徴量とを用いて、前記少なくとも1つの第2の画素それぞれの位置での前記第1の画素に対する視差値に対応する相違度を算出し、(e)前記複数の第1の画素それぞれについて、前記相違度を用いて、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得し、(f)前記視差画像の画素毎の視差値に対して、縮小処理をすることにより、前記第2の画像に対する前記第1の画像の画素毎の視差値を算出することを、コンピュータに実行させる。   A program according to an aspect of the present disclosure includes: (a) a first image captured by a first camera disposed at a first position, and a second image disposed at a second position; A second image, and (b) enlarging the number of pixels of the first image by enlarging the first image in a predetermined parallax direction, A first magnified image including a first pixel is generated, and the number of pixels of the second image is increased by performing enlargement processing on the second image in a predetermined parallax direction. Generating a second enlarged image including a plurality of second pixels; and (c) comparing the pixel values with surrounding pixels for each of the plurality of first pixels in the first enlarged image. Calculating a census feature amount of 1 for each of the plurality of second pixels in the second enlarged image; A second census feature value is calculated by comparing pixel values with surrounding pixels, and (d) the first census feature value and at least one of the second census feature values for each of the plurality of first pixels. The difference degree corresponding to the parallax value with respect to the first pixel at the position of each of the at least one second pixel is calculated using the second census feature value of the pixel, and (e) the plurality of pixels The parallax value for each pixel in the parallax image corresponding to the first enlarged image is acquired by selecting the parallax value corresponding to the smallest degree of difference using the degree of difference for each of the first pixels, (F) causing a computer to calculate a parallax value for each pixel of the first image with respect to the second image by performing reduction processing on the parallax value for each pixel of the parallax image .

なお、上記の包括的又は具体的な態様は、システム、装置、方法、集積回路、コンピュータプログラム又はコンピュータ読取可能な記録ディスク等の記録媒体で実現されてもよく、システム、装置、方法、集積回路、コンピュータプログラム及び記録媒体の任意な組み合わせで実現されてもよい。コンピュータ読み取り可能な記録媒体は、例えばCD−ROM(Compact Disc-Read Only Memory)等の不揮発性の記録媒体を含む。   Note that the above-described comprehensive or specific aspect may be realized by a recording medium such as a system, an apparatus, a method, an integrated circuit, a computer program, or a computer readable recording disk, and the system, an apparatus, a method, an integrated circuit , And may be realized by any combination of computer program and recording medium. The computer readable recording medium includes, for example, a non-volatile recording medium such as a CD-ROM (Compact Disc-Read Only Memory).

本開示の視差値算出装置等によれば、複数の画像間の視差値の算出精度を向上することが可能になる。   According to the parallax value calculation device and the like of the present disclosure, it is possible to improve the calculation accuracy of parallax values between a plurality of images.

図1は、特許文献1が開示するイメージ処理システムを示す図である。FIG. 1 is a diagram showing an image processing system disclosed in Patent Document 1. As shown in FIG. 図2Aは、特許文献1に開示される等角フィッティング法を説明する図である。FIG. 2A is a diagram for explaining the conformal fitting method disclosed in Patent Document 1. 図2Bは、特許文献1に開示される等角フィッティング法を説明する図である。FIG. 2B is a view for explaining the conformal fitting method disclosed in Patent Document 1. 図3は、従来技術の視差値算出処理の流れを模式的に示す図である。FIG. 3 is a diagram schematically showing the flow of disparity value calculation processing according to the prior art. 図4は、従来技術のSemi−Global Maching処理の流れを模式的に示す図である。FIG. 4 is a diagram schematically showing the flow of the prior art Semi-Global Maching process. 図5は、SGMを用いた視差値算出処理の検証に使用したCG画像である。FIG. 5 is a CG image used for verification of disparity value calculation processing using SGM. 図6は、図5のCG画像と、このCG画素を水平方向に平行移動した画像とを用いたSGMによる視差値の算出結果を示す図である。FIG. 6 is a diagram showing the calculation result of the parallax value by SGM using the CG image of FIG. 5 and an image obtained by translating the CG pixels in the horizontal direction. 図7は、SGMを用いた視差値算出処理の検証に使用した実写画像である。FIG. 7 shows a photographed image used for verification of disparity value calculation processing using SGM. 図8は、図7の実写画像と、この実写画素を水平方向に平行移動した画像とを用いたSGMによる視差値の算出結果を示す図である。FIG. 8 is a view showing the calculation result of the parallax value by SGM using the photographed image of FIG. 7 and an image obtained by translating the photographed pixels in the horizontal direction. 図9は、SGMを用いた視差値算出処理の検証に使用した実写画像である。FIG. 9 shows a photographed image used for verification of disparity value calculation processing using SGM. 図10は、図9の実写画像と、この実写画素を水平方向に平行移動した画像とを用いたSGMによる視差値の算出結果を示す図である。FIG. 10 is a view showing the calculation result of the parallax value by SGM using the photographed image of FIG. 9 and an image obtained by translating the photographed pixels in the horizontal direction. 図11は、SGMを用いた視差値算出処理の検証に使用した実写画像である。FIG. 11 shows a photographed image used for verification of disparity value calculation processing using SGM. 図12は、図11の実写画像と、この実写画素を水平方向に平行移動した画像とを用いたSGMによる視差値の算出結果を示す図である。FIG. 12 is a diagram showing the calculation result of the parallax value by SGM using the photographed image of FIG. 11 and the image obtained by translating the photographed pixels in the horizontal direction. 図13は、正解視差値と算出視差値との関係の仮定的な一例を示す図である。FIG. 13 is a diagram showing a hypothetical example of the relationship between the correct parallax value and the calculated parallax value. 図14は、実施の形態1に係る視差値算出装置を含む測距システムの機能的な構成の一例を示すブロック図である。FIG. 14 is a block diagram showing an example of a functional configuration of a distance measuring system including the disparity value calculating device according to Embodiment 1. 図15は、撮像部のカメラの配置例を示す模式的な斜視図である。FIG. 15 is a schematic perspective view showing an arrangement example of cameras of the imaging unit. 図16は、図15のカメラの基線長の例を示す模式的な正面図である。FIG. 16 is a schematic front view showing an example of the baseline length of the camera of FIG. 図17は、撮像部のカメラの別の配置例を示す模式的な斜視図である。FIG. 17 is a schematic perspective view showing another arrangement example of the cameras of the imaging unit. 図18Aは、センサス変換における周辺画素の一例を示す図である。FIG. 18A is a diagram illustrating an example of peripheral pixels in census conversion. 図18Bは、センサス変換における周辺画素の別の一例を示す図である。FIG. 18B is a diagram illustrating another example of peripheral pixels in census conversion. 図19Aは、図18Aの周辺画素のセンサス変換の一例を示す図である。FIG. 19A is a diagram illustrating an example of the census conversion of the peripheral pixels in FIG. 18A. 図19Bは、図18Bの周辺画素のセンサス変換の一例を示す図である。FIG. 19B is a diagram illustrating an example of the census conversion of the peripheral pixels in FIG. 18B. 図20は、相違度の算出の際の画素の探索範囲の一例を示す図である。FIG. 20 is a diagram illustrating an example of a search range of pixels at the time of calculation of the degree of difference. 図21は、相違度の算出の際の画素の探索範囲の別の一例を示す図である。FIG. 21 is a diagram showing another example of the search range of the pixel at the time of calculation of the degree of difference. 図22は、1つの着目画素に対して算出される相違度と、相違度に対応する参照画素の視差値との関係の一例を示す図である。FIG. 22 is a diagram showing an example of the relationship between the degree of difference calculated for one target pixel and the parallax value of the reference pixel corresponding to the degree of difference. 図23は、実施の形態1に係る視差値算出装置の動作の一例を示すフローチャートである。FIG. 23 is a flowchart showing an example of the operation of the disparity value calculating device according to the first embodiment. 図24は、実施の形態2に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 24 is a block diagram showing an example of a functional configuration of a disparity value calculating device according to Embodiment 2. 図25は、実施の形態2に係る視差値算出装置の動作の一例を示すフローチャートである。FIG. 25 is a flowchart illustrating an example of the operation of the disparity value calculating device according to the second embodiment. 図26は、実施の形態3に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 26 is a block diagram showing an example of a functional configuration of a disparity value calculating device according to Embodiment 3. 図27は、実施の形態3に係る視差値算出装置の動作の一例を示すフローチャートである。FIG. 27 is a flowchart illustrating an example of the operation of the disparity value calculating device according to the third embodiment. 図28は、実施の形態3の変形例に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 28 is a block diagram illustrating an example of a functional configuration of a disparity value calculating device according to a modification of the third embodiment. 図29は、実施の形態4に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 29 is a block diagram showing an example of a functional configuration of a disparity value calculating device according to Embodiment 4. 図30は、実施の形態4の変形例に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 30 is a block diagram showing an example of a functional configuration of a disparity value calculating device according to a modification of the fourth embodiment. 図31は、実施の形態5に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 31 is a block diagram illustrating an example of a functional configuration of the disparity value calculating device according to the fifth embodiment. 図32は、コスト算出の際の着目画素からの複数の走査方向の例を示す図である。FIG. 32 is a diagram showing an example of a plurality of scanning directions from the pixel of interest at the time of cost calculation. 図33は、コスト算出の際の着目画素を通る直線上での画素の走査方向の例を示す図である。FIG. 33 is a diagram showing an example of the scanning direction of a pixel on a straight line passing the pixel of interest at the time of cost calculation. 図34は、コスト算出のための走査ライン上の1つの画素におけるコストの例を示す図である。FIG. 34 is a diagram showing an example of the cost of one pixel on a scanning line for cost calculation. 図35は、実施の形態5に係る視差値算出装置の動作の一例を示すフローチャートである。FIG. 35 is a flowchart illustrating an example of the operation of the disparity value calculating device according to the fifth embodiment. 図36は、実施の形態5の変形例1に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 36 is a block diagram showing an example of a functional configuration of a disparity value calculating device according to Variation 1 of Embodiment 5. 図37は、実施の形態5の変形例2に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 37 is a block diagram showing an example of a functional configuration of a disparity value calculating device according to Variation 2 of Embodiment 5. 図38は、実施の形態5の変形例3に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 38 is a block diagram showing an example of a functional configuration of a disparity value calculating device according to Variation 3 of Embodiment 5. 図39は、実施の形態5の変形例4に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 39 is a block diagram showing an example of a functional configuration of a disparity value calculating device according to Variation 4 of Embodiment 5. 図40は、実施の形態6に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 40 is a block diagram showing an example of a functional configuration of a disparity value calculating device according to Embodiment 6. 図41は、着目画素の複数の窓領域の一例を示す図である。FIG. 41 is a diagram showing an example of a plurality of window areas of the pixel of interest. 図42は、実施の形態6の変形例に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 42 is a block diagram showing an example of a functional configuration of a disparity value calculating device according to a modification of the sixth embodiment. 図43は、実施の形態7に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 43 is a block diagram illustrating an example of a functional configuration of a disparity value calculating device according to a seventh embodiment. 図44は、着目画素と周辺画素との間におけるビット間差異と輝度差に基づく重みとの関係の一例を示す図である。FIG. 44 is a diagram showing an example of the relationship between the inter-bit difference between the pixel of interest and the peripheral pixels and the weight based on the luminance difference. 図45は、実施の形態7の変形例に係る視差値算出装置の機能的な構成の一例を示すブロック図である。FIG. 45 is a block diagram showing an example of a functional configuration of a disparity value calculating device according to a modification of the seventh embodiment.

[発明者による知見]
本発明者らは、デジタル画像を用いた測距精度の向上のために、デジタル画像の画素単位よりも細かいサブピクセル精度で、画像間の視差値を算出する技術を検討した。なお、視差値の単位は、1画素つまりピクセルであり、サブピクセルは、1画素未満を示す。本発明者らは、特許文献1及び非特許文献1に開示される技術を、以下に説明するように検討した。例えば、特許文献1に開示される従来技術では、複数のカメラ又は複眼カメラで撮像された複数の画像であるステレオ画像それぞれの画素が、センサス変換され、各画素について、センサス変換後の特徴量であるセンサス特徴量が算出される。さらに、ステレオ画像間において、各画素のセンサス特徴量の相違度が、ハミング距離を用いて算出される。一方の画像における着目画素について、当該着目画素とのハミング距離が最小となる画素が他方の画像から抽出され、抽出された画素は、着目画素に対応する画素に決定される。さらに、他方の画像における着目画素に対応する画素とその近傍の画素とについて、着目画素に対するハミング距離と、画素間の位置関係とに基づき、等角フィティングと呼ばれる方法を用いることによって、1画素未満のサブピクセル精度で視差値が算出される。
[Findings by the inventor]
The present inventors examined a technique for calculating a parallax value between images with sub-pixel accuracy finer than the pixel unit of a digital image in order to improve distance measurement accuracy using a digital image. Note that the unit of disparity value is one pixel, that is, a pixel, and the sub-pixel indicates less than one pixel. The present inventors examined the techniques disclosed in Patent Document 1 and Non-Patent Document 1 as described below. For example, in the prior art disclosed in Patent Document 1, pixels of stereo images that are a plurality of images captured by a plurality of cameras or compound-eye cameras are subjected to census conversion, and feature values after census conversion for each pixel A census feature value is calculated. Furthermore, the degree of difference of the census feature value of each pixel between stereo images is calculated using the Hamming distance. For the pixel of interest in one of the images, the pixel whose Hamming distance to the pixel of interest is the smallest is extracted from the other image, and the extracted pixel is determined as the pixel corresponding to the pixel of interest. Furthermore, for the pixel corresponding to the pixel of interest in the other image and the neighboring pixels, one pixel is used by using a method called equiangular fitting based on the Hamming distance to the pixel of interest and the positional relationship between the pixels. The disparity value is calculated with sub-pixel accuracy less than.

例えば、図1は、特許文献1が開示するイメージ処理システムを示す。このシステムは、左右のカメラ21及び22で撮像されたオリジナルイメージデータ200及び201から、視差イメージ290を生成する。視差イメージ290は、オリジナルイメージの中の個々のイメージ要素に対する選択された最適な視差の組である。この視差イメージ290を得るために、イメージデータ200及び201は、変換され、これらの間で相関演算され、エラー及び信頼性の検査がなされる。   For example, FIG. 1 shows an image processing system disclosed in Patent Document 1. This system generates a parallax image 290 from original image data 200 and 201 captured by the left and right cameras 21 and 22. The parallax image 290 is a set of selected optimal parallaxes for individual image elements in the original image. In order to obtain this disparity image 290, the image data 200 and 201 are transformed, correlated between them, and checked for errors and reliability.

例えば、左カメラ21及び右カメラ22が、光景10をキャプチャし、フレームグラバ及びデジタイザが、再構成可能なイメージの処理システムにイメージデータを提供する。個別のピクセル要素及びその各々の輝度の形態である左のイメージデータ200及び右のイメージデータ201はそれぞれ、左の輝度イメージ210及び右の輝度イメージ211にマッピングされる。これらの輝度イメージそれぞれは、Xの幅であり、Yの高さであり、つまり、X×Yの輝度イメージである。センサス変換又はランク変換のような非パラメトリック局所変換215及び216が、これらの輝度イメージの各々に適用される。変換215は、矢印218によって示されるように、左の輝度イメージ210に適用されて、変換されたベクトル左イメージ220を生成する。同様に、変換216は、矢印219によって示されるように、右の輝度イメージ211に適用されて、変換されたベクトル右イメージ221を生成する。これらの変換は、これら2つの輝度イメージ各々の中のイメージ要素の近隣部、又はウインドウの中における2つの輝度イメージのイメージ要素の実質的に全てに適用される。従って、ウインドウのサイズ及び参照イメージ要素の位置は、輝度イメージの端のどのイメージ要素が変換計算で無視されるかを決定する。これらの無視されたイメージ要素は、参照イメージ要素としては使用されないが、当該イメージ要素は、他の参照イメージ要素の変換ベクトルの計算では、依然として使用され得る。   For example, left camera 21 and right camera 22 capture scene 10, and a frame grabber and digitizer provide image data to a reconfigurable image processing system. The left image data 200 and the right image data 201 in the form of individual pixel elements and their respective luminances are mapped to the left luminance image 210 and the right luminance image 211, respectively. Each of these luminance images is the width of X and the height of Y, that is, an X × Y luminance image. Non-parametric local transforms 215 and 216, such as census transform or rank transform, are applied to each of these intensity images. Transform 215 is applied to left luminance image 210, as indicated by arrow 218, to produce transformed vector left image 220. Similarly, transform 216 is applied to the right intensity image 211, as indicated by arrow 219, to produce a transformed vector right image 221. These transformations apply to substantially all of the image elements of the two luminance images in the neighborhood or window of the image elements in each of the two luminance images. Thus, the size of the window and the position of the reference image element determine which image element at the edge of the intensity image is to be ignored in the conversion calculation. These neglected image elements are not used as reference image elements, but the image elements may still be used in the calculation of transformation vectors of other reference image elements.

図1のイメージ処理システムは、相関合計プロセス225をさらに含む。相関合計プロセス225は、左イメージ220と右イメージ221との間の対応の決定における1つのステップである。相関合計プロセス225は、左イメージ220のための相関ウインドウの内部の変換ベクトル、及び右イメージ221の中の同じサイズの相関ウインドウの内部の変換ベクトルに動作して、単一の矢印226で示されるように、相関合計マトリクス230を生成する。この相関合計マトリクス230の生成において、左又は右イメージ220又は221の何れかが参照イメージとして使用され、もう一方のイメージの中のウインドウがシフトされる。右イメージ221が参照イメージとして取り扱われるならば、相関合計マトリクス230は、相関ウインドウの中の右イメージ221の各右イメージ要素がどのように相関しているか、又は、左イメージ220の左イメージ要素の右イメージ要素からのシフト若しくは視差の各々についての相関ウインドウの中で左イメージ要素にどのように対応しているかを示すデータを含む。定義によって、特定の左イメージ要素の、右イメージ要素の様々なシフト若しくは視差との相関又は対応を示すデータは、やはり相関合計マトリクス230に含まれている。これらの視差に基づく相関合計及び相関合計マトリクス230、矢印231で示される最適視差は、各右イメージ要素について選択され、外部インデックス(「指標」とも呼ばれる)アレイ270に記憶され得る。最終的な視差イメージ290は、その後に、矢印271で示されるように、外部インデックスアレイ270で決定される。ステレオ視の場合には、視差は、変換イメージ1のウインドウと変換イメージ2のウインドウとの間の水平オフセットである。   The image processing system of FIG. 1 further includes a correlation sum process 225. The correlation summation process 225 is one step in determining the correspondence between the left image 220 and the right image 221. The correlation sum process 225 operates on the transform vector inside the correlation window for the left image 220 and the transform vector inside the correlation window of the same size in the right image 221 and is indicated by a single arrow 226 Thus, the correlation sum matrix 230 is generated. In generating this correlation sum matrix 230, either the left or right image 220 or 221 is used as a reference image and the windows in the other image are shifted. If the right image 221 is treated as a reference image, the correlation sum matrix 230 shows how each right image element of the right image 221 in the correlation window is correlated, or of the left image element of the left image 220. It contains data indicating how it corresponds to the left image element in the correlation window for each shift or disparity from the right image element. By definition, data indicating the correlation or correspondence of a particular left image element with various shifts or disparities of the right image element is also included in the correlation sum matrix 230. The disparity based correlation sum and correlation sum matrix 230, the optimal disparity indicated by the arrow 231, may be selected for each right image element and stored in the external index (also called "index") array 270. The final disparity image 290 is then determined at the external index array 270 as indicated by the arrow 271. In the case of stereo vision, the parallax is the horizontal offset between the window of transformed image 1 and the window of transformed image 2.

図1では含まれていないが、特許文献1は、等角フィッティング法(「等角直線フィッティング法」とも呼ばれる)により、サブピクセル精度の視差を導出することを開示している。この等角フィッティング法では、相関合計の最小値を与える視差値、及び、その前後の視差値、例えば相関合計の最小値を与える視差値±1の視差値のそれぞれについての相関合計の値(以下、「相関合計値」とも呼ぶ)と、視差値との関係に対して、V字型の関数の関係が当てはめられる。   Although not included in FIG. 1, Patent Document 1 discloses that parallax with sub-pixel accuracy is derived by an equiangular fitting method (also referred to as “equiangular straight line fitting method”). In this conformal fitting method, the value of the correlation sum for each of the parallax value giving the minimum value of the correlation sum and the parallax values before and after it, for example, the parallax value of ± 1 for the parallax value giving the minimum value of the correlation sum , And the relationship between the “correlation total value” and the disparity value, the relationship of the V-shaped function is applied.

例えば、図2A及び図2Bは、特許文献1に開示される等角フィッティング法を説明する図である。図2Aにおいて、相関合計値及び視差値の関係が示され、相関合計値は、視差値2において、最小値Y2である。この場合、相関合計値が最小値Y2であり且つ視差値が2である点Aに加えて、視差値1且つ相関合計値Y1の点Bと、視差値3且つ相関合計値Y3の点Cが用いられる。さらに、図2Bに示すように、これら3点を通るV字型の関数が当てはめられる。このとき、V字型の関数の2つのラインの傾きの絶対値は、点A及び点Bの間の視差値の差異に対する相関合計値の差異の傾きの絶対値と、点A及び点Cとの間の視差値の差異に対する相関合計値の差異の傾きの絶対値とのうち、大きい方と等しくされる。具体的には、図2Aでは、点Aと点Cとの間の傾きである相関合計値の差分(Y3−Y2)の絶対値の方が、点Aと点Bとの間の傾きである相関合計値の差分(Y2−Y1)の絶対値よりも大きい。このため、(Y3−Y2)の絶対値が、V字型の関数の傾きに採用される。V字型の関数では、V字の頂点の両側のラインの傾きの絶対値が同じである。つまり、両側のラインと水平ラインとの角度1及び2が同じである。これにより、点Bを通り且つ上記傾きの絶対値で負の傾きを持つ直線と、点A及び点Cを通り且つ上記傾きの絶対値で正の傾きを持つ直線とが、形成される。これら2つの直線の交点Dを求めることにより、1画素未満の間隔のサブピクセル精度で、視差値が求められる。例えば、図2Bの例では、視差値は1.8である。   For example, FIGS. 2A and 2B illustrate the conformal fitting method disclosed in Patent Document 1. In FIG. 2A, the relationship between the correlation sum value and the disparity value is shown, and the correlation sum value is the minimum value Y2 at disparity value 2. In this case, in addition to the point A where the correlation sum is the minimum value Y2 and the parallax value is 2, the point B with the parallax value 1 and the correlation sum Y1 and the point C with the parallax value 3 and the correlation sum Y3 Used. Furthermore, as shown in FIG. 2B, a V-shaped function passing through these three points is fitted. At this time, the absolute values of the slopes of the two lines of the V-shaped function are the absolute value of the slope of the difference of the correlation sum with respect to the difference of the parallax value between the points A and B, and the points A and C And the absolute value of the slope of the difference of the correlation sum with respect to the difference of the disparity value, whichever is larger. Specifically, in FIG. 2A, the absolute value of the difference (Y3-Y2) of the correlation total value, which is the slope between point A and point C, is the slope between point A and point B. It is larger than the absolute value of the difference (Y2-Y1) of the correlation sum. Therefore, the absolute value of (Y3-Y2) is adopted as the slope of the V-shaped function. In a V-shaped function, the absolute value of the slope of the line on either side of the V-shaped vertex is the same. That is, the angles 1 and 2 of the line on both sides and the horizontal line are the same. Thus, a straight line passing through the point B and having a negative slope as the absolute value of the slope, and a straight line passing through the points A and C and having a positive slope as the absolute value of the slope are formed. By obtaining the intersection point D of these two straight lines, the parallax value can be obtained with sub-pixel accuracy of an interval of less than one pixel. For example, in the example of FIG. 2B, the disparity value is 1.8.

図1における視差イメージ290の決定は、3つのオプションの信頼/エラー検出検査、すなわち、対象演算、左右一貫性検査、及びモードフィルタを含み得る。対象演算は、輝度イメージが高レベル信頼に関連しているかを、キャプチャされた光景の模様(テクスチャ)に基づいて決定する。これにより、均一な模様(テクスチャ)である光景のイメージ要素に関連している対象演算は、模様(テクスチャ)が変化している光景よりも、低い信頼を有する。対象演算は、輝度イメージの一つのみ、左側或いは右側の輝度イメージのいずれかのみに、適用される。しかしながら、他の態様では、両輝度イメージに適用される対象演算がカバーされ得る。図1では、対象演算235は、矢印236によって示されるように、右輝度イメージ2に適用され、対象ウインドウの内部の各イメージ要素について、矢印237で示されるように、合計のスライディング視差(SSD)アレイ240を生成する。閾値演算241の適用によって、最終対象結果アレイ250が対象結果として生成される。対象結果は、特定のイメージ要素がこのイメージ処理システムの中に確立された信頼閾値をパスするかどうかを反映するデータを含む。対象結果アレイ250の中のデータに基づいて、視差イメージ290は、外部インデックスアレイ270に関連して決定され得る。   The determination of disparity image 290 in FIG. 1 may include three optional confidence / error detection tests: object operation, left / right consistency check, and mode filter. The subject operation determines if the luminance image is associated with high level confidence based on the texture of the captured scene. In this way, object operations associated with image elements of the scene that are uniform patterns (textures) have lower confidence than scenes in which the textures are changing. The object operation is applied to only one of the luminance images, or to either the left or right luminance image. However, in other aspects, object operations applied to both intensity images may be covered. In FIG. 1, the subject operation 235 is applied to the right intensity image 2 as indicated by arrow 236, and for each image element inside the object window, as shown by arrow 237, total sliding disparity (SSD) An array 240 is generated. Application of the threshold operation 241 generates a final target result array 250 as a target result. The subject result includes data that reflects whether a particular image element passes the confidence threshold established in the image processing system. Based on the data in the target result array 250, a parallax image 290 may be determined in relation to the external index array 270.

左右一貫性検査は、エラー検出の形態である。この検査は、右イメージの中のイメージ要素によって最適イメージ要素として選択された左イメージの中のイメージ要素が、最適イメージ要素として、右イメージの中の同じイメージ要素をまた選択する事を、決定且つ確認する。左右一貫性検査245は、矢印246によって示されるように、相関合計アレイ230に適用され、矢印276で示されるように、外部インデックスアレイ270と比較され、矢印247によって示されるように、LR結果アレイ260を生成する。LR結果アレイ260は、左右一貫性検査245をパスするイメージ要素を示すデータを含む。LR結果アレイ260は、外部インデックスアレイ270と協同して、矢印261によって示されるように、視差イメージ290を生成するために使用される。   Left-right consistency check is a form of error detection. This examination determines that the image element in the left image selected as the optimal image element by the image element in the right image also selects the same image element in the right image as the optimal image element and Check. Left-right consistency check 245 is applied to correlation sum array 230, as indicated by arrow 246, compared to external index array 270, as indicated by arrow 276, and LR result array, as indicated by arrow 247. Generate 260. The LR result array 260 includes data indicating image elements that pass the left-right consistency check 245. The LR result array 260 is used to generate a parallax image 290, as indicated by the arrow 261 in cooperation with the external index array 270.

第3の信頼/エラー検出検査は、モードフィルタである。モードフィルタは、個体群解析に基づいて最適視差を選択することによって、選択された最適視差が高度の一貫性を有するかどうかを決定する。これにより、外部インデックスアレイ270の中の選択された最適視差が、高度の一貫性を示さないならば、その後これらの最適視差は無効にされる。モードフィルタ275は、矢印276に示されるように、外部インデックスアレイ270に動作し、矢印277に示されるように、モードフィルタ外部インデックス(「指標」とも呼ばれる)アレイ280を生成する。モードフィルタ外部インデックスアレイ280は、特定のイメージ要素が視差の一貫性検査をパスした視差を選択したかどうかを示すデータを含む。データ及びモードフィルタ外部インデックスアレイ280は、矢印281に示されるように、外部インデックスアレイ270と協同して視差イメージ290を生成するために使用され得る。   The third confidence / error detection test is a mode filter. The mode filter determines whether the selected optimal disparity has a high degree of consistency by selecting the optimal disparity based on population analysis. Thereby, if the selected optimal disparities in the external index array 270 do not show a high degree of consistency, then these optimal disparities are invalidated. Mode filter 275 operates on external index array 270, as indicated by arrow 276, and generates mode filter external index (also referred to as "index") array 280, as indicated by arrow 277. The mode filter external index array 280 includes data indicating whether a particular image element has selected a disparity that has passed the disparity consistency check. Data and mode filter external index array 280 may be used to cooperate with external index array 270 to generate disparity image 290, as indicated by arrow 281.

これらの3つの信頼/エラー検出検査を行うかどうかは選択可能である。ある態様では、視差イメージ290の決定に当たってこれらの3つの検査の全てを行い得るが、他の態様では、これらの検査を全く含まなくてもよい。更に他の態様では、これらの検査の組合せが含まれ得る。   Whether to perform these three confidence / error detection checks is optional. In one aspect, all three of these tests may be performed in determining the parallax image 290, but in other aspects these tests may not be included at all. In yet another aspect, a combination of these tests may be included.

例えば、特許文献1に記載されるような従来技術の視差値算出処理は、図3に示すように模式的に示すことができる。なお、図3は、従来技術の視差値算出処理の流れを模式的に示す図である。ステレオ画像である入力画像I1及びI2ではそれぞれ、ステップS1501において、各画素が、センサス変換され、各センサス特徴量が求められる。さらに、ステップS1502では、入力画像I1及びI2の間において、画素間の視差値についてのセンサス特徴量の相関(「相違度」とも呼ばれる)が、入力画像I1及びI2の各画素について視差値毎に算出される。ここでは、ハミング距離によりセンサス特徴量間の相違度算出を行う。   For example, the parallax value calculation process of the prior art as described in Patent Document 1 can be schematically shown as shown in FIG. FIG. 3 is a diagram schematically showing the flow of disparity value calculation processing according to the prior art. In the input images I1 and I2 that are stereo images, each pixel is subjected to census conversion in step S1501, and census feature values are obtained. Furthermore, in step S1502, the correlation of census feature values for parallax values between pixels (also referred to as “difference degree”) between the input images I1 and I2 is calculated for each pixel of the input images I1 and I2. It is calculated. Here, the degree of difference between census feature quantities is calculated by the Hamming distance.

ステップS1503a及びS1503bではそれぞれ、入力画像I1及びI2のうちの一方の画像である基準画像の各画素について、他方の画像における予め設定された探索範囲内の各画素の視差値及び相違度(すなわちハミング距離)から、最小の相違度を与える視差値が選択される。これにより、基準画像の各画素におけるピクセル精度の視差値が得られる。ステップS1503aでは、入力画像I1を基準画像として、ステップS1503bでは、入力画像I2を基準画像として、それぞれにおいて上記処理が行われる。   In steps S1503a and S1503b, for each pixel of the reference image which is one of the input images I1 and I2, respectively, the parallax value and the degree of difference of each pixel within the preset search range in the other image (ie Hamming From the distance), the parallax value giving the smallest difference is selected. Thereby, the parallax value of the pixel precision in each pixel of a reference | standard image is obtained. In step S1503a, the above process is performed on the input image I1 as a reference image, and in step S1503b on the input image I2 as a reference image.

ステップS1504a及びS1504bではそれぞれ、図2A及び図2Bを用いて説明したような等角フィッティング法により、基準画像I1及び基準画像I2それぞれにおける各画素でのサブピクセル精度の視差値が算出される。具体的には、基準画像の各画素について、最小相違度及びそれを与える視差値と、当該視差値の前後の視差値及びその相違度とを用いて、サブピクセル精度の視差値が算出される。ステップS1505では、基準画像I1の場合の視差値と、基準画像I2の場合の視差値とについて、対応する画素間での一貫性がチェックされる。具体的には、基準画像I1及び基準画像I2の対応する画素間で、双方向の視差値の差が所定の閾値未満であるかがチェックされる。さらに、閾値以上の差を構成する視差値は無効とされ、当該視差値に対応する画素についての視差推定結果は、出力されない。   In steps S1504a and S1504b, the parallax values of the subpixel accuracy at each pixel in each of the reference image I1 and the reference image I2 are calculated by the equiangular fitting method as described with reference to FIGS. 2A and 2B. Specifically, for each pixel of the reference image, the disparity value with sub-pixel accuracy is calculated using the minimum difference degree, the disparity value giving it, and the disparity values before and after the disparity value and the difference degree thereof. . In step S1505, the consistency between corresponding pixels is checked for the parallax value in the case of the reference image I1 and the parallax value in the case of the reference image I2. Specifically, it is checked whether the difference between the parallax values in both directions between the corresponding pixels of the reference image I1 and the reference image I2 is less than a predetermined threshold. Furthermore, the parallax value which comprises the difference more than a threshold value is invalidated, and the parallax estimation result about the pixel corresponding to the said parallax value is not output.

また、非特許文献1に記載されるようなSemi−Global Maching(以下、「SGM」とも呼ぶ)と呼ばれる視差値算出処理は、図4に示すように模式的に示すことができる。なお、図4は、従来技術のSemi−Global Maching処理の流れを模式的に示す図である。ステップS1601において、入力画像I1及びI2と初期視差画像とが縮小される。初期視差画像は、予め設定された画像であり、各画素は、当該画素における2つの画像間の視差値を画素値として有する。画像の縮小では、画素数が減少される。ステップS1602において、入力画像I1及びI2間の各画素について、視差値毎に相違度が算出される。ステップS1602では、入力画像I1及びI2間の相違度の算出に、相互情報量又は特許文献1と同様のセンサス特徴量を用いたセンサス特徴量間の相違度(ハミング距離)を用いることができる。ステップS1603では、基準画像中の着目画素それぞれについて、着目画素を通る、つまり中心とする8又は16方向の直線上での視差値の分布に対するコストが算出される。ステップS1604では、着目画素を通る8又は16方向の直線上での視差の分布に対するコストに関して、各方向について最小のコストを与える視差値が選択される。つまり、コストが集約される。   Also, disparity value calculation processing called Semi-Global Maching (hereinafter also referred to as “SGM”) as described in Non-Patent Document 1 can be schematically shown as shown in FIG. In addition, FIG. 4 is a figure which shows typically the flow of the Semi-Global Machining process of a prior art. In step S1601, the input images I1 and I2 and the initial parallax image are reduced. The initial parallax image is an image set in advance, and each pixel has a parallax value between two images in the pixel as a pixel value. In image reduction, the number of pixels is reduced. In step S1602, the degree of difference is calculated for each parallax value for each pixel between the input images I1 and I2. In step S1602, the degree of difference (Hamming distance) between census feature amounts using mutual information or the same census feature amount as in Patent Document 1 can be used to calculate the degree of difference between input images I1 and I2. In step S1603, the cost for the distribution of disparity values on a straight line in the eight or sixteen directions passing through the pixel of interest, that is, the center, is calculated for each pixel of interest in the reference image. In step S1604, with respect to the cost of distribution of parallax on a straight line in 8 or 16 directions passing through the pixel of interest, a parallax value that provides the minimum cost in each direction is selected. In other words, costs are consolidated.

ステップS1605a及びS1605bでは、各方向について最小のコストを与える視差値のうちから、最小のコストを与える方向の視差値が選択される。その際、ステップS1605aでは、入力画像I1を基準画像とする視差値が選択され、ステップS1605bでは、入力画像I2を基準画像とする視差値が選択される。ステップS1606では、入力画像I1を基準画像とする視差値と入力画像I2を基準画像とする視差値との一貫性がチェックされる。ステップS1607では、ステップS1606において一貫性チェックが行われた視差値を各画素が画素値として含む視差画像が、拡大される。この拡大では、視差画像に対する空間的な拡大により画素数を増加させる処理と、空間的な拡大に伴って視差値(視差画像の画素値)を大きくする処理との両方が行われる。例えば、空間的な拡大率が2倍の場合、視差値も2倍に変換される。ステップS1608では、ステップS1601〜S1607の処理を繰り返すか否かの終了判断が行われる。   In steps S1605a and S1605b, among the parallax values that provide the minimum cost in each direction, the parallax value in the direction that provides the minimum cost is selected. At this time, in step S1605a, a parallax value using the input image I1 as a reference image is selected, and in step S1605b, a parallax value using the input image I2 as a reference image is selected. In step S1606, the consistency between the parallax value with the input image I1 as the reference image and the parallax value with the input image I2 as the reference image is checked. In step S1607, the parallax image in which each pixel has the parallax value subjected to the consistency check in step S1606 as a pixel value is enlarged. In this enlargement, both a process of increasing the number of pixels by spatial enlargement of the parallax image and a process of increasing the parallax value (pixel value of parallax image) along with the spatial enlargement are performed. For example, when the spatial magnification is doubled, the parallax value is also converted to double. In step S1608, it is determined whether or not to repeat the processing of steps S1601 to S1607.

図4において、一例として4段階の繰り返し処理が行われる場合、入力画像I1及びI2に対して、1回目の処理では8分の1に縮小されたスケールで、ステップS1601〜S1608の視差値算出処理がされ、さらに、2回目の処理では4分の1に縮小されたスケールで、3回目の処理では2分の1に縮小されたスケールで、4回目の処理では等倍のスケールで視差値算出処理がされる。そのため、ステップS1608では、繰り返し数が4回目未満の場合、処理が継続され、繰り返し数が4回目の場合、処理が終了する。   In FIG. 4, when four-step repetitive processing is performed as an example, the parallax value calculation processing of steps S1601 to S1608 with a scale reduced to 1⁄8 in the first processing with respect to the input images I1 and I2 Is calculated, and the parallax value is calculated with a scale reduced by a factor of 4 in the second process, by a scale reduced by a factor of 2 in the third process, and in the same magnification scale in the fourth process. It is processed. Therefore, in step S1608, if the number of repetitions is less than four, the process is continued, and if the number of repetitions is four, the process ends.

SGM及び特許文献1の視差値算出処理の間には、以下のような差異がある。特許文献1では、視差値の探索が局所的な処理(ローカルな処理)で行われており、視差値算出時に、着目画素における視差値とその周囲の画素における視差値との関係について考慮されていない。SGMでは、コスト算出の際、視差値の空間的な変化に対してペナルティを与えることにより、着目画素における視差値がその周囲の画素の視差値と同様の値を取りやすくされている。特許文献1では、視差画像において、ストリーキングアーチファクト(Streaking Artifact)、つまり、エッジ、境界等のライン間で視差値が異なることによる筋状のアーチファクトが生じ得るが、SGMでは、ストリーキングアーチファクトを低減することができる。   The following differences exist between the SGM and the parallax value calculation process of Patent Document 1. In Patent Document 1, the parallax value search is performed in a local process (local process), and at the time of parallax value calculation, the relationship between the parallax value in the pixel of interest and the parallax values in surrounding pixels is considered. Absent. In SGM, when a cost is calculated, a penalty is given to the spatial change of the parallax value, so that the parallax value in the pixel of interest easily takes the same value as the parallax value of the pixels around it. According to Patent Document 1, streaking artifacts may be generated in parallax images, that is, streak-like artifacts due to differences in parallax values between lines such as edges and boundaries, but SGM reduces streaking artifacts. Can.

しかしながら、特許文献1及び非特許文献1の従来の視差値算出処理では、相違度(つまり、ハミング距離)、又は相違度に基づくコストが最小となる整数画素精度の視差値付近において、具体的には、当該視差値の前後の視差値(当該視差値±1画素の視差値)に対応する相違度又はコストを用いてサブピクセル精度の視差値を算出する場合、得られる視差値の精度が低い、つまり誤差が大きいという問題がある。   However, in the conventional parallax value calculation processing of Patent Document 1 and Non-patent Document 1, the degree of difference (that is, the Hamming distance), or the cost based on the degree of difference is specifically around the parallax value of integer pixel accuracy at which the cost is minimum. The accuracy of the obtained parallax value is low when the parallax value of the sub-pixel accuracy is calculated using the difference degree or the cost corresponding to the parallax values before and after the parallax value (the parallax value ± 1 pixel parallax value) That is, there is a problem that the error is large.

本発明者らは、上記問題の発生原因を、以下のように考えた。SAD(Sum of Absolute Difference:輝度値の差の絶対値の合計)及びSSD(Sum of Squared Difference:輝度値の差の2乗の合計)等の輝度差で定義されるコスト関数による視差値算出では、コスト関数の整数画素精度での最小値付近で等角フィッティング又はパラボラフィッティングすることでサブピクセル精度の視差値が算出できることが知られている。このことは、輝度差で定義されるコスト関数の空間的な分布が、その最小値付近で1次式又は2次式でよく近似できることを利用している。このことは、例えば8ビットの画素値の分布を連続量とみなせば、2つの画像の対応点間の画素値の差も連続量とみなせ、±0.5画素程度の区間であれば、低次のテーラー展開でよく近似できるということを意味する。   The inventors considered the cause of the occurrence of the above problem as follows. In the parallax value calculation by the cost function defined by luminance difference such as SAD (Sum of Absolute Difference: sum of absolute value of difference of luminance value) and SSD (Sum of Squared Difference: sum of square of difference of luminance value) It is known that disparity values with sub-pixel accuracy can be calculated by performing equiangular fitting or parabola fitting around the minimum value of the cost function at integer pixel accuracy. This utilizes the fact that the spatial distribution of the cost function defined by the luminance difference can be well approximated by a linear or quadratic equation near its minimum value. This means that if, for example, the distribution of pixel values of 8 bits is regarded as a continuous amount, the difference between pixel values between corresponding points of two images can also be regarded as a continuous amount. It means that it can be well approximated by the following Taylor expansion.

一方、センサス特徴量間のハミング距離は、着目画素とその周辺画素との間の明るさの大小関係をビット列化したものの差である。このようなハミング距離の最小値付近において、サブピクセル程度の位置変動に対して、ハミング距離が、リニア、つまり直線的に又は2次曲線的に振舞う保証はない。言い換えると、1画素間隔でのハミング距離の変動、すなわち明るさの大小関係の逆転が1画素間隔内で起きる位置は、規則性がないと考えるのが妥当である。このような規則性のない現象については、センサス変換における着目画素の周辺画素である参照画素を増やせば、大数の法則が効くため、滑らかな性質になることが期待される。しかしながら、センサス変換で参照する例えば8画素又は64画素程度の参照画素数では、サブピクセル精度の視差値の算出精度を確保するのに十分なサンプル数になっていないと考えられる。さらに、ハミング距離の最小値付近では、8ビット又は64ビットのビット列中の数ビットしか相違ビットがなく、ハミング距離の最小値付近は、大数の法則が最も効きにくいケースに該当する。   On the other hand, the Hamming distance between census feature quantities is the difference between the magnitude relation of the brightness between the pixel of interest and its peripheral pixels, which is formed into a bit string. In the vicinity of such a minimum value of the Hamming distance, there is no guarantee that the Hamming distance behaves linearly, that is, linearly or quadratically with respect to positional variation of the order of sub-pixels. In other words, it is appropriate to consider that there is no regularity in the variation of the Hamming distance at one pixel intervals, that is, the position where the reversal of the magnitude relation of brightness occurs within one pixel interval. As for the phenomenon without such regularity, if the number of reference pixels that are peripheral pixels of the pixel of interest in the census conversion is increased, the large number law will be effective, and it is expected that the property will be smooth. However, it is considered that the number of reference pixels of, for example, about 8 pixels or 64 pixels to be referred to in the census conversion is not sufficient for securing the calculation accuracy of the parallax value of the sub-pixel accuracy. Furthermore, in the vicinity of the minimum value of the Hamming distance, only a few bits in the 8-bit or 64-bit bit string have different bits, and in the vicinity of the minimum value of the Hamming distance, the large number law is the least effective.

本発明者らは、図5〜図13に示すように、実際に視差値を算出することによって、非特許文献1に記載されるようなSGMを用いた視差値算出処理を検証した。図5は、検証に使用したCG(Computer Graphic)画像であり、図7、図9及び図11は、検証に使用した実写画像である。図6は、図5のCG画像と、このCG画素を水平方向に平行移動した画像とを用いたSGMによる視差値の算出結果を示す。図8は、図7の実写画像と、この実写画素を水平方向に平行移動した画像とを用いたSGMによる視差値の算出結果を示す。図10は、図9の実写画像と、この実写画素を水平方向に平行移動した画像とを用いたSGMによる視差値の算出結果を示す。図12は、図11の実写画像と、この実写画素を水平方向に平行移動した画像とを用いたSGMによる視差値の算出結果を示す。   The present inventors verified disparity value calculation processing using SGM as described in Non-Patent Document 1 by actually calculating disparity values as shown in FIGS. 5 to 13. FIG. 5 shows a CG (Computer Graphic) image used for verification, and FIGS. 7, 9 and 11 show a photographed image used for verification. FIG. 6 shows the calculation result of the parallax value by SGM using the CG image of FIG. 5 and an image obtained by translating the CG pixels in the horizontal direction. FIG. 8 shows the calculation result of the parallax value by SGM using the photographed image of FIG. 7 and the image obtained by translating the photographed pixels in the horizontal direction. FIG. 10 shows the calculation result of the parallax value by SGM using the photographed image of FIG. 9 and an image obtained by translating the photographed pixels in the horizontal direction. FIG. 12 shows the calculation result of the parallax value by SGM using the photographed image of FIG. 11 and the image obtained by translating the photographed pixels in the horizontal direction.

各画像について、12ケース又は16ケースの水平方向の平行移動が行われ、その内訳は、1.0画素から1.5画素までの0.1画素間隔での移動量による6つケース、又は1.0画素から1.9画素までの0.1画素間隔での移動量による10のケースと、5.0画素から5.5画素までの0.1画素間隔での移動量による6つケースとである。平行移動後の画像である参照画像は、上記移動量での移動後の画像の画素を補間処理することにより、移動の前後で画素座標が対応するように生成した。画素座標は、画像上における2次元座標であり、画像の画素を単位とする座標である。そして、移動前の画像を基準画像として、基準画像と参照画像とから、基準画像の各画素に対応する参照画像の画素の視差値を算出した。例えば、算出視差値が「+1.0」画素又は「−1.0」画素である場合、画素座標で基準画像の画素と同じ位置にある参照画像の画素から、水平方向に、具体的には画素座標のx軸正方向又はx軸負方向に1画素移動した位置の画素は、基準画像の当該画素と同じ被写体を写し出す。   For each image, 12 cases or 16 cases of horizontal translation are performed, and the breakdown is 6 cases by the amount of movement at 0.1 pixel intervals from 1.0 pixel to 1.5 pixels, or 1 .10 cases by the movement amount at 0.1 pixel intervals from 0 pixels to 1.9 pixels, and 6 cases by the movement amount at 0.1 pixel intervals from 5.0 pixels to 5.5 pixels It is. The reference image, which is an image after parallel movement, is generated so that the pixel coordinates correspond to each other before and after movement by interpolating the pixels of the image after movement by the movement amount. The pixel coordinates are two-dimensional coordinates on the image, and are coordinates in units of pixels of the image. Then, the parallax value of the pixels of the reference image corresponding to each pixel of the reference image is calculated from the reference image and the reference image using the image before movement as the reference image. For example, when the calculated parallax value is "+1.0" pixel or "-1.0" pixel, specifically from the pixel of the reference image at the same position as the pixel of the reference image in pixel coordinates in the horizontal direction. The pixel at the position moved by one pixel in the x-axis positive direction or the x-axis negative direction of the pixel coordinates shows the same subject as the pixel of the reference image.

上記の視差値の算出では、上述したように、基準画像の各画素について、SGMで整数精度での視差値における相違度の算出後、最小の相違度を与える画素の視差値と、当該画素の±1画素隣の画素における視差値及び相違度とを用いて、等角フィッティング法によりサブピクセル精度で視差値が算出される。なお、ハミング距離で整数精度での視差値における相違度の算出後、相違度の最小値付近での等角フィッティング法によりサブピクセル精度での視差値の算出を行った場合にも、同様の結果になることは容易に類推できる。   In the above-described calculation of the parallax value, as described above, after the calculation of the degree of difference in parallax values with integer accuracy in SGM for each pixel of the reference image, the parallax value of the pixel giving the minimum degree of difference The parallax value is calculated with sub-pixel accuracy by the conformal fitting method using the parallax value and the dissimilarity at pixels adjacent to ± 1 pixel. In addition, the same result is obtained even when the parallax value is calculated with sub-pixel accuracy by the equiangular fitting method near the minimum value of the difference degree after the calculation of the difference degree with the parallax value with integer precision with Hamming distance. It can be easily analogized to become.

図6、図8、図10及び図12それぞれにおいて、左列は、上記の水平方向の移動量である正解視差値を示し、中列は、左列の移動量から各画素の算出視差値を減じた差の平均値(「mean」とも呼ぶ)を示し、右列は、左列の移動量から各画素の算出視差値を減じた差の2乗平均平方根(「RMS(Root mean square)」とも呼ぶ)を示す。これらの図から、正解視差値が、「1.0」及び「5.0」の整数画素単位の場合と比べて、正解視差値が上記以外のサブピクセル単位の場合の方が、視差値の推定誤差が大きくなる傾向であることがわかる。   In each of FIG. 6, FIG. 8, FIG. 10 and FIG. 12, the left column shows the correct parallax value which is the above horizontal movement amount, and the middle column shows the calculated parallax value of each pixel from the left column movement amount. The mean value (also referred to as "mean") of the difference is shown, and the right column is the root mean square ("RMS (Root mean square)" difference between the movement amount of the left column and the calculated parallax value of each pixel Also referred to as From these figures, compared with the case where the correct parallax value is in the integer pixel unit of “1.0” and “5.0”, the correct parallax value in the case of sub-pixel units other than the above is the parallax value of It can be seen that the estimation error tends to be large.

なお、整数画素単位の視差値の算出精度が高く、サブピクセル単位の視差値の誤差がランダムな誤差となる場合、整数画素精度の視差値の算出のみを行い、サブピクセル単位の視差値の算出を行わないと仮定する。この場合、正解視差値と算出視差値との関係は、図13に示すように仮定することができる。つまり、サブピクセル単位の視差値は、図13の斜線でハッチングした領域に含まれ、サブピクセル単位の視差値の誤差の分布は、±0.5画素の範囲で一様となると仮定することができる。この場合、サブピクセル単位の視差値の誤差のRMS値は、下記の式1により求まる。   In addition, when the calculation accuracy of the parallax value in the integer pixel unit is high and the error of the parallax value in the sub pixel unit becomes a random error, only the parallax value of the integer pixel accuracy is calculated and the parallax value in the sub pixel unit is calculated. Suppose you do not. In this case, the relationship between the correct parallax value and the calculated parallax value can be assumed as shown in FIG. That is, it is assumed that the disparity value in the sub-pixel unit is included in the hatched area in FIG. 13 hatched, and the distribution of the error in the disparity value in the sub-pixel unit becomes uniform within ± 0.5 pixel range it can. In this case, the RMS value of the disparity value error in units of sub-pixels can be obtained by the following equation 1.

一方、図6において、図5のCG画像について、全ての視差値の誤差のRMS値(全誤差RMS値とも称し、具体的には、1.0から1.9と5.0から5.9までの区間を0.1画素間隔で誤差評価した場合のRMS値である。ここで、1.6から1.9までと5.6から5.9までのRMS値については、1.1から1.4までと5.1から5.4までについてのRMS値を、1.5と5.5に対して折り返す形で用いている。)は、上記式1に示した整数画素精度での視差値算出時の誤差のRMS値を超えている。また、図8、図10及び図12において、実写画像についての全ての視差値の誤差のRMS値は、上記式1に示した誤差のRMS値を下回ってはいるが、いずれのRMS値も、定性的には正解視差値が整数値から離れるにつれて増加しており、サブピクセル精度での視差値の算出が行われていないことを示す。   On the other hand, in FIG. 6, for the CG image of FIG. 5, the RMS value of the error of all parallax values (also referred to as the total error RMS value, specifically, 1.0 to 1.9 and 5.0 to 5.9). The RMS value in the case of the error evaluation at intervals of 0.1 pixel, where the interval from 1.6 to 1.9 and 5.6 to 5.9 is 1.1 to 1. RMS values for up to 1.4 and 5.1 to 5.4 are used in a folded form for 1.5 and 5.5)) with the integer pixel precision shown in equation 1 above. The RMS value of the error at the time of parallax value calculation is exceeded. Further, in FIGS. 8, 10 and 12, although the RMS value of the error of all parallax values for the photographed image is less than the RMS value of the error shown in the above equation 1, any RMS value is Qualitatively, the correct disparity value increases as it deviates from the integer value, indicating that the disparity value is not calculated with sub-pixel accuracy.

本発明者らは、上述のような特許文献1及び非特許文献1に記載されるような従来技術の問題点を検討した結果、複数の画像間のサブピクセル精度の視差値の算出精度を向上するために、以下のような技術を創案した。   As a result of examining the problems of the prior art as described in Patent Document 1 and Non-patent Document 1 as described above, the present inventors have improved the calculation accuracy of the parallax value of the subpixel accuracy between a plurality of images. In order to do this, the following technologies were devised.

本開示の一態様に係る視差値算出装置は、プロセッサとメモリとを備え、前記プロセッサは、(a)第1の位置に配置された第1のカメラで撮像された第1の画像と、第2の位置に配置された第2のカメラで撮像された第2の画像とを前記メモリから取得し、(b)前記第1の画像に対して、予め定められた視差方向への拡大処理により、前記第1の画像の画素の数を増やすことによって、複数の第1の画素を含む第1の拡大画像を生成し、前記第2の画像に対して、予め定められた視差方向への拡大処理により、前記第2の画像の画素の数を増やすことによって、複数の第2の画素を含む第2の拡大画像を生成し、(c)前記第1の拡大画像において、前記複数の第1の画素毎に、周囲の画素との画素値の比較により、第1のセンサス特徴量を算出し、前記第2の拡大画像において、前記複数の第2の画素毎に、周囲の画素との画素値の比較により、第2のセンサス特徴量を算出し、(d)前記複数の第1の画素それぞれについて、前記第1のセンサス特徴量と、少なくとも1つの前記第2の画素の前記第2のセンサス特徴量とを用いて、前記少なくとも1つの第2の画素それぞれの位置での前記第1の画素に対する視差値に対応する相違度を算出し、(e)前記複数の第1の画素それぞれについて、前記相違度を用いて、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得し、(f)前記視差画像の画素毎の視差値に対して、縮小処理をすることにより、前記第2の画像に対する前記第1の画像の画素毎の視差値を算出する。   A parallax value calculation device according to an aspect of the present disclosure includes a processor and a memory, the processor including: (a) a first image captured by a first camera disposed at a first position; The second image captured by the second camera arranged at position 2 is acquired from the memory, and (b) the first image is enlarged by a predetermined parallax direction. Generating a first enlarged image including a plurality of first pixels by increasing the number of pixels of the first image, and enlarging the second image in a predetermined parallax direction Processing to generate a second magnified image including a plurality of second pixels by increasing the number of pixels of the second image; and (c) in the first magnified image, the plurality of first images. The first census feature by comparing pixel values with surrounding pixels for each pixel of And calculating a second census feature value by comparing pixel values with surrounding pixels for each of the plurality of second pixels in the second enlarged image, and (d) calculating the plurality of second plurality of The first census feature amount and the second census feature amount of the at least one second pixel are used for each of the one pixel, and the at the position of each of the at least one second pixel Calculating the degree of difference corresponding to the parallax value for the first pixel, and (e) selecting the parallax value corresponding to the smallest degree of difference using the degree of difference for each of the plurality of first pixels Acquiring a parallax value for each pixel in the parallax image corresponding to the first enlarged image, and (f) performing a reduction process on the parallax value for each pixel of the parallax image to obtain the second image Of the first image against To calculate the disparity value of Motogoto.

上記態様によれば、視差値算出装置は、第1の拡大画像及び第2の拡大画像を用いて、第1の拡大画像の各画素に対応する視差画像の各画素の視差値を算出する。さらに、視差値算出装置は、視差画像の視差値を縮小処理することによって、第2の画像に対する第1の画像の画素毎の視差値を算出する。上述のような視差値は、1画素未満の精度、つまりサブピクセル精度であり得る。例えば、視差画像の視差値が、整数精度であっても、このような視差値が縮小されることによって、サブピクセル精度となり得る。また、第1の拡大画像及び第2の拡大画像は、同じ方向に拡大された画像であるため、縮小処理による視差値の算出は簡易である。よって、視差値算出装置は、複数の画像間の視差値を高い精度で簡易に算出することができる。   According to the above aspect, the parallax value calculation device calculates the parallax value of each pixel of the parallax image corresponding to each pixel of the first enlarged image, using the first enlarged image and the second enlarged image. Furthermore, the parallax value calculation device calculates the parallax value for each pixel of the first image with respect to the second image by performing a reduction process on the parallax value of the parallax image. The disparity values as described above may be less than one pixel accurate, ie sub-pixel accurate. For example, even if the parallax value of the parallax image has integer precision, the sub-pixel precision can be obtained by reducing such a parallax value. Further, since the first enlarged image and the second enlarged image are images enlarged in the same direction, the calculation of the parallax value by the reduction process is simple. Therefore, the disparity value calculating device can easily calculate the disparity value between a plurality of images with high accuracy.

本開示の一態様に係る視差値算出装置において、前記プロセッサは、前記第1のセンサス特徴量と前記第2のセンサス特徴量との間のハミング距離を、前記相違度として算出してもよい。   In the parallax value calculation device according to an aspect of the present disclosure, the processor may calculate a Hamming distance between the first census feature amount and the second census feature amount as the degree of difference.

上記態様によれば、センサス特徴量間のハミング距離を用いた相違度の算出は、簡易である。よって、視差値算出装置は、相違度を簡易に算出することができる。   According to the above aspect, the calculation of the degree of difference using the Hamming distance between census feature quantities is simple. Therefore, the disparity value calculating device can easily calculate the degree of difference.

本開示の一態様に係る視差値算出装置において、前記プロセッサは、処理(d)と処理(e)の間において、(g)前記第1の拡大画像において、視差値の算出対象の前記第1の画素である着目画素から、所定の方向に位置する前記第1の画素である評価画素それぞれについて、前記評価画素のうち、第1の評価画素に前記所定の方向で隣り合う第2の評価画素の視差値と、前記第2の拡大画像における前記第1の評価画素に対応する位置の対応画素に対する、相違度算出のための探索範囲内の前記第2の画素それぞれの視差値との比較に基づき、前記探索範囲内の前記第2の画素それぞれの第1の評価値を算出し、前記第1の評価画素と前記探索範囲内の前記第2の画素それぞれとの間の相違度と、前記探索範囲内の前記第2の画素それぞれの第1の評価値とに基づき、前記探索範囲内の前記第2の画素それぞれの視差値についての第2の評価値を算出し、前記探索範囲内の前記第2の画素それぞれの視差値に対応する全ての前記評価画素の前記第2の評価値を加算して、加算評価値を算出し、処理(e)において、最小の前記加算評価値に対応する前記視差値を前記着目画素の視差値に決定してもよい。   In the parallax value calculation device according to an aspect of the present disclosure, the processor may be configured to: (g) the first calculation target of the parallax value calculation in the first enlarged image between the processing (d) and the processing (e). For each of the evaluation pixels which are the first pixels located in a predetermined direction from the pixel of interest which is a pixel of the second evaluation pixel adjacent to the first evaluation pixel in the predetermined direction among the evaluation pixels For the parallax value of each of the second pixels in the search range for calculating the degree of difference with respect to the corresponding pixel at the position corresponding to the first evaluation pixel in the second enlarged image. A first evaluation value of each of the second pixels in the search range is calculated based on the difference degree between the first evaluation pixel and each of the second pixels in the search range, Each of the second pixels in the search range And calculating a second evaluation value for the parallax value of each of the second pixels in the search range, based on the first evaluation value of the first and second parallax values for each of the second pixels in the search range. The second evaluation value of all corresponding evaluation pixels is added to calculate an addition evaluation value, and in processing (e), the parallax value corresponding to the minimum addition evaluation value is used as the parallax of the pixel of interest You may decide on the value.

上記態様によれば、第2の評価値は、着目画素の周囲の画素の視差値の変化を相違度に反映した指標である。視差値算出装置は、第2の評価値の和を最小にするような視差値を着目画素の視差値に決定するため、着目画素における視差値がその周囲の画素の視差値と同様の値を取りやすくなる。よって、視差値算出装置は、被写体のエッジ、境界等のライン間で視差値が異なることによる筋状のアーチファクトが生じるストリーキングアーチファクトを低減し、高い精度で視差値を算出することができる。   According to the above aspect, the second evaluation value is an index that reflects the change in the parallax value of the pixels around the pixel of interest in the degree of difference. Since the parallax value calculation device determines the parallax value that minimizes the sum of the second evaluation values as the parallax value of the pixel of interest, the parallax value of the pixel of interest is the same value as the parallax value of the pixels around it. It becomes easy to take. Therefore, the parallax value calculation apparatus can calculate the parallax value with high accuracy by reducing the streaking artifact in which the streak-like artifact is generated due to the parallax value being different between the lines such as the edge of the subject and the boundary.

本開示の一態様に係る視差値算出装置において、前記プロセッサは、処理(c)において、対象画素のセンサス特徴量を算出する際に比較する周囲の画素の領域である比較領域として、前記対象画素を含み且つ前記対象画素に対する位置が異なる複数の前記比較領域を決定し、前記比較領域それぞれについて、前記複数の第1の画素の前記第1のセンサス特徴量と、前記複数の第2の画素の前記第2のセンサス特徴量とを算出し、処理(d)において、前記比較領域それぞれについて、前記相違度を算出し、処理(e)において、全ての前記比較領域の前記相違度のうち、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得してもよい。   In the parallax value calculation device according to one aspect of the present disclosure, in the processing (c), the target pixel as a comparison region that is a region of surrounding pixels to be compared when calculating a census feature amount of the target pixel. And determining the plurality of comparison regions having different positions with respect to the target pixel, and for each of the comparison regions, the first census feature value of the plurality of first pixels and the plurality of second pixels. The second census feature amount is calculated, and in the processing (d), the degree of difference is calculated for each of the comparison regions, and in the processing (e), the difference is the largest among the degrees of difference of all the comparison regions. The parallax value for each pixel in the parallax image corresponding to the first enlarged image may be acquired by selecting the parallax value corresponding to the small difference degree.

上記態様によれば、視差値算出装置は、複数の比較領域に関する着目画素の相違度のうち、最も小さい相違度に対応する視差値を着目画素の視差値に決定する。このような視差値は、着目画素に対する比較領域の位置に起因する視差値の誤差を低減する。よって、視差値算出装置は、オクルージョンの境界又は視差値が変化する前景及び背景間の境界付近に位置する画素について、視差画像での視差値の差異による境界の位置と、被写体の輪郭の位置とを正確に整合させることができる。   According to the above aspect, the disparity value calculating device determines, as the disparity value of the pixel of interest, the disparity value corresponding to the smallest difference degree among the differences of the pixels of interest related to the plurality of comparison areas. Such a parallax value reduces an error of the parallax value caused by the position of the comparison area with respect to the target pixel. Therefore, the parallax value calculating device determines the position of the boundary due to the difference in the parallax value in the parallax image, and the position of the outline of the subject for the pixels located in the vicinity of the boundary between the foreground or the background where the boundary of occlusion or the parallax value changes. Can be precisely aligned.

本開示の一態様に係る視差値算出装置において、前記プロセッサは、処理(d)において、前記相違度が算出される前記第1の画素及び前記第2の画素について、前記第1の画素の前記周囲の画素の画素値である輝度値と前記第2の画素の前記周囲の画素の画素値である輝度値との差異と、前記第1の画素の前記周囲の画素の輝度勾配と前記第2の画素の前記周囲の画素の輝度勾配との差異との少なくとも一方に基づく重みを、前記相違度に付加してもよい。   In the parallax value calculation device according to one aspect of the present disclosure, in the processing (d), for the first pixel and the second pixel for which the degree of difference is calculated, the processor determines the first pixel A difference between a luminance value that is a pixel value of a surrounding pixel and a luminance value that is a pixel value of the surrounding pixel of the second pixel, a luminance gradient of the surrounding pixel of the first pixel, and the second A weight based on at least one of the difference between the pixel of the pixel and the brightness gradient of the surrounding pixels may be added to the degree of difference.

上記態様によれば、第1の画素の周囲の画素の輝度値と第2の画素の周囲の画素の輝度値との差異に基づく重みも、第1の画素の周囲の画素の輝度勾配と第2の画素の周囲の画素の輝度勾配との差異に基づく重みも、着目画素に対する比較領域の配置が固定されていても、比較領域の内部を空間的に重み付けする。これにより、相違度は、輝度値の変化及び/又は輝度勾配の変化を反映することができる。よって、視差値算出装置は、オクルージョンの境界又は視差値が変化する前景及び背景間の境界付近に位置する画素について、着目画素に対して単一の比較領域を用いるだけで、視差画像での視差値の差異による境界の位置と、被写体の輪郭の位置とを正確に整合させることができる。   According to the above aspect, the weight based on the difference between the luminance value of the pixel around the first pixel and the luminance value of the pixel around the second pixel also corresponds to the luminance gradient of the pixel around the first pixel and The weight based on the difference with the luminance gradient of the pixels around the 2 pixels also spatially weights the inside of the comparison area even if the arrangement of the comparison area with respect to the target pixel is fixed. Thereby, the difference degree can reflect the change of the brightness value and / or the change of the brightness gradient. Therefore, the parallax value calculation apparatus can use only a single comparison area for the pixel of interest for pixels located in the vicinity of the boundary between the occlusion boundary or the boundary between the foreground and the background where the parallax value changes. The position of the boundary due to the difference in value and the position of the contour of the subject can be accurately aligned.

本開示の一態様に係る視差値算出方法は、(a)第1の位置に配置された第1のカメラで撮像される第1の画像と、第2の位置に配置された第2のカメラで撮像される第2の画像とを取得し、(b)前記第1の画像に対して、予め定められた視差方向への拡大処理により、前記第1の画像の画素の数を増やすことによって、複数の第1の画素を含む第1の拡大画像を生成し、前記第2の画像に対して、予め定められた視差方向への拡大処理により、前記第2の画像の画素の数を増やすことによって、複数の第2の画素を含む第2の拡大画像を生成し、(c)前記第1の拡大画像において、前記複数の第1の画素毎に、周囲の画素との画素値の比較により、第1のセンサス特徴量を算出し、前記第2の拡大画像において、前記複数の第2の画素毎に、周囲の画素との画素値の比較により、第2のセンサス特徴量を算出し、(d)前記複数の第1の画素それぞれについて、前記第1のセンサス特徴量と、少なくとも1つの前記第2の画素の前記第2のセンサス特徴量とを用いて、前記少なくとも1つの第2の画素それぞれの位置での前記第1の画素に対する視差値に対応する相違度を算出し、(e)前記複数の第1の画素それぞれについて、前記相違度を用いて、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得し、(f)前記視差画像の画素毎の視差値に対して、縮小処理をすることにより、前記第2の画像に対する前記第1の画像の画素毎の視差値を算出し、処理(a)〜処理(f)の少なくとも1つは、少なくとも1つのプロセッサによって実行される。上記態様によれば、本開示の一態様に係る視差値算出装置を同様の効果が得られる。   A parallax value calculation method according to an aspect of the present disclosure includes: (a) a first image captured by a first camera disposed at a first position, and a second camera disposed at a second position (B) increasing the number of pixels of the first image by performing enlargement processing in a predetermined parallax direction on the first image (b). Generating a first enlarged image including a plurality of first pixels, and increasing the number of pixels of the second image by performing enlargement processing on the second image in a predetermined parallax direction Thereby generating a second enlarged image including a plurality of second pixels, and (c) comparing pixel values with surrounding pixels for each of the plurality of first pixels in the first enlarged image Calculates a first census feature amount, and the plurality of second pixels in the second enlarged image A second census feature value is calculated by comparing pixel values with surrounding pixels, and (d) the first census feature value and the at least one first census feature value for each of the plurality of first pixels. The difference degree corresponding to the parallax value with respect to the first pixel at each position of the at least one second pixel is calculated using the second census feature value of two pixels, and (e) the above The parallax value for each pixel in the parallax image corresponding to the first enlarged image is acquired by selecting the parallax value corresponding to the smallest degree of difference using the degree of difference for each of the plurality of first pixels And (f) calculating a parallax value for each pixel of the first image with respect to the second image by performing reduction processing on the parallax value for each pixel of the parallax image, and processing (a) ~ At least one of processing (f) It is performed by at least one processor. According to the above aspect, similar effects to the parallax value calculation device according to one aspect of the present disclosure can be obtained.

本開示の一態様に係る視差値算出方法において、前記第1のセンサス特徴量と前記第2のセンサス特徴量との間のハミング距離を、前記相違度として算出してもよい。   In the parallax value calculation method according to an aspect of the present disclosure, a Hamming distance between the first census feature amount and the second census feature amount may be calculated as the degree of difference.

本開示の一態様に係る視差値算出方法において、処理(d)と処理(e)の間において、(g)前記第1の拡大画像において、視差値の算出対象の前記第1の画素である着目画素から、所定の方向に位置する前記第1の画素である評価画素それぞれについて、前記評価画素のうち、第1の評価画素に前記所定の方向で隣り合う第2の評価画素の視差値と、前記第2の拡大画像における前記第1の評価画素に対応する位置の対応画素に対する、相違度算出のための探索範囲内の前記第2の画素それぞれの視差値との比較に基づき、前記探索範囲内の前記第2の画素それぞれの第1の評価値を算出し、前記第1の評価画素と前記探索範囲内の前記第2の画素それぞれとの間の相違度と、前記探索範囲内の前記第2の画素それぞれの第1の評価値とに基づき、前記探索範囲内の前記第2の画素それぞれの視差値についての第2の評価値を算出し、前記探索範囲内の前記第2の画素それぞれの視差値に対応する全ての前記評価画素の前記第2の評価値を加算して、加算評価値を算出し、処理(e)において、最小の前記加算評価値に対応する前記視差値を前記着目画素の視差値に決定してもよい。   In the parallax value calculation method according to an aspect of the present disclosure, in the process (d) and the process (e), (g) the first pixel for which a parallax value is to be calculated in the first enlarged image. For each of the evaluation pixels that are the first pixels located in a predetermined direction from the pixel of interest, among the evaluation pixels, the parallax value of the second evaluation pixel adjacent to the first evaluation pixel in the predetermined direction and The search based on a comparison of the corresponding pixel at the position corresponding to the first evaluation pixel in the second enlarged image with the parallax value of each of the second pixels in the search range for calculating the degree of difference; A first evaluation value of each of the second pixels in the range is calculated, and a degree of difference between the first evaluation pixel and each of the second pixels in the search range; A first evaluation value of each of the second pixels and Based on the second evaluation value for the parallax value of each of the second pixels in the search range, a second evaluation value is calculated, and all evaluation pixels corresponding to the parallax values of the second pixels in the search range are calculated. The second evaluation value may be added to calculate an addition evaluation value, and in processing (e), the parallax value corresponding to the minimum addition evaluation value may be determined as the parallax value of the pixel of interest.

本開示の一態様に係る視差値算出方法では、処理(c)において、対象画素のセンサス特徴量を算出する際に比較する周囲の画素の領域である比較領域として、前記対象画素を含み且つ前記対象画素に対する位置が異なる複数の前記比較領域を決定し、前記比較領域それぞれについて、前記複数の第1の画素の前記第1のセンサス特徴量と、前記複数の第2の画素の前記第2のセンサス特徴量とを算出し、処理(d)において、前記比較領域それぞれについて、前記相違度を算出し、処理(e)において、全ての前記比較領域の前記相違度のうち、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得してもよい。   In the parallax value calculation method according to an aspect of the present disclosure, the target pixel is included as a comparison region that is a region of surrounding pixels to be compared when calculating a census feature value of the target pixel in the processing (c) The plurality of comparison areas having different positions with respect to the target pixel are determined, and the first census feature value of the plurality of first pixels and the second of the plurality of second pixels are determined for each of the comparison areas. In the process (d), the degree of difference is calculated for each of the comparison areas, and in the process (e), the smallest degree of difference among the degrees of difference in all the comparison areas is calculated. The parallax value for each pixel in the parallax image corresponding to the first enlarged image may be acquired by selecting the corresponding parallax value.

本開示の一態様に係る視差値算出方法では、処理(d)において、前記相違度が算出される前記第1の画素及び前記第2の画素について、前記第1の画素の前記周囲の画素の画素値である輝度値と前記第2の画素の前記周囲の画素の画素値である輝度値との差異と、前記第1の画素の前記周囲の画素の輝度勾配と前記第2の画素の前記周囲の画素の輝度勾配との差異との少なくとも一方に基づく重みを、前記相違度に付加するとしてもよい。   In the parallax value calculation method according to an aspect of the present disclosure, in the processing (d), with respect to the first pixel and the second pixel for which the degree of difference is calculated, pixels of the surrounding pixels of the first pixel. A difference between a luminance value which is a pixel value and a luminance value which is a pixel value of the surrounding pixels of the second pixel, a luminance gradient of the surrounding pixels of the first pixel, and the luminance of the second pixel A weight based on at least one of the difference with the brightness gradient of surrounding pixels may be added to the degree of difference.

本開示の一態様に係るプログラムは、(a)第1の位置に配置された第1のカメラで撮像された第1の画像と、第2の位置に配置された第2のカメラで撮像された第2の画像とを取得し、(b)前記第1の画像に対して、予め定められた視差方向への拡大処理により、前記第1の画像の画素の数を増やすことによって、複数の第1の画素を含む第1の拡大画像を生成し、前記第2の画像に対して、予め定められた視差方向への拡大処理により、前記第2の画像の画素の数を増やすことによって、複数の第2の画素を含む第2の拡大画像を生成し、(c)前記第1の拡大画像において、前記複数の第1の画素毎に、周囲の画素との画素値の比較により、第1のセンサス特徴量を算出し、前記第2の拡大画像において、前記複数の第2の画素毎に、周囲の画素との画素値の比較により、第2のセンサス特徴量を算出し、(d)前記複数の第1の画素それぞれについて、前記第1のセンサス特徴量と、少なくとも1つの前記第2の画素の前記第2のセンサス特徴量とを用いて、前記少なくとも1つの第2の画素それぞれの位置での前記第1の画素に対する視差値に対応する相違度を算出し、(e)前記複数の第1の画素それぞれについて、前記相違度を用いて、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得し、(f)前記視差画像の画素毎の視差値に対して、縮小処理をすることにより、前記第2の画像に対する前記第1の画像の画素毎の視差値を算出することを、コンピュータに実行させる。上記態様によれば、本開示の一態様に係る視差値算出装置を同様の効果が得られる。   A program according to an aspect of the present disclosure includes: (a) a first image captured by a first camera disposed at a first position, and a second image disposed at a second position; A second image, and (b) enlarging the number of pixels of the first image by enlarging the first image in a predetermined parallax direction, A first magnified image including a first pixel is generated, and the number of pixels of the second image is increased by performing enlargement processing on the second image in a predetermined parallax direction. Generating a second enlarged image including a plurality of second pixels; and (c) comparing the pixel values with surrounding pixels for each of the plurality of first pixels in the first enlarged image. Calculating a census feature amount of 1 for each of the plurality of second pixels in the second enlarged image; A second census feature value is calculated by comparing pixel values with surrounding pixels, and (d) the first census feature value and at least one of the second census feature values for each of the plurality of first pixels. The difference degree corresponding to the parallax value with respect to the first pixel at the position of each of the at least one second pixel is calculated using the second census feature value of the pixel, and (e) the plurality of pixels The parallax value for each pixel in the parallax image corresponding to the first enlarged image is acquired by selecting the parallax value corresponding to the smallest degree of difference using the degree of difference for each of the first pixels, (F) causing a computer to calculate a parallax value for each pixel of the first image with respect to the second image by performing reduction processing on the parallax value for each pixel of the parallax image . According to the above aspect, similar effects to the parallax value calculation device according to one aspect of the present disclosure can be obtained.

なお、上記の包括的又は具体的な態様は、システム、装置、方法、集積回路、コンピュータプログラム又はコンピュータ読取可能な記録ディスク等の記録媒体で実現されてもよく、システム、装置、方法、集積回路、コンピュータプログラム及び記録媒体の任意な組み合わせで実現されてもよい。コンピュータ読み取り可能な記録媒体は、例えばCD−ROM等の不揮発性の記録媒体を含む。また、装置は、1つ以上の装置で構成されてもよい。装置が2つ以上の装置で構成される場合、当該2つ以上の装置は、1つの機器内に配置されてもよく、分離した2つ以上の機器内に分かれて配置されてもよい。本明細書及び特許請求の範囲では、「装置」とは、1つの装置を意味し得るだけでなく、複数の装置からなるシステムも意味し得る。   Note that the above-described comprehensive or specific aspect may be realized by a recording medium such as a system, an apparatus, a method, an integrated circuit, a computer program, or a computer readable recording disk, and the system, an apparatus, a method, an integrated circuit , And may be realized by any combination of computer program and recording medium. The computer readable recording medium includes, for example, a non-volatile recording medium such as a CD-ROM. A device may also be comprised of one or more devices. When the device is configured by two or more devices, the two or more devices may be disposed in one device or may be separately disposed in two or more separate devices. In the present specification and claims, "device" may mean not only one device but also a system consisting of a plurality of devices.

以下、本開示に係る視差値算出装置について、図面を参照しながら具体的に説明する。なお、以下で説明する実施の形態は、いずれも包括的又は具体的な例を示すものである。以下の実施の形態で示される数値、形状、構成要素、構成要素の配置位置及び接続形態、ステップ(工程)、ステップの順序等は、一例であり、本開示を限定する主旨ではない。また、以下の実施の形態における構成要素のうち、最上位概念を示す独立請求項に記載されていない構成要素については、任意の構成要素として説明される。また、各図は模式図であり、必ずしも厳密に図示されたものではない。さらに、各図において、実質的に同一の構成要素に対しては同一の符号を付しており、重複する説明は省略又は簡略化される場合がある。   Hereinafter, the parallax value calculation device according to the present disclosure will be specifically described with reference to the drawings. Note that all the embodiments described below show general or specific examples. Numerical values, shapes, components, arrangement positions and connection forms of components, steps (steps), order of steps, and the like shown in the following embodiments are merely examples, and are not intended to limit the present disclosure. Further, among the components in the following embodiments, components not described in the independent claim indicating the highest concept are described as arbitrary components. Further, each drawing is a schematic view, and is not necessarily illustrated exactly. Further, in the drawings, substantially the same components are denoted by the same reference numerals, and overlapping descriptions may be omitted or simplified.

[実施の形態1]
実施の形態1に係る視差値算出装置100を含む測距システム1を説明する。測距システム1は、複数のカメラで取得された複数の撮像画像から、当該撮像画像内の被写体と複数のカメラとの距離を算出する、つまり、当該撮像画像内の被写体の位置を3次元的に測距する。視差値算出装置100は、測距に用いられる複数の撮像画像間の視差値を算出する。なお、視差値算出装置100が備えられる対象は、測距システム1に限定されず、複数の撮像画像間の視差値を用いるものであれば、いかなる対象でもよい。
First Embodiment
A ranging system 1 including the parallax value calculation device 100 according to the first embodiment will be described. The distance measuring system 1 calculates the distance between the subject in the captured image and the plurality of cameras from the plurality of captured images acquired by the plurality of cameras, that is, the position of the subject in the captured image is three-dimensionally Ranging to The disparity value calculating device 100 calculates disparity values between a plurality of captured images used for distance measurement. In addition, the object with which the parallax value calculation device 100 is provided is not limited to the distance measurement system 1, and any object may be used as long as the parallax value between a plurality of captured images is used.

図14は、実施の形態1に係る視差値算出装置100を含む測距システム1の機能的な構成の一例のブロック図を示す。図14に示すように、測距システム1は、撮像部10と、記憶部20と、画像処理部30とを備える。撮像部10、記憶部20及び画像処理部30は、1つの機器に搭載されてもよく、複数の機器に分かれて搭載されてもよい。後者の場合、複数の機器は、有線通信又は無線通信を介して、情報を授受してもよい。上記有線通信には、既存のいかなる有線通信が適用されてもよい。上記無線通信には、既存のいかなる無線通信が適用されてもよい。例えば、上記無線通信には、Wi−Fi(登録商標)(Wireless Fidelity)などの無線LAN(Local Area Network)が適用されてもよく、Bluetooth(登録商標)、ZigBee(登録商標)等の近距離無線通信が適用されてもよい。   FIG. 14 shows a block diagram of an example of a functional configuration of the distance measuring system 1 including the disparity value calculating device 100 according to the first embodiment. As shown in FIG. 14, the distance measurement system 1 includes an imaging unit 10, a storage unit 20, and an image processing unit 30. The imaging unit 10, the storage unit 20, and the image processing unit 30 may be mounted on one device, or may be separately mounted on a plurality of devices. In the latter case, the plurality of devices may exchange information via wired communication or wireless communication. Any existing wired communication may be applied to the wired communication. Any existing wireless communication may be applied to the wireless communication. For example, a wireless LAN (Local Area Network) such as Wi-Fi (registered trademark) (Wireless Fidelity) may be applied to the wireless communication, and a short distance such as Bluetooth (registered trademark) or ZigBee (registered trademark) Wireless communication may be applied.

撮像部10は、画像を撮像して取得し、記憶部20に出力する。撮像部10は、少なくとも2つのカメラを備え、本実施の形態では、異なる光軸中心で配置された2つのカメラ11a及び11bを備える。本実施の形態では、カメラ11a及び11bは、各画素の画素値が輝度値であるデジタル画像を、動画及び/又は静止画として撮像するカメラであるが、いかなるデジタル画像を撮像するカメラであってもよい。カメラ11a及び11bは、別々のカメラを構成してもよく、一体化されて複眼のカメラを構成してもよい。なお、カメラの数量は、2つに限定されず、2つ以上のいかなる数量であってもよい。本実施の形態では、カメラ11a及び11bは、同時に撮像を行う。   The imaging unit 10 captures and acquires an image, and outputs the image to the storage unit 20. The imaging unit 10 includes at least two cameras, and in the present embodiment, includes two cameras 11 a and 11 b arranged at different optical axis centers. In the present embodiment, the cameras 11a and 11b are cameras that capture digital images whose pixel values of the respective pixels are luminance values as moving images and / or still images, but are cameras that capture any digital image. It is also good. The cameras 11a and 11b may constitute separate cameras, or may be integrated to constitute a compound eye camera. The number of cameras is not limited to two, and may be any number of two or more. In the present embodiment, the cameras 11a and 11b simultaneously perform imaging.

例えば、図15には、撮像部10のカメラ11a及び11bの配置例が模式的な斜視図で示されている。さらに、図16には、図15のカメラ11a及び11bの基線長の例が模式的な正面図で示されている。図15の例では、カメラ11a及び11bは、水平方向に並んで配置されている。この場合、カメラ11a及び11bのレンズの中心を結ぶ基線BLは、水平方向に延びる。さらに、カメラ11a及び11bそれぞれの光軸中心OAa及びOAbは、互いから離れて水平方向に並び且つ平行であり、基線BL方向に対して垂直である。この場合、図16に示すように、カメラ11a及び11bの光軸中心OAa及びOAbの距離である基線長Lは、0よりも大きい。さらに、カメラ11a及び11bは、同じ向きDに向けられ、例えば、図15の例では、光軸中心OAa及びOAbは、水平方向に延び且つ向きDに平行である。さらにまた、カメラ11a及び11bの水平スキャン方向と基線BL方向とが平行である。水平スキャン方向は、カメラが有する複数の撮像素子の縦横の並び方向のうちの横方向であり、基線BL方向と同様の水平方向である。複数の撮像素子は、例えば、横方向である水平方向と、これに垂直な縦方向である垂直方向との2つの方向に格子状に平面的に配置されている。ここで、カメラ11aは、第1の位置に配置された第1のカメラの一例であり、カメラ11bは、第2の位置に配置された第2のカメラの一例である。   For example, FIG. 15 is a schematic perspective view showing an arrangement example of the cameras 11 a and 11 b of the imaging unit 10. Furthermore, FIG. 16 shows an example of the base lengths of the cameras 11a and 11b of FIG. 15 in a schematic front view. In the example of FIG. 15, the cameras 11a and 11b are arranged side by side in the horizontal direction. In this case, the base line BL connecting the centers of the lenses of the cameras 11a and 11b extends in the horizontal direction. Furthermore, the optical axis centers OAa and OAb of the cameras 11a and 11b are horizontally separated from each other, horizontally aligned and parallel, and perpendicular to the direction of the base line BL. In this case, as shown in FIG. 16, the base line length L which is the distance between the optical axis centers OAa and OAb of the cameras 11a and 11b is larger than zero. Furthermore, the cameras 11a and 11b are oriented in the same direction D, for example, in the example of FIG. 15, the optical axis centers OAa and OAb extend horizontally and are parallel to the direction D. Furthermore, the horizontal scanning direction of the cameras 11a and 11b is parallel to the direction of the base line BL. The horizontal scanning direction is the horizontal direction among the vertical and horizontal alignment directions of the plurality of imaging elements of the camera, and is the same as the direction of the base line BL. The plurality of imaging elements are, for example, planarly arranged in a grid shape in two directions of a horizontal direction which is a horizontal direction and a vertical direction which is a vertical direction perpendicular thereto. Here, the camera 11a is an example of a first camera disposed at a first position, and the camera 11b is an example of a second camera disposed at a second position.

なお、カメラ11a及び11bの配置は、図15に示すような水平方向に並ぶ配置に限定されず、例えば、図17に示すように、鉛直方向、つまり上下方向に並ぶ配置であってもよい。図17は、撮像部10のカメラ11a及び11bの別の配置例を示す模式的な斜視図である。この場合、基線BLは鉛直方向に延びる。カメラ11a及び11bの光軸中心OAa及びOAbは、互いから離れて鉛直方向に並び且つ平行であり、基線BL方向に対して垂直である。さらに、カメラ11a及び11bは、同じ向きDに向けられ、例えば、図17の例では、光軸中心OAa及びOAbは、水平方向に延び且つ向きDに平行である。さらにまた、カメラ11a及び11bの水平スキャン方向と基線BL方向とが垂直である。   The arrangement of the cameras 11a and 11b is not limited to the arrangement in the horizontal direction as shown in FIG. 15. For example, as shown in FIG. 17, the arrangement may be the arrangement in the vertical direction, that is, the vertical direction. FIG. 17 is a schematic perspective view showing another arrangement example of the cameras 11 a and 11 b of the imaging unit 10. In this case, the base line BL extends in the vertical direction. Optical axis centers OAa and OAb of the cameras 11a and 11b are vertically separated from each other, aligned in parallel in the vertical direction, and parallel to the direction of the base line BL. Furthermore, the cameras 11a and 11b are oriented in the same direction D, for example, in the example of FIG. 17, the optical axis centers OAa and OAb extend horizontally and are parallel to the direction D. Furthermore, the horizontal scanning direction of the cameras 11a and 11b is perpendicular to the direction of the base line BL.

上述のようなカメラ11a及び11bは、同じ被写体を撮像することができるステレオカメラを構成し、このようなカメラ11a及び11bによって撮像された画像は、ステレオ画像を構成する。   The cameras 11a and 11b as described above constitute a stereo camera capable of picking up the same subject, and the images picked up by such cameras 11a and 11b constitute stereo images.

本明細書及び特許請求の範囲において、「平行」及び「垂直」とはそれぞれ、完全に平行及び垂直であるケースだけでなく、完全な平行及び垂直に対して差異があるケースも意味し得る。上記差異は、例えば、10°未満の角度の差異であってもよい。   In the present specification and claims, "parallel" and "perpendicular" can mean not only the cases that are completely parallel and perpendicular, respectively, but also the cases that have differences with respect to completely parallel and perpendicular. The difference may be, for example, an angular difference of less than 10 °.

記憶部20は、種々の情報の格納及び取り出しを可能にする。例えば、記憶部20は、撮像部10によって取得された撮像画像を格納する。記憶部20は、撮像部10及び/又は画像処理部30を動作させるためのプログラムを格納してもよい。これらのプログラムは、撮像部10及び画像処理部30が有する図示しないメモリに格納されてもよい。記憶部20は、例えば、ROM(Read-Only Memory)、RAM(Random Access Memory)、フラッシュメモリなどの半導体メモリ、ハードディスクドライブ、又はSSD(Solid State Drive)等の記憶装置によって実現される。ここで、記憶部20は、メモリの一例である。   The storage unit 20 enables storage and retrieval of various information. For example, the storage unit 20 stores the captured image acquired by the imaging unit 10. The storage unit 20 may store a program for operating the imaging unit 10 and / or the image processing unit 30. These programs may be stored in a memory (not shown) that the imaging unit 10 and the image processing unit 30 have. The storage unit 20 is realized by, for example, a storage device such as a read-only memory (ROM), a random access memory (RAM), a semiconductor memory such as a flash memory, a hard disk drive, or a solid state drive (SSD). Here, the storage unit 20 is an example of a memory.

画像処理部30は、視差値算出装置100と、距離算出部31と、出力部32とを備える。さらに、視差値算出装置100は、水平拡大部101と、センサス変換部102と、相違度算出部103と、視差選択部104と、水平縮小部105とを含む。上記の画像処理部30及び視差値算出装置100の各構成要素は、CPU(Central Processing Unit)又はDSP(Digital Signal Processor)等のプロセッサ、並びに、RAM及びROM等のメモリなどからなるコンピュータシステム(図示せず)により構成されてもよい。各構成要素の一部又は全部の機能は、CPU又はDSPがRAMを作業用のメモリとして用いてROMに記録されたプログラムを実行することによって達成されてもよい。また、各構成要素の一部又は全部の機能は、電子回路又は集積回路等の専用のハードウェア回路によって達成されてもよい。各構成要素の一部又は全部の機能は、上記のソフトウェア機能とハードウェア回路との組み合わせによって構成されてもよい。プログラムは、アプリケーションとして、インターネット等の通信網を介した通信、モバイル通信規格による通信、その他の無線ネットワーク、有線ネットワーク、又は放送等で提供されるものであってもよい。   The image processing unit 30 includes a parallax value calculation device 100, a distance calculation unit 31, and an output unit 32. Furthermore, the parallax value calculation device 100 includes a horizontal enlargement unit 101, a census conversion unit 102, a dissimilarity calculation unit 103, a parallax selection unit 104, and a horizontal reduction unit 105. Each component of the image processing unit 30 and the parallax value calculation device 100 described above is a computer system including a processor such as a central processing unit (CPU) or a digital signal processor (DSP), and a memory such as a RAM and a ROM. Not shown). Some or all of the functions of each component may be achieved by the CPU or DSP executing a program recorded in the ROM using the RAM as a working memory. Also, some or all of the functions of each component may be achieved by dedicated hardware circuits such as electronic circuits or integrated circuits. Some or all of the functions of each component may be configured by a combination of the above software functions and hardware circuits. The program may be provided as an application through communication via a communication network such as the Internet, communication according to a mobile communication standard, another wireless network, a wired network, broadcast, or the like.

視差値算出装置100は、カメラ11a及び11bによって取得された対応する撮像画像を用いて、撮像画像上の様々な位置、具体的には、各画素における撮像画像間の視差を算出し、距離算出部31に出力する。対応する撮像画像の例は、カメラ11a及び11bによって同時刻に撮像された画像である。距離算出部31は、カメラ11a及び11bの撮像画像間の視差に基づき、三角測量の技術を用いて、撮像画像の上の様々な位置、具体的には、各画素における、当該画素に写し出される被写体とカメラ11a及び11bとの距離を算出し、出力部32に出力する。距離算出部31は、被写体とカメラ11a及び11bの基線BLとの距離を算出する。距離算出部31は、各画素の画素値が基準カメラ(カメラ11a又はカメラ11b)の光学中心(図15及び図17におけるOAa又はOAb)からの距離である距離画像を生成してもよい。出力部32は、距離算出部31によって算出された撮像画像の各画素の距離、及び距離画像等の距離情報を、撮像画像と対応付けて、記憶部20、測距システム1を搭載する機器等に出力する。例えば、測距システム1が自動車に搭載される場合、出力部32は、距離情報を自動車のECU(Electronic Control Unit:電子制御ユニット)に出力してもよい。   The parallax value calculation device 100 calculates the distance between various positions on the pickup image, specifically, the parallax between the pickup images in each pixel, using the corresponding pickup images acquired by the cameras 11a and 11b, and calculates the distance. Output to section 31. An example of the corresponding captured image is an image captured at the same time by the cameras 11a and 11b. The distance calculation unit 31 uses the triangulation technique based on the parallax between the images taken by the cameras 11a and 11b to be taken out at various positions on the taken image, specifically, the pixels in each pixel. The distance between the subject and the cameras 11 a and 11 b is calculated and output to the output unit 32. The distance calculation unit 31 calculates the distance between the subject and the base line BL of the cameras 11a and 11b. The distance calculation unit 31 may generate a distance image in which the pixel value of each pixel is the distance from the optical center (OAa or OAb in FIGS. 15 and 17) of the reference camera (camera 11a or camera 11b). The output unit 32 associates the distance of each pixel of the captured image calculated by the distance calculation unit 31 and the distance information such as the distance image with the captured image, and stores the storage unit 20 and the device including the distance measuring system 1 Output to For example, when the ranging system 1 is mounted on a vehicle, the output unit 32 may output distance information to an ECU (Electronic Control Unit) of the vehicle.

視差値算出装置100の水平拡大部101は、入力画像であるカメラ11a及び11bの撮像画像I1及びI2と、初期視差画像Dinitとを、予め定められた視差探索方向である水平方向の視差方向に拡大する、つまり水平拡大する。視差探索方向は、後述する探索範囲内における画素の並び方向である。撮像画像I1及びI2はそれぞれ、拡大画像I1h及びI2hに水平拡大される。初期視差画像Dinitは、カメラ11a及び11bのカメラパラメタに基づき予め算出された視差値の初期値を、各画素の画素値として含む画像である。このような視差値の初期値は、全ての画素において同一であってもよい。初期視差画像Dinitの全ての画素の視差値は、0であってもよい。カメラパラメタの例は、カメラの位置及び向き、並びに、焦点距離及び光軸中心位置等である。視差探索方向は、視差値を算出する際に、カメラ11a及び11bの画像間で画素を比較する方向であり、本実施の形態では、水平方向の一次元の探索方向である。この場合、カメラ11aの画像を基準として視差値を算出する際、当該画像の1つの画素である着目画素に対して、カメラ11bの画像において、着目画素と同じラインの参照画素が、水平方向、つまりライン方向に順次探索され、着目画素と比較される。カメラ11aの画像ではなく、カメラ11bの画像を基準とする場合も同様である。ここで、撮像画像I1は、第1の画像の一例であり、撮像画像I2は、第2の画像の一例であり、視差探索方向は、予め定められた視差方向の一例である。   The horizontal enlargement unit 101 of the parallax value calculation device 100 sets the captured images I1 and I2 of the cameras 11a and 11b, which are input images, and the initial parallax image Dinit in the horizontal parallax direction, which is a predetermined parallax search direction. Expand, that is, expand horizontally. The parallax search direction is an arrangement direction of pixels in a search range described later. The captured images I1 and I2 are horizontally enlarged to enlarged images I1h and I2h, respectively. The initial parallax image Dinit is an image including the initial value of the parallax value calculated in advance based on the camera parameters of the cameras 11a and 11b as the pixel value of each pixel. The initial value of such a parallax value may be the same for all pixels. The parallax value of all the pixels of the initial parallax image Dinit may be zero. Examples of camera parameters are the position and orientation of the camera, as well as the focal length and center position of the optical axis. The parallax search direction is a direction in which pixels are compared between the images of the cameras 11a and 11b when calculating parallax values, and in the present embodiment, it is a one-dimensional search direction in the horizontal direction. In this case, when the parallax value is calculated based on the image of the camera 11a, with respect to the pixel of interest which is one pixel of the image, in the image of the camera 11b, the reference pixels in the same line as the pixel of interest are in the horizontal direction. That is, the search is sequentially performed in the line direction and compared with the target pixel. The same applies to the case where not the image of the camera 11a but the image of the camera 11b is used as a reference. Here, the captured image I1 is an example of a first image, the captured image I2 is an example of a second image, and the parallax search direction is an example of a predetermined parallax direction.

水平拡大処理では、水平方向の画素数が増やされるが、鉛直方向の画素数は変わらない。つまり、画素列の数量が増加し、画素行の数量は一定である。水平拡大処理は補間拡大によって行われる。補間拡大の方法には複数のものが知られているが、本実施の形態では、復元画質が高いことで知られているバイキュービック補間よりもバイリニア補間を行うことが好ましい。その理由は、バイキュービック補間で重畳されるオーバーシュート成分が後述するセンサス変換結果を用いた相違度計算の誤差要因となり得るからである。   In the horizontal enlargement process, the number of pixels in the horizontal direction is increased, but the number of pixels in the vertical direction does not change. That is, the number of pixel columns increases and the number of pixel rows is constant. Horizontal enlargement processing is performed by interpolation enlargement. Although a plurality of interpolation expansion methods are known, in the present embodiment, it is preferable to perform bilinear interpolation rather than bicubic interpolation which is known to have a high restoration image quality. The reason is that the overshoot component superimposed in the bicubic interpolation may become an error factor of the difference calculation using the census conversion result described later.

センサス変換部102は、拡大画像I1h及びI2hをセンサス変換する。センサス変換とは、着目画素とその周囲の周辺画素との大小関係により、着目画素周囲の周辺画素の画素値つまり輝度値の分布をビット列に変換する処理である。具体的には、例えば、着目画素の画素値が周辺画素の画素値よりも大きい場合、当該周辺画素のセンサス変換値は1であり、着目画素の画素値が周辺画素の画素値以下の場合、当該周辺画素のセンサス変換値は0である。センサス変換部102は、拡大画像I1h及びI2hそれぞれの全ての画素に対して、センサス変換する。   The census conversion unit 102 performs census conversion on the enlarged images I1h and I2h. Census conversion is processing of converting the distribution of the pixel values of peripheral pixels around the pixel of interest, that is, the luminance value, into a bit string based on the magnitude relationship between the pixel of interest and the peripheral pixels around it. Specifically, for example, when the pixel value of the target pixel is larger than the pixel values of the peripheral pixels, the census conversion value of the peripheral pixels is 1, and the pixel value of the target pixel is less than or equal to the pixel values of the peripheral pixels. The census conversion value of the peripheral pixels is zero. The census conversion unit 102 performs census conversion on all the pixels of each of the enlarged images I1h and I2h.

例えば、図18A及び図18Bは、センサス変換における周辺画素の一例を示す。図19A及び図19Bはそれぞれ、図18A及び図18Bの周辺画素のセンサス変換の一例を示す。図18A、図18B、図19A及び図19Bにおいて、ctrは着目画素を示す。図18A及び図19Aは、着目画素の近傍の8画素が周辺画素である例であり、図18B及び図19Bは、着目画素の近傍の64画素が周辺画素である例である。図19A及び図19Bの例ではそれぞれ、センサス変換により、着目画素周囲の周辺画素の画素値の分布は、8ビット又は64ビットのビット列で表すことができる。具体的には、図19A及び図19Bはそれぞれ、センサス変換前の周辺画素及び着目画素の画素値の例と、周辺画素のセンサス変換値の例と、センサス変換値からなるビット列の例とを示す。   For example, FIGS. 18A and 18B show an example of peripheral pixels in census conversion. 19A and 19B respectively show an example of the census conversion of the peripheral pixels in FIGS. 18A and 18B. In FIGS. 18A, 18B, 19A, and 19B, ctr represents a target pixel. FIGS. 18A and 19A are examples in which eight pixels in the vicinity of the pixel of interest are peripheral pixels, and FIGS. 18B and 19B are examples in which 64 pixels in the vicinity of the pixel of interest are peripheral pixels. In the examples of FIGS. 19A and 19B, the distribution of pixel values of peripheral pixels around the pixel of interest can be represented by a bit string of 8 bits or 64 bits by census conversion, respectively. Specifically, FIG. 19A and FIG. 19B respectively show an example of pixel values of peripheral pixels and a pixel of interest before census conversion, an example of census conversion values of peripheral pixels, and an example of a bit string consisting of census conversion values. .

例えば、図18A、図18B、図19A及び図19Bにおいて、図面上で水平方向に画素座標のx軸が定義され、上記水平方向の垂直方向に画素座標のy軸が定義され、図面上で水平方向右方向にx軸正方向が定義され、垂直方向下方向にy軸正方向が定義される。x軸は、カメラ11a及び11bの基線BLに沿う方向に延びる。ビット列は、例えば、y座標最小且つx座標最小の周辺画素のセンサス変換値を最初の要素、つまりビットとして含み、さらに、y座標が同じであるx軸正方向の周辺画素のセンサス変換値を順次要素として含み、次いで、y座標を1つずつ増やしつつ、y座標が同じであるx軸正方向の周辺画素のセンサス変換値を順次要素として含む。例えば、図19Aの例では、ビット列は、(00011011)で示される。このようにして、拡大画像I1h及びI2hそれぞれの全ての画素に対して、ビット列が生成される。なお、周辺画素の数量及び配置は、図18A及び18Bの数量及び配置に限る必要はなく、他の数量及び配置であってもかまわない。ここで、センサス変換値からなる上記のようなビット列は、センサス特徴量を構成する。   For example, in FIG. 18A, FIG. 18B, FIG. 19A and FIG. 19B, the x axis of pixel coordinates is defined in the horizontal direction in the drawing, the y axis of pixel coordinates is defined in the vertical direction of the horizontal direction, Direction The x-axis positive direction is defined as the right direction, and the y-axis positive direction is defined as the vertically downward direction. The x-axis extends in a direction along the base line BL of the cameras 11a and 11b. The bit string includes, for example, census transformed values of peripheral pixels with y coordinate minimum and x coordinate minimum as the first element, that is, bits, and further, census transformed values of peripheral pixels in the positive direction of x axis with the same y coordinate are sequentially It is included as an element, and then, while the y-coordinate is incremented one by one, census transformation values of peripheral pixels in the positive direction of the x-axis whose y-coordinates are the same are sequentially included as an element. For example, in the example of FIG. 19A, the bit string is indicated by (00011011). In this way, bit strings are generated for all the pixels of each of the enlarged images I1h and I2h. The number and arrangement of peripheral pixels need not be limited to the numbers and arrangements shown in FIGS. 18A and 18B, and may be other numbers and arrangements. Here, the above bit string composed of the census conversion value constitutes census feature value.

相違度算出部103は、予め決められた探索範囲内の画素について、拡大画像I1h及びI2hの間のセンサス特徴量の相違度を算出する。本実施の形態では、センサス特徴量の相違度として、ハミング距離が用いられる。ここで、探索範囲について説明する。探索範囲は、少なくとも1つの画素を含む。図15に示すように、本実施の形態では、カメラ11aは、撮像方向である向きDに向かって、カメラ11bよりも左側に配置され、左カメラを構成し、カメラ11bは、右カメラを構成する。   The degree-of-difference calculation unit 103 calculates the degree of difference in census feature value between the enlarged images I1h and I2h for pixels in a predetermined search range. In the present embodiment, the Hamming distance is used as the degree of difference between census feature quantities. Here, the search range will be described. The search range includes at least one pixel. As shown in FIG. 15, in the present embodiment, the camera 11a is disposed on the left side of the camera 11b toward the direction D, which is the imaging direction, to constitute a left camera, and the camera 11b constitutes a right camera. Do.

このようなカメラ11aの撮像画像I1に対応する拡大画像I1hを基準画像とし、カメラ11bの撮像画像I2に対応する拡大画像I2hを参照画像とする場合の探索範囲を説明する。この場合、図20に示すように、例えば、基準画像I1h上の画素(以下、「着目画素」とも呼ぶ)I1hpは、参照画像I2h上の探索範囲内の全ての画素(以下、「参照画素」とも呼ぶ)I2hp〜I2hpそれぞれとの間で、センサス特徴量の相違度が求められる。なお、図20は、相違度の算出の際の画素の探索範囲の一例を示す図である。参照画素I2hp〜I2hpは、着目画素I1hpと画素座標のy座標が同じ画素の行を構成し、当該画素の行は、探索範囲を構成する。このような探索範囲は、画素座標における一次元探索範囲であり、参照画像I2hにおける1つの画素の行の全てである。 A search range in the case where the magnified image I1h corresponding to the captured image I1 of the camera 11a is a reference image and the magnified image I2h corresponding to the captured image I2 of the camera 11b is a reference image will be described. In this case, as shown in FIG. 20, for example, all the pixels in the search range on the reference image I2h (hereinafter referred to as “reference pixels”) on the reference image I1h (hereinafter also referred to as “focused pixels”) The degree of difference between census feature quantities is determined between each of I 2 hp 1 to I 2 hp n . FIG. 20 is a diagram illustrating an example of a search range of pixels in the calculation of the degree of difference. The reference pixels I2hp 1 to I2hp n form a row of pixels having the same y coordinate as the pixel of interest I1hp, and the row of pixels forms a search range. Such a search range is a one-dimensional search range in pixel coordinates, and is all rows of one pixel in the reference image I2h.

又は、着目画素I1hpは、参照画像I2h上における着目画素I1hpと同じ画素座標である対応画素I2hpを含むk+1個(kは、正の整数)の参照画素それぞれとの間で、センサス特徴量の相違度が求められてもよい。着目画素I1hpの画素座標と、対応画素I2hpの画素座標とは、着目画素I1hpでの視差値に対応して異なるが、本実施の形態では、各画素の視差値の初期値を示す初期視差画像における各画素の視差値は0である。このため、着目画素I1hpの画素座標と、対応画素I2hpの画素座標とが同じである。このような参照画素は、対応画素I2hpとy座標が同じであり且つ対応画素I2hpからx軸負方向にk+1個の画素、つまり、対応画素I2hpから画素I2hpm−kのk+1個の画素であり、探索範囲を構成する。このような探索範囲は、一次元探索範囲であり、参照画像I2hの対応画素I2hpを含む画素の行において、対応画素I2hpから基線BLに沿ってカメラ11aに向かうk+1個の画素の範囲である。以下の実施の形態では、k+1個の画素を探索範囲とするケースを説明する。 Alternatively, the pixel of interest I1hp is included in the census feature value with each of k + 1 (k is a positive integer) reference pixels including the corresponding pixel I2hp m having the same pixel coordinates as the pixel of interest I1hp on the reference image I2h. The degree of difference may be determined. Although the pixel coordinates of the target pixel I1hp and the pixel coordinates of the corresponding pixel I2hp m differ depending on the parallax value at the target pixel I1hp, in the present embodiment, an initial parallax indicating the initial value of the parallax value of each pixel The parallax value of each pixel in the image is zero. For this reason, the pixel coordinates of the focused pixel I1hp and the pixel coordinates of the corresponding pixel I2hp m are the same. Such reference pixels, the corresponding pixel I2hp m and y-coordinates are the same and the corresponding pixel I2hp m k + 1 pixels in the x-axis negative direction from, that is, from the corresponding pixel I2hp m pixels I2hp m-k k + 1 single It is a pixel and constitutes a search range. Such a search range is a one-dimensional search range, and in a row of pixels including the corresponding pixel I2hp m of the reference image I2h, in the range of k + 1 pixels from the corresponding pixel I2hp m toward the camera 11a along the base line BL. is there. In the following embodiment, a case in which k + 1 pixels are set as a search range will be described.

なお、着目画素I1hpに対する対応画素I2hpの視差値は、0画素であり、着目画素I1hpに対する画素I2hpm−kの視差値は、−k画素である。このため、探索範囲は、着目画素I1hpに対する水平方向の視差値が0画素から−k画素である範囲でもある。なお、上記探索範囲は、視差値が0以下の範囲であるが、これに限定されず、視差値が0超である範囲も含んでもよい。本実施の形態では、視差値は、正の値である場合、x軸正方向の視差を示し、負の値である場合、x軸負方向の視差を示す。 The parallax value of the corresponding pixel I2hp m with respect to the focused pixel I1hp is 0 pixel, and the parallax value of the pixel I2hp m-k with respect to the focused pixel I1hp is −k pixels. For this reason, the search range is also a range in which the parallax value in the horizontal direction with respect to the target pixel I1hp is 0 pixel to −k pixel. In addition, although the said search range is a range whose parallax value is zero or less, it is not limited to this, You may also include the range whose parallax value is more than zero. In the present embodiment, when the parallax value is a positive value, it indicates parallax in the x-axis positive direction, and when it is a negative value, it indicates parallax in the x-axis negative direction.

同様に、拡大画像I2hを基準画像とし、拡大画像I1hを参照画像とする場合の探索範囲を説明する。この場合、図21に示すように、基準画像I2h上の着目画素I2hpは、参照画像I1h上の探索範囲内の全ての参照画素I1hp〜I1hpそれぞれとの間で、センサス特徴量の相違度が求められる。なお、図21は、相違度の算出の際の画素の探索範囲の別の一例を示す図である。このような探索範囲は、参照画像I1hにおける1つの画素の行の全てであり、この行のy座標は、着目画素I2hpと同じである。 Similarly, a search range in the case where the enlarged image I2h is a reference image and the enlarged image I1h is a reference image will be described. In this case, as shown in FIG. 21, the degree of difference in census feature value between the target pixel I2hp on the reference image I2h and each of all the reference pixels I1hp 1 to I1hp n within the search range on the reference image I1h. Is required. FIG. 21 is a diagram showing another example of the search range of the pixel at the time of calculation of the degree of difference. Such a search range is all of one row of pixels in the reference image I1h, and the y coordinate of this row is the same as the target pixel I2hp.

又は、着目画素I2hpは、参照画像I1h上における対応画素I1hpを含むk+1個の参照画素それぞれとの間で、センサス特徴量の相違度が求められてもよい。このような参照画素は、対応画素I1hpとy座標が同じであり且つ対応画素I1hpからx軸正方向のk+1個の画素、つまり、対応画素I1hpから画素I1hpm+kのk+1個の画素であり、探索範囲を構成する。このような探索範囲は、参照画像I1hの対応画素I1hpを含む画素の行において、対応画素I1hpから基線BLに沿ってカメラ11bに向かうk+1個の画素の範囲である。また、探索範囲は、着目画素I2hpに対する水平方向の視差値が0画素からk画素である範囲でもある。上記探索範囲は、視差値が0以上の範囲であるが、これに限定されず、視差値が0未満である範囲も含んでもよい。 Alternatively, for the pixel of interest I2hp, the degree of difference in census feature value may be determined between each of k + 1 reference pixels including the corresponding pixel I1hp m on the reference image I1h. Such a reference pixel has the same y coordinate as the corresponding pixel I1hp m and k + 1 pixels in the positive direction along the x axis from the corresponding pixel I1hp m , that is, k + 1 pixels from the corresponding pixel I1hp m to the pixel I1hp m + k Yes, configure the search range. Such a search range is a range of k + 1 pixels from the corresponding pixel I1hp m toward the camera 11b along the base line BL in the row of pixels including the corresponding pixel I1hp m of the reference image I1h. Further, the search range is also a range in which the parallax value in the horizontal direction with respect to the target pixel I2hp is 0 pixel to k pixels. The above search range is a range in which the disparity value is 0 or more, but is not limited to this, and may include a range in which the disparity value is less than 0.

また、ハミング距離を用いた相違度は、以下のように求められる。例えば、基準画像の着目画素のセンサス特徴量が、ビット列(00011011)であり、参照画像の参照画素のセンサス特徴量が、ビット列(10110001)である場合、これら2つの画素間のハミング距離は、1+0+1+0+1+0+1+0=4であり、相違度は、「4」である。相違度は、ハミング距離であり、2つの画素のセンサス特徴量であるビット列間において、同じ桁同士のビットの数値が異なる桁数である。つまり、ハミング距離の算出では、2つのビット列間において、同じ桁のビットの数値が同じ場合、ビット間差異が「0」であり、同じ桁のビットの数値が異なる場合、ビット間差異が「1」であり、全てのビット間差異の和がハミング距離である。   Moreover, the difference degree using Hamming distance is calculated | required as follows. For example, when the census feature value of the target pixel of the reference image is bit string (00011011) and the census feature value of reference pixel of the reference image is bit string (10110001), the Hamming distance between these two pixels is 1 + 0 + 1 + 0 + 1 + 0 + 1 + 0. It is = 4, and a difference degree is "4". The degree of difference is the Hamming distance, and the number of bits of the same digit is different between bit strings which are census features of two pixels. That is, in the calculation of the Hamming distance, when the bit numbers of the same digit are the same between two bit strings, the inter-bit difference is “0”, and when the bit numbers of the same digit are different, the inter-bit difference is “1”. And the sum of all inter-bit differences is the Hamming distance.

このように、相違度算出部103は、基準画像の着目画素それぞれについて、着目画素のセンサス特徴量と、参照画像の少なくとも1つの参照画素のセンサス特徴量とを用いて、少なくとも1つの参照画素それぞれの位置での着目画素に対する視差値に対応する相違度を算出する。   As described above, the dissimilarity calculation unit 103 uses the census feature of the pixel of interest and the census feature of at least one reference pixel of the reference image for each pixel of interest of the reference image to perform at least one reference pixel. The difference degree corresponding to the parallax value with respect to the pixel of interest at the position of is calculated.

視差選択部104は、着目画素について、対応する探索範囲内の参照画素の相違度のうちから、最小の相違度を選択し、当該相違度に対応する参照画素の視差値を特定する。そして、視差選択部104は、特定された視差値を、着目画素の視差値に決定する。視差選択部104は、基準画像内の全ての画素を、着目画素として順次走査することにより、基準画像内の各画素における視差値を決定する。これにより、視差選択部104は、各画素の画素値が視差値である視差画像を生成する。視差画像は、基準画像の各画素における輝度値からなる画素値を視差値に置き換えた画像である。   The parallax selection unit 104 selects the smallest degree of difference from among the degrees of difference of reference pixels in the corresponding search range for the pixel of interest, and specifies the parallax value of the reference pixel corresponding to the degree of difference. Then, the disparity selection unit 104 determines the identified disparity value as the disparity value of the pixel of interest. The parallax selection unit 104 sequentially determines all pixels in the reference image as the target pixel, thereby determining the parallax value of each pixel in the reference image. Thereby, the parallax selection unit 104 generates a parallax image in which the pixel value of each pixel is a parallax value. The parallax image is an image in which a pixel value including a luminance value in each pixel of the reference image is replaced with a parallax value.

具体的には、着目画素の視差値の決定は、以下に説明するように処理される。例えば、図22には、1つの着目画素に対して算出される相違度と、相違度に対応する参照画素の視差値との関係の一例が、図化されている。このように、相違度は、予め設定された視差値の最小値及び最大値で決まる探索範囲内において、1画素間隔で算出される。そして、視差選択部104は、探索範囲内の相違度から、最小の相違度を選択し、当該相違度に対応する視差値を、着目画素の視差値に決定する。   Specifically, the determination of the parallax value of the pixel of interest is processed as described below. For example, FIG. 22 illustrates an example of the relationship between the degree of difference calculated for one target pixel and the parallax value of the reference pixel corresponding to the degree of difference. As described above, the degree of difference is calculated at an interval of one pixel within a search range determined by the minimum value and the maximum value of the preset parallax values. Then, the parallax selection unit 104 selects the smallest degree of difference from the degrees of difference within the search range, and determines the parallax value corresponding to the degree of difference as the parallax value of the pixel of interest.

水平縮小部105は、視差選択部104によって決定された基準画像の各画素の視差値を、水平拡大部101における水平拡大率に対応した水平縮小率で縮小することによって、水平拡大前のスケールの視差値に変換する。例えば、水平拡大部101における水平拡大率が2倍の場合、水平縮小部105は、2分の1の水平縮小率で水平縮小処理を行う。例えば、水平拡大部101における水平拡大率が4倍の場合、水平縮小部105は、4分の1の水平縮小率で水平縮小処理を行う。   The horizontal reduction unit 105 reduces the parallax value of each pixel of the reference image determined by the parallax selection unit 104 at a horizontal reduction ratio corresponding to the horizontal enlargement ratio in the horizontal enlargement unit 101 to obtain a scale before horizontal enlargement. Convert to disparity value. For example, when the horizontal enlargement ratio in the horizontal enlargement unit 101 is twice, the horizontal reduction unit 105 performs horizontal reduction processing at a horizontal reduction ratio of 1⁄2. For example, when the horizontal enlargement ratio in the horizontal enlargement unit 101 is four, the horizontal reduction unit 105 performs horizontal reduction processing at a horizontal reduction ratio of one fourth.

具体的には、水平縮小部105は、視差選択部104によって生成された視差画像を、上記の水平縮小率で縮小する。例えば、水平縮小率が2分の1の場合、水平縮小部105は、水平方向つまりx軸方向に並ぶ2つの画素の画素値を平均化する、2つの画素の画素値の一方を選ぶ等で当該2つの画素を統合することにより、画素数を2分の1にするように視差画像を縮小する。さらに、水平縮小部105は、統合後の各画素の画素値、つまり視差値を2分の1にする。これにより、水平縮小部105は、視差画像を2分の1に縮小した1/2視差画像を、縮小視差画像として生成する。このような1/2視差画像の各画素は、2分の1画素精度の視差値を含む。   Specifically, the horizontal reduction unit 105 reduces the parallax image generated by the parallax selection unit 104 at the above-described horizontal reduction ratio. For example, when the horizontal reduction ratio is 1⁄2, the horizontal reduction unit 105 averages the pixel values of two pixels aligned in the horizontal direction, that is, the x-axis direction, selects one of the pixel values of two pixels, etc. By combining the two pixels, the parallax image is reduced so that the number of pixels is halved. Furthermore, the horizontal reduction unit 105 halves the pixel value of each pixel after integration, that is, the parallax value. Thereby, the horizontal reduction unit 105 generates a half parallax image in which the parallax image is reduced by half as a reduced parallax image. Each pixel of such a 1/2 parallax image includes a parallax value with half pixel accuracy.

よって、水平拡大部101による2倍の水平拡大及び水平縮小部105による2分の1の水平縮小の場合、2分の1画素精度の視差値の算出が可能であり、水平拡大部101による4倍の水平拡大及び水平縮小部105による4分の1の水平縮小の場合、4分の1画素精度の視差値の算出が可能である。   Therefore, in the case of 2 × horizontal enlargement by the horizontal enlargement unit 101 and 1⁄2 horizontal reduction by the horizontal reduction unit 105, it is possible to calculate a parallax value with 1⁄2 pixel accuracy. In the case of 1⁄4 horizontal enlargement and horizontal 1⁄4 horizontal reduction by the horizontal reduction unit 105, it is possible to calculate parallax values with 1⁄4 pixel accuracy.

なお、本実施の形態では、左右のカメラ11a及び11bの配置が適切である場合を想定している。すなわち、図15に示すように、カメラ11a及び11bの光軸中心OAa及びOAbが基線BL方向に垂直であり、且つ、光軸中心OAa及びOAbが互いに平行であり、且つ、カメラ11a及び11bの水平スキャン方向と基線BL方向とが平行あり、且つ、カメラ11a及び11bに画像歪がない場合を想定している。基準画像中の着目点に対応する参照画像中の対応点は、当該着目点の画素座標のy座標と、画素座標のy座標が同じであるx軸方向の水平ライン中に存在する。上記のカメラ11a及び11bの配置によるステレオ画像の撮像を平行撮像と呼ぶ。カメラ11a及び11bの配置が、平行撮像の配置からずれている、又は、撮像画像の歪みが無視できない程大きい場合には、水平拡大部101により水平拡大を行う前又は後に、歪み補正及び画像の平行化処理を行うことで、歪みを有さず且つ平行撮像による画像となるように、画像を補正してもよい。また、図17に示すように、カメラ11a及び11bが上下方向に離して配置される場合、基準画像中の着目点に対応する参照画像中の対応点は、当該着目点の画素座標のx座標と、画素座標のx座標が同じであるy軸方向の垂直コラム中に存在する。   In the present embodiment, it is assumed that the arrangement of the left and right cameras 11a and 11b is appropriate. That is, as shown in FIG. 15, the optical axis centers OAa and OAb of the cameras 11a and 11b are perpendicular to the direction of the base line BL, and the optical axis centers OAa and OAb are parallel to each other and the cameras 11a and 11b. It is assumed that the horizontal scanning direction and the base line BL direction are parallel and that there is no image distortion in the cameras 11a and 11b. The corresponding point in the reference image corresponding to the point of interest in the reference image exists in the horizontal line in the x-axis direction in which the y coordinate of the pixel coordinates of the point of interest and the y coordinate of the pixel coordinates are the same. The imaging of stereo images by the arrangement of the cameras 11a and 11b is called parallel imaging. When the arrangement of the cameras 11a and 11b deviates from the arrangement of parallel imaging, or distortion of the captured image is so large that it can not be ignored, distortion correction and image distortion are performed before or after horizontal enlargement is performed by the horizontal enlargement unit 101. By performing the parallelization process, the image may be corrected so as to be an image obtained by parallel imaging without distortion. Further, as shown in FIG. 17, when the cameras 11a and 11b are arranged apart in the vertical direction, the corresponding point in the reference image corresponding to the focused point in the reference image is the x coordinate of the pixel coordinates of the focused point. And the x-coordinates of the pixel coordinates are in the same vertical column in the y-axis direction.

さらに、実施の形態1に係る視差値算出装置100の動作を説明する。図23は、実施の形態1に係る視差値算出装置100の動作の一例を示すフローチャートである。まず、ステップS101において、水平拡大部101は、記憶部20から、カメラ11a及び11bそれぞれにより撮像された撮像画像I1及びI2を取得する。撮像画像I1及びI2は、同じ被写体を写し出す画像であり、同じ時刻にカメラ11a及び11bにより撮像された画像である。つまり、撮像画像I1及びI2は、ステレオ画像である。   Furthermore, the operation of disparity value calculation apparatus 100 according to the first embodiment will be described. FIG. 23 is a flowchart showing an example of the operation of the disparity value calculating device 100 according to Embodiment 1. First, in step S101, the horizontal enlargement unit 101 obtains, from the storage unit 20, captured images I1 and I2 captured by the cameras 11a and 11b, respectively. The captured images I1 and I2 are images that capture the same subject, and are images captured by the cameras 11a and 11b at the same time. That is, the captured images I1 and I2 are stereo images.

次いで、ステップS102において、水平拡大部101は、撮像画像I1及びI2それぞれを、視差探索方向である画素座標のx軸方向、つまり水平方向に、所定の水平拡大率で拡大することによって、拡大画像I1h及びI2hを生成する。水平拡大部101は、補間拡大により画素数を増やすことよって水平拡大処理をする。本実施の形態では、バイリニア補間が補間拡大の方法として用いられる。   Next, in step S102, the horizontal enlargement unit 101 enlarges the captured images I1 and I2 by enlarging each of the captured images I1 and I2 in the x-axis direction of the pixel coordinates that is the parallax search direction, that is, in the horizontal direction. Generate I1h and I2h. The horizontal enlargement unit 101 performs horizontal enlargement processing by increasing the number of pixels by interpolation enlargement. In the present embodiment, bilinear interpolation is used as a method of interpolation enlargement.

次いで、ステップS103において、センサス変換部102は、拡大画像I1h及びI2hそれぞれをセンサス変換する。センサス変換部102は、拡大画像I1h及びI2hそれぞれの全ての画素をセンサス変換し、各画素のセンサス特徴量を算出する。センサス特徴量は、例えば、図18A、図18B、図19A及び図19Bに示すように、センサス変換される着目画素の周辺画素に対応するビット列であり、「センサスベクトル」とも呼ばれる。   Next, in step S103, the census conversion unit 102 performs census conversion on each of the enlarged images I1h and I2h. The census conversion unit 102 performs census conversion on all the pixels of each of the enlarged images I1h and I2h, and calculates census feature quantities of the respective pixels. For example, as shown in FIGS. 18A, 18B, 19A, and 19B, the census feature value is a bit string corresponding to the peripheral pixels of the pixel of interest subjected to census conversion, and is also referred to as a “sensor vector”.

次いで、ステップS104において、相違度算出部103は、拡大画像I1h及びI2hのうちの一方の基準画像の各画素について、拡大画像I1h及びI2hのうちの他方の参照画像に対する相違度を算出する。本実施の形態では、相違度算出部103は、図15に示すように左側に位置するカメラ11aに対応する拡大画像I1hを、基準画像に決定し、拡大画像I2hを参照画像に決定するが、これに限定されない。基準画像及び参照画像の決定は、予め決められた規則に従って行われてもよく、図示しない入力装置を介したユーザによる指令に従って行われてもよい。相違度算出部103は、基準画像I1hの着目画素について、例えば、図20に示すような、参照画像I2hにおける着目画素に対応する探索範囲の参照画素それぞれと着目画素との間で、センサス特徴量の相違度を算出する。相違度算出部103は、基準画像I1hの全ての画素を着目画素として、相違度を算出する。本実施の形態では、相違度は、着目画素及び参照画素のセンサス特徴量間のハミング距離である。例えば、探索範囲内の参照画素の数量がk+1個である場合、1つの着目画素に対してk+1個の相違度が算出される。   Next, in step S104, the degree-of-difference calculation unit 103 calculates the degree of difference with respect to the other reference image of the enlarged images I1h and I2h for each pixel of one of the enlarged images I1h and I2h. In the present embodiment, the degree-of-difference calculation unit 103 determines the enlarged image I1h corresponding to the camera 11a located on the left side as a reference image and determines the enlarged image I2h as a reference image as shown in FIG. It is not limited to this. The determination of the reference image and the reference image may be performed in accordance with a predetermined rule, or may be performed in accordance with a command from the user via an input device (not shown). The degree-of-difference calculation unit 103 determines, for example, the census feature value between the reference pixels in the search range corresponding to the pixel of interest in the reference image I2h and the pixel of interest for the pixel of interest in the reference image I1h. Calculate the degree of difference of The dissimilarity calculation unit 103 calculates the dissimilarity using all pixels of the reference image I1h as a pixel of interest. In the present embodiment, the degree of difference is the Hamming distance between census feature quantities of the pixel of interest and the reference pixel. For example, when the number of reference pixels in the search range is k + 1, k + 1 differences are calculated for one target pixel.

次いで、ステップS105において、視差選択部104は、基準画像I1hの各画素について、算出された相違度に基づき、当該画素の視差値を決定する。視差選択部104は、例えば、図22に示すように、基準画像I1hの着目画素に対応する相違度から最小の相違度を抽出し、最小の相違度に対応する参照画素と着目画素との視差値を特定する。視差値は、例えば、図20に示すように、着目画素I1hpに対応する参照画像I2hの対応画素I2hpに対する参照画素の位置から、算出可能である。視差選択部104は、基準画像I1h内で、全ての画素を着目画素として順次走査することにより、基準画像I1h内の全ての画素の視差値を決定する。これにより、視差選択部104は基準画像I1hの視差画像を生成する。 Next, in step S105, the parallax selection unit 104 determines, for each pixel of the reference image I1h, the parallax value of the pixel based on the calculated degree of difference. For example, as illustrated in FIG. 22, the parallax selection unit 104 extracts the minimum difference degree from the difference degree corresponding to the target pixel of the reference image I1h, and generates the parallax between the reference pixel corresponding to the minimum difference degree and the target pixel. Identify the value. The parallax value can be calculated, for example, from the position of the reference pixel with respect to the corresponding pixel I2hp m of the reference image I2h corresponding to the target pixel I1hp as shown in FIG. The parallax selection unit 104 determines the parallax value of all the pixels in the reference image I1h by sequentially scanning all the pixels as a target pixel in the reference image I1h. Thereby, the parallax selection unit 104 generates a parallax image of the reference image I1h.

次いで、ステップS106において、水平縮小部105は、視差画像を、ステップS102における水平拡大率に応じた水平縮小率で縮小することによって、縮小視差画像を生成する。このとき、水平縮小部105は、視差画像において、水平方向つまりx軸方向で隣り合う複数の画素を統合することによって、撮像画像I1と同じ画素数の縮小視差画像を生成する。水平縮小部105は、複数の画素の統合の際、画素値である視差値も、水平縮小率で縮小する。これにより、縮小視差画像は、水平拡大前のスケールにおける視差値を画素値として含む。例えば、ステップS102での水平拡大率が2倍の場合、水平縮小率は2分の1であり、水平拡大率が4倍の場合、水平縮小率は4分の1である。縮小視差画像は、前者の場合、2分の1画素精度の視差値を含み、後者の場合、4分の1画素精度の視差値を含む。   Next, in step S106, the horizontal reduction unit 105 generates a reduced parallax image by reducing the parallax image at the horizontal reduction ratio according to the horizontal enlargement ratio in step S102. At this time, the horizontal reduction unit 105 generates a reduced parallax image having the same number of pixels as the captured image I1 by integrating a plurality of pixels adjacent in the horizontal direction, that is, in the x-axis direction in the parallax image. When integrating a plurality of pixels, the horizontal reduction unit 105 reduces the parallax value, which is the pixel value, at the horizontal reduction rate. Thus, the reduced parallax image includes, as pixel values, parallax values at the scale before horizontal enlargement. For example, when the horizontal enlargement ratio in step S102 is double, the horizontal reduction ratio is half, and when the horizontal enlargement ratio is four, the horizontal reduction ratio is quarter. The reduced parallax image includes parallax values with half pixel accuracy in the former case, and includes parallax values with quarter pixel accuracy in the latter case.

なお、左右のカメラ11a及び11bの配置が適切でない場合、ステップS102又はステップS103の前に、画像の歪み補正及び平行化処理等を行ってもよい。またその際、平行化に伴う画像中心(図15及び図17における光軸中心OAa及びOAbの画像中での位置)の移動を考慮し、初期視差画像における視差値の初期値を0以外の値に設定するようにしてもよい。   If the arrangement of the left and right cameras 11a and 11b is not appropriate, distortion correction and parallelization processing of an image may be performed before step S102 or step S103. Also, at that time, considering the movement of the image center (the position in the image of the optical axis centers OAa and OAb in FIGS. 15 and 17) accompanying the parallelization, the initial value of the parallax value in the initial parallax image is a value other than 0. It may be set to

上述したように、実施の形態1に係る視差値算出装置100は、カメラ11aで撮像された撮像画像I1と、カメラ11bで撮像された撮像画像I2とを記憶部20から取得し、撮像画像I1に対して、予め定められた視差方向への拡大処理により、画素の数を増やすことによって、拡大画像I1hを生成し、撮像画像I2に対して、予め定められた視差方向への拡大処理により、画素の数を増やすことによって、拡大画像I2hを生成する。さらに、視差値算出装置100は、拡大画像I1hの複数の第1の画素毎に第1のセンサス特徴量を算出し、拡大画像I2hの複数の第2の画素毎に第2のセンサス特徴量を算出し、複数の第1の画素それぞれについて、第1のセンサス特徴量と、少なくとも1つの第2の画素それぞれの第2のセンサス特徴量とを用いて、少なくとも1つの第2の画素それぞれの位置での視差値に対応する相違度を算出する。視差値算出装置100は、複数の第1の画素それぞれについて、相違度を用いて、最も小さい相違度に対応する視差値を選択することにより、拡大画像I1hに対応する視差画像における画素毎の視差値を取得し、視差画像の画素毎の視差値に対して、縮小処理をすることにより、撮像画像I2に対する撮像画像I1の画素毎の視差値を算出する。   As described above, the parallax value calculation device 100 according to the first embodiment acquires the captured image I1 captured by the camera 11a and the captured image I2 captured by the camera 11b from the storage unit 20, and captures the captured image I1. On the other hand, the magnified image I1h is generated by increasing the number of pixels by the enlargement process in the predetermined parallax direction, and the enlargement process in the predetermined parallax direction is performed on the captured image I2. An enlarged image I2h is generated by increasing the number of pixels. Furthermore, the parallax value calculation device 100 calculates a first census feature amount for each of a plurality of first pixels of the enlarged image I1h, and a second census feature amount for each of a plurality of second pixels of the enlarged image I2h. The position of each of at least one second pixel is calculated using the first census feature and the second census feature of each at least one second pixel for each of the plurality of first pixels. The degree of difference corresponding to the disparity value at is calculated. The parallax value calculation device 100 selects, for each of the plurality of first pixels, the parallax value corresponding to the smallest degree of difference using the degree of difference, whereby the parallax for each pixel in the parallax image corresponding to the enlarged image I1 h The parallax value of each pixel of the captured image I1 with respect to the captured image I2 is calculated by obtaining a value and performing reduction processing on the disparity value of each pixel of the parallax image.

上記構成によると、視差値算出装置100は、拡大画像I1h及びI2hを用いて、基準画像である拡大画像I1hの各画素に対応する視差画像の各画素の視差値を、整数精度で算出する。拡大画像I1h及びI2hは、同じ方向に拡大されているため、上記の視差値の算出は簡易である。上述のような視差画像が縮小処理されることによって得られる視差値は、1画素未満の精度、つまりサブピクセル精度である。よって、視差値算出装置100は、複数の画像間の視差値を高い精度で算出することができる。より具体的には、視差値算出装置100は、ハミング距離である相違度が最小となる整数画素精度の視差値付近でサブピクセル精度の視差値を算出することができる。なお、拡大画像I2hが基準画像である場合も同様である。   According to the above configuration, the parallax value calculation device 100 calculates the parallax value of each pixel of the parallax image corresponding to each pixel of the enlarged image I1h, which is the reference image, using the enlarged images I1h and I2h with integer accuracy. Since the magnified images I1h and I2h are magnified in the same direction, the calculation of the parallax value is easy. The parallax value obtained by performing the reduction process on the parallax image as described above has an accuracy of less than one pixel, that is, sub-pixel accuracy. Therefore, the disparity value calculating device 100 can calculate disparity values between a plurality of images with high accuracy. More specifically, the disparity value calculating device 100 can calculate sub-pixel accuracy disparity values in the vicinity of disparity values of integer pixel accuracy at which the degree of difference which is the Hamming distance is minimum. The same applies to the case where the enlarged image I2h is a reference image.

また、実施の形態1に係る視差値算出装置100において、相違度は、第1のセンサス特徴量と第2のセンサス特徴量との間のハミング距離であるため、相違度の算出が簡易である。よって、視差値算出装置100は、複数の画像間の視差値を、高い精度で且つ簡易に算出することができる。   Further, in the parallax value calculation device 100 according to the first embodiment, the degree of difference is the Hamming distance between the first census feature amount and the second census feature amount, so that the calculation of the degree of difference is easy. . Therefore, the disparity value calculating device 100 can calculate disparity values between a plurality of images with high accuracy and easily.

[実施の形態2]
実施の形態1に係る視差値算出装置100は、カメラ11a及び11bに対応する拡大画像I1h及びI2hの一方を基準画像とし、他方を参照画像と決定し、基準画像の画素に対応する視差値を算出した。実施の形態2に係る視差値算出装置200は、拡大画像I1h及びI2hそれぞれを基準画像に決定し、各基準画像に対応する視差値を比較することによって、視差値の一貫性をチェックする。つまり、実施の形態2に係る視差値算出装置200は、視差値の算出結果の信頼性を高めるために、双方向の視差値の算出を行い、視差値の算出結果の比較から一貫性をチェックすることで、視差値の算出精度を高める。実施の形態2において、実施の形態1と同様の構成要素については、実施の形態1と同一の参照符号を付し、その説明を省略する。以下において、実施の形態1と異なる点を中心に説明し、実施の形態1と同様の点の説明を省略する。
Second Embodiment
The disparity value calculating device 100 according to the first embodiment determines one of the enlarged images I1h and I2h corresponding to the cameras 11a and 11b as a reference image, determines the other as a reference image, and sets disparity values corresponding to pixels of the reference image. Calculated. The disparity value calculating device 200 according to Embodiment 2 determines the enlarged images I1h and I2h as reference images, and checks the consistency of disparity values by comparing the parallax values corresponding to the reference images. That is, the parallax value calculation device 200 according to Embodiment 2 calculates bidirectional parallax values in order to enhance the reliability of the parallax value calculation results, and checks the consistency based on the comparison of the parallax value calculation results. By doing this, the calculation accuracy of the parallax value is improved. In Embodiment 2, about the component similar to Embodiment 1, the same referential mark as Embodiment 1 is attached | subjected, and the description is abbreviate | omitted. In the following, differences from the first embodiment will be mainly described, and description of the same points as the first embodiment will be omitted.

図24は、実施の形態2に係る視差値算出装置200の機能的な構成の一例のブロック図を示す。図24に示すように、視差値算出装置200は、水平拡大部101と、センサス変換部102と、相違度算出部103と、第一視差選択部204aと、第二視差選択部204bと、L/Rチェック部(「左右チェック部」とも呼ぶ)206と、水平縮小部105とを含む。   FIG. 24 shows a block diagram of an example of a functional configuration of the disparity value calculating device 200 according to Embodiment 2. As shown in FIG. 24, the disparity value calculating device 200 includes a horizontal enlargement unit 101, a census conversion unit 102, a dissimilarity calculation unit 103, a first disparity selection unit 204a, a second disparity selection unit 204b, and L. / R check unit (also referred to as "left / right check unit") 206 and a horizontal reduction unit 105.

相違度算出部103は、カメラ11a及び11bの撮像画像I1及びI2それぞれに対応する拡大画像I1h及びI2hそれぞれを基準画像として、基準画像の各画素の相違度を算出する。具体的には、相違度算出部103は、第一基準画像である拡大画像I1h中の各画素に関して、第一参照画像である拡大画像I2hの探索範囲中の各画素に対して、つまり、探索範囲中の各視差値について、センサス特徴量の相違度を算出する。同様に、相違度算出部103は、第二基準画像である拡大画像I2h中の各画素に関して、第二参照画像である拡大画像I1hの探索範囲中の各画素に対して、センサス特徴量の相違度を算出する。   The dissimilarity calculating unit 103 calculates the dissimilarity of each pixel of the reference image using each of the enlarged images I1h and I2h corresponding to the captured images I1 and I2 of the cameras 11a and 11b as a reference image. Specifically, the degree-of-difference calculation unit 103 searches for each pixel in the search range of the enlarged image I2h which is the first reference image with respect to each pixel in the enlarged image I1h which is the first reference image, that is, searching The degree of difference of the census feature value is calculated for each parallax value in the range. Similarly, with respect to each pixel in the enlarged image I2h which is the second reference image, the difference degree calculation unit 103 determines the difference in census feature value with respect to each pixel in the search range of the enlarged image I1h which is the second reference image. Calculate the degree.

第一視差選択部204aは、拡大画像I1hの各画素に対して算出された相違度について、当該画素の相違度のうちから最小の相違度を抽出し、最小の相違度を与える拡大画像I2hの画素の視差値を特定する。そして、第一視差選択部204aは、拡大画像I1hの視差画像を、第一基準画像の視差画像として生成する。   The first disparity selection unit 204a extracts the smallest difference degree from among the difference degrees of the pixels for the difference degree calculated for each pixel of the enlarged image I1h, and gives the minimum difference degree of the enlarged image I2h Identify the disparity value of the pixel. Then, the first parallax selection unit 204a generates a parallax image of the enlarged image I1h as a parallax image of the first reference image.

第二視差選択部204bは、拡大画像I2hの各画素に対して算出された相違度について、当該画素の相違度のうちから最小の相違度を抽出し、最小の相違度を与える拡大画像I1hの画素の視差値を特定する。そして、第二視差選択部204bは、拡大画像I2hの視差画像を、第二基準画像の視差画像として生成する。   The second parallax selection unit 204b extracts the smallest difference degree from among the difference degrees of the pixels for the difference degree calculated for each pixel of the enlarged image I2h, and gives the minimum difference degree of the enlarged image I1h Identify the disparity value of the pixel. Then, the second parallax selection unit 204b generates a parallax image of the enlarged image I2h as a parallax image of the second reference image.

L/Rチェック部206は、第一基準画像の視差画像と、第二基準画像の視差画像との間の一貫性をチェックする。つまり、L/Rチェック部206は、拡大画像I1hの視差画像と、拡大画像I2hの視差画像との間の一貫性をチェックする。L/Rチェック部206は、一貫性のチェックに、以下の式2を用いる。   The L / R check unit 206 checks consistency between the parallax image of the first reference image and the parallax image of the second reference image. That is, the L / R check unit 206 checks the consistency between the parallax image of the enlarged image I1h and the parallax image of the enlarged image I2h. The L / R check unit 206 uses the following Equation 2 to check the consistency.

上記の式2において、d1は、拡大画像I1hの着目画素の視差値である。x’は、水平拡大後の拡大画像I1hにおける画素のx座標を示し、(x’,y)は、着目画素の画素座標である。x’+d1(x’,y)は、拡大画像I1hの着目画素の視差値に対応する位置の拡大画像I2hの画素である視差対応画素のx座標を示す。d2は、拡大画像I2hの上記視差対応画素の視差値である。x’+d1(x’,y)+d2(x’+d1(x’,y),y)は、拡大画像I2hの上記視差対応画素の視差値に対応する位置の拡大画像I1hの画素のx座標を示す。このような式2は、拡大画像I1hを基準にした視差値と、拡大画像I2hを基準とした視差値との差異を表す。上記の式2の値が所定の閾値以下である場合、拡大画像I1hの着目画素の視差値の信頼性が高く、拡大画像I1hを基準にした視差値と、拡大画像I2hを基準とした視差値との間に一貫性がある見なすことができる。上記の式2の値が所定の閾値よりも大きい場合、拡大画像I1hの着目画素の視差値の信頼性が低く、上記一貫性がないと見なすことができる。上記閾値は、要求される一貫性の程度に応じて予め決められる。上記閾値の例は、1画素である。   In Equation 2 above, d1 is the parallax value of the target pixel of the enlarged image I1h. x 'indicates the x coordinate of the pixel in the enlarged image I1h after horizontal enlargement, and (x', y) is the pixel coordinate of the target pixel. x '+ d1 (x', y) indicates the x coordinate of a parallax corresponding pixel which is a pixel of the enlarged image I2h at a position corresponding to the parallax value of the focused pixel of the enlarged image I1h. d2 is a parallax value of the parallax corresponding pixel of the enlarged image I2h. x ′ + d1 (x ′, y) + d2 (x ′ + d1 (x ′, y), y) is the x coordinate of the pixel of the enlarged image I1h at a position corresponding to the parallax value of the parallax corresponding pixel of the enlarged image I2h Show. Such equation 2 represents the difference between the parallax value based on the enlarged image I1 h and the parallax value based on the enlarged image I2 h. When the value of Equation 2 is equal to or less than a predetermined threshold, the reliability of the parallax value of the pixel of interest of enlarged image I1h is high, and the parallax value based on enlarged image I1h and the parallax value based on enlarged image I2h It can be regarded as consistent with. If the value of Equation 2 is larger than a predetermined threshold, the reliability of the parallax value of the target pixel of the enlarged image I1h is low, and it can be considered that the above-mentioned consistency is not present. The threshold is predetermined according to the degree of consistency required. An example of the threshold is one pixel.

L/Rチェック部206は、上記の式2の値が所定の閾値以下である場合、視差値d1をそのまま、拡大画像I1hの着目画素(x’,y)の視差値に決定し出力する。一方、L/Rチェック部206は、上記の式2の値が閾値よりも大きい場合には、拡大画像I1hの着目画素(x’,y)の視差値を、例えば探索範囲に含まれる視差値以外の特定の値に変更し出力する。この特定の値は、視差値の一貫性がないことを示す値である。例えば、図20に示すように、探索範囲が0画素から−k画素である場合、上記の特定の値は、−k画素未満の値であってもよい。L/Rチェック部206は、上述のように、拡大画像I1hの視差画像における各画素の視差値を、一貫性の有無に基づき、維持又は変更することによって、新たな視差画像を生成する。   The L / R check unit 206 determines and outputs the parallax value d1 as the parallax value of the pixel of interest (x ', y) of the enlarged image I1h as it is, when the value of the equation 2 is equal to or less than a predetermined threshold. On the other hand, when the value of Equation 2 above is larger than the threshold value, the L / R check unit 206 detects the disparity value of the pixel of interest (x ′, y) of the enlarged image I1h, for example, the disparity value included in the search range Change to a specific value other than and output. This particular value is a value indicating that the disparity values are not consistent. For example, as shown in FIG. 20, when the search range is from 0 pixel to −k pixel, the above specific value may be a value less than −k pixel. As described above, the L / R check unit 206 generates a new parallax image by maintaining or changing the parallax value of each pixel in the parallax image of the enlarged image I1h based on the presence or absence of consistency.

水平縮小部105は、L/Rチェック部206によって生成された新たな視差画像を、水平拡大部101における水平拡大率に応じた水平縮小率で縮小し、水平拡大前の撮像画像と同じ画素数の縮小視差画像を生成する。具体的には、水平縮小部105は、拡大画像I1hの視差画像から生成された新たな視差画像を縮小する。水平縮小部105は、複数の画素を統合する際、視差値の一貫性がある画素の視差値を、上記水平縮小率で縮小し、統合後の画素の画素値に決定する。このような統合後の画素の視差値は、水平拡大前のスケールにおける視差値を示す。一方、水平縮小部105は、視差値の一貫性がない画素の視差値については、視差値の一貫性がないことを示す上記の特定の値を、縮小せずに、統合後の画素の画素値に決定する。これにより、水平縮小部105が出力する縮小視差画像では、視差値の一貫性がある画素は、算出されたサブピクセル精度の視差値を画素値として含み、視差値の一貫性がない画素は、一貫性つまり信頼性が低いことを示す例外値を画素値として含む。   The horizontal reduction unit 105 reduces the new parallax image generated by the L / R check unit 206 at a horizontal reduction ratio according to the horizontal enlargement ratio in the horizontal enlargement unit 101, and the same number of pixels as the captured image before horizontal enlargement. To generate a reduced parallax image of Specifically, the horizontal reduction unit 105 reduces a new parallax image generated from the parallax image of the enlarged image I1h. When integrating a plurality of pixels, the horizontal reduction unit 105 reduces the parallax value of the pixel having a consistent parallax value at the above horizontal reduction ratio, and determines the pixel value of the pixel after integration. The parallax value of the pixel after such integration indicates the parallax value at the scale before horizontal enlargement. On the other hand, the horizontal reduction unit 105 does not reduce the above specific value indicating that the parallax value is not consistent with respect to the parallax value of the pixel that is not consistent in parallax value, and does not reduce the pixel of the pixel after integration. Determine the value. Accordingly, in the reduced parallax image output by the horizontal reduction unit 105, the pixel having consistency of parallax values includes the calculated parallax value of sub-pixel accuracy as a pixel value, and the pixel having inconsistency of parallax values is: An exception value indicating consistency or low reliability is included as the pixel value.

図25を参照しつつ、視差値算出装置200の動作を説明する。図25は、実施の形態2に係る視差値算出装置200の動作の一例を示すフローチャートである。視差値算出装置200は、ステップS101〜S103の処理を、実施の形態1と同様に行う。   The operation of the disparity value calculating device 200 will be described with reference to FIG. FIG. 25 is a flowchart showing an example of the operation of the disparity value calculating device 200 according to Embodiment 2. The disparity value calculating device 200 performs the processes of steps S101 to S103 as in the first embodiment.

次いで、ステップS201において、相違度算出部103は、拡大画像I1hを第一基準画像として、第一参照画像である拡大画像I2hに対する相違度を、拡大画像I1hの各画素について算出する。さらに、相違度算出部103は、拡大画像I2hを第二基準画像として、第二参照画像である拡大画像I1hに対する相違度を、拡大画像I2hの各画素について算出する。   Next, in step S201, the dissimilarity calculating unit 103 calculates the dissimilarity to the enlarged image I2h, which is the first reference image, for each pixel of the enlarged image I1h, using the enlarged image I1h as a first reference image. Furthermore, the dissimilarity calculation unit 103 calculates the dissimilarity to the magnified image I1h, which is the second reference image, for each pixel of the magnified image I2h, using the magnified image I2h as a second reference image.

次いで、ステップS202において、第一視差選択部204aは、第一基準画像である拡大画像I1hの各画素について、算出された相違度に基づき、当該画素の視差値を決定する。第一視差選択部204aは、拡大画像I1h内の各画素の輝度値を視差値に置き換えることによって、拡大画像I1h、つまり第一基準画像の視差画像を生成する。   Next, in step S202, the first parallax selection unit 204a determines the parallax value of the pixel based on the calculated degree of difference for each pixel of the enlarged image I1h that is the first reference image. The first parallax selection unit 204a generates a parallax image of the enlarged image I1h, that is, the first reference image by replacing the luminance value of each pixel in the enlarged image I1h with a parallax value.

次いで、ステップS203において、第二視差選択部204bは、第二基準画像である拡大画像I2hの各画素について、算出された相違度に基づき、当該画素の視差値を決定する。第二視差選択部204bは、拡大画像I2h内の各画素の輝度値を視差値に置き換えることによって、拡大画像I2h、つまり第二基準画像の視差画像を生成する。なお、ステップS202及びS203の順序は、逆であってもよい。   Next, in step S203, the second parallax selection unit 204b determines the parallax value of the pixel based on the calculated degree of difference for each pixel of the enlarged image I2h that is the second reference image. The second parallax selection unit 204b generates a parallax image of the enlarged image I2h, that is, the second reference image by replacing the luminance value of each pixel in the enlarged image I2h with a parallax value. The order of steps S202 and S203 may be reversed.

次いで、ステップS204において、L/Rチェック部206は、第一基準画像である拡大画像I1hの視差画像の各画素について、拡大画像I2hの視差画像との間で、視差値の一貫性をチェックする。L/Rチェック部206は、拡大画像I1hの視差画像における各画素の視差値を、一貫性がある場合には維持し、一貫性がない場合には例外的な視差値に変更することによって、新たな視差画像を生成する。   Next, in step S204, the L / R check unit 206 checks, for each pixel of the parallax image of the enlarged image I1h which is the first reference image, the consistency of the parallax value with the parallax image of the enlarged image I2h. . The L / R check unit 206 maintains the parallax value of each pixel in the parallax image of the enlarged image I1h when there is consistency, and changes the parallax value to an exceptional parallax value when there is no consistency. Generate a new parallax image.

次いで、ステップS205において、水平縮小部105は、ステップS204で生成された新たな視差画像を、ステップS102における水平拡大率に応じた水平縮小率で縮小することによって、縮小視差画像を生成する。水平縮小部105は、複数の画素を統合する際、視差値の一貫性がある画素の視差値を、上記水平縮小率で縮小し、統合後の画素の画素値に決定する。水平縮小部105は、視差値の一貫性がない画素については、当該画素に設定された例外的な視差値を、縮小せずに、統合後の画素の画素値に決定する。   Next, in step S205, the horizontal reduction unit 105 generates a reduced parallax image by reducing the new parallax image generated in step S204 at the horizontal reduction ratio according to the horizontal enlargement ratio in step S102. When integrating a plurality of pixels, the horizontal reduction unit 105 reduces the parallax value of the pixel having a consistent parallax value at the above horizontal reduction ratio, and determines the pixel value of the pixel after integration. The horizontal reduction unit 105 determines the exceptional parallax value set for the pixel having no consistency of parallax value as the pixel value of the pixel after integration without reducing the parallax value.

上述のような実施の形態2に係る視差値算出装置200によれば、実施の形態1と同様の効果が得られる。さらに、視差値算出装置200は、カメラ11aの撮像画像I1の拡大画像I1hを基準画像とし且つカメラ11bの撮像画像I2の拡大画像I2hを参照画像とする場合の拡大画像I1hの各画素の視差値を算出する。さらに、視差値算出装置200は、拡大画像I2hを基準画像とし且つ拡大画像I1hを参照画像とする場合の拡大画像I2hの各画素の視差値を算出する。視差値算出装置200は、拡大画像I1hを基準にした視差値と、拡大画像I2hを基準とした視差値との差異に基づき、視差値の一貫性を決定し、一貫性のある視差値を画素に適用し、一貫性のない視差値を一貫性が低いことを示す値に置き換えて画素に適用する。そして、視差値算出装置200は、各画素の視差値の一貫性の有無の判別が容易である視差画像を生成する。よって、視差値算出装置200は、複数の画像間の視差値を高い精度及び信頼性で算出することができる。   According to the disparity value calculating device 200 according to the second embodiment as described above, the same effect as that of the first embodiment can be obtained. Furthermore, the parallax value calculation device 200 sets the parallax value of each pixel of the enlarged image I1h when the enlarged image I1h of the captured image I1 of the camera 11a is a reference image and the enlarged image I2h of the captured image I2 of the camera 11b is a reference image. Calculate Furthermore, the parallax value calculation device 200 calculates the parallax value of each pixel of the enlarged image I2h when the enlarged image I2h is a reference image and the enlarged image I1h is a reference image. The disparity value calculating device 200 determines the consistency of the disparity value based on the difference between the disparity value based on the enlarged image I1 h and the disparity value based on the enlarged image I2 h, and the pixels having the consistent disparity value are determined. Apply inconsistent values of disparity to values that indicate low consistency and apply to pixels. Then, the disparity value calculating device 200 generates a disparity image in which it is easy to determine whether the disparity values of the pixels are consistent. Therefore, the disparity value calculating device 200 can calculate disparity values between a plurality of images with high accuracy and reliability.

本実施の形態では、L/Rチェック部206は、拡大画像I1hの視差画像と拡大画像I2hの視差画像との間の視差値の一貫性の有無に応じて、拡大画像I1hの視差画像の各画素の視差値を変更し、新たな視差画像を生成したが、これに限定されない。L/Rチェック部206は、上記一貫性の有無に応じて、拡大画像I2hの視差画像の各画素の視差値を変更し、新たな視差画像を生成してもよい。この場合、水平縮小部105は、拡大画像I2hの視差画像から生成された新たな視差画像を縮小する。   In the present embodiment, L / R check section 206 selects each of the parallax images of enlarged image I1h according to the presence or absence of the consistency of the parallax value between the parallax image of enlarged image I1h and the parallax image of enlarged image I2h. Although the parallax value of the pixel is changed to generate a new parallax image, the present invention is not limited to this. The L / R check unit 206 may change the parallax value of each pixel of the parallax image of the enlarged image I2h according to the presence or absence of the consistency, and generate a new parallax image. In this case, the horizontal reduction unit 105 reduces a new parallax image generated from the parallax image of the enlarged image I2h.

又は、L/Rチェック部206は、拡大画像I1hの視差画像の各画素について、拡大画像I2hの視差画像との間の視差値の一貫性の有無を判定し、且つ、拡大画像I2hの視差画像の各画素について、拡大画像I1hの視差画像との間の視差値の一貫性の有無を判定してもよい。さらに、L/Rチェック部206は、拡大画像I1hの視差画像及び拡大画像I2hの視差画像の対応する2つの画素間で、視差値の一貫性の有無を比較してもよい。この場合、L/Rチェック部206は、対応する2つの画素のいずれもが、視差値の一貫性を有する場合、当該画素それぞれの視差値をそのまま採用し、対応する2つの画素のいずれもが、視差値の一貫性を有さない場合、当該画素それぞれの視差値を上記特定の値に変更する。また、L/Rチェック部206は、対応する2つの画素の一方が、視差値の一貫性を有し、且つ他方が視差値の一貫性を有さない場合、当該画素それぞれの視差値として、一貫性を有する画素の視差値を採用してもよく、上記特定の値を採用してもよい。   Alternatively, the L / R check unit 206 determines, for each pixel of the parallax image of the enlarged image I1h, whether the parallax value with the parallax image of the enlarged image I2h is consistent or not, and the parallax image of the enlarged image I2h The presence or absence of the consistency of the parallax value with the parallax image of the enlarged image I1 h may be determined for each of the pixels. Furthermore, the L / R check unit 206 may compare the presence or absence of the consistency of the parallax value between corresponding two pixels of the parallax image of the enlarged image I1h and the parallax image of the enlarged image I2h. In this case, when both of the corresponding two pixels have the consistency of the parallax value, the L / R check unit 206 adopts the parallax value of each pixel as it is, and both of the corresponding two pixels When the parallax value does not have consistency, the parallax value of each of the pixels is changed to the specific value. When one of the two corresponding pixels has the consistency of parallax values and the other does not have the consistency of parallax values, the L / R check unit 206 sets the parallax values of the respective pixels as: A disparity value of pixels having consistency may be adopted, or the above specific value may be adopted.

[実施の形態3]
実施の形態3に係る視差値算出装置300を説明する。実施の形態3に係る視差値算出装置300は、実施の形態2に係る視差値算出装置200と比較して、画像を縮小及び拡大する処理をさらに行う。具体的には、実施の形態2に係る視差値算出装置200は、水平方向の画像の拡大及び縮小のみを行ったが、実施の形態3に係る視差値算出装置300は、垂直方向の画像の縮小及び拡大をさらに行う。実施の形態3において、実施の形態1又は2と同様の構成要素については、実施の形態1及び2と同一の参照符号を付し、その説明を省略する。以下において、実施の形態1及び2と異なる点を中心に説明し、実施の形態1又は2と同様の点の説明を省略する。
Third Embodiment
A disparity value calculating device 300 according to Embodiment 3 will be described. The disparity value calculating device 300 according to the third embodiment further performs processing of reducing and enlarging an image, as compared with the disparity value calculating device 200 according to the second embodiment. Specifically, the parallax value calculation device 200 according to the second embodiment only performs enlargement and reduction of the image in the horizontal direction, but the parallax value calculation device 300 according to the third embodiment Make further reductions and enlargements. In Embodiment 3, about the component similar to Embodiment 1 or 2, the same referential mark as Embodiment 1 and 2 is attached | subjected, and the description is abbreviate | omitted. In the following, differences from Embodiments 1 and 2 will be mainly described, and descriptions of the same points as Embodiments 1 or 2 will be omitted.

図26は、実施の形態3に係る視差値算出装置300の機能的な構成の一例のブロック図を示す。図26に示すように、視差値算出装置300は、縮小部307と、水平拡大部101と、センサス変換部102と、相違度算出部103と、第一視差選択部204aと、第二視差選択部204bと、L/Rチェック部206と、水平縮小部105と、拡大部308と、終了判断部309とを含む。   FIG. 26 shows a block diagram of an example of a functional configuration of disparity value calculation apparatus 300 according to Embodiment 3. As shown in FIG. 26, the parallax value calculation device 300 includes a reduction unit 307, a horizontal enlargement unit 101, a census conversion unit 102, a difference degree calculation unit 103, a first parallax selection unit 204a, and a second parallax selection. It includes a unit 204b, an L / R check unit 206, a horizontal reduction unit 105, an enlargement unit 308, and an end determination unit 309.

縮小部307は、カメラ11a及び11bの撮像画像I1及びI2を、予め定められた縮小率で縮小し、水平拡大部101に出力する。縮小部307は、記憶部20から初期視差画像を取得する、又は拡大部308から視差画像を取得し、当該視差画像を予め定められた縮小率で縮小し、水平拡大部101に出力する。縮小部307は、撮像画像I1及びI2について、通常の等方的な縮小処理を行う、つまり、水平方向及び垂直方向であるx軸方向及びy軸方向に同じ縮小処理を行う。例えば、縮小率が2分の1の場合、撮像画像I1及びI2はそれぞれ、x軸方向の画素数が2分の1に減少され且つy軸方向の画素数が2分の1に減少された画像に、補間縮小によって変換される。本実施の形態では、バイリニア補間が補間縮小の方法として用いられる。   The reduction unit 307 reduces the captured images I1 and I2 of the cameras 11a and 11b at a predetermined reduction ratio, and outputs the reduced images to the horizontal enlargement unit 101. The reduction unit 307 acquires an initial parallax image from the storage unit 20 or acquires a parallax image from the enlargement unit 308, reduces the parallax image at a predetermined reduction ratio, and outputs the reduced parallax image to the horizontal enlargement unit 101. The reduction unit 307 performs normal isotropic reduction processing on the captured images I1 and I2, that is, the same reduction processing in the x-axis direction and the y-axis direction which are the horizontal direction and the vertical direction. For example, when the reduction ratio is 1⁄2, the number of pixels in the x-axis direction is reduced to 1⁄2 and the number of pixels in the y-axis direction is reduced to 1⁄2 in each of the captured images I1 and I2 The image is transformed by interpolation reduction. In the present embodiment, bilinear interpolation is used as a method of interpolation reduction.

縮小部307は、視差画像について、通常の縮小処理に加えて、縮小率に応じて画素値である視差値を縮小(「ゲインダウン」とも呼ばれる)させる。これは、例えば2分の1の縮小率により視差画像の幅が水平方向に2分の1に縮小されると、これに応じて各画素の視差値も縮小前の2分の1の大きさになるためである。   The reduction unit 307 reduces the parallax value (also referred to as “gain down”), which is a pixel value, in accordance with the reduction ratio, in addition to the normal reduction processing, for the parallax image. This is because, for example, when the width of the parallax image is reduced to one half in the horizontal direction at a reduction ratio of one half, the parallax value of each pixel is also half the size before reduction according to this. In order to

縮小部307による縮小処理は、後述する繰り返し処理の回数に応じて複数回行われる。例えば、繰り返し処理の回数が3回の場合、縮小率の一例は、1回目の4分の1の縮小率、2回目の2分の1の縮小率、3回目の等倍の縮小率(すなわち入力信号そのままの出力)である。縮小部307は、1回目の繰り返し処理では、初期視差画像を縮小し、2回目以降の繰り返し処理では、拡大部409から取得する視差画像を縮小する。初期視差画像では、全ての画素の画素値である視差値が0である。   The reduction process by the reduction unit 307 is performed a plurality of times according to the number of repetition processes described later. For example, in the case where the number of iterations is three, an example of the reduction ratio is the first reduction ratio, the second reduction ratio, and the third equal reduction ratio (ie It is an output of the input signal as it is. The reduction unit 307 reduces the initial parallax image in the first iterative process, and reduces the parallax image acquired from the enlargement unit 409 in the second and subsequent iterative processes. In the initial parallax image, the parallax value which is the pixel value of all the pixels is zero.

拡大部308は、水平縮小部105によって出力された縮小視差画像を、縮小部307での縮小率に対応する拡大率で拡大処理をし、縮小部307に出力する。拡大部308は、縮小視差画像について、通常の拡大処理に加えて、拡大率に応じて画素値である視差値を拡大させる。例えば、縮小率が2分の1の場合、拡大部308は、縮小視差画像に対して、2倍の拡大率で通常の補間拡大処理及び各画素の視差値の拡大処理を行う。縮小視差画像は、x軸方向の画素数が2倍に増加され且つy軸方向の画素数が2倍に増加された画像に、補間拡大によって変換される。本実施の形態では、バイリニア補間が補間拡大の方法として用いられる。   The enlargement unit 308 performs enlargement processing on the reduced parallax image output by the horizontal reduction unit 105 at an enlargement ratio corresponding to the reduction ratio in the reduction unit 307, and outputs the enlarged parallax image to the reduction unit 307. The enlargement unit 308 enlarges the parallax value, which is a pixel value, according to the enlargement ratio, in addition to the normal enlargement processing, for the reduced parallax image. For example, when the reduction ratio is half, the enlargement unit 308 performs normal interpolation enlargement processing and enlargement processing of the parallax value of each pixel at a magnification ratio of 2 with respect to the reduction parallax image. The reduced parallax image is converted by interpolation enlargement into an image in which the number of pixels in the x-axis direction is doubled and the number of pixels in the y-axis direction is doubled. In the present embodiment, bilinear interpolation is used as a method of interpolation enlargement.

終了判断部309は、視差画像を算出するための縮小部307での縮小率に基づき、視差値の計算を継続するか終了するかを決定する。終了判断部309は、上記縮小率が1未満の場合、すなわち等倍未満である場合、視差値の計算の継続を決定し、等倍の場合、視差値の計算の終了を決定し、上記視差画像を出力する。   The end determination unit 309 determines whether to continue or end the calculation of the parallax value based on the reduction ratio in the reduction unit 307 for calculating the parallax image. The end determination unit 309 determines continuation of the calculation of the disparity value if the reduction ratio is less than 1, that is, less than equal magnification, and determines the end of the calculation of the disparity value if equal magnification, and determines the disparity Output an image.

図27を参照しつつ、視差値算出装置300の動作を説明する。図27は、実施の形態3に係る視差値算出装置300の動作の一例を示すフローチャートである。まず、ステップS301において、縮小部307は、記憶部20から、カメラ11a及び11bそれぞれにより撮像されたステレオ画像である撮像画像I1及びI2と、初期視差画像Ii1及びIi2とを取得する。初期視差画像Ii1及びIi2はそれぞれ、カメラ11a及び11bに対応して予め設定される視差画像であり、初期視差画像Ii1及びIi2の全ての画素の視差値は、0である。   The operation of the disparity value calculation device 300 will be described with reference to FIG. FIG. 27 is a flowchart illustrating an example of the operation of the disparity value calculating device 300 according to the third embodiment. First, in step S301, the reduction unit 307 obtains, from the storage unit 20, captured images I1 and I2 which are stereo images captured by the cameras 11a and 11b, and initial parallax images Ii1 and Ii2. The initial parallax images Ii1 and Ii2 are parallax images set in advance corresponding to the cameras 11a and 11b, respectively, and the parallax values of all pixels of the initial parallax images Ii1 and Ii2 are zero.

次いで、ステップS302において、縮小部307は、撮像画像I1及びI2それぞれを、所定の縮小率Sで通常の縮小処理することによって、縮小画像I1s及びI2sを生成する。縮小部307は、縮小画像I1s及びI2sを、水平拡大部101に出力する。また、縮小部307は、初期視差画像Ii1及びIi2、又は、拡大部308から取得した視差画像Id1及びId2それぞれを、撮像画像I1及びI2と同じ縮小率で縮小し、縮小視差画像Id1s及びId2sを生成する。この際、縮小部307は、各視差画像の各画素の視差値も当該縮小率で縮小する。縮小部307は、縮小視差画像Id1s及びId2sを水平拡大部101に出力する。視差画像Id1及びId2はそれぞれ、撮像画像I1及びI2の視差画像である。   Next, in step S302, the reduction unit 307 generates reduced images I1s and I2s by performing normal reduction processing of the captured images I1 and I2 at a predetermined reduction ratio S. The reduction unit 307 outputs the reduced images I1s and I2s to the horizontal enlargement unit 101. Further, the reduction unit 307 reduces the initial parallax images Ii1 and Ii2 or the parallax images Id1 and Id2 acquired from the enlargement unit 308 at the same reduction ratio as the captured images I1 and I2, respectively, and reduces the reduced parallax images Id1s and Id2s. Generate At this time, the reduction unit 307 reduces the parallax value of each pixel of each parallax image at the reduction rate. The reduction unit 307 outputs the reduced parallax images Id1s and Id2s to the horizontal enlargement unit 101. The parallax images Id1 and Id2 are parallax images of the captured images I1 and I2, respectively.

なお、ステップS301〜S307の一連の処理の繰り返し回数が予め設定され、さらに、各回での縮小率が予め設定され、記憶部20に格納されている。縮小率は、繰り返された回数が多くなるに従い、大きくなる。本実施の形態では、3回の繰り返し処理回数が設定され、1回目、2回目及び3回目の処理の際の縮小率がそれぞれ、4分の1、2分の1、及び等倍に設定されている。縮小部307は、縮小処理の回数をカウントし、カウント数を繰り返し処理回数として、当該繰り返し処理回数に対応する縮小率で、撮像画像I1及びI2それぞれを縮小し、且つ、初期視差画像Ii1及びIi2又は視差画像Id1及びId2を縮小する。縮小部307は、1回目の繰り返し処理では、初期視差画像Ii1及びIi2を縮小し、2回目以降の繰り返し処理では、視差画像Id1及びId2を縮小する。また、縮小率が等倍の場合、縮小部307は、撮像画像I1及びI2並びに視差画像Id1及びId2を縮小せずにそのまま、出力する。初期視差画像Ii1及びIi2の各画素の視差値は、0である。   The number of repetitions of the series of processes in steps S301 to S307 is set in advance, and the reduction ratio at each time is set in advance and stored in the storage unit 20. The reduction rate increases as the number of repetitions increases. In the present embodiment, the number of times of repeated processing is set three times, and the reduction ratio at the time of the first, second and third processing is set to one fourth, one second, and one time, respectively. ing. The reduction unit 307 counts the number of times of reduction processing, and reduces the captured images I1 and I2 at a reduction ratio corresponding to the number of repetition processing, with the count number as the number of repetition processing, and the initial parallax images Ii1 and Ii2 Alternatively, the parallax images Id1 and Id2 are reduced. The reduction unit 307 reduces the initial parallax images Ii1 and Ii2 in the first iterative process, and reduces the parallax images Id1 and Id2 in the second and subsequent iterative processes. When the reduction ratio is equal, the reduction unit 307 outputs the captured images I1 and I2 and the parallax images Id1 and Id2 as they are without reducing them. The parallax value of each pixel of the initial parallax images Ii1 and Ii2 is zero.

次いで、ステップS303において、水平拡大部101は、縮小画像I1s及びI2sそれぞれを、所定の水平拡大率Hで拡大することによって、拡大画像I1sh及びI2shを生成する。また、水平拡大部101は、縮小視差画像Id1s及びId2sそれぞれを、水平拡大率Hで拡大することによって、拡大視差画像Id1sh及びId2shを生成する。この際、水平拡大部101は、縮小視差画像Id1s及びId2sの各画素の視差値も水平拡大率Hで拡大する。水平拡大部101は、拡大画像I1sh及びI2shをセンサス変換部102に出力し、拡大視差画像Id1sh及びId2shを相違度算出部103に出力する。   Next, in step S303, the horizontal enlargement unit 101 generates enlarged images I1sh and I2sh by enlarging the reduced images I1s and I2s, respectively, at a predetermined horizontal enlargement ratio H. Further, the horizontal enlargement unit 101 generates the enlarged parallax images Id1sh and Id2sh by enlarging the reduced parallax images Id1s and Id2s at the horizontal enlargement ratio H, respectively. At this time, the horizontal enlargement unit 101 also enlarges the parallax value of each pixel of the reduced parallax images Id1s and Id2s at the horizontal enlargement ratio H. The horizontal enlargement unit 101 outputs the enlarged images I1sh and I2sh to the census conversion unit 102, and outputs the enlarged parallax images Id1sh and Id2sh to the dissimilarity calculation unit 103.

拡大画像I1sh及びI2shそれぞれのx軸方向の画素数は、撮像画像I1及びI2それぞれのx軸方向の画素数のH/S倍である。拡大画像I1sh及びI2shそれぞれのy軸方向の画素数は、撮像画像I1及びI2それぞれのy軸方向の画素数の1/S倍である。拡大視差画像Id1sh及びId2shそれぞれのx軸方向の画素数及びy軸方向の画素数は、拡大画像I1sh及びI2shと同じであり、初期視差画像Ii1及びIi2又は視差画像Id1及びId2それぞれのx軸方向の画素数のH/S倍であり、y軸方向の画素数の1/S倍である。拡大視差画像Id1sh及びId2shそれぞれの各画素の視差値は、初期視差画像Ii1及びIi2又は視差画像Id1及びId2それぞれの各画素の視差値のH/S倍である。   The number of pixels in the x-axis direction of each of the enlarged images I1sh and I2sh is H / S times the number of pixels in the x-axis direction of each of the captured images I1 and I2. The number of pixels in the y-axis direction of each of the enlarged images I1sh and I2sh is 1 / S times the number of pixels in the y-axis direction of each of the captured images I1 and I2. The number of pixels in the x-axis direction and the number of pixels in the y-axis direction of the enlarged parallax images Id1sh and Id2sh are the same as those of the enlarged images I1sh and I2sh, and the initial parallax images Ii1 and Ii2 or the parallax images Id1 and Id2 in the x-axis direction H / S times the number of pixels, and 1 / S times the number of pixels in the y-axis direction. The parallax value of each pixel of each of the enlarged parallax images Id1sh and Id2sh is H / S times the parallax value of each pixel of each of the initial parallax images Ii1 and Ii2 or each of the parallax images Id1 and Id2.

次いで、ステップS304において、センサス変換部102は、実施の形態1におけるステップS103と同様に、拡大画像I1sh及びI2shそれぞれをセンサス変換する。   Next, in step S304, the census conversion unit 102 performs census conversion on each of the enlarged images I1sh and I2sh, as in step S103 in the first embodiment.

次いで、ステップS305において、相違度算出部103は、実施の形態2のステップS201と同様に、拡大画像I1shを第一基準画像として、第一参照画像である拡大画像I2shに対する相違度を、拡大画像I1shの各画素について算出する。さらに、相違度算出部103は、拡大画像I2shを第二基準画像として、第二参照画像である拡大画像I1shに対する相違度を、拡大画像I2shの各画素について算出する。   Next, in step S305, the degree-of-difference calculation unit 103 sets the degree of difference with respect to the enlarged image I2sh, which is the first reference image, to the enlarged image, using the enlarged image I1sh as the first reference image, as in step S201 of the second embodiment. Calculated for each pixel of I1sh. Furthermore, the dissimilarity calculation unit 103 calculates the dissimilarity to the magnified image I1sh, which is the second reference image, for each pixel of the magnified image I2sh, using the magnified image I2sh as a second reference image.

なお、相違度算出部103は、1回目の繰り返し処理では、予め決められた探索範囲に従って、相違度を算出する。具体的には、相違度算出部103は、撮像画像と同じスケールでの予め設定された視差探索範囲と、縮小率と、水平拡大率とに基づき、探索範囲を決定する。例えば、1回目の繰り返し処理における縮小率が4分の1であり、水平拡大率が2倍であり、撮像画像と同じスケールでの視差探索範囲がx軸方向の64画素である場合、探索範囲は、基準画像の着目画素に対応する参照画像の対応画素を中心として、x軸方向で、±64画素×1/4×2=±32画素に決定される。なお、基準画像と参照画像との位置関係、すなわち、基準画像がカメラ11a及び11bの撮像画像I1及びI2のいずれに対応するかが既知の場合、探索範囲は、対応画素からx軸正方向の画素又はx軸負方向画素の一方にすることができる。具体的には、基準画像が撮像画像I1に対応する場合は、図20においてk=32であるケースに該当し、探索範囲は、対応画素に対する−32画素から0画素の範囲である。基準画像が撮像画像I2に対応する場合は、図21においてk=32であるケースに該当し、探索範囲は、対応画素に対する0画素から32画素の範囲である。   In the first iteration, the degree-of-difference calculation unit 103 calculates the degree of difference according to a predetermined search range. Specifically, the degree-of-difference calculation unit 103 determines the search range based on the preset parallax search range, the reduction ratio, and the horizontal enlargement ratio at the same scale as the captured image. For example, if the reduction ratio in the first iteration is 1⁄4, the horizontal enlargement ratio is 2 ×, and the parallax search range at the same scale as the captured image is 64 pixels in the x-axis direction, the search range Is determined to be ± 64 pixels × 1⁄4 × 2 = ± 32 pixels in the x-axis direction with the corresponding pixel of the reference image corresponding to the target pixel of the reference image as the center. When it is known that the positional relationship between the reference image and the reference image, that is, which of the captured images I1 and I2 of the cameras 11a and 11b corresponds to, the search range is from the corresponding pixel to the x-axis positive direction. It can be one of the pixel or the x-axis negative direction pixel. Specifically, when the reference image corresponds to the captured image I1, this corresponds to the case where k = 32 in FIG. 20, and the search range is a range from -32 pixels to 0 pixels with respect to the corresponding pixel. When the reference image corresponds to the captured image I2, this corresponds to the case where k = 32 in FIG. 21, and the search range is the range from 0 pixel to 32 pixels for the corresponding pixel.

2回目以降の繰り返し処理では、相違度算出部103は、直前の繰り返し処理によって得られた視差値の近傍の範囲を探索範囲として、相違度を算出する。具体的には、相違度算出部103は、直前の繰り返し処理によって得られた拡大視差画像Id1sh及びId2shに基づき、参照画像において、着目画素の視差値に対応する位置の画素を、着目画素の対応画素に決定し、当該対応画素のx軸方向での近傍範囲を探索範囲に決定する。例えば、相違度算出部103は、当該対応画素を中心として、x軸方向で、±2画素の範囲を探索範囲に決定する。このような探索範囲は、1回目の繰り返し処理よりも小さくてよい。   In the second and subsequent iterative processes, the dissimilarity calculating unit 103 calculates the dissimilarity using the range in the vicinity of the parallax value obtained by the immediately preceding iterative process as the search range. Specifically, based on the enlarged parallax images Id1sh and Id2sh obtained by the previous repetition processing, the difference degree calculation unit 103 corresponds the pixel of the position corresponding to the parallax value of the pixel of interest in the reference image to the correspondence of the pixel of interest The pixel is determined, and the vicinity range in the x-axis direction of the corresponding pixel is determined as the search range. For example, the dissimilarity calculating unit 103 determines a range of ± 2 pixels as a search range in the x-axis direction with the corresponding pixel as a center. Such a search range may be smaller than the first repeated processing.

ステップS302での縮小率は、処理が繰り返された回数が多くなる従い、大きくなる。このため、繰り返し処理が進行することによって、画素密度が粗である探索から密である探索に移行する。つまり、繰り返し処理による粗密探索が行われる。相違度算出部103は、1回目の繰り返し処理では、容量が小さな低解像度の画像に対する粗な探索を全探索で行った後に、繰り返し処理の回数の増加に応じて、解像度がより高い画像を用いた徐々に密な探索を、直前の探索結果の周辺だけで行う。これにより、視差値の算出精度が高く維持されつつ視差値算出の全体の計算量が削減する。   The reduction rate in step S302 increases as the number of times the process is repeated increases. For this reason, as the iterative process progresses, the search shifts from a search with a coarse pixel density to a search with a dense pixel density. That is, the coarse and dense search is performed by repetitive processing. In the first iterative process, the dissimilarity computing unit 103 uses the coarse search for the low-resolution image with a small capacity in all the search, and then uses the image with a higher resolution according to the increase in the number of iterations. Performs a gradually dense search only around the previous search results. Thereby, the calculation amount of the whole parallax value calculation reduces while the calculation accuracy of the parallax value is maintained high.

次いで、ステップS202〜S205において、視差値算出装置300は、ステップS305で算出された拡大画像I1sh及びI2shそれぞれの各画素の相違度に基づき、実施の形態2と同様の処理を行う。   Next, in steps S202 to S205, the disparity value calculating device 300 performs the same process as that of the second embodiment based on the degree of difference between each pixel of the enlarged images I1sh and I2sh calculated in step S305.

次いで、ステップS306において、終了判断部309は、視差値の計算処理を継続するか否かを判定する。終了判断部309は、視差値の計算処理を継続する場合(ステップS306でYes)、ステップS307に進み、視差値の計算処理を継続しない場合(ステップS306でNo)、処理を終了する。具体的には、終了判断部309は、ステップS302での縮小率を縮小部307から取得し、ステップS205で生成された視差画像をL/Rチェック部206から取得する。そして、終了判断部309は、縮小率が1未満の場合、視差値の計算処理を継続し、取得された視差画像を拡大部308に出力する。終了判断部309は、縮小率が等倍の場合、計算処理を終了し、取得された視差画像を距離算出部31及び記憶部20等に出力する。なお、縮小率が等倍の場合、L/Rチェック部206から取得される視差画像のスケールは、撮像画像I1及びI2と同じである。   Next, in step S306, the end determination unit 309 determines whether to continue the process of calculating the disparity value. If the end determination unit 309 continues the parallax value calculation process (Yes in step S306), the process advances to step S307. If the parallax value calculation process is not continued (No in step S306), the process ends. Specifically, the end determination unit 309 acquires the reduction ratio in step S302 from the reduction unit 307, and acquires the parallax image generated in step S205 from the L / R check unit 206. Then, when the reduction ratio is less than 1, the end determination unit 309 continues the calculation process of the parallax value, and outputs the acquired parallax image to the enlargement unit 308. When the reduction ratio is equal, the end determination unit 309 ends the calculation processing, and outputs the acquired parallax image to the distance calculation unit 31, the storage unit 20, and the like. When the reduction ratio is equal, the scale of the parallax image acquired from the L / R check unit 206 is the same as that of the captured images I1 and I2.

次いで、ステップS307において、拡大部308は、終了判断部309から取得した視差画像に対して、ステップS302での縮小率に対応する拡大率で、通常の拡大処理及び各画素の視差値の拡大処理を行い、縮小部307に出力する。本実施の形態では、1回目、2回目及び3回目の処理の際の拡大率はそれぞれ、縮小率4分の1、2分の1及び等倍に対応する、4倍、2倍及び等倍である。なお、縮小率が等倍の場合、ステップS306で上述したように、拡大部308は視差画像を取得しない。   Next, in step S307, the enlargement unit 308 performs normal enlargement processing and enlargement processing of the parallax value of each pixel at the enlargement ratio corresponding to the reduction ratio in step S302 with respect to the parallax image acquired from the end determination unit 309. And output to the reduction unit 307. In the present embodiment, the enlargement ratios at the first, second and third processings correspond to reduction ratios of 1/4, 1/2 and 1 ×, 4 ×, 2 × and 1 ×, respectively. It is. When the reduction ratio is equal, as described above in step S306, the enlargement unit 308 does not acquire a parallax image.

ステップS307の次のステップS302では、縮小部307は、前回の繰り返し処理よりも大きい縮小率で、撮像画像I1及びI2、並びに視差画像Id1及びId2を縮小し、縮小画像I1sa及びI2sa、並びに縮小視差画像Id1sa及びId2saを生成する。ステップS303では、水平拡大部101は、縮小画像I1sa及びI2sa、並びに縮小視差画像Id1sa及びId2saを水平拡大し、拡大画像I1sah及びI2sah、並びに拡大視差画像Id1sah及びId2sahを生成する。ステップS304では、センサス変換部102は、拡大画像I1sah及びI2sahをセンサス変換する。ステップS305では、相違度算出部103は、拡大画像I1sahが基準画像である場合、拡大視差画像Id1sahに基づき、拡大画像I1sahの着目画素の視差値を取得する。さらに、相違度算出部103は、参照画像である拡大画像I2sah上において、着目画素と同じ位置に上記視差値を付加した位置の画素を、着目画素の対応画素に決定し、対応画素の近傍範囲を探索範囲に決定する。相違度算出部103は、上記探索範囲に基づき、着目画素の相違度を算出する。また、相違度算出部103は、拡大画像I2sahが基準画像である場合も、拡大視差画像Id2sahに基づき、上記と同様に処理する。また、視差値算出装置300は、ステップS202〜S307の処理を、前回の繰り返し処理と同様に繰り返す。   In step S302 subsequent to step S307, the reduction unit 307 reduces the captured images I1 and I2 and the parallax images Id1 and Id2 at a reduction ratio larger than that of the previous repetition process, and reduces the reduced images I1sa and I2sa and the reduced parallax. Generate images Id1sa and Id2sa. In step S303, the horizontal enlargement unit 101 horizontally enlarges the reduced images I1sa and I2sa and the reduced parallax images Id1sa and Id2sa to generate enlarged images I1sah and I2sah and enlarged parallax images Id1sah and Id2sah. In step S304, the census conversion unit 102 performs census conversion on the magnified images I1sah and I2sah. In step S305, when the enlarged image I1sah is a reference image, the dissimilarity calculating unit 103 acquires the parallax value of the pixel of interest of the enlarged image I1sah based on the enlarged parallax image Id1sah. Furthermore, the dissimilarity calculation unit 103 determines the pixel at the position where the parallax value is added to the same position as the focused pixel on the enlarged image I2sah which is the reference image, as the corresponding pixel of the focused pixel. To be the search range. The dissimilarity calculating unit 103 calculates the dissimilarity of the target pixel based on the search range. In addition, even when the enlarged image I2sah is a reference image, the difference degree calculation unit 103 processes the same as the above based on the enlarged parallax image Id2sah. In addition, the parallax value calculation device 300 repeats the processes of steps S202 to S307 as in the previous repeated process.

上述のような実施の形態3に係る視差値算出装置300によれば、実施の形態2と同様の効果が得られる。さらに、視差値算出装置300は、撮像画像に縮小率を大きくするように変化させつつ、視差値の計算の繰り返し処理を行う。視差値算出装置300は、繰り返し処理において、相違度の算出のための探索範囲を、前回の繰り返し処理で得られた視差画像を用いて限定する。視差値算出装置300は、1回目の繰り返し処理では、小さく縮小された低解像度の画像に対する粗な探索を全探索で行うことで相違度及び視差値を算出した後に、繰り返し処理の回数の増加に応じて、徐々に大きく縮小された高解像度の画像に対する密な探索を直前の視差画像から得られる限定された探索範囲で行うことで相違度及び視差値を算出する。これにより、視差値算出装置300は、視差値の算出精度をサブピクセル精度に維持しつつ、視差値算出の全体の演算量を低減することができる。   According to the disparity value calculating device 300 according to the third embodiment as described above, the same effect as that of the second embodiment can be obtained. Furthermore, the parallax value calculation device 300 repeatedly performs calculation of the parallax value while changing the captured image so as to increase the reduction ratio. In the iterative process, the parallax value calculation device 300 limits the search range for computing the degree of difference using the parallax image obtained in the previous iterative process. In the first iteration of the process, the disparity value calculating device 300 performs the rough search on the small and low-resolution image by performing the entire search by calculating the degree of difference and the disparity value, and then increasing the number of times of the iterative process. Accordingly, the degree of difference and the parallax value are calculated by performing a dense search on the high resolution image which is greatly reduced gradually in a limited search range obtained from the immediately preceding parallax image. As a result, the disparity value calculating device 300 can reduce the overall calculation amount of disparity value calculation while maintaining the disparity value calculation accuracy to the sub-pixel accuracy.

実施の形態3に係る視差値算出装置300は、実施の形態2に係る視差値算出装置200に、縮小部307と、拡大部308と、終了判断部309とを加えた構成であるが、図28に示す実施の形態3の変形例に係る視差値算出装置300aのように、実施の形態1に係る視差値算出装置100に、縮小部307と、拡大部308と、終了判断部309とを加えた構成であってもよい。なお、図28は、実施の形態3の変形例に係る視差値算出装置300aの機能的な構成の一例を示すブロック図である。   The disparity value calculating apparatus 300 according to the third embodiment has a configuration in which the reducing unit 307, the enlarging unit 308, and the end determining unit 309 are added to the disparity value calculating apparatus 200 according to the second embodiment. Like the parallax value calculation apparatus 300a according to the modification of the third embodiment shown in FIG. 28, the parallax value calculation apparatus 100 according to the first embodiment includes the reduction unit 307, the enlargement unit 308, and the end determination unit 309. The configuration may be added. FIG. 28 is a block diagram showing an example of a functional configuration of a disparity value calculating device 300a according to a modification of the third embodiment.

[実施の形態4]
実施の形態4に係る視差値算出装置400を説明する。実施の形態3に係る視差値算出装置300は、撮像画像に対して、縮小部307による等方的な縮小の後、水平拡大部101による水平拡大を行い、さらに、L/Rチェック部206による一貫性チェックの後、視差画像に対して、水平縮小部105による水平縮小と、拡大部308による等方的な拡大を行っている。実施の形態4に係る視差値算出装置400は、縮小部307及び水平拡大部101による縮小及び拡大処理、並びに、水平縮小部105及び拡大部308による縮小及び拡大処理をそれぞれ、個別に行わず、合成した処理で一度に行う。実施の形態4において、実施の形態1〜3と同様の構成要素については、実施の形態1〜3と同一の参照符号を付し、その説明を省略する。以下において、実施の形態1〜3と異なる点を中心に説明し、実施の形態1〜3と同様の点の説明を省略する。
Fourth Embodiment
A disparity value calculating device 400 according to Embodiment 4 will be described. The parallax value calculation device 300 according to Embodiment 3 performs isotropic enlargement by the horizontal enlargement unit 101 on the captured image after isotropic reduction by the reduction unit 307, and further by the L / R check unit 206. After the consistency check, horizontal reduction by the horizontal reduction unit 105 and isotropic enlargement by the enlargement unit 308 are performed on the parallax image. The disparity value calculating device 400 according to the fourth embodiment does not individually perform reduction and enlargement processing by the reduction unit 307 and the horizontal enlargement unit 101 and reduction and enlargement processing by the horizontal reduction unit 105 and the enlargement unit 308, respectively. Perform at one time in the combined process. In Embodiment 4, about the component similar to Embodiment 1-3, the referential mark same as Embodiment 1-3 is attached | subjected, and the description is abbreviate | omitted. In the following, differences from the first to third embodiments will be mainly described, and the description of the same points as the first to third embodiments will be omitted.

図29は、実施の形態4に係る視差値算出装置400の機能的な構成の一例のブロック図を示す。図29に示すように、視差値算出装置400は、異方性縮小部410と、センサス変換部102と、相違度算出部103と、第一視差選択部204aと、第二視差選択部204bと、L/Rチェック部206と、終了判断部309と、異方性拡大部411とを含む。視差値算出装置400は、実施の形態3に係る視差値算出装置300において、縮小部307及び水平拡大部101が異方性縮小部410に変更され、水平縮小部105及び拡大部308が異方性拡大部411に変更された構成である。   FIG. 29 shows a block diagram of an example of a functional configuration of disparity value calculation apparatus 400 according to Embodiment 4. As shown in FIG. 29, the parallax value calculation device 400 includes an anisotropy reduction unit 410, a census conversion unit 102, a dissimilarity calculation unit 103, a first parallax selection unit 204a, and a second parallax selection unit 204b. , L / R check unit 206, end determination unit 309, and anisotropic enlargement unit 411. In the disparity value calculating device 400, in the disparity value calculating device 300 according to the third embodiment, the reducing unit 307 and the horizontal enlarging unit 101 are changed to the anisotropic reducing unit 410, and the horizontal reducing unit 105 and the enlarging unit 308 are anisotropic. The configuration is changed to the sex expansion unit 411.

異方性縮小部410は、縮小部307の縮小処理と水平拡大部101の水平拡大処理とを合成した処理を行う。例えば、実施の形態3で例示したように、3回の繰り返し処理における1回目、2回目及び3回目の縮小率がそれぞれ、4分の1、2分の1及び等倍であり、各回の繰り返し処理での水平拡大率が2倍である場合、異方性縮小部410は、以下のような変化率で縮小処理を行う。つまり、1回目の繰り返し処理での変化率は、水平方向2分の1、且つ垂直方向4分の1であり、2回目の繰り返し処理での変化率は、水平方向等倍、且つ垂直方向2分の1であり、3回目の繰り返し処理での変化率は、水平方向2倍、且つ垂直方向等倍である。このように、異方性縮小部410は、縮小部307での縮小率と水平拡大部101での水平拡大率とを合成した変化率で、撮像画像の縮小処理を行う。また、異方性縮小部410は、視差画像の各画素の視差値について、本実施の形態では、視差値の探索方向でもある水平方向の変化率で縮小する。具体的には、1回目の繰り返し処理では、2分の1の変化率が適用され、2回目の繰り返し処理では、等倍の変化率が適用され、3回目の繰り返し処理では、2倍の変化率が適用される。   The anisotropic reduction unit 410 performs processing combining the reduction processing of the reduction unit 307 and the horizontal enlargement processing of the horizontal enlargement unit 101. For example, as exemplified in the third embodiment, the reduction rates of the first, second and third times in the three repetition processes are respectively one fourth, one half and one half, and repetition of each time When the horizontal enlargement ratio in the process is twice, the anisotropic reduction unit 410 performs the reduction process at the following change rates. That is, the change rate in the first repeated process is 1/2 in the horizontal direction and 1/4 in the vertical direction, and the change rate in the second repeated process is equal to 1 in the horizontal direction and 2 in the vertical direction. The rate of change in the third repetition processing is twice in the horizontal direction and equal in the vertical direction. As described above, the anisotropic reduction unit 410 performs reduction processing of a captured image at a change rate obtained by combining the reduction ratio in the reduction unit 307 and the horizontal enlargement ratio in the horizontal enlargement unit 101. In addition, the anisotropy reduction unit 410 reduces the parallax value of each pixel of the parallax image at a horizontal change rate, which is also the search direction of the parallax value in the present embodiment. Specifically, a half change rate is applied in the first repeated process, an equal change rate is applied in the second repeated process, and a double change in the third repeated process. Rates apply.

異方性拡大部411は、水平縮小部105の水平縮小処理と拡大部308の拡大処理とを合成した処理を行う。つまり、異方性拡大部411は、異方性縮小部410の変化率に対応する変化率で、視差画像の拡大処理を行うことによって、視差画像のスケールを撮像画像と同じスケールに変換する。例えば、上記の実施の形態3の例と同様に処理する場合、異方性拡大部411における1回目の繰り返し処理での変化率は、水平方向2倍、且つ垂直方向4倍であり、2回目の繰り返し処理での変化率は、水平方向等倍、且つ垂直方向2倍であり、3回目の繰り返し処理での変化率は、水平方向2分の1、且つ垂直方向等倍である。また、異方性拡大部411は、視差画像の各画素の視差値について、本実施の形態では、水平方向の変化率で拡大する。具体的には、1回目の繰り返し処理では、2倍の変化率が適用され、2回目の繰り返し処理では、等倍の変化率が適用され、3回目の繰り返し処理では、2分の1の変化率が適用される。   The anisotropic enlargement unit 411 performs processing combining the horizontal reduction processing of the horizontal reduction unit 105 and the enlargement processing of the enlargement unit 308. That is, the anisotropic enlargement unit 411 converts the scale of the parallax image into the same scale as the captured image by performing the enlargement process on the parallax image at a change rate corresponding to the change rate of the anisotropic reduction unit 410. For example, in the case of processing in the same manner as the example of the third embodiment described above, the rate of change in the first repetitive processing in the anisotropic expansion portion 411 is twice in the horizontal direction and four times in the vertical direction. The rate of change in the repetition process is 1 × in the horizontal direction and 2 × in the vertical direction, and the rate of change in the third repetition process is 1⁄2 in the horizontal direction and 1 × in the vertical direction. In addition, the anisotropic enlargement unit 411 enlarges the parallax value of each pixel of the parallax image at a change rate in the horizontal direction in the present embodiment. Specifically, a double change rate is applied in the first repeated process, an equal change rate is applied in the second repeated process, and a half change in the third repeated process. Rates apply.

上述のような実施の形態4に係る視差値算出装置400によれば、実施の形態3と同様の効果が得られる。さらに、視差値算出装置400は、撮像画像の縮小及び水平拡大処理を合成した処理で一度に行い、視差画像の水平縮小及び拡大処理を合成した処理で一度に行うため、処理に要する演算量を低減することができる。   According to the disparity value calculating device 400 according to the fourth embodiment as described above, the same effect as that of the third embodiment can be obtained. Furthermore, since the parallax value calculation device 400 performs the process of combining the reduction and horizontal enlargement processes of the captured image at one time and performs the process of combining the horizontal reduction and enlargement processes of parallax images at one time, It can be reduced.

実施の形態4に係る視差値算出装置400は、実施の形態3に係る視差値算出装置300をベースとした構成であるが、図30に示す実施の形態4の変形例に係る視差値算出装置400aのように、実施の形態3の変形例に係る視差値算出装置300aをベースにした構成であってもよい。このような視差値算出装置400aは、異方性縮小部410と、センサス変換部102と、相違度算出部103と、視差選択部104と、終了判断部309と、異方性拡大部411とを含む。なお、図30は、実施の形態4の変形例に係る視差値算出装置400aの機能的な構成の一例を示すブロック図である。   The disparity value calculating device 400 according to the fourth embodiment is configured based on the disparity value calculating device 300 according to the third embodiment, but a disparity value calculating device according to a modification of the fourth embodiment shown in FIG. Like 400a, the structure based on the parallax value calculation apparatus 300a which concerns on the modification of Embodiment 3 may be sufficient. Such a parallax value calculation device 400a includes an anisotropy reduction unit 410, a census conversion unit 102, a difference degree calculation unit 103, a parallax selection unit 104, an end determination unit 309, and an anisotropy enlargement unit 411. including. FIG. 30 is a block diagram showing an example of a functional configuration of a disparity value calculating device 400a according to a modification of the fourth embodiment.

[実施の形態5]
実施の形態5に係る視差値算出装置500を説明する。実施の形態5に係る視差値算出装置500は、実施の形態1に係る視差値算出装置100において、相違度に重み付けをし、重み付けされた相違度に基づき、視差値を決定する構成である。実施の形態5において、実施の形態1〜4と同様の構成要素については、実施の形態1〜4と同一の参照符号を付し、その説明を省略する。以下において、実施の形態1〜4と異なる点を中心に説明し、実施の形態1〜4と同様の点の説明を省略する。
Fifth Embodiment
A disparity value calculating device 500 according to Embodiment 5 will be described. The disparity value calculating device 500 according to the fifth embodiment is configured to weight the dissimilarity in the disparity value calculating device 100 according to the first embodiment, and to determine the disparity value based on the weighted dissimilarity. In Embodiment 5, about the component similar to Embodiment 1-4, the referential mark same as Embodiment 1-4 is attached | subjected, and the description is abbreviate | omitted. In the following, differences from the first to fourth embodiments will be mainly described, and the description of the same points as the first to fourth embodiments will be omitted.

図31は、実施の形態5に係る視差値算出装置500の機能的な構成の一例のブロック図を示す。図31に示すように、視差値算出装置500は、水平拡大部101と、センサス変換部102と、相違度算出部103と、コスト算出部512と、コスト集約部513と、視差選択部104と、水平縮小部105とを含む。視差値算出装置500は、実施の形態1に係る視差値算出装置100に対して、コスト算出部512及びコスト集約部513が加えられた構成である。水平拡大部101、センサス変換部102及び水平縮小部105は、実施の形態1と同様である。   FIG. 31 shows a block diagram of an example of a functional configuration of the disparity value calculating device 500 according to the fifth embodiment. As shown in FIG. 31, the parallax value calculation device 500 includes a horizontal enlargement unit 101, a census conversion unit 102, a dissimilarity calculation unit 103, a cost calculation unit 512, a cost aggregation unit 513, and a parallax selection unit 104. , And a horizontal reduction unit 105. The disparity value calculating device 500 has a configuration in which a cost calculating unit 512 and a cost aggregating unit 513 are added to the disparity value calculating device 100 according to the first embodiment. The horizontal enlargement unit 101, the census conversion unit 102, and the horizontal reduction unit 105 are the same as in the first embodiment.

コスト算出部512は、基準画像中の着目画素について、着目画素から複数の走査方向それぞれに沿った画素における視差値の分布に関するコストを算出する。具体的には、コスト算出部512は、着目画素を通る複数の直線それぞれの上での視差値の分布に関するコストを算出する。複数の直線の例は、着目画素を起点とする放射状の半直線である。本実施の形態では、複数の直線は、着目画素から8又は16の方向に等間隔に延びる半直線であり、8の半直線は、着目画素を通過する4の直線を構成し、16の半直線は、着目画素を通過する8の直線を構成する。ここで、走査方向、つまり、半直線の方向は、所定の方向の一例である。   The cost calculation unit 512 calculates, for the pixel of interest in the reference image, the cost relating to the distribution of parallax values in pixels along the respective scanning directions from the pixel of interest. Specifically, the cost calculation unit 512 calculates the cost relating to the distribution of disparity values on each of a plurality of straight lines passing the pixel of interest. An example of a plurality of straight lines is a radial half line starting from the pixel of interest. In the present embodiment, the plurality of straight lines are semi-lines extending equidistantly in the direction of 8 or 16 from the pixel of interest, and the eight semi-lines constitute 4 straight lines passing through the pixel of interest. The straight line constitutes eight straight lines passing through the pixel of interest. Here, the scanning direction, that is, the direction of the half line is an example of a predetermined direction.

コスト集約部513は、コスト算出部512によって算出された着目画素から延びる複数の半直線上での視差値の分布に関するコストについて、相違度算出のための探索範囲の各視差値に対して複数の半直線でのコストを加算し集約する。   The cost aggregation unit 513 sets a plurality of costs for the distribution of parallax values on a plurality of half straight lines extending from the pixel of interest calculated by the cost calculation unit 512 with respect to each parallax value in the search range for difference degree calculation. Add and consolidate costs in half straight line.

視差選択部104は、コスト集約部513によって集約された着目画素における視差値毎のコストについて、最小のコストを与える視差値を着目画素の視差値として決定する。   The parallax selection unit 104 determines, as the parallax value of the pixel of interest, the parallax value that provides the minimum cost for the cost of each parallax value in the pixel of interest aggregated by the cost aggregation unit 513.

ここで、コスト算出処理及びコスト集約処理の詳細を説明する。拡大画像I1hが基準画像であり、拡大画像I2hが参照画像である場合において、8の方向のうちのx軸負方向の半直線上の視差値の分布のコストに関する処理例を説明する。コスト算出部512は、図32に示すように、拡大画像I1hの着目画素I1hpaを中心とする8の方向の半直線L1〜L8を、拡大画像I1h上で設定する。そして、コスト算出部512は、各半直線L1〜L8上における画素の視差値の分布のコストを算出する。なお、図32は、コスト算出の際の着目画素からの複数の走査方向の例を示す図である。   Here, the details of the cost calculation process and the cost aggregation process will be described. In the case where the magnified image I1h is a reference image and the magnified image I2h is a reference image, a processing example regarding the cost of the distribution of disparity values on the half line in the x-axis negative direction among the eight directions is described. As illustrated in FIG. 32, the cost calculation unit 512 sets, on the enlarged image I1h, half straight lines L1 to L8 in eight directions around the pixel of interest I1hpa of the enlarged image I1h. Then, the cost calculation unit 512 calculates the cost of the distribution of parallax values of the pixels on the respective half straight lines L1 to L8. FIG. 32 is a diagram showing an example of a plurality of scanning directions from the pixel of interest at the time of cost calculation.

図33に示すように、コスト算出部512は、x軸正方向の半直線L1上の各画素について、当該画素に対応する探索範囲と、探索範囲内の視差値に対応する相違度とに基づき、コストを算出する。コスト算出部512は、拡大画像I1hの縁から着目画素I1hpaに向かって順に、つまり、画素座標のx座標が1である画素I1hpから着目画素I1hpaに向かって順に、半直線L1上の各画素に関するコストを算出する。なお、図33は、コスト算出の際の着目画素を通る直線上での画素の走査方向の例を示す図である。 As shown in FIG. 33, for each pixel on the half line L1 in the positive direction of the x-axis, the cost calculation unit 512 determines the search range corresponding to the pixel and the dissimilarity corresponding to the parallax value within the search range. , To calculate the cost. Cost calculation unit 512, in order from the edge of the enlarged image I1h the target pixel I1hpa, i.e., in order from the pixels I1hp 1 is a x-coordinate of the pixel coordinates 1 to the target pixel I1hpa, each pixel on the half line L1 Calculate the cost for FIG. 33 is a diagram showing an example of the scanning direction of a pixel on a straight line passing the pixel of interest at the time of cost calculation.

例えば、図34は、画素I1hpと着目画素I1hpaとの間の画素I1hp(iは正の整数)に関するコストの例を示す。図34に示すように、コスト算出部512は、画素I1hpについて、相違度算出部103によって算出された探索範囲内の各視差値に対応する相違度を取得する。なお、図34は、コスト算出のための走査ライン上の1つの画素におけるコストの例を示す図である。本例では、探索範囲は、0画素から−k画素である。さらに、コスト算出部512は、探索範囲内の各視差値と、隣接画素I1hpi−1の視差値との差異に基づき、当該視差値のペナルティ値を決定する。探索範囲内の視差値と画素I1hpi−1の視差値とが同じである場合、ペナルティ値はP1であり、探索範囲内の視差値と画素I1hpi−1の視差値とが異なる場合、ペナルティ値はP2である。本実施の形態では、P2はP1よりも大きい。画素I1hpi−1は、画素I1hpに対して、x軸正方向に隣接する画素であり、半直線L1に沿って画素I1hpの直前にコスト計算された画素である。コスト算出部512は、探索範囲内の各視差値について、その相違度にペナルティ値を加算した値であるコストを算出する。これにより、画素I1hpに関する探索範囲内の各視差値のコストが求まる。ここで、半直線L1上の画素I1hpは、第1の評価画素の一例であり、画素I1hpi−1は、第2の評価画素の一例であり、ペナルティ値は、第1の評価値の一例であり、コストは、第2の評価値の一例である。 For example, FIG. 34 shows an example of the cost for the pixel I1hp i (i is a positive integer) between the pixel I1hp 1 and the target pixel I1hpa. As shown in FIG. 34, the cost calculation unit 512, the pixel I1hp i, to obtain the difference degree for each disparity value in the search range calculated by the difference calculation unit 103. FIG. 34 is a diagram showing an example of the cost of one pixel on the scanning line for cost calculation. In this example, the search range is from 0 pixel to −k pixel. Furthermore, the cost calculation unit 512 determines a penalty value of the disparity value based on the difference between each disparity value in the search range and the disparity value of the adjacent pixel I1hp i-1 . If the disparity value in the search range is the same as the disparity value of the pixel I1hp i-1 , the penalty value is P1, and if the disparity value in the search range is different from the disparity value of the pixel I1hp i-1 , the penalty The value is P2. In the present embodiment, P2 is larger than P1. Pixel I1hp i-1, to the pixel I1hp i, a pixel adjacent in the x-axis positive direction, a pixel that is costing the immediately preceding pixel I1hp i along the half line L1. The cost calculation unit 512 calculates, for each disparity value in the search range, a cost that is a value obtained by adding a penalty value to the difference degree. Thus, obtained is the cost of each disparity value in the search range for pixels I1hp i. Here, the pixel I1hp i on the half straight line L1 is an example of a first evaluation pixel, the pixel I1 hp i-1 is an example of a second evaluation pixel, and the penalty value is a value of the first evaluation value. The cost is an example of the second evaluation value.

コスト算出部512は、半直線L1上の全ての画素について、探索範囲内の各視差値のコストを算出する。なお、画素I1hpについては、隣接する画素が存在しないため、ペナルティ値がなく、各視差値の相違度がコストになる。さらに、コスト算出部512は、他の半直線L2〜L8それぞれについても、当該半直線上の全ての画素について、探索範囲内の各視差値のコストを算出する。よって、半直線L1〜L8上の全ての画素について、0画素から−k画素の視差値それぞれのコストが算出される。コスト集約部513は、半直線L1〜L8上の全ての画素について、同じ視差値のコストの和を算出する。そして、視差選択部104は、0画素から−k画素の視差値それぞれのコストの和のうち、最小の和を有する視差値を、着目画素I1hpaの視差値に決定する。コスト算出部512及びコスト集約部513は、拡大画像I1hの全ての画素を着目画素として上述のような処理を行うことによって、各画素の視差値を決定する。ここで、コストの和は、加算評価値の一例である。 The cost calculation unit 512 calculates the cost of each parallax value within the search range for all the pixels on the half line L1. Note that the pixel I1hp 1, since the adjacent pixels do not exist, there is no penalty value, difference of each disparity value is cost. Further, the cost calculation unit 512 calculates the cost of each parallax value within the search range for all the pixels on the other half straight lines L2 to L8 for each of the other half straight lines L2 to L8. Therefore, the cost of each parallax value of 0 pixel to -k pixel is calculated for all the pixels on the half straight lines L1 to L8. The cost aggregation unit 513 calculates the sum of costs of the same parallax value for all the pixels on the half straight lines L1 to L8. Then, the parallax selection unit 104 determines the parallax value having the smallest sum among the sums of costs of parallax values from 0 pixel to -k pixels as the parallax value of the pixel of interest I1hpa. The cost calculation unit 512 and the cost aggregation unit 513 determine the parallax value of each pixel by performing the above-described process with all the pixels of the enlarged image I1h as the pixel of interest. Here, the sum of costs is an example of the addition evaluation value.

上述のように、コスト算出部512は、例えば、第1の拡大画像としての拡大画像I1hにおいて、視差値の算出対象の第1の画素としての着目画素I1hpaから、所定の方向に位置する評価画素としての画素I1hpそれぞれについて、画素I1hpに所定の方向で隣り合う画素I1hpi−1の視差値と、第2の拡大画像としての拡大画像I2hにおける画素I1hpに対応する位置の対応画素に対する、相違度算出のための探索範囲内の画素それぞれの視差値との比較に基づき、探索範囲内の画素それぞれの第1の評価値としてのペナルティ値を算出する。さらに、コスト算出部512は、画素I1hpと探索範囲内の画素それぞれとの間の相違度と、探索範囲内の画素それぞれのペナルティ値とに基づき、探索範囲内の画素それぞれの視差値についての第2の評価値としてのコストを算出する。コスト集約部513は、探索範囲内の画素それぞれの視差値に対応する全ての評価画素のコストを加算して、加算評価値としてのコストの和を算出する。視差選択部104は、最小のコストの和に対応する視差値を着目画素I1hpaの視差値に決定する。 As described above, in the enlarged image I1h as the first enlarged image, for example, the cost calculation unit 512 evaluates the evaluation pixel positioned in a predetermined direction from the target pixel I1hpa as the first pixel for which the parallax value is to be calculated. for pixel I1hp i respectively as the disparity value of the pixel I1hp i-1 adjacent to each other in a predetermined direction in the pixel I1hp i, for the corresponding pixel position corresponding to the pixel I1hp i in the enlarged image I2h as a second enlarged image The penalty value as the first evaluation value of each of the pixels in the search range is calculated based on comparison with the parallax value of each of the pixels in the search range for calculating the difference degree. Furthermore, based on the degree of difference between the pixel I1hp i and each of the pixels within the search range and the penalty value of each of the pixels within the search range, the cost calculation unit 512 determines the disparity value for each pixel within the search range. Calculate the cost as the second evaluation value. The cost aggregation unit 513 adds the costs of all the evaluation pixels corresponding to the parallax value of each pixel within the search range, and calculates the sum of the costs as the addition evaluation value. The disparity selection unit 104 determines the disparity value corresponding to the sum of the minimum costs as the disparity value of the pixel of interest I1hpa.

図35を参照しつつ、視差値算出装置500の動作を説明する。図35は、実施の形態5に係る視差値算出装置500の動作の一例を示すフローチャートである。視差値算出装置500は、実施の形態1と同様に、ステップS101〜S104の処理を行うことによって、記憶部20から撮像画像I1及びI2を取得し、撮像画像I1及びI2の拡大画像I1h及びI2hの各画素のセンサス特徴量を算出する。さらに、視差値算出装置500は、拡大画像I1hを基準画像として、拡大画像I1hの各画素に関して、拡大画像I2hの探索範囲の各画素に対する相違度を算出する。   The operation of the disparity value calculating device 500 will be described with reference to FIG. FIG. 35 is a flowchart illustrating an example of the operation of the disparity value calculating device 500 according to the fifth embodiment. Similar to the first embodiment, the parallax value calculation device 500 acquires the captured images I1 and I2 from the storage unit 20 by performing the processes of steps S101 to S104, and enlarges the images I1h and I2h of the captured images I1 and I2. The census feature value of each pixel is calculated. Furthermore, the parallax value calculation device 500 calculates the degree of difference with respect to each pixel of the search range of the enlarged image I2h for each pixel of the enlarged image I1h, using the enlarged image I1h as a reference image.

次いで、ステップS501において、コスト算出部512は、基準画像である拡大画像I1h中の着目画素について、着目画素を通る複数の直線それぞれの上での視差値の分布に関するコストを算出する。コスト算出部512は、各直線上の画素それぞれについて、相違度算出のための探索範囲内の視差値と、当該画素に隣接する画素の視差値との差異に基づき、探索範囲内の各視差値に対応する相違度を重み付けした値であるコストを算出する。コスト算出部512は、拡大画像I1hの全ての画素を着目画素として、コストを算出する。   Next, in step S501, the cost calculation unit 512 calculates, for the pixel of interest in the enlarged image I1h that is the reference image, the cost of the distribution of parallax values on each of a plurality of straight lines passing the pixel of interest. The cost calculation unit 512 determines, for each pixel on each straight line, each parallax value within the search range based on the difference between the parallax value within the search range for calculating the degree of difference and the parallax value of the pixel adjacent to the pixel. The cost which is a value obtained by weighting the degree of difference corresponding to. The cost calculation unit 512 calculates the cost with all the pixels of the enlarged image I1h as the target pixel.

次いで、ステップS502において、コスト集約部513は、拡大画像I1h中の着目画素について、複数の直線上の画素それぞれに対して算出されたコストを、探索範囲の視差値毎に加算し集約する、つまり、同じ視差値のコストの全てを加算する。これにより、探索範囲の視差値毎に、コストの和が求められる。コスト集約部513は、拡大画像I1hの全ての画素を着目画素として、各画素のコストを集約する。   Next, in step S502, the cost aggregating unit 513 adds the costs calculated for each of the pixels on the plurality of straight lines for the target pixel in the enlarged image I1h, and adds them together for each parallax value in the search range, that is, , Add all of the costs of the same disparity value. Thereby, the sum of costs is calculated for each disparity value in the search range. The cost aggregation unit 513 aggregates the cost of each pixel, with all the pixels of the enlarged image I1h as the target pixel.

次いで、ステップS503において、視差選択部104は、拡大画像I1h中の着目画素について、探索範囲の視差値毎のコストの和のうち、最小のコストの和を与える視差値を着目画素の視差値に決定する。視差選択部104は、拡大画像I1hの全ての画素を着目画素として、各画素の視差値を決定し、拡大画像I1hの視差画像を生成する。   Next, in step S503, the parallax selection unit 104 sets, as the parallax value of the pixel of interest, the parallax value giving the sum of the minimum cost among the sum of costs for each parallax value in the search range for the pixel of interest in the enlarged image I1h. decide. The parallax selection unit 104 determines the parallax value of each pixel with all the pixels of the enlarged image I1h as the pixel of interest, and generates a parallax image of the enlarged image I1h.

次いで、ステップS106では、視差値算出装置500は、実施の形態1と同様に、拡大画像I1hの視差画像を水平縮小した縮小視差画像を生成する。   Next, in step S106, the parallax value calculation device 500 generates a reduced parallax image in which the parallax image of the enlarged image I1h is horizontally reduced, as in the first embodiment.

上述のような実施の形態5に係る視差値算出装置500によれば、実施の形態1と同様の効果が得られる。また、視差値算出装置500は、基準画像の着目画素の周囲の画素の視差値の変化を相違度に反映したコストに基づき、着目画素の視差値を算出する。これにより、視差値算出装置500は、着目画素における視差値がその周囲の画素の視差値と同様の値を取りやすくし、被写体のエッジ、境界等のライン間で視差値が異なることによる筋状のアーチファクトが生じるストリーキングアーチファクトを低減することができる。よって、視差値算出装置500は、高い精度で視差値を算出することができる。上述では、視差値算出装置500は、拡大画像I1hを基準画像としていたが、拡大画像I2hを基準画像としてもよい。   According to the disparity value calculating device 500 according to the fifth embodiment as described above, the same effect as that of the first embodiment can be obtained. In addition, the parallax value calculation device 500 calculates the parallax value of the pixel of interest based on the cost in which the change in parallax value of the pixels around the pixel of interest of the reference image is reflected in the degree of difference. In this way, the parallax value calculation device 500 makes it easy for the parallax value at the pixel of interest to take the same value as the parallax value of the pixels around it, and causes streaks due to differences in parallax values between lines such as edges and boundaries of the object. Can reduce streaking artifacts that occur. Thus, the disparity value calculating device 500 can calculate disparity values with high accuracy. Although the parallax value calculation device 500 uses the enlarged image I1h as the reference image in the above description, the enlarged image I2h may be used as the reference image.

実施の形態5に係る視差値算出装置500は、実施の形態1に係る視差値算出装置100をベースとした構成であるが、実施の形態2〜4及びその変形例をベースとした構成であってもよい。例えば、実施の形態2をベースとする実施の形態5の変形例1に係る視差値算出装置500aは、図36に示すような構成である。また、実施の形態3をベースとする実施の形態5の変形例2に係る視差値算出装置500bは、図37に示すような構成である。また、実施の形態4をベースとする実施の形態5の変形例3に係る視差値算出装置500cは、図38に示すような構成である。変形例1〜3において、コスト算出部512は、相違度算出部103から相違度を取得し、コスト集約部513は、集約したコストを、第一視差選択部204a及び第二視差選択部204bに出力する。また、実施の形態4の変形例をベースとする実施の形態5の変形例4に係る視差値算出装置500dは、図39に示すような構成である。変形例4において、コスト算出部512は、相違度算出部103から相違度を取得し、コスト集約部513は、集約したコストを視差選択部104に出力する。   The disparity value calculating device 500 according to the fifth embodiment has a configuration based on the disparity value calculating device 100 according to the first embodiment, but has a configuration based on the second to fourth embodiments and the modification thereof. May be For example, a disparity value calculating device 500a according to the first modification of the fifth embodiment based on the second embodiment has a configuration as shown in FIG. Further, a disparity value calculating device 500b according to the second modification of the fifth embodiment based on the third embodiment has a configuration as shown in FIG. A disparity value calculating device 500c according to the third modification of the fifth embodiment based on the fourth embodiment has a configuration as shown in FIG. In the first to third modifications, the cost calculation unit 512 acquires the degree of difference from the degree of difference calculation unit 103, and the cost aggregation unit 513 transmits the aggregated costs to the first parallax selection unit 204a and the second parallax selection unit 204b. Output. Further, a disparity value calculating device 500d according to the fourth modification of the fifth embodiment based on the modification of the fourth embodiment has a configuration as shown in FIG. In the fourth modification, the cost calculation unit 512 acquires the difference degree from the difference degree calculation unit 103, and the cost aggregation unit 513 outputs the aggregated cost to the disparity selection unit 104.

[実施の形態6]
実施の形態6に係る視差値算出装置600を説明する。実施の形態1に係る視差値算出装置100では、センサス変換の際、着目画素に対する周辺画素の領域は、例えば、図18A及び図18Bに示すように一定である。実施の形態6に係る視差値算出装置600は、着目画素に対する周辺画素の様々な領域に基づき、着目画素のセンサス特徴量を算出する。本明細書において、センサス変換において、着目画素に対して参照される周辺画素の領域を、「窓領域」とも呼ぶ。実施の形態6において、実施の形態1〜5と同様の構成要素については、実施の形態1〜5と同一の参照符号を付し、その説明を省略する。以下において、実施の形態1〜5と異なる点を中心に説明し、実施の形態1〜5と同様の点の説明を省略する。ここで、窓領域は、比較領域の一例である。
Sixth Embodiment
A disparity value calculating device 600 according to Embodiment 6 will be described. In the parallax value calculation device 100 according to Embodiment 1, the area of the peripheral pixel with respect to the pixel of interest is constant, for example, as shown in FIGS. 18A and 18B at the time of census conversion. The disparity value calculating device 600 according to the sixth embodiment calculates the census feature value of the pixel of interest based on various regions of peripheral pixels with respect to the pixel of interest. In the present specification, in the census conversion, a region of a peripheral pixel referred to a target pixel is also referred to as a “window region”. In Embodiment 6, about the component similar to Embodiment 1-5, the referential mark same as Embodiment 1-5 is attached | subjected, and the description is abbreviate | omitted. In the following, differences from the first to fifth embodiments will be mainly described, and the description of the same points as the first to fifth embodiments will be omitted. Here, the window area is an example of the comparison area.

窓領域が、手前の被写体により背後の被写体が見えない状態であるオクルージョンの領域、又は視差が大きく変化する領域をまたぐ場合、このような窓領域に基づき視差値が算出された視差画像の領域では、撮像画像における前景及び背景の境界等の被写体の輪郭と、視差値の差異により形成される視差画像の境界ラインとが、一致しない場合がある。本実施の形態では、視差値算出装置600は、実施の形態1〜5のように、着目画素が窓領域の中央に位置する通常の窓領域以外に、着目画素が中央からずらした位置にある少なくとも1つの窓領域を用いる。視差値算出装置600は、これら複数の窓領域について算出した相違度を最も小さくする視差値を決定することにより、視差値の差異の境界が実際の被写体の輪郭とより整合する視差画像を生成する。   In the case where the window area crosses an occlusion area where the subject in front can not see the subject behind, or an area where the parallax changes significantly, in the parallax image area where the parallax value is calculated based on such a window area There are cases where the outline of the subject such as the boundary of the foreground and background in the captured image and the boundary line of the parallax image formed by the difference in parallax value do not match. In the present embodiment, as in the first to fifth embodiments, in the parallax value calculation device 600, the pixel of interest is located at a position shifted from the center other than the normal window region where the pixel of interest is located at the center of the window region. Use at least one window area. The parallax value calculation device 600 generates a parallax image in which the boundary of the difference in parallax value is more consistent with the contour of the actual subject by determining the parallax value that minimizes the degree of difference calculated for the plurality of window regions. .

図40は、実施の形態6に係る視差値算出装置600の機能的な構成の一例のブロック図を示す。図40に示すように、視差値算出装置600は、実施の形態1と同様に、水平拡大部101と、センサス変換部602と、相違度算出部603と、視差選択部604と、水平縮小部105とを含む。水平拡大部101及び水平縮小部105の構成は、実施の形態1と同様である。   FIG. 40 shows a block diagram of an example of a functional configuration of disparity value calculation apparatus 600 according to Embodiment 6. As shown in FIG. 40, the parallax value calculation device 600 includes the horizontal enlargement unit 101, the census conversion unit 602, the dissimilarity calculation unit 603, the parallax selection unit 604, and the horizontal reduction unit as in the first embodiment. And 105. The configurations of the horizontal enlargement unit 101 and the horizontal reduction unit 105 are the same as in the first embodiment.

センサス変換部602は、基準画像の着目画素に対して、複数の窓領域を設定する。センサス変換部602は、各窓領域について、着目画素と当該窓領域内の周辺画素との間でセンサス変換を行い、センサス特徴量を算出する。センサス変換部602は、拡大画像I1h及びI2hそれぞれの全ての画素に対して、複数の窓領域それぞれについてのセンサス特徴量を算出する。   The census conversion unit 602 sets a plurality of window areas for the pixel of interest of the reference image. The census conversion unit 602 performs census conversion between the pixel of interest and peripheral pixels in the window area for each window area to calculate a census feature value. The census conversion unit 602 calculates census feature values for each of a plurality of window regions for all pixels of each of the enlarged images I1h and I2h.

例えば、本実施の形態では、センサス変換部602は、図41に示すように、9つの窓領域W1〜W9を、1つの着目画素ctrに対して設定する。なお、図41は、着目画素の複数の窓領域の一例を示す図である。窓領域W5は、着目画素ctrが窓領域の中央に位置する通常の窓領域である。窓領域W1〜W4及びW6〜W9ではそれぞれ、着目画素ctrが、窓領域の中央以外に位置する。センサス変換部602は、着目画素ctrについて、窓領域W1〜W9それぞれの周辺画素との間でセンサス変換することによって、9つのセンサス特徴量を算出する。   For example, in the present embodiment, as shown in FIG. 41, the census conversion unit 602 sets nine window regions W1 to W9 for one pixel of interest ctr. FIG. 41 is a diagram showing an example of a plurality of window areas of the pixel of interest. The window area W5 is a normal window area in which the target pixel ctr is located at the center of the window area. In the window regions W1 to W4 and W6 to W9, the pixel of interest ctr is located other than at the center of the window region. The census conversion unit 602 calculates nine census feature quantities by performing census conversion on the pixel of interest ctr with the peripheral pixels of each of the window regions W1 to W9.

相違度算出部603は、各窓領域に関して、基準画像の各画素の参照画像に対する相違度を算出する。相違度算出部603は、基準画像の着目画素の相違度を算出する際、着目画素のセンサス特徴量の算出に使用した窓領域と同じ窓領域を使用して算出された、参照画像の各画素のセンサス特徴量と、当該着目画素のセンサス特徴量との間で、相違度を算出する。つまり、相違度の算出では、基準画像と参照画像との間において、センサス特徴量の算出に使用される窓領域と着目画素及び参照画素との位置関係が同じである。すなわち、例えば、窓領域W1が、基準画像のセンサス特徴量の算出に用いられた場合、当該基準画像の着目画素の相違度計算に用いられる参照画像のセンサス特徴量は、窓領域W1を用いて算出されたものである。よって、図41の例の場合、相違度算出部603は、基準画像の1つの着目画素に対して、窓領域W1〜W9それぞれに対応する相違度を算出する。   The dissimilarity calculating unit 603 calculates the dissimilarity of each pixel of the reference image to the reference image for each window area. When the dissimilarity calculating unit 603 calculates the dissimilarity of the reference pixel in the reference image, each pixel of the reference image is calculated using the same window region as the window region used for calculating the census feature amount of the target pixel. The degree of difference is calculated between the census feature amount of and the census feature amount of the target pixel. That is, in the calculation of the degree of difference, the positional relationship between the window region used for calculation of the census feature amount and the target pixel and the reference pixel is the same between the reference image and the reference image. That is, for example, when the window region W1 is used to calculate the census feature amount of the reference image, the census feature amount of the reference image used to calculate the degree of difference of the target pixel of the reference image uses the window region W1. It is calculated. Therefore, in the case of the example of FIG. 41, the dissimilarity calculation unit 603 calculates the dissimilarity corresponding to each of the window regions W1 to W9 with respect to one focused pixel of the reference image.

視差選択部604は、相違度算出部603によって算出された窓領域毎の基準画像の各画素の相違度に基づき、各窓領域について、基準画像の着目画素の相違度のうちから、最小の相違度を抽出し、当該最小の相違度を与える視差値を抽出する。さらに、視差選択部604は、全ての窓領域それぞれにおいて抽出された視差値の相違度のうちから、最小の相違度を抽出し、当該最小の相違度を与える視差値を、着目画素の視差値に決定する。つまり、視差選択部604は、全ての窓領域における着目画素の相違度のうちから、最小の相違度を抽出し、当該最小の相違度を与える視差値を、着目画素の視差値に決定する。さらに、視差選択部604は、基準画像の全ての画素を着目画素として、当該画素の視差値を決定し、視差画像を生成する。   Based on the degree of difference of each pixel of the reference image for each window area calculated by the degree of difference calculation unit 603, the parallax selection unit 604 determines the smallest difference among the degrees of difference of the target pixel of the reference image for each window area. The degree is extracted, and the disparity value giving the minimum degree of difference is extracted. Furthermore, the disparity selection unit 604 extracts the minimum difference degree from among the difference degrees of disparity values extracted in all the window regions, and sets the disparity value giving the minimum difference degree to the disparity value of the pixel of interest. Decide on. That is, the parallax selection unit 604 extracts the smallest degree of difference among the degrees of difference of the target pixels in all the window regions, and determines the parallax value giving the minimum degree of difference as the parallax value of the target pixel. Furthermore, the parallax selection unit 604 determines the parallax value of the pixel with all pixels of the reference image as the target pixel, and generates a parallax image.

上述のような実施の形態6に係る視差値算出装置600によれば、実施の形態1と同様の効果が得られる。また、視差値算出装置600は、窓領域に対する着目画素の位置が異なる複数の窓領域のうち、相違度を最小にする窓領域を用いて算出されたセンサス特徴量を用いた相違度に基づき、視差値を算出する。このような視差値は、着目画素に対する窓領域の位置に起因する視差値の誤差を低減する。よって、視差値算出装置600は、オクルージョンの境界又は視差値が変化する前景及び背景間の境界付近に位置する画素について、視差画像での視差値の差異による境界の位置と、被写体の輪郭の位置とを正確に整合させることができる。   According to the disparity value calculating device 600 according to the sixth embodiment as described above, the same effect as that of the first embodiment can be obtained. Also, the parallax value calculation device 600 is based on the degree of difference using the census feature value calculated using the window area that minimizes the degree of difference among the plurality of window areas where the position of the pixel of interest with respect to the window area is different. Calculate the disparity value. Such a parallax value reduces an error of the parallax value caused by the position of the window area with respect to the target pixel. Therefore, the parallax value calculation device 600 detects the position of the boundary due to the difference in parallax value in the parallax image and the position of the outline of the subject for the pixels located in the vicinity of the boundary between the occlusion boundary or the foreground and background where the parallax value changes. And can be precisely aligned.

なお、着目画素に対する窓領域の位置は、図41に示す例に限定されず、窓領域内のいかなる位置に着目画素が位置してもよい。また、図41の例では、複数の窓領域の形状は、矩形であったが、いかなる形状であってもよい。   The position of the window area with respect to the pixel of interest is not limited to the example shown in FIG. 41, and the pixel of interest may be located at any position in the window area. Further, in the example of FIG. 41, the shape of the plurality of window regions is rectangular, but may be any shape.

また、実施の形態6に係る視差値算出装置600は、実施の形態1に係る視差値算出装置100をベースする構成であったが、実施の形態2〜5及びその変形例をベースする構成であってもよい。   In addition, although the parallax value calculation device 600 according to the sixth embodiment is configured based on the parallax value calculation device 100 according to the first embodiment, the configuration is based on the second to fifth embodiments and the modification thereof. It may be.

例えば、実施の形態5をベースとする実施の形態6の変形例に係る視差値算出装置600aは、図42に示すような構成である。変形例に係る視差値算出装置600aにおいて、上述の実施の形態6と同様に、センサス変換部602は、拡大画像I1h及びI2hそれぞれの全ての画素に対して、複数の窓領域それぞれについてのセンサス特徴量を算出する。相違度算出部603は、各窓領域に関して、基準画像の各画素の参照画像に対する相違度を算出する。   For example, a disparity value calculating device 600a according to a modification of the sixth embodiment based on the fifth embodiment has a configuration as shown in FIG. In the parallax value calculation device 600a according to the modification, as in the sixth embodiment described above, the census conversion unit 602 generates census characteristics for each of a plurality of window regions for all pixels of each of the enlarged images I1h and I2h. Calculate the quantity. The dissimilarity calculating unit 603 calculates the dissimilarity of each pixel of the reference image to the reference image for each window area.

コスト算出部512は、各窓領域に関して、基準画像中の全ての画素を着目画素として、着目画素を通る複数の直線それぞれの上での視差値の分布に関する着目画素のコストを算出する。コスト算出部512は、各直線上の画素それぞれについて、相違度算出のための探索範囲内の視差値と、当該画素に隣接する画素の視差値との差異に基づき、探索範囲内の各視差値に対応する相違度を重み付けした値を、着目画素のコストとして算出する。コスト集約部513は、各窓領域に関して、着目画素を通る複数の直線上の画素それぞれに対して算出されたコストを、探索範囲の視差値毎に加算する、つまり視差値毎のコストの和を算出することによって、着目画素のコストを集約する。視差選択部604は、着目画素に関して、全ての窓領域における探索範囲の視差値毎のコストの和のうちから、最小のコストの和を抽出し、最小のコストの和を与える窓領域及び視差値を特定し、特定した視差値を着目画素の視差値に決定する。さらに、視差選択部604は、基準画像の全ての画素を着目画素として、当該画素の視差値を決定し、視差画像を生成する。   The cost calculation unit 512 calculates the cost of the pixel of interest with respect to the distribution of parallax values on each of a plurality of straight lines passing the pixel of interest, with all pixels in the reference image as pixels of interest for each window region. The cost calculation unit 512 determines, for each pixel on each straight line, each parallax value within the search range based on the difference between the parallax value within the search range for calculating the degree of difference and the parallax value of the pixel adjacent to the pixel. Is calculated as the cost of the pixel of interest. The cost aggregation unit 513 adds, for each window area, the cost calculated for each of the pixels on the plurality of straight lines passing the pixel of interest for each disparity value in the search range, that is, the sum of costs for each disparity value By calculating, the cost of the pixel of interest is consolidated. The parallax selection unit 604 extracts the sum of the minimum cost from the sum of the costs for each parallax value of the search range in all the window areas for the pixel of interest, and provides the window area and the parallax value giving the sum of the minimum cost. Are identified, and the identified disparity value is determined as the disparity value of the pixel of interest. Furthermore, the parallax selection unit 604 determines the parallax value of the pixel with all pixels of the reference image as the target pixel, and generates a parallax image.

[実施の形態7]
実施の形態7に係る視差値算出装置700を説明する。実施の形態6に係る視差値算出装置600は、視差画像における視差値の差異による境界ラインを、前景及び背景の境界等の被写体の輪郭と一致させるために、1つの着目画素に設定される複数の窓領域について、相違度又はコストを算出することによって、着目画素の視差値を決定した。実施の形態7に係る視差値算出装置700は、基準画像の着目画素と参照画像の参照画素との間の相違度であるハミング距離を計算する際、2つの画素のセンサス特徴量のビット列間におけるビット間差異を、センサス変換での対応画素間の画素値の差である輝度差で重み付けする。実施の形態7において、実施の形態1〜6と同様の構成要素については、実施の形態1〜6と同一の参照符号を付し、その説明を省略する。以下において、実施の形態1〜6と異なる点を中心に説明し、実施の形態1〜6と同様の点の説明を省略する。
Seventh Embodiment
A disparity value calculating device 700 according to Embodiment 7 will be described. The parallax value calculation device 600 according to the sixth embodiment sets a plurality of pixels set as one pixel of interest in order to make the boundary line due to the difference in parallax value in the parallax image coincide with the contour of the subject such as the boundary of foreground and background. The parallax value of the pixel of interest is determined by calculating the degree of difference or the cost for the window region of When the parallax value calculation device 700 according to the seventh embodiment calculates the Hamming distance, which is the degree of difference between the focused pixel of the reference image and the reference pixel of the reference image, the parallax value calculation device 700 The difference between the bits is weighted by the luminance difference which is the difference in pixel value between corresponding pixels in the census conversion. In Embodiment 7, about the component similar to Embodiment 1-6, the referential mark same as Embodiment 1-6 is attached | subjected, and the description is abbreviate | omitted. In the following, differences from the first to sixth embodiments will be mainly described, and the description of the same points as the first to sixth embodiments will be omitted.

図43は、実施の形態7に係る視差値算出装置700の機能的な構成の一例のブロック図を示す。図43に示すように、視差値算出装置700は、実施の形態1と同様に、水平拡大部101と、センサス変換部102と、相違度算出部703と、視差選択部104と、水平縮小部105とを含む。水平拡大部101、センサス変換部102、視差選択部104及び水平縮小部105は、実施の形態1と同様である。   FIG. 43 shows a block diagram of an example of a functional configuration of disparity value calculation apparatus 700 according to Embodiment 7. As shown in FIG. 43, the parallax value calculation device 700 includes the horizontal enlargement unit 101, the census conversion unit 102, the dissimilarity calculation unit 703, the parallax selection unit 104, and the horizontal reduction unit as in the first embodiment. And 105. The horizontal enlargement unit 101, the census conversion unit 102, the parallax selection unit 104, and the horizontal reduction unit 105 are the same as in the first embodiment.

相違度算出部703は、拡大画像I1h及びI2hについてのセンサス特徴量間の視差値に応じた相違度であるハミング距離を算出する際に、対応画素間の画素値の差である輝度差に応じて重み付けする。具体的には、相違度算出部703は、拡大画像I1h及びI2hのうちの基準画像の着目画素の相違度を算出する際、着目画素のセンサス特徴量のビット列と、参照画像の参照画素のセンサス特徴量のビット列との間における同じ桁のビットの数値の差異であるビット間差異を、着目画素のセンサス変換の際に参照した周辺画素の輝度値と参照画素のセンサス変換の際に参照した周辺画素の輝度値との、対応画素での差で重み付けする。ここで、対応画素間の輝度差に応じた重みは、対応画素間で輝度差が大きい場合には小さく、対応画素間で輝度差が小さい場合には大きくされる。これにより、対応画素間で輝度差の小さい場合のハミング距離のビット間差異は、ハミング距離に重点的に反映され、対応画素間で輝度差の大きい場合のハミング距離のビット間差異は、ハミング距離への影響が少なくなる。   When calculating the Hamming distance which is the degree of difference according to the parallax value between the census feature amounts of the enlarged images I1h and I2h, the degree of difference calculation unit 703 responds to the luminance difference which is the difference in pixel value between corresponding pixels. Weight. Specifically, when the dissimilarity calculation unit 703 calculates the dissimilarity of the target pixel of the reference image of the enlarged images I1h and I2h, the bit string of the census feature amount of the target pixel and the census of the reference pixel of the reference image The inter-bit difference which is the difference between the bit numbers of the same digit from the bit string of the feature amount is referred to in the census conversion of the pixel of interest and in the census conversion of the reference pixel It is weighted by the difference between the corresponding pixel and the luminance value of the pixel. Here, the weight according to the luminance difference between corresponding pixels is small when the luminance difference between corresponding pixels is large, and is increased when the luminance difference between corresponding pixels is small. Thereby, the inter-bit difference in the Hamming distance when the luminance difference is small between corresponding pixels is mainly reflected in the Hamming distance, and the inter-bit difference between the Hamming distances when the luminance difference is large between the corresponding pixels is the Hamming distance Less impact on.

例えば、図44は、着目画素と参照画素との間におけるビット間差異と輝度差に基づく重みとの関係の一例を示す。図44は、センサス変換の際に、8つの周辺画素が参照されるケースである。図44において、相違度算出部703は、拡大画像I1hを基準画像とし、拡大画像I2hを参照画像として処理を行う。相違度算出部703は、基準画像において、着目画素ctrの周囲の周辺画素の輝度値を、拡大画像I1hから取得する。周辺画素は、着目画素ctrのセンサス変換において参照される8つの画素である。さらに、相違度算出部703は、参照画像において、参照画素refの周囲の周辺画素の輝度値を、拡大画像I2hから取得する。参照画素refは、着目画素ctrとの間で相違度を算出する対象である探索範囲内の画素であり、参照画素refの周辺画素は、参照画素refのセンサス変換において参照される8つの画素である。   For example, FIG. 44 shows an example of the relationship between the inter-bit difference between the pixel of interest and the reference pixel and the weight based on the luminance difference. FIG. 44 shows the case where eight peripheral pixels are referred to during census conversion. In FIG. 44, the degree-of-difference calculating unit 703 performs processing using the enlarged image I1h as a reference image and the enlarged image I2h as a reference image. The degree-of-difference calculation unit 703 acquires, from the enlarged image I1h, the luminance values of peripheral pixels around the pixel of interest ctr in the reference image. The peripheral pixels are eight pixels referred to in the census conversion of the target pixel ctr. Furthermore, in the reference image, the degree-of-difference calculation unit 703 obtains, from the enlarged image I2h, luminance values of peripheral pixels around the reference pixel ref. The reference pixel ref is a pixel within a search range for which the degree of difference with the pixel of interest ctr is to be calculated, and the peripheral pixels of the reference pixel ref are eight pixels referred to in the census conversion of the reference pixel ref. is there.

相違度算出部703は、着目画素ctrの周辺画素の窓領域A1と、参照画素refの周辺画素の窓領域A2との間で、窓領域に対して同じ位置の周辺画素である対応周辺画素同士の輝度値の差異、つまり、輝度値の差の絶対値を算出する。さらに、相違度算出部703は、8組の対応周辺画素それぞれについて、輝度値の差異に基づく重みを算出する。本実施の形態では、相違度算出部703は、輝度値の差異の逆数を、重みとして算出する。なお、重みは、これに限定されず、輝度値の差異の逆数の2乗等、差異が大きい場合に小さく、差異が小さい場合に大きくなるものであればよい。例えば、相違度算出部703は、窓領域A1における輝度値「85」の周辺画素と、窓領域A2における輝度値「120」の周辺画素との間で、輝度値の差異に基づく重み「0.03」を算出する。相違度算出部703は、窓領域A1の8つの周辺画素それぞれについて、重みを算出する。   The degree-of-difference calculation unit 703 calculates corresponding peripheral pixels which are peripheral pixels at the same position with respect to the window area between the window area A1 of the peripheral pixel of the target pixel ctr and the window area A2 of the peripheral pixel of the reference pixel ref. The difference between the brightness values of (i.e., the absolute value of the difference between the brightness values) is calculated. Furthermore, the degree-of-difference calculation unit 703 calculates weights based on differences in luminance values for each of the eight sets of corresponding peripheral pixels. In the present embodiment, the degree-of-difference calculation unit 703 calculates the reciprocal of the difference in luminance value as a weight. The weight is not limited to this, and may be small as long as the difference is large, such as the square of the reciprocal of the difference in luminance value, and large as the difference is small. For example, the degree-of-difference calculation unit 703 determines that the weight “0 .. 6” is based on the difference in luminance value between the peripheral pixel of the luminance value “85” in the window region A1 and the peripheral pixel of the luminance value “120” in the window region A2. Calculate “03”. The degree-of-difference calculating unit 703 calculates weights for each of eight peripheral pixels in the window area A1.

さらに、相違度算出部703は、着目画素のセンサス特徴量と、参照画素のセンサス特徴量とから、センサス特徴量のビット列間のビット間差異を算出する。相違度算出部703は、窓領域A1内の各周辺画素における着目画素に対するセンサス変換値と、窓領域A2内の各周辺画素における参照画素に対するセンサス変換値とを比較し、窓領域に対して同じ位置の対応画素同士の間で、センサス変換値が同じであるか否かに基づく、ビット間差異を算出する。例えば、相違度算出部703は、窓領域A1における左上角のセンサス変換値「1」と、窓領域A2における左上角のセンサス変換値「0」との間で、ビット間差異「1」を算出する。相違度算出部703は、窓領域A1の8つの周辺画素それぞれについて、ビット間差異を算出する。   Further, the dissimilarity calculation unit 703 calculates the inter-bit difference between the bit strings of the census feature amount from the census feature amount of the target pixel and the census feature amount of the reference pixel. The degree-of-difference calculation unit 703 compares the census conversion value for the pixel of interest in each peripheral pixel in the window area A1 with the census conversion value for the reference pixel in each peripheral pixel in the window area A2, and makes the same for the window area. The inter-bit difference is calculated based on whether the census conversion value is the same between the corresponding pixels of the position. For example, the dissimilarity calculation unit 703 calculates the inter-bit difference “1” between the census converted value “1” of the upper left corner in the window area A1 and the census converted value “0” of the upper left corner in the window area A2. Do. The dissimilarity calculating unit 703 calculates inter-bit differences for each of the eight peripheral pixels in the window area A1.

さらに、相違度算出部703は、窓領域A1の周辺画素それぞれの重みと、窓領域A1の周辺画素それぞれのビット間差異とから、窓領域A1の周辺画素それぞれにおける重み付け後ビット間差異である重み付けビット間差異を算出する。相違度算出部703は、窓領域A1内の同一の周辺画素に対応する重みとビット間差異とを乗算することによって、重み付けビット間差異を算出する。例えば、相違度算出部703は、窓領域A1における左上角の周辺画素の重み「0.03」とビット間差異「1」とを乗算することによって、重み付けビット間差異「0.03」を算出する。   Furthermore, the dissimilarity calculation unit 703 determines the weighted after-weighting bit difference in each peripheral pixel of the window region A1 from the weight of each peripheral pixel in the window region A1 and the difference between the bits of each peripheral pixel in the window region A1. Calculate the inter-bit difference. The degree-of-difference calculating unit 703 calculates the difference between the weighting bits by multiplying the weight corresponding to the same peripheral pixel in the window area A1 by the difference between the bits. For example, the dissimilarity calculating unit 703 calculates the weighting bit difference “0.03” by multiplying the weight “0.03” of the peripheral pixels in the upper left corner of the window area A1 and the bit difference “1”. Do.

さらに、相違度算出部703は、着目画素ctrの各周辺画素の重み付けビット間差異の和を、着目画素ctrの相違度として算出する。図44の例では、相違度算出部703は、窓領域A1の各周辺画素の重み付けビット間差異の和「0.03+0.09+0.04=0.16」を、着目画素ctrの相違度として算出する。   Furthermore, the dissimilarity calculating unit 703 calculates the sum of the weighting bit difference of each of the peripheral pixels of the pixel of interest ctr as the difference of the pixel of interest ctr. In the example of FIG. 44, the dissimilarity calculating unit 703 calculates the sum “0.03 + 0.09 + 0.04 = 0.16” of the differences between the weighting bits of the respective peripheral pixels of the window region A1 as the dissimilarity of the pixel of interest ctr. Do.

視差選択部104は、着目画素に対して、参照画像における探索範囲内の参照画素それぞれとの間で、相違度算出部703によって算出された相違度のうちから、最小の相違度を抽出し、抽出した相違度に対応する視差値を、着目画素の視差値に決定する。   The disparity selection unit 104 extracts, for the pixel of interest, the smallest difference degree among the difference degrees calculated by the difference degree calculation unit 703 between each of the reference pixels within the search range in the reference image, The disparity value corresponding to the extracted degree of difference is determined as the disparity value of the pixel of interest.

上述のような実施の形態7に係る視差値算出装置700によれば、実施の形態1と同様の効果が得られる。また、視差値算出装置700は、基準画像の着目画素と参照画像の参照画素との相違度に対して、着目画素のセンサス変換で参照される周辺画素の輝度値と、参照画素のセンサス変換で参照される周辺画素の輝度値との差異に基づく重み付けを行う。この重み付けは、輝度値の差異が小さくなるほど大きくされ、輝度値の差異が大きくなるほど小さくされる。輝度値の差異が小さい相違度の構成要素は、相違度に重点的に反映され、輝度値の差異が大きい相違度の構成要素は、相違度に与える影響が小さい。このような重み付けは、例えば、着目画素に対する窓領域の配置が窓領域の中央のみであっても、窓領域の内部を空間的に重み付けすることができ、窓領域に対する重心位置を適応的に変更することができることを示す。つまり、着目画素に対して窓領域をあたかも適応的に動かしたのと同様の効果が得られる。これにより、相違度は、画素値の変化を反映することができる。よって、視差値算出装置700は、オクルージョンの境界又は視差値が変化する前景及び背景間の境界付近に位置する画素について、着目画素に対して単一の窓領域を用いるだけで、視差画像での視差値の差異による境界の位置と、被写体の輪郭の位置とを正確に整合させることができる。   According to the disparity value calculating device 700 according to the seventh embodiment as described above, the same effect as that of the first embodiment can be obtained. In addition, the disparity value calculating device 700 compares the degree of difference between the focused pixel of the reference image and the reference pixel of the reference image with the luminance value of the peripheral pixel referred to in the census conversion of the focused pixel and the census conversion of the reference pixel. Weighting is performed based on the difference from the luminance value of the peripheral pixel to be referred to. This weighting is increased as the difference in luminance value decreases, and reduced as the difference in luminance value increases. The component of the difference degree where the difference in luminance value is small is mainly reflected in the difference degree, and the component of the difference degree where the difference in luminance value is large has a small influence on the difference degree. Such weighting can, for example, spatially weight the inside of the window area even if the arrangement of the window area with respect to the target pixel is only the center of the window area, and adaptively change the barycentric position with respect to the window area Show what you can do. That is, the same effect as if the window area was moved adaptively with respect to the pixel of interest can be obtained. Thereby, the difference degree can reflect the change of the pixel value. Therefore, the parallax value calculation device 700 can use only a single window area for the pixel of interest for pixels located in the vicinity of the boundary between the boundary of the occlusion or the boundary between the foreground and the background where the parallax value changes. The position of the boundary due to the difference in parallax value and the position of the contour of the object can be accurately aligned.

なお、ビット間差異に対する重み付けは、着目画素及び参照画素の比較領域間の対応画素の輝度差に限らず、対応画素におけるそれぞれの輝度勾配の差であってもよく、さらに簡略化して、着目画素又は対応画素における輝度勾配であってもよい。さらに、上記重み付けは、対応画素間の輝度差と、対応画素における輝度勾配の差と、着目画素又は対応画素の輝度勾配との少なくとも2つを組み合わせたものあってもよい。ここで、上記重み付けは、上記の輝度差、輝度勾配の差、又は、着目画素若しくは対応画素における輝度勾配が大きいほど重くなり、小さいほど軽くなるように設定される。このような重み付けによっても、対応画素間の輝度差を用いた重み付けの場合と同様の効果を得ることができる。輝度勾配は、画像座標で、x軸方向の勾配であってもよく、y軸方向の勾配であってもよく、x軸方向及びy軸方向の勾配の両者を考慮した勾配であってもよく、その他の任意の方向の勾配であってもよい。   The weighting for the inter-bit difference is not limited to the luminance difference of the corresponding pixel between the comparison region of the target pixel and the reference pixel, but may be the difference of the respective luminance gradients in the corresponding pixel. Alternatively, it may be a brightness gradient at the corresponding pixel. Furthermore, the weighting may be a combination of at least two of the luminance difference between corresponding pixels, the difference in luminance gradient at the corresponding pixels, and the luminance gradient of the target pixel or the corresponding pixels. Here, the weighting is set to be heavier as the luminance difference, the luminance gradient difference, or the luminance gradient at the target pixel or the corresponding pixel is larger, and to be lighter as it is smaller. Such weighting can also achieve the same effect as the weighting using the luminance difference between corresponding pixels. The brightness gradient may be a gradient in the x-axis direction or a gradient in the y-axis direction in image coordinates, or may be a gradient considering both the gradient in the x-axis direction and the y-axis direction. It may be a gradient in any other direction.

上述のように、視差値算出装置700は、相違度が算出される基準画像の着目画素及び参照画像の参照画素について、着目画素の周囲の画素の輝度値と参照画素の周囲の画素の輝度値との差異、着目画素の周囲の画素の輝度勾配と参照画素の周囲の画素の輝度勾配との差異と、着目画素、参照画素又はその周囲の画素における輝度勾配とのうちの少なくとも一つに基づく重みを、相違度に付加してもよい。   As described above, the parallax value calculation device 700 calculates the luminance values of pixels around the pixel of interest and the luminance values of pixels around the reference pixel for the pixel of interest of the standard image for which the degree of difference is calculated and the reference pixel of the reference image. Based on at least one of the difference between the brightness gradient of the pixel around the pixel of interest and the brightness gradient of the pixel around the reference pixel and the brightness gradient of the pixel of interest, the reference pixel, or a pixel around it A weight may be added to the dissimilarity.

また、実施の形態7に係る視差値算出装置700は、実施の形態1に係る視差値算出装置100をベースする構成であったが、実施の形態2〜6及びその変形例をベースする構成であってもよい。   In addition, the parallax value calculation device 700 according to the seventh embodiment is configured based on the parallax value calculation device 100 according to the first embodiment, but the configuration is based on the second to sixth embodiments and the modification thereof. It may be.

例えば、実施の形態5をベースとする実施の形態7の変形例に係る視差値算出装置700aは、図45に示すような構成である。変形例に係る視差値算出装置700aにおいて、実施の形態7と同様に、相違度算出部703は、基準画像である拡大画像I1hの全ての画素に対して、重み付けされた相違度を算出する。   For example, a disparity value calculating device 700a according to a modification of the seventh embodiment based on the fifth embodiment has a configuration as shown in FIG. In the disparity value calculating device 700a according to the modified example, as in the seventh embodiment, the dissimilarity calculating unit 703 calculates weighted dissimilarities for all pixels of the enlarged image I1h that is a reference image.

コスト算出部512は、基準画像中の全ての画素を着目画素として、着目画素を通る複数の直線それぞれの上での視差値の分布に関する着目画素のコストを算出する。コスト算出部512は、各直線上の画素それぞれについて、相違度算出のための探索範囲内の視差値と、当該画素に隣接する画素の視差値との差異に基づき、探索範囲内の各視差値に対応する重み付けされた相違度を、さらに重み付けした値を、着目画素のコストとして算出する。コスト集約部513は、着目画素を通る複数の直線上の画素それぞれに対して算出されたコストを、探索範囲の視差値毎に加算する、つまり視差値毎のコストの和を算出することによって、着目画素のコストを集約する。視差選択部104は、着目画素に関して、探索範囲の視差値毎のコストの和のうちから、最小のコストの和を抽出し、最小のコストの和を与える視差値を特定し、特定した視差値を着目画素の視差値に決定する。さらに、視差選択部104は、基準画像の全ての画素を着目画素として、当該画素の視差値を決定し、視差画像を生成する。   The cost calculation unit 512 calculates the cost of the pixel of interest regarding the distribution of parallax values on each of a plurality of straight lines passing the pixel of interest, with all pixels in the reference image as the pixel of interest. The cost calculation unit 512 determines, for each pixel on each straight line, each parallax value within the search range based on the difference between the parallax value within the search range for calculating the degree of difference and the parallax value of the pixel adjacent to the pixel. Is calculated as the cost of the pixel of interest. The cost aggregation unit 513 adds the cost calculated for each of the pixels on the plurality of straight lines passing the pixel of interest for each parallax value in the search range, that is, calculates the sum of costs for each parallax value, Consolidate the cost of the pixel of interest. The disparity selection unit 104 extracts the sum of the minimum cost from the sum of the costs for each disparity value in the search range for the pixel of interest, identifies the disparity value giving the sum of the minimum cost, and identifies the identified disparity value Is determined as the parallax value of the pixel of interest. Furthermore, the parallax selection unit 104 determines the parallax value of the pixel with all the pixels of the reference image as the target pixel, and generates a parallax image.

なお、変形例に係る視差値算出装置700aは、重み付けを相違度に対して行うが、これに限る必要はなく、コスト計算時又はコスト集約時に同様の重み付けを各画素に対して行ってもよい。このような場合も、同様の効果を得ることができる。   In addition, although the parallax value calculation device 700a according to the modification performs weighting on the degree of difference, the present invention is not limited thereto, and the same weighting may be performed on each pixel at the time of cost calculation or cost consolidation. . Similar effects can be obtained in such a case as well.

具体的には、図34に示す着目画素I1hpのコストの場合、ペナルティ値P1及びP2の値が、着目画素及び対応画素間の輝度差、着目画素及び対応画素間の輝度勾配の差、又は、これらの組み合わせに応じて、重み付けされる。さらに簡略化して、ペナルティ値P1及びP2は、着目画素又は対応画素における輝度勾配に応じて、重み付けされてもよい。ここで、基準画像中の着目画素I1hpのx座標値をxbとすると、視差値0の場合、対応画素は、参照画像中において、xb−0=xbをx座標とする画素である。同様に、対応画素は、視差値−1の場合、参照画像中でxb−1をx座標とする画素であり、視差値−kの場合、参照画像中でxb−kをx座標とする画素である。ちなみに、参照画像中のいずれの対応画素のy座標も、基準画像中の着目画素I1hpのy座標と等しい。 Specifically, when the cost of the target pixel I1hp i shown in FIG. 34, the value of the penalty values P1 and P2, the luminance difference between the target pixel and the corresponding pixel, the difference in luminance gradient between the target pixel and the corresponding pixel, or , Are weighted according to these combinations. To further simplify, the penalty values P1 and P2 may be weighted according to the luminance gradient at the pixel of interest or the corresponding pixel. Here, when the x-coordinate value of the target pixel I1hp i in the reference image and xb, when the parallax value 0, the corresponding pixel is in a reference image, a pixel to be x coordinate xb-0 = xb. Similarly, the corresponding pixel is a pixel having xb-1 as the x coordinate in the reference image in the case of parallax value −1, and a pixel having xb−k as the x coordinate in the reference image in the case of parallax value −k. It is. Incidentally, the y-coordinate of any of the corresponding pixel in the reference image is also equal to the y coordinate of the pixel of interest I1hp i in the reference image.

なお、上記重み付けは、上記の輝度差、輝度勾配の差、又は、着目画素若しくは対応画素における輝度勾配が大きいほど重くなり、小さいほど軽くなるように設定される。輝度勾配は、画像座標で、x軸方向の勾配であってもよく、y軸方向の勾配であってもよく、x軸方向及びy軸方向の勾配の両者を考慮した勾配であってもよく、その他の任意の方向の勾配であってもよい。   The weighting is set to be heavier as the luminance difference, the luminance gradient difference, or the luminance gradient at the target pixel or the corresponding pixel is larger, and to be lighter as it is smaller. The brightness gradient may be a gradient in the x-axis direction or a gradient in the y-axis direction in image coordinates, or may be a gradient considering both the gradient in the x-axis direction and the y-axis direction. It may be a gradient in any other direction.

上述のように、視差値算出装置は、第1の評価画素としての着目画素I1hpとその対応画素の探索範囲内の画素との間における輝度値の差異、着目画素I1hpと上記探索範囲内の画素との間における輝度勾配の差異、並びに、着目画素I1hp又は上記探索範囲内の画素における輝度勾配のうちの少なくとも一つに基づく重みを、第1の評価値としてのペナルティ値に付加してもよい。 As described above, the disparity value calculating device determines whether the difference in luminance value between the pixel of interest I1hp i as the first evaluation pixel and the pixel within the search range of the corresponding pixel, the pixel of interest I1 hp i and the above search range the difference in brightness gradient between the pixels, as well, at least one the basis weight of the luminance gradient of the reference pixel in the target pixel I1hp i or the search range, is added to the penalty value as a first evaluation value May be

[その他]
以上、1つ又は複数の態様に係る視差値算出装置について、実施の形態及び変形例に基づいて説明したが、本開示は、これらの実施の形態及び変形例に限定されるものではない。本開示の趣旨を逸脱しない限り、当業者が思いつく各種変形を実施の形態及び変形例に施したものや、異なる実施の形態及び変形例における構成要素を組み合わせて構築される形態も、1つ又は複数の態様の範囲内に含まれてもよい。
[Others]
As mentioned above, although the parallax value calculation apparatus which concerns on one or several aspect was demonstrated based on embodiment and a modification, this indication is not limited to these embodiment and a modification. As long as it does not deviate from the spirit of the present disclosure, various modifications that those skilled in the art may think of are applied to the embodiment and the modifications, and an embodiment configured by combining components in different embodiments and modifications is also one or It may be included within the scope of a plurality of aspects.

実施の形態及び変形例に係る視差値算出装置は、2つのカメラ11a及び11bの撮像画像間の視差値を算出したが、これに限定されない。視差値算出装置は、3つ以上のカメラの撮像画像間の視差値を算出してもよい。この場合、視差値算出装置は、3つ以上のカメラのうちの2つのカメラによるペア毎に、当該ペアの2つの撮像画像間の視差値を算出してもよい。   Although the parallax value calculation device according to the embodiment and the modification calculates the parallax value between the images captured by the two cameras 11a and 11b, the present invention is not limited to this. The disparity value calculating device may calculate disparity values between captured images of three or more cameras. In this case, the parallax value calculation device may calculate, for each pair of two or more cameras among two or more cameras, the parallax value between the two captured images of the pair.

また、上述したように、本開示の技術は、システム、装置、方法、集積回路、コンピュータプログラム又はコンピュータ読取可能な記録ディスク等の記録媒体で実現されてもよく、システム、装置、方法、集積回路、コンピュータプログラム及び記録媒体の任意な組み合わせで実現されてもよい。コンピュータ読み取り可能な記録媒体は、例えばCD−ROM等の不揮発性の記録媒体を含む。   Further, as described above, the technology of the present disclosure may be realized by a recording medium such as a system, an apparatus, a method, an integrated circuit, a computer program, or a computer readable recording disk, and the system, an apparatus, a method, an integrated circuit. , And may be realized by any combination of computer program and recording medium. The computer readable recording medium includes, for example, a non-volatile recording medium such as a CD-ROM.

例えば、上記実施の形態及び変形例に係る視差値算出装置に含まれる各処理部は典型的には集積回路であるLSI(Large Scale Integration:大規模集積回路)として実現される。これらは個別に1チップ化されてもよいし、一部又は全てを含むように1チップ化されてもよい。   For example, each processing unit included in the disparity value calculating device according to the above-described embodiment and modification is typically realized as an LSI (Large Scale Integration: large scale integrated circuit) which is an integrated circuit. These may be individually made into one chip, or may be made into one chip so as to include some or all.

また、集積回路化はLSIに限るものではなく、専用回路又は汎用プロセッサで実現してもよい。LSI製造後にプログラムすることが可能なFPGA(Field Programmable Gate Array)、又はLSI内部の回路セルの接続や設定を再構成可能なリコンフィギュラブル・プロセッサを利用してもよい。   Further, the circuit integration is not limited to LSI's, and implementation using dedicated circuitry or general purpose processors is also possible. A field programmable gate array (FPGA) that can be programmed after LSI fabrication, or a reconfigurable processor that can reconfigure connection and setting of circuit cells inside the LSI may be used.

なお、上記実施の形態及び変形例において、各構成要素は、専用のハードウェアで構成されるか、各構成要素に適したソフトウェアプログラムを実行することによって実現されてもよい。各構成要素は、CPUなどのプロセッサ等のプログラム実行部が、ハードディスク又は半導体メモリ等の記録媒体に記録されたソフトウェアプログラムを読み出して実行することによって実現されてもよい。   In the above embodiment and modification, each component may be configured by dedicated hardware or implemented by executing a software program suitable for each component. Each component may be realized by a program execution unit such as a processor such as a CPU reading and executing a software program recorded on a recording medium such as a hard disk or a semiconductor memory.

また、上記構成要素の一部又は全部は、脱着可能なIC(Integrated Circuit)カード又は単体のモジュールから構成されてもよい。ICカード又はモジュールは、マイクロプロセッサ、ROM、RAM等から構成されるコンピュータシステムである。ICカード又はモジュールは、上記のLSI又はシステムLSIを含むとしてもよい。マイクロプロセッサが、コンピュータプログラムにしたがって動作することにより、ICカード又はモジュールは、その機能を達成する。これらICカード及びモジュールは、耐タンパ性を有するとしてもよい。   In addition, part or all of the above components may be composed of a removable integrated circuit (IC) card or a single module. The IC card or module is a computer system including a microprocessor, a ROM, a RAM, and the like. The IC card or module may include the above LSI or system LSI. The IC card or module achieves its function by the microprocessor operating according to the computer program. These IC cards and modules may be tamper resistant.

本開示の視差値算出方法は、MPU(Micro Processing Unit)及びCPU等のプロセッサ、LSI等の回路、ICカード又は単体のモジュール等によって、実現されてもよい。   The parallax value calculation method of the present disclosure may be realized by a processor such as a micro processing unit (MPU) and a CPU, a circuit such as an LSI, an IC card, or a single module.

さらに、本開示の技術は、ソフトウェアプログラム又はソフトウェアプログラムからなるデジタル信号によって実現されてもよく、プログラムが記録された非一時的なコンピュータ読み取り可能な記録媒体であってもよい。また、上記プログラムは、インターネット等の伝送媒体を介して流通させることができるのは言うまでもない。   Furthermore, the technology of the present disclosure may be realized by a software program or a digital signal consisting of a software program, and may be a non-transitory computer readable recording medium in which the program is recorded. Further, it goes without saying that the program can be distributed via a transmission medium such as the Internet.

また、上記で用いた序数、数量等の数字は全て、本開示の技術を具体的に説明するために例示するものであり、本開示は例示された数字に制限されない。また、構成要素間の接続関係は、本開示の技術を具体的に説明するために例示するものであり、本開示の機能を実現する接続関係はこれに限定されない。   In addition, all numbers such as ordinal numbers and quantities used above are illustrated to specifically describe the technology of the present disclosure, and the present disclosure is not limited to the illustrated numbers. Also, the connection relationship between components is illustrated to specifically describe the technology of the present disclosure, and the connection relationship that implements the function of the present disclosure is not limited thereto.

また、ブロック図における機能ブロックの分割は一例であり、複数の機能ブロックを1つの機能ブロックとして実現したり、1つの機能ブロックを複数に分割したり、一部の機能を他の機能ブロックに移してもよい。また、類似する機能を有する複数の機能ブロックの機能を単一のハードウェア又はソフトウェアが並列又は時分割に処理してもよい。   Also, division of functional blocks in the block diagram is an example, and a plurality of functional blocks may be realized as one functional block, one functional block may be divided into a plurality, or some functions may be transferred to another functional block. May be Also, a single piece of hardware or software may process the functions of a plurality of functional blocks having similar functions in parallel or in time division.

本開示の技術は、カメラの撮像画像間のサブピクセル精度の視差値を算出する技術に有用である。本開示の技術は、車両、船舶、飛行体又はロボットなどに搭載されるカメラを用いた距離センサ等の、カメラの撮像画像間の視差値を用いるいかなる技術にも有用である。   The technique of the present disclosure is useful for a technique of calculating disparity values of subpixel accuracy between captured images of a camera. The technology of the present disclosure is useful for any technology that uses a parallax value between captured images of a camera, such as a distance sensor using a camera mounted on a vehicle, a ship, an aircraft, a robot or the like.

20 記憶部(メモリ)
100,200,300,300a,400,400a,500,500a,500b,500c,500d,600,600a,700,700a 視差値算出装置
101 水平拡大部
102,602 センサス変換部
103,603,703 相違度算出部
104,604 視差選択部
105,205 水平縮小部
204a 第一視差選択部
204b 第二視差選択部
206 L/Rチェック部
307 縮小部
308 拡大部
309 終了判断部
410 異方性縮小部
411 異方性拡大部
512 コスト算出部
513 コスト集約部
20 storage unit (memory)
100, 200, 300, 300a, 400, 400a, 500, 500a, 500b, 500c, 500d, 600, 600a, 700, 700a Parallax value calculation device 101 Horizontal enlargement unit 102, 602 Census conversion unit 103, 603, 703 Degree of difference Calculation unit 104, 604 Parallax selection unit 105, 205 Horizontal reduction unit 204a First parallax selection unit 204b Second parallax selection unit 206 L / R check unit 307 Reduction unit 308 Enlargement unit 309 End determination unit 410 Anisotropy reduction unit 411 Directionality expansion unit 512 Cost calculation unit 513 Cost consolidation unit

Claims (11)

プロセッサとメモリとを備え、
前記プロセッサは、
(a)第1の位置に配置された第1のカメラで撮像された第1の画像と、第2の位置に配置された第2のカメラで撮像された第2の画像とを前記メモリから取得し、
(b)前記第1の画像に対して、予め定められた視差方向への拡大処理により、前記第1の画像の画素の数を増やすことによって、複数の第1の画素を含む第1の拡大画像を生成し、前記第2の画像に対して、予め定められた視差方向への拡大処理により、前記第2の画像の画素の数を増やすことによって、複数の第2の画素を含む第2の拡大画像を生成し、
(c)前記第1の拡大画像において、前記複数の第1の画素毎に、周囲の画素との画素値の比較により、第1のセンサス特徴量を算出し、前記第2の拡大画像において、前記複数の第2の画素毎に、周囲の画素との画素値の比較により、第2のセンサス特徴量を算出し、
(d)前記複数の第1の画素それぞれについて、前記第1のセンサス特徴量と、少なくとも1つの前記第2の画素の前記第2のセンサス特徴量とを用いて、前記少なくとも1つの第2の画素それぞれの位置での前記第1の画素に対する視差値に対応する相違度を算出し、
(e)前記複数の第1の画素それぞれについて、前記相違度を用いて、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得し、
(f)前記視差画像の画素毎の視差値に対して、縮小処理をすることにより、前記第2の画像に対する前記第1の画像の画素毎の視差値を算出する
視差値算出装置。
Processor and memory,
The processor is
(A) From the memory, a first image taken by a first camera disposed at a first position and a second image taken by a second camera disposed at a second position Acquired,
(B) A first enlargement including a plurality of first pixels by increasing the number of pixels of the first image by enlarging the first image in a predetermined parallax direction. A second image including a plurality of second pixels by generating an image and enlarging the number of pixels of the second image by performing enlargement processing in a predetermined parallax direction on the second image; Generate a magnified image of the
(C) In the first enlarged image, a first census feature value is calculated for each of the plurality of first pixels by comparing pixel values with surrounding pixels, and in the second enlarged image, A second census feature value is calculated for each of the plurality of second pixels by comparing pixel values with surrounding pixels.
(D) For each of the plurality of first pixels, using the first census feature amount and the second census feature amount of at least one second pixel, the at least one second census feature amount Calculating a degree of difference corresponding to the parallax value with respect to the first pixel at each pixel position;
(E) For each of the plurality of first pixels, by selecting the parallax value corresponding to the smallest degree of difference using the degree of difference, each pixel in the parallax image corresponding to the first enlarged image Get the disparity value,
(F) A parallax value calculation device that calculates a parallax value for each pixel of the first image with respect to the second image by performing reduction processing on the parallax value for each pixel of the parallax image.
前記プロセッサは、前記第1のセンサス特徴量と前記第2のセンサス特徴量との間のハミング距離を、前記相違度として算出する
請求項1に記載の視差値算出装置。
The parallax value calculation device according to claim 1, wherein the processor calculates a Hamming distance between the first census feature amount and the second census feature amount as the degree of difference.
前記プロセッサは、
処理(d)と処理(e)の間において、
(g)前記第1の拡大画像において、視差値の算出対象の前記第1の画素である着目画素から、所定の方向に位置する前記第1の画素である評価画素それぞれについて、
前記評価画素のうち、第1の評価画素に前記所定の方向で隣り合う第2の評価画素の視差値と、前記第2の拡大画像における前記第1の評価画素に対応する位置の対応画素に対する、相違度算出のための探索範囲内の前記第2の画素それぞれの視差値との比較に基づき、前記探索範囲内の前記第2の画素それぞれの第1の評価値を算出し、
前記第1の評価画素と前記探索範囲内の前記第2の画素それぞれとの間の相違度と、前記探索範囲内の前記第2の画素それぞれの第1の評価値とに基づき、前記探索範囲内の前記第2の画素それぞれの視差値についての第2の評価値を算出し、
前記探索範囲内の前記第2の画素それぞれの視差値に対応する全ての前記評価画素の前記第2の評価値を加算して、加算評価値を算出し、
処理(e)において、最小の前記加算評価値に対応する前記視差値を前記着目画素の視差値に決定する
請求項1または2に記載の視差値算出装置。
The processor is
Between the treatment (d) and the treatment (e)
(G) In the first enlarged image, from the pixel of interest, which is the first pixel for which the parallax value is calculated, for each of the evaluation pixels, which are the first pixels positioned in a predetermined direction,
Among the evaluation pixels, the parallax value of the second evaluation pixel adjacent to the first evaluation pixel in the predetermined direction, and the corresponding pixel at the position corresponding to the first evaluation pixel in the second enlarged image The first evaluation value of each of the second pixels in the search range is calculated based on comparison with the parallax value of each of the second pixels in the search range for calculating the degree of difference,
The search range based on the degree of difference between the first evaluation pixel and each of the second pixels in the search range, and the first evaluation value of each of the second pixels in the search range. Calculating a second evaluation value for the parallax value of each of the second pixels in
The second evaluation value of all the evaluation pixels corresponding to the parallax value of each of the second pixels in the search range is added to calculate an addition evaluation value.
The parallax value calculation device according to claim 1, wherein in the processing (e), the parallax value corresponding to the minimum addition evaluation value is determined as the parallax value of the target pixel.
前記プロセッサは、
処理(c)において、対象画素のセンサス特徴量を算出する際に比較する周囲の画素の領域である比較領域として、前記対象画素を含み且つ前記対象画素に対する位置が異なる複数の前記比較領域を決定し、
前記比較領域それぞれについて、前記複数の第1の画素の前記第1のセンサス特徴量と、前記複数の第2の画素の前記第2のセンサス特徴量とを算出し、
処理(d)において、前記比較領域それぞれについて、前記相違度を算出し、
処理(e)において、全ての前記比較領域の前記相違度のうち、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得する
請求項1〜3のいずれか一項に記載の視差値算出装置。
The processor is
In the processing (c), a plurality of comparison areas including the object pixel and having different positions with respect to the object pixel are determined as comparison areas that are areas of surrounding pixels to be compared when calculating the census feature of the object pixel. And
Calculating, for each of the comparison regions, the first census feature of the plurality of first pixels and the second census feature of the plurality of second pixels;
In the processing (d), the degree of difference is calculated for each of the comparison regions,
In the process (e), the parallax value for each pixel in the parallax image corresponding to the first enlarged image is selected by selecting the parallax value corresponding to the smallest difference degree among the difference degrees of all the comparison areas. The parallax value calculation apparatus as described in any one of Claims 1-3.
前記プロセッサは、
処理(d)において、前記相違度が算出される前記第1の画素及び前記第2の画素について、前記第1の画素の前記周囲の画素の画素値である輝度値と前記第2の画素の前記周囲の画素の画素値である輝度値との差異と、前記第1の画素の前記周囲の画素の輝度勾配と前記第2の画素の前記周囲の画素の輝度勾配との差異との少なくとも一方に基づく重みを、前記相違度に付加する
請求項1〜4のいずれか一項に記載の視差値算出装置。
The processor is
In the processing (d), with respect to the first pixel and the second pixel for which the degree of difference is calculated, a luminance value which is a pixel value of the pixel around the first pixel and a value of the second pixel At least one of a difference from a luminance value which is a pixel value of the peripheral pixel, and a difference between a luminance gradient of the peripheral pixel of the first pixel and a luminance gradient of the peripheral pixel of the second pixel The disparity value calculating device according to any one of claims 1 to 4, wherein a weight based on is added to the degree of difference.
(a)第1の位置に配置された第1のカメラで撮像される第1の画像と、第2の位置に配置された第2のカメラで撮像される第2の画像とを取得し、
(b)前記第1の画像に対して、予め定められた視差方向への拡大処理により、前記第1の画像の画素の数を増やすことによって、複数の第1の画素を含む第1の拡大画像を生成し、前記第2の画像に対して、予め定められた視差方向への拡大処理により、前記第2の画像の画素の数を増やすことによって、複数の第2の画素を含む第2の拡大画像を生成し、
(c)前記第1の拡大画像において、前記複数の第1の画素毎に、周囲の画素との画素値の比較により、第1のセンサス特徴量を算出し、前記第2の拡大画像において、前記複数の第2の画素毎に、周囲の画素との画素値の比較により、第2のセンサス特徴量を算出し、
(d)前記複数の第1の画素それぞれについて、前記第1のセンサス特徴量と、少なくとも1つの前記第2の画素の前記第2のセンサス特徴量とを用いて、前記少なくとも1つの第2の画素それぞれの位置での前記第1の画素に対する視差値に対応する相違度を算出し、
(e)前記複数の第1の画素それぞれについて、前記相違度を用いて、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得し、
(f)前記視差画像の画素毎の視差値に対して、縮小処理をすることにより、前記第2の画像に対する前記第1の画像の画素毎の視差値を算出し、
処理(a)〜処理(f)の少なくとも1つは、少なくとも1つのプロセッサによって実行される
視差値算出方法。
(A) acquiring a first image captured by a first camera disposed at a first position, and a second image captured by a second camera disposed at a second position;
(B) A first enlargement including a plurality of first pixels by increasing the number of pixels of the first image by enlarging the first image in a predetermined parallax direction. A second image including a plurality of second pixels by generating an image and enlarging the number of pixels of the second image by performing enlargement processing in a predetermined parallax direction on the second image; Generate a magnified image of the
(C) In the first enlarged image, a first census feature value is calculated for each of the plurality of first pixels by comparing pixel values with surrounding pixels, and in the second enlarged image, A second census feature value is calculated for each of the plurality of second pixels by comparing pixel values with surrounding pixels.
(D) For each of the plurality of first pixels, using the first census feature amount and the second census feature amount of at least one second pixel, the at least one second census feature amount Calculating a degree of difference corresponding to the parallax value with respect to the first pixel at each pixel position;
(E) For each of the plurality of first pixels, by selecting the parallax value corresponding to the smallest degree of difference using the degree of difference, each pixel in the parallax image corresponding to the first enlarged image Get the disparity value,
(F) A parallax value for each pixel of the first image with respect to the second image is calculated by performing a reduction process on the parallax value for each pixel of the parallax image;
At least one of the processing (a) to the processing (f) is executed by at least one processor.
前記第1のセンサス特徴量と前記第2のセンサス特徴量との間のハミング距離を、前記相違度として算出する
請求項6に記載の視差値算出方法。
The parallax value calculation method according to claim 6, wherein a Hamming distance between the first census feature amount and the second census feature amount is calculated as the degree of difference.
処理(d)と処理(e)の間において、
(g)前記第1の拡大画像において、視差値の算出対象の前記第1の画素である着目画素から、所定の方向に位置する前記第1の画素である評価画素それぞれについて、
前記評価画素のうち、第1の評価画素に前記所定の方向で隣り合う第2の評価画素の視差値と、前記第2の拡大画像における前記第1の評価画素に対応する位置の対応画素に対する、相違度算出のための探索範囲内の前記第2の画素それぞれの視差値との比較に基づき、前記探索範囲内の前記第2の画素それぞれの第1の評価値を算出し、
前記第1の評価画素と前記探索範囲内の前記第2の画素それぞれとの間の相違度と、前記探索範囲内の前記第2の画素それぞれの第1の評価値とに基づき、前記探索範囲内の前記第2の画素それぞれの視差値についての第2の評価値を算出し、
前記探索範囲内の前記第2の画素それぞれの視差値に対応する全ての前記評価画素の前記第2の評価値を加算して、加算評価値を算出し、
処理(e)において、最小の前記加算評価値に対応する前記視差値を前記着目画素の視差値に決定する
請求項6または7に記載の視差値算出方法。
Between the treatment (d) and the treatment (e)
(G) In the first enlarged image, from the pixel of interest, which is the first pixel for which the parallax value is calculated, for each of the evaluation pixels, which are the first pixels positioned in a predetermined direction,
Among the evaluation pixels, the parallax value of the second evaluation pixel adjacent to the first evaluation pixel in the predetermined direction, and the corresponding pixel at the position corresponding to the first evaluation pixel in the second enlarged image The first evaluation value of each of the second pixels in the search range is calculated based on comparison with the parallax value of each of the second pixels in the search range for calculating the degree of difference,
The search range based on the degree of difference between the first evaluation pixel and each of the second pixels in the search range, and the first evaluation value of each of the second pixels in the search range. Calculating a second evaluation value for the parallax value of each of the second pixels in
The second evaluation value of all the evaluation pixels corresponding to the parallax value of each of the second pixels in the search range is added to calculate an addition evaluation value.
The parallax value calculation method according to claim 6, wherein in the processing (e), the parallax value corresponding to the minimum addition evaluation value is determined as the parallax value of the target pixel.
処理(c)において、対象画素のセンサス特徴量を算出する際に比較する周囲の画素の領域である比較領域として、前記対象画素を含み且つ前記対象画素に対する位置が異なる複数の前記比較領域を決定し、
前記比較領域それぞれについて、前記複数の第1の画素の前記第1のセンサス特徴量と、前記複数の第2の画素の前記第2のセンサス特徴量とを算出し、
処理(d)において、前記比較領域それぞれについて、前記相違度を算出し、
処理(e)において、全ての前記比較領域の前記相違度のうち、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得する
請求項6〜8のいずれか一項に記載の視差値算出方法。
In the processing (c), a plurality of comparison areas including the object pixel and having different positions with respect to the object pixel are determined as comparison areas that are areas of surrounding pixels to be compared when calculating the census feature of the object pixel. And
Calculating, for each of the comparison regions, the first census feature of the plurality of first pixels and the second census feature of the plurality of second pixels;
In the processing (d), the degree of difference is calculated for each of the comparison regions,
In the process (e), the parallax value for each pixel in the parallax image corresponding to the first enlarged image is selected by selecting the parallax value corresponding to the smallest difference degree among the difference degrees of all the comparison areas. The parallax value calculation method according to any one of claims 6 to 8.
処理(d)において、前記相違度が算出される前記第1の画素及び前記第2の画素について、前記第1の画素の前記周囲の画素の画素値である輝度値と前記第2の画素の前記周囲の画素の画素値である輝度値との差異と、前記第1の画素の前記周囲の画素の輝度勾配と前記第2の画素の前記周囲の画素の輝度勾配との差異との少なくとも一方に基づく重みを、前記相違度に付加する
請求項6〜9のいずれか一項に記載の視差値算出方法。
In the processing (d), with respect to the first pixel and the second pixel for which the degree of difference is calculated, a luminance value which is a pixel value of the pixel around the first pixel and a value of the second pixel At least one of a difference from a luminance value which is a pixel value of the peripheral pixel, and a difference between a luminance gradient of the peripheral pixel of the first pixel and a luminance gradient of the peripheral pixel of the second pixel The disparity value calculation method according to any one of claims 6 to 9, wherein a weight based on is added to the degree of difference.
(a)第1の位置に配置された第1のカメラで撮像された第1の画像と、第2の位置に配置された第2のカメラで撮像された第2の画像とを取得し、
(b)前記第1の画像に対して、予め定められた視差方向への拡大処理により、前記第1の画像の画素の数を増やすことによって、複数の第1の画素を含む第1の拡大画像を生成し、前記第2の画像に対して、予め定められた視差方向への拡大処理により、前記第2の画像の画素の数を増やすことによって、複数の第2の画素を含む第2の拡大画像を生成し、
(c)前記第1の拡大画像において、前記複数の第1の画素毎に、周囲の画素との画素値の比較により、第1のセンサス特徴量を算出し、前記第2の拡大画像において、前記複数の第2の画素毎に、周囲の画素との画素値の比較により、第2のセンサス特徴量を算出し、
(d)前記複数の第1の画素それぞれについて、前記第1のセンサス特徴量と、少なくとも1つの前記第2の画素の前記第2のセンサス特徴量とを用いて、前記少なくとも1つの第2の画素それぞれの位置での前記第1の画素に対する視差値に対応する相違度を算出し、
(e)前記複数の第1の画素それぞれについて、前記相違度を用いて、最も小さい相違度に対応する視差値を選択することにより、前記第1の拡大画像に対応する視差画像における画素毎の視差値を取得し、
(f)前記視差画像の画素毎の視差値に対して、縮小処理をすることにより、前記第2の画像に対する前記第1の画像の画素毎の視差値を算出する
ことを、コンピュータに実行させるプログラム。
(A) acquiring a first image captured by a first camera disposed at a first position, and a second image captured by a second camera disposed at a second position,
(B) A first enlargement including a plurality of first pixels by increasing the number of pixels of the first image by enlarging the first image in a predetermined parallax direction. A second image including a plurality of second pixels by generating an image and enlarging the number of pixels of the second image by performing enlargement processing in a predetermined parallax direction on the second image; Generate a magnified image of the
(C) In the first enlarged image, a first census feature value is calculated for each of the plurality of first pixels by comparing pixel values with surrounding pixels, and in the second enlarged image, A second census feature value is calculated for each of the plurality of second pixels by comparing pixel values with surrounding pixels.
(D) For each of the plurality of first pixels, using the first census feature amount and the second census feature amount of at least one second pixel, the at least one second census feature amount Calculating a degree of difference corresponding to the parallax value with respect to the first pixel at each pixel position;
(E) For each of the plurality of first pixels, by selecting the parallax value corresponding to the smallest degree of difference using the degree of difference, each pixel in the parallax image corresponding to the first enlarged image Get the disparity value,
(F) A computer is executed to calculate a parallax value for each pixel of the first image with respect to the second image by performing reduction processing on the parallax value for each pixel of the parallax image. program.
JP2018000877A 2018-01-05 2018-01-05 Parallax value calculation device, parallax value calculation method and program Pending JP2019120590A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018000877A JP2019120590A (en) 2018-01-05 2018-01-05 Parallax value calculation device, parallax value calculation method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018000877A JP2019120590A (en) 2018-01-05 2018-01-05 Parallax value calculation device, parallax value calculation method and program

Publications (1)

Publication Number Publication Date
JP2019120590A true JP2019120590A (en) 2019-07-22

Family

ID=67307252

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018000877A Pending JP2019120590A (en) 2018-01-05 2018-01-05 Parallax value calculation device, parallax value calculation method and program

Country Status (1)

Country Link
JP (1) JP2019120590A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112802079A (en) * 2021-01-19 2021-05-14 奥比中光科技集团股份有限公司 Disparity map acquisition method, device, terminal and storage medium
CN113763269A (en) * 2021-08-30 2021-12-07 上海工程技术大学 Stereo matching method for binocular images
JP7408337B2 (en) 2019-10-10 2024-01-05 キヤノン株式会社 Image processing method and image processing device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7408337B2 (en) 2019-10-10 2024-01-05 キヤノン株式会社 Image processing method and image processing device
CN112802079A (en) * 2021-01-19 2021-05-14 奥比中光科技集团股份有限公司 Disparity map acquisition method, device, terminal and storage medium
CN113763269A (en) * 2021-08-30 2021-12-07 上海工程技术大学 Stereo matching method for binocular images
CN113763269B (en) * 2021-08-30 2023-11-24 上海工程技术大学 Stereo matching method for binocular images

Similar Documents

Publication Publication Date Title
JP6986683B2 (en) Parallax value calculation device, parallax value calculation method and program
US10944960B2 (en) Free-viewpoint video generating method and free-viewpoint video generating system
Jeon et al. Accurate depth map estimation from a lenslet light field camera
JP7282317B2 (en) Three-dimensional measurement system and three-dimensional measurement method
JP7043085B2 (en) Devices and methods for acquiring distance information from a viewpoint
US8452081B2 (en) Forming 3D models using multiple images
US8447099B2 (en) Forming 3D models using two images
TWI520078B (en) Optical flow tracking method and device
JP7105246B2 (en) Reconstruction method and reconstruction device
JP7058277B2 (en) Reconstruction method and reconfiguration device
JP5955028B2 (en) Image processing apparatus, image processing method, and image processing program
US20210044787A1 (en) Three-dimensional reconstruction method, three-dimensional reconstruction device, and computer
US20140340486A1 (en) Image processing system, image processing method, and image processing program
JP6655379B2 (en) Method and apparatus for generating an adaptive slice image from a focus stack
KR102407137B1 (en) Method and apparatus for image processing
JP4701848B2 (en) Image matching apparatus, image matching method, and image matching program
JP2019120590A (en) Parallax value calculation device, parallax value calculation method and program
JPWO2018147059A1 (en) Image processing apparatus, image processing method, and program
JP6285686B2 (en) Parallax image generation device
JP6494402B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP2009186287A (en) Plane parameter estimating device, plane parameter estimating method, and plane parameter estimating program
JP7312026B2 (en) Image processing device, image processing method and program
WO2018133027A1 (en) Grayscale constraint-based method and apparatus for integer-pixel search for three-dimensional digital speckle pattern
JP6671589B2 (en) Three-dimensional measurement system, three-dimensional measurement method, and three-dimensional measurement program
JP2017199285A (en) Information processor, information processing method, program